edu.jas.vector
Class GenVectorModul<C extends RingElem<C>>

java.lang.Object
  extended by 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

Field Summary
 java.util.List<GenVector<C>> BASIS
           
 RingFactory<C> coFac
           
 int cols
           
static float DEFAULT_DENSITY
           
 GenVector<C> ZERO
           
 
Constructor Summary
GenVectorModul(RingFactory<C> b, int s)
          Constructors for GenVectorModul.
 
Method Summary
 GenVector<C> copy(GenVector<C> c)
          copy vector.
 boolean equals(java.lang.Object other)
           
 GenVector<C> fromInteger(java.math.BigInteger a)
          Get the vector for a.
 GenVector<C> fromInteger(long a)
          Get the vector for a.
 GenVector<C> fromList(java.util.List<C> v)
          From List of coefficients.
 GenVector<C> getZERO()
          getZERO.
 int hashCode()
          Hash code for this vector module.
 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.String toString()
          toString method.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

coFac

public final RingFactory<C extends RingElem<C>> coFac

cols

public final int cols

ZERO

public final GenVector<C extends RingElem<C>> ZERO

BASIS

public final java.util.List<GenVector<C extends RingElem<C>>> BASIS

DEFAULT_DENSITY

public static final float DEFAULT_DENSITY
See Also:
Constant Field Values
Constructor Detail

GenVectorModul

public GenVectorModul(RingFactory<C> b,
                      int s)
Constructors for GenVectorModul.

Method Detail

toString

public java.lang.String toString()
toString method.

Overrides:
toString in class java.lang.Object

getZERO

public GenVector<C> getZERO()
getZERO.

Specified by:
getZERO in interface AbelianGroupFactory<GenVector<C extends RingElem<C>>>
Returns:
ZERO.

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Hash code for this vector module.

Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

fromInteger

public GenVector<C> fromInteger(long a)
Get the vector for a.

Specified by:
fromInteger in interface ElemFactory<GenVector<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:
fromInteger in interface ElemFactory<GenVector<C extends RingElem<C>>>
Parameters:
a - long
Returns:
vector corresponding to a.

fromList

public GenVector<C> fromList(java.util.List<C> v)
From List of coefficients.

Specified by:
fromList in interface ModulFactory<GenVector<C extends RingElem<C>>,C extends RingElem<C>>
Parameters:
v - list of coefficients.
Returns:
a module element with the elements from v.

random

public GenVector<C> random(int k)
Random vector.

Specified by:
random in interface ElemFactory<GenVector<C extends RingElem<C>>>
Parameters:
k - size of random coefficients.
Returns:
a random element.

random

public GenVector<C> random(int k,
                           float q)
Random vector.

Specified by:
random in interface ModulFactory<GenVector<C extends RingElem<C>>,C extends RingElem<C>>
Parameters:
k - size of random coefficients.
q - density of nozero coefficients.
Returns:
a random vector.

random

public GenVector<C> random(int k,
                           java.util.Random random)
Random vector.

Specified by:
random in interface ElemFactory<GenVector<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 nozero coefficients.
random - is a source for random bits.
Returns:
a random element.

copy

public GenVector<C> copy(GenVector<C> c)
copy vector.

Specified by:
copy in interface ElemFactory<GenVector<C extends RingElem<C>>>
Returns:
a copy of c.

parse

public GenVector<C> parse(java.lang.String s)
parse a vector from a String. Syntax: [ c, ..., c ]

Specified by:
parse in interface ElemFactory<GenVector<C extends RingElem<C>>>
Parameters:
s - String.
Returns:
a Element corresponding to s.

parse

public GenVector<C> parse(java.io.Reader r)
parse a vector from a Reader.

Specified by:
parse in interface ElemFactory<GenVector<C extends RingElem<C>>>
Parameters:
r - Reader.
Returns:
the next Element found on r.