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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4303 - (view) (download)

1 : jhr 4303 // test clamp function
2 :     //
3 : jhr 3831
4 : jhr 4303 // 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 : jhr 3831
12 : jhr 4303 {
13 :     print ("M = ", M, "\n");
14 :     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 : jhr 3831
21 : jhr 4303 strand S () {
22 :     output real w = 0;
23 : jhr 3831
24 : jhr 4303 update {
25 :     stabilize;
26 :     }
27 :    
28 :     }
29 :    
30 :     collection { S() | i in 1..1 }
31 :    

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