AFLOW
 
Loading...
Searching...
No Matches
aurostd_xrandom.h
Go to the documentation of this file.
1// ***************************************************************************
2// * *
3// * Aflow STEFANO CURTAROLO - Duke University 2003-2024 *
4// * *
5// ***************************************************************************
6// Written by Stefano Curtarolo 1994-2011
7
8#ifndef _AUROSTD_XRANDOM_H_
9#define _AUROSTD_XRANDOM_H_
10
11#include "aurostd_defs.h"
12
13namespace aurostd {
14 // namespace aurostd
15 // ----------------------------------------------------------------------------
16 // ---------------------------------- random function and procedures on numbers
17
18 long int _random_initialize(long int _num); // initialize randoms
19 long int _random_initialize();// initialize randoms with clock based number
20 // ---------------------------------------------------------- uniform deviation
21 double ran0(); // uniform in [0,1]
22 double ran1(); // uniform in [0,1]
23 double ran2(); // uniform in [0,1]
24 template <class utype>
25 utype uniform(const utype &) // uniform in [0,x]
27 template <class utype>
28 inline utype uniform(const utype &, // uniform in [x,y]
29 const utype &) __xprototype;
30 // --------------------------------------------------------- gaussian deviation
31 double gaussian(); // gaussian(m=0,v=1)
32 template <class utype>
33 inline utype gaussian(const utype &) // gaussian(m=0,v)
35 template <class utype>
36 inline utype gaussian(const utype &, // gaussian(m,v)
37 const utype &) __xprototype;
38 // ------------------------------------------------------ exponential deviation
39 inline double expdev() // exponential lambda=1
40 // returns a exponentially distribuited deviate with lambda=1
42 template <class utype>
43 inline utype expdev(const utype &) // exponential lambda
45
46 // ---------------------------------------------------------- laplace deviation
47 inline double laplacedev() // laplace mean=0 a=1
48 // returns a laplace distribuited deviate p(x)=1/2a*exp(-|x-lambda|/a)
49 // sigma^2=2a*a mean=lambda
51
52 template <class utype>
53 inline utype // laplace mean=0 a
54 laplacedev(const utype &)
55 // returns a laplace distribuited deviate p(x)=1/2a*exp(-|x-lambda|/a)
57
58 template <class utype>
59 inline utype // laplace mean a
60 laplacedev(const utype &a, const utype &lambda)
61 // returns a laplace distribuited deviate p(x)=1/2a*exp(-|x-lambda|/a)
63} // namespace aurostd
64
65// ---------------------------------------------------------- poisson deviation
66
67// ????????? not yet done
68
69// ----------------------------------------------------------------------------
70// ----------------------------------------------------------------------------
71// -------------------------- uniform function and procedures on xvector, xmatrix
72
73#ifdef _AUROSTD_XVECTOR_CPP_
74
75#include "aurostd_xvector.h"
76
77namespace aurostd {
78 // namespace aurostd
79 template <class utype>
80 xvector<utype> // xvector of uniforms [0,1]
82
83 template <class utype>
84 xvector<utype> // xvector of uniforms [0,y]
85 uniform(const xvector<utype> &, const utype &) __xprototype;
86
87 template <class utype>
88 xvector<utype> // xvector of uniforms [x,y]
89 uniform(const xvector<utype> &, const utype &, const utype &) __xprototype;
90
91 template <class utype>
92 xvector<std::complex<utype>> // complex xvector of uniforms
93 uniform(const xvector<std::complex<utype>> &) // real,imag in ([0,1],[0,1])
95
96 template <class utype>
97 xvector<std::complex<utype>> // complex xvector of uniforms
98 uniform(const xvector<std::complex<utype>> &, // real,imag in ([0,y],[0,y])
99 const utype &) __xprototype;
100
101 template <class utype>
102 xvector<std::complex<utype>> // complex xvector of uniforms
103 uniform(const xvector<std::complex<utype>> &, // real,imag in ([0,y1],[0,y2])
104 const utype &,
105 const utype &) __xprototype;
106
107 template <class utype>
108 xvector<std::complex<utype>> // complex xvector of uniforms
109 uniform(const xvector<std::complex<utype>> &, // real,imag in ([x1,y1],[x2,y2])
110 const utype &,
111 const utype &,
112 const utype &,
113 const utype &) __xprototype;
114} // namespace aurostd
115#endif
116
117// ---------------------------------- uniform function and procedures on xmatrix
118
119#ifdef _AUROSTD_XMATRIX_CPP_
120
121#include "aurostd_xmatrix.h"
122
123namespace aurostd {
124 // namespace aurostd
125 template <class utype>
126 xmatrix<utype> // xmatrix of uniforms [0,1]
128
129 template <class utype>
130 xmatrix<utype> // xmatrix of uniforms [0,y]
131 uniform(const xmatrix<utype> &, const utype &) __xprototype;
132
133 template <class utype>
134 xmatrix<utype> // xmatrix of uniforms [x,y]
135 uniform(const xmatrix<utype> &, const utype &, const utype &) __xprototype;
136
137 template <class utype>
138 xmatrix<std::complex<utype>> // complex xmatrix of uniforms
139 uniform(const xmatrix<std::complex<utype>> &) // real,imag in ([0,1],[0,1])
141
142 template <class utype>
143 xmatrix<std::complex<utype>> // complex xmatrix of uniforms
144 uniform(const xmatrix<std::complex<utype>> &, // real,imag in ([0,y],[0,y])
145 const utype &) __xprototype;
146
147 template <class utype>
148 xmatrix<std::complex<utype>> // complex xmatrix of uniforms
149 uniform(const xmatrix<std::complex<utype>> &, // real,imag in ([0,x],[0,y])
150 const utype &,
151 const utype &) __xprototype;
152
153 template <class utype>
154 xmatrix<std::complex<utype>> // complex xmatrix of uniforms
155 uniform(const xmatrix<std::complex<utype>> &, // real,imag in ([x1,y1],[x2,y2])
156 const utype &,
157 const utype &,
158 const utype &,
159 const utype &) __xprototype;
160} // namespace aurostd
161
162// --------------------------------- gaussian function and procedures on xmatrix
163
164namespace aurostd {
165 // namespace aurostd
166 template <class utype>
167 xmatrix<utype> // gaussian xmatrix<utype> (m,v)
168 gaussian(const xmatrix<utype> &a, const utype &m, const utype &v) __xprototype;
169
170 template <class utype>
171 xmatrix<utype> // gaussian xmatrix<utype> (m=0,v)
172 gaussian(const xmatrix<utype> &a, const utype &v) __xprototype;
173
174 template <class utype>
175 xmatrix<utype> // gaussian xmatrix<utype> (m=0,v=1)
177
178 template <class utype>
179 xmatrix<std::complex<utype>> // complex xmatrix of gaussians
180 gaussian(const xmatrix<std::complex<utype>> &a, // real,imag in (m1,v1),(m2,v2)
181 const utype &m2,
182 const utype &v2) __xprototype;
183
184 template <class utype>
185 xmatrix<std::complex<utype>> // complex xmatrix of gaussians
186 gaussian(const xmatrix<std::complex<utype>> &a, // real,imag in (0,v1),(0,v2)
187 const utype &v1,
188 const utype &v2) __xprototype;
189
190 template <class utype>
191 xmatrix<std::complex<utype>> // complex xmatrix of gaussians
192 gaussian(const xmatrix<std::complex<utype>> &a, // real,imag in (0,v),(0,v)
193 const utype &v) __xprototype;
194
195 template <class utype>
196 xmatrix<std::complex<utype>> // complex xmatrix of gaussians
197 gaussian(const xmatrix<std::complex<utype>> &a) // real,imag in (0,1),(0,1)
199} // namespace aurostd
200#endif
201
202// ---------------------------------- uniform function and procedures on xtensor3
203
204#ifdef __XTENSOR3_CPP
205
206namespace aurostd {
207 // namespace aurostd
208 template <class utype>
209 xtensor3<utype> // xtensor3 of uniforms [0,1]
210 uniform(const xtensor3<utype> &) __xprototype;
211
212 template <class utype>
213 xtensor3<utype> // xtensor3 of uniforms [0,y]
214 uniform(const xtensor3<utype> &, const utype &) __xprototype;
215
216 template <class utype>
217 xtensor3<utype> // xtensor3 of uniforms [x,y]
218 uniform(const xtensor3<utype> &, const utype &, const utype &) __xprototype;
219
220 template <class utype>
221 xtensor3<std::complex<utype>> // complex xtensor3 of uniforms
222 uniform(const xtensor3<std::complex<utype>> &) // real,imag in ([0,1],[0,1])
224
225 template <class utype>
226 xtensor3<std::complex<utype>> // complex xtensor3 of uniforms
227 uniform(const xtensor3<std::complex<utype>> &, // real,imag in ([0,y],[0,y])
228 const utype &) __xprototype;
229
230 template <class utype>
231 xtensor3<std::complex<utype>> // complex xtensor3 of uniforms
232 uniform(const xtensor3<std::complex<utype>> &, // real,imag in ([0,x],[0,y])
233 const utype &,
234 const utype &) __xprototype;
235
236 template <class utype>
237 xtensor3<std::complex<utype>> // complex xtensor3 of uniforms
238 uniform(const xtensor3<std::complex<utype>> &, // real,imag in ([x1,y1],[x2,y2])
239 const utype &,
240 const utype &,
241 const utype &,
242 const utype &) __xprototype;
243} // namespace aurostd
244
245// --------------------------------- gaussian function and procedures on xtensor3
246
247namespace aurostd {
248 // namespace aurostd
249 template <class utype>
250 xtensor3<utype> // gaussian xtensor3<utype> (m,v)
251 gaussian(const xtensor3<utype> &a, const utype &m, const utype &v) __xprototype;
252
253 template <class utype>
254 xtensor3<utype> // gaussian xtensor3<utype> (m=0,v)
255 gaussian(const xtensor3<utype> &a, const utype &v) __xprototype;
256
257 template <class utype>
258 xtensor3<utype> // gaussian xtensor3<utype> (m=0,v=1)
259 gaussian(const xtensor3<utype> &a) __xprototype;
260
261 template <class utype>
262 xtensor3<std::complex<utype>> // complex xtensor3 of gaussians
263 gaussian(const xtensor3<std::complex<utype>> &a, // real,imag in (m1,v1),(m2,v2)
264 const utype &m2,
265 const utype &v2) __xprototype;
266
267 template <class utype>
268 xtensor3<std::complex<utype>> // complex xtensor3 of gaussians
269 gaussian(const xtensor3<std::complex<utype>> &a, // real,imag in (0,v1),(0,v2)
270 const utype &v1,
271 const utype &v2) __xprototype;
272
273 template <class utype>
274 xtensor3<std::complex<utype>> // complex xtensor3 of gaussians
275 gaussian(const xtensor3<std::complex<utype>> &a, // real,imag in (0,v),(0,v)
276 const utype &v) __xprototype;
277
278 template <class utype>
279 xtensor3<std::complex<utype>> // complex xtensor3 of gaussians
280 gaussian(const xtensor3<std::complex<utype>> &a) // real,imag in (0,1),(0,1)
282} // namespace aurostd
283
284#endif //__XTENSOR3_CPP
285
286// ---------------------------------- uniform function and procedures on xtensor4
287
288#ifdef __XTENSOR4_CPP
289
290namespace aurostd {
291 // namespace aurostd
292 template <class utype>
293 xtensor4<utype> // xtensor4 of uniforms [0,1]
294 uniform(const xtensor4<utype> &) __xprototype;
295
296 template <class utype>
297 xtensor4<utype> // xtensor4 of uniforms [0,y]
298 uniform(const xtensor4<utype> &, const utype &) __xprototype;
299
300 template <class utype>
301 xtensor4<utype> // xtensor4 of uniforms [x,y]
302 uniform(const xtensor4<utype> &, const utype &, const utype &) __xprototype;
303
304 template <class utype>
305 xtensor4<std::complex<utype>> // complex xtensor4 of uniforms
306 uniform(const xtensor4<std::complex<utype>> &) // real,imag in ([0,1],[0,1])
308
309 template <class utype>
310 xtensor4<std::complex<utype>> // complex xtensor4 of uniforms
311 uniform(const xtensor4<std::complex<utype>> &, // real,imag in ([0,y],[0,y])
312 const utype &) __xprototype;
313
314 template <class utype>
315 xtensor4<std::complex<utype>> // complex xtensor4 of uniforms
316 uniform(const xtensor4<std::complex<utype>> &, // real,imag in ([0,x],[0,y])
317 const utype &,
318 const utype &) __xprototype;
319
320 template <class utype>
321 xtensor4<std::complex<utype>> // complex xtensor4 of uniforms
322 uniform(const xtensor4<std::complex<utype>> &, // real,imag in ([x1,y1],[x2,y2])
323 const utype &,
324 const utype &,
325 const utype &,
326 const utype &) __xprototype;
327} // namespace aurostd
328
329// --------------------------------- gaussian function and procedures on xtensor4
330
331namespace aurostd {
332 // namespace aurostd
333 template <class utype>
334 xtensor4<utype> // gaussian xtensor4<utype> (m,v)
335 gaussian(const xtensor4<utype> &a, const utype &m, const utype &v) __xprototype;
336
337 template <class utype>
338 xtensor4<utype> // gaussian xtensor4<utype> (m=0,v)
339 gaussian(const xtensor4<utype> &a, const utype &v) __xprototype;
340
341 template <class utype>
342 xtensor4<utype> // gaussian xtensor4<utype> (m=0,v=1)
343 gaussian(const xtensor4<utype> &a) __xprototype;
344
345 template <class utype>
346 xtensor4<std::complex<utype>> // complex xtensor4 of gaussians
347 gaussian(const xtensor4<std::complex<utype>> &a, // real,imag in (m1,v1),(m2,v2)
348 const utype &m2,
349 const utype &v2) __xprototype;
350
351 template <class utype>
352 xtensor4<std::complex<utype>> // complex xtensor4 of gaussians
353 gaussian(const xtensor4<std::complex<utype>> &a, // real,imag in (0,v1),(0,v2)
354 const utype &v1,
355 const utype &v2) __xprototype;
356
357 template <class utype>
358 xtensor4<std::complex<utype>> // complex xtensor4 of gaussians
359 gaussian(const xtensor4<std::complex<utype>> &a, // real,imag in (0,v),(0,v)
360 const utype &v) __xprototype;
361
362 template <class utype>
363 xtensor4<std::complex<utype>> // complex xtensor4 of gaussians
364 gaussian(const xtensor4<std::complex<utype>> &a) // real,imag in (0,1),(0,1)
366} // namespace aurostd
367
368#endif //__XTENSOR4_CPP
369
370// ---------------------------------- uniform function and procedures on xtensor5
371
372#ifdef __XTENSOR5_CPP
373
374namespace aurostd {
375 // namespace aurostd
376 template <class utype>
377 xtensor5<utype> // xtensor5 of uniforms [0,1]
378 uniform(const xtensor5<utype> &) __xprototype;
379
380 template <class utype>
381 xtensor5<utype> // xtensor5 of uniforms [0,y]
382 uniform(const xtensor5<utype> &, const utype &) __xprototype;
383
384 template <class utype>
385 xtensor5<utype> // xtensor5 of uniforms [x,y]
386 uniform(const xtensor5<utype> &, const utype &, const utype &) __xprototype;
387
388 template <class utype>
389 xtensor5<std::complex<utype>> // complex xtensor5 of uniforms
390 uniform(const xtensor5<std::complex<utype>> &) // real,imag in ([0,1],[0,1])
392
393 template <class utype>
394 xtensor5<std::complex<utype>> // complex xtensor5 of uniforms
395 uniform(const xtensor5<std::complex<utype>> &, // real,imag in ([0,y],[0,y])
396 const utype &) __xprototype;
397
398 template <class utype>
399 xtensor5<std::complex<utype>> // complex xtensor5 of uniforms
400 uniform(const xtensor5<std::complex<utype>> &, // real,imag in ([0,x],[0,y])
401 const utype &,
402 const utype &) __xprototype;
403
404 template <class utype>
405 xtensor5<std::complex<utype>> // complex xtensor5 of uniforms
406 uniform(const xtensor5<std::complex<utype>> &, // real,imag in ([x1,y1],[x2,y2])
407 const utype &,
408 const utype &,
409 const utype &,
410 const utype &) __xprototype;
411} // namespace aurostd
412
413// --------------------------------- gaussian function and procedures on xtensor5
414
415namespace aurostd {
416 // namespace aurostd
417 template <class utype>
418 xtensor5<utype> // gaussian xtensor5<utype> (m,v)
419 gaussian(const xtensor5<utype> &a, const utype &m, const utype &v) __xprototype;
420
421 template <class utype>
422 xtensor5<utype> // gaussian xtensor5<utype> (m=0,v)
423 gaussian(const xtensor5<utype> &a, const utype &v) __xprototype;
424
425 template <class utype>
426 xtensor5<utype> // gaussian xtensor5<utype> (m=0,v=1)
427 gaussian(const xtensor5<utype> &a) __xprototype;
428
429 template <class utype>
430 xtensor5<std::complex<utype>> // complex xtensor5 of gaussians
431 gaussian(const xtensor5<std::complex<utype>> &a, // real,imag in (m1,v1),(m2,v2)
432 const utype &m2,
433 const utype &v2) __xprototype;
434
435 template <class utype>
436 xtensor5<std::complex<utype>> // complex xtensor5 of gaussians
437 gaussian(const xtensor5<std::complex<utype>> &a, // real,imag in (0,v1),(0,v2)
438 const utype &v1,
439 const utype &v2) __xprototype;
440
441 template <class utype>
442 xtensor5<std::complex<utype>> // complex xtensor5 of gaussians
443 gaussian(const xtensor5<std::complex<utype>> &a, // real,imag in (0,v),(0,v)
444 const utype &v) __xprototype;
445
446 template <class utype>
447 xtensor5<std::complex<utype>> // complex xtensor5 of gaussians
448 gaussian(const xtensor5<std::complex<utype>> &a) // real,imag in (0,1),(0,1)
450} // namespace aurostd
451
452#endif //__XTENSOR5_CPP
453
454// ---------------------------------- uniform function and procedures on xtensor6
455
456#ifdef __XTENSOR6_CPP
457
458namespace aurostd {
459 // namespace aurostd
460 template <class utype>
461 xtensor6<utype> // xtensor6 of uniforms [0,1]
462 uniform(const xtensor6<utype> &) __xprototype;
463
464 template <class utype>
465 xtensor6<utype> // xtensor6 of uniforms [0,y]
466 uniform(const xtensor6<utype> &, const utype &) __xprototype;
467
468 template <class utype>
469 xtensor6<utype> // xtensor6 of uniforms [x,y]
470 uniform(const xtensor6<utype> &, const utype &, const utype &) __xprototype;
471
472 template <class utype>
473 xtensor6<std::complex<utype>> // complex xtensor6 of uniforms
474 uniform(const xtensor6<std::complex<utype>> &) // real,imag in ([0,1],[0,1])
476
477 template <class utype>
478 xtensor6<std::complex<utype>> // complex xtensor6 of uniforms
479 uniform(const xtensor6<std::complex<utype>> &, // real,imag in ([0,y],[0,y])
480 const utype &) __xprototype;
481
482 template <class utype>
483 xtensor6<std::complex<utype>> // complex xtensor6 of uniforms
484 uniform(const xtensor6<std::complex<utype>> &, // real,imag in ([0,x],[0,y])
485 const utype &,
486 const utype &) __xprototype;
487
488 template <class utype>
489 xtensor6<std::complex<utype>> // complex xtensor6 of uniforms
490 uniform(const xtensor6<std::complex<utype>> &, // real,imag in ([x1,y1],[x2,y2])
491 const utype &,
492 const utype &,
493 const utype &,
494 const utype &) __xprototype;
495} // namespace aurostd
496
497// --------------------------------- gaussian function and procedures on xtensor6
498
499namespace aurostd {
500 // namespace aurostd
501 template <class utype>
502 xtensor6<utype> // gaussian xtensor6<utype> (m,v)
503 gaussian(const xtensor6<utype> &a, const utype &m, const utype &v) __xprototype;
504
505 template <class utype>
506 xtensor6<utype> // gaussian xtensor6<utype> (m=0,v)
507 gaussian(const xtensor6<utype> &a, const utype &v) __xprototype;
508
509 template <class utype>
510 xtensor6<utype> // gaussian xtensor6<utype> (m=0,v=1)
511 gaussian(const xtensor6<utype> &a) __xprototype;
512
513 template <class utype>
514 xtensor6<std::complex<utype>> // complex xtensor6 of gaussians
515 gaussian(const xtensor6<std::complex<utype>> &a, // real,imag in (m1,v1),(m2,v2)
516 const utype &m2,
517 const utype &v2) __xprototype;
518
519 template <class utype>
520 xtensor6<std::complex<utype>> // complex xtensor6 of gaussians
521 gaussian(const xtensor6<std::complex<utype>> &a, // real,imag in (0,v1),(0,v2)
522 const utype &v1,
523 const utype &v2) __xprototype;
524
525 template <class utype>
526 xtensor6<std::complex<utype>> // complex xtensor6 of gaussians
527 gaussian(const xtensor6<std::complex<utype>> &a, // real,imag in (0,v),(0,v)
528 const utype &v) __xprototype;
529
530 template <class utype>
531 xtensor6<std::complex<utype>> // complex xtensor6 of gaussians
532 gaussian(const xtensor6<std::complex<utype>> &a) // real,imag in (0,1),(0,1)
534} // namespace aurostd
535
536#endif //__XTENSOR6_CPP
537
538// ---------------------------------- uniform function and procedures on xtensor7
539
540#ifdef __XTENSOR7_CPP
541
542namespace aurostd {
543 // namespace aurostd
544 template <class utype>
545 xtensor7<utype> // xtensor7 of uniforms [0,1]
546 uniform(const xtensor7<utype> &) __xprototype;
547
548 template <class utype>
549 xtensor7<utype> // xtensor7 of uniforms [0,y]
550 uniform(const xtensor7<utype> &, const utype &) __xprototype;
551
552 template <class utype>
553 xtensor7<utype> // xtensor7 of uniforms [x,y]
554 uniform(const xtensor7<utype> &, const utype &, const utype &) __xprototype;
555
556 template <class utype>
557 xtensor7<std::complex<utype>> // complex xtensor7 of uniforms
558 uniform(const xtensor7<std::complex<utype>> &) // real,imag in ([0,1],[0,1])
560
561 template <class utype>
562 xtensor7<std::complex<utype>> // complex xtensor7 of uniforms
563 uniform(const xtensor7<std::complex<utype>> &, // real,imag in ([0,y],[0,y])
564 const utype &) __xprototype;
565
566 template <class utype>
567 xtensor7<std::complex<utype>> // complex xtensor7 of uniforms
568 uniform(const xtensor7<std::complex<utype>> &, // real,imag in ([0,x],[0,y])
569 const utype &,
570 const utype &) __xprototype;
571
572 template <class utype>
573 xtensor7<std::complex<utype>> // complex xtensor7 of uniforms
574 uniform(const xtensor7<std::complex<utype>> &, // real,imag in ([x1,y1],[x2,y2])
575 const utype &,
576 const utype &,
577 const utype &,
578 const utype &) __xprototype;
579} // namespace aurostd
580
581// --------------------------------- gaussian function and procedures on xtensor7
582
583namespace aurostd {
584 // namespace aurostd
585 template <class utype>
586 xtensor7<utype> // gaussian xtensor7<utype> (m,v)
587 gaussian(const xtensor7<utype> &a, const utype &m, const utype &v) __xprototype;
588
589 template <class utype>
590 xtensor7<utype> // gaussian xtensor7<utype> (m=0,v)
591 gaussian(const xtensor7<utype> &a, const utype &v) __xprototype;
592
593 template <class utype>
594 xtensor7<utype> // gaussian xtensor7<utype> (m=0,v=1)
595 gaussian(const xtensor7<utype> &a) __xprototype;
596
597 template <class utype>
598 xtensor7<std::complex<utype>> // complex xtensor7 of gaussians
599 gaussian(const xtensor7<std::complex<utype>> &a, // real,imag in (m1,v1),(m2,v2)
600 const utype &m2,
601 const utype &v2) __xprototype;
602
603 template <class utype>
604 xtensor7<std::complex<utype>> // complex xtensor7 of gaussians
605 gaussian(const xtensor7<std::complex<utype>> &a, // real,imag in (0,v1),(0,v2)
606 const utype &v1,
607 const utype &v2) __xprototype;
608
609 template <class utype>
610 xtensor7<std::complex<utype>> // complex xtensor7 of gaussians
611 gaussian(const xtensor7<std::complex<utype>> &a, // real,imag in (0,v),(0,v)
612 const utype &v) __xprototype;
613
614 template <class utype>
615 xtensor7<std::complex<utype>> // complex xtensor7 of gaussians
616 gaussian(const xtensor7<std::complex<utype>> &a) // real,imag in (0,1),(0,1)
618} // namespace aurostd
619
620#endif //__XTENSOR7_CPP
621
622// ---------------------------------- uniform function and procedures on xtensor8
623
624#ifdef __XTENSOR8_CPP
625
626namespace aurostd {
627 // namespace aurostd
628 template <class utype>
629 xtensor8<utype> // xtensor8 of uniforms [0,1]
630 uniform(const xtensor8<utype> &) __xprototype;
631
632 template <class utype>
633 xtensor8<utype> // xtensor8 of uniforms [0,y]
634 uniform(const xtensor8<utype> &, const utype &) __xprototype;
635
636 template <class utype>
637 xtensor8<utype> // xtensor8 of uniforms [x,y]
638 uniform(const xtensor8<utype> &, const utype &, const utype &) __xprototype;
639
640 template <class utype>
641 xtensor8<std::complex<utype>> // complex xtensor8 of uniforms
642 uniform(const xtensor8<std::complex<utype>> &) // real,imag in ([0,1],[0,1])
644
645 template <class utype>
646 xtensor8<std::complex<utype>> // complex xtensor8 of uniforms
647 uniform(const xtensor8<std::complex<utype>> &, // real,imag in ([0,y],[0,y])
648 const utype &) __xprototype;
649
650 template <class utype>
651 xtensor8<std::complex<utype>> // complex xtensor8 of uniforms
652 uniform(const xtensor8<std::complex<utype>> &, // real,imag in ([0,x],[0,y])
653 const utype &,
654 const utype &) __xprototype;
655
656 template <class utype>
657 xtensor8<std::complex<utype>> // complex xtensor8 of uniforms
658 uniform(const xtensor8<std::complex<utype>> &, // real,imag in ([x1,y1],[x2,y2])
659 const utype &,
660 const utype &,
661 const utype &,
662 const utype &) __xprototype;
663} // namespace aurostd
664
665// --------------------------------- gaussian function and procedures on xtensor8
666
667namespace aurostd {
668 // namespace aurostd
669 template <class utype>
670 xtensor8<utype> // gaussian xtensor8<utype> (m,v)
671 gaussian(const xtensor8<utype> &a, const utype &m, const utype &v) __xprototype;
672
673 template <class utype>
674 xtensor8<utype> // gaussian xtensor8<utype> (m=0,v)
675 gaussian(const xtensor8<utype> &a, const utype &v) __xprototype;
676
677 template <class utype>
678 xtensor8<utype> // gaussian xtensor8<utype> (m=0,v=1)
679 gaussian(const xtensor8<utype> &a) __xprototype;
680
681 template <class utype>
682 xtensor8<std::complex<utype>> // complex xtensor8 of gaussians
683 gaussian(const xtensor8<std::complex<utype>> &a, // real,imag in (m1,v1),(m2,v2)
684 const utype &m2,
685 const utype &v2) __xprototype;
686
687 template <class utype>
688 xtensor8<std::complex<utype>> // complex xtensor8 of gaussians
689 gaussian(const xtensor8<std::complex<utype>> &a, // real,imag in (0,v1),(0,v2)
690 const utype &v1,
691 const utype &v2) __xprototype;
692
693 template <class utype>
694 xtensor8<std::complex<utype>> // complex xtensor8 of gaussians
695 gaussian(const xtensor8<std::complex<utype>> &a, // real,imag in (0,v),(0,v)
696 const utype &v) __xprototype;
697
698 template <class utype>
699 xtensor8<std::complex<utype>> // complex xtensor8 of gaussians
700 gaussian(const xtensor8<std::complex<utype>> &a) // real,imag in (0,1),(0,1)
702} // namespace aurostd
703
704#endif //__XTENSOR8_CPP
705
706// ----------------------------------------------------------------------------
707// ----------------------------------------------------------------------------
708
709#endif // _AUROSTD_XRANDOM_H_
710
711// ***************************************************************************
712// * *
713// * Aflow STEFANO CURTAROLO - Duke University 2003-2024 *
714// * *
715// ***************************************************************************
double expdev()
utype uniform(const utype &x)
double gaussian()
double ran0()
__xprototype
Definition aurostd.h:175
double ran2()
double laplacedev()
long int _random_initialize()
double ran1()