java.lang.Object
de.uni_trier.wi2.procake.similarity.nest.sequence.utils.impl.VectorImpl
All Implemented Interfaces:
Vector

public class VectorImpl extends Object implements Vector
  • Constructor Summary

    Constructors
    Constructor
    Description
    VectorImpl(double... values)
     
    VectorImpl(int size)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    add(Vector v2)
    Add a vector to this vector.
    double
    get(int idx)
    Get the value of the vector at a specified position.
    int
    Get the size of the vector.
    double
    max()
    The maximum value of the vector.
    int
    Index at which the vector holds its maximum value.
    void
    set(int idx, double value)
    Set the value at a specified position.
    times(double val)
    Multiplication to a scalar.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • VectorImpl

      public VectorImpl(int size)
    • VectorImpl

      public VectorImpl(double... values)
  • Method Details

    • add

      public Vector add(Vector v2)
      Description copied from interface: Vector
      Add a vector to this vector.
      Specified by:
      add in interface Vector
      Parameters:
      v2 - The vector to add. Must be of same size.
      Returns:
      The result of the operation.
    • times

      public Vector times(double val)
      Description copied from interface: Vector
      Multiplication to a scalar.
      Specified by:
      times in interface Vector
      Parameters:
      val - The scalar to multiply with.
      Returns:
      The result of the operation.
    • maxIdx

      public int maxIdx()
      Description copied from interface: Vector
      Index at which the vector holds its maximum value.
      Specified by:
      maxIdx in interface Vector
      Returns:
      The index.
    • max

      public double max()
      Description copied from interface: Vector
      The maximum value of the vector.
      Specified by:
      max in interface Vector
      Returns:
      The maximum value of the vector.
    • get

      public double get(int idx)
      Description copied from interface: Vector
      Get the value of the vector at a specified position.
      Specified by:
      get in interface Vector
      Returns:
    • set

      public void set(int idx, double value)
      Description copied from interface: Vector
      Set the value at a specified position.
      Specified by:
      set in interface Vector
      Parameters:
      idx - The index where to set a new value.
      value - The value to set to.
    • getSize

      public int getSize()
      Description copied from interface: Vector
      Get the size of the vector.
      Specified by:
      getSize in interface Vector
      Returns:
      Size of the vector.