org.ptolemy.machineLearning

## Class Algorithms

• java.lang.Object
• org.ptolemy.machineLearning.Algorithms

• ```public class Algorithms
extends java.lang.Object```
Algorithms class.
Since:
Ptolemy II 10.0
Version:
\$Id: Algorithms.java 70402 2014-10-23 00:52:20Z cxh \$
Author:
ilgea
Accepted Rating:
 Red (cxh)
Proposed Rating:
 Red (cxh)
• ### Constructor Summary

Constructors
Constructor and Description
`Algorithms()`
• ### Method Summary

All Methods
Modifier and Type Method and Description
`static int` ```_binaryIntervalSearch(double[] A, double key)```
Do a binary interval search for the key in array A.
`static int` ```_binaryIntervalSearch(double[] A, double key, int imin, int imax)```
Do a binary interval search for the key in array A.
`static double` ```poissonPmf(int k, double mean)```
Return the probability mass function P(x=k) ~ Poisson(mean) value at k, for the Poisson distribution with parameter mean
`static double` ```poissonPmf(int k, double mean, double logFactorial)```
Return the probability mass function P(x=k) ~ Poisson(mean) value at k, for the poisson distribution with parameter mean
• ### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
• ### Constructor Detail

• #### Algorithms

`public Algorithms()`
• ### Method Detail

• #### poissonPmf

```public static double poissonPmf(int k,
double mean)
throws IllegalActionException```
Return the probability mass function P(x=k) ~ Poisson(mean) value at k, for the Poisson distribution with parameter mean
Parameters:
`k` - The value at which the probability mass function will be computed
`mean` - The mean (lambda) of the poisson distribution
Returns:
The PMF value at k.
Throws:
`IllegalActionException`
`java.lang.Exception` - If k < 0
• #### poissonPmf

```public static double poissonPmf(int k,
double mean,
double logFactorial)
throws IllegalActionException```
Return the probability mass function P(x=k) ~ Poisson(mean) value at k, for the poisson distribution with parameter mean
Parameters:
`k` - The value at which the probability mass function will be computed
`mean` - The mean (lambda) of the poisson distribution
Returns:
The PMF value at k.
Throws:
`IllegalActionException`
`java.lang.Exception` - If k < 0
• #### _binaryIntervalSearch

```public static int _binaryIntervalSearch(double[] A,
double key)```
Do a binary interval search for the key in array A. The bin index in which key is found is returned.
Parameters:
`A` - The search array
`key` - Key to be searched
Returns:
the found key index.
• #### _binaryIntervalSearch

```public static int _binaryIntervalSearch(double[] A,
double key,
int imin,
int imax)```
Do a binary interval search for the key in array A. The bin index in which key is found is returned.
Parameters:
`A` - A The search array
`key` - Key to be searched
`imin` - minimum array index to look for key
`imax` - maximum array index to look for key
Returns: