Changeset 3596


Ignore:
Timestamp:
Jan 21, 2017, 3:25:27 PM (5 years ago)
Author:
Peter
Message:

move constructor and assignment in MatrixWeighted?. Remove declaration of assignment operator (not implemented), and add doxygen since tags. refs #878

Location:
trunk/yat
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/omic/BamRead.h

    r3583 r3596  
    7070    /**
    7171       \brief move constructor
     72
     73       \since new in yat 0.15
    7274     */
    7375    BamRead(BamRead&& other);
     
    8789    /**
    8890       \brief move assignment operator
     91
     92       \since new in yat 0.15
    8993     */
    9094    BamRead& operator=(BamRead&& rhs);
  • trunk/yat/utility/Matrix.h

    r3585 r3596  
    146146    /**
    147147       \brief The move constructor.
     148
     149       \since new in yat 0.15
    148150    */
    149151    Matrix(Matrix&&);
     
    445447    /**
    446448       \brief Move assignment operator
     449
     450       \since new in yat 0.15
    447451     */
    448452    Matrix& operator=(Matrix&& other);
  • trunk/yat/utility/MatrixWeighted.cc

    r2992 r3596  
    3636#include <cassert>
    3737#include <sstream>
     38#include <utility>
    3839#include <vector>
    3940
     
    5960
    6061
     62#ifdef YAT_HAVE_RVALUE
     63  MatrixWeighted::MatrixWeighted(MatrixWeighted&& other)
     64    : vec_(std::move(other.vec_)), columns_(other.columns_)
     65  {}
     66#endif
     67
     68
    6169  MatrixWeighted::MatrixWeighted(const Matrix& data)
    6270  {
     
    6472  }
    6573
    66  
     74
    6775  MatrixWeighted::MatrixWeighted(std::istream& is, char sep)
    6876  {
     
    224232
    225233
     234#ifdef YAT_HAVE_RVALUE
     235  MatrixWeighted& MatrixWeighted::operator=(MatrixWeighted&& other)
     236  {
     237    MatrixWeighted tmp(std::move(other));
     238    swap(tmp);
     239    return *this;
     240  }
     241#endif
     242
     243
    226244  DataWeight& MatrixWeighted::operator()(size_t row, size_t column)
    227245  {
  • trunk/yat/utility/MatrixWeighted.h

    r2992 r3596  
    2626*/
    2727
     28#include "config_public.h"
     29
    2830#include "DataWeight.h"
    2931#include "StrideIterator.h"
     
    9395    /**
    9496       @brief The default constructor.
    95    
     97
    9698       Creates a zero size MatrixWeighted
    9799    */
     
    115117    MatrixWeighted(const MatrixWeighted&);
    116118
    117    
     119
     120#ifdef YAT_HAVE_RVALUE
     121    /**
     122       \brief The move copy constructor.
     123
     124       \since new in yat 0.15
     125    */
     126    MatrixWeighted(MatrixWeighted&&);
     127#endif
     128
     129
    118130    /**
    119131       \brief Constructor.
     
    258270
    259271
    260     /**
    261        \brief The assignment operator.
    262 
    263        \return A const reference to the resulting Matrix.
    264     */
    265     const MatrixWeighted& operator=(const MatrixWeighted& other);
     272#ifdef YAT_HAVE_RVALUE
     273    /**
     274       \brief The move assignment operator.
     275
     276       \return A reference to the resulting Matrix.
     277
     278       \since new in yat 0.15
     279    */
     280    MatrixWeighted& operator=(MatrixWeighted&& other);
     281#endif
    266282
    267283  private:
  • trunk/yat/utility/Vector.h

    r3589 r3596  
    8484    /**
    8585       \brief The move constructor.
     86
     87       \since new in yat 0.15
    8688    */
    8789    Vector(Vector&& other);
     
    151153
    152154       \return A reference to the resulting Vector.
     155
     156       \since new in yat 0.15
    153157    */
    154158    Vector& operator=(Vector&&);
Note: See TracChangeset for help on using the changeset viewer.