Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Thomas Pitiot
SocialAgents3D
Commits
a1267f46
Commit
a1267f46
authored
Mar 18, 2015
by
Etienne Schmitt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
benchmarking
Signed-off-by:
Étienne Schmitt
<
etienne.schmitt@inria.fr
>
parent
21772991
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
15 deletions
+33
-15
include/env_map.h
include/env_map.h
+13
-14
src/env_map.cpp
src/env_map.cpp
+20
-1
No files found.
include/env_map.h
View file @
a1267f46
...
...
@@ -7,6 +7,8 @@
#include <iostream>
#include <algorithm>
#include <chrono>
#include <ctime>
#include "Topology/generic/parameters.h"
...
...
@@ -42,7 +44,7 @@ typedef CGoGN::Algo::Volume::MovingObjects::ParticleCell3DMemo<PFP> PARTICULEMEM
class
EnvMap
{
public:
std
::
chrono
::
duration
<
double
>
duration_pop
,
duration_subdiv
,
duration_push
;
EnvMap
()
;
void
init
(
int
argc
,
char
**
argv
)
;
...
...
@@ -132,19 +134,16 @@ inline void addElementToVector(std::vector<T>& a, T ag)
template
<
typename
T
>
inline
bool
removeElementFromVector
(
std
::
vector
<
T
>&
a
,
T
ag
)
{
assert
(
std
::
find
(
a
.
begin
(),
a
.
end
(),
ag
)
!=
a
.
end
());
typename
std
::
vector
<
T
>::
iterator
end
=
a
.
template
end
()
;
for
(
typename
std
::
vector
<
T
>::
iterator
it
=
a
.
begin
();
it
!=
end
;
++
it
)
{
if
(
*
it
==
ag
)
{
*
it
=
a
.
back
()
;
a
.
pop_back
()
;
return
true
;
}
}
return
false
;
typedef
typename
std
::
vector
<
T
>::
iterator
iterator
;
iterator
it
=
std
::
find
(
a
.
begin
(),
a
.
end
(),
ag
);
if
(
it
==
a
.
end
())
{
return
false
;
}
else
{
*
it
=
a
.
back
();
a
.
pop_back
();
}
return
true
;
}
/////////////////////////////////////////////////////////////////////REGISTRATIONS
...
...
src/env_map.cpp
View file @
a1267f46
...
...
@@ -592,7 +592,7 @@ bool EnvMap::subdivideVolume(Dart dglobal, bool OneLevelDifference)
}
const
std
::
chrono
::
time_point
<
std
::
chrono
::
system_clock
>
startPop
=
std
::
chrono
::
system_clock
::
now
();
// on commence ensuite a subdiviser
// map.check();
map
.
setCurrentLevel
(
map
.
getMaxLevel
())
;
...
...
@@ -625,12 +625,22 @@ bool EnvMap::subdivideVolume(Dart dglobal, bool OneLevelDifference)
this
->
popTriangle
(
o
)
;
}
const
std
::
chrono
::
time_point
<
std
::
chrono
::
system_clock
>
endPop
=
std
::
chrono
::
system_clock
::
now
();
duration_pop
=
endPop
-
startPop
;
std
::
cout
<<
"pop duration : "
<<
duration_pop
.
count
()
<<
"s
\n
"
;
const
std
::
chrono
::
time_point
<
std
::
chrono
::
system_clock
>
startSubdiv
=
std
::
chrono
::
system_clock
::
now
();
if
(
!
map
.
isBoundaryMarked
(
3
,
dglobal
)
&&
map
.
getDartLevel
(
dglobal
)
<=
map
.
getMaxLevel
()
&&
!
map
.
volumeIsSubdivided
(
dglobal
)
)
{
Algo
::
Volume
::
IHM
::
subdivideVolumeClassic
<
PFP
>
(
map
,
dglobal
,
position
,
false
);
res
=
true
;
}
const
std
::
chrono
::
time_point
<
std
::
chrono
::
system_clock
>
endSubdiv
=
std
::
chrono
::
system_clock
::
now
();
duration_subdiv
=
endSubdiv
-
startSubdiv
;
std
::
cout
<<
"subdiv duration : "
<<
duration_subdiv
.
count
()
<<
"s
\n
"
;
map
.
setCurrentLevel
(
map
.
getMaxLevel
())
;
// map.check();
...
...
@@ -646,12 +656,15 @@ bool EnvMap::subdivideVolume(Dart dglobal, bool OneLevelDifference)
}
const
std
::
chrono
::
time_point
<
std
::
chrono
::
system_clock
>
startPush
=
std
::
chrono
::
system_clock
::
now
();
//same for adjacent triangles // optimiser
for
(
Triangle
*
o
:
oldTrianNeighbor
)
{
this
->
FirstRegistrationTriangle
(
o
)
;
}
//same for triangles // optimiser
for
(
Triangle
*
o
:
oldTrian
)
{
...
...
@@ -659,6 +672,8 @@ bool EnvMap::subdivideVolume(Dart dglobal, bool OneLevelDifference)
this
->
FirstRegistrationTriangle
(
o
)
;
}
const
std
::
chrono
::
time_point
<
std
::
chrono
::
system_clock
>
endPushTriangle
=
std
::
chrono
::
system_clock
::
now
();
//same for adjacent obstacles // optimiser
for
(
Segment
*
o
:
oldNeighborObst
)
...
...
@@ -673,6 +688,10 @@ bool EnvMap::subdivideVolume(Dart dglobal, bool OneLevelDifference)
}
const
std
::
chrono
::
time_point
<
std
::
chrono
::
system_clock
>
endPush
=
std
::
chrono
::
system_clock
::
now
();
duration_push
=
endPush
-
startPush
;
std
::
cout
<<
"push triangle duration : "
<<
std
::
chrono
::
duration
<
double
>
(
endPushTriangle
-
startPush
).
count
()
<<
"s
\n
"
;
std
::
cout
<<
"push duration : "
<<
duration_push
.
count
()
<<
"s
\n
"
;
#endif
...
...
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