Package com.google.common.geometry
Class Matrix3x3
java.lang.Object
com.google.common.geometry.Matrix3x3
A simple 3x3 matrix.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
cols()
Returns the number of columns in this matrix.boolean
static Matrix3x3
Constructs a matrix from a series of column vectors.static Matrix3x3
Constructs a matrix from a series of column vectors.double
get
(int row, int col) Gets a value.getCol
(int col) Return the vector of the given column.int
hashCode()
Returns the result of multiplying this x m.int
rows()
Returns the number of rows in this matrix.void
set
(int row, int col, double value) Sets a value.Returns the transpose of this.
-
Field Details
-
values
private final double[] values -
rows
private final int rows -
cols
private final int cols
-
-
Constructor Details
-
Matrix3x3
public Matrix3x3(int cols, double... values) Constructs a 2D matrix of the given width and values. -
Matrix3x3
public Matrix3x3(int rows, int cols) Constructs a 2D matrix of a fixed size.
-
-
Method Details
-
fromCols
Constructs a matrix from a series of column vectors. -
fromCols
Constructs a matrix from a series of column vectors. -
rows
public int rows()Returns the number of rows in this matrix. -
cols
public int cols()Returns the number of columns in this matrix. -
set
public void set(int row, int col, double value) Sets a value. -
get
public double get(int row, int col) Gets a value. -
transpose
Returns the transpose of this. -
mult
Returns the result of multiplying this x m. -
getCol
Return the vector of the given column. -
equals
-
hashCode
public int hashCode()
-