Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

# LinearFunction Class Reference

A class representing a linear function in a potential field f(x) = a*x +b. More...

`#include <PotentialFunctions.h>`

Inheritance diagram for LinearFunction:

[legend]
Collaboration diagram for LinearFunction:

[legend]
List of all members.

## Public Member Functions
| LinearFunction (double range, double atZero)
| Constructor.
virtual PotentialfieldFunction * | clone ()
| Clones a function object.
## Protected Member Functions
double | f (double x) const
| Computes the value of the function for a given x.
double | d (double x) const
| Computes the value of the derivative of the function for a given x.
virtual double | dd (double x) const
| Computes the value of the second derivative of the function for a given x.
virtual void | init ()
| Computes the values of a and b.

## Detailed Description

A class representing a linear function in a potential field f(x) = a*x +b.

Definition at line 181 of file PotentialFunctions.h.

## Constructor & Destructor Documentation

LinearFunction::LinearFunction | ( | double | range,
|  | double | atZero
| ) | `[inline]`

  | Constructor. Parameters:
  range | The range of the function
  atZero | The value of the function for x having the value 0
Definition at line 189 of file PotentialFunctions.h. References init(). Referenced by clone().

Here is the call graph for this function:

## Member Function Documentation

virtual PotentialfieldFunction* LinearFunction::clone | ( |  | ) | `[inline, virtual]`

| Clones a function object. Returns: A pointer to a copy of the object Implements PotentialfieldFunction. Definition at line 199 of file PotentialFunctions.h. References PotentialfieldFunction::getStandardParameters(), and LinearFunction().

Here is the call graph for this function:

double LinearFunction::f | ( | double | x | ) | const`[inline, protected, virtual]`

  | Computes the value of the function for a given x. Parameters:
  x | The distance for which to compute the value of the function
Returns: The value of the function Reimplemented from PotentialfieldFunction. Definition at line 211 of file PotentialFunctions.h.

double LinearFunction::d | ( | double | x | ) | const`[inline, protected, virtual]`

  | Computes the value of the derivative of the function for a given x. Parameters:
  x | The distance for which to compute the value of the function
Returns: The value of the function Reimplemented from PotentialfieldFunction. Definition at line 220 of file PotentialFunctions.h.

virtual double LinearFunction::dd | ( | double | x | ) | const`[inline, protected, virtual]`

  | Computes the value of the second derivative of the function for a given x. Parameters:
  x | The distance for which to compute the value of the function
Returns: The value of the function Reimplemented from PotentialfieldFunction. Definition at line 229 of file PotentialFunctions.h.

virtual void LinearFunction::init | ( |  | ) | `[inline, protected, virtual]`

| Computes the values of a and b. Reimplemented from PotentialfieldFunction. Definition at line 235 of file PotentialFunctions.h. Referenced by LinearFunction().

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

- Tools/PotentialFields/PotentialFunctions.h