A view of a container is a container accessing a subset of C's domain and values. The subset can include all of the container's domain. A "view" is so named because it is a different way to access, or view, another container's values. Both the container and its view share the same underlying engine so changing values in one also changes them in the other.
A view is created by following a container's name by parentheses containing a domain. For example, consider this code extracted from Example 3-3 in Section 3.4.
Interval<1> N(0, n-1); Interval<2> vertDomain(N, N); Interval<1> I(1,n-2); Interval<1> J(1,n-2); Array<2, double, Brick> a(vertDomain); Array<2, double, Brick> b(vertDomain); a(I,J) = (1.0/9.0) * (b(I+1,J+1) + b(I+1,J ) + b(I+1,J-1) + b(I ,J+1) + b(I ,J ) + b(I ,J-1) + b(I-1,J+1) + b(I-1,J ) + b(I-1,J-1));The last statement creates ten views. For example, a(I,J) creates a view of a using the smaller domain specified by I and J. This omits the outermost rows of columns of a. The views of b illustrate the use of views in data-parallel statements. b(I-1,J-1) has a subset shifted up one row and left one column compared with b(I,J).