
\begin{verbatim}
  Embed a_e(3, x, NULL) ;
  Array<0, float> a(&a_e) ;
  Array<1, float> b(x) ;
  ...
  if(a_e)
    a() = 23 + b(a_e) ;
\end{verbatim}

\begin{verbatim}
  Range x(12, t_1) ;
  Array<1, float> u(x) ;
  SubRange x_internal(10, 1, 1, x) ;
  Array<1, float> n(x_internal) ;
  Array<1, float> p(x_internal) ;
  ...
  for( ; ; ) {
    remap(n, Section<1, float> (u, SubRange(10, 0, 1, x))) ;
    remap(p, Section<1, float> (u, SubRange(10, 2, 1, x))) ;
    for(x_internal.first() ; x_internal ; x_internal++)
      u(x_internal) = 0.5 * (n(x_internal) + p(x_internal)) ;
  }
\end{verbatim}

\begin{verbatim}
  Range x_a(n, t_1) ;
  Range y_a(n, t_2) ;
  Array<2, float> a(x_a, y_a) ;

  Range x_b(n * n, s_1) ;
  Array<1, float> b(x_b) ;
 
  ...

  Array<2, int> subscript(x_a, y_a) ;
  for(x_a.first() ; x_a ; x_a++)
    for(y_a.first() ; y_a ; y_a++)
      subscript(x_a, y_a) = x_a() + y_a() ;
  scatter(a, b, subscript) ;
\end{verbatim}

\begin{verbatim}
  Array<1, float> c(x_a) ;

  ...

  gather(c, a, Index(x_a), Index(x_a))
\end{verbatim}

\begin{verbatim}
  SubRange x_d(m, 0, 1, x_a) ;
  SubRange y_d(m, 0, 1, y_a) ;
  Array<2, float> d(x_d, y_d) ;

  ...

  Array<2, int> subscript2(x_d, y_d) ;
  for(x_d.first() ; x_d ; x_d++)
    for(y_d.first() ; y_d ; y_d++)
      subscript2(x_d, y_d) = x_d() + y_d() ;
  gather(d, a, Index(x_d), subscript2) ;
\end{verbatim}

\begin{verbatim}
  for(x_d.first() ; x_d ; x_d++)
    remap(Section<1, float>(d, x_d, y_d),
          Section<1, float>(a, x_d, SubRange(m, x_d(), 1, y_a)) ;
\end{verbatim}

\begin{verbatim}
  Array<2, float>* a ;
  ...
  a = new Array<2, float>(Range(10, t_1), Range(10, t_2)) ;
  ...
  delete a ;
\end{verbatim}

\begin{verbatim}
  Range x_b(10, t_1) ;
  Range y_b(10, t_2) ;

  Aggregate<2> b(x_b, y_b) ;

  ...

  for(x_b.first() ; x_b ; x_b++)
    for(y_b.first() ; y_b ; y_b++)
      b(x_b, y_b) =
        new Array<1, float>(Range(x_b() + y_b(), t_3)) ;
    
  ...

  for(x_b.last() ; x_b ; x_b--)
    for(y_b.last() ; y_b ; y_b--)
      delete b(x_b, y_b) ;
\end{verbatim}

\begin{verbatim}
  Procs<2> p(4, 4) ;
  Dimension p_1(p.dim(1)) ;
  Dimension p_2(p.dim(2)) ;

  Range i_a(16, p_1, blk) ;
  Range j_a(16, p_2, blk) ;
  Array<2, int> a(i_a, j_a) ;
  
  SubRange i_b(8, 5, 1, j_a) ;
  SubRange j_b(4, 3, 3, i_a) ;
  Array<2, int> b(i_b, j_b) ;

  Embed c_e(2, i_b, NULL) ;
  Array<0, int> c(&c_e) ;
\end{verbatim}

\begin{verbatim}
  Procs<2> p(4, 4) ;

  Array<2, int> a(Range(16, p.dim(1), blk),
                  Range(16, p.dim(2), blk)) ;
  
  Array<2, int> b(SubRange(8, 5, 1, a.rng(2)),
                  SubRange(4, 3, 3, a.rng(1))) ;

  Embed c_e(2, b.rng(1), NULL) ;
  Array<0, int> c(&c_e) ;
\end{verbatim}

\begin{verbatim}
  void mingo(Array<2, float>& m)
    ...
  }
\end{verbatim}

\begin{verbatim}
  void _mingo(Array<2, float>& _m) {
    Array<2, float> m(Range(100, def2d_1), Range(100, def2d_2)) ;
    remap(m, _m) ;
    ...
    remap(_m, m) ;
  }
\end{verbatim}

\begin{verbatim}
  void rickard(Array<2, float>& r)
    ...
  }
\end{verbatim}

\begin{verbatim}
  void jaffee(Array<2, float>& j) {
    ...
  }
\end{verbatim}

\begin{verbatim}
  void melvin(Array<2, float>& axolotl, Array<2, float>& poiuytt) {
    ...
  }
\end{verbatim}

\begin{verbatim}
  Array<1, float> dough(Range(100, def1d_1, blk, 10)) ;
  probate(Section<1, float>(dough,
                            SubRange(9, 6, 2, dough.rng(1)))) ;
  ...
  void probate(Array<1, float>& bread) {
    ...
\end{verbatim}

\begin{verbatim}
  Procs<1> dance_floor(16) ;
  Range i_frug(128, dance_floor.dim(1), blk) ;
  Array<1, int> frug(i_frug) ;
  Array<1, int> twist(i_frug) ;
  _terpsichore(Section<1, int>(frug,
                               SubRange(13, 0, 3, frug.rng(1))),
               Section<1, int>(twist,
                               SubRange(13, 0, 3, frug.rng(1))))

  void _terpsichore(Array<1, int>& _foxtrot,
                    Array<1, int>& tango) {
    Dimension def0d_1(def0d) ;
    Array<1, int> foxtrot(Range(_foxtrot.rng(1).size(),
                                def0d_1)) ;
    remap(foxtrot, _foxtrot) ;
    ...
    remap(_foxtrot, foxtrot) ;
  }
\end{verbatim}

\begin{verbatim}
  Procs<1> dance_floor(16) ;
  Range i_frug(128, dance_floor.dim(1), blk) ;
  Array<1, int> frug(i_frug) ;
  Array<1, int> twist(i_frug) ;
  {
    Dimension def0d_1(def0d) ;
    Array<1, int> temp1(Range(13, def0d_1)) ;
    SubRange i_temp2(13, 0, step 3, i_frug) ;
    remap(temp1, Section<1, int>(frug, i_temp2)) ;
    terpsichore(temp1, Section<1, int>(twist, i_temp2)) ;
    remap(Section<1, int>(frug, i_temp2), temp1) ;
  }

  void terpsichore(Array<1, int>& foxtrot,
                   Array<1, int>& tango) {
    ...
  }
\end{verbatim}

\begin{verbatim}
  Procs<1> dance_floor(16) ;
  Range i_frug(128, dance_floor.dim(1), blk) ;
  Array<1, int> frug(i_frug) ;
  Array<1, int> twist(i_frug) ;
  {
    int temp1 [13] ;
    SubRange i_temp2(13, 0, 3, i_frug) ;
    broadcast(temp1, Section<1, int>(frug, i_temp2)) ;
    terpsichore(temp1, Section<1, int>(twist, i_temp2)) ;
    for(i_temp2.first() ; i_temp2 ; i_temp2++)
      frug(i_temp2) = temp1 [i_temp2()] ;
  }

  void terpsichore(int foxtrot [], Array<1, int>& tango) {
    ...
  }
\end{verbatim}

\begin{verbatim}
  Dimension def1d_2(def1d) ;
  Array<2, float> troggs(Range(1024, def1d_1, blk),
                         Range(473, def1d_2)) ;
  for (j = 0; j < 473 ; j++)
    wild_thing(Section<1, float> troggs(trogg.rng(1),
                                     Embed(j, trogg.rng(2)))) ;
  ...

  void wild_thing(Array<1, float>& groovy)
    ...
\end{verbatim}

\begin{verbatim}
  void grunge(Array<1, float> plunge, Array<1, float> sponge) {
    ...

  Array<1, float> squeegee(fiji.emb(),
                           SubRange(2000, 1, 2, fiji.rng(1))) ;
  grunge(Section<1, float>(fiji.emb(), fiji,
                           SubRange(1000, 2001, 2, fiji.rng(1)))
         Section<1, float>(squeegee.emb(), squeegee,
                     SubRange(1000, 1000, 1, squegee.rng(1)))) ;
  ...
\end{verbatim}

\begin{verbatim}
  void copy(Array<1, int>& u, Array<1, int>& v) {
    ...
  }

  void foo(int n, Array<1, int>& foo_res) {
    ...
  }

  Array<1, int> a(Range(10 def1d_1, blk)) ;
  ...
  {
    Array<1, int> temp1(Range(10, def1d_1, cyc)) ;
    foo(10, temp1) ;
    Array<1, int> temp2(Range(10, def1d_1, blk)) ;
    remap(temp2, temp1) ;
    copy(a, temp2) ;
  }
\end{verbatim}

\begin{verbatim}
  int sum(Array<1, int>& u) {
    ...
  }

  Array<2, int> a(Range(10, def2d_1, blk),
                  Range(10, def2d_2, blk)) ;
  Array<1, int> v(Range(5, def1d_1, blk)) ;
  int x ;
  ...
  {
    Embed e_t1(4, a.rng(1), NULL) ;
    SubRange i_t1(f(x) - 1, 1, 2, a.rng(2)) ;
    Array<1, int> temp1(&e_t1, i_t1) ;
    remap(temp1,
      Section<1, int>(v, SubRange(g(x) - 1, 1, 1, v.rng(1)))) ;
    if(e_t1)
      for(i_t1.first() ; i_t1 ; i_t1++)
        temp1(i_t1) += a(e_t1, i_t1) ;
    x = sum(temp1) ;
  }
\end{verbatim}

\begin{verbatim}
  Array<2, int> a(Range(100, p_1, blk), Range(10, p_2, blk)) ;
  Array<2, int> b(Range(10, q_1, blk), Range(10, q_2, blk)) ;
  ...
  {
    Range x_t1(b.rng(1)) ;
    Range y_t1(b.rng(2)) ;
    Dimension q_3(q) ;
    Range z_t1(20, q_3) ;
    Array<3, int> temp1(x_t1, y_t1, z_t1) ;

    // temp1 [x, y, z] = b [x, y] + f(y + 1, z + 1)
    for(x_t1.first() ; x_t1 ; x_t1++)
      for(y_t1.first() ; y_t1 ; y_t1++)
        for(z_t1.first() ; z_t1 ; z_t1++)
          temp1(x_t1, y_t1, z_t1) = b(x_t1, y_t1) +
                                    f(y_t1() + 1, z_t1() + 1) ;

    Array<2, int> temp2(x_t1, y_t1) ;

    // temp2 [x, y] = 10 * x + y
    for(x_t1.first() ; x_t1 ; x_t1++)
      for(y_t1.first() ; y_t1 ; y_t1++)
        temp2(x_t1, y_t1) = 10 * x_t1() + y_t1()

    // a [10 * x + y, z] = temp1 [x, y, z]
    scatter(temp1, a, temp2, Index(z_t1)) ;
  }
\end{verbatim}

\begin{verbatim}
  for(y_t1.first() ; y_t1 ; y_t1++)
    for(z_t1.first() ; z_t1 ; z_t1++) {
      int temp2 = f(y_t1() + 1, z_t1() + 1) ;
      for(x_t1.first() ; x_t1 ; x_t1++)
        temp1(x_t1, y_t1, z_t1) =
                 b(x_t1, y_t1) + temp2(x_t1, z_t1) ;
    }
\end{verbatim}

\begin{verbatim}
  {
    Array<2, int> temp2(y_t1, z_t1) ;

    // temp2 [y, z] = f(y + 1, z + 1)
    for(y_t1.first() ; y_t1 ; y_t1++) {
      Range z_t3(20, q_1, blk) ;
      Array<1, int> temp3(z_t3) ;

      // temp3 [z] = f (y + 1, z + 1)
      for(z_t3.first() ; z_t3 ; z_t3++)
        temp3(z_t3) = f(y_t1() + 1, z_t3() + 1) ;

      remap(Section<1, int>(temp2, y_t1, z_t1), temp3) ;
    }

    // temp1 [x, y, z] = b [x, y] + temp2 [y, z]
    for(x_t1.first() ; x_t1 ; x_t1++)
      for(y_t1.first() ; y_t1 ; y_t1++)
        for(z_t1.first() ; z_t1 ; z_t1++)
          temp1(x_t1, y_t1, z_t1) =
                   b(x_t1, y_t1) + temp2(x_t1, z_t1) ;
  }
\end{verbatim}

\begin{verbatim}
  void foo(int n, Dimension& d, Array<1, int>* foo_res) {
    foo_res = new Array<1, int>(f(n), d) ;
    ...
  }

  Array<2, int> a(Range(10, p_1, blk), Range(10, p_2, blk)) ;
  Array<1, int> b(Range(10, q_1, blk) ;
  ...
  {
    Range x_t1(b.rng(1)) ;
    Dimension q_2(q) ;
    Aggregate<1> temp1(x_t1) ;

    // temp1 [x] [i] = b [foo(x) [i]]
    {
      Aggregate<1> temp2(x_t1) ;

      // temp2 [x] [i] = foo(x) [i]
      for(x_t1.first() ; x_t1 ; x_t1++)
        foo(x_t1() + 1, q_2, temp2(x_t1)) ;

      // temp1 [x] [i] = b [temp2 [x] [i]]
      gather(temp1, b, temp2) ;

      for(x_t1.last() ; x_t1 ; x_t1--)
        delete temp2(x_t1) ;
    }

    Aggregate<1> temp2(x_t1) ;

    // temp2 [x] [i] = i
    for(x_t1.first() ; x_t1 ; x_t1++)
      temp2(x_t1) = new Index(Range(f(x_t1() + 1), q_2)) ;

    // a [x, temp2 [x] [i]] = temp1 [x] [i]
    scatter(temp1, a, Index(x_t1), temp2) ;

    for(x_t1.last() ; x_t1 ; x_t1--)
      delete temp2(x_t1) ;

    for(x_t1.last() ; x_t1 ; x_t1--)
      delete temp1(x_t1) ;
  }
\end{verbatim}

\begin{verbatim}
  Array<2, int> a(Range(10, p_1, blk), Range(10, p_2, blk)) ;
  Array<2, int> b(Range(10, q_1, blk), Range(10, q_2, blk)) ;
  ...
  {
    Range x_t1(b.rng(1)) ;
    Dimension q_3(q) ;
    Aggregate<1> temp1(x_t1) ;
    Aggregate<1> temp2(x_t1) ;

    // temp1 [x] [y] = b [x, y] + f(x) + g(y)
    // temp2 [x] [y] = y
    {
      for(x_t1.first() ; x_t1 ; x_t1++) {
        Range y_t1(x_t1() + 1, q_3) ;

        temp1(x_t1) = new Array<1, int>(y_t1) ;

        Array<1, int> temp2(yt_1) ;

        // temp2 [y] = b [x, y]
        remap(temp2, Section<1, int>(b, x_t1, y_t1)) ;

        // temp3 = f(x + 1)
        int temp3 = f(x_t1() + 1) ;

        for(y_t1.first() ; y_t1 ; y_t1)
          temp1(x_t1)(y_t1) =
                       b(x_t1, y_t1) + temp3 + g(y_t1() + 1) ;

        temp2 = new Index(y_t1) ;
      }
    }

    // a [x] [y] = temp1 [x] [y]
    scatter(temp1, a, Index(x_t1), temp2) ;

    for(x_t1.last() ; x_t1 ; x_t1--) {
      delete temp2(x_t1) ;
      delete temp1(x_t1) ;
    }
  }
\end{verbatim}

\begin{verbatim}
  Array<2, int> a(Range(10, p_1, blk), Range(10, p_2, blk)) ;
  Array<2, int> b(Range(10, q_1, blk), Range(10, q_2, blk)) ;
  ...
  {
    Range x_t1(b.rng(1)) ;
    Range y_t1(b.rng(2)) ;
    Array<2, int> temp1(x_t1, y_t1) ;

    // temp1 [x] [y] = b [x, y] + f(x) + g(y)
    {
      Array<1, int> temp2(y_t1) ;

      // temp2 [y] = g(y + 1)
      for(y_t1.first() ; y_t1 ; y_t1++)
        temp2(y_t1) = g(y_t1() + 1) ;

      for(x_t1.first() ; x_t1 ; x_t1++) {

        // temp3 = f(x + 1)
        int temp3 = f(x_t1() + 1) ;

        // temp1 [x, y] = b [x, y] + temp3 + temp2 [y] ;
        for(y_t1.first() ; y_t1 ; y_t1++)
          if(y_t1() <= x_t1())
            temp1(x_t1, y_t1) =
                        b(x_t1, y_t1) + temp3 + temp2(y_t1) ;
      }
    }

    Range x_t2(a.rng(1)) ;
    Range y_t2(a.rng(2)) ;
    Array<2, int> temp2(x_t2, y_t2) ;

    // temp2 [x, y] = temp1 [x, y] 
    remap(temp2, temp1) ;

    // a [x, y] = temp2 [x, y]
    for(x_t2.first() ; x_t2 ; x_t2++)
      for(y_t2.first() ; y_t2 ; y_t2++)
        if(y_t2() <= x_t2())
          a(x_t2, y_t2) = temp2(x_t2, y_t2) ;
  }
\end{verbatim}

\begin{verbatim}
  void foo (Array<2, int>& a) {
    Array<1, int> b(a.emb(), a.rng(2)) ;
    ...
    Embed* e = a.emb() ;
    while(*e)
      if(e = e.next())
        ;
      else {
        Range x(a.rng(1)) ;
        Range y(a.rng(2)))
        for(x.first() ; x ; x++) {
          int temp1 = f(x() + 1) ;
          for(y.first() ; y ; y++) {
            a(x, y) = b(y) + temp1 ;
        }
        break ;
      }
  }
\end{verbatim}

