82#define SP_LOW_FLOAT_PRECISION SP_32BIT_PRECISION
83#define SP_LONG_PRECISION SP_32BIT_PRECISION
84#define SP_SHORT_PRECISION SP_16BIT_PRECISION
85#define SP_CHAR_PRECISION SP_8BIT_PRECISION
87#ifdef SP_USE_VECTOR_ENGINE
89#define SP_VECTOR_LOCK_SWITCH_NORMAL 0
90#define SP_VECTOR_LOCK_SWITCH_SYNC_ONLY 1
91#define SP_VECTOR_LOCK_SWITCH_NOSYNC 2
94#define SP_PLUGIN_VECTOR "vector 1.2"
96typedef struct _spVectorPluginRec spVectorPluginRec;
98#ifdef SP_USE_VECTOR_LINEAR_ALGEBRA_ENGINE
99#define SP_PLUGIN_BLAS "blas 0.1"
100#define SP_PLUGIN_LAPACK "lapack 0.1"
102#define SP_PLUGIN_CAPS_SUPPORT_BLAS_FUNCTIONS (1<<13)
103#define SP_PLUGIN_CAPS_SUPPORT_LAPACK_FUNCTIONS (1<<14)
104#define SP_PLUGIN_CAPS_SUPPORT_LINEAR_ALGEBRA_FUNCTIONS (SP_PLUGIN_CAPS_SUPPORT_BLAS_FUNCTIONS|SP_PLUGIN_CAPS_SUPPORT_LAPACK_FUNCTIONS)
106#define SP_LINEAR_ALGEBRA_INSTANCE_STATUS_CHILD_PLUGIN (1<<1)
107#define SP_LINEAR_ALGEBRA_INSTANCE_STATUS_UNLOCKED (1<<2)
108#define SP_LINEAR_ALGEBRA_INSTANCE_STATUS_SYNCED (1<<3)
109#define SP_LINEAR_ALGEBRA_INSTANCE_STATUS_DATA_IN_REAL (1<<4)
110#define SP_LINEAR_ALGEBRA_INSTANCE_STATUS_DATA_IN_IMAG (1<<5)
111#define SP_LINEAR_ALGEBRA_INSTANCE_STATUS_DATA_IN_CPLX (1<<6)
114 SP_MATRIX_MEMORY_LAYOUT_COLUMN_MAJOR = 0,
115 SP_MATRIX_MEMORY_LAYOUT_ROW_MAJOR = 1,
116} spMatrixMemoryLayout;
118typedef struct _spLinearAlgebraPluginRec spLinearAlgebraPluginRec;
119typedef struct _spLinearAlgebraPluginList *spLinearAlgebraPluginList;
121struct _spLinearAlgebraPluginList {
124 unsigned long status_mask;
125 struct _spLinearAlgebraPluginList *prev;
126 struct _spLinearAlgebraPluginList *next;
129#define SpVectorLinearAlgebraPluginRec(vec) ((spLinearAlgebraPluginRec *)((vec)->la_current_list->plugin->rec))
130#define SpMatrixLinearAlgebraPluginRec(mat) ((spLinearAlgebraPluginRec *)((mat)->la_current_list->plugin->rec))
162#ifdef SP_USE_VECTOR_ENGINE
166#ifdef SP_USE_VECTOR_LINEAR_ALGEBRA_ENGINE
167 spLinearAlgebraPluginList la_plugin_list;
168 spLinearAlgebraPluginList la_current_list;
169 unsigned long la_status_mask;
196#ifdef SP_USE_VECTOR_ENGINE
200#ifdef SP_USE_VECTOR_LINEAR_ALGEBRA_ENGINE
201 spLinearAlgebraPluginList la_plugin_list;
202 spLinearAlgebraPluginList la_current_list;
203 unsigned long la_status_mask;
230#ifdef SP_USE_VECTOR_ENGINE
234#ifdef SP_USE_VECTOR_LINEAR_ALGEBRA_ENGINE
235 spLinearAlgebraPluginList la_plugin_list;
236 spLinearAlgebraPluginList la_current_list;
237 unsigned long la_status_mask;
264#ifdef SP_USE_VECTOR_ENGINE
268#ifdef SP_USE_VECTOR_LINEAR_ALGEBRA_ENGINE
269 spLinearAlgebraPluginList la_plugin_list;
270 spLinearAlgebraPluginList la_current_list;
271 unsigned long la_status_mask;
276typedef struct _spSVectors *spSVectors;
277typedef struct _spLVectors *spLVectors;
278typedef struct _spFVectors *spFVectors;
279typedef struct _spDVectors *spDVectors;
303#define spvlength(x) ((x)->length)
304#define spvdata(x) ((x)->data)
305#define spvreal(x) ((x)->data)
306#define spvimag(x) ((x)->imag)
308#define SVector spSVector
309#define LVector spLVector
310#define FVector spFVector
311#define DVector spDVector
312#define _SVector _spSVector
313#define _LVector _spLVector
314#define _FVector _spFVector
315#define _DVector _spDVector
317#define SVectors spSVectors
318#define LVectors spLVectors
319#define FVectors spFVectors
320#define DVectors spDVectors
321#define _SVectors _spSVectors
322#define _LVectors _spLVectors
323#define _FVectors _spFVectors
324#define _DVectors _spDVectors
326#define vlength spvlength
332#define SP_DVECTOR_NO_CALLBACK 0L
333#define SP_DVECTOR_READ_STARTED_CALLBACK (1L<<0)
334#define SP_DVECTOR_READ_PROGRESS_CALLBACK (1L<<1)
335#define SP_DVECTOR_READ_FINISHED_CALLBACK (1L<<2)
336#define SP_DVECTOR_WRITE_STARTED_CALLBACK (1L<<3)
337#define SP_DVECTOR_WRITE_PROGRESS_CALLBACK (1L<<4)
338#define SP_DVECTOR_WRITE_FINISHED_CALLBACK (1L<<5)
339typedef spBool (*spDVectorCallbackFunc)(
spDVector x,
unsigned long callback_type,
void *callback_data,
void *user_data);
345#ifdef SP_USE_VECTOR_ENGINE
346extern int spGetNumVectorPlugin(
void);
347extern char *xspSearchVectorPluginFile(
int *index);
348extern spPlugin *spSetDefaultVectorPlugin(
const char *name);
350extern spPlugin *spLoadVectorPlugin(
const char *name);
352extern spPlugin *spGetDefaultVectorPlugin(
void);
353extern spBool spFreeDefaultVectorPlugin(
void);
355extern spBool spGetVectorPluginNumUnit(
spPlugin *plugin,
int *num_unit);
356extern const char *spGetVectorPluginUnitName(
spPlugin *plugin,
int index);
357extern spBool spSelectVectorPluginUnit(
spPlugin *plugin,
int index);
359extern spBool spGetDefaultVectorPluginNumUnit(
int *num_unit);
360extern const char *spGetDefaultVectorPluginUnitName(
int index);
361extern spBool spSelectDefaultVectorPluginUnit(
int index);
370extern spBool spSetDefaultVectorPluginFastMode(
spBool fast_flag);
371extern spBool spGetDefaultVectorPluginFastMode(
spBool *fast_flag);
374extern long spsizeof(
char type);
574extern spSVectors xsvsalloc(
long num);
575extern spLVectors xlvsalloc(
long num);
576extern spFVectors xfvsalloc(
long num);
577extern spDVectors xdvsalloc(
long num);
578extern spSVectors xsvsrealloc(spSVectors xs,
long num);
579extern spLVectors xlvsrealloc(spLVectors xs,
long num);
580extern spFVectors xfvsrealloc(spFVectors xs,
long num);
581extern spDVectors xdvsrealloc(spDVectors xs,
long num);
582extern void xsvsfree(spSVectors xs);
583extern void xlvsfree(spLVectors xs);
584extern void xfvsfree(spFVectors xs);
585extern void xdvsfree(spDVectors xs);
587extern void lvsshift(spLVectors xs,
long shift);
588extern void svsshift(spSVectors xs,
long shift);
589extern void fvsshift(spFVectors xs,
long shift);
590extern void dvsshift(spDVectors xs,
long shift);
592extern void svsmemshift(spSVectors xs,
long shift);
593extern void lvsmemshift(spLVectors xs,
long shift);
594extern void fvsmemshift(spFVectors xs,
long shift);
595extern void dvsmemshift(spDVectors xs,
long shift);
761extern long svcopyfromarray(
spSVector y,
long y_offset,
short *data,
long length);
764extern long lvcopyfromarray(
spLVector y,
long y_offset,
long *data,
long length);
767extern long fvcopyfromarray(
spFVector y,
long y_offset,
float *data,
long length);
770extern long dvcopyfromarray(
spDVector y,
long y_offset,
double *data,
long length);
774extern long svcopyfromriarray(
spSVector y,
long y_offset,
short *data,
short *imag,
long length);
777extern long lvcopyfromriarray(
spLVector y,
long y_offset,
long *data,
long *imag,
long length);
780extern long fvcopyfromriarray(
spFVector y,
long y_offset,
float *data,
float *imag,
long length);
783extern long dvcopyfromriarray(
spDVector y,
long y_offset,
double *data,
double *imag,
long length);
787extern long svcopytoarray(
spSVector x,
long x_offset,
short *data,
long length);
790extern long lvcopytoarray(
spLVector x,
long x_offset,
long *data,
long length);
793extern long fvcopytoarray(
spFVector x,
long x_offset,
float *data,
long length);
796extern long dvcopytoarray(
spDVector x,
long x_offset,
double *data,
long length);
800extern long svcopytoriarray(
spSVector x,
long x_offset,
short *data,
short *imag,
long length);
803extern long lvcopytoriarray(
spLVector x,
long x_offset,
long *data,
long *imag,
long length);
806extern long fvcopytoriarray(
spFVector x,
long x_offset,
float *data,
float *imag,
long length);
809extern long dvcopytoriarray(
spDVector x,
long x_offset,
double *data,
double *imag,
long length);
873extern long lvgetinitcount(
long x_length,
long m,
long incr,
long n);
874extern long fvgetinitcount(
long x_length,
float m,
float incr,
float n);
875extern long dvgetinitcount(
long x_length,
double m,
double incr,
double n);
892extern spSVector xsvinit(
long m,
long incr,
long n);
895extern spLVector xlvinit(
long m,
long incr,
long n);
898extern spFVector xfvinit(
float m,
float incr,
float n);
901extern spDVector xdvinit(
double m,
double incr,
double n);
944extern spSVector xsvriinit(
long m,
long incr,
long n);
947extern spLVector xlvriinit(
long m,
long incr,
long n);
950extern spFVector xfvriinit(
float m,
float incr,
float n);
953extern spDVector xdvriinit(
double m,
double incr,
double n);
997#define svnums(x, length, value) svinit(x, (long)(value), 0, (long)(length))
1000#define lvnums(x, length, value) lvinit(x, (long)(value), 0, (long)(length))
1003#define fvnums(x, length, value) fvinit(x, (float)(value), 0.0, (float)(length))
1006#define dvnums(x, length, value) dvinit(x, (double)(value), 0.0, (double)(length))
1010#define svzeros(x, length) svnums(x, length, 0)
1013#define lvzeros(x, length) lvnums(x, length, 0)
1016#define fvzeros(x, length) fvnums(x, length, 0.0)
1019#define dvzeros(x, length) dvnums(x, length, 0.0)
1023#define svones(x, length) svnums(x, length, 1)
1026#define lvones(x, length) lvnums(x, length, 1)
1029#define fvones(x, length) fvnums(x, length, 1.0)
1032#define dvones(x, length) dvnums(x, length, 1.0)
1036#define svinums(x, length, value) sviinit(x, (long)(value), 0, (long)(length))
1039#define lvinums(x, length, value) lviinit(x, (long)(value), 0, (long)(length))
1042#define fvinums(x, length, value) fviinit(x, (float)(value), 0.0, (float)(length))
1045#define dvinums(x, length, value) dviinit(x, (double)(value), 0.0, (double)(length))
1049#define svizeros(x, length) svinums(x, length, 0.0)
1052#define lvizeros(x, length) lvinums(x, length, 0.0)
1055#define fvizeros(x, length) fvinums(x, length, 0.0)
1058#define dvizeros(x, length) dvinums(x, length, 0.0)
1062#define sviones(x, length) svinums(x, length, 1.0)
1065#define lviones(x, length) lvinums(x, length, 1.0)
1068#define fviones(x, length) fvinums(x, length, 1.0)
1071#define dviones(x, length) dvinums(x, length, 1.0)
1075#define svrinums(x, length, value) svriinit(x, (long)(value), 0, (long)(length))
1078#define lvrinums(x, length, value) lvriinit(x, (long)(value), 0, (long)(length))
1081#define fvrinums(x, length, value) fvriinit(x, (float)(value), 0.0, (float)(length))
1084#define dvrinums(x, length, value) dvriinit(x, (double)(value), 0.0, (double)(length))
1088#define svrizeros(x, length) svrinums(x, length, 0.0)
1091#define lvrizeros(x, length) lvrinums(x, length, 0.0)
1094#define fvrizeros(x, length) fvrinums(x, length, 0.0)
1097#define dvrizeros(x, length) dvrinums(x, length, 0.0)
1101#define svriones(x, length) svrinums(x, length, 1.0)
1104#define lvriones(x, length) lvrinums(x, length, 1.0)
1107#define fvriones(x, length) fvrinums(x, length, 1.0)
1110#define dvriones(x, length) dvrinums(x, length, 1.0)
1114#define xsvnums(length, value) xsvinit((long)(value), 0, (long)(length))
1117#define xlvnums(length, value) xlvinit((long)(value), 0, (long)(length))
1120#define xfvnums(length, value) xfvinit((float)(value), 0.0, (float)(length))
1123#define xdvnums(length, value) xdvinit((double)(value), 0.0, (double)(length))
1127#define xsvnumsul(plugin, length, value, unlock_flag) xsvinitul(plugin, (long)(value), 0, (long)(length), unlock_flag)
1130#define xlvnumsul(plugin, length, value, unlock_flag) xlvinitul(plugin, (long)(value), 0, (long)(length), unlock_flag)
1133#define xfvnumsul(plugin, length, value, unlock_flag) xfvinitul(plugin, (float)(value), 0.0, (float)(length), unlock_flag)
1136#define xdvnumsul(plugin, length, value, unlock_flag) xdvinitul(plugin, (double)(value), 0.0, (double)(length), unlock_flag)
1140#define xsvzeros(length) xsvnums(length, 0)
1143#define xlvzeros(length) xlvnums(length, 0)
1146#define xfvzeros(length) xfvnums(length, 0.0)
1149#define xdvzeros(length) xdvnums(length, 0.0)
1153#define xsvzerosul(plugin, length, unlock_flag) xsvnumsul(plugin, length, 0, unlock_flag)
1156#define xlvzerosul(plugin, length, unlock_flag) xlvnumsul(plugin, length, 0, unlock_flag)
1159#define xfvzerosul(plugin, length, unlock_flag) xfvnumsul(plugin, length, 0.0, unlock_flag)
1162#define xdvzerosul(plugin, length, unlock_flag) xdvnumsul(plugin, length, 0.0, unlock_flag)
1166#define xsvones(length) xsvnums(length, 1)
1169#define xlvones(length) xlvnums(length, 1)
1172#define xfvones(length) xfvnums(length, 1.0)
1175#define xdvones(length) xdvnums(length, 1.0)
1179#define xsvonesul(plugin, length, unlock_flag) xsvnumsul(plugin, length, 1, unlock_flag)
1182#define xlvonesul(plugin, length, unlock_flag) xlvnumsul(plugin, length, 1, unlock_flag)
1185#define xfvonesul(plugin, length, unlock_flag) xfvnumsul(plugin, length, 1.0, unlock_flag)
1188#define xdvonesul(plugin, length, unlock_flag) xdvnumsul(plugin, length, 1.0, unlock_flag)
1192#define xsvnull() xsvalloc(0)
1195#define xlvnull() xlvalloc(0)
1198#define xfvnull() xfvalloc(0)
1201#define xdvnull() xdvalloc(0)
1205#define xsvnullul(plugin, unlock_flag) xsvallocul(plugin, 0, unlock_flag)
1208#define xlvnullul(plugin, unlock_flag) xlvallocul(plugin, 0, unlock_flag)
1211#define xfvnullul(plugin, unlock_flag) xfvallocul(plugin, 0, unlock_flag)
1214#define xdvnullul(plugin, unlock_flag) xdvallocul(plugin, 0, unlock_flag)
1218#define xsvrinums(length, value) xsvriinit((long)(value), 0, (long)(length))
1221#define xlvrinums(length, value) xlvriinit((long)(value), 0, (long)(length))
1224#define xfvrinums(length, value) xfvriinit((float)(value), 0.0, (float)(length))
1227#define xdvrinums(length, value) xdvriinit((double)(value), 0.0, (double)(length))
1231#define xsvrinumsul(plugin, length, value, unlock_flag) xsvriinitul(plugin, (long)(value), 0, (long)(length), unlock_flag)
1234#define xlvrinumsul(plugin, length, value, unlock_flag) xlvriinitul(plugin, (long)(value), 0, (long)(length), unlock_flag)
1237#define xfvrinumsul(plugin, length, value, unlock_flag) xfvriinitul(plugin, (float)(value), 0.0, (float)(length), unlock_flag)
1240#define xdvrinumsul(plugin, length, value, unlock_flag) xdvriinitul(plugin, (double)(value), 0.0, (double)(length), unlock_flag)
1244#define xsvrizeros(length) xsvrinums(length, 0)
1247#define xlvrizeros(length) xlvrinums(length, 0)
1250#define xfvrizeros(length) xfvrinums(length, 0.0)
1253#define xdvrizeros(length) xdvrinums(length, 0.0)
1257#define xsvrizerosul(plugin, length, unlock_flag) xsvrinumsul(plugin, length, 0, unlock_flag)
1260#define xlvrizerosul(plugin, length, unlock_flag) xlvrinumsul(plugin, length, 0, unlock_flag)
1263#define xfvrizerosul(plugin, length, unlock_flag) xfvrinumsul(plugin, length, 0.0, unlock_flag)
1266#define xdvrizerosul(plugin, length, unlock_flag) xdvrinumsul(plugin, length, 0.0, unlock_flag)
1270#define xsvriones(length) xsvrinums(length, 1)
1273#define xlvriones(length) xlvrinums(length, 1)
1276#define xfvriones(length) xfvrinums(length, 1.0)
1279#define xdvriones(length) xdvrinums(length, 1.0)
1283#define xsvrionesul(plugin, length, unlock_flag) xsvrinumsul(plugin, length, 1, unlock_flag)
1286#define xlvrionesul(plugin, length, unlock_flag) xlvrinumsul(plugin, length, 1, unlock_flag)
1289#define xfvrionesul(plugin, length, unlock_flag) xfvrinumsul(plugin, length, 1.0, unlock_flag)
1292#define xdvrionesul(plugin, length, unlock_flag) xdvrinumsul(plugin, length, 1.0, unlock_flag)
1340extern void sverase(
spSVector x,
long offset,
long length,
spBool inv);
1343extern void lverase(
spLVector x,
long offset,
long length,
spBool inv);
1346extern void fverase(
spFVector x,
long offset,
long length,
spBool inv);
1359extern void svset(
spSVector x,
short *data,
long length);
1362extern void lvset(
spLVector x,
long *data,
long length);
1365extern void fvset(
spFVector x,
float *data,
long length);
1372extern void sviset(
spSVector x,
short *imag,
long length);
1375extern void lviset(
spLVector x,
long *imag,
long length);
1378extern void fviset(
spFVector x,
float *imag,
long length);
1398extern spSVector xsvset(
short *data,
long length);
1401extern spLVector xlvset(
long *data,
long length);
1404extern spFVector xfvset(
float *data,
long length);
1411extern spSVector xsvsetnew(
short *data,
long length);
1414extern spLVector xlvsetnew(
long *data,
long length);
1417extern spFVector xfvsetnew(
float *data,
long length);
1452#define svunset(x) svset(x, NULL, 0)
1455#define lvunset(x) lvset(x, NULL, 0)
1458#define fvunset(x) fvset(x, NULL, 0)
1461#define dvunset(x) dvset(x, NULL, 0)
1465#define sviunset(x) sviset(x, NULL, 0)
1468#define lviunset(x) lviset(x, NULL, 0)
1471#define fviunset(x) fviset(x, NULL, 0)
1474#define dviunset(x) dviset(x, NULL, 0)
1480#define spvsset(xs, index, x) {(xs)->vector[index]=(x);}
1481#define svsset spvsset
1482#define lvsset spvsset
1483#define fvsset spvsset
1484#define dvsset spvsset
1492typedef spSVectors SVECTORS;
1493typedef spLVectors LVECTORS;
1494typedef spFVectors FVECTORS;
1495typedef spDVectors DVECTORS;
spPrecision
Definition vector.h:53
spComputeSpeed
Definition vector.h:69
@ SP_DOUBLE_PRECISION
Definition vector.h:56
@ SP_8BIT_PRECISION
Definition vector.h:63
@ SP_UNKNOWN_PRECISION
Definition vector.h:65
@ SP_HIGH_DOUBLE_PRECISION
Definition vector.h:55
@ SP_HIGH_FLOAT_PRECISION
Definition vector.h:58
@ SP_FLOAT_PRECISION
Definition vector.h:59
@ SP_LOW_DOUBLE_PRECISION
Definition vector.h:57
@ SP_32BIT_PRECISION
Definition vector.h:60
@ SP_24BIT_PRECISION
Definition vector.h:61
@ SP_HIGHEST_PRECISION
Definition vector.h:54
@ SP_16BIT_PRECISION
Definition vector.h:62
@ SP_IGNORE_PRECISION
Definition vector.h:64
@ SP_COMPUTE_SPEED_NORMAL
Definition vector.h:74
@ SP_COMPUTE_SPEED_UNKNOWN
Definition vector.h:79
@ SP_COMPUTE_SPEED_VERY_FAST
Definition vector.h:71
@ SP_COMPUTE_SPEED_FASTER
Definition vector.h:72
@ SP_COMPUTE_SPEED_SLOW
Definition vector.h:75
@ SP_COMPUTE_SPEED_SLOWER
Definition vector.h:76
@ SP_COMPUTE_SPEED_FAST
Definition vector.h:73
@ SP_COMPUTE_SPEED_EXTREMELY_SLOW
Definition vector.h:78
@ SP_COMPUTE_SPEED_EXTREMELY_FAST
Definition vector.h:70
@ SP_COMPUTE_SPEED_VERY_SLOW
Definition vector.h:77
double型を扱うためのベクトル型です.
Definition vector.h:248
double * data
Definition vector.h:256
double * imag
Definition vector.h:262
long length
Definition vector.h:251
float型を扱うためのベクトル型です.
Definition vector.h:214
float * data
Definition vector.h:222
float * imag
Definition vector.h:228
long length
Definition vector.h:217
long型を扱うためのベクトル型です.
Definition vector.h:180
long * data
Definition vector.h:188
long * imag
Definition vector.h:194
long length
Definition vector.h:183
short型を扱うためのベクトル型です.
Definition vector.h:146
short * data
Definition vector.h:154
short * imag
Definition vector.h:160
long length
Definition vector.h:149