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
No related merge requests found
......@@ -115,10 +115,7 @@ setup(const GridType& grid,
// Create Hessian matrix and its occupation structure
// ////////////////////////////////////////////////////////////
if (hessianMatrix_)
delete hessianMatrix_;
hessianMatrix_ = new MatrixType;
hessianMatrix_ = std::auto_ptr<MatrixType>(new MatrixType);
Dune::MatrixIndexSet indices(grid_->size(1), grid_->size(1));
assembler_->getNeighborsPerVertex(indices);
indices.exportIdx(*hessianMatrix_);
......
......@@ -38,7 +38,7 @@ public:
RiemannianTrustRegionSolver()
: 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,
......@@ -100,7 +100,7 @@ protected:
double qpTolerance_;
/** \brief Hessian matrix */
MatrixType* hessianMatrix_;
std::auto_ptr<MatrixType> hessianMatrix_;
/** \brief The assembler for the material law */
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