Scilab.pod (PDL-2.074) | : | Scilab.pod (PDL-2.075) | ||
---|---|---|---|---|
skipping to change at line 459 | skipping to change at line 459 | |||
end } | end } | |||
=over 5 | =over 5 | |||
=item B<Note> | =item B<Note> | |||
Never use for-loops for numerical work. Perl's for-loops are faster | Never use for-loops for numerical work. Perl's for-loops are faster | |||
than Scilab's, but they both pale against a "vectorized" operation. | than Scilab's, but they both pale against a "vectorized" operation. | |||
PDL has many tools that facilitate writing vectorized programs. | PDL has many tools that facilitate writing vectorized programs. | |||
These are beyond the scope of this guide. To learn more, see: | These are beyond the scope of this guide. To learn more, see: | |||
L<PDL::Indexing>, L<PDL::Threading>, | L<PDL::Indexing>, L<PDL::Broadcasting>, | |||
and L<PDL::PP>. | and L<PDL::PP>. | |||
Likewise, never use C<1..10> for numerical work, even outside a for-loop. | Likewise, never use C<1..10> for numerical work, even outside a for-loop. | |||
C<1..10> is a Perl array. Perl arrays are designed for flexibility, not | C<1..10> is a Perl array. Perl arrays are designed for flexibility, not | |||
speed. Use I<ndarrays> instead. To learn more, see the next section. | speed. Use I<ndarrays> instead. To learn more, see the next section. | |||
=back | =back | |||
=head2 ndarrays vs Perl Arrays | =head2 ndarrays vs Perl Arrays | |||
skipping to change at line 689 | skipping to change at line 689 | |||
=over 5 | =over 5 | |||
=item L<PDL::Indexing> | =item L<PDL::Indexing> | |||
B<Level>: Beginner | B<Level>: Beginner | |||
This beginner tutorial covers the standard "vectorization" feature that | This beginner tutorial covers the standard "vectorization" feature that | |||
you already know from Scilab. Use this page to learn how to avoid for-loops | you already know from Scilab. Use this page to learn how to avoid for-loops | |||
to make your program more efficient. | to make your program more efficient. | |||
=item L<PDL::Threading> | =item L<PDL::Broadcasting> | |||
B<Level>: Intermediate | B<Level>: Intermediate | |||
PDL's "vectorization" feature goes beyond what most numerical software | PDL's "vectorization" feature goes beyond what most numerical software | |||
can do. In this tutorial you'll learn how to "thread" over higher dimensions, | can do. In this tutorial you'll learn how to "broadcast" over higher dimensions, | |||
allowing you to vectorize your program further than is possible in Scilab. | allowing you to vectorize your program further than is possible in Scilab. | |||
=item Benchmarks | =item Benchmarks | |||
B<Level>: Intermediate | B<Level>: Intermediate | |||
Perl comes with an easy to use benchmarks module to help you find how | Perl comes with an easy to use benchmarks module to help you find how | |||
long it takes to execute different parts of your code. It is a great | long it takes to execute different parts of your code. It is a great | |||
tool to help you focus your optimization efforts. You can read about it | tool to help you focus your optimization efforts. You can read about it | |||
online (L<http://perldoc.perl.org/Benchmark.html>) or through the | online (L<http://perldoc.perl.org/Benchmark.html>) or through the | |||
End of changes. 3 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added |