libDAI
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
include
dai
evidence.h
Go to the documentation of this file.
1
/* This file is part of libDAI - http://www.libdai.org/
2
*
3
* Copyright (c) 2006-2011, The libDAI authors. All rights reserved.
4
*
5
* Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
6
*/
7
8
11
12
13
#ifndef __defined_libdai_evidence_h
14
#define __defined_libdai_evidence_h
15
16
17
#include <istream>
18
#include <
dai/daialg.h
>
19
20
21
namespace
dai {
22
23
25
30
class
Evidence
{
31
public
:
33
typedef
std::map<Var, size_t>
Observation
;
34
35
private
:
37
std::vector<Observation>
_samples
;
38
39
public
:
41
Evidence
() :
_samples
() {}
42
44
Evidence
( std::vector<Observation> &samples ) :
_samples
(samples) {}
45
47
52
void
addEvidenceTabFile
( std::istream& is,
FactorGraph
& fg );
53
55
size_t
nrSamples
()
const
{
return
_samples
.size(); }
56
58
59
60
typedef
std::vector<Observation>::iterator
iterator
;
62
typedef
std::vector<Observation>::const_iterator
const_iterator
;
63
65
iterator
begin
() {
return
_samples
.begin(); }
67
const_iterator
begin
()
const
{
return
_samples
.begin(); }
69
iterator
end
() {
return
_samples
.end(); }
71
const_iterator
end
()
const
{
return
_samples
.end(); }
73
74
private
:
76
void
addEvidenceTabFile
( std::istream& is, std::map<std::string, Var> &varMap );
77
};
78
79
80
}
// end of namespace dai
81
82
83
#endif
Generated on Mon Sep 17 2012 12:30:34 for libDAI by
1.8.1.2