当前位置: 首页>>代码示例>>C#>>正文


C# DenseMatrix.At方法代码示例

本文整理汇总了C#中MathNet.Numerics.LinearAlgebra.Complex.DenseMatrix.At方法的典型用法代码示例。如果您正苦于以下问题:C# DenseMatrix.At方法的具体用法?C# DenseMatrix.At怎么用?C# DenseMatrix.At使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MathNet.Numerics.LinearAlgebra.Complex.DenseMatrix的用法示例。


在下文中一共展示了DenseMatrix.At方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OuterProduct

        /// <summary>
        /// Outer product of two vectors
        /// </summary>
        /// <param name="u">First vector</param>
        /// <param name="v">Second vector</param>
        /// <returns>Matrix M[i,j] = u[i]*v[j] </returns>
        /// <exception cref="ArgumentNullException">If the u vector is <see langword="null" />.</exception> 
        /// <exception cref="ArgumentNullException">If the v vector is <see langword="null" />.</exception> 
        public static DenseMatrix OuterProduct(DenseVector u, DenseVector v)
        {
            if (u == null)
            {
                throw new ArgumentNullException("u");
            }

            if (v == null)
            {
                throw new ArgumentNullException("v");
            }

            var matrix = new DenseMatrix(u.Count, v.Count);
            CommonParallel.For(
                0, 
                u.Count, 
                i =>
                {
                    for (var j = 0; j < v.Count; j++)
                    {
                        matrix.At(i, j, u._values[i] * v._values[j]);
                    }
                });
            return matrix;
        }
开发者ID:cdrnet,项目名称:mathnet-numerics-native,代码行数:33,代码来源:DenseVector.cs

示例2: ToRowMatrix

        /// <summary>
        /// Create a matrix based on this vector in row form (one single row).
        /// </summary>
        /// <returns>This vector as a row matrix.</returns>
        public override Matrix<Complex> ToRowMatrix()
        {
            var matrix = new DenseMatrix(1, _length);
            for (var i = 0; i < _values.Length; i++)
            {
                matrix.At(0, i, _values[i]);
            }

            return matrix;
        }
开发者ID:cdrnet,项目名称:mathnet-numerics-native,代码行数:14,代码来源:DenseVector.cs

示例3: ToRowMatrix

        /// <summary>
        /// Create a matrix based on this vector in row form (one single row).
        /// </summary>
        /// <returns>This vector as a row matrix.</returns>
        public override Matrix<Complex> ToRowMatrix()
        {
            var matrix = new DenseMatrix(1, Count);
            for (var i = 0; i < Data.Length; i++)
            {
                matrix.At(0, i, Data[i]);
            }

            return matrix;
        }
开发者ID:bstrausser,项目名称:mathnet-numerics,代码行数:14,代码来源:DenseVector.cs

示例4: ToColumnMatrix

        /// <summary>
        /// Create a matrix based on this vector in column form (one single column).
        /// </summary>
        /// <returns>This vector as a column matrix.</returns>
        public override Matrix<Complex> ToColumnMatrix()
        {
            var matrix = new DenseMatrix(_length, 1);
            for (var i = 0; i < _values.Length; i++)
            {
                matrix.At(i, 0, _values[i]);
            }

            return matrix;
        }
开发者ID:cdrnet,项目名称:mathnet-numerics-native,代码行数:14,代码来源:DenseVector.cs

示例5: ToColumnMatrix

        /// <summary>
        /// Create a matrix based on this vector in column form (one single column).
        /// </summary>
        /// <returns>This vector as a column matrix.</returns>
        public override Matrix<Complex> ToColumnMatrix()
        {
            var matrix = new DenseMatrix(Count, 1);
            for (var i = 0; i < Data.Length; i++)
            {
                matrix.At(i, 0, Data[i]);
            }

            return matrix;
        }
开发者ID:bstrausser,项目名称:mathnet-numerics,代码行数:14,代码来源:DenseVector.cs


注:本文中的MathNet.Numerics.LinearAlgebra.Complex.DenseMatrix.At方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。