public final class JavaMathAdapter extends Object
Modifier and Type | Method and Description |
---|---|
static double |
binomialCoefficientGeneric(int a,
int b)
Compute the Binomial Coefficient, "a choose b", the number of b-element subsets that can be selected from an
a-element set.
|
static double[][] |
matrixAdd(double[][] m1,
double[][] m2)
Add 2 matrices.
|
static double[][] |
matrixMultiply(double[][] m1,
double[][] m2)
Multiply 2 matrix.
|
static void |
matrixToVector(double[][] matrix,
double[] vector,
int offset)
Copy a matrix into a vector, column per column.
|
static double[][] |
matrixTranspose(double[][] m)
Transpose a matrix.
|
static double[] |
matrixVectorMultiply(double[][] m,
double[] v)
Multiply matrix with a vector.
|
static double |
mod(double x,
double mod)
Computes "x" modulo "mod".
|
static double[] |
negate(double[] v)
Invert a vector.
|
static double[][] |
scalarMultiply(double coef,
double[][] matrix)
Return coef * matrix.
|
static double[][] |
threeDMatrixVectorMultiply(double[][][] mat,
double[] vect)
Multiply an automatically-generated-3-dimensional matrix with a vector.
|
static void |
vectorToMatrix(double[] vector,
double[][] matrix)
Copy a vector into a matrix, column per column.
|
public static double mod(double x, double mod)
x
- value to modulatemod
- modulo (for instance π)public static double binomialCoefficientGeneric(int a, int b)
a
- the size of the setb
- the size of the subsetspublic static double[][] threeDMatrixVectorMultiply(double[][][] mat, double[] vect) throws PatriusException
mat
- the 3-dimensional matrixvect
- the vectorPatriusException
- thrown if matrix dimension mismatchpublic static double[] negate(double[] v)
v
- vectorpublic static double[][] matrixAdd(double[][] m1, double[][] m2) throws PatriusException
m1
- first matrixm2
- second matrixPatriusException
- thrown if matrix dimension mismatchpublic static void vectorToMatrix(double[] vector, double[][] matrix)
vector
- vector to be copiedmatrix
- matrix where to put the datapublic static void matrixToVector(double[][] matrix, double[] vector, int offset)
matrix
- matrix from which the data is readvector
- vector in which the data is putoffset
- offset after which the data will be put in the vector thrown if dimensions mismatchpublic static double[][] matrixMultiply(double[][] m1, double[][] m2)
m1
- first Matrixm2
- second matrixpublic static double[][] matrixTranspose(double[][] m)
m
- the matrix.public static double[] matrixVectorMultiply(double[][] m, double[] v)
m
- the matrixv
- the vectorpublic static double[][] scalarMultiply(double coef, double[][] matrix)
coef
- a coefficentmatrix
- a matrixCopyright © 2019 CNES. All rights reserved.