From 802b249e649bb7f6e5c0bd7c9be2e4baf9d674c2 Mon Sep 17 00:00:00 2001 From: nadolski <nadolski@9a6e40ed-f3a0-4838-9b4a-bf418f78e88d> Date: Wed, 7 Jan 2015 08:59:34 +0000 Subject: [PATCH] Compatibility for MAC OS Mavericks --- tracy/tools/testchroma.prm | 8 ++++---- tracy/tracy/src/mathlib.cc | 2 +- tracy/tracy/src/radia2tracy.cc | 17 +++++++++++++++-- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/tracy/tools/testchroma.prm b/tracy/tools/testchroma.prm index e6b5934..6cbe674 100644 --- a/tracy/tools/testchroma.prm +++ b/tracy/tools/testchroma.prm @@ -19,7 +19,7 @@ #******files******** # relative directory of the files in the script # in_dir /Users/nadolski/codes/tracy/TracyIII/tracy/tools/ -in_dir /Users/nadolski/codes/tracy/maille/soleil/ +in_dir /Users/nadolski/Documents/Travail/codes/tracy/maille/soleil/ # lattice file wihout .lat extension # lat_file soleil_HU36_checkcode # lat_file solamor2_reglage_focalisation_chcvqt_thicksextu_LQPintermediaire_QFF @@ -50,9 +50,9 @@ in_dir /Users/nadolski/codes/tracy/maille/soleil/ # MultipoleFlag must be true if ThinsextFlag is true ThinsextFlag false # files for looking for the multipole of corrector (Machine current based) - fic_hcorr /Users/nadolski/Documents/codes/tracy/maille/soleil/corh.txt - fic_vcorr /Users/nadolski/Documents/codes/tracy/maille/soleil/corv.txt - fic_skew /Users/nadolski/Documents/codes/tracy/maille/soleil/corqt.txt + fic_hcorr /Users/nadolski/Documents/Documents/Travail/codes/tracy/maille/soleil/corh.txt + fic_vcorr /Users/nadolski/Documents/Documents/Travail/codes/tracy/maille/soleil/corv.txt + fic_skew /Users/nadolski/Documents/Documents/Travail/codes/tracy/maille/soleil/corqt.txt ### ### FITTING FACTORY diff --git a/tracy/tracy/src/mathlib.cc b/tracy/tracy/src/mathlib.cc index a103bec..e8eab54 100644 --- a/tracy/tracy/src/mathlib.cc +++ b/tracy/tracy/src/mathlib.cc @@ -9,7 +9,7 @@ */ // missing in lstdc++ -template double std::__cmath_power<double>(double, unsigned); +// LSN template double std::__cmath_power<double>(double, unsigned); double log(const int k) { return log((double)k); } diff --git a/tracy/tracy/src/radia2tracy.cc b/tracy/tracy/src/radia2tracy.cc index 5fc669b..bc40734 100644 --- a/tracy/tracy/src/radia2tracy.cc +++ b/tracy/tracy/src/radia2tracy.cc @@ -28,7 +28,11 @@ void spline(const double x[], const T y[], int const n, double const yp1, { int i, k; double sig; - T p, u[n], qn, un; + // LSN + // T p, u[n], qn, un; + T p, qn, un; + T *u = new T[n]; + if (yp1 > 0.99e30) y2[1] = u[1] = 0.0; @@ -54,6 +58,9 @@ void spline(const double x[], const T y[], int const n, double const yp1, y2[n] = (un - qn * u[n - 1]) / (qn * y2[n - 1] + 1.0); for (k = n - 1; k >= 1; k--) y2[k] = y2[k] * y2[k + 1] + u[k]; + + // LSN + delete u; } /*********************************************************************************************** @@ -107,12 +114,18 @@ void splin2(const double x1a[], const double x2a[], double **ya, double **y2a, const int m, const int n, const T &x1, const T &x2, T &y) { int j; - T ytmp[m + 1], yytmp[m + 1]; // Perform m evaluations of the row splines constructed by + // LSN + //T ytmp[m + 1], yytmp[m + 1]; // Perform m evaluations of the row splines constructed by + T *ytmp = new T[m + 1]; + T *yytmp = new T[m + 1]; // Perform m evaluations of the row splines constructed by for (j = 1; j <= m; j++) //splie2, using the one-dimensional spline evaluator splint(x2a, ya[j], y2a[j], n, x2, yytmp[j]); //splint. spline(x1a, yytmp, m, 1.0e30, 1.0e30, ytmp); // Construct the one-dimensional column spline and evaluate it. splint(x1a, yytmp, ytmp, m, x1, y); + + delete ytmp; + delete yytmp; } /************************************************************************************************** -- GitLab