Macaulay2 Engine
Loading...
Searching...
No Matches
pcomparator.hpp
Go to the documentation of this file.
1
/*****************************************************************************
2
* Copyright (C) 2006-2011 by Mikhail V. Zinin *
3
* mzinin@gmail.com *
4
* *
5
* You may redistribute this file under the terms of the GNU General *
6
* Public License as published by the Free Software Foundation, either *
7
* version 2 of the License, or any later version. *
8
*****************************************************************************/
9
10
#ifndef BIBASIS_PCOMPARATOR_HPP
11
#define BIBASIS_PCOMPARATOR_HPP
12
38
39
#include <string>
40
#include "
error.h
"
41
42
namespace
BIBasis
43
{
44
template
<
class
T>
class
PointerLessComparator
45
{
46
public
:
47
bool
operator()
(
const
T
*
const
&
p1
,
const
T
*
const
& p2)
48
{
49
if
(!
p1
|| !p2)
50
{
51
throw
std::string(
"BIBasis::PointerLessComparator::operator(): at least one argument is NULL."
);
52
}
53
return
*
p1
< *p2;
54
}
55
};
56
57
template
<
class
T>
class
PointerMoreComparator
58
{
59
public
:
60
bool
operator()
(
const
T
*
const
&
p1
,
const
T
*
const
& p2)
61
{
62
if
(!
p1
|| !p2)
63
{
64
throw
std::string(
"BIBasis::PointerMoreComparator::operator(): at least one argument is NULL."
);
65
}
66
return
*
p1
> *p2;
67
}
68
};
69
}
70
71
#endif
//BIBASIS_PCONPARATOR_HPP
BIBasis::PointerLessComparator::operator()
bool operator()(const T *const &p1, const T *const &p2)
Definition
pcomparator.hpp:47
BIBasis::PointerLessComparator
Definition
pcomparator.hpp:45
BIBasis::PointerMoreComparator::operator()
bool operator()(const T *const &p1, const T *const &p2)
Definition
pcomparator.hpp:60
BIBasis::PointerMoreComparator
Definition
pcomparator.hpp:58
error.h
Engine error-reporting primitives: ERROR, INTERNAL_ERROR, error, error_message.
p1
int p1
Definition
godboltTest.cpp:35
BIBasis
Definition
allocator.cpp:21
T
#define T
Definition
table.c:13
Macaulay2
e
bibasis
pcomparator.hpp
Generated on
for Macaulay2 Engine by
1.15.0