source: CIVL/examples/arrayLambda/complexLiteral.cvl@ ba6c728

main test-branch
Last change on this file since ba6c728 was 08f7210, checked in by Stephen Siegel <siegel@…>, 3 months ago

Added mpi_comm_self to civl-mpi-nonblocking, just copying
the same def. from civl-mpi-blocking.cvl.

Adding another complexLiteral example.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@6007 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 302 bytes
RevLine 
[08f7210]1typedef struct Complex {
2 double real;
3 double imag;
4} Complex;
5
6typedef struct {
7 int len;
8 Complex data[];
9} Vector;
10
11int main() {
12 Vector v;
13 v.len = 1;
14 v.data = (Complex[3])$lambda(int i) ((struct Complex) { 1.0 * i, 2.0 * i });
15 $assert(v.data[1].real == 1.0 && v.data[1].imag == 2.0);
16}
Note: See TracBrowser for help on using the repository browser.