Class MatrixFunctions
java.lang.Object
org.jblas.MatrixFunctions
This class provides the functions from java.lang.Math for matrices. The
functions are applied to each element of the matrix.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic doubleabs(double x) static floatabs(float x) static DoubleMatrixabs(DoubleMatrix x) Returns a copy of this matrix where all elements are set to their absolute values.static FloatMatrixabs(FloatMatrix x) Returns a copy of this matrix where all elements are set to their absolute values.static ComplexDoubleMatrixstatic ComplexFloatMatrixstatic DoubleMatrixabsi(DoubleMatrix x) Sets all elements in this matrix to their absolute values.static FloatMatrixabsi(FloatMatrix x) Sets all elements in this matrix to their absolute values.static doubleacos(double x) static floatacos(float x) static DoubleMatrixacos(DoubleMatrix x) Returns a copy of this matrix where the trigonometric acos function is applied element wise.static FloatMatrixacos(FloatMatrix x) Returns a copy of this matrix where the trigonometric acos function is applied element wise.static DoubleMatrixApplies the trigonometric arccosine function element wise on this matrix.static FloatMatrixacosi(FloatMatrix x) Applies the trigonometric arccosine function element wise on this matrix.static doubleasin(double x) static floatasin(float x) static DoubleMatrixasin(DoubleMatrix x) static FloatMatrixasin(FloatMatrix x) static DoubleMatrixApplies the trigonometric arcsine function element wise on this matrix.static FloatMatrixasini(FloatMatrix x) Applies the trigonometric arcsine function element wise on this matrix.static doubleatan(double x) static floatatan(float x) static DoubleMatrixatan(DoubleMatrix x) static FloatMatrixatan(FloatMatrix x) static DoubleMatrixApplies the trigonometric arctangend function element wise on this matrix.static FloatMatrixatani(FloatMatrix x) Applies the trigonometric arctangend function element wise on this matrix.static doublecbrt(double x) static floatcbrt(float x) static DoubleMatrixcbrt(DoubleMatrix x) static FloatMatrixcbrt(FloatMatrix x) static DoubleMatrixApplies the cube root function element wise on this matrix.static FloatMatrixcbrti(FloatMatrix x) Applies the cube root function element wise on this matrix.static doubleceil(double x) static floatceil(float x) static DoubleMatrixceil(DoubleMatrix x) static FloatMatrixceil(FloatMatrix x) static DoubleMatrixElement-wise round up by applying the ceil function on each element.static FloatMatrixceili(FloatMatrix x) Element-wise round up by applying the ceil function on each element.static doublecos(double x) static floatcos(float x) static DoubleMatrixcos(DoubleMatrix x) static FloatMatrixcos(FloatMatrix x) static doublecosh(double x) static floatcosh(float x) static DoubleMatrixcosh(DoubleMatrix x) static FloatMatrixcosh(FloatMatrix x) static DoubleMatrixApplies the hyperbolic cosine function element-wise on this matrix.static FloatMatrixcoshi(FloatMatrix x) Applies the hyperbolic cosine function element-wise on this matrix.static DoubleMatrixcosi(DoubleMatrix x) Applies the cosine function element-wise on this matrix.static FloatMatrixcosi(FloatMatrix x) Applies the cosine function element-wise on this matrix.static FloatMatrixstatic doubleexp(double x) static floatexp(float x) static DoubleMatrixexp(DoubleMatrix x) static FloatMatrixexp(FloatMatrix x) static DoubleMatrixexpi(DoubleMatrix x) Applies the exponential function element-wise on this matrix.static FloatMatrixexpi(FloatMatrix x) Applies the exponential function element-wise on this matrix.static DoubleMatrixexpm(DoubleMatrix A) Calculate matrix exponential of a square matrix.static FloatMatrixexpm(FloatMatrix A) Calculate matrix exponential of a square matrix.static DoubleMatrixstatic doublefloor(double x) static floatfloor(float x) static DoubleMatrixstatic FloatMatrixfloor(FloatMatrix x) static DoubleMatrixElement-wise round down by applying the floor function on each element.static FloatMatrixElement-wise round down by applying the floor function on each element.static doublelog(double x) static floatlog(float x) static DoubleMatrixlog(DoubleMatrix x) static FloatMatrixlog(FloatMatrix x) static doublelog10(double x) static floatlog10(float x) static DoubleMatrixstatic FloatMatrixlog10(FloatMatrix x) static DoubleMatrixApplies the logarithm with basis to 10 element-wise on this matrix.static FloatMatrixApplies the logarithm with basis to 10 element-wise on this matrix.static DoubleMatrixlogi(DoubleMatrix x) Applies the natural logarithm function element-wise on this matrix.static FloatMatrixlogi(FloatMatrix x) Applies the natural logarithm function element-wise on this matrix.static doublepow(double x, double y) static DoubleMatrixpow(double b, DoubleMatrix x) static floatpow(float x, float y) static FloatMatrixpow(float b, FloatMatrix x) static DoubleMatrixpow(DoubleMatrix x, double e) static DoubleMatrixpow(DoubleMatrix x, DoubleMatrix e) static FloatMatrixpow(FloatMatrix x, float e) static FloatMatrixpow(FloatMatrix x, FloatMatrix e) static DoubleMatrixpowi(double base, DoubleMatrix x) static FloatMatrixpowi(float base, FloatMatrix x) static DoubleMatrixpowi(DoubleMatrix x, double d) Element-wise power function.static DoubleMatrixpowi(DoubleMatrix x, DoubleMatrix e) static FloatMatrixpowi(FloatMatrix x, float d) Element-wise power function.static FloatMatrixpowi(FloatMatrix x, FloatMatrix e) static doublesignum(double x) static floatsignum(float x) static DoubleMatrixstatic FloatMatrixstatic DoubleMatrixstatic FloatMatrixstatic doublesin(double x) static floatsin(float x) static DoubleMatrixsin(DoubleMatrix x) static FloatMatrixsin(FloatMatrix x) static doublesinh(double x) static floatsinh(float x) static DoubleMatrixsinh(DoubleMatrix x) static FloatMatrixsinh(FloatMatrix x) static DoubleMatrixstatic FloatMatrixsinhi(FloatMatrix x) static DoubleMatrixsini(DoubleMatrix x) static FloatMatrixsini(FloatMatrix x) static doublesqrt(double x) static floatsqrt(float x) static DoubleMatrixsqrt(DoubleMatrix x) static FloatMatrixsqrt(FloatMatrix x) static DoubleMatrixstatic FloatMatrixsqrti(FloatMatrix x) static doubletan(double x) static floattan(float x) static DoubleMatrixtan(DoubleMatrix x) static FloatMatrixtan(FloatMatrix x) static doubletanh(double x) static floattanh(float x) static DoubleMatrixtanh(DoubleMatrix x) static FloatMatrixtanh(FloatMatrix x) static DoubleMatrixstatic FloatMatrixtanhi(FloatMatrix x) static DoubleMatrixtani(DoubleMatrix x) static FloatMatrixtani(FloatMatrix x)
-
Constructor Details
-
MatrixFunctions
public MatrixFunctions()
-
-
Method Details
-
absi
Sets all elements in this matrix to their absolute values. Note that this operation is in-place.- Returns:
- this matrix
- See Also:
-
absi
-
acosi
Applies the trigonometric arccosine function element wise on this matrix. Note that this is an in-place operation.- Returns:
- this matrix
- See Also:
-
asini
Applies the trigonometric arcsine function element wise on this matrix. Note that this is an in-place operation.- Returns:
- this matrix
- See Also:
-
atani
Applies the trigonometric arctangend function element wise on this matrix. Note that this is an in-place operation.- Returns:
- this matrix
- See Also:
-
cbrti
Applies the cube root function element wise on this matrix. Note that this is an in-place operation.- Returns:
- this matrix
- See Also:
-
ceili
Element-wise round up by applying the ceil function on each element. Note that this is an in-place operation.- Returns:
- this matrix
- See Also:
-
cosi
Applies the cosine function element-wise on this matrix. Note that this is an in-place operation.- Returns:
- this matrix
- See Also:
-
coshi
Applies the hyperbolic cosine function element-wise on this matrix. Note that this is an in-place operation.- Returns:
- this matrix
- See Also:
-
expi
Applies the exponential function element-wise on this matrix. Note that this is an in-place operation.- Returns:
- this matrix
- See Also:
-
floori
Element-wise round down by applying the floor function on each element. Note that this is an in-place operation.- Returns:
- this matrix
- See Also:
-
logi
Applies the natural logarithm function element-wise on this matrix. Note that this is an in-place operation.- Returns:
- this matrix
- See Also:
-
log10i
Applies the logarithm with basis to 10 element-wise on this matrix. Note that this is an in-place operation.- Returns:
- this matrix
- See Also:
-
powi
Element-wise power function. Replaces each element with its power of d.Note that this is an in-place operation.- Parameters:
d- the exponent- Returns:
- this matrix
- See Also:
-
powi
-
powi
-
signumi
-
sini
-
sinhi
-
sqrti
-
tani
-
tanhi
-
abs
Returns a copy of this matrix where all elements are set to their absolute values.- Returns:
- copy of this matrix
- See Also:
-
acos
Returns a copy of this matrix where the trigonometric acos function is applied element wise.- Returns:
- copy of this matrix
- See Also:
-
asin
-
atan
-
cbrt
-
ceil
-
cos
-
cosh
-
exp
-
floor
-
log
-
log10
-
pow
public static double pow(double x, double y) -
pow
-
pow
-
pow
-
signum
-
sin
-
sinh
-
sqrt
-
tan
-
tanh
-
abs
public static double abs(double x) -
acos
public static double acos(double x) -
asin
public static double asin(double x) -
atan
public static double atan(double x) -
cbrt
public static double cbrt(double x) -
ceil
public static double ceil(double x) -
cos
public static double cos(double x) -
cosh
public static double cosh(double x) -
exp
public static double exp(double x) -
floor
public static double floor(double x) -
log
public static double log(double x) -
log10
public static double log10(double x) -
signum
public static double signum(double x) -
sin
public static double sin(double x) -
sinh
public static double sinh(double x) -
sqrt
public static double sqrt(double x) -
tan
public static double tan(double x) -
tanh
public static double tanh(double x) -
expm
Calculate matrix exponential of a square matrix. A scaled Pade approximation algorithm is used. The algorithm has been directly translated from Golub & Van Loan "Matrix Computations", algorithm 11.3.1. Special Horner techniques from 11.2 are also used to minimize the number of matrix multiplications.- Parameters:
A- square matrix- Returns:
- matrix exponential of A
-
floatToDouble
-
doubleToFloat
-
absi
Sets all elements in this matrix to their absolute values. Note that this operation is in-place.- Returns:
- this matrix
- See Also:
-
absi
-
acosi
Applies the trigonometric arccosine function element wise on this matrix. Note that this is an in-place operation.- Returns:
- this matrix
- See Also:
-
asini
Applies the trigonometric arcsine function element wise on this matrix. Note that this is an in-place operation.- Returns:
- this matrix
- See Also:
-
atani
Applies the trigonometric arctangend function element wise on this matrix. Note that this is an in-place operation.- Returns:
- this matrix
- See Also:
-
cbrti
Applies the cube root function element wise on this matrix. Note that this is an in-place operation.- Returns:
- this matrix
- See Also:
-
ceili
Element-wise round up by applying the ceil function on each element. Note that this is an in-place operation.- Returns:
- this matrix
- See Also:
-
cosi
Applies the cosine function element-wise on this matrix. Note that this is an in-place operation.- Returns:
- this matrix
- See Also:
-
coshi
Applies the hyperbolic cosine function element-wise on this matrix. Note that this is an in-place operation.- Returns:
- this matrix
- See Also:
-
expi
Applies the exponential function element-wise on this matrix. Note that this is an in-place operation.- Returns:
- this matrix
- See Also:
-
floori
Element-wise round down by applying the floor function on each element. Note that this is an in-place operation.- Returns:
- this matrix
- See Also:
-
logi
Applies the natural logarithm function element-wise on this matrix. Note that this is an in-place operation.- Returns:
- this matrix
- See Also:
-
log10i
Applies the logarithm with basis to 10 element-wise on this matrix. Note that this is an in-place operation.- Returns:
- this matrix
- See Also:
-
powi
Element-wise power function. Replaces each element with its power of d.Note that this is an in-place operation.- Parameters:
d- the exponent- Returns:
- this matrix
- See Also:
-
powi
-
powi
-
signumi
-
sini
-
sinhi
-
sqrti
-
tani
-
tanhi
-
abs
Returns a copy of this matrix where all elements are set to their absolute values.- Returns:
- copy of this matrix
- See Also:
-
acos
Returns a copy of this matrix where the trigonometric acos function is applied element wise.- Returns:
- copy of this matrix
- See Also:
-
asin
-
atan
-
cbrt
-
ceil
-
cos
-
cosh
-
exp
-
floor
-
log
-
log10
-
pow
public static float pow(float x, float y) -
pow
-
pow
-
pow
-
signum
-
sin
-
sinh
-
sqrt
-
tan
-
tanh
-
abs
public static float abs(float x) -
acos
public static float acos(float x) -
asin
public static float asin(float x) -
atan
public static float atan(float x) -
cbrt
public static float cbrt(float x) -
ceil
public static float ceil(float x) -
cos
public static float cos(float x) -
cosh
public static float cosh(float x) -
exp
public static float exp(float x) -
floor
public static float floor(float x) -
log
public static float log(float x) -
log10
public static float log10(float x) -
signum
public static float signum(float x) -
sin
public static float sin(float x) -
sinh
public static float sinh(float x) -
sqrt
public static float sqrt(float x) -
tan
public static float tan(float x) -
tanh
public static float tanh(float x) -
expm
Calculate matrix exponential of a square matrix. A scaled Pade approximation algorithm is used. The algorithm has been directly translated from Golub & Van Loan "Matrix Computations", algorithm 11.3f.1. Special Horner techniques from 11.2f are also used to minimize the number of matrix multiplications.- Parameters:
A- square matrix- Returns:
- matrix exponential of A
-