@@ -382,12 +382,12 @@ static REAL o3derrboundA, o3derrboundB, o3derrboundC;
382
382
static REAL iccerrboundA, iccerrboundB, iccerrboundC;
383
383
static REAL isperrboundA, isperrboundB, isperrboundC;
384
384
385
- // Options to choose types of geometric computtaions.
385
+ // Options to choose types of geometric computtaions.
386
386
// Added by H. Si, 2012-08-23.
387
387
static int _use_inexact_arith; // -X option.
388
388
static int _use_static_filter; // Default option, disable it by -X1
389
389
390
- // Static filters for orient3d() and insphere().
390
+ // Static filters for orient3d() and insphere().
391
391
// They are pre-calcualted and set in exactinit().
392
392
// Added by H. Si, 2012-08-23.
393
393
static REAL o3dstaticfilter;
@@ -399,7 +399,7 @@ static REAL ispstaticfilter;
399
399
// http://www.math.utah.edu/~beebe/software/ieee/
400
400
// The original program was "fpinfo2.c".
401
401
402
- double fppow2 (int n)
402
+ static double fppow2 (int n)
403
403
{
404
404
double x, power;
405
405
x = (n < 0 ) ? ((double )1.0 /(double )2.0 ) : (double )2.0 ;
@@ -412,12 +412,12 @@ double fppow2(int n)
412
412
413
413
#ifdef SINGLE
414
414
415
- float fstore (float x)
415
+ static float fstore (float x)
416
416
{
417
417
return (x);
418
418
}
419
419
420
- int test_float (int verbose)
420
+ static int test_float (int verbose)
421
421
{
422
422
float x;
423
423
int pass = 1 ;
@@ -467,12 +467,12 @@ int test_float(int verbose)
467
467
468
468
# else
469
469
470
- double dstore (double x)
470
+ static double dstore (double x)
471
471
{
472
472
return (x);
473
473
}
474
474
475
- int test_double (int verbose)
475
+ static int test_double (int verbose)
476
476
{
477
477
double x;
478
478
int pass = 1 ;
@@ -488,7 +488,7 @@ int test_double(int verbose)
488
488
x = 1.0 ;
489
489
while (dstore (1.0 + x/2.0 ) != 1.0 )
490
490
x /= 2.0 ;
491
- if (verbose)
491
+ if (verbose)
492
492
(void )printf (" machine epsilon = %13.5le " , x);
493
493
494
494
if (x == (double )fppow2 (-52 )) {
@@ -540,7 +540,7 @@ int test_double(int verbose)
540
540
/* */
541
541
/* ****************************************************************************/
542
542
543
- void exactinit (int verbose, int noexact, int nofilter, REAL maxx, REAL maxy,
543
+ void exactinit (int verbose, int noexact, int nofilter, REAL maxx, REAL maxy,
544
544
REAL maxz)
545
545
{
546
546
REAL half;
@@ -881,7 +881,7 @@ int expansion_sum_zeroelim2(int elen, REAL *e, int flen, REAL *f, REAL *h)
881
881
/* */
882
882
/* ****************************************************************************/
883
883
884
- int fast_expansion_sum (int elen, REAL *e, int flen, REAL *f, REAL *h)
884
+ static int fast_expansion_sum (int elen, REAL *e, int flen, REAL *f, REAL *h)
885
885
/* h cannot be e or f. */
886
886
{
887
887
REAL Q;
@@ -953,7 +953,7 @@ int fast_expansion_sum(int elen, REAL *e, int flen, REAL *f, REAL *h)
953
953
/* properties. */
954
954
/* */
955
955
/* ****************************************************************************/
956
-
956
+ static
957
957
int fast_expansion_sum_zeroelim (int elen, REAL *e, int flen, REAL *f, REAL *h)
958
958
/* h cannot be e or f. */
959
959
{
@@ -970,47 +970,19 @@ int fast_expansion_sum_zeroelim(int elen, REAL *e, int flen, REAL *f, REAL *h)
970
970
eindex = findex = 0 ;
971
971
if ((fnow > enow) == (fnow > -enow)) {
972
972
Q = enow;
973
- /* *
974
- * [JWP] Increment 'eindex,' but only update 'enow' if it is
975
- * safe. Otherwise, 'enow' remains unchanged from the previous
976
- * iteration...
977
- */
978
- ++eindex;
979
- if (eindex < elen)
980
- enow = e[eindex];
973
+ enow = e[++eindex];
981
974
} else {
982
975
Q = fnow;
983
- /* *
984
- * [JWP] Increment 'findex,' but only update 'fnow' if it is
985
- * safe. Otherwise, 'fnow' remains unchanged from the previous
986
- * iteration...
987
- */
988
- ++findex;
989
- if (findex < flen)
990
- fnow = f[findex];
976
+ fnow = f[++findex];
991
977
}
992
978
hindex = 0 ;
993
979
if ((eindex < elen) && (findex < flen)) {
994
980
if ((fnow > enow) == (fnow > -enow)) {
995
981
Fast_Two_Sum (enow, Q, Qnew, hh);
996
- /* *
997
- * [JWP] Increment 'eindex,' but only update 'enow' if it is
998
- * safe. Otherwise, 'enow' remains unchanged from the previous
999
- * iteration...
1000
- */
1001
- ++eindex;
1002
- if (eindex < elen)
1003
- enow = e[eindex];
982
+ enow = e[++eindex];
1004
983
} else {
1005
984
Fast_Two_Sum (fnow, Q, Qnew, hh);
1006
- /* *
1007
- * [JWP] Increment 'findex,' but only update 'fnow' if it is
1008
- * safe. Otherwise, 'fnow' remains unchanged from the previous
1009
- * iteration...
1010
- */
1011
- ++findex;
1012
- if (findex < flen)
1013
- fnow = f[findex];
985
+ fnow = f[++findex];
1014
986
}
1015
987
Q = Qnew;
1016
988
if (hh != 0.0 ) {
@@ -1019,24 +991,10 @@ int fast_expansion_sum_zeroelim(int elen, REAL *e, int flen, REAL *f, REAL *h)
1019
991
while ((eindex < elen) && (findex < flen)) {
1020
992
if ((fnow > enow) == (fnow > -enow)) {
1021
993
Two_Sum (Q, enow, Qnew, hh);
1022
- /* *
1023
- * [JWP] Increment 'eindex,' but only update 'enow' if it is
1024
- * safe. Otherwise, 'enow' remains unchanged from the previous
1025
- * iteration...
1026
- */
1027
- ++eindex;
1028
- if (eindex < elen)
1029
- enow = e[eindex];
994
+ enow = e[++eindex];
1030
995
} else {
1031
996
Two_Sum (Q, fnow, Qnew, hh);
1032
- /* *
1033
- * [JWP] Increment 'findex,' but only update 'fnow' if it is
1034
- * safe. Otherwise, 'fnow' remains unchanged from the previous
1035
- * iteration...
1036
- */
1037
- ++findex;
1038
- if (findex < flen)
1039
- fnow = f[findex];
997
+ fnow = f[++findex];
1040
998
}
1041
999
Q = Qnew;
1042
1000
if (hh != 0.0 ) {
@@ -1046,29 +1004,15 @@ int fast_expansion_sum_zeroelim(int elen, REAL *e, int flen, REAL *f, REAL *h)
1046
1004
}
1047
1005
while (eindex < elen) {
1048
1006
Two_Sum (Q, enow, Qnew, hh);
1049
- /* *
1050
- * [JWP] Increment 'eindex,' but only update 'enow' if it is
1051
- * safe. Otherwise, 'enow' remains unchanged from the previous
1052
- * iteration...
1053
- */
1054
- ++eindex;
1055
- if (eindex < elen)
1056
- enow = e[eindex];
1007
+ enow = e[++eindex];
1057
1008
Q = Qnew;
1058
1009
if (hh != 0.0 ) {
1059
1010
h[hindex++] = hh;
1060
1011
}
1061
1012
}
1062
1013
while (findex < flen) {
1063
1014
Two_Sum (Q, fnow, Qnew, hh);
1064
- /* *
1065
- * [JWP] Increment 'findex,' but only update 'fnow' if it is
1066
- * safe. Otherwise, 'fnow' remains unchanged from the previous
1067
- * iteration...
1068
- */
1069
- ++findex;
1070
- if (findex < flen)
1071
- fnow = f[findex];
1015
+ fnow = f[++findex];
1072
1016
Q = Qnew;
1073
1017
if (hh != 0.0 ) {
1074
1018
h[hindex++] = hh;
@@ -1221,7 +1165,7 @@ int linear_expansion_sum_zeroelim(int elen, REAL *e, int flen, REAL *f,
1221
1165
/* will h.) */
1222
1166
/* */
1223
1167
/* ****************************************************************************/
1224
-
1168
+ static
1225
1169
int scale_expansion (int elen, REAL *e, REAL b, REAL *h)
1226
1170
/* e and h cannot be the same. */
1227
1171
{
@@ -1267,7 +1211,7 @@ int scale_expansion(int elen, REAL *e, REAL b, REAL *h)
1267
1211
/* will h.) */
1268
1212
/* */
1269
1213
/* ****************************************************************************/
1270
-
1214
+ static
1271
1215
int scale_expansion_zeroelim (int elen, REAL *e, REAL b, REAL *h)
1272
1216
/* e and h cannot be the same. */
1273
1217
{
@@ -1319,7 +1263,7 @@ int scale_expansion_zeroelim(int elen, REAL *e, REAL b, REAL *h)
1319
1263
/* nonadjacent expansion. */
1320
1264
/* */
1321
1265
/* ****************************************************************************/
1322
-
1266
+ static
1323
1267
int compress (int elen, REAL *e, REAL *h)
1324
1268
/* e and h may be the same. */
1325
1269
{
@@ -1362,7 +1306,7 @@ int compress(int elen, REAL *e, REAL *h)
1362
1306
/* See either version of my paper for details. */
1363
1307
/* */
1364
1308
/* ****************************************************************************/
1365
-
1309
+ static
1366
1310
REAL estimate (int elen, REAL *e)
1367
1311
{
1368
1312
REAL Q;
@@ -1400,7 +1344,7 @@ REAL estimate(int elen, REAL *e)
1400
1344
/* nearly so. */
1401
1345
/* */
1402
1346
/* ****************************************************************************/
1403
-
1347
+ static
1404
1348
REAL orient2dfast (REAL *pa, REAL *pb, REAL *pc)
1405
1349
{
1406
1350
REAL acx, bcx, acy, bcy;
@@ -1412,6 +1356,7 @@ REAL orient2dfast(REAL *pa, REAL *pb, REAL *pc)
1412
1356
return acx * bcy - acy * bcx;
1413
1357
}
1414
1358
1359
+ // static
1415
1360
REAL orient2dexact (REAL *pa, REAL *pb, REAL *pc)
1416
1361
{
1417
1362
INEXACT REAL axby1, axcy1, bxcy1, bxay1, cxay1, cxby1;
@@ -2233,9 +2178,9 @@ REAL orient3dadapt(REAL *pa, REAL *pb, REAL *pc, REAL *pd, REAL permanent)
2233
2178
2234
2179
REAL orient3d (REAL *pa, REAL *pb, REAL *pc, REAL *pd)
2235
2180
{
2236
- return (REAL)
2181
+ return (REAL)
2237
2182
- cgal_pred_obj.orientation_3_object ()
2238
- (Point (pa[0 ], pa[1 ], pa[2 ]),
2183
+ (Point (pa[0 ], pa[1 ], pa[2 ]),
2239
2184
Point (pb[0 ], pb[1 ], pb[2 ]),
2240
2185
Point (pc[0 ], pc[1 ], pc[2 ]),
2241
2186
Point (pd[0 ], pd[1 ], pd[2 ]));
@@ -2269,7 +2214,7 @@ REAL orient3d(REAL *pa, REAL *pb, REAL *pc, REAL *pd)
2269
2214
adxbdy = adx * bdy;
2270
2215
bdxady = bdx * ady;
2271
2216
2272
- det = adz * (bdxcdy - cdxbdy)
2217
+ det = adz * (bdxcdy - cdxbdy)
2273
2218
+ bdz * (cdxady - adxcdy)
2274
2219
+ cdz * (adxbdy - bdxady);
2275
2220
@@ -4237,9 +4182,9 @@ REAL insphere(REAL *pa, REAL *pb, REAL *pc, REAL *pd, REAL *pe)
4237
4182
/* See my Robust Predicates paper for details. */
4238
4183
/* */
4239
4184
/* ****************************************************************************/
4240
-
4185
+ // static
4241
4186
REAL orient4dexact (REAL* pa, REAL* pb, REAL* pc, REAL* pd, REAL* pe,
4242
- REAL aheight, REAL bheight, REAL cheight, REAL dheight,
4187
+ REAL aheight, REAL bheight, REAL cheight, REAL dheight,
4243
4188
REAL eheight)
4244
4189
{
4245
4190
INEXACT REAL axby1, bxcy1, cxdy1, dxey1, exay1;
@@ -4453,8 +4398,9 @@ REAL orient4dexact(REAL* pa, REAL* pb, REAL* pc, REAL* pd, REAL* pe,
4453
4398
return deter[deterlen - 1 ];
4454
4399
}
4455
4400
4401
+ static
4456
4402
REAL orient4dadapt (REAL* pa, REAL* pb, REAL* pc, REAL* pd, REAL* pe,
4457
- REAL aheight, REAL bheight, REAL cheight, REAL dheight,
4403
+ REAL aheight, REAL bheight, REAL cheight, REAL dheight,
4458
4404
REAL eheight, REAL permanent)
4459
4405
{
4460
4406
INEXACT REAL aex, bex, cex, dex, aey, bey, cey, dey, aez, bez, cez, dez;
@@ -4649,8 +4595,8 @@ REAL orient4dadapt(REAL* pa, REAL* pb, REAL* pc, REAL* pd, REAL* pe,
4649
4595
aheight, bheight, cheight, dheight, eheight);
4650
4596
}
4651
4597
4652
- REAL orient4d (REAL* pa, REAL* pb, REAL* pc, REAL* pd, REAL* pe,
4653
- REAL aheight, REAL bheight, REAL cheight, REAL dheight,
4598
+ REAL orient4d (REAL* pa, REAL* pb, REAL* pc, REAL* pd, REAL* pe,
4599
+ REAL aheight, REAL bheight, REAL cheight, REAL dheight,
4654
4600
REAL eheight)
4655
4601
{
4656
4602
REAL aex, bex, cex, dex;
@@ -4756,3 +4702,9 @@ REAL orient4d(REAL* pa, REAL* pb, REAL* pc, REAL* pd, REAL* pe,
4756
4702
4757
4703
4758
4704
4705
+
4706
+
4707
+
4708
+ // ==============================================================================
4709
+
4710
+
0 commit comments