Public Member Functions | Protected Attributes | Friends | List of all members
mirtk::Vector Class Reference

#include <Vector.h>

Inheritance diagram for mirtk::Vector:
Inheritance graph
Collaboration diagram for mirtk::Vector:
Collaboration graph

Public Member Functions

void Clear ()
 Free vector.
 
Vector CrossProduct (const Vector &) const
 Vector/cross product.
 
double DotProduct (const Vector &) const
 Scalar/dot product.
 
const double & Get (int) const
 Gets vector value.
 
void Initialize (int)
 Intialize matrix with number of rows.
 
void Initialize (int, double)
 Intialize matrix with number of rows.
 
void Initialize (int, double *)
 Intialize matrix with number of rows.
 
VectorInverse ()
 Replace each vector element by its inverse.
 
double Mean () const
 Compute mean value of vector components.
 
double Norm () const
 Returns norm of a vector.
 
VectorNormalize ()
 Normalize vector.
 
 operator bool () const
 Whether vector is non-empty, i.e., initialized and number of rows greater zero.
 
bool operator!= (const Vector &) const
 Comparison operator !=.
 
double & operator() (int)
 Puts vector value.
 
const double & operator() (int) const
 Gets vector value.
 
Vector operator* (double) const
 Return result of multiplication with a double.
 
Vector operator* (const Vector &) const
 Return result for componentwise vector multiplication (no scalar nor cross product)
 
Vectoroperator*= (double)
 Multiplication with a double.
 
Vectoroperator*= (const Vector &)
 Vector componentwise multiplication operator (no scalar nor cross product)
 
Vector operator+ (double) const
 Return result of addition of a double.
 
Vector operator+ (const Vector &) const
 Return result for vector addition.
 
Vectoroperator+= (double)
 Addition of a double.
 
Vectoroperator+= (const Vector &)
 Vector addition operator.
 
Vector operator- (double) const
 Return result of subtraction of a double.
 
Vector operator- () const
 Unary negation operator.
 
Vector operator- (const Vector &) const
 Return result for vector subtraction.
 
Vectoroperator-= (double)
 Subtraction of a double.
 
Vectoroperator-= (const Vector &)
 Vector subtraction operator.
 
Vector operator/ (double) const
 Return result of division by a double.
 
Vector operator/ (const Vector &) const
 Return result for componentwise vector division.
 
Vectoroperator/= (double)
 Division by a double.
 
Vectoroperator/= (const Vector &)
 Vector componentwise division operator.
 
bool operator< (const Vector &) const
 Comparison operator <.
 
Vectoroperator= (double)
 Assignment of double.
 
Vectoroperator= (const Vector &)
 Vector copy operator.
 
bool operator== (const Vector &) const
 Comparison operator ==.
 
void Permute (const Array< int > &)
 Permute vector elements (cf. PermuteRows)
 
void PermuteRows (Array< int >)
 Permute vector elements.
 
void Print (Indent=0) const
 Print vector.
 
template<class T >
VectorPut (const Vector3D< T > &)
 Initialize from 3D vector.
 
template<class T >
VectorPut (const Vector4D< T > &)
 Initialize from 4D vector.
 
void Put (int, double)
 Puts vector value.
 
double * RawPointer (int r=0)
 Get pointer to linear memory which stores vector elements.
 
const double * RawPointer (int r=0) const
 Get pointer to linear memory which stores vector elements.
 
void Read (const char *)
 Read vector from file.
 
void Resize (int, double=.0)
 Change size of vector, preserving existing rows.
 
int Rows () const
 Returns number of rows.
 
double ScalarProduct (const Vector &) const
 Scalar/dot product.
 
double Sum () const
 Returns sum of a vector components.
 
 Vector ()
 Default constructor.
 
 Vector (int)
 Constructor for given row dimensions.
 
 Vector (int, double)
 Constructor for given row dimensions.
 
 Vector (int, double *)
 Constructor for given row dimensions.
 
 Vector (const Vector &)
 Copy constructor.
 
template<class T >
 Vector (const Vector3D< T > &)
 Construct vector from 3D vector.
 
template<class T >
 Vector (const Vector4D< T > &)
 Construct vector from 4D vector.
 
void Write (const char *) const
 Write vector to file.
 
bool WriteMAT (const char *, const char *="A") const
 
 ~Vector ()
 Destructor.
 
- Public Member Functions inherited from mirtk::Object
virtual const char * NameOfClass () const =0
 Get name of class, which this object is an instance of.
 
virtual ParameterList Parameter () const
 Get parameter name/value pairs.
 
bool Parameter (const ParameterList &)
 Set parameters from name/value pairs.
 
virtual bool Set (const char *name, const char *value)
 
virtual ~Object ()
 Destructor.
 

Protected Attributes

int _rows
 Number of rows.
 
double * _vector
 Vector elements.
 

Friends

ostream & operator<< (ostream &, const Vector &)
 Interface to output stream.
 
Cofstreamoperator<< (Cofstream &, const Vector &)
 Interface to output stream.
 
istream & operator>> (istream &, Vector &)
 Interface to input stream.
 
Cifstreamoperator>> (Cifstream &, Vector &)
 Interface to input stream.
 

Additional Inherited Members

- Static Public Member Functions inherited from mirtk::Object
static const char * NameOfType ()
 Get name of this class type.
 
- Protected Member Functions inherited from mirtk::Object
template<typename... Args>
void Throw (ErrorType err, const char *func, Args... args) const
 
- Static Protected Member Functions inherited from mirtk::Object
template<typename... Args>
static void ThrowStatic (ErrorType err, const char *cls, const char *func, Args... args)
 

Detailed Description

Vector class.

Definition at line 43 of file Vector.h.

Member Function Documentation

§ WriteMAT()

bool mirtk::Vector::WriteMAT ( const char *  ,
const char *  = "A" 
) const

Write vector to MAT-file

Note
Use only when MIRTK_Numerics_WITH_MATLAB is 1.

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