/*
 * call-seq: replace_column(j, v)
 *
 * replace the +j+-th column with the column vector +v+.
 *
 */
VALUE rb_dmatrix_replace_column( VALUE self, VALUE rj, VALUE rv )
{
    DMatrix* a ;
    integer j = (integer)NUM2INT(rj) ;
    DMatrix* v ;

    get_dmatrix(a, self) ;
    get_dmatrix(v, rv) ;

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