diff --git a/news/rw_history.rst b/news/rw_history.rst new file mode 100644 index 0000000..a348487 --- /dev/null +++ b/news/rw_history.rst @@ -0,0 +1,23 @@ +**Added:** + +* Add method ``GetRwHistory`` on LSQ object to get history of Rw values through one run of ``lsq.Refine()``. + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* diff --git a/src/extensions/lsq_ext.cpp b/src/extensions/lsq_ext.cpp index b28ba8d..f34420c 100644 --- a/src/extensions/lsq_ext.cpp +++ b/src/extensions/lsq_ext.cpp @@ -62,6 +62,15 @@ bp::dict _GetVarianceCovarianceMap(LSQNumObj & lsq) return d; } +bp::list _GetRwHistory(const LSQNumObj & lsq) +{ + bp::list out; + const std::vector & h = lsq.GetRwHistory(); + for (std::vector::const_iterator it = h.begin(); it != h.end(); ++it) + out.append(*it); + return out; +} + } // namespace void wrap_lsq() @@ -98,6 +107,7 @@ void wrap_lsq() bp::arg("minChi2var")=0.01)) .def("Rfactor", &LSQNumObj::Rfactor) .def("RwFactor", &LSQNumObj::RwFactor) + .def("GetRwHistory", &_GetRwHistory) .def("ChiSquare", &LSQNumObj::ChiSquare) .def("SetRefinedObj", &LSQNumObj::SetRefinedObj, (bp::arg("obj"), bp::arg("LSQFuncIndex")=0,