Debian Codegraph @

dwtools/TableOfReal_extensions.h

raw symbols SCIP
1 #cxx . . $ `<file>/dwtools/TableOfReal_extensions.h`/ifndef _TableOfReal_extensions_h_
2 #define _TableOfReal_extensions_h_cxx . . $ `dwtools/TableOfReal_extensions.h:2:9`!
3 /* TableOfReal_extensions.h
4 *
5 * Copyright (C) 1993-2021 David Weenink
6 *
7 * This code is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or (at
10 * your option) any later version.
11 *
12 * This code is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this work. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #include "Categories.h"cxx . . $ `<file>/dwtools/Categories.h`/
22 #include "Collection.h"cxx . . $ `<file>/sys/Collection.h`/
23 #include "Graphics_extensions.h"cxx . . $ `<file>/dwsys/Graphics_extensions.h`/
24 #include "Matrix_extensions.h"cxx . . $ `<file>/dwtools/Matrix_extensions.h`/
25 #include "PatternList.h"cxx . . $ `<file>/dwtools/PatternList.h`/
26 #include "Strings_.h"cxx . . $ `<file>/sys/Strings_.h`/
27 #include "TableOfReal.h"cxx . . $ `<file>/stat/TableOfReal.h`/
28
29 void TableOfReal_to_PatternList_and_Categoriescxx . . $ TableOfReal_to_PatternList_and_Categories(72412f56e03cd801). (TableOfRealcxx . . $ TableOfReal# me,
30 integercxx . . $ integer# fromrow, integercxx . . $ integer# torow, integercxx . . $ integer# fromcol, integercxx . . $ integer# tocol,
31 autoPatternListcxx . . $ autoPatternList# *out_patternList, autoCategoriescxx . . $ autoCategories# *out_categories
32 );
33
34 autoTableOfRealcxx . . $ autoTableOfReal# TableOfReal_transposecxx . . $ TableOfReal_transpose(d3f65ba86ef5eddf). (TableOfRealcxx . . $ TableOfReal# me);
35
36 autoStringscxx . . $ autoStrings# TableOfReal_extractRowLabelscxx . . $ TableOfReal_extractRowLabels(397082e846780902). (TableOfRealcxx . . $ TableOfReal# me);
37
38 autoStringscxx . . $ autoStrings# TableOfReal_extractColumnLabelscxx . . $ TableOfReal_extractColumnLabels(397082e846780902). (TableOfRealcxx . . $ TableOfReal# me);
39
40 void TableOfReal_Categories_setRowLabelscxx . . $ TableOfReal_Categories_setRowLabels(ad8f683e3187e1a6). (TableOfRealcxx . . $ TableOfReal# me, Categoriescxx . . $ Categories# thee);
41 // !!! Set rowlabels from categories because we need a Table-object with string-columns.
42
43 autoTableOfRealcxx . . $ autoTableOfReal# TableOfReal_sortOnlyByRowLabelscxx . . $ TableOfReal_sortOnlyByRowLabels(d3f65ba86ef5eddf). (TableOfRealcxx . . $ TableOfReal# me);
44
45 autoINTVECcxx . . $ autoINTVEC# TableOfReal_getSortedIndexFromRowLabelscxx . . $ TableOfReal_getSortedIndexFromRowLabels(d7e1e1d71f070041). (TableOfRealcxx . . $ TableOfReal# me);
46
47 autoTableOfRealcxx . . $ autoTableOfReal# TableOfReal_sortRowsByIndexcxx . . $ TableOfReal_sortRowsByIndex(6e37ec5b4f028e7d). (TableOfRealcxx . . $ TableOfReal# me, constINTVECcxx . . $ constINTVEC# index, bool reverse);
48 // thy data [reverse ? i : index [i]] [j] = my data [reverse ? index [i] : i]
49
50 autoTableOfRealcxx . . $ autoTableOfReal# TableOfReal_createIrisDatasetcxx . . $ TableOfReal_createIrisDataset(a19afbfc2fbf56a1). ();
51
52 autoTableOfRealcxx . . $ autoTableOfReal# TableOfReal_create_pols1973cxx . . $ TableOfReal_create_pols1973(cac167727fc42438). (bool include_levels);
53
54 autoTableOfRealcxx . . $ autoTableOfReal# TableOfReal_create_vanNierop1973cxx . . $ TableOfReal_create_vanNierop1973(cac167727fc42438). (bool include_levels);
55
56 autoTableOfRealcxx . . $ autoTableOfReal# TableOfReal_create_weenink1983cxx . . $ TableOfReal_create_weenink1983(b66663d1a4c641c6). (int option); /* M W C */
57
58 /* The data for Fig. 2 in Sandwell (1987) */
59 autoTableOfRealcxx . . $ autoTableOfReal# TableOfReal_create_sandwell1987cxx . . $ TableOfReal_create_sandwell1987(a19afbfc2fbf56a1). ();
60
61 integercxx . . $ integer# TableOfReal_getColumnIndexAtMaximumInRowcxx . . $ TableOfReal_getColumnIndexAtMaximumInRow(a5db92b16a8de5dc). (TableOfRealcxx . . $ TableOfReal# me, integercxx . . $ integer# rowNumber);
62
63 conststring32cxx . . $ conststring32# TableOfReal_getColumnLabelAtMaximumInRowcxx . . $ TableOfReal_getColumnLabelAtMaximumInRow(f4641389fd530e3d). (TableOfRealcxx . . $ TableOfReal# me, integercxx . . $ integer# rowNumber);
64
65 void TableOfReal_drawRowsAsHistogramcxx . . $ TableOfReal_drawRowsAsHistogram(91074deaf287a0ee). (TableOfRealcxx . . $ TableOfReal# me, Graphicscxx . . $ Graphics# g, constINTVECVUcxx . . $ constINTVECVU# const& rowNumbers, integercxx . . $ integer# colb, integercxx . . $ integer# cole,
66 double ymin, double ymax, double xoffsetFraction, double interbarFraction,
67 double interbarsFraction, constVECVUcxx . . $ constVECVU# const& greys, bool garnish
68 );
69
70 void TableOfReal_drawScatterPlotcxx . . $ TableOfReal_drawScatterPlot(de72f158a9f1b019). (TableOfRealcxx . . $ TableOfReal# me, Graphicscxx . . $ Graphics# g, integercxx . . $ integer# icx, integercxx . . $ integer# icy, integercxx . . $ integer# rowb,
71 integercxx . . $ integer# rowe, double xmin, double xmax, double ymin, double ymax,
72 integercxx . . $ integer# labelSize, bool useRowLabels, conststring32cxx . . $ conststring32# label, bool garnish
73 );
74
75 void TableOfReal_drawAsScalableSquarescxx . . $ TableOfReal_drawAsScalableSquares(54e3570fbb1a5cef). (TableOfRealcxx . . $ TableOfReal# me, Graphicscxx . . $ Graphics# g, integercxx . . $ integer# rowmin, integercxx . . $ integer# rowmax, integercxx . . $ integer# colmin, integercxx . . $ integer# colmax, kGraphicsMatrixOrigincxx . . $ kGraphicsMatrixOrigin# origin, double cellSizeFactor, kGraphicsMatrixCellDrawingOrdercxx . . $ kGraphicsMatrixCellDrawingOrder# fillOrder, bool garnish);
76
77 void TableOfReal_drawScatterPlotMatrixcxx . . $ TableOfReal_drawScatterPlotMatrix(82a672ef36333966). (TableOfRealcxx . . $ TableOfReal# me, Graphicscxx . . $ Graphics# g, integercxx . . $ integer# colb, integercxx . . $ integer# cole, double fractionWhite);
78
79 void TableOfReal_drawBoxPlotscxx . . $ TableOfReal_drawBoxPlots(dd70eb78df9357f8). (TableOfRealcxx . . $ TableOfReal# me, Graphicscxx . . $ Graphics# g, integercxx . . $ integer# rowmin, integercxx . . $ integer# rowmax, integercxx . . $ integer# colmin, integercxx . . $ integer# colmax,
80 double ymin, double ymax, bool garnish);
81
82 void TableOfReal_drawVectorscxx . . $ TableOfReal_drawVectors(5a02641f01d94b4a). (TableOfRealcxx . . $ TableOfReal# me, Graphicscxx . . $ Graphics# g, integercxx . . $ integer# colx1, integercxx . . $ integer# coly1,
83 integercxx . . $ integer# colx2, integercxx . . $ integer# coly2, double xmin, double xmax,
84 double ymin, double ymax, int vectype, int labelsize, bool garnish);
85
86 void TableOfReal_drawBiplotcxx . . $ TableOfReal_drawBiplot(5fbaf05b01d1a4a1). (TableOfRealcxx . . $ TableOfReal# me, Graphicscxx . . $ Graphics# g, double xmin, double xmax,
87 double ymin, double ymax, double sv_splitfactor, int labelsize,
88 bool garnish);
89
90 void TableOfReal_drawColumnAsDistributioncxx . . $ TableOfReal_drawColumnAsDistribution(c3461478f6273311). (TableOfRealcxx . . $ TableOfReal# me, Graphicscxx . . $ Graphics# g, integercxx . . $ integer# column, double minimum, double maximum, integercxx . . $ integer# nBins,
91 double freqMin, double freqMax, bool cumulative, bool garnish);
92
93 integercxx . . $ integer# TableOfReal_getNumberOfLabelMatchescxx . . $ TableOfReal_getNumberOfLabelMatches(b5bbe33fe963f4cf). (TableOfRealcxx . . $ TableOfReal# me, conststring32cxx . . $ conststring32# search, bool columnLabels,
94 bool use_regexp);
95 /*
96 Find number of labels that match search description.
97 */
98
99 void TableOfReal_copyLabelscxx . . $ TableOfReal_copyLabels(4a8870dfd6c30d44). (TableOfRealcxx . . $ TableOfReal# me, TableOfRealcxx . . $ TableOfReal# thee, int rowOrigin, int columnOrigin);
100 /*
101 rowOrigin == 1 copy from row
102 rowOrigin == 0 do nothing
103 rowOrigin == -1 copy from column
104
105 columnOrigin == 1 copy from column
106 columnOrigin == 0 do nothing
107 columnOrigin == -1 copy from row
108 */
109
110 void TableOfReal_setLabelsFromCollectionItemNamescxx . . $ TableOfReal_setLabelsFromCollectionItemNames(ab1514337d93b725). (TableOfRealcxx . . $ TableOfReal# me, Collectioncxx . . $ Collection# thee, bool setRowLabels, bool setColumnLabels);
111
112 void TableOfReal_setSequentialColumnLabelscxx . . $ TableOfReal_setSequentialColumnLabels(8dc3139cdc86d712). (TableOfRealcxx . . $ TableOfReal# me, integercxx . . $ integer# from, integercxx . . $ integer# to, conststring32cxx . . $ conststring32# precursor, integercxx . . $ integer# number, integercxx . . $ integer# increment);
113
114 void TableOfReal_setSequentialRowLabelscxx . . $ TableOfReal_setSequentialRowLabels(8dc3139cdc86d712). (TableOfRealcxx . . $ TableOfReal# me, integercxx . . $ integer# from, integercxx . . $ integer# to, conststring32cxx . . $ conststring32# precursor, integercxx . . $ integer# number, integercxx . . $ integer# increment);
115
116 bool TableOfReal_hasRowLabelscxx . . $ TableOfReal_hasRowLabels(e9b5ab7ea1aaed43). (TableOfRealcxx . . $ TableOfReal# me);
117
118 bool TableOfReal_hasColumnLabelscxx . . $ TableOfReal_hasColumnLabels(e9b5ab7ea1aaed43). (TableOfRealcxx . . $ TableOfReal# me);
119
120 void TableOfReal_changeRowLabelscxx . . $ TableOfReal_changeRowLabels(a1aafac44f2857be). (TableOfRealcxx . . $ TableOfReal# me, conststring32cxx . . $ conststring32# search, conststring32cxx . . $ conststring32# replace,
121 integercxx . . $ integer# maximumNumberOfReplaces, integercxx . . $ integer# *nmatches, integercxx . . $ integer# *nstringmatches, bool use_regexp);
122
123 void TableOfReal_changeColumnLabelscxx . . $ TableOfReal_changeColumnLabels(a1aafac44f2857be). (TableOfRealcxx . . $ TableOfReal# me, conststring32cxx . . $ conststring32# search, conststring32cxx . . $ conststring32# replace,
124 integercxx . . $ integer# maximumNumberOfReplaces, integercxx . . $ integer# *nmatches, integercxx . . $ integer# *nstringmatches, bool use_regexp);
125 /*
126 Change all row/column labels. The 'search' and 'replace' string are
127 interpreted as regular expressions when 'use_regexp' != 0.
128 'maximumNumberOfReplaces' is the maximum number of replaces in EACH string
129 in the array of strings (you can replace ALL occurrences by making this
130 number <= 0)
131 The totalnumber of matches found is returned in 'nmatches'.
132 The number of strings with at least one match is returned in
133 'nstringmatches'.
134 */
135
136 void TableOfReal_centreColumnscxx . . $ TableOfReal_centreColumns(683412d750813a40). (TableOfRealcxx . . $ TableOfReal# me);
137
138 void TableOfReal_centreColumns_byRowLabelcxx . . $ TableOfReal_centreColumns_byRowLabel(683412d750813a40). (TableOfRealcxx . . $ TableOfReal# me);
139 /* PRECONDITION: Table should be sorted by row labels !! */
140
141 double TableOfReal_getColumnQuantilecxx . . $ TableOfReal_getColumnQuantile(24395f3cb231684c). (TableOfRealcxx . . $ TableOfReal# me, integercxx . . $ integer# col, double quantile);
142
143 double TableOfReal_getRowSumByLabelcxx . . $ TableOfReal_getRowSumByLabel(901c48445e04803c). (TableOfRealcxx . . $ TableOfReal# me, conststring32cxx . . $ conststring32# label);
144
145 double TableOfReal_getRowSumcxx . . $ TableOfReal_getRowSum(cf1dc42777ed1a29). (TableOfRealcxx . . $ TableOfReal# me, integercxx . . $ integer# index);
146
147 double TableOfReal_getColumnSumByLabelcxx . . $ TableOfReal_getColumnSumByLabel(901c48445e04803c). (TableOfRealcxx . . $ TableOfReal# me, conststring32cxx . . $ conststring32# label);
148
149 double TableOfReal_getColumnSumcxx . . $ TableOfReal_getColumnSum(cf1dc42777ed1a29). (TableOfRealcxx . . $ TableOfReal# me, integercxx . . $ integer# index);
150
151 double TableOfReal_getGrandSumcxx . . $ TableOfReal_getGrandSum(260ac66a6eccb616). (TableOfRealcxx . . $ TableOfReal# me);
152
153 void TableOfReal_centreRowscxx . . $ TableOfReal_centreRows(683412d750813a40). (TableOfRealcxx . . $ TableOfReal# me);
154
155 void TableOfReal_doubleCentrecxx . . $ TableOfReal_doubleCentre(683412d750813a40). (TableOfRealcxx . . $ TableOfReal# me);
156
157 bool TableOfReal_isNonNegativecxx . . $ TableOfReal_isNonNegative(e9b5ab7ea1aaed43). (TableOfRealcxx . . $ TableOfReal# me);
158
159 double TableOfReal_getTableNormcxx . . $ TableOfReal_getTableNorm(260ac66a6eccb616). (TableOfRealcxx . . $ TableOfReal# me);
160
161 void TableOfReal_normalizeTablecxx . . $ TableOfReal_normalizeTable(9b898dd61a6a2e72). (TableOfRealcxx . . $ TableOfReal# me, double norm);
162
163 void TableOfReal_normalizeColumnscxx . . $ TableOfReal_normalizeColumns(9b898dd61a6a2e72). (TableOfRealcxx . . $ TableOfReal# me, double norm);
164
165 void TableOfReal_normalizeRowscxx . . $ TableOfReal_normalizeRows(9b898dd61a6a2e72). (TableOfRealcxx . . $ TableOfReal# me, double norm);
166
167 void TableOfReal_standardizeColumnscxx . . $ TableOfReal_standardizeColumns(683412d750813a40). (TableOfRealcxx . . $ TableOfReal# me);
168
169 void TableOfReal_standardizeRowscxx . . $ TableOfReal_standardizeRows(683412d750813a40). (TableOfRealcxx . . $ TableOfReal# me);
170
171 autoTableOfRealcxx . . $ autoTableOfReal# TableOfReal_rankColumnscxx . . $ TableOfReal_rankColumns(9b66c0af0e652f50). (TableOfRealcxx . . $ TableOfReal# me, integercxx . . $ integer# fromColumn, integercxx . . $ integer# toColumn);
172
173 autoTableOfRealcxx . . $ autoTableOfReal# TableOfReal_meansByRowLabelscxx . . $ TableOfReal_meansByRowLabels(a593ed957a799805). (TableOfRealcxx . . $ TableOfReal# me, bool expand, bool useMedians);
174 /*
175 stats == 0? averages : medians
176 For a table with n rows and m different labels (m <= n):
177 if (expand=1) { output has n rows, substitute each array by the average value for that row label}
178 else output a table with m rows, the averages for the m labels.
179 */
180
181 autoTableOfRealcxx . . $ autoTableOfReal# TableOfReal_bootstrapcxx . . $ TableOfReal_bootstrap(d3f65ba86ef5eddf). (TableOfRealcxx . . $ TableOfReal# me);
182 // Produce new table with the same number of entries, but randomly selected with replacement.
183
184 autoTableOfRealcxx . . $ autoTableOfReal# TableOfReal_randomizeRowscxx . . $ TableOfReal_randomizeRows(d3f65ba86ef5eddf). (TableOfRealcxx . . $ TableOfReal# me);
185 /* Produce new table with randomized rows */
186
187 /* For the inheritors */
188 autoTableOfRealcxx . . $ autoTableOfReal# TableOfReal_to_TableOfRealcxx . . $ TableOfReal_to_TableOfReal(d3f65ba86ef5eddf). (TableOfRealcxx . . $ TableOfReal# me);
189
190 autoTableOfRealcxx . . $ autoTableOfReal# TableOfReal_choleskyDecompositioncxx . . $ TableOfReal_choleskyDecomposition(a593ed957a799805). (TableOfRealcxx . . $ TableOfReal# me, bool upper, bool inverse);
191
192 autoTableOfRealcxx . . $ autoTableOfReal# TableOfReal_appendColumnscxx . . $ TableOfReal_appendColumns(8a870f738eddd928). (TableOfRealcxx . . $ TableOfReal# me, TableOfRealcxx . . $ TableOfReal# thee);
193
194 void TableOfReal_copyOneRowWithLabelcxx . . $ TableOfReal_copyOneRowWithLabel(f4eb8ed484c5a163). (TableOfRealcxx . . $ TableOfReal# me, TableOfRealcxx . . $ TableOfReal# thee, integercxx . . $ integer# myrow, integercxx . . $ integer# thyrow);
195
196 double TableOfReal_normalityTest_BHEPcxx . . $ TableOfReal_normalityTest_BHEP(13d376cbb242ac0a). (TableOfRealcxx . . $ TableOfReal# me, double *h, double *out_tnb, double *out_lnmu, double *out_lnvar, bool *out_singularCovariance);
197 /*
198 Henze & Wagner (1997), A new approach to the BHEP tests for multivariate normality, Journal of Multivariate Analysis 62, 1-23.
199 */
200
201 double TableOfReal_testSphericityOfCovariancecxx . . $ TableOfReal_testSphericityOfCovariance(822fda78f7e8d1b3). (TableOfRealcxx . . $ TableOfReal# me, integercxx . . $ integer# numberOfPermutations, bool useCorrelation);
202 /*
203 Sphericity test of covariance (correlation) matrix
204 This test is a combination of two tests:
205 1. H0: Sigma = sigma^2 I vs. H1: Sigma = diag (sigma[1]^2, sigma-2[^2, ... sigma[p]^2)
206 2. H0: Sigma = diag (sigma[1]^2, sigma-2[^2, ... sigma[p]^2) vs. H1: Sigma != diag (sigma[1]^2, sigma-2[^2, ... sigma[p]^2)
207 This is test 1 in:
208 L. Wu, C. Weng, X. Wang, K. Wang & X. Liu (2018): Test of covariance and correlation matrices,
209 arXiv: 1812.01172v1 [start.ME] 4 Dec 2018.
210 */
211
212 double TableOfReal_testCovarianceEqualsIdentityMatrixcxx . . $ TableOfReal_testCovarianceEqualsIdentityMatrix(822fda78f7e8d1b3). (TableOfRealcxx . . $ TableOfReal# me, integercxx . . $ integer# numberOfPermutations, bool useCorrelation);
213 /*
214 Test if the covariance or correlation equals the identity matrix I.
215 H0: Sigma = I vs H1: Sigma != I
216 This is test2 in:
217 L. Wu, C. Weng, X. Wang, K. Wang & X. Liu (2018): Test of covariance and correlation matrices,
218 arXiv: 1812.01172v1 [start.ME] 4 Dec 2018.
219 */
220
221 double TableOfReal_testCovarianceCompoundSymmetrycxx . . $ TableOfReal_testCovarianceCompoundSymmetry(822fda78f7e8d1b3). (TableOfRealcxx . . $ TableOfReal# me, integercxx . . $ integer# numberOfPermutations, bool useCorrelation);
222 /*
223 H0: Sigma = sigma^2 (1-rho) * I + rho * J,
224 where I is identity matrix and J is square matrix of ones znd rho > 0 (intra-class correlation coefficient
225 This is test3 in:
226 L. Wu, C. Weng, X. Wang, K. Wang & X. Liu (2018): Test of covariance and correlation matrices,
227 arXiv: 1812.01172v1 [start.ME] 4 Dec 2018.
228
229 */
230
231 double TableOfReal_testEqualityOfCovariancescxx . . $ TableOfReal_testEqualityOfCovariances(60da553e516dbb2b). (TableOfRealcxx . . $ TableOfReal# me, TableOfRealcxx . . $ TableOfReal# thee, integercxx . . $ integer# numberOfPermutations, bool useCorrelation);
232 /*
233 Test the equality of two covariance or correlation matrices.
234 H0: Sigma[1] = Sigma[2] vs H1: Sigma[1] != Sigma[2]
235 This is test4 in:
236 L. Wu, C. Weng, X. Wang, K. Wang & X. Liu (2018): Test of covariance and correlation matrices,
237 arXiv: 1812.01172v1 [start.ME] 4 Dec 2018.
238 */
239
240 autoTableOfRealcxx . . $ autoTableOfReal# TableOfReal_TableOfReal_crossCorrelationscxx . . $ TableOfReal_TableOfReal_crossCorrelations(6d857e698212acc1). (TableOfRealcxx . . $ TableOfReal# me, TableOfRealcxx . . $ TableOfReal# thee, bool by_columns, bool center, bool normalize);
241
242
243 #pragma mark - class TableOfRealList
244
245 autoTableOfRealcxx . . $ autoTableOfReal# TableOfRealList_sumcxx . . $ TableOfRealList_sum(73aaa73563b681a). (TableOfRealListcxx . . $ TableOfRealList# me);
246
247 bool TableOfRealList_haveIdenticalDimensionscxx . . $ TableOfRealList_haveIdenticalDimensions(82ea0717c3d3ddae). (TableOfRealListcxx . . $ TableOfRealList# me);
248
249 autoTableOfRealcxx . . $ autoTableOfReal# TableOfRealList_appendColumnsManycxx . . $ TableOfRealList_appendColumnsMany(73aaa73563b681a). (TableOfRealListcxx . . $ TableOfRealList# me);
250
251 autoMatrixcxx . . $ autoMatrix# TableOfReal_to_Matrix_interpolateOnRectangularGridcxx . . $ TableOfReal_to_Matrix_interpolateOnRectangularGrid(be70aa1e89489cb2). (TableOfRealcxx . . $ TableOfReal# me, double xmin, double xmax, double nx, double ymin, double ymax, integercxx . . $ integer# ny, int method);
252
253 #endif /* _TableOfReal_extensions_h_ */