54 int main(
int argc,
char *argv[])
62 label randomDistributionTestSize = 50000000;
66 Info<<
nl <<
"Distribution<scalar>" <<
nl
68 << randomDistributionTestSize
69 <<
" times from GaussNormal distribution."
72 for (
label i = 0; i < randomDistributionTestSize; i++)
74 dS.
add(2.5*
R.GaussNormal() + 8.5);
78 <<
"Median " << dS.
median()
81 dS.
write(
"Distribution_scalar_test_1");
85 Info<<
nl <<
"Distribution<scalar>" <<
nl
87 << randomDistributionTestSize
88 <<
" times from GaussNormal distribution."
91 for (
label i = 0; i < randomDistributionTestSize; i++)
93 dS2.
add(1.5*
R.GaussNormal() -6.0);
97 <<
"Median " << dS2.
median()
100 dS2.
write(
"Distribution_scalar_test_2");
102 Info<<
nl <<
"Adding previous two Distribution<scalar>" <<
endl;
106 dS.
write(
"Distribution_scalar_test_1+2");
112 label randomDistributionTestSize = 100000000;
116 Pout<<
"Distribution<scalar>" <<
nl
118 << randomDistributionTestSize
119 <<
" times from uniform distribution."
122 for (
label i = 0; i < randomDistributionTestSize; i++)
128 <<
"Median " << dS.
median()
135 Info<<
"Reducing parallel Distribution<scalar>" <<
nl
136 <<
"Mean " << dS.
mean() <<
nl
137 <<
"Median " << dS.
median()
140 dS.
write(
"Distribution_scalar_test_parallel_reduced");
148 label randomDistributionTestSize = 1000000;
150 Info<<
nl <<
"Distribution<vector>" <<
nl
152 << randomDistributionTestSize
153 <<
" times from uniform and GaussNormal distribution."
156 for (
label i = 0; i < randomDistributionTestSize; i++)
158 dV.
add(
R.vector01());
167 R.GaussNormal()*3.0 + 1.5,
168 R.GaussNormal()*0.25 + 4.0,
169 R.GaussNormal()*3.0 - 1.5
176 <<
"Median " << dV.
median()
179 dV.
write(
"Distribution_vector_test");
218 label randomDistributionTestSize = 2000000;
220 Info<<
nl <<
"Distribution<tensor>" <<
nl
222 << randomDistributionTestSize
223 <<
" times from uniform distribution."
226 for (
label i = 0; i < randomDistributionTestSize; i++)
228 dT.
add(
R.tensor01());
232 <<
"Median " << dT.
median()
235 dT.
write(
"Distribution_tensor_test");
242 label randomDistributionTestSize = 2000000;
244 Info<<
nl <<
"Distribution<symmTensor>" <<
nl
246 << randomDistributionTestSize
247 <<
" times from uniform distribution."
250 for (
label i = 0; i < randomDistributionTestSize; i++)
252 dSyT.
add(
R.symmTensor01());
256 <<
"Median " << dSyT.
median()
259 dSyT.
write(
"Distribution_symmTensor_test");
266 label randomDistributionTestSize = 50000000;
268 Info<<
nl <<
"Distribution<sphericalTensor>" <<
nl
270 << randomDistributionTestSize
271 <<
" times from uniform distribution."
274 for (
label i = 0; i < randomDistributionTestSize; i++)
276 dSpT.
add(
R.sphericalTensor01());
280 <<
"Median " << dSpT.
median()
283 dSpT.
write(
"Distribution_sphericalTensor_test");