|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--ru.sscc.util.data.RealMath
A collection of basic algebraic operations with real vectors.
| Field Summary | |
static double |
DBL_EPSILON
Smallest double value such that 1+DBL_EPSILON isn't equal to 1. |
static float |
FLT_EPSILON
Smallest float value such that 1+FLT_EPSILON isn't equal to 1. |
| Method Summary | |
static void |
addVector(double[] vector1,
int index1,
int step1,
double[] vector2,
int index2,
int step2,
double factor,
int count)
Operation vector1 = vector1 + factor * vector2. |
static void |
addVector(float[] vector1,
int index1,
int step1,
float[] vector2,
int index2,
int step2,
double factor,
int count)
Operation vector1 = vector1 + factor * vector2. |
static void |
addVector(RealPointer p1,
RealPointer p2,
double factor,
int count)
Operation p1 = p1 + factor * p2. |
static void |
assign(double[] vector1,
int index1,
int step1,
double[] vector2,
int index2,
int step2,
int count)
Assignment vector1 = vector2. |
static void |
assign(double[] vector,
int index,
int step,
double value,
int count)
Assignment vector = value. |
static void |
assign(float[] vector,
int index,
int step,
double value,
int count)
Assignment vector = value. |
static void |
assign(float[] vector1,
int index1,
int step1,
float[] vector2,
int index2,
int step2,
int count)
Assignment vector1 = vector2. |
static void |
assign(RealPointer p1,
double[] vector2,
int index2,
int step2,
int count)
Assignment p1 = vector2. |
static void |
assign(RealPointer p,
double value,
int count)
Assignment p = value. |
static void |
assign(RealPointer p1,
float[] vector2,
int index2,
int step2,
int count)
Assignment p1 = vector2. |
static void |
assign(RealPointer p1,
RealPointer p2,
double factor,
int count)
Assignement p1 = factor*p2. |
static void |
assign(RealPointer p1,
RealPointer p2,
int count)
Assignment p1 = p2. |
static double |
factorial(int n)
Calculates n! -- the factorial of n. |
static int |
indexOfNormMax(double[] vector,
int index,
int step,
int count)
Calculates the index of the first entry having the maximum module for the vector stored in the double[] type array. |
static int |
indexOfNormMax(float[] vector,
int index,
int step,
int count)
Calculates the index of the first entry having the maximum module for the vector stored in the float[] type array. |
static int |
indexOfNormMax(RealPointer p,
int count)
Calculates the index of the first entry having the maximum module for the vector presented by RealPointer. |
static double |
innerProduct(double[] vector1,
int index1,
int step1,
double[] vector2,
int index2,
int step2,
int count)
Calculates an inner product of two vectors stored in double[] type arrays. |
static double |
innerProduct(float[] vector1,
int index1,
int step1,
float[] vector2,
int index2,
int step2,
int count)
Calculates an inner product of two vectors stored in float[] type arrays. |
static double |
innerProduct(RealPointer p1,
RealPointer p2,
int count)
Calculates an inner product of two vectors presented by RealPointer pointers. |
static void |
multiply(double[] vector,
int index,
int step,
double value,
int count)
Multiplication of a vector by a value. |
static void |
multiply(float[] vector,
int index,
int step,
double value,
int count)
Multiplication of a vector by a value. |
static void |
multiply(RealPointer p,
double value,
int count)
Multiplication of a vector by a value. |
static double |
norm(RealPointer p,
int count)
Calculates the euqlidian norm of a vector presented by RealPointer. |
static double |
normMax(double[] vector,
int index,
int step,
int count)
Calculates the maximum modules norm of the vector stored in the double[] type array. |
static double |
normMax(float[] vector,
int index,
int step,
int count)
Calculates the maximum modules norm of the vector stored in the float[] type array. |
static double |
normMax(RealPointer p,
int count)
Calculates the maximum modules norm of a vector presented by RealPointer. |
static double |
normSum(double[] vector,
int index,
int step,
int count)
Calculates the sum of modules norm of the vector stored in the double[] type array. |
static double |
normSum(float[] vector,
int index,
int step,
int count)
Calculates the sum of modules norm of the vector stored in the float[] type array. |
static double |
normSum(RealPointer p,
int count)
Calculates the sum of modules norm of a vector presented by RealPointer. |
static double |
polynomial(double[] vector,
int index,
int step,
double x,
int degree)
Calculates a polynomial of required degree at the point x. |
static double |
polynomial(float[] vector,
int index,
int step,
double x,
int degree)
Calculates a polynomial of required degree at the point x. |
static double |
polynomial(RealPointer vector,
double x,
int degree)
Calculates a polynomial of required degree at the point x. |
static double |
power(double x,
int n)
Calculate xn -- x powered to the integer power n. |
static void |
recalculatePolynomial(double[] source,
int index1,
int step1,
double[] target,
int index2,
int step2,
double x,
int degree)
Recalculates polynomial representation with respect to a point x using its representation at zero (source and target coefficient vectors may coinside). |
static void |
recalculatePolynomial(float[] source,
int index1,
int step1,
float[] target,
int index2,
int step2,
double x,
int degree)
Recalculates polynomial representation with respect to a point x using its representation at zero (source and target coefficient vectors may coinside). |
static void |
recalculatePolynomial(RealPointer source,
RealPointer target,
double x,
int degree)
Recalculates polynomial representation with respect to a point x using its representation at zero (source and target coefficient vectors may coinside). |
static double |
squaredDistance(double[] vector1,
int index1,
double[] vector2,
int index2,
int count)
Calculates the squared euqlidian distance between two vectors stored in double[] type arrays. |
static double |
squaredDistance(double[] vector1,
int index1,
float[] vector2,
int index2,
int count)
Calculates the squared euqlidian distance between two vectors stored in double[] and float[] type arrays respectively. |
static double |
squaredDistance(float[] vector1,
int index1,
float[] vector2,
int index2,
int count)
Calculates the squared euqlidian distance between two vectors stored in float[] type arrays. |
static double |
squaredDistance(RealPointer p1,
double[] vector2,
int index2,
int count)
Calculates the squared euqlidian distance between a vector presented by real pointer and a vector stored in double[] type array. |
static double |
squaredDistance(RealPointer p1,
float[] vector2,
int index2,
int count)
Calculates the squared euqlidian distance between a vector presented by real pointer and a vector stored in float[] type array. |
static double |
squaredDistance(RealPointer p1,
RealPointer p2,
int count)
Calculates a squared euqlidian distance between two vectors. |
static void |
swap(double[] vector1,
int index1,
int step1,
double[] vector2,
int index2,
int step2,
int count)
Swaps entries of vector1 with corresponding entries of vector2 for the double[] type storage. |
static void |
swap(float[] vector1,
int index1,
int step1,
float[] vector2,
int index2,
int step2,
int count)
Swaps entries of vector1 with corresponding entries of vector2 for the float[] type storage. |
static double |
weightedNorm(RealPointer p,
RealPointer weight,
int count)
Calculates the weighted euqlidian norm of a vector presented by RealPointer. |
static double |
weightedNormMax(double[] vector,
int index,
int step,
RealPointer weight,
int count)
Calculates the weighted maximum modules norm of the vector stored in the double[] type array. |
static double |
weightedNormMax(float[] vector,
int index,
int step,
RealPointer weight,
int count)
Calculates the weighted maximum modules norm of the vector stored in the float[] type array. |
static double |
weightedNormMax(RealPointer p,
RealPointer weight,
int count)
Calculates the weighted maximum modules norm of a vector presented by RealPointer. |
static double |
weightedNormSum(double[] vector,
int index,
int step,
RealPointer weight,
int count)
Calculates the weighted sum of modules norm of the vector stored in the double[] type array. |
static double |
weightedNormSum(float[] vector,
int index,
int step,
RealPointer weight,
int count)
Calculates the weighted sum of modules norm of the vector stored in the float[] type array. |
static double |
weightedNormSum(RealPointer p,
RealPointer weight,
int count)
Calculates the weighted sum of modules norm of a vector presented by RealPointer. |
static double |
weightedProduct(double[] vector1,
int index1,
int step1,
double[] vector2,
int index2,
int step2,
RealPointer weight,
int count)
Calculates the weighted inner product of two vectors stored in double[] type arrays. |
static double |
weightedProduct(float[] vector1,
int index1,
int step1,
float[] vector2,
int index2,
int step2,
RealPointer weight,
int count)
Calculates the weighted inner product of two vectors stored in float[] type arrays. |
static double |
weightedProduct(RealPointer p1,
RealPointer p2,
RealPointer weight,
int count)
Calculates the weighted inner product of two vectors presented by RealPointer pointers. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
public static final double DBL_EPSILON
public static final float FLT_EPSILON
| Method Detail |
public static void assign(double[] vector,
int index,
int step,
double value,
int count)
vector - a container for the vectorindex - a starting indexstep - an increment stepvalue - a value to assigncount - a vector size
public static void assign(float[] vector,
int index,
int step,
double value,
int count)
vector - a container for the vectorindex - a starting indexstep - an increment stepvalue - a value to assigncount - a vector size
public static void assign(RealPointer p,
double value,
int count)
RealPointer pointer.p - a pointer to the vectorvalue - a value to assigncount - a vector size
public static void assign(double[] vector1,
int index1,
int step1,
double[] vector2,
int index2,
int step2,
int count)
vector1 - a container for the first vectorindex1 - a starting index for the first vectorstep1 - an increment step for the first vectorvector2 - a container for the second vectorindex2 - a starting index for the second vectorstep2 - an increment step for the second vectorcount - a vector size
public static void assign(float[] vector1,
int index1,
int step1,
float[] vector2,
int index2,
int step2,
int count)
vector1 - a container for the first vectorindex1 - a starting index for the first vectorstep1 - an increment step for the first vectorvector2 - a container for the second vectorindex2 - a starting index for the second vectorstep2 - an increment step for the second vectorcount - a vector size
public static void assign(RealPointer p1,
double[] vector2,
int index2,
int step2,
int count)
p1 - a pointer to the first vectorvector2 - a container for the second vectorindex2 - a starting index for the second vectorstep2 - an increment step for the second vectorcount - a vector size
public static void assign(RealPointer p1,
float[] vector2,
int index2,
int step2,
int count)
p1 - a pointer to the first vectorvector2 - a container for the second vectorindex2 - a starting index for the second vectorstep2 - an increment step for the second vectorcount - a vector size
public static void assign(RealPointer p1,
RealPointer p2,
int count)
RealPointer pointers.p1 - a pointer to the first (target) vectorp2 - a pointer to the second (source) vectorcount - a vector size
public static void assign(RealPointer p1,
RealPointer p2,
double factor,
int count)
RealPointer pointers.p1 - a pointer to the first (target) vectorp2 - a pointer to the second (source) vectorfactor - a multiplecount - a vector size
public static void addVector(double[] vector1,
int index1,
int step1,
double[] vector2,
int index2,
int step2,
double factor,
int count)
vector1 - a container for the first vectorindex1 - a starting index for the first vectorstep1 - an increment step for the first vectorvector2 - a container for the second vectorindex2 - a starting index for the second vectorstep2 - an increment step for the second vectorfactor - a multipliercount - a vector size
public static void addVector(float[] vector1,
int index1,
int step1,
float[] vector2,
int index2,
int step2,
double factor,
int count)
vector1 - a container for the first vectorindex1 - a starting index for the first vectorstep1 - an increment step for the first vectorvector2 - a container for the second vectorindex2 - a starting index for the second vectorstep2 - an increment step for the second vectorfactor - a multipliercount - a vector size
public static void addVector(RealPointer p1,
RealPointer p2,
double factor,
int count)
RealPointer pointers.p1 - a pointer to the first vectorp2 - a pointer to the second vectorfactor - a multipliercount - a vector length
public static void multiply(double[] vector,
int index,
int step,
double value,
int count)
vector - a container for the vectorindex - a starting indexstep - an increment stepvalue - a value to multiplycount - a vector size
public static void multiply(float[] vector,
int index,
int step,
double value,
int count)
vector - a container for the vectorindex - a starting indexstep - an increment stepvalue - a value to multiplycount - a vector size
public static void multiply(RealPointer p,
double value,
int count)
RealPointer pointer.p - a pointer to the vectorvalue - a value to multiplycount - a vector size
public static double innerProduct(double[] vector1,
int index1,
int step1,
double[] vector2,
int index2,
int step2,
int count)
vector1 - a container for the first vectorindex1 - a starting index for the first vectorstep1 - an increment step for the first vectorvector2 - a container for the second vectorindex2 - a starting index for the second vectorstep2 - an increment step for the second vectorcount - a vector size
public static double innerProduct(float[] vector1,
int index1,
int step1,
float[] vector2,
int index2,
int step2,
int count)
vector1 - a container for the first vectorindex1 - a starting index for the first vectorstep1 - an increment step for the first vectorvector2 - a container for the second vectorindex2 - a starting index for the second vectorstep2 - an increment step for the second vectorcount - a vector size
public static double innerProduct(RealPointer p1,
RealPointer p2,
int count)
RealPointer pointers.p1 - a pointer to the first vectorp2 - a pointer to the second vectorcount - a vector size
public static double weightedProduct(double[] vector1,
int index1,
int step1,
double[] vector2,
int index2,
int step2,
RealPointer weight,
int count)
vector1 - a container for the first vectorindex1 - a starting index for the first vectorstep1 - an increment step for the first vectorvector2 - a container for the second vectorindex2 - a starting index for the second vectorstep2 - an increment step for the second vectorweight - a pointer to the weight vector (may be equal to null)count - a vector size
public static double weightedProduct(float[] vector1,
int index1,
int step1,
float[] vector2,
int index2,
int step2,
RealPointer weight,
int count)
vector1 - a container for the first vectorindex1 - a starting index for the first vectorstep1 - an increment step for the first vectorvector2 - a container for the second vectorindex2 - a starting index for the second vectorstep2 - an increment step for the second vectorweight - a pointer to the weight vector (may be equal to null)count - a vector size
public static double weightedProduct(RealPointer p1,
RealPointer p2,
RealPointer weight,
int count)
RealPointer pointers.p1 - a pointer to the first vectorp2 - a pointer to the second vectorweight - a pointer to the weight vector (may be equal to null)count - a vector size
public static double norm(RealPointer p,
int count)
RealPointer.p - a pointer to the vectorcount - a vector size
public static double normMax(double[] vector,
int index,
int step,
int count)
vector - the container for the vectorindex - the starting indexstep - the increment stepcount - the vector size
public static double normMax(float[] vector,
int index,
int step,
int count)
vector - the container for the vectorindex - the starting indexstep - the increment stepcount - the vector size
public static double normMax(RealPointer p,
int count)
p - a pointer to the vectorcount - a vector size
public static double normSum(double[] vector,
int index,
int step,
int count)
vector - the container for the vectorindex - the starting indexstep - the increment stepcount - the vector size
public static double normSum(float[] vector,
int index,
int step,
int count)
vector - the container for the vectorindex - the starting indexstep - the increment stepcount - the vector size
public static double normSum(RealPointer p,
int count)
RealPointer.p - a pointer to the vectorcount - a vector size
public static int indexOfNormMax(double[] vector,
int index,
int step,
int count)
vector - the container for the vectorindex - the starting indexstep - the increment stepcount - the vector size
public static int indexOfNormMax(float[] vector,
int index,
int step,
int count)
vector - the container for the vectorindex - the starting indexstep - the increment stepcount - the vector size
public static int indexOfNormMax(RealPointer p,
int count)
p - a pointer to the vectorcount - the vector size
public static double weightedNorm(RealPointer p,
RealPointer weight,
int count)
RealPointer.p - a pointer to the vectorweight - a pointer to the weight vector (may be equal to null)count - a vector size
public static double weightedNormMax(double[] vector,
int index,
int step,
RealPointer weight,
int count)
vector - the container for the vectorindex - the starting indexstep - the increment stepweight - a pointer to the weight vector (may be equal to null)count - the vector size
public static double weightedNormMax(float[] vector,
int index,
int step,
RealPointer weight,
int count)
vector - the container for the vectorindex - the starting indexstep - the increment stepweight - a pointer to the weight vector (may be equal to null)count - the vector size
public static double weightedNormMax(RealPointer p,
RealPointer weight,
int count)
p - a pointer to the vectorweight - a pointer to the weight vector (may be equal to null)count - a vector size
public static double weightedNormSum(double[] vector,
int index,
int step,
RealPointer weight,
int count)
vector - the container for the vectorindex - the starting indexstep - the increment stepweight - the pointer to the weight vector (may be equal to null)count - the vector size
public static double weightedNormSum(float[] vector,
int index,
int step,
RealPointer weight,
int count)
vector - the container for the vectorindex - the starting indexstep - the increment stepweight - the pointer to the weight vector (may be equal to null)count - the vector size
public static double weightedNormSum(RealPointer p,
RealPointer weight,
int count)
p - a pointer to the vectorweight - a pointer to the weight vector (may be equal to null)count - a vector size
public static void swap(double[] vector1,
int index1,
int step1,
double[] vector2,
int index2,
int step2,
int count)
vector1 - a container for the first vectorindex1 - a starting index for the first vectorstep1 - an increment step for the first vectorvector2 - a container for the second vectorindex2 - a starting index for the second vectorstep2 - an increment step for the second vectorcount - a vector size
public static void swap(float[] vector1,
int index1,
int step1,
float[] vector2,
int index2,
int step2,
int count)
vector1 - a container for the first vectorindex1 - a starting index for the first vectorstep1 - an increment step for the first vectorvector2 - a container for the second vectorindex2 - a starting index for the second vectorstep2 - an increment step for the second vectorcount - a vector size
public static double squaredDistance(double[] vector1,
int index1,
double[] vector2,
int index2,
int count)
vector1 - a container for the first vectorindex1 - a starting index in the first vectorvector2 - a container for the second vectorindex2 - a starting index in the second vectorcount - a vector size
public static double squaredDistance(double[] vector1,
int index1,
float[] vector2,
int index2,
int count)
vector1 - a container for the first vectorindex1 - a starting index in the first vectorvector2 - a container for the second vectorindex2 - a starting index in the second vectorcount - a vector size
public static double squaredDistance(float[] vector1,
int index1,
float[] vector2,
int index2,
int count)
vector1 - a container for the first vectorindex1 - a starting index in the first vectorvector2 - a container for the second vectorindex2 - a starting index in the second vectorcount - a vector size
public static double squaredDistance(RealPointer p1,
double[] vector2,
int index2,
int count)
p1 - a pointer to the first vectorvector2 - a container for the second vectorindex2 - a starting index in the second vectorcount - a vector size
public static double squaredDistance(RealPointer p1,
float[] vector2,
int index2,
int count)
p1 - a pointer to the first vectorvector2 - a container for the second vectorindex2 - a starting index in the second vectorcount - a vector size
public static double squaredDistance(RealPointer p1,
RealPointer p2,
int count)
p1 - a pointer to the first vectorp2 - a pointer to the second vectorcount - a vector size
public static double polynomial(double[] vector,
int index,
int step,
double x,
int degree)
vector - contains polynomial coefficientsindex - a starting position in the vectorstep - a distance between neighboring coefficientsx - a point to calculatedegree - a degree of polynomial
public static double polynomial(float[] vector,
int index,
int step,
double x,
int degree)
vector - contains polynomial coefficientsindex - a starting position in the vectorstep - a distance between neighboring coefficientsx - a point to calculatedegree - a degree of polynomial
public static double polynomial(RealPointer vector,
double x,
int degree)
vector - a pointer to polynomial coefficientsx - a point to calculatedegree - a degree of polynomial
public static void recalculatePolynomial(double[] source,
int index1,
int step1,
double[] target,
int index2,
int step2,
double x,
int degree)
source - contains source polynomial representation at zerotarget - a pointer to the target polynomial representation at xx - a point to recalculate the polynomialdegree - a polynomial degree (if degree<0, nothing happens)
public static void recalculatePolynomial(float[] source,
int index1,
int step1,
float[] target,
int index2,
int step2,
double x,
int degree)
source - contains source polynomial representation at zerotarget - a pointer to the target polynomial representation at xx - a point to recalculate the polynomialdegree - a polynomial degree (if degree<0, nothing happens)
public static void recalculatePolynomial(RealPointer source,
RealPointer target,
double x,
int degree)
source - a pointer to the source polynomial representation at zerotarget - a pointer to the target polynomial representation at xx - a point to recalculate the polynomialdegree - a polynomial degree (if degree<0, nothing happens)public static double factorial(int n)
public static double power(double x,
int n)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||