Interface Vector

  • All Known Implementing Classes:
    VectorImpl

    public interface Vector
    Represents a mathematical vector.
    • Method Summary

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

      • add

        Vector add​(Vector v2)
        Add a vector to this vector.
        Parameters:
        v2 - The vector to add. Must be of same size.
        Returns:
        The result of the operation.
      • times

        Vector times​(double val)
        Multiplication to a scalar.
        Parameters:
        val - The scalar to multiply with.
        Returns:
        The result of the operation.
      • maxIdx

        int maxIdx()
        Index at which the vector holds its maximum value.
        Returns:
        The index.
      • max

        double max()
        The maximum value of the vector.
        Returns:
        The maximum value of the vector.
      • get

        double get​(int idx)
        Get the value of the vector at a specified position.
        Parameters:
        idx -
        Returns:
      • set

        void set​(int idx,
                 double value)
        Set the value at a specified position.
        Parameters:
        idx - The index where to set a new value.
        value - The value to set to.
      • getSize

        int getSize()
        Get the size of the vector.
        Returns:
        Size of the vector.