assign5/mat.cpp
// print the whole matrix including it's name and size
print the whole matrix including it's name and size
print the whole matrix including it ' s name and size
void Matrix::printInt(std::string msg) const
{
    assertDefined("printInt");
    printSize(msg);
    for (int r=0; r<maxr; r++) {
        for (int c=0; c<maxc; c++) {
            if (m[r][c] != int(m[r][c])) {
                printf("ERROR(printInt): Trying to print an integer matrix but element at position %d, %d is %10.5lg which is not an integer\n", r, c, m[r][c]);
                exit(1);
            }
            printf("%5d ", int(m[r][c]));
        }
        printf("\n");
    }
    fflush(stdout);
}
void Matrix :: printInt ( std :: string msg ) const { assertDefined ( " " ) ; printSize ( msg ) ; for ( int r = 0 ; r < maxr ; r ++ ) { for ( int c = 0 ; c < maxc ; c ++ ) { if ( m [ r ] [ c ] != int ( m [ r ] [ c ] ) ) { printf ( " \n " , r , c , m [ r ] [ c ] ) ; exit ( 1 ) ; } printf ( " " , int ( m [ r ] [ c ] ) ) ; } printf ( " \n " ) ; } fflush ( stdout ) ; }
print the whole matrix including it's name and size
print the whole matrix including it ' s name and size