Skip to content
Snippets Groups Projects
Commit 54d66e14 authored by Carsten Gräser's avatar Carsten Gräser
Browse files

[cleanup] Replaced runtime-sized array by dynamic allocation

While gcc supports them (as extension) runtime sized arrays
are not standard c++. They are not even contained in c++14
but postponed to a later TS.
parent 11596fe4
Branches
Tags
No related merge requests found
......@@ -3,6 +3,10 @@
#ifndef DUNE_DYNMATRIXEIGENVALUES_HH
#define DUNE_DYNMATRIXEIGENVALUES_HH
#include <memory>
#include <dune/common/std/memory.hh>
#include "dynmatrix.hh"
/*!
......@@ -42,7 +46,7 @@ namespace Dune {
// matrix to put into dgeev
double matrixVector[N * N];
std::unique_ptr<double[]> matrixVector = Std::make_unique<double[]>(N*N);
// copy matrix
int row = 0;
......@@ -55,9 +59,9 @@ namespace Dune {
}
// working memory
double eigenR[N];
double eigenI[N];
double work[3*N];
std::unique_ptr<double[]> eigenR = Std::make_unique<double[]>(N);
std::unique_ptr<double[]> eigenI = Std::make_unique<double[]>(N);
std::unique_ptr<double[]> work = Std::make_unique<double[]>(3*N);
// return value information
long int info = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment