示例#1
0
        /// <summary>
        /// returns the maximum (over all locally stored rows) number of off-diagonal non-zero entries per row
        /// </summary>
        /// <returns></returns>
        static public int GetMaxNoOfOffDiagonalNonZerosPerRow(this IMutableMatrixEx M)
        {
            int r            = 0;
            var _RowPartiton = M.RowPartitioning;

            int i0 = (int)_RowPartiton.i0;

            for (int i = (int)(_RowPartiton.i0 + _RowPartiton.LocalLength - 1); i >= i0; i--)
            {
                r = Math.Max(M.GetNoOfOffDiagonalNonZerosPerRow(i), r);
            }
            return(r);
        }
示例#2
0
        /// <summary>
        /// returns the number of non-zero elements outside the diagonal in all rows
        /// (on the current MPI process);
        /// </summary>
        /// <returns></returns>
        static public int GetTotalNoOfOffDiagonalNonZeros(this IMutableMatrixEx M)
        {
            int odnz    = 0;
            var rowPart = M.RowPartitioning;

            int i0 = (int)rowPart.i0;

            for (int i = (int)(rowPart.i0 + rowPart.LocalLength - 1); i >= i0; i--)
            {
                odnz += M.GetNoOfOffDiagonalNonZerosPerRow(i);
            }

            return(odnz);
        }