Class Matrix2x2D
java.lang.Object
com.io7m.jtensors.core.unparameterized.matrices.Matrix2x2D
- All Implemented Interfaces:
MatrixComputationalType,Matrix2x2DType,MatrixReadable2x2DType,MatrixReadableDType
public final class Matrix2x2D extends java.lang.Object implements Matrix2x2DType
The type of 2x2
double-typed matrices.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMatrix2x2D.BuilderBuilds instances of typeMatrix2x2D. -
Method Summary
Modifier and Type Method Description static Matrix2x2D.Builderbuilder()Creates a builder forMatrix2x2D.static Matrix2x2DcopyOf(Matrix2x2DType instance)Creates an immutable copy of aMatrix2x2DTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofMatrix2x2Dthat have equal attribute values.inthashCode()Computes a hash code from attributes:r0c0,r0c1,r1c0,r1c1.static Matrix2x2Dof(double r0c0, double r0c1, double r1c0, double r1c1)Construct a new immutableMatrix2x2Dinstance.doubler0c0()doubler0c1()doubler1c0()doubler1c1()java.lang.StringtoString()Prints the immutable valueMatrix2x2Dwith attribute values.Matrix2x2DwithR0c0(double value)Copy the current immutable object by setting a value for ther0c0attribute.Matrix2x2DwithR0c1(double value)Copy the current immutable object by setting a value for ther0c1attribute.Matrix2x2DwithR1c0(double value)Copy the current immutable object by setting a value for ther1c0attribute.Matrix2x2DwithR1c1(double value)Copy the current immutable object by setting a value for ther1c1attribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.io7m.jtensors.core.unparameterized.matrices.MatrixReadable2x2DType
rowColumn
-
Method Details
-
r0c0
public double r0c0()- Specified by:
r0c0in interfaceMatrix2x2DType- Specified by:
r0c0in interfaceMatrixReadable2x2DType- Returns:
- The value at row 0 column 0
-
r0c1
public double r0c1()- Specified by:
r0c1in interfaceMatrix2x2DType- Specified by:
r0c1in interfaceMatrixReadable2x2DType- Returns:
- The value at row 0 column 1
-
r1c0
public double r1c0()- Specified by:
r1c0in interfaceMatrix2x2DType- Specified by:
r1c0in interfaceMatrixReadable2x2DType- Returns:
- The value at row 1 column 0
-
r1c1
public double r1c1()- Specified by:
r1c1in interfaceMatrix2x2DType- Specified by:
r1c1in interfaceMatrixReadable2x2DType- Returns:
- The value at row 1 column 1
-
withR0c0
Copy the current immutable object by setting a value for ther0c0attribute. A value strict bits equality used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for r0c0- Returns:
- A modified copy of the
thisobject
-
withR0c1
Copy the current immutable object by setting a value for ther0c1attribute. A value strict bits equality used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for r0c1- Returns:
- A modified copy of the
thisobject
-
withR1c0
Copy the current immutable object by setting a value for ther1c0attribute. A value strict bits equality used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for r1c0- Returns:
- A modified copy of the
thisobject
-
withR1c1
Copy the current immutable object by setting a value for ther1c1attribute. A value strict bits equality used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for r1c1- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofMatrix2x2Dthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()Computes a hash code from attributes:r0c0,r0c1,r1c0,r1c1.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valueMatrix2x2Dwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
Construct a new immutableMatrix2x2Dinstance.- Parameters:
r0c0- The value for ther0c0attributer0c1- The value for ther0c1attributer1c0- The value for ther1c0attributer1c1- The value for ther1c1attribute- Returns:
- An immutable Matrix2x2D instance
-
copyOf
Creates an immutable copy of aMatrix2x2DTypevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable Matrix2x2D instance
-
builder
Creates a builder forMatrix2x2D.Matrix2x2D.builder() .setR0c0(double) // requiredr0c0.setR0c1(double) // requiredr0c1.setR1c0(double) // requiredr1c0.setR1c1(double) // requiredr1c1.build();- Returns:
- A new Matrix2x2D builder
-