Home My Page Projects Code Snippets Project Openings diderot

# SCM Repository

[diderot] Diff of /branches/vis15/doc/implementation/data-layout.md
 [diderot] / branches / vis15 / doc / implementation / data-layout.md

# Diff of /branches/vis15/doc/implementation/data-layout.md

revision 3884, Fri May 20 13:35:25 2016 UTC revision 3885, Fri May 20 15:03:05 2016 UTC
# Line 19  Line 19
19  tensors have the type `tensor[d_1,...,d_n]`.  Thus the dimensions of a tensor  tensors have the type `tensor[d_1,...,d_n]`.  Thus the dimensions of a tensor
20  are listed from slowest to fastest (the opposite of Nrrd file headers).  are listed from slowest to fastest (the opposite of Nrrd file headers).
21
22    ### Tensor indexing
23
24    If we have
25
26    ````diderot
27    tensor[d_1,...,d_n] T;
28    ````
29
30    then the expression
31
32    ````diderot
33    T[i_1,...,i_n]
34    ````
35
36    is translated to the following address arithmetic:
37
38    ````
39    T + i_n + d_n * (i_{n-1} + d_{n-1} * ( ... d_2 * i_1) ... )
40    ````
41
42  ## Differentiation  ## Differentiation
43
44  The gradiant operator returns a field of higher order than its argument.  The gradiant operator returns a field of higher order than its argument.
# Line 27  Line 47
47  ````diderot  ````diderot
48  field#2(3)[2] F;  field#2(3)[2] F;
49  field#1(3)[2,3] G = ∇ F;  field#1(3)[2,3] G = ∇ F;
50    tensor[2,3] T = G(x);
51  ````  ````
52
53    Again, the dimensions are slowest to fastest, so T can be thought of
54    as a two-element array of three-vectors.
55
56  ## Images and Nrrd Files  ## Images and Nrrd Files
57
58  Image values are represented using the [Nrrd file format](http://teem.sourceforge.net/nrrd/format.html)  Image values are represented using the [Nrrd file format](http://teem.sourceforge.net/nrrd/format.html)

Legend:
 Removed from v.3884 changed lines Added in v.3885