Package com.singularsys.exttests.matrix
Class RationalMatrixFactory
- java.lang.Object
-
- com.singularsys.extensions.matrix.genericmat.GenericMatrixFactory<Rational>
-
- com.singularsys.exttests.matrix.RationalMatrixFactory
-
- All Implemented Interfaces:
MatrixFactoryI
,JepComponent
,java.io.Serializable
public class RationalMatrixFactory extends GenericMatrixFactory<Rational>
A MatrixFactory where the matrices have elements of type Rational. and calculations are performed using theRationalField
. Here the matrices are actually an arrayRational[][]
rather than arrayObject[][]
where the elements are all rationals.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
RationalMatrixFactory.RationalMatrix
class
RationalMatrixFactory.RationalVector
-
Field Summary
-
Fields inherited from class com.singularsys.extensions.matrix.genericmat.GenericMatrixFactory
ONE, ZERO
-
-
Constructor Summary
Constructors Constructor Description RationalMatrixFactory(RationalField base)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Rational[]
buildDataArray(int len)
Build a data array.protected Rational[][]
buildDataArray(int rows, int cols)
Build a data array.protected RationalMatrixFactory.RationalMatrix
cast(MatrixI m)
A typical implementation will just usereturn (GenericMatrix<E>) m;
protected RationalMatrixFactory.RationalVector
cast(VectorI m)
A typical implementation will just usereturn (V) v;
RationalMatrixFactory.RationalMatrix
newMatrixUnchecked(java.lang.Object[][] data)
RationalMatrixFactory.RationalVector
newVectorUnchecked(java.lang.Object[] data)
-
Methods inherited from class com.singularsys.extensions.matrix.genericmat.GenericMatrixFactory
elementValue, getLightWeightInstance, getONE, identity, identity, init, newMatrix, newVector, zeroEement, zeroMat, zeroMat, zeroMat, zeroVec
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.singularsys.extensions.matrix.MatrixFactoryI
zeroVec
-
-
-
-
Constructor Detail
-
RationalMatrixFactory
public RationalMatrixFactory(RationalField base)
-
-
Method Detail
-
cast
protected RationalMatrixFactory.RationalMatrix cast(MatrixI m)
Description copied from class:GenericMatrixFactory
A typical implementation will just usereturn (GenericMatrix<E>) m;
- Overrides:
cast
in classGenericMatrixFactory<Rational>
- Parameters:
m
- the matrix to cast- Returns:
- a matrix of type GenericMatrix<E> = GenericMatrix<E>
-
cast
protected RationalMatrixFactory.RationalVector cast(VectorI m)
Description copied from class:GenericMatrixFactory
A typical implementation will just usereturn (V) v;
- Overrides:
cast
in classGenericMatrixFactory<Rational>
- Parameters:
m
- the vector to cast- Returns:
- a vector of type V = GenericVector<E>
-
buildDataArray
protected Rational[][] buildDataArray(int rows, int cols)
Description copied from class:GenericMatrixFactory
Build a data array. A typical concrete implementation will just usereturn new E[rows][cols]
.- Overrides:
buildDataArray
in classGenericMatrixFactory<Rational>
- Parameters:
rows
- number of rowscols
- number of cols- Returns:
- the array.
-
buildDataArray
protected Rational[] buildDataArray(int len)
Description copied from class:GenericMatrixFactory
Build a data array. A typical concrete implementation will just usereturn new E[rows][len]
.- Overrides:
buildDataArray
in classGenericMatrixFactory<Rational>
- Parameters:
len
- number of elements- Returns:
- the array.
-
newMatrixUnchecked
public RationalMatrixFactory.RationalMatrix newMatrixUnchecked(java.lang.Object[][] data)
- Overrides:
newMatrixUnchecked
in classGenericMatrixFactory<Rational>
-
newVectorUnchecked
public RationalMatrixFactory.RationalVector newVectorUnchecked(java.lang.Object[] data)
- Overrides:
newVectorUnchecked
in classGenericMatrixFactory<Rational>
-
-