Rev 30 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 30 | Rev 36 | ||
---|---|---|---|
Line 11... | Line 11... | ||
11 | // private static final int ABSCHNITT_STEP = 3; |
11 | // private static final int ABSCHNITT_STEP = 3; |
12 | // private static final BigInteger ABSCHNITT_BEGINN = new BigInteger("789"); |
12 | // private static final BigInteger ABSCHNITT_BEGINN = new BigInteger("789"); |
13 | // private static final BigInteger ABFALL_MEDIAN = new BigInteger("199"); |
13 | // private static final BigInteger ABFALL_MEDIAN = new BigInteger("199"); |
14 | 14 | ||
15 | // Der neue Algorithmus (r20) |
15 | // Der neue Algorithmus (r20) |
- | 16 | // private static final int ABSCHNITT_STEP = 29; |
|
- | 17 | // private static final BigInteger ABSCHNITT_BEGINN = new |
|
- | 18 | // BigInteger("94923"); |
|
- | 19 | // private static final BigInteger ABFALL_MEDIAN = new BigInteger("30"); |
|
- | 20 | ||
- | 21 | // Das erste C-Programm (c 1.0) |
|
- | 22 | // private static final int ABSCHNITT_STEP = 76; |
|
- | 23 | // private static final BigInteger ABSCHNITT_BEGINN = new |
|
- | 24 | // BigInteger("215715"); |
|
- | 25 | // private static final BigInteger ABFALL_MEDIAN = new BigInteger("43"); |
|
- | 26 | ||
- | 27 | // Das erste C-Programm mit Optimierung (c 1.2) |
|
16 | private static final int ABSCHNITT_STEP = 29; |
28 | private static final int ABSCHNITT_STEP = 83; |
17 | private static final BigInteger ABSCHNITT_BEGINN = new BigInteger("94923"); |
29 | private static final BigInteger ABSCHNITT_BEGINN = new BigInteger("230516"); |
18 | private static final BigInteger ABFALL_MEDIAN = new BigInteger("30"); |
30 | private static final BigInteger ABFALL_MEDIAN = new BigInteger("11"); |
19 | 31 | ||
20 | private static BigInteger f(int u) { |
32 | private static BigInteger f(int u) { |
21 | BigInteger res = ABSCHNITT_BEGINN; |
33 | BigInteger res = ABSCHNITT_BEGINN; |
22 | for (int i = ABSCHNITT_STEP + 1; i <= u; i++) { |
34 | for (int i = ABSCHNITT_STEP + 1; i <= u; i++) { |
23 | res = res.add(ABFALL_MEDIAN.multiply(BigInteger.valueOf(i))); |
35 | res = res.add(ABFALL_MEDIAN.multiply(BigInteger.valueOf(i))); |