This is the yat interface to GSL vector.
More...
#include <yat/utility/VectorBase.h>
|
const gsl_vector * | const_vec_ |
| pointer to underlying GSL vector
|
|
This is the yat interface to GSL vector.
This is an interface class for vectors containing the const interface. For mutable functionality see VectorMutable.
const_reference type is const double&
- Since
- New in yat 0.5
value_type is double
- Since
- New in yat 0.5
virtual theplu::yat::utility::VectorBase::~VectorBase |
( |
void |
| ) |
|
|
virtual |
bool theplu::yat::utility::VectorBase::equal |
( |
const VectorBase & |
, |
|
|
const double |
precision = 0 |
|
) |
| const |
Check whether VectorBases are equal within a user defined precision, set by precision.
- Returns
- True if each element deviates less or equal than d. If any VectorBase contain a NaN, false is always returned.
- See Also
- operator== and operator!=
const gsl_vector* theplu::yat::utility::VectorBase::gsl_vector_p |
( |
void |
| ) |
const |
- Returns
- A const pointer to the internal GSL vector,
virtual bool theplu::yat::utility::VectorBase::isview |
( |
void |
| ) |
const |
|
pure virtual |
bool theplu::yat::utility::VectorBase::operator!= |
( |
const VectorBase & |
| ) |
const |
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.
- Returns
- False if all elements are equal otherwise true.
- See Also
- equal(const VectorBase&, const double precision=0)
const double& theplu::yat::utility::VectorBase::operator() |
( |
size_t |
i | ) |
const |
Element access operator.
- Returns
- Const reference to element i.
- Exceptions
-
If | GSL range checks are enabled in the underlying GSL library a GSL_error exception is thrown if either index is out of range. |
double theplu::yat::utility::VectorBase::operator* |
( |
const VectorBase & |
| ) |
const |
bool theplu::yat::utility::VectorBase::operator== |
( |
const VectorBase & |
| ) |
const |
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.
- Returns
- True if all elements are equal otherwise false.
- See Also
- equal(const VectorBase&, const double precision=0)
size_t theplu::yat::utility::VectorBase::size |
( |
void |
| ) |
const |
Check if all elements of the VectorBase are zero.
- Returns
- True if all elements in the VectorBase is zero, false othwerwise.
Locate the maximum value in the VectorBase.
- Returns
- The index to the maximum value of the VectorBase.
- Note
- Lower index has precedence.
Locate the minimum value in the VectorBase.
- Returns
- The index to the minimum value of the VectorBase.
- Note
- Lower index has precedence.
Create a VectorBase flag indicating NaN's in another VectorBase templat.
The flag VectorBase is changed to contain 1's and 0's only. A 1 means that the corresponding element in the templat VectorBase is valid and a zero means that the corresponding element is a NaN.
- Note
- Space for vector flag is reallocated to fit the size of VectorBase templat if sizes mismatch.
- Returns
- True if the templat VectorBase contains at least one NaN.
std::ostream & operator<< |
( |
std::ostream & |
s, |
|
|
const VectorBase & |
v |
|
) |
| |
|
related |
The output operator for the VectorBase class.
Elements in VectorBase v are sent to ostream s and separated with the fill character of stream s, s.fill(). If you, for example, want to print the VectorBase v with the elements separated by a ':', you do so by:
s << setfill(':') << v;
void sort_index |
( |
std::vector< size_t > & |
sort_index, |
|
|
const VectorBase & |
invec |
|
) |
| |
|
related |
Create a vector sort_index containing the indeces of elements in a another VectorBase invec. The elements of sort_index give the index of the VectorBase element which would have been stored in that position if the VectorBase had been sorted in place. The first element of sort_index gives the index of the least element in invec, and the last element of sort_index gives the index of the greatest element in invec . The VectorBase invec is not changed.
void sort_largest_index |
( |
std::vector< size_t > & |
sort_index, |
|
|
size_t |
k, |
|
|
const VectorBase & |
invec |
|
) |
| |
|
related |
Similar to sort_index but creates a VectorBase with indices to the k largest elements in invec.
void sort_smallest_index |
( |
std::vector< size_t > & |
sort_index, |
|
|
size_t |
k, |
|
|
const VectorBase & |
invec |
|
) |
| |
|
related |
Similar to sort_index but creates a VectorBase with indices to the k smallest elements in invec.
Calculate the sum of all VectorBase elements.
- Returns
- The sum.
The documentation for this class was generated from the following files: