Table

class Table

Table values are assumed to be equally spaced and vary from 0 to 1.

Subclassed by feasst::Table1D, feasst::Table2D, feasst::Table3D, feasst::Table4D, feasst::Table5D, feasst::Table6D

Public Functions

virtual double minimum() const = 0

Return the minimum of all elements.

virtual double maximum() const = 0

Return the maximum of all elements.

double calc_bin_spacing(const int num)

Return the bin spacing for a given number of elements.

virtual void write(const std::string file_name) const

Write to file.

class Table1D : public feasst::Table

One-dimensional implementation of a table.

Subclassed by feasst::RecursiveTable1D

Public Functions

Table1D(argtype args = argtype())

args:

  • num: number of values (default: 1).

  • default_value: initialize data to this constant (default: 0).

int num() const

Return the number of values.

double bin_spacing() const

Return the bin spacing.

double bin_to_value(const int bin) const

For a given dimension, return the value of a bin.

int value_to_nearest_bin(const double value) const

The inverse of above.

int value_to_lowest_bin(const double value) const

Return the bin just below the value.

void set_data(const int dim0, const double value)

Set data.

const std::vector<double> &data() const

Return the data.

double data(const int index) const

Return the data.

void add(const Table1D &table)

Add the values of the given table.

virtual double linear_interpolation(const double value0) const

Return linear interpolation of data given normalized values.

virtual double forward_difference_interpolation(const double value0) const

Return the Newton-Gregory forward difference interpolation. See Allen and Tildesley, 5.2.2, Booth 1972

double minimum() const

Return the minimum of all elements.

double maximum() const

Return the maximum of all elements.

class Table2D : public feasst::Table

Two-dimensional implementation of a table.

Subclassed by feasst::RecursiveTable2D

Public Functions

Table2D(argtype args = argtype())

args:

  • num0: number of values in first dimension (default: 1).

  • num1: number of values in second dimension (default: 1).

  • default_value: initialize data to this constant (default: 0).

int num0() const

Return the number of values in the first dimension.

int num1() const

Return the number of values in the second dimension.

int num(const int dim) const

Return the number of values in a given dimension.

double bin_spacing(const int dim) const

Return the bin spacing.

double bin_to_value(const int dim, const int bin) const

For a given dimension, return the value of a bin.

int value_to_nearest_bin(const int dim, const double value) const

The inverse of above.

void set_data(const int dim0, const int dim1, const double value)

Set data.

const fvec2 &data() const

Return the data.

void add(const Table2D &table)

Add the values of the given table.

virtual double linear_interpolation(const double value0, const double value1) const

Return linear interpolation of data given normalized values for each dimension that range from 0 to 1, inclusive.

double minimum() const

Return the minimum of all elements.

double maximum() const

Return the maximum of all elements.

class Table3D : public feasst::Table

Three-dimensional implementation of a table.

Subclassed by feasst::RecursiveTable3D

Public Functions

Table3D(argtype args = argtype())

args:

  • num0: number of values in first dimension (default: 1).

  • num1: number of values in second dimension (default: 1).

  • num2: number of values in third dimension (default: 1).

  • default_value: initialize data to this constant (default: 0).

int num0() const

Return the number of values in the first dimension.

int num1() const

Return the number of values in the second dimension.

int num2() const

Return the number of values in the third dimension.

int num(const int dim) const

Return the number of values in a given dimension.

double bin_spacing(const int dim) const

Return the bin spacing.

double bin_to_value(const int dim, const int bin) const

For a given dimension, return the value of a bin.

int value_to_nearest_bin(const int dim, const double value) const

The inverse of above.

void set_data(const int dim0, const int dim1, const int dim2, const double value)

Set data.

const fvec3 &data() const

Return the data.

void add(const Table3D &table)

Add the values of the given table.

virtual double linear_interpolation(const double value0, const double value1, const double value2) const

Return linear interpolation of data given normalized values for each dimension that range from 0 to 1, inclusive.

double minimum() const

Return the minimum of all elements.

double maximum() const

Return the maximum of all elements.

void write(const std::string file_name) const

Write to file.

Table3D(const std::string file_name)

Read from file.

class Table4D : public feasst::Table

Four-dimensional implementation of a table.

Public Functions

Table4D(argtype args = argtype())

args:

  • num0: number of values in first dimension (default: 1).

  • num1: number of values in second dimension (default: 1).

  • num2: number of values in third dimension (default: 1).

  • num3: number of values in fourth dimension (default: 1).

  • default_value: initialize data to this constant (default: 0).

int num0() const

Return the number of values in the first dimension.

int num1() const

Return the number of values in the second dimension.

int num2() const

Return the number of values in the third dimension.

int num3() const

Return the number of values in the fourth dimension.

int num(const int dim) const

Return the number of values in a given dimension.

double bin_spacing(const int dim) const

Return the bin spacing.

double bin_to_value(const int dim, const int bin) const

For a given dimension, return the value of a bin.

int value_to_nearest_bin(const int dim, const double value) const

The inverse of above.

void set_data(const int dim0, const int dim1, const int dim2, const int dim3, const double value)

Set data.

const fvec4 &data() const

Return the data.

void add(const Table4D &table)

Add the values of the given table.

double linear_interpolation(const double value0, const double value1, const double value2, const double value3) const

Return linear interpolation of data given normalized values for each dimension that range from 0 to 1, inclusive.

double minimum() const

Return the minimum of all elements.

double maximum() const

Return the maximum of all elements.

void write(const std::string file_name) const

Write to file.

Table4D(const std::string file_name)

Read from file.

class Table5D : public feasst::Table

Five-dimensional implementation of a table.

Subclassed by feasst::RecursiveTable5D

Public Functions

Table5D(argtype args = argtype())

args:

  • num0: number of values in first dimension (default: 1).

  • num1: number of values in second dimension (default: 1).

  • num2: number of values in third dimension (default: 1).

  • num3: number of values in fourth dimension (default: 1).

  • num4: number of values in fourth dimension (default: 1).

  • default_value: initialize data to this constant (default: 0).

int num0() const

Return the number of values in the first dimension.

int num1() const

Return the number of values in the second dimension.

int num2() const

Return the number of values in the third dimension.

int num3() const

Return the number of values in the fourth dimension.

int num4() const

Return the number of values in the fifth dimension.

int num(const int dim) const

Return the number of values in a given dimension.

double bin_spacing(const int dim) const

Return the bin spacing.

double bin_to_value(const int dim, const int bin) const

For a given dimension, return the value of a bin.

int value_to_nearest_bin(const int dim, const double value) const

The inverse of above.

void set_data(const int dim0, const int dim1, const int dim2, const int dim3, const int dim4, const double value)

Set data.

const fvec5 &data() const

Return the data.

void add(const Table5D &table)

Add the values of the given table.

virtual double linear_interpolation(const double value0, const double value1, const double value2, const double value3, const double value4) const

Return linear interpolation of data given normalized values for each dimension that range from 0 to 1, inclusive.

double minimum() const

Return the minimum of all elements.

double maximum() const

Return the maximum of all elements.

void write(const std::string file_name) const

Write to file.

Table5D(const std::string file_name)

Read from file.

class Table6D : public feasst::Table

Six-dimensional implementation of a table.

Subclassed by feasst::RecursiveTable6D

Public Functions

Table6D(argtype args = argtype())

args:

  • num0: number of values in first dimension (default: 1).

  • num1: number of values in second dimension (default: 1).

  • num2: number of values in third dimension (default: 1).

  • num3: number of values in fourth dimension (default: 1).

  • num4: number of values in fourth dimension (default: 1).

  • num5: number of values in fourth dimension (default: 1).

  • default_value: initialize data to this constant (default: 0).

int num0() const

Return the number of values in the first dimension.

int num1() const

Return the number of values in the second dimension.

int num2() const

Return the number of values in the third dimension.

int num3() const

Return the number of values in the fourth dimension.

int num4() const

Return the number of values in the fifth dimension.

int num5() const

Return the number of values in the sixth dimension.

int num(const int dim) const

Return the number of values in a given dimension.

double bin_spacing(const int dim) const

Return the bin spacing.

double bin_to_value(const int dim, const int bin) const

For a given dimension, return the value of a bin.

int value_to_nearest_bin(const int dim, const double value) const

The inverse of above.

void set_data(const int dim0, const int dim1, const int dim2, const int dim3, const int dim4, const int dim5, const double value)

Set data.

const fvec6 &data() const

Return the data.

void add(const Table6D &table)

Add the values of the given table.

virtual double linear_interpolation(const double value0, const double value1, const double value2, const double value3, const double value4, const double value5) const

Return linear interpolation of data given normalized values for each dimension that range from 0 to 1, inclusive.

double minimum() const

Return the minimum of all elements.

double maximum() const

Return the maximum of all elements.

void write(const std::string file_name) const

Write to file.

Table6D(const std::string file_name)

Read from file.