Class ShapeSpread

java.lang.Object
  extended byShapeFunction
      extended byShapeSpread

public class ShapeSpread
extends ShapeFunction

ShapeSpread -- Payoff function for a spread option at expiry

See Also:
Solution.discretize(ShapeFunction)

Field Summary
 
Fields inherited from class ShapeFunction
amplitude, curvature, position, slope, width
 
Constructor Summary
ShapeSpread(double position, double amplitude, double width)
          Creates an instance of the class
 
Method Summary
 double getValue(double xa)
          Evaluates the shape for a real argument
 double getValue(Mesh mesh, double xa)
          Evaluates the shape on a discrete mesh point position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShapeSpread

public ShapeSpread(double position,
                   double amplitude,
                   double width)
Creates an instance of the class

Parameters:
position - The starting point
amplitude - The offset
width - The width
Method Detail

getValue

public double getValue(double xa)
Evaluates the shape for a real argument

Specified by:
getValue in class ShapeFunction
Parameters:
xa - The argument
Returns:
The value of the function for this argument

getValue

public double getValue(Mesh mesh,
                       double xa)
Evaluates the shape on a discrete mesh point position.

Specified by:
getValue in class ShapeFunction
Parameters:
mesh - The mesh coordinates
xa - The argument
Returns:
The value of the function at the specified mesh location