lapack.h 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. extern void sgesvd_(char *JOBU, char *JOBVT, int *M, int *N, float *A, int *LDA, float *S, float *U, int *LDU, float *VT, int *LDVT, float *WORK, int *LWORK, int *INFO);
  20. /*! DGESVD computes the singular value decomposition (SVD) of a real
  21. * M-by-N matrix A, optionally computing the left and/or right singular
  22. * vectors. The SVD is written
  23. *
  24. * A = U * SIGMA * transpose(V)
  25. *
  26. * where SIGMA is an M-by-N matrix which is zero except for its
  27. * min(m,n) diagonal elements, U is an M-by-M orthogonal matrix, and
  28. * V is an N-by-N orthogonal matrix. The diagonal elements of SIGMA
  29. * are the singular values of A; they are real and non-negative, and
  30. * are returned in descending order. The first min(m,n) columns of
  31. * U and V are the left and right singular vectors of A.
  32. *
  33. * See http://www.netlib.org/lapack/double/dgesvd.f for more information
  34. */
  35. extern void dgesvd_(char *JOBU, char *JOBVT, int *M, int *N, double *A, int *LDA, double *S, double *U, int *LDU, double *VT, int *LDVT, double *WORK, int *LWORK, int *INFO);
  36. /*! DGESDD computes the singular value decomposition (SVD) of a real
  37. * M-by-N matrix A, optionally computing the left and right singular
  38. * vectors. If singular vectors are desired, it uses a
  39. * divide-and-conquer algorithm.
  40. *
  41. * The SVD is written
  42. *
  43. * A = U * SIGMA * transpose(V)
  44. *
  45. * where SIGMA is an M-by-N matrix which is zero except for its
  46. * min(m,n) diagonal elements, U is an M-by-M orthogonal matrix, and
  47. * V is an N-by-N orthogonal matrix. The diagonal elements of SIGMA
  48. ` * are the singular values of A; they are real and non-negative, and
  49. * are returned in descending order. The first min(m,n) columns of
  50. * U and V are the left and right singular vectors of A.
  51. *
  52. * See http://www.netlib.org/lapack/double/dgesdd.f for more information
  53. */
  54. extern void dgesdd_(char *jobz, int *m, int *n, double *a, int *lda, double *s, double *u, int *ldu, double *vt, int *ldvt, double *work, int *lwork, int *iwork, int *info);
  55. /*! DGETRF computes an LU factorization of a general M-by-N matrix A
  56. * using partial pivoting with row interchanges.
  57. *
  58. * The factorization has the form
  59. *
  60. * A = P * L * U
  61. *
  62. * where P is a permutation matrix, L is lower triangular with unit
  63. * diagonal elements (lower trapezoidal if m > n), and U is upper
  64. * triangular (upper trapezoidal if m < n).
  65. *
  66. * See http://www.netlib.org/lapack/double/dgetrf.f for more information
  67. */
  68. extern void dgetrf_(int *M, int *N, double *A, int *LDA, int *IPIV, int *INFO);
  69. /*! DGETRI computes the inverse of a matrix using the LU factorization
  70. * computed by DGETRF.
  71. *
  72. * This method inverts U and then computes inv(A) by solving the system
  73. * inv(A)*L = inv(U) for inv(A).
  74. *
  75. * See http://www.netlib.org/lapack/double/dgetri.f for more information
  76. */
  77. extern void dgetri_(int *N, double *A, int *LDA, int *IPIV, double *WORK, int *LWORK, int *INFO);
  78. }
  79. // EXTERN_C_END
  80. #endif