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

SCM Repository

[diderot] View of /tests/new-tests/clamp-test.diderot
ViewVC logotype

View of /tests/new-tests/clamp-test.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4640 - (download) (annotate)
Tue Sep 27 20:54:47 2016 UTC (2 years, 9 months ago) by glk
File size: 654 byte(s)
initial result of svn export --username anonsvn --password=anonsvn https://svn.smlnj-gforge.cs.uchicago.edu/svn/diderot/branches/vis15/src/tests/
#version 2.0

// test clamp function
//

// FIXME: higher-order clamp
//tensor[2,2] M = [[-2, 1], [1.5, 0]];
//tensor[2,2] L = [[-1, -1], [2, 2]];
//tensor[2,2] H = [[2, 3], [3, 2.5]];
tensor[4] M = [-2, 1, 1.5, 0];
tensor[4] L = [-1, -1, 2, 2];
tensor[4] H = [2, 3, 3, 2.5];

initialize {
  print ("M = ", M, "\n");
  print ("L = ", L, "\n");
  print ("H = ", H, "\n");
}

strand S () {
  output real w = 0;

  update {
    stabilize;
  }

}

start {
  print ("clamp(L, H, M) = ", clamp(L, H, M), "\n");
  print ("clamp(0, 1, M) = ", clamp(0, 1, M), "\n");
  print ("clamp(-1, 1, M) = ", clamp(-1, 1, M), "\n");
}

create_collection { S() | i in 1..1 }

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