-
Notifications
You must be signed in to change notification settings - Fork 6
/
cblas_dasum.c
49 lines (40 loc) · 1.36 KB
/
cblas_dasum.c
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
/*
DASUM - BLAS level one, sums the absolute values of the elements of
a double precision vector
* cblas_dasum.c
*
* The program is a C interface to dasum
* It calls the fortran wrapper before calling dasum.
*
* Written by Keita Teranishi. 2/11/1998
CBLAS provides a C interface to the BLAS routines, which were
originally written in FORTRAN. CBLAS wrappers are already provided
on Windows and OS X, but not on other UNIX-like operating systems
(such as Linux). For most platforms (particularly AMD chips), I
recommend Kazushige Goto's High-Performance BLAS Library:
http://www.cs.utexas.edu/users/flame/goto/
For more information on BLAS (including function definitions) see:
http://www.netlib.org/blas/
Note that I have only included wrappers for the BLAS functions which
the Matching package actually uses.
Jas Sekhon
<sekhon@berkeley.edu>
https://www.jsekhon.com
August 1, 2007
*/
#include <R.h>
#include <R_ext/Applic.h> /* No longer contains R blas declarations */
#include <R_ext/BLAS.h> /* New R blas declarations */
//#include "cblas.h"
double cblas_dasum( const int N, const double *X, const int incX)
{
double asum;
#ifdef F77_INT
F77_INT F77_N=N, F77_incX=incX;
#else
#define F77_N N
#define F77_incX incX
#endif
asum = F77_CALL(dasum)( &F77_N, X, &F77_incX);
return asum;
}