sokobo
Loading...
Searching...
No Matches
Vector< T > Class Template Reference

Public Member Functions

 Vector (int size)
 
 Vector (const std::vector< T > &vec)
 
T & operator[] (int i)
 
const T & operator[] (int i) const
 
int size () const
 
Vector< T > operator+ (const Vector< T > &other) const
 
Vector< T > operator- (const Vector< T > &other) const
 
Vector< T > operator* (T scalar) const
 
Vector< T > operator/ (T scalar) const
 
dot (const Vector< T > &other) const
 
double norm () const
 
void normalize ()
 
std::string toString () const
 

Static Public Member Functions

static Vector< T > zeros (int size)
 
static Vector< T > ones (int size)
 

Detailed Description

template<typename T>
class Vector< T >

Definition at line 9 of file vector.h.

Constructor & Destructor Documentation

◆ Vector() [1/3]

template<typename T >
Vector< T >::Vector

Definition at line 5 of file vector.cpp.

◆ Vector() [2/3]

template<typename T >
Vector< T >::Vector ( int  size)

Definition at line 8 of file vector.cpp.

◆ Vector() [3/3]

template<typename T >
Vector< T >::Vector ( const std::vector< T > &  vec)

Definition at line 11 of file vector.cpp.

Member Function Documentation

◆ dot()

template<typename T >
T Vector< T >::dot ( const Vector< T > &  other) const

Definition at line 76 of file vector.cpp.

◆ norm()

template<typename T >
double Vector< T >::norm

Definition at line 89 of file vector.cpp.

◆ normalize()

template<typename T >
void Vector< T >::normalize

Definition at line 95 of file vector.cpp.

◆ ones()

template<typename T >
Vector< T > Vector< T >::ones ( int  size)
static

Definition at line 121 of file vector.cpp.

◆ operator*()

template<typename T >
Vector< T > Vector< T >::operator* ( scalar) const

Definition at line 54 of file vector.cpp.

◆ operator+()

template<typename T >
Vector< T > Vector< T >::operator+ ( const Vector< T > &  other) const

Definition at line 30 of file vector.cpp.

◆ operator-()

template<typename T >
Vector< T > Vector< T >::operator- ( const Vector< T > &  other) const

Definition at line 42 of file vector.cpp.

◆ operator/()

template<typename T >
Vector< T > Vector< T >::operator/ ( scalar) const

Definition at line 63 of file vector.cpp.

◆ operator[]() [1/2]

template<typename T >
T & Vector< T >::operator[] ( int  i)

Definition at line 14 of file vector.cpp.

◆ operator[]() [2/2]

template<typename T >
const T & Vector< T >::operator[] ( int  i) const

Definition at line 19 of file vector.cpp.

◆ size()

template<typename T >
int Vector< T >::size

Definition at line 24 of file vector.cpp.

◆ toString()

template<typename T >
std::string Vector< T >::toString

Definition at line 105 of file vector.cpp.

◆ zeros()

template<typename T >
Vector< T > Vector< T >::zeros ( int  size)
static

Definition at line 116 of file vector.cpp.


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