Package edu.jas.vector
Class BasicLinAlg<C extends RingElem<C>>
- java.lang.Object
-
- edu.jas.vector.BasicLinAlg<C>
-
- Type Parameters:
C
- coefficient type
- All Implemented Interfaces:
java.io.Serializable
public class BasicLinAlg<C extends RingElem<C>> extends java.lang.Object implements java.io.Serializable
Basic linear algebra methods. Implements Basic linear algebra computations and tests. Note: will eventually use wrong method dispatch in JRE when used with GenSolvablePolynomial.- Author:
- Heinz Kredel
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BasicLinAlg()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<C>
genVector(int n, C a)
Generation of a vector of ring elements.java.util.List<C>
genVector(int n, C a, java.util.List<C> A)
Generation of a vector of ring elements.boolean
isZero(java.util.List<C> a)
Test vector of zero ring elements.GenVector<C>
leftProduct(GenVector<C> G, GenMatrix<C> F)
Product of a vector and a matrix of ring elements.java.util.List<C>
leftScalarProduct(java.util.List<C> G, java.util.List<java.util.List<C>> F)
Scalar product of vectors and a matrix of ring elements.GenVector<C>
rightProduct(GenVector<C> G, GenMatrix<C> F)
Product of a vector and a matrix of ring elements.java.util.List<C>
rightScalarProduct(java.util.List<C> G, java.util.List<java.util.List<C>> F)
Scalar product of vectors and a matrix of ring elements.java.util.List<C>
scalarProduct(C p, java.util.List<C> F)
Scalar product of ring element with vector of ring elements.java.util.List<C>
scalarProduct(java.util.List<C> F, C p)
Scalar product of vector of ring element with ring element.C
scalarProduct(java.util.List<C> G, java.util.List<C> F)
Scalar product of vectors of ring elements.java.util.List<C>
vectorAdd(java.util.List<C> a, java.util.List<C> b)
Addition of vectors of ring elements.java.util.List<C>
vectorCombineOld(java.util.List<C> a, java.util.List<C> b)
Combination of vectors for old representation.java.util.List<C>
vectorCombineRep(java.util.List<C> a, java.util.List<C> b)
Combination of vectors for reduction representation.java.util.List<C>
vectorCombineSyz(java.util.List<C> a, java.util.List<C> b)
Combination of vectors for syzygy representation.java.util.List<C>
vectorNegate(java.util.List<C> a)
Negative of vectors of ring elements.
-
-
-
Constructor Detail
-
BasicLinAlg
public BasicLinAlg()
Constructor.
-
-
Method Detail
-
scalarProduct
public C scalarProduct(java.util.List<C> G, java.util.List<C> F)
Scalar product of vectors of ring elements.- Parameters:
G
- a ring element list.F
- a ring element list.- Returns:
- the scalar product of G and F.
-
leftScalarProduct
public java.util.List<C> leftScalarProduct(java.util.List<C> G, java.util.List<java.util.List<C>> F)
Scalar product of vectors and a matrix of ring elements.- Parameters:
G
- a ring element list.F
- a list of ring element lists.- Returns:
- the scalar product of G and F.
-
rightScalarProduct
public java.util.List<C> rightScalarProduct(java.util.List<C> G, java.util.List<java.util.List<C>> F)
Scalar product of vectors and a matrix of ring elements.- Parameters:
G
- a ring element list.F
- a list of ring element lists.- Returns:
- the right scalar product of G and F.
-
vectorAdd
public java.util.List<C> vectorAdd(java.util.List<C> a, java.util.List<C> b)
Addition of vectors of ring elements.- Parameters:
a
- a ring element list.b
- a ring element list.- Returns:
- a+b, the vector sum of a and b.
-
vectorNegate
public java.util.List<C> vectorNegate(java.util.List<C> a)
Negative of vectors of ring elements.- Parameters:
a
- a ring element list.- Returns:
- -a, the vector of -a.
-
vectorCombineRep
public java.util.List<C> vectorCombineRep(java.util.List<C> a, java.util.List<C> b)
Combination of vectors for reduction representation.- Parameters:
a
- a ring element list.b
- a ring element list.- Returns:
- a-b, the vector difference of a and b, with one entry more.
-
vectorCombineSyz
public java.util.List<C> vectorCombineSyz(java.util.List<C> a, java.util.List<C> b)
Combination of vectors for syzygy representation.- Parameters:
a
- a ring element list.b
- a ring element list.- Returns:
- (-a)+b, the vector sum of -a and b, with one entry more.
-
vectorCombineOld
public java.util.List<C> vectorCombineOld(java.util.List<C> a, java.util.List<C> b)
Combination of vectors for old representation.- Parameters:
a
- a ring element list.b
- a ring element list.- Returns:
- -a-b, the vector difference of -a and b, with one entry more.
-
genVector
public java.util.List<C> genVector(int n, C a)
Generation of a vector of ring elements.- Parameters:
n
- length of vector.a
- a ring element to fill vector entries.- Returns:
- V, a vector of length n and entries a.
-
genVector
public java.util.List<C> genVector(int n, C a, java.util.List<C> A)
Generation of a vector of ring elements.- Parameters:
n
- length of vector.a
- a ring element to fill vector entries.A
- vector of starting first entries.- Returns:
- V, a vector of length n and entries a, respectively A.
-
isZero
public boolean isZero(java.util.List<C> a)
Test vector of zero ring elements.- Parameters:
a
- a ring element list.- Returns:
- true, if all polynomial in a are zero, else false.
-
scalarProduct
public java.util.List<C> scalarProduct(C p, java.util.List<C> F)
Scalar product of ring element with vector of ring elements.- Parameters:
p
- a ring element.F
- a ring element list.- Returns:
- the scalar product of p and F.
-
scalarProduct
public java.util.List<C> scalarProduct(java.util.List<C> F, C p)
Scalar product of vector of ring element with ring element.- Parameters:
F
- a ring element list.p
- a ring element.- Returns:
- the scalar product of F and p.
-
leftProduct
public GenVector<C> leftProduct(GenVector<C> G, GenMatrix<C> F)
Product of a vector and a matrix of ring elements.- Parameters:
G
- a vectors of ring elements.F
- a matrix of ring element lists.- Returns:
- the left product of G and F.
-
-