Ignore:
Timestamp:
Apr 27, 2012, 12:26:07 AM (13 years ago)
Author:
ansari
Message:

Petites ameliorations classes Units et PhysQty, documentation doxygen, ajout fichiers pqnumber.h et sunitpcst.h ds basetools.h, passage numero de version a 2.30, Reza 27/04/2012

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/BaseTools/pqnumber.cc

    r4056 r4062  
    1515   \code
    1616   // Create a PrimeNumbers object
     17   // Create a PrimeNumbers object
    1718   PrimeNumbers primes;
    18    // Print the first 15 primes ...
    19    for(size_t k=0; k<15; k++)
    20      cout << primes(k) << endl;
     19   // Print the prime numbers from rank 20 to 25 ...
     20   cout << " Primes[20...30]: " ;
     21   for(size_t k=19; k<30; k++) cout << primes(k) << "  ";
    2122   // Print all prime numbers less than some max values
    22    uint_8 pmax = 223;
    23    uint_8 p = primes.Next();
     23   uint_8 p = primes.Next();  uint_8 pmax = 223;
     24   cout << endl << " Primes < " << pmax << " : " << endl;
    2425   while (p<pmax) {
    25      cout << p << endl;
    26      p = primes.Next();
     26    cout << p << "  ";
     27    p = primes.Next();
    2728   }
     29   cout << endl;
     30   // Compute and print prime factor decomposition:
     31   uint_8 nombre=247890;
     32   vector<uint_8> pfac=primes.PrimeFactors(nombre, true);
     33   cout << " PrimeFactors[" << nombre << "]: ";
     34   for(size_t i=0; i<pfac.size(); i++) cout << pfac[i] << "   ";   
     35   cout << endl;
    2836   \endcode
    2937*/
     
    266274   
    267275   \code
    268    // Create rational numbers from integers
     276   // Create rational numbers from pairs of integers
    269277   QNumber q1(3,4), q2(5,6), q3(6,8);
    270278   // Operations and comparsion
     
    272280   cout << q1 << " + " << q2 << " = " << q4 << endl;
    273281   QNumber qa(q1), qb(q2);
    274    cout " Test qa==qb : -> " << qa << " ?== " << qb;
     282   cout << " Test qa==qb : -> " << qa << " ?== " << qb;
    275283   if (qa == qb)  cout << " -> true " << endl;
    276284   else cout << " -> false " << endl;
    277285   qb = q3;
    278    cout " Test qa==qb : -> " << qa << " ?== " << qb;
     286   cout << " Test qa==qb : -> " << qa << " ?== " << qb;
    279287   if (qa == qb)  cout << " -> true " << endl;
    280288   else cout << " -> false " << endl;
Note: See TracChangeset for help on using the changeset viewer.