Re: Modifying MEX arguments in place?



"Petr Krysl" <pkryslNOSP@xxxxxxxxx> writes:

Peter Boettcher <boettcher@xxxxxxxxxx> wrote in message
<muyir0r1v1p.fsf@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>...
"Petr Krysl" <pkryslNOSP@xxxxxxxxx> writes:

First generate a dataset. Then do b=a; (Copy the dataset). Then run
your in-place code on "a". Then look at b. That's the problem.

Actually, I'm trying carefully to avoid having two copies of
the data (because of the tremendous size). The variable I
want to modify is an attribute of a class (variable A): see the
solve method.

I'm trying to explain to you the problem with in-place modification.
The deal is that b=a does NOT copy the data, but instead shares it,
which leads to strange behavior. Then I give the solution to it.

If you can avoid it altogether, because you are sure it is never
assigned (this includes passing into functions, for example), then
ignore the whole thing! Modify your data at will!

-Peter
.



Relevant Pages

  • Re: Avoid duplicate combinations
    ... I will receive a messge when I ... advising of the error provides no details, as I recall. ... I would rather avoid if at all possible the use of a ... Read the following and modify to meet ...
    (microsoft.public.access.forms)
  • Re: Adding MsgBox to a form
    ... "Yes, dammit, I updated it because I wanted to update it!" ... Add the code if you want, but do be aware of the downside! ... You may also want to modify the code to avoid the message if this is the new ...
    (microsoft.public.access.forms)
  • Click to activate and use this control
    ... control (e.g., the OWC spreadsheet). ... to modify you web page to avoid this prompt. ... Has anybody using the OWC 11 spreadsheet control looked into modifying their ...
    (microsoft.public.office.developer.web.components)
  • URLConnection tricks
    ... URLConnection urlc = url.openConnection; ... How would I modify that code to avoid getting the contents of the ... file, get just the headers? ...
    (comp.lang.java.programmer)
  • Re: driving from nj to williamsburg va
    ... the I-95-I-64 route that includes DC. ... If you care this much, ... Avoid 95 and 64 altogether... ...
    (misc.transport.road)