home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / CPROG / ANUMR5.ZIP / ANUM.H < prev    next >
C/C++ Source or Header  |  1991-11-25  |  51KB  |  2,277 lines

  1. /*     Définitions diverses pour les modules d'analyse numérique */
  2.  
  3.  
  4. /*     Constants defines */
  5.  
  6. #ifndef __ANUM_H
  7. #define __ANUM_H
  8.  
  9. #include <math.h>
  10.  
  11. #ifdef __TURBOC__
  12. #ifdef __PASCAL__
  13. #error Pascal calling conventions are not yet supported
  14. #endif
  15.  
  16. #ifndef __LARGE__
  17. #error Compilation should occur *ONLY* in LARGE Model
  18. #endif
  19. #endif
  20.  
  21.  
  22.  
  23.         /*     Constants defines */
  24.  
  25.  
  26.  
  27.                 /*      Error codes returned by functions       */
  28.  
  29. #define ENOERROR      0   /* No error                 */
  30. #define ETOLLE0          -1   /* Tolerance lower than or equal to 0    */
  31. #define EOVERMAXITER     -2   /* Attempted more iterations than allowed */
  32. #define ENULLSLOPE       -3   /* Function derivative is 0        */
  33. #define ENOPARAB3        -4   /* No parabola fitting three given points    */
  34. #define WCPLXROOTS       -5   /* Possible complex roots            */
  35. #define EYSAMESIGN       -6   /* f(x1) and f(x2) same sign        */
  36. #define EMAXITERLT0      -7   /* Max nubr of allowed iterations l.e. 0    */
  37. #define ENOPXINTERSECT   -8   /* No parabola intersect with x axis    */
  38. #define EDIMLT0          -9   /* Array dimension lower than 0        */
  39. #define EMATSING           -10   /* Singular matrix            */
  40. #define EDIMLE0            -11   /* Array dimension lower than-equal to 0  */
  41. #define ENOFITPARAB       -12   /*            *** RESERVED ***            */
  42. #define E0DIVIDE      -13   /* Attempted 0 divide            */
  43. #define EDEGLT2        -14   /* Degree lower than or equal to 2    */
  44. #define ENOWCORE    -15   /* Not enough working core        */
  45. #define EDEGLE0        -16   /* Degree lower than or equal to 0    */
  46. #define ENUMINTLE0    -17   /* Number of intervals l.e. 0        */
  47. #define ELOGLE0        -18   /* Attempted compute log a negative real    */
  48. #define ENDPTSLT2    -19   /* One or less data points given (lsq)    */
  49. #define ENTRMLT1    -20   /* Less than one term asked              */
  50. #define ENDTPTLTNTRMS    -21   /* Less data points than terms asked (lsq)*/
  51. #define ENOSOL        -22   /* No solution                */
  52. #define E0MATDIAG    -23   /* Matrix diagonal contains 0s        */
  53. #define WNODIAGDOM    -24   /* Not a diagonal dominant matrix        */
  54. #define EMATNOTSYM    -25   /* Not a symmetric matrix             */
  55. #define ELBDGEUBD    -26   /* Lower bound g.e. than upper bound    */
  56. #define ETOLNR        -27   /* Tolerance not reached            */
  57. #define ENTRMGTNINT    -28   /* Less intervals than asked terms    */
  58. #define ENOTLINDIFEQ    -29   /* Not a linear differential equation    */
  59.  
  60.  
  61. /* Public types */
  62.  
  63.  
  64. typedef struct complex COMPLEX;
  65.  
  66. typedef enum {expolsq, fourierlsq, loglsq, polylsq, powerlsq, xpowerlsq}
  67.         lsqfit;
  68.  
  69. typedef enum {FALSE, TRUE} bool;
  70.  
  71.  
  72. /*    Now the provided routines     */
  73. /*    C-C++ compatibility hack      */
  74.  
  75. #ifdef __cplusplus
  76. extern "C" {
  77. #endif
  78.  
  79.  
  80. /*
  81.  **********************************************************************
  82.  **
  83.  **
  84.  **    Reserved functions
  85.  **    ******************
  86.  **
  87.  **
  88.  **
  89.   */
  90.  
  91.  
  92.   bool cdecl ctestroot(COMPLEX, COMPLEX, COMPLEX, double);
  93.  
  94.   void cdecl checkslope(double, int *);
  95.  
  96.   bool cdecl iseq0(double);
  97.  
  98.   bool cdecl isinfinite(double);
  99.  
  100.   void cdecl rowmultadd(int ,
  101.                double *,
  102.                double ,
  103.                int , int );
  104.  
  105.   bool cdecl rtestroot(double, double, double, double);
  106.  
  107.   bool cdecl islt0(double);
  108.  
  109.   bool cdecl isle0(double);
  110.  
  111.   bool cdecl isgt0(double);
  112.  
  113.   bool cdecl isge0(double);
  114.  
  115.  
  116.  
  117.  
  118. /*
  119.  **********************************************************************
  120.  **
  121.  **
  122.  **    Functions in module FCOMPLEX
  123.  **    ****************************
  124.  **
  125.  **
  126.  **
  127.   */
  128.  
  129.  
  130.  
  131.  
  132. /*    void conjugue(COMPLEX z1, COMPLEX *z2)
  133.  *
  134.  *    This function calculates a-ib if z=a+ib
  135.  *
  136.  *    Input parameters:
  137.  *    ----------------
  138.  *    z1 : a + ib
  139.  *
  140.  *    Output parameters:
  141.  *    -----------------
  142.  *    z2 : a - ib
  143.  */
  144.   void cdecl conjugue(COMPLEX, COMPLEX *);
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151. /*    double modulus(COMPLEX z)
  152.  *
  153.  *    This function calculates the modulus of a complex number.
  154.  *
  155.  *    Input parameters:
  156.  *    ----------------
  157.  *    z : complex operand.
  158.  *
  159.  *    Returns: value of the modulus
  160.  */
  161.   double cdecl modulus(COMPLEX);
  162.  
  163.  
  164.  
  165.  
  166.  
  167. /*    double carg(COMPLEX z)
  168.  *
  169.  *
  170.  *    This function  returns  the  characteristic  angle  of  a
  171.  *    complex number.
  172.  *
  173.  *    Input parameters:
  174.  *    ----------------
  175.  *    z : complex number
  176.  *
  177.  *
  178.  *    Returns : the value of the angle.
  179.  *
  180.  *
  181.  *     Notes : carg(0) = PI/2 (convention)
  182.  */
  183.   double cdecl carg(COMPLEX);
  184.  
  185.  
  186.  
  187. /*
  188.  *    void cadd(COMPLEX z1, COMPLEX z2, COMPLEX *z3)
  189.  *
  190.  *    This function performs the addition of two complex numbers.
  191.  *
  192.  *    Input parameters:
  193.  *    ----------------
  194.  *    z1 : First operand.
  195.  *    z2 : Second operand.
  196.  *
  197.  *    Output parameters:
  198.  *    -----------------
  199.  *    z3 : = z1+z2
  200.  */
  201.   void cdecl cadd(COMPLEX, COMPLEX, COMPLEX *);
  202.  
  203.  
  204.  
  205.  
  206. /*    void csub(COMPLEX z1, COMPLEX z2, COMPLEX *z3)
  207.  *
  208.  *    This function performs complex substraction.
  209.  *
  210.  *    Input parameters:
  211.  *    ----------------
  212.  *    z1 : First complex operand.
  213.  *    z2 : Second complex operand.
  214.  *
  215.  *    Output parameters:
  216.  *    -----------------
  217.  *    z3 : = z1 - z3.
  218.  */
  219.   void cdecl csub(COMPLEX, COMPLEX, COMPLEX *);
  220.  
  221.  
  222.  
  223. /*    void cmult(COMPLEX z1, COMPLEX z2,
  224.  *        COMPLEX *z3)
  225.  *
  226.  *    This function performs complex multiplication.
  227.  *
  228.  *    Input parameters:
  229.  *    ----------------
  230.  *    z1 : First complex operand.
  231.  *    z2 : Second complex operand.
  232.  *
  233.  *    Output parameters:
  234.  *    -----------------
  235.  *    z3 : = z2 x z3
  236.  */
  237.   void cdecl cmult(COMPLEX, COMPLEX, COMPLEX *);
  238.  
  239.  
  240.  
  241.  
  242. /*    void rmult(double lambda, COMPLEX *z)
  243.  *
  244.  *    This function performs multiplication. of a complex number
  245.  *    by a real.
  246.  *
  247.  *    Input parameters:
  248.  *    ----------------
  249.  *    lambda    : Real multiplier.
  250.  *    z    : complex operand.
  251.  *
  252.  *    Output parameters:
  253.  *    -----------------
  254.  *    z    : = lambda * z
  255.  */
  256.   void cdecl rmult(double, COMPLEX *);
  257.  
  258.  
  259.  
  260.  
  261.  
  262. /*    void cdiv(COMPLEX z1, COMPLEX z2,
  263.  *          COMPLEX *z3, int *errcode)
  264.  *
  265.  *    This functions performs complex division.
  266.  *
  267.  *    Input parameters:
  268.  *    ----------------
  269.  *    z1 : complex number to be divided.
  270.  *    z2 : complex number to divide by.
  271.  *
  272.  *    Output parameters:
  273.  *    -----------------
  274.  *    z3    : = z1/z3.
  275.  *    errcode : possible error code.
  276.  *
  277.  *    Possible error codes:
  278.  *    --------------------
  279.  *    E0DIVIDE
  280.  */
  281.   void cdecl cdiv(COMPLEX, COMPLEX, COMPLEX *, int *);
  282.  
  283.  
  284.  
  285.  
  286.  
  287. /*  void cpow(COMPLEX z1, int n, COMPLEX *z2)
  288.  *
  289.  *    This function performs a complex power evelation.
  290.  *
  291.  *    Input parameters:
  292.  *    ----------------
  293.  *    z1 : complex to elevate
  294.  *    n : value of the power
  295.  *
  296.  *    Output parameters:
  297.  *    -----------------
  298.  *    z2 : z1**n
  299.  */
  300.   void cdecl cpow(COMPLEX, int, COMPLEX *);
  301.  
  302.  
  303.  
  304.  
  305. /*    void csqrt(COMPLEX z1, COMPLEX *z2)
  306.  *
  307.  *    This function calculates a complex square root.
  308.  *
  309.  *    Input Parameters:
  310.  *    ----------------
  311.  *    z1 : complex operand
  312.  *
  313.  *    Output parameters:
  314.  *    -----------------
  315.  *    z2 : = z1**(1/2)
  316.  */
  317.   void cdecl csqrt(COMPLEX, COMPLEX *);
  318.  
  319.  
  320.  
  321.  
  322. /*    void rassign(double lambda, COMPLEX *z)
  323.  *
  324.  *    This function assigns a real value to a complex number.
  325.  *
  326.  *    Input Parameters:
  327.  *    ----------------
  328.  *    lambda    : value to assign.
  329.  *
  330.  *    Output parameters:
  331.  *    -----------------
  332.  *    z    : = labda + 0i.
  333.  */
  334.   void cdecl rassign(double, COMPLEX *);
  335.  
  336.  
  337.  
  338.  
  339. /*    void cpoly(int degree,
  340.  *           COMPLEX *poly,
  341.  *           COMPLEX z,
  342.  *           COMPLEX *y, *yderiv, COMPLEX *yderiv2,
  343.  *           int *errcode)
  344.  *
  345.  *    This  function   computes  the   values  of  the  complex
  346.  *    polynomial poly, and of its first and second derivatives at a
  347.  *    given point.
  348.  *
  349.  *    Input parameters:
  350.  *    ----------------
  351.  *    degree     : degree of the polynomial
  352.  *    poly     : pointer to the coefficients of the polynomial
  353.  *    z     : value of the point at which omputation must be performed
  354.  *
  355.  *    Output parameters:
  356.  *    -----------------
  357.  *    y     : = poly(z)
  358.  *    yderiv     : = poly'(z)
  359.  *    yderiv2 : = poly"(z)
  360.  *    errcode : possible error code.
  361.  *
  362.  *    Possible error codes:
  363.  *    --------------------
  364.  *    ENOWCORE
  365.  */
  366.   void cpoly(int,
  367.          COMPLEX *,
  368.          COMPLEX,
  369.          COMPLEX *, COMPLEX *, COMPLEX *,
  370.          int *);
  371.  
  372.  
  373.  
  374. /*    void cpoly2_solve(COMPLEX *poly,
  375.  *        COMPLEX *root1, COMPLEX *root2)
  376.  *
  377.  *    This function  solves a  second degree complex polynomial
  378.  *    equation.
  379.  *
  380.  *    Input parameters:
  381.  *    ----------------
  382.  *    poly : complex second degree polynome.
  383.  *
  384.  *    Output parameters:
  385.  *    -----------------
  386.  *    root1 : first root.
  387.  *    root2 : second root.
  388.  */
  389.   void cpoly2_solve(COMPLEX *,
  390.         COMPLEX *, COMPLEX *);
  391.  
  392.  
  393.  
  394.  
  395. /*    void cpoly_one_root(int degree,
  396.  *        COMPLEX *poly,
  397.  *        COMPLEX z0,
  398.  *        double tol,
  399.  *        int maxiter,
  400.  *        COMPLEX *zroot, COMPLEX *yroot,
  401.  *        int *iter, int *errcode)
  402.  *
  403.  *    This  function   approximates  a   root  of   a   complex
  404.  *    polynomial.
  405.  *
  406.  *    Input parameters:
  407.  *    ----------------
  408.  *    degree     : degree of the polynomial
  409.  *    poly     : pointer to the coefficients of the polynomial
  410.  *    z0     : value of the root guess
  411.  *    tol     : tolerance used for convergence test.
  412.  *    maxiter : maximum number of allowed iterations
  413.  *
  414.  *    Output parameters:
  415.  *    -----------------
  416.  *    zroot     : value of the root if found
  417.  *    yroot     : = poly(zroot)
  418.  *    iter    : actual  number  of  iterations  the  algorithm  went
  419.  *          through.
  420.  *    errcode : possible error code.
  421.  *
  422.  *    Possible error codes:
  423.  *    --------------------
  424.  *    ENOWCORE
  425.  *    E0DIVIDE
  426.  *    EOVERMAXITER
  427.  */
  428.   void cpoly_one_root(int,
  429.         COMPLEX *,
  430.         COMPLEX,
  431.         double,
  432.         int,
  433.         COMPLEX *, COMPLEX *,
  434.         int *, int *);
  435.  
  436.  
  437.  
  438.  
  439. /*  void cpoly_reduce(int *degree, COMPLEX *poly, COMPLEX zroot,
  440.  *    int *errcode)
  441.  *
  442.  *
  443.  *    This function  reduces the degree of a complex polynomial
  444.  *    by factoring out one of its given root.
  445.  *
  446.  *    Input parameters:
  447.  *    ----------------
  448.  *    degree : degree of the polynomial
  449.  *    poly   : pointer to the coefficients of the polynomial
  450.  *    zroot  : value of the root
  451.  *
  452.  *    Output parameters:
  453.  *    -----------------
  454.  *    errcode : possible error code.
  455.  *
  456.  *    Possible error codes:
  457.  *    --------------------
  458.  *    ENOWCORE
  459.  */
  460.   void cpoly_reduce(int *,
  461.     COMPLEX *,
  462.     COMPLEX,
  463.     int *);
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475. /*
  476.  **********************************************************************
  477.  **
  478.  **
  479.  **
  480.  **    Equation solving functions
  481.  **    ==========================
  482.  **
  483.  **
  484.  **
  485.  */
  486.  
  487.  
  488. /*     void newton_raphson(double x0, double tol,
  489.  *        int maxiter,
  490.  *        double *root, double *yroot, double *deriv,
  491.  *        int *iter, int *errcode,
  492.  *        double f(double t), double fprime(double t))
  493.  *
  494.  *    This routine  solves a  real equation  f(x)=0  using  the
  495.  *    general Newton algorithm (more often called Newton-Raphson).
  496.  *
  497.  *    Input parameters:
  498.  *    ----------------
  499.  *    x0     : Approximate value of the solution.
  500.  *    tol     : Tolerance used for convergence tests.
  501.  *    maxiter : Maximum number of allowed iterations.
  502.  *    f    : function defining the equation.
  503.  *    fprime    : first derivate of f.
  504.  *
  505.  *    Output parameters:
  506.  *    -----------------
  507.  *    roots     : Value of the root, if found.
  508.  *    yroot    : = f(root)
  509.  *    deriv     : = fprime(root).
  510.  *    iter    :  Number of  iterations the  algorithm  actually  went
  511.  *           through.
  512.  *    errcode : Error code.
  513.  *
  514.  *    Possible error codes:
  515.  *    --------------------
  516.  *    ETOLLE0
  517.  *    EMAXITERLT0
  518.  *    EOVERMAXITER
  519.  *    ENULLSLOPE
  520.  */
  521.   void cdecl newton_raphson(double, double,
  522.                int,
  523.                double *, double *, double *,
  524.                int *, int *,
  525.                double (*)(double), double (*)(double));
  526.  
  527.  
  528.  
  529.  
  530. /*
  531.  *    void bisect(double lb, double ub, double tol,
  532.  *        int maxiter,
  533.  *        double *root, double *value,
  534.  *        int *iter, int *errcode,
  535.  *        double f(double))
  536.  *
  537.  *    This function uses a dichotomic algorithm to find one root
  538.  *    of the equation f(x)=0 on a given interval.
  539.  *
  540.  *    Input parameters:
  541.  *    ----------------
  542.  *    lb : lower bound of the search interval
  543.  *    ub : upper bound of the search interval
  544.  *    f  : function of the equation.
  545.  *
  546.  *    Output parameters:
  547.  *    -----------------
  548.  *    root    : value of the root, if found.
  549.  *    value   : = f(root)
  550.  *    iter    : number of iterations taken the algorithm
  551.  *          actually went through.
  552.  *    errcode : possible error code.
  553.  *
  554.  *    Possible error codes:
  555.  *    --------------------
  556.  *    EYSAMESIGN
  557.  *    ETOLLE0
  558.  *    EMAXITERLT0
  559.  *    EOVERMAXITER
  560.  */
  561.   void cdecl bisect(double, double, double,
  562.            int,
  563.            double *, double *,
  564.            int    *, int *,
  565.            double (*)(double));
  566.  
  567.  
  568.  
  569.  
  570. /*    void secant(double x01, double x02, double tol,
  571.  *        int maxiter,
  572.  *        double *root, double *y,
  573.  *        int *iter, int *errcode,
  574.  *        double f(double t))
  575.  *
  576.  *    This function  solves a  real equation  f(x)=0 using  the
  577.  *    secant algorithm.
  578.  *
  579.  *    Input parameters:
  580.  *    ----------------
  581.  *    x01,x02    : Approximate values of the root.
  582.  *    tol    : Tolerance used for convergence tests.
  583.  *    maxiter : Maximum number of allowed iterations.
  584.  *    f    : function defining the equation.
  585.  *
  586.  *    Output parameters:
  587.  *    -----------------
  588.  *    root    : Found root, if any.
  589.  *    iter    : Actual number of iterations the algorithm went through.
  590.  *    y    : = f(root).
  591.  *    errcode    : Error code
  592.  *
  593.  *    Possible error codes:
  594.  *    --------------------
  595.  *    EYSAMESIGN
  596.  *    EMAXITERLT0
  597.  *    EOVERMAXITER
  598.  *    ETOLLE0
  599.  */
  600.   void cdecl secant(double, double, double,
  601.            int,
  602.            double *, double *,
  603.            int *, int *,
  604.            double (*)(double));
  605.  
  606.  
  607.  
  608. /*    void newton_horner(int degree0,
  609.  *        double *poly0,
  610.  *        double x0, double tol,
  611.  *        int maxiter,
  612.  *        int *degree, int *nbroots,
  613.  *        double *poly, double *roots, double *image,
  614.  *        double *value, double *deriv,
  615.  *        int *iter, int *errcode)
  616.  *
  617.  *    This function solves a real polynomial equation using the
  618.  *    Newton-Horner algoritm.
  619.  *
  620.  *    Input parameters:
  621.  *    ----------------
  622.  *    degree0 : Degree of the polynomial equation.
  623.  *    poly0 : Polynome defining the equation.
  624.  *    x0 : Approximate value of the solution.
  625.  *    tol : Tolerance used for convergence tests.
  626.  *    maxiter : Maximum number of allowed iterations.
  627.  *
  628.  *    Output parameters:
  629.  *    -----------------
  630.  *    degree     : Degree of the resulting polynome after treatment.
  631.  *    nbroots : Number of found roots
  632.  *    poly      : Resulting deflated polynome.
  633.  *    roots     : Array containing the values of the real parts of the
  634.  *          roots found so far.
  635.  *    image     : Array containing  the values of the imaginary parts
  636.  *          of the roots found so far.
  637.  *    value     : Array containing  the value  of poly0  at the found
  638.  *          roots.
  639.  *    deriv     : Array containing the value of the first derivate of
  640.  *          poly0 at the found roots.
  641.  *    iter      : Array  containing  the  number  of  iterations  the
  642.  *          algorithm actually went through for each found root.
  643.  *    errcode : Error code.
  644.  *
  645.  *    Possible error codes:
  646.  *    --------------------
  647.  *    ETOLLE0
  648.  *    EMAXITERLT0
  649.  *    EDEGLE0
  650.  *    EOVERMAXITER
  651.  *    ENULLSLOPE
  652.  */
  653.   void cdecl newton_horner(int,
  654.               double *,
  655.               double, double,
  656.               int,
  657.               int *, int *,
  658.               double *, double *, double *,
  659.               double *, double *,
  660.               int *, int *);
  661.  
  662.  
  663. /*    void muller(COMPLEX z0,
  664.  *        double tol,
  665.  *        int maxiter,
  666.  *        COMPLEX *root, COMPLEX *yroot,
  667.  *        int *iter, int *errcode,COMPLEX f(COMPLEX z))
  668.  *
  669.  *    This function  solves a  general complex  equation, using
  670.  *    the Müller's algorithm.
  671.  *
  672.  *    Input parameters:
  673.  *    ----------------
  674.  *    z0     : initial approximate value of the root.
  675.  *    tol     : tolerance used for convergence tests.
  676.  *    maxiter : maximum number of allowed iterations.
  677.  *    f    : function to solve.
  678.  *
  679.  *    Output parameters:
  680.  *    -----------------
  681.  *    root    : value of the complex root, if found.
  682.  *    yroot     : = f(root).
  683.  *    errcode : error code.
  684.  *
  685.  *    Possible error codes:
  686.  *    --------------------
  687.  *    EOVERMAXITER
  688.  *    ETOLLE0
  689.  *    EMAXITERLT0
  690.  *    ENOINTERSECT
  691.  *    ENOFITPARAB
  692.  */
  693.   void cdecl muller(COMPLEX ,
  694.            double ,
  695.            int ,
  696.            COMPLEX *, COMPLEX *,
  697.            int *, int *,COMPLEX (*)(COMPLEX));
  698.  
  699.  
  700.  
  701. /*    void laguerre (int degree,
  702.  *        COMPLEX *poly,
  703.  *        COMPLEX z0,
  704.  *        double tol,
  705.  *        int maxiter,
  706.  *        int *nbroot,
  707.  *        COMPLEX *roots,
  708.  *        COMPLEX *yroots,
  709.  *        int *errcode)
  710.  *
  711.  *    This function solves a complex polynome.
  712.  *
  713.  *    Input parameters:
  714.  *    ----------------
  715.  *    degree     : degree of the polynome.
  716.  *    poly     : polynome to solve.
  717.  *    z0    : initial guess of an actual root.
  718.  *    tol    : tolerance to use.
  719.  *    maxiter : maximum number of allowed iterations.
  720.  *
  721.  *    Output parameters:
  722.  *    -----------------
  723.  *    nbroot    : number of found roots.
  724.  *    roots    : array containing the found roots.
  725.  *    yroots    : array containing  the value of the polynome at the
  726.  *            found roots.
  727.  *    errcode : error code.
  728.  *
  729.  *    Possible error codes:
  730.  *    --------------------
  731.  *    ENOWCORE
  732.  *    EDEGLT2
  733.  *    EMAXITERLT0
  734.  *    EOVERMAXITER
  735.  */
  736.   void cdecl laguerre(int ,
  737.              COMPLEX *,
  738.              COMPLEX ,
  739.              double ,
  740.              int ,
  741.              int *,
  742.              COMPLEX *, COMPLEX *,
  743.              int *, int *);
  744.  
  745. /*    void steffensen(double x0, double tol,
  746.  *        int maxiter,
  747.  *        double *root, double *value,
  748.  *        int *iter, int *errcode,
  749.  *        double f(double t))
  750.  *
  751.  *    This  function   finds  the  root  of  f(x)=0  using  the
  752.  *    steffensen algorithm.
  753.  *
  754.  *    Input parameters:
  755.  *    ----------------
  756.  *    x0    : Approximate value of the root.
  757.  *    tol    : tolerance to be used as stp criteria.
  758.  *    f    : function to solve.
  759.  *
  760.  *    Output parameters:
  761.  *    -----------------
  762.  *    root    : value of the found root.
  763.  *    value    : =f(root).
  764.  *    iter    :  number of  iterations  the  algorith  actually  went
  765.  *            through.
  766.  *    errcode : error code.
  767.  *
  768.  *    Possible error codes:
  769.  *    --------------------
  770.  *    E0DIVIDE
  771.  *    EOVERMAXITER
  772.  */
  773.   void cdecl steffensen(double, double ,
  774.                int ,
  775.                double *, double *,
  776.                int *, int *,
  777.                double (*)(double));
  778.  
  779.  
  780.  
  781.  
  782. /*
  783.  **********************************************************************
  784.  **
  785.  **
  786.  **
  787.  **    Elementary matrix routines
  788.  **    ==========================
  789.  **
  790.  **
  791.  **
  792.  */
  793.  
  794.  
  795. /*    void swap_rows(int dim, double *mat, int nrow1, int nrow2,
  796.  *    int *errcode)
  797.  *
  798.  *    This routine exchanges two rows of a square matrix.
  799.  *
  800.  *    Input parameters:
  801.  *    ----------------
  802.  *    dim         : Order of the matrix.
  803.  *    mat         : Matrix to be treated.
  804.  *    nrow1, nrow2     : indexes of the given rows (1 to n)
  805.  *
  806.  *    Output parameters:
  807.  *    -----------------
  808.  *    mat     : treated matrix.
  809.  *    errcode : Error code.
  810.  *
  811.  *    Possible error codes:
  812.  *    --------------------
  813.  *    ENOWCORE
  814.  */
  815.   void cdecl swap_rows(int,
  816.               double *,
  817.               int, int ,
  818.               int *);
  819.  
  820.  
  821.  
  822. /*    void row_mat_div(int dim,
  823.  *        double *mat,
  824.  *        double lambda,
  825.  *        int nrow,
  826.  *        int *errcode)
  827.  *    This function divides a given row of a square matrix by a
  828.  *    given constant.
  829.  *
  830.  *    Input parameters:
  831.  *    ----------------
  832.  *    dim    : Order of the matrix.
  833.  *    mat    : Points to the matrix.
  834.  *    lambda    : The real constant.
  835.  *    nrow    : Row index (1 to dim).
  836.  *
  837.  *    Output parameters:
  838.  *    -----------------
  839.  *    errcode : Error code.
  840.  *
  841.  *    Possible error codes:
  842.  *    --------------------
  843.  *    E0DIVIDE
  844.  */
  845.   void cdecl row_mat_div(int,
  846.             double *,
  847.             double,
  848.             int,
  849.             int *);
  850.  
  851.  
  852.  
  853.  
  854. /*    void slargest_vect(int dim, double *vect, double *res)
  855.  *
  856.  *    This function finds the largest element in a vector.
  857.  *
  858.  *    Input parameters:
  859.  *    ----------------
  860.  *    dim : dimension of the vector.
  861.  *    vect : vector.
  862.  *
  863.  *    Output parameters:
  864.  *    -----------------
  865.  *    res : result.
  866.  */
  867.   void cdecl slargest_vect(int,
  868.               double *,
  869.               double *);
  870.  
  871.  
  872.  
  873.  
  874.  
  875. /*    void rdiv_vect(int dim,
  876.  *        double *vect,
  877.  *        double lambda,
  878.  *        int *errcode)
  879.  *
  880.  *    This  function  allows  to  divide  all  the  coordinates
  881.  *    composing a vector by a real constant
  882.  *
  883.  *    Input parameters:
  884.  *    ----------------
  885.  *    dim    : vector dimension.
  886.  *    vect    : pointer to an array containing the vector.
  887.  *    lambda    : divider.
  888.  *
  889.  *    Output parameters:
  890.  *    -----------------
  891.  *    vect    : resulting vector.
  892.  *    errcode    : error code.
  893.  *
  894.  *    Possible error codes:
  895.  *    --------------------
  896.  *    E0DIVIDE
  897.  *    EDIMLE0
  898.  */
  899.   void cdecl rdiv_vect(int,
  900.               double *,
  901.               double ,
  902.               int *);
  903.  
  904.  
  905.  
  906.  
  907. /*    void mult_mat_vect(int dim, double *mat,
  908.  *        double *vect, double *res, int *errcode)
  909.  *
  910.  *    This function multiplies a square matrix by vector.
  911.  *
  912.  *    Input parameters:
  913.  *    ----------------
  914.  *    dim    : Order of the matrix (= vector dimension)
  915.  *    mat    : Matrix.
  916.  *    vect    : Vector.
  917.  *
  918.  *    Output parameters:
  919.  *    -----------------
  920.  *    res    : Resulting vector.
  921.  *    errcode : Error code.
  922.  *
  923.  *    Possible error codes:
  924.  *    --------------------
  925.  *    EDIMLE0
  926.  */
  927.   void cdecl mult_mat_vect(int ,
  928.               double *, double *, double *,
  929.               int *);
  930.  
  931.  
  932.  
  933.  
  934.  
  935.  
  936. /*    double mult_vect_vect(int dim,
  937.  *              double *v1, double *v2)
  938.  *
  939.  *    This routine computes the scalar product of two vectors.
  940.  *
  941.  *    Input parameters:
  942.  *    ----------------
  943.  *    dim    : Order of the vectors.
  944.  *    v1,v2    : Pointers to arrays containing the vectors.
  945.  *
  946.  *    Returns: the scalar product.
  947.  */
  948.  
  949.   double cdecl mult_vect_vect(int ,
  950.                  double *, double *);
  951.  
  952.  
  953.  
  954.  
  955.  
  956. /*    void trans_size_system(int dim1, double *m1, int dim2,
  957.  *        double *m2)
  958.  *
  959.  *    This function  converts a  matrix of  a  given  order  to
  960.  *    another one.
  961.  *
  962.  *    Input parameters:
  963.  *    ----------------
  964.  *    dim1    : order of the initial matrix.
  965.  *    m1    : initial Matrix to be treated.
  966.  *    dim2    : order of the target matrix
  967.  *
  968.  *    Output parameters:
  969.  *    -----------------
  970.  *    m2    : target matrix
  971.  *
  972.  *    Note:
  973.  *    ----
  974.  *    If dim2>dim1 the rest of the m2 will be completed by zeroes,
  975.  *    If dim2<dim1 the  dim1-dim2th columns  and rows  of  the
  976.  *        matrix m1 will be lost in m2.
  977.  */
  978.   void cdecl trans_size_system(int,
  979.                   double *,
  980.                   int,
  981.                   double *);
  982.  
  983.  
  984.  
  985.  
  986. /*    bool ismatsym(int dim,
  987.  *        double *mat,
  988.  *        int *errcode)
  989.  *
  990.  *
  991.  *
  992.  *    This function  determinates if  a matrix  is symmetric or
  993.  *    not.
  994.  *
  995.  *    Input parameters:
  996.  *    ----------------
  997.  *    dim    : Order of the matrix.
  998.  *    mat    : matrix to examine.
  999.  *
  1000.  *    Output parameters:
  1001.  *    -----------------
  1002.  *    errcode : error code
  1003.  *
  1004.  *    Returns : TRUE or FALSE
  1005.  *
  1006.  *    Possible error codes :
  1007.  *    EDIMLE0
  1008.  */
  1009.   bool cdecl ismatsym(int,
  1010.              double *,
  1011.              int *);
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021. /*
  1022.  **********************************************************************
  1023.  **
  1024.  **
  1025.  **    Linear algebra functions
  1026.  **    ========================
  1027.  **
  1028.  **
  1029.  **
  1030.   */
  1031.  
  1032. /*    void determinant(int dim,
  1033.  *        double *mat0,double *det,
  1034.  *        int *errcode)
  1035.  *
  1036.  *    This function  calculates the  determinant  of  a  square
  1037.  *    matrix.
  1038.  *
  1039.  *    Input parameters:
  1040.  *    ----------------
  1041.  *    dim     : order of the matrix.
  1042.  *    mat0     : matrix the determinant of which will be calculated.
  1043.  *
  1044.  *    Output parameters:
  1045.  *    -----------------
  1046.  *    det     : value of the calculated determinant.
  1047.  *    errcode : error code.
  1048.  *
  1049.  *    Possible error codes:
  1050.  *    --------------------
  1051.  *    EDIMLE0
  1052.  *    ENOWCORE
  1053.  */
  1054.   void cdecl determinant(int,
  1055.             double *, double *,
  1056.             int *);
  1057.  
  1058.  
  1059.  
  1060.  
  1061. /*    void inverse(int dim,
  1062.  *        double *mat0,
  1063.  *        double *invmat,
  1064.  *        int *errcode)
  1065.  *
  1066.  *    This routine inverts a square matrix
  1067.  *
  1068.  *    Input parameters:
  1069.  *    ----------------
  1070.  *    dim    : order of the matrix to invert.
  1071.  *    mat0    : matrix to invert
  1072.  *
  1073.  *    Output parameters:
  1074.  *    -----------------
  1075.  *    invmat    : inverted matrix.
  1076.  *    errcode : error code.
  1077.  *
  1078.  *    Possible error codes:
  1079.  *    --------------------
  1080.  *    EDIMLE0
  1081.  *    EMATSING
  1082.  *    ENOWCORE
  1083.  */
  1084.   void cdecl inverse(int,
  1085.             double *,
  1086.             double *,
  1087.             int *);
  1088.  
  1089.  
  1090. /*    void gauss_elimination(int dim,
  1091.  *        double *mat_A,
  1092.  *        double *vect_B,
  1093.  *        double *vect_X,
  1094.  *        int *errcode)
  1095.  *
  1096.  *    This  routine   solves  a  linear  system  (A*X=B)  using
  1097.  *    gaussian elimination.
  1098.  *
  1099.  *    Input parameters:
  1100.  *    ----------------
  1101.  *    dim    : order of the matrix.
  1102.  *    mat_A    : matrix A
  1103.  *    vect_B    : second member vector B
  1104.  *
  1105.  *    Output parameters:
  1106.  *    -----------------
  1107.  *    vect_X    : solution vector X.
  1108.  *    errcode : error code.
  1109.  *
  1110.  *    Possible error codes:
  1111.  *    --------------------
  1112.  *    EDIMLE0
  1113.  *    ENOSOL
  1114.  *    EMATSING
  1115.  */
  1116.   void cdecl gauss_elimination(int ,
  1117.                   double *,
  1118.                   double *, double *,
  1119.                   int *);
  1120.  
  1121.  
  1122.  
  1123.  
  1124. /*    void partial_pivot(int dim,
  1125.  *        double *mat_A,
  1126.  *        double *vect_B,
  1127.  *        double *vect_X,
  1128.  *        int *errcode)
  1129.  *
  1130.  *    This function  solves a  linear system  (AxX=B) using the
  1131.  *    partial pivoting algorithm.
  1132.  *
  1133.  *    Input parameters:
  1134.  *    ----------------
  1135.  *    dim    : order of matrix A.
  1136.  *    mat_A    : matrix A.
  1137.  *    vect_B    : second member vector B.
  1138.  *
  1139.  *    Output parameters:
  1140.  *    -----------------
  1141.  *    vect_X    : solution vector X.
  1142.  *    errcode    : Error code.
  1143.  *
  1144.  *    Possible error codes:
  1145.  *    --------------------
  1146.  *    EDIMLE0
  1147.  *    EMATSING
  1148.  *    ENOWCORE
  1149.  */
  1150.   void cdecl partial_pivot(int,
  1151.               double *,
  1152.               double *, double *,
  1153.               int *);
  1154.  
  1155.  
  1156.  
  1157.  
  1158. /*    void lu_decompose(int dim,
  1159.  *        double *mat_A,
  1160.  *        double *decomp, double *matperm,
  1161.  *        int *errcode)
  1162.  *
  1163.  *    This function performs LU decomposition in order to solve
  1164.  *    several  linear  systems  having  the  same  matrix  (AxX=B,
  1165.  *    AxX'=B', AxX"=B", ...) with the lu_solve function.
  1166.  *
  1167.  *    Input parameters:
  1168.  *    ----------------
  1169.  *    dim    : order of the matrix.
  1170.  *    mat_A    : matrix A.
  1171.  *
  1172.  *    Output parameters:
  1173.  *    -----------------
  1174.  *    decomp, matperm : matrices  to be  passed as  arguments  to
  1175.  *                lu_solve..
  1176.  *    errcode        : error code.
  1177.  *
  1178.  *    Possible error codes:
  1179.  *    --------------------
  1180.  *    EDIMLE0
  1181.  *    ENOWCORE
  1182.  *    EMATSING
  1183.  */
  1184.   void cdecl lu_decompose(int ,
  1185.              double *, double *, double *,
  1186.              int *);
  1187.  
  1188.  
  1189.  
  1190.  
  1191. /*    void lu_solve(int dim,
  1192.  *        double *decomp,
  1193.  *        double *vect_B,
  1194.  *        double *matperm,
  1195.  *        double *vect_X,
  1196.  *        int *errcode)
  1197.  *
  1198.  *    This function  solves a  linear system (AxX=B) the matrix
  1199.  *    of which has been previously processed with lu_decompose.
  1200.  *
  1201.  *    Input parameters:
  1202.  *    ----------------
  1203.  *    dim    : order of the matrix A.
  1204.  *    decomp    : matrix resulting from the call to lu_decompose.
  1205.  *    vect_B    : Second member vector B.
  1206.  *    matperm : matrix resulting from the call to lu_decompose.
  1207.  *
  1208.  *    Output parameters:
  1209.  *    -----------------
  1210.  *    vect_X    : solution vector X.
  1211.  *    errcode : error code.
  1212.  *
  1213.  *    Possible error codes:
  1214.  *    --------------------
  1215.  *    EDIMLE0
  1216.  *    ENOWCORE
  1217.  */
  1218.   void cdecl lu_solve(int ,
  1219.              double *, double *, double *, double *,
  1220.              int *);
  1221.  
  1222.  
  1223.  
  1224.  
  1225. /*    void gauss_seidel(int dim,
  1226.  *        double *mat_A,
  1227.  *        double *vect_B,
  1228.  *        double tol,
  1229.  *        int maxiter,
  1230.  *        double *vect_X,
  1231.  *        int *iter, int *errcode)
  1232.  *
  1233.  *    This routine  solves a  linear system  (A*X=B) using  the
  1234.  *    Gauss Seidel iterative algorithm.
  1235.  *
  1236.  *    Input parameters:
  1237.  *    ----------------
  1238.  *    dim     : order of the matrix to invert.
  1239.  *    mat_A     : matrix A
  1240.  *    vect_B     : second member vector B
  1241.  *    tol     : tolerance used for convergence test
  1242.  *    maxiter : maximum number of allowed iterations
  1243.  *
  1244.  *    Output parameters:
  1245.  *    -----------------
  1246.  *    vect_X     : solution vector X.
  1247.  *    iter     : actual number of performed iterations
  1248.  *    errcode : error code.
  1249.  *
  1250.  *    Possible error codes:
  1251.  *    --------------------
  1252.  *    EDIMLE0
  1253.  *    ENOWCORE
  1254.  *    EOVERMAXITER
  1255.  *    WNODIAGDOM
  1256.  *    ETOLLE0
  1257.  *    EDIMLE0
  1258.  *    EMAXITERLE0
  1259.  *    E0MATDIAG
  1260.  *    ENOSOL
  1261.  *    EMATSING
  1262.  */
  1263.   void cdecl gauss_seidel(int ,
  1264.              double *, double *,
  1265.              double ,
  1266.              int ,
  1267.              double *,
  1268.              int *, int *);
  1269.  
  1270.  
  1271.  
  1272.  
  1273.  
  1274.  
  1275.  
  1276. /*
  1277.  **********************************************************************
  1278.  **
  1279.  **
  1280.  **    Eigen values and vectors routines set
  1281.  **    =====================================
  1282.  **
  1283.  **
  1284.  **
  1285.   */
  1286.  
  1287.  
  1288.  
  1289. /*    void eigen_power(int dim,
  1290.  *        double *mat,
  1291.  *        double *vect0,
  1292.  *        int maxiter,
  1293.  *        double tol,
  1294.  *        double *eigenval, double *eigenvect,
  1295.  *        int *iter, int *errcode)
  1296.  *
  1297.  *    This function  computes  the  dominant  eigenvalue  of  a
  1298.  *    square matrix.
  1299.  *
  1300.  *    Input parameters:
  1301.  *    ----------------
  1302.  *    dim : Order of the matrix
  1303.  *    mat : Matrix
  1304.  *    vect0 : Approximate value of the eigenvector.
  1305.  *    maxiter : Maximum number of iterations to perform.
  1306.  *    tol : tolerance used for convergence test.
  1307.  *
  1308.  *    Output parameters:
  1309.  *    -----------------
  1310.  *    eigenval     : Computed eigenvalue.
  1311.  *    eigenvect     : Computed eigenvector.
  1312.  *    iter          : Actual  number  of  iterations  the  algorith  went
  1313.  *              through.
  1314.  *    errcode : Error code.
  1315.  *
  1316.  *    Possible error codes:
  1317.  *    --------------------
  1318.  *    EDIMLE0
  1319.  *    ETOLLE0
  1320.  *    EMAXITERLT0
  1321.  *    E0DIVIDE
  1322.  *    ENOWCORE
  1323.  *
  1324.  *    Note:
  1325.  *    ----
  1326.  *    This algoritm  will not converge if vect0 happens
  1327.  *    to be orthogonal to the actual result.
  1328.  */
  1329.   void cdecl eigen_power(int,
  1330.             double *,
  1331.             double *,
  1332.             int,
  1333.             double,
  1334.             double*, double *,
  1335.             int *, int *);
  1336.  
  1337.             /* This algorithm will not converge *
  1338.              * if the approximate eigenvalue    *
  1339.              * is orthogonal to the actual      *
  1340.              * dominant one              */
  1341.  
  1342.  
  1343.  
  1344. /*    void jacobi(int dim,
  1345.  *        double *mat,
  1346.  *        int maxiter,
  1347.  *        double tol,
  1348.  *        double *eval, double *evect,
  1349.  *        int *iter, int *errcode)
  1350.  *
  1351.  *    This function  computes the  eigen vectors  and the eigen
  1352.  *    values of  a symmetric  matrix using  the Jacobi's rotations
  1353.  *    algorithm.
  1354.  *
  1355.  *    Input parameters:
  1356.  *    ----------------
  1357.  *    dim     : Order of the matrix.
  1358.  *    mat     : Matrix.
  1359.  *    maxiter : maximum number of allowed iterations.
  1360.  *    tol     : tolerance used in convergence tests.
  1361.  *
  1362.  *    Output parameters:
  1363.  *    -----------------
  1364.  *    eval     : computed eigen values.
  1365.  *    evect     : computed eigen vectors.
  1366.  *    errcode : error code.
  1367.  *
  1368.  *    Possible error codes:
  1369.  *    --------------------
  1370.  *    EDIMLE0
  1371.  *    ETOLLE0
  1372.  *    EMAXITERLT0
  1373.  *    EOVERMAXITER
  1374.  *    EMATNOTSYM
  1375.  */
  1376.   void cdecl jacobi(int,
  1377.            double *,
  1378.            int ,
  1379.            double,
  1380.            double *, double *,
  1381.            int *, int *);
  1382.  
  1383.  
  1384.  
  1385.  
  1386. /*    void le_verrier(int dim,
  1387.  *        double *mat,
  1388.  *        double *poly,
  1389.  *        int *errcode)
  1390.  *
  1391.  *    This function compute the characteristic polynome of a
  1392.  *    square matrix.
  1393.  *
  1394.  *    Input parameters:
  1395.  *    ----------------
  1396.  *    dim    : Order of the matrix.
  1397.  *    mat    : matrix
  1398.  *
  1399.  *    Output parameters:
  1400.  *    -----------------
  1401.  *    poly    : characteristic polynomial.
  1402.  *    errcode    : error code.
  1403.  *
  1404.  *    Possible error codes:
  1405.  *    --------------------
  1406.  *    ENOWCORE
  1407.  */
  1408.   void cdecl le_verrier(int,
  1409.                double *,
  1410.                double *,
  1411.                int *);
  1412.  
  1413.  
  1414.  
  1415. /*    void eigen_vect(int dim,
  1416.  *        double *mat,
  1417.  *        int nbeval,
  1418.  *        double *eval,
  1419.  *        double *evect,
  1420.  *        int *errcode)
  1421.  *
  1422.  *    This function  computes  the  eigenvectors  of  a  square
  1423.  *    matrix, the corresponding eigen values of which are known.
  1424.  *
  1425.  *    Input parameters:
  1426.  *    ----------------
  1427.  *    dim    : Order of the matrix
  1428.  *    mat    : Matrix
  1429.  *    nbeval    : Number of given eigen values.
  1430.  *    eval    : Pointer to an array containing known eigen values
  1431.  *
  1432.  *    Output parameters:
  1433.  *    -----------------
  1434.  *    evect    : Computed eigenvectors.
  1435.  *    errcode : Error code.
  1436.  *
  1437.  *    Possible error codes:
  1438.  *    --------------------
  1439.  *    EDIMLE0
  1440.  *    E0DIVIDE
  1441.  *    ENOWCORE
  1442.  *
  1443.  *    Note:
  1444.  *    -----
  1445.  *    This algoritm  will not converge if vect0 happens
  1446.  *    to be orthogonal to the actual result.
  1447.  */
  1448.   void cdecl eigen_vect(int,
  1449.                double *,
  1450.                int,
  1451.                double *,
  1452.                double *,
  1453.                int *);
  1454.  
  1455.  
  1456.  
  1457. /*    void householder_givens(int dim,
  1458.  *        double *mat,
  1459.  *        int nbeval,
  1460.  *        double *eval,
  1461.  *        int *errcode)
  1462.  *
  1463.  *    This routine computes a given number of eigen values of a
  1464.  *    symmetric matrix using the the Householder Givens algorithm.
  1465.  *    (It is  an adaptation of the version written by J. Ortega in
  1466.  *    the 1960's for the IBM 7094).
  1467.  *
  1468.  *    Input parameters:
  1469.  *    ----------------
  1470.  *    dim     : order of the matrix.
  1471.  *    mat     : matrix
  1472.  *    nbeval     : number of eigen values to be computed.
  1473.  *
  1474.  *    Output parameters:
  1475.  *    -----------------
  1476.  *    eval     : computed eigen values
  1477.  *    errcode : error code.
  1478.  *
  1479.  *    Possible error codes:
  1480.  *    --------------------
  1481.  *    EDIMLE0
  1482.  *    ENOWCORE
  1483.  *    EMATNOTSYM
  1484.  *
  1485.  *    Note:
  1486.  *    ----
  1487.  *    If nbeval  is lower  than or  equal to  0 then no computation
  1488.  *        is performed. If it is greater than dim then all
  1489.  *        eigenvalues are computed.
  1490.  */
  1491.   void cdecl householder_givens(int ,
  1492.                    double *,
  1493.                    int,
  1494.                    double *,
  1495.                    int *);
  1496.  
  1497.  
  1498. /*
  1499.  **********************************************************************
  1500.  **
  1501.  **
  1502.  **
  1503.  **    Elementary real polynomial functions
  1504.  **    ====================================
  1505.  **
  1506.  **
  1507.  **
  1508.  */
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514. /*    void rpoly2_solve(double a, double b, double c,
  1515.  *        double *root1r, double *root1im,
  1516.  *        double *root2r, double *root2im)
  1517.  *
  1518.  *    This  function   solves  the   real  polynomial  equation
  1519.  *    ax**2+bx+c=0.
  1520.  *
  1521.  *    Input parameters:
  1522.  *    ----------------
  1523.  *    a, b, c : coefficient of the polynome.
  1524.  *
  1525.  *    Output parameters:
  1526.  *    -----------------
  1527.  *    root1r  : Real part of the first root.
  1528.  *    root1im : Imaginary part of the first root.
  1529.  *    root2r  : Real part of the second root.
  1530.  *    root2im : Imaginary part of the second root.
  1531.  */
  1532.   void cdecl rpoly2_solve(double , double , double ,
  1533.              double *, double *,
  1534.              double *, double *);
  1535.  
  1536.  
  1537.  
  1538.  
  1539.  
  1540. /*    void rpoly_value_deriv(int degree,
  1541.  *        double *poly,
  1542.  *        double x,
  1543.  *        double *y, double *deriv)
  1544.  *
  1545.  *    This routines  computes the  value of  a polynome and the
  1546.  *    one of its first derivate at a given point.
  1547.  *
  1548.  *    Input parameters:
  1549.  *    ----------------
  1550.  *    degree    : Degree of the polynome.
  1551.  *    poly    : Polynome.
  1552.  *    x    : Real value.
  1553.  *
  1554.  *    Output parameters:
  1555.  *    -----------------
  1556.  *    y    : = poly(x).
  1557.  *    deriv    : = poly'(x).
  1558.  */
  1559.   void cdecl rpoly_value_deriv(int ,
  1560.                   double *,
  1561.                   double,
  1562.                   double *, double *);
  1563.  
  1564.  
  1565. /*    void rpoly_one_root(int degree
  1566.  *        double *poly,
  1567.  *        double x, double tol,
  1568.  *        int maxiter,
  1569.  *        double *root, double *value, double *deriv,
  1570.  *        int *iter, int *errcode)
  1571.  *
  1572.  *    This function  finds  one  real  root  of  a  given  real
  1573.  *    polynome.
  1574.  *
  1575.  *    Input parameters:
  1576.  *    ----------------
  1577.  *    degree : Degree of the polynome.
  1578.  *    poly : Polnome, one root of which must be found.
  1579.  *    x : Initial approximation of the root.
  1580.  *    tol : Tolerance used for convergence tests.
  1581.  *    maxiter : Maximum number of iterations allowed.
  1582.  *
  1583.  *    Output parameters:
  1584.  *    -----------------
  1585.  *    root    : Found root, if any.
  1586.  *    value    : = poly(root)
  1587.  *    deriv    : value of the first derivate of poly for x = root.
  1588.  *    iter      : Actual  number  of  iteration  the  algorithm  went
  1589.  *          through.
  1590.  *    errcode : Error Code.
  1591.  *
  1592.  *
  1593.  *    Possible error codes:
  1594.  *    --------------------
  1595.  *    EDEGLE0
  1596.  *    EOVERMAXITER
  1597.  *    ENULLSLOPE
  1598.  */
  1599.   void cdecl rpoly_one_root(int,
  1600.                double *,
  1601.                double , double ,
  1602.                int ,
  1603.                double *, double *, double *,
  1604.                int *, int *);
  1605.  
  1606.  
  1607.  
  1608.  
  1609.  
  1610.  
  1611. /*    void rpoly_reduce(int *degree,
  1612.  *        double *poly,
  1613.  *        double root,
  1614.  *        int *errcode)
  1615.  *
  1616.  *    This functions  reduce the  degree of a given polynome, a
  1617.  *    root of which is known.
  1618.  *
  1619.  *    Input parameters:
  1620.  *    ----------------
  1621.  *    degree    : Degree of the polynome.
  1622.  *    poly    : Polynome.
  1623.  *    root    : Known root.
  1624.  *
  1625.  *    Output parameters:
  1626.  *    -----------------
  1627.  *    poly    : Reduced polynomial.
  1628.  *    errcode : Error code.
  1629.  *
  1630.  *    Possible error codes:
  1631.  *    --------------------
  1632.  *    EDEGLE0
  1633.  *    ENOWCORE
  1634.  */
  1635.   void cdecl rpoly_reduce(int *,
  1636.              double *,
  1637.              double ,
  1638.              int *);
  1639.  
  1640.  
  1641.  
  1642. /*
  1643.  **********************************************************************
  1644.  **
  1645.  **
  1646.  **    Integration functions
  1647.  **    =====================
  1648.  **
  1649.  **
  1650.  **
  1651.  */
  1652.  
  1653.  
  1654. /*    void simpson(double lb, double ub,
  1655.  *        int nbinter,
  1656.  *        double *I,
  1657.  *        int *errcode,
  1658.  *        double f(double))
  1659.  *
  1660.  *    This function computes the integration of a real function
  1661.  *    on an interval using the Simpson method.
  1662.  *
  1663.  *    Input parameters:
  1664.  *    ----------------
  1665.  *    lb     : lower bound of the interval.
  1666.  *    ub     : upper bound of the interval.
  1667.  *    nbinter : number of sub-intervals used for the computation.
  1668.  *    I     : value of the computed integral.
  1669.  *
  1670.  *    Output parameters:
  1671.  *    -----------------
  1672.  *    errcode : Error code.
  1673.  *    f     : function to integrate
  1674.  *
  1675.  *    Possible error codes:
  1676.  *    --------------------
  1677.  *    ENUMINTLE0
  1678.  */
  1679.   void cdecl simpson(double , double ,
  1680.             int ,
  1681.             double *,
  1682.             int *,
  1683.             double (*)(double));
  1684.  
  1685.  
  1686.  
  1687.  
  1688.  
  1689.  
  1690. /*    void romberg(double lb, double ub, double tol,
  1691.  *        int maxiter,
  1692.  *        double *I,
  1693.  *        int *iter,
  1694.  *        int *errcode,
  1695.  *        double f(double))
  1696.  *
  1697.  *    This function computes the integration of a real function
  1698.  *    on an interval using the Romberg algorithm.
  1699.  *
  1700.  *    Input parameters:
  1701.  *    ----------------
  1702.  *    lb : lower bound of the interval.
  1703.  *    ub : upper bound of the interval.
  1704.  *    tol : tolerance used for convergence test.
  1705.  *    maxiter : maximum number of allowed iterations.
  1706.  *
  1707.  *    Output parameters:
  1708.  *    -----------------
  1709.  *    I     : value of the computed integral.
  1710.  *    iter     : actual  number  of  iterations  the  algorithm  went
  1711.  *          through.
  1712.  *    errcode : Error code.
  1713.  *    f    : function to integrate
  1714.  *
  1715.  *    Possible error codes:
  1716.  *    --------------------
  1717.  *    ENOWCORE
  1718.  *    EOVERMAXITER
  1719.  *    EMAXITERLT0
  1720.  *    ETOLLE0
  1721.  */
  1722.   void cdecl romberg(double, double, double,
  1723.             int,
  1724.             double *,
  1725.             int *, int *,
  1726.             double (*)(double));
  1727.  
  1728.  
  1729.  
  1730.  
  1731.  
  1732.  
  1733.  
  1734.  
  1735. /*
  1736.  **********************************************************************
  1737.  **
  1738.  **
  1739.  **
  1740.  **    Differential equations functions
  1741.  **    ================================
  1742.  **
  1743.  **
  1744.  **
  1745.  */
  1746.  
  1747.  
  1748.  
  1749.  
  1750.  
  1751. /*
  1752.  *    void adams(double lb, double ub, double x0,
  1753.  *        int nret, int nint,
  1754.  *        double *tval, double *xval,
  1755.  *        int *errcode,
  1756.  *        double f(double, double))
  1757.  *
  1758.  *    This function solves a first order differential equation
  1759.  *    with a specified initial condition.
  1760.  *
  1761.  *    Input Parameters:
  1762.  *    ----------------
  1763.  *    lb   : Lower bound of t interval.
  1764.  *    ub   : Upper bound of t interval.
  1765.  *    x0   : x value for t = lb.
  1766.  *    tol  : Tolerance used for convergence tests.
  1767.  *    nret : Number of values to be returned.
  1768.  *    nint : Number of sub-intervals used for computation
  1769.  *    f    : f(t, x) = dx/dt
  1770.  *
  1771.  *    Output parameters:
  1772.  *    -----------------
  1773.  *    tval    : Pointer to an array containing nret values of t
  1774.  *          scattered between lb and ub.
  1775.  *    xval    : Pointer to an array containing the nret
  1776.  *          corresponding values of x.
  1777.  *    errcode : error code.
  1778.  *
  1779.  *    Possible error codes:
  1780.  *    --------------------
  1781.  *    ENTRMGTNINT
  1782.  *    ENTRMLT1
  1783.  *    ELBDGEUBD
  1784.  *    ENOWCORE
  1785.  */
  1786.   void cdecl adams(double, double, double,
  1787.          int, int,
  1788.          double *, double *,
  1789.          int *,
  1790.          double (*)(double, double));
  1791.  
  1792.  
  1793.  
  1794.  
  1795.  
  1796.  
  1797. /*    void RKF(double lb, double ub, double x0, double tol,
  1798.  *        int nret,
  1799.  *        double *tval, double *xval,
  1800.  *        int *errcode,
  1801.  *        double f(double, double))
  1802.  *
  1803.  *    This function  solves a first order ordinary differential
  1804.  *    equation with a specified initial condition.
  1805.  *
  1806.  *    Input parameters:
  1807.  *    ----------------
  1808.  *    lb    : Lower bound of t interval.
  1809.  *    ub    : Upper bound of t interval.
  1810.  *    x0    : x value for t = lb.
  1811.  *    tol    : Tolerance used for convergence tests.
  1812.  *    nret    : Number of values to be returned.
  1813.  *    f     : f(t, x) = dx/dt
  1814.  *
  1815.  *    Output parameters:
  1816.  *    -----------------
  1817.  *    tval    : Pointer to  an array  containing nret  values  of  t
  1818.  *          scattered between lb and ub.
  1819.  *    xval    : Pointer to an array containing the nret corresponding
  1820.  *          values of x.
  1821.  *    errcode : error code.
  1822.  *
  1823.  *    Possible error codes:
  1824.  *    --------------------
  1825.  *    ENTRMGTNINT
  1826.  *    ENTRMLT1
  1827.  *    ELBDGEUBD
  1828.  *    ENOWCORE
  1829.  *    ETOLNR
  1830.  */
  1831.   void cdecl RKF(double, double, double, double,
  1832.        int,
  1833.        double *, double *,
  1834.        int *,
  1835.        double (*)(double, double));
  1836.  
  1837.  
  1838.  
  1839. /*    void initcond1storder(double lb, double ub, double x0,
  1840.  *        int nret, int nint,
  1841.  *        double *tval, double *xval,
  1842.  *        int *errcode,
  1843.  *        double f(double, double))
  1844.  *
  1845.  *    This finction  solves a first order ordinary differential
  1846.  *    equation with initial condition specified).
  1847.  *
  1848.  *    Input parameters:
  1849.  *    ----------------
  1850.  *    lb    : lower bound value of t
  1851.  *    ub    : upper bound value of t
  1852.  *    x0    : value of x for t = lb
  1853.  *    nret    : number of values to be returned
  1854.  *    nint    : number of sub-intervals used for computation.
  1855.  *    f    : dx/dt = f(t,x)
  1856.  *
  1857.  *    Output parameters:
  1858.  *    -----------------
  1859.  *    tval    : pointer to an array containint nret values of t
  1860.  *    xval    : pointer to an array containint nret values of x
  1861.  *    errcode : error codes
  1862.  *
  1863.  *    Possible error codes:
  1864.  *    --------------------
  1865.  *    ENTRMLT1
  1866.  *    ELBDGEUBD
  1867.  *    ENOWCORE
  1868.  */
  1869.   void cdecl initcond1storder(double , double , double ,
  1870.                  int , int ,
  1871.                  double *, double *,
  1872.                  int *,
  1873.                  double (*)(double, double));
  1874.  
  1875.  
  1876.  
  1877.  
  1878. /*    void initcond2ndorder(double lb, double ub, double x0,
  1879.  *        double xprime0,
  1880.  *        int nret, int nint,
  1881.  *        double *tval, double *xval, double *xprimeval,
  1882.  *        int *errcode,
  1883.  *        double f(double, double, double))
  1884.  *
  1885.  *    This function  solves a  2nd order  ordinary differential
  1886.  *    equation with specified initial conditions.
  1887.  *
  1888.  *    Input parameters:
  1889.  *    ----------------
  1890.  *    lb    : lower bound value of t
  1891.  *    ub    : upper bound value of t
  1892.  *    x0    : values of x for t = lb
  1893.  *    xprime0 : values of dx/dt for t = lb
  1894.  *    nret    : number of values to be returned
  1895.  *    nint    : number of sub-intervals used for computation.
  1896.  *    f    : dx2/dt2 = f(t, x, dx/dt)
  1897.  *
  1898.  *    Output parameters:
  1899.  *    -----------------
  1900.  *    tval        : pointer to an array containint nret values of t.
  1901.  *    xval        : pointer to an array containint nret values of x.
  1902.  *    xprimeval    :  pointer to  an array  containint nret values of
  1903.  *                dx/dt.
  1904.  *    errcode     : Error code.
  1905.  *
  1906.  *    Possible error codes:
  1907.  *    --------------------
  1908.  *    ENTRMLT1
  1909.  *    ENTRMGTNINT
  1910.  *    ELBDGEUBD
  1911.  *    ENOWCORE
  1912.  */
  1913.   void cdecl initcond2ndorder(double, double, double, double,
  1914.               int, int,
  1915.               double *, double *, double *,
  1916.               int *,
  1917.               double (*)(double, double, double));
  1918.  
  1919.  
  1920.  
  1921.  
  1922. /*    void initcond(int order,
  1923.  *        double lb, double ub,
  1924.  *        double *initval,
  1925.  *        int nret, int nint,
  1926.  *        double *matsol,
  1927.  *        int *errcode,
  1928.  *        double f(double *))
  1929.  *
  1930.  *    This routine solves an  n-order ordinary  differential
  1931.  *    equation with  specified initial conditions.
  1932.  *
  1933.  *    Input parameters:
  1934.  *    ----------------
  1935.  *    n    : order of the equation to be solved.
  1936.  *    lb     : lower bound value of t
  1937.  *    ub     : upper bound value of t
  1938.  *    initval : pointer to  an array containing the values values
  1939.  *          of x and its "order" successive derivates for t=lb.
  1940.  *    nret    : number of values to be returned
  1941.  *    nint    : number of sub-intervals used for computation.
  1942.  *    f    : d(n)x/dtn = f(t, x, dx/dt, ....,d(n-1)x/dt(n-1))
  1943.  *
  1944.  *    Output parameters:
  1945.  *    -----------------
  1946.  *    matsol     : bi dimensional  array containing  the solution  :;
  1947.  *          matsol[i][j]
  1948.  *    errcode    : error codes
  1949.  *
  1950.  *    Possible error codes:
  1951.  *    --------------------
  1952.  *    ENTRMLT1
  1953.  *    ENTRMGTNINT
  1954.  *    ELBDGEUBD
  1955.  *    ENOWCORE
  1956.  *    EDIMLE0
  1957.  */
  1958.   void cdecl initcond(int,
  1959.           double, double,
  1960.           double *,
  1961.           int, int,
  1962.           double *,
  1963.           int *,
  1964.           double (*)(double *));
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971. /*    void initcondsystem1(int neq,
  1972.  *        double lb, double ub,
  1973.  *        double *initval,
  1974.  *        int nret, int nint,
  1975.  *        double *matsol, int *errcode,
  1976.  *        double (**tabfunc)(double *))
  1977.  *
  1978.  *    This procedure solves a system of 1st-order differential
  1979.  *    equation with specified initial conditions.
  1980.  *
  1981.  *    Input parameters:
  1982.  *    ----------------
  1983.  *    neq    : number of equations.
  1984.  *    lb, ub    : lower and upper bounds of the study interval.
  1985.  *      initval : values of x1, x2, ... xneq at t
  1986.  *    nret    : numbers of values of t that computed results must
  1987.  *            be returned for.
  1988.  *    nint     : numbers of sub intervals of [lb, ub] used for computation.
  1989.  *      tabfunc : array of functions defining the system to be solved.
  1990.  *          (Each function is as x' = f(t, x , x , ..., x , ..., x   )
  1991.  *                                       i        1   2        j        neq
  1992.  *    Output parameters:
  1993.  *    -----------------
  1994.  *    matsol    : matrix containing the results.
  1995.  *    errcode : error code.
  1996.  *
  1997.  *    Possible error codes:
  1998.  *    --------------------
  1999.  *    ENTRMLT1
  2000.  *    ENTRMGTNINT
  2001.  *    ELBDGEUBD
  2002.  *    ENOWCORE
  2003.  *    EDIMLE0
  2004.  *
  2005.  *    Note:
  2006.  *    ----
  2007.  *    the result (matsol) is organized the following way
  2008.  *    matsol is a neq+1 columns nret lines matrix
  2009.  *    Column 0 contains the succesive values of t
  2010.  *    Column 1 contains the succesive values of x1
  2011.  *    etc ...
  2012.  *    (i.e. each line contains a value of t and the corresponding
  2013.  *    x1, x2, ..., xneq.
  2014.  *
  2015.  */
  2016.   void cdecl initcondsystem1(int,
  2017.             double, double,
  2018.             double *,
  2019.             int, int,
  2020.             double *, int *,
  2021.             double (**)(double *));
  2022.  
  2023.  
  2024.  
  2025.  
  2026. /*    void initcondsystem2(int neq,
  2027.  *        double lb, double ub,
  2028.  *        double *initval,
  2029.  *        int nret, int nint,
  2030.  *        double *matsol, int *errcode,
  2031.  *        double (**tabfunc)(double *))
  2032.  *
  2033.  *    This procedure solves a system of 2nd-order differential
  2034.  *    equation with specified initial conditions.
  2035.  *
  2036.  *    Input parameters:
  2037.  *    ----------------
  2038.  *    neq    : number of equations.
  2039.  *    lb, ub    : lower and upper bounds of the study interval.
  2040.  *      initval : values of x1, x2, ... xneq at t
  2041.  *    nret    : numbers of values of t that computed results must
  2042.  *            be returned for.
  2043.  *    nint     : numbers of sub intervals of [lb, ub] used for computation.
  2044.  *      tabfunc : array of functions defining the system to be solved.
  2045.  *          (Each function is as x" = f(v, w)
  2046.  *                     i
  2047.  *           with v = (t, x , x , ..., x , ..., x   )
  2048.  *                               1   2        j        neq
  2049.  *                 and
  2050.  *            w = (t, x', x', ..., x', ..., x'  )
  2051.  *                               1   2        j        neq
  2052.  *    Output parameters:
  2053.  *    -----------------
  2054.  *    matsol    : matrix containing the results.
  2055.  *    errcode : error code.
  2056.  *
  2057.  *    Possible error codes:
  2058.  *    --------------------
  2059.  *    ENTRMLT1
  2060.  *    ENTRMGTNINT
  2061.  *    ELBDGEUBD
  2062.  *    ENOWCORE
  2063.  *    EDIMLE0
  2064.  *
  2065.  *    Note:
  2066.  *    ----
  2067.  *    the result (matsol) is organized the following way
  2068.  *    matsol is a neq+1 columns nret lines matrix
  2069.  *    Column 0 contains the succesive values of t
  2070.  *    Column 1 contains the succesive values of x1
  2071.  *    etc ...
  2072.  *    (i.e. each line contains a value of t and the corresponding
  2073.  *    x1, x2, ..., xneq.
  2074.  *
  2075.  */
  2076.   void cdecl initcondsystem2(int,
  2077.              double, double,
  2078.              double *, double *,
  2079.              int, int,
  2080.              double *, double *,
  2081.              int *,
  2082.              double (**)(double *, double *));
  2083.  
  2084.  
  2085.  
  2086.  
  2087. /*    void shooting(double lb, double ub, double lb0, double ub0,
  2088.  *            double lbprime,
  2089.  *          int nret,
  2090.  *          double tol,
  2091.  *          int maxiter, int nint,
  2092.  *          int *iter,
  2093.  *          double *tval, double *xval, double *xprimeval,
  2094.  *          int *errcode,
  2095.  *          double (*f)(double, double, double))
  2096.  *
  2097.  *    This routine solves a possibly non-linear 2nd order ordinary
  2098.  *    differential equation with specified initial and final
  2099.  *    conditions.
  2100.  *
  2101.  *
  2102.  *    Input parameters:
  2103.  *    ----------------
  2104.  *    lb, ub    : lower and upper bounds of the study interval.
  2105.  *      lb0,ub0    : values of x t=lb and t=ub.
  2106.  *    lbprime    : values of x' at t=ub.
  2107.  *    nret    : numbers of values of t that computed results must
  2108.  *            be returned for.
  2109.  *    tol    : tolerance used for algorithm convergence tests.
  2110.  *      maxiter : maximum number of allowed iterations.
  2111.  *    nint     : numbers of sub intervals of [lb, ub] used for computation.
  2112.  *    f    : differential equation (x" = f(t, x, x'))
  2113.  *
  2114.  *    Output parameters:
  2115.  *    -----------------
  2116.  *    iter        : actual number of iterations the algorithm went through.
  2117.  *    tval        : values of t  between lb and ub.
  2118.  *    xval        : values of x  between lb and ub.
  2119.  *    xprimeval    : values of x' between lb and ub.
  2120.  *    errcode     : error code.
  2121.  *
  2122.  *    Possible error codes:
  2123.  *    --------------------
  2124.  *    ENTRMLT1
  2125.  *    ENTRMGTNINT
  2126.  *    ELBDGEUBD
  2127.  *    ENOWCORE
  2128.  *    EOVERMAXITER
  2129.  *    ENOSOL
  2130.  *    EMAXITERLT0
  2131.  *    ETOLLE0
  2132.  */
  2133.   void cdecl shooting(double, double, double, double,
  2134.           double,
  2135.           int,
  2136.           double,
  2137.           int, int,
  2138.           int *,
  2139.           double *, double*, double *,
  2140.           int *,
  2141.           double (*)(double, double, double));
  2142.  
  2143.  
  2144.  
  2145. /*    void linear_shooting(double tlb, double tub, double xlb, double xub,
  2146.  *        int nret, int nint,
  2147.  *        double *tval, double *xval, double *xprimeval,
  2148.  *        int *errcode,
  2149.  *        double (*f)(double, double, double))
  2150.  *
  2151.  *
  2152.  *    This routine solves a linear 2nd order ordinary
  2153.  *    differential equation with specified initial and final
  2154.  *    conditions.
  2155.  *
  2156.  *    Input parameters:
  2157.  *    ----------------
  2158.  *    tlb, tub    : lower and upper bounds of the study interval.
  2159.  *      xlb, xub    : values of x t=lb and t=ub.
  2160.  *    nret        : numbers of values of t that computed results must
  2161.  *                be returned for.
  2162.  *    nint     : numbers of sub intervals of [lb, ub] used for computation.
  2163.  *    f    : differential equation (x" = f(t, x, x'))
  2164.  *
  2165.  *    Output parameters:
  2166.  *    -----------------
  2167.  *    tval        : values of t  between lb and ub.
  2168.  *    xval        : values of x  between lb and ub.
  2169.  *    xprimeval    : values of x' between lb and ub.
  2170.  *    errcode     : error code.
  2171.  *
  2172.  *    Possible error codes:
  2173.  *    --------------------
  2174.  *    ENTRMLT1
  2175.  *    ENTRMGTNINT
  2176.  *    ELBDGEUBD
  2177.  *    ENOWCORE
  2178.  *    ENOTLINDIFEQ
  2179.  */
  2180.   void cdecl linear_shooting(double, double, double, double,
  2181.              int, int,
  2182.              double *, double *, double *,
  2183.              int *,
  2184.              double (*)(double, double, double));
  2185.  
  2186.  
  2187.  
  2188.  
  2189.  
  2190.  
  2191.  
  2192.  
  2193. /*
  2194.  **********************************************************************
  2195.  **
  2196.  **
  2197.  **
  2198.  **    Least Squares routine
  2199.  **    =====================
  2200.  **
  2201.  **
  2202.  **
  2203.  */
  2204.  
  2205.  
  2206.  
  2207.  
  2208.  
  2209. /*     void lsq(int nbpoints,
  2210.  *        double *xdata, double *ydata,
  2211.  *        int *nbtermes,
  2212.  *        double *vectsol, double *yfit, double *residus,
  2213.  *        double *stddev, double *variance,
  2214.  *        int *errcode,
  2215.  *        lsqfit fit)
  2216.  *
  2217.  *    This function computes least square fit of points.
  2218.  *
  2219.  *    Input parameters:
  2220.  *    ----------------
  2221.  *    nbpoints : number of data points.
  2222.  *    xdata      : x of each point.
  2223.  *    ydata      : y of each point.
  2224.  *    nbterms  : number of terms in the least square fit.
  2225.  *    lsq      : least square fit type
  2226.  *
  2227.  *    Output parameters:
  2228.  *    -----------------
  2229.  *    vectsol  : computed LS coefficients.
  2230.  *    yfit       : values of each point.
  2231.  *    stddev      : standard deviation.
  2232.  *    variance : variance.
  2233.  *    errcode  : error code.
  2234.  *
  2235.  *    Possible error codes:
  2236.  *    --------------------
  2237.  *    ENOWCORE
  2238.  *    E0DIVIDE
  2239.  *    ELOGLE0
  2240.  *    ENDPTSLT2
  2241.  *    ENTRMLT1
  2242.  *    ENDTPTLTLTRMS
  2243.  *    ENOSOL
  2244.  */
  2245.   void cdecl lsq(int ,
  2246.         double *, double *,
  2247.         int *,
  2248.         double *, double *, double *,
  2249.         double *, double *,
  2250.         int *,
  2251.         lsqfit );
  2252.  
  2253.  
  2254.  
  2255.  
  2256.  
  2257. /*    char *lsqname(lsqfit fit)
  2258.  *
  2259.  *    This function  returns the  name associated  to  a  least
  2260.  *    square method.
  2261.  *
  2262.  *    Input parameters:
  2263.  *    ----------------
  2264.  *    lsq : least square fit type
  2265.  *
  2266.  *    Returns:
  2267.  *    -------
  2268.  *    the name of the least square type fit
  2269.  */
  2270.   char * cdecl lsqname(lsqfit);
  2271.  
  2272. #ifdef __cplusplus
  2273. }
  2274. #endif
  2275.  
  2276.  
  2277. #endif