Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Seitosh
Seitosh
Commits
e0c04d57
Commit
e0c04d57
authored
Feb 08, 2019
by
thomas.forbriger
Browse files
croposp [WP][FEATURE]: implement triple indexer
parent
953a25eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/ts/croposp/triples.cc
View file @
e0c04d57
...
...
@@ -61,8 +61,28 @@ namespace croposp {
const
unsigned
int
&
l
)
const
{
unsigned
int
retval
=
0
;
unsigned
int
npairs
=
this
->
pairs
();
unsigned
int
size
=
this
->
size
();
TFXX_assert
((
i
!=
k
)
&&
(
k
!=
l
)
&&
(
l
!=
i
),
"triple indices must be unique"
);
"triple indices must be unique; report this as a bug"
);
TFXX_assert
((
i
<
size
)
&&
(
k
<
size
)
&&
(
l
<
size
),
"index value(s) out of range; report this as a bug"
);
if
(
this
->
Mpairs_first
)
{
unsigned
int
ii
=
i
;
if
(
ii
>
k
)
{
--
ii
;
}
if
(
ii
>
l
)
{
--
ii
;
}
retval
=
this
->
Mpairs
.
operator
()(
k
,
l
)
+
ii
*
npairs
;
}
else
{
croposp
::
Pairs
pairs
(
size
-
1
);
unsigned
int
kk
=
k
;
unsigned
int
ll
=
l
;
if
(
kk
>
i
)
{
--
kk
;
}
if
(
ll
>
i
)
{
--
ll
;
}
retval
=
pairs
(
kk
,
ll
)
+
i
*
npairs
;
}
return
(
retval
);
}
// unsigned int Triples::operator()(const unsigned int& i,
// const unsigned int& k,
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment