Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Koch
dune-common
Commits
52d36ddd
Commit
52d36ddd
authored
11 years ago
by
Oliver Sander
Browse files
Options
Downloads
Patches
Plain Diff
[cleanup] Move complex conjugation et al to math.hh
parent
8d811aff
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/common/math.hh
+22
-0
22 additions, 0 deletions
dune/common/math.hh
dune/common/misc.hh
+0
-24
0 additions, 24 deletions
dune/common/misc.hh
with
22 additions
and
24 deletions
dune/common/math.hh
+
22
−
0
View file @
52d36ddd
...
...
@@ -96,7 +96,29 @@ namespace Dune
enum
{
factorial
=
1
};
};
//! compute conjugate complex of x
// conjugate complex does nothing for non-complex types
template
<
class
K
>
inline
K
conjugateComplex
(
const
K
&
x
)
{
return
x
;
}
#ifndef DOXYGEN
// specialization for complex
template
<
class
K
>
inline
std
::
complex
<
K
>
conjugateComplex
(
const
std
::
complex
<
K
>&
c
)
{
return
std
::
complex
<
K
>
(
c
.
real
(),
-
c
.
imag
());
}
#endif
//! Return the sign of the value
template
<
class
T
>
int
sign
(
const
T
&
val
)
{
return
(
val
<
0
?
-
1
:
1
);
}
}
...
...
This diff is collapsed.
Click to expand it.
dune/common/misc.hh
+
0
−
24
View file @
52d36ddd
...
...
@@ -31,30 +31,6 @@ namespace Dune {
@{
*/
//! compute conjugate complex of x
// conjugate complex does nothing for non-complex types
template
<
class
K
>
inline
K
conjugateComplex
(
const
K
&
x
)
{
return
x
;
}
#ifndef DOXYGEN
// specialization for complex
template
<
class
K
>
inline
std
::
complex
<
K
>
conjugateComplex
(
const
std
::
complex
<
K
>&
c
)
{
return
std
::
complex
<
K
>
(
c
.
real
(),
-
c
.
imag
());
}
#endif
//! Return the sign of the value
template
<
class
T
>
int
sign
(
const
T
&
val
)
{
return
(
val
<
0
?
-
1
:
1
);
}
/** \brief Compute the square of T */
/**
* \code
...
...
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