Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
d89d784a
Commit
d89d784a
authored
Dec 10, 2011
by
Davis King
Browse files
Just added a try/catch block around the whole program.
parent
cbcb80bf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
248 additions
and
237 deletions
+248
-237
examples/bayes_net_ex.cpp
examples/bayes_net_ex.cpp
+248
-237
No files found.
examples/bayes_net_ex.cpp
View file @
d89d784a
...
...
@@ -51,6 +51,8 @@ using namespace std;
int
main
()
{
try
{
// There are many useful convenience functions in this namespace. They all
// perform simple access or modify operations on the nodes of a bayesian network.
// You don't have to use them but they are convenient and they also will check for
...
...
@@ -291,6 +293,15 @@ int main()
cout
<<
"p(B=1 | C=1) = "
<<
(
double
)
B_count
/
(
double
)
rounds
<<
endl
;
cout
<<
"p(C=1 | C=1) = "
<<
(
double
)
C_count
/
(
double
)
rounds
<<
endl
;
cout
<<
"p(D=1 | C=1) = "
<<
(
double
)
D_count
/
(
double
)
rounds
<<
endl
;
}
catch
(
std
::
exception
&
e
)
{
cout
<<
"exception thrown: "
<<
endl
;
cout
<<
e
.
what
()
<<
endl
;
cout
<<
"hit enter to terminate"
<<
endl
;
cin
.
get
();
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment