carl
24.04
Computer ARithmetic Library
MultivariatePolynomial_Create.cpp
Go to the documentation of this file.
1
#include <iostream>
2
3
#include <
carl-arith/core/Variable.h
>
4
#include <
carl-arith/poly/umvpoly/MultivariatePolynomial.h
>
5
#include <
carl-arith/numbers/numbers.h
>
6
7
#ifdef USE_CLN_NUMBERS
8
#include <cln/cln.h>
9
typedef
cln::cl_RA
Rational
;
10
typedef
cln::cl_I
Integer
;
11
#else
12
#include <gmpxx.h>
13
typedef
mpq_class
Rational
;
14
typedef
mpz_class
Integer
;
15
#endif
16
17
int
main
() {
18
carl::Variable
x =
carl::fresh_real_variable
(
"x"
);
19
carl::Variable
y =
carl::fresh_real_variable
(
"y"
);
20
21
/*
22
* A carl::MultivariatePolynomial represents a monomial in multiple
23
* variables. It consists of a vector of carl::Term objects that consist of
24
* a carl::Monomial and a coefficient.
25
*/
26
27
carl::MultivariatePolynomial<Rational>
p(x*y);
28
std::cout << p << std::endl;
29
}
Variable.h
numbers.h
MultivariatePolynomial.h
Rational
mpq_class Rational
Definition:
MultivariatePolynomial_Create.cpp:13
main
int main()
Definition:
MultivariatePolynomial_Create.cpp:17
Integer
mpz_class Integer
Definition:
MultivariatePolynomial_Create.cpp:14
carl::fresh_real_variable
Variable fresh_real_variable() noexcept
Definition:
VariablePool.h:198
carl::Variable
A Variable represents an algebraic variable that can be used throughout carl.
Definition:
Variable.h:85
carl::MultivariatePolynomial< Rational >
examples
tutorial
MultivariatePolynomial_Create.cpp
Generated by
1.9.1