public final class MatHelper
extends java.lang.Object
Mat objects.Mat| Modifier and Type | Method and Description |
|---|---|
static <R extends OneMin,C extends OneMin> |
divide(Mat<R,C> m,
double s)
Divides a matrix by a scalar
|
static <R extends OneMin,C extends OneMin> |
divideOptional(Mat<R,C> m,
double s)
Divides a matrix by a scalar
|
static <R1 extends OneMin,C1 extends OneMin,R2 extends OneMin,C2 extends OneMin> |
multiply(Mat<R1,C1> m1,
Mat<R2,C2> m2)
Multiplies a two matrices with each other.
|
static <R extends OneMin,C extends OneMin> |
multiply(Mat<R,C> m,
double s)
Multiplies a matrix with a scalar
|
static <R1 extends OneMin,C1 extends OneMin,R2 extends OneMin,C2 extends OneMin> |
multiplyOptional(Mat<R1,C1> m1,
Mat<R2,C2> m2)
Multiplies a two matrices with each other.
|
static <R extends OneMin,C extends OneMin> |
multiplyOptional(Mat<R,C> m,
double s)
Multiplies a matrix with a scalar
|
static <R extends OneMin,C extends OneMin> |
toArray(Mat<R,C> m,
Mat.ElementOrder order)
Returns the elements of a matrix in an ordered array.
|
public static <R extends OneMin,C extends OneMin> Mat<R,C> multiply(Mat<R,C> m, double s)
m - the matrixs - the scalarm * sjava.lang.NullPointerException - if m is nulljava.lang.IllegalArgumentException - if s is equal to (+/-)Infinity or NaNjava.lang.IllegalArgumentException - if an element of the resulting matrix is infinitepublic static <R extends OneMin,C extends OneMin> java.util.Optional<Mat<R,C>> multiplyOptional(Mat<R,C> m, double s)
m - the matrixs - the scalarm * s.
If one element of the resulting matrix is infinite, an empty Optional will be returned.java.lang.NullPointerException - if m is nulljava.lang.IllegalArgumentException - if s is equal to (+/-)Infinity or NaNpublic static <R1 extends OneMin,C1 extends OneMin,R2 extends OneMin,C2 extends OneMin> Mat<R1,C2> multiply(Mat<R1,C1> m1, Mat<R2,C2> m2)
m1 - the first matrixm2 - the second matrixm1 * m2java.lang.NullPointerException - if m1 or m2 is nulljava.lang.IllegalArgumentException - if an element of the resulting matrix is infinitepublic static <R1 extends OneMin,C1 extends OneMin,R2 extends OneMin,C2 extends OneMin> java.util.Optional<Mat<R1,C2>> multiplyOptional(Mat<R1,C1> m1, Mat<R2,C2> m2)
m1 - the first matrixm2 - the second matrixm1 * m2.
If one element of the resulting matrix is infinite, an empty Optional will be returned.java.lang.NullPointerException - if m1 or m2 is nullpublic static <R extends OneMin,C extends OneMin> Mat<R,C> divide(Mat<R,C> m, double s)
m - the matrixs - the scalarm / sjava.lang.NullPointerException - if m is nulljava.lang.IllegalArgumentException - if s is equal to (+/-)Infinity or NaNjava.lang.IllegalArgumentException - if an element of the resulting matrix is infinitepublic static <R extends OneMin,C extends OneMin> java.util.Optional<Mat<R,C>> divideOptional(Mat<R,C> m, double s)
m - the matrixs - the scalarm / s.
If one element of the resulting matrix is infinite, an empty Optional will be returned.java.lang.NullPointerException - if m is nulljava.lang.IllegalArgumentException - if s is equal to (+/-)Infinity or NaNpublic static <R extends OneMin,C extends OneMin> double[] toArray(Mat<R,C> m, Mat.ElementOrder order)
m - the matrix which should be converted to an row-major arrayorder - the order in which the elements of the matrix should be filled into the arrayjava.lang.NullPointerException - if m or order is null