Commits

Fazlul Shahriar committed fc5c7c4

add some level2 functions

Comments (0)

Files changed (1)

 
 import "unsafe"
 
-// Sgemv updates y: y <- alpha*transA(A)*x + beta*y.
+// Sgemv updates y: y <- alpha*A*x + beta*y.
 func Sgemv(transA uint32, alpha float32, A *Float32Matrix, x *Float32Vector,
 beta float32, y *Float32Vector) {
 	C.cblas_sgemv(rowMajor, transA, C.int(A.Rows), C.int(A.Cols), C.float(alpha),
                  const int KL, const int KU, const float alpha,
                  const float *A, const int lda, const float *X,
                  const int incX, const float beta, float *Y, const int incY);
-void cblas_strmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
-                 const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag,
-                 const int N, const float *A, const int lda,
-                 float *X, const int incX);
+*/
+
+// Strmv updates x: x <- A*x.
+func Strmv(uplo, transA, diag uint32, A *Float32Matrix, x *Float32Vector) {
+	C.cblas_strmv(rowMajor, uplo, transA, diag, C.int(x.Size),
+		(*C.float)(unsafe.Pointer(&A.Data[0])), C.int(A.Lda),
+		(*C.float)(unsafe.Pointer(&x.Data[0])), C.int(x.Stride))
+}
+
+/*
 void cblas_stbmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                  const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag,
                  const int N, const int K, const float *A, const int lda,
 void cblas_stpmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                  const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag,
                  const int N, const float *Ap, float *X, const int incX);
-void cblas_strsv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
-                 const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag,
-                 const int N, const float *A, const int lda, float *X,
-                 const int incX);
+*/
+
+// Strsv updates x: x <- inv(A)*x.
+func Strsv(uplo, transA, diag uint32, A *Float32Matrix, x *Float32Vector) {
+	C.cblas_strsv(rowMajor, uplo, transA, diag, C.int(x.Size),
+		(*C.float)(unsafe.Pointer(&A.Data[0])), C.int(A.Lda),
+		(*C.float)(unsafe.Pointer(&x.Data[0])), C.int(x.Stride))
+}
+
+/*
 void cblas_stbsv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                  const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag,
                  const int N, const int K, const float *A, const int lda,
 void cblas_stpsv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                  const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag,
                  const int N, const float *Ap, float *X, const int incX);
+*/
 
-void cblas_dgemv(const enum CBLAS_ORDER Order,
-                 const enum CBLAS_TRANSPOSE TransA, const int M, const int N,
-                 const double alpha, const double *A, const int lda,
-                 const double *X, const int incX, const double beta,
-                 double *Y, const int incY);
+// Dgemv updates y: y <- alpha*A*x + beta*y.
+func Dgemv(transA uint32, alpha float64, A *Float64Matrix, x *Float64Vector,
+beta float64, y *Float64Vector) {
+	C.cblas_dgemv(rowMajor, transA, C.int(A.Rows), C.int(A.Cols), C.double(alpha),
+		(*C.double)(unsafe.Pointer(&A.Data[0])), C.int(A.Lda),
+		(*C.double)(unsafe.Pointer(&x.Data[0])), C.int(x.Stride), C.double(beta),
+		(*C.double)(unsafe.Pointer(&y.Data[0])), C.int(y.Stride))
+}
+
+/*
 void cblas_dgbmv(const enum CBLAS_ORDER Order,
                  const enum CBLAS_TRANSPOSE TransA, const int M, const int N,
                  const int KL, const int KU, const double alpha,
                  const double *A, const int lda, const double *X,
                  const int incX, const double beta, double *Y, const int incY);
-void cblas_dtrmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
-                 const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag,
-                 const int N, const double *A, const int lda,
-                 double *X, const int incX);
+*/
+
+// Dtrmv updates x: x <- A*x.
+func Dtrmv(uplo, transA, diag uint32, A *Float64Matrix, x *Float64Vector) {
+	C.cblas_dtrmv(rowMajor, uplo, transA, diag, C.int(x.Size),
+		(*C.double)(unsafe.Pointer(&A.Data[0])), C.int(A.Lda),
+		(*C.double)(unsafe.Pointer(&x.Data[0])), C.int(x.Stride))
+}
+
+/*
 void cblas_dtbmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                  const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag,
                  const int N, const int K, const double *A, const int lda,
 void cblas_dtpmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                  const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag,
                  const int N, const double *Ap, double *X, const int incX);
-void cblas_dtrsv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
-                 const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag,
-                 const int N, const double *A, const int lda, double *X,
-                 const int incX);
+*/
+
+// Dtrsv updates x: x <- inv(A)*x.
+func Dtrsv(uplo, transA, diag uint32, A *Float64Matrix, x *Float64Vector) {
+	C.cblas_dtrsv(rowMajor, uplo, transA, diag, C.int(x.Size),
+		(*C.double)(unsafe.Pointer(&A.Data[0])), C.int(A.Lda),
+		(*C.double)(unsafe.Pointer(&x.Data[0])), C.int(x.Stride))
+}
+
+/*
 void cblas_dtbsv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                  const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag,
                  const int N, const int K, const double *A, const int lda,
 void cblas_dtpsv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                  const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag,
                  const int N, const double *Ap, double *X, const int incX);
+*/
 
-void cblas_cgemv(const enum CBLAS_ORDER Order,
-                 const enum CBLAS_TRANSPOSE TransA, const int M, const int N,
-                 const void *alpha, const void *A, const int lda,
-                 const void *X, const int incX, const void *beta,
-                 void *Y, const int incY);
+// Cgemv updates y: y <- alpha*A*x + beta*y.
+func Cgemv(transA uint32, alpha complex64, A *Complex64Matrix, x *Complex64Vector,
+beta complex64, y *Complex64Vector) {
+	C.cblas_cgemv(rowMajor, transA, C.int(A.Rows), C.int(A.Cols), unsafe.Pointer(&alpha),
+		unsafe.Pointer(&A.Data[0]), C.int(A.Lda),
+		unsafe.Pointer(&x.Data[0]), C.int(x.Stride), unsafe.Pointer(&beta),
+		unsafe.Pointer(&y.Data[0]), C.int(y.Stride))
+}
+
+/*
 void cblas_cgbmv(const enum CBLAS_ORDER Order,
                  const enum CBLAS_TRANSPOSE TransA, const int M, const int N,
                  const int KL, const int KU, const void *alpha,
                  const void *A, const int lda, const void *X,
                  const int incX, const void *beta, void *Y, const int incY);
-void cblas_ctrmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
-                 const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag,
-                 const int N, const void *A, const int lda,
-                 void *X, const int incX);
+*/
+
+// Ctrmv updates x <- A*x.
+func Ctrmv(uplo, transA, diag uint32, A *Complex64Matrix, x *Complex64Vector) {
+	C.cblas_ctrmv(rowMajor, uplo, transA, diag, C.int(x.Size),
+		unsafe.Pointer(&A.Data[0]), C.int(A.Lda),
+		unsafe.Pointer(&x.Data[0]), C.int(x.Stride))
+}
+
+/*
 void cblas_ctbmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                  const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag,
                  const int N, const int K, const void *A, const int lda,
 void cblas_ctpmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                  const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag,
                  const int N, const void *Ap, void *X, const int incX);
-void cblas_ctrsv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
-                 const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag,
-                 const int N, const void *A, const int lda, void *X,
-                 const int incX);
+*/
+
+// Ctrsv updates x: x <- inv(A)*x.
+func Ctrsv(uplo, transA, diag uint32, A *Complex64Matrix, x *Complex64Vector) {
+	C.cblas_ctrsv(rowMajor, uplo, transA, diag, C.int(x.Size),
+		unsafe.Pointer(&A.Data[0]), C.int(A.Lda),
+		unsafe.Pointer(&x.Data[0]), C.int(x.Stride))
+}
+
+/*
 void cblas_ctbsv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                  const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag,
                  const int N, const int K, const void *A, const int lda,
 void cblas_ctpsv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                  const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag,
                  const int N, const void *Ap, void *X, const int incX);
+*/
 
-void cblas_zgemv(const enum CBLAS_ORDER Order,
-                 const enum CBLAS_TRANSPOSE TransA, const int M, const int N,
-                 const void *alpha, const void *A, const int lda,
-                 const void *X, const int incX, const void *beta,
-                 void *Y, const int incY);
+// Zgemv updates y: y <- alpha*A*x + beta*y.
+func Zgemv(transA uint32, alpha complex128, A *Complex128Matrix,
+x *Complex128Vector, beta complex128, y *Complex128Vector) {
+	C.cblas_zgemv(rowMajor, transA, C.int(A.Rows), C.int(A.Cols), unsafe.Pointer(&alpha),
+		unsafe.Pointer(&A.Data[0]), C.int(A.Lda),
+		unsafe.Pointer(&x.Data[0]), C.int(x.Stride), unsafe.Pointer(&beta),
+		unsafe.Pointer(&y.Data[0]), C.int(y.Stride))
+}
+
+/*
 void cblas_zgbmv(const enum CBLAS_ORDER Order,
                  const enum CBLAS_TRANSPOSE TransA, const int M, const int N,
                  const int KL, const int KU, const void *alpha,
                  const void *A, const int lda, const void *X,
                  const int incX, const void *beta, void *Y, const int incY);
-void cblas_ztrmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
-                 const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag,
-                 const int N, const void *A, const int lda,
-                 void *X, const int incX);
+*/
+
+// Ztrmv updates x <- A*x.
+func Ztrmv(uplo, transA, diag uint32, A *Complex128Matrix, x *Complex128Vector) {
+	C.cblas_ztrmv(rowMajor, uplo, transA, diag, C.int(x.Size),
+		unsafe.Pointer(&A.Data[0]), C.int(A.Lda),
+		unsafe.Pointer(&x.Data[0]), C.int(x.Stride))
+}
+
+/*
 void cblas_ztbmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                  const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag,
                  const int N, const int K, const void *A, const int lda,
 void cblas_ztpmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                  const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag,
                  const int N, const void *Ap, void *X, const int incX);
-void cblas_ztrsv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
-                 const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag,
-                 const int N, const void *A, const int lda, void *X,
-                 const int incX);
+*/
+
+// Ztrsv updates x: x <- inv(A)*x.
+func Ztrsv(uplo, transA, diag uint32, A *Complex128Matrix, x *Complex128Vector) {
+	C.cblas_ztrsv(rowMajor, uplo, transA, diag, C.int(x.Size),
+		unsafe.Pointer(&A.Data[0]), C.int(A.Lda),
+		unsafe.Pointer(&x.Data[0]), C.int(x.Stride))
+}
+
+/*
 void cblas_ztbsv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                  const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag,
                  const int N, const int K, const void *A, const int lda,