Hopsan
LookupTableNDBase Class Reference
Inheritance diagram for LookupTableNDBase:
LookupTable1D LookupTable2D LookupTable3D

Public Types

enum  IncreasingEnumT { StrictlyIncreasing , StrictlyDecreasing , NotStrictlyIncOrDec , Unknown }
 

Public Member Functions

 LookupTableNDBase (const size_t nDims)
 
void clear ()
 
bool isEmpty () const
 
std::vector< double > & getIndexDataRef (const size_t d)
 
std::vector< double > & getValueDataRef ()
 
bool isDataSizeOK ()
 
bool isDataOK ()
 
bool allIndexStrictlyIncreasing () const
 
IncreasingEnumT isIndexIncreasingOrDecresing (size_t d) const
 
void calcIncreasingOrDecreasing (int dim=-1)
 
void sortIncreasing ()
 
void getDimDataAt (const size_t dim, const size_t idx, std::vector< double > &rData)
 Get a "slice" of data at idx at given dimension.
 
void insertDimDataAt (const size_t dim, const size_t idx, const std::vector< double > &rData)
 
size_t getDimSize (const size_t dim) const
 
size_t findIndexAlongDim (const size_t dim, const double x) const
 

Protected Member Functions

size_t intervalHalfSubDiv (const double x, const size_t i1, const size_t iend, const size_t dim) const
 
size_t quickSortPartition (const size_t dim, const std::vector< double > &rIndexArray, const size_t left, const size_t right, const size_t pivotIndex)
 
void quickSort (const size_t dim, const std::vector< double > &rIndexArray, const size_t left, const size_t right)
 
void swapDataSliceInDim (const size_t r1, const size_t r2, const size_t dim)
 
void reverseAlongDim (size_t d)
 
void resetFirstLast ()
 
double limitToRange (const size_t dim, const double val) const
 
size_t calcDataIndex (const std::vector< size_t > coordinates)
 

Protected Attributes

size_t mNumDims
 
std::vector< size_t > mNumSubDimDataElements
 
std::vector< double > mIndexFirst
 
std::vector< double > mIndexLast
 
std::vector< IncreasingEnumT > mIndexIncreasingOrDecreasing
 
std::vector< std::vector< double > > mIndexData
 
std::vector< double > mValueData
 

Member Function Documentation

◆ findIndexAlongDim()

size_t findIndexAlongDim ( const size_t dim,
const double x ) const
inline
Note
Assumes that x is within index range

◆ reverseAlongDim()

void reverseAlongDim ( size_t d)
inlineprotected