Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F19244548
ComplexComparesFalse.hh
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
ComplexComparesFalse.hh
View Options
#ifndef NPSTAT_COMPLEXCOMPARESFALSE_HH_
#define NPSTAT_COMPLEXCOMPARESFALSE_HH_
/*!
// \file ComplexComparesFalse.hh
//
// \brief Ordering extended to complex numbers by always returning "false"
//
// Author: I. Volobouev
//
// January 2012
*/
#include
<complex>
namespace
npstat
{
/**
// This template compares two numbers. For simple numeric types
// (int, double, etc) the numbers themselves are compared while for
// std::complex<...> types "false" is returned for every comparison.
*/
template
<
class
T
>
struct
ComplexComparesFalse
{
inline
static
bool
less
(
const
T
&
l
,
const
T
&
r
)
{
return
l
<
r
;}
inline
static
bool
more
(
const
T
&
l
,
const
T
&
r
)
{
return
l
>
r
;}
};
template
<
class
T
>
struct
ComplexComparesFalse
<
std
::
complex
<
T
>
>
{
inline
static
bool
less
(
const
std
::
complex
<
T
>&
,
const
std
::
complex
<
T
>&
)
{
return
false
;}
inline
static
bool
more
(
const
std
::
complex
<
T
>&
,
const
std
::
complex
<
T
>&
)
{
return
false
;}
};
}
#endif
// NPSTAT_COMPLEXCOMPARESFALSE_HH_
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Tue, Sep 30, 4:43 AM (1 d, 19 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
6528983
Default Alt Text
ComplexComparesFalse.hh (1 KB)
Attached To
Mode
rNPSTATSVN npstatsvn
Attached
Detach File
Event Timeline
Log In to Comment