Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -547,11 +547,6 @@ static double pelzGood(double x, int n) {
// This is the form for K0.
// Compute all together over odd integers and divide factors
// of (k + 1/2)^b by 2^b.
double k0 = 0;
double k1 = 0;
double k2 = 0;
double k3 = 0;

final double rootN = Math.sqrt(n);
final double z = x * rootN;
final double z3 = z * z2;
Expand Down Expand Up @@ -579,6 +574,10 @@ static double pelzGood(double x, int n) {
// 0 = k^2 - k + log(eps) * 2z^2 / pi^2
// Solve using quadratic equation and eps = ulp(1.0): 4a ~ -288
final int max = (int) Math.ceil((1 + Math.sqrt(1 - FOUR_A * z2 / PI2)) / 2);
double k0 = 0;
double k1 = 0;
double k2 = 0;
double k3 = 0;
// Sum smallest terms first
for (int k = max; k > 0; k--) {
final int j = 2 * k - 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,6 @@ public RealSquareMatrix power(int n) {

// Working arrays
final double[] col = new double[dim];
double[] b = new double[data.length];
double[] tmp;

// Initialise result as A^1.
final double[] a = data;
Expand All @@ -168,6 +166,8 @@ public RealSquareMatrix power(int n) {
int bits = n << shift;

// Process remaining bits below highest set bit.
double[] b = new double[data.length];
double[] tmp;
for (int i = 32 - shift; i != 0; i--, bits <<= 1) {
// Square the result
er = multiply(r, er, r, er, col, b);
Expand Down
8 changes: 8 additions & 0 deletions src/conf/pmd/pmd-ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@
value="./ancestor-or-self::MethodDeclaration[@Name='twoSampleTwoSidedPStabilizedInner']"/>
</properties>
</rule>
<rule ref="category/java/codestyle.xml/VariableDeclarationUsageDistance">
<properties>
<!-- Brent algorithm state must persist across iterations. -->
<property name="violationSuppressXPath"
value="./ancestor-or-self::MethodDeclaration[@Name='optimize'
and ancestor::ClassDeclaration[@SimpleName='BrentOptimizer']]"/>
</properties>
</rule>
<rule ref="category/java/codestyle.xml/LinguisticNaming">
<properties>
<!-- Allow builder pattern for configuring statistics for fluent chaining -->
Expand Down