Пример #1
0
 /// <summary>Set a submatrix.</summary>
 /// <param name="i0">  Initial row index
 /// </param>
 /// <param name="i1">  Final row index
 /// </param>
 /// <param name="c">   Array of column indices.
 /// </param>
 /// <param name="X">   A(i0:i1,c(:))
 /// </param>
 /// <exception cref="System.IndexOutOfRangeException">  Submatrix indices
 /// </exception>
 public virtual void SetMatrix(int i0, int i1, int[] c, GeneralMatrix X)
 {
     try
       {
     for (int i = i0; i <= i1; i++)
     {
       for (int j = 0; j < c.Length; j++)
       {
     a[i][c[j]] = X.GetElement(i - i0, j);
       }
     }
       }
       catch (System.IndexOutOfRangeException e)
       {
     throw new System.IndexOutOfRangeException("Submatrix indices", e);
       }
 }
Пример #2
0
 /// <summary>Set a submatrix.</summary>
 /// <param name="r">   Array of row indices.
 /// </param>
 /// <param name="j0">  Initial column index
 /// </param>
 /// <param name="j1">  Final column index
 /// </param>
 /// <param name="X">   A(r(:),j0:j1)
 /// </param>
 /// <exception cref="System.IndexOutOfRangeException"> Submatrix indices
 /// </exception>
 public virtual void SetMatrix(int[] r, int j0, int j1, GeneralMatrix X)
 {
     try
       {
     for (int i = 0; i < r.Length; i++)
     {
       for (int j = j0; j <= j1; j++)
       {
     a[r[i]][j] = X.GetElement(i, j - j0);
       }
     }
       }
       catch (System.IndexOutOfRangeException e)
       {
     throw new System.IndexOutOfRangeException("Submatrix indices", e);
       }
 }