Thrill  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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

using type = Type

Definition at line 128 of file vector.hpp.

using TypeVector = std::vector<Type>

Definition at line 126 of file vector.hpp.

Constructor & Destructor Documentation

VVector ( size_t  D = 0)
inlineexplicit

Definition at line 133 of file vector.hpp.

Referenced by VVector< Type >::Make().

VVector ( TypeVector &&  v)
inlineexplicit

Definition at line 134 of file vector.hpp.

Member Function Documentation

size_t dim ( ) const
inline

Definition at line 136 of file vector.hpp.

References VVector< Type >::x.

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

Definition at line 159 of file vector.hpp.

References VVector< Type >::DistanceSquare().

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

Definition at line 152 of file vector.hpp.

References VVector< Type >::x.

Referenced by VVector< Type >::Distance().

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

Definition at line 193 of file vector.hpp.

References VVector< Type >::x.

VVector fill ( const Type  init_val)
inline

Definition at line 142 of file vector.hpp.

References VVector< Type >::x.

static VVector Make ( size_t  D)
inlinestatic

Definition at line 139 of file vector.hpp.

References VVector< Type >::VVector().

Type Norm ( ) const
inline

Definition at line 162 of file vector.hpp.

References VVector< Type >::x.

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

Definition at line 167 of file vector.hpp.

References VVector< Type >::x.

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

Definition at line 173 of file vector.hpp.

References VVector< Type >::x.

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

Definition at line 178 of file vector.hpp.

References VVector< Type >::x.

VVector operator/ ( const Type &  s) const
inline

Definition at line 184 of file vector.hpp.

References VVector< Type >::x.

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

Definition at line 189 of file vector.hpp.

References VVector< Type >::x.

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.

void serialize ( Archive &  archive)
inline

serialization method for cereal.

Definition at line 206 of file vector.hpp.

References VVector< Type >::x.

size_t size ( ) const
inline

Definition at line 137 of file vector.hpp.

References VVector< Type >::x.

Friends And Related Function Documentation

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

Definition at line 198 of file vector.hpp.

Member Data Documentation


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