Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions M2/Macaulay2/e/rings/frac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,13 @@ void FractionField::simplify(frac_elem *f) const
if (use_gcd_simplify)
{
y = f->denom;
if (R_->is_equal(y, R_->one())) return;
Comment thread
pzinn marked this conversation as resolved.
x = f->numer;
const RingElement *a = RingElement::make_raw(R_, x);
const RingElement *b = RingElement::make_raw(R_, y);
const RingElement *c = rawGCDRingElement(a, b, nullptr, false);
if (!c) return;
if (!R_->is_equal(y, R_->one()))
Comment thread
pzinn marked this conversation as resolved.
Outdated
{
x = f->numer;
const RingElement *a = RingElement::make_raw(R_, x);
const RingElement *b = RingElement::make_raw(R_, y);
const RingElement *c = rawGCDRingElement(a, b, nullptr, false);
if (!c) return;

#if 0
// Debugging code
Expand All @@ -131,10 +132,11 @@ void FractionField::simplify(frac_elem *f) const
o << newline;
emit(o.str());
#endif
if (!R_->is_equal(c->get_value(), R_->one()))
{
f->numer = R_->divide(f->numer, c->get_value());
f->denom = R_->divide(f->denom, c->get_value());
if (!R_->is_equal(c->get_value(), R_->one()))
{
f->numer = R_->divide(f->numer, c->get_value());
f->denom = R_->divide(f->denom, c->get_value());
}
}
// Now, let's take the content of the denominator, and divide the
// numerator
Expand Down
7 changes: 7 additions & 0 deletions M2/Macaulay2/tests/normal/matrix-equality.m2
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ debug Core
assert isWellDefined f
assert isWellDefined g
assert(f == g) -- fails in version 1.13

-- issue #4461 fix
F = frac(QQ[y])
a = matrix{{1/2}} * matrix{{y}}
b = matrix{{y/2}}
assert(a_(0,0) === b_(0,0))
assert(a == b)
end--

-- Local Variables:
Expand Down