Matrices/lower_tri.cpp
// Displays the entire structure as a matrix of
// size n*n
Displays the entire structure as a matrix of
size n*n
Displays the entire structure as a matrix of size n * n
void display(Matrix m)
{
    for(int i=1;i<=m.n;i++)
    {
        for(int j=1;j<=m.n;j++)
        {
            if(i>=j)
            {
                cout<<m.A[i*(i-1)/2 + (j-1)]<<" ";
            }
            else
            {
                cout<<"0 ";
            }
        }
        cout<<endl;
    }
}
void display ( Matrix m ) { for ( int i = 1 ; i <= m . n ; i ++ ) { for ( int j = 1 ; j <= m . n ; j ++ ) { if ( i >= j ) { cout << m . A [ i * ( i - 1 ) / 2 + ( j - 1 ) ] << " " ; } else { cout << " " ; } } cout << endl ; } }
Displays the entire structure as a matrix of
size n*n
Displays the entire structure as a matrix of size n * n