Class MatrixFieldCollection
java.lang.Object
com.singularsys.extensions.field.FieldCollection
com.singularsys.extensions.matrix.MatrixFieldCollection
- All Implemented Interfaces:
FieldI,IntegerConvertor,MatrixFieldI,JepComponent,Serializable
A collection of fields including one matrix.
It is not currently possible to use two different types of matrices
together. You can combine a matrix type with other field implementations
such as the
BooleanField
to add logical capability.- See Also:
-
Field Summary
Fields inherited from class com.singularsys.extensions.field.FieldCollection
fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAttempt to convert argument from an integerAttempt to convert argument to an integerThe cross product of two vectorsThe determinant of a matrixThe dot product of two vectorsReturns thisvoidInitialize the component.Returns the inverse of a square matrix.Solve equation A * X = BReturns the trace of a matrix.Transpose of a matrixMethods inherited from class com.singularsys.extensions.field.FieldCollection
add, addField, and, clearFields, div, eq, ge, getFields, getOne, getZero, gt, le, lt, mod, mul, ne, neg, not, or, pow, removeField, sub
-
Constructor Details
-
MatrixFieldCollection
-
-
Method Details
-
det
Description copied from interface:MatrixFieldIThe determinant of a matrix- Specified by:
detin interfaceMatrixFieldI- Parameters:
mat-- Returns:
- the determinant of mat if it is a matrix
- Throws:
EvaluationException
-
trans
Description copied from interface:MatrixFieldITranspose of a matrix- Specified by:
transin interfaceMatrixFieldI- Parameters:
mat- the matrix- Returns:
- a matrix containing the transpose
- Throws:
EvaluationException
-
dot
Description copied from interface:MatrixFieldIThe dot product of two vectors- Specified by:
dotin interfaceMatrixFieldI- Parameters:
l-r-- Returns:
- the dot product if both arguments are vectors, null otherwise.
- Throws:
EvaluationException
-
cross
Description copied from interface:MatrixFieldIThe cross product of two vectors- Specified by:
crossin interfaceMatrixFieldI- Parameters:
l-r-- Returns:
- a vector with the cross product
- Throws:
EvaluationException- if either vectors not of length 3
-
trace
Description copied from interface:MatrixFieldIReturns the trace of a matrix.- Specified by:
tracein interfaceMatrixFieldI- Parameters:
mat- the matrix- Returns:
- the trace
- Throws:
EvaluationException
-
inv
Description copied from interface:MatrixFieldIReturns the inverse of a square matrix.- Specified by:
invin interfaceMatrixFieldI- Parameters:
mat- the matrix- Returns:
- the trace
- Throws:
EvaluationException- if matrix is not square or is singular
-
solve
Description copied from interface:MatrixFieldISolve equation A * X = B- Specified by:
solvein interfaceMatrixFieldI- Parameters:
l- a square matrixr- either a vector or matrix with same number of rows as A- Returns:
- a vector or matrix solving equations
- Throws:
EvaluationException- if matrix is not square or is singular
-
convertToInt
Description copied from interface:IntegerConvertorAttempt to convert argument to an integer- Specified by:
convertToIntin interfaceIntegerConvertor- Overrides:
convertToIntin classFieldCollection- Parameters:
l- value to convert- Returns:
- corresponding integer or null if it cannot be converted
- Throws:
EvaluationException- on error
-
convertFromInt
Description copied from interface:IntegerConvertorAttempt to convert argument from an integer- Specified by:
convertFromIntin interfaceIntegerConvertor- Overrides:
convertFromIntin classFieldCollection- Parameters:
l- value to convert- Returns:
- corresponding value in this field or null if it cannot be converted
- Throws:
EvaluationException- probably never
-
init
Description copied from interface:JepComponentInitialize the component. This method is called whenever a component is added to Jep. Hence, it allows components to keep track of the other components they may rely on.- Specified by:
initin interfaceJepComponent- Parameters:
jep- the current Jep instance
-
getLightWeightInstance
Returns this- Specified by:
getLightWeightInstancein interfaceJepComponent- Returns:
- either a new instance, null or 'this'.
-