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

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

[Octave-bug-tracker] [bug #29475] new incompatibility of MEX function in


From: Jaroslav Hajek
Subject: [Octave-bug-tracker] [bug #29475] new incompatibility of MEX function in Octave 3.2.x
Date: Fri, 09 Apr 2010 12:41:46 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.8) Gecko/20100204 SUSE/3.5.8-0.1.1 Firefox/3.5.8

Follow-up Comment #5, bug #29475 (project octave):

Yes, ranges and lazy indexes are other instances. 
They may have the full() conversion cached, so you may happen to modify just
the cache but not the original value, letting the djinn out of the bottle.
Diagonal matrices are particularly nasty because here even the copy-on-write
trick may not save you:

a = eye(10); #1
a(1,1) = a(1,1); #2
my_cheating_mex_fcn (a);

the problem is that after statement #2, a is still diagonal (try it). With
other "packed" internal types, an assignment is enough to unpack, but in this
case you need to assign to an off-diagonal element to force unpacking.
So if you cheat and modify the input argument in your mex function, the
change may or may not be visible outside (depending on what you do next).

You were warned, so now you can happily proceed :)


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?29475>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

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