* Doxyfile.in: add new path to included files.
* tutorial/Makefile.am,
* Makefile.am: update target dependencies.
* doc.mk: add new global variables.
* tutorial/figures/fill-subdomain-1.pbm,
* tutorial/figures/fill-subdomain-2.ppm,
* tutorial/figures/fill-subdomain-3.ppm,
* tutorial/figures/fill-subdomain-4.ppm,
* tutorial/figures/fill-subimage-cfun-1.ppm,
* tutorial/figures/ima_save.pbm,
* tutorial/figures/labeling-compute-1.pbm,
* tutorial/figures/labeling-compute-2.ppm,
* tutorial/figures/logical-not-1.pbm,
* tutorial/figures/logical-not-2.pbm,
* tutorial/figures/logical-not-3.pbm: add new reference figures.
* tutorial/outputs/accu-right-instanciation.txt,
* tutorial/outputs/box2d-bbox.txt,
* tutorial/outputs/domain-display.txt,
* tutorial/outputs/estim-sites.txt,
* tutorial/outputs/extension-ignore.txt,
* tutorial/outputs/fill-call-1.txt,
* tutorial/outputs/fill-part-image.txt,
* tutorial/outputs/fill-subdomain-shorter.txt,
* tutorial/outputs/fill-subdomain.txt,
* tutorial/outputs/fill-subimage-cfun.txt,
* tutorial/outputs/fill.txt,
* tutorial/outputs/forall-piter.txt,
* tutorial/outputs/fun-p2v-1.txt,
* tutorial/outputs/graph-data-full.txt,
* tutorial/outputs/graph-data.txt,
* tutorial/outputs/graph-iter.txt,
* tutorial/outputs/ima-save.txt,
* tutorial/outputs/ima2d-2.txt,
* tutorial/outputs/ima2d-3.txt,
* tutorial/outputs/ima2d-4.txt,
* tutorial/outputs/ima2d-5.txt,
* tutorial/outputs/ima2d-6-clone.txt,
* tutorial/outputs/ima2d-7.txt,
* tutorial/outputs/ima2d-decl-2-blobs-full.txt,
* tutorial/outputs/ima2d-decl-2-blobs.txt,
* tutorial/outputs/ima2d-decl-2.txt,
* tutorial/samples/ima2d-display-1.cc,
* tutorial/outputs/ima2d-display-1.txt,
* tutorial/samples/ima2d-display-2.cc,
* tutorial/outputs/ima2d-display-2.txt,
* tutorial/outputs/labeling-compute-1,
* tutorial/outputs/labeling-compute.txt,
* tutorial/outputs/logical-not.txt,
* tutorial/outputs/mln_var.txt,
* tutorial/outputs/parray-append.txt,
* tutorial/outputs/parray-bbox.txt,
* tutorial/samples/parray-display-1.cc,
* tutorial/outputs/parray-display-1.txt,
* tutorial/outputs/paste-call-1.txt,
* tutorial/outputs/paste.txt,
* tutorial/outputs/predicate-1.txt,
* tutorial/samples/win-create-1-display.cc,
* tutorial/outputs/win-create-1-display.txt,
* tutorial/outputs/win-create-1.txt,
* tutorial/outputs/win-create-2.txt: Update and add new reference
outputs.
* tutorial/samples/accu-wrong-instanciation.cc: rename as...
* tutorial/samples/accu-wrong-instanciation.cc.raw: ...this.
* tutorial/samples/ima-load.cc: rename as...
* tutorial/samples/ima-load.cc.raw: ...this.
* tutorial/samples/ima2d-restricted-1.cc: rename as...
* tutorial/samples/ima2d-restricted-1.cc.raw: ...this.
* tutorial/samples/ima2d-restricted-2.cc: rename as...
* tutorial/samples/ima2d-restricted-2.cc.raw: ...this.
* tutorial/samples/ima2d-restricted-3.cc: rename as...
* tutorial/samples/ima2d-restricted-3.cc.raw: ...this.
* tutorial/samples/labeling-compute-full.cc: rename as...
* tutorial/samples/labeling-compute.cc: ...this.
* tutorial/samples/Makefile.am,
* tutorial/samples/accu-right-instanciation.cc,
* tutorial/samples/borderthickness.cc,
* tutorial/samples/dpoint-1.cc,
* tutorial/samples/estim-sites.cc,
* tutorial/samples/extension-ignore.cc,
* tutorial/samples/fill-call-1.cc,
* tutorial/samples/fill.cc,
* tutorial/samples/fun-p2v-1.cc,
* tutorial/samples/graph-data.cc,
* tutorial/samples/graph-iter.cc,
* tutorial/samples/ima-has.cc,
* tutorial/samples/ima-save.cc,
* tutorial/samples/ima-size.cc,
* tutorial/samples/ima2d-1.cc,
* tutorial/samples/ima2d-2.cc,
* tutorial/samples/ima2d-3.cc,
* tutorial/samples/ima2d-4.cc,
* tutorial/samples/ima2d-5.cc,
* tutorial/samples/ima2d-6-clone.cc,
* tutorial/samples/ima2d-7.cc,
* tutorial/samples/ima2d-rot.cc,
* tutorial/samples/logical-not.cc,
* tutorial/samples/parray-append.cc,
* tutorial/samples/paste-call-1.cc,
* tutorial/samples/paste.cc,
* tutorial/samples/point-1.cc,
* tutorial/samples/predicate-1.cc,
* tutorial/samples/win-create-1.cc,
* tutorial/samples/win-create-2.cc,
* tutorial/tutorial.tex: make samples compile.
* tutorial/samples/fill-part-image.cc,
* tutorial/samples/fill-subdomain-shorter.cc,
* tutorial/samples/fill-subdomain.cc,
* tutorial/samples/fill-subimage-cfun.cc,
* tutorial/samples/domain-display.cc,
* tutorial/samples/box2d-bbox.cc,
* tutorial/samples/forall-piter.cc,
* tutorial/samples/mln_var.cc,
* tutorial/samples/parray-bbox.cc: Improve samples.
* tutorial/samples/box2d-1.cc,
* tutorial/samples/box2d-2.cc,
* tutorial/samples/domain-display-1.cc,
* tutorial/samples/domain-display-out-1.cc,
* tutorial/samples/fill-part-1.cc,
* tutorial/samples/fill-part-2.cc,
* tutorial/samples/fill-part-3.cc,
* tutorial/samples/forall-piter-1.cc,
* tutorial/samples/fun-p2b-1.cc,
* tutorial/samples/graph-add-edges.cc,
* tutorial/samples/graph-add-vertex.cc,
* tutorial/samples/graph-data-full.cc,
* tutorial/samples/graph-i2v-vertex.cc,
* tutorial/samples/graph-iter-edge-nbh-edge.cc,
* tutorial/samples/graph-iter-vertex-nbh-vertex.cc,
* tutorial/samples/graph-iter-vertex.cc,
* tutorial/samples/graph-p-vertices.cc,
* tutorial/samples/ima2d-decl-1.cc,
* tutorial/samples/ima2d-decl-2-blobs-full.cc,
* tutorial/samples/ima2d-decl-2-blobs.cc,
* tutorial/samples/ima2d-decl-2.cc,
* tutorial/samples/ima2d-restricted-display-1.cc,
* tutorial/samples/labeling-compute-call.cc,
* tutorial/samples/labeling-compute-result.cc,
* tutorial/samples/mln_var-1.cc,
* tutorial/samples/mln_var-2.cc,
* tutorial/samples/mln_var-3.cc,
* tutorial/samples/win-create-3.cc: not needed anymore. Mostly
generated.
* tutorial/todoxygen.sh: move to...
* tutorial/tools/todoxygen.sh: ...here.
* tutorial/tools/sample_utils.hh: new set of functions to help writing
doc examples.
* tutorial/tools/split_sample.sh: new script to split example files.
---
milena/ChangeLog | 168 ++++++++++++++
milena/doc/Doxyfile.in | 1 +
milena/doc/Makefile.am | 22 +--
milena/doc/doc.mk | 5 +
milena/doc/tutorial/Makefile.am | 35 +++-
milena/doc/tutorial/figures/fill-subdomain-1.pbm | 5 +
milena/doc/tutorial/figures/fill-subdomain-2.ppm | Bin 0 -> 206 bytes
milena/doc/tutorial/figures/fill-subdomain-3.ppm | Bin 0 -> 206 bytes
milena/doc/tutorial/figures/fill-subdomain-4.ppm | Bin 0 -> 206 bytes
.../doc/tutorial/figures/fill-subimage-cfun-1.ppm | Bin 0 -> 206 bytes
milena/doc/tutorial/figures/ima_save.pbm | 5 +
milena/doc/tutorial/figures/labeling-compute-1.pbm | 5 +
milena/doc/tutorial/figures/labeling-compute-2.ppm | Bin 0 -> 206 bytes
milena/doc/tutorial/figures/logical-not-1.pbm | 5 +
milena/doc/tutorial/figures/logical-not-2.pbm | 5 +
milena/doc/tutorial/figures/logical-not-3.pbm | 5 +
milena/doc/tutorial/outputs/box2d-bbox.txt | 2 +
milena/doc/tutorial/outputs/domain-display.txt | 2 +
milena/doc/tutorial/outputs/fill-part-image.txt | 12 +
milena/doc/tutorial/outputs/forall-piter.txt | 1 +
.../{graph-data-full.txt => graph-data.txt} | 0
milena/doc/tutorial/outputs/graph-iter.txt | 28 +++
milena/doc/tutorial/outputs/ima2d-3.txt | 5 +
milena/doc/tutorial/outputs/ima2d-4.txt | 1 +
milena/doc/tutorial/outputs/ima2d-5.txt | 2 +
milena/doc/tutorial/outputs/ima2d-6-clone.txt | 2 +
...ecl-2-blobs-full.txt => ima2d-decl-2-blobs.txt} | 0
.../ima2d-display-1.txt} | 0
.../ima2d-display-2.txt} | 0
milena/doc/tutorial/outputs/labeling-compute-1 | Bin 0 -> 206 bytes
milena/doc/tutorial/outputs/labeling-compute.txt | 5 +
milena/doc/tutorial/outputs/logical-not.txt | 18 --
milena/doc/tutorial/outputs/parray-bbox.txt | 2 +
.../parray-display-1.txt} | 0
milena/doc/tutorial/outputs/paste-call-1.txt | 6 +-
.../win-create-1-display.txt} | 0
milena/doc/tutorial/samples/Makefile.am | 141 ++++++++++--
.../tutorial/samples/accu-right-instanciation.cc | 12 +-
...nciation.cc => accu-wrong-instanciation.cc.raw} | 0
milena/doc/tutorial/samples/borderthickness.cc | 3 +
milena/doc/tutorial/samples/box2d-1.cc | 7 -
milena/doc/tutorial/samples/box2d-2.cc | 9 -
milena/doc/tutorial/samples/box2d-bbox.cc | 15 ++
milena/doc/tutorial/samples/domain-display-1.cc | 4 -
.../doc/tutorial/samples/domain-display-out-1.cc | 2 -
milena/doc/tutorial/samples/domain-display.cc | 15 ++
milena/doc/tutorial/samples/dpoint-1.cc | 5 +-
milena/doc/tutorial/samples/estim-sites.cc | 14 +-
milena/doc/tutorial/samples/extension-ignore.cc | 19 ++-
milena/doc/tutorial/samples/fill-call-1.cc | 19 ++-
milena/doc/tutorial/samples/fill-part-1.cc | 16 --
milena/doc/tutorial/samples/fill-part-2.cc | 17 --
milena/doc/tutorial/samples/fill-part-3.cc | 9 -
milena/doc/tutorial/samples/fill-part-image.cc | 42 ++++
.../doc/tutorial/samples/fill-subdomain-shorter.cc | 33 +++
milena/doc/tutorial/samples/fill-subdomain.cc | 54 +++++
milena/doc/tutorial/samples/fill-subimage-cfun.cc | 39 ++++
milena/doc/tutorial/samples/fill.cc | 8 +
milena/doc/tutorial/samples/forall-piter-1.cc | 5 -
milena/doc/tutorial/samples/forall-piter.cc | 14 ++
milena/doc/tutorial/samples/fun-p2b-1.cc | 4 -
milena/doc/tutorial/samples/fun-p2v-1.cc | 9 +-
milena/doc/tutorial/samples/graph-add-edges.cc | 5 -
milena/doc/tutorial/samples/graph-add-vertex.cc | 4 -
milena/doc/tutorial/samples/graph-data-full.cc | 82 -------
milena/doc/tutorial/samples/graph-data.cc | 58 ++++-
milena/doc/tutorial/samples/graph-i2v-vertex.cc | 7 -
.../tutorial/samples/graph-iter-edge-nbh-edge.cc | 15 --
.../samples/graph-iter-vertex-nbh-vertex.cc | 15 --
milena/doc/tutorial/samples/graph-iter-vertex.cc | 15 --
milena/doc/tutorial/samples/graph-iter.cc | 130 +++++++++++-
milena/doc/tutorial/samples/graph-p-vertices.cc | 1 -
milena/doc/tutorial/samples/ima-has.cc | 2 +
.../samples/{ima-load.cc => ima-load.cc.raw} | 5 +-
milena/doc/tutorial/samples/ima-save.cc | 17 ++-
milena/doc/tutorial/samples/ima-size.cc | 2 +
milena/doc/tutorial/samples/ima2d-1.cc | 2 +
milena/doc/tutorial/samples/ima2d-2.cc | 19 +-
milena/doc/tutorial/samples/ima2d-3.cc | 10 +-
milena/doc/tutorial/samples/ima2d-4.cc | 21 ++-
milena/doc/tutorial/samples/ima2d-5.cc | 28 ++-
milena/doc/tutorial/samples/ima2d-6-clone.cc | 20 ++-
milena/doc/tutorial/samples/ima2d-7.cc | 16 +-
milena/doc/tutorial/samples/ima2d-decl-1.cc | 1 -
.../tutorial/samples/ima2d-decl-2-blobs-full.cc | 21 --
milena/doc/tutorial/samples/ima2d-decl-2-blobs.cc | 2 -
milena/doc/tutorial/samples/ima2d-decl-2.cc | 9 -
...d-restricted-1.cc => ima2d-restricted-1.cc.raw} | 0
...d-restricted-2.cc => ima2d-restricted-2.cc.raw} | 0
...d-restricted-3.cc => ima2d-restricted-3.cc.raw} | 0
.../tutorial/samples/ima2d-restricted-display-1.cc | 7 -
milena/doc/tutorial/samples/ima2d-rot.cc | 13 +-
.../doc/tutorial/samples/labeling-compute-call.cc | 3 -
.../tutorial/samples/labeling-compute-result.cc | 2 -
...abeling-compute-full.cc => labeling-compute.cc} | 19 ++-
milena/doc/tutorial/samples/logical-not.cc | 30 ++--
milena/doc/tutorial/samples/mln_var-1.cc | 1 -
milena/doc/tutorial/samples/mln_var-2.cc | 1 -
milena/doc/tutorial/samples/mln_var-3.cc | 9 -
milena/doc/tutorial/samples/mln_var.cc | 42 ++++
milena/doc/tutorial/samples/parray-append.cc | 20 ++-
milena/doc/tutorial/samples/parray-bbox.cc | 19 ++
milena/doc/tutorial/samples/paste-call-1.cc | 6 +-
milena/doc/tutorial/samples/paste.cc | 8 +
milena/doc/tutorial/samples/point-1.cc | 7 +-
milena/doc/tutorial/samples/predicate-1.cc | 9 +
milena/doc/tutorial/samples/win-create-1.cc | 16 +-
milena/doc/tutorial/samples/win-create-2.cc | 27 ++-
milena/doc/tutorial/samples/win-create-3.cc | 7 -
milena/doc/tutorial/tools/sample_utils.hh | 94 ++++++++
milena/doc/tutorial/tools/split_sample.sh | 23 ++
milena/doc/tutorial/{ => tools}/todoxygen.sh | 0
milena/doc/tutorial/tutorial.tex | 232 ++++++++++++++-----
113 files changed, 1458 insertions(+), 506 deletions(-)
create mode 100644 milena/doc/tutorial/figures/fill-subdomain-1.pbm
create mode 100644 milena/doc/tutorial/figures/fill-subdomain-2.ppm
create mode 100644 milena/doc/tutorial/figures/fill-subdomain-3.ppm
create mode 100644 milena/doc/tutorial/figures/fill-subdomain-4.ppm
create mode 100644 milena/doc/tutorial/figures/fill-subimage-cfun-1.ppm
create mode 100644 milena/doc/tutorial/figures/ima_save.pbm
create mode 100644 milena/doc/tutorial/figures/labeling-compute-1.pbm
create mode 100644 milena/doc/tutorial/figures/labeling-compute-2.ppm
create mode 100644 milena/doc/tutorial/figures/logical-not-1.pbm
create mode 100644 milena/doc/tutorial/figures/logical-not-2.pbm
create mode 100644 milena/doc/tutorial/figures/logical-not-3.pbm
create mode 100644 milena/doc/tutorial/outputs/accu-right-instanciation.txt
create mode 100644 milena/doc/tutorial/outputs/box2d-bbox.txt
create mode 100644 milena/doc/tutorial/outputs/domain-display.txt
create mode 100644 milena/doc/tutorial/outputs/estim-sites.txt
create mode 100644 milena/doc/tutorial/outputs/extension-ignore.txt
create mode 100644 milena/doc/tutorial/outputs/fill-call-1.txt
create mode 100644 milena/doc/tutorial/outputs/fill-part-image.txt
create mode 100644 milena/doc/tutorial/outputs/fill-subdomain-shorter.txt
create mode 100644 milena/doc/tutorial/outputs/fill-subdomain.txt
create mode 100644 milena/doc/tutorial/outputs/fill-subimage-cfun.txt
create mode 100644 milena/doc/tutorial/outputs/fill.txt
create mode 100644 milena/doc/tutorial/outputs/forall-piter.txt
create mode 100644 milena/doc/tutorial/outputs/fun-p2v-1.txt
rename milena/doc/tutorial/outputs/{graph-data-full.txt => graph-data.txt} (100%)
create mode 100644 milena/doc/tutorial/outputs/graph-iter.txt
create mode 100644 milena/doc/tutorial/outputs/ima-save.txt
create mode 100644 milena/doc/tutorial/outputs/ima2d-2.txt
create mode 100644 milena/doc/tutorial/outputs/ima2d-3.txt
create mode 100644 milena/doc/tutorial/outputs/ima2d-4.txt
create mode 100644 milena/doc/tutorial/outputs/ima2d-5.txt
create mode 100644 milena/doc/tutorial/outputs/ima2d-6-clone.txt
create mode 100644 milena/doc/tutorial/outputs/ima2d-7.txt
rename milena/doc/tutorial/outputs/{ima2d-decl-2-blobs-full.txt =>
ima2d-decl-2-blobs.txt} (100%)
create mode 100644 milena/doc/tutorial/outputs/ima2d-decl-2.txt
rename milena/doc/tutorial/{samples/ima2d-display-1.cc => outputs/ima2d-display-1.txt}
(100%)
rename milena/doc/tutorial/{samples/ima2d-display-2.cc => outputs/ima2d-display-2.txt}
(100%)
create mode 100644 milena/doc/tutorial/outputs/labeling-compute-1
create mode 100644 milena/doc/tutorial/outputs/labeling-compute.txt
create mode 100644 milena/doc/tutorial/outputs/mln_var.txt
create mode 100644 milena/doc/tutorial/outputs/parray-append.txt
create mode 100644 milena/doc/tutorial/outputs/parray-bbox.txt
rename milena/doc/tutorial/{samples/parray-display-1.cc =>
outputs/parray-display-1.txt} (100%)
create mode 100644 milena/doc/tutorial/outputs/paste.txt
create mode 100644 milena/doc/tutorial/outputs/predicate-1.txt
rename milena/doc/tutorial/{samples/win-create-1-display.cc =>
outputs/win-create-1-display.txt} (100%)
create mode 100644 milena/doc/tutorial/outputs/win-create-1.txt
create mode 100644 milena/doc/tutorial/outputs/win-create-2.txt
rename milena/doc/tutorial/samples/{accu-wrong-instanciation.cc =>
accu-wrong-instanciation.cc.raw} (100%)
delete mode 100644 milena/doc/tutorial/samples/box2d-1.cc
delete mode 100644 milena/doc/tutorial/samples/box2d-2.cc
create mode 100644 milena/doc/tutorial/samples/box2d-bbox.cc
delete mode 100644 milena/doc/tutorial/samples/domain-display-1.cc
delete mode 100644 milena/doc/tutorial/samples/domain-display-out-1.cc
create mode 100644 milena/doc/tutorial/samples/domain-display.cc
delete mode 100644 milena/doc/tutorial/samples/fill-part-1.cc
delete mode 100644 milena/doc/tutorial/samples/fill-part-2.cc
delete mode 100644 milena/doc/tutorial/samples/fill-part-3.cc
create mode 100644 milena/doc/tutorial/samples/fill-part-image.cc
create mode 100644 milena/doc/tutorial/samples/fill-subdomain-shorter.cc
create mode 100644 milena/doc/tutorial/samples/fill-subdomain.cc
create mode 100644 milena/doc/tutorial/samples/fill-subimage-cfun.cc
delete mode 100644 milena/doc/tutorial/samples/forall-piter-1.cc
create mode 100644 milena/doc/tutorial/samples/forall-piter.cc
delete mode 100644 milena/doc/tutorial/samples/fun-p2b-1.cc
delete mode 100644 milena/doc/tutorial/samples/graph-add-edges.cc
delete mode 100644 milena/doc/tutorial/samples/graph-add-vertex.cc
delete mode 100644 milena/doc/tutorial/samples/graph-data-full.cc
delete mode 100644 milena/doc/tutorial/samples/graph-i2v-vertex.cc
delete mode 100644 milena/doc/tutorial/samples/graph-iter-edge-nbh-edge.cc
delete mode 100644 milena/doc/tutorial/samples/graph-iter-vertex-nbh-vertex.cc
delete mode 100644 milena/doc/tutorial/samples/graph-iter-vertex.cc
delete mode 100644 milena/doc/tutorial/samples/graph-p-vertices.cc
rename milena/doc/tutorial/samples/{ima-load.cc => ima-load.cc.raw} (59%)
delete mode 100644 milena/doc/tutorial/samples/ima2d-decl-1.cc
delete mode 100644 milena/doc/tutorial/samples/ima2d-decl-2-blobs-full.cc
delete mode 100644 milena/doc/tutorial/samples/ima2d-decl-2-blobs.cc
delete mode 100644 milena/doc/tutorial/samples/ima2d-decl-2.cc
rename milena/doc/tutorial/samples/{ima2d-restricted-1.cc =>
ima2d-restricted-1.cc.raw} (100%)
rename milena/doc/tutorial/samples/{ima2d-restricted-2.cc =>
ima2d-restricted-2.cc.raw} (100%)
rename milena/doc/tutorial/samples/{ima2d-restricted-3.cc =>
ima2d-restricted-3.cc.raw} (100%)
delete mode 100644 milena/doc/tutorial/samples/ima2d-restricted-display-1.cc
delete mode 100644 milena/doc/tutorial/samples/labeling-compute-call.cc
delete mode 100644 milena/doc/tutorial/samples/labeling-compute-result.cc
rename milena/doc/tutorial/samples/{labeling-compute-full.cc => labeling-compute.cc}
(64%)
delete mode 100644 milena/doc/tutorial/samples/mln_var-1.cc
delete mode 100644 milena/doc/tutorial/samples/mln_var-2.cc
delete mode 100644 milena/doc/tutorial/samples/mln_var-3.cc
create mode 100644 milena/doc/tutorial/samples/mln_var.cc
create mode 100644 milena/doc/tutorial/samples/parray-bbox.cc
delete mode 100644 milena/doc/tutorial/samples/win-create-3.cc
create mode 100644 milena/doc/tutorial/tools/sample_utils.hh
create mode 100755 milena/doc/tutorial/tools/split_sample.sh
rename milena/doc/tutorial/{ => tools}/todoxygen.sh (100%)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 6d684b6..c2dc31d 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,171 @@
+2008-11-27 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Upgrade tutorial.
+
+ * Doxyfile.in: add new path to included files.
+
+ * tutorial/Makefile.am,
+ * Makefile.am: update target dependencies.
+
+ * doc.mk: add new global variables.
+
+ * tutorial/figures/fill-subdomain-1.pbm,
+ * tutorial/figures/fill-subdomain-2.ppm,
+ * tutorial/figures/fill-subdomain-3.ppm,
+ * tutorial/figures/fill-subdomain-4.ppm,
+ * tutorial/figures/fill-subimage-cfun-1.ppm,
+ * tutorial/figures/ima_save.pbm,
+ * tutorial/figures/labeling-compute-1.pbm,
+ * tutorial/figures/labeling-compute-2.ppm,
+ * tutorial/figures/logical-not-1.pbm,
+ * tutorial/figures/logical-not-2.pbm,
+ * tutorial/figures/logical-not-3.pbm: add new reference figures.
+
+ * tutorial/outputs/accu-right-instanciation.txt,
+ * tutorial/outputs/box2d-bbox.txt,
+ * tutorial/outputs/domain-display.txt,
+ * tutorial/outputs/estim-sites.txt,
+ * tutorial/outputs/extension-ignore.txt,
+ * tutorial/outputs/fill-call-1.txt,
+ * tutorial/outputs/fill-part-image.txt,
+ * tutorial/outputs/fill-subdomain-shorter.txt,
+ * tutorial/outputs/fill-subdomain.txt,
+ * tutorial/outputs/fill-subimage-cfun.txt,
+ * tutorial/outputs/fill.txt,
+ * tutorial/outputs/forall-piter.txt,
+ * tutorial/outputs/fun-p2v-1.txt,
+ * tutorial/outputs/graph-data-full.txt,
+ * tutorial/outputs/graph-data.txt,
+ * tutorial/outputs/graph-iter.txt,
+ * tutorial/outputs/ima-save.txt,
+ * tutorial/outputs/ima2d-2.txt,
+ * tutorial/outputs/ima2d-3.txt,
+ * tutorial/outputs/ima2d-4.txt,
+ * tutorial/outputs/ima2d-5.txt,
+ * tutorial/outputs/ima2d-6-clone.txt,
+ * tutorial/outputs/ima2d-7.txt,
+ * tutorial/outputs/ima2d-decl-2-blobs-full.txt,
+ * tutorial/outputs/ima2d-decl-2-blobs.txt,
+ * tutorial/outputs/ima2d-decl-2.txt,
+ * tutorial/samples/ima2d-display-1.cc,
+ * tutorial/outputs/ima2d-display-1.txt,
+ * tutorial/samples/ima2d-display-2.cc,
+ * tutorial/outputs/ima2d-display-2.txt,
+ * tutorial/outputs/labeling-compute-1,
+ * tutorial/outputs/labeling-compute.txt,
+ * tutorial/outputs/logical-not.txt,
+ * tutorial/outputs/mln_var.txt,
+ * tutorial/outputs/parray-append.txt,
+ * tutorial/outputs/parray-bbox.txt,
+ * tutorial/samples/parray-display-1.cc,
+ * tutorial/outputs/parray-display-1.txt,
+ * tutorial/outputs/paste-call-1.txt,
+ * tutorial/outputs/paste.txt,
+ * tutorial/outputs/predicate-1.txt,
+ * tutorial/samples/win-create-1-display.cc,
+ * tutorial/outputs/win-create-1-display.txt,
+ * tutorial/outputs/win-create-1.txt,
+ * tutorial/outputs/win-create-2.txt: Update and add new reference
+ outputs.
+
+ * tutorial/samples/accu-wrong-instanciation.cc: rename as...
+ * tutorial/samples/accu-wrong-instanciation.cc.raw: ...this.
+
+ * tutorial/samples/ima-load.cc: rename as...
+ * tutorial/samples/ima-load.cc.raw: ...this.
+
+ * tutorial/samples/ima2d-restricted-1.cc: rename as...
+ * tutorial/samples/ima2d-restricted-1.cc.raw: ...this.
+
+ * tutorial/samples/ima2d-restricted-2.cc: rename as...
+ * tutorial/samples/ima2d-restricted-2.cc.raw: ...this.
+
+ * tutorial/samples/ima2d-restricted-3.cc: rename as...
+ * tutorial/samples/ima2d-restricted-3.cc.raw: ...this.
+
+ * tutorial/samples/labeling-compute-full.cc: rename as...
+ * tutorial/samples/labeling-compute.cc: ...this.
+
+ * tutorial/samples/Makefile.am,
+ * tutorial/samples/accu-right-instanciation.cc,
+ * tutorial/samples/borderthickness.cc,
+ * tutorial/samples/dpoint-1.cc,
+ * tutorial/samples/estim-sites.cc,
+ * tutorial/samples/extension-ignore.cc,
+ * tutorial/samples/fill-call-1.cc,
+ * tutorial/samples/fill.cc,
+ * tutorial/samples/fun-p2v-1.cc,
+ * tutorial/samples/graph-data.cc,
+ * tutorial/samples/graph-iter.cc,
+ * tutorial/samples/ima-has.cc,
+ * tutorial/samples/ima-save.cc,
+ * tutorial/samples/ima-size.cc,
+ * tutorial/samples/ima2d-1.cc,
+ * tutorial/samples/ima2d-2.cc,
+ * tutorial/samples/ima2d-3.cc,
+ * tutorial/samples/ima2d-4.cc,
+ * tutorial/samples/ima2d-5.cc,
+ * tutorial/samples/ima2d-6-clone.cc,
+ * tutorial/samples/ima2d-7.cc,
+ * tutorial/samples/ima2d-rot.cc,
+ * tutorial/samples/logical-not.cc,
+ * tutorial/samples/parray-append.cc,
+ * tutorial/samples/paste-call-1.cc,
+ * tutorial/samples/paste.cc,
+ * tutorial/samples/point-1.cc,
+ * tutorial/samples/predicate-1.cc,
+ * tutorial/samples/win-create-1.cc,
+ * tutorial/samples/win-create-2.cc,
+ * tutorial/tutorial.tex: make samples compile.
+
+ * tutorial/samples/fill-part-image.cc,
+ * tutorial/samples/fill-subdomain-shorter.cc,
+ * tutorial/samples/fill-subdomain.cc,
+ * tutorial/samples/fill-subimage-cfun.cc,
+ * tutorial/samples/domain-display.cc,
+ * tutorial/samples/box2d-bbox.cc,
+ * tutorial/samples/forall-piter.cc,
+ * tutorial/samples/mln_var.cc,
+ * tutorial/samples/parray-bbox.cc: Improve samples.
+
+ * tutorial/samples/box2d-1.cc,
+ * tutorial/samples/box2d-2.cc,
+ * tutorial/samples/domain-display-1.cc,
+ * tutorial/samples/domain-display-out-1.cc,
+ * tutorial/samples/fill-part-1.cc,
+ * tutorial/samples/fill-part-2.cc,
+ * tutorial/samples/fill-part-3.cc,
+ * tutorial/samples/forall-piter-1.cc,
+ * tutorial/samples/fun-p2b-1.cc,
+ * tutorial/samples/graph-add-edges.cc,
+ * tutorial/samples/graph-add-vertex.cc,
+ * tutorial/samples/graph-data-full.cc,
+ * tutorial/samples/graph-i2v-vertex.cc,
+ * tutorial/samples/graph-iter-edge-nbh-edge.cc,
+ * tutorial/samples/graph-iter-vertex-nbh-vertex.cc,
+ * tutorial/samples/graph-iter-vertex.cc,
+ * tutorial/samples/graph-p-vertices.cc,
+ * tutorial/samples/ima2d-decl-1.cc,
+ * tutorial/samples/ima2d-decl-2-blobs-full.cc,
+ * tutorial/samples/ima2d-decl-2-blobs.cc,
+ * tutorial/samples/ima2d-decl-2.cc,
+ * tutorial/samples/ima2d-restricted-display-1.cc,
+ * tutorial/samples/labeling-compute-call.cc,
+ * tutorial/samples/labeling-compute-result.cc,
+ * tutorial/samples/mln_var-1.cc,
+ * tutorial/samples/mln_var-2.cc,
+ * tutorial/samples/mln_var-3.cc,
+ * tutorial/samples/win-create-3.cc: not needed anymore. Mostly
+ generated.
+
+ * tutorial/todoxygen.sh: move to...
+ * tutorial/tools/todoxygen.sh: ...here.
+
+ * tutorial/tools/sample_utils.hh: new set of functions to help writing
+ doc examples.
+
+ * tutorial/tools/split_sample.sh: new script to split example files.
+
2008-11-27 Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Add a test on p_vaccess.
diff --git a/milena/doc/Doxyfile.in b/milena/doc/Doxyfile.in
index 144d23a..e56c529 100644
--- a/milena/doc/Doxyfile.in
+++ b/milena/doc/Doxyfile.in
@@ -87,6 +87,7 @@ EXCLUDE_PATTERNS = *spe.hh
EXCLUDE_SYMBOLS =
EXAMPLE_PATH = @top_srcdir@/milena/doc/tutorial/samples \
@top_builddir@/milena/doc/tutorial/outputs \
+ @top_builddir@/milena/doc/tutorial/outputs/splitted \
@top_srcdir@/milena/doc/tutorial/outputs
EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO
diff --git a/milena/doc/Makefile.am b/milena/doc/Makefile.am
index bb717f6..a0a71f8 100644
--- a/milena/doc/Makefile.am
+++ b/milena/doc/Makefile.am
@@ -6,34 +6,28 @@ SUBDIRS = tutorial
DOXYGEN = doxygen
-.PHONY: doc user-doc complete-doc html_complete html_user
+.PHONY: doc user-doc complete-doc html_complete html_user tuto
doc: complete-doc
complete-doc: html_complete
-user-doc: html_user tutorial
+user-doc: html_user tuto
-html_complete: figures Doxyfile tuto_html
+html_complete: Doxyfile tuto_html
$(DOXYGEN) Doxyfile_complete
-html_user: figures Doxyfile tuto_html
+html_user: Doxyfile tuto_html
$(DOXYGEN) Doxyfile_user
-figures: all
- @failcom='exit 1'; \
- list='${wildcard $(FIGURES_BUILDDIR)/*.p*m}'; for img in $$list; do \
- echo "Converting $$img to png"; \
- convert $$img $(FIGURES_BUILDDIR)/`basename $$img .ppm`.png \
- || eval $$failcom; \
- done;
-
tuto_html:
- $(MAKE) -C tutorial tuto_html
-tuto: all figures
+tuto: all
$(MAKE) -C tutorial tuto
+fix-refdata:
+ $(MAKE) -C tutorial fix-refdata
+
edit = sed -e "s|@ID@|$$Id|" \
-e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
-e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
diff --git a/milena/doc/doc.mk b/milena/doc/doc.mk
index 3311139..c5ff517 100644
--- a/milena/doc/doc.mk
+++ b/milena/doc/doc.mk
@@ -2,12 +2,17 @@
include $(top_srcdir)/milena/tests/tests.mk
+AM_CPPFLAGS += -I$(top_srcdir)/milena/doc/tutorial/tools
+
TUTORIAL_SRCDIR = $(top_srcdir)/milena/doc/tutorial
OUTPUTS_SRCDIR = $(TUTORIAL_SRCDIR)/outputs
FIGURES_SRCDIR = $(TUTORIAL_SRCDIR)/figures
+SAMPLES_SRCDIR = $(TUTORIAL_SRCDIR)/samples
TUTORIAL_BUILDDIR = $(top_builddir)/milena/doc/tutorial
OUTPUTS_BUILDDIR = $(TUTORIAL_BUILDDIR)/outputs
+SPLITTED_OUTPUTS_BUILDDIR = $(TUTORIAL_BUILDDIR)/outputs/splitted
FIGURES_BUILDDIR = $(TUTORIAL_BUILDDIR)/figures
+SAMPLES_BUILDDIR = $(TUTORIAL_BUILDDIR)/samples
diff --git a/milena/doc/tutorial/Makefile.am b/milena/doc/tutorial/Makefile.am
index 9bc00e6..e2e864a 100644
--- a/milena/doc/tutorial/Makefile.am
+++ b/milena/doc/tutorial/Makefile.am
@@ -1,18 +1,37 @@
SUBDIRS = samples
-.PHONY: tuto
+.PHONY: tuto tuto_html
include $(top_srcdir)/milena/doc/doc.mk
-TEXINPUTS = $(TUTORIAL_SRCDIR):$(TUTORIAL_BUILDDIR):
+TEXINPUTS = $(TUTORIAL_SRCDIR):$(TUTORIAL_BUILDDIR):$(OUTPUTS_SRCDIR):
-tuto:
+tuto: data fig-convert
TEXINPUTS=$(TEXINPUTS) pdflatex $(TUTORIAL_SRCDIR)/tutorial.tex
+ TEXINPUTS=$(TEXINPUTS) pdflatex $(TUTORIAL_SRCDIR)/tutorial.tex
+ TEXINPUTS=$(TEXINPUTS) pdflatex $(TUTORIAL_SRCDIR)/tutorial.tex
+
+tuto_html: data fig-convert
+ chmod u+x $(TUTORIAL_SRCDIR)/tools/todoxygen.sh
+ $(TUTORIAL_SRCDIR)/tools/todoxygen.sh $(TUTORIAL_SRCDIR)/tutorial.tex
$(TUTORIAL_BUILDDIR)
+
+data:
+ make -C samples data
+
+fix-refdata:
+ make -C samples fix-refdata
-tuto_html:
- chmod u+x $(TUTORIAL_SRCDIR)/todoxygen.sh
- $(TUTORIAL_SRCDIR)/todoxygen.sh $(TUTORIAL_SRCDIR)/tutorial.tex $(TUTORIAL_BUILDDIR)
+fig-convert:
+ @failcom='exit 1'; \
+ list="$(FIGURES_BUILDDIR)/*.p*m"; for img in $$list; do \
+ echo "Converting $$img to png"; \
+ name=`basename $$img` \
+ ext=`echo $$name | cut -d '.' -f 2`; \
+ convert $$img $(FIGURES_BUILDDIR)/`basename $$img $$ext`png \
+ || eval $$failcom; \
+ done;
clean-local:
- rm -f *.aux *.toc *.log *.bbl *blg *.lot *.out *~
+ rm -f tutorial.aux tutorial.toc tutorial.log tutorial.bbl tutorial.out
+ rm -f *~ *blg *.lot
rm -f tutorial.pdf
- rm *.haux *.hh *.html *.htoc
+ rm -f *.haux *.hh *.html *.htoc
diff --git a/milena/doc/tutorial/figures/fill-subdomain-1.pbm
b/milena/doc/tutorial/figures/fill-subdomain-1.pbm
new file mode 100644
index 0000000..4c79df2
--- /dev/null
+++ b/milena/doc/tutorial/figures/fill-subdomain-1.pbm
@@ -0,0 +1,5 @@
+P4
+# Generated by Milena 1.0
http://olena.lrde.epita.fr
+# EPITA Research and Development Laboratory (LRDE)
+5 6
+˜˜ø(@x
\ No newline at end of file
diff --git a/milena/doc/tutorial/figures/fill-subdomain-2.ppm
b/milena/doc/tutorial/figures/fill-subdomain-2.ppm
new file mode 100644
index 0000000000000000000000000000000000000000..7bfa0e4c45344b8acdbefee7347dd890f15031a2
GIT binary patch
literal 206
zcmWGA<5E^|Pt8j$N-RlDQAny(@XgFg%}Z1;)H6^}$S5f(u+rDh2Z`wA6s4r<r50qC
zB<iIV0d=_sc!oGC1f>?ICKe@UC?w{kD7d7SrRL-p<fi78DEK5M<pT}PFRE0~@CkBp
z)#Nf&Fyk^ZHRWPpU{F1m4n#l(1fX$Y!XR3Cra2G+8Idtz5H5rb<N^^y3Mc{r0K)t+
A#Q*>R
literal 0
HcmV?d00001
diff --git a/milena/doc/tutorial/figures/fill-subdomain-3.ppm
b/milena/doc/tutorial/figures/fill-subdomain-3.ppm
new file mode 100644
index 0000000000000000000000000000000000000000..037dec623f7a3629cc0b4cc0523eb091071ccfc4
GIT binary patch
literal 206
zcmWGA<5E^|Pt8j$N-RlDQAny(@XgFg%}Z1;)H6^}$S5f(u+rDh2Z`wA6s4r<r50qC
zB<iIV0d=_sc!oGC1f>?ICKe@UC?w{kD7d7SrRL-p<fi78DEK5M<pT}PFRE0~@CkBp
e)#Nf&Fyk^ZHRWO;1*o1&2O_u*WHwL`jSB$tMJdey
literal 0
HcmV?d00001
diff --git a/milena/doc/tutorial/figures/fill-subdomain-4.ppm
b/milena/doc/tutorial/figures/fill-subdomain-4.ppm
new file mode 100644
index 0000000000000000000000000000000000000000..41f6b5492c80937955e863a1f3413be1c9954ad8
GIT binary patch
literal 206
zcmWGA<5E^|Pt8j$N-RlDQAny(@XgFg%}Z1;)H6^}$S5f(u+rDh2Z`wA6s4r<r50qC
zB<iIV0d=_sc!oGC1f>?ICKe@UC?w{kD7d7SrRL-p<fi78DEK5M<pT}PFRE0~@CkBp
d)#Nf&Fyk^ZHRWO;1^j1V03tX*W&;J$xB$w@C}98q
literal 0
HcmV?d00001
diff --git a/milena/doc/tutorial/figures/fill-subimage-cfun-1.ppm
b/milena/doc/tutorial/figures/fill-subimage-cfun-1.ppm
new file mode 100644
index 0000000000000000000000000000000000000000..a341258e36e2a1f41906112326ef74f5da020ec1
GIT binary patch
literal 206
zcmZ8Zy$ZrG7|fifIB?M=RiPc+gccDhl;R6~HJ`MQCLso)Pp@%nJZ?DdudCz+7q%QI
zvc|CBHW{{rgW3aQjQ&&<?&l~IG%NN~B=rnw)pXbU89l$4!eazkjhf$VoS)f7v^2PM
g>cWC;+t<xbmZ;>hETzct5n|0e%%W8L!+MzX7mgw`RsaA1
literal 0
HcmV?d00001
diff --git a/milena/doc/tutorial/figures/ima_save.pbm
b/milena/doc/tutorial/figures/ima_save.pbm
new file mode 100644
index 0000000..2faf6d4
--- /dev/null
+++ b/milena/doc/tutorial/figures/ima_save.pbm
@@ -0,0 +1,5 @@
+P4
+# Generated by Milena 1.0
http://olena.lrde.epita.fr
+# EPITA Research and Development Laboratory (LRDE)
+5 5
+XÅ¡XÅ¡Å¡
\ No newline at end of file
diff --git a/milena/doc/tutorial/figures/labeling-compute-1.pbm
b/milena/doc/tutorial/figures/labeling-compute-1.pbm
new file mode 100644
index 0000000..4c79df2
--- /dev/null
+++ b/milena/doc/tutorial/figures/labeling-compute-1.pbm
@@ -0,0 +1,5 @@
+P4
+# Generated by Milena 1.0
http://olena.lrde.epita.fr
+# EPITA Research and Development Laboratory (LRDE)
+5 6
+˜˜ø(@x
\ No newline at end of file
diff --git a/milena/doc/tutorial/figures/labeling-compute-2.ppm
b/milena/doc/tutorial/figures/labeling-compute-2.ppm
new file mode 100644
index 0000000000000000000000000000000000000000..7bfa0e4c45344b8acdbefee7347dd890f15031a2
GIT binary patch
literal 206
zcmWGA<5E^|Pt8j$N-RlDQAny(@XgFg%}Z1;)H6^}$S5f(u+rDh2Z`wA6s4r<r50qC
zB<iIV0d=_sc!oGC1f>?ICKe@UC?w{kD7d7SrRL-p<fi78DEK5M<pT}PFRE0~@CkBp
z)#Nf&Fyk^ZHRWPpU{F1m4n#l(1fX$Y!XR3Cra2G+8Idtz5H5rb<N^^y3Mc{r0K)t+
A#Q*>R
literal 0
HcmV?d00001
diff --git a/milena/doc/tutorial/figures/logical-not-1.pbm
b/milena/doc/tutorial/figures/logical-not-1.pbm
new file mode 100644
index 0000000..2faf6d4
--- /dev/null
+++ b/milena/doc/tutorial/figures/logical-not-1.pbm
@@ -0,0 +1,5 @@
+P4
+# Generated by Milena 1.0
http://olena.lrde.epita.fr
+# EPITA Research and Development Laboratory (LRDE)
+5 5
+XÅ¡XÅ¡Å¡
\ No newline at end of file
diff --git a/milena/doc/tutorial/figures/logical-not-2.pbm
b/milena/doc/tutorial/figures/logical-not-2.pbm
new file mode 100644
index 0000000..de560ba
--- /dev/null
+++ b/milena/doc/tutorial/figures/logical-not-2.pbm
@@ -0,0 +1,5 @@
+P4
+# Generated by Milena 1.0
http://olena.lrde.epita.fr
+# EPITA Research and Development Laboratory (LRDE)
+5 5
+Â PÂ PP
\ No newline at end of file
diff --git a/milena/doc/tutorial/figures/logical-not-3.pbm
b/milena/doc/tutorial/figures/logical-not-3.pbm
new file mode 100644
index 0000000..de560ba
--- /dev/null
+++ b/milena/doc/tutorial/figures/logical-not-3.pbm
@@ -0,0 +1,5 @@
+P4
+# Generated by Milena 1.0
http://olena.lrde.epita.fr
+# EPITA Research and Development Laboratory (LRDE)
+5 5
+Â PÂ PP
\ No newline at end of file
diff --git a/milena/doc/tutorial/outputs/accu-right-instanciation.txt
b/milena/doc/tutorial/outputs/accu-right-instanciation.txt
new file mode 100644
index 0000000..e69de29
diff --git a/milena/doc/tutorial/outputs/box2d-bbox.txt
b/milena/doc/tutorial/outputs/box2d-bbox.txt
new file mode 100644
index 0000000..f31cdef
--- /dev/null
+++ b/milena/doc/tutorial/outputs/box2d-bbox.txt
@@ -0,0 +1,2 @@
+[(0, 0)..(1, 2)]
+nsites = 6
diff --git a/milena/doc/tutorial/outputs/domain-display.txt
b/milena/doc/tutorial/outputs/domain-display.txt
new file mode 100644
index 0000000..02f0962
--- /dev/null
+++ b/milena/doc/tutorial/outputs/domain-display.txt
@@ -0,0 +1,2 @@
+ima1.domain() = [(0, 0)..(4, 4)]
+ima2.domain() = [(0, 0)..(9, 9)]
diff --git a/milena/doc/tutorial/outputs/estim-sites.txt
b/milena/doc/tutorial/outputs/estim-sites.txt
new file mode 100644
index 0000000..e69de29
diff --git a/milena/doc/tutorial/outputs/extension-ignore.txt
b/milena/doc/tutorial/outputs/extension-ignore.txt
new file mode 100644
index 0000000..e69de29
diff --git a/milena/doc/tutorial/outputs/fill-call-1.txt
b/milena/doc/tutorial/outputs/fill-call-1.txt
new file mode 100644
index 0000000..e69de29
diff --git a/milena/doc/tutorial/outputs/fill-part-image.txt
b/milena/doc/tutorial/outputs/fill-part-image.txt
new file mode 100644
index 0000000..39d0035
--- /dev/null
+++ b/milena/doc/tutorial/outputs/fill-part-image.txt
@@ -0,0 +1,12 @@
+ -
+
+
+
+-
+
+ -
+
+
+
+-
+
diff --git a/milena/doc/tutorial/outputs/fill-subdomain-shorter.txt
b/milena/doc/tutorial/outputs/fill-subdomain-shorter.txt
new file mode 100644
index 0000000..e69de29
diff --git a/milena/doc/tutorial/outputs/fill-subdomain.txt
b/milena/doc/tutorial/outputs/fill-subdomain.txt
new file mode 100644
index 0000000..e69de29
diff --git a/milena/doc/tutorial/outputs/fill-subimage-cfun.txt
b/milena/doc/tutorial/outputs/fill-subimage-cfun.txt
new file mode 100644
index 0000000..e69de29
diff --git a/milena/doc/tutorial/outputs/fill.txt b/milena/doc/tutorial/outputs/fill.txt
new file mode 100644
index 0000000..e69de29
diff --git a/milena/doc/tutorial/outputs/forall-piter.txt
b/milena/doc/tutorial/outputs/forall-piter.txt
new file mode 100644
index 0000000..f22d097
--- /dev/null
+++ b/milena/doc/tutorial/outputs/forall-piter.txt
@@ -0,0 +1 @@
+(0, 0)(0, 1)(1, 0)(1, 1)(2, 0)(2, 1)
\ No newline at end of file
diff --git a/milena/doc/tutorial/outputs/fun-p2v-1.txt
b/milena/doc/tutorial/outputs/fun-p2v-1.txt
new file mode 100644
index 0000000..e69de29
diff --git a/milena/doc/tutorial/outputs/graph-data-full.txt
b/milena/doc/tutorial/outputs/graph-data.txt
similarity index 100%
rename from milena/doc/tutorial/outputs/graph-data-full.txt
rename to milena/doc/tutorial/outputs/graph-data.txt
diff --git a/milena/doc/tutorial/outputs/graph-iter.txt
b/milena/doc/tutorial/outputs/graph-iter.txt
new file mode 100644
index 0000000..2749d86
--- /dev/null
+++ b/milena/doc/tutorial/outputs/graph-iter.txt
@@ -0,0 +1,28 @@
+// \{
+0 : 10
+1 : 11
+2 : 12
+3 : 13
+4 : 14
+// \}
+// \{
+0 : (0,1)
+1 : (0,1) (1,2) (1,3)
+2 : (1,2) (2,4)
+3 : (1,3) (3,4)
+4 : (3,4) (2,4)
+// \}
+// \{
+(0,1) : (1,2) (1,3)
+(1,2) : (0,1) (1,3) (2,4)
+(1,3) : (0,1) (1,2) (3,4)
+(3,4) : (1,3) (2,4)
+(2,4) : (1,2) (3,4)
+// \}
+// \{
+0 : 1
+1 : 0 2 3
+2 : 1 4
+3 : 1 4
+4 : 3 2
+// \}
diff --git a/milena/doc/tutorial/outputs/ima-save.txt
b/milena/doc/tutorial/outputs/ima-save.txt
new file mode 100644
index 0000000..e69de29
diff --git a/milena/doc/tutorial/outputs/ima2d-2.txt
b/milena/doc/tutorial/outputs/ima2d-2.txt
new file mode 100644
index 0000000..e69de29
diff --git a/milena/doc/tutorial/outputs/ima2d-3.txt
b/milena/doc/tutorial/outputs/ima2d-3.txt
new file mode 100644
index 0000000..b0fda85
--- /dev/null
+++ b/milena/doc/tutorial/outputs/ima2d-3.txt
@@ -0,0 +1,5 @@
+ima.at(1,2) = 9
+ima(p) = 9
+---
+ima.at(1,2) = 2
+ima(p) = 2
diff --git a/milena/doc/tutorial/outputs/ima2d-4.txt
b/milena/doc/tutorial/outputs/ima2d-4.txt
new file mode 100644
index 0000000..bc59c12
--- /dev/null
+++ b/milena/doc/tutorial/outputs/ima2d-4.txt
@@ -0,0 +1 @@
+False
diff --git a/milena/doc/tutorial/outputs/ima2d-5.txt
b/milena/doc/tutorial/outputs/ima2d-5.txt
new file mode 100644
index 0000000..b78ee27
--- /dev/null
+++ b/milena/doc/tutorial/outputs/ima2d-5.txt
@@ -0,0 +1,2 @@
+2 - 2
+1
diff --git a/milena/doc/tutorial/outputs/ima2d-6-clone.txt
b/milena/doc/tutorial/outputs/ima2d-6-clone.txt
new file mode 100644
index 0000000..877bce6
--- /dev/null
+++ b/milena/doc/tutorial/outputs/ima2d-6-clone.txt
@@ -0,0 +1,2 @@
+3 - 0
+0
diff --git a/milena/doc/tutorial/outputs/ima2d-7.txt
b/milena/doc/tutorial/outputs/ima2d-7.txt
new file mode 100644
index 0000000..e69de29
diff --git a/milena/doc/tutorial/outputs/ima2d-decl-2-blobs-full.txt
b/milena/doc/tutorial/outputs/ima2d-decl-2-blobs.txt
similarity index 100%
rename from milena/doc/tutorial/outputs/ima2d-decl-2-blobs-full.txt
rename to milena/doc/tutorial/outputs/ima2d-decl-2-blobs.txt
diff --git a/milena/doc/tutorial/outputs/ima2d-decl-2.txt
b/milena/doc/tutorial/outputs/ima2d-decl-2.txt
new file mode 100644
index 0000000..e69de29
diff --git a/milena/doc/tutorial/samples/ima2d-display-1.cc
b/milena/doc/tutorial/outputs/ima2d-display-1.txt
similarity index 100%
rename from milena/doc/tutorial/samples/ima2d-display-1.cc
rename to milena/doc/tutorial/outputs/ima2d-display-1.txt
diff --git a/milena/doc/tutorial/samples/ima2d-display-2.cc
b/milena/doc/tutorial/outputs/ima2d-display-2.txt
similarity index 100%
rename from milena/doc/tutorial/samples/ima2d-display-2.cc
rename to milena/doc/tutorial/outputs/ima2d-display-2.txt
diff --git a/milena/doc/tutorial/outputs/labeling-compute-1
b/milena/doc/tutorial/outputs/labeling-compute-1
new file mode 100644
index 0000000000000000000000000000000000000000..7bfa0e4c45344b8acdbefee7347dd890f15031a2
GIT binary patch
literal 206
zcmWGA<5E^|Pt8j$N-RlDQAny(@XgFg%}Z1;)H6^}$S5f(u+rDh2Z`wA6s4r<r50qC
zB<iIV0d=_sc!oGC1f>?ICKe@UC?w{kD7d7SrRL-p<fi78DEK5M<pT}PFRE0~@CkBp
z)#Nf&Fyk^ZHRWPpU{F1m4n#l(1fX$Y!XR3Cra2G+8Idtz5H5rb<N^^y3Mc{r0K)t+
A#Q*>R
literal 0
HcmV?d00001
diff --git a/milena/doc/tutorial/outputs/labeling-compute.txt
b/milena/doc/tutorial/outputs/labeling-compute.txt
new file mode 100644
index 0000000..8108b32
--- /dev/null
+++ b/milena/doc/tutorial/outputs/labeling-compute.txt
@@ -0,0 +1,5 @@
+// \{
+[(0, 1)..(1, 2)]
+[(3, 0)..(5, 1)]
+[(3, 2)..(4, 4)]
+// \}
diff --git a/milena/doc/tutorial/outputs/logical-not.txt
b/milena/doc/tutorial/outputs/logical-not.txt
index 42391a7..e69de29 100644
--- a/milena/doc/tutorial/outputs/logical-not.txt
+++ b/milena/doc/tutorial/outputs/logical-not.txt
@@ -1,18 +0,0 @@
-ima:
-| -
-- |
-
-----
-ima_neg:
-- |
-| -
-
-ima:
-| -
-- |
-
-----
-not_inplace(ima)
-- |
-| -
-
diff --git a/milena/doc/tutorial/outputs/mln_var.txt
b/milena/doc/tutorial/outputs/mln_var.txt
new file mode 100644
index 0000000..e69de29
diff --git a/milena/doc/tutorial/outputs/parray-append.txt
b/milena/doc/tutorial/outputs/parray-append.txt
new file mode 100644
index 0000000..e69de29
diff --git a/milena/doc/tutorial/outputs/parray-bbox.txt
b/milena/doc/tutorial/outputs/parray-bbox.txt
new file mode 100644
index 0000000..28c8c9e
--- /dev/null
+++ b/milena/doc/tutorial/outputs/parray-bbox.txt
@@ -0,0 +1,2 @@
+[(1, 0)..(1, 1)]
+nsites = 2
diff --git a/milena/doc/tutorial/samples/parray-display-1.cc
b/milena/doc/tutorial/outputs/parray-display-1.txt
similarity index 100%
rename from milena/doc/tutorial/samples/parray-display-1.cc
rename to milena/doc/tutorial/outputs/parray-display-1.txt
diff --git a/milena/doc/tutorial/outputs/paste-call-1.txt
b/milena/doc/tutorial/outputs/paste-call-1.txt
index a09b521..49e117a 100644
--- a/milena/doc/tutorial/outputs/paste-call-1.txt
+++ b/milena/doc/tutorial/outputs/paste-call-1.txt
@@ -1,4 +1,4 @@
-b b b b
-b b b b
-b b b b
+98 98 98 98
+98 98 98 98
+98 98 98 98
diff --git a/milena/doc/tutorial/outputs/paste.txt
b/milena/doc/tutorial/outputs/paste.txt
new file mode 100644
index 0000000..e69de29
diff --git a/milena/doc/tutorial/outputs/predicate-1.txt
b/milena/doc/tutorial/outputs/predicate-1.txt
new file mode 100644
index 0000000..e69de29
diff --git a/milena/doc/tutorial/samples/win-create-1-display.cc
b/milena/doc/tutorial/outputs/win-create-1-display.txt
similarity index 100%
rename from milena/doc/tutorial/samples/win-create-1-display.cc
rename to milena/doc/tutorial/outputs/win-create-1-display.txt
diff --git a/milena/doc/tutorial/outputs/win-create-1.txt
b/milena/doc/tutorial/outputs/win-create-1.txt
new file mode 100644
index 0000000..e69de29
diff --git a/milena/doc/tutorial/outputs/win-create-2.txt
b/milena/doc/tutorial/outputs/win-create-2.txt
new file mode 100644
index 0000000..e69de29
diff --git a/milena/doc/tutorial/samples/Makefile.am
b/milena/doc/tutorial/samples/Makefile.am
index 43a5877..afa1cff 100644
--- a/milena/doc/tutorial/samples/Makefile.am
+++ b/milena/doc/tutorial/samples/Makefile.am
@@ -3,42 +3,107 @@
include $(top_srcdir)/milena/doc/doc.mk
bin_PROGRAMS = \
+ accu-right-instanciation \
borderthickness \
+ box2d-bbox \
+ domain-display \
dpoint-1 \
- graph-data-full \
+ estim-sites \
+ extension-ignore \
+ fill \
+ fill-call-1 \
+ fill-part-image \
+ fill-subdomain \
+ fill-subdomain-shorter \
+ fill-subimage-cfun \
+ forall-piter \
+ fun-p2v-1 \
+ graph-data \
+ graph-iter \
ima-has \
+ ima-save \
ima-size \
ima2d-1 \
- ima2d-decl-2-blobs-full \
+ ima2d-2 \
+ ima2d-3 \
+ ima2d-4 \
+ ima2d-5 \
+ ima2d-6-clone \
+ ima2d-7 \
ima2d-rot \
- labeling-compute-full \
+ ima-size \
+ labeling-compute \
logical-not \
+ mln_var \
+ parray-bbox \
+ paste \
paste-call-1 \
- point-1
+ parray-append \
+ point-1 \
+ predicate-1 \
+ win-create-1 \
+ win-create-2
+accu_right_instanciation_SOURCES = accu-right-instanciation.cc
borderthickness_SOURCES = borderthickness.cc
+box2d_bbox_SOURCES = box2d-bbox.cc
+domain_display_SOURCES = domain-display.cc
dpoint_1_SOURCES = dpoint-1.cc
-graph_data_full_SOURCES = graph-data-full.cc
+estim_sites_SOURCES = estim-sites.cc
+extension_ignore_SOURCES = extension-ignore.cc
+fill_SOURCES = fill.cc
+fill_call_1_SOURCES = fill-call-1.cc
+fill_part_image_SOURCES = fill-part-image.cc
+fill_subdomain_SOURCES = fill-subdomain.cc
+fill_subdomain_shorter_SOURCES = fill-subdomain-shorter.cc
+fill_subimage_cfun_SOURCES = fill-subimage-cfun.cc
+forall_piter_SOURCES = forall-piter.cc
+fun_p2v_1_SOURCES = fun-p2v-1.cc
+graph_data_SOURCES = graph-data.cc
+graph_iter_SOURCES = graph-iter.cc
ima_has_SOURCES = ima-has.cc
+ima_save_SOURCES = ima-save.cc
ima_size_SOURCES = ima-size.cc
ima2d_1_SOURCES = ima2d-1.cc
-ima2d_decl_2_blobs_full_SOURCES = ima2d-decl-2-blobs-full.cc
+ima2d_2_SOURCES = ima2d-2.cc
+ima2d_3_SOURCES = ima2d-3.cc
+ima2d_4_SOURCES = ima2d-4.cc
+ima2d_5_SOURCES = ima2d-5.cc
+ima2d_6_clone_SOURCES = ima2d-6-clone.cc
+ima2d_7_SOURCES = ima2d-7.cc
ima2d_rot_SOURCES = ima2d-rot.cc
-labeling_compute_full_SOURCES = labeling-compute-full.cc
+labeling_compute_SOURCES = labeling-compute.cc
logical_not_SOURCES = logical-not.cc
+mln_var_SOURCES = mln_var.cc
+paste_SOURCES = paste.cc
paste_call_1_SOURCES = paste-call-1.cc
+parray_append_SOURCES = parray-append.cc
+parray_bbox_SOURCES = parray-bbox.cc
point_1_SOURCES = point-1.cc
+predicate_1_SOURCES = predicate-1.cc
+win_create_1_SOURCES = win-create-1.cc
+win_create_2_SOURCES = win-create-2.cc
-all: clean-png-figures
+all: clean-figures
mkdir -p $(OUTPUTS_BUILDDIR)
mkdir -p $(FIGURES_BUILDDIR)
+
+
+run-samples: all
@failcom='exit 1'; \
list='$(bin_PROGRAMS)'; for bin in $$list; do \
echo "Running $$bin"; \
./$$bin > $(OUTPUTS_BUILDDIR)/$$bin.txt || eval $$failcom; \
- done; \
+ done
+
+
+data: run-samples diff-data split-samples split-outputs
+
+
+diff-data:
+ @failcom='exit 1'; \
has_txt_diff=""; \
- txtlist="$(OUTPUTS_BUILDDIR)/*"; for txt in $$txtlist; do \
+ txtlist="$(OUTPUTS_BUILDDIR)/*.txt"; for txt in $$txtlist; do \
echo "Diff `basename $$txt`"; \
diff $$txt $(OUTPUTS_SRCDIR)/`basename $$txt` >/dev/null 2>&1 \
|| has_txt_diff+=" `basename $$txt`"; \
@@ -47,7 +112,7 @@ all: clean-png-figures
figlist="$(FIGURES_BUILDDIR)/*"; for fig in $$figlist; do \
echo "Diff `basename $$fig`"; \
diff $$fig $(FIGURES_SRCDIR)/`basename $$fig` >/dev/null 2>&1 \
- || has_fig_diff=" `basename $$fig`"; \
+ || has_fig_diff+=" `basename $$fig`"; \
done; \
(test -z "$$has_txt_diff" && test -z "$$has_fig_diff") \
|| (echo "--------"; \
@@ -60,22 +125,58 @@ reference or their reference file does not exist:"; \
echo "$$has_txt_diff"; \
echo ""; \
echo "--------"; \
- echo "* Figures:"; \
+ echo "* Figures:"; \
echo ""; \
echo "$$has_fig_diff"; \
echo ""; \
echo "--------"; \
- echo "* Please update the reference files located in:"; \
+ echo "* Please update manually the reference files located \
+in:"; \
+ echo ""; \
+ echo " $(OUTPUTS_SRCDIR)"; \
+ echo " $(FIGURES_SRCDIR)"; \
+ echo ""; \
+ echo "* Reference files can updated automatically with \
+'make fix-refdata'"; \
echo ""; \
- echo " $(OUTPUTS_SRCDIR)"; \
- echo " $(FIGURES_SRCDIR)"; \
echo ""; \
eval $$failcom);
-clean-local:
- rm -Rf $(OUTPUTS_BUILDDIR) $(FIGURES_BUILDDIR)
+fix-refdata:
+ @failcom='exit 1'; \
+ txtlist="$(OUTPUTS_BUILDDIR)/*.txt"; for txt in $$txtlist; do \
+ diff $$txt $(OUTPUTS_SRCDIR)/`basename $$txt` >/dev/null 2>&1 \
+ || echo "Updating reference file for $$txt"; \
+ cp $$txt $(OUTPUTS_SRCDIR); \
+ done; \
+ figlist="$(FIGURES_BUILDDIR)/*.p*m"; for fig in $$figlist; do \
+ diff $$fig $(FIGURES_SRCDIR)/`basename $$fig` >/dev/null 2>&1 \
+ || echo "Updating reference file for $$fig"; \
+ cp $$fig $(FIGURES_SRCDIR); \
+ done;
+
+
+split-samples:
+ mkdir -p $(SAMPLES_BUILDDIR)
+ @failcom='exit 1'; \
+ list='$(SAMPLES_SRCDIR)/*.cc'; for file in $$list; do \
+ $(TUTORIAL_SRCDIR)/tools/split_sample.sh $$file cc $(SAMPLES_BUILDDIR)\
+ || eval $$failcom; \
+ done
+
+split-outputs:
+ mkdir -p $(SPLITTED_OUTPUTS_BUILDDIR)
+ @failcom='exit 1'; \
+ list='$(OUTPUTS_BUILDDIR)/*.txt'; for file in $$list; do \
+ $(TUTORIAL_SRCDIR)/tools/split_sample.sh $$file txt $(SPLITTED_OUTPUTS_BUILDDIR)\
+ || eval $$failcom; \
+ done
+
+
+clean-local: clean-figures
+ rm -Rf $(OUTPUTS_BUILDDIR)
+ rm -f $(SAMPLES_BUILDDIR)/*.cc
-## Clean up converted images. (*.p*m -> *.png)
-clean-png-figures:
- rm -f $(FIGURES_BUILDDIR)/*.png
+clean-figures:
+ rm -Rf $(FIGURES_BUILDDIR)
diff --git a/milena/doc/tutorial/samples/accu-right-instanciation.cc
b/milena/doc/tutorial/samples/accu-right-instanciation.cc
index 446893a..4e1d180 100644
--- a/milena/doc/tutorial/samples/accu-right-instanciation.cc
+++ b/milena/doc/tutorial/samples/accu-right-instanciation.cc
@@ -1 +1,11 @@
-level::compute(accu::meta::bbox(), ima);
+#include <mln/essential/2d.hh>
+int main()
+{
+ using namespace mln;
+
+ image2d<value::int_u8> ima(2, 3);
+
+ // \{
+ level::compute(accu::meta::max(), ima);
+ // \}
+}
diff --git a/milena/doc/tutorial/samples/accu-wrong-instanciation.cc
b/milena/doc/tutorial/samples/accu-wrong-instanciation.cc.raw
similarity index 100%
rename from milena/doc/tutorial/samples/accu-wrong-instanciation.cc
rename to milena/doc/tutorial/samples/accu-wrong-instanciation.cc.raw
diff --git a/milena/doc/tutorial/samples/borderthickness.cc
b/milena/doc/tutorial/samples/borderthickness.cc
index 1e59076..8c96bfb 100644
--- a/milena/doc/tutorial/samples/borderthickness.cc
+++ b/milena/doc/tutorial/samples/borderthickness.cc
@@ -3,6 +3,7 @@ int main()
{
using namespace mln;
+ // \{
bool vals[3][3] = { { 0, 1, 1 },
{ 1, 0, 0 },
{ 1, 1, 0 } };
@@ -15,4 +16,6 @@ int main()
border::thickness = 0;
image2d<bool> ima_bt0 = make::image(vals);
debug::println_with_border(ima_bt0);
+ // \}
+
}
diff --git a/milena/doc/tutorial/samples/box2d-1.cc
b/milena/doc/tutorial/samples/box2d-1.cc
deleted file mode 100644
index 07383a2..0000000
--- a/milena/doc/tutorial/samples/box2d-1.cc
+++ /dev/null
@@ -1,7 +0,0 @@
-box2d b(2,3);
-
-// The bbox can be retrived in constant time.
-std::cout << b.bbox() << std::endl;
-
-// nsites can be retrieved in constant time.
-std::cout << "nsites = " << b.nsites() << std::endl;
diff --git a/milena/doc/tutorial/samples/box2d-2.cc
b/milena/doc/tutorial/samples/box2d-2.cc
deleted file mode 100644
index 6055d2d..0000000
--- a/milena/doc/tutorial/samples/box2d-2.cc
+++ /dev/null
@@ -1,9 +0,0 @@
-p_array<point2d> arr;
-
-// The bbox is computed thanks to bbox() algorithm.
-box2d box = geom::bbox(arr);
-std::cout << box << std::endl;
-
-// p_array provides nsites(),
-// it can be retrieved in constant time.
-std::cout << "nsites = " << arr.nsites() << std::endl;
diff --git a/milena/doc/tutorial/samples/box2d-bbox.cc
b/milena/doc/tutorial/samples/box2d-bbox.cc
new file mode 100644
index 0000000..b4bb22a
--- /dev/null
+++ b/milena/doc/tutorial/samples/box2d-bbox.cc
@@ -0,0 +1,15 @@
+#include<mln/essential/2d.hh>
+int main()
+{
+ using namespace mln;
+
+// \{
+ box2d b(2,3);
+
+ // The bbox can be retrived in constant time.
+ std::cout << b.bbox() << std::endl;
+
+ // nsites can be retrieved in constant time.
+ std::cout << "nsites = " << b.nsites() << std::endl;
+// \}
+}
diff --git a/milena/doc/tutorial/samples/domain-display-1.cc
b/milena/doc/tutorial/samples/domain-display-1.cc
deleted file mode 100644
index 635b3eb..0000000
--- a/milena/doc/tutorial/samples/domain-display-1.cc
+++ /dev/null
@@ -1,4 +0,0 @@
-std::cout << "imga.domain() = " << imga.domain()
-<< std::endl;
-std::cout << "imgb.domain() = " << imgb.domain()
-<< std::endl;
diff --git a/milena/doc/tutorial/samples/domain-display-out-1.cc
b/milena/doc/tutorial/samples/domain-display-out-1.cc
deleted file mode 100644
index f021cef..0000000
--- a/milena/doc/tutorial/samples/domain-display-out-1.cc
+++ /dev/null
@@ -1,2 +0,0 @@
-imga.domain() = { (0,0) .. (19,19) }
-imgb.domain() = { (5,5) .. (14,14) }
diff --git a/milena/doc/tutorial/samples/domain-display.cc
b/milena/doc/tutorial/samples/domain-display.cc
new file mode 100644
index 0000000..d11101f
--- /dev/null
+++ b/milena/doc/tutorial/samples/domain-display.cc
@@ -0,0 +1,15 @@
+#include <mln/essential/2d.hh>
+int main()
+{
+ using namespace mln;
+
+ // \{
+ image2d<int> ima1(5, 5);
+ image2d<int> ima2(10, 10);
+
+ std::cout << "ima1.domain() = " << ima1.domain()
+ << std::endl;
+ std::cout << "ima2.domain() = " << ima2.domain()
+ << std::endl;
+ // \}
+}
diff --git a/milena/doc/tutorial/samples/dpoint-1.cc
b/milena/doc/tutorial/samples/dpoint-1.cc
index 65b2628..5ad29e6 100644
--- a/milena/doc/tutorial/samples/dpoint-1.cc
+++ b/milena/doc/tutorial/samples/dpoint-1.cc
@@ -1,11 +1,12 @@
-#include <mln/core/alias/point2d.hh>
-#include <mln/core/alias/dpoint2d.hh>
+#include <mln/essential/2d.hh>
int main()
{
using namespace mln;
+ // \{
dpoint2d dp(-1,0);
point2d p(1,1);
std::cout << p + dp << std::endl;
+ // \}
}
diff --git a/milena/doc/tutorial/samples/estim-sites.cc
b/milena/doc/tutorial/samples/estim-sites.cc
index b6d7914..5678750 100644
--- a/milena/doc/tutorial/samples/estim-sites.cc
+++ b/milena/doc/tutorial/samples/estim-sites.cc
@@ -1 +1,13 @@
-unsigned nsites = estim::nsites(ima);
+#include <mln/essential/2d.hh>
+int main()
+{
+ using namespace mln;
+
+ image2d<int> ima(2, 3);
+
+ // \{
+ unsigned nsites = geom::nsites(ima);
+ // \}
+
+ (void) nsites;
+}
diff --git a/milena/doc/tutorial/samples/extension-ignore.cc
b/milena/doc/tutorial/samples/extension-ignore.cc
index a8d0be5..f3a0f4d 100644
--- a/milena/doc/tutorial/samples/extension-ignore.cc
+++ b/milena/doc/tutorial/samples/extension-ignore.cc
@@ -1 +1,18 @@
-my_routine(ima | ima.domain());
+#include <mln/essential/2d.hh>
+
+template <typename I>
+void my_routine(const mln::Image<I>&)
+{
+
+}
+
+int main()
+{
+ mln::image2d<mln::value::int_u8> ima(1, 1);
+
+ // \{
+ my_routine(ima | ima.domain());
+ // \}
+
+ (void) ima;
+}
diff --git a/milena/doc/tutorial/samples/fill-call-1.cc
b/milena/doc/tutorial/samples/fill-call-1.cc
index 134df4f..d41a5d9 100644
--- a/milena/doc/tutorial/samples/fill-call-1.cc
+++ b/milena/doc/tutorial/samples/fill-call-1.cc
@@ -1 +1,18 @@
-level::fill(imga.rw(), 'a');
+#include <mln/essential/2d.hh>
+int main()
+{
+ using namespace mln;
+
+ // \{
+ image2d<char> imga(5, 5);
+ // \}
+
+ // \{
+ level::fill(imga, 'a');
+ // \}
+
+ // \{
+ level::fill((imga | box2d(1,2)).rw(), 'a');
+ // \}
+
+}
diff --git a/milena/doc/tutorial/samples/fill-part-1.cc
b/milena/doc/tutorial/samples/fill-part-1.cc
deleted file mode 100644
index b191156..0000000
--- a/milena/doc/tutorial/samples/fill-part-1.cc
+++ /dev/null
@@ -1,16 +0,0 @@
-p_array2d<bool> arr;
-
-// We add two points in the array.
-arr.append(point2d(0, 1));
-arr.append(point2d(4, 0));
-
-// We restrict the image to the sites
-// contained in arr and fill these ones
-// with 0.
-// We must call "rw()" here.
-fill((ima | arr).rw(), 0);
-
-
-mln_VAR(ima2, ima | arr);
-// We do not need to call "rw()" here.
-fill(ima2, 0);
diff --git a/milena/doc/tutorial/samples/fill-part-2.cc
b/milena/doc/tutorial/samples/fill-part-2.cc
deleted file mode 100644
index 17335d2..0000000
--- a/milena/doc/tutorial/samples/fill-part-2.cc
+++ /dev/null
@@ -1,17 +0,0 @@
-using namespace mln;
-using value::label8;
-
-// Find and label the different components.
-label8 nlabels;
-image2d<label8> lab = labeling::blobs(ima, c4(), nlabels);
-
-// Store a boolean image. True if the site is part of
-// component 2, false otherwise.
-mln_VAR(lab_2b, lab | (pw::value(lab) == 2));
-
-// Get the sub site set containing only the sites
-// part of component 2.
-mln_VAR(lab_2, lab_2b.domain(true));
-
-// Fill the sites of component 2 with red.
-fill(lab_2, color::red);
diff --git a/milena/doc/tutorial/samples/fill-part-3.cc
b/milena/doc/tutorial/samples/fill-part-3.cc
deleted file mode 100644
index 9082430..0000000
--- a/milena/doc/tutorial/samples/fill-part-3.cc
+++ /dev/null
@@ -1,9 +0,0 @@
-using namespace mln;
-using value::label8;
-
-// Find and label the different components.
-label8 nlabels;
-image2d<label8> lab = labeling::blobs(ima, c4(), nlabels);
-
-// Fill the sites of component 2 with red.
-fill(lab.domain(2).rw(), color::red);
diff --git a/milena/doc/tutorial/samples/fill-part-image.cc
b/milena/doc/tutorial/samples/fill-part-image.cc
new file mode 100644
index 0000000..c3bc89e
--- /dev/null
+++ b/milena/doc/tutorial/samples/fill-part-image.cc
@@ -0,0 +1,42 @@
+#include <mln/essential/2d.hh>
+int main()
+{
+ using namespace mln;
+ using value::int_u8;
+ using value::label8;
+
+
+ // \{
+ bool vals[6][5] = {
+ {0, 1, 1, 0, 0},
+ {0, 1, 1, 0, 0},
+ {0, 0, 0, 0, 0},
+ {1, 1, 0, 1, 0},
+ {1, 0, 1, 1, 1},
+ {1, 0, 0, 0, 0}
+ };
+ image2d<bool> ima = make::image(vals);
+ // \}
+
+ // \{
+ p_array<point2d> arr;
+
+ // We add two points in the array.
+ arr.append(point2d(0, 1));
+ arr.append(point2d(4, 0));
+
+ // We restrict the image to the sites
+ // contained in arr and fill these ones
+ // with 0.
+ // We must call "rw()" here.
+ level::fill((ima | arr).rw(), 0);
+
+ debug::println((ima | arr));
+
+ mln_VAR(ima2, ima | arr);
+ // We do not need to call "rw()" here.
+ level::fill(ima2, 0);
+ // \}
+
+ debug::println(ima2);
+}
diff --git a/milena/doc/tutorial/samples/fill-subdomain-shorter.cc
b/milena/doc/tutorial/samples/fill-subdomain-shorter.cc
new file mode 100644
index 0000000..a5f7e9f
--- /dev/null
+++ b/milena/doc/tutorial/samples/fill-subdomain-shorter.cc
@@ -0,0 +1,33 @@
+#include <mln/essential/2d.hh>
+int main()
+{
+ using namespace mln;
+ using value::rgb8;
+ using value::label8;
+
+
+ // \{
+ bool vals[6][5] = {
+ {0, 1, 1, 0, 0},
+ {0, 1, 1, 0, 0},
+ {0, 0, 0, 0, 0},
+ {1, 1, 0, 1, 0},
+ {1, 0, 1, 1, 1},
+ {1, 0, 0, 0, 0}
+ };
+ image2d<bool> ima = make::image(vals);
+ // \}
+
+ // Find and label the different components.
+ // Fill the sites of component 2 with red.
+ // \{
+ label8 nlabels;
+ image2d<label8> lab = labeling::blobs(ima, c4(), nlabels);
+
+ image2d<rgb8> ima2;
+ initialize(ima2, ima);
+ level::fill(ima2, literal::black);
+
+ level::fill((ima2 | pw::value(lab) == pw::cst(2u)).rw(), literal::red);
+ // \}
+}
diff --git a/milena/doc/tutorial/samples/fill-subdomain.cc
b/milena/doc/tutorial/samples/fill-subdomain.cc
new file mode 100644
index 0000000..124a663
--- /dev/null
+++ b/milena/doc/tutorial/samples/fill-subdomain.cc
@@ -0,0 +1,54 @@
+#include <mln/essential/2d.hh>
+#include <doc/tutorial/tools/sample_utils.hh>
+int main()
+{
+ using namespace mln;
+ using value::rgb8;
+ using value::label8;
+
+
+ // \{
+ bool vals[6][5] = {
+ {0, 1, 1, 0, 0},
+ {0, 1, 1, 0, 0},
+ {0, 0, 0, 0, 0},
+ {1, 1, 0, 1, 0},
+ {1, 0, 1, 1, 1},
+ {1, 0, 0, 0, 0}
+ };
+ image2d<bool> ima = make::image(vals);
+ // \}
+
+ doc::pbmsave(ima, "fill-subdomain");
+
+ // Find and label the different components.
+ // \{
+ label8 nlabels;
+ image2d<label8> lbl = labeling::blobs(ima, c4(), nlabels);
+ // \}
+
+ doc::ppmsave(debug::colorize(rgb8(), lbl, nlabels), "fill-subdomain");
+
+ // Create a new image from lbl's sites being part of component 2.
+ // \{
+ mln_VAR(lbl_2, lbl | (pw::value(lbl) == pw::cst(2u)));
+ // \}
+
+ image2d<label8> tmp;
+ initialize(tmp, lbl);
+ level::fill(tmp, 0);
+ level::fill((tmp | lbl_2.domain()).rw(), 1);
+ doc::ppmsave(debug::colorize(rgb8(), tmp, 1), "fill-subdomain");
+
+ // Create a black image from ima.
+ // Fill sites being part of component 2 with red.
+ // \{
+ image2d<rgb8> ima2;
+ initialize(ima2, ima);
+ level::fill(ima2, literal::black);
+
+ level::fill((ima2 | lbl_2.domain()).rw(), literal::red);
+ // \}
+
+ doc::ppmsave(ima2, "fill-subdomain");
+}
diff --git a/milena/doc/tutorial/samples/fill-subimage-cfun.cc
b/milena/doc/tutorial/samples/fill-subimage-cfun.cc
new file mode 100644
index 0000000..6deabf3
--- /dev/null
+++ b/milena/doc/tutorial/samples/fill-subimage-cfun.cc
@@ -0,0 +1,39 @@
+#include <mln/essential/2d.hh>
+#include <doc/tutorial/tools/sample_utils.hh>
+// \{
+bool row_oddity(mln::point2d p)
+{
+ return p.row() % 2;
+}
+// \}
+int main()
+{
+ using namespace mln;
+ using value::rgb8;
+ using value::label8;
+
+
+ // \{
+ bool vals[6][5] = {
+ {0, 1, 1, 0, 0},
+ {0, 1, 1, 0, 0},
+ {0, 0, 0, 0, 0},
+ {1, 1, 0, 1, 0},
+ {1, 0, 1, 1, 1},
+ {1, 0, 0, 0, 0}
+ };
+ image2d<bool> ima = make::image(vals);
+ // \}
+
+ // Create a black image from ima.
+ // Fill sites being part of component 2 with red.
+ // \{
+ image2d<rgb8> ima2;
+ initialize(ima2, ima);
+ level::fill(ima2, literal::black);
+
+ level::fill((ima2 | row_oddity).rw(), literal::red);
+ // \}
+
+ doc::ppmsave(ima2, "fill-subimage-cfun");
+}
diff --git a/milena/doc/tutorial/samples/fill.cc b/milena/doc/tutorial/samples/fill.cc
index ec9c43d..0e98634 100644
--- a/milena/doc/tutorial/samples/fill.cc
+++ b/milena/doc/tutorial/samples/fill.cc
@@ -1,3 +1,6 @@
+#include <mln/essential/2d.hh>
+
+// \{
template <typename I>
void fill(I& ima, mln_value(I) v)
{
@@ -5,3 +8,8 @@ void fill(I& ima, mln_value(I) v)
for_all(p)
ima(p) = v;
}
+// \}
+
+int main()
+{
+}
diff --git a/milena/doc/tutorial/samples/forall-piter-1.cc
b/milena/doc/tutorial/samples/forall-piter-1.cc
deleted file mode 100644
index f2ea498..0000000
--- a/milena/doc/tutorial/samples/forall-piter-1.cc
+++ /dev/null
@@ -1,5 +0,0 @@
-box2d b(3, 2);
-mln_piter(box2d) p(b);
-
-for_all(p)
- std::cout << p; //prints every site coordinates.
diff --git a/milena/doc/tutorial/samples/forall-piter.cc
b/milena/doc/tutorial/samples/forall-piter.cc
new file mode 100644
index 0000000..60011f9
--- /dev/null
+++ b/milena/doc/tutorial/samples/forall-piter.cc
@@ -0,0 +1,14 @@
+#include <mln/essential/2d.hh>
+int main()
+{
+ using namespace mln;
+
+ // \{
+ box2d b(3, 2);
+ mln_piter_(box2d) p(b);
+
+ for_all(p)
+ std::cout << p; //prints every site coordinates.
+ // \}
+
+}
diff --git a/milena/doc/tutorial/samples/fun-p2b-1.cc
b/milena/doc/tutorial/samples/fun-p2b-1.cc
deleted file mode 100644
index 0354bcb..0000000
--- a/milena/doc/tutorial/samples/fun-p2b-1.cc
+++ /dev/null
@@ -1,4 +0,0 @@
-bool row_oddity(mln::point2d p)
-{
- return p.row() % 2;
-}
diff --git a/milena/doc/tutorial/samples/fun-p2v-1.cc
b/milena/doc/tutorial/samples/fun-p2v-1.cc
index 96bae2b..6a5725d 100644
--- a/milena/doc/tutorial/samples/fun-p2v-1.cc
+++ b/milena/doc/tutorial/samples/fun-p2v-1.cc
@@ -1,6 +1,13 @@
-unsigned my_values(const point2d& p)
+#include <mln/essential/2d.hh>
+// \{
+unsigned my_values(const mln::point2d& p)
{
if (p.row() == 0)
return 8;
return 9;
}
+// \}
+
+int main()
+{
+}
diff --git a/milena/doc/tutorial/samples/graph-add-edges.cc
b/milena/doc/tutorial/samples/graph-add-edges.cc
deleted file mode 100644
index be04c8a..0000000
--- a/milena/doc/tutorial/samples/graph-add-edges.cc
+++ /dev/null
@@ -1,5 +0,0 @@
-g.add_edge(0, 1); // Associated to edge 0.
-g.add_edge(1, 2); // Associated to edge 1.
-g.add_edge(1, 3); // Associated to edge 2.
-g.add_edge(3, 4); // Associated to edge 3.
-g.add_edge(4, 2); // Associated to edge 4.
diff --git a/milena/doc/tutorial/samples/graph-add-vertex.cc
b/milena/doc/tutorial/samples/graph-add-vertex.cc
deleted file mode 100644
index 48eca70..0000000
--- a/milena/doc/tutorial/samples/graph-add-vertex.cc
+++ /dev/null
@@ -1,4 +0,0 @@
-util::graph g;
-
-for (unsigned i = 0; i < 5; ++i)
- g.add_vertex () // Add vertex 'i';
diff --git a/milena/doc/tutorial/samples/graph-data-full.cc
b/milena/doc/tutorial/samples/graph-data-full.cc
deleted file mode 100644
index 60792a3..0000000
--- a/milena/doc/tutorial/samples/graph-data-full.cc
+++ /dev/null
@@ -1,82 +0,0 @@
-#include <mln/essential/2d.hh>
-#include <mln/util/graph.hh>
-
-// Part of graph-data.cc
-// \{
-template <typename S>
-struct viota_t : public mln::Function_p2v< viota_t<S> >
-{
- typedef unsigned result;
-
- viota_t(unsigned size)
- {
- v_.resize(size);
- for(unsigned i = 0; i < size; ++i)
- v_[i] = 10 + i;
- }
-
- unsigned
- operator()(const mln_psite(S)& p) const
- {
- return v_[p.v().id()];
- }
-
- protected:
- std::vector<result> v_;
-};
-// \}
-
-int main()
-{
- using namespace mln;
-
- // Part of graph-add-vertec.cc
- // \{
- util::graph g;
-
- for (unsigned i = 0; i < 5; ++i)
- g.add_vertex(); // Add vertex 'i';
- // \}
-
- // Part of graph-add-edges.cc
- // \{
- g.add_edge(0, 1); // Associated to edge 0.
- g.add_edge(1, 2); // Associated to edge 1.
- g.add_edge(1, 3); // Associated to edge 2.
- g.add_edge(3, 4); // Associated to edge 3.
- g.add_edge(4, 2); // Associated to edge 4.
- // \}
-
- // Part of graph-i2v-vertex.cc
- // \{
- typedef fun::i2v::array<point2d> F;
- F f(5); // We need to map 5 vertices.
- f(0) = point2d(0, 0);
- f(1) = point2d(2, 2);
- f(2) = point2d(0, 4);
- f(3) = point2d(4, 3);
- f(4) = point2d(4, 4);
- // \}
-
- // Part of graph-p-vertices.cc
- // \{
- typedef p_vertices<util::graph, F> pv_t;
- pv_t pv(g, f);
- // \}
-
- // Part of graph-data.cc
- // \{
-
- // Constructs an image
- viota_t<pv_t> viota(pv.nsites());
- mln_VAR(graph_vertices_ima, viota | pv);
-
- //Prints each vertex and its associated data.
- mln_piter_(graph_vertices_ima_t) p(graph_vertices_ima.domain());
- for_all(p)
- std::cout << "graph_vertices_ima(" << p << ") =
"
- << graph_vertices_ima(p) << std::endl;
-
- // \}
-}
-
diff --git a/milena/doc/tutorial/samples/graph-data.cc
b/milena/doc/tutorial/samples/graph-data.cc
index b2a3f06..04cccf0 100644
--- a/milena/doc/tutorial/samples/graph-data.cc
+++ b/milena/doc/tutorial/samples/graph-data.cc
@@ -1,3 +1,7 @@
+#include <mln/essential/2d.hh>
+#include <mln/util/graph.hh>
+
+// \{
template <typename S>
struct viota_t : public mln::Function_p2v< viota_t<S> >
{
@@ -6,7 +10,7 @@ struct viota_t : public mln::Function_p2v< viota_t<S> >
viota_t(unsigned size)
{
v_.resize(size);
- for (unsigned i = 0; i < size; ++i)
+ for(unsigned i = 0; i < size; ++i)
v_[i] = 10 + i;
}
@@ -19,18 +23,54 @@ struct viota_t : public mln::Function_p2v< viota_t<S> >
protected:
std::vector<result> v_;
};
+// \}
-void my_fun()
+int main()
{
- ...
- // Constructs an image
- mln_VAR(graph_vertices_ima, viota_t<pv_t>() | pv);
+ using namespace mln;
+
+ // \{
+ util::graph g;
+
+ for (unsigned i = 0; i < 5; ++i)
+ g.add_vertex(); // Add vertex 'i';
+ // \}
+
+ // \{
+ g.add_edge(0, 1); // Associated to edge 0.
+ g.add_edge(1, 2); // Associated to edge 1.
+ g.add_edge(1, 3); // Associated to edge 2.
+ g.add_edge(3, 4); // Associated to edge 3.
+ g.add_edge(4, 2); // Associated to edge 4.
+ // \}
+
+ // \{
+ typedef fun::i2v::array<point2d> F;
+ F f(5); // We need to map 5 vertices.
+ f(0) = point2d(0, 0);
+ f(1) = point2d(2, 2);
+ f(2) = point2d(0, 4);
+ f(3) = point2d(4, 3);
+ f(4) = point2d(4, 4);
+ // \}
+
+ // \{
+ typedef p_vertices<util::graph, F> pv_t;
+ pv_t pv(g, f);
+ // \}
+
+ // \{
+
+ // Constructs an image
+ viota_t<pv_t> viota(pv.nsites());
+ mln_VAR(graph_vertices_ima, viota | pv);
//Prints each vertex and its associated data.
- mln_piter(graph_vertices_ima_t) p(graph_vertices_ima);
+ mln_piter_(graph_vertices_ima_t) p(graph_vertices_ima.domain());
for_all(p)
- std::Cout << "ima(" << p << ") = "
- << ima(p) << std::endl;
- ...
+ std::cout << "graph_vertices_ima(" << p << ") =
"
+ << graph_vertices_ima(p) << std::endl;
+
+ // \}
}
diff --git a/milena/doc/tutorial/samples/graph-i2v-vertex.cc
b/milena/doc/tutorial/samples/graph-i2v-vertex.cc
deleted file mode 100644
index 4de430f..0000000
--- a/milena/doc/tutorial/samples/graph-i2v-vertex.cc
+++ /dev/null
@@ -1,7 +0,0 @@
-typedef fun::i2v::array<point2d> F;
-F f(5); // We need to map 5 vertices.
-f(0) = point2d(0, 0);
-f(1) = point2d(2, 2);
-f(2) = point2d(0, 4);
-f(3) = point2d(4, 3);
-f(4) = point2d(4, 4);
diff --git a/milena/doc/tutorial/samples/graph-iter-edge-nbh-edge.cc
b/milena/doc/tutorial/samples/graph-iter-edge-nbh-edge.cc
deleted file mode 100644
index 9d2e8f0..0000000
--- a/milena/doc/tutorial/samples/graph-iter-edge-nbh-edge.cc
+++ /dev/null
@@ -1,15 +0,0 @@
-// Iterator on edges.
-mln_edge_iter(util::graph) e(g);
-
-// Iterator on edges adjacent to e.
-mln_edge_nbh_edge_iter ne(g, e);
-
-// Prints the graph
-// List all adjacent edges for each edge.
-for_all(e)
-{
- std::cout << e << " : ";
- for_all(ne)
- std::cout << ne << " ";
- std::cout << std::endl;
-}
diff --git a/milena/doc/tutorial/samples/graph-iter-vertex-nbh-vertex.cc
b/milena/doc/tutorial/samples/graph-iter-vertex-nbh-vertex.cc
deleted file mode 100644
index 75fcea7..0000000
--- a/milena/doc/tutorial/samples/graph-iter-vertex-nbh-vertex.cc
+++ /dev/null
@@ -1,15 +0,0 @@
-// Iterator on vertices.
-mln_vertex_iter(util::graph) v(g);
-
-// Iterator on vertices adjacent to v.
-mln_vertex_nbh_vertex_iter nv(g, v);
-
-// Prints the graph
-// List all adjacent edges for each edge.
-for_all(v)
-{
- std::cout << v << " : ";
- for_all(nv)
- std::cout << nv << " ";
- std::cout << std::endl;
-}
diff --git a/milena/doc/tutorial/samples/graph-iter-vertex.cc
b/milena/doc/tutorial/samples/graph-iter-vertex.cc
deleted file mode 100644
index aa0ee74..0000000
--- a/milena/doc/tutorial/samples/graph-iter-vertex.cc
+++ /dev/null
@@ -1,15 +0,0 @@
-// Iterator on vertices.
-mln_vertex_iter(util::graph) v(g);
-
-// Iterator on v's edges.
-mln_vertex_nbh_edge_iter(util::graph) e(g, v);
-
-// Prints the graph
-// List all edges for each vertex.
-for_all(v)
-{
- std::cout << v << " : ";
- for_all(e)
- std::cout << e << " ";
- std::cout << std::endl;
-}
diff --git a/milena/doc/tutorial/samples/graph-iter.cc
b/milena/doc/tutorial/samples/graph-iter.cc
index 1c0f403..2e52d7d 100644
--- a/milena/doc/tutorial/samples/graph-iter.cc
+++ b/milena/doc/tutorial/samples/graph-iter.cc
@@ -1,11 +1,127 @@
-// Function which maps sites to data.
-viota_t viota;
+#include <mln/essential/2d.hh>
+#include <mln/util/graph.hh>
+#include <doc/tutorial/tools/sample_utils.hh>
-// Iterator on vertices.
-mln_vertex_iter(util::graph) v(g);
+struct viota_t : public mln::Function_p2v< viota_t >
+{
+ typedef unsigned result;
+
+ viota_t(unsigned size)
+ {
+ v_.resize(size);
+ for(unsigned i = 0; i < size; ++i)
+ v_[i] = 10 + i;
+ }
+
+ unsigned
+ operator()(const mln::util::vertex<mln::util::graph>& v) const
+ {
+ return v_[v.id()];
+ }
+
+ protected:
+ std::vector<result> v_;
+};
-// Prints each vertex and its associated value.
-for_all(v)
+int main()
{
- std::cout << v << " : " << viota(v) << std::endl;
+ using namespace mln;
+
+ util::graph g;
+
+ for (unsigned i = 0; i < 5; ++i)
+ g.add_vertex(); // Add vertex 'i';
+
+ g.add_edge(0, 1); // Associated to edge 0.
+ g.add_edge(1, 2); // Associated to edge 1.
+ g.add_edge(1, 3); // Associated to edge 2.
+ g.add_edge(3, 4); // Associated to edge 3.
+ g.add_edge(4, 2); // Associated to edge 4.
+
+
+
+ doc::begin_output();
+ // \{
+ // Function which maps sites to data.
+ viota_t viota(g.v_nmax());
+
+ // Iterator on vertices.
+ mln_vertex_iter_(util::graph) v(g);
+
+ // Prints each vertex and its associated value.
+ for_all(v)
+ std::cout << v << " : " << viota(v) << std::endl;
+ // \}
+ doc::end_output();
+
+
+ {
+ doc::begin_output();
+ // \{
+ // Iterator on vertices.
+ mln_vertex_iter_(util::graph) v(g);
+
+ // Iterator on v's edges.
+ mln_vertex_nbh_edge_iter_(util::graph) e(v);
+
+ // Prints the graph
+ // List all edges for each vertex.
+ for_all(v)
+ {
+ std::cout << v << " : ";
+ for_all(e)
+ std::cout << e << " ";
+ std::cout << std::endl;
+ }
+ // \}
+ doc::end_output();
+ }
+
+
+
+ {
+ doc::begin_output();
+ // \{
+ // Iterator on edges.
+ mln_edge_iter_(util::graph) e(g);
+
+ // Iterator on edges adjacent to e.
+ mln_edge_nbh_edge_iter_(util::graph) ne(e);
+
+ // Prints the graph
+ // List all adjacent edges for each edge.
+ for_all(e)
+ {
+ std::cout << e << " : ";
+ for_all(ne)
+ std::cout << ne << " ";
+ std::cout << std::endl;
+ }
+ // \}
+ doc::end_output();
+ }
+
+
+
+ {
+ doc::begin_output();
+ // \{
+ // Iterator on vertices.
+ mln_vertex_iter_(util::graph) v(g);
+
+ // Iterator on vertices adjacent to v.
+ mln_vertex_nbh_vertex_iter_(util::graph) nv(v);
+
+ // Prints the graph
+ // List all adjacent edges for each edge.
+ for_all(v)
+ {
+ std::cout << v << " : ";
+ for_all(nv)
+ std::cout << nv << " ";
+ std::cout << std::endl;
+ }
+ // \}
+ doc::end_output();
+ }
}
diff --git a/milena/doc/tutorial/samples/graph-p-vertices.cc
b/milena/doc/tutorial/samples/graph-p-vertices.cc
deleted file mode 100644
index 3b6869e..0000000
--- a/milena/doc/tutorial/samples/graph-p-vertices.cc
+++ /dev/null
@@ -1 +0,0 @@
-p_vertices<util::graph, F> pv(g, f);
diff --git a/milena/doc/tutorial/samples/ima-has.cc
b/milena/doc/tutorial/samples/ima-has.cc
index 9513541..bf4332d 100644
--- a/milena/doc/tutorial/samples/ima-has.cc
+++ b/milena/doc/tutorial/samples/ima-has.cc
@@ -3,6 +3,7 @@ int main()
{
using namespace mln;
+ // \{
// Default border size is set to 0.
// Image defined on a box2d from
@@ -35,4 +36,5 @@ int main()
std::cout << "ima2.has(2, 5) : "
<< ima2.has(point2d(2, 5)) << std::endl;
+ // \}
}
diff --git a/milena/doc/tutorial/samples/ima-load.cc
b/milena/doc/tutorial/samples/ima-load.cc.raw
similarity index 59%
rename from milena/doc/tutorial/samples/ima-load.cc
rename to milena/doc/tutorial/samples/ima-load.cc.raw
index e4a68ee..9f697fd 100644
--- a/milena/doc/tutorial/samples/ima-load.cc
+++ b/milena/doc/tutorial/samples/ima-load.cc.raw
@@ -1,6 +1,9 @@
# include <mln/core/io/pbm/load.hh>
int main()
{
- mln::image2d<bool> ima;
+ using namespace mln;
+ // \{
+ image2d<bool> ima;
io::pbm::load(ima, "my_image.pbm");
+ // \}
}
diff --git a/milena/doc/tutorial/samples/ima-save.cc
b/milena/doc/tutorial/samples/ima-save.cc
index 47086e2..3ac426e 100644
--- a/milena/doc/tutorial/samples/ima-save.cc
+++ b/milena/doc/tutorial/samples/ima-save.cc
@@ -1,9 +1,20 @@
-# include <mln/core/io/pgm/save.hh>
+# include <mln/essential/2d.hh>
int main()
{
- mln::image2d<mln::value::int_u8> ima;
+ using namespace mln;
+
+ // \{
+ bool vals[5][5] = {
+ {1, 0, 1, 0, 0},
+ {0, 1, 0, 1, 0},
+ {1, 0, 1, 0, 0},
+ {0, 1, 0, 1, 0},
+ {0, 1, 0, 1, 0}
+ };
+ image2d<bool> ima = make::image(vals);
// ...
- io::pgm::save(ima, "my_image.pgm");
+ io::pbm::save(ima, "../figures/ima_save.pbm");
+ // \}
}
diff --git a/milena/doc/tutorial/samples/ima-size.cc
b/milena/doc/tutorial/samples/ima-size.cc
index 9fa845d..8e67fac 100644
--- a/milena/doc/tutorial/samples/ima-size.cc
+++ b/milena/doc/tutorial/samples/ima-size.cc
@@ -3,10 +3,12 @@ int main()
{
using namespace mln;
+ // \{
image2d<int> ima(make::box2d(0,0, 10,12));
std::cout << "nrows = " << ima.nrows()
<< " - "
<< "ncols = " << ima.ncols()
<< std::endl;
+ // \}
}
diff --git a/milena/doc/tutorial/samples/ima2d-1.cc
b/milena/doc/tutorial/samples/ima2d-1.cc
index bc0da47..358dd3f 100644
--- a/milena/doc/tutorial/samples/ima2d-1.cc
+++ b/milena/doc/tutorial/samples/ima2d-1.cc
@@ -3,6 +3,7 @@ int main()
{
using namespace mln;
+ // \{
// Define a box2d from (-2,-3) to (3,5).
box2d b = make::box2d(-2,-3, 3,5);
// Initialize an image with b as domain.
@@ -10,4 +11,5 @@ int main()
std::cout << "b = " << b << std::endl;
std::cout << "domain = " << ima.domain() << std::endl;
+ // \}
}
diff --git a/milena/doc/tutorial/samples/ima2d-2.cc
b/milena/doc/tutorial/samples/ima2d-2.cc
index 1caf397..e9b5e79 100644
--- a/milena/doc/tutorial/samples/ima2d-2.cc
+++ b/milena/doc/tutorial/samples/ima2d-2.cc
@@ -1,8 +1,15 @@
-// Build an empty image;
-image2d<int> img1a;
+#include <mln/essential/2d.hh>
+int main()
+{
+ using namespace mln;
-// Build an image with 2 rows
-// and 3 columns sites
-image2d<int> img1b(box2d(2, 3));
-image2d<int> img1c(2, 3);
+ // \{
+ // Build an empty image;
+ image2d<value::int_u8> img1a;
+ // Build an image with 2 rows
+ // and 3 columns sites
+ image2d<value::int_u8> img1b(box2d(2, 3));
+ image2d<value::int_u8> img1c(2, 3);
+ // \}
+}
diff --git a/milena/doc/tutorial/samples/ima2d-3.cc
b/milena/doc/tutorial/samples/ima2d-3.cc
index 8dd3c4d..ddb35bc 100644
--- a/milena/doc/tutorial/samples/ima2d-3.cc
+++ b/milena/doc/tutorial/samples/ima2d-3.cc
@@ -2,9 +2,12 @@
#include <mln/core/alias/box2d.hh>
int main()
{
+ using namespace mln;
+
+ // \{
box2d b(2,3);
- image2d<int> ima(b);
-
+ image2d<value::int_u8> ima(b);
+
// On image2d, Site <=> point2d
point2d p(1, 2);
@@ -21,8 +24,9 @@ int main()
// Associate '2' as value for the site/point2d (1,2).
// The value is returned by reference
// and can be changed as well.
- ima(p) = 2;
+ ima(p) = 2;
std::cout << "ima.at(1,2) = " << ima.at(1,2)
<< std::endl;
std::cout << "ima(p) = " << ima(p) << std::endl;
+ // \}
}
diff --git a/milena/doc/tutorial/samples/ima2d-4.cc
b/milena/doc/tutorial/samples/ima2d-4.cc
index b5417fc..6eee770 100644
--- a/milena/doc/tutorial/samples/ima2d-4.cc
+++ b/milena/doc/tutorial/samples/ima2d-4.cc
@@ -1,6 +1,19 @@
-point2d p(9,9);
+#include <mln/essential/2d.hh>
+int main()
+{
+ using namespace mln;
+ image2d<char> ima1(12, 12);
+ image2d<char> ima2(12, 12);
-// At (9, 9), both values change.
-imga(p) = 'M';
-imgb(p) = 'W';
+ // \{
+ point2d p(9,9);
+
+ // At (9, 9), both values change.
+ ima1(p) = 'M';
+ ima2(p) = 'W';
+
+ bool b = (ima1(p) == ima2(p));
+ std::cout << (b ? "True" : "False") << std::endl;
+ // \}
+}
diff --git a/milena/doc/tutorial/samples/ima2d-5.cc
b/milena/doc/tutorial/samples/ima2d-5.cc
index febbfa8..d4023af 100644
--- a/milena/doc/tutorial/samples/ima2d-5.cc
+++ b/milena/doc/tutorial/samples/ima2d-5.cc
@@ -1,13 +1,21 @@
-image2d<int> ima1(box2d(2, 3));
-image2d<int> ima2;
-point2d p(1,2);
+#include <mln/essential/2d.hh>
+int main()
+{
+ using namespace mln;
-ima2 = ima1; // ima1.id() == ima2.id()
-// and both point to the same memory area.
+ // \{
+ image2d<int> ima1(box2d(2, 3));
+ image2d<int> ima2;
+ point2d p(1,2);
-ima2(p) = 2; // ima1 is modified as well.
+ ima2 = ima1; // ima1.id() == ima2.id()
+ // and both point to the same memory area.
-// prints "2 - 2"
-std::cout << ima2(p) << " - " << ima1(p) << std::endl;
-// prints "true"
-std::cout << (ima2.id() == ima1.id()) << std::endl;
+ ima2(p) = 2; // ima1 is modified as well.
+
+ // prints "2 - 2"
+ std::cout << ima2(p) << " - " << ima1(p) <<
std::endl;
+ // prints "true"
+ std::cout << (ima2.id_() == ima1.id_()) << std::endl;
+ // \}
+}
diff --git a/milena/doc/tutorial/samples/ima2d-6-clone.cc
b/milena/doc/tutorial/samples/ima2d-6-clone.cc
index 872b93d..ae9c827 100644
--- a/milena/doc/tutorial/samples/ima2d-6-clone.cc
+++ b/milena/doc/tutorial/samples/ima2d-6-clone.cc
@@ -1,8 +1,16 @@
-image2d<int> ima3 = clone(ima1); // Makes a deep copy.
+#include <mln/essential/2d.hh>
+int main()
+{
+ using namespace mln;
-ima3(p) = 3;
+ // \{
+ image2d<int> ima1(5, 5);
+ image2d<int> ima3 = clone(ima1); // Makes a deep copy.
-// prints "3 - 2"
-std::cout << ima3(p) << " - " << ima1(p) << std::endl;
-// prints "false"
-std::cout << (ima3.id() == ima1.id()) << std::endl;
+ point2d p(2, 2);
+ ima3(p) = 3;
+
+ std::cout << ima3(p) << " - " << ima1(p) <<
std::endl;
+ std::cout << (ima3.id_() == ima1.id_()) << std::endl;
+ // \}
+}
diff --git a/milena/doc/tutorial/samples/ima2d-7.cc
b/milena/doc/tutorial/samples/ima2d-7.cc
index ae7ef8f..d15d3b9 100644
--- a/milena/doc/tutorial/samples/ima2d-7.cc
+++ b/milena/doc/tutorial/samples/ima2d-7.cc
@@ -1,5 +1,13 @@
-image2d<int> img2a(2, 3);
-image2d<int> img2b;
+#include <mln/essential/2d.hh>
+int main()
+{
+ using namespace mln;
-initialize(img2b, img2a);
-level::fill(img2b, img2a);
+ // \{
+ image2d<value::int_u8> img2a(2, 3);
+ image2d<value::int_u8> img2b;
+
+ initialize(img2b, img2a);
+ level::fill(img2b, img2a);
+ // \}
+}
diff --git a/milena/doc/tutorial/samples/ima2d-decl-1.cc
b/milena/doc/tutorial/samples/ima2d-decl-1.cc
deleted file mode 100644
index 9fa4fdd..0000000
--- a/milena/doc/tutorial/samples/ima2d-decl-1.cc
+++ /dev/null
@@ -1 +0,0 @@
-image2d<char> imga(0, 0, 20, 20);
diff --git a/milena/doc/tutorial/samples/ima2d-decl-2-blobs-full.cc
b/milena/doc/tutorial/samples/ima2d-decl-2-blobs-full.cc
deleted file mode 100644
index da6fa2b..0000000
--- a/milena/doc/tutorial/samples/ima2d-decl-2-blobs-full.cc
+++ /dev/null
@@ -1,21 +0,0 @@
-#include <mln/essential/2d.hh>
-int main()
-{
- using namespace mln;
- using value::label8;
-
- bool vals[6][5] = {
- {0, 1, 1, 0, 0},
- {0, 1, 1, 0, 0},
- {0, 0, 0, 0, 0},
- {1, 1, 0, 1, 0},
- {1, 0, 1, 1, 1},
- {1, 0, 0, 0, 0}
- };
- image2d<bool> ima = make::image(vals);
-
- label8 nlabels;
- image2d<label8> lbl = labeling::blobs(ima, c4(), nlabels);
-
- debug::println(lbl);
-}
diff --git a/milena/doc/tutorial/samples/ima2d-decl-2-blobs.cc
b/milena/doc/tutorial/samples/ima2d-decl-2-blobs.cc
deleted file mode 100644
index f69c8c0..0000000
--- a/milena/doc/tutorial/samples/ima2d-decl-2-blobs.cc
+++ /dev/null
@@ -1,2 +0,0 @@
-label8 nlabels;
-image2d<label8> lbl = labeling::blobs(ima, c4(), nlabels);
diff --git a/milena/doc/tutorial/samples/ima2d-decl-2.cc
b/milena/doc/tutorial/samples/ima2d-decl-2.cc
deleted file mode 100644
index 478a627..0000000
--- a/milena/doc/tutorial/samples/ima2d-decl-2.cc
+++ /dev/null
@@ -1,9 +0,0 @@
-bool vals[6][5] = {
- {0, 1, 1, 0, 0},
- {0, 1, 1, 0, 0},
- {0, 0, 0, 0, 0},
- {1, 1, 0, 1, 0},
- {1, 0, 1, 1, 1},
- {1, 0, 0, 0, 0}
-};
-image2d<bool> ima = make::image2d(vals);
diff --git a/milena/doc/tutorial/samples/ima2d-restricted-1.cc
b/milena/doc/tutorial/samples/ima2d-restricted-1.cc.raw
similarity index 100%
rename from milena/doc/tutorial/samples/ima2d-restricted-1.cc
rename to milena/doc/tutorial/samples/ima2d-restricted-1.cc.raw
diff --git a/milena/doc/tutorial/samples/ima2d-restricted-2.cc
b/milena/doc/tutorial/samples/ima2d-restricted-2.cc.raw
similarity index 100%
rename from milena/doc/tutorial/samples/ima2d-restricted-2.cc
rename to milena/doc/tutorial/samples/ima2d-restricted-2.cc.raw
diff --git a/milena/doc/tutorial/samples/ima2d-restricted-3.cc
b/milena/doc/tutorial/samples/ima2d-restricted-3.cc.raw
similarity index 100%
rename from milena/doc/tutorial/samples/ima2d-restricted-3.cc
rename to milena/doc/tutorial/samples/ima2d-restricted-3.cc.raw
diff --git a/milena/doc/tutorial/samples/ima2d-restricted-display-1.cc
b/milena/doc/tutorial/samples/ima2d-restricted-display-1.cc
deleted file mode 100644
index bbf94e2..0000000
--- a/milena/doc/tutorial/samples/ima2d-restricted-display-1.cc
+++ /dev/null
@@ -1,7 +0,0 @@
-void my_function()
-{
- ...
- // Prints only sites which are on odd lines.
- debug::println(ima | row_oddity);
- ...
-}
diff --git a/milena/doc/tutorial/samples/ima2d-rot.cc
b/milena/doc/tutorial/samples/ima2d-rot.cc
index 4832045..84cd1ad 100644
--- a/milena/doc/tutorial/samples/ima2d-rot.cc
+++ b/milena/doc/tutorial/samples/ima2d-rot.cc
@@ -1,8 +1,13 @@
#include <mln/essential/2d.hh>
+#include <doc/tutorial/tools/sample_utils.hh>
int main()
{
using namespace mln;
+ const char *IMA1_PPM = "ima2d-rot";
+ const char *IMA2_PPM = "ima2d-rot";
+
+ // \{
border::thickness = 30;
// Declare the image to be rotated.
@@ -23,8 +28,7 @@ int main()
// Draw the domain bounding box
draw::box(ima1, geom::bbox(ima1_), literal::red);
// Save the image, including its border.
- io::ppm::save(ima1 | extended_domain,
- "../figures/ima2d-rot-1.ppm");
+ doc::ppmsave(ima1 | extended_domain, IMA1_PPM);
// Define and apply a point-wise rotation
fun::x2x::rotation<2,float> rot1(0.5, literal::zero);
@@ -37,6 +41,7 @@ int main()
}
draw::box(ima2, ima2.bbox(), literal::red);
- io::ppm::save(ima2 | extended_domain,
- "../figures/ima2d-rot-2.ppm");
+ doc::ppmsave(ima2 | extended_domain, IMA2_PPM);
+ // \}
+
}
diff --git a/milena/doc/tutorial/samples/labeling-compute-call.cc
b/milena/doc/tutorial/samples/labeling-compute-call.cc
deleted file mode 100644
index bbe6eff..0000000
--- a/milena/doc/tutorial/samples/labeling-compute-call.cc
+++ /dev/null
@@ -1,3 +0,0 @@
-util::array<box2d> boxes = labeling::compute(accu::meta::bbox(),
- lbl,
- nlabels);
diff --git a/milena/doc/tutorial/samples/labeling-compute-result.cc
b/milena/doc/tutorial/samples/labeling-compute-result.cc
deleted file mode 100644
index 5f92904..0000000
--- a/milena/doc/tutorial/samples/labeling-compute-result.cc
+++ /dev/null
@@ -1,2 +0,0 @@
-for (unsigned i = 1; i <= nlabels; ++i)
- std::cout << boxes[i] << std::endl;
diff --git a/milena/doc/tutorial/samples/labeling-compute-full.cc
b/milena/doc/tutorial/samples/labeling-compute.cc
similarity index 64%
rename from milena/doc/tutorial/samples/labeling-compute-full.cc
rename to milena/doc/tutorial/samples/labeling-compute.cc
index 4996a99..9f56730 100644
--- a/milena/doc/tutorial/samples/labeling-compute-full.cc
+++ b/milena/doc/tutorial/samples/labeling-compute.cc
@@ -1,10 +1,13 @@
#include <mln/essential/2d.hh>
+#include <doc/tutorial/tools/sample_utils.hh>
int main()
{
using namespace mln;
- using value::int_u8;
+ using value::rgb8;
using value::label8;
+
+ // \{
bool vals[6][5] = {
{0, 1, 1, 0, 0},
{0, 1, 1, 0, 0},
@@ -14,15 +17,29 @@ int main()
{1, 0, 0, 0, 0}
};
image2d<bool> ima = make::image(vals);
+ // \}
+ doc::pbmsave(ima, "labeling-compute");
+ // \{
label8 nlabels;
image2d<label8> lbl = labeling::blobs(ima, c4(), nlabels);
+ // \}
+ doc::ppmsave(debug::colorize(rgb8(), lbl, nlabels),
+ "labeling-compute");
+
+ // \{
util::array<box2d> boxes =
labeling::compute(accu::meta::bbox(),
lbl,
nlabels);
+ // \}
+
+ doc::begin_output();
+ // \{
for (unsigned i = 1; i <= nlabels; ++i)
std::cout << boxes[i] << std::endl;
+ // \}
+ doc::end_output();
}
diff --git a/milena/doc/tutorial/samples/logical-not.cc
b/milena/doc/tutorial/samples/logical-not.cc
index ede62ca..18651b0 100644
--- a/milena/doc/tutorial/samples/logical-not.cc
+++ b/milena/doc/tutorial/samples/logical-not.cc
@@ -1,29 +1,31 @@
#include <mln/essential/2d.hh>
+#include <doc/tutorial/tools/sample_utils.hh>
int main()
{
using namespace mln;
- bool vals[2][2] = {
- {1, 0},
- {0, 1}
+ // \{
+ bool vals[5][5] = {
+ {1, 0, 1, 0, 0},
+ {0, 1, 0, 1, 0},
+ {1, 0, 1, 0, 0},
+ {0, 1, 0, 1, 0},
+ {0, 1, 0, 1, 0}
};
image2d<bool> ima = make::image(vals);
- std::cout << "ima:" << std::endl;
- debug::println(ima);
+ // \}
+ doc::pbmsave(ima, "logical-not");
- std::cout << "----" << std::endl;
+ // \{
image2d<bool> ima_neg = logical::not_(ima);
+ // \}
- std::cout << "ima_neg:" << std::endl;
- debug::println(ima_neg);
- std::cout << "ima:" << std::endl;
- debug::println(ima);
-
- std::cout << "----" << std::endl;
+ doc::pbmsave(ima_neg, "logical-not");
+ // \{
logical::not_inplace(ima);
+ // \}
- std::cout << "not_inplace(ima)" << std::endl;
- debug::println(ima);
+ doc::pbmsave(ima, "logical-not");
}
diff --git a/milena/doc/tutorial/samples/mln_var-1.cc
b/milena/doc/tutorial/samples/mln_var-1.cc
deleted file mode 100644
index d4142ae..0000000
--- a/milena/doc/tutorial/samples/mln_var-1.cc
+++ /dev/null
@@ -1 +0,0 @@
-mln_VAR(ima, my_values | arr);
diff --git a/milena/doc/tutorial/samples/mln_var-2.cc
b/milena/doc/tutorial/samples/mln_var-2.cc
deleted file mode 100644
index fe05d1e..0000000
--- a/milena/doc/tutorial/samples/mln_var-2.cc
+++ /dev/null
@@ -1 +0,0 @@
-mln_VAR(imab1, imab | (pw::value(imab) == 1u));
diff --git a/milena/doc/tutorial/samples/mln_var-3.cc
b/milena/doc/tutorial/samples/mln_var-3.cc
deleted file mode 100644
index d62891a..0000000
--- a/milena/doc/tutorial/samples/mln_var-3.cc
+++ /dev/null
@@ -1,9 +0,0 @@
-box2d b2(0,0, 1, 1);
-
-mln_VAR(imad, imab1 / b2);
-
-debug::prinln(imad);
-// Print
-// 1
-// 1 1
-
diff --git a/milena/doc/tutorial/samples/mln_var.cc
b/milena/doc/tutorial/samples/mln_var.cc
new file mode 100644
index 0000000..ad3a59c
--- /dev/null
+++ b/milena/doc/tutorial/samples/mln_var.cc
@@ -0,0 +1,42 @@
+#include <mln/essential/2d.hh>
+#include <mln/pw/all.hh>
+#include <mln/core/var.hh>
+
+struct my_values_t : mln::Function_p2v<my_values_t>
+{
+ typedef int result;
+
+ int operator()(const mln::point2d&) const
+ {
+ return 0;
+ }
+};
+
+int main()
+{
+ using namespace mln;
+
+ box2d arr(4, 2);
+ my_values_t my_values;
+
+ // \{
+ mln_VAR(ima, my_values | arr);
+ // \}
+
+ (void) ima;
+
+ // \{
+ mln_VAR(imab1, ima | (pw::value(ima) == pw::cst(1u)));
+ // \}
+
+ (void) imab1;
+
+ // \{
+ box2d b2(1, 2);
+//FIXME: enable these lines.
+// mln_VAR(imad, imab1 / b2);
+
+// debug::println(imad);
+ // \}
+
+}
diff --git a/milena/doc/tutorial/samples/parray-append.cc
b/milena/doc/tutorial/samples/parray-append.cc
index 544270e..3bd7cdb 100644
--- a/milena/doc/tutorial/samples/parray-append.cc
+++ b/milena/doc/tutorial/samples/parray-append.cc
@@ -1,6 +1,14 @@
-p_array<point2d> arr;
-arr.append(point2d(3, 6));
-arr.append(point2d(3, 7));
-arr.append(point2d(3, 8));
-arr.append(point2d(4, 8));
-arr.append(point2d(4, 9));
+#include <mln/essential/2d.hh>
+int main()
+{
+ using namespace mln;
+
+ // \{
+ p_array<point2d> arr;
+ arr.append(point2d(3, 6));
+ arr.append(point2d(3, 7));
+ arr.append(point2d(3, 8));
+ arr.append(point2d(4, 8));
+ arr.append(point2d(4, 9));
+ // \}
+}
diff --git a/milena/doc/tutorial/samples/parray-bbox.cc
b/milena/doc/tutorial/samples/parray-bbox.cc
new file mode 100644
index 0000000..e5d880f
--- /dev/null
+++ b/milena/doc/tutorial/samples/parray-bbox.cc
@@ -0,0 +1,19 @@
+#include<mln/essential/2d.hh>
+int main()
+{
+ using namespace mln;
+
+ // \{
+ p_array<point2d> arr;
+ arr.insert(point2d(1,0));
+ arr.insert(point2d(1,1));
+
+ // The bbox is computed thanks to bbox() algorithm.
+ box2d box = geom::bbox(arr);
+ std::cout << box << std::endl;
+
+ // p_array provides nsites(),
+ // it can be retrieved in constant time.
+ std::cout << "nsites = " << arr.nsites() << std::endl;
+ // \}
+}
diff --git a/milena/doc/tutorial/samples/paste-call-1.cc
b/milena/doc/tutorial/samples/paste-call-1.cc
index e4bfec2..88d4f88 100644
--- a/milena/doc/tutorial/samples/paste-call-1.cc
+++ b/milena/doc/tutorial/samples/paste-call-1.cc
@@ -3,9 +3,10 @@ int main()
{
using namespace mln;
- image2d<char> imgb(make::box2d(5,5, 7,8));
+ // \{
+ image2d<unsigned char> imgb(make::box2d(5,5, 7,8));
// Initialize imga with the same domain as imgb.
- image2d<char> imga(imgb.domain());
+ image2d<unsigned char> imga(imgb.domain());
// Initialize the image values.
level::fill(imgb, 'b');
@@ -14,4 +15,5 @@ int main()
level::paste(imgb, imga);
debug::println(imga);
+ // \}
}
diff --git a/milena/doc/tutorial/samples/paste.cc b/milena/doc/tutorial/samples/paste.cc
index 327b226..65c5eb1 100644
--- a/milena/doc/tutorial/samples/paste.cc
+++ b/milena/doc/tutorial/samples/paste.cc
@@ -1,3 +1,6 @@
+#include <mln/essential/2d.hh>
+
+// \{
template <typename I, typename J>
void paste(const I& data, J& dest)
{
@@ -5,3 +8,8 @@ void paste(const I& data, J& dest)
for_all(p)
dest(p) = data(p);
}
+// \}
+
+int main()
+{
+}
diff --git a/milena/doc/tutorial/samples/point-1.cc
b/milena/doc/tutorial/samples/point-1.cc
index 9efb7ec..e190b4c 100644
--- a/milena/doc/tutorial/samples/point-1.cc
+++ b/milena/doc/tutorial/samples/point-1.cc
@@ -1,10 +1,10 @@
-#include <mln/core/image/image2d.hh>
-#include <mln/core/alias/box2d.hh>
+#include <mln/essential/2d.hh>
int main()
{
using namespace mln;
- // Create an image on a 2D box
+ // \{
+ // Create an image on a 2D box
// with 10 columns and 10 rows.
image2d<bool> ima(make::box2d(10, 10));
@@ -18,4 +18,5 @@ int main()
std::cout << "has(p2)? "
<< (ima.has(p2) ? "true" : "false")
<< std::endl;
+ // \}
}
diff --git a/milena/doc/tutorial/samples/predicate-1.cc
b/milena/doc/tutorial/samples/predicate-1.cc
index bfa18f0..6d99dfc 100644
--- a/milena/doc/tutorial/samples/predicate-1.cc
+++ b/milena/doc/tutorial/samples/predicate-1.cc
@@ -1,6 +1,15 @@
+# include <mln/essential/2d.hh>
+
+// \{
//function_p2b
bool my_function_p2b(mln::point2d p);
//function_p2v
//V is the value type used in the image.
+template <typename V>
V my_function_p2v(mln::point2d p);
+// \}
+
+int main()
+{
+}
diff --git a/milena/doc/tutorial/samples/win-create-1.cc
b/milena/doc/tutorial/samples/win-create-1.cc
index 9e86ffb..92c962c 100644
--- a/milena/doc/tutorial/samples/win-create-1.cc
+++ b/milena/doc/tutorial/samples/win-create-1.cc
@@ -1,5 +1,13 @@
-window2d win;
-win.insert(-1, 0)
-win.insert(0, -1)
-win.insert(-1,-1);
+#include <mln/essential/2d.hh>
+int main()
+{
+ using namespace mln;
+ // \{
+ window2d win;
+ win.insert(-1, 0);
+ win.insert( 0, -1);
+ win.insert(-1, -1);
+ // \}
+
+}
diff --git a/milena/doc/tutorial/samples/win-create-2.cc
b/milena/doc/tutorial/samples/win-create-2.cc
index a76e9c2..193f729 100644
--- a/milena/doc/tutorial/samples/win-create-2.cc
+++ b/milena/doc/tutorial/samples/win-create-2.cc
@@ -1,8 +1,19 @@
-bool b[9] = { 1, 0, 0,
- 1, 0, 0,
- 1, 0, 0 };
-bool b2[3][3] = { { 1, 0, 0 },
- { 1, 0, 0 },
- { 1, 0, 0 } };
-window2d win = convert::to<window2d>(b)
-window2d win2 = convert::to<window2d>(b2);
+#include <mln/essential/2d.hh>
+int main()
+{
+ using namespace mln;
+
+ // \{
+ bool b[9] = { 1, 0, 0,
+ 1, 0, 0,
+ 1, 0, 0 };
+
+ bool b2[3][3] = { { 1, 0, 0 },
+ { 1, 0, 0 },
+ { 1, 0, 0 } };
+
+ window2d win = convert::to<window2d>(b);
+ window2d win2 = convert::to<window2d>(b2);
+ // \}
+
+}
diff --git a/milena/doc/tutorial/samples/win-create-3.cc
b/milena/doc/tutorial/samples/win-create-3.cc
deleted file mode 100644
index 8e4bf97..0000000
--- a/milena/doc/tutorial/samples/win-create-3.cc
+++ /dev/null
@@ -1,7 +0,0 @@
-bool b[25] = { 0, 0, 1, 0, 0,
- 0, 1, 0, 1, 0,
- 1, 0, 1, 0, 1,
- 1, 1, 0, 1, 1,
- 1, 0, 1, 0, 1 };
-window2d win = convert::to<window2d>(b)
-
diff --git a/milena/doc/tutorial/tools/sample_utils.hh
b/milena/doc/tutorial/tools/sample_utils.hh
new file mode 100644
index 0000000..36536ba
--- /dev/null
+++ b/milena/doc/tutorial/tools/sample_utils.hh
@@ -0,0 +1,94 @@
+// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef DOC_TUTORIAL_TOOLS_SAMPLE_UTILS_HH
+# define DOC_TUTORIAL_TOOLS_SAMPLE_UTILS_HH
+
+# include <mln/core/image/image2d.hh>
+# include <mln/io/all.hh>
+
+namespace doc
+{
+
+ inline
+ std::string
+ file(const std::string& name, const std::string& extension)
+ {
+ static int file_id = 1;
+
+ std::ostringstream os;
+ os << "../figures/"
+ << name
+ << "-"
+ << file_id++
+ << "."
+ << extension;
+ return os.str();
+ }
+
+ template <typename I>
+ inline
+ void
+ ppmsave(const mln::Image<I>& ima, const std::string& name)
+ {
+ mln::io::ppm::save(ima, file(name, "ppm"));
+ }
+
+ template <typename I>
+ inline
+ void
+ pbmsave(const mln::Image<I>& ima, const std::string& name)
+ {
+ mln::io::pbm::save(ima, file(name, "pbm"));
+ }
+
+ template <typename I>
+ inline
+ void
+ pgmsave(const mln::Image<I>& ima, const std::string& name)
+ {
+ mln::io::pgm::save(ima, file(name, "pgm"));
+ }
+
+ inline
+ void
+ begin_output()
+ {
+ std::cout << "// \\{" << std::endl;
+ }
+
+ inline
+ void
+ end_output()
+ {
+ std::cout << "// \\}" << std::endl;
+ }
+
+} // end of namespace doc
+
+#endif // ! DOC_TUTORIAL_TOOLS_SAMPLE_UTILS_HH
+
diff --git a/milena/doc/tutorial/tools/split_sample.sh
b/milena/doc/tutorial/tools/split_sample.sh
new file mode 100755
index 0000000..a3bf2d1
--- /dev/null
+++ b/milena/doc/tutorial/tools/split_sample.sh
@@ -0,0 +1,23 @@
+#/bin/sh
+
+if ! [ $# -eq 3 ]; then
+ echo "Usage: $0 <file1> <file extension> <dst dir>"
+ exit 1;
+fi
+
+begins=`grep -n -R '//[[:space:]]*\\\{' $1 | cut -d ':' -f 1`
+ends=`grep -n -R '//[[:space:]]*\\\}' $1 | cut -d ':' -f 1`
+
+splitted=false
+i=1
+for begin in $begins; do
+ partend=$((`echo $ends | cut -d ' ' -f $i` - 1))
+ head -n $partend $1 | tail -n $(($partend - $begin)) > $3/"`basename $1
.$2`-$i.$2"
+ i=$((i+1))
+ splitted=true
+done
+
+if [ $splitted ] && [ $i -gt 1 ]; then
+ echo "* $1 has been splitted in $i files."
+fi
+
diff --git a/milena/doc/tutorial/todoxygen.sh b/milena/doc/tutorial/tools/todoxygen.sh
similarity index 100%
rename from milena/doc/tutorial/todoxygen.sh
rename to milena/doc/tutorial/tools/todoxygen.sh
diff --git a/milena/doc/tutorial/tutorial.tex b/milena/doc/tutorial/tutorial.tex
index f58c8d2..49ef8a1 100644
--- a/milena/doc/tutorial/tutorial.tex
+++ b/milena/doc/tutorial/tutorial.tex
@@ -65,7 +65,15 @@ showstringspaces=false,linewidth=14cm}
\backslash htmlonly%
}
-\newcommand{\doxycode}[1]{
+% #1 - part number (Optional)
+% #2 - file name
+\newcommand{\doxycode}[2][1]{
+\backslash endhtmlonly%
+\backslash include #2-#1.cc%
+\backslash htmlonly%
+}
+
+\newcommand{\doxyrawcode}[1]{
\backslash endhtmlonly%
\backslash include #1.cc%
\backslash htmlonly%
@@ -77,6 +85,15 @@ showstringspaces=false,linewidth=14cm}
\backslash htmlonly%
}
+% Include file '#1' from a splitted output.
+% #1 - part number (Optional)
+% #2 - file name
+\newcommand{\doxymoutput}[2][1]{
+\backslash endhtmlonly%
+\backslash include #2-#1.txt%
+\backslash htmlonly%
+}
+
\newcommand{\doxyfigure}[2]{
\backslash endhtmlonly%
\backslash image html #1.png%
@@ -101,8 +118,10 @@ $$
\renewcommand{\doxychapter}[2]{\chapter{#2}\label{#1}}
\renewcommand{\doxysection}[2]{\section{#2}\label{#1}}
\renewcommand{\doxysubsection}[2]{\subsection{#2}\label{#1}}
-\renewcommand{\doxycode}[1]{\lstinputlisting[frame=single]{samples/#1.cc}}
+\renewcommand{\doxycode}[2][1]{\lstinputlisting[frame=single]{samples/#2-#1.cc}}
+\renewcommand{\doxyrawcode}[1]{\lstinputlisting[frame=single]{samples/#1.cc.raw}}
\renewcommand{\doxyoutput}[1]{\lstinputlisting[frame=single]{outputs/#1.txt}}
+\renewcommand{\doxymoutput}[2][1]{\lstinputlisting[frame=single]{outputs/splitted/#2-#1.txt}}
\renewcommand{\doxyfigure}[2]{%
\pgfimage[width=#2]{figures/#1}%
\label{#1}%
@@ -502,7 +521,9 @@ The previous methods are available depending on the site set. A box
will have the bbox() method since it can be retrived in constant time: a box
is it's own bounding box.
-\doxycode{box2d-1}
+\doxycode{box2d-bbox}
+Output:
+\doxyoutput{box2d-bbox}
A \type{p\_array} does not have the bbox
method since its sites do not have to be adjacent. Maintaining such information, in
@@ -512,7 +533,9 @@ available if this information is needed.
\type{p\_array} and \type{box} both have a nsites method since the internal structure
allows a
constant time retrieval.
-\doxycode{box2d-2}
+\doxycode{parray-bbox}
+Output:
+\doxyoutput{parray-bbox}
@@ -668,6 +691,8 @@ Output:
Since the notion of site is independent from the image it applies on, we can
form expressions where a site passed to several images:
\doxycode{ima2d-4}
+Output:
+\doxyoutput{ima2d-4}
%================================================
@@ -775,9 +800,9 @@ Output:
\bigskip
\begin{tabular}{c c}
-\doxyfigure{ima2d-rot-1}{4cm} & \doxyfigure{ima2d-rot-2}{4cm} \\
+\doxyfigure{ima2d-rot-1}{3cm} & \doxyfigure{ima2d-rot-2}{3cm} \\
\multicolumn{2}{c}{\var{ima1} and its border before rotation (left) and \var{ima2}
- and its border after rotation} \\
+ and its border after rotation (right).} \\
\end{tabular}
\bigskip
@@ -795,10 +820,6 @@ restrict the image to its domain.
Note that:
\begin{center}
\code{ima.domain().has()} $\equiv$ \code{(ima | ima.domain()).has()}
-
- and
-
-\code{border::get(ima.domain())} == \code{border::get(ima | ima.domain())} == 0
\end{center}
@@ -853,7 +874,7 @@ They are located in \hpath{mln/io/$<$image-format$>$/}.
Once the right header is included, the image can be loaded:
-\doxycode{ima-load}
+\doxyrawcode{ima-load}
Note that for the PBM format, you \textbf{MUST} use ``\type{bool}'' as value
type.
No special value type is required for other formats though.
@@ -1044,7 +1065,7 @@ dpoints:
\doxycode{win-create-1}
This code creates the following window where ``X'' is the central point from
which the window is computed:
-\doxycode{win-create-1-display}
+\doxyoutput{win-create-1-display}
Another way to define the same window is to provide a bool array:
\doxycode{win-create-2}
@@ -1091,7 +1112,7 @@ Usually, we need to access a value by its coordinates. With default
images it
can be done easily, at no cost.
Example with an \type{image2d}:
-\doxycode{ima2d-display-1}
+\doxyoutput{ima2d-display-1}
The site \var{x} is the point (0, 1). The image values are stored in a
multi-dimensional array. The point coordinates can be used directly. The site
@@ -1122,17 +1143,17 @@ Then, define a \type{p\_array} with few \type{point2d}:
\doxycode{parray-append}
Now, create a point-wise image from this function and this \type{p\_array}:
-\doxycode{mln_var-1}
+\doxycode[1]{mln_var}
Ima is actually that image:
-\doxycode{ima2d-display-2}
+\doxyoutput{ima2d-display-2}
However, in memory, since it is based on a \type{p\_array}, sites are stored in a
vector.
The site x is the point (3, 7) which corresponds to the cell 1 in the
\type{p\_array}.
-\doxycode{parray-display-1}
+\doxyoutput{parray-display-1}
Obviously, we cannot check in constant time whether the site \var{x},
\type{point2d} here,
@@ -1245,7 +1266,9 @@ Example of different forward iterations:
A \code{for\_all()} macro is available to iterate over all the sites: \\
-\doxycode{forall-piter-1}
+\doxycode{forall-piter}
+Output:
+\doxyoutput{forall-piter}
Note that when you declare an iterator, prefer using the ``\code{mln\_*iter}''
macros.
They resolve the iterator type automatically from the given container type
@@ -1305,6 +1328,8 @@ name to designate an image:
If a deep copy of the image is needed, a clone() routine is available:
\doxycode{ima2d-6-clone}
+Output:
+\doxyoutput{ima2d-6-clone}
@@ -1336,12 +1361,12 @@ logical::not\_inplace() & Point-wise "logical not"
\\
%**************************
\doxysection{fillop}{Fill}
First, create an image:
-\doxycode{ima2d-decl-1}
+\doxycode[1]{fill-call-1}
Memory has been allocated so data can be stored but site values
have not been initialized yet. So we fill \var{imga} with the value 'a':
-\doxycode{fill-call-1}
+\doxycode[2]{fill-call-1}
The ``\code{fill}'' algorithm is located in the sub-namespace
"\namespace{mln::level}" since this
algorithm deals with the ``level'' of site values.
@@ -1364,6 +1389,7 @@ the user shall explicitly state that the image is provided so that
its data is
modified "read/write". The algorithm call shall be
``\code{level::fill(ima.rw(),
val)}''. When forgetting the ``\code{rw()}'' call it does not compile.
+\doxycode[3]{fill-call-1}
%**************************
\doxysection{pasteop}{Paste}
@@ -1388,10 +1414,10 @@ With this simple example we can see that images defined on
different domains (or
set of sites) can interoperate. The set of sites of an image is defined and
can be accessed and printed. The following code:
-\doxycode{domain-display-1}
+\doxycode{domain-display}
Gives:
-\doxycode{domain-display-out-1}
+\doxycode{domain-display}
The notion of site sets plays an important role in Olena. Many tests are
performed at run-time to ensure that the program is correct.
@@ -1409,12 +1435,21 @@ component id as value for each site. The background has 0 as id
therefore the
component ids start from 1.
Consider the following image:
-\doxycode{ima2d-decl-2}
+\doxycode[1]{labeling-compute}
+
+Output: \\
+\begin{center}
+\doxyfigure{labeling-compute-1}{3cm}
+\end{center}
Then label this image thanks to \code{labeling::blobs()}:
-\doxycode{ima2d-decl-2-blobs}
-Output:
-\doxyoutput{ima2d-decl-2-blobs-full}
+\doxycode[2]{labeling-compute}
+
+Output: \\
+
+\begin{center}
+\doxyfigure{labeling-compute-2}{3cm}
+\end{center}
Note that this routine returns the number of components in its third parameter.
This parameter \must be of the same type as the returned image value.
@@ -1440,11 +1475,31 @@ This parameter \must be of the same type as the returned image
value.
This small routine only works on binary images. It performs a point-wise
"logical not" and therefore "negates" the image. There are two
versions of that
algorithm a version which returns a new image and another which works in place.
+Example:
+
+Make a binary image:
+\doxycode[1]{logical-not}
+\begin{center}
+\doxyfigure{logical-not-1}{3cm}
+\end{center}
+
+Return the result in a new image:
+\doxycode[2]{logical-not}
+\begin{center}
+\begin{tabular}{c c}
+\doxyfigure{logical-not-1}{3cm} & \doxyfigure{logical-not-2}{3cm} \\
+\multicolumn{2}{c}{\var{ima} (left) and \var{ima_neg} (right) after having
+ called logical::not\_().} \\
+\end{tabular}
+\end{center}
+
+Or, work in place:
+\doxycode[3]{logical-not}
+Then, \var{ima} looks like:
+\begin{center}
+\doxyfigure{logical-not-3}{3cm}
+\end{center}
-Sample code:
-\doxycode{logical-not}
-Output:
-\doxyoutput{logical-not}
%**************************
\doxysection{compute}{Compute}
@@ -1520,7 +1575,7 @@ It exists two versions of each accumulator.
\end{itemize}
Note that when an accumulator is passed to \code{*::compute()}, it \must be
instanciated.You cannot write:
-\doxycode{accu-wrong-instanciation}
+\doxyrawcode{accu-wrong-instanciation}
Instead, you \must write:
\doxycode{accu-right-instanciation}
@@ -1530,15 +1585,15 @@ In this example we will try to retrieve the bounding box of each
component in an
image.
Consider the following image:
-\doxycode{ima2d-decl-2}
+\doxycode[1]{labeling-compute}
Then label this image thanks to \code{labeling::blobs()}:
-\doxycode{ima2d-decl-2-blobs}
+\doxycode[2]{labeling-compute}
Output:
-\doxyoutput{ima2d-decl-2-blobs-full}
+\doxymoutput[1]{labeling-compute}
Then, use \code{labeling::compute()} with the bbox accumulator:
-\doxycode{labeling-compute-call}
+\doxycode[3]{labeling-compute}
\code{Labeling::compute()} hold an accumulator for each component, which means it
returns an array of accumulator results.
@@ -1546,9 +1601,9 @@ In this case, it returns an array of \type{box2d}.
\textbf{Important note:} since \code{labeling::blobs()} labels the component from 1 and
set the background to 0, we will want to iterate from 1 to nlabels included.
-\doxycode{labeling-compute-result}
+\doxycode[4]{labeling-compute}
Output:
-\doxyoutput{labeling-compute-full}
+\doxymoutput[2]{labeling-compute}
\subsection{Routines based on accumulators and *::compute()}
@@ -1566,8 +1621,8 @@ min\_max & Return the min and max values of the values of an
image.\\
sum & Return the sum of the values of an image.
\end{tabular}
-These routines can be found in \hpath{mln/estim}.
-For example, with \code{estim::nsites()} simply write:
+These routines can be found in \hpath{mln/geom} and in \hpath{mln/estim}.
+For example, with \code{geom::nsites()} simply write:
\doxycode{estim-sites}
%====================================
@@ -1612,23 +1667,63 @@ With \type{image2d$<$int$>$}, \type{V} would be \type{int}.
In this section, all along the examples, the image "\var{ima}" will refer to
the
following declaration:
-\doxycode{ima2d-decl-2}
+\doxycode[1]{fill-part-image}
+Output:
+\begin{center}
+\doxyfigure{fill-subdomain-1}{3cm}
+\end{center}
+\doxysubsection{restrictsiteset}{Restrict an image with a site set}
A simple example is to fill only a part of an image with a specific value:
-\doxycode{fill-part-1}
+\doxycode[2]{fill-part-image}
+
+Output:
+\doxyoutput{fill-part-image}
-The two next examples extract a specific component from an image and fill a new
-image with red only in the extracted component's domain.
-\doxycode{fill-part-2}
+\doxysubsection{restrictpred}{Restrict an image with a predicate}
+In the following example, we aim at extracting a component from an image and
+create a new image with it.
+
+First, find and label the components.
+\doxycode[2]{fill-subdomain}
+Output:
+\begin{center}
+\doxyfigure{fill-subdomain-2}{3cm}
+\end{center}
+
+Then, restrict the image to the sites being part of component 2.
+\doxycode[3]{fill-subdomain}
+
+\var{lbl\_2} is a new image. \var{lbl\_2} looks like:
+\begin{center}
+\doxyfigure{fill-subdomain-3}{3cm}
+\end{center}
+
+Finally, create a new color image, fill it with black and fill the sites part of
+component 2 with red.
+\doxycode[4]{fill-subdomain}
+Output:
+\begin{center}
+\doxyfigure{fill-subdomain-4}{3cm}
+\end{center}
The previous example can be written more quickly:
-\doxycode{fill-part-3}
+\doxycode[2]{fill-subdomain-shorter}
-Here is an example using a C function:
-\doxycode{fun-p2b-1}
+\doxysubsection{restrictcfun}{Restrict an image with a C function}
+In this example, the image is restricted to its odd lines. A new image is
+created in which odd lines are in red and others in black.
-\doxycode{ima2d-restricted-display-1}
+Here is the simple C function used as predicate:
+\doxycode[1]{fill-subimage-cfun}
+Restrict the image with it:
+\doxycode[3]{fill-subimage-cfun}
+
+Output:
+\begin{center}
+\doxyfigure{fill-subimage-cfun-1}{3cm}
+\end{center}
%
\medskip
%
@@ -1637,7 +1732,7 @@ Here is an example using a C function:
\subsection*{Important note}
When writing:
-\doxycode{ima2d-restricted-1}
+\doxyrawcode{ima2d-restricted-1}
\var{sub\_D} \must be included in \code{ima.domain()}.
@@ -1645,20 +1740,22 @@ Let's have an image, \var{imab}, like this:
\doxyoutput{ima2d-display-output-1}
Extract a sub image from \var{imab} with sites having their value set to 1.
-\doxycode{mln_var-2}
+\doxycode[2]{mln_var}
Then, \var{imab1} looks like:
\doxyoutput{ima2d-display-output-2}
Now, if we want to extract a sub image it may fail, depending on the site set
used:
-\doxycode{ima2d-restricted-2}
+\doxyrawcode{ima2d-restricted-2}
If you do not want this constraint, you may want to use an alternative
operator:
-\doxycode{ima2d-restricted-3}
+\doxyrawcode{ima2d-restricted-3}
In that case there is no restriction on the domain at all and the following example will
work.
-\doxycode{mln_var-3}
+\doxycode[3]{mln_var}
+Output:
+\doxyoutput{mln_var}
With this operator, an intersection is applied on the image domain and the
site set.
@@ -1694,10 +1791,10 @@ First, create a graph which looks like the following:
First we need to add vertices:
-\doxycode{graph-add-vertex}
+\doxycode[2]{graph-data}
Finally, populate the graph with edges:
-\doxycode{graph-add-edges}
+\doxycode[3]{graph-data}
Now there is a graph topology and we want to associate elements of this graph
to a site in the image.
@@ -1705,10 +1802,10 @@ The idea is to use specific site sets such as \type{p\_vertices}
and
\type{p\_edges}.
Let's associate the vertices with sites. To do so we need a function which maps
a vertex id to a site, e.g. a \type{point2d} here.
-\doxycode{graph-i2v-vertex}
+\doxycode[4]{graph-data}
Then declare a \type{p\_vertices}:
-\doxycode{graph-p-vertices}
+\doxycode[5]{graph-data}
Thanks to the \type{p\_vertices} there is now a mapping between vertices and sites.
We may like to map data to it. The idea is to provide a function which returns
@@ -1716,28 +1813,41 @@ the associated data according to the site given as parameter.
Combining this
function and the \type{p\_vertices}, we get an image which can be used with
algorithms and \code{for\_all} loops.
-\doxycode{graph-data}
+\doxycode[1]{graph-data}
+\doxycode[6]{graph-data}
+
+Output:
+\doxyoutput{graph-data}
Note that like any image in Olena, graph images share their data. Therefore,
while constructing a graph image from a graph and a function, the graph is not
copied and this is NOT a costly operation.
Of course, creating a graph image is not necessary and you can work directly
-with the graph and container/function mapping indexes and data.
+with the graph and container/function mapping sites and data.
\doxycode{graph-iter}
+Output:
+\doxymoutput[1]{graph-iter}
Graphs have iterators like any other site sets and also provide
specific iterators in order to iterate over graphes in a more intuitive way.
Iteration over the adjacent edges of all the vertices:
-\doxycode{graph-iter-vertex}
+\doxycode[2]{graph-iter}
+Output:
+\doxymoutput[2]{graph-iter}
Iteration over the adjacent edges of all the edges:
-\doxycode{graph-iter-edge-nbh-edge}
+\doxycode[3]{graph-iter}
+Output:
+\doxymoutput[3]{graph-iter}
+
Iteration over the adjacent vertices of all the vertices:
-\doxycode{graph-iter-vertex-nbh-vertex}
+\doxycode[4]{graph-iter}
+Output:
+\doxymoutput[4]{graph-iter}
//FIXME talk about p\_vertices and p\_edges.
--
1.5.6.5