Generated on for Gecode by doxygen 1.17.0

Operations for square and square-root propagators. More...

#include <gecode/int/arithmetic.hh>

Public Member Functions

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

Detailed Description

Operations for square and square-root propagators.

Requires

Definition at line 302 of file arithmetic.hh.

Member Function Documentation

◆ even()

bool Gecode::Int::Arithmetic::SqrOps::even ( void ) const
inline

Return whether exponent is even.

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

◆ exp() [1/2]

int Gecode::Int::Arithmetic::SqrOps::exp ( void ) const
inline

Return exponent.

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

◆ exp() [2/2]

void Gecode::Int::Arithmetic::SqrOps::exp ( int m)
inline

Set exponent to m.

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

◆ pow()

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

Return \(x^2\).

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

◆ tpow()

int Gecode::Int::Arithmetic::SqrOps::tpow ( int x) const
inline

Return \(x^2\) truncated to integer limits.

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

◆ fnroot()

int Gecode::Int::Arithmetic::SqrOps::fnroot ( int x) const
inline

Return \(\lfloor \sqrt{x}\rfloor\) where x must be non-negative and \(n>0\).

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

◆ cnroot()

int Gecode::Int::Arithmetic::SqrOps::cnroot ( int x) const
inline

Return \(\lceil \sqrt{x}\rceil\) where x must be non-negative and \(n>0\).

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


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