Class LinearCombinations.BaseLinearCombination
- java.lang.Object
-
- org.apache.commons.numbers.examples.jmh.core.LinearCombinations.BaseLinearCombination
-
- All Implemented Interfaces:
LinearCombination.ND
- Direct Known Subclasses:
LinearCombinations.Dekker
,LinearCombinations.Dot2s
,LinearCombinations.DotK
,LinearCombinations.Exact
,LinearCombinations.ExtendedPrecision
- Enclosing class:
- LinearCombinations
public abstract static class LinearCombinations.BaseLinearCombination extends Object implements LinearCombination.ND
Base class to compute a linear combination with high accuracy. Contains common code for computing short combinations and computing the standard precision sum of products.
-
-
Constructor Summary
Constructors Constructor Description BaseLinearCombination()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract double
computeValue(double[] a, double[] b)
Compute the sum of the products of two sequences of factors with high accuracy.double
value(double[] a, double[] b)
Compute the sum of the products of two sequences of factors.
-
-
-
Method Detail
-
value
public double value(double[] a, double[] b)
Compute the sum of the products of two sequences of factors.- Specified by:
value
in interfaceLinearCombination.ND
- Parameters:
a
- Factors.b
- Factors.- Returns:
- \( \sum_i a_i b_i \).
-
computeValue
protected abstract double computeValue(double[] a, double[] b)
Compute the sum of the products of two sequences of factors with high accuracy. The input arrays will have a length of at least 2; the lengths will be the same.- Parameters:
a
- Factors.b
- Factors.- Returns:
- \( \sum_i a_i b_i \).
-
-