diff --git a/pub/CHANGELOG b/pub/CHANGELOG index 985876211470ed15fc6a48194863a7eef4a55729..006bb63295c373eef4343ef0cf89b8da8205ee04 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 f5bf6551ad379a7ec9798f5d6687f26cc372803c..78868cd50cc36a83ad5008877e594a351fd79e5b 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 4185540a7cafe532376ff5a4055ba06374f359c2..54e0948c27ef93243f8b4c5b433bf34d7ac11f58 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 7434929fbce7d8275acc9d09fc550760f4c75f57..1e96859122e3ad1eb6f72ac3ac5667f094f31e69 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 929c8f5d4da586ed4ec265a7c626e710df952726..9cd5a571bf189eeec29ef97729ed0a0d06ce5b53 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() ); }