/** * This gets the equivalent java array of the wanted type, in correct order. * It avoids copying if possible. * * @param wantType returned object will be an array of this type. This must be convertible to it. * @return java array of type want */ public Object get1DJavaArray(Class wantType) { if (wantType == getElementType()) { if (indexCalc.isFastIterator()) return getStorage(); // already in order else return copyTo1DJavaArray(); // gotta copy } // gotta convert to new type Array newA = factory(wantType, getShape()); MAMath.copy(newA, this); return newA.getStorage(); }
/** * This gets the equivalent java array of the wanted type, in correct order. * It avoids copying if possible. * * @param wantType returned object will be an array of this type. This must be convertible to it. * @return java array of type want */ public Object get1DJavaArray(Class wantType) { if (wantType == getElementType()) { if (indexCalc.isFastIterator()) return getStorage(); // already in order else return copyTo1DJavaArray(); // gotta copy } // gotta convert to new type Array newA = factory(wantType, getShape()); MAMath.copy(newA, this); return newA.getStorage(); }
/** * This gets the equivalent java array of the wanted type, in correct order. * It avoids copying if possible. * * @param wantType returned object will be an array of this type. This must be convertible to it. * @return java array of type want */ public Object get1DJavaArray(DataType wantType) { if (wantType == getDataType()) { if (indexCalc.isFastIterator()) return getStorage(); // already in order else return copyTo1DJavaArray(); // gotta copy } // gotta convert to new type Array newA = factory(wantType, getShape()); MAMath.copy(newA, this); return newA.getStorage(); }