Mentions légales du service

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

Add MatButterfly copy ctor and assignment operator and implement the Clone member function.

parent c42a0e41
Branches
Tags
No related merge requests found
......@@ -48,6 +48,9 @@ namespace Faust
public:
MatButterfly<FPP,Cpu>(const MatSparse<FPP, Cpu> &factor, int level);
MatButterfly(const MatButterfly& src); // copy ctor
MatButterfly<FPP, Cpu>& operator=(const MatButterfly& src); // assignment operator
void init_transpose();
void Display() const;
......
......@@ -45,6 +45,28 @@ namespace Faust
this->level = level;
}
template<typename FPP>
MatButterfly<FPP, Cpu>::MatButterfly(const MatButterfly& src)
{
*this = src;
}
template<typename FPP>
MatButterfly<FPP, Cpu>& MatButterfly<FPP, Cpu>::operator=(const MatButterfly& src)
{
D1 = src.D1;
D2 = src.D2;
D2T = src.D2T;
subdiag_ids = src.subdiag_ids;
#ifdef USE_PYTHONIC
subdiag_ids_ptr = new long[src.getNbRow()];
copy(src.subdiag_ids_ptr, src.subdiag_ids_ptr + src.getNbRow(), subdiag_ids_ptr);
#endif
level = src.level;
return *this;
}
template<typename FPP>
void MatButterfly<FPP, Cpu>::Display() const
{
......@@ -93,8 +115,7 @@ namespace Faust
template<typename FPP>
MatGeneric<FPP,Cpu>* MatButterfly<FPP, Cpu>::Clone(const bool isOptimize) const
{
//TODO
return nullptr;
return new MatButterfly<FPP, Cpu>(*this);
}
template<typename FPP>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment