CBMC
Loading...
Searching...
No Matches
algebraic_numbert Class Reference

Represents real numbers as roots (zeros) of a polynomial with rational coefficients. More...

#include <algebraic_number.h>

+ Collaboration diagram for algebraic_numbert:

Public Member Functions

 algebraic_numbert (const std::vector< rationalt > &coeff)
 Represent a real number as roots of a polynomial with rational coefficients coeff.
 
 algebraic_numbert ()
 The default constructor builds a algebraic_numbert representing real number 0.
 
 algebraic_numbert (const rationalt &r)
 Represent a rational number as algebraic_numbert.
 
constant_exprt as_expr () const
 
const coefficientstget_coefficients () const
 

Protected Types

using coefficientst = std::vector< rationalt >
 

Protected Attributes

coefficientst coefficients
 

Detailed Description

Represents real numbers as roots (zeros) of a polynomial with rational coefficients.

Cannot represent transcendental numbers.

Definition at line 17 of file algebraic_number.h.

Member Typedef Documentation

◆ coefficientst

Definition at line 21 of file algebraic_number.h.

Constructor & Destructor Documentation

◆ algebraic_numbert() [1/3]

algebraic_numbert::algebraic_numbert ( const std::vector< rationalt > &  coeff)
inlineexplicit

Represent a real number as roots of a polynomial with rational coefficients coeff.

Definition at line 27 of file algebraic_number.h.

◆ algebraic_numbert() [2/3]

algebraic_numbert::algebraic_numbert ( )
inline

The default constructor builds a algebraic_numbert representing real number 0.

Definition at line 35 of file algebraic_number.h.

◆ algebraic_numbert() [3/3]

algebraic_numbert::algebraic_numbert ( const rationalt r)
inlineexplicit

Represent a rational number as algebraic_numbert.

Definition at line 40 of file algebraic_number.h.

Member Function Documentation

◆ as_expr()

constant_exprt algebraic_numbert::as_expr ( ) const

Definition at line 17 of file algebraic_number.cpp.

◆ get_coefficients()

const coefficientst & algebraic_numbert::get_coefficients ( ) const
inline

Definition at line 47 of file algebraic_number.h.

Member Data Documentation

◆ coefficients

coefficientst algebraic_numbert::coefficients
protected

Definition at line 22 of file algebraic_number.h.


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