當前位置: 首頁>>代碼示例>>C#>>正文


C# Vector.ToArray方法代碼示例

本文整理匯總了C#中numl.Math.LinearAlgebra.Vector.ToArray方法的典型用法代碼示例。如果您正苦於以下問題:C# Vector.ToArray方法的具體用法?C# Vector.ToArray怎麽用?C# Vector.ToArray使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在numl.Math.LinearAlgebra.Vector的用法示例。


在下文中一共展示了Vector.ToArray方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Calc

 /// <summary>Calcs.</summary>
 /// <param name="v">A variable-length parameters list containing v.</param>
 /// <param name="f">The Func&lt;int,double,double&gt; to process.</param>
 /// <returns>A Vector.</returns>
 public static Vector Calc(Vector v, Func<int, double, double> f)
 {
     var result = v.ToArray();
     for (int i = 0; i < v.Length; i++)
         result[i] = f(i, result[i]);
     return result;
 }
開發者ID:sethjuarez,項目名稱:numl,代碼行數:11,代碼來源:VectorStatics.cs

示例2: FeatureScale

 /// <summary>
 ///     Performs feature scaling on the supplied column vector and returns a copy
 /// </summary>
 /// <param name="column">Column vector to compute</param>
 /// <returns></returns>
 public static Vector FeatureScale(Vector column)
 {
     var temp = column.ToArray();
     return new Vector(FeatureScale(temp));
 }
開發者ID:ChewyMoon,項目名稱:Cupcake,代碼行數:10,代碼來源:FeatureNormalizer.cs

示例3: FeatureScale

 /// <summary>
 /// Performs feature scaling on the supplied column vector and returns a copy
 /// </summary>
 /// <param name="column">Column vector to compute</param>
 /// <returns></returns>
 public static Vector FeatureScale(Vector column)
 {
     double[] temp = column.ToArray();
     return new Vector(FeatureNormalizer.FeatureScale(temp));
 }
開發者ID:m-abubakar,項目名稱:numl,代碼行數:10,代碼來源:FeatureNormalizer.cs

示例4: ContainsNaN

 /// <summary>Query if 'vector' contains NaN.</summary>
 /// <param name="vector">The vector.</param>
 /// <returns>true if it succeeds, false if it fails.</returns>
 public static bool ContainsNaN(Vector vector)
 {
     var v = vector.ToArray();
     return v.Any(e => double.IsNaN(e));
 }
開發者ID:sethjuarez,項目名稱:numl,代碼行數:8,代碼來源:VectorStatics.cs

示例5: Sum

 /// <summary>Sums the given v.</summary>
 /// <param name="v">A variable-length parameters list containing v.</param>
 /// <returns>A double.</returns>
 public static double Sum(Vector v)
 {
     return v.ToArray().Sum();
 }
開發者ID:sethjuarez,項目名稱:numl,代碼行數:7,代碼來源:VectorStatics.cs

示例6: IsNaN

 /// <summary>Query if 'vector' is NaN.</summary>
 /// <param name="vector">The vector.</param>
 /// <returns>true if NaN, false if not.</returns>
 public static bool IsNaN(Vector vector)
 {
     var v = vector.ToArray();
     return v.All(e => double.IsNaN(e));
 }
開發者ID:sethjuarez,項目名稱:numl,代碼行數:8,代碼來源:VectorStatics.cs


注:本文中的numl.Math.LinearAlgebra.Vector.ToArray方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。