- Object
-
- Matrix22
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Matrix22
add(Matrix22 matrix)
Matrix22
copy()
Returns a deep copy of this object.double
determinant()
Returns the determinant of thisMatrix22
.Matrix22
difference(Matrix22 matrix)
boolean
equals(Object obj)
Matrix22
getInverse()
Matrix22
getTranspose()
int
hashCode()
Matrix22
identity()
Matrix22
invert()
void
invert(Matrix22 dest)
Matrix22
multiply(double scalar)
Matrix22
multiply(Matrix22 matrix)
Vector2
multiply(Vector2 vector)
Vector2
multiplyT(Vector2 vector)
double
norm1()
Returns the 1-norm of this matrix.double
normFrobenius()
Returns the frobenius-norm of this matrix.double
normInfinity()
Returns the infinity-norm of this matrix.double
normMax()
Returns the max-norm of this matrix.Matrix22
product(double scalar)
Matrix22
product(Matrix22 matrix)
Vector2
product(Vector2 vector)
Vector2
productT(Vector2 vector)
Vector2
solve(Vector2 b)
Solves the system of linear equations:Matrix22
subtract(Matrix22 matrix)
Matrix22
sum(Matrix22 matrix)
String
toString()
Matrix22
transpose()
-
-
-
Constructor Detail
-
Matrix22
public Matrix22()
Default constructor.
-
Matrix22
public Matrix22(double m00, double m01, double m10, double m11)
Full constructor.- Parameters:
m00
- the element at 0,0m01
- the element at 0,1m10
- the element at 1,0m11
- the element at 1,1
-
Matrix22
public Matrix22(double[] values)
Full constructor.The given array should be in the same order as the
Matrix22(double, double, double, double)
constructor.- Parameters:
values
- the values array- Throws:
NullPointerException
- if values is nullIllegalArgumentException
- if values is not of length 4
-
-
Method Detail
-
copy
public Matrix22 copy()
Description copied from interface:Copyable
Returns a deep copy of this object.
-
multiply
public Matrix22 multiply(double scalar)
Multiplies thisMatrix22
by the given scalar and places the result in thisMatrix22
.this = this * scalar
- Parameters:
scalar
- the scalar to multiply by- Returns:
Matrix22
this matrix
-
product
public Matrix22 product(double scalar)
Multiplies thisMatrix22
by the given scalar returning a newMatrix22
containing the result.r = this * scalar
- Parameters:
scalar
- the scalar to multiply by- Returns:
Matrix22
a new matrix containing the result
-
determinant
public double determinant()
Returns the determinant of thisMatrix22
.- Returns:
- double
-
invert
public void invert(Matrix22 dest)
- Parameters:
dest
- the destination for the inverse- Since:
- 4.0.0
-
solve
public Vector2 solve(Vector2 b)
Solves the system of linear equations:Ax = b Multiply by A-1 on both sides x = A-1b
-
normMax
public double normMax()
Returns the max-norm of this matrix.- Returns:
- double
-
normInfinity
public double normInfinity()
Returns the infinity-norm of this matrix.- Returns:
- double
-
norm1
public double norm1()
Returns the 1-norm of this matrix.- Returns:
- double
-
normFrobenius
public double normFrobenius()
Returns the frobenius-norm of this matrix.- Returns:
- double
-
-