コード例 #1
0
ファイル: ind2sub.cs プロジェクト: wdxa/ILNumerics
 /// <summary>
 /// convert sequential index into subscript indices
 /// </summary>
 /// <param name="A">input array</param>
 /// <param name="seqindex">sequential index</param>
 /// <returns>subscript indices</returns>
 /// <remarks><para>the length of the value returned will be the number of dimensions of A</para>
 /// <para>if A is null or empty array, the return value will be of length 0</para>
 /// </remarks>
 /// <exception cref="System.IndexOutOfRangeException">if seqindex is &lt; 0 or &gt; numel(A)</exception>
 public static int[] ind2sub(ILArray<complex>   A, int seqindex) {  
     if (object.Equals(A,null) || A.IsEmpty)
         return new int[0]; 
     int [] ret = new int[A.Dimensions.NumberOfDimensions]; 
     A.GetValueSeq(seqindex,ref ret); 
     return ret; 
 }
コード例 #2
0
ファイル: ind2sub.cs プロジェクト: zhufengGNSS/ILNumerics
 /// <summary>
 /// convert sequential index into subscript indices
 /// </summary>
 /// <param name="A">input array</param>
 /// <param name="seqindex">sequential index</param>
 /// <returns>subscript indices</returns>
 /// <remarks><para>the length of the value returned will be the number of dimensions of A</para>
 /// <para>if A is null or empty array, the return value will be of length 0</para>
 /// </remarks>
 /// <exception cref="System.IndexOutOfRangeException">if seqindex is &lt; 0 or &gt; numel(A)</exception>
 public static int[] ind2sub(ILArray <complex> A, int seqindex)
 {
     if (object.Equals(A, null) || A.IsEmpty)
     {
         return(new int[0]);
     }
     int [] ret = new int[A.Dimensions.NumberOfDimensions];
     A.GetValueSeq(seqindex, ref ret);
     return(ret);
 }