source: CIVL/examples/library/civlc/domainDecomposition.cvl

main
Last change on this file was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

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

  • Property mode set to 100644
File size: 722 bytes
RevLine 
[a28bfea]1#include <civlc.cvh>
2#include <domain.cvh>
3#include <stdio.h>
4
[0baeebd]5$input int n = 4;
[a28bfea]6
7void decomp($domain domain){
8 $domain_decomposition result;
9 int sum = 0;
10
11 result = $domain_partition(domain, ROUND_ROBIN, n);
12 for(int i = 0; i < n; i++){
13 //printf("The %d'th sub-domain is: %s\n", i, result.subdomains[i]);
14 printf("This is %d'th sub-domain\n", i);
15 $for(int j, k, l: (($domain(3))result.subdomains[i])){
16 printf("The current iteration (j, k, l) is (%d, %d, %d)\n", j, k, l);
17 sum+=1;
18 }
19 }
[d980649]20 $assert(sum == 45);
[a28bfea]21}
22
23void main(){
24 $range r1 = 1 .. 5;
25 $range r2 = 0 .. 4#-2;
26 $range r3 = 3 .. 9#3;
27 $domain(3) dom = ($domain){r1, r2, r3};
28 $domain_decomposition result;
29
30 decomp(dom);
31}
32
33
Note: See TracBrowser for help on using the repository browser.