lapack.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /* Kernel Independent Fast Multipole Method
  2. Copyright (C) 2004 Lexing Ying, New York University
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; either version 2, or (at your option)
  6. any later version.
  7. This program is distributed in the hope that it will be useful, but WITHOUT
  8. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  9. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  10. for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; see the file COPYING. If not, write to the Free
  13. Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  14. 02111-1307, USA. */
  15. #ifndef _LAPACK_H_
  16. #define _LAPACK_H_
  17. //EXTERN_C_BEGIN
  18. extern "C"
  19. {
  20. extern void sgesvd_(char *JOBU, char *JOBVT, int *M, int *N, float *A, int *LDA,
  21. float *S, float *U, int *LDU, float *VT, int *LDVT, float *WORK, int *LWORK, int *INFO);
  22. /*! DGESVD computes the singular value decomposition (SVD) of a real
  23. * M-by-N matrix A, optionally computing the left and/or right singular
  24. * vectors. The SVD is written
  25. *
  26. * A = U * SIGMA * transpose(V)
  27. *
  28. * where SIGMA is an M-by-N matrix which is zero except for its
  29. * min(m,n) diagonal elements, U is an M-by-M orthogonal matrix, and
  30. * V is an N-by-N orthogonal matrix. The diagonal elements of SIGMA
  31. * are the singular values of A; they are real and non-negative, and
  32. * are returned in descending order. The first min(m,n) columns of
  33. * U and V are the left and right singular vectors of A.
  34. *
  35. * See http://www.netlib.org/lapack/double/dgesvd.f for more information
  36. */
  37. extern void dgesvd_(char *JOBU, char *JOBVT, int *M, int *N, double *A, int *LDA,
  38. double *S, double *U, int *LDU, double *VT, int *LDVT, double *WORK, int *LWORK, int *INFO);
  39. /*! DGESDD computes the singular value decomposition (SVD) of a real
  40. * M-by-N matrix A, optionally computing the left and right singular
  41. * vectors. If singular vectors are desired, it uses a
  42. * divide-and-conquer algorithm.
  43. *
  44. * The SVD is written
  45. *
  46. * A = U * SIGMA * transpose(V)
  47. *
  48. * where SIGMA is an M-by-N matrix which is zero except for its
  49. * min(m,n) diagonal elements, U is an M-by-M orthogonal matrix, and
  50. * V is an N-by-N orthogonal matrix. The diagonal elements of SIGMA
  51. ` * are the singular values of A; they are real and non-negative, and
  52. * are returned in descending order. The first min(m,n) columns of
  53. * U and V are the left and right singular vectors of A.
  54. *
  55. * See http://www.netlib.org/lapack/double/dgesdd.f for more information
  56. */
  57. extern void dgesdd_(char *jobz, int* m, int* n, double* a, int* lda,
  58. double* s, double* u, int* ldu, double* vt, int* ldvt, double* work, int* lwork, int* iwork, int* info);
  59. /*! DGETRF computes an LU factorization of a general M-by-N matrix A
  60. * using partial pivoting with row interchanges.
  61. *
  62. * The factorization has the form
  63. *
  64. * A = P * L * U
  65. *
  66. * where P is a permutation matrix, L is lower triangular with unit
  67. * diagonal elements (lower trapezoidal if m > n), and U is upper
  68. * triangular (upper trapezoidal if m < n).
  69. *
  70. * See http://www.netlib.org/lapack/double/dgetrf.f for more information
  71. */
  72. extern void dgetrf_(int *M, int *N, double *A, int *LDA, int *IPIV, int *INFO);
  73. /*! DGETRI computes the inverse of a matrix using the LU factorization
  74. * computed by DGETRF.
  75. *
  76. * This method inverts U and then computes inv(A) by solving the system
  77. * inv(A)*L = inv(U) for inv(A).
  78. *
  79. * See http://www.netlib.org/lapack/double/dgetri.f for more information
  80. */
  81. extern void dgetri_(int *N, double *A, int *LDA, int *IPIV, double *WORK, int *LWORK, int *INFO);
  82. }
  83. //EXTERN_C_END
  84. #endif