/*
 * call-seq: *(b)
 *
 * Matrix multiply
 *
 *   c = a * b
 *
 * +DimensionError+ is raised unless
 *
 *   a.hsize == b.vsize
 *
 */
VALUE rb_dmatrix_mul(VALUE self, VALUE rb)
{
    DMatrix* a ;
    get_dmatrix(a, self) ;

    if( rb_obj_is_kind_of(rb, rb_cDMatrix) )
    {
        DMatrix* b ;
        DMatrix* c ;

        get_dmatrix(b, rb) ;
        
        if( a->hsize != b->vsize )
        {
            raise_dim_error() ;
        }
        
        c = DMatrix_new(a->vsize, b->hsize) ;
        DMatrix_mul(c, a, b) ;
        return wrap_dmatrix(c) ;
    }
    else
    {
        DMatrix* c = DMatrix_clone(a) ;
        DMatrix_mul_scalar(c, NUM2DBL(rb)) ;
        return wrap_dmatrix(c) ;
    }
}