Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
d89d784a
Commit
d89d784a
authored
Dec 10, 2011
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Just added a try/catch block around the whole program.
parent
cbcb80bf
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
bayes_net_ex.cpp
examples/bayes_net_ex.cpp
+11
-0
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