next up previous contents
Next: Maintaining Readabilty Up: Jumping and Copying Previous: The COPY DQF   Contents

A Word of Caution

It would be quite easy to get carried away with these DQFs. For example, this n-tuple counts all the MCVXs in an event:-

' num_vx        equals          0.;                              '
' _my_vx        get_link        MC-$KMC_MCVX;                    '
' _test_link    jump_undefined  +999., _my_vx;                   '
' _             equals          num_vx,  1.;                     '
' _             copy            num_vx;                          '
' _             get_link        _my_vx-0, _my_vx;                '
' _             jump_true       _test_link, 1.;                  '
and demonstrates how powerful the system is and how easy it is to abuse that power In this case, if you really want to count like this then all you need do is:-

 
' num_vx        nzbank          MC-$KMC_MCVX;                    '
Which is a lot quicker both to write and to execute! All the warnings about double counting given in section 6.7.1 apply in spades when writing loops. Careful attention must be paid to the way in which the n-tuple scanning interacts with the program stored in the n-tuple. In general use the scanning to define a set of unique points in the data structure, or turn if off, and then use the techniques described above, to navigate to the point of interest. Also you should be aware that this system, although it tries to be efficient, takes many instructions to process each line of the n-tuple and so sophisticated ``programs'' will run very slowly. If execution speed is a problem then this system can be used to prototype an n-tuple which can subsequently replaced by FORTRAN code stored in NTP_PACK_USER.


next up previous contents
Next: Maintaining Readabilty Up: Jumping and Copying Previous: The COPY DQF   Contents
sno Guest Acct 2009-09-09