Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

vnl_netlib.h

Go to the documentation of this file.
00001 #ifndef vnl_netlib_h_
00002 #define vnl_netlib_h_
00003 
00004 //:
00005 //  \file
00006 //  \brief Purpose: declare in a central place the list of symbols from netlib
00007 //  \author fsm@robots.ox.ac.uk
00008 //
00009 //  Modifications
00010 //  dac (Manchester) 28/03/2001: tidied up documentation
00011 //
00012 
00013 
00014 //: Purpose: declare in a central place the list of symbols from netlib
00015 //  referenced from vnl-algo. This list was auto-generated, so it is
00016 //  exhaustive as of 16 March 2000 (10pm)
00017 //
00018 //  Note: the declarations are initially entered as "int f()", which
00019 //  will conflict with the actual prototype. If you get a conflict,
00020 //  enter the correct prototype in here.
00021 //
00022 
00023 
00024 #include <vcl_complex.h>
00025 
00026 // xSVDC
00027 #define vnl_netlib_svd_proto(T) \
00028 T *x, int const &ldx, int const &m, int const &n, \
00029 T *sv, \
00030 T *errors, \
00031 T *u, int const &ldu, \
00032 T *v, int const &ldv, \
00033 T *work, \
00034 int const &job, int *info
00035 #define vnl_netlib_svd_params \
00036 x, ldx, m, n, sv, errors, u, ldu, v, ldv, work, job, info
00037 
00038 // xQRDC
00039 #define vnl_netlib_qrdc_proto(T) \
00040 T *x, \
00041 int const& ldx, \
00042 int const& n, \
00043 int const& p, \
00044 T* qraux, \
00045 int *jpvt, \
00046 T *work, \
00047 int const& job
00048 #define vnl_netlib_qrdc_params \
00049 x, ldx, n, p, qraux, jpvt, work, job
00050 
00051 // xQRSL
00052 #define vnl_netlib_qrsl_proto(T) \
00053 T const *x, \
00054 int &ldx, \
00055 int &n, \
00056 int &k, \
00057 T const *qraux, \
00058 T const *y, \
00059 T *qy, \
00060 T *qty, \
00061 T *b, \
00062 T *rsd, \
00063 T *xb, \
00064 int &job, \
00065 int *info
00066 #define vnl_netlib_qrsl_params \
00067 x, ldx, n, k, qraux, y, qy, qty, b, rsd, xb, job, info
00068 
00069 class vnl_netlib {
00070 public:
00071   // fsm : in the global namespace, 'real' conflicts with function ::real()
00072   // and 'complex' conflicts with template complex<T>.
00073   typedef int integer_t;
00074   typedef float  real_t;
00075   typedef double doublereal_t;
00076   typedef vcl_complex<float>  complex_t;
00077   typedef vcl_complex<double> doublecomplex_t;
00078 };
00079 
00080 extern "C" {
00081 #define integer       vnl_netlib::integer_t
00082 #define real          vnl_netlib::real_t
00083 #define doublereal    vnl_netlib::doublereal_t
00084 #define complex       vnl_netlib::complex_t
00085 #define doublecomplex vnl_netlib::doublecomplex_t
00086   // complex eigensystem
00087   int zgeev_(char const *jobvl,
00088              char const *jobvr,
00089              integer *n,
00090              doublecomplex *a,
00091              integer *lda,
00092              doublecomplex *w,
00093              doublecomplex *vl,
00094              integer *ldvl,
00095              doublecomplex *vr,
00096              integer *ldvr,
00097              doublecomplex *work,
00098              integer *lwork,
00099              doublereal *rwork,
00100              integer *info);
00101 
00102   // linpack xSVDC() routines
00103   int ssvdc_(vnl_netlib_svd_proto(real));
00104   int dsvdc_(vnl_netlib_svd_proto(doublereal));
00105   int csvdc_(vnl_netlib_svd_proto(complex));
00106   int zsvdc_(vnl_netlib_svd_proto(doublecomplex));
00107 
00108   // linpack xQRDC QR routines
00109   int sqrdc_(vnl_netlib_qrdc_proto(real));
00110   int dqrdc_(vnl_netlib_qrdc_proto(doublereal));
00111   int cqrdc_(vnl_netlib_qrdc_proto(complex));
00112   int zqrdc_(vnl_netlib_qrdc_proto(doublecomplex));
00113 
00114   // solve A x = b using QR ?
00115   int sqrsl_(vnl_netlib_qrsl_proto(real));
00116   int dqrsl_(vnl_netlib_qrsl_proto(doublereal));
00117   int cqrsl_(vnl_netlib_qrsl_proto(complex));
00118   int zqrsl_(vnl_netlib_qrsl_proto(doublecomplex));
00119 
00120   // real eigensystem
00121   int rg_(int const& nm,
00122           int const& n,
00123           double const* a,
00124           doublereal* wr,
00125           doublereal* wi,
00126           int const& matz,
00127           doublereal* z,
00128           int* iv1,
00129           doublereal* fv1,
00130           int* ierr);
00131 
00132   // temperton fft routines
00133   int gpfa_ (real  *a, real  *b, real  const *triggs,
00134              int const &inc, int const &jump, int const &n,
00135              int const &lot, int const &isign, int const *, int *);
00136   int setgpfa_ (real  *triggs, const int &, const int *, int *);
00137   int dgpfa_(doublereal *a, doublereal *b, doublereal const *triggs,
00138              int const &inc, int const &jump, int const &n,
00139              int const &lot, int const &isign, int const *, int *);
00140   int dsetgpfa_(doublereal *triggs, const int &, const int *, int *);
00141 
00142   // symmetric eigensystem
00143   int rs_(int const & nm, int const & n,
00144           doublereal const *a, doublereal *w,
00145           int const & matz, doublereal const *z,
00146           doublereal const *fv1, doublereal const *fv2,
00147           int * ierr);
00148 
00149   // generalized eigensystem
00150   int rsg_ (int const & nm, int const & n, doublereal const *a, doublereal const *b,
00151             doublereal *w, int const & matz, doublereal *z, doublereal *fv1, doublereal *fv2,
00152             int *ierr);
00153 
00154   // cholesky
00155   int dpofa_(doublereal *m, const int& lda, const int& n, int* info);
00156   int dposl_(const doublereal *a, const int& lda, const int& n, doublereal *b);
00157   int dpoco_(doublereal *a, const int& lda, const int& n,
00158       doublereal* rcond, doublereal *z, int *info);
00159   int dpodi_(doublereal *a, const int& lda, const int& n,
00160       doublereal* det, const int& job);
00161 
00162   // roots of real polynomial
00163   void rpoly_(const doublereal* op, int* degree, doublereal *zeror,
00164               doublereal *zeroi, int *fail);
00165 
00166   //
00167   int chscdf_();
00168   int lbfgs_();
00169   int dnlaso_();
00170   int cg_();
00171 
00172   // lmdif() is used by vnl_levenberg_marquardt
00173   int lmdif_(int fcn(int* m,      // I    Number of residuals
00174                      int* n,      // I    Number of unknowns
00175                      doublereal const* x, // I    Solution vector, size n
00176                      doublereal* fx,      // O    Residual vector f(x)
00177                      int* iflag   // IO   0 ==> print, -1 ==> terminate
00178                      ),
00179              int *m,              // I     Number of residuals, must be > #unknowns
00180              int *n,              // I     Number of unknowns
00181              doublereal *x,       // IO    Solution vector, size n
00182              doublereal *fvec,    // W m   Storage for residual vector
00183              doublereal *ftol,    // I     Termination tolerance on F (sum of squared residuals)
00184              doublereal *xtol,    // I     Termination tolerance on X (solution vector)
00185              doublereal *gtol,    // I     Termination tolerance on Grad(F)' * F = 0
00186              int    *maxfev,      // I     Termination maximum number of iterations.
00187              doublereal *epsfcn,  // I     Step length for FD Jacobian
00188              doublereal *diag,    // I     Multiplicative scale factors for variables
00189              int    *mode,        // I     1 => Compute diag, 2 => user has set diag
00190              doublereal *factor,  // I     Initial step bound.  Set to 100.
00191              int    *nprint,      // I     +ive => print every nprint iters.
00192              int    *info,        // O     See switch (info) below
00193              int    *nfev,        // O     Number of function evaluations
00194              doublereal *fjac,    // O m*n Upper n*n is P'J'JP = R'R
00195              int    *ldfjac,      // I     Leading dimension of fdjac -- set to m
00196              int    *ipvt,        // O n   Permutation indices P
00197              doublereal *qtf,     // O n   Q'*f(x)
00198              doublereal *wa1,     // W n
00199              doublereal *wa2,     // W n
00200              doublereal *wa3,     // W n
00201              doublereal *wa4,     // W m
00202              doublereal *errors); // O 2   Start/end RMS errors
00203 
00204   // lmder() is used by vnl_levenberg_marquardt
00205   int lmder1_(int fcn(int* m,          // I    Number of residuals
00206                       int* n,          // I    Number of unknowns
00207                       doublereal const* x, // I    Solution vector, size n
00208                       doublereal* fx,      // O    Residual vector f(x), size m
00209                       doublereal* fJ,      // O    m * n Jacobian f(x)
00210                       int&,
00211                       int* iflag        // I    1 -> calc fx, 2 -> calc fjac
00212                                         // O    0 ==> print, -1 ==> terminate
00213                       ),
00214               int const& m,             // I    Number of residuals
00215               int const& n,             // I    Number of unknowns
00216               doublereal*    x,         // I    Solution vector, size n
00217               doublereal*    fvec,      // O    Residual vector f(x), size m
00218               doublereal*    fjac,      // O    m * n Jacobian f(x)
00219               int const& ldfjac,        // I    LD of fjac
00220               doublereal const& tol,    // I    x/ftol
00221               int* info,                // O
00222               int* ipvt,                // O length n
00223               doublereal * wa,          // I work, length lwa
00224               const int& lwa);          // I > 5*n+m
00225 #undef integer
00226 #undef real
00227 #undef doublereal
00228 #undef complex
00229 #undef doublecomplex
00230 };
00231 
00232 #endif // vnl_netlib_h_

Generated at Wed Mar 12 01:13:15 2003 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000