Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Lukas Weber
load_leveller
Commits
67b338aa
Commit
67b338aa
authored
Jun 06, 2019
by
Lukas Weber
Browse files
corner case... maybe vector_length shouldn’t be as dynamic as it is
parent
55921b95
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/observable.cpp
View file @
67b338aa
...
...
@@ -4,7 +4,8 @@
namespace
loadl
{
observable
::
observable
(
std
::
string
name
,
size_t
bin_length
,
size_t
vector_length
)
:
name_
{
std
::
move
(
name
)},
bin_length_
{
bin_length
},
vector_length_
{
vector_length
},
current_bin_
{
0
},
current_bin_filling_
{
0
}
{
:
name_
{
std
::
move
(
name
)},
bin_length_
{
bin_length
},
vector_length_
{
vector_length
},
current_bin_
{
0
},
current_bin_filling_
{
0
}
{
samples_
.
reserve
(
vector_length_
*
initial_bin_length
);
}
...
...
@@ -34,7 +35,7 @@ void observable::measurement_write(const iodump::group &meas_file) {
std
::
vector
<
double
>
current_bin_value
;
// if there is at least one bin…
if
(
samples_
.
size
()
>=
vector_length_
)
{
if
(
vector_length_
>
0
&&
samples_
.
size
()
>=
vector_length_
)
{
current_bin_value
.
assign
(
samples_
.
end
()
-
vector_length_
,
samples_
.
end
());
samples_
.
resize
(
current_bin_
*
vector_length_
);
}
...
...
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