00001 #ifndef vnl_netlib_h_
00002 #define vnl_netlib_h_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include <vcl_complex.h>
00025
00026
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
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
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
00072
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
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
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
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
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
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
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
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
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
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
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
00173 int lmdif_(int fcn(int* m,
00174 int* n,
00175 doublereal const* x,
00176 doublereal* fx,
00177 int* iflag
00178 ),
00179 int *m,
00180 int *n,
00181 doublereal *x,
00182 doublereal *fvec,
00183 doublereal *ftol,
00184 doublereal *xtol,
00185 doublereal *gtol,
00186 int *maxfev,
00187 doublereal *epsfcn,
00188 doublereal *diag,
00189 int *mode,
00190 doublereal *factor,
00191 int *nprint,
00192 int *info,
00193 int *nfev,
00194 doublereal *fjac,
00195 int *ldfjac,
00196 int *ipvt,
00197 doublereal *qtf,
00198 doublereal *wa1,
00199 doublereal *wa2,
00200 doublereal *wa3,
00201 doublereal *wa4,
00202 doublereal *errors);
00203
00204
00205 int lmder1_(int fcn(int* m,
00206 int* n,
00207 doublereal const* x,
00208 doublereal* fx,
00209 doublereal* fJ,
00210 int&,
00211 int* iflag
00212
00213 ),
00214 int const& m,
00215 int const& n,
00216 doublereal* x,
00217 doublereal* fvec,
00218 doublereal* fjac,
00219 int const& ldfjac,
00220 doublereal const& tol,
00221 int* info,
00222 int* ipvt,
00223 doublereal * wa,
00224 const int& lwa);
00225 #undef integer
00226 #undef real
00227 #undef doublereal
00228 #undef complex
00229 #undef doublecomplex
00230 };
00231
00232 #endif // vnl_netlib_h_