No BSD License
Highlights from
Inplace
Inplace
by David Gleich
04 Jun 2006
(Updated 06 Jun 2006)
Allows Matlab variables to be passed by reference instead of by value allowing inplace modification.
|
Watch this File
|
| File Information |
| Description |
Inplace is a Matlab package for working with matrices and vectors that are passed by reference instead of by value. This package allows variables to functions to be modified inplace. Previously, this behavior was not possible in Matlab.
To install, see the installation section of the documentation page: http://www.stanford.edu/~dgleich/programs/inplace/
It provides two classes, ipdouble and ipint32 (inplace double and inplace int32) that wrap Matlab's double and int32 matrices and vectors. The idea behind the package is simply to provide a way to modified arguments to a function directly without the necessity of returning the result and the hence, eliminating a copy required.
Example:
function a=func1(a)
a(1) = a(1)+1;
function func2(ipd)
ipd(1) = ipd(1)+1;
a = ones(5,1);
ipd = ipdouble(a);
a = func1(a);
func2(ipd); % accomplishes the same result without the copy at the end of the function. |
| MATLAB release |
MATLAB 7 (R14)
|
| Other requirements |
Matlab 7.0 required.
Compilation required on non-Windows platforms. |
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (7) |
| 06 Jun 2006 |
Jeremy Kozdon
|
|
|
| 08 Jun 2006 |
Raymond Norris
|
|
|
| 20 Jun 2006 |
David Gleich
|
|
|
| 16 Feb 2007 |
Danilo Zanatta Filho
|
|
|
| 08 Apr 2007 |
David Gleich
|
|
|
| 13 Jun 2009 |
Matthew
|
|
|
| 14 Jun 2009 |
Jveer
|
|
|
|
Contact us at files@mathworks.com