java.lang.Object
riso.distributions.AbstractConditionalDistribution
riso.distributions.Max
- All Implemented Interfaces:
- ConditionalDistribution, java.io.Serializable
- public class Max
- extends AbstractConditionalDistribution
|
Field Summary |
(package private) int |
ninputs
This is the number of inputs for this maximum-taker. |
|
Constructor Summary |
Max()
Default constructor. |
Max(int ninputs_in)
This constructor sets the number of inputs. |
ninputs
int ninputs
- This is the number of inputs for this maximum-taker.
This is either specified directly (in a constructor) or by counting
the number of parents of the associated variable.
Max
public Max()
- Default constructor. The number of inputs is set to 0; it is assumed that a
variable will be associated with this distribution before any methods that
need the number of inputs are called.
Max
public Max(int ninputs_in)
- This constructor sets the number of inputs.
clone
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
- Return a copy of this object.
- Specified by:
clone in interface ConditionalDistribution- Overrides:
clone in class AbstractConditionalDistribution
ndimensions_child
public int ndimensions_child()
- Return the number of dimensions of the child variable.
ndimensions_parent
public int ndimensions_parent()
- Return the number of dimensions of the parent variables.
get_density
public Distribution get_density(double[] c)
throws java.lang.Exception
- For a given value
c of the parents, return a distribution
which represents p(x|C=c). Executing get_density(c).
p(x) will yield the same result as p(x,c).
p
public double p(double[] x,
double[] c)
throws java.lang.Exception
- Description copied from interface:
ConditionalDistribution
- Compute the density at the point
x.
random
public double[] random(double[] c)
throws java.lang.Exception
- Return an instance of a random variable from this distribution.
pretty_input
public void pretty_input(riso.general.SmarterTokenizer st)
throws java.io.IOException
- Read in a Max from an input stream. This is intended for
input from a human-readable source; this is different from object serialization.
The input looks like this:
{ [ninputs ninputs-value] }
If ninputs is not specified, it is determined by counting parent variables.
- Overrides:
pretty_input in class AbstractConditionalDistribution
format_string
public java.lang.String format_string(java.lang.String leading_ws)
throws java.io.IOException
- Create a description of this distribution as a string.
If this distribution is associated with a variable, the number of inputs
is not put into the description.