def __repr__(self):
        """Print basic statistics about the multigrid hierarchy."""
        output = 'multilevel_solver\n'
        output += 'Number of Levels:     %d\n' % len(self.levels)
        output += 'Operator Complexity: %6.3f\n' % self.operator_complexity()
        output += 'Grid Complexity:     %6.3f\n' % self.grid_complexity()
        output += 'Coarse Solver:        %s\n' % self.coarse_solver.name()

        total_nnz = sum([level.A.nnz for level in self.levels])

        output += '  level   unknowns     nonzeros\n'
        for n, level in enumerate(self.levels):
            A = level.A
            output += '   %2d   %10d   %10d [%5.2f%%]\n' %\
                (n, A.shape[1], A.nnz,
                 (100 * float(A.nnz) / float(total_nnz)))

        return output
def __repr__ ( self ) : output = 'multilevel_solver\n' output += 'Number of Levels:     %d\n' % len ( self . levels ) output += 'Operator Complexity: %6.3f\n' % self . operator_complexity ( ) output += 'Grid Complexity:     %6.3f\n' % self . grid_complexity ( ) output += 'Coarse Solver:        %s\n' % self . coarse_solver . name ( ) total_nnz = sum ( [ level . A . nnz for level in self . levels ] ) output += '  level   unknowns     nonzeros\n' for n , level in enumerate ( self . levels ) : A = level . A output += '   %2d   %10d   %10d [%5.2f%%]\n' % ( n , A . shape [ 1 ] , A . nnz , ( 100 * float ( A . nnz ) / float ( total_nnz ) ) ) return output
Print basic statistics about the multigrid hierarchy.