DecompLib
A simple library for decomposition of spectra using a response matrix.
|
A representation of the vector of data that is the object of the decomposition. More...
#include <DataVector.h>
Public Member Functions | |
DataVector (int length, bool printBadSafety=true) | |
Constructor. More... | |
ParamType | getElement (int index) const |
Returns the value of the vector at index. More... | |
int | getLength () const |
Gets the size of the vector. More... | |
ParamType * | getRawDataPtr () |
Gives access to the underlying vector pointer. More... | |
bool | isSafe () |
Checks if the data vector is safe for usage in the decomposition. More... | |
void | setElement (int index, ParamType value) |
Places a given value into a specific index in the vector. More... | |
Private Attributes | |
bool | printErrors |
Stores if errors should be printed during safety checks. | |
int | size |
The number of cells in the input data vector. | |
ParamType * | vec |
The data vector itself. | |
A representation of the vector of data that is the object of the decomposition.
ParamType | The floating point type for which this calculation will be carried out |
Definition at line 29 of file DataVector.h.
|
inline |
Constructor.
length | the number of values in the vector |
printBadSafety | Whether or not to print locations of errors in safety checks |
Definition at line 37 of file DataVector.h.
References DataVector< ParamType >::vec.
|
inline |
Returns the value of the vector at index.
index | The index into the vector |
Definition at line 58 of file DataVector.h.
References DataVector< ParamType >::vec.
Referenced by DecompVector< ParamType >::initWithDataVector(), and performDecomposition().
|
inline |
Gets the size of the vector.
Definition at line 64 of file DataVector.h.
References DataVector< ParamType >::size.
Referenced by DecompVector< ParamType >::initWithDataVector(), and testSafety().
|
inline |
Gives access to the underlying vector pointer.
Definition at line 72 of file DataVector.h.
References DataVector< ParamType >::isSafe(), and DataVector< ParamType >::vec.
bool DataVector< ParamType >::isSafe | ( | ) |
Checks if the data vector is safe for usage in the decomposition.
Checking the vector's safety involves testing that every element is greater than or equal to zero and that the sum of all the elements is greater than zero (i.e. the vector is not a zero vector)
Definition at line 91 of file DataVector.h.
References DataVector< ParamType >::printErrors, DataVector< ParamType >::size, and DataVector< ParamType >::vec.
Referenced by DataVector< ParamType >::getRawDataPtr(), and testSafety().
|
inline |
Places a given value into a specific index in the vector.
index | The index into the vector |
value | The value to place at index |
Definition at line 49 of file DataVector.h.
References DataVector< ParamType >::vec.