Include files – HP Integrity NonStop H-Series User Manual
Page 143
![background image](/manuals/396950/143/background.png)
adjacent_difference
generate sequence of adjacent differences
miscellaneous operations
for_each
apply a function to each element of collection
In this chapter we will illustrate the use of each algorithm with a series of short examples. Many
of the algorithms are also used in the sample programs provided in the on the various container
classes. These cross references have been noted where appropriate.
All of the short example programs described in this section have been collected in a number of
files, named alg1.cpp through alg6.cpp. In the files, the example programs have been
augmented with output statements describing the test programs and illustrating the results of
executing the algorithms. In order to not confuse the reader with unnecessary detail, we have
generally omitted these output statements from the descriptions here. If you wish to see the text
programs complete with output statements, you can compile and execute these test files. The
expected output from these programs is also included in the distribution.
Include Files
To use any of the generic algorithms you must first include the appropriate header file. The
majority of the functions are defined in the header file algorithm. The functions accumulate(),
inner_product(), partial_sum(), and adjacent_difference()are defined in the header file numeric.
# include
# include