public abstract class AbstractMatrix extends Object implements Matrix
Matrix.| Modifier and Type | Field and Description |
|---|---|
protected MatrixBackingBuffer |
buffer |
protected int |
columns |
protected int |
rows |
protected boolean |
zeroPadded |
| Constructor and Description |
|---|
AbstractMatrix() |
| Modifier and Type | Method and Description |
|---|---|
Matrix |
add(Matrix m)
Creates a view that is equal to the result of an addition.
|
protected void |
checkBounds(int row,
int column) |
float[] |
columnSum()
Compute the sum for each column.
|
Matrix |
enlarge(Matrix m)
Creates a view that is as large as the larger of the two involved matrices.
|
boolean |
equals(Object o) |
protected float |
get(int index) |
float |
get(int row,
int column)
Gets the value from
row and column. |
float[] |
getColumn(int column)
Gets the value from
column. |
int |
getNumberOfColumns()
Number of columns.
|
int |
getNumberOfRows()
Number of rows
|
float[] |
getRow(int row)
Gets the values from
row. |
Matrix |
hadamardMultiply(Matrix m)
Creates a view that is equal to the result of a Hadamard multiplication.
|
int |
hashCode() |
protected boolean |
isInvalid(int row,
int column) |
protected boolean |
isValidXORZeroPadded(int row,
int column) |
boolean |
isZeroPadded()
Indicates whether this matrix is zero padded.
|
Matrix |
multiply(float scalar)
Creates a view that is equal to the result of a scalar multiplication.
|
Matrix |
multiply(Matrix m)
Creates a view that is equal to the result of a matrix multiplication.
|
float[] |
rowSum()
Compute the sum for each row.
|
Matrix |
subtract(Matrix m)
Creates a view that is equal to the result of an subtraction.
|
float |
sum()
Compute the sum of all elements.
|
protected int |
toIndex(int row,
int column) |
String |
toString() |
Matrix |
translate(int rows,
int columns)
Creates a view that is equal to the result of a matrix translation.
|
Matrix |
transpose()
Creates a view that is equal to the result of a matrix transposition.
|
protected int rows
protected int columns
protected boolean zeroPadded
protected MatrixBackingBuffer buffer
public Matrix add(Matrix m)
Matrixpublic Matrix subtract(Matrix m)
Matrixpublic Matrix multiply(float scalar)
Matrixpublic Matrix multiply(Matrix m)
Matrixpublic Matrix transpose()
Matrixpublic Matrix translate(int rows, int columns)
Matrixpublic Matrix hadamardMultiply(Matrix m)
MatrixhadamardMultiply in interface Matrixm - matrix to multiply this withpublic Matrix enlarge(Matrix m)
Matrixpublic int getNumberOfColumns()
MatrixgetNumberOfColumns in interface Matrixpublic int getNumberOfRows()
MatrixgetNumberOfRows in interface Matrixpublic boolean isZeroPadded()
MatrixisZeroPadded in interface Matrixpublic float get(int row,
int column)
Matrixrow and column.
If the matrix supports zero-padding, this method may return
0f for undefined rows or columns.public float sum()
Matrixpublic float[] rowSum()
Matrixpublic float[] columnSum()
Matrixpublic float[] getRow(int row)
Matrixrow.
If the matrix supports zero-padding, this method may return
0f for undefined rows or columns.public float[] getColumn(int column)
Matrixcolumn.
If the matrix supports zero-padding, this method may return
0f for undefined columns.protected boolean isValidXORZeroPadded(int row,
int column)
protected void checkBounds(int row,
int column)
protected boolean isInvalid(int row,
int column)
protected int toIndex(int row,
int column)
protected float get(int index)
Copyright © 2011–2020 tagtraum industries incorporated. All rights reserved.