Skip to content
Snippets Groups Projects
Commit 6f8aa356 authored by Oliver Sander's avatar Oliver Sander Committed by sander@PCPOOL.MI.FU-BERLIN.DE
Browse files

use an auto_ptr for the hesse Matrix

[[Imported from SVN: r4103]]
parent b353c2a3
No related branches found
No related tags found
Loading
...@@ -115,10 +115,7 @@ setup(const GridType& grid, ...@@ -115,10 +115,7 @@ setup(const GridType& grid,
// Create Hessian matrix and its occupation structure // Create Hessian matrix and its occupation structure
// //////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////
if (hessianMatrix_) hessianMatrix_ = std::auto_ptr<MatrixType>(new MatrixType);
delete hessianMatrix_;
hessianMatrix_ = new MatrixType;
Dune::MatrixIndexSet indices(grid_->size(1), grid_->size(1)); Dune::MatrixIndexSet indices(grid_->size(1), grid_->size(1));
assembler_->getNeighborsPerVertex(indices); assembler_->getNeighborsPerVertex(indices);
indices.exportIdx(*hessianMatrix_); indices.exportIdx(*hessianMatrix_);
......
...@@ -38,7 +38,7 @@ public: ...@@ -38,7 +38,7 @@ public:
RiemannianTrustRegionSolver() RiemannianTrustRegionSolver()
: IterativeSolver<std::vector<TargetSpace>, Dune::BitSetVector<blocksize> >(0,100,NumProc::FULL), : IterativeSolver<std::vector<TargetSpace>, Dune::BitSetVector<blocksize> >(0,100,NumProc::FULL),
hessianMatrix_(NULL), h1SemiNorm_(NULL) hessianMatrix_(std::auto_ptr<MatrixType>(NULL)), h1SemiNorm_(NULL)
{} {}
void setup(const GridType& grid, void setup(const GridType& grid,
...@@ -100,7 +100,7 @@ protected: ...@@ -100,7 +100,7 @@ protected:
double qpTolerance_; double qpTolerance_;
/** \brief Hessian matrix */ /** \brief Hessian matrix */
MatrixType* hessianMatrix_; std::auto_ptr<MatrixType> hessianMatrix_;
/** \brief The assembler for the material law */ /** \brief The assembler for the material law */
const GeodesicFEAssembler<typename GridType::LeafGridView, TargetSpace>* assembler_; const GeodesicFEAssembler<typename GridType::LeafGridView, TargetSpace>* assembler_;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment