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

some dox - refs #256

File:
1 edited

Legend:

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

    r1041 r1046  
    4343namespace yat {
    4444namespace utility {
    45 
     45 
    4646  class matrix;
    4747  class vector;
     
    5050     @brief This is the yat interface to GSL vector.
    5151
    52      For time being 'double' is the only type supported.
    53 
    54      \par File streams:
    55      Reading and writing vectors to file streams are of course
    56      supported. These are implemented without using GSL functionality,
    57      and thus binary read and write to streams are not supported.
    58 
    59      \par Vector views:
    60      GSL vector views are supported and these are disguised as
    61      ordinary utility::vectors. A support function is added,
    62      utility::vector::isview(), that can be used to check if a vector
    63      object is a view. Note that view vectors do not own the
    64      underlying data, and a view is not valid if the vector/matrix
    65      owing the data is deallocated.
    66 
    67      \par
    68      Currently there is no restriction on how a vector is used when
    69      the vector is a const view into another vector or matrix. To
    70      avoid unexpected runtime errors, the programmer must declare
    71      const view vectors as 'const' in order to get compile time
    72      diagnostics about improper use of a const view vector object. If
    73      'const' is not used and the const view vector is used erroneously
    74      (such as on the left hand side in assignments), the compiler will
    75      not catch the error and runtime error will occur. assert(3) is
    76      used to catch the runtime error during development. Example on
    77      bad and proper use of const view vectors:
    78      @code
    79   const vector vm(13,1.0);
    80   vector v1(vm,2,4);       // bad code! not const!
    81   v1(0)=-123;              // accepted by compiler, runtime abort will occur
    82                            // or catched by assert depending on compiler flags
    83   const vector v2(vm,2,4); // proper code
    84   v2(0)=-123;              // not acceptable for the compiler
    85      @endcode
    86   */
    87 
     52     This is an interface class for vectors containing the const
     53     interface. For mutable functionality see VectorMutable.
     54  */
    8855  class VectorBase
    8956  {
     
    12390    bool equal(const VectorBase&, const double precision=0) const;
    12491
    125     ///
    126     /// @return A const pointer to the internal GSL vector,
    127     ///
     92    /**
     93       \return A const pointer to the internal GSL vector,
     94    */
    12895    const gsl_vector* gsl_vector_p(void) const;
    12996
     
    136103    virtual bool isview(void) const=0;
    137104
    138     ///
    139     /// @return the number of elements in the VectorBase.
    140     ///
     105    /**
     106       \return number of elements in the VectorBase.
     107    */
    141108    size_t size(void) const;
    142109
     
    241208     valid and a zero means that the corresponding element is a NaN.
    242209
    243      \note Space for VectorBase \a flag is reallocated to fit the size of
     210     \note Space for vector \a flag is reallocated to fit the size of
    244211     VectorBase \a templat if sizes mismatch.
    245212
     
    261228
    262229  /**
    263       Similar to sort_index but creates a VectorBase with indices to the \a k
    264   smallest elements in \a invec. 
     230      Similar to sort_index but creates a VectorBase with indices to
     231      the \a k smallest elements in \a invec.
    265232  */
    266233  void sort_smallest_index(std::vector<size_t>& sort_index, size_t k,
     
    268235
    269236  /**
    270       Similar to sort_index but creates a VectorBase with indices to the \a k
    271   largest elements in \a invec. 
     237      Similar to sort_index but creates a VectorBase with indices to
     238      the \a k largest elements in \a invec.
    272239  */
    273240  void sort_largest_index(std::vector<size_t>& sort_index, size_t k,
Note: See TracChangeset for help on using the changeset viewer.