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


C# Complex32.GetLength方法代码示例

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


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

示例1: DenseMatrix

 /// <summary>
 /// Initializes a new instance of the <see cref="DenseMatrix"/> class from a 2D array. This constructor
 /// will allocate a completely new memory block for storing the dense matrix.
 /// </summary>
 /// <param name="array">The 2D array to create this matrix from.</param>
 public DenseMatrix(Complex32[,] array)
     : base(array.GetLength(0), array.GetLength(1))
 {
     _rowCount = array.GetLength(0);
     _columnCount = array.GetLength(1);
     Data = new Complex32[_rowCount * _columnCount];
     for (var i = 0; i < _rowCount; i++)
     {
         for (var j = 0; j < _columnCount; j++)
         {
             Data[(j * _rowCount) + i] = array[i, j];
         }
     }
 }
开发者ID:XiBeichuan,项目名称:hydronumerics,代码行数:19,代码来源:DenseMatrix.cs

示例2: DiagonalMatrix

        /// <summary>
        /// Initializes a new instance of the <see cref="DiagonalMatrix"/> class from a 2D array. 
        /// </summary>
        /// <param name="array">The 2D array to create this matrix from.</param>
        /// <exception cref="IndexOutOfRangeException">When <paramref name="array"/> contains an off-diagonal element.</exception>
        /// <exception cref="IndexOutOfRangeException">Depending on the implementation, an <see cref="IndexOutOfRangeException"/>
        /// may be thrown if one of the indices is outside the dimensions of the matrix.</exception>
        public DiagonalMatrix(Complex32[,] array)
            : this(array.GetLength(0), array.GetLength(1))
        {
            var rows = array.GetLength(0);
            var columns = array.GetLength(1);

            for (var i = 0; i < rows; i++)
            {
                for (var j = 0; j < columns; j++)
                {
                    if (i == j)
                    {
                        Data[i] = array[i, j];
                    }
                    else if (((array[i, j].Real != 0.0) && !double.IsNaN(array[i, j].Real)) || ((array[i, j].Imaginary != 0.0) && !double.IsNaN(array[i, j].Imaginary)))
                    {
                        throw new IndexOutOfRangeException("Cannot set an off-diagonal element in a diagonal matrix.");
                    }
                }
            }
        }
开发者ID:jiangzhen3s,项目名称:mathnet-numerics,代码行数:28,代码来源:DiagonalMatrix.cs

示例3: SparseMatrix

        /// <summary>
        /// Initializes a new instance of the <see cref="SparseMatrix"/> class from a 2D array. 
        /// </summary>
        /// <param name="array">The 2D array to create this matrix from.</param>
        public SparseMatrix(Complex32[,] array)
            : this(array.GetLength(0), array.GetLength(1))
        {
            var rows = array.GetLength(0);
            var columns = array.GetLength(1);

            for (var i = 0; i < rows; i++)
            {
                for (var j = 0; j < columns; j++)
                {
                    SetValueAt(i, j, array[i, j]);
                }
            }
        }
开发者ID:KeithVanderzanden,项目名称:mmbot,代码行数:18,代码来源:SparseMatrix.cs

示例4: DenseMatrix

 /// <summary>
 /// Initializes a new instance of the <see cref="DenseMatrix"/> class from a 2D array. This constructor
 /// will allocate a completely new memory block for storing the dense matrix.
 /// </summary>
 /// <param name="array">The 2D array to create this matrix from.</param>
 public DenseMatrix(Complex32[,] array)
     : this(array.GetLength(0), array.GetLength(1))
 {
     for (var i = 0; i < _rowCount; i++)
     {
         for (var j = 0; j < _columnCount; j++)
         {
             _data[(j * _rowCount) + i] = array[i, j];
         }
     }
 }
开发者ID:bstrausser,项目名称:mathnet-numerics,代码行数:16,代码来源:DenseMatrix.cs

示例5: SparseMatrix

 /// <summary>
 /// Initializes a new instance of the <see cref="SparseMatrix"/> class from a 2D array. 
 /// </summary>
 /// <param name="array">The 2D array to create this matrix from.</param>
 public SparseMatrix(Complex32[,] array)
     : this(array.GetLength(0), array.GetLength(1))
 {
     for (var i = 0; i < _storage.RowCount; i++)
     {
         for (var j = 0; j < _storage.ColumnCount; j++)
         {
             _storage.At(i, j, array[i, j]);
         }
     }
 }
开发者ID:cesardv,项目名称:mathnet-numerics,代码行数:15,代码来源:SparseMatrix.cs

示例6: DenseMatrix

 /// <summary>
 /// Initializes a new instance of the <see cref="DenseMatrix"/> class from a 2D array. This constructor
 /// will allocate a completely new memory block for storing the dense matrix.
 /// </summary>
 /// <param name="array">The 2D array to create this matrix from.</param>
 public DenseMatrix(Complex32[,] array)
     : base(array.GetLength(0), array.GetLength(1))
 {
     var rows = array.GetLength(0);
     var columns = array.GetLength(1);
     Data = new Complex32[rows * columns];
     for (var i = 0; i < rows; i++)
     {
         for (var j = 0; j < columns; j++)
         {
             Data[(j * rows) + i] = array[i, j];
         }
     }
 }
开发者ID:rherbrich,项目名称:mathnet-numerics,代码行数:19,代码来源:DenseMatrix.cs


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