/*
 * call-seq: rand(vsize, hsize)
 *
 * Create a matrix filled with random numbers between -1.0 and 1.0.
 *
 * Similar to
 *
 *   DMatrix.new(vsize, hsize) { 2*rand - 1 }
 *
 * except uses <tt>rand()</tt> from <tt>stdlib.h</tt>
 *
 */
VALUE rb_dmatrix_s_rand(VALUE klass, VALUE rvsize, VALUE rhsize)
{
    DMatrix* a = DMatrix_new(num2size(rvsize),
                                   num2size(rhsize)) ;

    static int first = 1 ;
    if( first )
    {
        srand(time(NULL)) ;
        first = 0 ;
    }
    
    DMatrix_rand(a) ;
    return wrap_dmatrix(a) ;
}