diff --git a/prism/src/sparse/PS_JOR.cc b/prism/src/sparse/PS_JOR.cc index 451ffc64..0bf2567b 100644 --- a/prism/src/sparse/PS_JOR.cc +++ b/prism/src/sparse/PS_JOR.cc @@ -300,7 +300,7 @@ jdouble omega // omega (over-relaxation parameter) PS_PrintToMainLog(env, "\n%s: %d iterations in %.2f seconds (average %.6f, setup %.2f)\n", (omega == 1.0)?"Jacobi":"JOR", iters, time_taken, time_for_iters/iters, time_for_setup); // if the iterative method didn't terminate, this is an error - if (!done) { delete soln; soln = NULL; PS_SetErrorMessage("Iterative method did not converge within %d iterations.\nConsider using a different numerical method or increasing the maximum number of iterations", iters); } + if (!done) { delete[] soln; soln = NULL; PS_SetErrorMessage("Iterative method did not converge within %d iterations.\nConsider using a different numerical method or increasing the maximum number of iterations", iters); } // catch exceptions: register error, free memory } catch (std::bad_alloc e) { diff --git a/prism/src/sparse/PS_NondetReachReward.cc b/prism/src/sparse/PS_NondetReachReward.cc index 0221a66f..cca80bd4 100644 --- a/prism/src/sparse/PS_NondetReachReward.cc +++ b/prism/src/sparse/PS_NondetReachReward.cc @@ -387,7 +387,7 @@ jboolean min // min or max probabilities (true = min, false = max) PS_PrintToMainLog(env, "\nIterative method: %d iterations in %.2f seconds (average %.6f, setup %.2f)\n", iters, time_taken, time_for_iters/iters, time_for_setup); // if the iterative method didn't terminate, this is an error - if (!done) { delete soln; soln = NULL; PS_SetErrorMessage("Iterative method did not converge within %d iterations.\nConsider using a different numerical method or increasing the maximum number of iterations", iters); } + if (!done) { delete[] soln; soln = NULL; PS_SetErrorMessage("Iterative method did not converge within %d iterations.\nConsider using a different numerical method or increasing the maximum number of iterations", iters); } // close file to store adversary (if required) if (export_adv_enabled != EXPORT_ADV_NONE) { diff --git a/prism/src/sparse/PS_NondetUntil.cc b/prism/src/sparse/PS_NondetUntil.cc index 83266187..b9ba4eb5 100644 --- a/prism/src/sparse/PS_NondetUntil.cc +++ b/prism/src/sparse/PS_NondetUntil.cc @@ -347,7 +347,7 @@ jlong _strat // strategy storage PS_PrintToMainLog(env, "\nIterative method: %d iterations in %.2f seconds (average %.6f, setup %.2f)\n", iters, time_taken, time_for_iters/iters, time_for_setup); // if the iterative method didn't terminate, this is an error - if (!done) { delete soln; soln = NULL; PS_SetErrorMessage("Iterative method did not converge within %d iterations.\nConsider using a different numerical method or increasing the maximum number of iterations", iters); } + if (!done) { delete[] soln; soln = NULL; PS_SetErrorMessage("Iterative method did not converge within %d iterations.\nConsider using a different numerical method or increasing the maximum number of iterations", iters); } // close file to store adversary (if required) if (export_adv_enabled != EXPORT_ADV_NONE) { diff --git a/prism/src/sparse/PS_Power.cc b/prism/src/sparse/PS_Power.cc index 174cbec0..dfce25ff 100644 --- a/prism/src/sparse/PS_Power.cc +++ b/prism/src/sparse/PS_Power.cc @@ -246,7 +246,7 @@ jboolean transpose // transpose A? (i.e. solve xA=x not Ax=x?) PS_PrintToMainLog(env, "\nPower method: %d iterations in %.2f seconds (average %.6f, setup %.2f)\n", iters, time_taken, time_for_iters/iters, time_for_setup); // if the iterative method didn't terminate, this is an error - if (!done) { delete soln; soln = NULL; PS_SetErrorMessage("Iterative method did not converge within %d iterations.\nConsider using a different numerical method or increasing the maximum number of iterations", iters); } + if (!done) { delete[] soln; soln = NULL; PS_SetErrorMessage("Iterative method did not converge within %d iterations.\nConsider using a different numerical method or increasing the maximum number of iterations", iters); } // catch exceptions: register error, free memory } catch (std::bad_alloc e) { diff --git a/prism/src/sparse/PS_SOR.cc b/prism/src/sparse/PS_SOR.cc index 24229293..bbb3a806 100644 --- a/prism/src/sparse/PS_SOR.cc +++ b/prism/src/sparse/PS_SOR.cc @@ -301,7 +301,7 @@ jboolean forwards // forwards or backwards? PS_PrintToMainLog(env, "\n%s%s: %d iterations in %.2f seconds (average %.6f, setup %.2f)\n", forwards?"":"Backwards ", (omega == 1.0)?"Gauss-Seidel":"SOR", iters, time_taken, time_for_iters/iters, time_for_setup); // if the iterative method didn't terminate, this is an error - if (!done) { delete soln; soln = NULL; PS_SetErrorMessage("Iterative method did not converge within %d iterations.\nConsider using a different numerical method or increasing the maximum number of iterations", iters); } + if (!done) { delete[] soln; soln = NULL; PS_SetErrorMessage("Iterative method did not converge within %d iterations.\nConsider using a different numerical method or increasing the maximum number of iterations", iters); } // catch exceptions: register error, free memory } catch (std::bad_alloc e) {