16 double min,
double max,
unsigned int nDivs,
unsigned int nSpecies )
22 nPts_ = nDivs + 1 + 1;
23 dx_ = ( max - min ) / nDivs;
25 nColumns_ = 2 * nSpecies;
28 table_.resize( nPts_ * nColumns_ );
33 const vector< double >& C1,
34 const vector< double >& C2 )
38 vector< double >::const_iterator ic1 = C1.begin();
39 vector< double >::const_iterator ic2 = C2.begin();
40 vector< double >::iterator iTable = table_.begin() + 2 * species;
42 for (
unsigned int igrid = 0; igrid < nPts_ - 1 ; ++igrid ) {
44 *( iTable + 1 ) = *ic2;
50 *( iTable ) = C1.back();
51 *( iTable + 1 ) = C2.back();
58 column.
column = 2 * species;
69 double div = ( x - min_ ) / dx_;
70 unsigned int integer = (
unsigned int )( div );
73 row.
row = &( table_.front() ) + integer * nColumns_;
void lookup(const LookupColumn &column, const LookupRow &row, double &C1, double &C2)
Actually performs the lookup and the linear interpolation.
void row(double x, LookupRow &row)
void addColumns(int species, const vector< double > &C1, const vector< double > &C2)
Adds the columns for a given species. Columns supplied are C1 and C2.
void column(unsigned int species, LookupColumn &column)
double * row
Pointer to the first column on a row.