Package dev.nm.number.doublearray
Interface DoubleArrayOperation
-
- All Known Implementing Classes:
CompositeDoubleArrayOperation,ParallelDoubleArrayOperation,SimpleDoubleArrayOperation
public interface DoubleArrayOperationIt is possible to provide different implementations for different platforms, hardware, etc. For example, there are single vs. multiple threads, single vs. multiple cores, single vs. multiple machines, GPU or not, etc.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description double[]add(double[] arr1, double[] arr2)Add twodoublearrays, entry-by-entry.double[]divide(double[] arr1, double[] arr2)Divide onedoublearray by another, entry-by-entry.double[]minus(double[] arr1, double[] arr2)Subtract onedoublearray from another, entry-by-entry.double[]multiply(double[] arr1, double[] arr2)Multiply onedoublearray to another, entry-by-entry.double[]scaled(double[] arr, double c)Scale each entry of adoublearray.
-
-
-
Method Detail
-
add
double[] add(double[] arr1, double[] arr2)Add twodoublearrays, entry-by-entry.- Parameters:
arr1- an arraydouble[]arr2- an arraydouble[]- Returns:
- the sum of the two arrays
-
minus
double[] minus(double[] arr1, double[] arr2)Subtract onedoublearray from another, entry-by-entry.- Parameters:
arr1- an arraydouble[]arr2- an arraydouble[]- Returns:
- the difference of the two arrays
-
multiply
double[] multiply(double[] arr1, double[] arr2)Multiply onedoublearray to another, entry-by-entry.- Parameters:
arr1- an arraydouble[]arr2- an arraydouble[]- Returns:
- the product of the two arrays
-
divide
double[] divide(double[] arr1, double[] arr2)Divide onedoublearray by another, entry-by-entry.- Parameters:
arr1- an arraydouble[]arr2- an arraydouble[]- Returns:
- the quotient array
-
scaled
double[] scaled(double[] arr, double c)Scale each entry of adoublearray.- Parameters:
arr- an arraydouble[]c- a scaling constant- Returns:
- the scaled array
-
-