#include <RaySolving.h>
Definition at line 59 of file RaySolving.h.
WireCell::RayGrid::Solving::Solving |
( |
| ) |
|
|
default |
WireCell::RayGrid::Solving::~Solving |
( |
| ) |
|
|
default |
Definition at line 88 of file RaySolving.cxx.
90 for (
const auto& it : cset) {
91 double total_value = 0;
92 double total_weight = 0;
94 std::vector<vertex_t> snodes;
95 for (
const auto& node : it.second) {
96 if (node.ntype ==
'm') {
97 total_value += node.value;
98 total_weight += node.weight;
102 if (node.ntype ==
's') {
103 auto snode =
source_node(node.ident, node.value, node.weight);
104 snodes.push_back(snode);
109 if (!nms or snodes.empty()) {
114 for (
auto snode : snodes) {
115 boost::add_edge(mnode, snode,
m_graph);
vertex_t source_node(ident_t sid, float value, float weight)
vertex_t measurement_node(float value, float weight)
graph_t& WireCell::RayGrid::Solving::graph |
( |
| ) |
|
|
inline |
Definition at line 78 of file RaySolving.cxx.
82 m_graph[mnode].ident = 0xdeadbeef;
boost::graph_traits< graph_t >::vertex_descriptor vertex_t
const GenericPointer< typename T::ValueType > T2 value
Definition at line 161 of file RaySolving.cxx.
163 std::unordered_map<vertex_t, int> probs;
164 int nprobs = boost::connected_components(
m_graph, boost::make_assoc_property_map(probs));
173 std::vector<vertex_t> sources, measures;
175 std::unordered_map<int, SMVecs> smvecs;
176 for (
auto it : probs) {
178 if (
m_graph[vtx].ntype ==
's') {
179 smvecs[it.second].sources.push_back(vtx);
181 if (
m_graph[vtx].ntype ==
'm') {
182 smvecs[it.second].measures.push_back(vtx);
186 for (
auto sit : smvecs) {
187 solve_one(answer, sit.second.sources, sit.second.measures);
void solve_one(solution_t &answer, const std::vector< vertex_t > &sources, const std::vector< vertex_t > &measures)
std::unordered_map< ident_t, float > solution_t
Definition at line 121 of file RaySolving.cxx.
129 Ress::matrix_t geom = Ress::matrix_t::Zero(measures.size(), sources.size());
130 std::unordered_map<vertex_t, size_t> sv2ind, mv2ind;
131 for (
size_t mind=0; mind<measures.size(); ++mind) {
134 meas(mind) =
m_graph[mvtx].value;
136 for (
size_t sind=0; sind<sources.size(); ++sind) {
141 auto medges = boost::out_edges(svtx,
m_graph);
142 for (
auto mit = medges.first; mit != medges.second; ++mit) {
144 size_t mind = mv2ind[mvtx];
145 geom(mind, sind) = 1.0;
153 for (
int sind = 0; sind < solved.size(); ++sind) {
154 auto svtx = sources[sind];
155 m_graph[svtx].value = solved[sind];
156 answer[
m_graph[svtx].ident] = solved[sind];
vector_t solve(matrix_t response, vector_t measured, const Params ¶ms=Params(), vector_t source=Eigen::VectorXd(), vector_t weights=Eigen::VectorXd())
boost::graph_traits< graph_t >::vertex_descriptor vertex_t
Definition at line 63 of file RaySolving.cxx.
std::unordered_map< ident_t, vertex_t > m_sid2vtx
boost::graph_traits< graph_t >::vertex_descriptor vertex_t
const GenericPointer< typename T::ValueType > T2 value
graph_t WireCell::RayGrid::Solving::m_graph |
|
private |
std::unordered_map<ident_t, vertex_t> WireCell::RayGrid::Solving::m_sid2vtx |
|
private |
The documentation for this class was generated from the following files: