[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #48867] delete elements from array with indire
From: |
Mike Miller |
Subject: |
[Octave-bug-tracker] [bug #48867] delete elements from array with indirect empty matrix |
Date: |
Tue, 23 Aug 2016 22:34:06 +0000 (UTC) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:48.0) Gecko/20100101 Firefox/48.0 |
Update of bug #48867 (project octave):
Status: None => Patch Submitted
_______________________________________________________
Follow-up Comment #2:
The following change makes the samples you've shown here compatible with
Matlab:
diff --git a/libinterp/octave-value/ov.cc b/libinterp/octave-value/ov.cc
--- a/libinterp/octave-value/ov.cc
+++ b/libinterp/octave-value/ov.cc
@@ -3165,7 +3165,10 @@ If @var{idx} is an empty structure array
arg0.make_unique ();
- return ovl (arg0.subsasgn (type, idx, args(2)));
+ const octave_value& arg2 = args(2);
+ bool arg2_empty = args(2).is_empty () && args(2).is_double_type ();
+
+ return ovl (arg0.subsasgn (type, idx, arg2_empty ?
octave_null_matrix::instance : args(2)));
}
}
Does subsasgn also work when the argument is single([]) or does it have to be
double([])?
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?48867>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #48867] delete elements from array with indirect empty matrix, Amro, 2016/08/23
- [Octave-bug-tracker] [bug #48867] delete elements from array with indirect empty matrix, Mike Miller, 2016/08/23
- [Octave-bug-tracker] [bug #48867] delete elements from array with indirect empty matrix, Mike Miller, 2016/08/23
- [Octave-bug-tracker] [bug #48867] delete elements from array with indirect empty matrix,
Mike Miller <=
- [Octave-bug-tracker] [bug #48867] delete elements from array with indirect empty matrix, Amro, 2016/08/24
- [Octave-bug-tracker] [bug #48867] delete elements from array with indirect empty matrix, John W. Eaton, 2016/08/24
- [Octave-bug-tracker] [bug #48867] delete elements from array with indirect empty matrix, Amro, 2016/08/25
- [Octave-bug-tracker] [bug #48867] delete elements from array with indirect empty matrix, Mike Miller, 2016/08/25
- [Octave-bug-tracker] [bug #48867] delete elements from array with indirect empty matrix, John W. Eaton, 2016/08/25
- [Octave-bug-tracker] [bug #48867] delete elements from array with indirect empty matrix, John W. Eaton, 2016/08/25