Changeset 894 in Sophya for trunk/SophyaLib/TArray/utilarr.h


Ignore:
Timestamp:
Apr 12, 2000, 7:42:33 PM (25 years ago)
Author:
ansari
Message:

documentation cmv 12/4/00

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/TArray/utilarr.h

    r850 r894  
    1313/* Quelques utilitaires pour les tableaux (Array) */             
    1414
     15//! define a function of double which returns a double
    1516typedef double (* Arr_DoubleFunctionOfX) (double x);
     17//! define a function of float which returns a float
    1618typedef float  (* Arr_FloatFunctionOfX)  (float x);
    1719
     20//////////////////////////////////////////////////////////
     21//! Class to generate a random sequence of values
    1822class RandomSequence {
    1923public:
    20   enum { Gaussian = 0, Flat = 1 };
     24  //! to define the generator type
     25  enum {
     26    Gaussian = 0, //!< gaussian generator
     27    Flat = 1      //!< Flat generator
     28    };
     29
    2130  RandomSequence(int typ = RandomSequence::Gaussian, double m=0., double s=1.);
    2231  double Rand();
    2332protected:
    24   int typ_;
    25   double mean_, sig_;
     33  int typ_;            //!< random generation type
     34  double mean_, sig_;  //!< generation parameters mean and sigma (if needed)
    2635};
    2736
    2837
     38//////////////////////////////////////////////////////////
     39//! Class to generate a sequence of values
    2940class Sequence {
    3041public:
    3142  explicit Sequence (double start=0., double step=1., Arr_DoubleFunctionOfX f=NULL);
    3243  explicit Sequence (RandomSequence rseq);
     44
     45  //! return start value of the sequence
    3346  inline double & Start() { return start_; }
     47  //! return step value of the sequence
    3448  inline double & Step() { return step_; }
    3549  double operator () (uint_4 k);
    3650protected:
    37   double start_, step_;
    38   Arr_DoubleFunctionOfX myf_;
    39   bool fgrseq_;
    40   RandomSequence rseq_;
     51  double start_;              //!< start value of the sequence
     52  double step_;               //!< step value of the sequence
     53  Arr_DoubleFunctionOfX myf_; //!< pointer to the sequence function
     54  bool fgrseq_;               //!< true if RandomSequence is used
     55  RandomSequence rseq_;       //!< RandomSequence
    4156};
    4257
     58//////////////////////////////////////////////////////////
     59//! Class to define a range of indexes
    4360class Range {
    4461public:
    4562  explicit Range(uint_4 start=0, uint_4 end=0, uint_4 size=1, uint_4 step=1);
     63  //! Return the start index
    4664  inline uint_4 & Start()  {  return start_; }
     65  //! Return the last index
    4766  inline uint_4 & End()    {  return end_; }
     67  //! Return the size
    4868  inline uint_4 & Size()   {  return size_; }
     69  //! Return the step
    4970  inline uint_4 & Step()   {  return step_; }
    5071protected:
    51   uint_4 start_, end_, size_, step_ ;
     72  uint_4 start_; //!< start index
     73  uint_4 end_;   //!< end index
     74  uint_4 size_;  //!< size
     75  uint_4 step_;  //!< step
    5276};
    5377
     78//////////////////////////////////////////////////////////
     79//! Class to define an identity matrix
    5480class IdentityMatrix {
    5581public:
    5682  explicit IdentityMatrix(double diag=1., uint_4 n=0);
     83  //! return the size of the identity matrix
    5784  inline uint_4 Size() { return size_; }
     85  //! return the value of the diagonal elements
    5886  inline double Diag() { return diag_; }
    5987protected:
    60   uint_4 size_;
    61   double diag_;
     88  uint_4 size_; //!< size of the matrix
     89  double diag_; //!< value of the diagonal elements
    6290};
    6391
     
    6593
    6694#endif
    67 
Note: See TracChangeset for help on using the changeset viewer.