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)
Matrix
public Matrix subtract(Matrix m)
Matrix
public Matrix multiply(float scalar)
Matrix
public Matrix multiply(Matrix m)
Matrix
public Matrix transpose()
Matrix
public Matrix translate(int rows, int columns)
Matrix
public Matrix hadamardMultiply(Matrix m)
Matrix
hadamardMultiply
in interface Matrix
m
- matrix to multiply this withpublic Matrix enlarge(Matrix m)
Matrix
public int getNumberOfColumns()
Matrix
getNumberOfColumns
in interface Matrix
public int getNumberOfRows()
Matrix
getNumberOfRows
in interface Matrix
public boolean isZeroPadded()
Matrix
isZeroPadded
in interface Matrix
public float get(int row, int column)
Matrix
row
and column
.
If the matrix supports zero-padding, this method may return
0f
for undefined rows or columns.public float sum()
Matrix
public float[] rowSum()
Matrix
public float[] columnSum()
Matrix
public float[] getRow(int row)
Matrix
row
.
If the matrix supports zero-padding, this method may return
0f
for undefined rows or columns.public float[] getColumn(int column)
Matrix
column
.
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.