JScience v3.3

org.jscience.mathematics.vectors
Class DenseVector<F extends Field<F>>

java.lang.Object
  extended by javolution.context.RealtimeObject
      extended by org.jscience.mathematics.vectors.Vector<F>
          extended by org.jscience.mathematics.vectors.DenseVector<F>
All Implemented Interfaces:
java.io.Serializable, Realtime, Immutable, GroupAdditive<Vector<F>>, Structure<Vector<F>>, VectorSpace<Vector<F>,F>

public final class DenseVector<F extends Field<F>>
extends Vector<F>

This class represents a dense vector.

Version:
3.3, January 2, 2007
Author:
Jean-Marie Dautelle
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javolution.context.RealtimeObject
RealtimeObject.Factory<T extends RealtimeObject>
 
Nested classes/interfaces inherited from interface javolution.context.Realtime
Realtime.ObjectSpace
 
Field Summary
protected static XMLFormat<DenseVector> XML
          Holds the default XML representation for dense vectors.
 
Method Summary
 F get(int i)
          Returns a single element from this vector.
 int getDimension()
          Returns the number of elements held by this vector.
 DenseVector<F> minus(Vector<F> that)
          Returns the difference between this vector and the one specified.
 boolean move(Realtime.ObjectSpace os)
           
 DenseVector<F> opposite()
          Returns the negation of this vector.
 DenseVector<F> plus(Vector<F> that)
          Returns the sum of this vector with the one specified.
 DenseVector<F> times(F k)
          Returns the product of this vector with the specified coefficient.
 F times(Vector<F> that)
          Returns the dot product of this vector with the one specified.
static
<F extends Field<F>>
DenseVector<F>
valueOf(F... elements)
          Returns a dense vector holding the specified elements.
static
<F extends Field<F>>
DenseVector<F>
valueOf(java.util.List<F> elements)
          Returns a dense vector holding the elements from the specified collection.
static
<F extends Field<F>>
DenseVector<F>
valueOf(Vector<F> that)
          Returns a dense vector equivalent to the specified vector.
 
Methods inherited from class org.jscience.mathematics.vectors.Vector
cross, equals, equals, hashCode, toText, valueOf
 
Methods inherited from class javolution.context.RealtimeObject
export, isLocal, moveHeap, preserve, toString, unpreserve
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

XML

protected static final XMLFormat<DenseVector> XML
Holds the default XML representation for dense vectors. For example:
    <DenseVector dimension="2">
        <Rational value="1/3" />
        <Rational value="3/5" />
    </DenseVector>

Method Detail

valueOf

public static <F extends Field<F>> DenseVector<F> valueOf(F... elements)
Returns a dense vector holding the specified elements.

Parameters:
elements - the vector elements.
Returns:
the vector having the specified elements.

valueOf

public static <F extends Field<F>> DenseVector<F> valueOf(java.util.List<F> elements)
Returns a dense vector holding the elements from the specified collection.

Parameters:
elements - the collection of vector elements.
Returns:
the vector having the specified elements.

valueOf

public static <F extends Field<F>> DenseVector<F> valueOf(Vector<F> that)
Returns a dense vector equivalent to the specified vector.

Parameters:
that - the vector to convert.
Returns:
that or a dense vector holding the same elements as the specified vector.

getDimension

public int getDimension()
Description copied from class: Vector
Returns the number of elements held by this vector.

Specified by:
getDimension in class Vector<F extends Field<F>>
Returns:
this vector dimension.

get

public F get(int i)
Description copied from class: Vector
Returns a single element from this vector.

Specified by:
get in class Vector<F extends Field<F>>
Parameters:
i - the element index (range [0..n[).
Returns:
the element at i.

opposite

public DenseVector<F> opposite()
Description copied from class: Vector
Returns the negation of this vector.

Specified by:
opposite in interface GroupAdditive<Vector<F extends Field<F>>>
Specified by:
opposite in class Vector<F extends Field<F>>
Returns:
-this.

plus

public DenseVector<F> plus(Vector<F> that)
Description copied from class: Vector
Returns the sum of this vector with the one specified.

Specified by:
plus in interface GroupAdditive<Vector<F extends Field<F>>>
Specified by:
plus in class Vector<F extends Field<F>>
Parameters:
that - the vector to be added.
Returns:
this + that.

minus

public DenseVector<F> minus(Vector<F> that)
Description copied from class: Vector
Returns the difference between this vector and the one specified.

Overrides:
minus in class Vector<F extends Field<F>>
Parameters:
that - the vector to be subtracted.
Returns:
this - that.

times

public DenseVector<F> times(F k)
Description copied from class: Vector
Returns the product of this vector with the specified coefficient.

Specified by:
times in interface VectorSpace<Vector<F extends Field<F>>,F extends Field<F>>
Specified by:
times in class Vector<F extends Field<F>>
Parameters:
k - the coefficient multiplier.
Returns:
this · k

times

public F times(Vector<F> that)
Description copied from class: Vector
Returns the dot product of this vector with the one specified.

Specified by:
times in class Vector<F extends Field<F>>
Parameters:
that - the vector multiplier.
Returns:
this · that
See Also:
Wikipedia: Dot Product

move

public boolean move(Realtime.ObjectSpace os)
Specified by:
move in interface Realtime
Overrides:
move in class RealtimeObject

JScience v3.3

Copyright © 2006 JScience.