Abstract

The truncated first occurrence vector (TFOV) is a data construct which the author has found useful in a variety of application areas. It is based on comparisons of adjacent items in a set ordered by some criterion. The use of the TFOV and its several derivatives improve efficiency and reduce the load on system resources. A contributing factor in performance improvement is the algorithm used in the APL implementations of monadic grade and its offshoot dyadic grade. It is interesting to note that an ordered set improves the efficiency of processes other than those utilizing the TFOV. Calculation of the range and median of a numeric set is an example of this. As new primitives have been added to APL, construction and generation of the TFOV has been simplified. The paper shows both the early and the later idioms used in programs. The techniques for calculating frequency distributions and the related statistical mode or modes are shown. The development of sub-totals by group in simple (single criterion) and hierarchical cases are illustrated. The generation of (ordered) defining subsets and “arrival” and “departure” sequences are shown. Along with the ordered defining subset (ODS) a pointer to the ODS can be developed. This technique has been found useful in applications requiring data compaction. The TFOV has proven useful in the development of control vectors for formatting tables especially for insertion of sub-total. A function for pagination of documents which eliminates “widows” has been developed, as have functions for reformatting paragraphs in text processing. In these latter cases, while the ordering algorithm is simply that of position, the concept is a direct outgrowth of experience with the TFOV. The techniques and concepts discussed in this paper are not intended to be exhaustive but are intended to stimulate programmers in considering an approach often overlooked. It is interesting to note that, while these ideas are applicable in other languages, their recognition required the primitives and arrays of APL.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call