moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / kig / misc / kignumerics.h
blobbb9340996643b04390bb443d4caf8490185707d8
1 /**
2 This file is part of Kig, a KDE program for Interactive Geometry...
3 Copyright (C) 2002 Maurizio Paolini <paolini@dmf.unicatt.it>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
18 USA
19 **/
21 #ifndef KIG_MISC_KIGNUMERICS_H
22 #define KIG_MISC_KIGNUMERICS_H
24 #include <cmath>
26 double calcCubicRoot ( double xmin, double xmax, double a,
27 double b, double c, double d, int root, bool& valid, int& numroots );
29 int calcCubicVariations (double x, double a, double b, double c,
30 double d, double p1a, double p1b, double p0a);
32 double calcCubicRootwithNewton ( double ymin, double ymax, double a,
33 double b, double c, double d, double tol );
35 // Gaussian Elimination. We return false if the matrix is singular,
36 // and can't be usefully eliminated..
37 bool GaussianElimination( double *matrix[], int numrows, int numcols,
38 int scambio[] );
40 void BackwardSubstitution( double *matrix[], int numrows, int numcols,
41 int scambio[], double solution[] );
43 bool Invert3by3matrix ( const double m[3][3], double inv[3][3] );
45 #endif // KIG_MISC_KIGNUMERICS_H