Skip to content
Snippets Groups Projects
Commit 36d6a5fe authored by Christian Engwer's avatar Christian Engwer
Browse files

[amg] cleanup constructors/destructors of Amg::Hierarchy

parent ef0e3a0c
Branches
Tags
1 merge request!274Feature/amg memory management
......@@ -110,29 +110,10 @@ namespace Dune
*/
Hierarchy(const std::shared_ptr<MemberType> & first);
/**
* @brief Construct a new hierarchy.
* @param first The first element in the hierarchy.
* @todo remove in 2.6
*/
Hierarchy(MemberType& first) DUNE_DEPRECATED_MSG("Use the constructor taking a shared_ptr");
/**
* @brief Construct a new hierarchy.
* @param first Pointer to the first element in the hierarchy.
* @warning Hierarchy will be responsible for the memory
* management of the pointer.
* @todo remove in 2.6
*/
Hierarchy(MemberType* first) DUNE_DEPRECATED_MSG("Use the constructor taking a shared_ptr");
/**
* @brief Construct a new empty hierarchy.
*/
Hierarchy();
Hierarchy() = default;
/**
* @brief Copy constructor.
* @brief Copy constructor (deep copy!).
*/
Hierarchy(const Hierarchy& other);
/**
......@@ -292,9 +273,6 @@ namespace Dune
*/
std::size_t levels() const;
/** @brief Destructor. */
~Hierarchy();
private:
/** @brief fix memory management of the finest element in the hierarchy
......@@ -1241,14 +1219,9 @@ namespace Dune
return built_;
}
template<class T, class A>
Hierarchy<T,A>::Hierarchy()
: finest_(0), coarsest_(0), allocator_(), levels_(0)
{}
template<class T, class A>
Hierarchy<T,A>::Hierarchy(const std::shared_ptr<MemberType> & first)
: originalFinest_(first), allocator_()
: originalFinest_(first)
{
finest_ = std::allocate_shared<Element>(allocator_);
finest_->element_ = originalFinest_;
......@@ -1256,21 +1229,6 @@ namespace Dune
levels_ = 1;
}
template<class T, class A>
Hierarchy<T,A>::Hierarchy(MemberType& first)
: Hierarchy(stackobject_to_shared_ptr(first))
{}
#warning get rid of this constructor
template<class T, class A>
Hierarchy<T,A>::Hierarchy(MemberType* first)
: Hierarchy(std::shared_ptr<MemberType>(first))
{}
template<class T, class A>
Hierarchy<T,A>::~Hierarchy()
{}
//! \brief deep copy of a given hierarchy
#warning do we catually want to support this? This might be very expensive?!
template<class T, class A>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment