Class AmiVectorArray¶
Defined in File vector.h
Class Documentation¶
-
class
amici
::
AmiVectorArray
¶ AmiVectorArray class.
Provides a generic interface to arrays of NVector_Serial structs
Public Functions
-
AmiVectorArray
() = default¶ Default constructor.
-
AmiVectorArray
(long int length_inner, long int length_outer)¶ empty constructor
Creates an std::vector<realype> and attaches the data pointer to a newly created N_VectorArray using CloneVectorArrayEmpty ensures that the N_Vector module does not try to deallocate the data vector when calling N_VDestroyVectorArray_Serial
- Parameters
length_inner
: length of vectorslength_outer
: number of vectors
-
AmiVectorArray
(const AmiVectorArray &vaold)¶ copy constructor
- Parameters
vaold
: object to copy from
-
~AmiVectorArray
() = default¶
-
AmiVectorArray &
operator=
(AmiVectorArray const &other)¶ copy assignment operator
- Return
left hand side
- Parameters
other
: right hand side
-
realtype *
data
(int pos)¶ accessor to data of AmiVector elements
- Return
pointer to data array
- Parameters
pos
: index of AmiVector
-
const realtype *
data
(int pos) const¶ const accessor to data of AmiVector elements
- Return
const pointer to data array
- Parameters
pos
: index of AmiVector
-
realtype &
at
(int ipos, int jpos)¶ accessor to elements of AmiVector elements
- Return
element
- Parameters
ipos
: inner index in AmiVectorjpos
: outer index in AmiVectorArray
-
const realtype &
at
(int ipos, int jpos) const¶ const accessor to elements of AmiVector elements
- Return
element
- Parameters
ipos
: inner index in AmiVectorjpos
: outer index in AmiVectorArray
-
N_Vector *
getNVectorArray
()¶ accessor to NVectorArray
- Return
N_VectorArray
-
N_Vector
getNVector
(int pos)¶ accessor to NVector element
- Return
N_Vector
- Parameters
pos
: index of corresponding AmiVector
-
const N_Vector
getNVector
(int pos) const¶ const accessor to NVector element
- Return
N_Vector
- Parameters
pos
: index of corresponding AmiVector
-
int
getLength
() const¶ length of AmiVectorArray
- Return
length
-
void
zero
()¶ set every AmiVector in AmiVectorArray to zero
-
void
flatten_to_vector
(std::vector<realtype> &vec) const¶ flattens the AmiVectorArray to a vector in row-major format
- Parameters
vec
: vector into which the AmiVectorArray will be flattened. Must have length equal to number of elements.
-
void
copy
(const AmiVectorArray &other)¶ copies data from another AmiVectorArray
- Parameters
other
: data source
-