bf3a3fa297
- aggiunta libreria vroni 7.6.
190 lines
6.2 KiB
C
190 lines
6.2 KiB
C
/*****************************************************************************/
|
|
/* */
|
|
/* Copyright (C) 2010-2023 M. Held, S. Huber */
|
|
/* */
|
|
/* This code is not in the public domain. All rights reserved! Please make */
|
|
/* sure to read the full copyright statement contained in "README.txt" or in */
|
|
/* the "main" file of this code, such as "main.cc". */
|
|
/* */
|
|
/*****************************************************************************/
|
|
/* */
|
|
/* Written by: Stefan Huber, Martin Held */
|
|
/* */
|
|
/* E-Mail: held@cs.sbg.ac.at */
|
|
/* Fax Mail: (+43 662) 8044-611 */
|
|
/* Voice Mail: (+43 662) 8044-6304 */
|
|
/* Snail Mail: Martin Held */
|
|
/* FB Informatik */
|
|
/* Universitaet Salzburg */
|
|
/* A-5020 Salzburg, Austria */
|
|
/* */
|
|
/*****************************************************************************/
|
|
|
|
#ifndef VRONI_CONSTS_H
|
|
#define VRONI_CONSTS_H
|
|
|
|
#ifndef DOUBLE_OVERRIDE
|
|
/* */
|
|
/* please do not change the following tolerance thresholds */
|
|
/* */
|
|
#define TINY 1.0e-14 /* about the size of the machine precision */
|
|
#define SMALL 0.0078125 /* 0.01 >= SMALL = 1/128 >> ZERO */
|
|
#define INVERSE_SMALL 128.0 /* INVERSE_SMALL = 1/SMALL */
|
|
/* */
|
|
/* the following tolerance thresholds may be changed if you know what you do */
|
|
/* */
|
|
#define ZERO 1.0e-13 /* small number with ZERO >= TINY */
|
|
#define ZERO_MAX 1.0e-5 /* SMALL >> ZERO_MAX >= ZERO */
|
|
#define ZERO_IO 1.0e-5 /* SMALL >> ZERO_IO >= ZERO_MAX */
|
|
#define DECENT 1.0e-10 /* = ZERO_MAX / 1000 */
|
|
#define GRAZE 1.0e-4 /* = ZERO_MAX * 10 */
|
|
/* */
|
|
/* the following thresholds depend on thresholds defined in previous lines */
|
|
/* */
|
|
#define THRESHOLD 1.0e-6 /* THRESHOLD = ZERO_MAX / 10.0 */
|
|
#define ZERO2 1.0e-26 /* ZERO2 = ZERO * ZERO */
|
|
|
|
|
|
#endif
|
|
|
|
#define NIL -1
|
|
#define APPROX 10
|
|
#define MAX_RESTART 50 /* max. number of retries if computation fails */
|
|
|
|
#ifdef WITH_MPFRBACKEND
|
|
|
|
extern double SMALL;
|
|
extern double INVERSE_SMALL;
|
|
extern double ZERO_IO;
|
|
extern double ZERO_MAX;
|
|
extern double ZERO;
|
|
extern double ZERO2;
|
|
extern double THRESHOLD;
|
|
extern double TINY;
|
|
|
|
#elif defined(WITH_COREBACKEND)
|
|
|
|
const double SMALL = 0;
|
|
/* INVERSE_SMALL is not used anyway of SMALL == 0, so keep value from
|
|
plain value. */
|
|
const double INVERSE_SMALL = 128;
|
|
const double ZERO_IO = 1.0e-6;
|
|
const double ZERO_MAX = 0;
|
|
const double ZERO = 0;
|
|
const double ZERO2 = 0;
|
|
const double THRESHOLD = 0;
|
|
const double TINY = 0;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef DOUBLE_OVERRIDE
|
|
|
|
|
|
#ifndef M_E
|
|
#define M_E 2.71828182845904553488
|
|
#endif
|
|
#ifndef M_1_E
|
|
#define M_1_E 0.36787944117144227851
|
|
#endif
|
|
#ifndef M_LOG2E
|
|
#define M_LOG2E 1.44269504088896360904
|
|
#endif
|
|
#ifndef M_LOG10E
|
|
#define M_LOG10E 0.43429448190325182765
|
|
#endif
|
|
#ifndef M_LN2
|
|
#define M_LN2 0.69314718055994530942
|
|
#endif
|
|
#ifndef M_LN10
|
|
#define M_LN10 2.30258509299404568402
|
|
#endif
|
|
#ifndef M_PI
|
|
#define M_PI 3.14159265358979323846
|
|
#endif
|
|
#ifndef M_PI_2
|
|
#define M_PI_2 1.57079632679489661923
|
|
#endif
|
|
#ifndef M_PI_4
|
|
#define M_PI_4 0.78539816339744830962
|
|
#endif
|
|
#ifndef M_PI_8
|
|
#define M_PI_8 0.39269908169872415481
|
|
#endif
|
|
#ifndef M_1_PI
|
|
#define M_1_PI 0.31830988618379067154
|
|
#endif
|
|
#ifndef M_2_PI
|
|
#define M_2_PI 0.63661977236758134308
|
|
#endif
|
|
#ifndef M_2PI
|
|
#define M_2PI 6.28318530717958623199
|
|
#endif
|
|
#ifndef M_180_PI
|
|
#define M_180_PI 57.2957795130823208767
|
|
#endif
|
|
#ifndef M_PI_180
|
|
#define M_PI_180 0.01745329251994329576
|
|
#endif
|
|
#ifndef M_2_SQRTPI
|
|
#define M_2_SQRTPI 1.12837916709551257390
|
|
#endif
|
|
#ifndef M_SQRT2
|
|
#define M_SQRT2 1.41421356237309504880
|
|
#endif
|
|
#ifndef M_SQRT1_2
|
|
#define M_SQRT1_2 0.70710678118654752440
|
|
#endif
|
|
#ifndef M_SQRT3
|
|
#define M_SQRT3 1.73205080756887719317
|
|
#endif
|
|
#ifndef M_SQRT1_3
|
|
#define M_SQRT1_3 0.57735026918962584208
|
|
#endif
|
|
#ifndef M_1_3
|
|
#define M_1_3 0.33333333333333333333
|
|
#endif
|
|
|
|
#elif defined(WITH_MPFRBACKEND)
|
|
|
|
extern double M_1_3;
|
|
extern double M_180_PI;
|
|
extern double M_PI_180;
|
|
#undef M_SQRT2
|
|
extern double M_SQRT2;
|
|
#undef M_PI_4
|
|
extern double M_PI_4;
|
|
#undef M_PI_2
|
|
extern double M_PI_2;
|
|
#undef M_PI
|
|
extern double M_PI;
|
|
#undef M_2PI
|
|
extern double M_2PI;
|
|
|
|
#else
|
|
//defined(WITH_COREBACKEND)
|
|
|
|
const double M_1_3 = double(1) / 3;
|
|
#undef M_SQRT2
|
|
const double M_SQRT2 = sqrt(double(2));
|
|
#undef M_PI
|
|
const double M_PI = pi();
|
|
#undef M_PI_4
|
|
const double M_PI_4 = M_PI / 4;
|
|
#undef M_PI_2
|
|
const double M_PI_2 = M_PI / 2;;
|
|
#undef M_2PI
|
|
const double M_2PI = M_PI * 2;
|
|
const double M_180_PI = 180 / M_PI;
|
|
const double M_PI_180 = M_PI * 180;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|