[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #59229] Regression in handling inf as for-loop
From: |
anonymous |
Subject: |
[Octave-bug-tracker] [bug #59229] Regression in handling inf as for-loop limits |
Date: |
Tue, 6 Oct 2020 09:33:21 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:81.0) Gecko/20100101 Firefox/81.0 |
URL:
<https://savannah.gnu.org/bugs/?59229>
Summary: Regression in handling inf as for-loop limits
Project: GNU Octave
Submitted by: None
Submitted on: Tue 06 Oct 2020 01:33:19 PM UTC
Category: Interpreter
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Regression
Status: None
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Release: dev
Discussion Lock: Any
Operating System: GNU/Linux
_______________________________________________________
Details:
This code used to work in Octave 5.2 but now causes an out of memory error in
Octave 7.0.0 (dev):
lo = +inf;
hi = -inf;
# lo and hi are refined here as required by the problem instance
# If the instance is empty, then lo and hi are unchanged.
for i = lo:hi
# do something
endfor
# The idea is that for empty problem instances,
# the for-loop would become empty as well and trivially backtrack.
This used to work as intended but now results in this error in Octave 7.0.0:
error: out of memory or dimension too large for Octave's index type
The problem is specific to the use of inf or -inf in for-loop limits, because
the following loop does not cause an error:
lo = +1e30; # some value much bigger than memory would allow
hi = -1e30;
for i = lo:hi
# do something
endfor
# Empty loop trivially exits.
The problem has been temporarily worked around by using a very large finite
value instead of inf.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?59229>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #59229] Regression in handling inf as for-loop limits,
anonymous <=