Class CombinedVectorByRef

    • Constructor Detail

      • CombinedVectorByRef

        public CombinedVectorByRef​(Vector v1,
                                   Vector v2,
                                   Vector... others)
    • Method Detail

      • size

        public int size()
        Description copied from interface: Vector
        Get the length of this vector.
        Returns:
        the vector length
      • get

        public double get​(int i)
        Description copied from interface: Vector
        Get the value at position i.
        Parameters:
        i - the position of a vector entry
        Returns:
        v[i]
      • set

        @Deprecated
        public void set​(int i,
                        double value)
        Deprecated.
        Description copied from interface: Vector
        Change the value of an entry in this vector. This is the only method that may change the entries of a vector.
        Parameters:
        i - the index of the entry to change. The indices are counting from 1, NOT 0.
        value - the value to change to
      • toArray

        public double[] toArray()
        Description copied from interface: Vector
        Cast this vector into a 1D double[].
        Returns:
        a copy of all vector entries as a double[]
      • deepCopy

        public Vector deepCopy()
        Description copied from interface: DeepCopyable
        The implementation returns an instance created from this by the copy constructor of the class, or just this if the instance itself is immutable.
        Returns:
        an independent (deep) copy of the instance
      • add

        public Vector add​(Vector that)
        Description copied from interface: Vector
        \(this + that\)
        Specified by:
        add in interface AbelianGroup<Vector>
        Specified by:
        add in interface Vector
        Parameters:
        that - a vector
        Returns:
        \(this + that\)
      • multiply

        public Vector multiply​(Vector that)
        Description copied from interface: Vector
        Multiply this by that, entry-by-entry.
        Specified by:
        multiply in interface Vector
        Parameters:
        that - a vector
        Returns:
        \(this \cdot that\)
      • divide

        public Vector divide​(Vector that)
        Description copied from interface: Vector
        Divide this by that, entry-by-entry.
        Specified by:
        divide in interface Vector
        Parameters:
        that - a vector
        Returns:
        \(this / that\)
      • add

        public Vector add​(double c)
        Description copied from interface: Vector
        Add a constant to all entries in this vector.
        Specified by:
        add in interface Vector
        Parameters:
        c - a constant
        Returns:
        \(v + c\)
      • minus

        public Vector minus​(double c)
        Description copied from interface: Vector
        Subtract a constant from all entries in this vector.
        Specified by:
        minus in interface Vector
        Parameters:
        c - a constant
        Returns:
        \(v - c\)
      • pow

        public Vector pow​(double c)
        Description copied from interface: Vector
        Take the exponentiation of all entries in this vector, entry-by-entry.
        Specified by:
        pow in interface Vector
        Parameters:
        c - a constant
        Returns:
        \(v ^ c\)
      • scaled

        public Vector scaled​(double c)
        Description copied from interface: Vector
        Scale this vector by a constant, entry-by-entry. Here is a way to get a unit version of the vector:
        vector.scaled(1. / vector.norm())
        Specified by:
        scaled in interface Vector
        Parameters:
        c - a constant
        Returns:
        \(c \times this\)
      • angle

        public double angle​(Vector that)
        Description copied from interface: Vector
        Measure the angle, \(\theta\), between this and that. That is, \[ this \cdot that = \|this\| \times \|that\| \times \cos \theta \]
        Specified by:
        angle in interface HilbertSpace<Vector,​Real>
        Specified by:
        angle in interface Vector
        Parameters:
        that - a vector
        Returns:
        the angle, \(\theta\), between this and that
      • ZERO

        public Vector ZERO()
        Description copied from interface: Vector
        Get a 0-vector that has the same length as this vector.
        Specified by:
        ZERO in interface AbelianGroup<Vector>
        Specified by:
        ZERO in interface Vector
        Returns:
        the 0-vector