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

using type = Type

Definition at line 34 of file vector.hpp.

Member Function Documentation

static size_t dim ( )
inlinestatic

Definition at line 36 of file vector.hpp.

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

Definition at line 69 of file vector.hpp.

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

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

Definition at line 48 of file vector.hpp.

Referenced by RunStochasticGradFile(), and RunStochasticGradGenerated().

static Vector Make ( size_t  D_)
inlinestatic

Definition at line 39 of file vector.hpp.

Type Norm ( ) const
inline

Definition at line 59 of file vector.hpp.

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

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

Definition at line 72 of file vector.hpp.

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

Definition at line 77 of file vector.hpp.

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

Definition at line 81 of file vector.hpp.

Vector operator/ ( const Type &  s) const
inline

Definition at line 86 of file vector.hpp.

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

Definition at line 91 of file vector.hpp.

static Vector Origin ( )
inlinestatic

Definition at line 43 of file vector.hpp.

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

Definition at line 53 of file vector.hpp.

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.

static size_t size ( )
inlinestatic

Definition at line 37 of file vector.hpp.

Friends And Related Function Documentation

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

Definition at line 95 of file vector.hpp.

Member Data Documentation


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