In the previous chapters, we accessed container values one at a time. Accessing more than one value in a container required a writing an explicit loop. Scientists and engineers commonly operate on sets of values, treated as an aggregate. For example, a vector is a one-dimension collection of data and two vectors can be added together. A matrix is a two-dimensional collection of data, and a scalar and a matrix can be multiplied. A data-parallel expression simultaneously uses multiple container values. POOMA supports data-parallel expressions.
After introducing data-parallel expressions and statements, we present the corresponding POOMA syntax. Then we present its implementation, which uses expression-template technology. A naïve data-parallel implementation might generate temporary variables, cluttering a program's inner loops and slowing its execution. Instead, POOMA uses PETE, the Portable Expression Template Engine. Using expression templates, it constructs a parse tree of expressions and corresponding types, which is then quickly evaluated without the need for temporary variables.