/** * \brief Get the other vertex in the edge. */ inline graph_type::vertex_type get_other_vertex(const graph_type::edge_type& edge, const graph_type::vertex_type& vertex) { return vertex.id() == edge.source().id()? edge.target() : edge.source(); }
/** * \brief Given an edge compute the error associated with that edge */ double extract_l2_error(const graph_type::edge_type & edge) { const double pred = edge.source().data().factor.dot(edge.target().data().factor); return (edge.data().obs - pred) * (edge.data().obs - pred); } // end of extract_l2_error