yat
0.20.3pre
|
An expression that can be converted to a Vector. More...
#include <yat/utility/VectorExpression.h>
Public Types | |
typedef Derived | derived_type |
Derived class. | |
Public Member Functions | |
VectorExpression (void) | |
default constructor | |
~VectorExpression (void) | |
destructor, free allocated memory | |
VectorExpression (const VectorExpression &other) | |
Cop constructor. | |
VectorExpression (VectorExpression &&other) | |
Move constructor. | |
size_t | size (void) const |
double | operator() (size_t i) const |
access an element | |
const gsl_vector * | gsl_vector_p (void) const |
return a GSL vector pointer | |
gsl_vector * | gsl_vector_p (void) |
return a mutable GSL vector pointer | |
void | gsl_vector_p (gsl_vector *v) |
set underlying GSL vector | |
Protected Member Functions | |
void | allocate_memory (size_t n) const |
allocate memory and throw if fails | |
void | delete_allocated_memory (void) |
clean up | |
Protected Attributes | |
gsl_vector * | v_ |
An expression that can be converted to a Vector.
yat uses template expression to implement fast linear algebra operations. This class defines the interface of expression that can be converted to a vector.
The class is used in two ways: 1) Classes that implements an expression that translates to a vector, for example, A * x, should inherit from this class. 2) Functions that takes expression that looks like a vector, but do not accept VectorBase, can pass this class.
To inherit from this class do the following:
1) declare you class class MyClass : public VectorExpression<MyClass>
Implement functions
|
inline |
|
mutableprotected |
cache variable that is calculated in derived classes via calculate_gsl_vector_p(void);