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

SCM Repository

[diderot] View of /branches/vis12/bugs/open/bug053.diderot
ViewVC logotype

View of /branches/vis12/bugs/open/bug053.diderot

Parent Directory Parent Directory | Revision Log Revision Log

Revision 3375 - (download) (annotate)
Fri Nov 6 02:46:46 2015 UTC (4 years, 3 months ago) by glk
File size: 1254 byte(s)
not clear how to take derivatives in 1D data
** BUG: ∇ doesn't seem to work on 1D fields;
** compiling with: ../../bin/diderotc --exec bug053.diderot
** generates:

***** Internal error after translation to MidIL: see log file for details

which is due to the "∇F(pos1);" line.  If that line is commented out,
the following "∇⊗∇F(pos1)" line causes this error:

[bug053.diderot:24.15-25] Error: type error for unary operator "'∇⊗'"
  expected:  field#1(1)'shp0108;'dim0107
  but found: field#1(1)[]
[bug053.diderot:10.1-30.0] Error: program does not have any strands

Which raises the question: what is the correct way to express the
second (or higher)  derivative of a 1D field?

field#2(2)[] G = image("../data/data2D.nrrd") ⊛ bspln3;
field#2(1)[] F = image("../data/data1D.nrrd") ⊛ bspln3;

strand foo (int xi, int yi) {
   real xx = lerp(5, 25, 0, xi, 2);
   real yy = lerp(5, 25, 0, yi, 2);
   vec2 pos2 = [xx,yy];
   real pos1 = xx;
   output real out = 0;

   update {
      out += |∇G(pos2)|;
      out += |∇⊗∇G(pos2)|;
      out += ∇F(pos1);   // how should 1st deriv be expressed for 1D fields?
      out += ∇⊗∇F(pos1); // how should 2nd deriv be expressed for 1D fields?

initially [ foo(xi, yi) | yi in 0..2, xi in 0..2 ];

ViewVC Help
Powered by ViewVC 1.0.0