From 6ce56d2a4f423e4a344d219d74c624d8f68ce848 Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (o)" <j.wuttke@fz-juelich.de>
Date: Fri, 30 Jan 2015 18:55:26 +0100
Subject: [PATCH] ?

---
 pub/CHANGELOG    | 14 ++++++++++++++
 pub/lib/fit.cpp  |  7 +++----
 pub/lib/olf.cpp  |  4 +++-
 pub/lib/olf.hpp  |  2 +-
 pub/lib/plot.cpp |  5 ++---
 5 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/pub/CHANGELOG b/pub/CHANGELOG
index 98587621..006bb632 100644
--- a/pub/CHANGELOG
+++ b/pub/CHANGELOG
@@ -1,3 +1,17 @@
+Release 2.3.0a:
+
+- Major code refactoring:
+  - expression evaluation now returns object pointers
+  - some cleanup according to cppcheck
+  - code is ready for clang (except for OpenMP, still unsupported under clang)
+  - most function names converted to underscore style
+  - variable registry instead of readln macros
+- New functionality:
+  - global fits 
+  - integer expressions now evaluated in integer arithmetics
+- Remove legacy methods:
+  - rm loaders for old formats 96 and 01.
+
 Release 2.2.2b of 22dec14:
 
 - Bugfix: a cmake file was missing in 2.2.2a.
diff --git a/pub/lib/fit.cpp b/pub/lib/fit.cpp
index f5bf6551..78868cd5 100644
--- a/pub/lib/fit.cpp
+++ b/pub/lib/fit.cpp
@@ -73,8 +73,7 @@ void NCurveFit::set_fit_tuning_pars( string which )
 //**************************************************************************************************
 
 static void compute_residues(
-    double* fvec, const int mdat, const int j, const RSpec& s,
-    const RObj cu, const COlc::TWgt wt )
+    double* fvec, const int mdat, const int j, const RSpec& s, const RObj cu, const COlc::TWgt wt )
 {
     int n = s->size();
 
@@ -297,12 +296,12 @@ static void fit_evaluate_glo( const double* par, int m_dat, const void *data,
             throw "inconsistent number of free parameters";
 
         bool want_error = wt==COlc::_VAR || wt==COlc::_VARC;
-#pragma omp parallel for // if ( !NCurveFit::verbosity )
+//#pragma omp parallel for // if ( !NCurveFit::verbosity )
         for( int jj=0; jj<mydata->J2J.size(); ++jj ) {
             int j = mydata->J2J[jj];
             RSpec s = fd->VS(j);
             RObj cu = fc->eval_curve( s->x, mydata->k, j, want_error );
-            compute_residues( fvec, mydata->Offset[j], j, s, cu, wt );
+            compute_residues( fvec, mydata->Offset[jj], j, s, cu, wt );
         }
     } catch ( string& s ) {
         cerr << "\n" << s << "\n";
diff --git a/pub/lib/olf.cpp b/pub/lib/olf.cpp
index 4185540a..54e0948c 100644
--- a/pub/lib/olf.cpp
+++ b/pub/lib/olf.cpp
@@ -552,7 +552,7 @@ RObj COlc::eval_curve_scalar( double arg, int k, int j, bool want_error ) const
 
 //! Returns text lines to describe file-wide settings.
 
-vector<string> COlc::infoFile() const
+vector<string> COlc::info_settings() const
 {
     vector<string> ret;
     string out = "";
@@ -592,6 +592,8 @@ string COlc::info_table_header() const
 
 void COlc::print_info_table() const
 {
+    for( string line: info_settings() )
+        cout << line << "\n";
     cout << info_table_header() << "\n";
     for( int j=0; j<nJ(); ++j )
         cout << info_line( j ) << "\n";
diff --git a/pub/lib/olf.hpp b/pub/lib/olf.hpp
index 7434929f..1e968591 100644
--- a/pub/lib/olf.hpp
+++ b/pub/lib/olf.hpp
@@ -111,7 +111,7 @@ public:
     // Pertinent functions:
     bool has_global_par() const;
     string weight_str() const;
-    vector<string> infoFile() const;
+    vector<string> info_settings() const;
     string info_table_header() const;
     void print_info_table() const;
     CCoord coord( class CVar* var ) const;
diff --git a/pub/lib/plot.cpp b/pub/lib/plot.cpp
index 929c8f5d..9cd5a571 100644
--- a/pub/lib/plot.cpp
+++ b/pub/lib/plot.cpp
@@ -478,9 +478,8 @@ void NPlot::plot( class CPlot *plot, bool add, const string& mode )
         for (int i=0; i<f->lDoc.size(); i++)
             plot->doc_TxLine( "  " + f->lDoc[i] );
         if ( fc ) {
-            vector<string> vs = fc->infoFile();
-            for (int i=0; i<vs.size(); i++)
-                plot->doc_TxLine( "  " + vs[i] );
+            for ( string line: fc->info_settings() )
+                plot->doc_TxLine( "  " + line );
             plot->doc_TxLine( "  " + fc->info_table_header() );
         }
 
-- 
GitLab