#include <yat/utility/VectorConstView.h>
Public Types | |
typedef double | value_type |
typedef const double & | const_reference |
typedef StrideIterator< const double * > | const_iterator |
VectorBase::const_iterator. | |
Public Member Functions | |
VectorConstView (const VectorConstView &other) | |
The copy constructor. | |
VectorConstView (const VectorBase &other) | |
Copy a VectorBase. | |
VectorConstView (const VectorBase &v, size_t offset, size_t n, size_t stride=1) | |
const view into a vector | |
VectorConstView (const Matrix &m, size_t i, bool row=true) | |
Matrix row/column view constructor. | |
~VectorConstView (void) | |
bool | isview (void) const |
const_iterator | begin (void) const |
const_iterator | end (void) const |
bool | equal (const VectorBase &, const double precision=0) const |
Check whether VectorBases are equal within a user defined precision, set by precision. | |
const gsl_vector * | gsl_vector_p (void) const |
size_t | size (void) const |
const double & | operator() (size_t i) const |
Element access operator. | |
bool | operator== (const VectorBase &) const |
Comparison operator. Takes linear time. | |
bool | operator!= (const VectorBase &) const |
Comparison operator. Takes linear time. | |
double | operator* (const VectorBase &) const |
Protected Attributes | |
const gsl_vector * | const_vec_ |
pointer to underlying GSL vector |
Wrapper to gsl_vector_const_view
With this class you can create a view into const objects - either a vector or matrix. By design all functionality in this class is const to guarantee that the viewed object is not modified.
typedef double theplu::yat::utility::VectorBase::value_type [inherited] |
typedef const double& theplu::yat::utility::VectorBase::const_reference [inherited] |
theplu::yat::utility::VectorConstView::VectorConstView | ( | const VectorBase & | v, | |
size_t | offset, | |||
size_t | n, | |||
size_t | stride = 1 | |||
) |
const view into a vector
Create a const view of VectorBase v, with starting index offset, size n, and an optional stride.
GSL_error | if a view cannot be set up. |
theplu::yat::utility::VectorConstView::VectorConstView | ( | const Matrix & | m, | |
size_t | i, | |||
bool | row = true | |||
) |
Matrix row/column view constructor.
Create a view into a row/column of a matrix.
m | matrix to view into. | |
i | index telling which row/column to view into | |
row | if true (defult) created view is a row vector, i.e., viewing into row i, and, naturally, a column vector otherwise. |
theplu::yat::utility::VectorConstView::~VectorConstView | ( | void | ) |
The destructor.
bool theplu::yat::utility::VectorConstView::isview | ( | void | ) | const [virtual] |
const_iterator theplu::yat::utility::VectorBase::begin | ( | void | ) | const [inherited] |
const_iterator theplu::yat::utility::VectorBase::end | ( | void | ) | const [inherited] |
bool theplu::yat::utility::VectorBase::equal | ( | const VectorBase & | , | |
const double | precision = 0 | |||
) | const [inherited] |
Check whether VectorBases are equal within a user defined precision, set by precision.
const gsl_vector* theplu::yat::utility::VectorBase::gsl_vector_p | ( | void | ) | const [inherited] |
size_t theplu::yat::utility::VectorBase::size | ( | void | ) | const [inherited] |
const double& theplu::yat::utility::VectorBase::operator() | ( | size_t | i | ) | const [inherited] |
Element access operator.
If | GSL range checks are enabled in the underlying GSL library a GSL_error exception is thrown if either index is out of range. |
bool theplu::yat::utility::VectorBase::operator== | ( | const VectorBase & | ) | const [inherited] |
Comparison operator. Takes linear time.
Checks are performed with exact matching, i.e., rounding off effects may destroy comparison. Use the equal function for comparing elements within a user defined precision.
bool theplu::yat::utility::VectorBase::operator!= | ( | const VectorBase & | ) | const [inherited] |
Comparison operator. Takes linear time.
Checks are performed with exact matching, i.e., rounding off effects may destroy comparison. Use the equal function for comparing elements within a user defined precision.
double theplu::yat::utility::VectorBase::operator* | ( | const VectorBase & | ) | const [inherited] |