Class SquareWell

java.lang.Object
  |
  +--SquareWell
Direct Known Subclasses:
MultipleWells

class SquareWell
extends java.lang.Object
implements Function

A function which is constantly zero, except for exactly one finite interval, in which it takes a single different constant value (the "depth").


Field Summary
static double DEFAULT_DEPTH
           
static double DEFAULT_SHIFT
           
static double DEFAULT_WIDTH
           
protected  double depth
           
protected  double shift
           
protected  double width
           
 
Constructor Summary
SquareWell()
          Creates a new square well function, centred on the origin, with default width and depth.
SquareWell(double depth)
          Creates a new square well function, centred on the origin, with default width.
SquareWell(double depth, double width)
          Creates a new square well function, centred on the origin.
SquareWell(double depth, double width, double shift)
          Creates a new square well function
 
Method Summary
 double evaluate(double x)
           
 double getDepth()
          Returns the depth of the well
 double getLeft()
          Returns the x coordinate of the left-hand edge of the well
 double[] getMarkers(double minX, double minY)
          Returns an array containing x coordinates of all discontinuities within the specified interval.
 double getRight()
          Returns the x coordinate of the right-hand edge of the well
 double getShift()
          Returns the x coordinate of the centre of the well
 double getWidth()
          Returns the width of the well
 void setDepth(double d)
          Sets the width of the well
 void setShift(double d)
          Sets the width of the well
 void setWidth(double d)
          Sets the width of the well
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

depth

protected double depth

width

protected double width

shift

protected double shift

DEFAULT_DEPTH

public static final double DEFAULT_DEPTH

DEFAULT_WIDTH

public static final double DEFAULT_WIDTH

DEFAULT_SHIFT

public static final double DEFAULT_SHIFT
Constructor Detail

SquareWell

public SquareWell(double depth,
                  double width,
                  double shift)
Creates a new square well function
Parameters:
depth - The depth of the well
width - The width of the well
shift - The x coordinate of the centre of the well

SquareWell

public SquareWell(double depth,
                  double width)
Creates a new square well function, centred on the origin.
Parameters:
depth - The depth of the well
width - The width of the well

SquareWell

public SquareWell(double depth)
Creates a new square well function, centred on the origin, with default width.
Parameters:
depth - The depth of the well

SquareWell

public SquareWell()
Creates a new square well function, centred on the origin, with default width and depth.
Method Detail

evaluate

public double evaluate(double x)
Specified by:
evaluate in interface Function

getMarkers

public double[] getMarkers(double minX,
                           double minY)
Returns an array containing x coordinates of all discontinuities within the specified interval.

getDepth

public double getDepth()
Returns the depth of the well

getWidth

public double getWidth()
Returns the width of the well

getShift

public double getShift()
Returns the x coordinate of the centre of the well

getLeft

public double getLeft()
Returns the x coordinate of the left-hand edge of the well

getRight

public double getRight()
Returns the x coordinate of the right-hand edge of the well

setWidth

public void setWidth(double d)
Sets the width of the well

setDepth

public void setDepth(double d)
Sets the width of the well

setShift

public void setShift(double d)
Sets the width of the well