Permalink
Browse files

Add DLACPY binding

  • Loading branch information...
1 parent c4484ca commit f3311f0446fb90d05a0425e2e00dcbfe3d374390 @patperry committed Oct 16, 2011
Showing with 27 additions and 0 deletions.
  1. +6 −0 lib/f77lapack.h
  2. +12 −0 src/lapack.c
  3. +9 −0 src/lapack.h
View
@@ -6,6 +6,8 @@
#define F77_SVDJOB(j) const char *j ## _ = (j == LA_SVD_ALL ? "A" \
: j == LA_SVD_SEP ? "S" \
: j == LA_SVD_OVER ? "O" : "N")
+#define F77_COPYJOB(j) const char *j ## _ = (j == LA_COPY_UPPER ? "U" \
+ : j == LA_COPY_LOWER ? "L" : "A")
#define F77_EIGJOB(j) const char *j ## _ = (j == LA_EIG_VEC ? "V" : "N")
int F77_FUNC(dgesdd) (const char *jobz, const f77int *m, const f77int *n,
@@ -14,6 +16,10 @@ int F77_FUNC(dgesdd) (const char *jobz, const f77int *m, const f77int *n,
double *work, const f77int *lwork, f77int *iwork,
f77int *info);
+int F77_FUNC(dlacpy) (const char *uplo, const f77int *m, const f77int *n,
+ const double *a, const f77int *lda, double *b,
+ const f77int *ldb);
+
int F77_FUNC(dposv) (const char *uplo, const f77int *n, const f77int *nrhs,
double *a, const f77int *lda, double *b, const f77int *ldb,
f77int *info);
View
@@ -43,6 +43,18 @@ size_t lapack_dgesdd_lwork(enum lapack_svdjob jobz, size_t m, size_t n,
return (size_t)work;
}
+void lapack_dlacpy(enum lapack_copyjob uplo, size_t m, size_t n,
+ const double *a, size_t lda, double *b, size_t ldb)
+{
+ F77_COPYJOB(uplo);
+ F77_INT(m);
+ F77_INT(n);
+ F77_INT(lda);
+ F77_INT(ldb);
+
+ F77_FUNC(dlacpy) (uplo_, &m_, &n_, a, &lda_, b, &ldb_);
+}
+
ptrdiff_t lapack_dposv(enum blas_uplo uplo, size_t n, size_t nrhs,
double *a, size_t lda, double *b, size_t ldb)
{
View
@@ -4,6 +4,12 @@
#include <stddef.h>
#include "blas.h"
+enum lapack_copyjob {
+ LA_COPY_UPPER = BLAS_UPPER,
+ LA_COPY_LOWER = BLAS_LOWER,
+ LA_COPY_ALL
+};
+
enum lapack_eigjob {
LA_EIG_NOVEC,
LA_EIG_VEC
@@ -24,6 +30,9 @@ ptrdiff_t lapack_dgesdd(enum lapack_svdjob jobz, size_t m, size_t n,
size_t lapack_dgesdd_lwork(enum lapack_svdjob jobz, size_t m, size_t n,
size_t *liwork);
+void lapack_dlacpy(enum lapack_copyjob uplo, size_t m, size_t n,
+ const double *a, size_t lda, double *b, size_t ldb);
+
ptrdiff_t lapack_dposv(enum blas_uplo uplo, size_t n, size_t nrhs,
double *a, size_t lda, double *b, size_t ldb);

0 comments on commit f3311f0

Please sign in to comment.