diff --git a/pub/src/curve.cpp b/pub/src/curve.cpp index f88f8294ff291fa8e9aca3eba662a6acf110c8cd..0397456096f9c7fd494e5e71b2f777684eaf538e 100644 --- a/pub/src/curve.cpp +++ b/pub/src/curve.cpp @@ -365,15 +365,17 @@ void NCurveFile::SetConvTuningPars( string which ) //! Set auxiliary parameters (weighing, ..). -void NCurveFile::SetProperties(string which) +void NCurveFile::SetProperties( string which ) { NOlm::IterateC fiter; POlc fc; - while((fc=fiter())) { - if (which=="yli") - fc->weight_y_log = false; - else if (which=="ylg") - fc->weight_y_log = true; + while ( (fc=fiter()) ) { + if (which=="cwc") + fc->weighing = COlc::_LIN; + else if (which=="cwl") + fc->weighing = COlc::_LOG; + else if (which=="cwv") + fc->weighing = COlc::_ERR; else { printf("! unknown property"); return; diff --git a/pub/src/frida2.cpp b/pub/src/frida2.cpp index 681e414b0da3c3c609aee712c1b3f5d3f392eccc..198fab838570108e595dd25ab93869a2b3b644a1 100644 --- a/pub/src/frida2.cpp +++ b/pub/src/frida2.cpp @@ -151,8 +151,9 @@ int main() " cf fit\n" " cfs fit, allow slow convolution\n" " cx toggle fixed (also: cx+ cx-)\n" - " cyli weight y lin\n" - " cylg weight y log\n" + " cwc weighing: constant\n" + " cwl weighing: logarithmic\n" + " cwv weighing: reciprocal variance (default)\n" "Fit tuning parameters:\n" " cs? show parameters\n" " csf set gradient step factor\n" @@ -195,10 +196,8 @@ int main() NCurveFile::Fit( true ); } else if (cmd == "cx") { NCurveFile::SetFixed(); - } else if (cmd == "cyli") { - NCurveFile::SetProperties("yli"); - } else if (cmd == "cylg") { - NCurveFile::SetProperties("ylg"); + } else if (cmd.substr(0,2) == "cw") { + NCurveFile::SetProperties( cmd.substr(1) ); } else if (cmd == "c_cd") { NCurveFile::CumulativeDistribution(); diff --git a/pub/src/olf.h b/pub/src/olf.h index 638668cd2b353f180c300dae56ccf9a06c42e9c7..7256b7e3fbedfd5079537aea358d4e0191be2bca 100644 --- a/pub/src/olf.h +++ b/pub/src/olf.h @@ -81,14 +81,14 @@ class COlc : public COlo { // online state records: boost::shared_ptr<class CTree> T; vector<CList> Fixed; - bool weight_y_log; + enum TWgt { _LIN, _LOG, _ERR } weighing; uint kd; // internal number of data file to be fitted uint kconv; uint cv_intmod; double cv_epsabs; double cv_epsrel; - COlc() : weight_y_log(false), kconv(-1) { ; }; + COlc() : weighing( _ERR ), kconv(-1) { ; }; // trivially duplicated functions: PCurve VC( uint j ) const;