Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
usadelndsoc
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
JYU Condensed Matter Theory
usadelndsoc
Commits
5c0c54dc
Commit
5c0c54dc
authored
11 months ago
by
patavirt
Browse files
Options
Downloads
Patches
Plain Diff
src: CppAD 2024 wants ordered complex numbers
Fix compilation error. Define lexical order for complex numbers.
parent
b51b2de4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/common.hpp
+4
-0
4 additions, 0 deletions
src/common.hpp
with
4 additions
and
0 deletions
src/common.hpp
+
4
−
0
View file @
5c0c54dc
...
...
@@ -63,6 +63,10 @@ namespace CppAD {
COMMON_HPP_DECLARE_BINOP
(
*
);
COMMON_HPP_DECLARE_BINOP
(
/
);
#undef COMMON_HPP_DECLARE_BINOP
/* CppAD needs comparisons; use lexical order for complex */
bool
operator
<=
(
const
Complex
&
a
,
const
Complex
&
b
)
{
return
a
.
real
()
==
b
.
real
()
?
(
a
.
imag
()
<=
b
.
imag
())
:
(
a
.
real
()
<=
b
.
real
());
}
bool
operator
<
(
const
Complex
&
a
,
const
Complex
&
b
)
{
return
a
.
real
()
==
b
.
real
()
?
(
a
.
imag
()
<
b
.
imag
())
:
(
a
.
real
()
<
b
.
real
());
}
}
#endif
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