COPASI API  4.16.103
Public Member Functions | List of all members
CNormalLogical::SetSorter< TYPE > Class Template Reference

#include <CNormalLogical.h>

Public Member Functions

bool isEqual (const std::pair< TYPE *, bool > &lhs, const std::pair< TYPE *, bool > &rhs) const
 
bool operator() (const std::pair< TYPE *, bool > &lhs, const std::pair< TYPE *, bool > &rhs) const
 

Detailed Description

template<typename TYPE>
class CNormalLogical::SetSorter< TYPE >

Definition at line 40 of file CNormalLogical.h.

Member Function Documentation

template<typename TYPE>
bool CNormalLogical::SetSorter< TYPE >::isEqual ( const std::pair< TYPE *, bool > &  lhs,
const std::pair< TYPE *, bool > &  rhs 
) const
inline

This routine compares a set and returns true if the first argument is equal to the second.

Definition at line 71 of file CNormalLogical.h.

Referenced by CNormalLogical::SetOfSetsSorter< TYPE >::isEqual().

73  {
74  bool result = true;
75 
76  if (!(lhs.second == rhs.second && (*lhs.first) == (*rhs.first)))
77  {
78  result = false;
79  }
80 
81  return result;
82  }
template<typename TYPE>
bool CNormalLogical::SetSorter< TYPE >::operator() ( const std::pair< TYPE *, bool > &  lhs,
const std::pair< TYPE *, bool > &  rhs 
) const
inline

This routine compares a set and returns true if the first argument is smaller than the second.

Definition at line 47 of file CNormalLogical.h.

49  {
50  bool result = false;
51 
52  // the compiler warnings about broken strict aliasing rules
53  // that are issued by e.g. gcc 4.4.5 on linux are bogus
54  // see GCC Bug 39390
55  if (lhs.second == rhs.second)
56  {
57  result = ((*lhs.first) < (*rhs.first));
58  }
59  else if (lhs.second == true)
60  {
61  result = true;
62  }
63 
64  return result;
65  }

The documentation for this class was generated from the following file: