Generated on Sat Feb 7 2015 02:01:45 for Gecode by doxygen 1.8.9.1
Gecode::Int::Arithmetic::PowOps Class Reference

Operations for power and nroot propagators. More...

#include <arithmetic.hh>

Public Member Functions

 PowOps (int n)
 Initialize with exponent n. More...
 
bool even (void) const
 Return whether exponent is even. More...
 
int exp (void) const
 Return exponent. More...
 
void exp (int m)
 Set exponent to m. More...
 
template<class IntType >
IntType pow (IntType x) const
 Return $x^n$ where $n>0$. More...
 
int tpow (int x) const
 Return $x^n$ where $n>0$ truncated to integer limits. More...
 
int fnroot (int x) const
 Return $\lfloor \sqrt[n]{x}\rfloor$ where x must be non-negative and $n>0$. More...
 
int cnroot (int x) const
 Return $\lceil \sqrt[n]{x}\rceil$ where x must be non-negative and $n>0$. More...
 

Protected Member Functions

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

Static Protected Member Functions

static bool even (int m)
 Return whether m is even. More...
 

Protected Attributes

int n
 The exponent and root index. More...
 

Detailed Description

Operations for power and nroot propagators.

Requires

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)
inlinestaticprotected

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
inlineprotected

Test whether $r^n>x$.

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

bool Gecode::Int::Arithmetic::PowOps::powle ( long long int  r,
int  x 
) const
inlineprotected

Test whether $r^n<x$.

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.

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

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

Definition at line 65 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 79 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 119 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 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: