\n\n\n\nVector\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\n\n\n\n
\n
\n
\n\n\n\n
\n
org.jscience.mathematics.vector
\n

## Class Vector<F extends Field<F>>

\n
\n
\n
\n
\n
\n
\n
\n
\n
• \n\n
\n
• \n\n\n

### Method Summary

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Methods
Modifier and TypeMethod and Description
`abstract Vector<F>``copy()`\n
Returns a copy of this vector \n `allocated` \n by the calling thread (possibly on the stack).
\n
`Vector<F>``cross(Vector<F> that)`\n
Returns the cross product of two 3-dimensional vectors.
\n
`boolean``equals(Object that)`\n
Indicates if this vector is equal to the object specified.
\n
`boolean``equals(Vector<F> that,\n Comparator<F> cmp)`\n
Indicates if this vector can be considered equals to the one \n specified using the specified comparator when testing for \n element equality.
\n
`abstract F``get(int i)`\n
Returns a single element from this vector.
\n
`abstract int``getDimension()`\n
Returns the number of elements held by this vector.
\n
`int``hashCode()`\n
Returns a hash code value for this vector.
\n
`Vector<F>``minus(Vector<F> that)`\n
Returns the difference between this vector and the one specified.
\n
`abstract Vector<F>``opposite()`\n
Returns the negation of this vector.
\n
`abstract Vector<F>``plus(Vector<F> that)`\n
Returns the sum of this vector with the one specified.
\n
`abstract Vector<F>``times(F k)`\n
Returns the product of this vector with the specified coefficient.
\n
`abstract F``times(Vector<F> that)`\n
Returns the dot product of this vector with the one specified.
\n
`String``toString()`\n
Returns the text representation of this vector as a \n `java.lang.String`.
\n
`javolution.text.Text``toText()`\n
Returns the text representation of this vector.
\n
\n
\n
• \n\n\n

### Methods inherited from class java.lang.Object

\n`getClass, notify, notifyAll, wait, wait, wait`
• \n
\n
• \n
\n
• \n
\n
\n
\n
\n
• \n\n
\n
• \n\n\n

### Method Detail

\n\n\n\n
\n
• \n

#### getDimension

\n
`public abstract int getDimension()`
\n
Returns the number of elements held by this vector.
\n
Returns:
this vector dimension.
\n
• \n
\n\n\n\n
\n
• \n

#### get

\n
`public abstract F get(int i)`
\n
Returns a single element from this vector.
\n
Parameters:
`i` - the element index (range [0..n[).
\n
Returns:
the element at `i`.
\n
Throws:
\n
`IndexOutOfBoundsException` - `(i < 0) || (i >= size())`
\n
• \n
\n\n\n\n
\n
• \n

#### opposite

\n
`public abstract Vector<F> opposite()`
\n
Returns the negation of this vector.
\n
\n
Specified by:
\n
`opposite` in interface `GroupAdditive<Vector<F extends Field<F>>>`
\n
Returns:
`-this`.
\n
• \n
\n\n\n\n
\n
• \n

#### plus

\n
`public abstract Vector<F> plus(Vector<F> that)`
\n
Returns the sum of this vector with the one specified.
\n
\n
Specified by:
\n
`plus` in interface `GroupAdditive<Vector<F extends Field<F>>>`
\n
Parameters:
`that` - the vector to be added.
\n
Returns:
`this + that`.
\n
Throws:
\n
`DimensionException` - is vectors dimensions are different.
\n
• \n
\n\n\n\n
\n
• \n

#### minus

\n
`public Vector<F> minus(Vector<F> that)`
\n
Returns the difference between this vector and the one specified.
\n
Parameters:
`that` - the vector to be subtracted.
\n
Returns:
`this - that`.
\n
• \n
\n\n\n\n\n\n
\n
• \n

#### times

\n
`public abstract Vector<F> times(F k)`
\n
Returns the product of this vector with the specified coefficient.
\n
\n
Specified by:
\n
`times` in interface `VectorSpace<Vector<F extends Field<F>>,F extends Field<F>>`
\n
Parameters:
`k` - the coefficient multiplier.
\n
Returns:
`this \xc2\xb7 k`
\n
• \n
\n\n\n\n
\n
• \n

#### times

\n
`public abstract F times(Vector<F> that)`
\n
Returns the dot product of this vector with the one specified.
\n
Parameters:
`that` - the vector multiplier.
\n
Returns:
`this \xc2\xb7 that`
\n
Throws:
\n
`DimensionException` - if `this.dimension() != that.dimension()`
\n Wikipedia: Dot Product
\n
• \n
\n\n\n\n
\n
• \n

#### cross

\n
`public Vector<F> cross(Vector<F> that)`
\n
Returns the cross product of two 3-dimensional vectors.
\n
Parameters:
`that` - the vector multiplier.
\n
Returns:
`this x that`
\n
Throws:
\n
`DimensionException` - if \n `(this.getDimension() != 3) && (that.getDimension() != 3)`
\n
• \n
\n\n\n\n
\n
• \n

#### toText

\n
`public javolution.text.Text toText()`
\n
Returns the text representation of this vector.
\n
\n
Specified by:
\n
`toText` in interface `javolution.lang.Realtime`
\n
Returns:
the text representation of this vector.
\n
• \n
\n\n\n\n
\n
• \n

#### toString

\n
`public final String toString()`
\n
Returns the text representation of this vector as a \n `java.lang.String`.
\n
\n
Overrides:
\n
`toString` in class `Object`
\n
Returns:
`toText().toString()`
\n
• \n
\n\n\n\n
\n
• \n

#### equals

\n
`public boolean equals(Vector<F> that,\n             Comparator<F> cmp)`
\n
Indicates if this vector can be considered equals to the one \n specified using the specified comparator when testing for \n element equality. The specified comparator may allow for some \n tolerance in the difference between the vector elements.
\n
Parameters:
`that` - the vector to compare for equality.
`cmp` - the comparator to use when testing for element equality.
\n
Returns:
`true` if this vector and the specified matrix are\n both vector with equal elements according to the specified\n comparator; `false` otherwise.
\n
• \n
\n\n\n\n
\n
• \n

#### equals

\n
`public boolean equals(Object that)`
\n
Indicates if this vector is equal to the object specified.
\n
\n
Overrides:
\n
`equals` in class `Object`
\n
Parameters:
`that` - the object to compare for equality.
\n
Returns:
`true` if this vector and the specified object are\n both vectors with equal elements; `false` otherwise.
\n
• \n
\n\n\n\n\n\n\n\n
\n
• \n

#### copy

\n
`public abstract Vector<F> copy()`
\n
Returns a copy of this vector \n `allocated` \n by the calling thread (possibly on the stack).
\n
\n
Specified by:
\n
`copy` in interface `javolution.lang.ValueType`
\n
Returns:
an identical and independant copy of this matrix.
\n
• \n
\n
• \n
\n
• \n
\n
\n
\n\n\n
\n\n\n\n\n
\n
\n
\n\n\n