Re: Modifying MEX arguments in place?
- From: Peter Boettcher <boettcher@xxxxxxxxxx>
- Date: Thu, 14 Feb 2008 12:54:08 -0500
"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
.
- References:
- Modifying MEX arguments in place?
- From: Petr Krysl
- Re: Modifying MEX arguments in place?
- From: Peter Boettcher
- Re: Modifying MEX arguments in place?
- From: Petr Krysl
- Modifying MEX arguments in place?
- Prev by Date: read file with unhomogen structure
- Next by Date: Re: problems installing MATLAB7
- Previous by thread: Re: Modifying MEX arguments in place?
- Next by thread: Re: Modifying MEX arguments in place?
- Index(es):
Relevant Pages
|