This commit is contained in:
macstein
2021-06-12 10:36:37 -07:00
parent 51994c8c65
commit 7f261a2801
2 changed files with 17 additions and 3 deletions

View File

@ -477,8 +477,14 @@ void MLIAP_SO3::compute_W(int nmax, double *arr)
delete sqrtD;
delete tempM;
delete temparr;
delete tempvl;
for (int iy=0; iy<n; iy++)
delete[] temparr[iy];
delete[] temparr;
for (int iy=0; iy<n; iy++)
delete[] tempvl[iy];
delete[] tempvl;
}

View File

@ -25,7 +25,11 @@ typedef Jacobi<double,double*,double**,double const*const*> Jacobi_v2;
int SO3Math::jacobin(int n, double const* const* mat, double *eval, double **evec)
{
int i,j;
double mat_cpy[n][n];
double **mat_cpy;
mat_cpy = new double* [n];
for (int iy=0; iy<n; iy++)
mat_cpy[iy] = new double[n];
for(i=0;i<n;i++)
for(j=0;j<n;j++)
@ -44,6 +48,10 @@ int SO3Math::jacobin(int n, double const* const* mat, double *eval, double **eve
for (int j=i+1; j<n; j++)
std::swap(evec[i][j], evec[j][i]);
for (int iy=0; iy<n; iy++)
delete[] mat_cpy[iy];
delete[] mat_cpy;
return ierror;
}