Commits

Anonymous committed 8d188f8

cosmetics

Comments (0)

Files changed (1)

pkg/cblas_lvl1.go

  #include <complex.h>
  #undef I
  #include "cblas.h"
-*/
+ */
 import "C"
 import "unsafe"
 
  */
 
 /*
- float  cblas_sdsdot(const int N, const float alpha, 
- const float *X, const int incX, 
- const float *Y, const int incY);
-*/
+ float  cblas_sdsdot(const int N, const float alpha, const float *X, const int incX, const float *Y, const int incY);
+ */
 func Sdsdot(alpha float32, x, y []float32) float32 {
 	if len(x) != len(y) {
 		panic("slices' size differ")
 
 	return float32(
 		C.cblas_sdsdot(c_N, c_alpha,
-			c_X, c_incX,
-			c_Y, c_incY))
+		c_X, c_incX,
+		c_Y, c_incY))
 }
 
 /*
- double cblas_dsdot(const int N, const float *X, const int incX, const float *Y,
- const int incY);
-*/
+ double cblas_dsdot(const int N, const float *X, const int incX, const float *Y, const int incY);
+ */
 func Dsdot(x, y []float32) float64 {
 	if len(x) != len(y) {
 		panic("slices' size differ")
 
 	return float64(
 		C.cblas_dsdot(c_N,
-			c_X, c_incX,
-			c_Y, c_incY))
+		c_X, c_incX,
+		c_Y, c_incY))
 }
 
 /*
  float  cblas_sdot(const int N, const float  *X, const int incX,
  const float  *Y, const int incY);
-*/
+ */
 func Sdot(x, y []float32) float32 {
 	if len(x) != len(y) {
 		panic("slices' size differ")
 
 	return float32(
 		C.cblas_sdot(c_N,
-			c_X, c_incX,
-			c_Y, c_incY))
+		c_X, c_incX,
+		c_Y, c_incY))
 
 }
 
 /*
  double cblas_ddot(const int N, const double *X, const int incX,
  const double *Y, const int incY);
-*/
+ */
 func Ddot(x, y []float64) float64 {
 	if len(x) != len(y) {
 		panic("slices' size differ")
 
 	return float64(
 		C.cblas_ddot(c_N,
-			c_X, c_incX,
-			c_Y, c_incY))
+		c_X, c_incX,
+		c_Y, c_incY))
 }
 
 /*
  void   cblas_cdotu_sub(const int N, const void *X, const int incX,
  const void *Y, const int incY, void *dotu);
-*/
+ */
 func Cdotu(x, y []complex64) complex64 {
 
 	if len(x) != len(y) {
 /*
  void   cblas_cdotc_sub(const int N, const void *X, const int incX,
  const void *Y, const int incY, void *dotc);
-*/
+ */
 func Cdotc(x, y []complex64) complex64 {
 
 	if len(x) != len(y) {
 
 /*
  void   cblas_zdotu_sub(const int N, const void *X, const int incX,
-                        const void *Y, const int incY, void *dotu);
-*/
+ const void *Y, const int incY, void *dotu);
+ */
 func Zdotu(x, y []complex128) complex128 {
 
 	if len(x) != len(y) {
  panic("slices' size differ")
  }
 
- var ret C.complex64_t
+ var ret C.complexfloat
  c_ret := (*C.char)(unsafe.Pointer(ret))
 
  c_N := C.int(len(x))
 
- c_X    := (*C.complex64_t)(unsafe.Pointer(&x[0]))
+ c_X    := (*C.complexfloat)(unsafe.Pointer(&x[0]))
  c_incX := C.int(1)
 
- c_Y    := (*C.complex64_t)(unsafe.Pointer(&y[0]))
+ c_Y    := (*C.complexfloat)(unsafe.Pointer(&y[0]))
  c_incY := C.int(-1)
 
  C.cblas_cdotu_sub(c_N,
  c_Y, c_incY,
  c_ret)
 
- return cmplx(
- float64(ret.real), 
- float64(ret.imag))
+ return complex(
+ float32(ret.real), 
+ float32(ret.imag))
  }
-*/
+ */
 
 /*
  float  cblas_snrm2(const int N, const float *X, const int incX);
-*/
+ */
 func Snrm2(x []float32) float32 {
 
 	c_N := C.int(len(x))
 
 /*
  float  cblas_sasum(const int N, const float *X, const int incX);
-*/
+ */
 func Sasum(x []float32) float32 {
 
 	c_N := C.int(len(x))
 
 /*
  double cblas_dnrm2(const int N, const double *X, const int incX);
-*/
+ */
 func Dnrm2(x []float64) float64 {
 	c_N := C.int(len(x))
 
 
 /*
  double cblas_dasum(const int N, const double *X, const int incX);
-*/
+ */
 func Dasum(x []float64) float64 {
 	c_N := C.int(len(x))
 
 
 /*
  float  cblas_scnrm2(const int N, const void *X, const int incX);
-*/
+ */
 func Scnrm2(x []complex64) float32 {
 
 	c_N := C.int(len(x))
 
 /*
  float  cblas_scasum(const int N, const void *X, const int incX);
-*/
+ */
 func Scasum(x []complex64) float32 {
 
 	c_N := C.int(len(x))
 
 /*
  double  cblas_dznrm2(const int N, const void *X, const int incX);
-*/
+ */
 func Dznrm2(x []complex64) float64 {
 
 	c_N := C.int(len(x))
 
 /*
  double  cblas_dzasum(const int N, const void *X, const int incX);
-*/
+ */
 func Dzasum(x []complex128) float64 {
 
 	c_N := C.int(len(x))
 
 /*
  CBLAS_INDEX cblas_isamax(const int N, const float  *X, const int incX);
-*/
+ */
 func Isamax(x []float32) Index {
 	c_N := C.int(len(x))
 	c_X := (*C.float)(unsafe.Pointer(&x[0]))
 
 /*
  CBLAS_INDEX cblas_idamax(const int N, const double *X, const int incX);
-*/
+ */
 func Idamax(x []float64) Index {
 	c_N := C.int(len(x))
 	c_X := (*C.double)(unsafe.Pointer(&x[0]))