Drop unused resource strings
[TortoiseGit.git] / ext / OGDF / src / energybased / numexcept.h
blobcd744dec34fc696cd0757dbe3d766c59260868e8
1 /*
2 * $Revision: 2559 $
4 * last checkin:
5 * $Author: gutwenger $
6 * $Date: 2012-07-06 15:04:28 +0200 (Fr, 06. Jul 2012) $
7 ***************************************************************/
9 /** \file
10 * \brief Declaration of class numexcept (handling of numeric problems).
12 * \author Stefan Hachul
14 * \par License:
15 * This file is part of the Open Graph Drawing Framework (OGDF).
17 * \par
18 * Copyright (C)<br>
19 * See README.txt in the root directory of the OGDF installation for details.
21 * \par
22 * This program is free software; you can redistribute it and/or
23 * modify it under the terms of the GNU General Public License
24 * Version 2 or 3 as published by the Free Software Foundation;
25 * see the file LICENSE.txt included in the packaging of this file
26 * for details.
28 * \par
29 * This program is distributed in the hope that it will be useful,
30 * but WITHOUT ANY WARRANTY; without even the implied warranty of
31 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 * GNU General Public License for more details.
34 * \par
35 * You should have received a copy of the GNU General Public
36 * License along with this program; if not, write to the Free
37 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
38 * Boston, MA 02110-1301, USA.
40 * \see http://www.gnu.org/copyleft/gpl.html
41 ***************************************************************/
44 #ifdef _MSC_VER
45 #pragma once
46 #endif
48 #ifndef OGDF_NUMEXCEPT_H
49 #define OGDF_NUMEXCEPT_H
51 #include <ogdf/basic/geometry.h>
53 namespace ogdf {
55 //--------------------------------------------------------------------------
56 // this class is developed for exceptions that might occure, when nodes are
57 // placed at the same position and a new random position has to be found, or
58 // when the calculated forces are near the machine accuracy, where no
59 // reasonable numeric and logic calculations are possible any more
60 //---------------------------------------------------------------------------
62 class numexcept
64 public:
66 //Returns a distinct random point within the smallest disque D with center
67 //old_point that is contained in the box defined by xmin,...,ymax; The size of
68 //D is shrunk by multiplying with epsilon = 0.1; Precondition:
69 //old_point is contained in the box and the box is not equal to old_point.
70 DPoint choose_distinct_random_point_in_disque(
71 DPoint old_point,
72 double xmin,
73 double xmax,
74 double ymin,
75 double ymax);
77 //A random point (distinct from old_pos) on the disque around old_pos with
78 //radius epsilon = 0.1 is computed.
79 DPoint choose_distinct_random_point_in_radius_epsilon(DPoint old_pos);
81 //If distance has a value near the machine precision the repulsive force calculation
82 //is not possible (calculated values exceed the machine accuracy) in this cases
83 //true is returned and force is set to a reasonable value that does
84 //not cause problems; Else false is returned and force keeps unchanged.
85 bool f_rep_near_machine_precision(double distance, DPoint& force);
87 //If distance has a value near the machine precision the (attractive)force
88 //calculation is not possible (calculated values exceed the machine accuracy) in
89 //this cases true is returned and force is set to a reasonable value that does
90 //not cause problems; Else false is returned and force keeps unchanged.
91 bool f_near_machine_precision(double distance, DPoint& force);
93 //Returns true if a is "nearly" equal to b (needed, when machine accuracy is
94 //insufficient in functions well_seperated and bordering of NMM)
95 bool nearly_equal(double a, double b);
99 }//namespace ogdf
100 #endif