Package edu.jas.vector
Class GenVector<C extends RingElem<C>>
java.lang.Object
edu.jas.vector.GenVector<C>
- All Implemented Interfaces:
AbelianGroupElem<GenVector<C>>
,Element<GenVector<C>>
,ModulElem<GenVector<C>,
,C> Serializable
,Comparable<GenVector<C>>
GenVector implements generic vectors with RingElem entries. Vectors of n
columns over C.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGenVector
(GenVectorModul<C> m) Constructor for zero GenVector.GenVector
(GenVectorModul<C> m, C[] v) Constructor for GenVector.GenVector
(GenVectorModul<C> m, List<C> v) Constructor for GenVector. -
Method Summary
Modifier and TypeMethodDescriptionabs()
Absolute value of this vector.int
compareTo, lexicographical comparison.copy()
clone method.boolean
equals method.factory()
Get the corresponding element factory.get
(int i) get element.int
hashCode()
Hash code for this GenVector.boolean
isZERO()
test if this is equal to a zero vector.leftLinearCombination
(C s, C t, GenVector<C> b) left linear combination of this vector with scalar multiple of other vector.Left product of this vector with scalar.linearCombination
(C t, GenVector<C> b) Left linear combination of this vector with scalar multiple of other vector.linearCombination
(C s, GenVector<C> b, C t) Linear combination of this vector with scalar multiple of other vector.linearCombination
(GenVector<C> b, C t) Linear combination of this vector with scalar multiple of other vector.Product of this vector with scalar.negate()
Negative of this vector.rightScalarProduct
(List<GenVector<C>> B) right scalar / dot product of this vector with list of other vectors.scalarMultiply
(C s) Product of this vector with scalar.scalarProduct
(GenVector<C> b) scalar / dot product of this vector with other vector.scalarProduct
(List<GenVector<C>> B) scalar / dot product of this vector with list of other vectors.set element, mutate this.int
signum()
sign of vector.Difference of vectors.Sum of vectors.toScript()
Get a scripting compatible string representation.Get a scripting compatible string representation of the factory.toString()
Get the String representation as RingElem.
-
Field Details
-
logger
private static final org.apache.logging.log4j.Logger logger -
modul
-
val
-
-
Constructor Details
-
GenVector
Constructor for zero GenVector. -
GenVector
Constructor for GenVector. -
GenVector
Constructor for GenVector.
-
-
Method Details
-
toString
Get the String representation as RingElem. -
toScript
Get a scripting compatible string representation. -
toScriptFactory
Get a scripting compatible string representation of the factory.- Specified by:
toScriptFactory
in interfaceElement<C extends RingElem<C>>
- Returns:
- script compatible representation for this ElemFactory.
- See Also:
-
factory
Get the corresponding element factory. -
copy
clone method. -
isZERO
public boolean isZERO()test if this is equal to a zero vector.- Specified by:
isZERO
in interfaceAbelianGroupElem<C extends RingElem<C>>
- Returns:
- true if this is 0, else false.
-
equals
equals method. -
hashCode
public int hashCode()Hash code for this GenVector. -
compareTo
compareTo, lexicographical comparison. -
get
get element.- Parameters:
i
- index- Returns:
- e with e = this(i).
-
setMutate
set element, mutate this.- Parameters:
i
- indexe
- value- Returns:
- this with this(i) = e.
-
signum
public int signum()sign of vector.- Specified by:
signum
in interfaceAbelianGroupElem<C extends RingElem<C>>
- Returns:
- 1 if (this < 0), 0 if (this == 0) or -1 if (this > 0).
-
sum
Sum of vectors.- Specified by:
sum
in interfaceAbelianGroupElem<C extends RingElem<C>>
- Parameters:
b
- other vector.- Returns:
- this+b
-
subtract
Difference of vectors.- Specified by:
subtract
in interfaceAbelianGroupElem<C extends RingElem<C>>
- Parameters:
b
- other vector.- Returns:
- this-b
-
negate
Negative of this vector.- Specified by:
negate
in interfaceAbelianGroupElem<C extends RingElem<C>>
- Returns:
- -this
-
abs
Absolute value of this vector.- Specified by:
abs
in interfaceAbelianGroupElem<C extends RingElem<C>>
- Returns:
- abs(this)
-
multiply
Product of this vector with scalar.- Parameters:
s
- scalar.- Returns:
- this*s
-
scalarMultiply
Product of this vector with scalar. -
leftScalarMultiply
Left product of this vector with scalar.- Parameters:
s
- scalar.- Returns:
- s*this
-
linearCombination
Linear combination of this vector with scalar multiple of other vector. -
linearCombination
Linear combination of this vector with scalar multiple of other vector. -
linearCombination
Left linear combination of this vector with scalar multiple of other vector.- Parameters:
t
- scalar.b
- other vector.- Returns:
- this+t*b
-
leftLinearCombination
left linear combination of this vector with scalar multiple of other vector.- Parameters:
s
- scalar.t
- scalar.b
- other vector.- Returns:
- s*this+t*b
-
scalarProduct
scalar / dot product of this vector with other vector. -
scalarProduct
scalar / dot product of this vector with list of other vectors. -
rightScalarProduct
right scalar / dot product of this vector with list of other vectors.- Parameters:
B
- list of vectors.- Returns:
- b * this
-