Renamed the USE_PRECOMPUTED_TABLES constant into

RECOMPUTE_TABLES_AT_RUNTIME.

The previous name was in fact the exact opposite of what was really
done.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1172224 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Luc Maisonobe 2011-09-18 08:52:03 +00:00
parent 237c80ba7b
commit eb09e4d118
1 changed files with 5 additions and 15 deletions

View File

@ -85,14 +85,14 @@ public class FastMath {
private static final int TWO_POWER_10 = 1024; private static final int TWO_POWER_10 = 1024;
/** Indicator for precomputed tables. /** Indicator for tables initialization.
* <p> * <p>
* This compile-time constant should be set to true only if one explicitly * This compile-time constant should be set to true only if one explicitly
* wants to compute the tables at class loading time instead of using the * wants to compute the tables at class loading time instead of using the
* already computed ones provided as literal arrays below. * already computed ones provided as literal arrays below.
* </p> * </p>
*/ */
private static final boolean USE_PRECOMPUTED_TABLES = false; private static final boolean RECOMPUTE_TABLES_AT_RUNTIME = false;
/** log(2) (high bits). */ /** log(2) (high bits). */
private static final double LN_2_A = 0.693147063255310059; private static final double LN_2_A = 0.693147063255310059;
@ -299,16 +299,6 @@ public class FastMath {
/** 2^52 - double numbers this large must be integral (no fraction) or NaN or Infinite */ /** 2^52 - double numbers this large must be integral (no fraction) or NaN or Infinite */
private static final double TWO_POWER_52 = 4503599627370496.0; private static final double TWO_POWER_52 = 4503599627370496.0;
// Initialize tables
// static {
// if (USE_PRECOMPUTED_TABLES) { // suppress table initialisation as now hard-coded
// int i;
// // Build the sine and cosine tables
// buildSinCosTables();
// }
// }
/** /**
* Private Constructor * Private Constructor
*/ */
@ -3676,7 +3666,7 @@ public class FastMath {
private static final double[] EXP_INT_TABLE_B; private static final double[] EXP_INT_TABLE_B;
static { static {
if (FastMath.USE_PRECOMPUTED_TABLES) { if (FastMath.RECOMPUTE_TABLES_AT_RUNTIME) {
EXP_INT_TABLE_A = new double[FastMath.EXP_INT_TABLE_LEN]; EXP_INT_TABLE_A = new double[FastMath.EXP_INT_TABLE_LEN];
EXP_INT_TABLE_B = new double[FastMath.EXP_INT_TABLE_LEN]; EXP_INT_TABLE_B = new double[FastMath.EXP_INT_TABLE_LEN];
@ -6721,7 +6711,7 @@ public class FastMath {
private static final double[] EXP_FRAC_TABLE_B; private static final double[] EXP_FRAC_TABLE_B;
static { static {
if (FastMath.USE_PRECOMPUTED_TABLES) { if (FastMath.RECOMPUTE_TABLES_AT_RUNTIME) {
EXP_FRAC_TABLE_A = new double[FastMath.EXP_FRAC_TABLE_LEN]; EXP_FRAC_TABLE_A = new double[FastMath.EXP_FRAC_TABLE_LEN];
EXP_FRAC_TABLE_B = new double[FastMath.EXP_FRAC_TABLE_LEN]; EXP_FRAC_TABLE_B = new double[FastMath.EXP_FRAC_TABLE_LEN];
@ -8801,7 +8791,7 @@ public class FastMath {
private static final double[][] LN_MANT; private static final double[][] LN_MANT;
static { static {
if (FastMath.USE_PRECOMPUTED_TABLES) { if (FastMath.RECOMPUTE_TABLES_AT_RUNTIME) {
LN_MANT = new double[FastMath.LN_MANT_LEN][]; LN_MANT = new double[FastMath.LN_MANT_LEN][];
// Populate lnMant table // Populate lnMant table