⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 netlib.h

📁 InsightToolkit-1.4.0(有大量的优化算法程序)
💻 H
📖 第 1 页 / 共 3 页
字号:
#ifndef netlib_h_
#define netlib_h_

/*
//:
// \file
// \brief Header file for all exported netlib (fortran-originating) functions
// \author Peter Vanroose, KULeuven
// \date   March 2002
*/

#ifdef __cplusplus
#include <vcl_complex.h>
typedef vcl_complex<float> cmplx;
typedef vcl_complex<double> dcmplx;
typedef int logical;
extern "C" {
#else
#define cmplx complex
#define dcmplx doublecomplex
#endif

#include <vxl_config.h>
#if VXL_MATH_HAS_SQRTF
  float sqrtf(float);
#else
# define sqrtf(f) ((float)sqrt((double)(f)))
#endif

  char * F77_aloc(int Len, char *whence);
  void   sig_die(char *s, int kill);
  void   exit_(int *rc);
  void   s_cat(char *lp, const char *rpp[], long rnp[], long *np, long ll);
  int    s_cmp(char *a0, char *b0, long la, long lb);
  void   s_copy(char *a, const char *b, long la, long lb);
  double f__cabs(double, double);

  double pow_dd(const double *x, const double *y);
  double pow_di(const double *ap, const int *bp);
  int    pow_ii(const int *ap, const int *bp);
  float  pow_ri(const float *ap, const int *bp);
  float  c_abs(const cmplx *z);
  double z_abs(const dcmplx *z);
  void   r_cnjg(cmplx *r, const cmplx *z);
  void   d_cnjg(dcmplx *r, const dcmplx *z);
  void   c_div(cmplx *c, const cmplx *a, const cmplx *b);
  void   z_div(dcmplx *c, const dcmplx *a, const dcmplx *b);
  int    i_dnnt(const double *x);
  float  r_imag(const cmplx *z);
  double d_imag(const dcmplx *a);
  double d_lg10(const double *x);
  float  r_sign(const float *a, const float *b);
  double d_sign(const double *a, const double *b);
  void   z_sqrt(dcmplx *ret_value, const dcmplx *z);
  double urand_(int *iy);
  void   xerbla_(char *srname, int *info);

  /*: Computes singular values and vectors of an mxn matrix (double version) */
  void dsvdc_(double *x, const int* ldx, /*!< (IN) matrix, m rows, n columns, stored row-wise */
              const int* m, const int* n,
              double *singular_values, /*!< (OUT) in descending order of magnitude */
              double *errors, /*!< (OUT) superdiagonal of u^T*x*v (normally 0) */
              double *u, const int* ldu, /*!< (OUT) left singular vectors */
              double *v, const int* ldv, /*!< (OUT) right singular vectors */
              double *work,  /*!< (IN/OUT) scratch work area of length m */
              const int* job, /*!< (IN) 2-digit number. First digit refers to u; 0 = do not compute, 1 = all m; 2 = only min(m,n) */
              int *info); /*!< (OUT) singular values [info] and up are correct */

  /*: Computes singular values and vectors of an mxn matrix (float version) */
  void ssvdc_(float* x, const int* ldx, const int* m, const int* n,
              float* s, float* e, float* u, const int* ldu, float* v, const int* ldv,
              float* work, const int* job, int* info);

  /*: Computes singular values and vectors of an mxn matrix (double_complex version) */
  void zsvdc_(dcmplx* x, const int* ldx, const int* m, const int* n,
              dcmplx* s, dcmplx* e, dcmplx* u, const int* ldu, dcmplx* v, const int* ldv,
              dcmplx* work, const int* job, int* info);

  /*: Computes singular values and vectors of an mxn matrix (float_complex version) */
  void csvdc_(cmplx* x, const int* ldx, const int* m, const int* n,
              cmplx* s, cmplx* e, cmplx* u, const int* ldu, cmplx* v, const int* ldv,
              cmplx* work, const int* job, int* info);

  void sggsvd_(char *jobu, char *jobv, char *jobq, int *m, int *n, int *p, int *k, int *l, float *a, int *lda,
               float *b, int *ldb, float *alpha, float *beta, float *u, int * ldu, float *v, int *ldv, float *q, int *ldq,
               float *work, int *iwork, int *info);

  void dggsvd_(char *jobu, char *jobv, char *jobq, int *m, int *n, int *p, int *k, int *l,
               double *a, int *lda, double *b, int *ldb, double *alpha, double *beta,
               double *u, int *ldu, double *v, int *ldv, double *q, int *ldq, double *work, int *iwork, int *info);

  /*: Finds eigenvalues and eigenvectors of a general matrix */
  void rg_(int* nm, int* n, double* a, double* wr, double* wi, int* matz, double* z, int* iv1, double* fv1, int* ierr);

  /*: Computes eigenvalues and eigenvectors of nxn complex general matrix */
  void zgeev_(const char* jobvl, const char* jobvr, const int* n, dcmplx* a, const int* lda, dcmplx* w,
              dcmplx* vl, const int* ldvl, dcmplx* vr, const int* ldvr,
              dcmplx* work, int* lwork, double* rwork, int* info);

  /*: Computes eigenvalues and eigenvectors of a real symmetric matrix */
  void rs_(const int* nm, /*!< (IN) leading dimension of matrices */
           const int* n, /*!< (IN) order of the square matrix a */
           double *a_matrix, /*!< (IN) real symmetric matrix */
           double *eigenvalues,    /*!< (OUT) eigenvalues in ascending order */
           const int* want_eigenvectors, /*!< (IN) set nonzero if eigenvectors wanted */
           double *eigenvectors, /*!< (OUT) eigenvectors */
           double *workspace_1_size_n, double *workspace_2_size_n, /*!< scratch */
           int* output_error_code); /*!< (OUT) normal completion code is 0 */

  /*: Computes eigenvalues and eigenvectors of a real symmetric generalized eigenproblem  ax = lambda bx.  */
  void rsg_(const int* nm, /*!< (IN) leading dimension of matrices */
            const int* n, /*!< (IN) order of the square matrices a and b */
            double *a_matrix, /*!< (IN) real symmetric matrix */
            double *b_matrix, /*!< (IN) positive definite real symm matrix */
            double *eigenvalues,    /*!< (OUT) eigenvalues in ascending order */
            const int* want_eigenvectors, /*!< (IN) set nonzero if eigenvectors wanted */
            double *eigenvectors, /*!< (OUT) eigenvectors */
            double *workspace_1_size_n, double *workspace_2_size_n, /*!< scratch */
            int* output_error_code); /*!< (OUT) normal completion code is 0 */

  /*: Computes QR factorisation of an n x p double matrix */
  void dqrdc_(double *x, const int* ldx, /*!< (IN/OUT) matrix, n rows, p columns, stored row-wise */
              const int* n, const int* p,
              double* qraux, /*!< (OUT) further info necessary to recover R part from x */
              int *jpvt,  /*!< (IN/OUT) length p; selection of pivot columns: */
                          /*   ==0 ==> any; >0 ==> initial column; <0 ==> final */
              double *work,  /*!< (IN/OUT) scratch work area of length p */
              const int* job); /*!< (IN) if == 0, no pivoting is done */

  /*: Computes QR factorisation of an n x p float matrix */
  void sqrdc_(float* x, const int* ldx, const int* n, const int* p,
              float* qraux, int* jpvt, float* work, const int* job);

  /*: Computes QR factorisation of an n x p double_complex matrix */
  void zqrdc_(dcmplx* x, const int* ldx, const int* n, const int* p,
              dcmplx* qraux, int* jpvt, dcmplx* work, const int* job);

  /*: Computes QR factorisation of an n x p float_complex matrix */
  void cqrdc_(cmplx* x, const int* ldx, const int* n, const int* p,
              cmplx* qraux, int* jpvt, cmplx* work, const int* job);

  /*: Computes coord transf etc from QR factorisation of double matrix */
  void dqrsl_(const double* x, const int* ldx, /*!< (IN) output of dqrdc_, n x k matrix */
              const int* n, const int* k, /*!< (IN) k <= min(n,p) with n,p from dqrdc_ */
              const double* qraux, /*!< (IN) qraux output of dqrdc_ */
              const double* y, /*!< (IN) n-vector to operate on */
              double* qy,  /*!< (OUT) q*y */
              double* qty, /*!< (OUT) q^T*y (conjugate transpose if complex) */
              double* b,   /*!< (OUT) solution b of min norm_2(y - x*b) */
              double* rsd, /*!< (OUT) least squares residual y - x*b = proj of y on orth complement of columns(x) */
              double* xb,  /*!< (OUT) least squares approx of x*b = proj of y on columns(x) */
              const int* job, /*!< (IN) decimal acbde: a:compute qy; c:qty; b:qty+b; d:qty+rsd; e:qty+xb */
              int* info); /*!< non-zero if r is singular and b is set. */

  /*: Computes coord transf etc from QR factorisation of float matrix */
  void sqrsl_(const float* x, const int* ldx, const int* n, const int* k,
              const float* qraux, const float* y,
              float* qy, float* qty, float* b, float* rsd, float* xb,
              const int* job, int* info);

  /*: Computes coord transf etc from QR factorisation of double_complex matrix */
  void zqrsl_(const dcmplx* x, const int* ldx, const int* n, const int* k,
              const dcmplx* qraux, const dcmplx* y,
              dcmplx* qy, dcmplx* qty, dcmplx* b, dcmplx* rsd, dcmplx* xb,
              const int* job, int* info);

  /*: Computes coord transf etc from QR factorisation of float_complex matrix */
  void cqrsl_(const cmplx* x, const int* ldx, const int* n, const int* k,
              const cmplx* qraux, const cmplx* y,
              cmplx* qy, cmplx* qty, cmplx* b, cmplx* rsd, cmplx* xb,
              int* job, int* info);

  /*: Minimizes a function using the conjugate gradient method */
  void cg_(double* x, /*!< (IN/OUT) minimizer, length n; input = starting guess */
           double* e, /*!< (OUT) max-norm of gradient */
           int* it,   /*!< (OUT) number of iterations performed */
           double* step, /*!< (IN/OUT) step size along search direction */
           const double* tolerance_on_e, const int* max_iterations,
           const int* n, /*!< (IN) number of unknowns */
           const int* m, /*!< (IN) # iterations before calc new seach direction */
           double (*cost_function)(double*),
           void (*gradient_func)(double*,double*),
           void (*both)(double*,double*,double*),
           void (*preconditioning_func)(double*,double*),
           double *work);

  /*: Computes the float cumulative distribution function value for the chi-squared distribution */
  void chscdf_(const float* x, /*!< (IN) value where the cumulative distribution must be evaluated */
               const int* nu,  /*!< (IN) # degrees of freedom */
               float* cdf);    /*!< (OUT) the function value */

  /*: Computes the double cumulative distribution function value for the chi-squared distribution */
  void dchscdf_(double* x, int* nu, double* cdf);

  /*: Self-sorting in-place generalized prime factor (complex) double fft */
  void dgpfa_(double* a, /*!< (IN/OUT) Real part of input/output vectors */
              double* b, /*!< (IN/OUT) Imaginary part of input/output vectors */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -