Class DenseVector<F extends Field<F>>

java.lang.Object
org.jscience.mathematics.vector.Vector<F>
org.jscience.mathematics.vector.DenseVector<F>
All Implemented Interfaces:
javolution.lang.Immutable, javolution.lang.Realtime, javolution.lang.ValueType, 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.

  • Field Details

    • XML

      protected static final javolution.xml.XMLFormat<DenseVector> XML
      Holds the default XML representation for dense vectors. For example: [code] [/code]
  • Method Details

    • 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(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<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<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:
    • copy

      public DenseVector<F> copy()
      Description copied from class: Vector
      Returns a copy of this vector allocated by the calling thread (possibly on the stack).
      Specified by:
      copy in interface javolution.lang.ValueType
      Specified by:
      copy in class Vector<F extends Field<F>>
      Returns:
      an identical and independant copy of this matrix.