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

Public Functions

virtual double minimum() const = 0

Return the minimum of all elements.

virtual double maximum() const = 0

Return the maximum of all elements.

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

Write to file.

class Table1D : public feasst::Table

This is a one-dimensional implementation of a table.

Public Functions

Table1D(const 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_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.

void set_data(const int dim0, const double value)

Set data.

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

Return the data.

void add(const Table1D &table)

Add the values of the given table.

double linear_interpolation(const double value0) const

Return linear interpolation of data given normalized values.

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

This is a two-dimensional implementation of a table.

Public Functions

Table2D(const 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_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 vec2 &data() const

Return the data.

void add(const Table2D &table)

Add the values of the given table.

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

This is a three-dimensional implementation of a table.

Public Functions

Table3D(const 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_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 vec3 &data() const

Return the data.

void add(const Table3D &table)

Add the values of the given table.

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.