[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #51634] Calling repmat on struct array sometim
From: |
Piotr Held |
Subject: |
[Octave-bug-tracker] [bug #51634] Calling repmat on struct array sometimes fails |
Date: |
Mon, 31 Jul 2017 19:12:59 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.86 Safari/537.36 |
URL:
<http://savannah.gnu.org/bugs/?51634>
Summary: Calling repmat on struct array sometimes fails
Project: GNU Octave
Submitted by: jsoh425
Submitted on: Mon 31 Jul 2017 11:12:58 PM UTC
Category: Interpreter
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Incorrect Result
Status: None
Assigned to: None
Originator Name: Piotr Held
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: dev
Operating System: Any
_______________________________________________________
Details:
The exact code is as follows:
a = struct('f',1);
b = repmat (a, 3, 1);
c = repmat (b, 1, 3); % this line fails
I believe I have identified the problem and I will attach a changeset in the
next post.
I believe the problem is with octave_map::reshape(const dim_vector&). When
reshaping the octave map the main dimensions (retval.dimensions) do not have
the singletons chopped. Whereas, when reshaping the values (retval.xvals) the
trailing singletons are chopped (the Array constructor does that). So the
failure occured when trying to compare the main dimensions (retval.dimensions)
to the array value dimensions (retval.xvals).
A simple:
retval.dimensions.chop_trailing_singletons ();
seems to solve the trick.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?51634>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #51634] Calling repmat on struct array sometimes fails,
Piotr Held <=