Changeset 1107 in Sophya


Ignore:
Timestamp:
Jul 27, 2000, 7:33:55 PM (25 years ago)
Author:
ansari
Message:

correction/modifs prog de test de TArray Reza+CMV 27/7/2000

Location:
trunk/SophyaProg/Tests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaProg/Tests/arrt.cc

    r1102 r1107  
    113113  cout << " ----- Vector va apres va(Range(0,6)) += 100. " << va << endl;
    114114
     115  TMatrix<r_4> esm(3,5);
     116  esm = (EnumeratedSequence(),
     117         11 , 12 , 13, 14, 15, 
     118         21 , 22 , 23, 24, 25
     119         );
     120  //         31 , 32 , 33, 34, 35 ) ; 
     121
     122  cout << "\n TMatrix<r_4> esm(3,5) = EnumeratedSequence(), 11 , 12 , 13, 14, 15 ... "
     123       << esm << endl;
     124
    115125  cout << "\n :::::: Testing Matrix operations :::::: " << endl;
    116126  TMatrix<r_4> ra(2,2), ira(2,2);
     
    123133  es, 2 , 1 , 4 , 3 ;
    124134  ra = es ;
    125  
    126135 
    127136  cout << " ----- Matrix ra = \n " << ra << endl;
  • trunk/SophyaProg/Tests/carrt.cc

    r1102 r1107  
    1313
    1414static int prtlev = 0;
    15 static int nprt = 0;
     15static int nprt = 100;
    1616
    1717template <class T>
     
    7272    cout << "\n -----> Testing TArray Conversion <---- " << endl;
    7373     TArray<int_4> ia(7,5);   
    74      ia = Sequence(10., 2.);
     74     ia = RegularSequence(10., 2.);
    7575     TArray<r_4> ra(7,5);   
    7676     ra = ia;
    77      cout << " ra = ia(= Sequence(10., 2.)) = \n " << ra << endl;
     77     cout << " ra = ia(= RegularSequence(10., 2.)) = \n " << ra << endl;
    7878     cout << ra << endl; 
    7979     TArray<r_4> rb(5,3);
    80      rb =  Sequence(20., .5); 
     80     rb =  RegularSequence(20., .5); 
    8181     TMatrix<int_4> mx(3,5);
    82      cout << " TArray<r_4> rb(5,3); rb =  Sequence(20., .5); rb : " << endl;
     82     cout << " TArray<r_4> rb(5,3); rb =  RegularSequence(20., .5); rb : " << endl;
    8383     cout << rb << endl;
    8484     mx = rb;
     
    132132  else cout << " OK   Test C = (A*4+1)/B  OK " << endl;
    133133 
     134  a = RegularSequence(1, 1);
     135  b = RegularSequence(nr*nc, -1);
     136  c = (a*2)+(b*2);
     137  if (prtlev > 0) {
     138    cout << " A = \n " << a << endl;
     139    cout << " B = \n " << b << endl;
     140    cout << " C = 2A-2*B= \n " << c << endl;
     141  }
     142  c /= (nr*nc+1);
     143  getMinMax(c, min, max);
     144  if ((min != 2) || (max != 2)) {
     145    cout << "!!! ERROR Test3 C=2A+2*B  Min=" << min << " Max=" << max << endl;
     146    rc += 1;
     147  }
     148  else cout << " OK   Test3 C=2A+2*B  OK " << endl;
     149 
    134150  return(rc);
    135151}
     
    172188  }
    173189  else cout << " OK   Test C = (A*4+12)/B  OK " << endl;
     190
     191  a = RegularSequence(1, 1);
     192  b = RegularSequence(nr*nc, -1);
     193  c = (a*2.f)+(b*2.f);
     194  if (prtlev > 0) {
     195    cout << " A = \n " << a << endl;
     196    cout << " B = \n " << b << endl;
     197    cout << " C = 2A-2*B= \n " << c << endl;
     198  }
     199  c /= (nr*nc+1);
     200  getMinMax(c, min, max);
     201  if ((fabs(min-2.) > 0.0001) || (fabs(max-2.) > 0.0001)) {
     202    cout << "!!! ERROR Test3 C=2A+2*B  Min=" << min << " Max=" << max << endl;
     203    rc += 1;
     204  }
     205  else cout << " OK   Test3 C=2A+2*B  OK " << endl;
     206
    174207  return(rc);
    175208
Note: See TracChangeset for help on using the changeset viewer.