Commit f12dc2f9 authored by BLANCHARD Pierre's avatar BLANCHARD Pierre
Browse files

Provided copy ctor for all Uniform M2L handlers.

parent 47126803
...@@ -211,6 +211,20 @@ public: ...@@ -211,6 +211,20 @@ public:
} }
/*
* Copy constructor
*/
FUnifM2LHandler(const FUnifM2LHandler& other)
: FC(other.FC), Dft(), opt_rc(other.opt_rc)
{
// init DFT
const int steps[dimfft] = {rc};
Dft.buildDFT(steps);
// copy node_diff
memcpy(node_diff,other.node_diff,sizeof(unsigned int)*nnodes*nnodes);
}
~FUnifM2LHandler() ~FUnifM2LHandler()
{ } { }
...@@ -350,8 +364,8 @@ public: ...@@ -350,8 +364,8 @@ public:
FUnifM2LHandler(const MatrixKernelClass *const MatrixKernel, const unsigned int inTreeHeight, const FReal inRootCellWidth) FUnifM2LHandler(const MatrixKernelClass *const MatrixKernel, const unsigned int inTreeHeight, const FReal inRootCellWidth)
: TreeHeight(inTreeHeight), : TreeHeight(inTreeHeight),
RootCellWidth(inRootCellWidth), RootCellWidth(inRootCellWidth),
opt_rc(rc/2+1), Dft(), opt_rc(rc/2+1)
Dft()
{ {
// init DFT // init DFT
const int steps[dimfft] = {rc}; const int steps[dimfft] = {rc};
...@@ -370,6 +384,25 @@ public: ...@@ -370,6 +384,25 @@ public:
} }
/*
* Copy constructor
*/
FUnifM2LHandler(const FUnifM2LHandler& other)
: FC(other.FC),
TreeHeight(other.TreeHeight),
RootCellWidth(other.RootCellWidth),
Dft(), opt_rc(other.opt_rc)
{
// init DFT
const int steps[dimfft] = {rc};
Dft.buildDFT(steps);
// copy node_diff
memcpy(node_diff,other.node_diff,sizeof(unsigned int)*nnodes*nnodes);
}
~FUnifM2LHandler() ~FUnifM2LHandler()
{ {
for (unsigned int l=0; l<TreeHeight; ++l) for (unsigned int l=0; l<TreeHeight; ++l)
......
...@@ -184,7 +184,7 @@ static void Compute(const MatrixKernelClass *const MatrixKernel, ...@@ -184,7 +184,7 @@ static void Compute(const MatrixKernelClass *const MatrixKernel,
template <int ORDER, class MatrixKernelClass, KERNEL_FUNCTION_TYPE TYPE> class FUnifTensorialM2LHandler; template <int ORDER, class MatrixKernelClass, KERNEL_FUNCTION_TYPE TYPE> class FUnifTensorialM2LHandler;
template <int ORDER, class MatrixKernelClass> template <int ORDER, class MatrixKernelClass>
class FUnifTensorialM2LHandler<ORDER,MatrixKernelClass,HOMOGENEOUS> : FNoCopyable class FUnifTensorialM2LHandler<ORDER,MatrixKernelClass,HOMOGENEOUS>
{ {
enum {order = ORDER, enum {order = ORDER,
nnodes = TensorTraits<ORDER>::nnodes, nnodes = TensorTraits<ORDER>::nnodes,
...@@ -239,6 +239,22 @@ public: ...@@ -239,6 +239,22 @@ public:
ComputeAndSet(MatrixKernel); ComputeAndSet(MatrixKernel);
} }
/*
* Copy constructor
*/
FUnifTensorialM2LHandler(const FUnifTensorialM2LHandler& other)
: FC(other.FC),
CellWidthExtension(other.CellWidthExtension),
Dft(), opt_rc(other.opt_rc)
{
// init DFT
const int steps[dimfft] = {rc};
Dft.buildDFT(steps);
// copy node_diff
memcpy(node_diff,other.node_diff,sizeof(unsigned int)*nnodes*nnodes);
}
~FUnifTensorialM2LHandler() ~FUnifTensorialM2LHandler()
{ {
for (unsigned int d=0; d<ncmp; ++d) for (unsigned int d=0; d<ncmp; ++d)
...@@ -358,7 +374,7 @@ public: ...@@ -358,7 +374,7 @@ public:
template <int ORDER, class MatrixKernelClass> template <int ORDER, class MatrixKernelClass>
class FUnifTensorialM2LHandler<ORDER,MatrixKernelClass,NON_HOMOGENEOUS> : FNoCopyable class FUnifTensorialM2LHandler<ORDER,MatrixKernelClass,NON_HOMOGENEOUS>
{ {
enum {order = ORDER, enum {order = ORDER,
nnodes = TensorTraits<ORDER>::nnodes, nnodes = TensorTraits<ORDER>::nnodes,
...@@ -422,6 +438,25 @@ public: ...@@ -422,6 +438,25 @@ public:
ComputeAndSet(MatrixKernel); ComputeAndSet(MatrixKernel);
} }
/*
* Copy constructor
*/
FUnifTensorialM2LHandler(const FUnifTensorialM2LHandler& other)
: FC(other.FC),
TreeHeight(other.TreeHeight),
RootCellWidth(other.RootCellWidth),
CellWidthExtension(other.CellWidthExtension),
Dft(), opt_rc(other.opt_rc)
{
// init DFT
const int steps[dimfft] = {rc};
Dft.buildDFT(steps);
// copy node_diff
memcpy(node_diff,other.node_diff,sizeof(unsigned int)*nnodes*nnodes);
}
~FUnifTensorialM2LHandler() ~FUnifTensorialM2LHandler()
{ {
for (unsigned int l=0; l<TreeHeight; ++l) for (unsigned int l=0; l<TreeHeight; ++l)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment