Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ext-edelen_a
src
Commits
878fa2bc
Commit
878fa2bc
authored
Nov 28, 2018
by
frey_m
Browse files
LatinHyperCube: use better container
parent
98f4f8ff
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
src/Sample/LatinHyperCube.h
src/Sample/LatinHyperCube.h
+3
-5
No files found.
src/Sample/LatinHyperCube.h
View file @
878fa2bc
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
#include "Sample/RNGStream.h"
#include "Sample/RNGStream.h"
#include <algorithm>
#include <algorithm>
#include <deque>
class
LatinHyperCube
:
public
SamplingMethod
class
LatinHyperCube
:
public
SamplingMethod
{
{
...
@@ -56,14 +57,11 @@ private:
...
@@ -56,14 +57,11 @@ private:
std
::
size_t
bin
=
bin_m
.
back
();
std
::
size_t
bin
=
bin_m
.
back
();
bin_m
.
pop_back
();
bin_m
.
pop_back
();
if
(
bin_m
.
size
()
+
1e4
<
bin_m
.
capacity
()
)
bin_m
.
shrink_to_fit
();
return
binsize_m
*
(
val
+
bin
);
return
binsize_m
*
(
val
+
bin
);
}
}
void
fillBins_m
(
std
::
size_t
n
)
{
void
fillBins_m
(
std
::
size_t
n
)
{
bin_m
.
res
erv
e
(
n
);
bin_m
.
res
iz
e
(
n
);
std
::
iota
(
bin_m
.
begin
(),
bin_m
.
end
(),
0
);
std
::
iota
(
bin_m
.
begin
(),
bin_m
.
end
(),
0
);
std
::
random_device
rd
;
std
::
random_device
rd
;
...
@@ -74,7 +72,7 @@ private:
...
@@ -74,7 +72,7 @@ private:
private:
private:
RNGStream
*
RNGInstance_m
;
RNGStream
*
RNGInstance_m
;
std
::
vector
<
std
::
size_t
>
bin_m
;
std
::
deque
<
std
::
size_t
>
bin_m
;
double
binsize_m
;
double
binsize_m
;
dist_t
dist_m
;
dist_t
dist_m
;
...
...
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