Package com.ijurnove.cpu3d
Class Matrix
java.lang.Object
com.ijurnove.cpu3d.Matrix
A
Matrix stores a two dimensional array of doubles.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMatrix(double[][] values) Constructs a newMatrixfilled with a specified set of values. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the number of columns.double[]getColumn(int columnNum) Returns an entire column of theMatrixas adouble[].double[]getRow(int rowNum) Returns an entire row of theMatrixas adouble[]doublegetValue(int col, int row) Returns the value at a specified row and column.double[][]Returns the values within theMatrixas adouble[][].protected static MatrixMultiplies thisMatrixby another.static MatrixMultiplies twoMatrixes together.protected voidprotected voidprotected voidintrowCount()Returns the number of rows.voidscalarMult(double factor) Multiplies all items of thisMatrixby a number.static voidscalarMult(Matrix m, double factor) Multiplies all items of aMatrixby a number.voidsetValue(int col, int row, double newVal) Sets the item at a specified row and column.voidSets all values in thisMatrixto the values of another.toString()
-
Field Details
-
AXIS_CONV_MATRIX
-
-
Constructor Details
-
Matrix
public Matrix(double[][] values) Constructs a newMatrixfilled with a specified set of values.- Parameters:
values- the initial Matrix values
-
-
Method Details
-
getValues
public double[][] getValues()Returns the values within theMatrixas adouble[][].- Returns:
- the values within this Matrix
-
columnCount
public int columnCount()Returns the number of columns.- Returns:
- the number of columns
-
rowCount
public int rowCount()Returns the number of rows.- Returns:
- the number of rows
-
setValue
public void setValue(int col, int row, double newVal) Sets the item at a specified row and column.- Parameters:
col- the column of the item to setrow- the row of the item to setnewVal- the value to set
-
getValue
public double getValue(int col, int row) Returns the value at a specified row and column.- Parameters:
col- the column of the itemrow- the row of the item
-
getRow
public double[] getRow(int rowNum) Returns an entire row of theMatrixas adouble[]- Parameters:
rowNum- the row to be returned- Returns:
- a specified row
-
getColumn
public double[] getColumn(int columnNum) Returns an entire column of theMatrixas adouble[].- Parameters:
columnNum- the column to be returned- Returns:
- a specified column
-
toString
-
setValues
Sets all values in thisMatrixto the values of another.- Parameters:
newValues- the Matrix to fill this one
-
scalarMult
Multiplies all items of aMatrixby a number.- Parameters:
m- the Matrix to be multipliedfactor- the number to multiply all numbers in the Matrix by
-
scalarMult
public void scalarMult(double factor) Multiplies all items of thisMatrixby a number.- Parameters:
factor- the number to multiply all numbers in this Matrix by
-
multiply
Multiplies twoMatrixes together.- Parameters:
matrix1- the first Matrixmatrix2- the second Matrix- Returns:
- the product of the two Matrices
-
multiply
Multiplies thisMatrixby another.- Parameters:
matrix2- the Matrix to multiply this one by- Returns:
- the product of this Matrix and the given Matrix
-
perspRenderUpd
-
perspRenderUpdForPointShadowMap
-
orthoRenderUpd
-
lookAt
-