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 ; }
Add elements of two arrays together allocating the result array . The result type and the operation type are taken from the type of a .