Last change
on this file since 739495a was
0b8c951d,
checked in by Peter A. Buhr <pabuhr@…>, 14 months ago
|
more rename directories containers to collections
|
-
Property mode set to
100644
|
File size:
563 bytes
|
Rev | Line | |
---|
[f02f546] | 1 | // A simple, isolated, example of what the dimexpr-match cases are all about. |
---|
| 2 | |
---|
[55b060d] | 3 | #include <collections/array.hfa> |
---|
[f02f546] | 4 | |
---|
| 5 | // context excerpted from doc/theses/mike_brooks_MMath/programs/hello-array.cfa |
---|
| 6 | forall( [N] ) |
---|
| 7 | array(bool, N) & f( array(float, N) & a, array(float, N) & b ) {} |
---|
| 8 | |
---|
| 9 | int main() { |
---|
| 10 | // adapted from Peter's "why doesn't this one work" email |
---|
| 11 | array(float, 10) a; |
---|
| 12 | array(float, 20) b; |
---|
| 13 | f( a, a ); // these calls ok (no error here; actual success is shown in dimexpr-match) |
---|
| 14 | f( b, b ); |
---|
| 15 | |
---|
| 16 | f( a, b ); // reject with mismatch |
---|
| 17 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.