Exemplo n.º 1
0
 /**
  * Returns a copy of this vector.
  *
  * @return a copy of this vector.
  */
 public Vector copyVector()
 {
     Vector result = new Vector(getRowDimension());
     for (int i = 0; i < getRowDimension(); i++)
     {
     result.setValue(i, getValue(i));
     }
     return result;
 }
Exemplo n.º 2
0
        /**
         * Returns the result of vector subtraction.
         *
         * @param v
         *            the vector to subtract
         *
         * @return the result of vector subtraction.
         */
        public Vector minus(Vector v)
        {
            Vector result = new Vector(size());

            for (int i = 0; i < size(); i++)
            {
                result.setValue(i, getValue(i) - v.getValue(i));
            }
            return(result);
        }
Exemplo n.º 3
0
        /**
         * Returns a copy of this vector.
         *
         * @return a copy of this vector.
         */
        public Vector copyVector()
        {
            Vector result = new Vector(getRowDimension());

            for (int i = 0; i < getRowDimension(); i++)
            {
                result.setValue(i, getValue(i));
            }
            return(result);
        }
Exemplo n.º 4
0
 /**
  * Returns the result of vector addition.
  *
  * @param v
  *            the vector to add
  *
  * @return the result of vector addition.
  */
 public Vector plus(Vector v)
 {
     Vector result = new Vector(size());
     for (int i = 0; i < size(); i++)
     {
     result.setValue(i, getValue(i) + v.getValue(i));
     }
     return result;
 }