コード例 #1
0
ファイル: RowVector.cs プロジェクト: zyzhu/metanumerics
 /// <summary>
 /// Divides a row vector by a real, scalar constant.
 /// </summary>
 /// <param name="alpha">The real, scalar constant.</param>
 /// <param name="v">The row vector.</param>
 /// <returns>The result.</returns>
 public static RowVector operator /(RowVector v, double alpha)
 {
     if (v == null)
     {
         throw new ArgumentNullException(nameof(v));
     }
     double[] store = VectorAlgorithms.Multiply(1.0 / alpha, v.store, v.offset, v.stride, v.dimension);
     return(new RowVector(store, v.dimension));
 }
コード例 #2
0
 /// <summary>
 /// Multiplies a column vector by a real, scalar constant.
 /// </summary>
 /// <param name="alpha">The real, scalar constant.</param>
 /// <param name="v">The column vector.</param>
 /// <returns>The product &#x3B1;v.</returns>
 public static ColumnVector operator *(double alpha, ColumnVector v)
 {
     if (v == null)
     {
         throw new ArgumentNullException(nameof(v));
     }
     double[] store = VectorAlgorithms.Multiply(alpha, v.store, v.offset, v.stride, v.dimension);
     return(new ColumnVector(store, v.dimension));
 }