コード例 #1
0
ファイル: Vector.cs プロジェクト: youthinkk/aima-csharp
 /**
  * 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;
 }
コード例 #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);
        }
コード例 #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);
        }
コード例 #4
0
ファイル: Vector.cs プロジェクト: youthinkk/aima-csharp
 /**
  * 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;
 }