Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CGoGN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
CGoGN
CGoGN
Commits
742d8e66
Commit
742d8e66
authored
Feb 15, 2011
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
operator const dans les Dart + micro optim oldest dart IHM
parent
ce36e5a4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
9 deletions
+20
-9
include/Topology/generic/dart.h
include/Topology/generic/dart.h
+3
-3
src/Algo/ImplicitHierarchicalMesh/ihm.cpp
src/Algo/ImplicitHierarchicalMesh/ihm.cpp
+17
-6
No files found.
include/Topology/generic/dart.h
View file @
742d8e66
...
...
@@ -54,19 +54,19 @@ struct Dart
* equality operator
* @param d the dart to compare with
*/
bool
operator
==
(
Dart
d
)
{
return
d
.
index
==
index
;
}
bool
operator
==
(
Dart
d
)
const
{
return
d
.
index
==
index
;
}
/**
* different operator
* @param d the dart to compare with
*/
bool
operator
!=
(
Dart
d
)
{
return
d
.
index
!=
index
;
}
bool
operator
!=
(
Dart
d
)
const
{
return
d
.
index
!=
index
;
}
/**
* less operator, can be used for sorting
* @param d the dart to compare with
*/
bool
operator
<
(
Dart
d
)
{
return
d
.
index
<
index
;
}
bool
operator
<
(
Dart
d
)
const
{
return
index
<
d
.
index
;
}
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
const
Dart
&
fa
)
{
return
out
<<
fa
.
index
;
}
friend
std
::
istream
&
operator
>>
(
std
::
istream
&
in
,
Dart
&
fa
)
{
in
>>
fa
.
index
;
return
in
;
}
...
...
src/Algo/ImplicitHierarchicalMesh/ihm.cpp
View file @
742d8e66
...
...
@@ -81,6 +81,7 @@ void ImplicitHierarchicalMap::initEdgeId()
unsigned
int
ImplicitHierarchicalMap
::
faceLevel
(
Dart
d
)
{
assert
(
m_dartLevel
[
d
]
<=
m_curLevel
||
!
"Access to a dart introduced after current level"
)
;
if
(
m_curLevel
==
0
)
return
0
;
...
...
@@ -126,14 +127,19 @@ unsigned int ImplicitHierarchicalMap::faceLevel(Dart d)
Dart
it
=
d
;
Dart
old
=
it
;
unsigned
int
l_old
=
m_dartLevel
[
old
]
;
unsigned
int
fLevel
=
edgeLevel
(
it
)
;
do
{
it
=
phi1
(
it
)
;
if
(
m_dartLevel
[
it
]
<
m_dartLevel
[
old
])
// in a first time, the level of a face
old
=
it
;
// is the minimum of the levels
unsigned
int
l
=
edgeLevel
(
it
)
;
// of its edges
fLevel
=
l
<
fLevel
?
l
:
fLevel
;
unsigned
int
dl
=
m_dartLevel
[
it
]
;
if
(
dl
<
l_old
)
// compute the oldest dart of the face
{
// in the same time
old
=
it
;
l_old
=
dl
;
}
// in a first time, the level of a face
unsigned
int
l
=
edgeLevel
(
it
)
;
// is the minimum of the levels
fLevel
=
l
<
fLevel
?
l
:
fLevel
;
// of its edges
}
while
(
it
!=
d
)
;
unsigned
int
cur
=
m_curLevel
;
...
...
@@ -180,11 +186,16 @@ Dart ImplicitHierarchicalMap::faceOldestDart(Dart d)
assert
(
m_dartLevel
[
d
]
<=
m_curLevel
||
!
"Access to a dart introduced after current level"
)
;
Dart
it
=
d
;
Dart
oldest
=
it
;
unsigned
int
l_old
=
m_dartLevel
[
oldest
]
;
do
{
it
=
phi1
(
it
)
;
if
(
m_dartLevel
[
it
]
<
m_dartLevel
[
oldest
])
unsigned
int
l
=
m_dartLevel
[
it
]
;
if
(
l
<
l_old
||
(
l
==
l_old
&&
it
<
oldest
))
{
oldest
=
it
;
l_old
=
l
;
}
it
=
phi1
(
it
)
;
}
while
(
it
!=
d
)
;
return
oldest
;
}
...
...
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