public class Domain
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static int |
CONTINUOUS |
static int |
DISCRETE |
Constructor and Description |
---|
Domain()
This default constructor creates a new domain on (0, 1) with step size 0.1
|
Domain(double a,
double b,
double w,
int t)
This general constructor creates a new partition of a specified interval [a, b]
into subintervals of width w.
|
Modifier and Type | Method and Description |
---|---|
double |
getBound(int i)
This method returns the boundary point corresponding to a given index.
|
int |
getIndex(double x)
This method returns the index of the interval containing a given value.
|
double |
getLowerBound()
This method returns the lower bound of the domain.
|
double |
getLowerValue()
This method returns the lower midpoint of the domain.
|
double |
getNearestValue(double x)
This method returns the value (midpoint) that is closest to a given value.
|
int |
getSize()
This method returns the size of the partition (the number of subintervals).
|
int |
getType()
This method returns the type of the domain (DISCRETE or CONTINUOUS).
|
double |
getUpperBound()
This method returns the upper bound of the domain.
|
double |
getUpperValue()
This method returns the upper midpoint of the domain.
|
double |
getValue(int i)
This method return the midpoint of the interval corresponding to a given index.
|
double |
getWidth()
This method returns the width (step size) of the domain.
|
public static final int DISCRETE
public static final int CONTINUOUS
public Domain(double a, double b, double w, int t)
a
- the lower bound or valueb
- the upper bound or valuew
- the step sizet
- the type of domainpublic Domain()
public int getType()
public int getIndex(double x)
x
- a number in the domainpublic double getBound(int i)
i
- the indexpublic double getValue(int i)
i
- the indexpublic double getLowerBound()
public double getUpperBound()
public double getLowerValue()
public double getUpperValue()
public double getWidth()
public int getSize()
public double getNearestValue(double x)
x
- a number in the domain