public void setValues ( Variable v , int npts , double start , double incr ) { if ( npts != v . getSize ( ) ) throw new IllegalArgumentException ( "bad npts = " + npts + " should be " + v . getSize ( ) ) ; Array data = Array . makeArray ( v . getDataType ( ) , npts , start , incr ) ; if ( v . getRank ( ) != 1 ) data = data . reshape ( v . getShape ( ) ) ; v . setCachedData ( data , true ) ; }
Generate the list of values from a starting value and an increment . Will reshape to variable if needed .