public final class Matrix22 extends APrimitiveMatrix implements ISpecialisedTransform
| Modifier and Type | Field and Description |
|---|---|
double |
m00 |
double |
m01 |
double |
m10 |
double |
m11 |
| Constructor and Description |
|---|
Matrix22() |
Matrix22(AMatrix m) |
Matrix22(double m00,
double m01,
double m10,
double m11) |
Matrix22(Matrix22 source) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(AMatrix a)
Adds another matrix to this matrix.
|
void |
add(Matrix22 a) |
void |
applyOp(Op op)
Applies a unary operator to all elements of the array (in-place)
|
int |
checkSquare()
Checks if a matrix is square.
|
Matrix22 |
clone()
Returns a clone of the array data, as a new array which will be fully mutable
and may be of a different class to the original.
|
int |
columnCount()
Gets the number of columns in this matrix (dimension 1)
|
void |
copyRowTo(int row,
double[] dest,
int destOffset)
Copies the elements in a slected row of this matrix to a double array
|
static Matrix22 |
create(double a,
double b,
double c,
double d) |
static Matrix22 |
createIdentity()
Creates a new mutable 2D identity matrix
|
static Matrix22 |
createReflectionMatrix(AVector normal) |
static Matrix22 |
createReflectionMatrix(Vector2 normal) |
static Matrix22 |
createRotationMatrix(double angle) |
static Matrix22 |
createScaleMatrix(double d) |
double |
determinant()
Calculates the determinant of the matrix.
|
long |
elementCount()
Returns the total number of elements in this array.
|
double |
elementMax()
Returns the maximum element value in this array.
|
double |
elementMin()
Returns the maximum element value in this array.
|
double |
elementSum()
Returns the sum of all elements in this matrix
|
boolean |
equals(Matrix22 m) |
boolean |
equals(Object o) |
Matrix22 |
exactClone()
Creates a deep clone of an array, using the same class implementation as the original array
|
double |
get(int row,
int column)
Returns the double value at the specified position in a 2D matrix
|
Vector2 |
getColumnClone(int column)
Returns a column of the matrix as a new cloned, mutable vector
The cloned column may be modified without affecting the original matrix.
|
void |
getElements(double[] data,
int offset)
Gets all elements of the array, copying them into a double array at the specified offset
|
Vector2 |
getRowClone(int row)
Returns a row of the matrix as a new cloned, mutable vector.
|
Matrix22 |
getTranspose()
Returns the transpose of this array.
|
AMatrix |
innerProduct(AMatrix a)
Computes the inner product of this matrix with another.
|
AVector |
innerProduct(AVector a)
Computes the inner product of this array with a vector
|
Matrix22 |
innerProduct(Matrix22 a) |
Vector2 |
innerProduct(Vector2 a) |
Matrix22 |
inverse()
Computes the inverse of a matrix.
|
boolean |
isSymmetric()
Returns true if a matrix is symmetric
|
boolean |
isZero()
Returns true if the matrix is the zero matrix (all components zero)
|
void |
multiply(double factor)
Multiplies all elements of the array in place by a given double value
|
int |
rowCount()
Gets the number of rows in this matrix (dimension 0)
|
void |
set(AMatrix m)
Sets this matrix with the element values from another matrix.
|
void |
set(int row,
int column,
double value)
Sets a value at a given position in a mutable 2D array
|
void |
set(Matrix22 a) |
void |
sub(Matrix22 a) |
double[] |
toDoubleArray()
Copies the elements of this array to a new double[] array.
|
Vector |
toVector()
Coerces the array into a flattened dense Vector, in row-major order
May return the same array if it is already a Vector instance
|
double |
trace()
Computes the trace of a matrix, i.e.
|
void |
transform(AVector source,
AVector dest)
Transforms a source vector into a destination vector, using matrix multiplication (inner product).
|
Vector2 |
transform(Vector2 source) |
void |
transform(Vector2 source,
AVector dest) |
void |
transform(Vector2 source,
Vector2 dest) |
void |
transformInPlace(Vector2 dest) |
void |
unsafeSet(AMatrix m) |
copy, getColumn, getRow, isFullyMutable, isSquareabs, add, add, add, add2, addAt, addCopy, addCopy, addCopy, addCopy, addCopy, addInnerProduct, addInnerProduct, addInnerProduct, addMultiple, addMultiple, addMultiple, addOuterProduct, addOuterProduct, addRowMultiple, addToArray, applyOp, applyOp, applyOp, applyOp, applyOp, applyOpCopy, asDoubleArray, asElementList, asVector, bandIndex, bandLength, bandLength, bandPosition, bandStartColumn, bandStartRow, broadcast, broadcastCloneLike, broadcastCopyLike, broadcastLike, broadcastLike, checkColumn, checkColumnCount, checkDimension, checkIndex, checkRow, checkRowCount, checkSameShape, checkSameShape, checkShape, clamp, composeWith, copyColumnTo, dense, denseClone, diagonalProduct, dimensionality, divide, divide, divide, divide, elementIterator, elementsEqual, elementSquaredSum, ensureMutable, epsilonEquals, epsilonEquals, epsilonEquals, epsilonEquals, equals, equals, equalsArray, equalsByRows, equalsTranspose, exp, fill, get, get, get, getBand, getBandWrapped, getColumns, getColumnView, getLeadingDiagonal, getLongShape, getRows, getRowView, getShape, getShape, getShapeClone, getSlices, getSlices, getSliceViews, getTransposeCopy, getTransposeView, hashCode, hasOrthonormalColumns, hasOrthonormalRows, hasUncountable, immutable, innerProduct, innerProduct, innerProduct, innerProduct, inputDimensions, isBoolean, isDiagonal, isElementConstrained, isHermitian, isIdentity, isInvertible, isLowerTriangular, isMutable, isOrthogonal, isOrthogonal, isPositiveDefinite, isRectangularDiagonal, isSameShape, isSameShape, isUpperTriangular, isView, iterator, join, log, lowerBandwidth, lowerBandwidthLimit, mul, multiply, multiply, multiply, multiplyCopy, multiplyRow, mutable, negate, nonZeroCount, outerProduct, outputDimensions, pow, rank, reciprocal, reduce, reduce, reduceSlices, reduceSlices, reorder, reorder, replaceColumn, replaceRow, reshape, reshape, rotateView, rowDotProduct, scaleAdd, scaleAdd, set, set, set, set, set, set, set, setColumn, setElements, setElements, setRow, signum, slice, slice, sliceCount, sparse, sparseClone, sqrt, square, sub, sub, sub, subArray, subMatrix, swapColumns, swapRows, toAffineTransform, toArray, toDoubleBuffer, toMatrix, toMatrixTranspose, toMutableMatrix, toNestedDoubleArrays, toSliceArray, toString, toStringFull, transform, transformInPlace, transformInPlace, transposeInnerProduct, transposeInnerProduct, transposeInPlace, unsafeGet, unsafeSet, upperBandwidth, upperBandwidthLimit, validateabsCopy, add, addAt, addInnerProduct, addPower, addPower, broadcastLike, checkMutable, componentCount, density, divideCopy, elementAbsPowSum, elementPowSum, elementProduct, equals, equalsArray, get, get, get, get, get, getComponent, getComponents, getElements, getElements, getElements, isDense, isSparse, join, multiplyCopy, negateCopy, reciprocalCopy, scale, scaleCopy, setElements, setInnerProduct, setMultiple, setMultiple, signumCopy, sliceValue, squareCopy, sub, sub, subCopy, withComponentsfinalize, getClass, notify, notifyAll, wait, wait, waitabsCopy, addAt, addPower, addPower, broadcastLike, checkMutable, componentCount, divideCopy, elementAbsPowSum, elementPowSum, elementProduct, equalsArray, get, get, get, get, get, getComponent, getComponents, getElements, getElements, getElements, isDense, isSparse, join, multiplyCopy, negateCopy, reciprocalCopy, scale, scaleCopy, setElements, setInnerProduct, setMultiple, setMultiple, signumCopy, sliceValue, squareCopy, sub, subCopy, withComponentsforEach, spliteratorpublic double m00
public double m01
public double m10
public double m11
public Matrix22()
public Matrix22(Matrix22 source)
public Matrix22(double m00,
double m01,
double m10,
double m11)
public Matrix22(AMatrix m)
public void set(Matrix22 a)
public void set(AMatrix m)
AMatrixpublic void unsafeSet(AMatrix m)
public static Matrix22 create(double a, double b, double c, double d)
public static Matrix22 createRotationMatrix(double angle)
public static Matrix22 createScaleMatrix(double d)
public static Matrix22 createIdentity()
public void multiply(double factor)
INDArraypublic double determinant()
AMatrixdeterminant in class AMatrixpublic long elementCount()
INDArrayelementCount in interface INDArrayelementCount in class AMatrixpublic double elementSum()
AMatrixelementSum in interface INDArrayelementSum in class AMatrixpublic double elementMin()
INDArrayelementMin in interface INDArrayelementMin in class AbstractArray<AVector>public double elementMax()
INDArrayelementMax in interface INDArrayelementMax in class AbstractArray<AVector>public double trace()
IMatrixpublic Matrix22 inverse()
AMatrixpublic int rowCount()
IMatrixpublic int columnCount()
IMatrixcolumnCount in interface IMatrixpublic int checkSquare()
AMatrixcheckSquare in class APrimitiveMatrixpublic void add(AMatrix a)
AMatrixpublic void add(Matrix22 a)
public void sub(Matrix22 a)
public void applyOp(Op op)
INDArraypublic Vector2 getRowClone(int row)
IMatrixgetRowClone in interface IMatrixgetRowClone in class AMatrixpublic Vector2 getColumnClone(int column)
IMatrixgetColumnClone in interface IMatrixgetColumnClone in class AMatrixpublic void copyRowTo(int row,
double[] dest,
int destOffset)
AMatrixpublic double get(int row,
int column)
INDArraypublic void set(int row,
int column,
double value)
INDArraypublic AMatrix innerProduct(AMatrix a)
IMatrixinnerProduct in interface IMatrixinnerProduct in class AMatrixpublic AVector innerProduct(AVector a)
INDArrayinnerProduct in interface INDArrayinnerProduct in interface IMatrixinnerProduct in class AMatrixa - A vectorpublic void transform(AVector source, AVector dest)
IMatrixpublic void transformInPlace(Vector2 dest)
public boolean isSymmetric()
AMatrixisSymmetric in interface IMatrixisSymmetric in class AMatrixpublic Vector toVector()
INDArraypublic Matrix22 getTranspose()
INDArraygetTranspose in interface INDArraygetTranspose in interface IMatrixgetTranspose in class AMatrixpublic void getElements(double[] data,
int offset)
INDArraygetElements in interface INDArraygetElements in class AMatrixpublic boolean equals(Matrix22 m)
public Matrix22 clone()
INDArraypublic Matrix22 exactClone()
INDArrayexactClone in interface INDArrayexactClone in class AMatrixpublic double[] toDoubleArray()
INDArraytoDoubleArray in interface INDArraytoDoubleArray in class AMatrixCopyright © 2016. All rights reserved.