|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmain.MoreMath
This class includes a bunch of extra mathematical functions and other math tidbits that are useful to have around. All the functions are static and all the important ones are public, so you never actually need to instantiate this class.
Nested Class Summary | |
static interface |
MoreMath.Comparer
|
class |
MoreMath.PartialDerivRec
A record class that's handy when assembling a Jacobian matrix from the Affectors' formulas rather than numerically. |
Field Summary | |
static int |
BROWN_NOISE
|
static int |
GAUSSIAN
|
static int |
UNIFORM
|
Constructor Summary | |
MoreMath()
|
Method Summary | |
static void |
calcJacobian(float[] matrix,
Cell cell,
int num_nodes,
float epsilon)
Calculates the jacobian matrix for the equations in a network around the Node values of the input cell. |
static void |
eigenvalues(float[] a,
int n,
float[] wr,
float[] wi)
Numerical recipes in C code for finding eigenvalues of a general, real, non-symmetric matrix. |
static double |
getStdDev(double sum,
double sum_sqr,
int num)
Returns the standard deviation. |
static float |
getStdDev(float sum,
float sum_sqr,
int num)
|
static float |
pickRandomLinear(float min,
float max)
|
static float |
pickRandomLogarithmic(float min,
float max)
|
static float |
randNeg(int mode)
|
static float |
random()
|
static float |
random(int mode)
|
static int |
randomInt(int min,
int max)
Returns an integer between min and max - 1. |
static void |
randomize(int[] array)
Randomizes the elements in the array. |
static void |
setRandomSeed(int seed)
|
static void |
sort(java.lang.Object[] a,
MoreMath.Comparer comparer)
|
static void |
sort(java.lang.Object[] a,
java.lang.Object[] b,
int from,
int to,
boolean ascending,
MoreMath.Comparer comparer)
Sort a and b, using a as the reference - stolen from somewhere on internet |
static double |
sqr(double num)
Returns num * num |
static float |
sqr(float num)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int UNIFORM
public static final int GAUSSIAN
public static final int BROWN_NOISE
Constructor Detail |
public MoreMath()
Method Detail |
public static double sqr(double num)
public static float sqr(float num)
public static double getStdDev(double sum, double sum_sqr, int num)
public static float getStdDev(float sum, float sum_sqr, int num)
public static void setRandomSeed(int seed)
public static float random()
public static float random(int mode)
public static float randNeg(int mode)
public static int randomInt(int min, int max)
public static float pickRandomLinear(float min, float max)
public static float pickRandomLogarithmic(float min, float max)
public static void randomize(int[] array)
public static void calcJacobian(float[] matrix, Cell cell, int num_nodes, float epsilon)
public static void eigenvalues(float[] a, int n, float[] wr, float[] wi) throws java.lang.Exception
java.lang.Exception
public static void sort(java.lang.Object[] a, MoreMath.Comparer comparer)
public static void sort(java.lang.Object[] a, java.lang.Object[] b, int from, int to, boolean ascending, MoreMath.Comparer comparer)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |