#include <matrix.h>
Public Member Functions | |
CVector (int s=0, T e=0) | |
~CVector () | |
CVector (const CVector &v) | |
CVector & | operator= (const CVector &v) |
T | operator* (const CVector &v) const |
Scalar product of two vectors. | |
CVector | operator* (T a) const |
Multiplication with scalar. | |
CVector | operator+ (const CVector &v) const |
CVector | operator- (const CVector &v) const |
T & | operator[] (int i) |
Operator [] allows to change the coordinate of the vector. | |
T | operator() (int i) const |
Operator () returns value of an element. | |
operator int () const | |
Cast to int returns the size of the vector. | |
T | norm1 () const |
Norm computed as a sum of absolute values. | |
T | norm2 () const |
Euclidean norm. | |
CVector | normalization () const |
Function returns normalization of the current vector with respect to Euclidean norm. | |
int | write (const char *name, int precision) |
CVector | projection (const CVector &v) const |
Function returns orthonormal projection of the current vector onto v vector. | |
Private Attributes | |
T * | elements |
int | size |
Scalar product of two vectors.
Multiplication with scalar.
T& CVector< T >::operator[] | ( | int | i | ) | [inline] |
Operator [] allows to change the coordinate of the vector.
It returns reference to an element. No indices checking implemented.
T CVector< T >::operator() | ( | int | i | ) | const [inline] |
Operator () returns value of an element.
It is a const operator. It does not change the elements of the vector. No indices checking implemented.
CVector< T >::operator int | ( | ) | const [inline] |
Cast to int returns the size of the vector.
T CVector< T >::norm1 | ( | ) | const [inline] |
Norm computed as a sum of absolute values.
T CVector< T >::norm2 | ( | ) | const [inline] |
Euclidean norm.
Function returns normalization of the current vector with respect to Euclidean norm.
int CVector< T >::write | ( | const char * | name, | |
int | precision | |||
) | [inline] |
Function returns orthonormal projection of the current vector onto v vector.