MATLAB COMPILER RELEASE NOTES Guía de usuario Pagina 176

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 264
  • Tabla de contenidos
  • SOLUCIÓN DE PROBLEMAS
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 175
6 Optimizing Performance
6-8
Note This optimization causes the variable names in the resulting C
program to differ from those in the M-file. Therefore, it is recommended that
you do not use this option when debugging.
For example,
function test(x)
for i = 1:length(x)-1
x(i) = x(i) + x(i+1)
end
If you compile this with the -O none option, you get
...
{
mclForLoopIterator viter__;
for (mclForStart(
&viter__,
mlfScalar(1),
mclMinus(mclVe(mlfLength(mclVa(x, "x"))),
mlfScalar(1)), NULL);
mclForNext(&viter__, &i);
) {
...
}
mclDestroyForLoopIterator(viter__);
}
...
Compiling with -O none -O optimize_integer_for_loops:on gives
...
{
int v_ = mclForIntStart(1);
int e_ = mclForIntEnd(mlfScalar(mclLengthInt(mclVa(x, "x"))
- 1));
if (v_ > e_) {
mlfAssign(&i, _mxarray0_);
} else {
Vista de pagina 175
1 2 ... 171 172 173 174 175 176 177 178 179 180 181 ... 263 264

Comentarios a estos manuales

Sin comentarios