carl  24.04
Computer ARithmetic Library
helper.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 /**
6  * Helpers due to the shortcomings of libpoly's C++ API.
7  *
8  */
9 namespace carl::poly_helper {
10 
11 inline lp_polynomial_t* construct_lp_poly(const lp_polynomial_context_t* c, lp_variable_t v) {
12  lp_polynomial_t* p = lp_polynomial_alloc();
13  lp_polynomial_construct_simple(p, c, mpz_class(1).get_mpz_t(), v, 1);
14  return p;
15 }
16 
17 inline lp_polynomial_t* construct_lp_poly(const lp_polynomial_context_t* c, const mpz_class& i) {
18  lp_polynomial_t* p = lp_polynomial_alloc();
19  lp_polynomial_construct_simple(p, c, i.get_mpz_t(), lp_variable_null, 0) ;
20  return p;
21 }
22 
23 }
Helpers due to the shortcomings of libpoly's C++ API.
Definition: helper.h:9
lp_polynomial_t * construct_lp_poly(const lp_polynomial_context_t *c, lp_variable_t v)
Definition: helper.h:11