OpenMM
Discrete2DFunction Class Reference

This is a TabulatedFunction that computes a discrete two dimensional function f(x,y). More...

`#include <TabulatedFunction.h>`

Inheritance diagram for Discrete2DFunction:

## Public Member Functions

Discrete2DFunction (int xsize, int ysize, const std::vector< double > &values)
Create a Discrete2DFunction f(x,y) based on a set of tabulated values. More...

void getFunctionParameters (int &xsize, int &ysize, std::vector< double > &values) const
Get the parameters for the tabulated function. More...

void setFunctionParameters (int xsize, int ysize, const std::vector< double > &values)
Set the parameters for the tabulated function. More...

Discrete2DFunctionCopy () const
Create a deep copy of the tabulated function. More...

Public Member Functions inherited from TabulatedFunction
virtual ~TabulatedFunction ()

## Detailed Description

This is a TabulatedFunction that computes a discrete two dimensional function f(x,y).

To evaluate it, x and y are each rounded to the nearest integer and the table element with those indices is returned. If either index is outside the range [0, size), the result is undefined.

## Constructor & Destructor Documentation

 Discrete2DFunction ( int xsize, int ysize, const std::vector< double > & values )

Create a Discrete2DFunction f(x,y) based on a set of tabulated values.

Parameters
 xsize the number of table elements along the x direction ysize the number of table elements along the y direction values the tabulated values of the function f(x,y), ordered so that values[i+xsize*j] = f(i,j). This must be of length xsize*ysize.

## Member Function Documentation

 Discrete2DFunction* Copy ( ) const
virtual

Create a deep copy of the tabulated function.

Implements TabulatedFunction.

 void getFunctionParameters ( int & xsize, int & ysize, std::vector< double > & values ) const

Get the parameters for the tabulated function.

Parameters
 xsize the number of table elements along the x direction ysize the number of table elements along the y direction values the tabulated values of the function f(x,y), ordered so that values[i+xsize*j] = f(i,j). This must be of length xsize*ysize.
 void setFunctionParameters ( int xsize, int ysize, const std::vector< double > & values )

Set the parameters for the tabulated function.

Parameters
 xsize the number of table elements along the x direction ysize the number of table elements along the y direction values the tabulated values of the function f(x,y), ordered so that values[i+xsize*j] = f(i,j). This must be of length xsize*ysize.

The documentation for this class was generated from the following file: