spLib
読み取り中…
検索中…
一致する文字列を見つけられません
vmath.h
[詳解]
1
4#ifndef SPLIB_VMATH_H
5#define SPLIB_VMATH_H
6
7#include <sp/vector.h>
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13#if defined(MACOS)
14#pragma import on
15#endif
16
24 /*----@addtogroup vmathGroup----*/
25
31extern void svabs(spSVector x);
34extern void lvabs(spLVector x);
37extern void fvabs(spFVector x);
41extern void dvabs(spDVector x);
44extern spSVector xsvabs(spSVector x);
47extern spLVector xlvabs(spLVector x);
50extern spFVector xfvabs(spFVector x);
53extern spDVector xdvabs(spDVector x);
54
62extern void svsqrt(spSVector x);
65extern void lvsqrt(spLVector x);
68extern void fvsqrt(spFVector x);
71extern void dvsqrt(spDVector x);
74extern spSVector xsvsqrt(spSVector x);
77extern spLVector xlvsqrt(spLVector x);
80extern spFVector xfvsqrt(spFVector x);
83extern spDVector xdvsqrt(spDVector x);
84
92extern void svsquare(spSVector x);
95extern void lvsquare(spLVector x);
98extern void fvsquare(spFVector x);
101extern void dvsquare(spDVector x);
104extern spSVector xsvsquare(spSVector x);
107extern spLVector xlvsquare(spLVector x);
110extern spFVector xfvsquare(spFVector x);
113extern spDVector xdvsquare(spDVector x);
114
122extern void svsign(spSVector x);
125extern void lvsign(spLVector x);
128extern void fvsign(spFVector x);
132extern void dvsign(spDVector x);
135extern spSVector xsvsign(spSVector x);
138extern spLVector xlvsign(spLVector x);
141extern spFVector xfvsign(spFVector x);
145extern spDVector xdvsign(spDVector x);
146
154extern void svcumsum(spSVector x);
157extern void lvcumsum(spLVector x);
160extern void fvcumsum(spFVector x);
163extern void dvcumsum(spDVector x);
166extern spSVector xsvcumsum(spSVector x);
169extern spLVector xlvcumsum(spLVector x);
172extern spFVector xfvcumsum(spFVector x);
175extern spDVector xdvcumsum(spDVector x);
176
184extern void svcumprod(spSVector x);
187extern void lvcumprod(spLVector x);
190extern void fvcumprod(spFVector x);
193extern void dvcumprod(spDVector x);
196extern spSVector xsvcumprod(spSVector x);
199extern spLVector xlvcumprod(spLVector x);
202extern spFVector xfvcumprod(spFVector x);
205extern spDVector xdvcumprod(spDVector x);
206
214extern void svcodiff(spSVector x, double coef);
217extern void lvcodiff(spLVector x, double coef);
220extern void fvcodiff(spFVector x, double coef);
225extern void dvcodiff(spDVector x, double coef);
228extern spSVector xsvcodiff(spSVector x, double coef);
231extern spLVector xlvcodiff(spLVector x, double coef);
234extern spFVector xfvcodiff(spFVector x, double coef);
239extern spDVector xdvcodiff(spDVector x, double coef);
240
243#define svdiff(x) svcodiff(x, 1.0);
246#define lvdiff(x) lvcodiff(x, 1.0);
249#define fvdiff(x) fvcodiff(x, 1.0);
254#define dvdiff(x) dvcodiff(x, 1.0);
257#define xsvdiff(x) xsvcodiff(x, 1.0);
260#define xlvdiff(x) xlvcodiff(x, 1.0);
263#define xfvdiff(x) xfvcodiff(x, 1.0);
268#define xdvdiff(x) xdvcodiff(x, 1.0);
269
277extern long svsum(spSVector x);
280extern long lvsum(spLVector x);
283extern float fvsum(spFVector x);
286extern double dvsum(spDVector x);
287
290extern long svisum(spSVector x);
293extern long lvisum(spLVector x);
296extern float fvisum(spFVector x);
299extern double dvisum(spDVector x);
300
303extern long svsqsum(spSVector x);
306extern long lvsqsum(spLVector x);
309extern float fvsqsum(spFVector x);
312extern double dvsqsum(spDVector x);
313
316extern long svabssum(spSVector x);
319extern long lvabssum(spLVector x);
322extern float fvabssum(spFVector x);
325extern double dvabssum(spDVector x);
326
334extern long svprod(spSVector x);
337extern long lvprod(spLVector x);
340extern float fvprod(spFVector x);
343extern double dvprod(spDVector x);
344
347extern long svriprod(spSVector x, long *oiprod);
350extern long lvriprod(spLVector x, long *oiprod);
353extern float fvriprod(spFVector x, float *oiprod);
356extern double dvriprod(spDVector x, double *oiprod);
357
365extern double svnorm(spSVector x, long p);
368extern double lvnorm(spLVector x, long p);
371extern float fvnorm(spFVector x, long p);
378extern double dvnorm(spDVector x, long p);
379
387extern long svdot(spSVector x, spSVector y);
390extern long lvdot(spLVector x, spLVector y);
393extern float fvdot(spFVector x, spFVector y);
396extern double dvdot(spDVector x, spDVector y);
397
400extern void svcplxdot(spSVector x, spSVector y, long *re, long *im);
403extern void lvcplxdot(spLVector x, spLVector y, long *re, long *im);
406extern void fvcplxdot(spFVector x, spFVector y, float *re, float *im);
409extern void dvcplxdot(spDVector x, spDVector y, double *re, double *im);
410
418extern double svvar(spSVector x, double *mean);
421extern double lvvar(spLVector x, double *mean);
424extern float fvvar(spFVector x, float *mean);
430extern double dvvar(spDVector x, double *mean);
431
434extern double svstd(spSVector x, double *mean);
437extern double lvstd(spLVector x, double *mean);
440extern float fvstd(spFVector x, float *mean);
446extern double dvstd(spDVector x, double *mean);
447
450#define svmean(x) ((double)svsum(x) / (double)x->length)
453#define lvmean(x) ((double)lvsum(x) / (double)x->length)
456#define fvmean(x) (fvsum(x) / (float)x->length)
459#define dvmean(x) (dvsum(x) / (double)x->length)
460
468extern short svmin(spSVector x, long *index);
471extern long lvmin(spLVector x, long *index);
474extern float fvmin(spFVector x, long *index);
480extern double dvmin(spDVector x, long *index);
481
484extern short svmax(spSVector x, long *index);
487extern long lvmax(spLVector x, long *index);
490extern float fvmax(spFVector x, long *index);
496extern double dvmax(spDVector x, long *index);
497
500extern void svscmin(spSVector x, short a);
503extern void lvscmin(spLVector x, long a);
506extern void fvscmin(spFVector x, float a);
509extern void dvscmin(spDVector x, double a);
510
513extern void svscmax(spSVector x, short a);
516extern void lvscmax(spLVector x, long a);
519extern void fvscmax(spFVector x, float a);
522extern void dvscmax(spDVector x, double a);
523
526extern void svelmin(spSVector x, spSVector y);
529extern void lvelmin(spLVector x, spLVector y);
532extern void fvelmin(spFVector x, spFVector y);
535extern void dvelmin(spDVector x, spDVector y);
536
539extern void svelmax(spSVector x, spSVector y);
542extern void lvelmax(spLVector x, spLVector y);
545extern void fvelmax(spFVector x, spFVector y);
548extern void dvelmax(spDVector x, spDVector y);
549
553#define SP_NMINMAX_OPTION_PEAK_ONLY 1
554#define SP_NMINMAX_OPTION_ZERO_EDGES (1<<1)
555extern spLVector xsvnmin(spSVector x, long n, long margin, unsigned long options);
556extern spLVector xlvnmin(spLVector x, long n, long margin, unsigned long options);
557extern spLVector xfvnmin(spFVector x, long n, long margin, unsigned long options);
558extern spLVector xdvnmin(spDVector x, long n, long margin, unsigned long options);
559extern spLVector xsvnmax(spSVector x, long n, long margin, unsigned long options);
560extern spLVector xlvnmax(spLVector x, long n, long margin, unsigned long options);
561extern spLVector xfvnmax(spFVector x, long n, long margin, unsigned long options);
562extern long dvnmax(spLVector idx, spDVector x, long margin, unsigned long options);
563extern spLVector xdvnmax(spDVector x, long n, long margin, unsigned long options);
564
570extern void svsort(spSVector x);
573extern void lvsort(spLVector x);
576extern void fvsort(spFVector x);
579extern void dvsort(spDVector x);
582extern spSVector xsvsort(spSVector x);
585extern spLVector xlvsort(spLVector x);
588extern spFVector xfvsort(spFVector x);
591extern spDVector xdvsort(spDVector x);
592
594extern void spheapsort(void *keysptr, void *valuesptr, long length,
595 int (*compare_func)(void *keysptr, long i, long j),
596 void (*swap_func)(void *keysptr, void *valuesptr, long i, long j));
597
600extern spLVector xsvsortidx(spSVector x);
603extern spLVector xlvsortidx(spLVector x);
606extern spLVector xfvsortidx(spFVector x);
611extern spLVector xdvsortidx(spDVector x);
612
615extern double svmedian(spSVector x);
618extern double lvmedian(spLVector x);
621extern float fvmedian(spFVector x);
626extern double dvmedian(spDVector x);
629extern spSVector xsvmedian(spSVector x, double *median);
632extern spLVector xlvmedian(spLVector x, double *median);
635extern spFVector xfvmedian(spFVector x, float *median);
641extern spDVector xdvmedian(spDVector x, double *median);
642
650extern long svzerocross(spSVector x, int slope_sign);
653extern long lvzerocross(spLVector x, int slope_sign);
656extern long fvzerocross(spFVector x, int slope_sign);
663extern long dvzerocross(spDVector x, int slope_sign);
664
667/*-- the following functions are supported for float and double only --*/
668
674extern void fvangle(spFVector x);
677extern spFVector xfvangle(spFVector x);
680extern void dvangle(spDVector x);
683extern spDVector xdvangle(spDVector x);
684
692extern void fvcos(spFVector x);
695extern void dvcos(spDVector x);
698extern spFVector xfvcos(spFVector x);
701extern spDVector xdvcos(spDVector x);
702
705extern void fvsin(spFVector x);
708extern void dvsin(spDVector x);
711extern spFVector xfvsin(spFVector x);
714extern spDVector xdvsin(spDVector x);
715
718extern void fvtan(spFVector x);
721extern void dvtan(spDVector x);
724extern spFVector xfvtan(spFVector x);
727extern spDVector xdvtan(spDVector x);
728
731extern void fvcosh(spFVector x);
734extern void dvcosh(spDVector x);
737extern spFVector xfvcosh(spFVector x);
740extern spDVector xdvcosh(spDVector x);
741
744extern void fvsinh(spFVector x);
747extern void dvsinh(spDVector x);
750extern spFVector xfvsinh(spFVector x);
753extern spDVector xdvsinh(spDVector x);
754
757extern void fvtanh(spFVector x);
760extern void dvtanh(spDVector x);
763extern spFVector xfvtanh(spFVector x);
766extern spDVector xdvtanh(spDVector x);
767
770extern void fvacos(spFVector x);
773extern void dvacos(spDVector x);
776extern spFVector xfvacos(spFVector x);
779extern spDVector xdvacos(spDVector x);
780
783extern void fvasin(spFVector x);
786extern void dvasin(spDVector x);
789extern spFVector xfvasin(spFVector x);
792extern spDVector xdvasin(spDVector x);
793
796extern void fvatan(spFVector x);
799extern void dvatan(spDVector x);
802extern spFVector xfvatan(spFVector x);
805extern spDVector xdvatan(spDVector x);
806
809extern void fvatan2(spFVector y, spFVector x, spBool reverse);
814extern void dvatan2(spDVector y, spDVector x, spBool reverse);
817extern spFVector xfvatan2(spFVector y, spFVector x);
821extern spDVector xdvatan2(spDVector y, spDVector x);
822
830extern void fvexp(spFVector x);
833extern void dvexp(spDVector x);
836extern spFVector xfvexp(spFVector x);
839extern spDVector xdvexp(spDVector x);
840
843extern void fvlog(spFVector x);
846extern void dvlog(spDVector x);
849extern spFVector xfvlog(spFVector x);
852extern spDVector xdvlog(spDVector x);
853
856extern void fvlog10(spFVector x);
859extern void dvlog10(spDVector x);
862extern spFVector xfvlog10(spFVector x);
865extern spDVector xdvlog10(spDVector x);
866
869extern void fvdecibela(spFVector x);
873extern void dvdecibela(spDVector x);
876extern spFVector xfvdecibela(spFVector x);
880extern spDVector xdvdecibela(spDVector x);
881
884extern void fvdecibelp(spFVector x);
888extern void dvdecibelp(spDVector x);
891extern spFVector xfvdecibelp(spFVector x);
895extern spDVector xdvdecibelp(spDVector x);
896
899extern void fvundecibelp(spFVector x);
902extern void dvundecibelp(spDVector x);
905extern spFVector xfvundecibelp(spFVector x);
908extern spDVector xdvundecibelp(spDVector x);
909
912extern void fvdecibel(spFVector x);
915extern void dvdecibel(spDVector x);
918extern spFVector xfvdecibel(spFVector x);
921extern spDVector xdvdecibel(spDVector x);
922
925extern void fvundecibel(spFVector x);
928extern void dvundecibel(spDVector x);
931extern spFVector xfvundecibel(spFVector x);
934extern spDVector xdvundecibel(spDVector x);
935
943extern void fvrandun(spFVector x);
946extern void dvrandun(spDVector x);
947
950extern spFVector xfvrandunul(spPlugin *plugin, long length, spBool unlock_flag);
953extern spDVector xdvrandunul(spPlugin *plugin, long length, spBool unlock_flag);
954
957extern spFVector xfvrandun(long length);
960extern spDVector xdvrandun(long length);
961
964extern void fvgauss(spFVector x, float mu, float sigma);
967extern void dvgauss(spDVector x, double mu, double sigma);
968
971extern spFVector xfvgaussul(spPlugin *plugin, long length, float mu, float sigma, spBool unlock_flag);
974extern spDVector xdvgaussul(spPlugin *plugin, long length, double mu, double sigma, spBool unlock_flag);
975
978extern spFVector xfvgauss(long length, float mu, float sigma);
981extern spDVector xdvgauss(long length, double mu, double sigma);
982
985extern void fvrandn(spFVector x);
988extern void dvrandn(spDVector x);
989
992extern spFVector xfvrandnul(spPlugin *plugin, long length, spBool unlock_flag);
995extern spDVector xdvrandnul(spPlugin *plugin, long length, spBool unlock_flag);
996
999extern spFVector xfvrandn(long length);
1002extern spDVector xdvrandn(long length);
1003
1006 /*----@addtogroup vmathGroup----*/
1007
1009extern double dvscpolyval(spDVector p, double x);
1010extern void dvcplxpolyval(spDVector p, double xre, double xim, double *oyre, double *oyim);
1011extern void dvpolyval(spDVector iox, spDVector p);
1012extern spDVector xdvpolyval(spDVector x, spDVector p);
1013
1014#if defined(MACOS)
1015#pragma import off
1016#endif
1017
1018#ifdef __cplusplus
1019} /* Close scope of 'extern "C"' declaration */
1020#endif
1021
1022#endif /* SPLIB_VMATH_H */
int spBool
double型を扱うためのベクトル型です.
Definition vector.h:248
float型を扱うためのベクトル型です.
Definition vector.h:214
long型を扱うためのベクトル型です.
Definition vector.h:180
short型を扱うためのベクトル型です.
Definition vector.h:146