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


C# Matrix.Column方法代码示例

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


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

示例1: ComputeMatrixCrossproduct

 private static Matrix<double> ComputeMatrixCrossproduct(Matrix<double> matrix, IList<int> columnIndexes)
 {
     var result = new DenseMatrix(columnIndexes.Count, columnIndexes.Count);
     for (int iRow = 0; iRow < columnIndexes.Count; iRow++)
     {
         for (int iCol = 0; iCol < columnIndexes.Count; iCol++)
         {
             result[iRow, iCol] = matrix.Column(columnIndexes[iRow]).DotProduct(matrix.Column(columnIndexes[iCol]));
         }
     }
     return result;
 }
开发者ID:AlexandreBurel,项目名称:pwiz-mzdb,代码行数:12,代码来源:QrFactorizationCache.cs

示例2: QuaternionFromMatrix

 private Quaternion QuaternionFromMatrix(Matrix<double> m)
 {
     Vector<double> col2 = m.Column(2);
     Vector<double> col1 = m.Column(1);
     return Quaternion.LookRotation(numericToUnity(col2), numericToUnity(col1));
 }
开发者ID:imclab,项目名称:SpaceLeap,代码行数:6,代码来源:Kabsch.cs

示例3: QRGramSchmidt

        /// <summary>
        /// Gram-Schmidtian orthogonalization of an m by n matrix A, such that
        /// {Q, R} is returned, where A = QR, Q is m by n and orthogonal, R is
        /// n by n and upper triangular matrix.
        /// </summary>
        /// <returns></returns>
        public Matrix[] QRGramSchmidt()
        {
            int m = rowCount;
            int n = columnCount;

            Matrix A = this.Clone();

            Matrix Q = new Matrix(m, n);
            Matrix R = new Matrix(n, n);

            // the first column of Q equals the first column of this matrix
            for (int i = 1; i <= m; i++)
                Q[i, 1] = A[i, 1];

            R[1, 1] = Complex.One;

            for (int k = 1; k <= n; k++)
            {
                R[k, k] = new Complex(A.Column(k).Norm());

                for (int i = 1; i <= m; i++)
                    Q[i, k] = A[i, k] / R[k, k];

                for (int j = k + 1; j <= n; j++)
                {
                    R[k, j] = Dot(Q.Column(k), A.Column(j));

                    for (int i = 1; i <= m; i++)
                        A[i, j] = A[i, j] - Q[i, k] * R[k, j];
                }
            }

            return new Matrix[] { Q, R };
        }
开发者ID:,项目名称:,代码行数:40,代码来源:

示例4: VerticalConcat

        /// <summary>
        /// Vertically concats matrices A and B, which do not have to be of the same height. 
        /// </summary>
        /// <param name="A"></param>
        /// <param name="B"></param>
        /// <returns>Matrix [A|B]</returns>
        public static Matrix VerticalConcat(Matrix A, Matrix B)
        {
            Matrix C = A.Column(1);

            for (int j = 2; j <= A.ColumnCount; j++)
            {
                C.InsertColumn(A.Column(j), j);
            }

            for (int j = 1; j <= B.ColumnCount; j++)
            {
                C.InsertColumn(B.Column(j), C.ColumnCount + 1);
            }

            return C;
        }
开发者ID:,项目名称:,代码行数:22,代码来源:


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