Package edu.jas.vector
Class GenVectorModul<C extends RingElem<C>>
- java.lang.Object
-
- edu.jas.vector.GenVectorModul<C>
-
- All Implemented Interfaces:
AbelianGroupFactory<GenVector<C>>,ElemFactory<GenVector<C>>,ModulFactory<GenVector<C>,C>,java.io.Serializable
public class GenVectorModul<C extends RingElem<C>> extends java.lang.Object implements ModulFactory<GenVector<C>,C>
GenVectorModul implements a generic vector factory with RingElem entries. Vectors of n columns over C.- Author:
- Heinz Kredel
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description GenVectorModul(RingFactory<C> b, int s)Constructor for GenVectorModul.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GenVector<C>copy(GenVector<C> c)copy vector.booleanequals(java.lang.Object other)Comparison with any other object.GenVector<C>fromInteger(long a)Get the vector for a.GenVector<C>fromInteger(java.math.BigInteger a)Get the vector for a.GenVector<C>fromList(java.util.List<C> v)From List of coefficients.java.util.List<GenVector<C>>generators()Get a list of the generating elements.GenVector<C>getZERO()getZERO.inthashCode()Hash code for this vector module.booleanisFinite()Is this structure finite or infinite.GenVector<C>parse(java.io.Reader r)Parse a vector from a Reader.GenVector<C>parse(java.lang.String s)Parse a vector from a String.GenVector<C>random(int k)Random vector.GenVector<C>random(int k, float q)Random vector.GenVector<C>random(int k, float q, java.util.Random random)Random vector.GenVector<C>random(int k, java.util.Random random)Random vector.java.lang.StringtoScript()Get a scripting compatible string representation.java.lang.StringtoString()Get the String representation as RingElem.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface edu.jas.structure.ElemFactory
valueOf
-
-
-
-
Field Detail
-
coFac
public final RingFactory<C extends RingElem<C>> coFac
-
cols
public final int cols
-
DEFAULT_DENSITY
public static final float DEFAULT_DENSITY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GenVectorModul
public GenVectorModul(RingFactory<C> b, int s)
Constructor for GenVectorModul.
-
-
Method Detail
-
toString
public java.lang.String toString()
Get the String representation as RingElem.- Overrides:
toStringin classjava.lang.Object- See Also:
Object.toString()
-
toScript
public java.lang.String toScript()
Get a scripting compatible string representation.- Specified by:
toScriptin interfaceElemFactory<C extends RingElem<C>>- Returns:
- script compatible representation for this ElemFactory.
- See Also:
ElemFactory.toScript()
-
getZERO
public GenVector<C> getZERO()
getZERO.- Specified by:
getZEROin interfaceAbelianGroupFactory<C extends RingElem<C>>- Returns:
- ZERO.
-
generators
public java.util.List<GenVector<C>> generators()
Get a list of the generating elements.- Specified by:
generatorsin interfaceElemFactory<C extends RingElem<C>>- Returns:
- list of generators for the algebraic structure.
- See Also:
ElemFactory.generators()
-
isFinite
public boolean isFinite()
Is this structure finite or infinite.- Specified by:
isFinitein interfaceElemFactory<C extends RingElem<C>>- Returns:
- true if this structure is finite, else false.
- See Also:
ElemFactory.isFinite()
-
equals
public boolean equals(java.lang.Object other)
Comparison with any other object.- Overrides:
equalsin classjava.lang.Object- See Also:
Object.equals(java.lang.Object)
-
hashCode
public int hashCode()
Hash code for this vector module.- Overrides:
hashCodein classjava.lang.Object- See Also:
Object.hashCode()
-
fromInteger
public GenVector<C> fromInteger(long a)
Get the vector for a.- Specified by:
fromIntegerin interfaceElemFactory<C extends RingElem<C>>- Parameters:
a- long- Returns:
- vector corresponding to a.
-
fromInteger
public GenVector<C> fromInteger(java.math.BigInteger a)
Get the vector for a.- Specified by:
fromIntegerin interfaceElemFactory<C extends RingElem<C>>- Parameters:
a- long- Returns:
- vector corresponding to a.
-
random
public GenVector<C> random(int k)
Random vector.- Specified by:
randomin interfaceElemFactory<C extends RingElem<C>>- Parameters:
k- size of random coefficients.- Returns:
- random vector.
-
random
public GenVector<C> random(int k, java.util.Random random)
Random vector.- Specified by:
randomin interfaceElemFactory<C extends RingElem<C>>- Parameters:
k- size of random coefficients.random- is a source for random bits.- Returns:
- a random element.
-
random
public GenVector<C> random(int k, float q, java.util.Random random)
Random vector.- Parameters:
k- size of random coefficients.q- density of nonzero coefficients.random- is a source for random bits.- Returns:
- a random element.
-
copy
public GenVector<C> copy(GenVector<C> c)
copy vector.- Specified by:
copyin interfaceElemFactory<C extends RingElem<C>>- Parameters:
c- vector.- Returns:
- copy of vector c.
-
parse
public GenVector<C> parse(java.lang.String s)
Parse a vector from a String. Syntax: [ c, ..., c ]- Specified by:
parsein interfaceElemFactory<C extends RingElem<C>>- Parameters:
s- String with vector.- Returns:
- parsed vector.
-
-