/*
 * call-seq: replace_row(i, v)
 *
 * replace the +i+-th row with the row vector +v+.
 *
 */
VALUE rb_dmatrix_replace_row( VALUE self, VALUE ri, VALUE rv )
{
    DMatrix* a ;
    integer i = (integer)NUM2INT(ri) ;
    DMatrix* v ;

    get_dmatrix(a, self) ;
    get_dmatrix(v, rv) ;
    
    if( v->vsize != 1 ||
        v->hsize != a->hsize )
    {
        raise_dim_error() ;
    }
    
    dmatrix_replace_minor(a, i, 0, v) ;
    return self ;
}