File: fff_blas.h

package info (click to toggle)
nipy 0.6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,352 kB
  • sloc: python: 39,115; ansic: 30,931; makefile: 210; sh: 93
file content (85 lines) | stat: -rw-r--r-- 3,696 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*!
  \file fff_blas.h
  \brief lite wrapper around the Fortran Basic Linear Algeabra Library (BLAS)
  \author Alexis Roche
  \date 2008

  This library can be linked against the standard (Fortran) blas
  library, but not against cblas.
*/

#ifndef FFF_BLAS
#define FFF_BLAS

#ifdef __cplusplus
extern "C" {
#endif

#include "fff_vector.h"
#include "fff_matrix.h"

#define CBLAS_INDEX_t size_t  /* this may vary between platforms */

  typedef enum {CblasRowMajor=101, CblasColMajor=102} CBLAS_ORDER_t;
  typedef enum {CblasNoTrans=111, CblasTrans=112, CblasConjTrans=113} CBLAS_TRANSPOSE_t;
  typedef enum {CblasUpper=121, CblasLower=122} CBLAS_UPLO_t;
  typedef enum {CblasNonUnit=131, CblasUnit=132} CBLAS_DIAG_t;
  typedef enum {CblasLeft=141, CblasRight=142} CBLAS_SIDE_t;

  /* BLAS 1 */
  extern double fff_blas_ddot (const fff_vector * x, const fff_vector * y);
  extern double fff_blas_dnrm2 (const fff_vector * x);
  extern double fff_blas_dasum (const fff_vector * x);
  extern CBLAS_INDEX_t fff_blas_idamax (const fff_vector * x);
  extern int fff_blas_dswap (fff_vector * x, fff_vector * y);
  extern int fff_blas_dcopy (const fff_vector * x, fff_vector * y);
  extern int fff_blas_daxpy (double alpha, const fff_vector * x, fff_vector * y);
  extern int fff_blas_dscal (double alpha, fff_vector * x);
  extern int fff_blas_drot (fff_vector * x, fff_vector * y, double c, double s);
  extern int fff_blas_drotg (double a[], double b[], double c[], double s[]);
  extern int fff_blas_drotmg (double d1[], double d2[], double b1[], double b2, double P[]);
  extern int fff_blas_drotm (fff_vector * x, fff_vector * y, const double P[]);

  /* BLAS 2 */
  extern int fff_blas_dgemv (CBLAS_TRANSPOSE_t TransA, double alpha,
			     const fff_matrix * A, const fff_vector * x, double beta, fff_vector * y);
  extern int fff_blas_dtrmv (CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag,
			     const fff_matrix * A, fff_vector * x);
  extern int fff_blas_dtrsv (CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag,
			     const fff_matrix * A, fff_vector * x);
  extern int fff_blas_dsymv (CBLAS_UPLO_t Uplo,
			     double alpha, const fff_matrix * A,
			     const fff_vector * x, double beta, fff_vector * y);
  extern int fff_blas_dger (double alpha, const fff_vector * x, const fff_vector * y, fff_matrix * A);
  extern int fff_blas_dsyr (CBLAS_UPLO_t Uplo, double alpha, const fff_vector * x, fff_matrix * A);
  extern int fff_blas_dsyr2 (CBLAS_UPLO_t Uplo, double alpha,
			     const fff_vector * x, const fff_vector * y, fff_matrix * A);


  /* BLAS 3 */
  extern int fff_blas_dgemm (CBLAS_TRANSPOSE_t TransA, CBLAS_TRANSPOSE_t TransB,
			     double alpha, const fff_matrix * A,
			     const fff_matrix * B, double beta,
			     fff_matrix * C);
  extern int fff_blas_dsymm (CBLAS_SIDE_t Side, CBLAS_UPLO_t Uplo,
			     double alpha, const fff_matrix * A,
			     const fff_matrix * B, double beta,
			     fff_matrix * C);
  extern int fff_blas_dtrmm (CBLAS_SIDE_t Side, CBLAS_UPLO_t Uplo,
			     CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag,
			     double alpha, const fff_matrix * A, fff_matrix * B);
  extern int fff_blas_dtrsm (CBLAS_SIDE_t Side, CBLAS_UPLO_t Uplo,
			     CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag,
			     double alpha, const fff_matrix * A, fff_matrix * B);
  extern int fff_blas_dsyrk (CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t Trans,
			     double alpha, const fff_matrix * A, double beta, fff_matrix * C);
  extern int fff_blas_dsyr2k (CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t Trans,
			      double alpha, const fff_matrix * A, const fff_matrix * B,
			      double beta, fff_matrix * C);


#ifdef __cplusplus
}
#endif

#endif