Arcane  v3.15.0.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
TestNumArray.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2024 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7
8#include <gtest/gtest.h>
9
10#include "arcane/utils/NumArray.h"
11
12#include "arcane/utils/Real2.h"
13#include "arcane/utils/Real3.h"
14#include "arcane/utils/Real2x2.h"
15#include "arcane/utils/Real3x3.h"
16
17#include "arcane/utils/NumArrayUtils.h"
18
19#include <vector>
20
21/*---------------------------------------------------------------------------*/
22/*---------------------------------------------------------------------------*/
23
24using namespace Arcane;
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
29using namespace Arcane;
30
31TEST(NumArray, Empty)
32{
33 std::cout << "TEST_NUMARRAY Empty\n";
37 array1 = array3;
39 array4 = array1;
40}
41
42TEST(NumArray, Basic)
43{
44 std::cout << "TEST_NUMARRAY Basic\n";
45
47 array1(1) = 5.0;
48 ASSERT_EQ(array1(1), 5.0);
49 std::cout << " V=" << array1(1) << "\n";
50 array1[2] = 3.0;
51 ASSERT_EQ(array1[2], 3.0);
52 std::cout << " V=" << array1(1) << "\n";
53 array1.resize(7);
54 ASSERT_EQ(array1.totalNbElement(), 7);
55
57 array2(1, 2) = 5.0;
58 std::cout << " V=" << array2(1, 2) << "\n";
59 array2.resize(7, 5);
60 ASSERT_EQ(array2.totalNbElement(), (7 * 5));
61
63 array3(1, 2, 3) = 5.0;
64 std::cout << " V=" << array3(1, 2, 3) << "\n";
65 ASSERT_EQ(array3(1, 2, 3), 5.0);
66 array3.resize(12, 4, 6);
67 ASSERT_EQ(array3.totalNbElement(), (12 * 4 * 6));
68 array3.fill(0.0);
69 array3(1, 2, 3) = 4.0;
70 array3(2, 3, 5) = 1.0;
71
72 {
74 ASSERT_EQ(array3.extent0(), span_array3.extent0());
75
77 ASSERT_EQ(const_span_array3.to1DSpan(), span_array3.to1DSpan());
78
79 ASSERT_EQ(array3.extent0(), span_array3.extent0());
80 std::cout << "Array3: extents=" << array3.extent0()
81 << "," << array3.extent1() << "," << array3.extent2() << "\n";
82 for (Int32 i = 0; i < array3.extent0(); ++i) {
84 ASSERT_EQ(span_array2.extent0(), span_array3.extent1());
85 ASSERT_EQ(span_array2.extent1(), span_array3.extent2());
86 std::cout << " MDDim2 slice i=" << i << " X=" << span_array2.extent0() << " Y=" << span_array2.extent1() << "\n";
87 for (Int32 x = 0, xn = span_array2.extent0(); x < xn; ++x) {
88 for (Int32 y = 0, yn = span_array2.extent1(); y < yn; ++y) {
89 ASSERT_EQ(span_array2.ptrAt(x, y), span_array3.ptrAt(i, x, y));
90 }
91 }
92 }
93 }
94 {
96 std::cout << "Array2: extents=" << array2.extent0() << "," << array2.extent1() << "\n";
97 for (Int32 i = 0; i < array2.extent0(); ++i) {
98 MDSpan<Real, MDDim1> span_array1 = array2.mdspan().slice(i);
99 ASSERT_EQ(span_array1.extent0(), span_array2.extent1());
100 std::cout << " MDDim1 slice i=" << i << " X=" << span_array2.extent0() << "\n";
101 for (Int32 x = 0, xn = span_array1.extent0(); x < xn; ++x) {
102 ASSERT_EQ(span_array1.ptrAt(x), span_array2.ptrAt(i, x));
103 }
104 }
105 }
106 NumArray<Real, MDDim4> array4(2, 3, 4, 5);
107 array4(1, 2, 3, 4) = 5.0;
108 std::cout << " V=" << array4(1, 2, 3, 4) << "\n";
109 array4.resize(8, 3, 7, 5);
110 ASSERT_EQ(array4.totalNbElement(), (8 * 3 * 7 * 5));
111
112 NumArray<Real, MDDim1> num_data1(4, { 2.4, 5.6, 3.3, 5.4 });
113 ASSERT_EQ(num_data1[0], 2.4);
114 ASSERT_EQ(num_data1[1], 5.6);
115 ASSERT_EQ(num_data1[2], 3.3);
116 ASSERT_EQ(num_data1[3], 5.4);
117
118 NumArray<Real, MDDim2, RightLayout> num_data2(3, 2, { 1.4, 15.6, 33.3, 7.4, 4.2, 6.5 });
119 ASSERT_EQ(num_data2(0, 0), 1.4);
120 ASSERT_EQ(num_data2(0, 1), 15.6);
121 ASSERT_EQ(num_data2(1, 0), 33.3);
122 ASSERT_EQ(num_data2(1, 1), 7.4);
123 ASSERT_EQ(num_data2(2, 0), 4.2);
124 ASSERT_EQ(num_data2(2, 1), 6.5);
125}
126
127/*---------------------------------------------------------------------------*/
128/*---------------------------------------------------------------------------*/
129
130TEST(NumArray,Basic2)
131{
132 std::cout << "TEST_NUMARRAY Basic2\n";
133
135 array1.resize(2);
136 array1(1) = 5.0;
137 std::cout << " V=" << array1(1) << "\n";
138
140 array2.resize(2,3);
141 array2(1,2) = 5.0;
142 std::cout << " V=" << array2(1,2) << "\n";
143
145 array3.resize(2,3,4);
146 array3(1,2,3) = 5.0;
147 std::cout << " V=" << array3(1,2,3) << "\n";
148
150 array4.resize(2,3,4,5);
151 array4(1,2,3,4) = 5.0;
152 std::cout << " V=" << array4(1,2,3,4) << "\n";
153}
154
155/*---------------------------------------------------------------------------*/
156/*---------------------------------------------------------------------------*/
157
158TEST(NumArray, Extents)
159{
160 std::cout << "TEST_NUMARRAY Extents\n";
161
167 ASSERT_EQ(1, MDDim1::nb_dynamic);
168 ASSERT_EQ(2, MDDim2::nb_dynamic);
169 ASSERT_EQ(3, MDDim3::nb_dynamic);
170 ;
171 ASSERT_EQ(4, MDDim4::nb_dynamic);
172
173 {
175 x1.resize({ 6, 7 });
176 ASSERT_EQ(x1.extent0(), 2);
177 ASSERT_EQ(x1.extent1(), 6);
178 ASSERT_EQ(x1.extent2(), 3);
179 ASSERT_EQ(x1.extent3(), 7);
180 }
181 {
183 x1.resize(6);
184 ASSERT_EQ(x1.extent0(), 2);
185 ASSERT_EQ(x1.extent1(), 3);
186 ASSERT_EQ(x1.extent2(), 6);
187 }
188}
189
190/*---------------------------------------------------------------------------*/
191/*---------------------------------------------------------------------------*/
192
193TEST(NumArray3,Misc)
194{
195 constexpr int nb_x = 3;
196 constexpr int nb_y = 4;
197 constexpr int nb_z = 5;
198
200 v.fill(0);
201 // Attention, v.extents() change si 'v' est redimensionné
202 auto v_extents = v.extentsWithOffset();
203 {
204 for( Int32 x=0, xn=v.dim1Size(); x<xn; ++x ){
205 for( Int32 y=0, yn=v.dim2Size(); y<yn; ++y ){
206 for( Int32 z=0, zn=v.dim3Size(); z<zn; ++z ){
207 ArrayIndex<3> idx{x,y,z};
208 Int64 offset = v_extents.offset(idx);
209 v(x,y,z) = offset;
210 v({x,y,z}) = offset;
211 v(idx) = offset;
212 }
213 }
214 }
215 }
216 std::cout << "CAPACITY V1=" << v.capacity() << "\n";
217 v.resize(4,5,6);
218 std::cout << "CAPACITY V2=" << v.capacity() << "\n";
219 v.resize(2,7,9);
220 std::cout << "CAPACITY V3=" << v.capacity() << "\n";
221 v.resize(3,2,6);
222 std::cout << "CAPACITY V4=" << v.capacity() << "\n";
223
224 // NOTE: désactive temporairement le test tant que la méthode
225 // resize() de 'NumArray' ne conserve pas les valeurs
226#if NUMARRAY_HAS_VALID_RESIZE
227 // Les valeurs ci-dessous dépendent de l'implémentation actuelle
228 // de NumArray::resize(). Je ne suis pas sur qu'il soit valide de les
229 // tester
230 std::vector<Int64> valid_values =
231 {
232 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
233 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
234 24 , 25, 26, 27, 28, 29, 20 , 21, 22, 23, 24, 25
235 };
236 ASSERT_EQ(valid_values.size(),(size_t)36);
237
238 v_extents = v.extentsWithOffset();
239 Int64 index = 0;
240 for( Int64 x=0, xn=v.dim1Size(); x<xn; ++x ){
241 for( Int64 y=0, yn=v.dim2Size(); y<yn; ++y ){
242 for( Int64 z=0, zn=v.dim3Size(); z<zn; ++z ){
243 ArrayBoundsIndex<3> idx{x,y,z};
244 Int64 offset = v_extents.offset(idx);
245 Int64 val1 = v(x,y,z);
246 Int64 val2 = v({x,y,z});
247 std::cout << "XYZ=" << x << " " << y << " " << z
248 << " V=" << val1 << " offset=" << offset << "\n";
249 ASSERT_EQ(index,offset);
251 ASSERT_EQ(valid_values.at(offset),val1);
252 ++index;
253 }
254 }
255 }
256#endif
257}
258
259/*---------------------------------------------------------------------------*/
260/*---------------------------------------------------------------------------*/
261
262namespace
263{
265{
266 std::cout << "IN_CREATE_1\n";
267 NumArray<int,MDDim1> a(size);
268 std::cout << "IN_CREATE_2\n";
269 for(Int32 i=0; i<size; ++i )
270 a(i) = size+i+2;
271 return a;
272}
273}
274TEST(NumArray3, Copy)
275{
276 int nb_x = 3;
277 int nb_y = 4;
278 int nb_z = 5;
280 v.fill(3.2);
281 NumArray<Real, MDDim3> v2(nb_x * 2, nb_y / 2, nb_z * 3);
282
283 v.copy(v2.mdspan());
284
285 {
286 NumArray<int, MDDim1> vi0(4, { 1, 3, 5, 7 });
289 vi2 = vi1;
290 ASSERT_EQ(vi1.to1DSpan(), vi0.to1DSpan());
291 ASSERT_EQ(vi2.to1DSpan(), vi1.to1DSpan());
292 NumArray<int, MDDim1> vi3(vi0.to1DSpan());
293 ASSERT_EQ(vi3.to1DSpan(), vi0.to1DSpan());
294
295 Span<const int> vi0_span(vi0.to1DSmallSpan());
296 Span<const int> vi1_span(vi1.to1DSmallSpan());
297 ASSERT_EQ(vi0.to1DSpan(), vi0_span);
298 ASSERT_EQ(vi1_span, vi1.to1DSpan());
299 ASSERT_EQ(vi1.to1DSmallSpan(), vi0.to1DSmallSpan());
300 ASSERT_EQ(vi1.to1DConstSmallSpan(), vi0.to1DConstSmallSpan());
302 Span<const int> vi1_ref_span(v1_ref.to1DSmallSpan());
303 ASSERT_EQ(vi1_ref_span, vi1.to1DSpan());
304 }
305
306 {
307 NumArray<int, MDDim1> vi0(4, { 1, 3, 5, 7 });
310 vi2 = vi1;
311 ASSERT_EQ(vi1.to1DSpan(), vi0.to1DSpan());
312 ASSERT_EQ(vi2.to1DSpan(), vi1.to1DSpan());
313 }
314}
315
316TEST(NumArray3,Move)
317{
318 // Test NumArray::NumArray(NumArray&&)
319 {
320 std::cout << "PART_1\n";
322 test_move.fill(3);
323 Int32 wanted_size1 = 23;
325 std::cout << "PART_2\n";
326 ASSERT_EQ(test_move.totalNbElement(),wanted_size1) << "Bad size (test move 1)";
327 ASSERT_EQ(test_move[6],wanted_size1+8) << "Bad size (test move 2)";
328 Int32 wanted_size2 = 17;
330 std::cout << "PART_3\n";
331 ASSERT_EQ(test_move.totalNbElement(),wanted_size2) << "Bad size (test move 3)";
332 ASSERT_EQ(test_move[3],wanted_size2+5) << "Bad size (test move 4)";
333 }
334 // Test NumArray::operator=(NumArray&&)
335 {
336 Int32 wanted_size1 = 31;
337 std::cout << "PART_4\n";
339 std::cout << "PART_5\n";
340 ASSERT_EQ(test_move.totalNbElement(),wanted_size1) << "Bad size (test move 1)";
341 ASSERT_EQ(test_move[7],wanted_size1+9) << "Bad size (test move 2)";
342 }
343}
344
345/*---------------------------------------------------------------------------*/
346/*---------------------------------------------------------------------------*/
347
348TEST(NumArray3,Index)
349{
350 ArrayIndex<3> index(1,4,2);
351 auto [i, j, k] = index();
352
353 ASSERT_TRUE(i==1);
354 ASSERT_TRUE(j==4);
355 ASSERT_TRUE(k==2);
356}
357
358namespace
359{
360template<typename T>
361void _setNumArray2Values(T& a)
362{
363 for( Int32 i=0; i<a.dim1Size(); ++i ){
364 for( Int32 j=0; j<a.dim2Size(); ++j ){
365 a(i,j) = (i*253) + j;
366 }
367 }
368}
369template<typename T>
370void _setNumArray3Values(T& a)
371{
372 for( Int32 i=0; i<a.dim1Size(); ++i ){
373 for( Int32 j=0; j<a.dim2Size(); ++j ){
374 for( Int32 k=0; k<a.dim3Size(); ++k ){
375 a(i,j,k) = (i*253) + (j*27) + k;
376 }
377 }
378 }
379}
380}
381
382/*---------------------------------------------------------------------------*/
383/*---------------------------------------------------------------------------*/
384
385TEST(NumArray2,Layout)
386{
387 std::cout << "TEST_NUMARRAY2 Layout\n";
388
389 {
391 ASSERT_EQ(a.totalNbElement(),(3*5));
393 auto values = a.to1DSpan();
394 std::cout << "V=" << values << "\n";
395 UniqueArray<Real> ref_value = { 0, 1, 2, 3, 4, 253, 254, 255, 256, 257, 506, 507, 508, 509, 510 };
396 ASSERT_EQ(values.smallView(),ref_value.view());
397 }
398
399 {
401 ASSERT_EQ(a.totalNbElement(),(3*5));
403 auto values = a.to1DSpan();
404 std::cout << "V=" << values << "\n";
405 UniqueArray<Real> ref_value = { 0, 253, 506, 1, 254, 507, 2, 255, 508, 3, 256, 509, 4, 257, 510 };
406 ASSERT_EQ(values.smallView(),ref_value.view());
407 }
408}
409
410/*---------------------------------------------------------------------------*/
411/*---------------------------------------------------------------------------*/
412
413template<typename NumArray3>
414void _checkRightLayoutDim3(NumArray3& a)
415{
416 // Le tableau doit avoir les dimensions (2,3,5);
417 ASSERT_EQ(a.totalNbElement(),(2*3*5));
418 ASSERT_EQ(a.extent0(),2);
419 ASSERT_EQ(a.extent1(),3);
420 ASSERT_EQ(a.extent2(),5);
422 auto values = a.to1DSpan();
423 std::cout << "V=" << values << "\n";
425 {
426 0, 1, 2, 3, 4, 27, 28, 29, 30, 31, 54, 55, 56, 57, 58,
427 253, 254, 255, 256, 257, 280, 281, 282, 283, 284, 307, 308, 309, 310, 311
428 };
429 ASSERT_EQ(values.smallView(),ref_value.view());
430}
431
432template<typename NumArray3>
433void _checkLeftLayoutDim3(NumArray3& a)
434{
435 // Le tableau doit avoir les dimensions (2,3,5);
436 //NumArray<Real,MDDim3,LeftLayout3> a(2,3,5);
437 ASSERT_EQ(a.totalNbElement(),(2*3*5));
439 auto values = a.to1DSpan();
440 std::cout << "V=" << values << "\n";
442 {
443 0, 253, 27, 280, 54, 307, 1, 254, 28, 281, 55, 308, 2, 255, 29,
444 282, 56, 309, 3, 256, 30, 283, 57, 310, 4, 257, 31, 284, 58, 311
445 };
446 ASSERT_EQ(values.smallView(),ref_value.view());
447}
448
449TEST(NumArray3, Layout)
450{
451 std::cout << "TEST_NUMARRAY3 Layout\n";
452
453 {
455 std::cout << "TEST_NUMARRAY3 RightLayout 1\n";
456 _checkRightLayoutDim3(a);
457 }
458 {
460 std::cout << "TEST_NUMARRAY3 RightLayout 2\n";
461 _checkRightLayoutDim3(a);
462 }
463 {
465 std::cout << "TEST_NUMARRAY3 RightLayout 3\n";
466 _checkRightLayoutDim3(a);
467 }
468 {
470 std::cout << "TEST_NUMARRAY3 RightLayout 4\n";
471 _checkRightLayoutDim3(a);
472 }
473 {
475 std::cout << "TEST_NUMARRAY3 RightLayout 5\n";
476 _checkRightLayoutDim3(a);
477 }
478
479 {
481 std::cout << "TEST_NUMARRAY3 LeftLayout 1\n";
482 _checkLeftLayoutDim3(a);
483 }
484 {
486 std::cout << "TEST_NUMARRAY3 LeftLayout 2\n";
487 _checkLeftLayoutDim3(a);
488 }
489 {
491 std::cout << "TEST_NUMARRAY3 LeftLayout 3\n";
492 _checkLeftLayoutDim3(a);
493 }
494 {
496 std::cout << "TEST_NUMARRAY3 LeftLayout 4\n";
497 _checkLeftLayoutDim3(a);
498 }
499 {
501 std::cout << "TEST_NUMARRAY3 LeftLayout 5\n";
502 _checkLeftLayoutDim3(a);
503 }
504}
505
506/*---------------------------------------------------------------------------*/
507/*---------------------------------------------------------------------------*/
508
509TEST(NumArray,RealN)
510{
511 {
513 a(2) = Real2(0.0,3.2);
514 a(3)(1) = 2.0;
515 ASSERT_EQ(a(3).y,2.0);
516 }
517
518 {
520 const Real3 v(0.0,3.2,5.6);
521 a(0) = v;
522 a(4)(1) = 4.0;
523 ASSERT_EQ(a(4).y,4.0);
524 ASSERT_EQ(a(0),v);
525 }
526
527 {
529 const Real2 v0(1.2,1.7);
530 const Real2x2 v(Real2(3.2,5.6), Real2(3.4,1.7));
531 a(0) = v;
532 a(3)(1,0) = v0.x;
533 a(3)(1,1) = v0.y;
534 a(4)(1,0) = 4.0;
535 ASSERT_EQ(a(4).y.x,4.0);
536 ASSERT_EQ(a(0),v);
537 ASSERT_EQ(a(3)(1),v0);
538 }
539
540 {
542 const Real3 v0(1.2,3.4,1.7);
543 const Real3x3 v(Real3(0.0,3.2,5.6), Real3(1.2,3.4,1.7), Real3(9.2,1.4,5.0));
544 a(0) = v;
545 a(3)(1)(0) = v0.x;
546 a(3)(1)(1) = v0.y;
547 a(3)(1)(2) = v0.z;
548 a(4)(1)(2) = 4.0;
549 ASSERT_EQ(a(4).y.z,4.0);
550 ASSERT_EQ(a(0),v);
551 ASSERT_EQ(a(3)(1),v0);
552 }
553}
554
555/*---------------------------------------------------------------------------*/
556/*---------------------------------------------------------------------------*/
557
559{
560 {
561 const char* values1_str = "1 3 -2 \n -7 -5 12 \n 3 9 11\n";
562 NumArray<Int32, MDDim1> ref_value(9, { 1, 3, -2, -7, -5, 12, 3, 9, 11 });
563 std::istringstream istr1(values1_str);
566 ASSERT_EQ(int32_values.extent0(), 9);
567 ASSERT_EQ(int32_values.to1DSpan(), ref_value.to1DSpan());
568 }
569 {
570 const char* values1_str = "1.1 3.3 -2.5 \n \n 2.1 4.99 12.23 \n 23 \n 45.1 11.9e2 -12.6e4\n";
571 NumArray<Real, MDDim1> ref_value(10, { 1.1, 3.3, -2.5, 2.1, 4.99, 12.23, 23, 45.1, 11.9e2, -12.6e4 });
572 std::istringstream istr1(values1_str);
575 ASSERT_EQ(real_values.extent0(), 10);
576 ASSERT_EQ(real_values.to1DSpan(), ref_value.to1DSpan());
577 }
578}
579namespace TestCopyNumArray
580{
581using Real = double;
582
587
588auto bar()
589{
591 tpq.fill(1.526);
592 auto const& w = tpq;
593 std::cout << w.to1DSpan() << "\n";
594 B b{ w };
595 std::cout << b.a_.to1DSpan() << "\n";
596 return b;
597}
598
599auto bar2()
600{
602 tpq.fill(1.526);
603 std::cout << tpq.to1DSpan() << "\n";
604 return tpq;
605}
606
607} // namespace TestCopyNumArray
608
609TEST(NumArray, TestCopy)
610{
611 using namespace TestCopyNumArray;
612
613 auto test4 = bar();
614 std::cout << "Val 4 = "
615 << &test4.a_
616 << " " << test4.a_.to1DSpan() << "\n";
617 auto test5 = bar2();
618 std::cout << "Val 5 = " << &test5 << " " << test5.to1DSpan() << "\n";
619 ASSERT_EQ(test4.a_.to1DSpan(), test5.to1DSpan());
620}
621
622/*---------------------------------------------------------------------------*/
623/*---------------------------------------------------------------------------*/
624
625TEST(NumArray, SpanUsage)
626{
627 std::cout << "Test_SpanUsage";
628 UniqueArray<Int32> ua1 = { 0, 1, 2, 3, 4, 253, 254, 255, 256, 25 };
631 SmallSpan<Int32> span_ua1 = ua1.smallSpan();
632 a1.copy(span_ua1);
633 ASSERT_EQ(span_ua1, a1.to1DSmallSpan());
634
635 a1.fill(3);
636 a1.copy(span_ua1, nullptr);
637 ASSERT_EQ(span_ua1, a1.to1DSmallSpan());
638
640 ASSERT_EQ(span_ua1, md_a1.to1DSmallSpan());
641
643 ASSERT_EQ(const_span_ua1, md_a2.to1DSmallSpan());
644
646 ASSERT_EQ(span_ua1, md_a3.to1DSmallSpan());
647
648 md_a3 = a1.to1DSmallSpan();
649 ASSERT_EQ(a1.to1DSmallSpan(), md_a3.to1DSmallSpan());
650}
651
652/*---------------------------------------------------------------------------*/
653/*---------------------------------------------------------------------------*/
654
655namespace Arcane
656{
657// On instantie explicitement pour tester que toutes les méthodes templates sont valides
661
665
666template class NumArray<float,MDDim1>;
667
673
677
681
682template class MDSpan<float,MDDim1>;
683
689}
690
691/*---------------------------------------------------------------------------*/
692/*---------------------------------------------------------------------------*/
#define ASSERT_TRUE(condition)
Vérifie que condition est vrai.
Definition Assertion.h:126
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition Lima.cc:149
Tableaux multi-dimensionnels pour les types numériques accessibles sur accélérateurs.
Classe gérant un vecteur de réel de dimension 2.
Definition Real2.h:121
Classe gérant une matrice de réel de dimension 2x2.
Definition Real2x2.h:53
Classe gérant un vecteur de réel de dimension 3.
Definition Real3.h:132
Classe gérant une matrice de réel de dimension 3x3.
Definition Real3x3.h:66
void readFromText(NumArray< double, MDDim1 > &v, std::istream &input)
Remplit v avec les valeurs de input.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-