Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/vis15/src/tests/new-tests/clamp-test.diderot
ViewVC logotype

Diff of /branches/vis15/src/tests/new-tests/clamp-test.diderot

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4302, Fri Jul 29 13:31:01 2016 UTC revision 4303, Fri Jul 29 13:31:42 2016 UTC
# Line 1  Line 1 
1  // test various forms of the clamp operation  // test clamp function
2    //
3    
4    // FIXME: higher-order clamp
5    //tensor[2,2] M = [[-2, 1], [1.5, 0]];
6    //tensor[2,2] L = [[-1, -1], [2, 2]];
7    //tensor[2,2] H = [[2, 3], [3, 2.5]];
8    tensor[4] M = [-2, 1, 1.5, 0];
9    tensor[4] L = [-1, -1, 2, 2];
10    tensor[4] H = [2, 3, 3, 2.5];
11    
12  tensor[2,2] t1 = [[-1, 2], [3, 4]];  {
13  tensor[2,2] lo = [[0, 1], [0, 0]];;    print ("M = ", M, "\n");
14  tensor[2,2] hi = [[1, 1.5], [4, 3]];    print ("L = ", L, "\n");
15      print ("H = ", H, "\n");
16      print ("clamp(L, H, M) = ", clamp(L, H, M), "\n");
17      print ("clamp(0, 1, M) = ", clamp(0, 1, M), "\n");
18      print ("clamp(-1, 1, M) = ", clamp(-1, 1, M), "\n");
19    }
20    
21  tensor[2,2] t = clamp (lo, hi, t1);  strand S () {
22      output real w = 0;
23    
24      update {
25        stabilize;
26      }
27    
28    }
29    
30    collection { S() | i in 1..1 }
31    

Legend:
Removed from v.4302  
changed lines
  Added in v.4303

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0