22 AssignmentMatrix::AssignmentMatrix() {
26 AssignmentMatrix::~AssignmentMatrix() {
30 void AssignmentMatrix::addPotentialAssignment(
const Assignment& assignment) {
34 if (it_ev == evidence_to_index_.end()) {
35 ev_index = assignments_.size();
36 evidence_to_index_[assignment.
getEvidence()] = ev_index;
37 assignments_.resize(ev_index + 1);
39 ev_index = it_ev->second;
42 assignments_[ev_index].push_back(&assignment);
46 void AssignmentMatrix::sortAssignments() {
47 for(vector<vector<const Assignment*> >::
iterator it_ev = assignments_.begin(); it_ev != assignments_.end(); ++it_ev) {
52 const Assignment& AssignmentMatrix::getAssignment(
unsigned int i_ev,
int i_assignment) {
53 return *assignments_[i_ev][i_assignment];
56 unsigned int AssignmentMatrix::getNumAssignments(
unsigned int i_ev) {
57 return assignments_[i_ev].size();
60 unsigned int AssignmentMatrix::getNumMeasurements()
const {
61 return assignments_.size();
iterator(field< oT > &in_M, const bool at_end=false)
double getProbability() const
arma_inline const Op< T1, op_sort > sort(const Base< typename T1::elem_type, T1 > &X, const uword sort_type=0, const uword dim=0)
bool compareAssignments(const Assignment *ass1, const Assignment *ass2)
const Evidence * getEvidence() const