Discrete2DFunction

class openmm.openmm.Discrete2DFunction(*args)

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.

__init__(self, xsize, ysize, values)Discrete2DFunction
__init__(self, other)Discrete2DFunction

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

Parameters
  • xsize (int) – the number of table elements along the x direction

  • ysize (int) – the number of table elements along the y direction

  • values (vector< double >) – 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.

Methods

Copy(self)

Create a deep copy of the tabulated function

__init__(-> Discrete2DFunction)

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

getFunctionParameters(self)

Get the parameters for the tabulated function.

getPeriodic(self)

Get the periodicity status of the tabulated function.

getUpdateCount(self)

Get the value of a counter that is updated every time setFunctionParameters() is called.

setFunctionParameters(self, xsize, ysize, values)

Set the parameters for the tabulated function.

Attributes

thisown

The membership flag

property thisown

The membership flag

getFunctionParameters(self)

Get the parameters for the tabulated function.

Returns

  • xsize (int) – the number of table elements along the x direction

  • ysize (int) – the number of table elements along the y direction

  • values (vector< double >) – 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.

setFunctionParameters(self, xsize, ysize, values)

Set the parameters for the tabulated function.

Parameters
  • xsize (int) – the number of table elements along the x direction

  • ysize (int) – the number of table elements along the y direction

  • values (vector< double >) – 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.

Copy(self)Discrete2DFunction

Create a deep copy of the tabulated function

Deprecated

This will be removed in a future release.

__eq__(self, other)bool
__ne__(self, other)bool
getPeriodic(self)bool

Get the periodicity status of the tabulated function.

getUpdateCount(self)int

Get the value of a counter that is updated every time setFunctionParameters() is called. This provides a fast way to detect when a function has changed.