Changeset 1058


Ignore:
Timestamp:
Feb 8, 2008, 10:26:06 PM (16 years ago)
Author:
Peter
Message:

some dox on vector - refs #256

File:
1 edited

Legend:

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

    r1036 r1058  
    4848     @brief This is the yat interface to GSL vector.
    4949
    50      For time being 'double' is the only type supported.
    51 
    5250     \par File streams:
    5351     Reading and writing vectors to file streams are of course
     
    5553     and thus binary read and write to streams are not supported.
    5654
    57      \par Vector views:
    58      GSL vector views are supported and these are disguised as
    59      ordinary utility::vectors. A support function is added,
    60      utility::vector::isview(), that can be used to check if a vector
    61      object is a view. Note that view vectors do not own the
    62      underlying data, and a view is not valid if the vector/matrix
    63      owing the data is deallocated.
     55     \par Vector views: GSL vector views are supported in classes
     56     VectorView and VectorConstView
    6457
    65      \par
    66      Currently there is no restriction on how a vector is used when
    67      the vector is a const view into another vector or matrix. To
    68      avoid unexpected runtime errors, the programmer must declare
    69      const view vectors as 'const' in order to get compile time
    70      diagnostics about improper use of a const view vector object. If
    71      'const' is not used and the const view vector is used erroneously
    72      (such as on the left hand side in assignments), the compiler will
    73      not catch the error and runtime error will occur. assert(3) is
    74      used to catch the runtime error during development. Example on
    75      bad and proper use of const view vectors:
    76      @code
    77   const vector vm(13,1.0);
    78   vector v1(vm,2,4);       // bad code! not const!
    79   v1(0)=-123;              // accepted by compiler, runtime abort will occur
    80                            // or catched by assert depending on compiler flags
    81   const vector v2(vm,2,4); // proper code
    82   v2(0)=-123;              // not acceptable for the compiler
    83      @endcode
    8458  */
    8559
     
    8761  {
    8862  public:
    89 
    9063    /**
    9164       \brief The default constructor.
     
    10477       \brief The copy constructor.
    10578
    106        \note If the object to be copied is a vector view, the values
    107        of the view will be copied, i.e. the view is not copied.
    108 
    10979       \throw A GSL_error is indirectly thrown if memory allocation
    11080       fails.
     
    11383
    11484    /**
    115        \brief The copy constructor.
    116 
    117        \note If the object to be copied is a vector view, the values
    118        of the view will be copied, i.e. the view is not copied.
     85       \brief Copy a VectorBase.
    11986
    12087       \throw A GSL_error is indirectly thrown if memory allocation
     
    158125  private:
    159126    const vector& assign(const VectorBase& other);
    160     //const VectorBase& assign(VectorBase& other);
    161127
    162128    /**
Note: See TracChangeset for help on using the changeset viewer.