C++ mpi module for stochmagnet_main Package
CORE_Test.hpp
1 #ifndef CORE_Test_HPP
2 #define CORE_Test_HPP
3 
4 
5 template<typename T,class I>
6 requires functions_type::isArithmeticType<T>
8 
9 
10  std::cout<<"\n\t testing "<<A.getIdentityString()<<"...\n";
11  tBoolean ok=true,succeeds=true;
12 
13  //eps value
14  tReal eps=std::numeric_limits<float>::epsilon();
15 
16  //test the size setting
17  tIndex n=10;
18  A.setSize(n);
19 
20  if (A.getIdentityString().find("Ptr")!=tString::npos) {
21  tMemSize memPtrA=sizeof(T*)+sizeof(tIndex)*2+8+sizeof(CORE_Object)+n*sizeof(T);//+8 instead of +1 because of memory alignement
22  //Ptr Array
23  if (A.getMemorySize()!=memPtrA) {
24  std::cout<<"\n\t size of "<<A.getIdentityString()<<" "<<A.getMemorySize()<<": ("<<memPtrA<<")";
25  return false;
26  }
27  } else {
28  //val array
29  tMemSize memValA=sizeof(std::valarray<T>)+sizeof(CORE_Object)+n*sizeof(T);
30  if (A.getMemorySize()!=memValA) {
31  std::cout<<"\n\t size of "<<A.getIdentityString()<<" "<<A.getMemorySize()<<": ("<<memValA<<")";
32  return false;
33  }
34  }
35  ok=(A.getSize()==10);
36  if (!ok) {
37  std::cout<<"\t\t\t memory size verification [FAILED] \n";
38  } else {
39  std::cout<<"\t\t\t memory size verification [OK] \n";
40  }
41  succeeds=succeeds&& ok;
42 
43  //test list initializer
44  A={1};
45  ok=(A.getSize()==1);
46  ok=ok && (Equals(A[0],1));
47  if (!ok) {
48  std::cout<<" A:"<<A<<" ";
49  std::cout<<"\t\t\t initialize to {1} [FAILED] \n";
50  } else {
51  std::cout<<"\t\t\t initialization to {1} [OK] \n";
52  }
53  succeeds=succeeds&& ok;
54 
55  A={1,2,3,4};
56  ok=(A.getSize()==4);
57  for(auto i=0; const auto& v: A) {
58  ok = ok && Equals(v,i+1);
59  i++;
60  }
61  if (!ok) {
62  std::cout<<" A:"<<A<<" ";
63  std::cout<<"\t\t\t initialize to {1,2,3,4} [FAILED] \n";
64  } else {
65  std::cout<<"\t\t\t initialization to {1,2,3,4} [OK] \n";
66  }
67  succeeds=succeeds&& ok;
68 
69 
70 
71  //accessor tests
72  try {
73  A.get(4);
74  ok=false;
75  } catch(std::exception& e) {
76  ok=true;
77  }
78  if (!ok) {
79  std::cout<<" A:"<<A<<" ";
80  std::cout<<"\t\t\t out bounds access detected [FAILED] \n";
81  } else {
82  std::cout<<"\t\t\t out bounds access detected [OK] \n";
83  }
84  succeeds=succeeds&& ok;
85 
86  //constant initialization & sum tests
87  A=2.;
88  n=A.getSize();
89  T s=0;
90  A.sum(s);
91  ok=Equals(s,2*n);
92  if (!ok) {
93  std::cout<<" A:"<<A<<" ";
94  std::cout<<"\t\t\t testing sum() & initialize(const T& v) [FAILED] \n";
95  } else {
96  std::cout<<"\t\t\t testing sum() & initialize(const T& v) [OK] \n";
97  }
98  succeeds=succeeds&& ok;
99 
100  //prod test
101  A.prod(s);
102  ok=Equals(s,pow(2,n));
103  if (!ok) {
104  std::cout<<" A:"<<A<<" ";
105  std::cout<<"\t\t\t testing prod() [FAILED] \n";
106  } else {
107  std::cout<<"\t\t\t testing prod() [OK] \n";
108  }
109  succeeds=succeeds&& ok;
110 
111  //+= operator
112  A+=1;
113  for (tIndex i=0;i<n;i++) ok=ok && (Equals(A[i],3));
114  if (!ok) {
115  std::cout<<" A:"<<A<<" ";
116  std::cout<<"\t\t\t testing +=(const T& v) [FAILED] \n";
117  } else {
118  std::cout<<"\t\t\t testing +=(const T& v) [OK] \n";
119  }
120  succeeds=succeeds&& ok;
121 
122  //test uniform randomize & copy
123  CORE_UniquePointer<CORE_Array<T,I>> pB=I::New();
124  if (pB.get()==null) {
125  std::cout<<"New Instanced has failed";
126  return false;
127  }
128  CORE_Array<T,I> &B=*pB.get();
129  B.setSize(10);
130  B.uniformRandomize();
131  A=B;
132  ok=(A.getSize()==B.getSize());
133  auto b=B.cbegin();
134  std::for_each(A.cbegin(),A.cend(),
135  [&](const auto & a) {
136  ok= ok && Equals(a,*b);//validate the copy
137  ok =ok && (a>=0) && (a<=1);//validate the unifoem
138  b++;
139  });
140 
141  if (!ok) {
142  std::cout<<" A:"<<A<<" B="<<B<<" ";
143  std::cout<<"\t\t\t testing =(const CORE_Array& v) [FAILED] \n";
144  } else {
145  std::cout<<"\t\t\t testing =(const CORE_Array& v) [OK] \n";
146  }
147  succeeds=succeeds&& ok;
148 
149  //testing Linf distance
150  tIndex imax=0;
151  tReal d=A.linfDistance(B,imax);
152  ok=ok && (fabs(d)<eps);
153  if (!ok) {
154  std::cout<<" A:"<<A<<" B="<<B<<" ";
155  std::cout<<" linfMax:"<<d<<" imax:"<<imax<<"\n";
156  std::cout<<"\t\t\t testing linfDistance [FAILED] \n";
157  } else {
158  std::cout<<"\t\t\t testing linfDistance [OK] \n";
159  }
160  succeeds=succeeds&& ok;
161 
162  //testing L2 distance
163  d=A.l2Distance(B);
164  ok=ok && (fabs(d)<eps);
165  if (!ok) {
166  std::cout<<" A:"<<A<<" B="<<B<<" ";
167  std::cout<<" l2:"<<d<<"\n";
168  std::cout<<"\t\t\t testing l2Distance [FAILED] \n";
169  } else {
170  std::cout<<"\t\t\t testing l2Distance [OK] \n";
171  }
172  succeeds=succeeds&& ok;
173 
174 
175  //testing swap
176 
177  A.swap(1,2);
178  ok = Equals(A[1],B[2]);
179  ok= ok && Equals(A[2],B[1]);
180  if (!ok) {
181  std::cout<<" A:"<<A<<" B="<<B<<" ";
182  std::cout<<" 1<->2 swaping \n";
183  std::cout<<"\t\t\t testing swaping element [FAILED] \n";
184  } else {
185  std::cout<<"\t\t\t testing swaping element [OK] \n";
186  }
187  succeeds=succeeds&& ok;
188  //transform test
190  C={0,1,2,3};
191  auto lambda=[](const tInteger& x) {return x*x;};
192  C.transform(lambda);
193  ok=(C.getSize()==4);
194  tInteger i=0;
195  for(const auto Ci : C.getArray()) {
196  ok = ok && (Equals(Ci,i*i));
197  i++;
198  }
199  if (!ok) {
200  std::cout<<" C:"<<C<<"\n";
201  std::cout<<"\t\t\t testing transform(x^2) [FAILED] \n";
202  } else {
203  std::cout<<"\t\t\t testing transform(x^2) [OK] \n";
204  }
205  succeeds=succeeds && ok;
206 
207 
208  //uniform randomize
209  succeeds = uniformRandomTest<T>(A,B) && succeeds;
210 
211  //copy an integer array to real array
212  A.copy(C);
213  ok=(A.getSize()==4);
214  for (i=0;i<4;i++) {
215  ok = ok && (Equals(A[i],i*i));
216  }
217  if (!ok) {
218  std::cout<<" A:"<<A<<" C:"<<C<<"\n";
219  std::cout<<"\t\t\t testing A.copy(C) [FAILED] \n";
220  } else {
221  std::cout<<"\t\t\t testing A.copy(C) [OK] \n";
222  }
223  succeeds=ok & succeeds;
224 
225  C=2;
226  A=C;
227  ok=(A.getSize()==4);
228  for (i=0;i<4;i++) {
229  ok = ok && (Equals(A[i],2));
230  }
231  if (!ok) {
232  std::cout<<" A:"<<A<<" C:"<<C<<"\n";
233  std::cout<<"\t\t\t testing A=C [FAILED] \n";
234  } else {
235  std::cout<<"\t\t\t testing A=C [OK] \n";
236  }
237  succeeds=ok & succeeds;
238 
239 
240 
241  //performance test:
242 
243  CORE_Chrono timer;
244 
245  tIndex N=256*256*256*3;
246  //N=16*16*16*3;//for valgrind
247  tReal alpha=1,beta=2;
248  std::cout<<"\t\t\t testing Y:=beta.Y+alpha X for a size N="<<N<<" randomizing... "<<std::flush;
249 
250  //A array initialization
251  A.setSize(N);
252  A.uniformRandomize();
253 
254  //B array initialization
255  B.setSize(N);
256  B.uniformRandomize();
257 
258  std::cout<<" computing Y... "<<std::flush;
259  timer.start();
260  A.axpy(alpha,B,beta);
261  tULLInt duration=timer.stop();
262  std::cout<<" time:"<<duration<<" ms \n";
263 
264 
265  return succeeds;
266 
267 }
268 
269 template<typename T,class I>
271 
272  //uniform randomize
273 
274  //area of a disk defined by (x^2+y^2)=a^2 : Pi.a^2
275  //area of the smallest square containing the previous circle : 4a^2
276  //for arbitrary point of the square has a proprobility P= Pi.a^2/4.a^2=Pi/4.
277  //so PI= 4 . P
278 
279  CORE_Chrono timer;
280 
281  tIndex p,N=128*128*128;
282  //N=10;//for debug
283  //N=16*16*16;//for valgrind
284  A.setSize(2*N);
285 
286  timer.start();
287  A.uniformRandomize();
288 
289  const T* vA=A.getValues();
290  const T* eA=vA+2*N;
291  T d=0,dk=0;
292  p=0;
293  while (vA!=eA) {
294  d=0;
295 
296  dk=(*vA);
297  dk*=dk;
298  d+=dk;
299  vA++;
300 
301  dk=(*vA);
302  dk*=dk;
303  d+=dk;
304  vA++;
305 
306  p+=(d<=1);
307 
308  }
309 
310  //the probality is p=s/n
311  //so pi ~4. p
312  tReal Pi=4.*((tReal)p)/((tReal)N);
313  //duration in ms
314  tULLInt duration=timer.stop();
315  tReal err=fabs(1-(Pi/M_PI));
316  tReal errMax=1.e-3;
317  std::cout<<"\t\t\t Pi:"<<std::setprecision(12)<<Pi<<" M_PI:"<<M_PI<<" err="<<err<<" (errMax="<<errMax<<") p="<<p<<" N="<<N<<" in "<<duration<<"ms ";
318  tBoolean ok=(err<errMax);
319  if (!ok) {
320  std::cout<<" [FAILED] \n";
321  } else {
322  std::cout<<" [OK] \n";
323  }
324  return ok;
325 }
329 
330 
331 
332 template<typename T,typename K,K D,class S,class I>
334  tBoolean ok=true,succeeds=true;
335 
336  std::cout<<"\n\t testing "<<A.getIdentityString()<<"...\n";
337  tDimension k;
338 
339  //init tests
340  A={1,2,3,4,5,6,7,8,9,10};
341  ok=(A.getElementsNumber()==3) && (A.getSize()==9);
342 
343  tInteger i=1;
344  for (const auto &Ai : A) {
345  ok = ok && ( Equals(Ai,i));
346  i++;
347  }
348  if (!ok) {
349  std::cout<<"error in copy initializer \n";
350  std::cout<<"A size : "<<A.getElementsNumber()<<" array size:"<<A.getSize()<<"\n";
351  std::cout<<"A="<<A<<"\n";
352  std::cout<<"\t\t\t testing A={1,2,3,4,5,6,7,8,9} [FAILED] \n";
353  } else {
354  std::cout<<"\t\t\t testing A={1,2,3,4,5,6,7,8,9} [OK] \n";
355  }
356 
357  succeeds=succeeds&& ok;
358 
359  //test the setting normalized values
360  std::array<tReal,3> V={1,1,1};
362  A.initialize(V);
363  ok=(A.getElementsNumber()==3);
364  for (i=0;i<3;i++) {
365  for (k=0;k<3;k++) {
366  ok=ok && Equals(A(i,k),1./sqrt(3.));
367  }
368  }
369  if (!ok) {
370  std::cout<<A<<"\n";
371  std::cout<<" error in setting value to normalized of ("<<V[0]<<","<<V[1]<<","<<V[2]<<")\n";
372  std::cout<<"\t\t\t testing initialize(std::array<D>) [FAILED] \n";
373  } else {
374  std::cout<<"\t\t\t testing initialize(std::array<D>) [OK] \n";
375  }
376  succeeds=succeeds&& ok;
377 
378  //nan test
379  ok=!(A.isNANContained());
380  A(1,0)=sqrt(-1);
381  ok=A.isNANContained() && ok;
382  if (!ok) {
383  std::cout<<" A:"<<A<<" ";
384  std::cout<<"\t\t\t testing nan detection [FAILED] \n";
385  } else {
386  std::cout<<"\t\t\t testing nan detection [OK] \n";
387  }
388 
389  succeeds=succeeds&& ok;
390 
391  //+= operator
392  A(1,0)=0;
393  A+=1;
394  ok=ok && Equals(A(1,0),1);
395  if (!ok) {
396  std::cout<<" A:"<<A<<" ";
397  std::cout<<"\t\t\t testing +=1 [FAILED] \n";
398  } else {
399  std::cout<<"\t\t\t testing +=1 [OK] \n";
400  }
401  succeeds=succeeds&& ok;
402 
403 
404 
405  //random test
406  //volume defined by (x^2+y^2)=a^2 : (4/3).Pi.a^3
407  //volume of the smallest square containing the previous sphere : 8a^3
408  //for arbitrary point of the square has a proprobility P= (4/3).Pi.a^3/(8.a^3)=Pi/6.
409  //so PI= 6 . P
410 
411 
412  //tIndex N=10;
413  tIndex N=10000000;
414  //N=16*16*16;//for valgrind
415  CORE_Chrono timer;
416  A.setElementsNumber(N);
417  ok =(A.getSize()==N*D);
418  if (!ok) {
419  std::cout<<"error in setting size/elements of A \n";
420  return false;
421  }
423 
424  timer.start();
425  A.uniformRandomize(0,1);
426  //std::cout<<"A:"<<A<<"\n";
427  A.mod2(nD);
428  //std::cout<<"norm2:"<<nD<<"\n";
429  //X:=(X^2+Y^2+Z^2)<=1)
430  nD.transform([](const tReal& r) { return (r<=1);});
431  //std::cout<<"r<=1:"<<nD<<"\n";
432  T p=1;
433  nD.sum(p);
434  //the probality is p=s/n
435  //so pi ~6. p
436  tReal Pi=6.*((tReal)p)/((tReal)N);
437  //duration in ms
438  tULLInt duration=timer.stop();
439  tReal err=fabs(1-(Pi/M_PI));
440  tReal errMax=1.e-3;
441  std::cout<<"\t\t\t Pi:"<<Pi<<" err="<<err<<" (errrMax="<<errMax<<") with PI="<<M_PI<<" with "<<N<<" random values computed in "<<duration<<"ms ";
442  ok=(err<errMax);
443  if (!ok) {
444  std::cout<<" [FAILED] \n";
445  } else {
446  std::cout<<" [OK] \n";
447  }
448  succeeds=succeeds&& ok;
449 
450 
451  //normalized
452  A.setSize(4);
453  A.uniformRandomize(-1,1);
454  A.normalize();
455  ok=(A.getElementsNumber()==1);
456  if (!ok) {
457  std::cout<<" error in getElementsNumber() & setSize() \n";
458  return false;
459  }
460  tReal r;
461  ok=true;
462  for (i=0;i<A.getElementsNumber();i++) {
463  r=0;
464  for (k=0;k<D;k++) {
465  r+=A(i,k)*A(i,k);
466  }
467  r=sqrt(r);
468  ok=(fabs(r-1)<1.e-12);
469  if (!ok) break;
470  }
471  if (!ok) {
472  std::cout<<"\n error in normalization of A at index "<<i<<" A=("<<A(i,0)<<","<<A(i,1)<<","<<A(i,2)<<") norm:"<<r<<"\n";
473  std::cout<<"\t\t\t testing field normalization [FAILED] \n";
474  } else {
475  std::cout<<"\t\t\t testing field normalization [OK] \n";
476  }
477  succeeds=succeeds&& ok;
478 
479  //verify the ApplyDArray method
480  //transform X as a circle of radius 1 to a radius 2 and center (1,1,1)
481  //F(X)=alpha X + C
482  A.setElementsNumber(4);
483  A.uniformRandomize(-1,1);
484  A.normalize();
485  ok=(A.getSize()==4*D);
486  if (!ok) {
487  std::cout<<"error in setting setElementsNumber() & getSize() \n";
488  return false;
489  }
490  std::array<tReal,D> C= {1,1,1};
491  r=2;
492  auto similitude=[&r,&C](auto& Xi) {
493  auto iCid=C.cbegin();//iterator to C(0)
494  std::for_each_n(&Xi,D,//iterator on d in [0,3[
495  [&r,&iCid](auto &Xid){//X(i,d)
496  Xid=Xid*r+(*iCid);
497  iCid++;//&C(i,d)
498  });
499  return Xi;
500  };
501  A.elementsTransform(similitude);
502  ok=true;
503  for (i=0;i<A.getElementsNumber();i++) {
504  r=0;
505  for (k=0;k<D;k++) {
506  r+=(A(i,k)-C[k])*(A(i,k)-C[k]);
507  }
508  r=sqrt(r);
509  ok=(fabs(r-2)<1.e-12);
510  if (!ok) break;
511  }
512 
513  if (!ok) {
514  std::cout<<"\n error in similitude of A at index "<<i<<" A=("<<A(i,0)<<","<<A(i,1)<<","<<A(i,2)<<") |A-C(1,1,1)|:"<<r<<"\n";
515  std::cout<<"\t\t\t testing similitude transformation [FAILED] \n";
516  } else {
517  std::cout<<"\t\t\t testing similitude transformation [OK] \n";
518  }
519 
520  succeeds=succeeds&& ok;
521 
522 
523  //scalar product test
524  //A={1,2,3,4,5,6};
525  A.copy({1,2,3,4,5,6});
526  //test uniform randomize & copy
527  CORE_UniquePointer<CORE_Field<T,K,D,S,I>> pB=I::New();
528  if (pB.get()==null) {
529  std::cout<<"New Instanced has failed";
530  return false;
531  }
532  CORE_Field<T,K,D,S,I> &B=*dynamic_cast<CORE_Field<tReal,K,D,S,I>*>(pB.get());
533  B={1,1,1,1,1,1};
534  T s;
535  A.scalarProduct(B,s);
536  ok=Equals(s,21);
537  if (!ok) {
538  std::cout<<"\n error <A,B>="<<s<<" A="<<A<<" B="<<B<<"\n";
539  std::cout<<"\t\t\t testing scalar product [FAILED] \n";
540  } else {
541  std::cout<<"\t\t\t testing scalar product [OK] \n";
542  }
543  succeeds=succeeds&& ok;
544 
545 
546  B.mod2(nD);
547  ok=(nD.getSize()==2);
548  ok=ok && (nD[0]==3);
549  ok=ok && (nD[1]==3);
550  if (!ok) {
551  std::cout<<"\n error |B|="<<nD<<" B="<<B<<" \n";
552  std::cout<<"\t\t\t testing norm2 [FAILED] \n";
553  } else {
554  std::cout<<"\t\t\t testing norm2 [OK] \n";
555  }
556  succeeds=succeeds&& ok;
557 
558  //performance test:
559 
560  //performance test:
561  N=256*256*256;
562  //N=16*16*16;//for valgrind
563  tReal alpha=1,beta=2;
564  std::cout<<"\t\t\t testing Y:=beta.Y+alpha X for a size N="<<N<<" ";
565 
566  //A field
567  A.setElementsNumber(N);
568  A.uniformRandomize(0,1);
569  B.setElementsNumber(N);
570  B.uniformRandomize(0,1);
571 
572  timer.start();
573  A.axpy(alpha,B,beta);
574  duration=timer.stop();
575  std::cout<<" time:"<<duration<<" ms \n";
576 
577 
578  return succeeds;
579 }
580 #endif
this class describes an array of values T of dynamical size with algebrical operators and I is an imp...
Definition: CORE_Array.h:91
virtual tMemSize getMemorySize() const override
return the memory size of the class and the memory size of all its attributes/associations
Definition: CORE_Array.h:127
void sum(T &s) const
Computes the sum of all the elements.
Definition: CORE_Array.h:622
const T & get(const tIndex &i) const
get the i-th element for reading
Definition: CORE_Array.h:192
tReal linfDistance(const CORE_Array< Q, I1 > &X, tIndex &i) const
compute the Linfinitty norm
Definition: CORE_Array.h:684
void prod(T &p) const
return the produc of all the elements
Definition: CORE_Array.h:628
void copy(const tIndex &n, const Q *vs)
initialize the array to the values of pointer of size n
Definition: CORE_Array.h:304
const T * getValues() const
get the values of the array for reading
Definition: CORE_Array.h:206
void axpy(const Q &alpha, const CORE_Array< Q, I1 > &X, const T &beta)
compute This=beta.This+ alpha .X
Definition: CORE_Array.h:593
void swap(Self &a)
swap the contents of the array
Definition: CORE_Array.h:565
void uniformRandomize()
randomize the field
Definition: CORE_Array.h:397
tReal l2Distance(const CORE_Array< Q, I1 > &X) const
compute the L2 distance
Definition: CORE_Array.h:668
this class describes the chono class by default write on standart output
Definition: CORE_Chrono.h:14
tULLInt stop()
stop the chrono and return the duration time in micro seconds as an int
Definition: CORE_Chrono.h:95
void start()
start the chrono
Definition: CORE_Chrono.h:89
constexpr auto cbegin() const
return begin iterator for reading
Definition: CORE_Collection.h:143
tIndex getSize() const
return the size of the container
Definition: CORE_Collection.h:111
void setSize(const tIndex &n)
set the size of the container
Definition: CORE_Collection.h:104
constexpr auto cend() const
return end iterator for reading
Definition: CORE_Collection.h:149
this class describes an field. A field is composed by
Definition: CORE_Field.h:49
void axpy(const Q &alpha, const CORE_Field< Q, K, D, S1, I1 > &X, const T &beta)
compute This=beta.This+ alpha .X
Definition: CORE_Field.h:770
tBoolean isNANContained() const
return true if one value is Not A Number
Definition: CORE_Field.h:782
void copy(const tIndex &n, const Q *vs)
initialize the field to the values of pointer of size n
Definition: CORE_Field.h:447
void uniformRandomize(const T &min, const T &max)
randomize the field
Definition: CORE_Field.h:561
void elementsTransform(LambdaFct &&F)
apply the transform element with the lambda function Xid = F(Xid)
Definition: CORE_Field.h:733
void mod2(CORE_Array< T, I1 > &X) const
return the norm2 array per each element
Definition: CORE_Field.h:793
tIndex getElementsNumber() const
return the number values of the container
Definition: CORE_Field.h:135
void initialize(const T &v)
initialize the field to v
Definition: CORE_Field.h:533
tIndex getSize() const
return the number values of the container
Definition: CORE_Field.h:161
T & scalarProduct(const CORE_Field< Q, K, D, S1, I1 > &X, T &s) const
return the scalar product
Definition: CORE_Field.h:836
void setElementsNumber(const tInteger &n)
set the number of element of the container
Definition: CORE_Field.h:121
void normalize()
normalize all the elements of the field return false if the method is not compatible with the floatin...
Definition: CORE_Field.h:760
void setSize(const tIndex &n)
set the number of values of the container
Definition: CORE_Field.h:144
abstract base class for most classes.
Definition: CORE_Object.h:65
tString getIdentityString() const
retrun the string identification of the class
Definition: CORE_Object.h:321
CORE_Object()
build an instance of the object
Definition: CORE_Object.cpp:9
static void Normalize(std::array< Q, N > &a)
normalize the array
Definition: CORE_StdPtrArray.h:836
this class describes a standart arithmetic array type implemented with a std::valarray object of type...
Definition: CORE_StdValArray.h:14
void sum(T &s) const
return the sum of all the elements
Definition: CORE_StdValArray.h:855
void transform(LambdaFct &&F)
transform the transform element with the lambda function Ti = F(const Ti)
Definition: CORE_StdValArray.h:674
tBoolean uniformRandomTest(CORE_Array< T, I > &A, CORE_Array< T, I > &B) const
randomizer test
Definition: CORE_Test.hpp:270
tBoolean testArray(const CORE_Run &runner, const CORE_OptionsList &options) const
test the numeric array
Definition: CORE_Test.cpp:754
requires functions_type::isRealType< T > static functions_type::isRealType< Q > tBoolean Equals(const T &a, const Q &b)
retrun true if the two values are equals
Definition: CORE_Test.h:226
tBoolean testField(const CORE_Run &runner, const CORE_OptionsList &options) const
test the numeric field
Definition: CORE_Test.cpp:773
tIndex getSize() const
return the size of the array for writing
Definition: CORE_ValArray.h:147