Class AmiVectorArray

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 vectors

  • length_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

const realtype *data(int pos) const

const accessor to data of AmiVector elements

Return

const pointer to data array

Parameters

realtype &at(int ipos, int jpos)

accessor to elements of AmiVector elements

Return

element

Parameters

const realtype &at(int ipos, int jpos) const

const accessor to elements of AmiVector elements

Return

element

Parameters

N_Vector *getNVectorArray()

accessor to NVectorArray

Return

N_VectorArray

N_Vector getNVector(int pos)

accessor to NVector element

Return

N_Vector

Parameters

const_N_Vector getNVector(int pos) const

const accessor to NVector element

Return

N_Vector

Parameters

AmiVector &operator[](int pos)

accessor to AmiVector elements

Return

AmiVector

Parameters

const AmiVector &operator[](int pos) const

const accessor to AmiVector elements

Return

const AmiVector

Parameters

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