octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #62870] reshape gives unexpected OOM/dim too l


From: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #62870] reshape gives unexpected OOM/dim too large error for improper size vector
Date: Sat, 6 Aug 2022 12:07:23 -0400 (EDT)

URL:
  <https://savannah.gnu.org/bugs/?62870>

                 Summary: reshape gives unexpected OOM/dim too large error for
improper size vector
                 Project: GNU Octave
               Submitter: nrjank
               Submitted: Sat 06 Aug 2022 12:07:22 PM EDT
                Category: Octave Function
                Severity: 2 - Minor
                Priority: 5 - Normal
              Item Group: Unexpected Error or Warning
                  Status: None
             Assigned to: None
         Originator Name: Nicholas Jankowski
        Originator Email: 
             Open/Closed: Open
                 Release: 7.2.0
         Discussion Lock: Any
        Operating System: Any


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Sat 06 Aug 2022 12:07:22 PM EDT By: Nicholas Jankowski <nrjank>
looking at failing code in another report (see bug #50286), it appears that a
reshape was called supplying an array A as the reshape dimensions instead of
size(A).  this produced an error as it should, but it seems that the error
slipped past input checking and instead triggered an unexpected "out of memory
or dimension too large for Octave's index type", when I would think it should
get caught by input checking on acceptable reshape vector size, hence making
it a bit less obvious to diagnose than it should be

steps to reproduce:


a = rand(100,1);
b = randi([0 10], 10);
c = reshape (a, b)
error: out of memory or dimension too large for Octave's index type


would have expected something like:

c = reshape (a, [10 10 10])
error: reshape: can't reshape 100x1 array to 10x10x10 array








    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?62870>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]