MATLAB COMPILER RELEASE NOTES User's Guide Page 178

  • Download
  • Add to my manuals
  • Print
  • Page
    / 264
  • Table of contents
  • TROUBLESHOOTING
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 177
6 Optimizing Performance
6-10
Optimizing Conditionals
(optimize_conditionals) This optimization reduces the MATLAB conditional
operators to scalar C conditional operators when both operands are known to
be integer scalars. The Compiler “knows” that
nargin, nargout,andfor loop
control variables (when using the above optimization) are integer scalars. For
example,
function test(a,b,c,d)
if (nargin < 4)
d = 0.0;
end
If you compile this with the -O none option, you get
...
if (mlfTobool(mclLt(mlfScalar(nargin_), mlfScalar(4)))) {
...
Compiling with -O none -O optimize_conditionals:on gives
...
if (nargin_ < 4) {
...
Page view 177
1 2 ... 173 174 175 176 177 178 179 180 181 182 183 ... 263 264

Comments to this Manuals

No comments