~ubuntu-branches/ubuntu/karmic/python-scipy/karmic

« back to all changes in this revision

Viewing changes to scipy/optimize/Zeros/zeros.h

  • Committer: Bazaar Package Importer
  • Author(s): Ondrej Certik
  • Date: 2008-06-16 22:58:01 UTC
  • mfrom: (2.1.24 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080616225801-irdhrpcwiocfbcmt
Tags: 0.6.0-12
* The description updated to match the current SciPy (Closes: #489149).
* Standards-Version bumped to 3.8.0 (no action needed)
* Build-Depends: netcdf-dev changed to libnetcdf-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Written by Charles Harris charles.harris@sdl.usu.edu */
 
2
 
 
3
/* Modified to not depend on Python everywhere by Travis Oliphant.
 
4
 */
 
5
 
 
6
 
 
7
#ifndef ZEROS_H
 
8
#define ZEROS_H
 
9
 
 
10
#define ZEROS_PARAM_HEAD int funcalls; int iterations; int error_num
 
11
 
 
12
typedef struct {
 
13
    ZEROS_PARAM_HEAD;
 
14
} default_parameters;
 
15
 
 
16
static double dminarg1,dminarg2;
 
17
#define DMIN(a,b) (dminarg1=(a),dminarg2=(b),(dminarg1) < (dminarg2) ?\
 
18
        (dminarg1) : (dminarg2))
 
19
 
 
20
#define SIGN(a)   ((a) > 0.0 ? 1.0 : -1.0)
 
21
#define ERROR(params,num,val) (params)->error_num=(num); return (val)
 
22
#define SIGNERR -1
 
23
#define CONVERR -2
 
24
 
 
25
typedef double (*callback_type)(double,void*);
 
26
typedef double (*solver_type)(callback_type, double, double, double, double, int,default_parameters*);
 
27
 
 
28
extern double bisect(callback_type f, double xa, double xb, double xtol, double rtol, int iter, default_parameters *params);
 
29
extern double ridder(callback_type f, double xa, double xb, double xtol, double rtol, int iter, default_parameters *params);
 
30
extern double brenth(callback_type f, double xa, double xb, double xtol, double rtol, int iter, default_parameters *params);
 
31
extern double brentq(callback_type f, double xa, double xb, double xtol, double rtol, int iter, default_parameters *params);
 
32
 
 
33
 
 
34
extern double fabs(double);
 
35
extern double sqrt(double);
 
36
 
 
37
#endif