16 lower_(lower), upper_(upper), edges_(nodes-2) {
17 stepinv_ = (nodes-1)/(upper - lower);
24 int nodes()
const {
return edges_+2;}
25 int cells()
const {
return edges_+1;}
30 return i>=0 && i<=edges_;
36 f = modff((a-lower())*stepinv_, &b);
46 else if (ind>edges_) {
57 return tmp*
step()+lower();
62 int ind =
static_cast<int>((a-lower())/
step());
int index(Scalar a) const
returns valid index, or -1 if the value is outside range +/- one cell.
bool inRange(int i) const
const T & max(const T &a, const T &b)
Scalar closestNode(Scalar a) const
std::vector< std::vector< double > > tmp
void normalize(int &ind, Scalar &f) const
Grid1D(Scalar lower, Scalar upper, int nodes)
int index(Scalar a, Scalar &f) const