@Test public void testAdd() { int dim0 = 2; int dim1 = 3; int[] shape = {dim0, dim1}; ArrayDouble A = new ArrayDouble(shape); ArrayDouble B = new ArrayDouble(shape); try { MAMath.setDouble(A, 1.0); MAMath.setDouble(B, 22.0F); MAMath.addDouble(A, A, A); Array result = MAMath.add(A, B); IndexIterator iterR = result.getIndexIterator(); while (iterR.hasNext()) { double vala = iterR.getDoubleNext(); assert (vala == 24.0); } } catch (Exception e) { fail("testAdd Exception" + e); } }
public static Array add(Array a, Array b) throws IllegalArgumentException { Array result = Array.factory(a.getDataType(), a.getShape()); if (a.getElementType() == double.class) { addDouble(result, a, b); } else throw new UnsupportedOperationException(); return result; }
MAMath { public static Array add(Array a, Array b) throws IllegalArgumentException { Array result = Array.factory(a.getDataType(), a.getShape()); if (a.getElementType() == double.class) { addDouble(result, a, b); } else throw new UnsupportedOperationException(); return result; } }
MAMath { public static Array add(Array a, Array b) throws IllegalArgumentException { Array result = Array.factory(a.getDataType(), a.getShape()); if (a.getElementType() == double.class) { addDouble(result, a, b); } else throw new UnsupportedOperationException(); return result; }  }
MAMath { public static Array add(Array a, Array b) throws IllegalArgumentException { Array result = Array.factory(a.getDataType(), a.getShape()); if (a.getElementType() == double.class) { addDouble(result, a, b); } else throw new UnsupportedOperationException(); return result; }  static Array add(Array a, Array b); static void addDouble(Array result, Array a, Array b); static boolean conformable(Array a, Array b); static boolean conformable(int[] shapeA, int[] shapeB); static Array convert(Array org, DataType wantType); static void copy(DataType dataType, IndexIterator from, IndexIterator to); static void copy(Array result, Array a); static void copyDouble(Array result, Array a); static void copyFloat(Array result, Array a); static void copyLong(Array result, Array a); static void copyInt(Array result, Array a); static void copyShort(Array result, Array a); static void copyChar(Array result, Array a); static void copyByte(Array result, Array a); static void copyBoolean(Array result, Array a); static void copyObject(Array result, Array a); static int reducedRank(int[] shape); static double getMinimum(Array a); static double getMaximum(Array a); static MAMath.MinMax getMinMax(Array a); static MAMath.MinMax getMinMaxSkipMissingData(Array a, IsMissingEvaluator eval); static double getMinimumSkipMissingData(Array a, double missingValue); static double getMaximumSkipMissingData(Array a, double missingValue); static MAMath.MinMax getMinMaxSkipMissingData(Array a, double missingValue); static void setDouble(Array result, double val); static double sumDouble(Array a); static double sumDoubleSkipMissingData(Array a, double missingValue); static MAMath.ScaleOffset calcScaleOffsetSkipMissingData(Array a, double missingValue, int nbits); static Array convert2packed(Array unpacked, double missingValue, int nbits, DataType packedType); static Array convert2Unpacked(Array packed, ScaleOffset scaleOffset); static boolean nearlyEquals(Array data1, Array data2); static boolean equals(Array array1, Array array2); static int hashCode(Array array); }
MAMath { public static Array add(Array a, Array b) throws IllegalArgumentException { Array result = Array.factory(a.getDataType(), a.getShape()); if (a.getElementType() == double.class) { addDouble(result, a, b); } else throw new UnsupportedOperationException(); return result; }  static Array add(Array a, Array b); static void addDouble(Array result, Array a, Array b); static boolean conformable(Array a, Array b); static boolean conformable(int[] shapeA, int[] shapeB); static Array convert(Array org, DataType wantType); static void copy(DataType dataType, IndexIterator from, IndexIterator to); static void copy(Array result, Array a); static void copyDouble(Array result, Array a); static void copyFloat(Array result, Array a); static void copyLong(Array result, Array a); static void copyInt(Array result, Array a); static void copyShort(Array result, Array a); static void copyChar(Array result, Array a); static void copyByte(Array result, Array a); static void copyBoolean(Array result, Array a); static void copyObject(Array result, Array a); static int reducedRank(int[] shape); static double getMinimum(Array a); static double getMaximum(Array a); static MAMath.MinMax getMinMax(Array a); static MAMath.MinMax getMinMaxSkipMissingData(Array a, IsMissingEvaluator eval); static double getMinimumSkipMissingData(Array a, double missingValue); static double getMaximumSkipMissingData(Array a, double missingValue); static MAMath.MinMax getMinMaxSkipMissingData(Array a, double missingValue); static void setDouble(Array result, double val); static double sumDouble(Array a); static double sumDoubleSkipMissingData(Array a, double missingValue); static MAMath.ScaleOffset calcScaleOffsetSkipMissingData(Array a, double missingValue, int nbits); static Array convert2packed(Array unpacked, double missingValue, int nbits, DataType packedType); static Array convert2Unpacked(Array packed, ScaleOffset scaleOffset); static boolean nearlyEquals(Array data1, Array data2); static boolean equals(Array array1, Array array2); static int hashCode(Array array);  }