/*
 * call-seq:
 *   symmetric!
 *
 * Force the matrix to be symmetric, reflecting the upper triangle
 * onto the lower triangle.
 *
 */
VALUE rb_dmatrix_make_symmetric( VALUE self )
{
    DMatrix* a ;
    get_dmatrix(a, self) ;
    
    if( a->vsize != a->hsize )
    {
        raise_dim_error() ;
    }

    {
        int i ;
        int j ;

        for( j = 0 ; j < a->hsize ; ++j )
        {
            for( i = j + 1 ; i < a->vsize ; ++i )
            {
                a->data[i + j*a->vsize] = a->data[j + i*a->vsize] ;
            }
        }
    }
    
    return self ;
}