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

java.lang.Object
  extended by edu.jas.vector.GenVector<C>
All Implemented Interfaces:
AbelianGroupElem<GenVector<C>>, Element<GenVector<C>>, ModulElem<GenVector<C>,C>, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<GenVector<C>>

public class GenVector<C extends RingElem<C>>
extends java.lang.Object
implements ModulElem<GenVector<C>,C>

GenVector implements generic vectors with RingElem entries. Vectors of n columns over C.

Author:
Heinz Kredel
See Also:
Serialized Form

Field Summary
 GenVectorModul<C> modul
           
 java.util.List<C> val
           
 
Constructor Summary
GenVector(GenVectorModul<C> m)
          Constructor for GenVector.
GenVector(GenVectorModul<C> m, java.util.List<C> v)
          Constructor for GenVector.
 
Method Summary
 GenVector<C> abs()
          Absolute value of this vector.
 GenVector<C> clone()
          clone method.
 int compareTo(GenVector<C> b)
          compareTo, lexicogaphical comparison.
 boolean equals(java.lang.Object other)
          equals method.
 GenVectorModul<C> factory()
          Get the corresponding element factory.
 int hashCode()
          Hash code for this GenVector.
 boolean isZERO()
          test if this is equal to a zero vector.
 GenVector<C> leftLinearCombination(C s, C t, GenVector<C> b)
          left linear compination of this vector with scalar multiple of other vector.
 GenVector<C> leftScalarMultiply(C s)
          Left product of this vector with scalar.
 GenVector<C> linearCombination(C t, GenVector<C> b)
          Left linear compination of this vector with scalar multiple of other vector.
 GenVector<C> linearCombination(C s, GenVector<C> b, C t)
          Linear compination of this vector with scalar multiple of other vector.
 GenVector<C> linearCombination(GenVector<C> b, C t)
          Linear compination of this vector with scalar multiple of other vector.
 GenVector<C> negate()
          Negative of this vector.
 GenVector<C> rightScalarProduct(java.util.List<GenVector<C>> B)
          right scalar / dot product of this vector with list of other vectors.
 GenVector<C> scalarMultiply(C s)
          Product of this vector with scalar.
 C scalarProduct(GenVector<C> b)
          scalar / dot product of this vector with other vector.
 GenVector<C> scalarProduct(java.util.List<GenVector<C>> B)
          scalar / dot product of this vector with list of other vectors.
 int signum()
          sign of vector.
 GenVector<C> subtract(GenVector<C> b)
          Difference of vectors.
 GenVector<C> sum(GenVector<C> b)
          Sum of vectors.
 java.lang.String toScript()
          Get a scripting compatible string representation.
 java.lang.String toScriptFactory()
          Get a scripting compatible string representation of the factory.
 java.lang.String toString()
          Get the String representation as RingElem.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

modul

public final GenVectorModul<C extends RingElem<C>> modul

val

public final java.util.List<C extends RingElem<C>> val
Constructor Detail

GenVector

public GenVector(GenVectorModul<C> m)
Constructor for GenVector.


GenVector

public GenVector(GenVectorModul<C> m,
                 java.util.List<C> v)
Constructor for GenVector.

Method Detail

toString

public java.lang.String toString()
Get the String representation as RingElem.

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

toScript

public java.lang.String toScript()
Get a scripting compatible string representation.

Specified by:
toScript in interface Element<GenVector<C extends RingElem<C>>>
Returns:
script compatible representation for this Element.
See Also:
Element.toScript()

toScriptFactory

public java.lang.String toScriptFactory()
Get a scripting compatible string representation of the factory.

Specified by:
toScriptFactory in interface Element<GenVector<C extends RingElem<C>>>
Returns:
script compatible representation for this ElemFactory.
See Also:
Element.toScriptFactory()

factory

public GenVectorModul<C> factory()
Get the corresponding element factory.

Specified by:
factory in interface Element<GenVector<C extends RingElem<C>>>
Returns:
factory for this Element.
See Also:
Element.factory()

clone

public GenVector<C> clone()
clone method.

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

isZERO

public boolean isZERO()
test if this is equal to a zero vector.

Specified by:
isZERO in interface AbelianGroupElem<GenVector<C extends RingElem<C>>>
Returns:
true if this is 0, else false.

equals

public boolean equals(java.lang.Object other)
equals method.

Specified by:
equals in interface Element<GenVector<C extends RingElem<C>>>
Overrides:
equals in class java.lang.Object
Returns:
true if this is equal to b, else false.

hashCode

public int hashCode()
Hash code for this GenVector.

Specified by:
hashCode in interface Element<GenVector<C extends RingElem<C>>>
Overrides:
hashCode in class java.lang.Object
Returns:
the hashCode.
See Also:
Object.hashCode()

compareTo

public int compareTo(GenVector<C> b)
compareTo, lexicogaphical comparison.

Specified by:
compareTo in interface Element<GenVector<C extends RingElem<C>>>
Specified by:
compareTo in interface java.lang.Comparable<GenVector<C extends RingElem<C>>>
Parameters:
b - other
Returns:
1 if (this < b), 0 if (this == b) or -1 if (this > b).

signum

public int signum()
sign of vector.

Specified by:
signum in interface AbelianGroupElem<GenVector<C extends RingElem<C>>>
Returns:
1 if (this < 0), 0 if (this == 0) or -1 if (this > 0).

sum

public GenVector<C> sum(GenVector<C> b)
Sum of vectors.

Specified by:
sum in interface AbelianGroupElem<GenVector<C extends RingElem<C>>>
Returns:
this+b

subtract

public GenVector<C> subtract(GenVector<C> b)
Difference of vectors.

Specified by:
subtract in interface AbelianGroupElem<GenVector<C extends RingElem<C>>>
Returns:
this-b

negate

public GenVector<C> negate()
Negative of this vector.

Specified by:
negate in interface AbelianGroupElem<GenVector<C extends RingElem<C>>>
Returns:
-this

abs

public GenVector<C> abs()
Absolute value of this vector.

Specified by:
abs in interface AbelianGroupElem<GenVector<C extends RingElem<C>>>
Returns:
abs(this)

scalarMultiply

public GenVector<C> scalarMultiply(C s)
Product of this vector with scalar.

Specified by:
scalarMultiply in interface ModulElem<GenVector<C extends RingElem<C>>,C extends RingElem<C>>
Parameters:
s - scalar
Returns:
this*s

leftScalarMultiply

public GenVector<C> leftScalarMultiply(C s)
Left product of this vector with scalar.

Returns:
s*this

linearCombination

public GenVector<C> linearCombination(C s,
                                      GenVector<C> b,
                                      C t)
Linear compination of this vector with scalar multiple of other vector.

Specified by:
linearCombination in interface ModulElem<GenVector<C extends RingElem<C>>,C extends RingElem<C>>
Parameters:
s - scalar
b - module element
t - scalar
Returns:
this*s+b*t

linearCombination

public GenVector<C> linearCombination(GenVector<C> b,
                                      C t)
Linear compination of this vector with scalar multiple of other vector.

Specified by:
linearCombination in interface ModulElem<GenVector<C extends RingElem<C>>,C extends RingElem<C>>
Parameters:
b - module element
t - scalar
Returns:
this+b*t

linearCombination

public GenVector<C> linearCombination(C t,
                                      GenVector<C> b)
Left linear compination of this vector with scalar multiple of other vector.

Returns:
this+t*b

leftLinearCombination

public GenVector<C> leftLinearCombination(C s,
                                          C t,
                                          GenVector<C> b)
left linear compination of this vector with scalar multiple of other vector.

Returns:
s*this+t*b

scalarProduct

public C scalarProduct(GenVector<C> b)
scalar / dot product of this vector with other vector.

Specified by:
scalarProduct in interface ModulElem<GenVector<C extends RingElem<C>>,C extends RingElem<C>>
Parameters:
b - module element
Returns:
this . b

scalarProduct

public GenVector<C> scalarProduct(java.util.List<GenVector<C>> B)
scalar / dot product of this vector with list of other vectors.

Specified by:
scalarProduct in interface ModulElem<GenVector<C extends RingElem<C>>,C extends RingElem<C>>
Parameters:
B - list of module elements
Returns:
this * b

rightScalarProduct

public GenVector<C> rightScalarProduct(java.util.List<GenVector<C>> B)
right scalar / dot product of this vector with list of other vectors.

Returns:
b * this