Skip to content

Commit cc5033d

Browse files
committed
Add promoters from RRi and CCi to quotient rings
1 parent 7bc6156 commit cc5033d

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

M2/Macaulay2/e/polyquotient.hpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,18 @@ class PolyRingQuotient : public PolyRingFlat
7575
normal_form(result);
7676
return ret;
7777
}
78+
virtual bool from_Interval(gmp_RRi a, ring_elem &result) const
79+
{
80+
bool ret = numerR_->from_Interval(a, result);
81+
normal_form(result);
82+
return ret;
83+
}
84+
virtual bool from_ComplexInterval(gmp_CCi a, ring_elem &result) const
85+
{
86+
bool ret = numerR_->from_ComplexInterval(a, result);
87+
normal_form(result);
88+
return ret;
89+
}
7890
virtual bool from_double(double a, ring_elem &result) const
7991
{
8092
bool ret = numerR_->from_double(a, result);

M2/Macaulay2/tests/normal/RRi.m2

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,13 @@ f = interval(1,3)*x + interval(3,5)*y + interval(5,7)*z
127127
use ring midpoint f
128128
assert(midpoint f == 2*x + 4*y + 6*z)
129129

130+
R = RRi[x]/x^2
131+
assert(promote(toRRi 2, R) == 2)
132+
133+
R = CCi[x]/x^2
134+
assert(promote(toRRi 2, R) == 2)
135+
assert(promote(toCCi 2, R) == 2)
136+
130137
--- TO FIX: ---------------------------------------------
131138

132139
-*

0 commit comments

Comments
 (0)