carl  24.04
Computer ARithmetic Library
operations.h File Reference
#include <carl-common/meta/platform.h>
#include "include.h"
#include "typetraits.h"
#include <climits>
#include <cmath>
#include <cstddef>
#include <iostream>
#include <sstream>
#include <vector>
Include dependency graph for operations.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 carl
 carl is the main namespace for the library.
 

Functions

bool carl::is_zero (const mpz_class &n)
 Informational functions. More...
 
bool carl::is_zero (const mpq_class &n)
 
bool carl::is_one (const mpz_class &n)
 
bool carl::is_one (const mpq_class &n)
 
bool carl::is_positive (const mpz_class &n)
 
bool carl::is_positive (const mpq_class &n)
 
bool carl::is_negative (const mpz_class &n)
 
bool carl::is_negative (const mpq_class &n)
 
mpz_class carl::get_num (const mpq_class &n)
 
mpz_class carl::get_num (const mpz_class &n)
 
mpz_class carl::get_denom (const mpq_class &n)
 
mpz_class carl::get_denom (const mpz_class &n)
 
bool carl::is_integer (const mpq_class &n)
 
bool carl::is_integer (const mpz_class &)
 
std::size_t carl::bitsize (const mpz_class &n)
 Get the bit size of the representation of a integer. More...
 
std::size_t carl::bitsize (const mpq_class &n)
 Get the bit size of the representation of a fraction. More...
 
double carl::to_double (const mpq_class &n)
 Conversion functions. More...
 
double carl::to_double (const mpz_class &n)
 
template<typename Integer >
Integer carl::to_int (const mpz_class &n)
 
template<>
sint carl::to_int< sint > (const mpz_class &n)
 
template<>
uint carl::to_int< uint > (const mpz_class &n)
 
template<typename Integer >
Integer carl::to_int (const mpq_class &n)
 
template<>
mpz_class carl::to_int< mpz_class > (const mpq_class &n)
 Convert a fraction to an integer. More...
 
template<typename To , typename From >
To carl::from_int (const From &n)
 
template<>
cln::cl_I carl::from_int (const uint &n)
 
template<>
cln::cl_I carl::from_int (const sint &n)
 
template<>
sint carl::to_int< sint > (const mpq_class &n)
 Convert a fraction to an unsigned. More...
 
template<>
uint carl::to_int< uint > (const mpq_class &n)
 
template<typename T >
carl::rationalize (const PreventConversion< mpq_class > &)
 
template<>
mpq_class carl::rationalize< mpq_class > (float n)
 
template<>
mpq_class carl::rationalize< mpq_class > (double n)
 
template<>
mpq_class carl::rationalize< mpq_class > (int n)
 
template<>
mpq_class carl::rationalize< mpq_class > (uint n)
 
template<>
mpq_class carl::rationalize< mpq_class > (sint n)
 
template<>
mpq_class carl::rationalize< mpq_class > (const PreventConversion< mpq_class > &n)
 
template<>
mpz_class carl::parse< mpz_class > (const std::string &n)
 
template<>
bool carl::try_parse< mpz_class > (const std::string &n, mpz_class &res)
 
template<>
mpq_class carl::parse< mpq_class > (const std::string &n)
 
template<>
bool carl::try_parse< mpq_class > (const std::string &n, mpq_class &res)
 
mpz_class carl::abs (const mpz_class &n)
 Basic Operators. More...
 
mpq_class carl::abs (const mpq_class &n)
 
mpz_class carl::round (const mpq_class &n)
 
mpz_class carl::round (const mpz_class &n)
 
mpz_class carl::floor (const mpq_class &n)
 
mpz_class carl::floor (const mpz_class &n)
 
mpz_class carl::ceil (const mpq_class &n)
 
mpz_class carl::ceil (const mpz_class &n)
 
mpz_class carl::gcd (const mpz_class &a, const mpz_class &b)
 
mpz_class carl::lcm (const mpz_class &a, const mpz_class &b)
 
mpq_class carl::gcd (const mpq_class &a, const mpq_class &b)
 
mpz_class & carl::gcd_assign (mpz_class &a, const mpz_class &b)
 Calculate the greatest common divisor of two integers. More...
 
mpq_class & carl::gcd_assign (mpq_class &a, const mpq_class &b)
 Calculate the greatest common divisor of two integers. More...
 
mpq_class carl::lcm (const mpq_class &a, const mpq_class &b)
 
mpq_class carl::log (const mpq_class &n)
 
mpq_class carl::log10 (const mpq_class &n)
 
mpq_class carl::sin (const mpq_class &n)
 
mpq_class carl::cos (const mpq_class &n)
 
template<>
mpz_class carl::pow (const mpz_class &basis, std::size_t exp)
 
template<>
mpq_class carl::pow (const mpq_class &basis, std::size_t exp)
 
bool carl::sqrt_exact (const mpq_class &a, mpq_class &b)
 Calculate the square root of a fraction if possible. More...
 
mpq_class carl::sqrt (const mpq_class &a)
 
std::pair< mpq_class, mpq_class > carl::sqrt_safe (const mpq_class &a)
 
std::pair< mpq_class, mpq_class > carl::root_safe (const mpq_class &a, uint n)
 Calculate the nth root of a fraction. More...
 
std::pair< mpq_class, mpq_class > carl::sqrt_fast (const mpq_class &a)
 Compute square root in a fast but less precise way. More...
 
mpz_class carl::mod (const mpz_class &n, const mpz_class &m)
 
mpz_class carl::remainder (const mpz_class &n, const mpz_class &m)
 
mpz_class carl::quotient (const mpz_class &n, const mpz_class &d)
 
mpz_class carl::operator/ (const mpz_class &n, const mpz_class &d)
 
mpq_class carl::quotient (const mpq_class &n, const mpq_class &d)
 
mpq_class carl::operator/ (const mpq_class &n, const mpq_class &d)
 
void carl::divide (const mpz_class &dividend, const mpz_class &divisor, mpz_class &quotient, mpz_class &remainder)
 
mpq_class carl::div (const mpq_class &a, const mpq_class &b)
 Divide two fractions. More...
 
mpz_class carl::div (const mpz_class &a, const mpz_class &b)
 Divide two integers. More...
 
mpz_class & carl::div_assign (mpz_class &a, const mpz_class &b)
 Divide two integers. More...
 
mpq_class & carl::div_assign (mpq_class &a, const mpq_class &b)
 Divide two integers. More...
 
mpq_class carl::reciprocal (const mpq_class &a)
 
mpq_class carl::operator* (const mpq_class &lhs, const mpq_class &rhs)
 
std::string carl::toString (const mpq_class &_number, bool _infix)
 
std::string carl::toString (const mpz_class &_number, bool _infix)
 

Detailed Description

Author
Gereon Kremer gereo.nosp@m.n.kr.nosp@m.emer@.nosp@m.cs.r.nosp@m.wth-a.nosp@m.ache.nosp@m.n.de
Sebastian Junges
Warning
This file should never be included directly but only via operations.h

Definition in file operations.h.