Package dev.nm.number.doublearray
Interface DoubleArrayOperation
-
- All Known Implementing Classes:
CompositeDoubleArrayOperation
,ParallelDoubleArrayOperation
,SimpleDoubleArrayOperation
public interface DoubleArrayOperation
It 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 twodouble
arrays, entry-by-entry.double[]
divide(double[] arr1, double[] arr2)
Divide onedouble
array by another, entry-by-entry.double[]
minus(double[] arr1, double[] arr2)
Subtract onedouble
array from another, entry-by-entry.double[]
multiply(double[] arr1, double[] arr2)
Multiply onedouble
array to another, entry-by-entry.double[]
scaled(double[] arr, double c)
Scale each entry of adouble
array.
-
-
-
Method Detail
-
add
double[] add(double[] arr1, double[] arr2)
Add twodouble
arrays, 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 onedouble
array 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 onedouble
array 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 onedouble
array 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 adouble
array.- Parameters:
arr
- an arraydouble[]
c
- a scaling constant- Returns:
- the scaled array
-
-