All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
TabulatedFunction.h
#ifndef OPENMM_TABULATEDFUNCTION_H_
#define OPENMM_TABULATEDFUNCTION_H_
/* -------------------------------------------------------------------------- *
* OpenMM *
* -------------------------------------------------------------------------- *
* This is part of the OpenMM molecular simulation toolkit originating from *
* Simbios, the NIH National Center for Physics-Based Simulation of *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2014 Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the "Software"), *
* to deal in the Software without restriction, including without limitation *
* the rights to use, copy, modify, merge, publish, distribute, sublicense, *
* and/or sell copies of the Software, and to permit persons to whom the *
* Software is furnished to do so, subject to the following conditions: *
* *
* The above copyright notice and this permission notice shall be included in *
* all copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
* THE AUTHORS, CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
#include "internal/windowsExport.h"
#include <vector>
namespace OpenMM {
class OPENMM_EXPORT TabulatedFunction {
public:
virtual ~TabulatedFunction() {
}
virtual TabulatedFunction* Copy() const = 0;
};
class OPENMM_EXPORT Continuous1DFunction : public TabulatedFunction {
public:
Continuous1DFunction(const std::vector<double>& values, double min, double max);
void getFunctionParameters(std::vector<double>& values, double& min, double& max) const;
void setFunctionParameters(const std::vector<double>& values, double min, double max);
Continuous1DFunction* Copy() const;
private:
std::vector<double> values;
double min, max;
};
class OPENMM_EXPORT Continuous2DFunction : public TabulatedFunction {
public:
Continuous2DFunction(int xsize, int ysize, const std::vector<double>& values, double xmin, double xmax, double ymin, double ymax);
void getFunctionParameters(int& xsize, int& ysize, std::vector<double>& values, double& xmin, double& xmax, double& ymin, double& ymax) const;
void setFunctionParameters(int xsize, int ysize, const std::vector<double>& values, double xmin, double xmax, double ymin, double ymax);
Continuous2DFunction* Copy() const;
private:
std::vector<double> values;
int xsize, ysize;
double xmin, xmax, ymin, ymax;
};
class OPENMM_EXPORT Continuous3DFunction : public TabulatedFunction {
public:
Continuous3DFunction(int xsize, int ysize, int zsize, const std::vector<double>& values, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax);
void getFunctionParameters(int& xsize, int& ysize, int& zsize, std::vector<double>& values, double& xmin, double& xmax, double& ymin, double& ymax, double& zmin, double& zmax) const;
void setFunctionParameters(int xsize, int ysize, int zsize, const std::vector<double>& values, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax);
Continuous3DFunction* Copy() const;
private:
std::vector<double> values;
int xsize, ysize, zsize;
double xmin, xmax, ymin, ymax, zmin, zmax;
};
class OPENMM_EXPORT Discrete1DFunction : public TabulatedFunction {
public:
Discrete1DFunction(const std::vector<double>& values);
void getFunctionParameters(std::vector<double>& values) const;
void setFunctionParameters(const std::vector<double>& values);
Discrete1DFunction* Copy() const;
private:
std::vector<double> values;
};
class OPENMM_EXPORT Discrete2DFunction : public TabulatedFunction {
public:
Discrete2DFunction(int xsize, int ysize, const std::vector<double>& values);
void getFunctionParameters(int& xsize, int& ysize, std::vector<double>& values) const;
void setFunctionParameters(int xsize, int ysize, const std::vector<double>& values);
Discrete2DFunction* Copy() const;
private:
int xsize, ysize;
std::vector<double> values;
};
class OPENMM_EXPORT Discrete3DFunction : public TabulatedFunction {
public:
Discrete3DFunction(int xsize, int ysize, int zsize, const std::vector<double>& values);
void getFunctionParameters(int& xsize, int& ysize, int& zsize, std::vector<double>& values) const;
void setFunctionParameters(int xsize, int ysize, int zsize, const std::vector<double>& values);
Discrete3DFunction* Copy() const;
private:
int xsize, ysize, zsize;
std::vector<double> values;
};
} // namespace OpenMM
#endif /*OPENMM_TABULATEDFUNCTION_H_*/
OpenMM::TabulatedFunction
A TabulatedFunction uses a set of tabulated values to define a mathematical function.
Definition: TabulatedFunction.h:58
OpenMM::Discrete3DFunction
This is a TabulatedFunction that computes a discrete three dimensional function f(x,y,z).
Definition: TabulatedFunction.h:325
OpenMM::Discrete2DFunction
This is a TabulatedFunction that computes a discrete two dimensional function f(x,y).
Definition: TabulatedFunction.h:282
OpenMM::Discrete1DFunction
This is a TabulatedFunction that computes a discrete one dimensional function f(x).
Definition: TabulatedFunction.h:249
OpenMM::Continuous1DFunction
This is a TabulatedFunction that computes a continuous one dimensional function.
Definition: TabulatedFunction.h:68
OpenMM::Continuous2DFunction
This is a TabulatedFunction that computes a continuous two dimensional function.
Definition: TabulatedFunction.h:112
OpenMM::Continuous3DFunction
This is a TabulatedFunction that computes a continuous three dimensional function.
Definition: TabulatedFunction.h:172
OpenMM::TabulatedFunction::~TabulatedFunction
virtual ~TabulatedFunction()
Definition: TabulatedFunction.h:60
OpenMM
Definition: AndersenThermostat.h:40