2 var <rows, <cols, <array;
3 *new { arg rows=1, cols=1;
4 ^super.new.init(rows, cols);
6 init { arg argRows, argCols;
9 array = Array.newClear(rows * cols);
13 ^array.at(row*cols + col)
15 put { arg row, col, val;
16 array.put(row*cols + col, val)
20 *fromArray { arg rows,cols, array;
21 ^this.new(rows,cols).with(array);
23 with { arg aarray; array = aarray; }
30 func.value( Array.fill(rows,{ arg ri; this.at(ri,ci) }), ci )
35 func.value( Array.fill(cols,{ arg ci; this.at(ri,ci) }), ri )
40 ^Array.fill(rows,{ arg ri; this.at(ri,ci) })
43 ^array.copyRange(ri * cols, ri * cols + cols - 1)
47 // add { ^thisMethod.shouldNotImplement }
49 // not a compileable string
50 stream << this.class.name << "[ " ;
58 stream << this.class.name << ".fromArray("
59 <<<* [rows,cols,this.asArray] << ")";
60 this.storeModifiersOn(stream);