cgo-cblas / cblas / level2.go

// Copyright 2011 Fazlul Shahriar. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package cblas

// #include <complex.h>
// #include <cblas.h>
import "C"

import "unsafe"

// 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),
		(*C.float)(unsafe.Pointer(&A.Data[0])), C.int(A.Lda),
		(*C.float)(unsafe.Pointer(&x.Data[0])), C.int(x.Stride), C.float(beta),
		(*C.float)(unsafe.Pointer(&y.Data[0])), C.int(y.Stride))
}

/*
void cblas_sgbmv(const enum CBLAS_ORDER Order,
                 const enum CBLAS_TRANSPOSE TransA, const int M, const int N,
                 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);
*/

// 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,
                 float *X, const int incX);
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);
*/

// 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,
                 float *X, const int incX);
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);
*/

// 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);
*/

// 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,
                 double *X, const int incX);
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);
*/

// 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,
                 double *X, const int incX);
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);
*/

// 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);
*/

// 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 *X, const int incX);
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);
*/

// 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 *X, const int incX);
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);
*/

// 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);
*/

// 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 *X, const int incX);
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);
*/

// 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,
                 void *X, const int incX);
void cblas_ztpsv(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_ssymv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                 const int N, 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_ssbmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                 const int N, const int K, 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_sspmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                 const int N, const float alpha, const float *Ap,
                 const float *X, const int incX,
                 const float beta, float *Y, const int incY);
void cblas_sger(const enum CBLAS_ORDER Order, const int M, const int N,
                const float alpha, const float *X, const int incX,
                const float *Y, const int incY, float *A, const int lda);
void cblas_ssyr(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                const int N, const float alpha, const float *X,
                const int incX, float *A, const int lda);
void cblas_sspr(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                const int N, const float alpha, const float *X,
                const int incX, float *Ap);
void cblas_ssyr2(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                const int N, const float alpha, const float *X,
                const int incX, const float *Y, const int incY, float *A,
                const int lda);
void cblas_sspr2(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                const int N, const float alpha, const float *X,
                const int incX, const float *Y, const int incY, float *A);

void cblas_dsymv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                 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);
void cblas_dsbmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                 const int N, const int K, 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_dspmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                 const int N, const double alpha, const double *Ap,
                 const double *X, const int incX,
                 const double beta, double *Y, const int incY);
void cblas_dger(const enum CBLAS_ORDER Order, const int M, const int N,
                const double alpha, const double *X, const int incX,
                const double *Y, const int incY, double *A, const int lda);
void cblas_dsyr(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                const int N, const double alpha, const double *X,
                const int incX, double *A, const int lda);
void cblas_dspr(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                const int N, const double alpha, const double *X,
                const int incX, double *Ap);
void cblas_dsyr2(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                const int N, const double alpha, const double *X,
                const int incX, const double *Y, const int incY, double *A,
                const int lda);
void cblas_dspr2(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                const int N, const double alpha, const double *X,
                const int incX, const double *Y, const int incY, double *A);


void cblas_chemv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                 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);
void cblas_chbmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                 const int N, const int K, 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_chpmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                 const int N, const void *alpha, const void *Ap,
                 const void *X, const int incX,
                 const void *beta, void *Y, const int incY);
void cblas_cgeru(const enum CBLAS_ORDER Order, const int M, const int N,
                 const void *alpha, const void *X, const int incX,
                 const void *Y, const int incY, void *A, const int lda);
void cblas_cgerc(const enum CBLAS_ORDER Order, const int M, const int N,
                 const void *alpha, const void *X, const int incX,
                 const void *Y, const int incY, void *A, const int lda);
void cblas_cher(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                const int N, const float alpha, const void *X, const int incX,
                void *A, const int lda);
void cblas_chpr(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                const int N, const float alpha, const void *X,
                const int incX, void *A);
void cblas_cher2(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const int N,
                const void *alpha, const void *X, const int incX,
                const void *Y, const int incY, void *A, const int lda);
void cblas_chpr2(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const int N,
                const void *alpha, const void *X, const int incX,
                const void *Y, const int incY, void *Ap);

void cblas_zhemv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                 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);
void cblas_zhbmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                 const int N, const int K, 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_zhpmv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                 const int N, const void *alpha, const void *Ap,
                 const void *X, const int incX,
                 const void *beta, void *Y, const int incY);
void cblas_zgeru(const enum CBLAS_ORDER Order, const int M, const int N,
                 const void *alpha, const void *X, const int incX,
                 const void *Y, const int incY, void *A, const int lda);
void cblas_zgerc(const enum CBLAS_ORDER Order, const int M, const int N,
                 const void *alpha, const void *X, const int incX,
                 const void *Y, const int incY, void *A, const int lda);
void cblas_zher(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                const int N, const double alpha, const void *X, const int incX,
                void *A, const int lda);
void cblas_zhpr(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo,
                const int N, const double alpha, const void *X,
                const int incX, void *A);
void cblas_zher2(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const int N,
                const void *alpha, const void *X, const int incX,
                const void *Y, const int incY, void *A, const int lda);
void cblas_zhpr2(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const int N,
                const void *alpha, const void *X, const int incX,
                const void *Y, const int incY, void *Ap);
*/
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.