Ignore:
Timestamp:
Feb 7, 2008, 12:56:23 AM (13 years ago)
Author:
Peter
Message:

some dox - refs #256

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/utility/VectorMutable.h

    r1041 r1046  
    4949
    5050  /**
    51      @brief This is the yat interface to GSL vector.
    52 
    53      For time being 'double' is the only type supported.
    54 
    55      \par File streams:
    56      Reading and writing vectors to file streams are of course
    57      supported. These are implemented without using GSL functionality,
    58      and thus binary read and write to streams are not supported.
    59 
    60      \par Vector views:
    61      GSL vector views are supported and these are disguised as
    62      ordinary utility::vectors. A support function is added,
    63      utility::vector::isview(), that can be used to check if a vector
    64      object is a view. Note that view vectors do not own the
    65      underlying data, and a view is not valid if the vector/matrix
    66      owing the data is deallocated.
    67 
    68      \par
    69      Currently there is no restriction on how a vector is used when
    70      the vector is a const view into another vector or matrix. To
    71      avoid unexpected runtime errors, the programmer must declare
    72      const view vectors as 'const' in order to get compile time
    73      diagnostics about improper use of a const view vector object. If
    74      'const' is not used and the const view vector is used erroneously
    75      (such as on the left hand side in assignments), the compiler will
    76      not catch the error and runtime error will occur. assert(3) is
    77      used to catch the runtime error during development. Example on
    78      bad and proper use of const view vectors:
    79      @code
    80   const vector vm(13,1.0);
    81   vector v1(vm,2,4);       // bad code! not const!
    82   v1(0)=-123;              // accepted by compiler, runtime abort will occur
    83                            // or catched by assert depending on compiler flags
    84   const vector v2(vm,2,4); // proper code
    85   v2(0)=-123;              // not acceptable for the compiler
    86      @endcode
     51     @brief This is the mutable interface to GSL vector.
     52
     53     This class contains the mutable interface to vector classes.
     54
     55     The non-mutable interface is inherited from VectorBase. When
     56     dealing with const vectors, it is preferable to use the
     57     VectorBase signature because this allows usage of VectorConstView
     58     too.
    8759  */
    88 
    8960  class VectorMutable : public VectorBase
    9061  {
     
    11081    VectorMutable(const gsl_vector*);
    11182
    112     ///
    113     /// The destructor.
    114     ///
     83    /**
     84      The destructor.
     85    */
    11586    virtual ~VectorMutable(void);
    11687
    117     ///
    118     /// Set all elements to \a value.
    119     ///
     88    /**
     89      Set all elements to \a value.
     90    */
    12091    void all(double value);
    12192
     
    241212    gsl_vector* vec_;
    242213
    243     // Peter document
     214    /**
     215       Proxy class used to allow copy and assignment of VectorView. By
     216       design vectors and matrices are passed as non-const references
     217       in all constructors of VectorView. Because the standard does
     218       not allow temporary objects to be bound to non-const
     219       references, it is not possible to directly construct a
     220       VectorView from a temporary VectorView returned from a
     221       function. Instead this proxy class is created from the
     222       temporary object and then a VectorView can be created from thsi
     223       proxy.
     224
     225       \see VectorView
     226     */
    244227    struct proxy
    245228    {
     
    252235  public:
    253236    /**
     237       conversion operator to protected proxy class.
    254238     */
    255239    operator proxy();
     
    258242
    259243  /**
    260      Randomly shuffles the elements in VectorBase \a invec
     244     Randomly shuffles the elements in VectorMutable \a invec
    261245  */
    262246  void shuffle(VectorMutable& invec);
    263247
    264248  /**
    265      Sort the elements in the VectorBase.
     249     Sort the elements in the VectorMutable.
    266250  */
    267251  void sort(VectorMutable&);
Note: See TracChangeset for help on using the changeset viewer.