Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions news/rw_history.rst
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
**Added:**

* Add method ``GetRwHistory`` on LSQ object to get history of Rw values through one run of ``lsq.Refine()``.

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
10 changes: 10 additions & 0 deletions src/extensions/lsq_ext.cpp
Original file line numberDiff line numberDiff line change
Expand Up@@ -45,6 +45,15 @@ bool _SafeRefine(LSQNumObj & lsq, REAL maxChi2factor, int nbCycle, bool useLeven
callBeginEndOptimization, minChi2var);
}

bp::list _GetRwHistory(const LSQNumObj & lsq)
{
bp::list out;
const std::vector<REAL> & h = lsq.GetRwHistory();
for (std::vector<REAL>::const_iterator it = h.begin(); it != h.end(); ++it)
out.append(*it);
return out;
}

} // namespace

void wrap_lsq()
Expand DownExpand Up@@ -81,6 +90,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,
Expand Down
Loading