Skip to content

Commit

Permalink
Merge pull request #12 from ccecka/patches
Browse files Browse the repository at this point in the history
RValue Reference Templated Engine Constructors
  • Loading branch information
michael-lehn committed May 16, 2015
2 parents 7cc15e4 + 8cf6022 commit f818e94
Show file tree
Hide file tree
Showing 31 changed files with 175 additions and 31 deletions.
4 changes: 2 additions & 2 deletions cxxstd/type_traits.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef CXXSTD_STRING_H
#define CXXSTD_STRING_H 1
#ifndef CXXSTD_TYPE_TRAITS_H
#define CXXSTD_TYPE_TRAITS_H 1

#include <type_traits>

Expand Down
4 changes: 4 additions & 0 deletions flens/matrixtypes/general/impl/diagmatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ class DiagMatrix
template <typename RHS>
DiagMatrix(DiagMatrix<RHS> &rhs);

template <typename RHS,
class = typename RestrictTo<!IsSame<FS,RHS>::value, void>::Type>
DiagMatrix(DiagMatrix<RHS> &&rhs);

template <typename RHS>
DiagMatrix(const DenseVector<RHS> &rhs);

Expand Down
11 changes: 9 additions & 2 deletions flens/matrixtypes/general/impl/diagmatrix.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ DiagMatrix<FS>::DiagMatrix()

template <typename FS>
DiagMatrix<FS>::DiagMatrix(IndexType dim, IndexType firstIndex)
: engine_(dim, firstIndex)
: engine_(dim, firstIndex)
{
}

Expand All @@ -59,7 +59,7 @@ DiagMatrix<FS>::DiagMatrix(const Engine &engine)

template <typename FS>
DiagMatrix<FS>::DiagMatrix(const DiagMatrix &rhs)
: GeneralMatrix<DiagMatrix<FS> >(), engine_(rhs.engine())
: engine_(rhs.engine())
{
}

Expand All @@ -77,6 +77,13 @@ DiagMatrix<FS>::DiagMatrix(DiagMatrix<RHS> &rhs)
{
}

template <typename FS>
template <typename RHS, class>
DiagMatrix<FS>::DiagMatrix(DiagMatrix<RHS> &&rhs)
: engine_(rhs.engine())
{
}

template <typename FS>
template <typename RHS>
DiagMatrix<FS>::DiagMatrix(const Matrix<RHS> &rhs)
Expand Down
4 changes: 4 additions & 0 deletions flens/matrixtypes/general/impl/gbmatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ class GbMatrix
template <typename RHS>
GbMatrix(GbMatrix<RHS> &rhs);

template <typename RHS,
class = typename RestrictTo<!IsSame<FS,RHS>::value, void>::Type>
GbMatrix(GbMatrix<RHS> &&rhs);

template <typename RHS>
GbMatrix(const Matrix<RHS> &rhs);

Expand Down
10 changes: 8 additions & 2 deletions flens/matrixtypes/general/impl/gbmatrix.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ GbMatrix<FS>::GbMatrix(const Engine &engine)

template <typename FS>
GbMatrix<FS>::GbMatrix(const GbMatrix &rhs)
: GeneralMatrix<GbMatrix<FS> >(),
engine_(rhs.engine())
: engine_(rhs.engine())
{
}

Expand All @@ -84,6 +83,13 @@ GbMatrix<FS>::GbMatrix(GbMatrix<RHS> &rhs)
{
}

template <typename FS>
template <typename RHS, class>
GbMatrix<FS>::GbMatrix(GbMatrix<RHS> &&rhs)
: engine_(rhs.engine())
{
}

template <typename FS>
template <typename RHS>
GbMatrix<FS>::GbMatrix(const Matrix<RHS> &rhs)
Expand Down
4 changes: 4 additions & 0 deletions flens/matrixtypes/general/impl/gematrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ class GeMatrix
template <typename RHS>
GeMatrix(GeMatrix<RHS> &rhs);

template <typename RHS,
class = typename RestrictTo<!IsSame<FS,RHS>::value, void>::Type>
GeMatrix(GeMatrix<RHS> &&rhs);

template <typename RHS>
GeMatrix(const Matrix<RHS> &rhs);

Expand Down
9 changes: 8 additions & 1 deletion flens/matrixtypes/general/impl/gematrix.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ GeMatrix<FS>::GeMatrix(const Engine &engine)

template <typename FS>
GeMatrix<FS>::GeMatrix(const GeMatrix &rhs)
: GeneralMatrix<GeMatrix>(), engine_(rhs.engine_)
: engine_(rhs.engine_)
{
}

Expand All @@ -103,6 +103,13 @@ GeMatrix<FS>::GeMatrix(GeMatrix<RHS> &rhs)
{
}

template <typename FS>
template <typename RHS, class>
GeMatrix<FS>::GeMatrix(GeMatrix<RHS> &&rhs)
: engine_(rhs.engine())
{
}

template <typename FS>
template <typename RHS>
GeMatrix<FS>::GeMatrix(const Matrix<RHS> &rhs)
Expand Down
4 changes: 4 additions & 0 deletions flens/matrixtypes/general/impl/getinymatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ class GeTinyMatrix
template <typename RHS>
GeTinyMatrix(GeTinyMatrix<RHS> &rhs);

template <typename RHS,
class = typename RestrictTo<!IsSame<TFS,RHS>::value, void>::Type>
GeTinyMatrix(GeTinyMatrix<RHS> &&rhs);

template <typename RHS>
GeTinyMatrix(const Matrix<RHS> &rhs);

Expand Down
7 changes: 7 additions & 0 deletions flens/matrixtypes/general/impl/getinymatrix.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ GeTinyMatrix<TFS>::GeTinyMatrix(GeTinyMatrix<RHS> &rhs)
{
}

template <typename TFS>
template <typename RHS, class>
GeTinyMatrix<TFS>::GeTinyMatrix(GeTinyMatrix<RHS> &&rhs)
: engine_(rhs.engine)
{
}

template <typename TFS>
template <typename RHS>
GeTinyMatrix<TFS>::GeTinyMatrix(const Matrix<RHS> &rhs)
Expand Down
4 changes: 4 additions & 0 deletions flens/matrixtypes/hermitian/impl/hbmatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ class HbMatrix
template <typename RHS>
HbMatrix(HbMatrix<RHS> &rhs);

template <typename RHS,
class = typename RestrictTo<!IsSame<FS,RHS>::value, void>::Type>
HbMatrix(HbMatrix<RHS> &&rhs);

template <typename RHS>
HbMatrix(const Matrix<RHS> &rhs);

Expand Down
17 changes: 10 additions & 7 deletions flens/matrixtypes/hermitian/impl/hbmatrix.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -62,25 +62,28 @@ HbMatrix<FS>::HbMatrix(const Engine &engine, StorageUpLo upLo)

template <typename FS>
HbMatrix<FS>::HbMatrix(const HbMatrix &rhs)
: HermitianMatrix<HbMatrix<FS> >(),
engine_(rhs.engine()),
upLo_(rhs.upLo())
: engine_(rhs.engine()), upLo_(rhs.upLo())
{
}

template <typename FS>
template <typename RHS>
HbMatrix<FS>::HbMatrix(const HbMatrix<RHS> &rhs)
: engine_(rhs.engine()),
upLo_(rhs.upLo())
: engine_(rhs.engine()), upLo_(rhs.upLo())
{
}

template <typename FS>
template <typename RHS>
HbMatrix<FS>::HbMatrix(HbMatrix<RHS> &rhs)
: engine_(rhs.engine()),
upLo_(rhs.upLo())
: engine_(rhs.engine()), upLo_(rhs.upLo())
{
}

template <typename FS>
template <typename RHS, class>
HbMatrix<FS>::HbMatrix(HbMatrix<RHS> &&rhs)
: engine_(rhs.engine()), upLo_(rhs.upLo())
{
}

Expand Down
4 changes: 4 additions & 0 deletions flens/matrixtypes/hermitian/impl/hematrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ class HeMatrix
template <typename RHS>
HeMatrix(HeMatrix<RHS> &rhs);

template <typename RHS,
class = typename RestrictTo<!IsSame<FS,RHS>::value, void>::Type>
HeMatrix(HeMatrix<RHS> &&rhs);

template <typename RHS>
HeMatrix(const Matrix<RHS> &rhs);

Expand Down
10 changes: 8 additions & 2 deletions flens/matrixtypes/hermitian/impl/hematrix.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ HeMatrix<FS>::HeMatrix(const Engine &engine, StorageUpLo upLo)

template <typename FS>
HeMatrix<FS>::HeMatrix(const HeMatrix &rhs)
: HermitianMatrix<HeMatrix<FS> >(),
engine_(rhs.engine()), upLo_(rhs.upLo())
: engine_(rhs.engine()), upLo_(rhs.upLo())
{
}

Expand All @@ -97,6 +96,13 @@ HeMatrix<FS>::HeMatrix(HeMatrix<RHS> &rhs)
{
}

template <typename FS>
template <typename RHS, class>
HeMatrix<FS>::HeMatrix(HeMatrix<RHS> &&rhs)
: engine_(rhs.engine()), upLo_(rhs.upLo())
{
}

template <typename FS>
template <typename RHS>
HeMatrix<FS>::HeMatrix(const Matrix<RHS> &rhs)
Expand Down
4 changes: 4 additions & 0 deletions flens/matrixtypes/hermitian/impl/hpmatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ class HpMatrix
template <typename RHS>
HpMatrix(HpMatrix<RHS> &rhs);

template <typename RHS,
class = typename RestrictTo<!IsSame<PS,RHS>::value, void>::Type>
HpMatrix(HpMatrix<RHS> &&rhs);

template <typename RHS>
HpMatrix(const Matrix<RHS> &rhs);

Expand Down
10 changes: 8 additions & 2 deletions flens/matrixtypes/hermitian/impl/hpmatrix.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ HpMatrix<PS>::HpMatrix(const Engine &engine, StorageUpLo upLo)

template <typename PS>
HpMatrix<PS>::HpMatrix(const HpMatrix &rhs)
: HermitianMatrix<HpMatrix<PS> >(),
engine_(rhs.engine()), upLo_(rhs.upLo())
: engine_(rhs.engine()), upLo_(rhs.upLo())
{
}

Expand All @@ -78,6 +77,13 @@ HpMatrix<PS>::HpMatrix(HpMatrix<RHS> &rhs)
{
}

template <typename PS>
template <typename RHS, class>
HpMatrix<PS>::HpMatrix(HpMatrix<RHS> &&rhs)
: engine_(rhs.engine()), upLo_(rhs.upLo())
{
}

template <typename PS>
template <typename RHS>
HpMatrix<PS>::HpMatrix(const Matrix<RHS> &rhs)
Expand Down
4 changes: 4 additions & 0 deletions flens/matrixtypes/symmetric/impl/sbmatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ class SbMatrix
template <typename RHS>
SbMatrix(SbMatrix<RHS> &rhs);

template <typename RHS,
class = typename RestrictTo<!IsSame<FS,RHS>::value, void>::Type>
SbMatrix(SbMatrix<RHS> &&rhs);

// -- operators --------------------------------------------------------

SbMatrix &
Expand Down
9 changes: 8 additions & 1 deletion flens/matrixtypes/symmetric/impl/sbmatrix.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ SbMatrix<FS>::SbMatrix(const Engine &engine, StorageUpLo upLo)

template <typename FS>
SbMatrix<FS>::SbMatrix(const SbMatrix &rhs)
: SymmetricMatrix<SbMatrix<FS> >(), engine_(rhs.engine()), upLo_(rhs.upLo())
: engine_(rhs.engine()), upLo_(rhs.upLo())
{
}

Expand All @@ -83,6 +83,13 @@ SbMatrix<FS>::SbMatrix(SbMatrix<RHS> &rhs)
{
}

template <typename FS>
template <typename RHS, class>
SbMatrix<FS>::SbMatrix(SbMatrix<RHS> &&rhs)
: engine_(rhs.engine()), upLo_(rhs.upLo())
{
}

template <typename FS>
template <typename RHS>
SbMatrix<FS>::SbMatrix(const Matrix<RHS> &rhs)
Expand Down
4 changes: 4 additions & 0 deletions flens/matrixtypes/symmetric/impl/spmatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ class SpMatrix
template <typename RHS>
SpMatrix(SpMatrix<RHS> &rhs);

template <typename RHS,
class = typename RestrictTo<!IsSame<PS,RHS>::value, void>::Type>
SpMatrix(SpMatrix<RHS> &&rhs);

template <typename RHS>
SpMatrix(const Matrix<RHS> &rhs);

Expand Down
9 changes: 8 additions & 1 deletion flens/matrixtypes/symmetric/impl/spmatrix.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ SpMatrix<PS>::SpMatrix(const Engine &engine, StorageUpLo upLo)

template <typename PS>
SpMatrix<PS>::SpMatrix(const SpMatrix &rhs)
: SymmetricMatrix<SpMatrix<PS> >(), engine_(rhs.engine()), upLo_(rhs.upLo())
: engine_(rhs.engine()), upLo_(rhs.upLo())
{
}

Expand All @@ -74,6 +74,13 @@ SpMatrix<PS>::SpMatrix(SpMatrix<RHS> &rhs)
{
}

template <typename PS>
template <typename RHS, class>
SpMatrix<PS>::SpMatrix(SpMatrix<RHS> &&rhs)
: engine_(rhs.engine()), upLo_(rhs.upLo())
{
}

template <typename PS>
template <typename RHS>
SpMatrix<PS>::SpMatrix(const Matrix<RHS> &rhs)
Expand Down
4 changes: 4 additions & 0 deletions flens/matrixtypes/symmetric/impl/symatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ class SyMatrix
template <typename RHS>
SyMatrix(SyMatrix<RHS> &rhs);

template <typename RHS,
class = typename RestrictTo<!IsSame<FS,RHS>::value, void>::Type>
SyMatrix(SyMatrix<RHS> &&rhs);

template <typename RHS>
SyMatrix(const Matrix<RHS> &rhs);

Expand Down
10 changes: 8 additions & 2 deletions flens/matrixtypes/symmetric/impl/symatrix.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ SyMatrix<FS>::SyMatrix(const Engine &engine, StorageUpLo upLo)

template <typename FS>
SyMatrix<FS>::SyMatrix(const SyMatrix &rhs)
: SymmetricMatrix<SyMatrix<FS> >(),
engine_(rhs.engine()), upLo_(rhs.upLo())
: engine_(rhs.engine()), upLo_(rhs.upLo())
{
}

Expand All @@ -97,6 +96,13 @@ SyMatrix<FS>::SyMatrix(SyMatrix<RHS> &rhs)
{
}

template <typename FS>
template <typename RHS, class>
SyMatrix<FS>::SyMatrix(SyMatrix<RHS> &&rhs)
: engine_(rhs.engine()), upLo_(rhs.upLo())
{
}

template <typename FS>
template <typename RHS>
SyMatrix<FS>::SyMatrix(const Matrix<RHS> &rhs)
Expand Down
4 changes: 4 additions & 0 deletions flens/matrixtypes/triangular/impl/tbmatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ class TbMatrix
template <typename RHS>
TbMatrix(TbMatrix<RHS> &rhs);

template <typename RHS,
class = typename RestrictTo<!IsSame<FS,RHS>::value, void>::Type>
TbMatrix(TbMatrix<RHS> &&rhs);

template <typename RHS>
TbMatrix(const Matrix<RHS> &rhs);

Expand Down
10 changes: 8 additions & 2 deletions flens/matrixtypes/triangular/impl/tbmatrix.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ TbMatrix<FS>::TbMatrix(const Engine &engine, StorageUpLo upLo, Diag diag)

template <typename FS>
TbMatrix<FS>::TbMatrix(const TbMatrix &rhs)
: TriangularMatrix<TbMatrix<FS> >(),
engine_(rhs.engine()), upLo_(rhs.upLo()), diag_(rhs.diag())
: engine_(rhs.engine()), upLo_(rhs.upLo()), diag_(rhs.diag())
{
}

Expand All @@ -78,6 +77,13 @@ TbMatrix<FS>::TbMatrix(TbMatrix<RHS> &rhs)
{
}

template <typename FS>
template <typename RHS, class>
TbMatrix<FS>::TbMatrix(TbMatrix<RHS> &&rhs)
: engine_(rhs.engine()), upLo_(rhs.upLo()), diag_(rhs.diag())
{
}

template <typename FS>
template <typename RHS>
TbMatrix<FS>::TbMatrix(const Matrix<RHS> &rhs)
Expand Down
Loading

0 comments on commit f818e94

Please sign in to comment.