|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.simulator.math.Mathematics
public class Mathematics
This class contains a collection of mathematical functions like the faculty, logarithms and several trigonometric functions.
Constructor Summary | |
---|---|
Mathematics()
|
Method Summary | |
---|---|
static double |
factorial(double n)
This method computes the factorial! |
static int |
min(int x,
int y,
int z)
This just computes the minimum of three integer values. |
static void |
scale(double scale,
double[] vec)
Scales a vector with the given scalar. |
static void |
svMult(double s,
double[] v,
double[] res)
Multiplies (scales) every element of the array v with s in place. |
static void |
svvAddAndScale(double s,
double[] v,
double[] w,
double[] res)
Add vectors scaled: res[i] = s*(v[i] + w[i]) |
static void |
svvAddScaled(double s,
double[] v,
double[] w,
double[] res)
Add vectors scaled: res[i] = s*v[i] + w[i] |
static void |
swap(double a,
double b)
Swaps a and b if a is greater then b. |
static void |
vvAdd(double[] v1,
double[] v2,
double[] res)
Add vectors in place setting res = v1 + v2. |
static void |
vvAddOffs(double[] v1,
int v1Offs,
double[] v2,
int v2Offs,
double[] res,
int resOffs,
int len)
Add vectors in place setting with an offset within the target vector, meaning that res[resOffs+i]=v1[v1Offs+i]+v2[v2Offs+i] for i in length. |
static double[] |
vvSub(double[] a,
double[] b)
Subtract vectors returning a new vector c = a - b. |
static void |
vvSub(double[] a,
double[] b,
double[] res)
Subtract vectors returning a new vector c = a - b. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Mathematics()
Method Detail |
---|
public static final double factorial(double n)
n
-
public static final void swap(double a, double b)
a
- b
- public static int min(int x, int y, int z)
x
- y
- z
-
public static void scale(double scale, double[] vec)
scale
- vec
- public static void svMult(double s, double[] v, double[] res)
s
- a scalarv
- an array to be multiplied with s.public static void svvAddAndScale(double s, double[] v, double[] w, double[] res)
s
- v
- w
- public static void svvAddScaled(double s, double[] v, double[] w, double[] res)
s
- v
- w
- public static void vvAdd(double[] v1, double[] v2, double[] res)
v1
- v2
- public static void vvAddOffs(double[] v1, int v1Offs, double[] v2, int v2Offs, double[] res, int resOffs, int len)
v1
- v2
- public static double[] vvSub(double[] a, double[] b)
a
- b
-
public static void vvSub(double[] a, double[] b, double[] res)
a
- b
-
|
Generated December 13 2012 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |