E - Type of an individual element.
Subclasses should implement the methods addEle(Object, Object) to add elements
of the base field.
public abstract class GenericMatrixField<E> extends java.lang.Object implements MatrixFieldI
addEle(Object, Object) etc.| Modifier and Type | Field and Description |
|---|---|
protected GenericMatrixFactory<E> |
mf |
| Constructor and Description |
|---|
GenericMatrixField(GenericMatrixFactory<E> mf)
Standard constructor.
|
GenericMatrixField(GenericMatrixFactory<E> mf,
boolean skipElements)
Constructor where operations on the base field can be switched off.
|
| Modifier and Type | Method and Description |
|---|---|
protected GenericMatrix<E> |
add(GenericMatrix<E> lm,
GenericMatrix<E> rm) |
protected GenericVector<E> |
add(GenericVector<E> lv,
GenericVector<E> rv) |
java.lang.Object |
add(java.lang.Object l,
java.lang.Object r)
Add two members of the field.
|
protected abstract E |
addEle(E l,
E r)
Adds two elements of the vector/matrix
|
java.lang.Boolean |
and(java.lang.Object l,
java.lang.Object r)
Logical and.
|
protected abstract java.lang.Boolean |
andEle(E l,
E r) |
protected E |
calcSize(E ele)
Get the current "size" of an element
|
protected boolean |
cmpSize(E size,
E max)
Compare current "size" to maximum.
|
java.lang.Object |
cross(GenericVector<E> lv,
GenericVector<E> rv) |
java.lang.Object |
cross(java.lang.Object l,
java.lang.Object r)
The cross product of two vectors
|
protected E |
det(GenericMatrix<E> l) |
java.lang.Object |
det(java.lang.Object l)
The determinant of a matrix
|
protected GenericMatrix<E> |
div(GenericMatrix<E> lm,
java.lang.Object r) |
protected GenericVector<E> |
div(GenericVector<E> lv,
java.lang.Object r) |
java.lang.Object |
div(java.lang.Object l,
java.lang.Object r)
Divides two members of the field.
|
protected abstract E |
divEle(E l,
E r) |
protected E |
dot(GenericVector<E> lv,
GenericVector<E> rv) |
java.lang.Object |
dot(java.lang.Object l,
java.lang.Object r)
The dot product of two vectors
|
protected boolean |
eq(GenericMatrix<E> lm,
GenericMatrix<E> rm) |
protected boolean |
eq(GenericVector<E> lv,
GenericVector<E> rv) |
java.lang.Boolean |
eq(java.lang.Object l,
java.lang.Object r)
Equals
|
protected abstract java.lang.Boolean |
eqEle(E l,
E r) |
java.lang.Boolean |
ge(java.lang.Object l,
java.lang.Object r)
Greater or equal to
|
protected abstract java.lang.Boolean |
geEle(E l,
E r) |
JepComponent |
getLightWeightInstance()
Gets a light-weight instance suitable for using in multiple threads.
|
abstract E |
getOne()
Get the multiplicative identity for this field.
|
abstract E |
getZero()
Get the additive identity for this field
|
java.lang.Boolean |
gt(java.lang.Object l,
java.lang.Object r)
Greater than
|
protected abstract java.lang.Boolean |
gtEle(E l,
E r) |
void |
init(Jep jep)
Initialize the component.
|
java.lang.Object |
inv(java.lang.Object l)
Returns the inverse of a square matrix.
|
protected GenericMatrix<E> |
invMat(GenericMatrix<E> mat) |
java.lang.Boolean |
le(java.lang.Object l,
java.lang.Object r)
Less than or equals to
|
protected abstract java.lang.Boolean |
leEle(E l,
E r) |
java.lang.Boolean |
lt(java.lang.Object l,
java.lang.Object r)
Less than
|
protected abstract java.lang.Boolean |
ltEle(E l,
E r) |
protected GenericMatrix<E> |
minor(GenericMatrix<E> l,
int row,
int col)
Creates the matrix of minors by excluding one row and one column
|
java.lang.Object |
mod(java.lang.Object l,
java.lang.Object r)
Mod operation not defined for matrices
|
protected abstract E |
modEle(E l,
E r) |
protected GenericMatrix<E> |
mul(GenericMatrix<E> lm,
GenericMatrix<E> rm) |
protected GenericVector<E> |
mul(GenericMatrix<E> lm,
GenericVector<E> rv) |
protected GenericMatrix<E> |
mul(GenericMatrix<E> lm,
java.lang.Object r) |
protected GenericVector<E> |
mul(GenericVector<E> lv,
GenericMatrix<E> rm) |
protected GenericMatrix<E> |
mul(GenericVector<E> lv,
GenericVector<E> rv) |
protected GenericVector<E> |
mul(GenericVector<E> lv,
java.lang.Object r) |
java.lang.Object |
mul(java.lang.Object l,
java.lang.Object r)
Multiplies two members of the field.
|
protected abstract E |
mulEle(E l,
E r) |
java.lang.Boolean |
ne(java.lang.Object l,
java.lang.Object r)
Not Equals
|
protected abstract java.lang.Boolean |
neEle(E l,
E r) |
protected GenericMatrix<E> |
neg(GenericMatrix<E> lm) |
protected GenericVector<E> |
neg(GenericVector<E> lv) |
java.lang.Object |
neg(java.lang.Object l)
The negation -x of an element.
|
protected abstract E |
negEle(E l) |
java.lang.Boolean |
not(java.lang.Object l)
Logical not.
|
protected abstract java.lang.Boolean |
notEle(E l) |
java.lang.Boolean |
or(java.lang.Object l,
java.lang.Object r)
Logical or.
|
protected abstract java.lang.Boolean |
orEle(E l,
E r) |
java.lang.Object |
pow(java.lang.Object l,
java.lang.Object r)
Pow operation not defined for matrices
|
protected abstract E |
powEle(E l,
E r) |
java.lang.Object |
solve(java.lang.Object A,
java.lang.Object B)
Solve equation A * X = B
|
protected MatrixI |
solveMM(GenericMatrix<E> A,
GenericMatrix<E> b) |
protected VectorI |
solveMV(GenericMatrix<E> A,
GenericVector<E> b) |
protected GenericMatrix<E> |
sub(GenericMatrix<E> lm,
GenericMatrix<E> rm) |
protected GenericVector<E> |
sub(GenericVector<E> lv,
GenericVector<E> rv) |
java.lang.Object |
sub(java.lang.Object l,
java.lang.Object r)
Subtract two members of the field.
|
protected abstract E |
subEle(E l,
E r) |
protected void |
subtractMul(GenericMatrix<E> m,
int targetRow,
int sourceRow,
E mul)
Subtract a multiply of the source row from the target
m(t,j) = m(t,j) - mul * m(s,j) |
protected void |
swapRows(MatrixI m,
int i,
int j)
In place swap of two rows
|
java.lang.Object |
trace(GenericMatrix<E> l) |
java.lang.Object |
trace(java.lang.Object l)
Returns the trace of a matrix.
|
protected GenericMatrix<E> |
trans(GenericMatrix<E> l) |
java.lang.Object |
trans(java.lang.Object l)
Transpose of a matrix
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconvertFromInt, convertToIntprotected GenericMatrixFactory<E> mf
public GenericMatrixField(GenericMatrixFactory<E> mf)
mf - The factory used to generate matricespublic GenericMatrixField(GenericMatrixFactory<E> mf, boolean skipElements)
mf - The factory used to generate matricesskipElements - whether to skip operations on the base elementsprotected abstract E addEle(E l, E r) throws EvaluationException
l - lhs elementr - rhs elementEvaluationExceptionprotected abstract E subEle(E l, E r) throws EvaluationException
EvaluationExceptionprotected abstract E negEle(E l) throws EvaluationException
EvaluationExceptionprotected abstract E mulEle(E l, E r) throws EvaluationException
EvaluationExceptionprotected abstract E modEle(E l, E r) throws EvaluationException
EvaluationExceptionprotected abstract E divEle(E l, E r) throws EvaluationException
EvaluationExceptionprotected abstract E powEle(E l, E r) throws EvaluationException
EvaluationExceptionprotected abstract java.lang.Boolean eqEle(E l, E r) throws EvaluationException
EvaluationExceptionprotected abstract java.lang.Boolean neEle(E l, E r) throws EvaluationException
EvaluationExceptionprotected abstract java.lang.Boolean ltEle(E l, E r) throws EvaluationException
EvaluationExceptionprotected abstract java.lang.Boolean leEle(E l, E r) throws EvaluationException
EvaluationExceptionprotected abstract java.lang.Boolean gtEle(E l, E r) throws EvaluationException
EvaluationExceptionprotected abstract java.lang.Boolean geEle(E l, E r) throws EvaluationException
EvaluationExceptionprotected abstract java.lang.Boolean andEle(E l, E r) throws EvaluationException
EvaluationExceptionprotected abstract java.lang.Boolean orEle(E l, E r) throws EvaluationException
EvaluationExceptionprotected abstract java.lang.Boolean notEle(E l) throws EvaluationException
EvaluationExceptionpublic java.lang.Object add(java.lang.Object l,
java.lang.Object r)
throws EvaluationException
FieldIadd in interface FieldIl - left hand argumentr - right hand argumentEvaluationException - on errorprotected GenericVector<E> add(GenericVector<E> lv, GenericVector<E> rv) throws EvaluationException
EvaluationExceptionprotected GenericMatrix<E> add(GenericMatrix<E> lm, GenericMatrix<E> rm) throws EvaluationException
EvaluationExceptionpublic java.lang.Object sub(java.lang.Object l,
java.lang.Object r)
throws EvaluationException
FieldIsub in interface FieldIl - left hand argumentr - right hand argumentEvaluationException - on errorprotected GenericMatrix<E> sub(GenericMatrix<E> lm, GenericMatrix<E> rm) throws EvaluationException
EvaluationExceptionprotected GenericVector<E> sub(GenericVector<E> lv, GenericVector<E> rv) throws EvaluationException
EvaluationExceptionpublic java.lang.Object neg(java.lang.Object l)
throws EvaluationException
FieldIneg in interface FieldIl - the argumentEvaluationException - on errorprotected GenericMatrix<E> neg(GenericMatrix<E> lm) throws EvaluationException
EvaluationExceptionprotected GenericVector<E> neg(GenericVector<E> lv) throws EvaluationException
EvaluationExceptionpublic java.lang.Object mul(java.lang.Object l,
java.lang.Object r)
throws EvaluationException
FieldImul in interface FieldIl - left hand argumentr - right hand argumentEvaluationException - on errorprotected GenericMatrix<E> mul(GenericMatrix<E> lm, GenericMatrix<E> rm) throws EvaluationException
EvaluationExceptionprotected GenericVector<E> mul(GenericMatrix<E> lm, GenericVector<E> rv) throws EvaluationException
EvaluationExceptionprotected GenericVector<E> mul(GenericVector<E> lv, GenericMatrix<E> rm) throws EvaluationException
EvaluationExceptionprotected GenericMatrix<E> mul(GenericVector<E> lv, GenericVector<E> rv) throws EvaluationException
EvaluationExceptionprotected GenericMatrix<E> mul(GenericMatrix<E> lm, java.lang.Object r) throws EvaluationException
EvaluationExceptionprotected GenericVector<E> mul(GenericVector<E> lv, java.lang.Object r) throws EvaluationException
EvaluationExceptionpublic java.lang.Object div(java.lang.Object l,
java.lang.Object r)
throws EvaluationException
FieldIdiv in interface FieldIl - left hand argumentr - right hand argumentEvaluationException - on errorprotected GenericVector<E> div(GenericVector<E> lv, java.lang.Object r) throws EvaluationException
EvaluationExceptionprotected GenericMatrix<E> div(GenericMatrix<E> lm, java.lang.Object r) throws EvaluationException
EvaluationExceptionpublic java.lang.Object mod(java.lang.Object l,
java.lang.Object r)
throws EvaluationException
mod in interface FieldIl - left hand argumentr - right hand argumentEvaluationExceptionpublic java.lang.Object pow(java.lang.Object l,
java.lang.Object r)
throws EvaluationException
pow in interface FieldIl - left hand argumentr - right hand argumentEvaluationExceptionpublic java.lang.Boolean eq(java.lang.Object l,
java.lang.Object r)
throws EvaluationException
FieldIeq in interface FieldIl - left hand argumentr - right hand argumentEvaluationException - on errorpublic java.lang.Boolean ne(java.lang.Object l,
java.lang.Object r)
throws EvaluationException
FieldIne in interface FieldIl - left hand argumentr - right hand argumentEvaluationException - on errorprotected boolean eq(GenericMatrix<E> lm, GenericMatrix<E> rm) throws EvaluationException
EvaluationExceptionprotected boolean eq(GenericVector<E> lv, GenericVector<E> rv) throws EvaluationException
EvaluationExceptionpublic java.lang.Boolean gt(java.lang.Object l,
java.lang.Object r)
throws EvaluationException
FieldIgt in interface FieldIl - left hand argumentr - right hand argumentEvaluationException - on errorpublic java.lang.Boolean ge(java.lang.Object l,
java.lang.Object r)
throws EvaluationException
FieldIge in interface FieldIl - left hand argumentr - right hand argumentEvaluationException - on errorpublic java.lang.Boolean lt(java.lang.Object l,
java.lang.Object r)
throws EvaluationException
FieldIlt in interface FieldIl - left hand argumentr - right hand argumentEvaluationException - on errorpublic java.lang.Boolean le(java.lang.Object l,
java.lang.Object r)
throws EvaluationException
FieldIle in interface FieldIl - left hand argumentr - right hand argumentEvaluationException - on errorpublic java.lang.Boolean and(java.lang.Object l,
java.lang.Object r)
throws EvaluationException
FieldIand in interface FieldIl - left hand argument implimentationr - right hand argumentEvaluationException - on errorpublic java.lang.Boolean or(java.lang.Object l,
java.lang.Object r)
throws EvaluationException
FieldIor in interface FieldIl - left hand argumentr - right hand argumentEvaluationException - on errorpublic java.lang.Boolean not(java.lang.Object l)
throws EvaluationException
FieldInot in interface FieldIl - argumentEvaluationException - on errorpublic java.lang.Object det(java.lang.Object l)
throws EvaluationException
MatrixFieldIdet in interface MatrixFieldIEvaluationExceptionprotected E det(GenericMatrix<E> l) throws EvaluationException
EvaluationExceptionpublic java.lang.Object trace(java.lang.Object l)
throws EvaluationException
MatrixFieldItrace in interface MatrixFieldIl - the matrixEvaluationExceptionpublic java.lang.Object trace(GenericMatrix<E> l) throws EvaluationException
EvaluationExceptionprotected GenericMatrix<E> minor(GenericMatrix<E> l, int row, int col) throws EvaluationException
l - row - the row to excludecol - the column to excludeEvaluationExceptionpublic java.lang.Object trans(java.lang.Object l)
throws EvaluationException
MatrixFieldItrans in interface MatrixFieldIl - the matrixEvaluationExceptionprotected GenericMatrix<E> trans(GenericMatrix<E> l)
public java.lang.Object dot(java.lang.Object l,
java.lang.Object r)
throws EvaluationException
MatrixFieldIdot in interface MatrixFieldIEvaluationExceptionprotected E dot(GenericVector<E> lv, GenericVector<E> rv) throws EvaluationException
EvaluationExceptionpublic java.lang.Object cross(java.lang.Object l,
java.lang.Object r)
throws EvaluationException
MatrixFieldIcross in interface MatrixFieldIEvaluationException - if either vectors not of length 3public java.lang.Object cross(GenericVector<E> lv, GenericVector<E> rv) throws EvaluationException
EvaluationExceptionprotected void swapRows(MatrixI m, int i, int j) throws EvaluationException
m - matrixi - index of first rowj - index of second rowEvaluationExceptionprotected void subtractMul(GenericMatrix<E> m, int targetRow, int sourceRow, E mul) throws EvaluationException
m(t,j) = m(t,j) - mul * m(s,j)m - targetRow - sourceRow - mul - EvaluationExceptionpublic abstract E getZero()
FieldIpublic abstract E getOne()
FieldIprotected GenericMatrix<E> invMat(GenericMatrix<E> mat) throws EvaluationException
EvaluationExceptionprotected E calcSize(E ele) throws EvaluationException
ele - EvaluationExceptionprotected boolean cmpSize(E size, E max) throws EvaluationException
size - currentmax - maximumEvaluationExceptionpublic java.lang.Object inv(java.lang.Object l)
throws EvaluationException
MatrixFieldIinv in interface MatrixFieldIl - the matrixEvaluationException - if matrix is not square or is singularprotected MatrixI solveMM(GenericMatrix<E> A, GenericMatrix<E> b) throws EvaluationException
EvaluationExceptionprotected VectorI solveMV(GenericMatrix<E> A, GenericVector<E> b) throws EvaluationException
EvaluationExceptionpublic java.lang.Object solve(java.lang.Object A,
java.lang.Object B)
throws EvaluationException
MatrixFieldIsolve in interface MatrixFieldIA - a square matrixB - either a vector or matrix with same number of rows as AEvaluationException - if matrix is not square or is singularpublic void init(Jep jep)
JepComponentinit in interface JepComponentjep - the current Jep instancepublic JepComponent getLightWeightInstance()
JepComponentgetLightWeightInstance in interface JepComponentCopyright © 2018 Singular Systems http://www.singularsys.com/jep