mat_utils.hpp 895 B

123456789101112131415161718192021222324252627282930313233343536
  1. /**
  2. * \file mat_utils.hpp
  3. * \author Dhairya Malhotra, dhairya.malhotra@gmail.com
  4. * \date 2-11-2011
  5. * \brief This file contains BLAS and LAPACK wrapper functions.
  6. */
  7. #ifndef _PVFMM_MAT_UTILS_
  8. #define _PVFMM_MAT_UTILS_
  9. #include <cstdlib>
  10. namespace pvfmm{
  11. namespace mat{
  12. template <class T>
  13. void gemm(char TransA, char TransB, int M, int N, int K, T alpha, T *A, int lda, T *B, int ldb, T beta, T *C, int ldc);
  14. template <class T>
  15. void svd(char *JOBU, char *JOBVT, int *M, int *N, T *A, int *LDA,
  16. T *S, T *U, int *LDU, T *VT, int *LDVT, T *WORK, int *LWORK,
  17. int *INFO);
  18. /**
  19. * \brief Computes the pseudo inverse of matrix M(n1xn2) (in row major form)
  20. * and returns the output M_(n2xn1).
  21. */
  22. template <class T>
  23. void pinv(T* M, int n1, int n2, T eps, T* M_);
  24. }//end namespace
  25. }//end namespace
  26. #include <mat_utils.txx>
  27. #endif //_PVFMM_MAT_UTILS_