SAF
Loading...
Searching...
No Matches
saf_utility_veclib.h
Go to the documentation of this file.
1/*
2 * Copyright 2016-2018 Leo McCormack
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10 * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14 * PERFORMANCE OF THIS SOFTWARE.
15 */
16
29#ifndef SAF_VECLIB_H_INCLUDED
30#define SAF_VECLIB_H_INCLUDED
31
32#ifdef __cplusplus
33extern "C" {
34#endif /* __cplusplus */
35
36#include "saf_utility_complex.h"
37
40typedef enum {
41 NO_CONJ = 1,
42 CONJ = 2
44
45#ifdef SAF_USE_BUILT_IN_NAIVE_CBLAS
46 enum { CblasRowMajor = 101, CblasColMajor = 102 } CBLAS_ORDER;
47 enum { CblasNoTrans = 111, CblasTrans = 112, CblasConjTrans = 113 } CBLAS_TRANSPOSE;
48#endif
49
50/* KEY:
51 * ? -> s -> single floating-point precision
52 * ? -> d -> double floating-point precision
53 * ? -> c -> complex single floating-point precision
54 * ? -> z -> complex double floating-point precision
55 *
56 * s -> scalar
57 * v -> vector
58 * m -> matrix */
59
60/* ========================================================================== */
61/* Built-in CBLAS Functions (Level 0) */
62/* ========================================================================== */
63
64#ifdef SAF_USE_BUILT_IN_NAIVE_CBLAS
65void cblas_scopy(const int N, const float *X, const int incX,
66 float *Y, const int incY);
67void cblas_dcopy(const int N, const double *X, const int incX,
68 double *Y, const int incY);
69void cblas_ccopy(const int N, const void *X, const int incX,
70 void *Y, const int incY);
71void cblas_zcopy(const int N, const void *X, const int incX,
72 void *Y, const int incY);
73
74void cblas_saxpy(const int N, const float alpha, const float* X,
75 const int incX, float* Y, const int incY);
76void cblas_daxpy(const int N, const double alpha, const double* X,
77 const int incX, double* Y, const int incY);
78void cblas_caxpy(const int N, const void* alpha, const void* X,
79 const int incX, void* Y, const int incY);
80void cblas_zaxpy(const int N, const void* alpha, const void* X,
81 const int incX, void* Y, const int incY);
82#endif
83
84
85/* ========================================================================== */
86/* Built-in CBLAS Functions (Level 3) */
87/* ========================================================================== */
88
89#ifdef SAF_USE_BUILT_IN_NAIVE_CBLAS
90void cblas_sgemm(const CBLAS_LAYOUT Layout, const CBLAS_TRANSPOSE TransA,
91 const CBLAS_TRANSPOSE TransB, const int M, const int N,
92 const int K, const float alpha, const float *A,
93 const int lda, const float *B, const int ldb,
94 const float beta, float *C, const int ldc);
95#endif
96
97
98/* ========================================================================== */
99/* Find Index of Min-Abs-Value (?iminv) */
100/* ========================================================================== */
101
112void utility_siminv(/* Input Arguments */
113 const float* a,
114 const int len,
115 /* Output Arguments */
116 int* index);
117
128void utility_ciminv(/* Input Arguments */
129 const float_complex* a,
130 const int len,
131 /* Output Arguments */
132 int* index);
133
144void utility_diminv(/* Input Arguments */
145 const double* a,
146 const int len,
147 /* Output Arguments */
148 int* index);
149
160void utility_ziminv(/* Input Arguments */
161 const double_complex* a,
162 const int len,
163 /* Output Arguments */
164 int* index);
165
166
167/* ========================================================================== */
168/* Find Index of Max-Abs-Value (?imaxv) */
169/* ========================================================================== */
170
181void utility_simaxv(/* Input Arguments */
182 const float* a,
183 const int len,
184 /* Output Arguments */
185 int* index);
186
197void utility_cimaxv(/* Input Arguments */
198 const float_complex* a,
199 const int len,
200 /* Output Arguments */
201 int* index);
202
213void utility_dimaxv(/* Input Arguments */
214 const double* a,
215 const int len,
216 /* Output Arguments */
217 int* index);
218
229void utility_zimaxv(/* Input Arguments */
230 const double_complex* a,
231 const int len,
232 /* Output Arguments */
233 int* index);
234
235
236/* ========================================================================== */
237/* Vector-Abs (?vabs) */
238/* ========================================================================== */
239
250void utility_svabs(/* Input Arguments */
251 const float* a,
252 const int len,
253 /* Output Arguments */
254 float* c);
255
266void utility_cvabs(/* Input Arguments */
267 const float_complex* a,
268 const int len,
269 /* Output Arguments */
270 float* c);
271
272
273/* ========================================================================== */
274/* Vector-Modulus (?vmod) */
275/* ========================================================================== */
276
288void utility_svmod(/* Input Arguments */
289 const float* a,
290 const float* b,
291 const int len,
292 /* Output Arguments */
293 float* c);
294
295
296/* ========================================================================== */
297/* Vector-Reciprocal (?vrecip) */
298/* ========================================================================== */
299
310void utility_svrecip(const float* a,
311 const int len,
312 float* c);
313
314
315/* ========================================================================== */
316/* Vector-Conjugate (?vconj) */
317/* ========================================================================== */
318
329void utility_cvconj(const float_complex* a,
330 const int len,
331 float_complex* c);
332
343void utility_zvconj(const double_complex* a,
344 const int len,
345 double_complex* c);
346
347
348/* ========================================================================== */
349/* Vector-Vector Copy (?vvcopy) */
350/* ========================================================================== */
351
362void utility_svvcopy(/* Input Arguments */
363 const float* a,
364 const int len,
365 /* Output Arguments */
366 float* c);
367
378void utility_cvvcopy(/* Input Arguments */
379 const float_complex* a,
380 const int len,
381 /* Output Arguments */
382 float_complex* c);
383
394void utility_dvvcopy(/* Input Arguments */
395 const double* a,
396 const int len,
397 /* Output Arguments */
398 double* c);
399
410void utility_zvvcopy(/* Input Arguments */
411 const double_complex* a,
412 const int len,
413 /* Output Arguments */
414 double_complex* c);
415
416
417/* ========================================================================== */
418/* Vector-Vector Addition (?vvadd) */
419/* ========================================================================== */
420
432void utility_svvadd(/* Input Arguments */
433 const float* a,
434 const float* b,
435 const int len,
436 /* Output Arguments */
437 float* c);
438
450void utility_cvvadd(/* Input Arguments */
451 const float_complex* a,
452 const float_complex* b,
453 const int len,
454 /* Output Arguments */
455 float_complex* c);
456
468void utility_dvvadd(/* Input Arguments */
469 const double* a,
470 const double* b,
471 const int len,
472 /* Output Arguments */
473 double* c);
474
486void utility_zvvadd(/* Input Arguments */
487 const double_complex* a,
488 const double_complex* b,
489 const int len,
490 /* Output Arguments */
491 double_complex* c);
492
493
494/* ========================================================================== */
495/* Vector-Vector Subtraction (?vvsub) */
496/* ========================================================================== */
497
509void utility_svvsub(/* Input Arguments */
510 const float* a,
511 const float* b,
512 const int len,
513 /* Output Arguments */
514 float* c);
515
527void utility_cvvsub(/* Input Arguments */
528 const float_complex* a,
529 const float_complex* b,
530 const int len,
531 /* Output Arguments */
532 float_complex* c);
533
545void utility_dvvsub(/* Input Arguments */
546 const double* a,
547 const double* b,
548 const int len,
549 /* Output Arguments */
550 double* c);
551
563void utility_zvvsub(/* Input Arguments */
564 const double_complex* a,
565 const double_complex* b,
566 const int len,
567 /* Output Arguments */
568 double_complex* c);
569
570
571/* ========================================================================== */
572/* Vector-Vector Multiplication (?vvmul) */
573/* ========================================================================== */
574
586void utility_svvmul(/* Input Arguments */
587 const float* a,
588 const float* b,
589 const int len,
590 /* Output Arguments */
591 float* c);
592
604void utility_cvvmul(/* Input Arguments */
605 const float_complex* a,
606 const float_complex* b,
607 const int len,
608 /* Output Arguments */
609 float_complex* c);
610
611
612/* ========================================================================== */
613/* Vector-Vector Dot Product (?vvdot) */
614/* ========================================================================== */
615
627void utility_svvdot(/* Input Arguments */
628 const float* a,
629 const float* b,
630 const int len,
631 /* Output Arguments */
632 float* c);
633
647void utility_cvvdot(/* Input Arguments */
648 const float_complex* a,
649 const float_complex* b,
650 const int len,
651 CONJ_FLAG flag,
652 /* Output Arguments */
653 float_complex* c);
654
655
656/* ========================================================================== */
657/* Vector-Scalar Product (?vsmul) */
658/* ========================================================================== */
659
673void utility_svsmul(/* Input Arguments */
674 float* a,
675 const float* s,
676 const int len,
677 /* Output Arguments */
678 float* c);
679
692void utility_cvsmul(/* Input Arguments */
693 float_complex* a,
694 const float_complex* s,
695 const int len,
696 /* Output Arguments */
697 float_complex* c);
698
712void utility_dvsmul(/* Input Arguments */
713 double* a,
714 const double* s,
715 const int len,
716 /* Output Arguments */
717 double* c);
718
731void utility_zvsmul(/* Input Arguments */
732 double_complex* a,
733 const double_complex* s,
734 const int len,
735 /* Output Arguments */
736 double_complex* c);
737
738
739/* ========================================================================== */
740/* Vector-Scalar Division (?vsdiv) */
741/* ========================================================================== */
742
755void utility_svsdiv(/* Input Arguments */
756 const float* a,
757 const float* s,
758 const int len,
759 /* Output Arguments */
760 float* c);
761
762
763/* ========================================================================== */
764/* Vector-Scalar Addition (?vsadd) */
765/* ========================================================================== */
766
778void utility_svsadd(/* Input Arguments */
779 float* a,
780 const float* s,
781 const int len,
782 /* Output Arguments */
783 float* c);
784
785
786/* ========================================================================== */
787/* Vector-Scalar Subtraction (?vssub) */
788/* ========================================================================== */
789
802void utility_svssub(/* Input Arguments */
803 float* a,
804 const float* s,
805 const int len,
806 /* Output Arguments */
807 float* c);
808
809
810/* ========================================================================== */
811/* Sparse-Vector to Compressed-Vector (Known Indices) (?sv2cv_inds) */
812/* ========================================================================== */
813
828void utility_ssv2cv_inds(/* Input Arguments */
829 const float* sv,
830 const int* inds,
831 const int len,
832 /* Output Arguments */
833 float* cv);
834
849void utility_csv2cv_inds(/* Input Arguments */
850 const float_complex* sv,
851 const int* inds,
852 const int len,
853 /* Output Arguments */
854 float_complex* cv);
855
870void utility_dsv2cv_inds(/* Input Arguments */
871 const double* sv,
872 const int* inds,
873 const int len,
874 /* Output Arguments */
875 double* cv);
876
891void utility_zsv2cv_inds(/* Input Arguments */
892 const double_complex* sv,
893 const int* inds,
894 const int len,
895 /* Output Arguments */
896 double_complex* cv);
897
898
899/* ========================================================================== */
900/* Singular-Value Decomposition (?svd) */
901/* ========================================================================== */
902
910void utility_ssvd_create(void ** const phWork, int maxDim1, int maxDim2);
911
913void utility_ssvd_destroy(void ** const phWork);
914
938void utility_ssvd(/* Input Arguments */
939 void* const hWork,
940 const float* A,
941 const int dim1,
942 const int dim2,
943 /* Output Arguments */
944 float* U,
945 float* S,
946 float* V,
947 float* sing);
948
956void utility_csvd_create(void ** const phWork, int maxDim1, int maxDim2);
957
959void utility_csvd_destroy(void ** const phWork);
960
984void utility_csvd(/* Input Arguments */
985 void* const hWork,
986 const float_complex* A,
987 const int dim1,
988 const int dim2,
989 /* Output Arguments */
990 float_complex* U,
991 float_complex* S,
992 float_complex* V,
993 float* sing);
994
995
996/* ========================================================================== */
997/* Symmetric Eigenvalue Decomposition (?seig) */
998/* ========================================================================== */
999
1006void utility_sseig_create(void ** const phWork, int maxDim);
1007
1009void utility_sseig_destroy(void ** const phWork);
1010
1035void utility_sseig(/* Input Arguments */
1036 void* const hWork,
1037 const float* A,
1038 const int dim,
1039 int sortDecFLAG,
1040 /* Output Arguments */
1041 float* V,
1042 float* D,
1043 float* eig);
1044
1051void utility_cseig_create(void ** const phWork,
1052 int maxDim);
1053
1055void utility_cseig_destroy(void ** const phWork);
1056
1081void utility_cseig(/* Input Arguments */
1082 void* const hWork,
1083 const float_complex* A,
1084 const int dim,
1085 int sortDecFLAG,
1086 /* Output Arguments */
1087 float_complex* V,
1088 float_complex* D,
1089 float* eig);
1090
1091
1092/* ========================================================================== */
1093/* Eigenvalues of Matrix Pair (?eigmp) */
1094/* ========================================================================== */
1095
1102void utility_ceigmp_create(void** const phWork, int maxDim);
1103
1105void utility_ceigmp_destroy(void ** const phWork);
1106
1126void utility_ceigmp(/* Input Arguments */
1127 void* const hWork,
1128 const float_complex* A,
1129 const float_complex* B,
1130 const int dim,
1131 /* Output Arguments */
1132 float_complex* VL,
1133 float_complex* VR,
1134 float_complex* D);
1135
1142void utility_zeigmp_create(void** const phWork, int maxDim);
1143
1145void utility_zeigmp_destroy(void ** const phWork);
1146
1166void utility_zeigmp(/* Input Arguments */
1167 void* const hWork,
1168 const double_complex* A,
1169 const double_complex* B,
1170 const int dim,
1171 /* Output Arguments */
1172 double_complex* VL,
1173 double_complex* VR,
1174 double_complex* D);
1175
1176
1177/* ========================================================================== */
1178/* Eigenvalue Decomposition (?eig) */
1179/* ========================================================================== */
1180
1187void utility_ceig_create(void ** const phWork, int maxDim);
1188
1190void utility_ceig_destroy(void ** const phWork);
1191
1215void utility_ceig(/* Input Arguments */
1216 void* const hWork,
1217 const float_complex* A,
1218 const int dim,
1219 /* Output Arguments */
1220 float_complex* VL,
1221 float_complex* VR,
1222 float_complex* D,
1223 float_complex* eig);
1224
1231void utility_zeig_create(void ** const phWork, int maxDim);
1232
1234void utility_zeig_destroy(void ** const phWork);
1235
1259void utility_zeig(/* Input Arguments */
1260 void* const hWork,
1261 const double_complex* A,
1262 const int dim,
1263 /* Output Arguments */
1264 double_complex* VL,
1265 double_complex* VR,
1266 double_complex* D,
1267 double_complex* eig);
1268
1269
1270/* ========================================================================== */
1271/* General Linear Solver (?glslv) */
1272/* ========================================================================== */
1273
1281void utility_sglslv_create(void ** const phWork,
1282 int maxDim,
1283 int maxNCol);
1284
1286void utility_sglslv_destroy(void ** const phWork);
1287
1302void utility_sglslv(/* Input Arguments */
1303 void* const hWork,
1304 const float* A,
1305 const int dim,
1306 float* B,
1307 int nCol,
1308 /* Output Arguments */
1309 float* X);
1310
1318void utility_cglslv_create(void ** const phWork, int maxDim, int maxNCol);
1319
1321void utility_cglslv_destroy(void ** const phWork);
1322
1337void utility_cglslv(/* Input Arguments */
1338 void* const hWork,
1339 const float_complex* A,
1340 const int dim,
1341 float_complex* B,
1342 int nCol,
1343 /* Output Arguments */
1344 float_complex* X);
1345
1353void utility_dglslv_create(void ** const phWork, int maxDim, int maxNCol);
1354
1356void utility_dglslv_destroy(void ** const phWork);
1357
1372void utility_dglslv(/* Input Arguments */
1373 void* const hWork,
1374 const double* A,
1375 const int dim,
1376 double* B,
1377 int nCol,
1378 /* Output Arguments */
1379 double* X);
1380
1388void utility_zglslv_create(void ** const phWork, int maxDim, int maxNCol);
1389
1391void utility_zglslv_destroy(void ** const phWork);
1392
1407void utility_zglslv(/* Input Arguments */
1408 void* const hWork,
1409 const double_complex* A,
1410 const int dim,
1411 double_complex* B,
1412 int nCol,
1413 /* Output Arguments */
1414 double_complex* X);
1415
1416
1417/* ========================================================================== */
1418/* General Linear Solver (?glslvt) */
1419/* ========================================================================== */
1420
1428void utility_sglslvt_create(void ** const phWork,
1429 int maxDim,
1430 int maxNCol);
1431
1433void utility_sglslvt_destroy(void ** const phWork);
1434
1449void utility_sglslvt(/* Input Arguments */
1450 void* const hWork,
1451 const float* A,
1452 const int dim,
1453 float* B,
1454 int nCol,
1455 /* Output Arguments */
1456 float* X);
1457
1458
1459/* ========================================================================== */
1460/* Symmetric Linear Solver (?slslv) */
1461/* ========================================================================== */
1462
1470void utility_sslslv_create(void ** const phWork, int maxDim, int maxNCol);
1471
1473void utility_sslslv_destroy(void ** const phWork);
1474
1491void utility_sslslv(/* Input Arguments */
1492 void* const hWork,
1493 const float* A,
1494 const int dim,
1495 float* B,
1496 int nCol,
1497 /* Output Arguments */
1498 float* X);
1499
1507void utility_cslslv_create(void ** const phWork, int maxDim, int maxNCol);
1508
1510void utility_cslslv_destroy(void ** const phWork);
1511
1529void utility_cslslv(/* Input Arguments */
1530 void* const hWork,
1531 const float_complex* A,
1532 const int dim,
1533 float_complex* B,
1534 int nCol,
1535 /* Output Arguments */
1536 float_complex* X);
1537
1538
1539/* ========================================================================== */
1540/* Matrix Pseudo-Inverse (?pinv) */
1541/* ========================================================================== */
1542
1550void utility_spinv_create(void ** const phWork, int maxDim1, int maxDim2);
1551
1553void utility_spinv_destroy(void ** const phWork);
1554
1568void utility_spinv(/* Input Arguments */
1569 void* const hWork,
1570 const float* A,
1571 const int dim1,
1572 const int dim2,
1573 /* Output Arguments */
1574 float* B);
1575
1583void utility_cpinv_create(void ** const phWork, int maxDim1, int maxDim2);
1584
1586void utility_cpinv_destroy(void ** const phWork);
1587
1601void utility_cpinv(/* Input Arguments */
1602 void* const hWork,
1603 const float_complex* A,
1604 const int dim1,
1605 const int dim2,
1606 /* Output Arguments */
1607 float_complex* B);
1608
1616void utility_dpinv_create(void ** const phWork, int maxDim1, int maxDim2);
1617
1619void utility_dpinv_destroy(void ** const phWork);
1620
1634void utility_dpinv(/* Input Arguments */
1635 void* const hWork,
1636 const double* A,
1637 const int dim1,
1638 const int dim2,
1639 /* Output Arguments */
1640 double* B);
1641
1649void utility_zpinv_create(void ** const phWork, int maxDim1, int maxDim2);
1650
1652void utility_zpinv_destroy(void ** const phWork);
1653
1667void utility_zpinv(/* Input Arguments */
1668 void* const hWork,
1669 const double_complex* A,
1670 const int dim1,
1671 const int dim2,
1672 /* Output Arguments */
1673 double_complex* B);
1674
1675
1676/* ========================================================================== */
1677/* Cholesky Factorisation (?chol) */
1678/* ========================================================================== */
1679
1686void utility_schol_create(void ** const phWork, int maxDim);
1687
1689void utility_schol_destroy(void ** const phWork);
1690
1705void utility_schol(/* Input Arguments */
1706 void* const hWork,
1707 const float* A,
1708 const int dim,
1709 /* Output Arguments */
1710 float* X);
1711
1718void utility_cchol_create(void ** const phWork, int maxDim);
1719
1721void utility_cchol_destroy(void ** const phWork);
1722
1737void utility_cchol(/* Input Arguments */
1738 void* const hWork,
1739 const float_complex* A,
1740 const int dim,
1741 /* Output Arguments */
1742 float_complex* X);
1743
1744
1745/* ========================================================================== */
1746/* Determinant of a Matrix (?det) */
1747/* ========================================================================== */
1748
1755void utility_sdet_create(void ** const phWork, int maxN);
1756
1758void utility_sdet_destroy(void ** const phWork);
1759
1772float utility_sdet(void* const hWork,
1773 float* A,
1774 int N);
1775
1782void utility_ddet_create(void ** const phWork, int maxN);
1783
1785void utility_ddet_destroy(void ** const phWork);
1786
1799double utility_ddet(void* const hWork,
1800 double* A,
1801 int N);
1802
1803
1804/* ========================================================================== */
1805/* Matrix Inversion (?inv) */
1806/* ========================================================================== */
1807
1814void utility_sinv_create(void ** const phWork, int maxDim);
1815
1817void utility_sinv_destroy(void ** const phWork);
1818
1831void utility_sinv(void* const hWork,
1832 float* A,
1833 float* B,
1834 const int dim);
1835
1842void utility_dinv_create(void ** const phWork, int maxDim);
1843
1845void utility_dinv_destroy(void ** const phWork);
1846
1859void utility_dinv(void* const hWork,
1860 double* A,
1861 double* B,
1862 const int dim);
1863
1870void utility_cinv_create(void ** const phWork, int maxDim);
1871
1873void utility_cinv_destroy(void ** const phWork);
1874
1887void utility_cinv(void* const hWork,
1888 float_complex* A,
1889 float_complex* B,
1890 const int dim);
1891
1892
1893#ifdef __cplusplus
1894}/* extern "C" */
1895#endif /* __cplusplus */
1896
1897#endif /* SAF_VECLIB_H_INCLUDED */
1898
1899 /* doxygen addtogroup Utilities */
void utility_dimaxv(const double *a, const int len, int *index)
Double-precision, index of maximum absolute value in a vector, i.e.
void utility_spinv_create(void **const phWork, int maxDim1, int maxDim2)
(Optional) Pre-allocate the working struct used by utility_spinv()
void utility_dinv(void *const hWork, double *A, double *B, const int dim)
Matrix inversion: double precision, i.e.
double utility_ddet(void *const hWork, double *A, int N)
Determinant of a Matrix, double precision, i,e.
void utility_dinv_create(void **const phWork, int maxDim)
(Optional) Pre-allocate the working struct used by utility_dinv()
void utility_zvvsub(const double_complex *a, const double_complex *b, const int len, double_complex *c)
Double-precision, complex, vector-vector subtraction, i.e.
void utility_ceigmp(void *const hWork, const float_complex *A, const float_complex *B, const int dim, float_complex *VL, float_complex *VR, float_complex *D)
Computes eigenvalues of a matrix pair using the QZ method, single precision complex,...
void utility_cpinv_create(void **const phWork, int maxDim1, int maxDim2)
(Optional) Pre-allocate the working struct used by utility_cpinv()
void utility_zsv2cv_inds(const double_complex *sv, const int *inds, const int len, double_complex *cv)
Double-precision complex, sparse-vector to compressed vector given known indices.
void utility_cglslv_destroy(void **const phWork)
De-allocate the working struct used by utility_cglslv()
void utility_cglslv(void *const hWork, const float_complex *A, const int dim, float_complex *B, int nCol, float_complex *X)
General linear solver: single precision complex, i.e.
void utility_ddet_destroy(void **const phWork)
De-allocate the working struct used by utility_ddet()
void utility_zeig_destroy(void **const phWork)
De-allocate the working struct used by utility_zeig()
void utility_cvvmul(const float_complex *a, const float_complex *b, const int len, float_complex *c)
Single-precision, complex, element-wise vector-vector multiplication i.e.
void utility_svvmul(const float *a, const float *b, const int len, float *c)
Single-precision, element-wise vector-vector multiplication i.e.
void utility_ceig_destroy(void **const phWork)
De-allocate the working struct used by utility_ceig()
void utility_cinv(void *const hWork, float_complex *A, float_complex *B, const int dim)
Matrix inversion: double precision complex, i.e.
void utility_dvsmul(double *a, const double *s, const int len, double *c)
Double-precision, multiplies each element in vector 'a' with a scalar 's', i.e.
void utility_csv2cv_inds(const float_complex *sv, const int *inds, const int len, float_complex *cv)
Single-precision complex, sparse-vector to compressed vector given known indices.
void utility_svmod(const float *a, const float *b, const int len, float *c)
Single-precision, modulus of vector elements, i.e.
void utility_ziminv(const double_complex *a, const int len, int *index)
Double-precision, complex, index of maximum absolute value in a vector, i.e.
void utility_dvvsub(const double *a, const double *b, const int len, double *c)
Double-precision, vector-vector subtraction, i.e.
void utility_dsv2cv_inds(const double *sv, const int *inds, const int len, double *cv)
Double-precision, sparse-vector to compressed vector given known indices i.e.
void utility_csvd_destroy(void **const phWork)
De-allocate the working struct used by utility_csvd()
void utility_ceigmp_create(void **const phWork, int maxDim)
(Optional) Pre-allocate the working struct used by utility_ceigmp()
void utility_dglslv(void *const hWork, const double *A, const int dim, double *B, int nCol, double *X)
General linear solver: double precision, i.e.
void utility_zvsmul(double_complex *a, const double_complex *s, const int len, double_complex *c)
Double-precision, complex, multiplies each element in vector 'a' with a scalar 's',...
void utility_dglslv_destroy(void **const phWork)
De-allocate the working struct used by utility_dglslv()
void utility_schol_destroy(void **const phWork)
De-allocate the working struct used by utility_schol()
void utility_zeig_create(void **const phWork, int maxDim)
(Optional) Pre-allocate the working struct used by utility_zeig()
void utility_svsadd(float *a, const float *s, const int len, float *c)
Single-precision, adds each element in vector 'a' with a scalar 's', i.e.
void utility_cseig_destroy(void **const phWork)
De-allocate the working struct used by utility_cseig()
void utility_ciminv(const float_complex *a, const int len, int *index)
Single-precision, complex, index of maximum absolute value in a vector, i.e.
void utility_dvvadd(const double *a, const double *b, const int len, double *c)
Double-precision, vector-vector addition, i.e.
void utility_svssub(float *a, const float *s, const int len, float *c)
Single-precision, subtracts each element in vector 'a' with a scalar 's', i.e.
void utility_svvsub(const float *a, const float *b, const int len, float *c)
Single-precision, vector-vector subtraction, i.e.
void utility_ssvd_create(void **const phWork, int maxDim1, int maxDim2)
(Optional) Pre-allocate the working struct used by utility_ssvd()
void utility_sglslvt(void *const hWork, const float *A, const int dim, float *B, int nCol, float *X)
General linear solver (the other way): single precision, i.e.
void utility_ssvd(void *const hWork, const float *A, const int dim1, const int dim2, float *U, float *S, float *V, float *sing)
Singular value decomposition: single precision, i.e.
void utility_zimaxv(const double_complex *a, const int len, int *index)
Double-precision, complex, index of maximum absolute value in a vector, i.e.
void utility_zeigmp(void *const hWork, const double_complex *A, const double_complex *B, const int dim, double_complex *VL, double_complex *VR, double_complex *D)
Computes eigenvalues of a matrix pair using the QZ method, double precision complex,...
void utility_cinv_destroy(void **const phWork)
De-allocate the working struct used by utility_cinv()
void utility_ceig(void *const hWork, const float_complex *A, const int dim, float_complex *VL, float_complex *VR, float_complex *D, float_complex *eig)
Eigenvalue decomposition of a NON-SYMMETRIC matrix: single precision complex, i.e.
void utility_cvvadd(const float_complex *a, const float_complex *b, const int len, float_complex *c)
Single-precision, complex, vector-vector addition, i.e.
void utility_sinv_create(void **const phWork, int maxDim)
(Optional) Pre-allocate the working struct used by utility_sinv()
void utility_zglslv(void *const hWork, const double_complex *A, const int dim, double_complex *B, int nCol, double_complex *X)
General linear solver: double precision complex, i.e.
void utility_sglslv(void *const hWork, const float *A, const int dim, float *B, int nCol, float *X)
General linear solver: single precision, i.e.
CONJ_FLAG
Whether a vector should be conjugated or not (e.g.
void utility_svvcopy(const float *a, const int len, float *c)
Single-precision, vector-vector copy, i.e.
void utility_cimaxv(const float_complex *a, const int len, int *index)
Single-precision, complex, index of maximum absolute value in a vector, i.e.
void utility_spinv(void *const hWork, const float *A, const int dim1, const int dim2, float *B)
General matrix pseudo-inverse (the svd way): single precision, i.e.
void utility_dpinv_create(void **const phWork, int maxDim1, int maxDim2)
(Optional) Pre-allocate the working struct used by utility_dpinv()
void utility_cpinv(void *const hWork, const float_complex *A, const int dim1, const int dim2, float_complex *B)
General matrix pseudo-inverse (the svd way): single precision complex, i.e.
void utility_cslslv_create(void **const phWork, int maxDim, int maxNCol)
(Optional) Pre-allocate the working struct used by utility_cslslv()
void utility_sseig_create(void **const phWork, int maxDim)
(Optional) Pre-allocate the working struct used by utility_sseig()
void utility_sinv(void *const hWork, float *A, float *B, const int dim)
Matrix inversion: single precision, i.e.
void utility_zglslv_destroy(void **const phWork)
De-allocate the working struct used by utility_zglslv()
void utility_cpinv_destroy(void **const phWork)
De-allocate the working struct used by utility_cpinv()
void utility_sglslvt_destroy(void **const phWork)
De-allocate the working struct used by utility_sglslvt()
void utility_dpinv_destroy(void **const phWork)
De-allocate the working struct used by utility_dpinv()
void utility_cseig(void *const hWork, const float_complex *A, const int dim, int sortDecFLAG, float_complex *V, float_complex *D, float *eig)
Eigenvalue decomposition of a SYMMETRIC/HERMITION matrix: single precision complex,...
void utility_csvd(void *const hWork, const float_complex *A, const int dim1, const int dim2, float_complex *U, float_complex *S, float_complex *V, float *sing)
Singular value decomposition: single precision complex, i.e.
void utility_dpinv(void *const hWork, const double *A, const int dim1, const int dim2, double *B)
General matrix pseudo-inverse (the svd way): double precision, i.e.
void utility_cseig_create(void **const phWork, int maxDim)
(Optional) Pre-allocate the working struct used by utility_cseig()
void utility_diminv(const double *a, const int len, int *index)
Double-precision, index of minimum absolute value in a vector, i.e.
void utility_sslslv_destroy(void **const phWork)
De-allocate the working struct used by utility_sslslv()
void utility_schol(void *const hWork, const float *A, const int dim, float *X)
Cholesky factorisation of a symmetric matrix positive-definate matrix: single precision,...
void utility_zeig(void *const hWork, const double_complex *A, const int dim, double_complex *VL, double_complex *VR, double_complex *D, double_complex *eig)
Eigenvalue decomposition of a NON-SYMMETRIC matrix: double precision complex, i.e.
void utility_cvabs(const float_complex *a, const int len, float *c)
Single-precision, complex, absolute values of vector elements, i.e.
void utility_cvvdot(const float_complex *a, const float_complex *b, const int len, CONJ_FLAG flag, float_complex *c)
Single-precision, complex, vector-vector dot product, i.e.
void utility_sglslv_create(void **const phWork, int maxDim, int maxNCol)
(Optional) Pre-allocate the working struct used by utility_sglslv()
void utility_cinv_create(void **const phWork, int maxDim)
(Optional) Pre-allocate the working struct used by utility_cinv()
void utility_cvvsub(const float_complex *a, const float_complex *b, const int len, float_complex *c)
Single-precision, complex, vector-vector subtraction, i.e.
void utility_zpinv(void *const hWork, const double_complex *A, const int dim1, const int dim2, double_complex *B)
General matrix pseudo-inverse (the svd way): double precision complex, i.e.
void utility_zpinv_create(void **const phWork, int maxDim1, int maxDim2)
(Optional) Pre-allocate the working struct used by utility_zpinv()
void utility_sseig(void *const hWork, const float *A, const int dim, int sortDecFLAG, float *V, float *D, float *eig)
Eigenvalue decomposition of a SYMMETRIC matrix: single precision, i.e.
void utility_dinv_destroy(void **const phWork)
De-allocate the working struct used by utility_dinv()
void utility_cchol(void *const hWork, const float_complex *A, const int dim, float_complex *X)
Cholesky factorisation of a hermitian positive-definate matrix: single precision complex,...
void utility_cchol_destroy(void **const phWork)
De-allocate the working struct used by utility_cchol()
void utility_zvvcopy(const double_complex *a, const int len, double_complex *c)
double-precision, complex, vector-vector copy, i.e.
float utility_sdet(void *const hWork, float *A, int N)
Determinant of a Matrix, single precision, i,e.
void utility_zeigmp_destroy(void **const phWork)
De-allocate the working struct used by utility_zeigmp()
void utility_schol_create(void **const phWork, int maxDim)
(Optional) Pre-allocate the working struct used by utility_schol()
void utility_sslslv_create(void **const phWork, int maxDim, int maxNCol)
(Optional) Pre-allocate the working struct used by utility_sslslv()
void utility_zvvadd(const double_complex *a, const double_complex *b, const int len, double_complex *c)
Double-precision, complex, vector-vector addition, i.e.
void utility_ceigmp_destroy(void **const phWork)
De-allocate the working struct used by utility_ceigmp()
void utility_csvd_create(void **const phWork, int maxDim1, int maxDim2)
(Optional) Pre-allocate the working struct used by utility_csvd()
void utility_cvvcopy(const float_complex *a, const int len, float_complex *c)
Single-precision, complex, vector-vector copy, i.e.
void utility_svvadd(const float *a, const float *b, const int len, float *c)
Single-precision, vector-vector addition, i.e.
void utility_svrecip(const float *a, const int len, float *c)
Single-precision, vector-reciprocal/inversion, i.e.
void utility_sglslvt_create(void **const phWork, int maxDim, int maxNCol)
(Optional) Pre-allocate the working struct used by utility_sglslvt()
void utility_spinv_destroy(void **const phWork)
De-allocate the working struct used by utility_spinv()
void utility_sslslv(void *const hWork, const float *A, const int dim, float *B, int nCol, float *X)
Linear solver for SYMMETRIC positive-definate 'A': single precision, i.e.
void utility_ddet_create(void **const phWork, int maxN)
(Optional) Pre-allocate the working struct used by utility_ddet()
void utility_sdet_create(void **const phWork, int maxN)
(Optional) Pre-allocate the working struct used by utility_sdet()
void utility_cvsmul(float_complex *a, const float_complex *s, const int len, float_complex *c)
Single-precision, complex, multiplies each element in vector 'a' with a scalar 's',...
void utility_cglslv_create(void **const phWork, int maxDim, int maxNCol)
(Optional) Pre-allocate the working struct used by utility_cglslv()
void utility_ceig_create(void **const phWork, int maxDim)
(Optional) Pre-allocate the working struct used by utility_ceig()
void utility_dglslv_create(void **const phWork, int maxDim, int maxNCol)
(Optional) Pre-allocate the working struct used by utility_dglslv()
void utility_svvdot(const float *a, const float *b, const int len, float *c)
Single-precision, vector-vector dot product, i.e.
void utility_svsdiv(const float *a, const float *s, const int len, float *c)
Single-precision, divides each element in vector 'a' with a scalar 's', i.e.
void utility_cslslv_destroy(void **const phWork)
De-allocate the working struct used by utility_cslslv()
void utility_zglslv_create(void **const phWork, int maxDim, int maxNCol)
(Optional) Pre-allocate the working struct used by utility_zglslv()
void utility_cvconj(const float_complex *a, const int len, float_complex *c)
Single-precision, complex, vector-conjugate, i.e.
void utility_dvvcopy(const double *a, const int len, double *c)
double-precision, vector-vector copy, i.e.
void utility_sseig_destroy(void **const phWork)
De-allocate the working struct used by utility_sseig()
void utility_svabs(const float *a, const int len, float *c)
Single-precision, absolute values of vector elements, i.e.
void utility_svsmul(float *a, const float *s, const int len, float *c)
Single-precision, multiplies each element in vector 'a' with a scalar 's', i.e.
void utility_zvconj(const double_complex *a, const int len, double_complex *c)
Double-precision, complex, vector-conjugate, i.e.
void utility_sinv_destroy(void **const phWork)
De-allocate the working struct used by utility_sinv()
void utility_cchol_create(void **const phWork, int maxDim)
(Optional) Pre-allocate the working struct used by utility_cchol()
void utility_sdet_destroy(void **const phWork)
De-allocate the working struct used by utility_sdet()
void utility_siminv(const float *a, const int len, int *index)
Single-precision, index of minimum absolute value in a vector, i.e.
void utility_zeigmp_create(void **const phWork, int maxDim)
(Optional) Pre-allocate the working struct used by utility_zeigmp()
void utility_ssv2cv_inds(const float *sv, const int *inds, const int len, float *cv)
Single-precision, sparse-vector to compressed vector given known indices i.e.
void utility_sglslv_destroy(void **const phWork)
De-allocate the working struct used by utility_sglslv()
void utility_simaxv(const float *a, const int len, int *index)
Single-precision, index of maximum absolute value in a vector, i.e.
void utility_ssvd_destroy(void **const phWork)
De-allocate the working struct used by utility_ssvd()
void utility_zpinv_destroy(void **const phWork)
De-allocate the working struct used by utility_zpinv()
void utility_cslslv(void *const hWork, const float_complex *A, const int dim, float_complex *B, int nCol, float_complex *X)
Linear solver for HERMITIAN positive-definate 'A': single precision complex, i.e.
@ NO_CONJ
Do not take the conjugate.
@ CONJ
Take the conjugate.
Contains wrappers for handling complex numbers across both C99-compliant compilers and Microsoft Visu...