Commit 2c5546a4 authored by COULAUD Olivier's avatar COULAUD Olivier

Add reset method (Bug found with optidis)

parent fdbe3580
......@@ -286,8 +286,9 @@ struct list {
*/
template<class T>
struct exists {
static constexpr int value = find<T, Elts...>::value < size;
};
// Intel compiler requires the parentheses
static constexpr int value = (find<T, Elts...>::value) < size;
};
};
}}} // close namesspace inria::tcli::meta
......
......@@ -90,6 +90,7 @@ public:
/** Do nothing */
void resetToInitialState(){
}
template<typename CellClass, typename Multipole>
......
......@@ -50,7 +50,7 @@ public:
}
void reset() {
memset(this->exp, 0, sizeof(FReal) * NRHS * NVALS * VectorSize);
memset(this->exp, 0, sizeof(FReal) * N * NVALS * VectorSize);
}
FSize getSavedSize() const {
......@@ -95,7 +95,9 @@ public:
return VectorSize;
}
/** Make it like the begining */
///
/// Make it like the begining
///
void resetToInitialState(){
m_data.reset();
l_data.reset();
......
......@@ -55,6 +55,11 @@ public:
return VectorSize;
}
void reset(){
std::memset(this->exp, 0, sizeof(FReal) * N * NVALS * VectorSize);
std::memset(this->transformed_exp, 0,
sizeof(stdComplex<FReal>) * N * NVALS * TransformedVectorSize);
}
// to extend FAbstractSendable
template <class BufferWriterClass>
void serialize(BufferWriterClass& buffer) const{
......@@ -170,7 +175,13 @@ public:
FSize getSavedSizeDown() const {
return l_data.getSavedSize();
}
///
/// \brief reset To zero all multipole and local arrays
///
void resetToInitialState(){
l_data.reset() ;
m_data.reset();
}
template <class StreamClass>
friend StreamClass& operator<<(StreamClass& output, const FUnifCell<FReal,ORDER, NRHS, NLHS, NVALS>& cell){
output << "Multipole exp NRHS " << NRHS
......
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