public class Matrix
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
Matrix.EigenvalueDecomposition
Eigenvalues and eigenvectors of a real matrix.
|
static class |
Matrix.ImmutableMatrix |
Modifier and Type | Field and Description |
---|---|
protected double[][] |
coords |
protected int |
M |
protected int |
N |
Constructor and Description |
---|
Matrix(double[][] coords)
Construct a matrix from an array-of-array-of-double.
|
Matrix(int M,
int N)
Construct an M by N matrix with zeros in all entries.
|
Matrix(int M,
int N,
int seed) |
Modifier and Type | Method and Description |
---|---|
Matrix |
add(Matrix m)
Add the components of two matrices.
|
Matrix |
addThis(Matrix m)
Add the components of two matrices.
|
Matrix |
clone()
Returns a clone of this matrix.
|
static Matrix |
create4x4ColumnMatrix(Vector v1,
Vector v2,
Vector v3,
Vector v4) |
static Matrix3x3 |
createColumnMatrix(Vector v1,
Vector v2,
Vector v3) |
static Matrix |
createIdentityMatrix(int n) |
static Matrix |
createRandomMatrix(int n) |
static Matrix |
createRotationMatrix(double angle,
Vector v) |
static Matrix3x3 |
createRowMatrix(Vector v1,
Vector v2,
Vector v3) |
double |
determinant()
Get the determinant of this matrix.
|
boolean |
equals(Matrix m) |
boolean |
equals(java.lang.Object o) |
Matrix |
expand()
extends to the smallest power of 2 square matrix by adding appropriate zero rows and columns
|
Matrix |
extend()
extends to the smallest square matrix by adding appropriate zero rows or columns
|
double |
get(int i,
int j) |
Vector |
getColumn(int c) |
double[][] |
getCoords() |
Matrix.EigenvalueDecomposition |
getEigenvalueDecomposition() |
int |
getM() |
int |
getN() |
Vector |
getRow(int r) |
Matrix |
getSubmatrix(int i1,
int i2,
int j1,
int j2) |
Matrix |
getTranspose()
Get the transpose of this matrix
|
Matrix |
invert()
Return the inverse of this matrix.
|
Matrix |
invertThis()
Invert this matrix (overwrites this and returns it).
|
boolean |
isSquare() |
Matrix |
minor(int r,
int c)
Return the minor, i.e.
|
Matrix |
multiply_Strassen(Matrix B) |
Matrix |
multiply(double scalar)
Multiply the components of this matrix by a scalar.
|
Matrix |
multiply(Matrix m)
Multiply this matrix to another matrix and return the result.
|
Point |
multiply(Point p)
Apply this matrix to the point p and return the result (this will NOT change p).
|
Point |
multiply(Point p) |
Vector |
multiply(Vector v)
Apply this matrix to the vector v and return the result (without changing v).
|
Point |
multiplyIn(Point p)
Apply this matrix to the point p and return the result (this will change p).
|
Vector |
multiplyIn(Vector v)
Apply this matrix to the vector v and return the result (this will change v).
|
Matrix |
multiplyThis(double scalar)
Multiply the components of this matrix by a scalar.
|
Matrix |
multiplyThis(Matrix m)
Multiply this matrix to another matrix.
|
Matrix |
orthonormalizeThis()
Run Gram-Schmidt orthonormalization procedure.
|
Matrix |
reduce()
Reduce this matrix to row canonical form (reduced row echelon form).
|
Matrix |
reduceThis()
Reduce this matrix to row canonical form (reduced row echelon form).
|
void |
set(int r,
int c,
double v) |
void |
setColumn(int c,
Vector v) |
void |
setRow(int r,
Vector v) |
void |
setSubmatrix(int i1,
int j1,
Matrix M) |
Matrix |
subtract(Matrix m)
Subtract the components of two matrices.
|
Matrix |
subtractThis(Matrix m)
Subtract the components of two matrices.
|
void |
toConsole() |
void |
toConsole(int dec) |
java.lang.String |
toString() |
java.lang.String |
toString(int dec) |
Matrix |
transpose()
Get the transpose of this matrix
|
public Matrix(int M, int N)
public Matrix(double[][] coords)
public Matrix(int M, int N, int seed)
public void set(int r, int c, double v)
public double get(int i, int j)
public double[][] getCoords()
public int getM()
public int getN()
public Vector getRow(int r)
public Vector getColumn(int c)
public void setRow(int r, Vector v)
public void setColumn(int c, Vector v)
public Matrix getSubmatrix(int i1, int i2, int j1, int j2)
public void setSubmatrix(int i1, int j1, Matrix M)
public Matrix getTranspose()
public Matrix transpose()
public Vector multiplyIn(Vector v)
public Point multiply(Point p)
public Point multiplyIn(Point p)
public Vector multiply(Vector v)
public Matrix multiplyThis(Matrix m)
public Matrix multiply(Matrix m)
public Matrix add(Matrix m)
public Matrix addThis(Matrix m)
public Matrix subtract(Matrix m)
public Matrix subtractThis(Matrix m)
public Matrix multiply(double scalar)
public Matrix multiplyThis(double scalar)
public Matrix minor(int r, int c)
public double determinant()
public boolean isSquare()
public Matrix extend()
public Matrix expand()
public Matrix invert()
public Matrix invertThis()
public Matrix reduce()
public Matrix reduceThis()
public Matrix orthonormalizeThis()
public boolean equals(Matrix m)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public Matrix.EigenvalueDecomposition getEigenvalueDecomposition()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(int dec)
public void toConsole()
public void toConsole(int dec)
public Matrix clone()
clone
in class java.lang.Object
public static Matrix createRandomMatrix(int n)
public static Matrix createIdentityMatrix(int n)
public static Matrix create4x4ColumnMatrix(Vector v1, Vector v2, Vector v3, Vector v4)