Class CRMatrix<A>
java.lang.Object
org.ddogleg.chainrule.CRMatrix<A>
References an index in an array that represents a 2D matrix. Dense row major format.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyteb(int row, int col) Array access for type bytevoidb(int row, int col, byte value) Array access for type doublecopy()Creates a copy of the original array and this wrapper.static CRMatrix<double[]> createD(int rows, int cols) doubled(int row, int col) Array access for type doublevoidd(int row, int col, double value) Array access for type doubleintNumber of elements in the matrixfloatf(int row, int col) Array access for type floatvoidf(int row, int col, float value) Array access for type doubleinti(int row, int col) Array access for type intvoidi(int row, int col, int value) Array access for type doublebooleanbooleanTrue if this is an invalid matrix.booleanisNaN()true if one element is NaN in the matrixvoidMarks the matrix as invalidvoidCopies the passed in array into the referenced arrayreserve(int length) Ensure that the array has at least this many elements in itvoidreset()Resets the matrix with zeros for rows and colsreshape(int rows, int cols) Resizes the array and makes sure the data array is large enoughshorts(int row, int col) Array access for type shortvoids(int row, int col, short value) Array access for type doublesetOffset(int offset) Assigns a new value to the offset and returns a reference to 'this' allowing operations to be chained.Sets the value of this to be identical to 'src' and returns a refernece to 'this'voidshape(int rows, int cols) Creates a string representation of a 2D matrix.voidvoidCopies values into the passed in 'dest' array
-
Field Details
-
data
Reference to the array -
offset
public int offsetFirst index in the sub array -
rows
public int rowsRows and columns in the 2D matrix -
cols
public int colsRows and columns in the 2D matrix
-
-
Constructor Details
-
CRMatrix
-
CRMatrix
public CRMatrix()
-
-
Method Details
-
createD
-
isInvalid
public boolean isInvalid()True if this is an invalid matrix. Can be used to indicate if this matrix should not be used -
markInvalid
public void markInvalid()Marks the matrix as invalid -
reset
public void reset()Resets the matrix with zeros for rows and cols -
setTo
-
reserve
-
reshape
-
wrap
-
write
Copies values into the passed in 'dest' array- Parameters:
dest- Reference to the destination arrayoffset- Offset in the dest array where it should start writing
-
read
Copies the passed in array into the referenced array- Parameters:
src- Reference to the source arrayoffset- Offset in the src array where it should start
-
setOffset
-
d
public void d(int row, int col, double value) Array access for type double -
d
public double d(int row, int col) Array access for type double -
f
public void f(int row, int col, float value) Array access for type double -
f
public float f(int row, int col) Array access for type float -
i
public void i(int row, int col, int value) Array access for type double -
i
public int i(int row, int col) Array access for type int -
s
public void s(int row, int col, short value) Array access for type double -
s
public short s(int row, int col) Array access for type short -
b
public void b(int row, int col, byte value) Array access for type double -
b
public byte b(int row, int col) Array access for type byte -
toStringD
-
toStringM
-
isEquals
-
isNaN
public boolean isNaN()true if one element is NaN in the matrix -
copy
-
elementCount
public int elementCount()Number of elements in the matrix -
shape
public void shape(int rows, int cols)
-