1*2eac72dbSBarry Smith /* 2*2eac72dbSBarry Smith This defines the abstract vector component. These are patterned 3*2eac72dbSBarry Smith after the Level-1 Blas, but with some additions that have proved 4*2eac72dbSBarry Smith useful. These include routines to allocate and free vectors. 5*2eac72dbSBarry Smith 6*2eac72dbSBarry Smith Note that the routines that are normally thought of as returning a 7*2eac72dbSBarry Smith value (e.g., dot, norm) return their value through an argument. 8*2eac72dbSBarry Smith This allows these routines to be used with other datatype, such 9*2eac72dbSBarry Smith as float and dcomplex. 10*2eac72dbSBarry Smith 11*2eac72dbSBarry Smith All vectors should be declared as a Vec. All vector routines begin 12*2eac72dbSBarry Smith with Vec. 13*2eac72dbSBarry Smith 14*2eac72dbSBarry Smith 15*2eac72dbSBarry Smith */ 16*2eac72dbSBarry Smith 17*2eac72dbSBarry Smith #ifndef __VEC_PACKAGE 18*2eac72dbSBarry Smith #define __VEC_PACKAGE 19*2eac72dbSBarry Smith #include "is.h" 20*2eac72dbSBarry Smith 21*2eac72dbSBarry Smith typedef struct _Vec* Vec; 22*2eac72dbSBarry Smith typedef struct _VecScatterCtx* VecScatterCtx; 23*2eac72dbSBarry Smith typedef double* VecScalar; 24*2eac72dbSBarry Smith 25*2eac72dbSBarry Smith extern int VecCreateSequential ANSI_ARGS((int,Vec *)); 26*2eac72dbSBarry Smith extern int VecCreateSequentialBLAS ANSI_ARGS((int,Vec *)); 27*2eac72dbSBarry Smith extern int VecCreateComplexSequential ANSI_ARGS((int,Vec *)); 28*2eac72dbSBarry Smith 29*2eac72dbSBarry Smith extern int VecCreateInitialVector ANSI_ARGS((int,int,char **,Vec *)); 30*2eac72dbSBarry Smith 31*2eac72dbSBarry Smith #if defined(MPI_PACKAGE) 32*2eac72dbSBarry Smith extern int VecCreateMPI ANSI_ARGS((void *,int,int,Vec *)); 33*2eac72dbSBarry Smith extern int VecCreateMPIBLAS ANSI_ARGS((void *,int,int,Vec *)); 34*2eac72dbSBarry Smith extern int VecCreateComplexMPI ANSI_ARGS((void *,int,int,Vec *)); 35*2eac72dbSBarry Smith #endif 36*2eac72dbSBarry Smith 37*2eac72dbSBarry Smith extern int VecDot ANSI_ARGS((Vec, Vec, VecScalar)); 38*2eac72dbSBarry Smith extern int VecTDot ANSI_ARGS((Vec, Vec, VecScalar)); 39*2eac72dbSBarry Smith extern int VecMDot ANSI_ARGS((int, Vec ,Vec*,VecScalar)); 40*2eac72dbSBarry Smith extern int VecMTDot ANSI_ARGS((int, Vec ,Vec*,VecScalar)); 41*2eac72dbSBarry Smith extern int VecNorm ANSI_ARGS((Vec, VecScalar)); 42*2eac72dbSBarry Smith extern int VecASum ANSI_ARGS((Vec, VecScalar)); 43*2eac72dbSBarry Smith extern int VecMax ANSI_ARGS((Vec, int *, VecScalar)); 44*2eac72dbSBarry Smith extern int VecScale ANSI_ARGS((VecScalar, Vec)); 45*2eac72dbSBarry Smith extern int VecCopy ANSI_ARGS((Vec, Vec)); 46*2eac72dbSBarry Smith extern int VecSet ANSI_ARGS((VecScalar, Vec)); 47*2eac72dbSBarry Smith extern int VecSwap ANSI_ARGS((Vec, Vec)); 48*2eac72dbSBarry Smith extern int VecAXPY ANSI_ARGS((VecScalar, Vec, Vec)); 49*2eac72dbSBarry Smith extern int VecMAXPY ANSI_ARGS((int, VecScalar, Vec ,Vec*)); 50*2eac72dbSBarry Smith extern int VecAYPX ANSI_ARGS((VecScalar, Vec, Vec)); 51*2eac72dbSBarry Smith extern int VecWAXPY ANSI_ARGS((VecScalar, Vec, Vec, Vec)); 52*2eac72dbSBarry Smith extern int VecPMult ANSI_ARGS((Vec, Vec, Vec)); 53*2eac72dbSBarry Smith extern int VecPDiv ANSI_ARGS((Vec, Vec, Vec)); 54*2eac72dbSBarry Smith extern int VecCreate ANSI_ARGS((Vec,Vec *)); 55*2eac72dbSBarry Smith extern int VecDestroy ANSI_ARGS((Vec)); 56*2eac72dbSBarry Smith extern int VecGetVecs ANSI_ARGS((Vec, int,Vec **)); 57*2eac72dbSBarry Smith extern int VecFreeVecs ANSI_ARGS((Vec*,int)); 58*2eac72dbSBarry Smith 59*2eac72dbSBarry Smith extern int VecAddValues ANSI_ARGS((Vec, int, int *,VecScalar)); 60*2eac72dbSBarry Smith extern int VecInsertValues ANSI_ARGS((Vec, int, int *,VecScalar)); 61*2eac72dbSBarry Smith extern int VecBeginAssembly ANSI_ARGS((Vec)); 62*2eac72dbSBarry Smith extern int VecEndAssembly ANSI_ARGS((Vec)); 63*2eac72dbSBarry Smith 64*2eac72dbSBarry Smith extern int VecScatterBegin ANSI_ARGS((Vec,IS,Vec,IS,VecScatterCtx *)); 65*2eac72dbSBarry Smith extern int VecScatterEnd ANSI_ARGS((Vec,IS,Vec,IS,VecScatterCtx *)); 66*2eac72dbSBarry Smith 67*2eac72dbSBarry Smith extern int VecScatterAddBegin ANSI_ARGS((Vec,IS,Vec,IS,VecScatterCtx *)); 68*2eac72dbSBarry Smith extern int VecScatterAddEnd ANSI_ARGS((Vec,IS,Vec,IS,VecScatterCtx *)); 69*2eac72dbSBarry Smith 70*2eac72dbSBarry Smith extern int VecGetArray ANSI_ARGS((Vec,VecScalar **)); 71*2eac72dbSBarry Smith extern int VecValidVector ANSI_ARGS((Vec)); 72*2eac72dbSBarry Smith extern int VecView ANSI_ARGS((Vec,void *)); 73*2eac72dbSBarry Smith 74*2eac72dbSBarry Smith extern int VecGetSize ANSI_ARGS((Vec,int *)); 75*2eac72dbSBarry Smith extern int VecGetLocalSize ANSI_ARGS((Vec,int *)); 76*2eac72dbSBarry Smith 77*2eac72dbSBarry Smith #endif 78*2eac72dbSBarry Smith 79*2eac72dbSBarry Smith 80