Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Oleksii Turkot
CrystFEL
Commits
95a2d852
Commit
95a2d852
authored
Oct 22, 2020
by
Thomas White
Browse files
compare_cell_parameters: Accept R/P pair as equivalent
See
0f18ff76
for some discussion.
parent
3b277295
Changes
1
Hide whitespace changes
Inline
Side-by-side
libcrystfel/src/cell-utils.c
View file @
95a2d852
...
...
@@ -1270,6 +1270,18 @@ double cell_get_volume(UnitCell *cell)
}
/* Return true if the two centering symbols are identical,
* or if they are a pair of R/P, which should be considered the
* same for the purposes of cell comparison */
static
int
centering_equivalent
(
char
cen1
,
char
cen2
)
{
if
(
cen1
==
cen2
)
return
1
;
if
(
(
cen1
==
'P'
)
&&
(
cen2
==
'R'
)
)
return
1
;
if
(
(
cen1
==
'R'
)
&&
(
cen2
==
'P'
)
)
return
1
;
return
0
;
}
/**
* \param cell: A UnitCell
* \param reference: Another UnitCell
...
...
@@ -1294,7 +1306,8 @@ int compare_cell_parameters(UnitCell *cell, UnitCell *reference,
/* Centering must match: we don't arbitrate primitive vs centered,
* different cell choices etc */
if
(
cell_get_centering
(
cell
)
!=
cell_get_centering
(
reference
)
)
return
0
;
if
(
!
centering_equivalent
(
cell_get_centering
(
cell
),
cell_get_centering
(
reference
))
)
return
0
;
cell_get_parameters
(
cell
,
&
a1
,
&
b1
,
&
c1
,
&
al1
,
&
be1
,
&
ga1
);
cell_get_parameters
(
reference
,
&
a2
,
&
b2
,
&
c2
,
&
al2
,
&
be2
,
&
ga2
);
...
...
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