1 /*
2    DASUM - BLAS level one, sums the absolute values of the elements of
3    a double precision vector
4 
5    * cblas_dasum.c
6    *
7    * The program is a C interface to dasum
8    * It calls the fortran wrapper before calling dasum.
9    *
10    * Written by Keita Teranishi.  2/11/1998
11 
12    CBLAS provides a C interface to the BLAS routines, which were
13    originally written in FORTRAN.  CBLAS wrappers are already provided
14    on Windows and OS X, but not on other UNIX-like operating systems
15    (such as Linux). For most platforms (particularly AMD chips), I
16    recommend Kazushige Goto's High-Performance BLAS Library:
17 
18    http://www.cs.utexas.edu/users/flame/goto/
19 
20    For more information on BLAS (including function definitions) see:
21    http://www.netlib.org/blas/
22 
23    Note that I have only included wrappers for the BLAS functions which
24    the Matching package actually uses.
25 
26    Jas Sekhon
27    <sekhon@berkeley.edu>
28    http://sekhon.berkeley.edu
29    August 1, 2007
30 */
31 
32 
33 #include <R.h>
34 #include <R_ext/Applic.h> /* R blas declarations */
35 
36 #include "cblas.h"
cblas_dasum(const int N,const double * X,const int incX)37 double cblas_dasum( const int N, const double *X, const int incX)
38 {
39    double asum;
40 #ifdef F77_INT
41    F77_INT F77_N=N, F77_incX=incX;
42 #else
43    #define F77_N N
44    #define F77_incX incX
45 #endif
46    asum = F77_CALL(dasum)( &F77_N, X, &F77_incX);
47    return asum;
48 }
49