Thrill  0.1
Vector< D, Type > Class Template Reference

Detailed Description

template<size_t D, typename Type = double>
class thrill::common::Vector< D, Type >

A compile-time fixed-length D-dimensional point with double precision.

Definition at line 28 of file vector.hpp.

+ Inheritance diagram for Vector< D, Type >:

#include <vector.hpp>

Public Types

using type = Type
 

Public Member Functions

Type Distance (const Vector &b) const
 
Type DistanceSquare (const Vector &b) const
 
Type dot (const Vector &b) const
 
Vector fill (const Type init_val)
 
Type Norm () const
 
Vector operator+ (const Vector &b) const
 
Vectoroperator+= (const Vector &b)
 
Vector operator- (const Vector &b) const
 
Vector operator/ (const Type &s) const
 
Vectoroperator/= (const Type &s)
 
template<typename Archive >
void serialize (Archive &archive)
 

Static Public Member Functions

static size_t dim ()
 
static Vector Make (size_t D_)
 
static Vector Origin ()
 
template<typename Distribution , typename Generator >
static Vector Random (size_t dim, Distribution &dist, Generator &gen)
 
static size_t size ()
 

Public Attributes

Type x [D]
 coordinates array More...
 

Friends

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

Member Typedef Documentation

◆ type

using type = Type

Definition at line 34 of file vector.hpp.

Member Function Documentation

◆ dim()

static size_t dim ( )
inlinestatic

Definition at line 36 of file vector.hpp.

◆ Distance()

Type Distance ( const Vector< D, Type > &  b) const
inline

Definition at line 69 of file vector.hpp.

Referenced by StochasticGradientDescent< Vector >::is_converged().

◆ DistanceSquare()

Type DistanceSquare ( const Vector< D, Type > &  b) const
inline

◆ dot()

Type dot ( const Vector< D, Type > &  b) const
inline

◆ fill()

Vector fill ( const Type  init_val)
inline

Definition at line 48 of file vector.hpp.

Referenced by RunStochasticGradFile(), and RunStochasticGradGenerated().

◆ Make()

static Vector Make ( size_t  D_)
inlinestatic

Definition at line 39 of file vector.hpp.

◆ Norm()

Type Norm ( ) const
inline

Definition at line 59 of file vector.hpp.

Referenced by StochasticGradientDescent< Vector >::is_converged().

◆ operator+()

Vector operator+ ( const Vector< D, Type > &  b) const
inline

Definition at line 72 of file vector.hpp.

◆ operator+=()

Vector& operator+= ( const Vector< D, Type > &  b)
inline

Definition at line 77 of file vector.hpp.

◆ operator-()

Vector operator- ( const Vector< D, Type > &  b) const
inline

Definition at line 81 of file vector.hpp.

◆ operator/()

Vector operator/ ( const Type &  s) const
inline

Definition at line 86 of file vector.hpp.

◆ operator/=()

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

Definition at line 91 of file vector.hpp.

◆ Origin()

static Vector Origin ( )
inlinestatic

Definition at line 43 of file vector.hpp.

◆ Random()

static Vector Random ( size_t  dim,
Distribution &  dist,
Generator &  gen 
)
inlinestatic

Definition at line 53 of file vector.hpp.

◆ serialize()

void serialize ( Archive &  archive)
inline

serialization method for cereal. Keep this, even though Vector is a POD, to serialize fixed-length Vectors that are contained in other structs.

Definition at line 109 of file vector.hpp.

◆ size()

static size_t size ( )
inlinestatic

Definition at line 37 of file vector.hpp.

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 95 of file vector.hpp.

Member Data Documentation

◆ x


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