Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-stable
Commits
42d43804
Commit
42d43804
authored
Feb 03, 2004
by
Jonathon Duerig
Browse files
Added two programs to help in analyzing route statistics.
parent
a210edb9
Changes
2
Show whitespace changes
Inline
Side-by-side
tbsetup/ipassign/src/add-x.cc
0 → 100644
View file @
42d43804
// add-x.cc
#include <iostream>
using
namespace
std
;
int
main
()
{
double
current
=
0.0
;
double
total
=
0.0
;
cin
>>
current
;
while
(
cin
)
{
cout
<<
total
<<
' '
<<
current
<<
endl
;
total
+=
0.01
;
cin
>>
current
;
}
return
0
;
}
tbsetup/ipassign/src/difference.cc
0 → 100644
View file @
42d43804
// difference.cc
#include <iostream>
#include <fstream>
#include <string>
using
namespace
std
;
int
main
(
int
argc
,
char
*
argv
[])
{
if
(
argc
==
3
)
{
ifstream
ideal
(
argv
[
1
],
ios
::
in
);
ifstream
candidate
(
argv
[
2
],
ios
::
in
);
ofstream
relative
((
argv
[
2
]
+
string
(
".relative"
)).
c_str
(),
ios
::
out
|
ios
::
trunc
);
ofstream
absolute
((
argv
[
2
]
+
string
(
".absolute"
)).
c_str
(),
ios
::
out
|
ios
::
trunc
);
if
(
ideal
&&
candidate
&&
relative
&&
absolute
)
{
int
left
=
0
;
int
right
=
0
;
ideal
>>
left
;
candidate
>>
right
;
while
(
ideal
&&
candidate
)
{
absolute
<<
(
right
-
left
)
<<
endl
;
double
num
=
right
-
left
;
double
denom
=
right
;
if
(
right
!=
0
)
{
relative
<<
(
num
/
denom
)
<<
endl
;
}
ideal
>>
left
;
candidate
>>
right
;
}
}
}
return
0
;
}
Write
Preview
Supports
Markdown
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