Gecode::Int::Arithmetic::PowOps Class Reference
[Integer propagators]
Operations for power and nroot propagators. More...
#include <arithmetic.hh>
Public Member Functions | |
PowOps (int n) | |
Initialize with exponent n. | |
bool | even (void) const |
Return whether exponent is even. | |
int | exp (void) const |
Return exponent. | |
void | exp (int m) |
Set exponent to m. | |
template<class IntType > | |
IntType | pow (IntType x) const |
Return ![]() ![]() | |
int | tpow (int x) const |
Return ![]() ![]() | |
int | fnroot (int x) const |
Return ![]() ![]() | |
int | cnroot (int x) const |
Return ![]() ![]() | |
Protected Member Functions | |
bool | powgr (long long int r, int x) const |
Test whether ![]() | |
bool | powle (long long int r, int x) const |
Test whether ![]() | |
Static Protected Member Functions | |
static bool | even (int m) |
Return whether m is even. | |
Protected Attributes | |
int | n |
The exponent and root index. |
Detailed Description
Operations for power and nroot propagators.
Requires
#include <gecode/int/arithmetic.hh>
Definition at line 329 of file arithmetic.hh.
Constructor & Destructor Documentation
Gecode::Int::Arithmetic::PowOps::PowOps | ( | int | n | ) | [inline] |
Initialize with exponent n.
Definition at line 41 of file pow-ops.hpp.
Member Function Documentation
bool Gecode::Int::Arithmetic::PowOps::even | ( | int | m | ) | [inline, static, protected] |
Return whether m is even.
Definition at line 44 of file pow-ops.hpp.
bool Gecode::Int::Arithmetic::PowOps::powgr | ( | long long int | r, | |
int | x | |||
) | const [inline, protected] |
Test whether .
Definition at line 98 of file pow-ops.hpp.
bool Gecode::Int::Arithmetic::PowOps::powle | ( | long long int | r, | |
int | x | |||
) | const [inline, protected] |
Test whether .
Definition at line 136 of file pow-ops.hpp.
bool Gecode::Int::Arithmetic::PowOps::even | ( | void | ) | const [inline] |
Return whether exponent is even.
Definition at line 49 of file pow-ops.hpp.
int Gecode::Int::Arithmetic::PowOps::exp | ( | void | ) | const [inline] |
Return exponent.
Definition at line 54 of file pow-ops.hpp.
void Gecode::Int::Arithmetic::PowOps::exp | ( | int | m | ) | [inline] |
Set exponent to m.
Definition at line 59 of file pow-ops.hpp.
IntType Gecode::Int::Arithmetic::PowOps::pow | ( | IntType | x | ) | const [inline] |
Return where
.
Definition at line 65 of file pow-ops.hpp.
int Gecode::Int::Arithmetic::PowOps::tpow | ( | int | x | ) | const [inline] |
Return where
truncated to integer limits.
Definition at line 79 of file pow-ops.hpp.
int Gecode::Int::Arithmetic::PowOps::fnroot | ( | int | x | ) | const [inline] |
Return where x must be non-negative and
.
Definition at line 119 of file pow-ops.hpp.
int Gecode::Int::Arithmetic::PowOps::cnroot | ( | int | x | ) | const [inline] |
Return where x must be non-negative and
.
Definition at line 157 of file pow-ops.hpp.
Member Data Documentation
int Gecode::Int::Arithmetic::PowOps::n [protected] |
The exponent and root index.
Definition at line 332 of file arithmetic.hh.
The documentation for this class was generated from the following files:
- gecode/int/arithmetic.hh (Revision: 14362)
- gecode/int/arithmetic/pow-ops.hpp (Revision: 13987)