Mentions légales du service

Skip to content
Snippets Groups Projects
Commit fb12d463 authored by hhakim's avatar hhakim
Browse files

Add MatPerm default ctor.

parent 63f9a043
Branches
Tags
No related merge requests found
...@@ -50,6 +50,7 @@ namespace Faust ...@@ -50,6 +50,7 @@ namespace Faust
public: public:
MatPerm<FPP,Cpu>(const MatSparse<FPP, Cpu> &factor); MatPerm<FPP,Cpu>(const MatSparse<FPP, Cpu> &factor);
MatPerm(); // default ctor
MatPerm(const MatPerm& src); // copy ctor MatPerm(const MatPerm& src); // copy ctor
MatPerm<FPP, Cpu>& operator=(const MatPerm& src); // assignment operator MatPerm<FPP, Cpu>& operator=(const MatPerm& src); // assignment operator
......
...@@ -2,10 +2,19 @@ ...@@ -2,10 +2,19 @@
namespace Faust namespace Faust
{ {
//TODO: default ctor //TODO: dtor?
//
template<typename FPP>
MatPerm<FPP, Cpu>::MatPerm()
{
#ifdef USE_PYTHONIC
perm_ids_ptr = nullptr;
#endif
is_transp = false;
}
template<typename FPP> template<typename FPP>
MatPerm<FPP, Cpu>::MatPerm(const MatSparse<FPP, Cpu> &sp_mat) MatPerm<FPP, Cpu>::MatPerm(const MatSparse<FPP, Cpu> &sp_mat) : MatPerm()
{ {
//TODO: test sp_mat is a permutation matrix (at least nrows == ncols) //TODO: test sp_mat is a permutation matrix (at least nrows == ncols)
auto size = sp_mat.getNbRow(); auto size = sp_mat.getNbRow();
...@@ -18,11 +27,10 @@ namespace Faust ...@@ -18,11 +27,10 @@ namespace Faust
perm_ids.resize(size); perm_ids.resize(size);
copy(sp_mat.getColInd(), sp_mat.getColInd()+size, perm_ids.begin()); copy(sp_mat.getColInd(), sp_mat.getColInd()+size, perm_ids.begin());
this->is_transp = false;
} }
template<typename FPP> template<typename FPP>
MatPerm<FPP, Cpu>::MatPerm(const MatPerm& src) MatPerm<FPP, Cpu>::MatPerm(const MatPerm& src) : MatPerm()
{ {
*this = src; *this = src;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment