NdArray constructor
NdArray(
- int numDimensions
Creates an array with numDimensions
dimensions.
Implementation
NdArray(this.numDimensions) {
if (numDimensions < 1) {
throw ArgumentError('numDimensions must be greater than 0\n'
'Actual: $numDimensions');
}
_data = List<dynamic>.filled(1, null, growable: true);
for (int i = 1; i < numDimensions; i++) {
_data = [_data];
}
}