Class FixedOps2
- java.lang.Object
-
- org.ejml.alg.fixed.FixedOps2
-
public class FixedOps2 extends java.lang.ObjectCommon matrix operations for fixed sized matrices which are 2 x 2 or 2 element vectors.
DO NOT MODIFY. Automatically generated code created by GenerateFixedOps
-
-
Constructor Summary
Constructors Constructor and Description FixedOps2()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static voidadd(FixedMatrix2x2_64F a, FixedMatrix2x2_64F b, FixedMatrix2x2_64F c)Performs the following operation:
c = a + b
cij = aij + bijstatic voidaddEquals(FixedMatrix2x2_64F a, FixedMatrix2x2_64F b)Performs the following operation:
a = a + b
aij = aij + bijstatic voidchangeSign(FixedMatrix2x2_64F a)Changes the sign of every element in the matrix.
aij = -aijstatic doubledet(FixedMatrix2x2_64F mat)Computes the determinant using minor matrices.static voiddiag(FixedMatrix2x2_64F input, FixedMatrix2_64F out)Extracts all diagonal elements from 'input' and places them inside the 'out' vector.static voiddivide(FixedMatrix2x2_64F a, double alpha)Performs an in-place element by element scalar division.static voiddivide(FixedMatrix2x2_64F a, double alpha, FixedMatrix2x2_64F b)Performs an element by element scalar division.static doubledot(FixedMatrix2_64F a, FixedMatrix2_64F b)Performs the vector dot product:
c = a * b
c> = ∑k=1:n { bk * ak }static voidelementDiv(FixedMatrix2x2_64F a, FixedMatrix2x2_64F b)Performs the an element by element division operation:
aij = aij / bijstatic voidelementDiv(FixedMatrix2x2_64F a, FixedMatrix2x2_64F b, FixedMatrix2x2_64F c)Performs the an element by element division operation:
cij = aij / bijstatic doubleelementMax(FixedMatrix2x2_64F a)Returns the value of the element in the matrix that has the largest value.
Max{ aij } for all i and jstatic doubleelementMaxAbs(FixedMatrix2x2_64F a)Returns the absolute value of the element in the matrix that has the largest absolute value.
Max{ |aij| } for all i and jstatic doubleelementMin(FixedMatrix2x2_64F a)Returns the value of the element in the matrix that has the minimum value.
Min{ aij } for all i and jstatic doubleelementMinAbs(FixedMatrix2x2_64F a)Returns the absolute value of the element in the matrix that has the smallest absolute value.
Min{ |aij| } for all i and jstatic voidelementMult(FixedMatrix2x2_64F a, FixedMatrix2x2_64F b)Performs the an element by element multiplication operation:
aij = aij * bijstatic voidelementMult(FixedMatrix2x2_64F a, FixedMatrix2x2_64F b, FixedMatrix2x2_64F c)Performs the an element by element multiplication operation:
cij = aij * bijstatic FixedMatrix2_64FextractColumn(FixedMatrix2x2_64F a, int column, FixedMatrix2_64F out)Extracts the column from the matrix a.static FixedMatrix2_64FextractRow(FixedMatrix2x2_64F a, int row, FixedMatrix2_64F out)Extracts the row from the matrix a.static voidfill(FixedMatrix2x2_64F a, double v)Sets every element in the matrix to the specified value.
aij = valuestatic booleaninvert(FixedMatrix2x2_64F a, FixedMatrix2x2_64F inv)Inverts matrix 'a' using minor matrices and stores the results in 'inv'.static voidmult(FixedMatrix2_64F a, FixedMatrix2x2_64F b, FixedMatrix2_64F c)Performs vector to matrix multiplication:
c = a * b
cj = ∑k=1:n { bk * akj }static voidmult(FixedMatrix2x2_64F a, FixedMatrix2_64F b, FixedMatrix2_64F c)Performs matrix to vector multiplication:
c = a * b
ci = ∑k=1:n { aik * bk}static voidmult(FixedMatrix2x2_64F a, FixedMatrix2x2_64F b, FixedMatrix2x2_64F c)Performs the following operation:
c = a * b
cij = ∑k=1:n { aik * bkj}static voidmultTransA(FixedMatrix2x2_64F a, FixedMatrix2x2_64F b, FixedMatrix2x2_64F c)Performs the following operation:
c = aT * b
cij = ∑k=1:n { aki * bkj}static voidmultTransAB(FixedMatrix2x2_64F a, FixedMatrix2x2_64F b, FixedMatrix2x2_64F c)Performs the following operation:
c = aT * bT
cij = ∑k=1:n { aki * bjk}static voidmultTransB(FixedMatrix2x2_64F a, FixedMatrix2x2_64F b, FixedMatrix2x2_64F c)Performs the following operation:
c = a * bT
cij = ∑k=1:n { aik * bjk}static voidscale(double alpha, FixedMatrix2x2_64F a)Performs an in-place element by element scalar multiplication.
aij = α*aijstatic voidscale(double alpha, FixedMatrix2x2_64F a, FixedMatrix2x2_64F b)Performs an element by element scalar multiplication.
bij = α*aijstatic voidsetIdentity(FixedMatrix2x2_64F a)Sets all the diagonal elements equal to one and everything else equal to zero.static voidsubtract(FixedMatrix2x2_64F a, FixedMatrix2x2_64F b, FixedMatrix2x2_64F c)Performs the following operation:
c = a - b
cij = aij - bijstatic voidsubtractEquals(FixedMatrix2x2_64F a, FixedMatrix2x2_64F b)Performs the following operation:
a = a - b
aij = aij - bijstatic doubletrace(FixedMatrix2x2_64F a)This computes the trace of the matrix:
trace = ∑i=1:n { aii }static voidtranspose(FixedMatrix2x2_64F m)Performs an in-place transpose.static FixedMatrix2x2_64Ftranspose(FixedMatrix2x2_64F input, FixedMatrix2x2_64F output)Transposes matrix 'a' and stores the results in 'b':
bij = aji
where 'b' is the transpose of 'a'.
-
-
-
Method Detail
-
add
public static void add(FixedMatrix2x2_64F a, FixedMatrix2x2_64F b, FixedMatrix2x2_64F c)
Performs the following operation:
c = a + b
cij = aij + bij
Matrix C can be the same instance as Matrix A and/or B.
- Parameters:
a- A Matrix. Not modified.b- A Matrix. Not modified.c- A Matrix where the results are stored. Modified.
-
addEquals
public static void addEquals(FixedMatrix2x2_64F a, FixedMatrix2x2_64F b)
Performs the following operation:
a = a + b
aij = aij + bij
- Parameters:
a- A Matrix. Modified.b- A Matrix. Not modified.
-
subtract
public static void subtract(FixedMatrix2x2_64F a, FixedMatrix2x2_64F b, FixedMatrix2x2_64F c)
Performs the following operation:
c = a - b
cij = aij - bij
Matrix C can be the same instance as Matrix A and/or B.
- Parameters:
a- A Matrix. Not modified.b- A Matrix. Not modified.c- A Matrix where the results are stored. Modified.
-
subtractEquals
public static void subtractEquals(FixedMatrix2x2_64F a, FixedMatrix2x2_64F b)
Performs the following operation:
a = a - b
aij = aij - bij
- Parameters:
a- A Matrix. Modified.b- A Matrix. Not modified.
-
transpose
public static void transpose(FixedMatrix2x2_64F m)
Performs an in-place transpose. This algorithm is only efficient for square matrices.- Parameters:
m- The matrix that is to be transposed. Modified.
-
transpose
public static FixedMatrix2x2_64F transpose(FixedMatrix2x2_64F input, FixedMatrix2x2_64F output)
Transposes matrix 'a' and stores the results in 'b':
bij = aji
where 'b' is the transpose of 'a'.- Parameters:
input- The original matrix. Not modified.output- Where the transpose is stored. If null a new matrix is created. Modified.- Returns:
- The transposed matrix.
-
mult
public static void mult(FixedMatrix2x2_64F a, FixedMatrix2x2_64F b, FixedMatrix2x2_64F c)
Performs the following operation:
c = a * b
cij = ∑k=1:n { aik * bkj}- Parameters:
a- The left matrix in the multiplication operation. Not modified.b- The right matrix in the multiplication operation. Not modified.c- Where the results of the operation are stored. Modified.
-
multTransA
public static void multTransA(FixedMatrix2x2_64F a, FixedMatrix2x2_64F b, FixedMatrix2x2_64F c)
Performs the following operation:
c = aT * b
cij = ∑k=1:n { aki * bkj}- Parameters:
a- The left matrix in the multiplication operation. Not modified.b- The right matrix in the multiplication operation. Not modified.c- Where the results of the operation are stored. Modified.
-
multTransAB
public static void multTransAB(FixedMatrix2x2_64F a, FixedMatrix2x2_64F b, FixedMatrix2x2_64F c)
Performs the following operation:
c = aT * bT
cij = ∑k=1:n { aki * bjk}- Parameters:
a- The left matrix in the multiplication operation. Not modified.b- The right matrix in the multiplication operation. Not modified.c- Where the results of the operation are stored. Modified.
-
multTransB
public static void multTransB(FixedMatrix2x2_64F a, FixedMatrix2x2_64F b, FixedMatrix2x2_64F c)
Performs the following operation:
c = a * bT
cij = ∑k=1:n { aik * bjk}- Parameters:
a- The left matrix in the multiplication operation. Not modified.b- The right matrix in the multiplication operation. Not modified.c- Where the results of the operation are stored. Modified.
-
mult
public static void mult(FixedMatrix2x2_64F a, FixedMatrix2_64F b, FixedMatrix2_64F c)
Performs matrix to vector multiplication:
c = a * b
ci = ∑k=1:n { aik * bk}- Parameters:
a- The left matrix in the multiplication operation. Not modified.b- The right vector in the multiplication operation. Not modified.c- Where the results of the operation are stored. Modified.
-
mult
public static void mult(FixedMatrix2_64F a, FixedMatrix2x2_64F b, FixedMatrix2_64F c)
Performs vector to matrix multiplication:
c = a * b
cj = ∑k=1:n { bk * akj }- Parameters:
a- The left vector in the multiplication operation. Not modified.b- The right matrix in the multiplication operation. Not modified.c- Where the results of the operation are stored. Modified.
-
dot
public static double dot(FixedMatrix2_64F a, FixedMatrix2_64F b)
Performs the vector dot product:
c = a * b
c> = ∑k=1:n { bk * ak }- Parameters:
a- The left vector in the multiplication operation. Not modified.b- The right matrix in the multiplication operation. Not modified.- Returns:
- The dot product
-
setIdentity
public static void setIdentity(FixedMatrix2x2_64F a)
Sets all the diagonal elements equal to one and everything else equal to zero. If this is a square matrix then it will be an identity matrix.- Parameters:
a- A matrix.
-
invert
public static boolean invert(FixedMatrix2x2_64F a, FixedMatrix2x2_64F inv)
Inverts matrix 'a' using minor matrices and stores the results in 'inv'. Scaling is applied to improve stability against overflow and underflow. WARNING: Potentially less stable than using LU decomposition.- Parameters:
a- Input matrix. Not modified.inv- Inverted output matrix. Modified.- Returns:
- true if it was successful or false if it failed. Not always reliable.
-
det
public static double det(FixedMatrix2x2_64F mat)
Computes the determinant using minor matrices. WARNING: Potentially less stable than using LU decomposition.- Parameters:
mat- Input matrix. Not modified.- Returns:
- The determinant.
-
trace
public static double trace(FixedMatrix2x2_64F a)
This computes the trace of the matrix:
trace = ∑i=1:n { aii }The trace is only defined for square matrices.
- Parameters:
a- A square matrix. Not modified.
-
diag
public static void diag(FixedMatrix2x2_64F input, FixedMatrix2_64F out)
Extracts all diagonal elements from 'input' and places them inside the 'out' vector. Elements are in sequential order.
- Parameters:
input- Matrix. Not modified.out- Vector containing diagonal elements. Modified.
-
elementMax
public static double elementMax(FixedMatrix2x2_64F a)
Returns the value of the element in the matrix that has the largest value.
Max{ aij } for all i and j
- Parameters:
a- A matrix. Not modified.- Returns:
- The max element value of the matrix.
-
elementMaxAbs
public static double elementMaxAbs(FixedMatrix2x2_64F a)
Returns the absolute value of the element in the matrix that has the largest absolute value.
Max{ |aij| } for all i and j
- Parameters:
a- A matrix. Not modified.- Returns:
- The max abs element value of the matrix.
-
elementMin
public static double elementMin(FixedMatrix2x2_64F a)
Returns the value of the element in the matrix that has the minimum value.
Min{ aij } for all i and j
- Parameters:
a- A matrix. Not modified.- Returns:
- The value of element in the matrix with the minimum value.
-
elementMinAbs
public static double elementMinAbs(FixedMatrix2x2_64F a)
Returns the absolute value of the element in the matrix that has the smallest absolute value.
Min{ |aij| } for all i and j
- Parameters:
a- A matrix. Not modified.- Returns:
- The max element value of the matrix.
-
elementMult
public static void elementMult(FixedMatrix2x2_64F a, FixedMatrix2x2_64F b)
Performs the an element by element multiplication operation:
aij = aij * bij
- Parameters:
a- The left matrix in the multiplication operation. Modified.b- The right matrix in the multiplication operation. Not modified.
-
elementMult
public static void elementMult(FixedMatrix2x2_64F a, FixedMatrix2x2_64F b, FixedMatrix2x2_64F c)
Performs the an element by element multiplication operation:
cij = aij * bij
- Parameters:
a- The left matrix in the multiplication operation. Not modified.b- The right matrix in the multiplication operation. Not modified.c- Where the results of the operation are stored. Modified.
-
elementDiv
public static void elementDiv(FixedMatrix2x2_64F a, FixedMatrix2x2_64F b)
Performs the an element by element division operation:
aij = aij / bij
- Parameters:
a- The left matrix in the division operation. Modified.b- The right matrix in the division operation. Not modified.
-
elementDiv
public static void elementDiv(FixedMatrix2x2_64F a, FixedMatrix2x2_64F b, FixedMatrix2x2_64F c)
Performs the an element by element division operation:
cij = aij / bij
- Parameters:
a- The left matrix in the division operation. Not modified.b- The right matrix in the division operation. Not modified.c- Where the results of the operation are stored. Modified.
-
scale
public static void scale(double alpha, FixedMatrix2x2_64F a)Performs an in-place element by element scalar multiplication.
aij = α*aij- Parameters:
a- The matrix that is to be scaled. Modified.alpha- the amount each element is multiplied by.
-
scale
public static void scale(double alpha, FixedMatrix2x2_64F a, FixedMatrix2x2_64F b)Performs an element by element scalar multiplication.
bij = α*aij- Parameters:
alpha- the amount each element is multiplied by.a- The matrix that is to be scaled. Not modified.b- Where the scaled matrix is stored. Modified.
-
divide
public static void divide(FixedMatrix2x2_64F a, double alpha)
Performs an in-place element by element scalar division. Scalar denominator.
aij = aij/α- Parameters:
a- The matrix whose elements are to be divided. Modified.alpha- the amount each element is divided by.
-
divide
public static void divide(FixedMatrix2x2_64F a, double alpha, FixedMatrix2x2_64F b)
Performs an element by element scalar division. Scalar denominator.
bij = *aij /α- Parameters:
alpha- the amount each element is divided by.a- The matrix whose elements are to be divided. Not modified.b- Where the results are stored. Modified.
-
changeSign
public static void changeSign(FixedMatrix2x2_64F a)
Changes the sign of every element in the matrix.
aij = -aij- Parameters:
a- A matrix. Modified.
-
fill
public static void fill(FixedMatrix2x2_64F a, double v)
Sets every element in the matrix to the specified value.
aij = value- Parameters:
a- A matrix whose elements are about to be set. Modified.v- The value each element will have.
-
extractRow
public static FixedMatrix2_64F extractRow(FixedMatrix2x2_64F a, int row, FixedMatrix2_64F out)
Extracts the row from the matrix a.- Parameters:
a- Input matrixrow- Which row is to be extractedout- output. Storage for the extracted row. If null then a new vector will be returned.- Returns:
- The extracted row.
-
extractColumn
public static FixedMatrix2_64F extractColumn(FixedMatrix2x2_64F a, int column, FixedMatrix2_64F out)
Extracts the column from the matrix a.- Parameters:
a- Input matrixcolumn- Which column is to be extractedout- output. Storage for the extracted column. If null then a new vector will be returned.- Returns:
- The extracted column.
-
-
DMelt 3.0 © DataMelt by jWork.ORG