Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NP_TMcode
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Giacomo Mulas
NP_TMcode
Commits
5227de52
Commit
5227de52
authored
1 year ago
by
Giovanni La Mura
Browse files
Options
Downloads
Patches
Plain Diff
Implement the ScattererConfiguration comparison operator
parent
903c0acb
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/libnptm/Configuration.cpp
+37
-14
37 additions, 14 deletions
src/libnptm/Configuration.cpp
with
37 additions
and
14 deletions
src/libnptm/Configuration.cpp
+
37
−
14
View file @
5227de52
...
...
@@ -1111,16 +1111,29 @@ void ScattererConfiguration::write_formatted(string file_name) {
}
bool
ScattererConfiguration
::
operator
==
(
ScattererConfiguration
&
other
)
{
if
(
reference_variable_name
.
compare
(
other
.
reference_variable_name
)
!=
0
)
return
false
;
if
(
number_of_spheres
!=
other
.
number_of_spheres
)
return
false
;
if
(
number_of_scales
!=
other
.
number_of_scales
)
return
false
;
if
(
idfc
!=
other
.
idfc
)
return
false
;
if
(
exdc
!=
other
.
exdc
)
return
false
;
if
(
wp
!=
other
.
wp
)
return
false
;
if
(
xip
!=
other
.
xip
)
return
false
;
if
(
use_external_sphere
!=
other
.
use_external_sphere
)
return
false
;
if
(
number_of_spheres
!=
other
.
number_of_spheres
)
{
return
false
;
}
if
(
number_of_scales
!=
other
.
number_of_scales
)
{
return
false
;
}
if
(
idfc
!=
other
.
idfc
)
{
return
false
;
}
if
(
exdc
!=
other
.
exdc
)
{
return
false
;
}
if
(
wp
!=
other
.
wp
)
{
return
false
;
}
if
(
xip
!=
other
.
xip
)
{
return
false
;
}
//if (use_external_sphere != other.use_external_sphere) return false;
for
(
int
svi
=
0
;
svi
<
number_of_scales
;
svi
++
)
if
(
scale_vec
[
svi
]
!=
other
.
scale_vec
[
svi
])
return
false
;
if
(
scale_vec
[
svi
]
!=
other
.
scale_vec
[
svi
])
{
return
false
;
}
int
dj_index
=
0
;
for
(
int
dj
=
0
;
dj
<
number_of_spheres
;
dj
++
)
{
bool
check_matrixes
=
false
;
...
...
@@ -1128,15 +1141,25 @@ bool ScattererConfiguration::operator ==(ScattererConfiguration &other) {
dj_index
=
iog_vec
[
dj
]
-
1
;
check_matrixes
=
true
;
}
if
(
iog_vec
[
dj
]
!=
other
.
iog_vec
[
dj
])
return
false
;
if
(
radii_of_spheres
[
dj_index
]
!=
other
.
radii_of_spheres
[
dj_index
])
return
false
;
if
(
iog_vec
[
dj
]
!=
other
.
iog_vec
[
dj
])
{
return
false
;
}
if
(
radii_of_spheres
[
dj_index
]
!=
other
.
radii_of_spheres
[
dj_index
])
{
return
false
;
}
int
layers
=
nshl_vec
[
dj_index
];
if
(
layers
!=
other
.
nshl_vec
[
dj_index
])
return
false
;
if
(
layers
!=
other
.
nshl_vec
[
dj_index
])
{
return
false
;
}
if
(
check_matrixes
)
{
for
(
int
di
=
0
;
di
<
layers
;
di
++
)
{
if
(
rcf
[
dj_index
][
di
]
!=
other
.
rcf
[
dj_index
][
di
])
return
false
;
if
(
rcf
[
dj_index
][
di
]
!=
other
.
rcf
[
dj_index
][
di
])
{
return
false
;
}
for
(
int
dk
=
0
;
dk
<
number_of_scales
;
dk
++
)
{
if
(
dc0_matrix
[
di
][
dj_index
][
dk
]
!=
other
.
dc0_matrix
[
di
][
dj_index
][
dk
])
return
false
;
if
(
dc0_matrix
[
di
][
dj_index
][
dk
]
!=
other
.
dc0_matrix
[
di
][
dj_index
][
dk
])
{
return
false
;
}
}
// dk loop
}
// di loop
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment