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

SCM Repository

[diderot] Diff of /branches/pure-cfg/test/iso2d.diderot
ViewVC logotype

Diff of /branches/pure-cfg/test/iso2d.diderot

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

revision 965, Mon Apr 25 15:46:48 2011 UTC revision 966, Mon Apr 25 15:49:00 2011 UTC
# Line 24  Line 24 
24          // non-finite position; these will be filtered later.          // non-finite position; these will be filtered later.
25          // This is really what "die" is for, though (see below).          // This is really what "die" is for, though (see below).
26          if (!inside(pos, F) || steps > stepsMax) {          if (!inside(pos, F) || steps > stepsMax) {
27            // HEY (BUG) not able to use NaN as in "pos = [nan,nan]"              pos = [nan,nan];
           // generated C code "vec2f(nanf, nanf)" causes problems:  
           // iso2d.c: In function ‘sample_update’:  
           // iso2d.c:86: error: incompatible type for argument 1 of ‘vec2f’  
           // iso2d.c:86: error: incompatible type for argument 2 of ‘vec2f’  
           // uncaught exception Fail [Fail: error compiling/linking]  
           //   raised at c-target/c-target.sml:323.14-323.44  
           pos = [∞,∞];  // should be: pos = [nan,nan];  
28            // HEY (BUG) we shouldn't even have to use non-finite values;            // HEY (BUG) we shouldn't even have to use non-finite values;
29            // we should be able to just say "die;".  Currently, using            // we should be able to just say "die;".  Currently, using
30            // "die" leads to the program never finishing...            // "die" leads to the program never finishing...
# Line 40  Line 33 
33          vec2 grad = ∇F(pos);          vec2 grad = ∇F(pos);
34          real gmsq = grad • grad;          real gmsq = grad • grad;
35          // If |∇F|=0 we can't compute update; we have to bail          // If |∇F|=0 we can't compute update; we have to bail
36          if (gmsq == 0.0) {          if (gmsq < 0.00001) {
37            pos = [∞,∞];              pos = [nan,nan];
38            stabilize;            stabilize;
39          }          }
40          // delta = Newton-Raphson step          // delta = Newton-Raphson step

Legend:
Removed from v.965  
changed lines
  Added in v.966

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