Thrill  0.1
VVector< Type > Class Template Reference

Detailed Description

template<typename Type = double>
class thrill::common::VVector< Type >

A variable-length D-dimensional point with double precision.

Definition at line 123 of file vector.hpp.

#include <vector.hpp>

Public Types

using type = Type
 
using TypeVector = std::vector< Type >
 

Public Member Functions

 VVector (size_t D=0)
 
 VVector (TypeVector &&v)
 
size_t dim () const
 
Type Distance (const VVector &b) const
 
Type DistanceSquare (const VVector &b) const
 
Type dot (const VVector &b) const
 
VVector fill (const Type init_val)
 
Type Norm () const
 
VVector operator+ (const VVector &b) const
 
VVectoroperator+= (const VVector &b)
 
VVector operator- (const VVector &b) const
 
VVector operator/ (const Type &s) const
 
VVectoroperator/= (const Type &s)
 
template<typename Archive >
void serialize (Archive &archive)
 serialization method for cereal. More...
 
size_t size () const
 

Static Public Member Functions

static VVector Make (size_t D)
 
template<typename Distribution , typename Generator >
static VVector Random (size_t D, Distribution &dist, Generator &gen)
 

Public Attributes

TypeVector x
 coordinates array More...
 

Friends

std::ostream & operator<< (std::ostream &os, const VVector &a)
 

Member Typedef Documentation

◆ type

using type = Type

Definition at line 128 of file vector.hpp.

◆ TypeVector

using TypeVector = std::vector<Type>

Definition at line 126 of file vector.hpp.

Constructor & Destructor Documentation

◆ VVector() [1/2]

VVector ( size_t  D = 0)
inlineexplicit

Definition at line 133 of file vector.hpp.

◆ VVector() [2/2]

VVector ( TypeVector &&  v)
inlineexplicit

Definition at line 134 of file vector.hpp.

Member Function Documentation

◆ dim()

size_t dim ( ) const
inline

Definition at line 136 of file vector.hpp.

◆ Distance()

Type Distance ( const VVector< Type > &  b) const
inline

Definition at line 159 of file vector.hpp.

References Vector< D, Type >::DistanceSquare().

◆ DistanceSquare()

Type DistanceSquare ( const VVector< Type > &  b) const
inline

Definition at line 152 of file vector.hpp.

References VVector< Type >::x.

◆ dot()

Type dot ( const VVector< Type > &  b) const
inline

Definition at line 193 of file vector.hpp.

References VVector< Type >::x.

◆ fill()

VVector fill ( const Type  init_val)
inline

Definition at line 142 of file vector.hpp.

◆ Make()

static VVector Make ( size_t  D)
inlinestatic

Definition at line 139 of file vector.hpp.

◆ Norm()

Type Norm ( ) const
inline

Definition at line 162 of file vector.hpp.

◆ operator+()

VVector operator+ ( const VVector< Type > &  b) const
inline

Definition at line 167 of file vector.hpp.

References VVector< Type >::x.

◆ operator+=()

VVector& operator+= ( const VVector< Type > &  b)
inline

Definition at line 173 of file vector.hpp.

References VVector< Type >::x.

◆ operator-()

VVector operator- ( const VVector< Type > &  b) const
inline

Definition at line 178 of file vector.hpp.

References VVector< Type >::x.

◆ operator/()

VVector operator/ ( const Type &  s) const
inline

Definition at line 184 of file vector.hpp.

References VVector< Type >::x.

◆ operator/=()

VVector& operator/= ( const Type &  s)
inline

Definition at line 189 of file vector.hpp.

◆ Random()

static VVector Random ( size_t  D,
Distribution &  dist,
Generator &  gen 
)
inlinestatic

Definition at line 147 of file vector.hpp.

References gen_data::D, and VVector< Type >::x.

◆ serialize()

void serialize ( Archive &  archive)
inline

serialization method for cereal.

Definition at line 206 of file vector.hpp.

◆ size()

size_t size ( ) const
inline

Definition at line 137 of file vector.hpp.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const VVector< Type > &  a 
)
friend

Definition at line 198 of file vector.hpp.

Member Data Documentation

◆ x


The documentation for this class was generated from the following file: