Skip to content

Comments

Adding missing operations#100

Merged
ahmed-irfan merged 15 commits intoSRI-CSL:masterfrom
Ovascos:fix-missing-operations
Nov 10, 2025
Merged

Adding missing operations#100
ahmed-irfan merged 15 commits intoSRI-CSL:masterfrom
Ovascos:fix-missing-operations

Conversation

@Ovascos
Copy link
Contributor

@Ovascos Ovascos commented Oct 27, 2025

Adds missing operations on the C++ interface:

  • make Context copy-able and a wrapper constructor for lp_polynomial_context_t
  • direct constructor for DyadicInterval(long) to avoid ambiguous implicit constructor calls
  • missing constructor DyadicRational(long), since DyadicRational(int) is present
  • Operators ==, !=, <, <=, >, and >= between Integer and long to avoid unnecessary implicit construction of Integer objects
  • Operators +=, -=, and *= as well as ==, !=, <, <=, >, and >= between Polynomial and Integer to avoid unnecessary construction of Polynomial objects with potentially incorrect context (partially fixes Operators are not context aware #97)

@Ovascos Ovascos force-pushed the fix-missing-operations branch from 9461393 to 421c5d2 Compare October 29, 2025 00:39
@daniel-larraz
Copy link

After these changes, creating a constant polynomial like this:

poly::Polynomial p1 = poly::Polynomial(ctx, 1);

no longer works. The integer value now needs to be wrapped explicitly:

poly::Polynomial p1 = poly::Polynomial(ctx, poly::Integer(1));

I'm not sure this is the intended behavior.

@Ovascos
Copy link
Contributor Author

Ovascos commented Oct 29, 2025

I'm not sure this is the intended behavior.

Of course not. Fixed.

@Ovascos
Copy link
Contributor Author

Ovascos commented Oct 29, 2025

The last commit added explicit to the constructor of Variable which might be a braking change. Let's wait some days for user feedback before merging.

@ahmed-irfan ahmed-irfan merged commit ac1c13e into SRI-CSL:master Nov 10, 2025
8 checks passed
@Ovascos Ovascos deleted the fix-missing-operations branch November 12, 2025 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Operators are not context aware

3 participants