public abstract class Vector<F extends Field<F>> extends Object implements VectorSpace<Vector<F>,F>, javolution.lang.ValueType, javolution.lang.Realtime
This class represents an immutable element of a vector space.
| Modifier and Type | Method and Description |
|---|---|
abstract Vector<F> |
copy()
Returns a copy of this vector
allocated
by the calling thread (possibly on the stack). |
Vector<F> |
cross(Vector<F> that)
Returns the cross product of two 3-dimensional vectors.
|
boolean |
equals(Object that)
Indicates if this vector is equal to the object specified.
|
boolean |
equals(Vector<F> that,
Comparator<F> cmp)
Indicates if this vector can be considered equals to the one
specified using the specified comparator when testing for
element equality.
|
abstract F |
get(int i)
Returns a single element from this vector.
|
abstract int |
getDimension()
Returns the number of elements held by this vector.
|
int |
hashCode()
Returns a hash code value for this vector.
|
Vector<F> |
minus(Vector<F> that)
Returns the difference between this vector and the one specified.
|
abstract Vector<F> |
opposite()
Returns the negation of this vector.
|
abstract Vector<F> |
plus(Vector<F> that)
Returns the sum of this vector with the one specified.
|
abstract Vector<F> |
times(F k)
Returns the product of this vector with the specified coefficient.
|
abstract F |
times(Vector<F> that)
Returns the dot product of this vector with the one specified.
|
String |
toString()
Returns the text representation of this vector as a
java.lang.String. |
javolution.text.Text |
toText()
Returns the text representation of this vector.
|
public abstract int getDimension()
public abstract F get(int i)
i - the element index (range [0..n[).i.IndexOutOfBoundsException - (i < 0) || (i >= size())public abstract Vector<F> plus(Vector<F> that)
plus in interface GroupAdditive<Vector<F extends Field<F>>>that - the vector to be added.this + that.DimensionException - is vectors dimensions are different.public Vector<F> minus(Vector<F> that)
that - the vector to be subtracted.this - that.public abstract Vector<F> times(F k)
public abstract F times(Vector<F> that)
that - the vector multiplier.this · thatDimensionException - if this.dimension() != that.dimension()public Vector<F> cross(Vector<F> that)
that - the vector multiplier.this x thatDimensionException - if
(this.getDimension() != 3) && (that.getDimension() != 3)public javolution.text.Text toText()
toText in interface javolution.lang.Realtimepublic final String toString()
java.lang.String.public boolean equals(Vector<F> that, Comparator<F> cmp)
that - the vector to compare for equality.cmp - the comparator to use when testing for element equality.true if this vector and the specified matrix are
both vector with equal elements according to the specified
comparator; false otherwise.public boolean equals(Object that)
public int hashCode()
hashCode in class Objectequals(org.jscience.mathematics.vector.Vector<F>, java.util.Comparator<F>)