Generated on Fri Oct 19 11:26:05 2018 for Gecode by doxygen 1.6.3

Gecode::Int::Arithmetic::PowOps Class Reference
[Integer propagators]

Operations for power and nroot propagators. More...

#include <arithmetic.hh>

List of all members.

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 $x^n$ where $n>0$.
int tpow (int x) const
 Return $x^n$ where $n>0$ truncated to integer limits.
int fnroot (int x) const
 Return $\lfloor \sqrt[n]{x}\rfloor$ where x must be non-negative and $n>0$.
int cnroot (int x) const
 Return $\lceil \sqrt[n]{x}\rceil$ where x must be non-negative and $n>0$.

Protected Member Functions

bool powgr (long long int r, int x) const
 Test whether $r^n>x$.
bool powle (long long int r, int x) const
 Test whether $r^n<x$.

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

Definition at line 327 of file arithmetic.hh.


Constructor & Destructor Documentation

Gecode::Int::Arithmetic::PowOps::PowOps ( int  n  )  [inline]

Initialize with exponent n.

Definition at line 37 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 40 of file pow-ops.hpp.

bool Gecode::Int::Arithmetic::PowOps::powgr ( long long int  r,
int  x 
) const [inline, protected]

Test whether $r^n>x$.

Definition at line 94 of file pow-ops.hpp.

bool Gecode::Int::Arithmetic::PowOps::powle ( long long int  r,
int  x 
) const [inline, protected]

Test whether $r^n<x$.

Definition at line 132 of file pow-ops.hpp.

bool Gecode::Int::Arithmetic::PowOps::even ( void   )  const [inline]

Return whether exponent is even.

Definition at line 45 of file pow-ops.hpp.

int Gecode::Int::Arithmetic::PowOps::exp ( void   )  const [inline]

Return exponent.

Definition at line 50 of file pow-ops.hpp.

void Gecode::Int::Arithmetic::PowOps::exp ( int  m  )  [inline]

Set exponent to m.

Definition at line 55 of file pow-ops.hpp.

template<class IntType >
IntType Gecode::Int::Arithmetic::PowOps::pow ( IntType  x  )  const [inline]

Return $x^n$ where $n>0$.

Definition at line 61 of file pow-ops.hpp.

int Gecode::Int::Arithmetic::PowOps::tpow ( int  x  )  const [inline]

Return $x^n$ where $n>0$ truncated to integer limits.

Definition at line 75 of file pow-ops.hpp.

int Gecode::Int::Arithmetic::PowOps::fnroot ( int  x  )  const [inline]

Return $\lfloor \sqrt[n]{x}\rfloor$ where x must be non-negative and $n>0$.

Definition at line 115 of file pow-ops.hpp.

int Gecode::Int::Arithmetic::PowOps::cnroot ( int  x  )  const [inline]

Return $\lceil \sqrt[n]{x}\rceil$ where x must be non-negative and $n>0$.

Definition at line 153 of file pow-ops.hpp.


Member Data Documentation

The exponent and root index.

Definition at line 330 of file arithmetic.hh.


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