/* blas/gsl_cblas.h
*
* Copyright (C) 1996, 1997, 1998, 1999, 2000 Gerard Jungman
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/* This is a copy of the CBLAS standard header.
* We carry this around so we do not have to
* break our model for flexible BLAS functionality.
*/
#ifndef __GSL_CBLAS_H__
#define __GSL_CBLAS_H__
#if !defined( CBL_FUN )
# if !defined( CBLAS_DLL )
# define CBL_FUN extern
# elif defined( BUILD_CBLAS_DLL )
# define CBL_FUN extern __declspec(dllexport)
# else
# define CBL_FUN extern __declspec(dllimport)
# endif
#endif
#include <stddef.h>
#undef __BEGIN_DECLS
#undef __END_DECLS
#ifdef __cplusplus
#define __BEGIN_DECLS extern "C" {
#define __END_DECLS }
#else
#define __BEGIN_DECLS /* empty */
#define __END_DECLS /* empty */
#endif
__BEGIN_DECLS
/*
* Enumerated and derived types
*/
#define CBLAS_INDEX size_t /* this may vary between platforms */
enum CBLAS_ORDER {CblasRowMajor=101, CblasColMajor=102};
enum CBLAS_TRANSPOSE {CblasNoTrans=111, CblasTrans=112, CblasConjTrans=113};
enum CBLAS_UPLO {CblasUpper=121, CblasLower=122};
enum CBLAS_DIAG {CblasNonUnit=131, CblasUnit=132};
enum CBLAS_SIDE {CblasLeft=141, CblasRight=142};
/*
* ===========================================================================
* Prototypes for level 1 BLAS functions (complex are recast as routines)
* ===========================================================================
*/
CBL_FUN float cblas_sdsdot(const int N, const float alpha, const float *X,
const int incX, const float *Y, const int incY);
CBL_FUN double cblas_dsdot(const int N, const float *X, const int incX, const float *Y,
const int incY);
CBL_FUN float cblas_sdot(const int N, const float *X, const int incX,
const float *Y, const int incY);
CBL_FUN double cblas_ddot(const int N, const double *X, const int incX,
const double *Y, const int incY);
/*
* Functions having prefixes Z and C only
*/
CBL_FUN void cblas_cdotu_sub(const int N, const void *X, const int incX,
const void *Y, const int incY, void *dotu);
CBL_FUN void cblas_cdotc_sub(const int N, const void *X, const int incX,
const void *Y, const int incY, void *dotc);
CBL_FUN void cblas_zdotu_sub(const int N, const void *X, const int incX,
const void *Y, const int incY, void *dotu);
CBL_FUN void cblas_zdotc_sub(const int N, const void *X, const int incX,
const void *Y, const int incY, void *dotc);
/*
* Functions having prefixes S D SC DZ
*/
CBL_FUN float cblas_snrm2(const int N, const float *X, const int incX);
CBL_FUN float cblas_sasum(const int N, const float *X, const int incX);
CBL_FUN double cblas_dnrm2(const int N, const double *X, const int incX);
CBL_FUN double cblas_dasum(const int N, const double *X, const int incX);
CBL_FUN float cblas_scnrm2(const int N, const void *X, const int incX);
CBL_FUN float cblas_scasum(const int N, const void *X, const int incX);
CBL_FUN double cblas_dznrm2(const int N, const void *X, const int incX);
CBL_FUN double cblas_dzasum(const int N, const void *X, const int incX);
/*
* Functions having standard 4 prefixes (S D C Z)
*/
CBL_FUN CBLAS_INDEX cblas_isamax(const int N, const float *X, const int incX);
CBL_FUN CBLAS_INDEX cblas_idamax(const int N, const double *X, const int incX);
CBL_FUN CBLAS_INDEX cblas_icamax(const int N, const void *X, const int incX);
CBL_FUN CBLAS_INDEX cblas_izamax(const int N, const void *X, const int incX);
/*
* ===========================================================================
* Prototypes for level 1 BLAS routines
* ===========================================================================
*/
/*
* Routines with standard 4 prefixes (s, d, c, z)
*/
CBL_FUN void cblas_sswap(const int N, float *X, const int incX,
float *Y, const int incY);
CBL_FUN void cblas_scopy(const int N, const float *X, const int incX,
float *Y, const int incY);
CBL_FUN void cblas_saxpy(const int N, const float alpha, const float *X,
const int incX, float *Y, const int incY);
CBL_FUN void cblas_dswap(const int N, double *X, const int incX,
double *Y, const int incY);
CBL_FUN void cblas_dcopy(const int N, const double *X, const int incX,
double *Y, const int incY);
CBL_FUN void cblas_daxpy(const int N, const double alpha, const double *X,
const int incX, double *Y, const int incY);
CBL_FUN void cblas_cswap(const int N, void *X, const int incX,
void *Y, const int incY);
CBL_FUN void cblas_ccopy(const int N, const void *X, const int incX,
void *Y, const int incY);
CBL_FUN void cblas_caxpy(const int N, const void *alpha, const void *X,
const int incX, void *Y, const int incY);
CBL_FUN void cblas_zswap(const int N, void *X, const int incX,
void *Y, const int incY);
CBL_FUN void cblas_zcopy(const int N, const void *X, const int incX,
void *Y, const int incY);
CBL_FUN void cblas_zaxpy(const int N, const void *alpha, const void *X,
const int incX, void *Y, const int incY);
/*
* Routines with S and D prefix only
*/
CBL_FUN void cblas_srotg(float *a, float *b, float *c, float *s);
CBL_FUN void cblas_srotmg(float *d1, float *d2, float *b1, const float b2, float *P);
CBL_FUN void cblas_srot(const int N, float *X, const int incX,
float *Y, const int incY, const float c, const float s);
CBL_FUN void cblas_srotm(const int N, float *X, const int incX,
float *Y, const int incY, const float *P);
CBL_FUN void cblas_drotg(double *a, double *b, double *c, double *s);
CBL_FUN void cblas_drotmg(double *d1, double *d2, double *b1, const double b2, double *P);
CBL_FUN void cblas_drot(const int N, double *X, const int incX,
double *Y, const int incY, const double c, const double s);
CBL_FUN void cblas_drotm(const int N, double *X, const int incX,
double *Y, const int incY, const double *P);
/*
* Routines with S D C Z CS and ZD prefixes
*/
CBL_FUN void cblas_sscal(const int N, const float alpha, float *X, const int incX);
CBL_FUN void cblas_dscal(const int N, const double alpha, double *X, const int incX);
CBL_FUN void cblas_cscal(const int N, const void *alpha, void *X, const int incX);
CBL_FUN void cblas_zscal(const int N, const void *alpha, void *X, const int incX);
CBL_FUN void cblas_csscal(const int N, const float alpha, void *X, const int incX);
CBL_FUN void cblas_zdscal(const int N, const double alpha, void *X, const int incX);
/*
* ===========================================================================
* Prototypes for level 2 BLAS
* ===========================================================================
*/
/*
* Routines with standard 4 prefixes (S, D, C, Z)
*/
CBL_FUN void cblas_sgemv(const enum CBLAS_ORDER order,
const enum CBLAS_TRANSPOSE TransA, const int M, const int N,
评论11
最新资源