Changeset 2687


Ignore:
Timestamp:
Feb 27, 2012, 12:49:01 PM (11 years ago)
Author:
Peter
Message:

remove stray whitespace

Location:
trunk/yat/utility
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/utility/Vector.cc

    r2384 r2687  
    104104      ss << "\nVector(std::istream&) data file error:\n"
    105105         << "    File has inconsistent number of rows (" << nof_rows
    106          << ") and columns (" << nof_columns 
     106         << ") and columns (" << nof_columns
    107107         << ").\n    Expected a row or column Vector.";
    108108      throw IO_error(ss.str());
     
    117117    // abort the program.
    118118    for (size_t i=0; i<nof_rows; i++)
    119       for (size_t j=0; j<nof_columns; j++) 
     119      for (size_t j=0; j<nof_columns; j++)
    120120        gsl_vector_set( vec_, n++, data_matrix[i][j] );
    121121    const_vec_ = vec_;
     
    138138      return *this;
    139139    }
    140     // indirect self assignment if begin <= other.begin() < end 
     140    // indirect self assignment if begin <= other.begin() < end
    141141    if (begin() <= other.begin() && other.begin()<end()) {
    142142      if (size() != other.size()) {
     
    146146      }
    147147      return *this;
    148     } 
     148    }
    149149    if (size()==other.size()){
    150150      if (gsl_vector_memcpy(vec_, other.gsl_vector_p()))
     
    157157    const_vec_ = vec_;
    158158    return *this;
    159   } 
     159  }
    160160
    161161
     
    184184
    185185
    186   void Vector::delete_allocated_memory(void) 
     186  void Vector::delete_allocated_memory(void)
    187187  {
    188188    if (vec_)
     
    222222  {
    223223    return assign(other);
    224   } 
     224  }
    225225
    226226
  • trunk/yat/utility/Vector.h

    r2119 r2687  
    4545
    4646  /**
    47      @brief This is the yat interface to GSL vector. 
     47     @brief This is the yat interface to GSL vector.
    4848
    4949     \par File streams:
     
    6868       \brief Allocates memory space for \a n elements, and sets all
    6969       elements to \a init_value.
    70        
     70
    7171       \throw GSL_error if memory allocation fails.
    7272    */
     
    112112       \return false
    113113    */
    114     bool isview(void) const; 
     114    bool isview(void) const;
    115115
    116116    /**
  • trunk/yat/utility/VectorBase.cc

    r2660 r2687  
    176176    if (status) {
    177177      gsl_permutation_free(p);
    178       throw utility::GSL_error(std::string("sort_index(vector&,const VectorBase&)",status));     
     178      throw utility::GSL_error(std::string("sort_index(vector&,const VectorBase&)",status));
    179179    }
    180180    std::vector<size_t> tmp(p->data,p->data+p->size);
     
    184184
    185185
    186   void sort_smallest_index(std::vector<size_t>& sort_index, size_t k, 
     186  void sort_smallest_index(std::vector<size_t>& sort_index, size_t k,
    187187                            const VectorBase& invec)
    188188  {
     
    192192    gsl_sort_vector_smallest_index(&sort_index[0],k,invec.gsl_vector_p());
    193193  }
    194  
    195   void sort_largest_index(std::vector<size_t>& sort_index, size_t k, 
     194
     195  void sort_largest_index(std::vector<size_t>& sort_index, size_t k,
    196196                            const VectorBase& invec)
    197197  {
  • trunk/yat/utility/VectorBase.h

    r2119 r2687  
    4040namespace yat {
    4141namespace utility {
    42  
     42
    4343  class matrix;
    4444  class Vector;
    4545
    4646  /**
    47      @brief This is the yat interface to GSL vector. 
     47     @brief This is the yat interface to GSL vector.
    4848
    4949     This is an interface class for vectors containing the const
     
    109109       Check if the vector object is a view (sub-vector) to another
    110110       vector.
    111    
     111
    112112       \return True if the object is a view, false othwerwise.
    113113     */
    114     virtual bool isview(void) const=0; 
     114    virtual bool isview(void) const=0;
    115115
    116116    /**
     
    243243     have been stored in that position if the VectorBase had been sorted
    244244     in place. The first element of \a sort_index gives the index of the least
    245      element in \a invec, and the last element of \a sort_index gives the 
    246      index of the greatest element in \a invec . The VectorBase \a invec 
     245     element in \a invec, and the last element of \a sort_index gives the
     246     index of the greatest element in \a invec . The VectorBase \a invec
    247247     is not changed.
    248248
     
    251251  void sort_index(std::vector<size_t>& sort_index, const VectorBase& invec);
    252252
    253   /** 
     253  /**
    254254      Similar to sort_index but creates a VectorBase with indices to
    255255      the \a k smallest elements in \a invec.
     
    257257     \relatesalso VectorBase
    258258  */
    259   void sort_smallest_index(std::vector<size_t>& sort_index, size_t k, 
     259  void sort_smallest_index(std::vector<size_t>& sort_index, size_t k,
    260260                           const VectorBase& invec);
    261261
    262   /** 
     262  /**
    263263      Similar to sort_index but creates a VectorBase with indices to
    264264      the \a k largest elements in \a invec.
     
    266266     \relatesalso VectorBase
    267267  */
    268   void sort_largest_index(std::vector<size_t>& sort_index, size_t k, 
     268  void sort_largest_index(std::vector<size_t>& sort_index, size_t k,
    269269                          const VectorBase& invec);
    270270
     
    285285     you, for example, want to print the VectorBase \a v with the
    286286     elements separated by a ':', you do so by:
    287      \verbatim 
    288      s << setfill(':') << v; 
     287     \verbatim
     288     s << setfill(':') << v;
    289289     \endverbatim
    290290
  • trunk/yat/utility/VectorConstView.cc

    r2119 r2687  
    5151  {
    5252    const_view_ = new gsl_vector_const_view(
    53                    gsl_vector_const_subvector_with_stride(v.gsl_vector_p(), 
     53                   gsl_vector_const_subvector_with_stride(v.gsl_vector_p(),
    5454                                                          offset, stride,n));
    5555    const_vec_ = &(const_view_->vector);
     
    6060    : VectorBase(), const_view_(NULL)
    6161  {
    62     const_view_ = 
    63       new gsl_vector_const_view(row ? 
     62    const_view_ =
     63      new gsl_vector_const_view(row ?
    6464                                gsl_matrix_const_row(m.gsl_matrix_p(),i) :
    6565                                gsl_matrix_const_column(m.gsl_matrix_p(),i));
     
    7676  void VectorConstView::copy(const VectorBase& other)
    7777  {
    78     const_view_ = 
    79       new gsl_vector_const_view(gsl_vector_const_subvector(other.gsl_vector_p(), 
     78    const_view_ =
     79      new gsl_vector_const_view(gsl_vector_const_subvector(other.gsl_vector_p(),
    8080                                                           0, other.size()));
    8181    const_vec_ = &(const_view_->vector);
  • trunk/yat/utility/VectorConstView.h

    r2119 r2687  
    4040
    4141  /**
    42      @brief Read-only view. 
     42     @brief Read-only view.
    4343
    44      Wrapper to gsl_vector_const_view 
     44     Wrapper to gsl_vector_const_view
    4545
    4646     With this class you can create a view into const
    4747     objects - either a vector or matrix. By design all functionality
    4848     in this class is const to guarantee that the viewed object is not
    49      modified. 
     49     modified.
    5050
    5151     \note that view vectors do not own the underlying data,
     
    6464    /**
    6565       \brief Copy a VectorBase
    66     */ 
     66    */
    6767    explicit VectorConstView(const VectorBase& other);
    6868
     
    8383    /**
    8484       \brief Matrix row/column view constructor.
    85        
    86        Create a view into a row/column of a matrix. 
     85
     86       Create a view into a row/column of a matrix.
    8787
    8888       \param m matrix to view into.
     
    109109       \return true
    110110    */
    111     bool isview(void) const; 
     111    bool isview(void) const;
    112112
    113113  private:
     
    119119    // because this pointer may be NULL.
    120120    gsl_vector_const_view* const_view_;
    121    
     121
    122122    // assignment not allowed
    123123    VectorConstView& operator=(const VectorConstView&);
  • trunk/yat/utility/VectorMutable.cc

    r2384 r2687  
    9191  {
    9292    if (vec_)
    93       return iterator(&(this->operator()(0))+vec_->stride*size(), 
     93      return iterator(&(this->operator()(0))+vec_->stride*size(),
    9494                            const_vec_->stride);
    9595    return iterator(NULL, 1);
  • trunk/yat/utility/VectorMutable.h

    r2121 r2687  
    3131#include "StrideIterator.h"
    3232
     33#include <gsl/gsl_vector.h>
     34
    3335#include <cstddef> // size_t
    34 
    35 #include <gsl/gsl_vector.h>
    3636
    3737namespace theplu {
     
    4343
    4444  /**
    45      @brief This is the mutable interface to GSL vector. 
     45     @brief This is the mutable interface to GSL vector.
    4646
    4747     This class contains the mutable interface to vector classes.
     
    126126       Check if the vector object is a view (sub-vector) to another
    127127       vector.
    128    
     128
    129129       \return True if the object is a view, false othwerwise.
    130    
    131      */
    132     virtual bool isview(void) const=0; 
     130
     131     */
     132    virtual bool isview(void) const=0;
    133133
    134134    /**
     
    226226     Randomly shuffles the elements in VectorMutable \a invec
    227227  */
    228   void shuffle(VectorMutable& invec); 
     228  void shuffle(VectorMutable& invec);
    229229
    230230  /**
  • trunk/yat/utility/VectorView.cc

    r2119 r2687  
    4444    : VectorMutable()
    4545  {
    46     view_ = new gsl_vector_view(gsl_vector_subvector(other.gsl_vector_p(), 
     46    view_ = new gsl_vector_view(gsl_vector_subvector(other.gsl_vector_p(),
    4747                                                     0, other.size()));
    4848    const_vec_ = vec_ = &(view_->vector);
    49    
     49
    5050  }
    5151
     
    6161    : VectorMutable()
    6262  {
    63     view_ = 
    64       new gsl_vector_view(gsl_vector_subvector_with_stride(v.gsl_vector_p(), 
     63    view_ =
     64      new gsl_vector_view(gsl_vector_subvector_with_stride(v.gsl_vector_p(),
    6565                                                           offset, stride,n));
    6666    const_vec_ = vec_ = &(view_->vector);
     
    101101    const_vec_ = vec_;
    102102    return *this;
    103   } 
     103  }
    104104
    105105
     
    122122  }
    123123
    124  
     124
    125125  const VectorView& VectorView::operator=(const VectorBase& other )
    126126  {
     
    128128  }
    129129
    130  
     130
    131131  void VectorView::delete_allocated_memory(void)
    132132  {
  • trunk/yat/utility/VectorView.h

    r2119 r2687  
    4040
    4141  /**
    42      @brief This is the yat interface to gsl_vector_view. 
     42     @brief This is the yat interface to gsl_vector_view.
    4343
    4444     This class can be used to create a vector view into a Matrix or a
     
    4646     data, i.e., the Matrix or VectorMutable that is viewed into. For
    4747     that reason all constructors are taking non-const references to
    48      disallow mutable views into a const objects. 
     48     disallow mutable views into a const objects.
    4949
    5050     The fact that there is no copy constructor with const argument,
     
    9393       underlying data (Vector or Matrix) is deallocated VectorView is
    9494       invalid.
    95     */ 
     95    */
    9696    VectorView(VectorView& other);
    9797
     
    128128    /// A VectorView view can be used as any VectorMutable with the
    129129    /// difference that changes made to the view will also change the
    130     /// object that is viewed. 
     130    /// object that is viewed.
    131131    ///
    132132    /// @note If the object viewed by the view goes out of scope or is
     
    144144       \return true
    145145    */
    146     bool isview(void) const; 
     146    bool isview(void) const;
    147147
    148148    /**
     
    186186       proxy.
    187187     */
    188     struct proxy 
    189     { 
     188    struct proxy
     189    {
    190190      /// pointer to GSL vector keeping everything we need to create a
    191191      /// new VectorMutable from a proxy.
     
    200200
    201201    /**
    202        conversion operator to private proxy class. 
     202       conversion operator to private proxy class.
    203203     */
    204204    operator proxy();
Note: See TracChangeset for help on using the changeset viewer.