
URL: https://svn.lrde.epita.fr/svn/oln Git branch: master (HEAD: 01e465f) Patch generated by ./add-inline.pl -v -t MLN_INCLUDE_ONLY **/*.hh I'll put this script in lrde-tools. According to `make check', this change doesn't introduce any regression. The problem is not entirely solved, there are some globals with multiple definitions, e.g.: struct image_t {} image; struct domain_t {} domain; struct bbox_t {} bbox; struct border_t {} border; struct function_t {} function; in mln/tag/init.hh Can we declare these `static' to work around the problem? ChangeLog: 2007-11-28 Benoit Sigoure <tsuna@lrde.epita.fr> Add the missing inline keywords. * milena/mln/accu/bbox.hh, * milena/mln/accu/compute.hh, * milena/mln/accu/count.hh, * milena/mln/accu/histo.hh, * milena/mln/accu/internal/base.hh, * milena/mln/accu/max.hh, * milena/mln/accu/max_h.hh, * milena/mln/accu/mean.hh, * milena/mln/accu/median.hh, * milena/mln/accu/median_alt.hh, * milena/mln/accu/min.hh, * milena/mln/accu/min_h.hh, * milena/mln/accu/nil.hh, * milena/mln/accu/p.hh, * milena/mln/accu/pair.hh, * milena/mln/accu/sum.hh, * milena/mln/accu/take.hh, * milena/mln/accu/v.hh, * milena/mln/arith/min.hh, * milena/mln/arith/min.spe.hh, * milena/mln/arith/minus.hh, * milena/mln/arith/plus.hh, * milena/mln/arith/revert.hh, * milena/mln/arith/revert.spe.hh, * milena/mln/arith/times.hh, * milena/mln/arith/times.spe.hh, * milena/mln/border/adjust.hh, * milena/mln/border/duplicate.hh, * milena/mln/border/equalize.hh, * milena/mln/border/fill.hh, * milena/mln/border/find.hh, * milena/mln/border/get.hh, * milena/mln/border/mirror.hh, * milena/mln/border/resize.hh, * milena/mln/canvas/browsing/dir_struct_elt_incr_update.hh, * milena/mln/canvas/browsing/directional.hh, * milena/mln/canvas/browsing/fwd.hh, * milena/mln/canvas/browsing/snake_fwd.hh, * milena/mln/convert/to_dpoint.hh, * milena/mln/convert/to_fun.hh, * milena/mln/convert/to_image.hh, * milena/mln/convert/to_p_array.hh, * milena/mln/convert/to_p_set.hh, * milena/mln/convert/to_rgb.hh, * milena/mln/convert/to_std_set.hh, * milena/mln/convert/to_tiles.hh, * milena/mln/convert/to_w_window.hh, * milena/mln/convert/to_window.hh, * milena/mln/core/a_point_of.hh, * milena/mln/core/box.hh, * milena/mln/core/box_piter.hh, * milena/mln/core/cast_image.hh, * milena/mln/core/clock_neighb.hh, * milena/mln/core/clock_neighb2d.hh, * milena/mln/core/clone.hh, * milena/mln/core/concept/accumulator.hh, * milena/mln/core/concept/box.hh, * milena/mln/core/concept/browsing.hh, * milena/mln/core/concept/delta_point_site.hh, * milena/mln/core/concept/dpoint.hh, * milena/mln/core/concept/function.hh, * milena/mln/core/concept/generalized_pixel.hh, * milena/mln/core/concept/image.hh, * milena/mln/core/concept/iterator.hh, * milena/mln/core/concept/literal.hh, * milena/mln/core/concept/mesh.hh, * milena/mln/core/concept/meta_accumulator.hh, * milena/mln/core/concept/neighborhood.hh, * milena/mln/core/concept/object.hh, * milena/mln/core/concept/pixel_iterator.hh, * milena/mln/core/concept/point.hh, * milena/mln/core/concept/point_iterator.hh, * milena/mln/core/concept/point_set.hh, * milena/mln/core/concept/point_site.hh, * milena/mln/core/concept/regular_grid.hh, * milena/mln/core/concept/value.hh, * milena/mln/core/concept/value_iterator.hh, * milena/mln/core/concept/value_set.hh, * milena/mln/core/concept/weighted_window.hh, * milena/mln/core/concept/window.hh, * milena/mln/core/decorated_image.hh, * milena/mln/core/dpoint.hh, * milena/mln/core/dpoints_piter.hh, * milena/mln/core/dpoints_pixter.hh, * milena/mln/core/exact.hh, * milena/mln/core/h_mat.hh, * milena/mln/core/h_vec.hh, * milena/mln/core/hexa.hh, * milena/mln/core/hexa_piter.hh, * milena/mln/core/image1d.hh, * milena/mln/core/image2d.hh, * milena/mln/core/image2d_h.hh, * milena/mln/core/image3d.hh, * milena/mln/core/image_if.hh, * milena/mln/core/image_if_interval.hh, * milena/mln/core/image_if_value.hh, * milena/mln/core/init.hh, * milena/mln/core/inplace.hh, * milena/mln/core/internal/box_impl.hh, * milena/mln/core/internal/check/image_fastest.hh, * milena/mln/core/internal/coord_impl.hh, * milena/mln/core/internal/dpoints_base.hh, * milena/mln/core/internal/exact.hh, * milena/mln/core/internal/image_base.hh, * milena/mln/core/internal/image_domain_morpher.hh, * milena/mln/core/internal/image_identity.hh, * milena/mln/core/internal/image_if_base.hh, * milena/mln/core/internal/image_morpher.hh, * milena/mln/core/internal/image_primary.hh, * milena/mln/core/internal/image_value_morpher.hh, * milena/mln/core/internal/piter_adaptor.hh, * milena/mln/core/internal/pixel_impl.hh, * milena/mln/core/internal/pixel_iterator_base.hh, * milena/mln/core/internal/point_iterator_base.hh, * milena/mln/core/internal/point_set_base.hh, * milena/mln/core/internal/run_image.hh, * milena/mln/core/internal/run_psite.hh, * milena/mln/core/internal/set_of.hh, * milena/mln/core/interpolated.hh, * milena/mln/core/line2d.hh, * milena/mln/core/line_piter.hh, * milena/mln/core/mesh_image.hh, * milena/mln/core/mesh_p.hh, * milena/mln/core/mesh_p_piter.hh, * milena/mln/core/mesh_psite.hh, * milena/mln/core/neighb.hh, * milena/mln/core/neighb1d.hh, * milena/mln/core/neighb2d.hh, * milena/mln/core/neighb3d.hh, * milena/mln/core/ops.hh, * milena/mln/core/p_array.hh, * milena/mln/core/p_array_piter.hh, * milena/mln/core/p_priority_queue.hh, * milena/mln/core/p_priority_queue_fast.hh, * milena/mln/core/p_priority_queue_fast_with_array.hh, * milena/mln/core/p_queue.hh, * milena/mln/core/p_queue_fast.hh, * milena/mln/core/p_run.hh, * milena/mln/core/p_run_piter.hh, * milena/mln/core/p_runs.hh, * milena/mln/core/p_set.hh, * milena/mln/core/pixel.hh, * milena/mln/core/pixter1d.hh, * milena/mln/core/pixter2d.hh, * milena/mln/core/pixter3d.hh, * milena/mln/core/plain.hh, * milena/mln/core/point.hh, * milena/mln/core/pset_if.hh, * milena/mln/core/pset_if_piter.hh, * milena/mln/core/rle_encode.hh, * milena/mln/core/rle_image.hh, * milena/mln/core/safe.hh, * milena/mln/core/sparse_encode.hh, * milena/mln/core/sparse_image.hh, * milena/mln/core/sub_image.hh, * milena/mln/core/t_image.hh, * milena/mln/core/tr_image.hh, * milena/mln/core/translate_image.hh, * milena/mln/core/w_window.hh, * milena/mln/core/window.hh, * milena/mln/debug/format.hh, * milena/mln/debug/iota.hh, * milena/mln/debug/iota.spe.hh, * milena/mln/debug/println.hh, * milena/mln/debug/println.spe.hh, * milena/mln/debug/println_with_border.hh, * milena/mln/debug/println_with_border.spe.hh, * milena/mln/display/color_pretty.hh, * milena/mln/display/remove.hh, * milena/mln/display/save.hh, * milena/mln/display/save_and_show.hh, * milena/mln/display/show.hh, * milena/mln/draw/line.hh, * milena/mln/draw/mesh.hh, * milena/mln/estim/mean.hh, * milena/mln/estim/min_max.hh, * milena/mln/estim/sum.hh, * milena/mln/fun/c.hh, * milena/mln/fun/cast.hh, * milena/mln/fun/i2v/all_to.hh, * milena/mln/fun/internal/x2x_linear_impl.hh, * milena/mln/fun/p2b/chess.hh, * milena/mln/fun/p2v/elifs.hh, * milena/mln/fun/p2v/iota.hh, * milena/mln/fun/p2v/ternary.hh, * milena/mln/fun/v2v/abs.hh, * milena/mln/fun/v2v/cast.hh, * milena/mln/fun/v2v/enc.hh, * milena/mln/fun/v2v/id.hh, * milena/mln/fun/v2v/linear.hh, * milena/mln/fun/v2v/norm.hh, * milena/mln/fun/v2v/saturate.hh, * milena/mln/fun/x2x/composed.hh, * milena/mln/fun/x2x/rotation.hh, * milena/mln/fun/x2x/translation.hh, * milena/mln/geom/bbox.hh, * milena/mln/geom/chamfer.hh, * milena/mln/geom/max_col.hh, * milena/mln/geom/max_ind.hh, * milena/mln/geom/max_row.hh, * milena/mln/geom/max_sli.hh, * milena/mln/geom/min_col.hh, * milena/mln/geom/min_ind.hh, * milena/mln/geom/min_row.hh, * milena/mln/geom/min_sli.hh, * milena/mln/geom/ncols.hh, * milena/mln/geom/ninds.hh, * milena/mln/geom/nrows.hh, * milena/mln/geom/nslis.hh, * milena/mln/geom/pmin_pmax.hh, * milena/mln/geom/seeds2tiling.hh, * milena/mln/geom/seeds2tiling_roundness.hh, * milena/mln/geom/shift.hh, * milena/mln/geom/sym.hh, * milena/mln/histo/compute.hh, * milena/mln/histo/compute.spe.hh, * milena/mln/histo/data.hh, * milena/mln/io/abort.hh, * milena/mln/io/fits/load.hh, * milena/mln/io/pbm/load.hh, * milena/mln/io/pbm/save.hh, * milena/mln/io/pfm/load.hh, * milena/mln/io/pfm/save.hh, * milena/mln/io/pgm/load.hh, * milena/mln/io/pgm/save.hh, * milena/mln/io/pnm/load.hh, * milena/mln/io/pnm/load_header.hh, * milena/mln/io/pnm/max_component.hh, * milena/mln/io/pnm/save.hh, * milena/mln/io/pnm/save_header.hh, * milena/mln/io/ppm/load.hh, * milena/mln/io/ppm/save.hh, * milena/mln/labeling/background.hh, * milena/mln/labeling/base.hh, * milena/mln/labeling/blobs.hh, * milena/mln/labeling/estimate.hh, * milena/mln/labeling/flat_zones.hh, * milena/mln/labeling/foreground.hh, * milena/mln/labeling/level.hh, * milena/mln/labeling/regional_maxima.hh, * milena/mln/labeling/regional_minima.hh, * milena/mln/level/abs.hh, * milena/mln/level/apply.hh, * milena/mln/level/apply.spe.hh, * milena/mln/level/approx/median.hh, * milena/mln/level/assign.hh, * milena/mln/level/assign.spe.hh, * milena/mln/level/compare.hh, * milena/mln/level/compute.hh, * milena/mln/level/fast_median.hh, * milena/mln/level/fill.hh, * milena/mln/level/fill.spe.hh, * milena/mln/level/median.hh, * milena/mln/level/memcpy_.hh, * milena/mln/level/memset_.hh, * milena/mln/level/naive/median.hh, * milena/mln/level/paste.hh, * milena/mln/level/paste.spe.hh, * milena/mln/level/saturate.hh, * milena/mln/level/sort_points.hh, * milena/mln/level/stretch.hh, * milena/mln/level/take.hh, * milena/mln/level/take.spe.hh, * milena/mln/level/to_enc.hh, * milena/mln/level/transform.hh, * milena/mln/level/transform.spe.hh, * milena/mln/linear/convolve.hh, * milena/mln/linear/gaussian.hh, * milena/mln/linear/lap.hh, * milena/mln/linear/line_convolve.hh, * milena/mln/linear/line_x2_convolve.hh, * milena/mln/linear/local/convolve.hh, * milena/mln/linear/log.hh, * milena/mln/linear/sobel.hh, * milena/mln/literal/one.hh, * milena/mln/literal/ops.hh, * milena/mln/literal/zero.hh, * milena/mln/logical/and.hh, * milena/mln/logical/and.spe.hh, * milena/mln/logical/and_not.hh, * milena/mln/logical/and_not.spe.hh, * milena/mln/logical/not.hh, * milena/mln/logical/not.spe.hh, * milena/mln/logical/or.hh, * milena/mln/logical/or.spe.hh, * milena/mln/make/box1d.hh, * milena/mln/make/box2d.hh, * milena/mln/make/box2d_h.hh, * milena/mln/make/box3d.hh, * milena/mln/make/dpoint1d.hh, * milena/mln/make/dpoint2d.hh, * milena/mln/make/dpoint2d_h.hh, * milena/mln/make/dpoint3d.hh, * milena/mln/make/image2d.hh, * milena/mln/make/mat.hh, * milena/mln/make/pix.hh, * milena/mln/make/pixel.hh, * milena/mln/make/point1d.hh, * milena/mln/make/point2d.hh, * milena/mln/make/point2d_h.hh, * milena/mln/make/point3d.hh, * milena/mln/make/vec.hh, * milena/mln/make/voronoi.hh, * milena/mln/make/w_window.hh, * milena/mln/make/w_window1d.hh, * milena/mln/make/w_window1d_int.hh, * milena/mln/make/w_window2d.hh, * milena/mln/make/w_window2d_int.hh, * milena/mln/make/w_window3d.hh, * milena/mln/make/w_window3d_int.hh, * milena/mln/make/w_window_line.hh, * milena/mln/make/window1d.hh, * milena/mln/make/window2d.hh, * milena/mln/make/window3d.hh, * milena/mln/math/abs.hh, * milena/mln/math/max.hh, * milena/mln/math/min.hh, * milena/mln/math/round.hh, * milena/mln/math/round_sat.hh, * milena/mln/math/sign.hh, * milena/mln/math/sqr.hh, * milena/mln/math/sqrt.hh, * milena/mln/metal/bool.hh, * milena/mln/metal/int.hh, * milena/mln/metal/mat.hh, * milena/mln/metal/vec.hh, * milena/mln/morpho/Rd.hh, * milena/mln/morpho/closing.hh, * milena/mln/morpho/complementation.hh, * milena/mln/morpho/contrast.hh, * milena/mln/morpho/dilation.hh, * milena/mln/morpho/dilation_fast.hh, * milena/mln/morpho/erosion.hh, * milena/mln/morpho/erosion.spe.hh, * milena/mln/morpho/erosion_fast.hh, * milena/mln/morpho/gradient.hh, * milena/mln/morpho/hit_or_miss.hh, * milena/mln/morpho/laplacian.hh, * milena/mln/morpho/min.hh, * milena/mln/morpho/minus.hh, * milena/mln/morpho/opening.hh, * milena/mln/morpho/opening_area.hh, * milena/mln/morpho/opening_attribute.hh, * milena/mln/morpho/plus.hh, * milena/mln/morpho/thick_miss.hh, * milena/mln/morpho/thickening.hh, * milena/mln/morpho/thin_fit.hh, * milena/mln/morpho/thinning.hh, * milena/mln/morpho/top_hat.hh, * milena/mln/norm/l1.hh, * milena/mln/norm/l2.hh, * milena/mln/norm/linfty.hh, * milena/mln/pw/cst.hh, * milena/mln/pw/image.hh, * milena/mln/pw/value.hh, * milena/mln/pw/var.hh, * milena/mln/set/diff.hh, * milena/mln/set/inter.hh, * milena/mln/set/sym_diff.hh, * milena/mln/set/uni.hh, * milena/mln/test/positive.hh, * milena/mln/test/predicate.hh, * milena/mln/trace/exiting.hh, * milena/mln/trait/image/print.hh, * milena/mln/trait/value/print.hh, * milena/mln/util/branch_iter.hh, * milena/mln/util/branch_iter_ind.hh, * milena/mln/util/eat.hh, * milena/mln/util/graph.hh, * milena/mln/util/ignore.hh, * milena/mln/util/lazy_set.hh, * milena/mln/util/nil.hh, * milena/mln/util/ordpair.hh, * milena/mln/util/pix.hh, * milena/mln/util/tracked_ptr.hh, * milena/mln/util/tree.hh, * milena/mln/util/tree_fast.hh, * milena/mln/util/tree_fast_to_image.hh, * milena/mln/util/tree_to_fast.hh, * milena/mln/util/tree_to_image.hh, * milena/mln/value/cast.hh, * milena/mln/value/concept/scalar.hh, * milena/mln/value/equiv.hh, * milena/mln/value/float01.hh, * milena/mln/value/float01_.hh, * milena/mln/value/float01_f.hh, * milena/mln/value/gray.hh, * milena/mln/value/graylevel.hh, * milena/mln/value/int_s.hh, * milena/mln/value/int_u.hh, * milena/mln/value/int_u_sat.hh, * milena/mln/value/internal/convert.hh, * milena/mln/value/internal/iterable_set.hh, * milena/mln/value/internal/value_like.hh, * milena/mln/value/interval.hh, * milena/mln/value/label.hh, * milena/mln/value/lut_vec.hh, * milena/mln/value/ops.hh, * milena/mln/value/other.hh, * milena/mln/value/proxy.hh, * milena/mln/value/quat.hh, * milena/mln/value/rgb.hh, * milena/mln/value/rgb8_non_templated.hh, * milena/mln/value/scalar.hh, * milena/mln/value/set.hh, * milena/mln/value/stack.hh, * milena/mln/value/viter.hh, * milena/mln/win/backdiag2d.hh, * milena/mln/win/cube3d.hh, * milena/mln/win/diag2d.hh, * milena/mln/win/disk2d.hh, * milena/mln/win/line.hh, * milena/mln/win/octagon2d.hh, * milena/mln/win/rectangle2d.hh: Here. --- milena/ChangeLog | 418 ++++++++++++++++++++ milena/mln/accu/bbox.hh | 7 + milena/mln/accu/compute.hh | 2 + milena/mln/accu/count.hh | 6 + milena/mln/accu/histo.hh | 14 + milena/mln/accu/internal/base.hh | 2 + milena/mln/accu/max.hh | 6 + milena/mln/accu/max_h.hh | 13 + milena/mln/accu/mean.hh | 5 + milena/mln/accu/median.hh | 12 + milena/mln/accu/median_alt.hh | 8 + milena/mln/accu/min.hh | 6 + milena/mln/accu/min_h.hh | 13 + milena/mln/accu/nil.hh | 6 + milena/mln/accu/p.hh | 7 + milena/mln/accu/pair.hh | 7 + milena/mln/accu/sum.hh | 5 + milena/mln/accu/take.hh | 2 + milena/mln/accu/v.hh | 7 + milena/mln/arith/min.hh | 4 + milena/mln/arith/min.spe.hh | 4 + milena/mln/arith/minus.hh | 17 + milena/mln/arith/plus.hh | 18 + milena/mln/arith/revert.hh | 3 + milena/mln/arith/revert.spe.hh | 2 + milena/mln/arith/times.hh | 10 + milena/mln/arith/times.spe.hh | 4 + milena/mln/border/adjust.hh | 1 + milena/mln/border/duplicate.hh | 4 + milena/mln/border/equalize.hh | 2 + milena/mln/border/fill.hh | 3 + milena/mln/border/find.hh | 5 + milena/mln/border/get.hh | 4 + milena/mln/border/mirror.hh | 4 + milena/mln/border/resize.hh | 3 + .../canvas/browsing/dir_struct_elt_incr_update.hh | 1 + milena/mln/canvas/browsing/directional.hh | 1 + milena/mln/canvas/browsing/fwd.hh | 1 + milena/mln/canvas/browsing/snake_fwd.hh | 1 + milena/mln/convert/to_dpoint.hh | 1 + milena/mln/convert/to_fun.hh | 2 + milena/mln/convert/to_image.hh | 5 + milena/mln/convert/to_p_array.hh | 2 + milena/mln/convert/to_p_set.hh | 5 + milena/mln/convert/to_rgb.hh | 3 + milena/mln/convert/to_std_set.hh | 2 + milena/mln/convert/to_tiles.hh | 1 + milena/mln/convert/to_w_window.hh | 1 + milena/mln/convert/to_window.hh | 5 + milena/mln/core/a_point_of.hh | 1 + milena/mln/core/box.hh | 13 + milena/mln/core/box_piter.hh | 24 ++ milena/mln/core/cast_image.hh | 5 + milena/mln/core/clock_neighb.hh | 2 + milena/mln/core/clock_neighb2d.hh | 2 + milena/mln/core/clone.hh | 1 + milena/mln/core/concept/accumulator.hh | 1 + milena/mln/core/concept/box.hh | 7 + milena/mln/core/concept/browsing.hh | 3 + milena/mln/core/concept/delta_point_site.hh | 6 + milena/mln/core/concept/dpoint.hh | 2 + milena/mln/core/concept/function.hh | 17 + milena/mln/core/concept/generalized_pixel.hh | 1 + milena/mln/core/concept/image.hh | 2 + milena/mln/core/concept/iterator.hh | 1 + milena/mln/core/concept/literal.hh | 2 + milena/mln/core/concept/mesh.hh | 1 + milena/mln/core/concept/meta_accumulator.hh | 1 + milena/mln/core/concept/neighborhood.hh | 1 + milena/mln/core/concept/object.hh | 1 + milena/mln/core/concept/pixel_iterator.hh | 1 + milena/mln/core/concept/point.hh | 4 + milena/mln/core/concept/point_iterator.hh | 1 + milena/mln/core/concept/point_set.hh | 5 + milena/mln/core/concept/point_site.hh | 7 + milena/mln/core/concept/regular_grid.hh | 1 + milena/mln/core/concept/value.hh | 1 + milena/mln/core/concept/value_iterator.hh | 2 + milena/mln/core/concept/value_set.hh | 2 + milena/mln/core/concept/weighted_window.hh | 1 + milena/mln/core/concept/window.hh | 2 + milena/mln/core/decorated_image.hh | 11 + milena/mln/core/dpoint.hh | 14 + milena/mln/core/dpoints_piter.hh | 20 + milena/mln/core/dpoints_pixter.hh | 9 + milena/mln/core/exact.hh | 2 + milena/mln/core/h_mat.hh | 2 + milena/mln/core/h_vec.hh | 5 + milena/mln/core/hexa.hh | 10 + milena/mln/core/hexa_piter.hh | 4 + milena/mln/core/image1d.hh | 29 ++ milena/mln/core/image2d.hh | 29 ++ milena/mln/core/image2d_h.hh | 1 + milena/mln/core/image3d.hh | 29 ++ milena/mln/core/image_if.hh | 6 + milena/mln/core/image_if_interval.hh | 7 + milena/mln/core/image_if_value.hh | 7 + milena/mln/core/init.hh | 4 + milena/mln/core/inplace.hh | 1 + milena/mln/core/internal/box_impl.hh | 18 + milena/mln/core/internal/check/image_fastest.hh | 2 + milena/mln/core/internal/coord_impl.hh | 18 + milena/mln/core/internal/dpoints_base.hh | 8 + milena/mln/core/internal/exact.hh | 2 + milena/mln/core/internal/image_base.hh | 9 + milena/mln/core/internal/image_domain_morpher.hh | 4 + milena/mln/core/internal/image_identity.hh | 6 + milena/mln/core/internal/image_if_base.hh | 6 + milena/mln/core/internal/image_morpher.hh | 6 + milena/mln/core/internal/image_primary.hh | 1 + milena/mln/core/internal/image_value_morpher.hh | 3 + milena/mln/core/internal/piter_adaptor.hh | 8 + milena/mln/core/internal/pixel_impl.hh | 11 + milena/mln/core/internal/pixel_iterator_base.hh | 4 + milena/mln/core/internal/point_iterator_base.hh | 2 + milena/mln/core/internal/point_set_base.hh | 1 + milena/mln/core/internal/run_image.hh | 1 + milena/mln/core/internal/run_psite.hh | 11 + milena/mln/core/internal/set_of.hh | 10 + milena/mln/core/interpolated.hh | 7 + milena/mln/core/line2d.hh | 7 + milena/mln/core/line_piter.hh | 8 + milena/mln/core/mesh_image.hh | 10 + milena/mln/core/mesh_p.hh | 4 + milena/mln/core/mesh_p_piter.hh | 8 + milena/mln/core/mesh_psite.hh | 4 + milena/mln/core/neighb.hh | 5 + milena/mln/core/neighb1d.hh | 1 + milena/mln/core/neighb2d.hh | 4 + milena/mln/core/neighb3d.hh | 3 + milena/mln/core/ops.hh | 15 + milena/mln/core/p_array.hh | 12 + milena/mln/core/p_array_piter.hh | 16 + milena/mln/core/p_priority_queue.hh | 15 + milena/mln/core/p_priority_queue_fast.hh | 15 + .../mln/core/p_priority_queue_fast_with_array.hh | 15 + milena/mln/core/p_queue.hh | 15 + milena/mln/core/p_queue_fast.hh | 15 + milena/mln/core/p_run.hh | 10 + milena/mln/core/p_run_piter.hh | 16 + milena/mln/core/p_runs.hh | 7 + milena/mln/core/p_set.hh | 7 + milena/mln/core/pixel.hh | 4 + milena/mln/core/pixter1d.hh | 2 + milena/mln/core/pixter2d.hh | 5 + milena/mln/core/pixter3d.hh | 2 + milena/mln/core/plain.hh | 4 + milena/mln/core/point.hh | 19 + milena/mln/core/pset_if.hh | 8 + milena/mln/core/pset_if_piter.hh | 3 + milena/mln/core/rle_encode.hh | 2 + milena/mln/core/rle_image.hh | 8 + milena/mln/core/safe.hh | 8 + milena/mln/core/sparse_encode.hh | 1 + milena/mln/core/sparse_image.hh | 8 + milena/mln/core/sub_image.hh | 9 + milena/mln/core/t_image.hh | 12 + milena/mln/core/tr_image.hh | 8 + milena/mln/core/translate_image.hh | 7 + milena/mln/core/w_window.hh | 13 + milena/mln/core/window.hh | 7 + milena/mln/debug/format.hh | 4 + milena/mln/debug/iota.hh | 2 + milena/mln/debug/iota.spe.hh | 1 + milena/mln/debug/println.hh | 2 + milena/mln/debug/println.spe.hh | 1 + milena/mln/debug/println_with_border.hh | 2 + milena/mln/debug/println_with_border.spe.hh | 1 + milena/mln/display/color_pretty.hh | 7 + milena/mln/display/remove.hh | 2 + milena/mln/display/save.hh | 3 + milena/mln/display/save_and_show.hh | 2 + milena/mln/display/show.hh | 3 + milena/mln/draw/line.hh | 1 + milena/mln/draw/mesh.hh | 2 + milena/mln/estim/mean.hh | 2 + milena/mln/estim/min_max.hh | 1 + milena/mln/estim/sum.hh | 2 + milena/mln/fun/c.hh | 2 + milena/mln/fun/cast.hh | 1 + milena/mln/fun/i2v/all_to.hh | 3 + milena/mln/fun/internal/x2x_linear_impl.hh | 2 + milena/mln/fun/p2b/chess.hh | 1 + milena/mln/fun/p2v/elifs.hh | 1 + milena/mln/fun/p2v/iota.hh | 4 + milena/mln/fun/p2v/ternary.hh | 3 + milena/mln/fun/v2v/abs.hh | 1 + milena/mln/fun/v2v/cast.hh | 1 + milena/mln/fun/v2v/enc.hh | 1 + milena/mln/fun/v2v/id.hh | 1 + milena/mln/fun/v2v/linear.hh | 2 + milena/mln/fun/v2v/norm.hh | 3 + milena/mln/fun/v2v/saturate.hh | 3 + milena/mln/fun/x2x/composed.hh | 10 + milena/mln/fun/x2x/rotation.hh | 7 + milena/mln/fun/x2x/translation.hh | 6 + milena/mln/geom/bbox.hh | 6 + milena/mln/geom/chamfer.hh | 4 + milena/mln/geom/max_col.hh | 1 + milena/mln/geom/max_ind.hh | 1 + milena/mln/geom/max_row.hh | 1 + milena/mln/geom/max_sli.hh | 1 + milena/mln/geom/min_col.hh | 1 + milena/mln/geom/min_ind.hh | 1 + milena/mln/geom/min_row.hh | 1 + milena/mln/geom/min_sli.hh | 1 + milena/mln/geom/ncols.hh | 1 + milena/mln/geom/ninds.hh | 1 + milena/mln/geom/nrows.hh | 1 + milena/mln/geom/nslis.hh | 1 + milena/mln/geom/pmin_pmax.hh | 6 + milena/mln/geom/seeds2tiling.hh | 2 + milena/mln/geom/seeds2tiling_roundness.hh | 2 + milena/mln/geom/shift.hh | 1 + milena/mln/geom/sym.hh | 2 + milena/mln/histo/compute.hh | 2 + milena/mln/histo/compute.spe.hh | 2 + milena/mln/histo/data.hh | 8 + milena/mln/io/abort.hh | 1 + milena/mln/io/fits/load.hh | 3 + milena/mln/io/pbm/load.hh | 4 + milena/mln/io/pbm/save.hh | 2 + milena/mln/io/pfm/load.hh | 5 + milena/mln/io/pfm/save.hh | 3 + milena/mln/io/pgm/load.hh | 2 + milena/mln/io/pgm/save.hh | 1 + milena/mln/io/pnm/load.hh | 8 + milena/mln/io/pnm/load_header.hh | 3 + milena/mln/io/pnm/max_component.hh | 2 + milena/mln/io/pnm/save.hh | 7 + milena/mln/io/pnm/save_header.hh | 3 + milena/mln/io/ppm/load.hh | 2 + milena/mln/io/ppm/save.hh | 1 + milena/mln/labeling/background.hh | 1 + milena/mln/labeling/base.hh | 14 + milena/mln/labeling/blobs.hh | 1 + milena/mln/labeling/estimate.hh | 1 + milena/mln/labeling/flat_zones.hh | 3 + milena/mln/labeling/foreground.hh | 1 + milena/mln/labeling/level.hh | 11 + milena/mln/labeling/regional_maxima.hh | 7 + milena/mln/labeling/regional_minima.hh | 7 + milena/mln/level/abs.hh | 2 + milena/mln/level/apply.hh | 2 + milena/mln/level/apply.spe.hh | 2 + milena/mln/level/approx/median.hh | 4 + milena/mln/level/assign.hh | 2 + milena/mln/level/assign.spe.hh | 2 + milena/mln/level/compare.hh | 3 + milena/mln/level/compute.hh | 3 + milena/mln/level/fast_median.hh | 2 + milena/mln/level/fill.hh | 6 + milena/mln/level/fill.spe.hh | 2 + milena/mln/level/median.hh | 15 + milena/mln/level/memcpy_.hh | 2 + milena/mln/level/memset_.hh | 3 + milena/mln/level/naive/median.hh | 2 + milena/mln/level/paste.hh | 2 + milena/mln/level/paste.spe.hh | 3 + milena/mln/level/saturate.hh | 3 + milena/mln/level/sort_points.hh | 10 + milena/mln/level/stretch.hh | 2 + milena/mln/level/take.hh | 2 + milena/mln/level/take.spe.hh | 2 + milena/mln/level/to_enc.hh | 1 + milena/mln/level/transform.hh | 3 + milena/mln/level/transform.spe.hh | 2 + milena/mln/linear/convolve.hh | 3 + milena/mln/linear/gaussian.hh | 5 + milena/mln/linear/lap.hh | 4 + milena/mln/linear/line_convolve.hh | 1 + milena/mln/linear/line_x2_convolve.hh | 1 + milena/mln/linear/local/convolve.hh | 5 + milena/mln/linear/log.hh | 4 + milena/mln/linear/sobel.hh | 6 + milena/mln/literal/one.hh | 1 + milena/mln/literal/ops.hh | 13 + milena/mln/literal/zero.hh | 1 + milena/mln/logical/and.hh | 3 + milena/mln/logical/and.spe.hh | 2 + milena/mln/logical/and_not.hh | 3 + milena/mln/logical/and_not.spe.hh | 2 + milena/mln/logical/not.hh | 3 + milena/mln/logical/not.spe.hh | 2 + milena/mln/logical/or.hh | 3 + milena/mln/logical/or.spe.hh | 2 + milena/mln/make/box1d.hh | 2 + milena/mln/make/box2d.hh | 2 + milena/mln/make/box2d_h.hh | 2 + milena/mln/make/box3d.hh | 2 + milena/mln/make/dpoint1d.hh | 1 + milena/mln/make/dpoint2d.hh | 1 + milena/mln/make/dpoint2d_h.hh | 1 + milena/mln/make/dpoint3d.hh | 1 + milena/mln/make/image2d.hh | 1 + milena/mln/make/mat.hh | 1 + milena/mln/make/pix.hh | 1 + milena/mln/make/pixel.hh | 2 + milena/mln/make/point1d.hh | 1 + milena/mln/make/point2d.hh | 1 + milena/mln/make/point2d_h.hh | 1 + milena/mln/make/point3d.hh | 1 + milena/mln/make/vec.hh | 4 + milena/mln/make/voronoi.hh | 1 + milena/mln/make/w_window.hh | 1 + milena/mln/make/w_window1d.hh | 1 + milena/mln/make/w_window1d_int.hh | 1 + milena/mln/make/w_window2d.hh | 1 + milena/mln/make/w_window2d_int.hh | 1 + milena/mln/make/w_window3d.hh | 1 + milena/mln/make/w_window3d_int.hh | 1 + milena/mln/make/w_window_line.hh | 1 + milena/mln/make/window1d.hh | 1 + milena/mln/make/window2d.hh | 1 + milena/mln/make/window3d.hh | 1 + milena/mln/math/abs.hh | 2 + milena/mln/math/max.hh | 1 + milena/mln/math/min.hh | 1 + milena/mln/math/round.hh | 1 + milena/mln/math/round_sat.hh | 1 + milena/mln/math/sign.hh | 1 + milena/mln/math/sqr.hh | 1 + milena/mln/math/sqrt.hh | 1 + milena/mln/metal/bool.hh | 2 + milena/mln/metal/int.hh | 1 + milena/mln/metal/mat.hh | 17 + milena/mln/metal/vec.hh | 20 + milena/mln/morpho/Rd.hh | 9 + milena/mln/morpho/closing.hh | 1 + milena/mln/morpho/complementation.hh | 6 + milena/mln/morpho/contrast.hh | 1 + milena/mln/morpho/dilation.hh | 6 + milena/mln/morpho/dilation_fast.hh | 7 + milena/mln/morpho/erosion.hh | 3 + milena/mln/morpho/erosion.spe.hh | 8 + milena/mln/morpho/erosion_fast.hh | 7 + milena/mln/morpho/gradient.hh | 3 + milena/mln/morpho/hit_or_miss.hh | 8 + milena/mln/morpho/laplacian.hh | 2 + milena/mln/morpho/min.hh | 6 + milena/mln/morpho/minus.hh | 3 + milena/mln/morpho/opening.hh | 1 + milena/mln/morpho/opening_area.hh | 1 + milena/mln/morpho/opening_attribute.hh | 5 + milena/mln/morpho/plus.hh | 3 + milena/mln/morpho/thick_miss.hh | 1 + milena/mln/morpho/thickening.hh | 1 + milena/mln/morpho/thin_fit.hh | 1 + milena/mln/morpho/thinning.hh | 1 + milena/mln/morpho/top_hat.hh | 3 + milena/mln/norm/l1.hh | 6 + milena/mln/norm/l2.hh | 6 + milena/mln/norm/linfty.hh | 6 + milena/mln/pw/cst.hh | 3 + milena/mln/pw/image.hh | 9 + milena/mln/pw/value.hh | 3 + milena/mln/pw/var.hh | 3 + milena/mln/set/diff.hh | 2 + milena/mln/set/inter.hh | 2 + milena/mln/set/sym_diff.hh | 2 + milena/mln/set/uni.hh | 2 + milena/mln/test/positive.hh | 1 + milena/mln/test/predicate.hh | 5 + milena/mln/trace/exiting.hh | 1 + milena/mln/trait/image/print.hh | 2 + milena/mln/trait/value/print.hh | 2 + milena/mln/util/branch_iter.hh | 8 + milena/mln/util/branch_iter_ind.hh | 8 + milena/mln/util/eat.hh | 3 + milena/mln/util/graph.hh | 5 + milena/mln/util/ignore.hh | 2 + milena/mln/util/lazy_set.hh | 11 + milena/mln/util/nil.hh | 4 + milena/mln/util/ordpair.hh | 6 + milena/mln/util/pix.hh | 4 + milena/mln/util/tracked_ptr.hh | 13 + milena/mln/util/tree.hh | 25 ++ milena/mln/util/tree_fast.hh | 8 + milena/mln/util/tree_fast_to_image.hh | 2 + milena/mln/util/tree_to_fast.hh | 2 + milena/mln/util/tree_to_image.hh | 7 + milena/mln/value/cast.hh | 4 + milena/mln/value/concept/scalar.hh | 2 + milena/mln/value/equiv.hh | 5 + milena/mln/value/float01.hh | 14 + milena/mln/value/float01_.hh | 9 + milena/mln/value/float01_f.hh | 5 + milena/mln/value/gray.hh | 41 ++ milena/mln/value/graylevel.hh | 20 + milena/mln/value/int_s.hh | 9 + milena/mln/value/int_u.hh | 11 + milena/mln/value/int_u_sat.hh | 7 + milena/mln/value/internal/convert.hh | 4 + milena/mln/value/internal/iterable_set.hh | 4 + milena/mln/value/internal/value_like.hh | 5 + milena/mln/value/interval.hh | 3 + milena/mln/value/label.hh | 9 + milena/mln/value/lut_vec.hh | 6 + milena/mln/value/ops.hh | 19 + milena/mln/value/other.hh | 6 + milena/mln/value/proxy.hh | 20 + milena/mln/value/quat.hh | 46 +++ milena/mln/value/rgb.hh | 16 + milena/mln/value/rgb8_non_templated.hh | 8 + milena/mln/value/scalar.hh | 5 + milena/mln/value/set.hh | 1 + milena/mln/value/stack.hh | 11 + milena/mln/value/viter.hh | 12 + milena/mln/win/backdiag2d.hh | 7 + milena/mln/win/cube3d.hh | 7 + milena/mln/win/diag2d.hh | 7 + milena/mln/win/disk2d.hh | 7 + milena/mln/win/line.hh | 7 + milena/mln/win/octagon2d.hh | 8 + milena/mln/win/rectangle2d.hh | 9 + 415 files changed, 2522 insertions(+), 0 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index 8f2b308..09c6932 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,3 +1,421 @@ +2007-11-28 Benoit Sigoure <tsuna@lrde.epita.fr> + + Add the missing inline keywords. + * milena/mln/accu/bbox.hh, + * milena/mln/accu/compute.hh, + * milena/mln/accu/count.hh, + * milena/mln/accu/histo.hh, + * milena/mln/accu/internal/base.hh, + * milena/mln/accu/max.hh, + * milena/mln/accu/max_h.hh, + * milena/mln/accu/mean.hh, + * milena/mln/accu/median.hh, + * milena/mln/accu/median_alt.hh, + * milena/mln/accu/min.hh, + * milena/mln/accu/min_h.hh, + * milena/mln/accu/nil.hh, + * milena/mln/accu/p.hh, + * milena/mln/accu/pair.hh, + * milena/mln/accu/sum.hh, + * milena/mln/accu/take.hh, + * milena/mln/accu/v.hh, + * milena/mln/arith/min.hh, + * milena/mln/arith/min.spe.hh, + * milena/mln/arith/minus.hh, + * milena/mln/arith/plus.hh, + * milena/mln/arith/revert.hh, + * milena/mln/arith/revert.spe.hh, + * milena/mln/arith/times.hh, + * milena/mln/arith/times.spe.hh, + * milena/mln/border/adjust.hh, + * milena/mln/border/duplicate.hh, + * milena/mln/border/equalize.hh, + * milena/mln/border/fill.hh, + * milena/mln/border/find.hh, + * milena/mln/border/get.hh, + * milena/mln/border/mirror.hh, + * milena/mln/border/resize.hh, + * milena/mln/canvas/browsing/dir_struct_elt_incr_update.hh, + * milena/mln/canvas/browsing/directional.hh, + * milena/mln/canvas/browsing/fwd.hh, + * milena/mln/canvas/browsing/snake_fwd.hh, + * milena/mln/convert/to_dpoint.hh, + * milena/mln/convert/to_fun.hh, + * milena/mln/convert/to_image.hh, + * milena/mln/convert/to_p_array.hh, + * milena/mln/convert/to_p_set.hh, + * milena/mln/convert/to_rgb.hh, + * milena/mln/convert/to_std_set.hh, + * milena/mln/convert/to_tiles.hh, + * milena/mln/convert/to_w_window.hh, + * milena/mln/convert/to_window.hh, + * milena/mln/core/a_point_of.hh, + * milena/mln/core/box.hh, + * milena/mln/core/box_piter.hh, + * milena/mln/core/cast_image.hh, + * milena/mln/core/clock_neighb.hh, + * milena/mln/core/clock_neighb2d.hh, + * milena/mln/core/clone.hh, + * milena/mln/core/concept/accumulator.hh, + * milena/mln/core/concept/box.hh, + * milena/mln/core/concept/browsing.hh, + * milena/mln/core/concept/delta_point_site.hh, + * milena/mln/core/concept/dpoint.hh, + * milena/mln/core/concept/function.hh, + * milena/mln/core/concept/generalized_pixel.hh, + * milena/mln/core/concept/image.hh, + * milena/mln/core/concept/iterator.hh, + * milena/mln/core/concept/literal.hh, + * milena/mln/core/concept/mesh.hh, + * milena/mln/core/concept/meta_accumulator.hh, + * milena/mln/core/concept/neighborhood.hh, + * milena/mln/core/concept/object.hh, + * milena/mln/core/concept/pixel_iterator.hh, + * milena/mln/core/concept/point.hh, + * milena/mln/core/concept/point_iterator.hh, + * milena/mln/core/concept/point_set.hh, + * milena/mln/core/concept/point_site.hh, + * milena/mln/core/concept/regular_grid.hh, + * milena/mln/core/concept/value.hh, + * milena/mln/core/concept/value_iterator.hh, + * milena/mln/core/concept/value_set.hh, + * milena/mln/core/concept/weighted_window.hh, + * milena/mln/core/concept/window.hh, + * milena/mln/core/decorated_image.hh, + * milena/mln/core/dpoint.hh, + * milena/mln/core/dpoints_piter.hh, + * milena/mln/core/dpoints_pixter.hh, + * milena/mln/core/exact.hh, + * milena/mln/core/h_mat.hh, + * milena/mln/core/h_vec.hh, + * milena/mln/core/hexa.hh, + * milena/mln/core/hexa_piter.hh, + * milena/mln/core/image1d.hh, + * milena/mln/core/image2d.hh, + * milena/mln/core/image2d_h.hh, + * milena/mln/core/image3d.hh, + * milena/mln/core/image_if.hh, + * milena/mln/core/image_if_interval.hh, + * milena/mln/core/image_if_value.hh, + * milena/mln/core/init.hh, + * milena/mln/core/inplace.hh, + * milena/mln/core/internal/box_impl.hh, + * milena/mln/core/internal/check/image_fastest.hh, + * milena/mln/core/internal/coord_impl.hh, + * milena/mln/core/internal/dpoints_base.hh, + * milena/mln/core/internal/exact.hh, + * milena/mln/core/internal/image_base.hh, + * milena/mln/core/internal/image_domain_morpher.hh, + * milena/mln/core/internal/image_identity.hh, + * milena/mln/core/internal/image_if_base.hh, + * milena/mln/core/internal/image_morpher.hh, + * milena/mln/core/internal/image_primary.hh, + * milena/mln/core/internal/image_value_morpher.hh, + * milena/mln/core/internal/piter_adaptor.hh, + * milena/mln/core/internal/pixel_impl.hh, + * milena/mln/core/internal/pixel_iterator_base.hh, + * milena/mln/core/internal/point_iterator_base.hh, + * milena/mln/core/internal/point_set_base.hh, + * milena/mln/core/internal/run_image.hh, + * milena/mln/core/internal/run_psite.hh, + * milena/mln/core/internal/set_of.hh, + * milena/mln/core/interpolated.hh, + * milena/mln/core/line2d.hh, + * milena/mln/core/line_piter.hh, + * milena/mln/core/mesh_image.hh, + * milena/mln/core/mesh_p.hh, + * milena/mln/core/mesh_p_piter.hh, + * milena/mln/core/mesh_psite.hh, + * milena/mln/core/neighb.hh, + * milena/mln/core/neighb1d.hh, + * milena/mln/core/neighb2d.hh, + * milena/mln/core/neighb3d.hh, + * milena/mln/core/ops.hh, + * milena/mln/core/p_array.hh, + * milena/mln/core/p_array_piter.hh, + * milena/mln/core/p_priority_queue.hh, + * milena/mln/core/p_priority_queue_fast.hh, + * milena/mln/core/p_priority_queue_fast_with_array.hh, + * milena/mln/core/p_queue.hh, + * milena/mln/core/p_queue_fast.hh, + * milena/mln/core/p_run.hh, + * milena/mln/core/p_run_piter.hh, + * milena/mln/core/p_runs.hh, + * milena/mln/core/p_set.hh, + * milena/mln/core/pixel.hh, + * milena/mln/core/pixter1d.hh, + * milena/mln/core/pixter2d.hh, + * milena/mln/core/pixter3d.hh, + * milena/mln/core/plain.hh, + * milena/mln/core/point.hh, + * milena/mln/core/pset_if.hh, + * milena/mln/core/pset_if_piter.hh, + * milena/mln/core/rle_encode.hh, + * milena/mln/core/rle_image.hh, + * milena/mln/core/safe.hh, + * milena/mln/core/sparse_encode.hh, + * milena/mln/core/sparse_image.hh, + * milena/mln/core/sub_image.hh, + * milena/mln/core/t_image.hh, + * milena/mln/core/tr_image.hh, + * milena/mln/core/translate_image.hh, + * milena/mln/core/w_window.hh, + * milena/mln/core/window.hh, + * milena/mln/debug/format.hh, + * milena/mln/debug/iota.hh, + * milena/mln/debug/iota.spe.hh, + * milena/mln/debug/println.hh, + * milena/mln/debug/println.spe.hh, + * milena/mln/debug/println_with_border.hh, + * milena/mln/debug/println_with_border.spe.hh, + * milena/mln/display/color_pretty.hh, + * milena/mln/display/remove.hh, + * milena/mln/display/save.hh, + * milena/mln/display/save_and_show.hh, + * milena/mln/display/show.hh, + * milena/mln/draw/line.hh, + * milena/mln/draw/mesh.hh, + * milena/mln/estim/mean.hh, + * milena/mln/estim/min_max.hh, + * milena/mln/estim/sum.hh, + * milena/mln/fun/c.hh, + * milena/mln/fun/cast.hh, + * milena/mln/fun/i2v/all_to.hh, + * milena/mln/fun/internal/x2x_linear_impl.hh, + * milena/mln/fun/p2b/chess.hh, + * milena/mln/fun/p2v/elifs.hh, + * milena/mln/fun/p2v/iota.hh, + * milena/mln/fun/p2v/ternary.hh, + * milena/mln/fun/v2v/abs.hh, + * milena/mln/fun/v2v/cast.hh, + * milena/mln/fun/v2v/enc.hh, + * milena/mln/fun/v2v/id.hh, + * milena/mln/fun/v2v/linear.hh, + * milena/mln/fun/v2v/norm.hh, + * milena/mln/fun/v2v/saturate.hh, + * milena/mln/fun/x2x/composed.hh, + * milena/mln/fun/x2x/rotation.hh, + * milena/mln/fun/x2x/translation.hh, + * milena/mln/geom/bbox.hh, + * milena/mln/geom/chamfer.hh, + * milena/mln/geom/max_col.hh, + * milena/mln/geom/max_ind.hh, + * milena/mln/geom/max_row.hh, + * milena/mln/geom/max_sli.hh, + * milena/mln/geom/min_col.hh, + * milena/mln/geom/min_ind.hh, + * milena/mln/geom/min_row.hh, + * milena/mln/geom/min_sli.hh, + * milena/mln/geom/ncols.hh, + * milena/mln/geom/ninds.hh, + * milena/mln/geom/nrows.hh, + * milena/mln/geom/nslis.hh, + * milena/mln/geom/pmin_pmax.hh, + * milena/mln/geom/seeds2tiling.hh, + * milena/mln/geom/seeds2tiling_roundness.hh, + * milena/mln/geom/shift.hh, + * milena/mln/geom/sym.hh, + * milena/mln/histo/compute.hh, + * milena/mln/histo/compute.spe.hh, + * milena/mln/histo/data.hh, + * milena/mln/io/abort.hh, + * milena/mln/io/fits/load.hh, + * milena/mln/io/pbm/load.hh, + * milena/mln/io/pbm/save.hh, + * milena/mln/io/pfm/load.hh, + * milena/mln/io/pfm/save.hh, + * milena/mln/io/pgm/load.hh, + * milena/mln/io/pgm/save.hh, + * milena/mln/io/pnm/load.hh, + * milena/mln/io/pnm/load_header.hh, + * milena/mln/io/pnm/max_component.hh, + * milena/mln/io/pnm/save.hh, + * milena/mln/io/pnm/save_header.hh, + * milena/mln/io/ppm/load.hh, + * milena/mln/io/ppm/save.hh, + * milena/mln/labeling/background.hh, + * milena/mln/labeling/base.hh, + * milena/mln/labeling/blobs.hh, + * milena/mln/labeling/estimate.hh, + * milena/mln/labeling/flat_zones.hh, + * milena/mln/labeling/foreground.hh, + * milena/mln/labeling/level.hh, + * milena/mln/labeling/regional_maxima.hh, + * milena/mln/labeling/regional_minima.hh, + * milena/mln/level/abs.hh, + * milena/mln/level/apply.hh, + * milena/mln/level/apply.spe.hh, + * milena/mln/level/approx/median.hh, + * milena/mln/level/assign.hh, + * milena/mln/level/assign.spe.hh, + * milena/mln/level/compare.hh, + * milena/mln/level/compute.hh, + * milena/mln/level/fast_median.hh, + * milena/mln/level/fill.hh, + * milena/mln/level/fill.spe.hh, + * milena/mln/level/median.hh, + * milena/mln/level/memcpy_.hh, + * milena/mln/level/memset_.hh, + * milena/mln/level/naive/median.hh, + * milena/mln/level/paste.hh, + * milena/mln/level/paste.spe.hh, + * milena/mln/level/saturate.hh, + * milena/mln/level/sort_points.hh, + * milena/mln/level/stretch.hh, + * milena/mln/level/take.hh, + * milena/mln/level/take.spe.hh, + * milena/mln/level/to_enc.hh, + * milena/mln/level/transform.hh, + * milena/mln/level/transform.spe.hh, + * milena/mln/linear/convolve.hh, + * milena/mln/linear/gaussian.hh, + * milena/mln/linear/lap.hh, + * milena/mln/linear/line_convolve.hh, + * milena/mln/linear/line_x2_convolve.hh, + * milena/mln/linear/local/convolve.hh, + * milena/mln/linear/log.hh, + * milena/mln/linear/sobel.hh, + * milena/mln/literal/one.hh, + * milena/mln/literal/ops.hh, + * milena/mln/literal/zero.hh, + * milena/mln/logical/and.hh, + * milena/mln/logical/and.spe.hh, + * milena/mln/logical/and_not.hh, + * milena/mln/logical/and_not.spe.hh, + * milena/mln/logical/not.hh, + * milena/mln/logical/not.spe.hh, + * milena/mln/logical/or.hh, + * milena/mln/logical/or.spe.hh, + * milena/mln/make/box1d.hh, + * milena/mln/make/box2d.hh, + * milena/mln/make/box2d_h.hh, + * milena/mln/make/box3d.hh, + * milena/mln/make/dpoint1d.hh, + * milena/mln/make/dpoint2d.hh, + * milena/mln/make/dpoint2d_h.hh, + * milena/mln/make/dpoint3d.hh, + * milena/mln/make/image2d.hh, + * milena/mln/make/mat.hh, + * milena/mln/make/pix.hh, + * milena/mln/make/pixel.hh, + * milena/mln/make/point1d.hh, + * milena/mln/make/point2d.hh, + * milena/mln/make/point2d_h.hh, + * milena/mln/make/point3d.hh, + * milena/mln/make/vec.hh, + * milena/mln/make/voronoi.hh, + * milena/mln/make/w_window.hh, + * milena/mln/make/w_window1d.hh, + * milena/mln/make/w_window1d_int.hh, + * milena/mln/make/w_window2d.hh, + * milena/mln/make/w_window2d_int.hh, + * milena/mln/make/w_window3d.hh, + * milena/mln/make/w_window3d_int.hh, + * milena/mln/make/w_window_line.hh, + * milena/mln/make/window1d.hh, + * milena/mln/make/window2d.hh, + * milena/mln/make/window3d.hh, + * milena/mln/math/abs.hh, + * milena/mln/math/max.hh, + * milena/mln/math/min.hh, + * milena/mln/math/round.hh, + * milena/mln/math/round_sat.hh, + * milena/mln/math/sign.hh, + * milena/mln/math/sqr.hh, + * milena/mln/math/sqrt.hh, + * milena/mln/metal/bool.hh, + * milena/mln/metal/int.hh, + * milena/mln/metal/mat.hh, + * milena/mln/metal/vec.hh, + * milena/mln/morpho/Rd.hh, + * milena/mln/morpho/closing.hh, + * milena/mln/morpho/complementation.hh, + * milena/mln/morpho/contrast.hh, + * milena/mln/morpho/dilation.hh, + * milena/mln/morpho/dilation_fast.hh, + * milena/mln/morpho/erosion.hh, + * milena/mln/morpho/erosion.spe.hh, + * milena/mln/morpho/erosion_fast.hh, + * milena/mln/morpho/gradient.hh, + * milena/mln/morpho/hit_or_miss.hh, + * milena/mln/morpho/laplacian.hh, + * milena/mln/morpho/min.hh, + * milena/mln/morpho/minus.hh, + * milena/mln/morpho/opening.hh, + * milena/mln/morpho/opening_area.hh, + * milena/mln/morpho/opening_attribute.hh, + * milena/mln/morpho/plus.hh, + * milena/mln/morpho/thick_miss.hh, + * milena/mln/morpho/thickening.hh, + * milena/mln/morpho/thin_fit.hh, + * milena/mln/morpho/thinning.hh, + * milena/mln/morpho/top_hat.hh, + * milena/mln/norm/l1.hh, + * milena/mln/norm/l2.hh, + * milena/mln/norm/linfty.hh, + * milena/mln/pw/cst.hh, + * milena/mln/pw/image.hh, + * milena/mln/pw/value.hh, + * milena/mln/pw/var.hh, + * milena/mln/set/diff.hh, + * milena/mln/set/inter.hh, + * milena/mln/set/sym_diff.hh, + * milena/mln/set/uni.hh, + * milena/mln/test/positive.hh, + * milena/mln/test/predicate.hh, + * milena/mln/trace/exiting.hh, + * milena/mln/trait/image/print.hh, + * milena/mln/trait/value/print.hh, + * milena/mln/util/branch_iter.hh, + * milena/mln/util/branch_iter_ind.hh, + * milena/mln/util/eat.hh, + * milena/mln/util/graph.hh, + * milena/mln/util/ignore.hh, + * milena/mln/util/lazy_set.hh, + * milena/mln/util/nil.hh, + * milena/mln/util/ordpair.hh, + * milena/mln/util/pix.hh, + * milena/mln/util/tracked_ptr.hh, + * milena/mln/util/tree.hh, + * milena/mln/util/tree_fast.hh, + * milena/mln/util/tree_fast_to_image.hh, + * milena/mln/util/tree_to_fast.hh, + * milena/mln/util/tree_to_image.hh, + * milena/mln/value/cast.hh, + * milena/mln/value/concept/scalar.hh, + * milena/mln/value/equiv.hh, + * milena/mln/value/float01.hh, + * milena/mln/value/float01_.hh, + * milena/mln/value/float01_f.hh, + * milena/mln/value/gray.hh, + * milena/mln/value/graylevel.hh, + * milena/mln/value/int_s.hh, + * milena/mln/value/int_u.hh, + * milena/mln/value/int_u_sat.hh, + * milena/mln/value/internal/convert.hh, + * milena/mln/value/internal/iterable_set.hh, + * milena/mln/value/internal/value_like.hh, + * milena/mln/value/interval.hh, + * milena/mln/value/label.hh, + * milena/mln/value/lut_vec.hh, + * milena/mln/value/ops.hh, + * milena/mln/value/other.hh, + * milena/mln/value/proxy.hh, + * milena/mln/value/quat.hh, + * milena/mln/value/rgb.hh, + * milena/mln/value/rgb8_non_templated.hh, + * milena/mln/value/scalar.hh, + * milena/mln/value/set.hh, + * milena/mln/value/stack.hh, + * milena/mln/value/viter.hh, + * milena/mln/win/backdiag2d.hh, + * milena/mln/win/cube3d.hh, + * milena/mln/win/diag2d.hh, + * milena/mln/win/disk2d.hh, + * milena/mln/win/line.hh, + * milena/mln/win/octagon2d.hh, + * milena/mln/win/rectangle2d.hh: Here. + 2007-11-28 Matthieu Garrigues <garrigues@lrde.epita.fr> Review the mln/io directory. diff --git a/milena/mln/accu/bbox.hh b/milena/mln/accu/bbox.hh index 2f1f507..0bafea5 100644 --- a/milena/mln/accu/bbox.hh +++ b/milena/mln/accu/bbox.hh @@ -76,12 +76,14 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename P> + inline bbox<P>::bbox() { init(); } template <typename P> + inline void bbox<P>::init() { @@ -89,6 +91,7 @@ namespace mln } template <typename P> + inline void bbox<P>::take_as_init(const P& p) { @@ -98,6 +101,7 @@ namespace mln } template <typename P> + inline void bbox<P>::take(const P& p) { @@ -116,6 +120,7 @@ namespace mln } template <typename P> + inline void bbox<P>::take(const bbox<P>& other) { @@ -140,6 +145,7 @@ namespace mln } template <typename P> + inline const box_<P>& bbox<P>::to_result() const { @@ -148,6 +154,7 @@ namespace mln } template <typename P> + inline bool bbox<P>::is_valid() const { diff --git a/milena/mln/accu/compute.hh b/milena/mln/accu/compute.hh index fcc1d21..48085b4 100644 --- a/milena/mln/accu/compute.hh +++ b/milena/mln/accu/compute.hh @@ -71,6 +71,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename A, typename I> + inline mln_result(A) compute(const Image<I>& input_) { @@ -84,6 +85,7 @@ namespace mln } template <typename A, typename I> + inline mln_accu_with(A, util::pix<I>)::result compute(const Image<I>& input) { diff --git a/milena/mln/accu/count.hh b/milena/mln/accu/count.hh index 3ea3025..ec6a58d 100644 --- a/milena/mln/accu/count.hh +++ b/milena/mln/accu/count.hh @@ -81,12 +81,14 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename T> + inline count_<T>::count_() { init(); } template <typename T> + inline void count_<T>::init() { @@ -94,6 +96,7 @@ namespace mln } template <typename T> + inline void count_<T>::take(const argument&) { @@ -101,6 +104,7 @@ namespace mln } template <typename T> + inline void count_<T>::take(const count_<T>& other) { @@ -108,6 +112,7 @@ namespace mln } template <typename T> + inline std::size_t count_<T>::to_result() const { @@ -115,6 +120,7 @@ namespace mln } template <typename T> + inline void count_<T>::set_value(std::size_t c) { diff --git a/milena/mln/accu/histo.hh b/milena/mln/accu/histo.hh index b227159..3a2d0fc 100644 --- a/milena/mln/accu/histo.hh +++ b/milena/mln/accu/histo.hh @@ -93,6 +93,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename S> + inline histo<S>::histo(const Value_Set<S>& s) : s_(exact(s)), h_(s_.nvalues(), 0), @@ -101,6 +102,7 @@ namespace mln } template <typename S> + inline histo<S>::histo() : s_(S::the()), h_(s_.nvalues(), 0), @@ -109,6 +111,7 @@ namespace mln } template <typename S> + inline void histo<S>::take(const argument& t) { @@ -117,6 +120,7 @@ namespace mln } template <typename S> + inline void histo<S>::take(const histo<S>& other) { @@ -126,6 +130,7 @@ namespace mln } template <typename S> + inline void histo<S>::untake(const argument& t) { @@ -136,6 +141,7 @@ namespace mln } template <typename S> + inline void histo<S>::init() { @@ -144,6 +150,7 @@ namespace mln } template <typename S> + inline std::size_t histo<S>::operator()(const argument& t) const { @@ -151,6 +158,7 @@ namespace mln } template <typename S> + inline std::size_t histo<S>::operator[](unsigned i) const { @@ -159,6 +167,7 @@ namespace mln } template <typename S> + inline unsigned histo<S>::nvalues() const { @@ -166,6 +175,7 @@ namespace mln } template <typename S> + inline std::size_t histo<S>::sum() const { @@ -173,6 +183,7 @@ namespace mln } template <typename S> + inline const std::vector<std::size_t>& histo<S>::vect() const { @@ -180,6 +191,7 @@ namespace mln } template <typename S> + inline const std::vector<std::size_t>& histo<S>::to_result() const { @@ -187,6 +199,7 @@ namespace mln } template <typename S> + inline const S& histo<S>::vset() const { @@ -194,6 +207,7 @@ namespace mln } template <typename S> + inline std::ostream& operator<<(std::ostream& ostr, const histo<S>& h) { mln_viter(S) v(h.vset()); diff --git a/milena/mln/accu/internal/base.hh b/milena/mln/accu/internal/base.hh index bda682d..8f011b1 100644 --- a/milena/mln/accu/internal/base.hh +++ b/milena/mln/accu/internal/base.hh @@ -71,11 +71,13 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename R, typename E> + inline base_<R,E>::base_() { } template <typename R, typename E> + inline base_<R,E>::operator typename base_<R,E>::result_ () const { return exact(this)->to_result(); diff --git a/milena/mln/accu/max.hh b/milena/mln/accu/max.hh index 1c0cbf2..22b13be 100644 --- a/milena/mln/accu/max.hh +++ b/milena/mln/accu/max.hh @@ -88,12 +88,14 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename T> + inline max_<T>::max_() { init(); } template <typename T> + inline void max_<T>::init() { @@ -101,6 +103,7 @@ namespace mln } template <typename T> + inline void max_<T>::take_as_init(const argument& t) { @@ -108,6 +111,7 @@ namespace mln } template <typename T> + inline void max_<T>::take(const argument& t) { @@ -116,6 +120,7 @@ namespace mln } template <typename T> + inline void max_<T>::take(const max_<T>& other) { @@ -124,6 +129,7 @@ namespace mln } template <typename T> + inline T max_<T>::to_result() const { diff --git a/milena/mln/accu/max_h.hh b/milena/mln/accu/max_h.hh index 0bef572..ce57cba 100644 --- a/milena/mln/accu/max_h.hh +++ b/milena/mln/accu/max_h.hh @@ -88,6 +88,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename S> + inline max_h<S>::max_h(const Value_Set<S>& s) : h_(s), s_(h_.vset()) @@ -96,6 +97,7 @@ namespace mln } template <typename S> + inline max_h<S>::max_h() : h_(), s_(h_.vset()) @@ -104,6 +106,7 @@ namespace mln } template <typename S> + inline void max_h<S>::take(const argument& t) { @@ -121,6 +124,7 @@ namespace mln } template <typename S> + inline void max_h<S>::take(const max_h<S>& other) { @@ -133,6 +137,7 @@ namespace mln } template <typename S> + inline void max_h<S>::untake(const argument& t) { @@ -155,6 +160,7 @@ namespace mln } template <typename S> + inline void max_h<S>::update_() const { @@ -167,6 +173,7 @@ namespace mln } template <typename S> + inline void max_h<S>::go_minus_() const { @@ -177,6 +184,7 @@ namespace mln } template <typename S> + inline void max_h<S>::go_plus_() const { @@ -190,6 +198,7 @@ namespace mln } template <typename S> + inline void max_h<S>::init() { @@ -201,6 +210,7 @@ namespace mln } template <typename S> + inline void max_h<S>::take_as_init(const argument& t) { @@ -212,6 +222,7 @@ namespace mln } template <typename S> + inline typename max_h<S>::argument max_h<S>::to_result() const { @@ -221,6 +232,7 @@ namespace mln } template <typename S> + inline const accu::histo<S>& max_h<S>::histo() const { @@ -228,6 +240,7 @@ namespace mln } template <typename S> + inline std::ostream& operator<<(std::ostream& ostr, const max_h<S>& m) { return ostr << m.to_result(); diff --git a/milena/mln/accu/mean.hh b/milena/mln/accu/mean.hh index 25c028a..ac047f1 100644 --- a/milena/mln/accu/mean.hh +++ b/milena/mln/accu/mean.hh @@ -100,12 +100,14 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename T, typename S, typename M> + inline mean_<T,S,M>::mean_() { init(); } template <typename T, typename S, typename M> + inline void mean_<T,S,M>::init() { @@ -114,6 +116,7 @@ namespace mln } template <typename T, typename S, typename M> + inline void mean_<T,S,M>::take(const argument& t) { count_.take(t); @@ -121,6 +124,7 @@ namespace mln } template <typename T, typename S, typename M> + inline void mean_<T,S,M>::take(const mean_<T,S,M>& other) { @@ -129,6 +133,7 @@ namespace mln } template <typename T, typename S, typename M> + inline M mean_<T,S,M>::to_result() const { diff --git a/milena/mln/accu/median.hh b/milena/mln/accu/median.hh index 3b5686b..b67a21f 100644 --- a/milena/mln/accu/median.hh +++ b/milena/mln/accu/median.hh @@ -88,6 +88,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename S> + inline median<S>::median(const Value_Set<S>& s) : h_(s), s_(h_.vset()) @@ -96,6 +97,7 @@ namespace mln } template <typename S> + inline median<S>::median() : h_(), s_(h_.vset()) @@ -104,6 +106,7 @@ namespace mln } template <typename S> + inline void median<S>::take(const argument& t) { @@ -119,6 +122,7 @@ namespace mln } template <typename S> + inline void median<S>::take(const median<S>& other) { @@ -138,6 +142,7 @@ namespace mln } template <typename S> + inline void median<S>::untake(const argument& t) { @@ -154,6 +159,7 @@ namespace mln } template <typename S> + inline void median<S>::update_() const { @@ -179,6 +185,7 @@ namespace mln } template <typename S> + inline void median<S>::go_minus_() const { @@ -195,6 +202,7 @@ namespace mln } template <typename S> + inline void median<S>::go_plus_() const { @@ -211,6 +219,7 @@ namespace mln } template <typename S> + inline void median<S>::init() { @@ -224,6 +233,7 @@ namespace mln } template <typename S> + inline typename median<S>::argument median<S>::to_result() const { @@ -233,6 +243,7 @@ namespace mln } template <typename S> + inline const accu::histo<S>& median<S>::histo() const { @@ -240,6 +251,7 @@ namespace mln } template <typename S> + inline std::ostream& operator<<(std::ostream& ostr, const median<S>& m) { return ostr << m.to_result(); diff --git a/milena/mln/accu/median_alt.hh b/milena/mln/accu/median_alt.hh index 12fd636..eb4f333 100644 --- a/milena/mln/accu/median_alt.hh +++ b/milena/mln/accu/median_alt.hh @@ -99,6 +99,7 @@ namespace mln template <typename S> + inline median_alt<S>::median_alt(const Value_Set<S>& s) : h_(s), s_(h_.vset()) @@ -108,6 +109,7 @@ namespace mln template <typename S> + inline void median_alt<S>::take(const argument& t) { @@ -151,6 +153,7 @@ namespace mln template <typename S> + inline void median_alt<S>::untake(const argument& t) { @@ -204,6 +207,7 @@ namespace mln template <typename S> + inline void median_alt<S>::go_minus_() { @@ -221,6 +225,7 @@ namespace mln template <typename S> + inline void median_alt<S>::go_plus_() { @@ -238,6 +243,7 @@ namespace mln template <typename S> + inline void median_alt<S>::init() { @@ -249,6 +255,7 @@ namespace mln } template <typename S> + inline typename median_alt<S>::argument median_alt<S>::to_result() const { @@ -256,6 +263,7 @@ namespace mln } template <typename S> + inline std::ostream& operator<<(std::ostream& ostr, const median_alt<S>& m) { m.debug__(); diff --git a/milena/mln/accu/min.hh b/milena/mln/accu/min.hh index 266cf4f..d5d1ef9 100644 --- a/milena/mln/accu/min.hh +++ b/milena/mln/accu/min.hh @@ -92,12 +92,14 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename T> + inline min_<T>::min_() { init(); } template <typename T> + inline void min_<T>::init() { @@ -105,12 +107,14 @@ namespace mln } template <typename T> + inline void min_<T>::take_as_init(const argument& t) { t_ = t; } template <typename T> + inline void min_<T>::take(const argument& t) { if (t < t_) @@ -118,6 +122,7 @@ namespace mln } template <typename T> + inline void min_<T>::take(const min_<T>& other) { @@ -126,6 +131,7 @@ namespace mln } template <typename T> + inline T min_<T>::to_result() const { diff --git a/milena/mln/accu/min_h.hh b/milena/mln/accu/min_h.hh index 8153292..fafdbc4 100644 --- a/milena/mln/accu/min_h.hh +++ b/milena/mln/accu/min_h.hh @@ -88,6 +88,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename S> + inline min_h<S>::min_h(const Value_Set<S>& s) : h_(s), s_(h_.vset()) @@ -96,6 +97,7 @@ namespace mln } template <typename S> + inline min_h<S>::min_h() : h_(), s_(h_.vset()) @@ -104,6 +106,7 @@ namespace mln } template <typename S> + inline void min_h<S>::take(const argument& t) { @@ -121,6 +124,7 @@ namespace mln } template <typename S> + inline void min_h<S>::take(const min_h<S>& other) { @@ -133,6 +137,7 @@ namespace mln } template <typename S> + inline void min_h<S>::untake(const argument& t) { @@ -155,6 +160,7 @@ namespace mln } template <typename S> + inline void min_h<S>::update_() const { @@ -167,6 +173,7 @@ namespace mln } template <typename S> + inline void min_h<S>::go_minus_() const { @@ -181,6 +188,7 @@ namespace mln } template <typename S> + inline void min_h<S>::go_plus_() const { @@ -191,6 +199,7 @@ namespace mln } template <typename S> + inline void min_h<S>::init() { @@ -202,6 +211,7 @@ namespace mln } template <typename S> + inline void min_h<S>::take_as_init(const argument& t) { @@ -213,6 +223,7 @@ namespace mln } template <typename S> + inline typename min_h<S>::argument min_h<S>::to_result() const { @@ -222,6 +233,7 @@ namespace mln } template <typename S> + inline const accu::histo<S>& min_h<S>::histo() const { @@ -229,6 +241,7 @@ namespace mln } template <typename S> + inline std::ostream& operator<<(std::ostream& ostr, const min_h<S>& m) { return ostr << m.to_result(); diff --git a/milena/mln/accu/nil.hh b/milena/mln/accu/nil.hh index 5fda9fb..e884ea5 100644 --- a/milena/mln/accu/nil.hh +++ b/milena/mln/accu/nil.hh @@ -81,35 +81,41 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename T> + inline nil_<T>::nil_() { } template <typename T> + inline void nil_<T>::init() { } template <typename T> + inline void nil_<T>::take(const argument&) { } template <typename T> + inline void nil_<T>::take_as_init(const argument&) { } template <typename T> + inline void nil_<T>::take(const nil_<T>&) { } template <typename T> + inline util::ignore nil_<T>::to_result() const { diff --git a/milena/mln/accu/p.hh b/milena/mln/accu/p.hh index f272067..ee8542f 100644 --- a/milena/mln/accu/p.hh +++ b/milena/mln/accu/p.hh @@ -88,12 +88,14 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename A> + inline p_<A>::p_() { init(); } template <typename A> + inline p_<A>::p_(const A& a) : a_(a) { @@ -101,6 +103,7 @@ namespace mln } template <typename A> + inline void p_<A>::init() { @@ -108,6 +111,7 @@ namespace mln } template <typename A> + inline void p_<A>::take_as_init(const argument& t) { @@ -115,6 +119,7 @@ namespace mln } template <typename A> + inline void p_<A>::take(const argument& t) { @@ -122,6 +127,7 @@ namespace mln } template <typename A> + inline void p_<A>::take(const p_<A>& other) { @@ -129,6 +135,7 @@ namespace mln } template <typename A> + inline typename p_<A>::result p_<A>::to_result() const { diff --git a/milena/mln/accu/pair.hh b/milena/mln/accu/pair.hh index 8936ca9..c592f09 100644 --- a/milena/mln/accu/pair.hh +++ b/milena/mln/accu/pair.hh @@ -100,12 +100,14 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename A1, typename A2, typename T> + inline pair_<A1,A2,T>::pair_() { init(); } template <typename A1, typename A2, typename T> + inline void pair_<A1,A2,T>::init() { @@ -114,6 +116,7 @@ namespace mln } template <typename A1, typename A2, typename T> + inline void pair_<A1,A2,T>::take_as_init(const argument& t) { @@ -122,6 +125,7 @@ namespace mln } template <typename A1, typename A2, typename T> + inline void pair_<A1,A2,T>::take(const argument& t) { @@ -130,6 +134,7 @@ namespace mln } template <typename A1, typename A2, typename T> + inline void pair_<A1,A2,T>::take(const pair_<A1,A2,T>& other) { @@ -138,6 +143,7 @@ namespace mln } template <typename A1, typename A2, typename T> + inline typename pair_<A1,A2,T>::result pair_<A1,A2,T>::to_result() const { @@ -146,6 +152,7 @@ namespace mln } template <typename A1, typename A2, typename T> + inline void pair_<A1,A2,T>::get_result(result_1& r1, result_2& r2) const diff --git a/milena/mln/accu/sum.hh b/milena/mln/accu/sum.hh index 611c7d6..894c93f 100644 --- a/milena/mln/accu/sum.hh +++ b/milena/mln/accu/sum.hh @@ -93,12 +93,14 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename T, typename S> + inline sum_<T,S>::sum_() { init(); } template <typename T, typename S> + inline void sum_<T,S>::init() { @@ -106,12 +108,14 @@ namespace mln } template <typename T, typename S> + inline void sum_<T,S>::take(const argument& t) { s_ += t; } template <typename T, typename S> + inline void sum_<T,S>::take(const sum_<T,S>& other) { @@ -119,6 +123,7 @@ namespace mln } template <typename T, typename S> + inline S sum_<T,S>::to_result() const { diff --git a/milena/mln/accu/take.hh b/milena/mln/accu/take.hh index 2c166b5..0c845ea 100644 --- a/milena/mln/accu/take.hh +++ b/milena/mln/accu/take.hh @@ -67,6 +67,7 @@ namespace mln { template <typename A, typename I> + inline void take(const Image<I>& input_, A& a) { const I& input = exact(input_); @@ -83,6 +84,7 @@ namespace mln // Facade. template <typename A, typename I> + inline void take(const Image<I>& input, Accumulator<A>& a) { mln_precondition(exact(input).has_data()); diff --git a/milena/mln/accu/v.hh b/milena/mln/accu/v.hh index fa90be2..90fd8f8 100644 --- a/milena/mln/accu/v.hh +++ b/milena/mln/accu/v.hh @@ -97,12 +97,14 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename A> + inline val_<A>::val_() { init(); } template <typename A> + inline val_<A>::val_(const A& a) : a_(a) { @@ -110,6 +112,7 @@ namespace mln } template <typename A> + inline void val_<A>::init() { @@ -117,6 +120,7 @@ namespace mln } template <typename A> + inline void val_<A>::take_as_init(const argument& t) { @@ -124,6 +128,7 @@ namespace mln } template <typename A> + inline void val_<A>::take(const argument& t) { @@ -131,6 +136,7 @@ namespace mln } template <typename A> + inline void val_<A>::take(const val_<A>& other) { @@ -138,6 +144,7 @@ namespace mln } template <typename A> + inline typename val_<A>::result val_<A>::to_result() const { diff --git a/milena/mln/arith/min.hh b/milena/mln/arith/min.hh index e2f6f22..cd2ef1d 100644 --- a/milena/mln/arith/min.hh +++ b/milena/mln/arith/min.hh @@ -77,6 +77,7 @@ namespace mln namespace generic { template <typename L, typename R, typename O> + inline void min_(const L& lhs, const R& rhs, O& output) { trace::entering("level::arith::generic::min_"); @@ -89,6 +90,7 @@ namespace mln } template <typename L, typename R> + inline void min_inplace_(L& lhs, const R& rhs) { trace::entering("level::arith::generic::min_inplace_"); @@ -109,6 +111,7 @@ namespace mln // Facades. template <typename L, typename R> + inline mln_concrete(L) min(const Image<L>& lhs, const Image<R>& rhs) { trace::entering("arith::min"); @@ -124,6 +127,7 @@ namespace mln } template <typename L, typename R> + inline void min_inplace(Image<L>& lhs, const Image<R>& rhs) { trace::entering("arith::min_inplace"); diff --git a/milena/mln/arith/min.spe.hh b/milena/mln/arith/min.spe.hh index 6e87bab..a52a2ab 100644 --- a/milena/mln/arith/min.spe.hh +++ b/milena/mln/arith/min.spe.hh @@ -56,6 +56,7 @@ namespace mln } template <typename L, typename R, typename O> + inline void min_(trait::image::speed::any, const L& lhs, trait::image::speed::any, const R& rhs, O& output) { @@ -64,6 +65,7 @@ namespace mln template <typename L, typename R, typename O> + inline void min_(trait::image::speed::fastest, const L& lhs, trait::image::speed::fastest, const R& rhs, O& output) { @@ -79,6 +81,7 @@ namespace mln } template <typename L, typename R> + inline void min_inplace_(trait::image::speed::any, L& lhs, trait::image::speed::any, const R& rhs) { @@ -86,6 +89,7 @@ namespace mln } template <typename L, typename R> + inline void min_inplace_(trait::image::speed::fastest, L& lhs, trait::image::speed::fastest, const R& rhs) { diff --git a/milena/mln/arith/minus.hh b/milena/mln/arith/minus.hh index 0809e36..6419e03 100644 --- a/milena/mln/arith/minus.hh +++ b/milena/mln/arith/minus.hh @@ -193,6 +193,7 @@ namespace mln template <typename L, typename R> + inline mln_trait_op_minus(L,R) operator-(const Image<L>& lhs, const Image<R>& rhs) { @@ -206,6 +207,7 @@ namespace mln } template <typename L, typename R> + inline L& operator-=(Image<L>& lhs, const Image<R>& rhs) { @@ -220,6 +222,7 @@ namespace mln template <typename I, typename S> + inline mln_trait_op_minus(I,S) operator-(const Image<I>& ima, const value::Scalar<S>& s) { @@ -233,6 +236,7 @@ namespace mln } template <typename I, typename S> + inline I& operator-=(Image<I>& ima, const value::Scalar<S>& s) { @@ -254,6 +258,7 @@ namespace mln { template <typename L, typename R, typename O> + inline void minus_(trait::image::speed::any, const L& lhs, trait::image::speed::any, const R& rhs, O& output) { @@ -263,6 +268,7 @@ namespace mln } template <typename L, typename R, typename F, typename O> + inline void minus_(trait::image::speed::any, const L& lhs, trait::image::speed::any, const R& rhs, const F& f, O& output) { @@ -272,6 +278,7 @@ namespace mln } template <typename L, typename R, typename O> + inline void minus_(trait::image::speed::fastest, const L& lhs, trait::image::speed::fastest, const R& rhs, O& output) { @@ -283,6 +290,7 @@ namespace mln } template <typename L, typename R, typename F, typename O> + inline void minus_(trait::image::speed::fastest, const L& lhs, trait::image::speed::fastest, const R& rhs, const F& f, O& output) { @@ -294,6 +302,7 @@ namespace mln } template <typename L, typename R> + inline void minus_inplace_(trait::image::speed::any, L& lhs, trait::image::speed::any, const R& rhs) { @@ -303,6 +312,7 @@ namespace mln } template <typename L, typename R> + inline void minus_inplace_(trait::image::speed::fastest, L& lhs, trait::image::speed::fastest, const R& rhs) { @@ -319,6 +329,7 @@ namespace mln template <typename L, typename R> + inline mln_trait_op_minus(L, R) minus(const Image<L>& lhs, const Image<R>& rhs) { @@ -337,6 +348,7 @@ namespace mln template <typename L, typename R, typename F> + inline mln_ch_value(L, mln_result(F)) minus(const Image<L>& lhs, const Image<R>& rhs, const Function_v2v<F>& f) { @@ -355,6 +367,7 @@ namespace mln template <typename V, typename L, typename R> + inline mln_ch_value(L, V) minus(const Image<L>& lhs, const Image<R>& rhs) { @@ -372,6 +385,7 @@ namespace mln template <typename I, typename V> + inline mln_trait_op_minus(I, V) minus_cst(const Image<I>& input, const V& val) { @@ -389,6 +403,7 @@ namespace mln template <typename I, typename V, typename F> + inline mln_ch_value(I, mln_result(F)) minus_cst(const Image<I>& input, const V& val, const Function_v2v<F>& f) { @@ -407,6 +422,7 @@ namespace mln template <typename L, typename R> + inline void minus_inplace(Image<L>& lhs, const Image<R>& rhs) { @@ -422,6 +438,7 @@ namespace mln template <typename I, typename V> + inline I& minus_cst_inplace(Image<I>& input, const V& val) { diff --git a/milena/mln/arith/plus.hh b/milena/mln/arith/plus.hh index 660d98d..4c834d1 100644 --- a/milena/mln/arith/plus.hh +++ b/milena/mln/arith/plus.hh @@ -207,6 +207,7 @@ namespace mln template <typename L, typename R> + inline mln_trait_op_plus(L,R) operator+(const Image<L>& lhs, const Image<R>& rhs) { @@ -221,6 +222,7 @@ namespace mln } template <typename L, typename R> + inline L& operator+=(Image<L>& lhs, const Image<R>& rhs) { @@ -236,6 +238,7 @@ namespace mln template <typename I, typename S> + inline mln_trait_op_plus(I,S) operator+(const Image<I>& ima, const value::Scalar<S>& s) { @@ -250,6 +253,7 @@ namespace mln } template <typename I, typename S> + inline I& operator+=(Image<I>& ima, const value::Scalar<S>& s) { @@ -272,6 +276,7 @@ namespace mln { template <typename L, typename R, typename O> + inline void plus_(trait::image::speed::any, const L& lhs, trait::image::speed::any, const R& rhs, O& output) { @@ -281,6 +286,7 @@ namespace mln } template <typename L, typename R, typename F, typename O> + inline void plus_(trait::image::speed::any, const L& lhs, trait::image::speed::any, const R& rhs, const F& f, O& output) { @@ -290,6 +296,7 @@ namespace mln } template <typename L, typename R, typename O> + inline void plus_(trait::image::speed::fastest, const L& lhs, trait::image::speed::fastest, const R& rhs, O& output) { @@ -301,6 +308,7 @@ namespace mln } template <typename L, typename R, typename F, typename O> + inline void plus_(trait::image::speed::fastest, const L& lhs, trait::image::speed::fastest, const R& rhs, const F& f, O& output) { @@ -312,6 +320,7 @@ namespace mln } template <typename L, typename R> + inline void plus_inplace_(trait::image::speed::any, L& lhs, trait::image::speed::any, const R& rhs) { @@ -321,6 +330,7 @@ namespace mln } template <typename L, typename R> + inline void plus_inplace_(trait::image::speed::fastest, L& lhs, trait::image::speed::fastest, const R& rhs) { @@ -337,6 +347,7 @@ namespace mln template <typename L, typename R> + inline mln_trait_op_plus(L, R) plus(const Image<L>& lhs, const Image<R>& rhs) { @@ -355,6 +366,7 @@ namespace mln template <typename L, typename R, typename F> + inline mln_ch_value(L, mln_result(F)) plus(const Image<L>& lhs, const Image<R>& rhs, const Function_v2v<F>& f) { @@ -373,6 +385,7 @@ namespace mln template <typename V, typename L, typename R> + inline mln_ch_value(L, V) plus(const Image<L>& lhs, const Image<R>& rhs) { @@ -390,6 +403,7 @@ namespace mln template <typename I, typename V> + inline mln_trait_op_plus(I, V) plus_cst(const Image<I>& input, const V& val) { @@ -407,6 +421,7 @@ namespace mln template <typename I, typename V, typename F> + inline mln_ch_value(I, mln_result(F)) plus_cst(const Image<I>& input, const V& val, const Function_v2v<F>& f) { @@ -425,6 +440,7 @@ namespace mln template <typename W, typename I, typename V> + inline mln_ch_value(I, W) plus_cst(const Image<I>& input, const V& val) { @@ -442,6 +458,7 @@ namespace mln template <typename L, typename R> + inline void plus_inplace(Image<L>& lhs, const Image<R>& rhs) { @@ -457,6 +474,7 @@ namespace mln template <typename I, typename V> + inline I& plus_cst_inplace(Image<I>& input, const V& val) { diff --git a/milena/mln/arith/revert.hh b/milena/mln/arith/revert.hh index 81ed2f2..c4d1044 100644 --- a/milena/mln/arith/revert.hh +++ b/milena/mln/arith/revert.hh @@ -90,6 +90,7 @@ namespace mln { template <typename I, typename O> + inline void revert_(const I& input, O& output) { trace::entering("arith::impl::generic::revert_"); @@ -110,6 +111,7 @@ namespace mln // Facades. template <typename I> + inline mln_concrete(I) revert(const Image<I>& input) { trace::entering("arith::revert"); @@ -125,6 +127,7 @@ namespace mln } template <typename I> + inline void revert_inplace(Image<I>& input) { trace::entering("arith::revert_inplace"); diff --git a/milena/mln/arith/revert.spe.hh b/milena/mln/arith/revert.spe.hh index 19b21c5..1be07b8 100644 --- a/milena/mln/arith/revert.spe.hh +++ b/milena/mln/arith/revert.spe.hh @@ -56,12 +56,14 @@ namespace mln } template <typename I, typename O> + inline void revert_(trait::image::speed::any, const I& input, O& output) { generic::revert_(input, output); } template <typename I, typename O> + inline void revert_(trait::image::speed::fastest, const I& input, O& output) { trace::entering("arith::impl::revert_"); diff --git a/milena/mln/arith/times.hh b/milena/mln/arith/times.hh index 1376dcb..f0609c4 100644 --- a/milena/mln/arith/times.hh +++ b/milena/mln/arith/times.hh @@ -136,6 +136,7 @@ namespace mln template <typename L, typename R> + inline mln_trait_op_times(L,R) operator*(const Image<L>& lhs, const Image<R>& rhs) { @@ -147,6 +148,7 @@ namespace mln } template <typename L, typename R> + inline L& operator*=(Image<L>& lhs, const Image<R>& rhs) { @@ -157,6 +159,7 @@ namespace mln template <typename I, typename S> + inline mln_trait_op_times(I,S) operator*(const Image<I>& ima, const value::Scalar<S>& s) { @@ -168,6 +171,7 @@ namespace mln } template <typename I, typename S> + inline I& operator*=(Image<I>& ima, const value::Scalar<S>& s) { @@ -188,6 +192,7 @@ namespace mln { template <typename L, typename R, typename O> + inline void times_(const L& lhs, const R& rhs, O& output) { trace::entering("arith::impl::generic::times_"); @@ -200,6 +205,7 @@ namespace mln } template <typename L, typename R> + inline void times_inplace_(L& lhs, const R& rhs) { trace::entering("arith::impl::generic::times_inplace_"); @@ -219,6 +225,7 @@ namespace mln // Facades. template <typename L, typename R, typename O> + inline void times(const Image<L>& lhs, const Image<R>& rhs, Image<O>& output) { trace::entering("arith::times"); @@ -233,6 +240,7 @@ namespace mln } template <typename I, typename V, typename O> + inline void times_cst(const Image<I>& input, const V& val, Image<O>& output) { trace::entering("arith::times_cst"); @@ -245,6 +253,7 @@ namespace mln } template <typename L, typename R> + inline void times_inplace(Image<L>& lhs, const Image<R>& rhs) { trace::entering("arith::times_inplace"); @@ -257,6 +266,7 @@ namespace mln } template <typename I, typename V> + inline void times_cst_inplace(Image<I>& input, const V& val) { trace::entering("arith::times_cst_inplace"); diff --git a/milena/mln/arith/times.spe.hh b/milena/mln/arith/times.spe.hh index 303c489..293532e 100644 --- a/milena/mln/arith/times.spe.hh +++ b/milena/mln/arith/times.spe.hh @@ -59,6 +59,7 @@ namespace mln } template <typename L, typename R, typename O> + inline void times_(trait::image::speed::any, const L& lhs, trait::image::speed::any, const R& rhs, trait::image::speed::any, O& output) @@ -67,6 +68,7 @@ namespace mln } template <typename L, typename R, typename O> + inline void times_(trait::image::speed::fastest, const L& lhs, trait::image::speed::fastest, const R& rhs, trait::image::speed::fastest, O& output) @@ -83,6 +85,7 @@ namespace mln } template <typename L, typename R> + inline void times_inplace_(trait::image::speed::any, L& lhs, trait::image::speed::any, const R& rhs) { @@ -90,6 +93,7 @@ namespace mln } template <typename L, typename R> + inline void times_inplace_(trait::image::speed::fastest, L& lhs, trait::image::speed::fastest, const R& rhs) { diff --git a/milena/mln/border/adjust.hh b/milena/mln/border/adjust.hh index 62885a6..2ca30cf 100644 --- a/milena/mln/border/adjust.hh +++ b/milena/mln/border/adjust.hh @@ -61,6 +61,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I> + inline void adjust(const Image<I>& ima_, unsigned min_thickness) { trace::entering("border::adjust"); diff --git a/milena/mln/border/duplicate.hh b/milena/mln/border/duplicate.hh index 7e29dea..c315e32 100644 --- a/milena/mln/border/duplicate.hh +++ b/milena/mln/border/duplicate.hh @@ -64,6 +64,7 @@ namespace mln { template <typename I> + inline void duplicate_1d_(const I& ima) { trace::entering("border::impl::duplicate_1d_"); @@ -84,6 +85,7 @@ namespace mln } template <typename I> + inline void duplicate_2d_(const I& ima) { trace::entering("border::impl::duplicate_2d_"); @@ -124,6 +126,7 @@ namespace mln } template <typename I> + inline void duplicate_3d_(const Image<I>& ima_) { trace::entering("border::impl::duplicate_3d_"); @@ -194,6 +197,7 @@ namespace mln // Facade. template <typename I> + inline void duplicate(const Image<I>& ima_) { trace::entering("border::duplicate"); diff --git a/milena/mln/border/equalize.hh b/milena/mln/border/equalize.hh index f901df0..e81e5f7 100644 --- a/milena/mln/border/equalize.hh +++ b/milena/mln/border/equalize.hh @@ -69,6 +69,7 @@ namespace mln { template <typename I, typename J> + inline void equalize_(const I& ima1, const J& ima2, unsigned min_thickness) { trace::entering("border::impl::equalize_"); @@ -109,6 +110,7 @@ namespace mln // Facade template <typename I, typename J> + inline void equalize(const Image<I>& ima1_, const Image<J>& ima2_, unsigned min_thickness) { diff --git a/milena/mln/border/fill.hh b/milena/mln/border/fill.hh index 0be0be7..24ad3fd 100644 --- a/milena/mln/border/fill.hh +++ b/milena/mln/border/fill.hh @@ -61,6 +61,7 @@ namespace mln { template <typename I> + inline void fill_size_1_(const I& ima, const mln_value(I)& v) { trace::entering("border::impl::fill_size_1_"); @@ -87,6 +88,7 @@ namespace mln } template <typename I> + inline void fill_size_n_(const I& ima, const mln_value(I)& v) { trace::entering("border::impl::fill_size_n_"); @@ -114,6 +116,7 @@ namespace mln // Facade. template <typename I> + inline void fill(const Image<I>& ima_, const mln_value(I)& v) { trace::entering("border::fill"); diff --git a/milena/mln/border/find.hh b/milena/mln/border/find.hh index 60ca67e..8a71414 100644 --- a/milena/mln/border/find.hh +++ b/milena/mln/border/find.hh @@ -60,24 +60,28 @@ namespace mln { template <typename I, typename S, typename E> + inline unsigned find__(const mln::internal::image_morpher_<I,S,E>& ima) { return border::find(*ima.delegatee_()); } template <typename S, typename E> + inline unsigned find__(const mln::internal::image_base_<S,E>&) { return 0; } template <typename I> + inline unsigned find_(trait::image::speed::any, const I& ima) { return border::impl::find__(ima); } template <typename I> + inline unsigned find_(trait::image::speed::fastest, const I& ima) { return ima.border(); @@ -89,6 +93,7 @@ namespace mln // Facade. template <typename I> + inline unsigned find(const Image<I>& ima) { trace::entering("border::find"); diff --git a/milena/mln/border/get.hh b/milena/mln/border/get.hh index 3f3bf79..db6d6a4 100644 --- a/milena/mln/border/get.hh +++ b/milena/mln/border/get.hh @@ -60,6 +60,7 @@ namespace mln { template <typename I> + inline unsigned get_(trait::image::border::some, trait::image::category::primary, const I& ima) { @@ -67,6 +68,7 @@ namespace mln } template <typename I> + inline unsigned get_(trait::image::border::some, trait::image::category::morpher, const I& ima) { @@ -75,6 +77,7 @@ namespace mln template <typename I> + inline unsigned get_(trait::image::border::none, trait::image::category::any, const I&) { @@ -87,6 +90,7 @@ namespace mln // Facade. template <typename I> + inline unsigned get(const Image<I>& ima) { trace::entering("border::get"); diff --git a/milena/mln/border/mirror.hh b/milena/mln/border/mirror.hh index b8602c7..480e681 100644 --- a/milena/mln/border/mirror.hh +++ b/milena/mln/border/mirror.hh @@ -68,12 +68,14 @@ namespace mln { template <typename I> + inline void mirror_1d_(const I& ima) { mln::internal::fixme(); } template <typename I> + inline void mirror_2d_(const I& ima) { trace::entering("border::impl::mirror_2d_"); @@ -136,6 +138,7 @@ namespace mln } template <typename I> + inline void mirror_3d_(const I& ima) { mln::internal::fixme(); @@ -146,6 +149,7 @@ namespace mln template <typename I> + inline void mirror(const Image<I>& ima_) { trace::entering("border::mirror"); diff --git a/milena/mln/border/resize.hh b/milena/mln/border/resize.hh index 61b426a..5503f60 100644 --- a/milena/mln/border/resize.hh +++ b/milena/mln/border/resize.hh @@ -69,6 +69,7 @@ namespace mln { template <typename I> + inline void resize_(trait::image::category::morpher, const I& ima_, unsigned thickness) { @@ -76,6 +77,7 @@ namespace mln } template <typename I> + inline void resize_(trait::image::category::primary, const I& ima_, unsigned thickness) { @@ -92,6 +94,7 @@ namespace mln /// Facade. template <typename I> + inline void resize(const Image<I>& ima_, unsigned thickness) { trace::entering("border::resize"); diff --git a/milena/mln/canvas/browsing/dir_struct_elt_incr_update.hh b/milena/mln/canvas/browsing/dir_struct_elt_incr_update.hh index d2ced00..af1501d 100644 --- a/milena/mln/canvas/browsing/dir_struct_elt_incr_update.hh +++ b/milena/mln/canvas/browsing/dir_struct_elt_incr_update.hh @@ -97,6 +97,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename F> + inline void dir_struct_elt_incr_update_t::operator()(F& f) const { diff --git a/milena/mln/canvas/browsing/directional.hh b/milena/mln/canvas/browsing/directional.hh index 6ee459c..ea0f6f9 100644 --- a/milena/mln/canvas/browsing/directional.hh +++ b/milena/mln/canvas/browsing/directional.hh @@ -86,6 +86,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename F> + inline void directional_t::operator()(F& f) const { diff --git a/milena/mln/canvas/browsing/fwd.hh b/milena/mln/canvas/browsing/fwd.hh index 3ec573a..642bfe1 100644 --- a/milena/mln/canvas/browsing/fwd.hh +++ b/milena/mln/canvas/browsing/fwd.hh @@ -85,6 +85,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename F> + inline void fwd_t::operator()(F& f) const { diff --git a/milena/mln/canvas/browsing/snake_fwd.hh b/milena/mln/canvas/browsing/snake_fwd.hh index 6f82578..b21db50 100644 --- a/milena/mln/canvas/browsing/snake_fwd.hh +++ b/milena/mln/canvas/browsing/snake_fwd.hh @@ -97,6 +97,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename F> + inline void snake_fwd_t::operator()(F& f) const { diff --git a/milena/mln/convert/to_dpoint.hh b/milena/mln/convert/to_dpoint.hh index a2281b1..6b5f602 100644 --- a/milena/mln/convert/to_dpoint.hh +++ b/milena/mln/convert/to_dpoint.hh @@ -50,6 +50,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename P> + inline mln_dpoint(P) to_dpoint(const Point_Site<P>& p_) { const P& p = exact(p_); diff --git a/milena/mln/convert/to_fun.hh b/milena/mln/convert/to_fun.hh index 57f7554..86a1ddc 100644 --- a/milena/mln/convert/to_fun.hh +++ b/milena/mln/convert/to_fun.hh @@ -55,6 +55,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename R, typename A> + inline fun::C<R(*)(A)> to_fun(R (*f_)(A)) { fun::C<R(*)(A)> f(f_); @@ -62,6 +63,7 @@ namespace mln } template <typename I> + inline pw::value_<I> to_fun(const Image<I>& ima) { return pw::value(ima); diff --git a/milena/mln/convert/to_image.hh b/milena/mln/convert/to_image.hh index 3d19ff9..2201681 100644 --- a/milena/mln/convert/to_image.hh +++ b/milena/mln/convert/to_image.hh @@ -129,6 +129,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename S> + inline mln_image_from(S, bool) to_image(const Point_Set<S>& pset_, unsigned border) { const S& pset = exact(pset_); @@ -141,6 +142,7 @@ namespace mln } template <typename W> + inline mln_image_from(W, bool) to_image(const Window<W>& win_) { const W& win = exact(win_); @@ -157,12 +159,14 @@ namespace mln } template <typename N> + inline mln_image_from(N, bool) to_image(const Neighborhood<N>& nbh) { return to_image(convert::to_window(nbh)); } template <typename W> + inline mln_image_from(W, mln_weight(W)) to_image(const Weighted_Window<W>& w_win_) { const W& w_win = exact(w_win_); @@ -178,6 +182,7 @@ namespace mln } template <typename S> + inline image1d<std::size_t> to_image(const histo::data<S>& h) { mln_value(S) diff --git a/milena/mln/convert/to_p_array.hh b/milena/mln/convert/to_p_array.hh index fde2a53..5b8045c 100644 --- a/milena/mln/convert/to_p_array.hh +++ b/milena/mln/convert/to_p_array.hh @@ -56,6 +56,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename S> + inline p_array<mln_point(S)> to_p_array(const Point_Set<S>& pset_) { const S& pset = exact(pset_); @@ -68,6 +69,7 @@ namespace mln } template <typename W> + inline p_array<mln_point(W)> to_p_array(const Window<W>& win, const mln_point(W)& p) { p_array<mln_point(W)> v; diff --git a/milena/mln/convert/to_p_set.hh b/milena/mln/convert/to_p_set.hh index a940863..ddf8681 100644 --- a/milena/mln/convert/to_p_set.hh +++ b/milena/mln/convert/to_p_set.hh @@ -74,6 +74,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename N> + inline p_set<mln_point(N)> to_p_set(const Neighborhood<N>& nbh_) { const N& nbh = exact(nbh_); @@ -87,6 +88,7 @@ namespace mln } template <typename I> + inline p_set<mln_point(I)> to_p_set(const Image<I>& ima_) { const I& ima = exact(ima_); @@ -106,6 +108,7 @@ namespace mln } template <typename W> + inline p_set<mln_point(W)> to_p_set(const Window<W>& win) { typedef mln_dpoint(W) D; @@ -118,6 +121,7 @@ namespace mln } template <typename P> + inline p_set<P> to_p_set(const std::set<P>& s) { mln::metal::is_a<P, Point_Site>::check(); @@ -129,6 +133,7 @@ namespace mln } template <typename S> + inline p_set<mln_psite(S)> to_p_set(const Point_Set<S>& ps_) { const S& ps = exact(ps_); diff --git a/milena/mln/convert/to_rgb.hh b/milena/mln/convert/to_rgb.hh index 97a8331..4c9ea4d 100644 --- a/milena/mln/convert/to_rgb.hh +++ b/milena/mln/convert/to_rgb.hh @@ -58,6 +58,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <unsigned int n> + inline rgb<n> to_rgb(const int_u<n>& i) { rgb<n> c(i, i, i); @@ -65,12 +66,14 @@ namespace mln } template <unsigned int n> + inline rgb<n>& to_rgb(rgb<n>& i) { return i; } template <unsigned int n> + inline const rgb<n>& to_rgb(const rgb<n>& i) { return i; diff --git a/milena/mln/convert/to_std_set.hh b/milena/mln/convert/to_std_set.hh index 8d0c456..f6baf8d 100644 --- a/milena/mln/convert/to_std_set.hh +++ b/milena/mln/convert/to_std_set.hh @@ -57,6 +57,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename W> + inline std::set<mln_dpoint(W)> to_std_set(const Window<W>& win) { typedef mln_dpoint(W) D; @@ -69,6 +70,7 @@ namespace mln } template <typename W> + inline std::set<mln_point(W)> to_std_set(const Point_Set<W>& setp) { typedef mln_point(W) P; diff --git a/milena/mln/convert/to_tiles.hh b/milena/mln/convert/to_tiles.hh index 9ccdc84..b18e6a3 100644 --- a/milena/mln/convert/to_tiles.hh +++ b/milena/mln/convert/to_tiles.hh @@ -52,6 +52,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I> + inline I to_tiles(std::vector<I>& v_ima, float ratio) { diff --git a/milena/mln/convert/to_w_window.hh b/milena/mln/convert/to_w_window.hh index bb49619..4db790a 100644 --- a/milena/mln/convert/to_w_window.hh +++ b/milena/mln/convert/to_w_window.hh @@ -51,6 +51,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I> + inline w_window<mln_dpoint(I), mln_value(I)> to_w_window(const Image<I>& input_) { const I& input = exact(input_); diff --git a/milena/mln/convert/to_window.hh b/milena/mln/convert/to_window.hh index 74feb33..37e86a1 100644 --- a/milena/mln/convert/to_window.hh +++ b/milena/mln/convert/to_window.hh @@ -73,6 +73,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename N> + inline window<mln_dpoint(N)> to_window(const Neighborhood<N>& nbh_) { const N& nbh = exact(nbh_); @@ -86,6 +87,7 @@ namespace mln } template <typename N> + inline window<mln_dpoint(N)> to_upper_window(const Neighborhood<N>& nbh_) { const N& nbh = exact(nbh_); @@ -100,6 +102,7 @@ namespace mln } template <typename I> + inline window<mln_dpoint(I)> to_window(const Image<I>& ima_) { const I& ima = exact(ima_); @@ -116,12 +119,14 @@ namespace mln } template <typename S> + inline window<mln_dpoint(S)> to_window(const Point_Set<S>& pset) { return to_window(pw::cst(true) | pset); } template <typename D> + inline window<D> to_window(const std::set<D>& s) { // FIXME: Was: mln::metal::is_a<D, Dpoint>::check(); diff --git a/milena/mln/core/a_point_of.hh b/milena/mln/core/a_point_of.hh index acd5b79..4ae8cba 100644 --- a/milena/mln/core/a_point_of.hh +++ b/milena/mln/core/a_point_of.hh @@ -47,6 +47,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I> + inline mln_point(I) a_point_of(const Image<I>& ima_) { const I& ima = exact(ima_); diff --git a/milena/mln/core/box.hh b/milena/mln/core/box.hh index 62c0c5b..9ba7e14 100644 --- a/milena/mln/core/box.hh +++ b/milena/mln/core/box.hh @@ -134,6 +134,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename P> + inline P box_<P>::pmin() const { @@ -141,6 +142,7 @@ namespace mln } template <typename P> + inline P& box_<P>::pmin() { @@ -148,6 +150,7 @@ namespace mln } template <typename P> + inline P box_<P>::pmax() const { @@ -155,6 +158,7 @@ namespace mln } template <typename P> + inline P& box_<P>::pmax() { @@ -162,11 +166,13 @@ namespace mln } template <typename P> + inline box_<P>::box_() { } template <typename P> + inline box_<P>::box_(const point& pmin, const point& pmax) : pmin_(pmin), pmax_(pmax) @@ -175,6 +181,7 @@ namespace mln } template <typename P> + inline box_<P>::box_(mln_coord(P) ninds) { metal::bool_<(dim == 1)>::check(); @@ -183,6 +190,7 @@ namespace mln } template <typename P> + inline box_<P>::box_(mln_coord(P) nrows, mln_coord(P) ncols) { metal::bool_<(dim == 2)>::check(); @@ -191,6 +199,7 @@ namespace mln } template <typename P> + inline box_<P>::box_(mln_coord(P) nslis, mln_coord(P) nrows, mln_coord(P) ncols) { metal::bool_<(dim == 3)>::check(); @@ -199,6 +208,7 @@ namespace mln } template <typename P> + inline bool box_<P>::has(const P& p) const { @@ -209,6 +219,7 @@ namespace mln } template <typename P> + inline void box_<P>::enlarge(unsigned b) { @@ -221,6 +232,7 @@ namespace mln template <typename P> + inline box_<P> box_<P>::to_larger(unsigned b) const { @@ -235,6 +247,7 @@ namespace mln } template <typename P> + inline std::ostream& operator<<(std::ostream& ostr, const box_<P>& b) { return ostr << "[" << b.pmin() << ".." << b.pmax() << ']'; diff --git a/milena/mln/core/box_piter.hh b/milena/mln/core/box_piter.hh index 5414d72..df58618 100644 --- a/milena/mln/core/box_piter.hh +++ b/milena/mln/core/box_piter.hh @@ -200,6 +200,7 @@ namespace mln // box_fwd_piter_<P> template <typename P> + inline box_fwd_piter_<P>::box_fwd_piter_(const box_<P>& b) : b_(b) { @@ -209,12 +210,14 @@ namespace mln } template <typename P> + inline box_fwd_piter_<P>::operator P() const { return p_; } template <typename P> + inline const P& box_fwd_piter_<P>::to_point() const { @@ -222,6 +225,7 @@ namespace mln } template <typename P> + inline mln_coord(P) box_fwd_piter_<P>::operator[](unsigned i) const { @@ -230,6 +234,7 @@ namespace mln } template <typename P> + inline bool box_fwd_piter_<P>::is_valid() const { @@ -237,6 +242,7 @@ namespace mln } template <typename P> + inline void box_fwd_piter_<P>::invalidate() { @@ -244,6 +250,7 @@ namespace mln } template <typename P> + inline void box_fwd_piter_<P>::start() { @@ -251,6 +258,7 @@ namespace mln } template <typename P> + inline void box_fwd_piter_<P>::next_() { @@ -270,6 +278,7 @@ namespace mln // box_bkd_piter_<P> template <typename P> + inline box_bkd_piter_<P>::box_bkd_piter_(const box_<P>& b) : b_(b) { @@ -279,6 +288,7 @@ namespace mln } template <typename P> + inline box_bkd_piter_<P>::operator P() const { return p_; @@ -286,6 +296,7 @@ namespace mln template <typename P> + inline const P& box_bkd_piter_<P>::to_point() const { @@ -293,6 +304,7 @@ namespace mln } template <typename P> + inline mln_coord(P) box_bkd_piter_<P>::operator[](unsigned i) const { @@ -301,6 +313,7 @@ namespace mln } template <typename P> + inline bool box_bkd_piter_<P>::is_valid() const { @@ -308,6 +321,7 @@ namespace mln } template <typename P> + inline void box_bkd_piter_<P>::invalidate() { @@ -315,6 +329,7 @@ namespace mln } template <typename P> + inline void box_bkd_piter_<P>::start() { @@ -322,6 +337,7 @@ namespace mln } template <typename P> + inline void box_bkd_piter_<P>::next_() { @@ -341,6 +357,7 @@ namespace mln // box_bounds_piter_<P> template <typename P> + inline box_bounds_piter_<P>::box_bounds_piter_(const box_<P>& b) : b_(b) { @@ -350,12 +367,14 @@ namespace mln } template <typename P> + inline box_bounds_piter_<P>::operator P() const { return p_; } template <typename P> + inline const P& box_bounds_piter_<P>::to_point() const { @@ -363,6 +382,7 @@ namespace mln } template <typename P> + inline mln_coord(P) box_bounds_piter_<P>::operator[](unsigned i) const { @@ -371,6 +391,7 @@ namespace mln } template <typename P> + inline bool box_bounds_piter_<P>::is_valid() const { @@ -378,6 +399,7 @@ namespace mln } template <typename P> + inline void box_bounds_piter_<P>::invalidate() { @@ -385,6 +407,7 @@ namespace mln } template <typename P> + inline void box_bounds_piter_<P>::start() { @@ -393,6 +416,7 @@ namespace mln } template <typename P> + inline void box_bounds_piter_<P>::next_() { diff --git a/milena/mln/core/cast_image.hh b/milena/mln/core/cast_image.hh index 9cac697..bb33bb7 100644 --- a/milena/mln/core/cast_image.hh +++ b/milena/mln/core/cast_image.hh @@ -134,6 +134,7 @@ namespace mln { template <typename T, typename I> + inline data_< cast_image_<T,I> >::data_(const I& ima) : ima_(ima) { @@ -145,6 +146,7 @@ namespace mln // cast_image_<T,I> template <typename T, typename I> + inline cast_image_<T,I>::cast_image_(const Image<I>& ima) { mln_precondition(exact(ima).has_data()); @@ -152,6 +154,7 @@ namespace mln } template <typename T, typename I> + inline T cast_image_<T,I>::operator()(const mln_psite(I)& p) const { @@ -160,6 +163,7 @@ namespace mln } template <typename T, typename I> + inline T cast_image_<T,I>::operator()(const mln_psite(I)& p) { @@ -167,6 +171,7 @@ namespace mln } template <typename T, typename I> + inline const mln::value::set<T>& cast_image_<T,I>::values() const { diff --git a/milena/mln/core/clock_neighb.hh b/milena/mln/core/clock_neighb.hh index 0de63d2..a40c35e 100644 --- a/milena/mln/core/clock_neighb.hh +++ b/milena/mln/core/clock_neighb.hh @@ -106,11 +106,13 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename D> + inline clock_neighb_<D>::clock_neighb_() { } template <typename D> + inline clock_neighb_<D>& clock_neighb_<D>::append(const D& dp) { diff --git a/milena/mln/core/clock_neighb2d.hh b/milena/mln/core/clock_neighb2d.hh index 0beee5b..2b41953 100644 --- a/milena/mln/core/clock_neighb2d.hh +++ b/milena/mln/core/clock_neighb2d.hh @@ -95,6 +95,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY + inline const clock_neighb2d cc4(dpoint2d& dp) { static bool flower = true; @@ -123,6 +124,7 @@ namespace mln } + inline const clock_neighb2d cc8(dpoint2d& dp) { // static bool flower = true; diff --git a/milena/mln/core/clone.hh b/milena/mln/core/clone.hh index b26a570..615a199 100644 --- a/milena/mln/core/clone.hh +++ b/milena/mln/core/clone.hh @@ -55,6 +55,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I> + inline mln_concrete(I) clone(const Image<I>& model) { // FIXME: Add a static check that mln_concrete(I) actually *is* concrete... diff --git a/milena/mln/core/concept/accumulator.hh b/milena/mln/core/concept/accumulator.hh index cedd403..b7b65a4 100644 --- a/milena/mln/core/concept/accumulator.hh +++ b/milena/mln/core/concept/accumulator.hh @@ -87,6 +87,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename E> + inline Accumulator<E>::Accumulator() { typedef mln_argument(E) argument; diff --git a/milena/mln/core/concept/box.hh b/milena/mln/core/concept/box.hh index 770817a..6d2b7da 100644 --- a/milena/mln/core/concept/box.hh +++ b/milena/mln/core/concept/box.hh @@ -127,18 +127,21 @@ namespace mln // Box<E> template <typename E> + inline const E& Box<E>::bbox() const { return exact(*this); } template <typename E> + inline unsigned Box<E>::len(unsigned i) const { return 1 + exact(this)->pmax()[i] - exact(this)->pmin()[i]; } template <typename E> + inline Box<E>::Box() { typedef mln_point(E) point; @@ -149,6 +152,7 @@ namespace mln } template <typename E> + inline std::size_t Box<E>::npoints() const { @@ -163,6 +167,7 @@ namespace mln // operators template <typename Bl, typename Br> + inline bool operator==(const Box<Bl>& lhs_, const Box<Br>& rhs_) { // FIXME: Same grid! @@ -172,6 +177,7 @@ namespace mln } template <typename Bl, typename Br> + inline bool operator<=(const Box<Bl>& lhs_, const Box<Br>& rhs_) { // FIXME: Same grid! @@ -186,6 +192,7 @@ namespace mln } template <typename Bl, typename Br> + inline bool operator<(const Box<Bl>& lhs_, const Box<Br>& rhs_) { // FIXME: Same grid! diff --git a/milena/mln/core/concept/browsing.hh b/milena/mln/core/concept/browsing.hh index fddf438..a780cff 100644 --- a/milena/mln/core/concept/browsing.hh +++ b/milena/mln/core/concept/browsing.hh @@ -70,16 +70,19 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename E> + inline Browsing<E>::Browsing() { } template <typename E> + inline void Browsing<E>::init() { } template <typename E> + inline void Browsing<E>::final() { } diff --git a/milena/mln/core/concept/delta_point_site.hh b/milena/mln/core/concept/delta_point_site.hh index f63251f..0768b5e 100644 --- a/milena/mln/core/concept/delta_point_site.hh +++ b/milena/mln/core/concept/delta_point_site.hh @@ -130,6 +130,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename E> + inline Delta_Point_Site<E>::Delta_Point_Site() { int dim = E::dim; @@ -147,6 +148,7 @@ namespace mln template <typename D> + inline std::ostream& operator<<(std::ostream& ostr, const Delta_Point_Site<D>& dp_) { const D& dp = exact(dp_); @@ -158,6 +160,7 @@ namespace mln template <typename L, typename R> + inline bool operator==(const Delta_Point_Site<L>& lhs_, const Delta_Point_Site<R>& rhs_) { mln::metal::bool_<(int(L::dim) == int(R::dim))>::check(); @@ -170,6 +173,7 @@ namespace mln } template <typename L, typename R> + inline bool operator<(const Delta_Point_Site<L>& lhs_, const Delta_Point_Site<R>& rhs_) { mln::metal::bool_<(int(L::dim) == int(R::dim))>::check(); @@ -185,6 +189,7 @@ namespace mln } template <typename L, typename R> + inline mln_dpoint(L) // FIXME: promote! operator+(const Delta_Point_Site<L>& lhs_, const Delta_Point_Site<R>& rhs_) { @@ -198,6 +203,7 @@ namespace mln } template <typename L, typename R> + inline mln_dpoint(L) // FIXME: promote! operator-(const Delta_Point_Site<L>& lhs_, const Delta_Point_Site<R>& rhs_) { diff --git a/milena/mln/core/concept/dpoint.hh b/milena/mln/core/concept/dpoint.hh index f6e4890..2c68066 100644 --- a/milena/mln/core/concept/dpoint.hh +++ b/milena/mln/core/concept/dpoint.hh @@ -79,11 +79,13 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename E> + inline Dpoint<E>::Dpoint() { } template <typename E> + inline const E& Dpoint<E>::to_dpoint() const { diff --git a/milena/mln/core/concept/function.hh b/milena/mln/core/concept/function.hh index 89ceaff..450c21c 100644 --- a/milena/mln/core/concept/function.hh +++ b/milena/mln/core/concept/function.hh @@ -221,67 +221,79 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename E> + inline Function<E>::Function() { typedef mln_result(E) result; } template <typename E> + inline Function<E>::Function(const Function<E>& rhs) : Object<E>(rhs) { } template <typename E> + inline Function_v2v<E>::Function_v2v() { } template <typename E> + inline Function_v2v<E>::Function_v2v(const Function_v2v<E>& rhs) : Function<E>(rhs) { } template <typename E> + inline Function_i2v<E>::Function_i2v() { } template <typename E> + inline Function_i2v<E>::Function_i2v(const Function_i2v<E>& rhs) : Function_v2v<E>(rhs) { } template <typename E> + inline Function_p2v<E>::Function_p2v() { } template <typename E> + inline Function_p2v<E>::Function_p2v(const Function_p2v<E>& rhs) : Function_v2v<E>(rhs) { } template <typename E> + inline Function_v2b<E>::Function_v2b() { } template <typename E> + inline Function_v2b<E>::Function_v2b(const Function_v2b<E>& rhs) : Function_v2v<E>(rhs) { } template <typename E> + inline Function_p2b<E>::Function_p2b() { } template <typename E> + inline Function_p2b<E>::Function_p2b(const Function_p2b<E>& rhs) : Function_v2v<E>(rhs), Function_p2v<E>(rhs), @@ -290,28 +302,33 @@ namespace mln } template <typename E> + inline Function_p2p<E>::Function_p2p() { } template <typename E> + inline Function_p2p<E>::Function_p2p(const Function_p2p<E>& rhs) : Function_p2v<E>(rhs) { } template <typename E> + inline Function_x2x<E>::Function_x2x() { } template <typename E> + inline Function_x2x<E>::Function_x2x(const Function_x2x<E>& rhs) : Function_v2v<E>(rhs) { } template <typename E> + inline Bijection_x2x<E>::Bijection_x2x() { typedef typename E::invert invert; diff --git a/milena/mln/core/concept/generalized_pixel.hh b/milena/mln/core/concept/generalized_pixel.hh index 6e511d6..10c75bc 100644 --- a/milena/mln/core/concept/generalized_pixel.hh +++ b/milena/mln/core/concept/generalized_pixel.hh @@ -79,6 +79,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename E> + inline Generalized_Pixel<E>::Generalized_Pixel() { typedef mln_value(E) value; diff --git a/milena/mln/core/concept/image.hh b/milena/mln/core/concept/image.hh index 6c98dcd..50af9c9 100644 --- a/milena/mln/core/concept/image.hh +++ b/milena/mln/core/concept/image.hh @@ -133,6 +133,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename E> + inline Image<E>::Image() { // provided by internal::image_base_: @@ -181,6 +182,7 @@ namespace mln } template <typename I, typename J> + inline void initialize(Image<I>& target, const Image<J>& model) { trace::entering("core::initialize"); diff --git a/milena/mln/core/concept/iterator.hh b/milena/mln/core/concept/iterator.hh index 96a16c7..d072329 100644 --- a/milena/mln/core/concept/iterator.hh +++ b/milena/mln/core/concept/iterator.hh @@ -105,6 +105,7 @@ namespace mln } template <typename E> + inline Iterator<E>::Iterator() { bool (E::*m1)() const = & E::is_valid; diff --git a/milena/mln/core/concept/literal.hh b/milena/mln/core/concept/literal.hh index a924926..e9e2931 100644 --- a/milena/mln/core/concept/literal.hh +++ b/milena/mln/core/concept/literal.hh @@ -70,11 +70,13 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename E> + inline Literal<E>::Literal() { } template <typename E> + inline const E& Literal<E>::the() { diff --git a/milena/mln/core/concept/mesh.hh b/milena/mln/core/concept/mesh.hh index 70a1034..98e7543 100644 --- a/milena/mln/core/concept/mesh.hh +++ b/milena/mln/core/concept/mesh.hh @@ -61,6 +61,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename E> + inline Mesh<E>::Mesh() { // FIXME: Check for typedefs. diff --git a/milena/mln/core/concept/meta_accumulator.hh b/milena/mln/core/concept/meta_accumulator.hh index cb4cd2e..b68f3b1 100644 --- a/milena/mln/core/concept/meta_accumulator.hh +++ b/milena/mln/core/concept/meta_accumulator.hh @@ -80,6 +80,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename E> + inline Meta_Accumulator<E>::Meta_Accumulator() { // FIXME: Check "with" on E. diff --git a/milena/mln/core/concept/neighborhood.hh b/milena/mln/core/concept/neighborhood.hh index 77b4aee..18efe56 100644 --- a/milena/mln/core/concept/neighborhood.hh +++ b/milena/mln/core/concept/neighborhood.hh @@ -76,6 +76,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename E> + inline Neighborhood<E>::Neighborhood() { typedef mln_niter(E) niter; diff --git a/milena/mln/core/concept/object.hh b/milena/mln/core/concept/object.hh index edbd4bb..081d51e 100644 --- a/milena/mln/core/concept/object.hh +++ b/milena/mln/core/concept/object.hh @@ -99,6 +99,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename E> + inline Object<E>::Object() { } diff --git a/milena/mln/core/concept/pixel_iterator.hh b/milena/mln/core/concept/pixel_iterator.hh index 84acc37..de014e8 100644 --- a/milena/mln/core/concept/pixel_iterator.hh +++ b/milena/mln/core/concept/pixel_iterator.hh @@ -67,6 +67,7 @@ namespace mln #ifndef MLN_INCLUDE_ONLY template <typename E> + inline Pixel_Iterator<E>::Pixel_Iterator() { // typedef mln_lvalue(E) lvalue; diff --git a/milena/mln/core/concept/point.hh b/milena/mln/core/concept/point.hh index f93f3b4..612e236 100644 --- a/milena/mln/core/concept/point.hh +++ b/milena/mln/core/concept/point.hh @@ -109,11 +109,13 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename P> + inline Point<P>::Point() { } template <typename P> + inline const P& Point<P>::to_point() const { @@ -121,6 +123,7 @@ namespace mln } template <typename P, typename D> + inline P& operator+=(Point<P>& p_, const Dpoint<D>& dp_) { P& p = exact(p_); @@ -132,6 +135,7 @@ namespace mln } template <typename P, typename D> + inline P& operator-=(Point<P>& p_, const Dpoint<D>& dp_) { P& p = exact(p_); diff --git a/milena/mln/core/concept/point_iterator.hh b/milena/mln/core/concept/point_iterator.hh index c6b86fb..2a71aef 100644 --- a/milena/mln/core/concept/point_iterator.hh +++ b/milena/mln/core/concept/point_iterator.hh @@ -90,6 +90,7 @@ namespace mln } template <typename E> + inline Point_Iterator<E>::Point_Iterator() { typedef mln_psite(E) psite; diff --git a/milena/mln/core/concept/point_set.hh b/milena/mln/core/concept/point_set.hh index 5caa54b..635c3d4 100644 --- a/milena/mln/core/concept/point_set.hh +++ b/milena/mln/core/concept/point_set.hh @@ -144,6 +144,7 @@ namespace mln template <typename P> struct box_; template <typename E> + inline Point_Set<E>::Point_Set() { typedef mln_mesh(E) mesh; @@ -167,6 +168,7 @@ namespace mln template <typename Sl, typename Sr> + inline bool operator==(const Point_Set<Sl>& lhs_, const Point_Set<Sr>& rhs_) { // FIXME: Same grid! @@ -193,6 +195,7 @@ namespace mln template <typename Sl, typename Sr> + inline bool operator<=(const Point_Set<Sl>& lhs_, const Point_Set<Sr>& rhs_) { // FIXME: Same grid! @@ -214,6 +217,7 @@ namespace mln template <typename Sl, typename Sr> + inline bool operator<(const Point_Set<Sl>& lhs_, const Point_Set<Sr>& rhs_) { // FIXME: Same grid! @@ -224,6 +228,7 @@ namespace mln template <typename S> + inline std::ostream& operator<<(std::ostream& ostr, const Point_Set<S>& pset_) { const S& pset = exact(pset_); diff --git a/milena/mln/core/concept/point_site.hh b/milena/mln/core/concept/point_site.hh index 37032b7..6831040 100644 --- a/milena/mln/core/concept/point_site.hh +++ b/milena/mln/core/concept/point_site.hh @@ -247,6 +247,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename E> + inline Point_Site<E>::Point_Site() { int dim = E::dim; @@ -266,6 +267,7 @@ namespace mln // Operators. template <typename L, typename R> + inline bool operator==(const Point_Site<L>& lhs_, const Point_Site<R>& rhs_) { mln::metal::bool_<(int(L::dim) == int(R::dim))>::check(); @@ -278,6 +280,7 @@ namespace mln } template <typename L, typename R> + inline bool operator<(const Point_Site<L>& lhs_, const Point_Site<R>& rhs_) { mln::metal::bool_<(int(L::dim) == int(R::dim))>::check(); @@ -293,6 +296,7 @@ namespace mln } template <typename L, typename R> + inline mln_dpoint(L) // FIXME: promote! operator-(const Point_Site<L>& lhs_, const Point_Site<R>& rhs_) { @@ -307,6 +311,7 @@ namespace mln } template <typename P, typename D> + inline mln_point(P) // FIXME: promote! operator+(const Point_Site<P>& p_, const Delta_Point_Site<D>& dp_) { @@ -320,6 +325,7 @@ namespace mln } template <typename P, typename D> + inline mln_point(P) // FIXME: promote! operator-(const Point_Site<P>& p_, const Delta_Point_Site<D>& dp_) { @@ -333,6 +339,7 @@ namespace mln } template <typename P> + inline std::ostream& operator<<(std::ostream& ostr, const Point_Site<P>& p_) { const P& p = exact(p_); diff --git a/milena/mln/core/concept/regular_grid.hh b/milena/mln/core/concept/regular_grid.hh index 9003655..f230676 100644 --- a/milena/mln/core/concept/regular_grid.hh +++ b/milena/mln/core/concept/regular_grid.hh @@ -53,6 +53,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename E> + inline Regular_Grid<E>::Regular_Grid() { } diff --git a/milena/mln/core/concept/value.hh b/milena/mln/core/concept/value.hh index 2cabdc8..ab94ef1 100644 --- a/milena/mln/core/concept/value.hh +++ b/milena/mln/core/concept/value.hh @@ -76,6 +76,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename E> + inline Value<E>::Value() { typedef mln_enc(E) enc; diff --git a/milena/mln/core/concept/value_iterator.hh b/milena/mln/core/concept/value_iterator.hh index a899e16..bccb1a9 100644 --- a/milena/mln/core/concept/value_iterator.hh +++ b/milena/mln/core/concept/value_iterator.hh @@ -82,6 +82,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename E> + inline Value_Iterator<E>::Value_Iterator() { typedef mln_value(E) value; @@ -90,6 +91,7 @@ namespace mln } template <typename E> + inline std::ostream& operator<<(std::ostream& ostr, const Value_Iterator<E>& v) { mln_precondition(exact(v).is_valid()); diff --git a/milena/mln/core/concept/value_set.hh b/milena/mln/core/concept/value_set.hh index c17381d..1d8744c 100644 --- a/milena/mln/core/concept/value_set.hh +++ b/milena/mln/core/concept/value_set.hh @@ -84,6 +84,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename E> + inline Value_Set<E>::Value_Set() { typedef mln_value(E) value; @@ -99,6 +100,7 @@ namespace mln } template <typename E> + inline std::ostream& operator<<(std::ostream& ostr, const Value_Set<E>& vs_) { const E& vs = exact(vs_); diff --git a/milena/mln/core/concept/weighted_window.hh b/milena/mln/core/concept/weighted_window.hh index 7317aed..f4fbce2 100644 --- a/milena/mln/core/concept/weighted_window.hh +++ b/milena/mln/core/concept/weighted_window.hh @@ -110,6 +110,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename E> + inline Weighted_Window<E>::Weighted_Window() { typedef mln_point(E) point; diff --git a/milena/mln/core/concept/window.hh b/milena/mln/core/concept/window.hh index 9edfb88..b45c1b1 100644 --- a/milena/mln/core/concept/window.hh +++ b/milena/mln/core/concept/window.hh @@ -96,6 +96,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename E> + inline Window<E>::Window() { typedef mln_point(E) point; @@ -118,6 +119,7 @@ namespace mln } template <typename Wl, typename Wr> + inline bool operator==(const Window<Wl>& lhs, const Window<Wr>& rhs) { // FIXME: Same grid! diff --git a/milena/mln/core/decorated_image.hh b/milena/mln/core/decorated_image.hh index b34c0db..f9ed7e8 100644 --- a/milena/mln/core/decorated_image.hh +++ b/milena/mln/core/decorated_image.hh @@ -133,6 +133,7 @@ namespace mln // internal::data_< decorated_image<I,S> > template <typename I, typename D> + inline data_< decorated_image<I,D> >::data_(I& ima, const D& deco) : ima_(ima), deco_(deco) @@ -144,17 +145,20 @@ namespace mln // decorated_image<I,D> template <typename I, typename D> + inline decorated_image<I,D>::decorated_image() { } template <typename I, typename D> + inline decorated_image<I,D>::decorated_image(I& ima, const D& deco) { this->data_ = new internal::data_< decorated_image<I,D> >(ima, deco); } template <typename I, typename D> + inline decorated_image<I,D>::~decorated_image() { void (D::*mr)(const I&, const mln_psite(I)&) const = & D::reading; @@ -168,6 +172,7 @@ namespace mln { template <typename I, typename E> + inline void decorated_image_impl_<I,E>::write_(const mln_psite(I)& p, const mln_value(I)& v) { @@ -179,6 +184,7 @@ namespace mln } // end of namespace mln::internal template <typename I, typename D> + inline mln_value(I) decorated_image<I,D>::read_(const mln_psite(I)& p) const { @@ -187,6 +193,7 @@ namespace mln } template <typename I, typename D> + inline decorated_image<I,D>::operator decorated_image<const I, D>() const { decorated_image<const I, D> tmp(this->data_->ima_, this->data_->deco_); @@ -195,6 +202,7 @@ namespace mln template <typename I, typename D> + inline const D& decorated_image<I,D>::decoration() const { @@ -202,6 +210,7 @@ namespace mln } template <typename I, typename D> + inline D& decorated_image<I,D>::decoration() { @@ -211,6 +220,7 @@ namespace mln // decorate template <typename I, typename D> + inline decorated_image<I, D> decorate(Image<I>& ima, const D& decoration) { @@ -219,6 +229,7 @@ namespace mln } template <typename I, typename D> + inline decorated_image<const I, D> decorate(const Image<I>& ima, const D& decoration) { diff --git a/milena/mln/core/dpoint.hh b/milena/mln/core/dpoint.hh index 288a0ec..14aa11f 100644 --- a/milena/mln/core/dpoint.hh +++ b/milena/mln/core/dpoint.hh @@ -128,6 +128,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename M, typename C> + inline C dpoint_<M,C>::operator[](unsigned i) const { assert(i < dim); @@ -135,6 +136,7 @@ namespace mln } template <typename M, typename C> + inline C& dpoint_<M,C>::operator[](unsigned i) { assert(i < dim); @@ -142,11 +144,13 @@ namespace mln } template <typename M, typename C> + inline dpoint_<M,C>::dpoint_() { } template <typename M, typename C> + inline dpoint_<M,C>::dpoint_(C ind) { metal::bool_<(dim == 1)>::check(); @@ -154,6 +158,7 @@ namespace mln } template <typename M, typename C> + inline dpoint_<M,C>::dpoint_(C row, C col) { metal::bool_<(dim == 2)>::check(); @@ -162,6 +167,7 @@ namespace mln } template <typename M, typename C> + inline dpoint_<M,C>::dpoint_(C sli, C row, C col) { metal::bool_<(dim == 3)>::check(); @@ -171,12 +177,14 @@ namespace mln } template <typename M, typename C> + inline dpoint_<M,C>::dpoint_(const literal::zero_t&) { coord_.set_all(0); } template <typename M, typename C> + inline dpoint_<M,C>& dpoint_<M,C>::operator=(const literal::zero_t&) { @@ -185,6 +193,7 @@ namespace mln } template <typename M, typename C> + inline dpoint_<M,C>::dpoint_(const literal::one_t&) { metal::bool_<(dim == 1)>::check(); @@ -192,6 +201,7 @@ namespace mln } template <typename M, typename C> + inline dpoint_<M,C>& dpoint_<M,C>::operator=(const literal::one_t&) { @@ -202,6 +212,7 @@ namespace mln template <typename M, typename C> template <typename F> + inline dpoint_<M,C>::dpoint_(const Function_i2v<F>& f_) { mlc_converts_to(mln_result(F), C)::check(); @@ -211,6 +222,7 @@ namespace mln } template <typename M, typename C> + inline void dpoint_<M,C>::set_all(C c) { for (unsigned i = 0; i < dim; ++i) @@ -219,12 +231,14 @@ namespace mln template <typename M, typename C> template <typename Q> + inline dpoint_<M,C>::operator metal::vec<M::dim, Q> () const { return coord_; } template <typename M, typename C> + inline metal::vec<M::dim, C> dpoint_<M,C>::to_vec() const { diff --git a/milena/mln/core/dpoints_piter.hh b/milena/mln/core/dpoints_piter.hh index c76fb3d..0fa8ce6 100644 --- a/milena/mln/core/dpoints_piter.hh +++ b/milena/mln/core/dpoints_piter.hh @@ -162,6 +162,7 @@ namespace mln template <typename D> template <typename Dps, typename Pref> + inline dpoints_fwd_piter<D>::dpoints_fwd_piter(const Dps& dps, const Point_Site<Pref>& p_ref) : dps_(exact(dps).vect()), @@ -171,6 +172,7 @@ namespace mln } template <typename D> + inline dpoints_fwd_piter<D>::operator mln_point(D) () const { mln_precondition(is_valid()); @@ -178,6 +180,7 @@ namespace mln } template <typename D> + inline const mln_point(D)& dpoints_fwd_piter<D>::to_point() const { @@ -185,6 +188,7 @@ namespace mln } template <typename D> + inline bool dpoints_fwd_piter<D>::is_valid() const { @@ -192,6 +196,7 @@ namespace mln } template <typename D> + inline void dpoints_fwd_piter<D>::invalidate() { @@ -199,6 +204,7 @@ namespace mln } template <typename D> + inline void dpoints_fwd_piter<D>::start() { @@ -207,6 +213,7 @@ namespace mln } template <typename D> + inline void dpoints_fwd_piter<D>::next_() { @@ -215,6 +222,7 @@ namespace mln } template <typename D> + inline const mln_point(D)& dpoints_fwd_piter<D>::center_point() const { @@ -222,6 +230,7 @@ namespace mln } template <typename D> + inline void dpoints_fwd_piter<D>::update() { @@ -230,6 +239,7 @@ namespace mln } template <typename D> + inline mln_coord(D) dpoints_fwd_piter<D>::operator[](unsigned i) const { @@ -248,6 +258,7 @@ namespace mln template <typename D> template <typename Dps, typename Pref> + inline dpoints_bkd_piter<D>::dpoints_bkd_piter(const Dps& dps, const Point_Site<Pref>& p_ref) : dps_(exact(dps).vect()), @@ -257,6 +268,7 @@ namespace mln } template <typename D> + inline dpoints_bkd_piter<D>::operator mln_point(D) () const { mln_precondition(is_valid()); @@ -264,6 +276,7 @@ namespace mln } template <typename D> + inline const mln_point(D)& dpoints_bkd_piter<D>::to_point() const { @@ -271,6 +284,7 @@ namespace mln } template <typename D> + inline bool dpoints_bkd_piter<D>::is_valid() const { @@ -280,6 +294,7 @@ namespace mln } template <typename D> + inline void dpoints_bkd_piter<D>::invalidate() { @@ -287,6 +302,7 @@ namespace mln } template <typename D> + inline void dpoints_bkd_piter<D>::start() { @@ -295,6 +311,7 @@ namespace mln } template <typename D> + inline void dpoints_bkd_piter<D>::next_() { @@ -303,6 +320,7 @@ namespace mln } template <typename D> + inline const mln_point(D)& dpoints_bkd_piter<D>::center_point() const { @@ -310,6 +328,7 @@ namespace mln } template <typename D> + inline void dpoints_bkd_piter<D>::update() { @@ -318,6 +337,7 @@ namespace mln } template <typename D> + inline mln_coord(D) dpoints_bkd_piter<D>::operator[](unsigned i) const { diff --git a/milena/mln/core/dpoints_pixter.hh b/milena/mln/core/dpoints_pixter.hh index 3fbad2a..3c66fc1 100644 --- a/milena/mln/core/dpoints_pixter.hh +++ b/milena/mln/core/dpoints_pixter.hh @@ -127,6 +127,7 @@ namespace mln template <typename I> template <typename Dps, typename Pref> + inline dpoints_fwd_pixter<I>::dpoints_fwd_pixter(I& image, const Dps& dps, const Point_Site<Pref>& p_ref) @@ -140,6 +141,7 @@ namespace mln template <typename I> template <typename Dps, typename Pref> + inline dpoints_fwd_pixter<I>::dpoints_fwd_pixter(const Generalized_Pixel<Pref>& pxl_ref_, const Dps& dps) : super_(internal::force_exact<Pref>(pxl_ref_).ima()) @@ -153,6 +155,7 @@ namespace mln } template <typename I> + inline const mln_value(I)& dpoints_fwd_pixter<I>::center_val() const { @@ -165,6 +168,7 @@ namespace mln template <typename I> template <typename Dps> + inline void dpoints_fwd_pixter<I>::init_(const Dps& dps) { @@ -179,6 +183,7 @@ namespace mln } template <typename I> + inline void dpoints_fwd_pixter<I>::update() { @@ -192,6 +197,7 @@ namespace mln } template <typename I> + inline void dpoints_fwd_pixter<I>::start() { @@ -200,6 +206,7 @@ namespace mln } template <typename I> + inline void dpoints_fwd_pixter<I>::next_() { @@ -208,6 +215,7 @@ namespace mln } template <typename I> + inline bool dpoints_fwd_pixter<I>::is_valid() const { @@ -215,6 +223,7 @@ namespace mln } template <typename I> + inline void dpoints_fwd_pixter<I>::invalidate() { diff --git a/milena/mln/core/exact.hh b/milena/mln/core/exact.hh index 3e8bb39..d967952 100644 --- a/milena/mln/core/exact.hh +++ b/milena/mln/core/exact.hh @@ -67,6 +67,7 @@ namespace mln // exact template <typename T> + inline typename internal::exact_<T>::ret* exact(T* ptr) { @@ -74,6 +75,7 @@ namespace mln } template <typename T> + inline typename internal::exact_<T>::ret& exact(T& ref) { diff --git a/milena/mln/core/h_mat.hh b/milena/mln/core/h_mat.hh index 76e182f..46a7239 100644 --- a/milena/mln/core/h_mat.hh +++ b/milena/mln/core/h_mat.hh @@ -60,12 +60,14 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <unsigned d, typename T> + inline h_mat<d,T>::h_mat() : metal::mat<d+1, d+1, T>(metal::mat<d+1, d+1, T>::Id) { } template <unsigned d, typename T> + inline h_mat<d,T>::h_mat(const metal::mat<d+1, d+1, T>& x) : metal::mat<d+1, d+1, T>(x) { diff --git a/milena/mln/core/h_vec.hh b/milena/mln/core/h_vec.hh index b62f511..fdd2a63 100644 --- a/milena/mln/core/h_vec.hh +++ b/milena/mln/core/h_vec.hh @@ -107,17 +107,20 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <unsigned d, typename C> + inline h_vec<d,C>::h_vec() { } template <unsigned d, typename C> + inline h_vec<d,C>::h_vec(const metal::vec<d+1, C>& other) : metal::vec<d+1, C>(other) { } template <unsigned d, typename C> + inline h_vec<d,C>& h_vec<d,C>::operator=(const metal::vec<d+1, C>& rhs) { if (& rhs == this) @@ -131,6 +134,7 @@ namespace mln // Immersion of a vector in its homogeneous space. template <unsigned n, typename T> + inline h_vec<n, T> vec<n,T>::to_h_vec() const { h_vec<n, T> tmp; @@ -144,6 +148,7 @@ namespace mln template <unsigned d, typename C> + inline metal::vec<d,C> h_vec<d,C>::to_vec() const { const C w = this->data_[d]; diff --git a/milena/mln/core/hexa.hh b/milena/mln/core/hexa.hh index 1211e24..8d48ad9 100644 --- a/milena/mln/core/hexa.hh +++ b/milena/mln/core/hexa.hh @@ -174,6 +174,7 @@ namespace mln // init_ template <typename I, typename J> + inline void init_(tag::image_t, hexa<I>& target, const J& model) { I ima; @@ -189,6 +190,7 @@ namespace mln { template <typename I> + inline data_< hexa<I> >::data_(I& ima, box2d_h b) : ima_(ima), b_(b) @@ -199,6 +201,7 @@ namespace mln template <typename I> + inline void hexa<I>::init_(I& ima) { @@ -211,18 +214,21 @@ namespace mln template <typename I> + inline hexa<I>::hexa() { } template <typename I> + inline hexa<I>::hexa(I& ima) { this->init_(ima); } template <typename I> + inline typename hexa<I>::rvalue hexa<I>::operator()(const point2d_h& p) const { @@ -232,6 +238,7 @@ namespace mln } template <typename I> + inline typename hexa<I>::lvalue hexa<I>::operator()(const point2d_h& p) { @@ -241,6 +248,7 @@ namespace mln } template <typename I> + inline const box2d_h& hexa<I>::domain() const { @@ -249,6 +257,7 @@ namespace mln } template <typename I> + inline bool hexa<I>::has(const psite& p) const { @@ -258,6 +267,7 @@ namespace mln template <typename I> + inline bool hexa<I>::owns_(const psite& p) const { diff --git a/milena/mln/core/hexa_piter.hh b/milena/mln/core/hexa_piter.hh index 9d0e619..2e0c998 100644 --- a/milena/mln/core/hexa_piter.hh +++ b/milena/mln/core/hexa_piter.hh @@ -93,6 +93,7 @@ namespace mln // hexa_fwd_piter_<I> template <typename S> + inline hexa_fwd_piter_<S>::hexa_fwd_piter_(const box2d_h& b) : super_(adaptee_(box_adaptee_)) @@ -104,6 +105,7 @@ namespace mln } template <typename S> + inline void hexa_fwd_piter_<S>::start() { @@ -113,6 +115,7 @@ namespace mln } template <typename S> + inline void hexa_fwd_piter_<S>::next_() { @@ -122,6 +125,7 @@ namespace mln } template <typename S> + inline hexa_fwd_piter_<S>::operator point2d_h() const { return p_; diff --git a/milena/mln/core/image1d.hh b/milena/mln/core/image1d.hh index 626b0d2..c2a7b40 100644 --- a/milena/mln/core/image1d.hh +++ b/milena/mln/core/image1d.hh @@ -222,12 +222,14 @@ namespace mln // init_ template <typename T> + inline void init_(tag::border_t, unsigned& b, const image1d<T>& model) { b = model.border(); } template <typename T, typename J> + inline void init_(tag::image_t, image1d<T>& target, const J& model) { box1d b; @@ -243,6 +245,7 @@ namespace mln { template <typename T> + inline data_< image1d<T> >::data_(const box1d& b, unsigned bdr) : buffer_(0), array_ (0), @@ -253,12 +256,14 @@ namespace mln } template <typename T> + inline data_< image1d<T> >::~data_() { deallocate_(); } template <typename T> + inline void data_< image1d<T> >::update_vb_() { @@ -267,6 +272,7 @@ namespace mln } template <typename T> + inline void data_< image1d<T> >::allocate_() { @@ -279,6 +285,7 @@ namespace mln } template <typename T> + inline void data_< image1d<T> >::deallocate_() { @@ -291,6 +298,7 @@ namespace mln template <typename T> + inline void data_< image1d<T> >::swap_(data_< image1d<T> >& other_) { @@ -302,6 +310,7 @@ namespace mln } template <typename T> + inline void data_< image1d<T> >::reallocate_(unsigned new_border) { @@ -315,17 +324,20 @@ namespace mln // image1d<T> template <typename T> + inline image1d<T>::image1d() { } template <typename T> + inline image1d<T>::image1d(const box1d& b, unsigned bdr) { init_(b, bdr); } template <typename T> + inline image1d<T>::image1d(unsigned ninds, unsigned bdr) { mln_precondition(ninds != 0); @@ -333,6 +345,7 @@ namespace mln } template <typename T> + inline void image1d<T>::init_(const box1d& b, unsigned bdr) { @@ -341,6 +354,7 @@ namespace mln } template <typename T> + inline const typename image1d<T>::vset& image1d<T>::values() const { @@ -348,6 +362,7 @@ namespace mln } template <typename T> + inline const box1d& image1d<T>::domain() const { @@ -356,6 +371,7 @@ namespace mln } template <typename T> + inline unsigned image1d<T>::border() const { @@ -364,6 +380,7 @@ namespace mln } template <typename T> + inline std::size_t image1d<T>::ncells() const { @@ -372,6 +389,7 @@ namespace mln } template <typename T> + inline bool image1d<T>::owns_(const point1d& p) const { @@ -380,6 +398,7 @@ namespace mln } template <typename T> + inline const T& image1d<T>::operator()(const point1d& p) const { @@ -388,6 +407,7 @@ namespace mln } template <typename T> + inline T& image1d<T>::operator()(const point1d& p) { @@ -396,6 +416,7 @@ namespace mln } template <typename T> + inline const T& image1d<T>::operator[](unsigned o) const { @@ -404,6 +425,7 @@ namespace mln } template <typename T> + inline T& image1d<T>::operator[](unsigned o) { @@ -412,6 +434,7 @@ namespace mln } template <typename T> + inline const T& image1d<T>::at(int ind) const { @@ -420,6 +443,7 @@ namespace mln } template <typename T> + inline T& image1d<T>::at(int ind) { @@ -428,6 +452,7 @@ namespace mln } template <typename T> + inline const T* image1d<T>::buffer() const { @@ -436,6 +461,7 @@ namespace mln } template <typename T> + inline T* image1d<T>::buffer() { @@ -444,6 +470,7 @@ namespace mln } template <typename T> + inline int image1d<T>::offset(const dpoint1d& dp) const { @@ -453,6 +480,7 @@ namespace mln } template <typename T> + inline point1d image1d<T>::point_at_offset(unsigned o) const { @@ -463,6 +491,7 @@ namespace mln } template <typename T> + inline void image1d<T>::resize_(unsigned new_border) { diff --git a/milena/mln/core/image2d.hh b/milena/mln/core/image2d.hh index be21efe..91c3375 100644 --- a/milena/mln/core/image2d.hh +++ b/milena/mln/core/image2d.hh @@ -229,12 +229,14 @@ namespace mln // init_ template <typename T> + inline void init_(tag::border_t, unsigned& bdr, const image2d<T>& model) { bdr = model.border(); } template <typename T, typename J> + inline void init_(tag::image_t, image2d<T>& target, const J& model) { box2d b; @@ -250,6 +252,7 @@ namespace mln namespace internal { template <typename T> + inline data_< image2d<T> >::data_(const box2d& b, unsigned bdr) : buffer_(0), array_ (0), @@ -260,12 +263,14 @@ namespace mln } template <typename T> + inline data_< image2d<T> >::~data_() { deallocate_(); } template <typename T> + inline void data_< image2d<T> >::update_vb_() { @@ -274,6 +279,7 @@ namespace mln } template <typename T> + inline void data_< image2d<T> >::allocate_() { @@ -295,6 +301,7 @@ namespace mln } template <typename T> + inline void data_< image2d<T> >::deallocate_() { @@ -312,6 +319,7 @@ namespace mln } template <typename T> + inline void data_< image2d<T> >::swap_(data_< image2d<T> >& other_) { @@ -321,6 +329,7 @@ namespace mln } template <typename T> + inline void data_< image2d<T> >::reallocate_(unsigned new_border) { @@ -335,23 +344,27 @@ namespace mln // image2d<T> template <typename T> + inline image2d<T>::image2d() { } template <typename T> + inline image2d<T>::image2d(int nrows, int ncols, unsigned bdr) { init_(make::box2d(nrows, ncols), bdr); } template <typename T> + inline image2d<T>::image2d(const box2d& b, unsigned bdr) { init_(b, bdr); } template <typename T> + inline void image2d<T>::init_(const box2d& b, unsigned bdr) { @@ -360,6 +373,7 @@ namespace mln } template <typename T> + inline const typename image2d<T>::vset& image2d<T>::values() const { @@ -367,6 +381,7 @@ namespace mln } template <typename T> + inline const box2d& image2d<T>::domain() const { @@ -375,6 +390,7 @@ namespace mln } template <typename T> + inline unsigned image2d<T>::border() const { @@ -383,6 +399,7 @@ namespace mln } template <typename T> + inline std::size_t image2d<T>::ncells() const { @@ -391,6 +408,7 @@ namespace mln } template <typename T> + inline bool image2d<T>::owns_(const point2d& p) const { @@ -399,6 +417,7 @@ namespace mln } template <typename T> + inline const T& image2d<T>::operator()(const point2d& p) const { @@ -407,6 +426,7 @@ namespace mln } template <typename T> + inline T& image2d<T>::operator()(const point2d& p) { @@ -415,6 +435,7 @@ namespace mln } template <typename T> + inline const T& image2d<T>::operator[](unsigned o) const { @@ -423,6 +444,7 @@ namespace mln } template <typename T> + inline T& image2d<T>::operator[](unsigned o) { @@ -431,6 +453,7 @@ namespace mln } template <typename T> + inline const T& image2d<T>::at(int row, int col) const { @@ -439,6 +462,7 @@ namespace mln } template <typename T> + inline T& image2d<T>::at(int row, int col) { @@ -447,6 +471,7 @@ namespace mln } template <typename T> + inline const T* image2d<T>::buffer() const { @@ -455,6 +480,7 @@ namespace mln } template <typename T> + inline T* image2d<T>::buffer() { @@ -463,6 +489,7 @@ namespace mln } template <typename T> + inline int image2d<T>::offset(const dpoint2d& dp) const { @@ -472,6 +499,7 @@ namespace mln } template <typename T> + inline point2d image2d<T>::point_at_offset(unsigned o) const { @@ -483,6 +511,7 @@ namespace mln } template <typename T> + inline void image2d<T>::resize_(unsigned new_border) { diff --git a/milena/mln/core/image2d_h.hh b/milena/mln/core/image2d_h.hh index 8474c9c..e299cd4 100644 --- a/milena/mln/core/image2d_h.hh +++ b/milena/mln/core/image2d_h.hh @@ -76,6 +76,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename V> + inline image2d_h<V>::image2d_h(int nrows, int ncols, unsigned bdr) { // numbers of cols can't be odd. diff --git a/milena/mln/core/image3d.hh b/milena/mln/core/image3d.hh index 972e645..b09304a 100644 --- a/milena/mln/core/image3d.hh +++ b/milena/mln/core/image3d.hh @@ -232,12 +232,14 @@ namespace mln // init_ template <typename T> + inline void init_(tag::border_t, unsigned& b, const image3d<T>& model) { b = model.border(); } template <typename T, typename J> + inline void init_(tag::image_t, image3d<T>& target, const J& model) { box3d b; @@ -254,6 +256,7 @@ namespace mln { template <typename T> + inline data_< image3d<T> >::data_(const box3d& b, unsigned bdr) : buffer_(0), array_ (0), @@ -264,12 +267,14 @@ namespace mln } template <typename T> + inline data_< image3d<T> >::~data_() { deallocate_(); } template <typename T> + inline void data_< image3d<T> >::update_vb_() { @@ -278,6 +283,7 @@ namespace mln } template <typename T> + inline void data_< image3d<T> >::allocate_() { @@ -305,6 +311,7 @@ namespace mln } template <typename T> + inline void data_< image3d<T> >::deallocate_() { @@ -331,6 +338,7 @@ namespace mln } template <typename T> + inline void data_< image3d<T> >::swap_(data_< image3d<T> >& other_) { @@ -340,6 +348,7 @@ namespace mln } template <typename T> + inline void data_< image3d<T> >::reallocate_(unsigned new_border) { @@ -353,23 +362,27 @@ namespace mln // image3d<T> template <typename T> + inline image3d<T>::image3d() { } template <typename T> + inline image3d<T>::image3d(const box3d& b, unsigned bdr) { init_(b, bdr); } template <typename T> + inline image3d<T>::image3d(int nslis, int nrows, int ncols, unsigned bdr) { init_(make::box3d(nslis, nrows, ncols), bdr); } template <typename T> + inline void image3d<T>::init_(const box3d& b, unsigned bdr) { @@ -378,6 +391,7 @@ namespace mln } template <typename T> + inline const typename image3d<T>::vset& image3d<T>::values() const { @@ -385,6 +399,7 @@ namespace mln } template <typename T> + inline const box3d& image3d<T>::domain() const { @@ -393,6 +408,7 @@ namespace mln } template <typename T> + inline unsigned image3d<T>::border() const { @@ -401,6 +417,7 @@ namespace mln } template <typename T> + inline std::size_t image3d<T>::ncells() const { @@ -409,6 +426,7 @@ namespace mln } template <typename T> + inline bool image3d<T>::owns_(const point3d& p) const { @@ -417,6 +435,7 @@ namespace mln } template <typename T> + inline const T& image3d<T>::operator()(const point3d& p) const { @@ -425,6 +444,7 @@ namespace mln } template <typename T> + inline T& image3d<T>::operator()(const point3d& p) { @@ -433,6 +453,7 @@ namespace mln } template <typename T> + inline const T& image3d<T>::operator[](unsigned o) const { @@ -441,6 +462,7 @@ namespace mln } template <typename T> + inline T& image3d<T>::operator[](unsigned o) { @@ -449,6 +471,7 @@ namespace mln } template <typename T> + inline const T& image3d<T>::at(int sli, int row, int col) const { @@ -457,6 +480,7 @@ namespace mln } template <typename T> + inline T& image3d<T>::at(int sli, int row, int col) { @@ -465,6 +489,7 @@ namespace mln } template <typename T> + inline const T* image3d<T>::buffer() const { @@ -473,6 +498,7 @@ namespace mln } template <typename T> + inline T* image3d<T>::buffer() { @@ -481,6 +507,7 @@ namespace mln } template <typename T> + inline int image3d<T>::offset(const dpoint3d& dp) const { @@ -490,6 +517,7 @@ namespace mln } template <typename T> + inline point3d image3d<T>::point_at_offset(unsigned o) const { @@ -502,6 +530,7 @@ namespace mln } template <typename T> + inline void image3d<T>::resize_(unsigned new_border) { diff --git a/milena/mln/core/image_if.hh b/milena/mln/core/image_if.hh index 5eab267..0808d8a 100644 --- a/milena/mln/core/image_if.hh +++ b/milena/mln/core/image_if.hh @@ -139,6 +139,7 @@ namespace mln { template <typename I, typename F> + inline data_< image_if<I,F> >::data_(I& ima, const F& f) : data_< Super >(ima, f) { @@ -149,17 +150,20 @@ namespace mln // image_if<I,F> template <typename I, typename F> + inline image_if<I,F>::image_if() { } template <typename I, typename F> + inline image_if<I,F>::image_if(I& ima, const F& f) { this->init_(ima, f); } template <typename I, typename F> + inline image_if<I,F>::operator image_if<const I,F>() const { mln_precondition(this->has_data()); @@ -171,6 +175,7 @@ namespace mln // Operators. template <typename I, typename F> + inline image_if<I,F> operator | (Image<I>& ima, const Function_p2b<F>& f) { @@ -179,6 +184,7 @@ namespace mln } template <typename I, typename F> + inline image_if<const I, F> operator | (const Image<I>& ima, const Function_p2b<F>& f) { diff --git a/milena/mln/core/image_if_interval.hh b/milena/mln/core/image_if_interval.hh index 7c7f6c4..3872148 100644 --- a/milena/mln/core/image_if_interval.hh +++ b/milena/mln/core/image_if_interval.hh @@ -128,17 +128,20 @@ namespace mln // image_if_interval<I> template <typename I> + inline image_if_interval<I>::image_if_interval() { } template <typename I> + inline image_if_interval<I>::image_if_interval(I& ima, const F& f) { this->init_(ima, f); } template <typename I> + inline image_if_interval<I>::image_if_interval(I& ima, const value::interval_<mln_value(I)>& vv) { this->init_(ima, (pw::value(ima) >= pw::cst(vv.from)) @@ -146,6 +149,7 @@ namespace mln } template <typename I> + inline image_if_interval<I>::operator image_if_interval<const I>() const { image_if_interval<const I> tmp(this->data_->ima_, this->data_->pset_); @@ -158,6 +162,7 @@ namespace mln { template <typename I> + inline data_< image_if_interval<I> >::data_(I& ima, const F& f) : data_< Super >(ima, f) { @@ -169,6 +174,7 @@ namespace mln template <typename I> + inline image_if_interval<I> operator | (Image<I>& ima, const value::interval_<mln_value(I)>& vv) { @@ -177,6 +183,7 @@ namespace mln } template <typename I> + inline image_if_interval<const I> operator | (const Image<I>& ima, const value::interval_<mln_value(I)>& vv) { diff --git a/milena/mln/core/image_if_value.hh b/milena/mln/core/image_if_value.hh index 3022e28..ee6c2d1 100644 --- a/milena/mln/core/image_if_value.hh +++ b/milena/mln/core/image_if_value.hh @@ -142,23 +142,27 @@ namespace mln // image_if_value<I> template <typename I> + inline image_if_value<I>::image_if_value() { } template <typename I> + inline image_if_value<I>::image_if_value(I& ima, const F& f) { this->init_(ima, f); } template <typename I> + inline image_if_value<I>::image_if_value(I& ima, const mln_value(I)& v) { this->init_(ima, pw::value(ima) == pw::cst(v)); } template <typename I> + inline image_if_value<I>::operator image_if_value<const I>() const { mln_precondition(this->has_data()); @@ -173,6 +177,7 @@ namespace mln { template <typename I> + inline data_< image_if_value<I> >::data_(I& ima, const F& f) : data_< Super >(ima, f) { @@ -183,6 +188,7 @@ namespace mln // Operators. template <typename I> + inline image_if_value<I> operator | (Image<I>& ima, const mln_value(I)& v) { @@ -191,6 +197,7 @@ namespace mln } template <typename I> + inline image_if_value<const I> operator | (const Image<I>& ima, const mln_value(I)& v) { diff --git a/milena/mln/core/init.hh b/milena/mln/core/init.hh index 0a9d301..ea9dde5 100644 --- a/milena/mln/core/init.hh +++ b/milena/mln/core/init.hh @@ -66,6 +66,7 @@ namespace mln template <typename Subject, typename T, typename M> + inline void init_(Subject, T&, const Object<M>&) { struct ERROR err_; // FIXME: Explicit msg. @@ -74,12 +75,14 @@ namespace mln // Easy impl. template <typename B, typename I> + inline void init_(tag::bbox_t, B& b, const Image<I>& ima) { b = geom::bbox(ima); } template <typename I> + inline void init_(tag::border_t, unsigned& bdr, const Image<I>& ima) { // 'Find' means that we want a value; this is not always the @@ -89,6 +92,7 @@ namespace mln } template <typename I> + inline void init_(tag::domain_t, mln_pset(I)& pset, const Image<I>& ima) { pset = exact(ima).domain(); diff --git a/milena/mln/core/inplace.hh b/milena/mln/core/inplace.hh index f3b551d..f1b6089 100644 --- a/milena/mln/core/inplace.hh +++ b/milena/mln/core/inplace.hh @@ -52,6 +52,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename E> + inline E& inplace(const Object<E>& temp) { return const_cast<E&>( exact(temp) ); diff --git a/milena/mln/core/internal/box_impl.hh b/milena/mln/core/internal/box_impl.hh index 0cfc585..f2480f1 100644 --- a/milena/mln/core/internal/box_impl.hh +++ b/milena/mln/core/internal/box_impl.hh @@ -127,54 +127,63 @@ namespace mln // 3 template <typename C, typename E> + inline unsigned box_impl_<3, C, E>::nslis() const { return internal::force_exact<E>(*this).bbox().len(0); } template <typename C, typename E> + inline C box_impl_<3, C, E>::min_sli() const { return internal::force_exact<E>(*this).bbox().pmin()[0]; } template <typename C, typename E> + inline C box_impl_<3, C, E>::max_sli() const { return internal::force_exact<E>(*this).bbox().pmax()[0]; } template <typename C, typename E> + inline unsigned box_impl_<3, C, E>::nrows() const { return internal::force_exact<E>(*this).bbox().len(1); } template <typename C, typename E> + inline C box_impl_<3, C, E>::min_row() const { return internal::force_exact<E>(*this).bbox().pmin()[1]; } template <typename C, typename E> + inline C box_impl_<3, C, E>::max_row() const { return internal::force_exact<E>(*this).bbox().pmax()[1]; } template <typename C, typename E> + inline unsigned box_impl_<3, C, E>::ncols() const { return internal::force_exact<E>(*this).bbox().len(2); } template <typename C, typename E> + inline C box_impl_<3, C, E>::min_col() const { return internal::force_exact<E>(*this).bbox().pmin()[2]; } template <typename C, typename E> + inline C box_impl_<3, C, E>::max_col() const { return internal::force_exact<E>(*this).bbox().pmax()[2]; @@ -184,36 +193,42 @@ namespace mln // 2 template <typename C, typename E> + inline unsigned box_impl_<2, C, E>::nrows() const { return internal::force_exact<E>(*this).bbox().len(0); } template <typename C, typename E> + inline C box_impl_<2, C, E>::min_row() const { return internal::force_exact<E>(*this).bbox().pmin()[0]; } template <typename C, typename E> + inline C box_impl_<2, C, E>::max_row() const { return internal::force_exact<E>(*this).bbox().pmax()[0]; } template <typename C, typename E> + inline unsigned box_impl_<2, C, E>::ncols() const { return internal::force_exact<E>(*this).bbox().len(1); } template <typename C, typename E> + inline C box_impl_<2, C, E>::min_col() const { return internal::force_exact<E>(*this).bbox().pmin()[1]; } template <typename C, typename E> + inline C box_impl_<2, C, E>::max_col() const { return internal::force_exact<E>(*this).bbox().pmax()[1]; @@ -222,18 +237,21 @@ namespace mln // 1 template <typename C, typename E> + inline unsigned box_impl_<1, C, E>::ninds() const { return internal::force_exact<E>(*this).bbox().len(0); } template <typename C, typename E> + inline C box_impl_<1, C, E>::min_ind() const { return internal::force_exact<E>(*this).bbox().pmin()[0]; } template <typename C, typename E> + inline C box_impl_<1, C, E>::max_ind() const { return internal::force_exact<E>(*this).bbox().pmax()[0]; diff --git a/milena/mln/core/internal/check/image_fastest.hh b/milena/mln/core/internal/check/image_fastest.hh index 7cbe57e..e6b7ecd 100644 --- a/milena/mln/core/internal/check/image_fastest.hh +++ b/milena/mln/core/internal/check/image_fastest.hh @@ -80,6 +80,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename E, typename B> + inline image_fastest_<E,B>::image_fastest_() { typedef mln_point(E) point; @@ -118,6 +119,7 @@ namespace mln template <typename E, typename B> template <typename P> + inline unsigned // FIXME: std::size_t? image_fastest_<E,B>::offset_at(const Point_Site<P>& p_) const { diff --git a/milena/mln/core/internal/coord_impl.hh b/milena/mln/core/internal/coord_impl.hh index 67abf20..436dbde 100644 --- a/milena/mln/core/internal/coord_impl.hh +++ b/milena/mln/core/internal/coord_impl.hh @@ -117,6 +117,7 @@ namespace mln // 1 template <typename C, typename E> + inline C coord_impl_<1, C, E>::ind() const { return internal::force_exact<E>(*this)[0]; @@ -125,12 +126,14 @@ namespace mln // 2 template <typename C, typename E> + inline C coord_impl_<2, C, E>::row() const { return internal::force_exact<E>(*this)[0]; } template <typename C, typename E> + inline C coord_impl_<2, C, E>::col() const { return internal::force_exact<E>(*this)[1]; @@ -139,18 +142,21 @@ namespace mln // 3 template <typename C, typename E> + inline C coord_impl_<3, C, E>::sli() const { return internal::force_exact<E>(*this)[0]; } template <typename C, typename E> + inline C coord_impl_<3, C, E>::row() const { return internal::force_exact<E>(*this)[1]; } template <typename C, typename E> + inline C coord_impl_<3, C, E>::col() const { return internal::force_exact<E>(*this)[2]; @@ -162,12 +168,14 @@ namespace mln // 1 template <typename C, typename E> + inline C mutable_coord_impl_<1, C, E>::ind() const { return internal::force_exact<E>(*this)[0]; } template <typename C, typename E> + inline C& mutable_coord_impl_<1, C, E>::ind() { return internal::force_exact<E>(*this)[0]; @@ -176,24 +184,28 @@ namespace mln // 2 template <typename C, typename E> + inline C mutable_coord_impl_<2, C, E>::row() const { return internal::force_exact<E>(*this)[0]; } template <typename C, typename E> + inline C& mutable_coord_impl_<2, C, E>::row() { return internal::force_exact<E>(*this)[0]; } template <typename C, typename E> + inline C mutable_coord_impl_<2, C, E>::col() const { return internal::force_exact<E>(*this)[1]; } template <typename C, typename E> + inline C& mutable_coord_impl_<2, C, E>::col() { return internal::force_exact<E>(*this)[1]; @@ -202,36 +214,42 @@ namespace mln // 3 template <typename C, typename E> + inline C mutable_coord_impl_<3, C, E>::sli() const { return internal::force_exact<E>(*this)[0]; } template <typename C, typename E> + inline C& mutable_coord_impl_<3, C, E>::sli() { return internal::force_exact<E>(*this)[0]; } template <typename C, typename E> + inline C mutable_coord_impl_<3, C, E>::row() const { return internal::force_exact<E>(*this)[1]; } template <typename C, typename E> + inline C& mutable_coord_impl_<3, C, E>::row() { return internal::force_exact<E>(*this)[1]; } template <typename C, typename E> + inline C mutable_coord_impl_<3, C, E>::col() const { return internal::force_exact<E>(*this)[2]; } template <typename C, typename E> + inline C& mutable_coord_impl_<3, C, E>::col() { return internal::force_exact<E>(*this)[2]; diff --git a/milena/mln/core/internal/dpoints_base.hh b/milena/mln/core/internal/dpoints_base.hh index fd2e307..012f5fa 100644 --- a/milena/mln/core/internal/dpoints_base.hh +++ b/milena/mln/core/internal/dpoints_base.hh @@ -96,11 +96,13 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename D, typename E> + inline dpoints_base_<D,E>::dpoints_base_() { } template <typename D, typename E> + inline bool dpoints_base_<D,E>::is_centered() const { static const D origin = all_to(0); @@ -108,12 +110,14 @@ namespace mln } template <typename D, typename E> + inline bool dpoints_base_<D,E>::is_empty() const { return this->super_::is_empty(); } template <typename D, typename E> + inline unsigned dpoints_base_<D,E>::delta() const { unsigned d = 0; @@ -128,6 +132,7 @@ namespace mln } template <typename D, typename E> + inline unsigned dpoints_base_<D,E>::ndpoints() const { @@ -135,6 +140,7 @@ namespace mln } template <typename D, typename E> + inline const D& dpoints_base_<D,E>::dp(unsigned i) const { @@ -143,6 +149,7 @@ namespace mln } template <typename D, typename E> + inline const std::vector<D>& dpoints_base_<D,E>::vect() const { @@ -150,6 +157,7 @@ namespace mln } template <typename D, typename E> + inline bool dpoints_base_<D,E>::has(const D& dp) const { diff --git a/milena/mln/core/internal/exact.hh b/milena/mln/core/internal/exact.hh index 45a9b99..bd45f0f 100644 --- a/milena/mln/core/internal/exact.hh +++ b/milena/mln/core/internal/exact.hh @@ -102,12 +102,14 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename E, typename T> + inline E* exact_run_(Object<E>* t, T*) { return (E*)(void*)t; } template <typename T> + inline T* exact_run_(void*, T* t) { return t; diff --git a/milena/mln/core/internal/image_base.hh b/milena/mln/core/internal/image_base.hh index fa00e60..b85e1ec 100644 --- a/milena/mln/core/internal/image_base.hh +++ b/milena/mln/core/internal/image_base.hh @@ -170,11 +170,13 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename S, typename E> + inline image_base_<S,E>::image_base_() { } template <typename S, typename E> + inline image_base_<S,E>::image_base_(const image_base_& rhs) : image_checked_<E>() { @@ -183,6 +185,7 @@ namespace mln } template <typename S, typename E> + inline image_base_<S,E>& image_base_<S,E>::operator=(const image_base_<S,E>& rhs) { @@ -194,6 +197,7 @@ namespace mln } template <typename S, typename E> + inline bool image_base_<S,E>::has_data() const { @@ -201,6 +205,7 @@ namespace mln } template <typename S, typename E> + inline bool image_base_<S,E>::has(const psite& p) const { @@ -209,6 +214,7 @@ namespace mln } template <typename S, typename E> + inline bool image_base_<S,E>::owns_(const psite& p) const { @@ -217,6 +223,7 @@ namespace mln } template <typename S, typename E> + inline const box_<mln_point(S)>& image_base_<S,E>::bbox() const { @@ -225,6 +232,7 @@ namespace mln } template <typename S, typename E> + inline std::size_t image_base_<S,E>::npoints() const { @@ -233,6 +241,7 @@ namespace mln } template <typename S, typename E> + inline void image_base_<S,E>::destroy() { diff --git a/milena/mln/core/internal/image_domain_morpher.hh b/milena/mln/core/internal/image_domain_morpher.hh index af8e9af..4904977 100644 --- a/milena/mln/core/internal/image_domain_morpher.hh +++ b/milena/mln/core/internal/image_domain_morpher.hh @@ -84,11 +84,13 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I, typename S, typename E> + inline image_domain_morpher_<I,S,E>::image_domain_morpher_() { } template <typename I, typename S, typename E> + inline const mln_vset(I)& image_domain_morpher_<I,S,E>::values() const { @@ -97,6 +99,7 @@ namespace mln } template <typename I, typename S, typename E> + inline mln_rvalue(I) image_domain_morpher_<I,S,E>::operator()(const mln_psite(S)& p) const { @@ -105,6 +108,7 @@ namespace mln } template <typename I, typename S, typename E> + inline typename image_domain_morpher_<I,S,E>::lvalue image_domain_morpher_<I,S,E>::operator()(const mln_psite(S)& p) { diff --git a/milena/mln/core/internal/image_identity.hh b/milena/mln/core/internal/image_identity.hh index 2affab2..2fe39f9 100644 --- a/milena/mln/core/internal/image_identity.hh +++ b/milena/mln/core/internal/image_identity.hh @@ -90,11 +90,13 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I, typename S, typename E> + inline image_identity_<I,S,E>::image_identity_() { } template <typename I, typename S, typename E> + inline const mln_vset(I)& image_identity_<I,S,E>::values() const { @@ -103,6 +105,7 @@ namespace mln } template <typename I, typename S, typename E> + inline mln_rvalue(I) image_identity_<I,S,E>::operator()(const mln_psite(S)& p) const { @@ -111,6 +114,7 @@ namespace mln } template <typename I, typename S, typename E> + inline typename image_identity_<I,S,E>::lvalue image_identity_<I,S,E>::operator()(const mln_psite(S)& p) { @@ -119,6 +123,7 @@ namespace mln } template <typename I, typename S, typename E> + inline const mln_pset(I)& image_identity_<I,S,E>::domain() const { @@ -127,6 +132,7 @@ namespace mln } template <typename I, typename S, typename E> + inline bool image_identity_<I,S,E>::owns_(const mln_psite(I)& p) const { diff --git a/milena/mln/core/internal/image_if_base.hh b/milena/mln/core/internal/image_if_base.hh index 959b305..3087b85 100644 --- a/milena/mln/core/internal/image_if_base.hh +++ b/milena/mln/core/internal/image_if_base.hh @@ -144,6 +144,7 @@ namespace mln // internal::data_< image_if_base_<I,S> > template <typename I, typename F, typename E> + inline data_< image_if_base_<I,F,E> >::data_(I& ima, const F& f) : ima_(ima), pset_(ima.domain() | f) @@ -153,17 +154,20 @@ namespace mln // image_if_base_<I,F,E> template <typename I, typename F, typename E> + inline image_if_base_<I,F,E>::image_if_base_() { } template <typename I, typename F, typename E> + inline image_if_base_<I,F,E>::image_if_base_(I& ima, const F& f) { init_(ima, f); } template <typename I, typename F, typename E> + inline bool image_if_base_<I,F,E>::owns_(const mln_psite(I)& p) const { @@ -172,6 +176,7 @@ namespace mln } template <typename I, typename F, typename E> + inline void image_if_base_<I,F,E>::init_(I& ima, const F& f) { @@ -180,6 +185,7 @@ namespace mln } template <typename I, typename F, typename E> + inline const pset_if<mln_pset(I), F>& image_if_base_<I,F,E>::domain() const { diff --git a/milena/mln/core/internal/image_morpher.hh b/milena/mln/core/internal/image_morpher.hh index 4055bee..4730ac3 100644 --- a/milena/mln/core/internal/image_morpher.hh +++ b/milena/mln/core/internal/image_morpher.hh @@ -108,11 +108,13 @@ namespace mln { template <typename I, typename S, typename E> + inline image_morpher_<I,S,E>::image_morpher_() { } template <typename I, typename S, typename E> + inline mlc_const(I)* image_morpher_<I,S,E>::delegatee_() const { @@ -120,6 +122,7 @@ namespace mln } template <typename I, typename S, typename E> + inline I* image_morpher_<I,S,E>::delegatee_() { @@ -127,6 +130,7 @@ namespace mln } template <typename I, typename S, typename E> + inline image_morpher_<I,S,E>::operator I() const { mln_precondition(exact(this)->has_data()); @@ -134,6 +138,7 @@ namespace mln } template <typename I, typename S, typename E> + inline bool image_morpher_<I,S,E>::has_data() const { @@ -159,6 +164,7 @@ namespace mln template <typename Subject, typename T, typename J> + inline void init_(Subject s, T& target, const Image<J>& model_) { // FIXME: Precondition. diff --git a/milena/mln/core/internal/image_primary.hh b/milena/mln/core/internal/image_primary.hh index 9afd696..eb5d430 100644 --- a/milena/mln/core/internal/image_primary.hh +++ b/milena/mln/core/internal/image_primary.hh @@ -58,6 +58,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename S, typename E> + inline image_primary_<S,E>::image_primary_() { } diff --git a/milena/mln/core/internal/image_value_morpher.hh b/milena/mln/core/internal/image_value_morpher.hh index d115e37..bb66230 100644 --- a/milena/mln/core/internal/image_value_morpher.hh +++ b/milena/mln/core/internal/image_value_morpher.hh @@ -65,11 +65,13 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I, typename E> + inline image_value_morpher_<I,E>::image_value_morpher_() { } template <typename I, typename E> + inline const mln_pset(I)& image_value_morpher_<I,E>::domain() const { @@ -78,6 +80,7 @@ namespace mln } template <typename I, typename E> + inline bool image_value_morpher_<I,E>::owns_(const mln_psite(I)& p) const { diff --git a/milena/mln/core/internal/piter_adaptor.hh b/milena/mln/core/internal/piter_adaptor.hh index 6561344..0d982f0 100644 --- a/milena/mln/core/internal/piter_adaptor.hh +++ b/milena/mln/core/internal/piter_adaptor.hh @@ -92,6 +92,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename Pi, typename E> + inline piter_adaptor_<Pi,E>::piter_adaptor_(const Pi& piter) : piter_(piter) { @@ -99,12 +100,14 @@ namespace mln } template <typename Pi, typename E> + inline piter_adaptor_<Pi,E>::operator mln_point(Pi) () const { return piter_; } template <typename Pi, typename E> + inline const mln_point(Pi)& piter_adaptor_<Pi,E>::to_point() const { @@ -112,6 +115,7 @@ namespace mln } template <typename Pi, typename E> + inline mln_coord(Pi) piter_adaptor_<Pi,E>::operator[](unsigned i) const { @@ -120,6 +124,7 @@ namespace mln } template <typename Pi, typename E> + inline bool piter_adaptor_<Pi,E>::is_valid() const { @@ -127,6 +132,7 @@ namespace mln } template <typename Pi, typename E> + inline void piter_adaptor_<Pi,E>::invalidate() { @@ -134,6 +140,7 @@ namespace mln } template <typename Pi, typename E> + inline void piter_adaptor_<Pi,E>::start() { @@ -141,6 +148,7 @@ namespace mln } template <typename Pi, typename E> + inline void piter_adaptor_<Pi,E>::next_() { diff --git a/milena/mln/core/internal/pixel_impl.hh b/milena/mln/core/internal/pixel_impl.hh index 4bac307..5baa34e 100644 --- a/milena/mln/core/internal/pixel_impl.hh +++ b/milena/mln/core/internal/pixel_impl.hh @@ -148,6 +148,7 @@ namespace mln // pixel_impl_<I, E> template <typename I, typename E> + inline bool pixel_impl_<I, E>::is_valid_() const { @@ -155,6 +156,7 @@ namespace mln } template <typename I, typename E> + inline pixel_impl_<I, E>::pixel_impl_(I& image) : image_(image), value_ptr_(0) @@ -162,6 +164,7 @@ namespace mln } template <typename I, typename E> + inline mln_lvalue(I) pixel_impl_<I, E>::val() { @@ -170,6 +173,7 @@ namespace mln } template <typename I, typename E> + inline mln_rvalue(I) pixel_impl_<I, E>::val() const { @@ -178,6 +182,7 @@ namespace mln } template <typename I, typename E> + inline I& pixel_impl_<I, E>::ima() const { @@ -186,6 +191,7 @@ namespace mln } template <typename I, typename E> + inline mln_value(I) ** pixel_impl_<I, E>::address_() const { @@ -196,6 +202,7 @@ namespace mln // pixel_impl_<const I, E> template <typename I, typename E> + inline bool pixel_impl_<const I, E>::is_valid_() const { @@ -203,6 +210,7 @@ namespace mln } template <typename I, typename E> + inline pixel_impl_<const I, E>::pixel_impl_(const I& image) : image_(image), value_ptr_(0) @@ -210,6 +218,7 @@ namespace mln } template <typename I, typename E> + inline mln_rvalue(I) pixel_impl_<const I, E>::val() const { @@ -218,6 +227,7 @@ namespace mln } template <typename I, typename E> + inline const I& pixel_impl_<const I, E>::ima() const { @@ -225,6 +235,7 @@ namespace mln } template <typename I, typename E> + inline const mln_value(I) ** pixel_impl_<const I, E>::address_() const { diff --git a/milena/mln/core/internal/pixel_iterator_base.hh b/milena/mln/core/internal/pixel_iterator_base.hh index 0c8c811..557b5f8 100644 --- a/milena/mln/core/internal/pixel_iterator_base.hh +++ b/milena/mln/core/internal/pixel_iterator_base.hh @@ -81,6 +81,7 @@ namespace mln #ifndef MLN_INCLUDE_ONLY template <typename I, typename E> + inline pixel_iterator_base_<I, E>::pixel_iterator_base_(I& image) : super_(image) { @@ -93,6 +94,7 @@ namespace mln // FIXME: Remove cause dangerous when bkd!!! template <typename I, typename E> + inline void pixel_iterator_base_<I, E>::start() { @@ -100,6 +102,7 @@ namespace mln } template <typename I, typename E> + inline void pixel_iterator_base_<I, E>::invalidate() { @@ -108,6 +111,7 @@ namespace mln // FIXME: Remove casue not optimal!!! template <typename I, typename E> + inline bool pixel_iterator_base_<I, E>::is_valid() const { diff --git a/milena/mln/core/internal/point_iterator_base.hh b/milena/mln/core/internal/point_iterator_base.hh index 1d47715..55901ea 100644 --- a/milena/mln/core/internal/point_iterator_base.hh +++ b/milena/mln/core/internal/point_iterator_base.hh @@ -83,12 +83,14 @@ namespace mln #ifndef MLN_INCLUDE_ONLY template <typename P, typename E> + inline point_iterator_base_<P, E>::point_iterator_base_() { mln::metal::is_a<P, Point_Site>::check(); } template <typename P, typename E> + inline typename point_iterator_base_<P, E>::coord point_iterator_base_<P, E>::operator[](unsigned i) const { diff --git a/milena/mln/core/internal/point_set_base.hh b/milena/mln/core/internal/point_set_base.hh index f8250d0..cf7b9e8 100644 --- a/milena/mln/core/internal/point_set_base.hh +++ b/milena/mln/core/internal/point_set_base.hh @@ -72,6 +72,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename S, typename E> + inline point_set_base_<S,E>::point_set_base_() { } diff --git a/milena/mln/core/internal/run_image.hh b/milena/mln/core/internal/run_image.hh index d4b6f05..2d4b921 100644 --- a/milena/mln/core/internal/run_image.hh +++ b/milena/mln/core/internal/run_image.hh @@ -59,6 +59,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename P, typename E> + inline run_image_<P, E>::run_image_() { } diff --git a/milena/mln/core/internal/run_psite.hh b/milena/mln/core/internal/run_psite.hh index 6af009e..b525441 100644 --- a/milena/mln/core/internal/run_psite.hh +++ b/milena/mln/core/internal/run_psite.hh @@ -102,11 +102,13 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename P> + inline run_psite<P>::run_psite() { } template <typename P> + inline run_psite<P>::run_psite(P point, unsigned index, unsigned pset_pos) : point_(point), range_index_(index), @@ -115,6 +117,7 @@ namespace mln } template <typename P> + inline run_psite<P>::operator P() const { P tmp = point_; @@ -123,6 +126,7 @@ namespace mln } template <typename P> + inline const P& run_psite<P>::range_start_() const { @@ -130,6 +134,7 @@ namespace mln } template <typename P> + inline P& run_psite<P>::range_start_() { @@ -137,6 +142,7 @@ namespace mln } template <typename P> + inline unsigned run_psite<P>::pset_pos_() const { @@ -144,6 +150,7 @@ namespace mln } template <typename P> + inline unsigned& run_psite<P>::pset_pos_() { @@ -151,6 +158,7 @@ namespace mln } template <typename P> + inline unsigned run_psite<P>::index_() const { @@ -158,6 +166,7 @@ namespace mln } template <typename P> + inline unsigned& run_psite<P>::index_() { @@ -165,6 +174,7 @@ namespace mln } template <typename P> + inline const P& run_psite<P>::to_point() const { @@ -172,6 +182,7 @@ namespace mln } template <typename P> + inline mln_coord(P) run_psite<P>::operator[](unsigned i) const { diff --git a/milena/mln/core/internal/set_of.hh b/milena/mln/core/internal/set_of.hh index e74c8db..759c05d 100644 --- a/milena/mln/core/internal/set_of.hh +++ b/milena/mln/core/internal/set_of.hh @@ -190,12 +190,14 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename E> + inline set_of_<E>::set_of_() { needs_update_ = false; } template <typename E> + inline set_of_<E>& set_of_<E>::insert(const E& elt) { @@ -206,6 +208,7 @@ namespace mln } template <typename E> + inline set_of_<E>& set_of_<E>::remove(const E& elt) { @@ -217,6 +220,7 @@ namespace mln } template <typename E> + inline const E& set_of_<E>::element(unsigned i) const { @@ -227,6 +231,7 @@ namespace mln } template <typename E> + inline unsigned set_of_<E>::nelements() const { @@ -236,6 +241,7 @@ namespace mln } template <typename E> + inline bool set_of_<E>::has(const E& elt) const { @@ -243,6 +249,7 @@ namespace mln } template <typename E> + inline bool set_of_<E>::is_empty() const { @@ -250,6 +257,7 @@ namespace mln } template <typename E> + inline void set_of_<E>::clear() { @@ -260,6 +268,7 @@ namespace mln } template <typename E> + inline const std::vector<E>& set_of_<E>::vect() const { @@ -269,6 +278,7 @@ namespace mln } template <typename E> + inline void set_of_<E>::update_() const { diff --git a/milena/mln/core/interpolated.hh b/milena/mln/core/interpolated.hh index 5b5d5ec..7760118 100644 --- a/milena/mln/core/interpolated.hh +++ b/milena/mln/core/interpolated.hh @@ -123,6 +123,7 @@ namespace mln // internal::data_< interpolated<I,S> > template <typename I> + inline data_< interpolated<I> >::data_(I& ima) : ima_(ima) { @@ -131,6 +132,7 @@ namespace mln } // end of namespace mln::internal template <typename I> + inline interpolated<I>::interpolated(I& ima) { mln_precondition(ima.has_data()); @@ -138,11 +140,13 @@ namespace mln } template <typename I> + inline interpolated<I>::interpolated() { } template <typename I> + inline bool interpolated<I>::has_data() const { mln_invariant(this->data_->ima_.has_data()); @@ -150,6 +154,7 @@ namespace mln } template <typename I> + inline bool interpolated<I>::owns_(const mln::metal::vec<I::point::dim, float>& v) const { mln_point(I) p; @@ -159,6 +164,7 @@ namespace mln } template <typename I> + inline mln_value(I) interpolated<I>::operator()(const mln::metal::vec<I::point::dim, float>& v) const { @@ -172,6 +178,7 @@ namespace mln // FIXME : Should we remove this method? (and inherit it from // identity morpher) template <typename I> + inline const mln::value::set<mln_value(I) >& interpolated<I>::values() const { diff --git a/milena/mln/core/line2d.hh b/milena/mln/core/line2d.hh index a11f1dc..1b256bc 100644 --- a/milena/mln/core/line2d.hh +++ b/milena/mln/core/line2d.hh @@ -93,6 +93,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY + inline line2d::line2d(const point2d& beg, const point2d& end) : beg_(beg), end_(end) @@ -100,6 +101,7 @@ namespace mln compute_(); } + inline void line2d::compute_() { @@ -148,6 +150,7 @@ namespace mln math::max(beg_.col(), end_.col())); } + inline bool line2d::has(const point2d& p) const { @@ -160,24 +163,28 @@ namespace mln return false; } + inline std::size_t line2d::npoints() const { return vect_.size(); } + inline const box2d& line2d::bbox() const { return bb_; } + inline const std::vector<point2d>& line2d::vect() const { return vect_; } + inline const point2d& line2d::operator[](unsigned i) const { diff --git a/milena/mln/core/line_piter.hh b/milena/mln/core/line_piter.hh index 7217e08..d57bf3b 100644 --- a/milena/mln/core/line_piter.hh +++ b/milena/mln/core/line_piter.hh @@ -94,6 +94,7 @@ namespace mln // line_piter_<P> template <typename P> + inline line_piter_<P>::line_piter_(const box_<P>& b) : b_(b) { @@ -109,12 +110,14 @@ namespace mln } template <typename P> + inline line_piter_<P>::operator P() const { return p_; } template <typename P> + inline const P& line_piter_<P>::to_point() const { @@ -122,6 +125,7 @@ namespace mln } template <typename P> + inline mln_coord(P) line_piter_<P>::operator[](unsigned i) const { @@ -131,6 +135,7 @@ namespace mln } template <typename P> + inline bool line_piter_<P>::is_valid() const { @@ -138,6 +143,7 @@ namespace mln } template <typename P> + inline void line_piter_<P>::invalidate() { @@ -145,6 +151,7 @@ namespace mln } template <typename P> + inline void line_piter_<P>::start() { @@ -152,6 +159,7 @@ namespace mln } template <typename P> + inline void line_piter_<P>::next_() { diff --git a/milena/mln/core/mesh_image.hh b/milena/mln/core/mesh_image.hh index 204ae7d..f5f629e 100644 --- a/milena/mln/core/mesh_image.hh +++ b/milena/mln/core/mesh_image.hh @@ -116,6 +116,7 @@ namespace mln namespace internal { template <typename P, typename V> + inline data_< mesh_image<P, V> >::data_(mesh_p<P>& mesh, std::vector<V>& val) : val_ (val), mesh_ (mesh) @@ -125,17 +126,20 @@ namespace mln } // end of namespace mln::internal template <typename P, typename V> + inline mesh_image<P, V>::mesh_image(mesh_p<P>& mesh, std::vector<V>& val) { this->data_ = new internal::data_< mesh_image<P, V> > (mesh, val); } template <typename P, typename V> + inline mesh_image<P, V>::mesh_image() { } template <typename P, typename V> + inline const V& mesh_image<P, V>::operator()(const mesh_psite<P>& p) const { @@ -145,6 +149,7 @@ namespace mln } template <typename P, typename V> + inline V& mesh_image<P, V>::operator()(const mesh_psite<P>& p) { @@ -154,6 +159,7 @@ namespace mln } template <typename P, typename V> + inline const mln::value::set<V> & mesh_image<P, V>::values() const { @@ -161,6 +167,7 @@ namespace mln } template <typename P, typename V> + inline const std::vector<V>& mesh_image<P, V>::data_values () const { @@ -168,6 +175,7 @@ namespace mln } template <typename P, typename V> + inline const mesh_p<P>& mesh_image<P, V>::domain() const { @@ -176,6 +184,7 @@ namespace mln } template <typename P, typename V> + inline const P& mesh_image<P, V>::access_location_link_node1 (const unsigned& i) const { @@ -183,6 +192,7 @@ namespace mln } template <typename P, typename V> + inline const P& mesh_image<P, V>::access_location_link_node2 (const unsigned& i) const { diff --git a/milena/mln/core/mesh_p.hh b/milena/mln/core/mesh_p.hh index ec67f76..9364e00 100644 --- a/milena/mln/core/mesh_p.hh +++ b/milena/mln/core/mesh_p.hh @@ -75,6 +75,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template<typename P> + inline mesh_p<P>::mesh_p (util::graph<void>& gr, std::vector<P>& loc) : gr_ (gr), @@ -87,6 +88,7 @@ namespace mln } template<typename P> + inline std::size_t mesh_p<P>::npoints() const { @@ -94,6 +96,7 @@ namespace mln } template<typename P> + inline const box_<P>& mesh_p<P>::bbox() const { @@ -101,6 +104,7 @@ namespace mln } template<typename P> + inline bool mesh_p<P>::has(const psite& p) const { diff --git a/milena/mln/core/mesh_p_piter.hh b/milena/mln/core/mesh_p_piter.hh index b730918..c17820c 100644 --- a/milena/mln/core/mesh_p_piter.hh +++ b/milena/mln/core/mesh_p_piter.hh @@ -86,6 +86,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template<typename P> + inline mesh_p_piter_<P>::mesh_p_piter_(const mesh_p<P>& s) : loc_(s.loc_) { @@ -93,6 +94,7 @@ namespace mln } template<typename P> + inline const P& mesh_p_piter_<P>::to_point() const { @@ -100,6 +102,7 @@ namespace mln } template<typename P> + inline mln_coord(P) mesh_p_piter_<P>::operator[](unsigned i) const { @@ -107,6 +110,7 @@ namespace mln } template<typename P> + inline bool mesh_p_piter_<P>::is_valid() const { @@ -114,6 +118,7 @@ namespace mln } template<typename P> + inline void mesh_p_piter_<P>::invalidate() { @@ -121,6 +126,7 @@ namespace mln } template<typename P> + inline void mesh_p_piter_<P>::start() { @@ -130,6 +136,7 @@ namespace mln } template<typename P> + inline void mesh_p_piter_<P>::next_() { @@ -139,6 +146,7 @@ namespace mln } template<typename P> + inline mesh_p_piter_<P>::operator P() const { mln_precondition(is_valid()); diff --git a/milena/mln/core/mesh_psite.hh b/milena/mln/core/mesh_psite.hh index 1150893..f65aa0c 100644 --- a/milena/mln/core/mesh_psite.hh +++ b/milena/mln/core/mesh_psite.hh @@ -69,6 +69,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template<typename P> + inline mesh_psite<P>::mesh_psite(unsigned i, mesh_p<P>* m_ptr) : i_(i) , m_ptr_(m_ptr) @@ -76,12 +77,14 @@ namespace mln } template<typename P> + inline mesh_psite<P>::operator P() const { return m_ptr_->loc_[i_]; } template<typename P> + inline const P& mesh_psite<P>::to_point() const { @@ -89,6 +92,7 @@ namespace mln } template<typename P> + inline mln_coord(P) mesh_psite<P>::operator[](unsigned i) const { diff --git a/milena/mln/core/neighb.hh b/milena/mln/core/neighb.hh index d87dfe8..0e293db 100644 --- a/milena/mln/core/neighb.hh +++ b/milena/mln/core/neighb.hh @@ -110,11 +110,13 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename D> + inline neighb_<D>::neighb_() { } template <typename D> + inline neighb_<D>& neighb_<D>::insert(const D& dp) { @@ -126,6 +128,7 @@ namespace mln } template <typename D> + inline neighb_<D>& neighb_<D>::insert(const mln_coord(D)& dind) { @@ -135,6 +138,7 @@ namespace mln } template <typename D> + inline neighb_<D>& neighb_<D>::insert(const mln_coord(D)& drow, const mln_coord(D)& dcol) { @@ -144,6 +148,7 @@ namespace mln } template <typename D> + inline neighb_<D>& neighb_<D>::insert(const mln_coord(D)& dsli, const mln_coord(D)& drow, const mln_coord(D)& dcol) { diff --git a/milena/mln/core/neighb1d.hh b/milena/mln/core/neighb1d.hh index f627514..5a89ba9 100644 --- a/milena/mln/core/neighb1d.hh +++ b/milena/mln/core/neighb1d.hh @@ -59,6 +59,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY + inline const neighb1d& c2() { static bool flower = true; diff --git a/milena/mln/core/neighb2d.hh b/milena/mln/core/neighb2d.hh index d8ebb5e..510b140 100644 --- a/milena/mln/core/neighb2d.hh +++ b/milena/mln/core/neighb2d.hh @@ -95,6 +95,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY + inline const neighb2d& c4() { static bool flower = true; @@ -108,6 +109,7 @@ namespace mln return it; } + inline const neighb2d& c8() { static bool flower = true; @@ -123,6 +125,7 @@ namespace mln return it; } + inline const neighb2d& c2_row() { static bool flower = true; @@ -135,6 +138,7 @@ namespace mln return it; } + inline const neighb2d& c2_col() { static bool flower = true; diff --git a/milena/mln/core/neighb3d.hh b/milena/mln/core/neighb3d.hh index 60cefe7..8d695ff 100644 --- a/milena/mln/core/neighb3d.hh +++ b/milena/mln/core/neighb3d.hh @@ -104,6 +104,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY + inline const neighb3d& c6() { static bool flower = true; @@ -118,6 +119,7 @@ namespace mln return it; } + inline const neighb3d& c18() { static bool flower = true; @@ -140,6 +142,7 @@ namespace mln return it; } + inline const neighb3d& c26() { static bool flower = true; diff --git a/milena/mln/core/ops.hh b/milena/mln/core/ops.hh index 77bad13..77271d2 100644 --- a/milena/mln/core/ops.hh +++ b/milena/mln/core/ops.hh @@ -338,6 +338,7 @@ namespace mln // Plus equal. template <typename L, typename R> + inline L& operator+=(Object<L>& lhs, const Object<R>& rhs) { @@ -349,6 +350,7 @@ namespace mln // Minus equal. template <typename L, typename R> + inline L& operator-=(Object<L>& lhs, const Object<R>& rhs) { @@ -360,6 +362,7 @@ namespace mln // Times equal. template <typename L, typename R> + inline L& operator*=(Object<L>& lhs, const Object<R>& rhs) { @@ -371,6 +374,7 @@ namespace mln // Div equal. template <typename L, typename R> + inline L& operator/=(Object<L>& lhs, const Object<R>& rhs) { @@ -382,6 +386,7 @@ namespace mln // Mod equal. template <typename L, typename R> + inline L& operator%=(Object<L>& lhs, const Object<R>& rhs) { @@ -393,6 +398,7 @@ namespace mln // Unary plus. template <typename O> + inline O operator+(const Object<O>& rhs) { @@ -402,6 +408,7 @@ namespace mln // Unary minus. template <typename O> + inline mln_trait_op_minus(O, O) operator-(const Object<O>& rhs) { @@ -413,6 +420,7 @@ namespace mln // Post-incrementation. template <typename O> + inline O operator++(Object<O>& rhs, int) { @@ -425,6 +433,7 @@ namespace mln // Post-decrementation. template <typename O> + inline O operator--(Object<O>& rhs, int) { @@ -437,6 +446,7 @@ namespace mln // Pre-decrementation. template <typename O> + inline O& operator--(Object<O>& rhs) { @@ -448,6 +458,7 @@ namespace mln // Pre-incrementation. template <typename O> + inline O& operator++(Object<O>& rhs) { @@ -459,6 +470,7 @@ namespace mln // Comparisons. template <typename O1, typename O2> + inline mln_trait_op_neq(O1, O2) operator!=(const Object<O1>& lhs, const Object<O2>& rhs) { @@ -466,6 +478,7 @@ namespace mln } template <typename O1, typename O2> + inline mln_trait_op_greater(O1, O2) operator>(const Object<O1>& lhs, const Object<O2>& rhs) { @@ -473,6 +486,7 @@ namespace mln } template <typename O1, typename O2> + inline mln_trait_op_geq(O1, O2) operator>=(const Object<O1>& lhs, const Object<O2>& rhs) { @@ -480,6 +494,7 @@ namespace mln } template <typename O1, typename O2> + inline mln_trait_op_leq(O1, O2) operator<=(const Object<O1>& lhs, const Object<O2>& rhs) { diff --git a/milena/mln/core/p_array.hh b/milena/mln/core/p_array.hh index 2fe5b2c..8df3ecb 100644 --- a/milena/mln/core/p_array.hh +++ b/milena/mln/core/p_array.hh @@ -115,12 +115,14 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename P> + inline p_array<P>::p_array() { bb_needs_update_ = false; } template <typename P> + inline p_array<P>::p_array(const std::vector<P>& vect) : vect_(vect) { @@ -128,6 +130,7 @@ namespace mln } template <typename P> + inline void p_array<P>::reserve(std::size_t n) { @@ -135,6 +138,7 @@ namespace mln } template <typename P> + inline std::vector<P>& p_array<P>::hook_() { @@ -142,6 +146,7 @@ namespace mln } template <typename P> + inline void p_array<P>::update_bb_() const { @@ -152,6 +157,7 @@ namespace mln } template <typename P> + inline bool p_array<P>::has(const P& p) const { @@ -162,6 +168,7 @@ namespace mln } template <typename P> + inline std::size_t p_array<P>::npoints() const { @@ -169,6 +176,7 @@ namespace mln } template <typename P> + inline const box_<P>& p_array<P>::bbox() const { @@ -179,6 +187,7 @@ namespace mln } template <typename P> + inline p_array<P>& p_array<P>::append(const P& p) { @@ -189,6 +198,7 @@ namespace mln } template <typename P> + inline void p_array<P>::clear() { @@ -197,6 +207,7 @@ namespace mln } template <typename P> + inline const std::vector<P>& p_array<P>::vect() const { @@ -204,6 +215,7 @@ namespace mln } template <typename P> + inline const P& p_array<P>::operator[](unsigned i) const { diff --git a/milena/mln/core/p_array_piter.hh b/milena/mln/core/p_array_piter.hh index dd19394..66f46a3 100644 --- a/milena/mln/core/p_array_piter.hh +++ b/milena/mln/core/p_array_piter.hh @@ -137,6 +137,7 @@ namespace mln template <typename P> template <typename S> + inline p_array_fwd_piter_<P>::p_array_fwd_piter_(const Point_Set<S>& s) : vect_(exact(s).vect()) { @@ -144,6 +145,7 @@ namespace mln } template <typename P> + inline const P& p_array_fwd_piter_<P>::to_point() const { @@ -151,6 +153,7 @@ namespace mln } template <typename P> + inline mln_coord(P) p_array_fwd_piter_<P>::operator[](unsigned i) const { @@ -160,6 +163,7 @@ namespace mln } template <typename P> + inline bool p_array_fwd_piter_<P>::is_valid() const { @@ -167,6 +171,7 @@ namespace mln } template <typename P> + inline void p_array_fwd_piter_<P>::invalidate() { @@ -174,6 +179,7 @@ namespace mln } template <typename P> + inline void p_array_fwd_piter_<P>::start() { @@ -183,6 +189,7 @@ namespace mln } template <typename P> + inline void p_array_fwd_piter_<P>::next_() { @@ -192,6 +199,7 @@ namespace mln } template <typename P> + inline p_array_fwd_piter_<P>::operator P() const { mln_precondition(is_valid()); @@ -203,6 +211,7 @@ namespace mln template <typename P> template <typename S> + inline p_array_bkd_piter_<P>::p_array_bkd_piter_(const Point_Set<S>& s) : vect_(exact(s).vect()) { @@ -210,6 +219,7 @@ namespace mln } template <typename P> + inline const P& p_array_bkd_piter_<P>::to_point() const { @@ -217,6 +227,7 @@ namespace mln } template <typename P> + inline mln_coord(P) p_array_bkd_piter_<P>::operator[](unsigned i) const { @@ -226,6 +237,7 @@ namespace mln } template <typename P> + inline bool p_array_bkd_piter_<P>::is_valid() const { @@ -233,6 +245,7 @@ namespace mln } template <typename P> + inline void p_array_bkd_piter_<P>::invalidate() { @@ -240,6 +253,7 @@ namespace mln } template <typename P> + inline void p_array_bkd_piter_<P>::start() { @@ -249,6 +263,7 @@ namespace mln } template <typename P> + inline void p_array_bkd_piter_<P>::next_() { @@ -258,6 +273,7 @@ namespace mln } template <typename P> + inline p_array_bkd_piter_<P>::operator P() const { mln_precondition(is_valid()); diff --git a/milena/mln/core/p_priority_queue.hh b/milena/mln/core/p_priority_queue.hh index 95691af..c43f191 100644 --- a/milena/mln/core/p_priority_queue.hh +++ b/milena/mln/core/p_priority_queue.hh @@ -137,6 +137,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename P, typename T> + inline p_priority_queue<P, T>::p_priority_queue() { vect_needs_update_ = false; @@ -144,6 +145,7 @@ namespace mln } template <typename P, typename T> + inline void p_priority_queue<P, T>::vect_update_() const { @@ -159,6 +161,7 @@ namespace mln } template <typename P, typename T> + inline void p_priority_queue<P, T>::bb_update_() const { @@ -174,6 +177,7 @@ namespace mln template <typename P, typename T> + inline bool p_priority_queue<P, T>::has(const P& p) const { @@ -186,6 +190,7 @@ namespace mln } template <typename P, typename T> + inline bool p_priority_queue<P, T>::is_empty() const { @@ -198,6 +203,7 @@ namespace mln } template <typename P, typename T> + inline unsigned p_priority_queue<P, T>::npoints() const { @@ -212,6 +218,7 @@ namespace mln } template <typename P, typename T> + inline const box_<P>& p_priority_queue<P, T>::bbox() const { @@ -222,6 +229,7 @@ namespace mln } template <typename P, typename T> + inline p_priority_queue<P, T>& p_priority_queue<P, T>::push_force(const P& p, T prio) { @@ -235,6 +243,7 @@ namespace mln } template <typename P, typename T> + inline p_priority_queue<P, T>& p_priority_queue<P, T>::push(const P& p, T prio) { @@ -245,6 +254,7 @@ namespace mln } template <typename P, typename T> + inline void p_priority_queue<P, T>::pop() { @@ -262,6 +272,7 @@ namespace mln } template <typename P, typename T> + inline const P& p_priority_queue<P, T>::front() const { @@ -276,6 +287,7 @@ namespace mln } template <typename P, typename T> + inline const P& p_priority_queue<P, T>::pop_front() { @@ -286,6 +298,7 @@ namespace mln } template <typename P, typename T> + inline void p_priority_queue<P, T>::clear() { @@ -299,6 +312,7 @@ namespace mln } template <typename P, typename T> + inline const std::vector<P>& p_priority_queue<P, T>::vect() const { @@ -308,6 +322,7 @@ namespace mln } template <typename P, typename T> + inline const P& p_priority_queue<P, T>::operator[](unsigned i) const { diff --git a/milena/mln/core/p_priority_queue_fast.hh b/milena/mln/core/p_priority_queue_fast.hh index 048ca14..6ddfe2f 100644 --- a/milena/mln/core/p_priority_queue_fast.hh +++ b/milena/mln/core/p_priority_queue_fast.hh @@ -137,6 +137,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename P, typename T> + inline p_priority_queue_fast<P, T>::p_priority_queue_fast() { vect_needs_update_ = false; @@ -144,6 +145,7 @@ namespace mln } template <typename P, typename T> + inline void p_priority_queue_fast<P, T>::vect_update_() const { @@ -159,6 +161,7 @@ namespace mln } template <typename P, typename T> + inline void p_priority_queue_fast<P, T>::bb_update_() const { @@ -174,6 +177,7 @@ namespace mln template <typename P, typename T> + inline bool p_priority_queue_fast<P, T>::has(const P& p) const { @@ -186,6 +190,7 @@ namespace mln } template <typename P, typename T> + inline bool p_priority_queue_fast<P, T>::is_empty() const { @@ -198,6 +203,7 @@ namespace mln } template <typename P, typename T> + inline unsigned p_priority_queue_fast<P, T>::npoints() const { @@ -212,6 +218,7 @@ namespace mln } template <typename P, typename T> + inline const box_<P>& p_priority_queue_fast<P, T>::bbox() const { @@ -222,6 +229,7 @@ namespace mln } template <typename P, typename T> + inline p_priority_queue_fast<P, T>& p_priority_queue_fast<P, T>::push_force(const P& p, T prio) { @@ -235,6 +243,7 @@ namespace mln } template <typename P, typename T> + inline p_priority_queue_fast<P, T>& p_priority_queue_fast<P, T>::push(const P& p, T prio) { @@ -245,6 +254,7 @@ namespace mln } template <typename P, typename T> + inline void p_priority_queue_fast<P, T>::pop() { @@ -262,6 +272,7 @@ namespace mln } template <typename P, typename T> + inline const P& p_priority_queue_fast<P, T>::front() const { @@ -276,6 +287,7 @@ namespace mln } template <typename P, typename T> + inline const P& p_priority_queue_fast<P, T>::pop_front() { @@ -286,6 +298,7 @@ namespace mln } template <typename P, typename T> + inline void p_priority_queue_fast<P, T>::clear() { @@ -299,6 +312,7 @@ namespace mln } template <typename P, typename T> + inline const std::vector<P>& p_priority_queue_fast<P, T>::vect() const { @@ -308,6 +322,7 @@ namespace mln } template <typename P, typename T> + inline const P& p_priority_queue_fast<P, T>::operator[](unsigned i) const { diff --git a/milena/mln/core/p_priority_queue_fast_with_array.hh b/milena/mln/core/p_priority_queue_fast_with_array.hh index 3b5f480..153829e 100644 --- a/milena/mln/core/p_priority_queue_fast_with_array.hh +++ b/milena/mln/core/p_priority_queue_fast_with_array.hh @@ -137,6 +137,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename P, typename T, unsigned S> + inline p_priority_queue_fast_with_array<P, T, S>::p_priority_queue_fast_with_array() { vect_needs_update_ = false; @@ -149,6 +150,7 @@ namespace mln } template <typename P, typename T, unsigned S> + inline void p_priority_queue_fast_with_array<P, T, S>::vect_update_() const { @@ -162,6 +164,7 @@ namespace mln } template <typename P, typename T, unsigned S> + inline void p_priority_queue_fast_with_array<P, T, S>::bb_update_() const { @@ -175,6 +178,7 @@ namespace mln template <typename P, typename T, unsigned S> + inline bool p_priority_queue_fast_with_array<P, T, S>::has(const P& p) const { @@ -185,6 +189,7 @@ namespace mln } template <typename P, typename T, unsigned S> + inline bool p_priority_queue_fast_with_array<P, T, S>::is_empty() const { @@ -195,6 +200,7 @@ namespace mln } template <typename P, typename T, unsigned S> + inline unsigned p_priority_queue_fast_with_array<P, T, S>::npoints() const { @@ -208,6 +214,7 @@ namespace mln } template <typename P, typename T, unsigned S> + inline const box_<P>& p_priority_queue_fast_with_array<P, T, S>::bbox() const { @@ -218,6 +225,7 @@ namespace mln } template <typename P, typename T, unsigned S> + inline p_priority_queue_fast_with_array<P, T, S>& p_priority_queue_fast_with_array<P, T, S>::push_force(const P& p, T prio) { @@ -232,6 +240,7 @@ namespace mln } template <typename P, typename T, unsigned S> + inline p_priority_queue_fast_with_array<P, T, S>& p_priority_queue_fast_with_array<P, T, S>::push(const P& p, T prio) { @@ -242,6 +251,7 @@ namespace mln } template <typename P, typename T, unsigned S> + inline void p_priority_queue_fast_with_array<P, T, S>::pop() { @@ -257,6 +267,7 @@ namespace mln } template <typename P, typename T, unsigned S> + inline const P& p_priority_queue_fast_with_array<P, T, S>::front() const { @@ -269,6 +280,7 @@ namespace mln } template <typename P, typename T, unsigned S> + inline const P& p_priority_queue_fast_with_array<P, T, S>::pop_front() { @@ -279,6 +291,7 @@ namespace mln } template <typename P, typename T, unsigned S> + inline void p_priority_queue_fast_with_array<P, T, S>::clear() { @@ -290,6 +303,7 @@ namespace mln } template <typename P, typename T, unsigned S> + inline const std::vector<P>& p_priority_queue_fast_with_array<P, T, S>::vect() const { @@ -299,6 +313,7 @@ namespace mln } template <typename P, typename T, unsigned S> + inline const P& p_priority_queue_fast_with_array<P, T, S>::operator[](unsigned n) const { diff --git a/milena/mln/core/p_queue.hh b/milena/mln/core/p_queue.hh index 52baeb4..3bdfed8 100644 --- a/milena/mln/core/p_queue.hh +++ b/milena/mln/core/p_queue.hh @@ -135,6 +135,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename P> + inline p_queue<P>::p_queue() { vect_needs_update_ = false; @@ -142,6 +143,7 @@ namespace mln } template <typename P> + inline void p_queue<P>::vect_update_() const { @@ -153,6 +155,7 @@ namespace mln } template <typename P> + inline void p_queue<P>::bb_update_() const { @@ -163,6 +166,7 @@ namespace mln } template <typename P> + inline bool p_queue<P>::has(const P& p) const { @@ -173,6 +177,7 @@ namespace mln } template <typename P> + inline bool p_queue<P>::is_empty() const { @@ -180,6 +185,7 @@ namespace mln } template <typename P> + inline std::size_t p_queue<P>::npoints() const { @@ -187,6 +193,7 @@ namespace mln } template <typename P> + inline const box_<P>& p_queue<P>::bbox() const { @@ -197,6 +204,7 @@ namespace mln } template <typename P> + inline p_queue<P>& p_queue<P>::push_force(const P& p) { @@ -210,6 +218,7 @@ namespace mln } template <typename P> + inline p_queue<P>& p_queue<P>::push(const P& p) { @@ -219,6 +228,7 @@ namespace mln } template <typename P> + inline void p_queue<P>::pop() { @@ -231,6 +241,7 @@ namespace mln } template <typename P> + inline const P& p_queue<P>::front() const { @@ -239,6 +250,7 @@ namespace mln } template <typename P> + inline const P& p_queue<P>::pop_front() { @@ -249,6 +261,7 @@ namespace mln } template <typename P> + inline void p_queue<P>::clear() { @@ -259,6 +272,7 @@ namespace mln } template <typename P> + inline const std::vector<P>& p_queue<P>::vect() const { @@ -268,6 +282,7 @@ namespace mln } template <typename P> + inline const P& p_queue<P>::operator[](unsigned i) const { diff --git a/milena/mln/core/p_queue_fast.hh b/milena/mln/core/p_queue_fast.hh index cdcd7f3..ba8fa2a 100644 --- a/milena/mln/core/p_queue_fast.hh +++ b/milena/mln/core/p_queue_fast.hh @@ -137,6 +137,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename P> + inline p_queue_fast<P>::p_queue_fast() { // vect_needs_update_ = false; @@ -146,6 +147,7 @@ namespace mln } template <typename P> + inline void p_queue_fast<P>::vect_update_() const { @@ -157,6 +159,7 @@ namespace mln } template <typename P> + inline void p_queue_fast<P>::bb_update_() const { @@ -167,6 +170,7 @@ namespace mln } template <typename P> + inline bool p_queue_fast<P>::has(const P& p) const { @@ -177,6 +181,7 @@ namespace mln } template <typename P> + inline bool p_queue_fast<P>::is_empty() const { @@ -184,6 +189,7 @@ namespace mln } template <typename P> + inline std::size_t p_queue_fast<P>::npoints() const { @@ -192,6 +198,7 @@ namespace mln } template <typename P> + inline const box_<P>& p_queue_fast<P>::bbox() const { @@ -202,6 +209,7 @@ namespace mln } template <typename P> + inline p_queue_fast<P>& p_queue_fast<P>::push_force(const P& p) { @@ -216,6 +224,7 @@ namespace mln } template <typename P> + inline p_queue_fast<P>& p_queue_fast<P>::push(const P& p) { @@ -225,6 +234,7 @@ namespace mln } template <typename P> + inline void p_queue_fast<P>::pop() { @@ -238,6 +248,7 @@ namespace mln } template <typename P> + inline const P& p_queue_fast<P>::front() const { @@ -246,6 +257,7 @@ namespace mln } template <typename P> + inline const P& p_queue_fast<P>::pop_front() { @@ -257,6 +269,7 @@ namespace mln template <typename P> + inline void p_queue_fast<P>::clear() { @@ -268,6 +281,7 @@ namespace mln } template <typename P> + inline const std::vector<P>& p_queue_fast<P>::vect() const { @@ -277,6 +291,7 @@ namespace mln } template <typename P> + inline const P& p_queue_fast<P>::operator[](unsigned i) const { diff --git a/milena/mln/core/p_run.hh b/milena/mln/core/p_run.hh index e96c42c..28dbfb2 100644 --- a/milena/mln/core/p_run.hh +++ b/milena/mln/core/p_run.hh @@ -118,12 +118,14 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename P> + inline p_run<P>::p_run() { is_valid_ = false; } template <typename P> + inline p_run<P>::p_run(const P& start, std::size_t len) : p_(start), len_(len) @@ -138,6 +140,7 @@ namespace mln } template <typename P> + inline void p_run<P>::set_run(const P& start, std::size_t len) { @@ -153,6 +156,7 @@ namespace mln } template <typename P> + inline bool p_run<P>::has(const P& p) const { @@ -166,6 +170,7 @@ namespace mln } template <typename P> + inline std::size_t p_run<P>::npoints() const { @@ -174,6 +179,7 @@ namespace mln } template <typename P> + inline std::size_t p_run<P>::length() const { @@ -182,6 +188,7 @@ namespace mln } template <typename P> + inline P p_run<P>::operator[](unsigned i) const { @@ -193,6 +200,7 @@ namespace mln } template <typename P> + inline const P& p_run<P>::first() const { @@ -200,6 +208,7 @@ namespace mln } template <typename P> + inline const box_<mln_point(P)>& p_run<P>::bbox() const { @@ -209,6 +218,7 @@ namespace mln } template <typename P> + inline bool p_run<P>::operator<(const p_run<P>& rhs) const { diff --git a/milena/mln/core/p_run_piter.hh b/milena/mln/core/p_run_piter.hh index d40d8fb..ec86d9e 100644 --- a/milena/mln/core/p_run_piter.hh +++ b/milena/mln/core/p_run_piter.hh @@ -134,6 +134,7 @@ namespace mln // p_run_fwd_piter_<P> template <typename P> + inline p_run_fwd_piter_<P>::p_run_fwd_piter_(const p_run<P>& pr) : run_(pr) { @@ -141,6 +142,7 @@ namespace mln } template <typename P> + inline const P& p_run_fwd_piter_<P>::to_point() const { @@ -149,6 +151,7 @@ namespace mln } template <typename P> + inline mln_coord(P) p_run_fwd_piter_<P>::operator[](unsigned i) const { @@ -158,6 +161,7 @@ namespace mln } template <typename P> + inline bool p_run_fwd_piter_<P>::is_valid() const { @@ -165,6 +169,7 @@ namespace mln } template <typename P> + inline void p_run_fwd_piter_<P>::invalidate() { @@ -172,6 +177,7 @@ namespace mln } template <typename P> + inline void p_run_fwd_piter_<P>::start() { @@ -180,6 +186,7 @@ namespace mln } template <typename P> + inline void p_run_fwd_piter_<P>::next_() { @@ -188,6 +195,7 @@ namespace mln } template <typename P> + inline p_run_fwd_piter_<P>::operator P() const { mln_precondition(is_valid()); @@ -198,6 +206,7 @@ namespace mln // p_run_bkd_piter_<P> template <typename P> + inline p_run_bkd_piter_<P>::p_run_bkd_piter_(const p_run<P>& pr) : run_(pr) { @@ -205,6 +214,7 @@ namespace mln } template <typename P> + inline const P& p_run_bkd_piter_<P>::to_point() const { @@ -213,6 +223,7 @@ namespace mln } template <typename P> + inline mln_coord(P) p_run_bkd_piter_<P>::operator[](unsigned i) const { @@ -222,6 +233,7 @@ namespace mln } template <typename P> + inline bool p_run_bkd_piter_<P>::is_valid() const { @@ -229,6 +241,7 @@ namespace mln } template <typename P> + inline void p_run_bkd_piter_<P>::invalidate() { @@ -236,6 +249,7 @@ namespace mln } template <typename P> + inline void p_run_bkd_piter_<P>::start() { @@ -244,6 +258,7 @@ namespace mln } template <typename P> + inline void p_run_bkd_piter_<P>::next_() { @@ -252,6 +267,7 @@ namespace mln } template <typename P> + inline p_run_bkd_piter_<P>::operator P() const { mln_precondition(is_valid()); diff --git a/milena/mln/core/p_runs.hh b/milena/mln/core/p_runs.hh index ab21ffd..bd661ba 100644 --- a/milena/mln/core/p_runs.hh +++ b/milena/mln/core/p_runs.hh @@ -102,12 +102,14 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename P> + inline p_runs_<P>::p_runs_() : npoints_(0) { } template <typename P> + inline bool p_runs_<P>::has(const internal::run_psite<P>& p) const { @@ -120,6 +122,7 @@ namespace mln } template <typename P> + inline const box_<P>& p_runs_<P>::bbox() const { @@ -127,6 +130,7 @@ namespace mln } template <typename P> + inline typename std::size_t p_runs_<P>::npoints() const { @@ -134,6 +138,7 @@ namespace mln } template <typename P> + inline void p_runs_<P>::insert(const p_run<P>& pr) { @@ -174,6 +179,7 @@ namespace mln } template <typename P> + inline unsigned p_runs_<P>::range_len_(const P& p) const { @@ -190,6 +196,7 @@ namespace mln } template <typename P> + inline const typename p_runs_<P>::container& p_runs_<P>::con() const { diff --git a/milena/mln/core/p_set.hh b/milena/mln/core/p_set.hh index 4af2246..dcbcef7 100644 --- a/milena/mln/core/p_set.hh +++ b/milena/mln/core/p_set.hh @@ -101,11 +101,13 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename P> + inline p_set<P>::p_set() { } template <typename P> + inline bool p_set<P>::has(const P& p) const { @@ -113,6 +115,7 @@ namespace mln } template <typename P> + inline std::size_t p_set<P>::npoints() const { @@ -120,6 +123,7 @@ namespace mln } template <typename P> + inline p_set<P>& p_set<P>::insert(const P& p) { @@ -141,6 +145,7 @@ namespace mln // } template <typename P> + inline const P& p_set<P>::operator[](unsigned i) const { @@ -149,6 +154,7 @@ namespace mln } template <typename P> + inline void p_set<P>::clear() { @@ -157,6 +163,7 @@ namespace mln } template <typename P> + inline const box_<mln_point(P)>& p_set<P>::bbox() const { diff --git a/milena/mln/core/pixel.hh b/milena/mln/core/pixel.hh index d968519..dfdbb02 100644 --- a/milena/mln/core/pixel.hh +++ b/milena/mln/core/pixel.hh @@ -70,6 +70,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I> + inline pixel<I>::pixel(I& image) : super(image) { @@ -77,6 +78,7 @@ namespace mln } template <typename I> + inline pixel<I>::pixel(I& image, const mln_point(I)& p) : super(image) { @@ -85,6 +87,7 @@ namespace mln } template <typename I> + inline void pixel<I>::change_to(const mln_point(I)& p) { @@ -93,6 +96,7 @@ namespace mln } template <typename I> + inline bool pixel<I>::is_valid() const { diff --git a/milena/mln/core/pixter1d.hh b/milena/mln/core/pixter1d.hh index 32b1243..552d37a 100644 --- a/milena/mln/core/pixter1d.hh +++ b/milena/mln/core/pixter1d.hh @@ -70,6 +70,7 @@ namespace mln #ifndef MLN_INCLUDE_ONLY template <typename I> + inline fwd_pixter1d<I>::fwd_pixter1d(I& image) : super_(image) { @@ -77,6 +78,7 @@ namespace mln } template <typename I> + inline void fwd_pixter1d<I>::next_() { diff --git a/milena/mln/core/pixter2d.hh b/milena/mln/core/pixter2d.hh index ce3ba6a..5f63e04 100644 --- a/milena/mln/core/pixter2d.hh +++ b/milena/mln/core/pixter2d.hh @@ -116,6 +116,7 @@ namespace mln // Fwd. template <typename I> + inline fwd_pixter2d<I>::fwd_pixter2d(I& image) : super_(image) { @@ -126,6 +127,7 @@ namespace mln } template <typename I> + inline void fwd_pixter2d<I>::next_() { @@ -140,6 +142,7 @@ namespace mln // Bkd. template <typename I> + inline bkd_pixter2d<I>::bkd_pixter2d(I& image) : super_(image) { @@ -150,6 +153,7 @@ namespace mln } template <typename I> + inline void bkd_pixter2d<I>::next_() { @@ -162,6 +166,7 @@ namespace mln } template <typename I> + inline void bkd_pixter2d<I>::start() { diff --git a/milena/mln/core/pixter3d.hh b/milena/mln/core/pixter3d.hh index ed56b73..8afc5be 100644 --- a/milena/mln/core/pixter3d.hh +++ b/milena/mln/core/pixter3d.hh @@ -92,6 +92,7 @@ namespace mln #ifndef MLN_INCLUDE_ONLY template <typename I> + inline fwd_pixter3d<I>::fwd_pixter3d(I& image) : super_(image), border_x2_ (2 * image.border()), @@ -106,6 +107,7 @@ namespace mln } template <typename I> + inline void fwd_pixter3d<I>::next_() { diff --git a/milena/mln/core/plain.hh b/milena/mln/core/plain.hh index 9c8ba61..8f6a86f 100644 --- a/milena/mln/core/plain.hh +++ b/milena/mln/core/plain.hh @@ -111,6 +111,7 @@ namespace mln // internal::data_< plain<I> > template <typename I> + inline data_< plain<I> >::data_(const I& ima) : ima_(clone(ima)) { @@ -119,6 +120,7 @@ namespace mln } // end of namespace mln::internal template <typename I> + inline plain<I>::plain(const I& ima) { mln_precondition(ima.has_data()); @@ -126,6 +128,7 @@ namespace mln } template <typename I> + inline plain<I>& plain<I>::operator=(const I& rhs) { @@ -136,6 +139,7 @@ namespace mln } template <typename I> + inline plain<I>::operator I () const { return clone(this->data_->ima_); diff --git a/milena/mln/core/point.hh b/milena/mln/core/point.hh index b49834d..23fddb8 100644 --- a/milena/mln/core/point.hh +++ b/milena/mln/core/point.hh @@ -160,6 +160,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename M, typename C> + inline C point_<M,C>::operator[](unsigned i) const { assert(i < dim); @@ -167,6 +168,7 @@ namespace mln } template <typename M, typename C> + inline C& point_<M,C>::operator[](unsigned i) { assert(i < dim); @@ -176,11 +178,13 @@ namespace mln // Constructors. template <typename M, typename C> + inline point_<M,C>::point_() { } template <typename M, typename C> + inline point_<M,C>::point_(C ind) { metal::bool_<(dim == 1)>::check(); @@ -188,6 +192,7 @@ namespace mln } template <typename M, typename C> + inline point_<M,C>::point_(C row, C col) { metal::bool_<(dim == 2)>::check(); @@ -196,6 +201,7 @@ namespace mln } template <typename M, typename C> + inline point_<M,C>::point_(C sli, C row, C col) { metal::bool_<(dim == 3)>::check(); @@ -206,6 +212,7 @@ namespace mln template <typename M, typename C> template <typename F> + inline point_<M,C>::point_(const Function_i2v<F>& f_) { mlc_converts_to(mln_result(F), C)::check(); @@ -215,12 +222,14 @@ namespace mln } template <typename M, typename C> + inline point_<M,C>::point_(const literal::origin_t&) { coord_.set_all(0); } template <typename M, typename C> + inline point_<M,C>& point_<M,C>::operator=(const literal::origin_t&) { @@ -229,6 +238,7 @@ namespace mln } template <typename M, typename C> + inline point_<M,C>::point_(const literal::zero_t&) { metal::bool_<(dim == 1)>::check(); @@ -236,6 +246,7 @@ namespace mln } template <typename M, typename C> + inline point_<M,C>& point_<M,C>::operator=(const literal::zero_t&) { @@ -245,6 +256,7 @@ namespace mln } template <typename M, typename C> + inline point_<M,C>::point_(const literal::one_t&) { metal::bool_<(dim == 1)>::check(); @@ -252,6 +264,7 @@ namespace mln } template <typename M, typename C> + inline point_<M,C>& point_<M,C>::operator=(const literal::one_t&) { @@ -261,6 +274,7 @@ namespace mln } template <typename M, typename C> + inline void point_<M,C>::set_all(C c) { coord_.set_all(c); @@ -270,6 +284,7 @@ namespace mln const point_<M,C> point_<M,C>::origin = all_to(0); template <typename M, typename C> + inline point_<M,C>& point_<M,C>::operator+=(const dpoint& dp) { @@ -279,6 +294,7 @@ namespace mln } template <typename M, typename C> + inline point_<M,C>& point_<M,C>::operator-=(const dpoint& dp) { @@ -288,12 +304,14 @@ namespace mln } template <typename M, typename C> + inline point_<M,C>::operator typename internal::point_to_<M, C>::metal_vec () const { return coord_; // FIXME: Is-it OK? } template <typename M, typename C> + inline point_<M,C>::operator metal::vec<M::dim, float> () const { metal::vec<dim, float> tmp; @@ -303,6 +321,7 @@ namespace mln } template <typename M, typename C> + inline h_vec<M::dim, C> point_<M,C>::to_h_vec() const { h_vec<M::dim, C> tmp; diff --git a/milena/mln/core/pset_if.hh b/milena/mln/core/pset_if.hh index b4b0a23..f9382a2 100644 --- a/milena/mln/core/pset_if.hh +++ b/milena/mln/core/pset_if.hh @@ -117,6 +117,7 @@ namespace mln template <typename S, typename F> + inline pset_if<S, F> operator | (const Point_Set<S>& pset, const Function_p2b<F>& f) { @@ -128,6 +129,7 @@ namespace mln // pset_if<S,F> template <typename S, typename F> + inline bool pset_if<S,F>::has(const psite& p) const { @@ -135,6 +137,7 @@ namespace mln } template <typename S, typename F> + inline const box_<mln_point(S)>& pset_if<S,F>::bbox() const { @@ -142,6 +145,7 @@ namespace mln } template <typename S, typename F> + inline const S& pset_if<S,F>::overset() const { @@ -149,6 +153,7 @@ namespace mln } template <typename S, typename F> + inline bool pset_if<S,F>::pred(const psite& p) const { @@ -156,6 +161,7 @@ namespace mln } template <typename S, typename F> + inline pset_if<S,F>::pset_if(const S& pset, const F& f) : pset_(pset), f_(f) @@ -163,11 +169,13 @@ namespace mln } template <typename S, typename F> + inline pset_if<S,F>::pset_if() { } template <typename S, typename F> + inline const F& pset_if<S,F>::predicate() const { diff --git a/milena/mln/core/pset_if_piter.hh b/milena/mln/core/pset_if_piter.hh index 1c5236a..7675b8a 100644 --- a/milena/mln/core/pset_if_piter.hh +++ b/milena/mln/core/pset_if_piter.hh @@ -89,6 +89,7 @@ namespace mln // pset_if_fwd_piter_<S,F> template <typename S, typename F> + inline pset_if_fwd_piter_<S,F>::pset_if_fwd_piter_(const pset_if<S,F>& subset) : super_(adaptee_(subset.overset())), subset_(subset) @@ -96,6 +97,7 @@ namespace mln } template <typename S, typename F> + inline void pset_if_fwd_piter_<S,F>::start() { @@ -105,6 +107,7 @@ namespace mln } template <typename S, typename F> + inline void pset_if_fwd_piter_<S,F>::next_() { diff --git a/milena/mln/core/rle_encode.hh b/milena/mln/core/rle_encode.hh index d5ca913..ad3b552 100644 --- a/milena/mln/core/rle_encode.hh +++ b/milena/mln/core/rle_encode.hh @@ -55,6 +55,7 @@ namespace mln ** test if Point p1 and p2 are on the same line */ template <typename P> + inline bool on_the_same_line(const P& p1, const P& p2) { @@ -67,6 +68,7 @@ namespace mln } template <typename I> + inline rle_image<mln_point(I), mln_value(I)> rle_encode(const Image<I>& input) { diff --git a/milena/mln/core/rle_image.hh b/milena/mln/core/rle_image.hh index 326a267..c2dc4c7 100644 --- a/milena/mln/core/rle_image.hh +++ b/milena/mln/core/rle_image.hh @@ -119,6 +119,7 @@ namespace mln // internal::data_< rle_image<I,S> > template <typename P, typename T> + inline data_< rle_image<P,T> >::data_() { } @@ -126,11 +127,13 @@ namespace mln } // end of namespace mln::internal template <typename P, typename T> + inline rle_image<P, T>::rle_image() { } template <typename P, typename T> + inline bool rle_image<P, T>::has_data() const { @@ -138,6 +141,7 @@ namespace mln } template <typename P, typename T> + inline const typename rle_image<P, T>::vset& rle_image<P, T>::values() const { @@ -145,6 +149,7 @@ namespace mln } template <typename P, typename T> + inline void rle_image<P, T>::insert(const P& p, unsigned len, T value) { @@ -155,6 +160,7 @@ namespace mln } template <typename P, typename T> + inline typename rle_image<P, T>::rvalue rle_image<P, T>::operator() (const typename rle_image<P, T>::psite& site) const @@ -165,6 +171,7 @@ namespace mln } template <typename P, typename T> + inline typename rle_image<P, T>::lvalue rle_image<P, T>::operator() (const typename rle_image<P, T>::psite& site) { @@ -174,6 +181,7 @@ namespace mln } template <typename P, typename T> + inline const typename rle_image<P, T>::pset& rle_image<P, T>::domain() const { diff --git a/milena/mln/core/safe.hh b/milena/mln/core/safe.hh index 08b1eec..be636ab 100644 --- a/milena/mln/core/safe.hh +++ b/milena/mln/core/safe.hh @@ -105,6 +105,7 @@ namespace mln // internal::data_< safe_image<I,S> > template <typename I> + inline data_< safe_image<I> >::data_(I& ima, const mln_value(I)& default_value) : ima_(ima), default_value_(default_value) @@ -116,17 +117,20 @@ namespace mln // safe_image<I> template <typename I> + inline safe_image<I>::safe_image(I& ima, const mln_value(I)& default_value) { this->data_ = new internal::data_< safe_image<I> >(ima, default_value); } template <typename I> + inline safe_image<I>::safe_image() { } template <typename I> + inline mln_rvalue(I) safe_image<I>::operator()(const mln_psite(I)& p) const { @@ -136,6 +140,7 @@ namespace mln } template <typename I> + inline typename safe_image<I>::lvalue safe_image<I>::operator()(const mln_psite(I)& p) { @@ -147,6 +152,7 @@ namespace mln } template <typename I> + inline safe_image<I>::operator safe_image<const I>() const { safe_image<const I> tmp(this->data_->ima_, this->data_->default_value_); @@ -156,6 +162,7 @@ namespace mln // safe template <typename I> + inline safe_image<I> safe(Image<I>& ima, mln_value(I) default_value) { @@ -164,6 +171,7 @@ namespace mln } template <typename I> + inline safe_image<const I> safe(const Image<I>& ima, mln_value(I) default_value) { diff --git a/milena/mln/core/sparse_encode.hh b/milena/mln/core/sparse_encode.hh index 57ef88d..cf626dd 100644 --- a/milena/mln/core/sparse_encode.hh +++ b/milena/mln/core/sparse_encode.hh @@ -53,6 +53,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I> + inline sparse_image<mln_point(I), mln_value(I)> sparse_encode(const Image<I>& input) { diff --git a/milena/mln/core/sparse_image.hh b/milena/mln/core/sparse_image.hh index b3978aa..c844773 100644 --- a/milena/mln/core/sparse_image.hh +++ b/milena/mln/core/sparse_image.hh @@ -112,6 +112,7 @@ namespace mln // internal::data_< sparse_image<I,S> > template <typename P, typename T> + inline data_< sparse_image<P,T> >::data_() { } @@ -119,11 +120,13 @@ namespace mln } // end of namespace mln::internal template <typename P, typename T> + inline sparse_image<P, T>::sparse_image() { } template <typename P, typename T> + inline bool sparse_image<P, T>::has_data() const { @@ -131,6 +134,7 @@ namespace mln } template <typename P, typename T> + inline const typename sparse_image<P, T>::vset& sparse_image<P, T>::values() const { @@ -138,6 +142,7 @@ namespace mln } template <typename P, typename T> + inline void sparse_image<P, T>::insert(const P& p, unsigned len, const std::vector<T>& value) @@ -149,6 +154,7 @@ namespace mln } template <typename P, typename T> + inline typename sparse_image<P, T>::rvalue sparse_image<P, T>::operator() (const typename sparse_image<P, T>::psite& site) const @@ -160,6 +166,7 @@ namespace mln } template <typename P, typename T> + inline typename sparse_image<P, T>::lvalue sparse_image<P, T>::operator() (const typename sparse_image<P,T>::psite& site) @@ -171,6 +178,7 @@ namespace mln } template <typename P, typename T> + inline const typename sparse_image<P, T>::pset& sparse_image<P, T>::domain() const { diff --git a/milena/mln/core/sub_image.hh b/milena/mln/core/sub_image.hh index 284ca2f..788c4d6 100644 --- a/milena/mln/core/sub_image.hh +++ b/milena/mln/core/sub_image.hh @@ -136,6 +136,7 @@ namespace mln // init_ template <typename I, typename S, typename J> + inline void init_(tag::image_t, sub_image<I,S>& target, const J& model) { I ima; @@ -152,6 +153,7 @@ namespace mln { template <typename I, typename S> + inline data_< sub_image<I,S> >::data_(I& ima, const S& pset) : ima_(ima), pset_(pset) @@ -164,17 +166,20 @@ namespace mln // sub_image<I,S> template <typename I, typename S> + inline sub_image<I,S>::sub_image() { } template <typename I, typename S> + inline sub_image<I,S>::sub_image(I& ima, const S& pset) { init_(ima, pset); } template <typename I, typename S> + inline void sub_image<I,S>::init_(I& ima, const S& pset) { @@ -183,6 +188,7 @@ namespace mln } template <typename I, typename S> + inline const S& sub_image<I,S>::domain() const { @@ -190,6 +196,7 @@ namespace mln } template <typename I, typename S> + inline sub_image<I,S>::operator sub_image<const I, S>() const { sub_image<const I, S> tmp(this->data_->ima_, @@ -201,6 +208,7 @@ namespace mln // Operators. template <typename I, typename S> + inline sub_image<const I, S> operator|(const Image<I>& ima, const Point_Set<S>& pset) { @@ -209,6 +217,7 @@ namespace mln } template <typename I, typename S> + inline sub_image<I, S> operator|(Image<I>& ima, const Point_Set<S>& pset) { diff --git a/milena/mln/core/t_image.hh b/milena/mln/core/t_image.hh index 2088bbf..74fc9a3 100644 --- a/milena/mln/core/t_image.hh +++ b/milena/mln/core/t_image.hh @@ -171,6 +171,7 @@ namespace mln // internal::data_< t_image<I,S> > template <typename I> + inline data_< t_image<I> >::data_(I& ima, unsigned dim1, unsigned dim2, mln::box_<mln_point(I)>& box) @@ -184,6 +185,7 @@ namespace mln template <typename I> + inline t_image<I>::t_image(I& ima, unsigned dim1, unsigned dim2) { mln_precondition(ima.has_data()); @@ -198,6 +200,7 @@ namespace mln } template <typename I> + inline bool t_image<I>::has_data() const { mln_invariant(this->delegatee_()->has_data()); @@ -205,6 +208,7 @@ namespace mln } template <typename I> + inline bool t_image<I>::owns_(const mln_point(I)& p) const { @@ -213,6 +217,7 @@ namespace mln } template <typename I> + inline mln_point(I) t_image<I>::transpose_(const mln_point(I)& p) const { @@ -221,6 +226,7 @@ namespace mln } template <typename I> + inline mln_point(I) t_image<I>::exchange_coords_(const mln_point(I)& p, unsigned dim1, unsigned dim2) const @@ -232,6 +238,7 @@ namespace mln } template <typename I> + inline const box_<mln_point(I)>& t_image<I>::domain() const { @@ -240,6 +247,7 @@ namespace mln } template <typename I> + inline mln_rvalue(I) t_image<I>::operator()(const mln_point(I)& p) const { @@ -248,6 +256,7 @@ namespace mln } template <typename I> + inline typename internal::morpher_lvalue_<I>::ret t_image<I>::operator()(const mln_point(I)& p) { @@ -256,6 +265,7 @@ namespace mln } template <typename I> + inline const typename t_image<I>::vset& t_image<I>::values() const { @@ -265,6 +275,7 @@ namespace mln template <typename I> + inline t_image<I> swap_coords(Image<I>& ima, unsigned dim1, unsigned dim2) { @@ -276,6 +287,7 @@ namespace mln } template <typename I> + inline t_image<const I> swap_coords(const Image<I>& ima, unsigned dim1, unsigned dim2) { diff --git a/milena/mln/core/tr_image.hh b/milena/mln/core/tr_image.hh index f1356b9..f439381 100644 --- a/milena/mln/core/tr_image.hh +++ b/milena/mln/core/tr_image.hh @@ -130,6 +130,7 @@ namespace mln // internal::data_< tr_image<I,S> > template <typename T, typename I> + inline data_< tr_image<T,I> >::data_(I& ima, T& tr) : ima_(ima), tr_(tr) @@ -139,6 +140,7 @@ namespace mln } // end of namespace mln::internal template <typename T, typename I> + inline tr_image<T,I>::tr_image(I& ima, T& tr) { mln_precondition(ima.has_data()); @@ -146,11 +148,13 @@ namespace mln } template <typename T, typename I> + inline tr_image<T,I>::tr_image() { } template <typename T, typename I> + inline bool tr_image<T,I>::has_data() const { mln_invariant(this->data_->ima_.has_data()); @@ -158,6 +162,7 @@ namespace mln } template <typename T, typename I> + inline bool tr_image<T,I>::owns_(const metal::vec<I::point::dim, float>& v) const { mln_point(I) p; @@ -168,6 +173,7 @@ namespace mln } template <typename T, typename I> + inline bool tr_image<T,I>::has(const metal::vec<I::point::dim, float>& v) const { mln_point(I) p; @@ -178,6 +184,7 @@ namespace mln } template <typename T, typename I> + inline mln_value(I) tr_image<T,I>::operator()(const metal::vec<I::point::dim, float>& v) const { @@ -190,6 +197,7 @@ namespace mln } template <typename T, typename I> + inline void tr_image<T,I>::set_tr(T& tr) { diff --git a/milena/mln/core/translate_image.hh b/milena/mln/core/translate_image.hh index 20f8b2f..a79645d 100644 --- a/milena/mln/core/translate_image.hh +++ b/milena/mln/core/translate_image.hh @@ -138,6 +138,7 @@ namespace mln // internal::data_< translate_image<I,S> > template <typename I> + inline data_< translate_image<I> >::data_(I& ima, const mln_dpoint(I) dp) : ima_ (ima), dp_ (dp) @@ -155,6 +156,7 @@ namespace mln } // end of namespace mln::internal template <typename I> + inline translate_image<I>::translate_image(I& ima, const mln_dpoint(I) dp) { mln_precondition(ima.has_data()); @@ -162,11 +164,13 @@ namespace mln } template <typename I> + inline translate_image<I>::translate_image() { } template <typename I> + inline bool translate_image<I>::owns_(const mln_psite(I)& p) const { mln_point(I) np = p - this->data_->dp_; @@ -174,6 +178,7 @@ namespace mln } template <typename I> + inline mln_rvalue(I) translate_image<I>::operator()(const mln_psite(I)& p) const { @@ -184,6 +189,7 @@ namespace mln template <typename I> + inline typename translate_image<I>::lvalue translate_image<I>::operator()(const mln_psite(I)& p) { @@ -193,6 +199,7 @@ namespace mln } template <typename I> + inline const box2d& translate_image<I>::domain() const { diff --git a/milena/mln/core/w_window.hh b/milena/mln/core/w_window.hh index 10da4ad..5c334c1 100644 --- a/milena/mln/core/w_window.hh +++ b/milena/mln/core/w_window.hh @@ -152,6 +152,7 @@ namespace mln template <typename It, typename W> template <typename Ds, typename P> + inline with_w_<It,W>::with_w_(const Ds& ds, const P& p) : It(ds, p), @@ -160,6 +161,7 @@ namespace mln } template <typename It, typename W> + inline W with_w_<It,W>::w() const { @@ -171,11 +173,13 @@ namespace mln // w_window<D,W> template <typename D, typename W> + inline w_window<D,W>::w_window() { } template <typename D, typename W> + inline const mln::window<D>& w_window<D,W>::win() const { @@ -183,6 +187,7 @@ namespace mln } template <typename D, typename W> + inline const D& w_window<D,W>::dp(unsigned i) const { @@ -192,6 +197,7 @@ namespace mln } template <typename D, typename W> + inline unsigned w_window<D,W>::ndpoints() const { @@ -200,6 +206,7 @@ namespace mln } template <typename D, typename W> + inline const std::vector<D>& w_window<D,W>::vect() const { @@ -207,6 +214,7 @@ namespace mln } template <typename D, typename W> + inline const std::vector<W>& w_window<D,W>::weights() const { @@ -214,6 +222,7 @@ namespace mln } template <typename D, typename W> + inline W w_window<D,W>::w(unsigned i) const { @@ -223,6 +232,7 @@ namespace mln } template <typename D, typename W> + inline w_window<D,W>& w_window<D,W>::insert(const W& w, const D& d) { @@ -252,6 +262,7 @@ namespace mln } template <typename D, typename W> + inline w_window<D,W>& w_window<D,W>::sym() { @@ -265,6 +276,7 @@ namespace mln // operators template <typename D, typename W> + inline std::ostream& operator<<(std::ostream& ostr, const w_window<D,W>& w_win) { ostr << '['; @@ -274,6 +286,7 @@ namespace mln } template <typename D, typename Wl, typename Wr> + inline bool operator==(const w_window<D,Wl>& lhs, const w_window<D,Wr>& rhs) { if (lhs.ndpoints() != rhs.ndpoints()) diff --git a/milena/mln/core/window.hh b/milena/mln/core/window.hh index 0e94a24..16b9450 100644 --- a/milena/mln/core/window.hh +++ b/milena/mln/core/window.hh @@ -130,6 +130,7 @@ namespace mln // window<D> template <typename D> + inline window<D>::window() { // FIXME HERE: Was: mln::metal::is_a<D, Dpoint>::check(); @@ -137,12 +138,14 @@ namespace mln } template <typename D> + inline bool window<D>::is_symmetric() const { return geom::sym(*this) == *this; } template <typename D> + inline window<D>& window<D>::insert(const D& dp) { @@ -152,6 +155,7 @@ namespace mln } template <typename D> + inline window<D>& window<D>::insert(const mln_coord(D)& dind) { @@ -161,6 +165,7 @@ namespace mln } template <typename D> + inline window<D>& window<D>::insert(const mln_coord(D)& drow, const mln_coord(D)& dcol) { @@ -170,6 +175,7 @@ namespace mln } template <typename D> + inline window<D>& window<D>::insert(const mln_coord(D)& dsli, const mln_coord(D)& drow, const mln_coord(D)& dcol) { @@ -179,6 +185,7 @@ namespace mln } template <typename D> + inline window<D>& window<D>::sym() { diff --git a/milena/mln/debug/format.hh b/milena/mln/debug/format.hh index 6d4ca91..d188665 100644 --- a/milena/mln/debug/format.hh +++ b/milena/mln/debug/format.hh @@ -61,24 +61,28 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename T> + inline const T& format(const T& v) { return v; } + inline char format(bool v) { return v ? '|' : '-'; } + inline signed short format(signed char v) { return v; } + inline unsigned short format(unsigned char v) { diff --git a/milena/mln/debug/iota.hh b/milena/mln/debug/iota.hh index 4ba8a57..80b2f03 100644 --- a/milena/mln/debug/iota.hh +++ b/milena/mln/debug/iota.hh @@ -60,6 +60,7 @@ namespace mln { template <typename I> + inline void iota(trait::image::speed::any, I& input) { @@ -73,6 +74,7 @@ namespace mln template <typename I> + inline void iota(Image<I>& input) { diff --git a/milena/mln/debug/iota.spe.hh b/milena/mln/debug/iota.spe.hh index 0902204..593f6df 100644 --- a/milena/mln/debug/iota.spe.hh +++ b/milena/mln/debug/iota.spe.hh @@ -48,6 +48,7 @@ namespace mln { template <typename I> + inline void iota(trait::image::speed::fastest, I& input) { diff --git a/milena/mln/debug/println.hh b/milena/mln/debug/println.hh index b6e97fa..6d986e2 100644 --- a/milena/mln/debug/println.hh +++ b/milena/mln/debug/println.hh @@ -58,6 +58,7 @@ namespace mln // Generic version. template <typename S, typename I> + inline void println(const S&, const Image<I>& input_) { @@ -73,6 +74,7 @@ namespace mln // Facade. template <typename I> + inline void println(const Image<I>& input) { diff --git a/milena/mln/debug/println.spe.hh b/milena/mln/debug/println.spe.hh index 7166b2b..3aaf5b9 100644 --- a/milena/mln/debug/println.spe.hh +++ b/milena/mln/debug/println.spe.hh @@ -53,6 +53,7 @@ namespace mln // 2D version. template <typename I> + inline void println(const box2d& b, const I& input) { diff --git a/milena/mln/debug/println_with_border.hh b/milena/mln/debug/println_with_border.hh index 8111822..621180d 100644 --- a/milena/mln/debug/println_with_border.hh +++ b/milena/mln/debug/println_with_border.hh @@ -61,6 +61,7 @@ namespace mln // Generic version. template <typename S, typename I> + inline void println_with_border(const S&, const I& input) { @@ -74,6 +75,7 @@ namespace mln // Facade. template <typename I> + inline void println_with_border(const Image<I>& input) { diff --git a/milena/mln/debug/println_with_border.spe.hh b/milena/mln/debug/println_with_border.spe.hh index 796a8b9..c12bfd9 100644 --- a/milena/mln/debug/println_with_border.spe.hh +++ b/milena/mln/debug/println_with_border.spe.hh @@ -52,6 +52,7 @@ namespace mln // 2D version. template <typename I> + inline void println_with_border(const box2d& b, const I& input) { diff --git a/milena/mln/display/color_pretty.hh b/milena/mln/display/color_pretty.hh index 61dcdbb..79f4f49 100644 --- a/milena/mln/display/color_pretty.hh +++ b/milena/mln/display/color_pretty.hh @@ -91,6 +91,7 @@ namespace mln namespace impl { template <typename V> + inline value::rgb8 color_value(V v) { @@ -98,12 +99,14 @@ namespace mln } template <unsigned int n> + inline value::rgb8 color_value(value::rgb<n> v) { return v; } + inline value::rgb8 color_value(bool b) { @@ -113,6 +116,7 @@ namespace mln template <typename I> + inline typename trait::image_from_mesh < mln_mesh(I), value::rgb8 >::ret color_pretty(const Image<I>& input_) { @@ -135,6 +139,7 @@ namespace mln } template <typename I> + inline typename trait::image_from_mesh < mln_mesh(I), value::rgb8 >::ret color_pretty_rgb(const Image<I>& input_, const p_set<mln_point(I) >& s1_, @@ -180,6 +185,7 @@ namespace mln /// Facade. template <typename I> + inline typename trait::image_from_mesh < mln_mesh(I), value::rgb8 >::ret color_pretty(const Image<I>& input_) { @@ -198,6 +204,7 @@ namespace mln } template <typename I> + inline typename trait::image_from_mesh < mln_mesh(I), value::rgb8 >::ret color_pretty_rgb(const Image<I>& input_, const p_set<mln_point(I) >& s1_, diff --git a/milena/mln/display/remove.hh b/milena/mln/display/remove.hh index 13ce728..34762e8 100644 --- a/milena/mln/display/remove.hh +++ b/milena/mln/display/remove.hh @@ -58,6 +58,7 @@ namespace mln namespace impl { + inline void remove() { @@ -77,6 +78,7 @@ namespace mln } // end of namespace mln::display::impl /// Facade. + inline void remove() { diff --git a/milena/mln/display/save.hh b/milena/mln/display/save.hh index 68293c3..e4cf38d 100644 --- a/milena/mln/display/save.hh +++ b/milena/mln/display/save.hh @@ -69,6 +69,7 @@ namespace mln namespace impl { template <typename I> + inline void save(trait::value::kind::any, const Image<I>& input_) { @@ -92,6 +93,7 @@ namespace mln } template <typename I> + inline void save(trait::value::kind::color, const Image<I>& input_) { @@ -117,6 +119,7 @@ namespace mln /// Facade. template <typename I> + inline void save(const Image<I>& input_) { diff --git a/milena/mln/display/save_and_show.hh b/milena/mln/display/save_and_show.hh index 20a127e..2079020 100644 --- a/milena/mln/display/save_and_show.hh +++ b/milena/mln/display/save_and_show.hh @@ -65,6 +65,7 @@ namespace mln namespace impl { template <typename I> + inline void save_and_show_(const Image<I>& input, std::string cmd, int time) @@ -81,6 +82,7 @@ namespace mln /// Facade. template <typename I> + inline void save_and_show(const Image<I>& input_, std::string cmd = "display", int time = 0) { diff --git a/milena/mln/display/show.hh b/milena/mln/display/show.hh index b01dc53..9c9d001 100644 --- a/milena/mln/display/show.hh +++ b/milena/mln/display/show.hh @@ -70,6 +70,7 @@ namespace mln { template <typename I> + inline bool check_saved(const Image<I>& input_) { @@ -84,6 +85,7 @@ namespace mln } template <typename I> + inline void show(const Image<I>& input_, std::string cmd, int time) { @@ -113,6 +115,7 @@ namespace mln /// Facade. template <typename I> + inline void show(const Image<I>& input_, std::string cmd = "display", int time = 0) { diff --git a/milena/mln/draw/line.hh b/milena/mln/draw/line.hh index 9fedcf5..903ef29 100644 --- a/milena/mln/draw/line.hh +++ b/milena/mln/draw/line.hh @@ -68,6 +68,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I> + inline void line(Image<I>& ima, const mln_point(I)& beg, const mln_point(I)& end, const mln_value(I)& v) diff --git a/milena/mln/draw/mesh.hh b/milena/mln/draw/mesh.hh index 5666f46..f7c74e8 100644 --- a/milena/mln/draw/mesh.hh +++ b/milena/mln/draw/mesh.hh @@ -76,6 +76,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I, typename P> + inline void mesh(Image<I>& ima, const mesh_p<P>& m, mln_value(I) node_v, @@ -94,6 +95,7 @@ namespace mln } template <typename I, typename P, typename V> + inline void mesh(Image<I>& ima, const mesh_image<P, V>& mesh) { diff --git a/milena/mln/estim/mean.hh b/milena/mln/estim/mean.hh index 0ea58a6..1725c04 100644 --- a/milena/mln/estim/mean.hh +++ b/milena/mln/estim/mean.hh @@ -67,6 +67,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I> + inline mln_sum(mln_value(I)) mean(const Image<I>& input) { mln_precondition(exact(input).has_data()); @@ -74,6 +75,7 @@ namespace mln } template <typename S, typename I, typename M> + inline void mean(const Image<I>& input, M& result) { mln_precondition(exact(input).has_data()); diff --git a/milena/mln/estim/min_max.hh b/milena/mln/estim/min_max.hh index 590dea9..da9a01e 100644 --- a/milena/mln/estim/min_max.hh +++ b/milena/mln/estim/min_max.hh @@ -57,6 +57,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I> + inline void min_max(const Image<I>& input, mln_value(I)& min, mln_value(I)& max) { diff --git a/milena/mln/estim/sum.hh b/milena/mln/estim/sum.hh index 3b736d3..deeb20b 100644 --- a/milena/mln/estim/sum.hh +++ b/milena/mln/estim/sum.hh @@ -66,6 +66,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I> + inline mln_sum(mln_value(I)) sum(const Image<I>& input) { mln_precondition(exact(input).has_data()); @@ -73,6 +74,7 @@ namespace mln } template <typename I, typename S> + inline void sum(const Image<I>& input, S& result) { mln_precondition(exact(input).has_data()); diff --git a/milena/mln/fun/c.hh b/milena/mln/fun/c.hh index 9d41a32..1300aba 100644 --- a/milena/mln/fun/c.hh +++ b/milena/mln/fun/c.hh @@ -63,12 +63,14 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename R, typename A> + inline C<R(*)(A)>::C(R (*f)(A)) : f_(f) { } template <typename R, typename A> + inline R C<R(*)(A)>::operator()(const mlc_unqualif(A)& a) const { diff --git a/milena/mln/fun/cast.hh b/milena/mln/fun/cast.hh index 8799a0f..b59595d 100644 --- a/milena/mln/fun/cast.hh +++ b/milena/mln/fun/cast.hh @@ -67,6 +67,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename V, typename F> + inline cast_p2v_expr_<V, F> cast(const Function_p2v<F>& f) { diff --git a/milena/mln/fun/i2v/all_to.hh b/milena/mln/fun/i2v/all_to.hh index 6f8a868..84f9859 100644 --- a/milena/mln/fun/i2v/all_to.hh +++ b/milena/mln/fun/i2v/all_to.hh @@ -73,6 +73,7 @@ namespace mln { template <typename T> + inline all_to<T>::all_to(T t) : t_(t) { @@ -80,6 +81,7 @@ namespace mln template <typename T> template <typename U> + inline T all_to<T>::operator()(const U&) const { @@ -91,6 +93,7 @@ namespace mln } // end of namespace mln::fun template <typename T> + inline fun::i2v::all_to<T> all_to(T t) { fun::i2v::all_to<T> tmp(t); diff --git a/milena/mln/fun/internal/x2x_linear_impl.hh b/milena/mln/fun/internal/x2x_linear_impl.hh index ced29e8..82870ee 100644 --- a/milena/mln/fun/internal/x2x_linear_impl.hh +++ b/milena/mln/fun/internal/x2x_linear_impl.hh @@ -75,12 +75,14 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename V, typename E> + inline x2x_linear_impl_<V,E>::x2x_linear_impl_() { } template <typename V, typename E> + inline const typename x2x_linear_impl_<V,E>::matrix& x2x_linear_impl_<V,E>::mat() const { diff --git a/milena/mln/fun/p2b/chess.hh b/milena/mln/fun/p2b/chess.hh index 5c7e989..101993d 100644 --- a/milena/mln/fun/p2b/chess.hh +++ b/milena/mln/fun/p2b/chess.hh @@ -59,6 +59,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY + inline bool chess_t::operator()(const point2d& p) const { diff --git a/milena/mln/fun/p2v/elifs.hh b/milena/mln/fun/p2v/elifs.hh index 3eea477..e076293 100644 --- a/milena/mln/fun/p2v/elifs.hh +++ b/milena/mln/fun/p2v/elifs.hh @@ -60,6 +60,7 @@ namespace mln template <typename T1, typename N1, typename T2, typename N2, typename O> + inline ternary_<T1, N1, ternary_<T2, N2, O> > elifs(const Function_p2b<T1>& f_if_1, const Function_p2v<N1>& f_then_1, diff --git a/milena/mln/fun/p2v/iota.hh b/milena/mln/fun/p2v/iota.hh index 63ea79c..ef58e90 100644 --- a/milena/mln/fun/p2v/iota.hh +++ b/milena/mln/fun/p2v/iota.hh @@ -66,24 +66,28 @@ namespace mln # ifndef MLN_INCLUDE_ONLY + inline iota_t::iota_t() { reset(); } template <typename P> + inline unsigned iota_t::operator()(const P&) const { return ++i_; } + inline unsigned iota_t::value() const { return i_; } + inline void iota_t::reset() const { diff --git a/milena/mln/fun/p2v/ternary.hh b/milena/mln/fun/p2v/ternary.hh index d4b3bee..49af9c2 100644 --- a/milena/mln/fun/p2v/ternary.hh +++ b/milena/mln/fun/p2v/ternary.hh @@ -75,6 +75,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename P, typename T, typename F> + inline ternary_<P,T,F>::ternary_(const Function_p2b<P>& f_pred, const Function_p2v<T>& f_true, const Function_p2v<F>& f_false) @@ -86,6 +87,7 @@ namespace mln template <typename P, typename T, typename F> template <typename Pt> + inline mln_result(T) ternary_<P,T,F>::operator()(const Pt& p) const { @@ -94,6 +96,7 @@ namespace mln template <typename P, typename T, typename F> + inline ternary_<P, T, F> ternary(const Function_p2b<P>& f_pred, const Function_p2v<T>& f_true, diff --git a/milena/mln/fun/v2v/abs.hh b/milena/mln/fun/v2v/abs.hh index bdc6d9f..299adb8 100644 --- a/milena/mln/fun/v2v/abs.hh +++ b/milena/mln/fun/v2v/abs.hh @@ -59,6 +59,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename V> + inline V abs<V>::operator()(const V& v) const { diff --git a/milena/mln/fun/v2v/cast.hh b/milena/mln/fun/v2v/cast.hh index 1af95fc..3368522 100644 --- a/milena/mln/fun/v2v/cast.hh +++ b/milena/mln/fun/v2v/cast.hh @@ -62,6 +62,7 @@ namespace mln template <typename V> template <typename W> + inline V cast<V>::operator()(const W& w) const { diff --git a/milena/mln/fun/v2v/enc.hh b/milena/mln/fun/v2v/enc.hh index 10b0973..f61b42d 100644 --- a/milena/mln/fun/v2v/enc.hh +++ b/milena/mln/fun/v2v/enc.hh @@ -58,6 +58,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename V> + inline typename V::enc enc<V>::operator()(const V& v) const { diff --git a/milena/mln/fun/v2v/id.hh b/milena/mln/fun/v2v/id.hh index 60fd81a..1cf17aa 100644 --- a/milena/mln/fun/v2v/id.hh +++ b/milena/mln/fun/v2v/id.hh @@ -59,6 +59,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename T> + inline T id<T>::operator()(const T& t) const { diff --git a/milena/mln/fun/v2v/linear.hh b/milena/mln/fun/v2v/linear.hh index d7b2c8a..7754396 100644 --- a/milena/mln/fun/v2v/linear.hh +++ b/milena/mln/fun/v2v/linear.hh @@ -68,6 +68,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename V, typename T, typename R> + inline linear<V,T,R>::linear(T a, T b) : a(a), b(b) @@ -75,6 +76,7 @@ namespace mln } template <typename V, typename T, typename R> + inline R linear<V,T,R>::operator()(const V& v) const { diff --git a/milena/mln/fun/v2v/norm.hh b/milena/mln/fun/v2v/norm.hh index 77a4702..c6fca3f 100644 --- a/milena/mln/fun/v2v/norm.hh +++ b/milena/mln/fun/v2v/norm.hh @@ -93,6 +93,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename V, typename R> + inline R l1_norm<V, R>::operator()(const V& v) const { @@ -100,6 +101,7 @@ namespace mln } template <typename V, typename R> + inline R l2_norm<V, R>::operator()(const V& v) const { @@ -107,6 +109,7 @@ namespace mln } template <typename V, typename R> + inline R linfty_norm<V, R>::operator()(const V& v) const { diff --git a/milena/mln/fun/v2v/saturate.hh b/milena/mln/fun/v2v/saturate.hh index 203bc0e..8ab62de 100644 --- a/milena/mln/fun/v2v/saturate.hh +++ b/milena/mln/fun/v2v/saturate.hh @@ -68,6 +68,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename V> + inline saturate<V>::saturate() : min_(mln_min(V)), max_(mln_max(V)) @@ -75,6 +76,7 @@ namespace mln } template <typename V> + inline saturate<V>::saturate(const V& min, const V& max) : min_(min), max_(max) @@ -84,6 +86,7 @@ namespace mln template <typename V> template <typename W> + inline V saturate<V>::operator()(const W& w) const { diff --git a/milena/mln/fun/x2x/composed.hh b/milena/mln/fun/x2x/composed.hh index f7a3d41..35e5061 100644 --- a/milena/mln/fun/x2x/composed.hh +++ b/milena/mln/fun/x2x/composed.hh @@ -177,11 +177,13 @@ namespace mln // Implementation of the bijective version. template <typename F, typename G, typename E> + inline helper_composed_<F,G,E,true>::helper_composed_() { } template <typename F, typename G, typename E> + inline helper_composed_<F,G,E,true>::helper_composed_(const F& f, const G& g) :f_(f), g_(g) @@ -190,6 +192,7 @@ namespace mln } template <typename F, typename G, typename E> + inline typename helper_composed_<F,G,E,true>::invert helper_composed_<F,G,E,true>::inv() const { @@ -198,6 +201,7 @@ namespace mln template <typename F, typename G, typename E> + inline void helper_composed_<F,G,E,true>::set_first(const F& f) { @@ -206,6 +210,7 @@ namespace mln } template <typename F, typename G, typename E> + inline void helper_composed_<F,G,E,true>::set_second(const G& g) { @@ -216,11 +221,13 @@ namespace mln // Implementation of the non bijective version. template <typename F, typename G, typename E> + inline helper_composed_<F,G,E,false>::helper_composed_() { } template <typename F, typename G, typename E> + inline helper_composed_<F,G,E,false>::helper_composed_(const F& f, const G& g) :f_(f), g_(g) @@ -229,6 +236,7 @@ namespace mln } template <typename F, typename G, typename E> + inline void helper_composed_<F,G,E,false>::set_first(const F& f) { @@ -237,6 +245,7 @@ namespace mln } template <typename F, typename G, typename E> + inline void helper_composed_<F,G,E,false>::set_second(const G& g) { @@ -251,6 +260,7 @@ namespace mln } // end of namespace mln::fun template <typename F, typename G> + inline fun::x2x::composed<F,G> compose(F f, G g) { trace::entering("fun::x2x::compose"); diff --git a/milena/mln/fun/x2x/rotation.hh b/milena/mln/fun/x2x/rotation.hh index f26dd24..54d97d1 100644 --- a/milena/mln/fun/x2x/rotation.hh +++ b/milena/mln/fun/x2x/rotation.hh @@ -88,11 +88,13 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <unsigned n, typename C> + inline rotation<n,C>::rotation() { } template <unsigned n, typename C> + inline rotation<n,C>::rotation(float alpha, unsigned dir) :alpha_(alpha), dir_(dir) @@ -103,6 +105,7 @@ namespace mln } template <unsigned n, typename C> + inline metal::vec<n,C> rotation<n,C>::operator()(const metal::vec<n,C>& v) const { @@ -121,6 +124,7 @@ namespace mln } template <unsigned n, typename C> + inline rotation<n,C> rotation<n,C>::inv() const { @@ -129,6 +133,7 @@ namespace mln } template <unsigned n, typename C> + inline void rotation<n,C>::set_alpha(float alpha) { @@ -137,6 +142,7 @@ namespace mln } template <unsigned n, typename C> + inline void rotation<n,C>::set_dir(unsigned dir) { @@ -146,6 +152,7 @@ namespace mln } template <unsigned n, typename C> + inline void rotation<n,C>::update() { diff --git a/milena/mln/fun/x2x/translation.hh b/milena/mln/fun/x2x/translation.hh index 7fc9ff5..be49c5e 100644 --- a/milena/mln/fun/x2x/translation.hh +++ b/milena/mln/fun/x2x/translation.hh @@ -87,11 +87,13 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <unsigned n, typename C> + inline translation<n,C>::translation() { } template <unsigned n, typename C> + inline translation<n,C>::translation(const metal::vec<n,C>& t) :t_(t) { @@ -100,6 +102,7 @@ namespace mln } template <unsigned n, typename C> + inline metal::vec<n,C> translation<n,C>::operator()(const metal::vec<n,C>& v) const { @@ -107,6 +110,7 @@ namespace mln } template <unsigned n, typename C> + inline translation<n,C> translation<n,C>::inv() const { @@ -116,6 +120,7 @@ namespace mln } template <unsigned n, typename C> + inline void translation<n,C>::set_t(const metal::vec<n,C>& t) { @@ -124,6 +129,7 @@ namespace mln } template <unsigned n, typename C> + inline void translation<n,C>::update() { diff --git a/milena/mln/geom/bbox.hh b/milena/mln/geom/bbox.hh index 8ebbfb6..c5fd93f 100644 --- a/milena/mln/geom/bbox.hh +++ b/milena/mln/geom/bbox.hh @@ -74,6 +74,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename W> + inline box_<mln_point(W)> bbox(const Window<W>& win_) { const W& win = exact(win_); @@ -88,6 +89,7 @@ namespace mln } template <typename W> + inline box_<mln_point(W)> bbox(const Weighted_Window<W>& w_win) { return bbox(exact(w_win).win()); @@ -98,6 +100,7 @@ namespace mln { template <typename S> + inline box_<mln_point(S)> bbox_(const Point_Set<S>& pset_) { const S& pset = exact(pset_); @@ -108,6 +111,7 @@ namespace mln } template <typename B> + inline box_<mln_point(B)> bbox_(const Box<B>& pset_) { return exact(pset_); @@ -116,6 +120,7 @@ namespace mln } // end of namespace mln::geom::impl template <typename S> + inline box_<mln_point(S)> bbox(const Point_Set<S>& pset) { mln_precondition(exact(pset).npoints() != 0); @@ -126,6 +131,7 @@ namespace mln template <typename I> + inline box_<mln_point(I)> bbox(const Image<I>& ima_) { const I& ima = exact(ima_); diff --git a/milena/mln/geom/chamfer.hh b/milena/mln/geom/chamfer.hh index 38da19c..9d0041f 100644 --- a/milena/mln/geom/chamfer.hh +++ b/milena/mln/geom/chamfer.hh @@ -77,13 +77,16 @@ namespace mln bool status; unsigned max; + inline void init() { initialize(output, exact(input)); level::fill(inplace(output | (input | true).domain()), 0); level::fill(inplace(output | (input | false).domain()), max); } + inline bool handles(const P& p) const { return input(p) == false; } // end of requirements + inline chamfer_t(const I_& input, const W_& win, unsigned max) : input (input), win (win), @@ -94,6 +97,7 @@ namespace mln // Routines. template <typename I, typename W> + inline mln_ch_value(I, unsigned) chamfer_(const Image<I>& input_, const W& w_win_, unsigned max = mln_max(unsigned)) diff --git a/milena/mln/geom/max_col.hh b/milena/mln/geom/max_col.hh index bbc2c65..8ce6f43 100644 --- a/milena/mln/geom/max_col.hh +++ b/milena/mln/geom/max_col.hh @@ -50,6 +50,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I> + inline mln_coord(I) max_col(const Image<I>& ima) { mln_precondition(exact(ima).has_data()); diff --git a/milena/mln/geom/max_ind.hh b/milena/mln/geom/max_ind.hh index 321635d..4ff4303 100644 --- a/milena/mln/geom/max_ind.hh +++ b/milena/mln/geom/max_ind.hh @@ -50,6 +50,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I> + inline mln_coord(I) max_ind(const Image<I>& ima) { mln_precondition(exact(ima).has_data()); diff --git a/milena/mln/geom/max_row.hh b/milena/mln/geom/max_row.hh index 628cc1b..8f16322 100644 --- a/milena/mln/geom/max_row.hh +++ b/milena/mln/geom/max_row.hh @@ -50,6 +50,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I> + inline mln_coord(I) max_row(const Image<I>& ima) { mln_precondition(exact(ima).has_data()); diff --git a/milena/mln/geom/max_sli.hh b/milena/mln/geom/max_sli.hh index 850777a..86deba5 100644 --- a/milena/mln/geom/max_sli.hh +++ b/milena/mln/geom/max_sli.hh @@ -50,6 +50,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I> + inline mln_coord(I) max_sli(const Image<I>& ima) { mln_precondition(exact(ima).has_data()); diff --git a/milena/mln/geom/min_col.hh b/milena/mln/geom/min_col.hh index bd9ae3d..f6ed29d 100644 --- a/milena/mln/geom/min_col.hh +++ b/milena/mln/geom/min_col.hh @@ -50,6 +50,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I> + inline mln_coord(I) min_col(const Image<I>& ima) { mln_precondition(exact(ima).has_data()); diff --git a/milena/mln/geom/min_ind.hh b/milena/mln/geom/min_ind.hh index e7061e9..ce84967 100644 --- a/milena/mln/geom/min_ind.hh +++ b/milena/mln/geom/min_ind.hh @@ -50,6 +50,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I> + inline mln_coord(I) min_ind(const Image<I>& ima) { mln_precondition(exact(ima).has_data()); diff --git a/milena/mln/geom/min_row.hh b/milena/mln/geom/min_row.hh index ba2755f..17e2128 100644 --- a/milena/mln/geom/min_row.hh +++ b/milena/mln/geom/min_row.hh @@ -50,6 +50,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I> + inline mln_coord(I) min_row(const Image<I>& ima) { mln_precondition(exact(ima).has_data()); diff --git a/milena/mln/geom/min_sli.hh b/milena/mln/geom/min_sli.hh index 2c4f587..303117d 100644 --- a/milena/mln/geom/min_sli.hh +++ b/milena/mln/geom/min_sli.hh @@ -50,6 +50,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I> + inline mln_coord(I) min_sli(const Image<I>& ima) { mln_precondition(exact(ima).has_data()); diff --git a/milena/mln/geom/ncols.hh b/milena/mln/geom/ncols.hh index db883f3..f8c403f 100644 --- a/milena/mln/geom/ncols.hh +++ b/milena/mln/geom/ncols.hh @@ -51,6 +51,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I> + inline unsigned ncols(const Image<I>& ima) { mln_precondition(exact(ima).has_data()); diff --git a/milena/mln/geom/ninds.hh b/milena/mln/geom/ninds.hh index c752a13..9ab0d1a 100644 --- a/milena/mln/geom/ninds.hh +++ b/milena/mln/geom/ninds.hh @@ -51,6 +51,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I> + inline unsigned ninds(const Image<I>& ima) { mln_precondition(exact(ima).has_data()); diff --git a/milena/mln/geom/nrows.hh b/milena/mln/geom/nrows.hh index 180bfbc..01d10b3 100644 --- a/milena/mln/geom/nrows.hh +++ b/milena/mln/geom/nrows.hh @@ -51,6 +51,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I> + inline unsigned nrows(const Image<I>& ima) { mln_precondition(exact(ima).has_data()); diff --git a/milena/mln/geom/nslis.hh b/milena/mln/geom/nslis.hh index 4c2ad33..7d90865 100644 --- a/milena/mln/geom/nslis.hh +++ b/milena/mln/geom/nslis.hh @@ -51,6 +51,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I> + inline unsigned nslis(const Image<I>& ima) { mln_precondition(exact(ima).has_data()); diff --git a/milena/mln/geom/pmin_pmax.hh b/milena/mln/geom/pmin_pmax.hh index 779ec19..1f25565 100644 --- a/milena/mln/geom/pmin_pmax.hh +++ b/milena/mln/geom/pmin_pmax.hh @@ -82,6 +82,7 @@ namespace mln // Versions with point iterator. template <typename I> + inline void pmin_pmax(const Point_Iterator<I>& p_, mln_point(I)& pmin, mln_point(I)& pmax) { @@ -103,6 +104,7 @@ namespace mln } template <typename I> + inline std::pair<mln_point(I), mln_point(I)> pmin_pmax(const Point_Iterator<I>& p) { @@ -121,6 +123,7 @@ namespace mln // General case. template <typename S> + inline void pmin_pmax_(const Point_Set<S>& s, mln_point(S)& pmin, mln_point(S)& pmax) { @@ -131,6 +134,7 @@ namespace mln // Box. template <typename B> + inline void pmin_pmax_(const Box<B>& b, mln_point(B)& pmin, mln_point(B)& pmax) { @@ -142,6 +146,7 @@ namespace mln template <typename S> + inline void pmin_pmax(const Point_Set<S>& s, mln_point(S)& pmin, mln_point(S)& pmax) { @@ -150,6 +155,7 @@ namespace mln } template <typename S> + inline std::pair<mln_point(S), mln_point(S)> pmin_pmax(const Point_Set<S>& s) { diff --git a/milena/mln/geom/seeds2tiling.hh b/milena/mln/geom/seeds2tiling.hh index 2bcf8ec..0e7bce6 100644 --- a/milena/mln/geom/seeds2tiling.hh +++ b/milena/mln/geom/seeds2tiling.hh @@ -65,6 +65,7 @@ namespace mln { template <typename I, typename N> + inline I seeds2tiling (Image<I>& ima_, const Neighborhood<N>& nbh) @@ -116,6 +117,7 @@ namespace mln /// Facade template <typename I, typename N> + inline I seeds2tiling(Image<I>& ima_, const Neighborhood<N>& nbh) { trace::entering("geom::seed2tiling"); diff --git a/milena/mln/geom/seeds2tiling_roundness.hh b/milena/mln/geom/seeds2tiling_roundness.hh index e26e963..1bf9915 100644 --- a/milena/mln/geom/seeds2tiling_roundness.hh +++ b/milena/mln/geom/seeds2tiling_roundness.hh @@ -74,6 +74,7 @@ namespace mln { template <typename I, typename N> + inline I seeds2tiling_roundness(Image<I>& ima_, const w_window2d_int& w_win, unsigned max, const Neighborhood<N>& nbh) @@ -119,6 +120,7 @@ namespace mln /// Facade template <typename I, typename N> + inline I seeds2tiling_roundness(Image<I>& ima_, const w_window2d_int& w_win, unsigned max, const Neighborhood<N>& nbh) diff --git a/milena/mln/geom/shift.hh b/milena/mln/geom/shift.hh index 72c9e34..2be8f68 100644 --- a/milena/mln/geom/shift.hh +++ b/milena/mln/geom/shift.hh @@ -52,6 +52,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename W> + inline window<mln_dpoint(W)> shift(const Window<W>& win, const mln_dpoint(W)& dp) { diff --git a/milena/mln/geom/sym.hh b/milena/mln/geom/sym.hh index d753234..ba59f6c 100644 --- a/milena/mln/geom/sym.hh +++ b/milena/mln/geom/sym.hh @@ -58,6 +58,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename W> + inline W sym(const Window<W>& win) { W tmp = exact(win); @@ -65,6 +66,7 @@ namespace mln } template <typename W> + inline W sym(const Weighted_Window<W>& w_win) { W tmp = exact(w_win); diff --git a/milena/mln/histo/compute.hh b/milena/mln/histo/compute.hh index 21a5dfc..ff4b2c3 100644 --- a/milena/mln/histo/compute.hh +++ b/milena/mln/histo/compute.hh @@ -61,6 +61,7 @@ namespace mln { template <typename I> + inline data<mln_vset(I)> compute_(const I& input) { data<mln_vset(I)> h(input.values()); @@ -76,6 +77,7 @@ namespace mln template <typename I> + inline data<mln_vset(I)> compute(const Image<I>& input) { trace::entering("histo::compute"); diff --git a/milena/mln/histo/compute.spe.hh b/milena/mln/histo/compute.spe.hh index 1a64297..f731d16 100644 --- a/milena/mln/histo/compute.spe.hh +++ b/milena/mln/histo/compute.spe.hh @@ -52,6 +52,7 @@ namespace mln } template <typename I> + inline data<mln_vset(I)> compute_(trait::image::speed::any, const I& input) { @@ -59,6 +60,7 @@ namespace mln } template <typename I> + inline data<mln_vset(I)> compute_(trait::image::speed::fastest, const I& input) { diff --git a/milena/mln/histo/data.hh b/milena/mln/histo/data.hh index 735eb26..727b5b9 100644 --- a/milena/mln/histo/data.hh +++ b/milena/mln/histo/data.hh @@ -79,6 +79,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename S> + inline data<S>::data(const Value_Set<S>& s) : s_(exact(s)), h_(s_.nvalues(), 0) @@ -87,6 +88,7 @@ namespace mln } template <typename S> + inline void data<S>::clear() { @@ -94,6 +96,7 @@ namespace mln } template <typename S> + inline std::size_t data<S>::operator()(const value& v) const { @@ -101,6 +104,7 @@ namespace mln } template <typename S> + inline std::size_t& data<S>::operator()(const value& v) { @@ -108,6 +112,7 @@ namespace mln } template <typename S> + inline const S& data<S>::vset() const { @@ -115,6 +120,7 @@ namespace mln } template <typename S> + inline std::size_t data<S>::operator[](unsigned i) const { @@ -123,6 +129,7 @@ namespace mln } template <typename S> + inline const std::vector<std::size_t>& data<S>::vect() const { @@ -130,6 +137,7 @@ namespace mln } template <typename S> + inline std::ostream& operator<<(std::ostream& ostr, const data<S>& h) { mln_viter(S) v(h.vset()); diff --git a/milena/mln/io/abort.hh b/milena/mln/io/abort.hh index cd46255..368381b 100644 --- a/milena/mln/io/abort.hh +++ b/milena/mln/io/abort.hh @@ -49,6 +49,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY + inline void abort() { std::cerr << "I/O error, aborting." << std::endl; diff --git a/milena/mln/io/fits/load.hh b/milena/mln/io/fits/load.hh index 78e1d69..05364bf 100644 --- a/milena/mln/io/fits/load.hh +++ b/milena/mln/io/fits/load.hh @@ -74,6 +74,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY + inline void fits_exit(int status) { if (status) @@ -84,6 +85,7 @@ namespace mln return; } + inline image2d<float> load(const std::string& filename) { fitsfile *fptr; @@ -125,6 +127,7 @@ namespace mln return output; } + inline void load(image2d<float>& ima, const std::string& filename) { diff --git a/milena/mln/io/pbm/load.hh b/milena/mln/io/pbm/load.hh index 2caa5a4..e3918ab 100644 --- a/milena/mln/io/pbm/load.hh +++ b/milena/mln/io/pbm/load.hh @@ -79,6 +79,7 @@ namespace mln /// load_ascii. template <typename I> + inline void load_ascii(std::ifstream& file, I& ima) { mln_fwd_piter(I) p(ima.domain()); @@ -95,6 +96,7 @@ namespace mln /// load_raw_2d. template <typename I> + inline void load_raw_2d(std::ifstream& file, I& ima) { point2d p = make::point2d(0, ima.domain().pmin().col()); @@ -125,6 +127,7 @@ namespace mln } // end of namespace mln::io::internal + inline image2d<bool> load(const std::string& filename) { std::ifstream file(filename.c_str()); @@ -148,6 +151,7 @@ namespace mln } + inline void load(image2d<bool>& ima, const std::string& filename) { diff --git a/milena/mln/io/pbm/save.hh b/milena/mln/io/pbm/save.hh index 1cce26f..eda568e 100644 --- a/milena/mln/io/pbm/save.hh +++ b/milena/mln/io/pbm/save.hh @@ -78,6 +78,7 @@ namespace mln { template <typename I> + inline void save_(const Image<I>& ima_, const std::string& filename) { const I& ima = exact(ima_); @@ -115,6 +116,7 @@ namespace mln template <typename I> + inline void save(const Image<I>& ima, const std::string& filename) { mln::metal::equal<mln_value(I), bool >::check(); diff --git a/milena/mln/io/pfm/load.hh b/milena/mln/io/pfm/load.hh index a6ebc85..08ef09f 100644 --- a/milena/mln/io/pfm/load.hh +++ b/milena/mln/io/pfm/load.hh @@ -72,12 +72,14 @@ namespace mln namespace internal { + inline void abort() { std::cerr << " aborting." << std::endl; exit(0); } + inline bool read_pfm_header(std::istream& file, int& nrows, int& ncols, bool test = false) @@ -114,6 +116,7 @@ namespace mln /// load_raw_2d. template <typename I> + inline void load_raw_2d(std::ifstream& file, I& ima) { point2d p = make::point2d(0, 0); @@ -134,6 +137,7 @@ namespace mln } // end of namespace mln::io::internal + inline image2d<float> load(const std::string& filename) { std::ifstream file(filename.c_str()); @@ -152,6 +156,7 @@ namespace mln } + inline void load(image2d<float>& ima, const std::string& filename) { diff --git a/milena/mln/io/pfm/save.hh b/milena/mln/io/pfm/save.hh index fe3c2e8..2420f9e 100644 --- a/milena/mln/io/pfm/save.hh +++ b/milena/mln/io/pfm/save.hh @@ -68,6 +68,7 @@ namespace mln { template <typename I> + inline void save_header_(const I& ima, const std::string& filename, std::ofstream& file) { @@ -76,6 +77,7 @@ namespace mln } template <typename I> + inline void save_(const Image<I>& ima_, const std::string& filename) { const I& ima = exact(ima_); @@ -101,6 +103,7 @@ namespace mln } // end of namespace mln::io::impl template <typename I> + inline void save(const Image<I>& ima, const std::string& filename) { mln::metal::equal<mln_value(I), float >::check(); diff --git a/milena/mln/io/pgm/load.hh b/milena/mln/io/pgm/load.hh index b048a74..1efc07f 100644 --- a/milena/mln/io/pgm/load.hh +++ b/milena/mln/io/pgm/load.hh @@ -82,12 +82,14 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename V> + inline image2d<V> load(const std::string& filename) { return io::pnm::load<V>(PGM, filename); } template <typename I> + inline void load(Image<I>& ima, const std::string& filename) { diff --git a/milena/mln/io/pgm/save.hh b/milena/mln/io/pgm/save.hh index 0b82191..c3b0709 100644 --- a/milena/mln/io/pgm/save.hh +++ b/milena/mln/io/pgm/save.hh @@ -75,6 +75,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I> + inline void save(const Image<I>& ima, const std::string& filename) { // FIXME : this is to restrictive. Check if I is compatible with PGM. diff --git a/milena/mln/io/pnm/load.hh b/milena/mln/io/pnm/load.hh index b090ba1..bd93d56 100644 --- a/milena/mln/io/pnm/load.hh +++ b/milena/mln/io/pnm/load.hh @@ -61,6 +61,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY //read a rgb value (sizeof(int_u8) != 1) template <unsigned int n> + inline void read_value(std::ifstream& file, value::rgb<n>& v) { @@ -77,6 +78,7 @@ namespace mln //read a scalar value (sizeof(int_u8) != 1) template <class V> + inline void read_value(std::ifstream& file, V& v) { @@ -89,6 +91,7 @@ namespace mln // used when (sizeof(int_u8) != 1) template <typename V> + inline void load_raw_2d_uncontiguous(std::ifstream& file, image2d<V>& ima) { @@ -106,6 +109,7 @@ namespace mln // used in g++ > 2.95 template <typename I> + inline void load_raw_2d_contiguous(std::ifstream& file, I& ima) { point2d p = make::point2d(0, ima.domain().pmin().col()); @@ -121,6 +125,7 @@ namespace mln /// load_ascii. template <typename I> + inline void load_ascii(std::ifstream& file, I& ima) { mln_fwd_piter(I) p(ima.domain()); @@ -131,6 +136,7 @@ namespace mln /// load_raw_2d. /// for all pnm 8/16 bits formats template <typename I> + inline void load_raw_2d(std::ifstream& file, I& ima) { if (sizeof(value::int_u8) == 1) @@ -141,6 +147,7 @@ namespace mln /// main function : load pnm format template <typename V> + inline image2d<V> load(char type_, const std::string& filename) { std::ifstream file(filename.c_str()); @@ -183,6 +190,7 @@ namespace mln /// the destination is an argument to check if /// the type match the file to load. template <typename I> + inline void load(char type_, Image<I>& ima_, const std::string& filename) diff --git a/milena/mln/io/pnm/load_header.hh b/milena/mln/io/pnm/load_header.hh index f2433f0..89a1a6a 100644 --- a/milena/mln/io/pnm/load_header.hh +++ b/milena/mln/io/pnm/load_header.hh @@ -51,6 +51,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY + inline bool read_header(std::ifstream& istr, char& type, int& nrows, int& ncols, @@ -99,6 +100,7 @@ namespace mln return false; } + inline void read_header(char ascii, char raw, std::ifstream& istr, char& type, @@ -116,6 +118,7 @@ namespace mln } } + inline void read_header(char ascii, char raw, std::ifstream& istr, char& type, diff --git a/milena/mln/io/pnm/max_component.hh b/milena/mln/io/pnm/max_component.hh index cccdb23..e18a123 100644 --- a/milena/mln/io/pnm/max_component.hh +++ b/milena/mln/io/pnm/max_component.hh @@ -52,6 +52,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename V> + inline unsigned int max_component(const V&) { return mln_max(V); @@ -60,6 +61,7 @@ namespace mln # ifdef MLN_VALUE_RGB_HH template <unsigned n> + inline unsigned int max_component(const mln::value::rgb<n>&) { return mln_max( mln::value::int_u<n> ); diff --git a/milena/mln/io/pnm/save.hh b/milena/mln/io/pnm/save.hh index f26d3ff..ebe04db 100644 --- a/milena/mln/io/pnm/save.hh +++ b/milena/mln/io/pnm/save.hh @@ -82,6 +82,7 @@ namespace mln // write a rgb value into for uncontiguous datas template <unsigned int n> + inline void write_value(std::ofstream& file, const value::rgb<n>& c) { @@ -97,6 +98,7 @@ namespace mln // write a scalar value into for uncontiguous datas template <typename V> + inline void write_value(std::ofstream& file, const V& v) { @@ -108,6 +110,7 @@ namespace mln // save data for (sizeof(int_u8) != 1) and non fastest images template <typename I> + inline void save_data_uncontiguous(std::ofstream& file, const I& ima) { @@ -126,6 +129,7 @@ namespace mln // save data when (sizeof(int_u8) == 1) with fastest images // (faster) template <typename I> + inline void save_data_contiguous(std::ofstream& file, const I& ima_) { @@ -143,6 +147,7 @@ namespace mln // caller for fastest images template <typename I> + inline void save_data_(std::ofstream& file, trait::image::speed::fastest, const I& ima) { @@ -154,6 +159,7 @@ namespace mln // caller for non fastest images template <typename I> + inline void save_data_(std::ofstream& file, trait::image::speed::any, const I& ima) { @@ -166,6 +172,7 @@ namespace mln // Facades. template <typename I> + inline void save(const int type, const Image<I>& ima_, const std::string& filename) { const I& ima = exact(ima_); diff --git a/milena/mln/io/pnm/save_header.hh b/milena/mln/io/pnm/save_header.hh index 87acb67..a28b89a 100644 --- a/milena/mln/io/pnm/save_header.hh +++ b/milena/mln/io/pnm/save_header.hh @@ -57,16 +57,19 @@ namespace mln { template <typename V> + inline void save_max_val(V&, std::ofstream& file) { file << max_component(V()) << std::endl; } + inline void save_max_val(bool&, std::ofstream& file) { } template <typename I> + inline void save_header(const char type, const I& ima, const std::string& filename, std::ofstream& file) diff --git a/milena/mln/io/ppm/load.hh b/milena/mln/io/ppm/load.hh index 309dacf..6a8af2d 100644 --- a/milena/mln/io/ppm/load.hh +++ b/milena/mln/io/ppm/load.hh @@ -79,12 +79,14 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename V> + inline image2d<V> load(const std::string& filename) { return io::pnm::load<V>(PPM, filename); } template <typename I> + inline void load(Image<I>& ima, const std::string& filename) { diff --git a/milena/mln/io/ppm/save.hh b/milena/mln/io/ppm/save.hh index 1468aa1..47a19f5 100644 --- a/milena/mln/io/ppm/save.hh +++ b/milena/mln/io/ppm/save.hh @@ -64,6 +64,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I> + inline void save(const Image<I>& ima, const std::string& filename) { mln::metal::templated_by<mln_value(I), value::rgb >::check(); diff --git a/milena/mln/labeling/background.hh b/milena/mln/labeling/background.hh index 1ca8582..6f8f102 100644 --- a/milena/mln/labeling/background.hh +++ b/milena/mln/labeling/background.hh @@ -60,6 +60,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I, typename N> + inline mln_ch_value(I, unsigned) background(const Image<I>& input, const Neighborhood<N>& nbh, unsigned& nlabels) diff --git a/milena/mln/labeling/base.hh b/milena/mln/labeling/base.hh index 593509e..df7f5fd 100644 --- a/milena/mln/labeling/base.hh +++ b/milena/mln/labeling/base.hh @@ -66,6 +66,7 @@ namespace mln mln_value(O_) nlabels; bool status; + inline base_(const I_& input, const N_& nbh, O_& output) : input(input), nbh(nbh), @@ -75,11 +76,17 @@ namespace mln // Defaults. + inline bool handles(const P&) const { return true; } + inline bool labels(const P&) const { return true; } + inline void init() {} + inline void do_no_union(const P&, const P&) {} + inline void init_attr(const P&) {} + inline void merge_attr(const P&, const P&) {} }; @@ -100,6 +107,7 @@ namespace mln mln_value(O_) nlabels; bool status; + inline base_fast_(const I_& input, const N_& nbh, O_& output) : input(input), nbh(nbh), @@ -109,11 +117,17 @@ namespace mln // Defaults. + inline bool handles(unsigned) const { return true; } + inline bool labels(unsigned) const { return true; } + inline void init() {} + inline void do_no_union(unsigned, unsigned) {} + inline void init_attr(unsigned) {} + inline void merge_attr(unsigned, unsigned) {} }; diff --git a/milena/mln/labeling/blobs.hh b/milena/mln/labeling/blobs.hh index 4ff5122..a349f6e 100644 --- a/milena/mln/labeling/blobs.hh +++ b/milena/mln/labeling/blobs.hh @@ -77,6 +77,7 @@ namespace mln // Facade. template <typename I, typename N> + inline mln_ch_value(I, unsigned) blobs(const Image<I>& input_, const Neighborhood<N>& nbh_, unsigned& nlabels) { diff --git a/milena/mln/labeling/estimate.hh b/milena/mln/labeling/estimate.hh index 862e2dd..9e86761 100644 --- a/milena/mln/labeling/estimate.hh +++ b/milena/mln/labeling/estimate.hh @@ -58,6 +58,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename A, typename I> + inline mln_accu_with(A, util::pix<I>)::result estimate(const Image<I>& input, const mln_value(I)& val) { diff --git a/milena/mln/labeling/flat_zones.hh b/milena/mln/labeling/flat_zones.hh index eb7c4e5..fa5e5a2 100644 --- a/milena/mln/labeling/flat_zones.hh +++ b/milena/mln/labeling/flat_zones.hh @@ -74,10 +74,12 @@ namespace mln mln_value(O) nlabels; bool status; + inline bool equiv(const P& n, const P&) const { return input(n) == input(p); } // end of requirements + inline flat_zones_(const I_& input, const N_& nbh, O_& output) : base_<I_,N_,O_>(input, nbh, output), s(input.domain()) @@ -90,6 +92,7 @@ namespace mln // Facade. template <typename I, typename N, typename O> + inline bool flat_zones(const Image<I>& input, const Neighborhood<N>& nbh, Image<O>& output, unsigned& nlabels) diff --git a/milena/mln/labeling/foreground.hh b/milena/mln/labeling/foreground.hh index 8fac2f6..4767952 100644 --- a/milena/mln/labeling/foreground.hh +++ b/milena/mln/labeling/foreground.hh @@ -60,6 +60,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I, typename N> + inline mln_ch_value(I, unsigned) foreground(const Image<I>& input, const Neighborhood<N>& nbh, unsigned& nlabels) diff --git a/milena/mln/labeling/level.hh b/milena/mln/labeling/level.hh index 366124c..c2e065c 100644 --- a/milena/mln/labeling/level.hh +++ b/milena/mln/labeling/level.hh @@ -80,14 +80,18 @@ namespace mln typedef mln_pset(I_) S; const S& s; + inline void init() { mln::level::fill(this->output, 0); } // FIXME: use literal::zero + inline bool handles(const P& p) const { return input(p) == val; } + inline bool equiv(const P& n, const P&) const { return input(n) == val; } // end of requirements const mln_value(I_)& val; + inline level_t(const I_& input, const mln_value(I_)& val, const N_& nbh, O_& output) : base_<I_,N_,O_>(input, nbh, output), s(input.domain()), @@ -98,6 +102,7 @@ namespace mln // Routines. template <typename I, typename N> + inline mln_ch_value(I, unsigned) level_(trait::image::speed::any, const I& input, const mln_value(I)& val, const Neighborhood<N>& nbh, @@ -126,12 +131,16 @@ namespace mln // typedef mln_pset(I_) S; // const S& s; + inline void init() { mln::level::fill(this->output, 0); } + inline bool handles(unsigned p) const { return this->input[p] == val; } + inline bool equiv(unsigned n, unsigned) const { return this->input[n] == val; } const mln_value(I_)& val; + inline level_fast_t(const I_& input, const mln_value(I_)& val, const N_& nbh, O_& output) : labeling::impl::base_fast_<I_,N_,O_>(input, nbh, output), // s(input.domain()), @@ -141,6 +150,7 @@ namespace mln template <typename I, typename N> + inline mln_ch_value(I, unsigned) level_(trait::image::speed::fastest, const I& input, const mln_value(I)& val, const Neighborhood<N>& nbh, @@ -169,6 +179,7 @@ namespace mln // Facade. template <typename I, typename N> + inline mln_ch_value(I, unsigned) level(const Image<I>& input, const mln_value(I)& val, const Neighborhood<N>& nbh, unsigned& nlabels) diff --git a/milena/mln/labeling/regional_maxima.hh b/milena/mln/labeling/regional_maxima.hh index 0b49bed..43520b4 100644 --- a/milena/mln/labeling/regional_maxima.hh +++ b/milena/mln/labeling/regional_maxima.hh @@ -75,18 +75,24 @@ namespace mln typedef p_array<P> S; S s; + inline void init() { mln::level::fill(this->output, 0); level::fill(attr, true); } + inline bool labels(const P& p) const { return attr(p); } + inline bool equiv(const P& n, const P& p) const { return input(n) == input(p); } + inline void do_no_union(const P& n, const P& p) { mln_invariant(input(n) > input(p)); attr(p) = false; } + inline void merge_attr(const P& r, const P& p) { attr(p) = attr(p) && attr(r); } // end of requirements mln_ch_value(O_, bool) attr; + inline regional_maxima_(const I_& input, const N_& nbh, O_& output) : base_<I_,N_,O_>(input, nbh, output), s(level::sort_points_decreasing(input)), @@ -101,6 +107,7 @@ namespace mln // Facade. template <typename I, typename N, typename O> + inline bool regional_maxima(const Image<I>& input, const Neighborhood<N>& nbh, Image<O>& output, unsigned& nlabels) { diff --git a/milena/mln/labeling/regional_minima.hh b/milena/mln/labeling/regional_minima.hh index cd66015..03f8c03 100644 --- a/milena/mln/labeling/regional_minima.hh +++ b/milena/mln/labeling/regional_minima.hh @@ -75,18 +75,24 @@ namespace mln typedef p_array<P> S; S s; + inline void init() { mln::level::fill(this->output, 0); level::fill(attr, true); } + inline bool labels(const P& p) const { return attr(p); } + inline bool equiv(const P& n, const P& p) const { return input(n) == input(p); } + inline void do_no_union(const P& n, const P& p) { mln_invariant(input(n) < input(p)); attr(p) = false; } + inline void merge_attr(const P& r, const P& p) { attr(p) = attr(p) && attr(r); } // end of requirements mln_ch_value(O_, bool) attr; + inline regional_minima_(const I_& input, const N_& nbh, O_& output) : base_<I_,N_,O_>(input, nbh, output), s(level::sort_points_increasing(input)), @@ -101,6 +107,7 @@ namespace mln // Facade. template <typename I, typename N, typename O> + inline bool regional_minima(const Image<I>& input, const Neighborhood<N>& nbh, Image<O>& output, unsigned& nlabels) { diff --git a/milena/mln/level/abs.hh b/milena/mln/level/abs.hh index f0e5a5b..a74b144 100644 --- a/milena/mln/level/abs.hh +++ b/milena/mln/level/abs.hh @@ -66,6 +66,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I, typename O> + inline void abs(const Image<I>& input, Image<O>& output) { trace::entering("level::abs"); @@ -77,6 +78,7 @@ namespace mln } template <typename I> + inline void abs_inplace(Image<I>& input) { trace::entering("level::abs_inplace"); diff --git a/milena/mln/level/apply.hh b/milena/mln/level/apply.hh index 8cce6f1..22aa880 100644 --- a/milena/mln/level/apply.hh +++ b/milena/mln/level/apply.hh @@ -73,6 +73,7 @@ namespace mln { template <typename I, typename F> + inline void apply_(I& input, const F& f) { trace::entering("level::impl::generic::apply_"); @@ -92,6 +93,7 @@ namespace mln // Facade. template <typename I, typename F> + inline void apply(Image<I>& input, const Function_v2v<F>& f) { trace::entering("level::apply"); diff --git a/milena/mln/level/apply.spe.hh b/milena/mln/level/apply.spe.hh index 8696cdc..86b0b37 100644 --- a/milena/mln/level/apply.spe.hh +++ b/milena/mln/level/apply.spe.hh @@ -59,12 +59,14 @@ namespace mln // Disjunction. template <typename I, typename F> + inline void apply_(trait::image::speed::any, I& input, const F& f) { generic::apply_(input, f); } template <typename I, typename F> + inline void apply_(trait::image::speed::fastest, I& input, const F& f) { trace::entering("level::impl::apply_"); diff --git a/milena/mln/level/approx/median.hh b/milena/mln/level/approx/median.hh index e06b731..0f949a4 100644 --- a/milena/mln/level/approx/median.hh +++ b/milena/mln/level/approx/median.hh @@ -108,6 +108,7 @@ namespace mln { template <typename I, typename O> + inline void median_(const I& input, const unsigned length, O& output) { @@ -145,6 +146,7 @@ namespace mln // Facades. template <typename I, typename O> + inline void median(const Image<I>& input_, const win::rectangle2d& win, Image<O>& output_) { @@ -158,6 +160,7 @@ namespace mln } template <typename I, typename O> + inline void median(const Image<I>& input, const win::disk2d& win, Image<O>& output) { @@ -167,6 +170,7 @@ namespace mln } template <typename I, typename O> + inline void median(const Image<I>& input, const win::octagon2d& win, Image<O>& output) { diff --git a/milena/mln/level/assign.hh b/milena/mln/level/assign.hh index 210a91c..1f09b07 100644 --- a/milena/mln/level/assign.hh +++ b/milena/mln/level/assign.hh @@ -72,6 +72,7 @@ namespace mln namespace generic { template <typename L, typename R> + inline void assign_(L& target, const R& data) { trace::entering("level::impl::generic::assign_"); @@ -91,6 +92,7 @@ namespace mln // Facade. template <typename L, typename R> + inline void assign(Image<L>& target, const Image<R>& data) { trace::entering("level::assign"); diff --git a/milena/mln/level/assign.spe.hh b/milena/mln/level/assign.spe.hh index 61a5a9d..f3f3517 100644 --- a/milena/mln/level/assign.spe.hh +++ b/milena/mln/level/assign.spe.hh @@ -60,6 +60,7 @@ namespace mln template <typename L, typename R> + inline void assign_(trait::image::speed::any, L& target, trait::image::speed::any, const R& data) { @@ -67,6 +68,7 @@ namespace mln } template <typename L, typename R> + inline void assign_(trait::image::speed::fastest, L& target, trait::image::speed::fastest, const R& data) { diff --git a/milena/mln/level/compare.hh b/milena/mln/level/compare.hh index c85e6e6..a8fa7af 100644 --- a/milena/mln/level/compare.hh +++ b/milena/mln/level/compare.hh @@ -79,6 +79,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename L, typename R> + inline bool operator == (const Image<L>& lhs_, const Image<R>& rhs_) { const L& lhs = exact(lhs_); @@ -92,6 +93,7 @@ namespace mln } template <typename L, typename R> + inline bool operator < (const Image<L>& lhs_, const Image<R>& rhs_) { const L& lhs = exact(lhs_); @@ -105,6 +107,7 @@ namespace mln } template <typename L, typename R> // required! + inline bool operator <= (const Image<L>& lhs_, const Image<R>& rhs_) { const L& lhs = exact(lhs_); diff --git a/milena/mln/level/compute.hh b/milena/mln/level/compute.hh index d97189e..bfd859c 100644 --- a/milena/mln/level/compute.hh +++ b/milena/mln/level/compute.hh @@ -69,6 +69,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I, typename A> + inline mln_result(A) compute(const Image<I>& input, const Accumulator<A>& a_) { @@ -84,6 +85,7 @@ namespace mln } template <typename A, typename I> + inline mln_result(A) compute(const Image<I>& input) { @@ -92,6 +94,7 @@ namespace mln } template <typename A, typename I> + inline mln_accu_with(A, mln_value(I))::result compute(const Image<I>& input) { diff --git a/milena/mln/level/fast_median.hh b/milena/mln/level/fast_median.hh index 880c1f0..db3dca1 100644 --- a/milena/mln/level/fast_median.hh +++ b/milena/mln/level/fast_median.hh @@ -67,6 +67,7 @@ namespace mln { template <typename I, typename W, typename O> + inline void fast_median(const I& input, const W& win, O& output) @@ -156,6 +157,7 @@ namespace mln // facade template <typename I, typename W, typename O> + inline void fast_median(const Image<I>& input, const Window<W>& win, Image<O>& output) { diff --git a/milena/mln/level/fill.hh b/milena/mln/level/fill.hh index 23ff253..2e7997c 100644 --- a/milena/mln/level/fill.hh +++ b/milena/mln/level/fill.hh @@ -138,6 +138,7 @@ namespace mln namespace generic { template <typename I> + inline void fill_with_value(I& ima, const mln_value(I)& value) { trace::entering("level::impl::generic::fill_with_value"); @@ -158,6 +159,7 @@ namespace mln // with: value template <typename I> + inline void fill(Image<I>& ima, const mln_value(I)& value) { trace::entering("level::fill"); @@ -174,6 +176,7 @@ namespace mln // with: Function_p2v<F> template <typename I, typename F> + inline void fill(Image<I>& ima_, const Function_p2v<F>& f_) { trace::entering("level::fill"); @@ -192,6 +195,7 @@ namespace mln // with: value f(const point&) template <typename I> + inline void fill_f(Image<I>& ima_, mln_value(I) (*f)(const mln_point(I)& p)) { @@ -211,6 +215,7 @@ namespace mln // with: value arr[N] template <typename I, unsigned N> + inline void fill(Image<I>& ima_, mln_value(I) (&arr)[N]) { trace::entering("level::fill"); @@ -230,6 +235,7 @@ namespace mln // with: Image<J> template <typename I, typename J> + inline void fill(Image<I>& ima_, const Image<J>& data_) { trace::entering("level::fill"); diff --git a/milena/mln/level/fill.spe.hh b/milena/mln/level/fill.spe.hh index 2c4cb14..319eca5 100644 --- a/milena/mln/level/fill.spe.hh +++ b/milena/mln/level/fill.spe.hh @@ -64,6 +64,7 @@ namespace mln template <typename I> + inline void fill_with_value(trait::image::speed::any, I& ima, const mln_value(I)& value) { @@ -71,6 +72,7 @@ namespace mln } template <typename I> + inline void fill_with_value(trait::image::speed::fastest, I& ima, const mln_value(I)& value) { diff --git a/milena/mln/level/median.hh b/milena/mln/level/median.hh index 0f07901..bb51371 100644 --- a/milena/mln/level/median.hh +++ b/milena/mln/level/median.hh @@ -115,6 +115,7 @@ namespace mln // ctor + inline median_t(const I& input_, const W& win_, O& output_) : // i/o @@ -138,6 +139,7 @@ namespace mln // parts + inline void init() { med.init(); @@ -146,6 +148,7 @@ namespace mln med.take(input(q)); } + inline void down() { for_all(q_dm) if (input.has(q_dm)) @@ -155,6 +158,7 @@ namespace mln output(p) = med.to_result(); } + inline void fwd() { for_all(q_fm) if (input.has(q_fm)) @@ -164,6 +168,7 @@ namespace mln output(p) = med.to_result(); } + inline void bkd() { for_all(q_bm) if (input.has(q_bm)) @@ -194,6 +199,7 @@ namespace mln accu::median<mln_vset(I)> med; // ctor + inline median_dir_t(const I& input, unsigned dir, unsigned length, O& output) : // i/o input(input), @@ -206,31 +212,37 @@ namespace mln { } + inline void init() { } + inline void init_line() { med.init(); } + inline void add_point(mln_point(I) pt) { med.take(input(pt)); } + inline void remove_point(mln_point(I) pu) { med.untake(input(pu)); } + inline void next() { if (output.has(p)) output(p) = med.to_result(); } + inline void final() { } @@ -240,6 +252,7 @@ namespace mln template <typename I, typename O> + inline void median_dir_(const Image<I>& input, unsigned dir, unsigned length, O& output) { median_dir_t<I,O> f(exact(input), dir, length, output); @@ -248,6 +261,7 @@ namespace mln template <typename I, typename W, typename O> + inline void median_(const Image<I>& input, const Window<W>& win, O& output) { // FIXME: resize border! @@ -258,6 +272,7 @@ namespace mln # ifdef MLN_CORE_WIN_LINE_HH template <typename I, typename M, unsigned i, typename C, typename O> + inline void median_(const Image<I>& input, const win::line<M,i,C>& win, O& output) { median_dir(input, i, win.length(), output); // FIXME: Make 1 explicit! diff --git a/milena/mln/level/memcpy_.hh b/milena/mln/level/memcpy_.hh index dfd1f3f..e923777 100644 --- a/milena/mln/level/memcpy_.hh +++ b/milena/mln/level/memcpy_.hh @@ -71,6 +71,7 @@ namespace mln { template <typename Pd, typename Ps> + inline void memcpy__(Pd& dest, const Ps& src, std::size_t n) { trace::entering("level::impl::memcpy__"); @@ -109,6 +110,7 @@ namespace mln } template <typename Pd, typename Ps> + inline void memcpy_(Generalized_Pixel<Pd>& dest_, const Generalized_Pixel<Ps>& src_, std::size_t n) { diff --git a/milena/mln/level/memset_.hh b/milena/mln/level/memset_.hh index f578507..dd2cf30 100644 --- a/milena/mln/level/memset_.hh +++ b/milena/mln/level/memset_.hh @@ -80,6 +80,7 @@ namespace mln { template <typename P> + inline void memset__(P& pix, const mln_value(P)& v, std::size_t n) { trace::entering("level::impl::memset_"); @@ -116,6 +117,7 @@ namespace mln template <typename P> + inline void memset_(Generalized_Pixel<P>& pix_, const mln_value(P)& v, std::size_t n) { @@ -136,6 +138,7 @@ namespace mln } template <typename I> + inline void memset_(I& input, const mln_point(I)& p, const mln_value(I)& v, std::size_t n) { diff --git a/milena/mln/level/naive/median.hh b/milena/mln/level/naive/median.hh index d3d4796..09372a4 100644 --- a/milena/mln/level/naive/median.hh +++ b/milena/mln/level/naive/median.hh @@ -73,6 +73,7 @@ namespace mln { template <typename I, typename W, typename O> + inline void median(const I& input, const W& win, O& output) { @@ -97,6 +98,7 @@ namespace mln // facade template <typename I, typename W, typename O> + inline void median(const Image<I>& input, const Window<W>& win, Image<O>& output) { diff --git a/milena/mln/level/paste.hh b/milena/mln/level/paste.hh index f682e3b..549205b 100644 --- a/milena/mln/level/paste.hh +++ b/milena/mln/level/paste.hh @@ -78,6 +78,7 @@ namespace mln { template <typename I, typename J> + inline void paste_(const I& data, J& destination) { trace::entering("level::impl::generic::paste_"); @@ -97,6 +98,7 @@ namespace mln // Facade. template <typename I, typename J> + inline void paste(const Image<I>& data_, Image<J>& destination_) { trace::entering("level::paste"); diff --git a/milena/mln/level/paste.spe.hh b/milena/mln/level/paste.spe.hh index 198d9f1..d30268f 100644 --- a/milena/mln/level/paste.spe.hh +++ b/milena/mln/level/paste.spe.hh @@ -55,6 +55,7 @@ namespace mln } template <typename I, typename J> + inline void paste_lines_(const I& data, J& destination) { trace::entering("level::impl::paste_lines_"); @@ -77,6 +78,7 @@ namespace mln // Remember: raw < linear < stored, computed. template <typename I, typename J> + inline void paste_(trait::image::data::any, const I& data, trait::image::data::any, J& destination) { @@ -84,6 +86,7 @@ namespace mln } template <typename I, typename J> + inline void paste_(trait::image::data::raw, const I& data, trait::image::data::raw, J& destination) { diff --git a/milena/mln/level/saturate.hh b/milena/mln/level/saturate.hh index 8890578..8b9c4f3 100644 --- a/milena/mln/level/saturate.hh +++ b/milena/mln/level/saturate.hh @@ -94,6 +94,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I, typename O> + inline void saturate(const Image<I>& input, Image<O>& output) { trace::entering("level::saturate"); @@ -107,6 +108,7 @@ namespace mln } template <typename I, typename O> + inline void saturate(const Image<I>& input, const mln_value(O)& min, const mln_value(O)& max, Image<O>& output) @@ -122,6 +124,7 @@ namespace mln } template <typename I> + inline void saturate_inplace(Image<I>& input, const mln_value(I)& min, const mln_value(I)& max) { diff --git a/milena/mln/level/sort_points.hh b/milena/mln/level/sort_points.hh index 9db8ad5..08c8427 100644 --- a/milena/mln/level/sort_points.hh +++ b/milena/mln/level/sort_points.hh @@ -81,11 +81,13 @@ namespace mln { const I& ima_; + inline value_point_less_(const I& ima) : ima_(ima) { } + inline bool operator()(const mln_point(I)& lhs, const mln_point(I)& rhs) const { @@ -99,11 +101,13 @@ namespace mln { const I& ima_; + inline value_point_greater_(const I& ima) : ima_(ima) { } + inline bool operator()(const mln_point(I)& lhs, const mln_point(I)& rhs) const { @@ -116,6 +120,7 @@ namespace mln // increasing template <typename I> + inline p_array<mln_point(I)> sort_points_increasing_(trait::image::quant::any, // general case const I& input) @@ -127,6 +132,7 @@ namespace mln } template <typename I> + inline p_array<mln_point(I)> sort_points_increasing_(trait::image::quant::low, // low quantization const I& input) @@ -159,6 +165,7 @@ namespace mln // decreasing template <typename I> + inline p_array<mln_point(I)> sort_points_decreasing_(trait::image::quant::any, // general case const I& input) @@ -170,6 +177,7 @@ namespace mln } template <typename I> + inline p_array<mln_point(I)> sort_points_decreasing_(trait::image::quant::low, // low quantization const I& input) @@ -205,6 +213,7 @@ namespace mln // Facades. template <typename I> + inline p_array<mln_point(I)> sort_points_increasing(const Image<I>& input) { @@ -213,6 +222,7 @@ namespace mln } template <typename I> + inline p_array<mln_point(I)> sort_points_decreasing(const Image<I>& input) { diff --git a/milena/mln/level/stretch.hh b/milena/mln/level/stretch.hh index a2c57d4..e560efb 100644 --- a/milena/mln/level/stretch.hh +++ b/milena/mln/level/stretch.hh @@ -63,6 +63,7 @@ namespace mln { template <unsigned n, typename I, typename O> + inline void stretch(value::int_u<n>, const Image<I>& input, Image<O>& output) { @@ -88,6 +89,7 @@ namespace mln template <typename I, typename O> + inline void stretch(const Image<I>& input, Image<O>& output) { trace::entering("level::stretch"); diff --git a/milena/mln/level/take.hh b/milena/mln/level/take.hh index e54bc8a..7f509ea 100644 --- a/milena/mln/level/take.hh +++ b/milena/mln/level/take.hh @@ -69,6 +69,7 @@ namespace mln namespace generic { template <typename A, typename I> + inline void take_(const I& input, A& a) { trace::entering("level::impl::generic::take"); @@ -88,6 +89,7 @@ namespace mln // Facade. template <typename A, typename I> + inline void take(const Image<I>& input, Accumulator<A>& a) { trace::entering("level::take"); diff --git a/milena/mln/level/take.spe.hh b/milena/mln/level/take.spe.hh index 5147d7e..ddc5035 100644 --- a/milena/mln/level/take.spe.hh +++ b/milena/mln/level/take.spe.hh @@ -54,12 +54,14 @@ namespace mln } template <typename A, typename I> + inline void take_(trait::image::speed::any, const I& input, A& a) { generic::take_(input, a); } template <typename A, typename I> + inline void take_(trait::image::speed::fastest, const I& input, A& a) { trace::entering("level::impl::take"); diff --git a/milena/mln/level/to_enc.hh b/milena/mln/level/to_enc.hh index cc03aaf..19661bb 100644 --- a/milena/mln/level/to_enc.hh +++ b/milena/mln/level/to_enc.hh @@ -58,6 +58,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I, typename O> + inline void to_enc(const Image<I>& input, Image<O>& output) { trace::entering("level::to_enc"); diff --git a/milena/mln/level/transform.hh b/milena/mln/level/transform.hh index 9cc1001..6e698f2 100644 --- a/milena/mln/level/transform.hh +++ b/milena/mln/level/transform.hh @@ -82,6 +82,7 @@ namespace mln { template <typename I, typename F, typename O> + inline void transform_(const Image<I>& input_, const Function_v2v<F>& f_, Image<O>& output_) { trace::entering("level::impl::generic::transform"); @@ -105,6 +106,7 @@ namespace mln // Facade. template <typename I, typename F, typename O> + inline void transform(const Image<I>& input, const Function_v2v<F>& f, Image<O>& output) { trace::entering("level::transform"); @@ -118,6 +120,7 @@ namespace mln template <typename I, typename F> + inline mln_ch_value(I, mln_result(F)) transform(const Image<I>& input, const Function_v2v<F>& f) { diff --git a/milena/mln/level/transform.spe.hh b/milena/mln/level/transform.spe.hh index 729e984..ae0e6ec 100644 --- a/milena/mln/level/transform.spe.hh +++ b/milena/mln/level/transform.spe.hh @@ -62,6 +62,7 @@ namespace mln } template <typename I, typename F, typename O> + inline void transform_(mln::trait::image::quant::any, // general case const Image<I>& input_, const Function_v2v<F>& f_, Image<O>& output_) { @@ -70,6 +71,7 @@ namespace mln template <typename I, typename F, typename O> + inline void transform_(mln::trait::image::quant::low, // low quantization const Image<I>& input_, const Function_v2v<F>& f_, Image<O>& output_) { diff --git a/milena/mln/linear/convolve.hh b/milena/mln/linear/convolve.hh index 466b27d..25d7f7a 100644 --- a/milena/mln/linear/convolve.hh +++ b/milena/mln/linear/convolve.hh @@ -67,6 +67,7 @@ namespace mln { template <typename I, typename W, typename O> + inline void convolve_(trait::image::speed::any, const I& input, const Weighted_Window<W>& w_win_, trait::image::speed::any, O& output) @@ -86,6 +87,7 @@ namespace mln } template <typename I, typename W, typename O> + inline void convolve_(trait::image::speed::fastest, const I& input, const Weighted_Window<W>& w_win_, trait::image::speed::fastest, O& output) @@ -116,6 +118,7 @@ namespace mln // Facade. template <typename I, typename W, typename O> + inline void convolve(const Image<I>& input, const Weighted_Window<W>& w_win, Image<O>& output) { diff --git a/milena/mln/linear/gaussian.hh b/milena/mln/linear/gaussian.hh index 01b02f2..d55baca 100644 --- a/milena/mln/linear/gaussian.hh +++ b/milena/mln/linear/gaussian.hh @@ -74,6 +74,7 @@ namespace mln float sumA, sumC; }; + inline recursivefilter_coef_::recursivefilter_coef_(float a0, float a1, float b0, float b1, float c0, float c1, @@ -146,6 +147,7 @@ namespace mln template <class WorkType, class I> + inline void recursivefilter_(I& ima, const recursivefilter_coef_& c, @@ -245,6 +247,7 @@ namespace mln template <class I, class F> + inline void gaussian_(Image<I>& img_, const F& coef) { @@ -270,6 +273,7 @@ namespace mln template <class I, class F, class O> + inline void gaussian_common_(const Image<I>& in, const F& coef, @@ -294,6 +298,7 @@ namespace mln // Facade. template <class I, class O> + inline void gaussian(const Image<I>& input, float sigma, Image<O>& output) diff --git a/milena/mln/linear/lap.hh b/milena/mln/linear/lap.hh index 3674eb5..de93c6a 100644 --- a/milena/mln/linear/lap.hh +++ b/milena/mln/linear/lap.hh @@ -64,6 +64,7 @@ namespace mln // Laplacian operators (Cf. Sonka et al., p. 81) template <typename I, typename O> + inline void lap_4(const Image<I>& input, Image<O>& output) { mln_precondition(exact(output).domain() == exact(input).domain()); @@ -74,6 +75,7 @@ namespace mln } template <typename I, typename O> + inline void lap_8(const Image<I>& input, Image<O>& output) { mln_precondition(exact(output).domain() == exact(input).domain()); @@ -84,6 +86,7 @@ namespace mln } template <typename I, typename O> + inline void lap_x(const Image<I>& input, Image<O>& output) { mln_precondition(exact(output).domain() == exact(input).domain()); @@ -94,6 +97,7 @@ namespace mln } template <typename I, typename O> + inline void lap_o(const Image<I>& input, Image<O>& output) { mln_precondition(exact(output).domain() == exact(input).domain()); diff --git a/milena/mln/linear/line_convolve.hh b/milena/mln/linear/line_convolve.hh index 005d659..fc9ea27 100644 --- a/milena/mln/linear/line_convolve.hh +++ b/milena/mln/linear/line_convolve.hh @@ -65,6 +65,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I, typename W, unsigned N, typename O> + inline void line_convolve(const Image<I>& input, W (&weights)[N], Image<O>& output) { diff --git a/milena/mln/linear/line_x2_convolve.hh b/milena/mln/linear/line_x2_convolve.hh index 043699b..3f1b946 100644 --- a/milena/mln/linear/line_x2_convolve.hh +++ b/milena/mln/linear/line_x2_convolve.hh @@ -68,6 +68,7 @@ namespace mln template <typename I, typename W, unsigned Nr, unsigned Nc, typename O> + inline void line_x2_convolve(const Image<I>& input, W (&row_weights)[Nr], W (&col_weights)[Nc], Image<O>& output) diff --git a/milena/mln/linear/local/convolve.hh b/milena/mln/linear/local/convolve.hh index b922379..92ce24a 100644 --- a/milena/mln/linear/local/convolve.hh +++ b/milena/mln/linear/local/convolve.hh @@ -87,6 +87,7 @@ namespace mln { template <typename I, typename P, typename W, typename R> + inline void convolve(trait::image::speed::any, const I& input, const Point_Site<P>& p_, const W& w_win, @@ -102,6 +103,7 @@ namespace mln } template <typename I, typename P, typename W, typename R> + inline void convolve(trait::image::speed::fastest, const I& input, const Point_Site<P>& p_, const W& w_win, @@ -120,6 +122,7 @@ namespace mln } template <typename P, typename W, typename R> + inline void convolve(const Generalized_Pixel<P>& p_, const W& w_win, R& result) @@ -143,6 +146,7 @@ namespace mln // Facades. template <typename I, typename P, typename W, typename R> + inline void convolve(const Image<I>& input, const Point_Site<P>& p, const Weighted_Window<W>& w_win, @@ -154,6 +158,7 @@ namespace mln } template <typename P, typename W, typename R> + inline void convolve(const Generalized_Pixel<P>& p, const Weighted_Window<W>& w_win, R& result) diff --git a/milena/mln/linear/log.hh b/milena/mln/linear/log.hh index 5a3b4fa..578fe09 100644 --- a/milena/mln/linear/log.hh +++ b/milena/mln/linear/log.hh @@ -63,6 +63,7 @@ namespace mln // This is also a "mexican hat". template <typename I, typename O> + inline void LoG_5x5(const Image<I>& input, Image<O>& output) { mln_precondition(exact(output).domain() == exact(input).domain()); @@ -77,6 +78,7 @@ namespace mln // LoG 7x7 (Cf. Russ, p. 250) template <typename I, typename O> + inline void LoG_7x7(const Image<I>& input, Image<O>& output) { mln_precondition(exact(output).domain() == exact(input).domain()); @@ -93,6 +95,7 @@ namespace mln // LoG 13x13 (Cf. Russ, p. 250) template <typename I, typename O> + inline void LoG_13x13(const Image<I>& input, Image<O>& output) { mln_precondition(exact(output).domain() == exact(input).domain()); @@ -116,6 +119,7 @@ namespace mln // LoG 17x17 (Cf. Sonka et al., pages 85-86) template <typename I, typename O> + inline void LoG_17x17(const Image<I>& input, Image<O>& output) { mln_precondition(exact(output).domain() == exact(input).domain()); diff --git a/milena/mln/linear/sobel.hh b/milena/mln/linear/sobel.hh index 767ac27..8e9ec83 100644 --- a/milena/mln/linear/sobel.hh +++ b/milena/mln/linear/sobel.hh @@ -76,6 +76,7 @@ namespace mln { template <typename I, typename O> + inline void sobel_h_(const Image<I>& input, Image<O>& output) { int wrow[] = { -1, 0, 1 }, wcol[] = { 1, @@ -85,6 +86,7 @@ namespace mln } template <typename I, typename O> + inline void sobel_v_(const Image<I>& input, Image<O>& output) { int wrow[] = { 1, 2, 1 }, wcol[] = { -1, @@ -94,6 +96,7 @@ namespace mln } template <typename I, typename O> + inline void sobel_(const Image<I>& input, Image<O>& output) { // h @@ -112,6 +115,7 @@ namespace mln // Facades. template <typename I, typename O> + inline void sobel_h(const Image<I>& input, Image<O>& output) { mln_precondition(exact(output).domain() == exact(input).domain()); @@ -119,6 +123,7 @@ namespace mln } template <typename I, typename O> + inline void sobel_v(const Image<I>& input, Image<O>& output) { mln_precondition(exact(output).domain() == exact(input).domain()); @@ -126,6 +131,7 @@ namespace mln } template <typename I, typename O> + inline void sobel(const Image<I>& input, Image<O>& output) { mln_precondition(exact(output).domain() == exact(input).domain()); diff --git a/milena/mln/literal/one.hh b/milena/mln/literal/one.hh index 644d11e..3b9d855 100644 --- a/milena/mln/literal/one.hh +++ b/milena/mln/literal/one.hh @@ -60,6 +60,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename T> + inline one_t::operator T () const { mlc_converts_to(int, T)::check(); diff --git a/milena/mln/literal/ops.hh b/milena/mln/literal/ops.hh index c1b4d37..d816026 100644 --- a/milena/mln/literal/ops.hh +++ b/milena/mln/literal/ops.hh @@ -146,6 +146,7 @@ namespace mln // Op + template <typename O, typename L> + inline mln_trait_op_plus(O, O) operator+(const Object<O>& lhs, const Literal<L>& rhs) { @@ -154,6 +155,7 @@ namespace mln } template <typename L, typename O> + inline mln_trait_op_plus(O, O) operator+(const Literal<L>& lhs, const Object<O>& rhs) { @@ -164,6 +166,7 @@ namespace mln // Op - template <typename O, typename L> + inline mln_trait_op_minus(O, O) operator-(const Object<O>& lhs, const Literal<L>& rhs) { @@ -172,6 +175,7 @@ namespace mln } template <typename L, typename O> + inline mln_trait_op_minus(O, O) operator-(const Literal<L>& lhs, const Object<O>& rhs) { @@ -182,6 +186,7 @@ namespace mln // Op * template <typename O, typename L> + inline mln_trait_op_times(O, O) operator*(const Object<O>& lhs, const Literal<L>& rhs) { @@ -190,6 +195,7 @@ namespace mln } template <typename L, typename O> + inline mln_trait_op_times(O, O) operator*(const Literal<L>& lhs, const Object<O>& rhs) { @@ -200,6 +206,7 @@ namespace mln // Op / template <typename O, typename L> + inline mln_trait_op_div(O, O) operator/(const Object<O>& lhs, const Literal<L>& rhs) { @@ -208,6 +215,7 @@ namespace mln } template <typename L, typename O> + inline mln_trait_op_div(O, O) operator/(const Literal<L>& lhs, const Object<O>& rhs) { @@ -218,6 +226,7 @@ namespace mln // Op % template <typename O, typename L> + inline mln_trait_op_mod(O, O) operator%(const Object<O>& lhs, const Literal<L>& rhs) { @@ -226,6 +235,7 @@ namespace mln } template <typename L, typename O> + inline mln_trait_op_mod(O, O) operator%(const Literal<L>& lhs, const Object<O>& rhs) { @@ -237,6 +247,7 @@ namespace mln // Op == template <typename O, typename L> + inline mln_trait_op_eq(O, O) operator==(const Object<O>& lhs, const Literal<L>& rhs) { @@ -245,6 +256,7 @@ namespace mln } template <typename L, typename O> + inline mln_trait_op_eq(O, O) operator==(const Literal<L>& lhs, const Object<O>& rhs) { @@ -253,6 +265,7 @@ namespace mln } template <typename L1, typename L2> + inline bool operator==(const Literal<L1>&, const Literal<L2>&) { diff --git a/milena/mln/literal/zero.hh b/milena/mln/literal/zero.hh index e33b9e6..88edc7c 100644 --- a/milena/mln/literal/zero.hh +++ b/milena/mln/literal/zero.hh @@ -62,6 +62,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename T> + inline zero_t::operator T () const { mlc_converts_to(int, T)::check(); diff --git a/milena/mln/logical/and.hh b/milena/mln/logical/and.hh index 93dc532..a15a1e6 100644 --- a/milena/mln/logical/and.hh +++ b/milena/mln/logical/and.hh @@ -84,6 +84,7 @@ namespace mln { template <typename L, typename R, typename O> + inline void and__(const L& lhs, const R& rhs, O& output) { trace::entering("logical::impl::generic::and__"); @@ -103,6 +104,7 @@ namespace mln // Facades. template <typename L, typename R> + inline mln_concrete(L) and_(const Image<L>& lhs, const Image<R>& rhs) { trace::entering("logical::and_"); @@ -119,6 +121,7 @@ namespace mln } template <typename L, typename R> + inline void and_inplace(Image<L>& lhs, const Image<R>& rhs) { trace::entering("logical::and_inplace"); diff --git a/milena/mln/logical/and.spe.hh b/milena/mln/logical/and.spe.hh index ac31c3d..57ca273 100644 --- a/milena/mln/logical/and.spe.hh +++ b/milena/mln/logical/and.spe.hh @@ -55,6 +55,7 @@ namespace mln } template <typename L, typename R, typename O> + inline void and__(trait::image::speed::any, const L& lhs, trait::image::speed::any, const R& rhs, O& output) { @@ -62,6 +63,7 @@ namespace mln } template <typename L, typename R, typename O> + inline void and__(trait::image::speed::fastest, const L& lhs, trait::image::speed::fastest, const R& rhs, O& output) { diff --git a/milena/mln/logical/and_not.hh b/milena/mln/logical/and_not.hh index 77db0da..f4afe51 100644 --- a/milena/mln/logical/and_not.hh +++ b/milena/mln/logical/and_not.hh @@ -83,6 +83,7 @@ namespace mln namespace generic { template <typename L, typename R, typename O> + inline void and_not_(const L& lhs, const R& rhs, O& output) { trace::entering("logical::impl::generic::and_not_"); @@ -101,6 +102,7 @@ namespace mln // Facades. template <typename L, typename R> + inline mln_concrete(L) and_not(const Image<L>& lhs, const Image<R>& rhs) { trace::entering("logical::and_not"); @@ -117,6 +119,7 @@ namespace mln } template <typename L, typename R> + inline void and_not_inplace(Image<L>& lhs, const Image<R>& rhs) { trace::entering("logical::and_not_inplace"); diff --git a/milena/mln/logical/and_not.spe.hh b/milena/mln/logical/and_not.spe.hh index 5b3f73a..2b250f1 100644 --- a/milena/mln/logical/and_not.spe.hh +++ b/milena/mln/logical/and_not.spe.hh @@ -56,6 +56,7 @@ namespace mln template <typename L, typename R, typename O> + inline void and_not_(trait::image::speed::any, const L& lhs, trait::image::speed::any, const R& rhs, O& output) { @@ -63,6 +64,7 @@ namespace mln } template <typename L, typename R, typename O> + inline void and_not_(trait::image::speed::fastest, const L& lhs, trait::image::speed::fastest, const R& rhs, O& output) { diff --git a/milena/mln/logical/not.hh b/milena/mln/logical/not.hh index a169d4e..69e5a29 100644 --- a/milena/mln/logical/not.hh +++ b/milena/mln/logical/not.hh @@ -81,6 +81,7 @@ namespace mln namespace generic { template <typename I, typename O> + inline void not__(const I& input, O& output) { trace::entering("logical::impl::generic::not__"); @@ -99,6 +100,7 @@ namespace mln // Facades. template <typename I> + inline mln_concrete(I) not_(const Image<I>& input) { trace::entering("logical::not"); @@ -114,6 +116,7 @@ namespace mln } template <typename I> + inline void not_inplace(Image<I>& input) { trace::entering("logical::not_inplace"); diff --git a/milena/mln/logical/not.spe.hh b/milena/mln/logical/not.spe.hh index 2dec1aa..e12f0dd 100644 --- a/milena/mln/logical/not.spe.hh +++ b/milena/mln/logical/not.spe.hh @@ -55,12 +55,14 @@ namespace mln } template <typename I, typename O> + inline void not__(trait::image::speed::any, const I& input, O& output) { generic::not__(input, output); } template <typename I, typename O> + inline void not__(trait::image::speed::fastest, const I& input, O& output) { trace::entering("logical::impl::not__"); diff --git a/milena/mln/logical/or.hh b/milena/mln/logical/or.hh index 7dda4ce..0995591 100644 --- a/milena/mln/logical/or.hh +++ b/milena/mln/logical/or.hh @@ -83,6 +83,7 @@ namespace mln namespace generic { template <typename L, typename R, typename O> + inline void or__(const L& lhs, const R& rhs, O& output) { trace::entering("logical::impl::generic::or__"); @@ -101,6 +102,7 @@ namespace mln // Facades. template <typename L, typename R> + inline mln_concrete(L) or_(const Image<L>& lhs, const Image<R>& rhs) { trace::entering("logical::or_"); @@ -117,6 +119,7 @@ namespace mln } template <typename L, typename R> + inline void or_inplace(Image<L>& lhs, const Image<R>& rhs) { trace::entering("logical::or_inplace"); diff --git a/milena/mln/logical/or.spe.hh b/milena/mln/logical/or.spe.hh index 70ae873..05e7dd0 100644 --- a/milena/mln/logical/or.spe.hh +++ b/milena/mln/logical/or.spe.hh @@ -54,6 +54,7 @@ namespace mln } template <typename L, typename R, typename O> + inline void or__(trait::image::speed::any, const L& lhs, trait::image::speed::any, const R& rhs, O& output) { @@ -61,6 +62,7 @@ namespace mln } template <typename L, typename R, typename O> + inline void or__(trait::image::speed::fastest, const L& lhs, trait::image::speed::fastest, const R& rhs, O& output) { diff --git a/milena/mln/make/box1d.hh b/milena/mln/make/box1d.hh index 8a710b6..9fbc292 100644 --- a/milena/mln/make/box1d.hh +++ b/milena/mln/make/box1d.hh @@ -70,6 +70,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY + inline mln::box1d box1d(unsigned ninds) { mln_precondition(ninds != 0); @@ -78,6 +79,7 @@ namespace mln return tmp; } + inline mln::box1d box1d(int min_ind, int max_ind) { mln_precondition(max_ind >= min_ind); diff --git a/milena/mln/make/box2d.hh b/milena/mln/make/box2d.hh index 6c3e060..c19cb9d 100644 --- a/milena/mln/make/box2d.hh +++ b/milena/mln/make/box2d.hh @@ -74,6 +74,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY + inline mln::box2d box2d(unsigned nrows, unsigned ncols) { mln_precondition(nrows != 0 && ncols != 0); @@ -82,6 +83,7 @@ namespace mln return tmp; } + inline mln::box2d box2d(int min_row, int min_col, int max_row, int max_col) { diff --git a/milena/mln/make/box2d_h.hh b/milena/mln/make/box2d_h.hh index a21f0ea..db9066a 100644 --- a/milena/mln/make/box2d_h.hh +++ b/milena/mln/make/box2d_h.hh @@ -74,6 +74,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY + inline mln::box2d_h box2d_h(unsigned nrows, unsigned ncols) { mln_precondition(nrows != 0 && ncols != 0); @@ -82,6 +83,7 @@ namespace mln return tmp; } + inline mln::box2d_h box2d_h(int min_row, int min_col, int max_row, int max_col) { diff --git a/milena/mln/make/box3d.hh b/milena/mln/make/box3d.hh index 4dbad71..d22b9e5 100644 --- a/milena/mln/make/box3d.hh +++ b/milena/mln/make/box3d.hh @@ -80,6 +80,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY + inline mln::box3d box3d(unsigned nslis, unsigned nrows, unsigned ncols) { mln_precondition(nrows != 0 && ncols != 0 && nslis != 0); @@ -88,6 +89,7 @@ namespace mln return tmp; } + inline mln::box3d box3d(int min_sli, int max_sli, int min_row, int max_row, int min_col, int max_col) diff --git a/milena/mln/make/dpoint1d.hh b/milena/mln/make/dpoint1d.hh index 1336f1f..3a62e70 100644 --- a/milena/mln/make/dpoint1d.hh +++ b/milena/mln/make/dpoint1d.hh @@ -53,6 +53,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY + inline mln::dpoint1d dpoint1d(int ind) { mln::dpoint1d tmp; diff --git a/milena/mln/make/dpoint2d.hh b/milena/mln/make/dpoint2d.hh index b989406..f3a3f91 100644 --- a/milena/mln/make/dpoint2d.hh +++ b/milena/mln/make/dpoint2d.hh @@ -54,6 +54,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY + inline mln::dpoint2d dpoint2d(int row, int col) { mln::dpoint2d tmp; diff --git a/milena/mln/make/dpoint2d_h.hh b/milena/mln/make/dpoint2d_h.hh index 6119cfe..b45d56d 100644 --- a/milena/mln/make/dpoint2d_h.hh +++ b/milena/mln/make/dpoint2d_h.hh @@ -54,6 +54,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY + inline mln::dpoint2d_h dpoint2d_h(int row, int col) { mln::dpoint2d_h tmp; diff --git a/milena/mln/make/dpoint3d.hh b/milena/mln/make/dpoint3d.hh index eba1345..f7eb3fa 100644 --- a/milena/mln/make/dpoint3d.hh +++ b/milena/mln/make/dpoint3d.hh @@ -55,6 +55,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY + inline mln::dpoint3d dpoint3d(int sli, int row, int col) { mln::dpoint3d tmp; diff --git a/milena/mln/make/image2d.hh b/milena/mln/make/image2d.hh index 6a09a61..1bcf4f4 100644 --- a/milena/mln/make/image2d.hh +++ b/milena/mln/make/image2d.hh @@ -55,6 +55,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename V, unsigned R, unsigned C> + inline mln::image2d<V> image2d(V (&values)[R][C]) { diff --git a/milena/mln/make/mat.hh b/milena/mln/make/mat.hh index 8084447..cc525a6 100644 --- a/milena/mln/make/mat.hh +++ b/milena/mln/make/mat.hh @@ -53,6 +53,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <unsigned n, unsigned m, unsigned N, typename T> + inline metal::mat<n,m,T> mat(const T tab[N]) { mln_precondition(n * m == N); diff --git a/milena/mln/make/pix.hh b/milena/mln/make/pix.hh index cd28758..5aff487 100644 --- a/milena/mln/make/pix.hh +++ b/milena/mln/make/pix.hh @@ -56,6 +56,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I> + inline mln::util::pix<I> pix(const Image<I>& ima, const mln_psite(I)& p) { mln::util::pix<I> tmp(ima, p); diff --git a/milena/mln/make/pixel.hh b/milena/mln/make/pixel.hh index 0c1aa33..7f68927 100644 --- a/milena/mln/make/pixel.hh +++ b/milena/mln/make/pixel.hh @@ -55,6 +55,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I> + inline mln::pixel<const I> pixel(const Image<I>& ima, const mln_point(I)& p) { mln::pixel<const I> tmp(exact(ima), p); @@ -62,6 +63,7 @@ namespace mln } template <typename I> + inline mln::pixel<I> pixel(Image<I>& ima, const mln_point(I)& p) { mln::pixel<I> tmp(exact(ima), p); diff --git a/milena/mln/make/point1d.hh b/milena/mln/make/point1d.hh index 55b0017..8757524 100644 --- a/milena/mln/make/point1d.hh +++ b/milena/mln/make/point1d.hh @@ -53,6 +53,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY + inline mln::point1d point1d(int ind) { mln::point1d tmp; diff --git a/milena/mln/make/point2d.hh b/milena/mln/make/point2d.hh index 4764a2d..daa03c2 100644 --- a/milena/mln/make/point2d.hh +++ b/milena/mln/make/point2d.hh @@ -54,6 +54,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY + inline mln::point2d point2d(int row, int col) { mln::point2d tmp; diff --git a/milena/mln/make/point2d_h.hh b/milena/mln/make/point2d_h.hh index c5b28d5..c984bd6 100644 --- a/milena/mln/make/point2d_h.hh +++ b/milena/mln/make/point2d_h.hh @@ -54,6 +54,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY + inline mln::point2d_h point2d_h(int row, int col) { mln::point2d_h tmp; diff --git a/milena/mln/make/point3d.hh b/milena/mln/make/point3d.hh index 59521ec..3686e78 100644 --- a/milena/mln/make/point3d.hh +++ b/milena/mln/make/point3d.hh @@ -55,6 +55,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY + inline mln::point3d point3d(int sli, int row, int col) { mln::point3d tmp; diff --git a/milena/mln/make/vec.hh b/milena/mln/make/vec.hh index 45491d2..7e6e3ad 100644 --- a/milena/mln/make/vec.hh +++ b/milena/mln/make/vec.hh @@ -89,6 +89,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename T> + inline metal::vec<1, T> vec(const T& v_0) { metal::vec<1, T> tmp; @@ -97,6 +98,7 @@ namespace mln } template <typename T> + inline metal::vec<2, T> vec(const T& v_0, const T& v_1) { metal::vec<2, T> tmp; @@ -106,6 +108,7 @@ namespace mln } template <typename T> + inline metal::vec<3, T> vec(const T& v_0, const T& v_1, const T& v_2) { metal::vec<3, T> tmp; @@ -116,6 +119,7 @@ namespace mln } template <typename T> + inline metal::vec<4, T> vec(const T& v_0, const T& v_1, const T& v_2, const T& v_3) { metal::vec<4, T> tmp; diff --git a/milena/mln/make/voronoi.hh b/milena/mln/make/voronoi.hh index 420165b..0ee2525 100644 --- a/milena/mln/make/voronoi.hh +++ b/milena/mln/make/voronoi.hh @@ -55,6 +55,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I, typename N> + inline mesh_p<mln_psite(I)> voronoi (Image<I>& ima_, Image<I>& orig_, diff --git a/milena/mln/make/w_window.hh b/milena/mln/make/w_window.hh index d34fddb..bc453a1 100644 --- a/milena/mln/make/w_window.hh +++ b/milena/mln/make/w_window.hh @@ -60,6 +60,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename W, typename F> + inline mln::w_window<mln_dpoint(W), mln_result(F)> w_window(const Window<W>& win_, const Function_p2v<F>& wei_) { diff --git a/milena/mln/make/w_window1d.hh b/milena/mln/make/w_window1d.hh index e0fcac4..6fed983 100644 --- a/milena/mln/make/w_window1d.hh +++ b/milena/mln/make/w_window1d.hh @@ -60,6 +60,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename W, unsigned M> + inline mln::w_window<mln::dpoint1d, W> w_window1d(W (&weights)[M]) { diff --git a/milena/mln/make/w_window1d_int.hh b/milena/mln/make/w_window1d_int.hh index c3a2eed..6195796 100644 --- a/milena/mln/make/w_window1d_int.hh +++ b/milena/mln/make/w_window1d_int.hh @@ -58,6 +58,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <unsigned M> + inline mln::w_window1d_int w_window1d_int(int (&weights)[M]) { diff --git a/milena/mln/make/w_window2d.hh b/milena/mln/make/w_window2d.hh index b596400..3977c57 100644 --- a/milena/mln/make/w_window2d.hh +++ b/milena/mln/make/w_window2d.hh @@ -60,6 +60,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename W, unsigned M> + inline mln::w_window<mln::dpoint2d, W> w_window2d(W (&weights)[M]) { diff --git a/milena/mln/make/w_window2d_int.hh b/milena/mln/make/w_window2d_int.hh index 53e8070..e41b5d0 100644 --- a/milena/mln/make/w_window2d_int.hh +++ b/milena/mln/make/w_window2d_int.hh @@ -58,6 +58,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <unsigned M> + inline mln::w_window2d_int w_window2d_int(int (&weights)[M]) { diff --git a/milena/mln/make/w_window3d.hh b/milena/mln/make/w_window3d.hh index 7affe82..6be9b41 100644 --- a/milena/mln/make/w_window3d.hh +++ b/milena/mln/make/w_window3d.hh @@ -61,6 +61,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename W, unsigned M> + inline mln::w_window<mln::dpoint3d, W> w_window3d(W (&weights)[M]) { diff --git a/milena/mln/make/w_window3d_int.hh b/milena/mln/make/w_window3d_int.hh index 9291e40..b062dfc 100644 --- a/milena/mln/make/w_window3d_int.hh +++ b/milena/mln/make/w_window3d_int.hh @@ -58,6 +58,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <unsigned M> + inline mln::w_window3d_int w_window3d_int(int (&weights)[M]) { diff --git a/milena/mln/make/w_window_line.hh b/milena/mln/make/w_window_line.hh index 2aaa44e..11f445d 100644 --- a/milena/mln/make/w_window_line.hh +++ b/milena/mln/make/w_window_line.hh @@ -59,6 +59,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename D, typename W, unsigned L> + inline mln::w_window<D,W> w_window_line(W (&w)[L]) { mln_precondition(L % 2 == 1); diff --git a/milena/mln/make/window1d.hh b/milena/mln/make/window1d.hh index 72c5672..2c55bbf 100644 --- a/milena/mln/make/window1d.hh +++ b/milena/mln/make/window1d.hh @@ -59,6 +59,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <unsigned M> + inline mln::window1d window1d(bool (&values)[M]) { int h = M / 2; diff --git a/milena/mln/make/window2d.hh b/milena/mln/make/window2d.hh index 090e9ee..bbdb638 100644 --- a/milena/mln/make/window2d.hh +++ b/milena/mln/make/window2d.hh @@ -59,6 +59,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <unsigned M> + inline mln::window2d window2d(bool (&values)[M]) { int h = unsigned(std::sqrt(float(M))) / 2; diff --git a/milena/mln/make/window3d.hh b/milena/mln/make/window3d.hh index 6798ca9..52d3701 100644 --- a/milena/mln/make/window3d.hh +++ b/milena/mln/make/window3d.hh @@ -59,6 +59,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <unsigned M> + inline mln::window3d window3d(bool (&values)[M]) { int h = unsigned(std::pow(float(M), 1 / 3)) / 2; diff --git a/milena/mln/math/abs.hh b/milena/mln/math/abs.hh index 41885ce..6e5d16e 100644 --- a/milena/mln/math/abs.hh +++ b/milena/mln/math/abs.hh @@ -51,12 +51,14 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename T> + inline T abs(const T& v) { return std::abs(v); } template <unsigned n> + inline value::int_u<n> abs(const value::int_u<n>& v) { return v; diff --git a/milena/mln/math/max.hh b/milena/mln/math/max.hh index 183d3ab..e261625 100644 --- a/milena/mln/math/max.hh +++ b/milena/mln/math/max.hh @@ -47,6 +47,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename T> + inline T max(const T& v1, const T& v2) { return v1 > v2 ? v1 : v2; diff --git a/milena/mln/math/min.hh b/milena/mln/math/min.hh index 8080174..60b126a 100644 --- a/milena/mln/math/min.hh +++ b/milena/mln/math/min.hh @@ -47,6 +47,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename T> + inline T min(const T& v1, const T& v2) { return v1 < v2 ? v1 : v2; diff --git a/milena/mln/math/round.hh b/milena/mln/math/round.hh index 9f4fb27..298ebaf 100644 --- a/milena/mln/math/round.hh +++ b/milena/mln/math/round.hh @@ -61,6 +61,7 @@ namespace mln template <typename R> template <typename T> + inline R round<R>::operator()(const T& v) const { return (long int)(v + 0.49999); // FIXME: !!! diff --git a/milena/mln/math/round_sat.hh b/milena/mln/math/round_sat.hh index 9ddadb5..c37a905 100644 --- a/milena/mln/math/round_sat.hh +++ b/milena/mln/math/round_sat.hh @@ -62,6 +62,7 @@ namespace mln template <typename R> template <typename T> + inline R round_sat_<R>::operator()(const T& v) const { long int l = (long int)(v + 0.49999); // FIXME: !!! diff --git a/milena/mln/math/sign.hh b/milena/mln/math/sign.hh index 475a2d9..7181b27 100644 --- a/milena/mln/math/sign.hh +++ b/milena/mln/math/sign.hh @@ -55,6 +55,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename T> + inline sign_t sign(const T& v) { return v > 0 ? positive : (v < 0 ? negative : null); diff --git a/milena/mln/math/sqr.hh b/milena/mln/math/sqr.hh index e73d578..37d5e60 100644 --- a/milena/mln/math/sqr.hh +++ b/milena/mln/math/sqr.hh @@ -49,6 +49,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename T> + inline T sqr(const T& v) { return v * v; diff --git a/milena/mln/math/sqrt.hh b/milena/mln/math/sqrt.hh index fb6390b..8558a30 100644 --- a/milena/mln/math/sqrt.hh +++ b/milena/mln/math/sqrt.hh @@ -49,6 +49,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename T> + inline T sqrt(const T& v) { return std::sqrt(v); diff --git a/milena/mln/metal/bool.hh b/milena/mln/metal/bool.hh index 6d65457..71ace3a 100644 --- a/milena/mln/metal/bool.hh +++ b/milena/mln/metal/bool.hh @@ -76,10 +76,12 @@ namespace mln # ifndef MLN_INCLUDE_ONLY + inline void true_::check() { } + inline void false_::check_not() { } diff --git a/milena/mln/metal/int.hh b/milena/mln/metal/int.hh index 364fa56..0a69e3f 100644 --- a/milena/mln/metal/int.hh +++ b/milena/mln/metal/int.hh @@ -55,6 +55,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <int i> + inline std::string int_<i>::name() const { std::ostringstream o; diff --git a/milena/mln/metal/mat.hh b/milena/mln/metal/mat.hh index 05ec647..1affc19 100644 --- a/milena/mln/metal/mat.hh +++ b/milena/mln/metal/mat.hh @@ -263,6 +263,7 @@ namespace mln const mat<n,m,T> mat<n,m,T>::Id = mat<n,m,T>::identity(); template <unsigned n, unsigned m, typename T> + inline mat<n,m,T> mat<n,m,T>::identity() { static mat<n,m,T> id_; @@ -279,6 +280,7 @@ namespace mln template <unsigned n, unsigned m, typename T> template <typename U> + inline mat<n,m,T>::mat(const mat<n,m,U>& rhs) { for (unsigned i = 0; i < n; ++i) @@ -288,6 +290,7 @@ namespace mln template <unsigned n, unsigned m, typename T> template <typename F> + inline mat<n,m,T>::mat(const Function_i2v<F>& f_) { mlc_converts_to(mln_result(F), T)::check(); @@ -299,6 +302,7 @@ namespace mln template <unsigned n, unsigned m, typename T> template <typename U> + inline mat<n,m,T>& mat<n,m,T>::operator=(const mat<n,m,U>& rhs) { @@ -309,6 +313,7 @@ namespace mln } template <unsigned n, unsigned m, typename T> + inline const T& mat<n,m,T>::operator()(unsigned i, unsigned j) const { @@ -317,6 +322,7 @@ namespace mln } template <unsigned n, unsigned m, typename T> + inline T& mat<n,m,T>::operator()(unsigned i, unsigned j) { @@ -325,6 +331,7 @@ namespace mln } template <unsigned n, unsigned m, typename T> + inline void mat<n,m,T>::set_all(const T& val) { for (unsigned i = 0; i < n; ++i) @@ -333,6 +340,7 @@ namespace mln } template <unsigned n, unsigned m, typename T> + inline unsigned mat<n,m,T>::size() const { return n * m; @@ -343,6 +351,7 @@ namespace mln template <unsigned n, unsigned m, typename T, typename U> + inline bool operator==(const mat<n,m,T>& lhs, const mat<n,m,U>& rhs) { @@ -354,6 +363,7 @@ namespace mln } template <unsigned n, unsigned m, typename T, typename U> + inline mat<n, m, mln_trait_op_plus(T,U)> operator+(const mat<n,m,T>& lhs, const mat<n,m,U>& rhs) { @@ -365,6 +375,7 @@ namespace mln } template <unsigned n, unsigned m, typename T, typename U> + inline mat<n,m, mln_trait_op_minus(T,U)> operator-(const mat<n,m,T>& lhs, const mat<n,m,U>& rhs) { @@ -376,6 +387,7 @@ namespace mln } template <unsigned n, unsigned m, typename T> + inline mat<n,m, mln_trait_op_uminus(T)> operator-(const mat<n,m,T>& rhs) { @@ -388,6 +400,7 @@ namespace mln template <unsigned n, unsigned o, typename T, unsigned m, typename U> + inline mat<n, m, mln_sum_x(T,U)> operator*(const mat<n,o,T>& lhs, const mat<o,m,U>& rhs) { @@ -404,6 +417,7 @@ namespace mln template <unsigned n, unsigned m, typename T, typename U> + inline vec<n, mln_sum_x(T,U)> operator*(const mat<n,m,T>& lhs, const vec<m,U>& rhs) { @@ -419,6 +433,7 @@ namespace mln } template <unsigned n, unsigned m, typename T, typename S> + inline mat<n, m, mln_trait_op_times(T,S)> operator*(const mat<n,m,T>& lhs, const value::scalar_<S>& s_) { @@ -431,6 +446,7 @@ namespace mln } template <unsigned n, unsigned m, typename T, typename S> + inline mat<n,m, mln_trait_op_div(T,S)> operator/(const mat<n,m,T>& lhs, const value::scalar_<S>& s_) { @@ -445,6 +461,7 @@ namespace mln // << template <unsigned n, unsigned m, typename T> + inline std::ostream& operator<<(std::ostream& ostr, const mat<n,m,T>& v) { diff --git a/milena/mln/metal/vec.hh b/milena/mln/metal/vec.hh index d58e4a4..2bb47a6 100644 --- a/milena/mln/metal/vec.hh +++ b/milena/mln/metal/vec.hh @@ -330,17 +330,20 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <unsigned n, typename T> + inline vec<n,T>::vec() { } template <unsigned n, typename T> + inline vec<n,T>::vec(const literal::zero_t&) { this->set_all(0); } template <unsigned n, typename T> + inline vec<n,T>& vec<n,T>::operator=(const literal::zero_t&) { @@ -349,6 +352,7 @@ namespace mln } template <unsigned n, typename T> + inline vec<n,T>::vec(const vec<n,T>& rhs) : super_() { @@ -358,6 +362,7 @@ namespace mln template <unsigned n, typename T> template <typename U> + inline vec<n,T>::vec(const vec<n, U>& rhs) : super_() { @@ -367,6 +372,7 @@ namespace mln template <unsigned n, typename T> template <typename U> + inline vec<n,T>& vec<n,T>::operator=(const vec<n, U>& rhs) { for (unsigned i = 0; i < n; ++i) @@ -375,6 +381,7 @@ namespace mln } template <unsigned n, typename T> + inline const T& vec<n,T>::operator[](unsigned i) const { mln_precondition(i < dim); @@ -382,6 +389,7 @@ namespace mln } template <unsigned n, typename T> + inline T& vec<n,T>::operator[](unsigned i) { mln_precondition(i < dim); @@ -389,6 +397,7 @@ namespace mln } template <unsigned n, typename T> + inline void vec<n,T>::set_all(const T& val) { for (unsigned i = 0; i < n; ++i) @@ -396,12 +405,14 @@ namespace mln } template <unsigned n, typename T> + inline unsigned vec<n,T>::size() const { return n; } template <unsigned n, typename T> + inline const vec<n, T>& vec<n, T>::normalize() { float n_l2 = 0; @@ -415,6 +426,7 @@ namespace mln template <unsigned n, typename T> template <typename F> + inline vec<n, T>::vec(const Function_i2v<F>& f_) { mlc_converts_to(mln_result(F), T)::check(); @@ -435,6 +447,7 @@ namespace mln template <unsigned n, typename T, typename U> + inline bool operator==(const vec<n,T>& lhs, const vec<n,U>& rhs) { for (unsigned i = 0; i < n; ++i) @@ -445,6 +458,7 @@ namespace mln template <unsigned n, typename T, typename U> + inline vec<n, mln_trait_op_plus(T,U)> operator+(const vec<n,T>& lhs, const vec<n,U>& rhs) { @@ -455,6 +469,7 @@ namespace mln } template <unsigned n, typename T, typename U> + inline vec<n, mln_trait_op_minus(T,U)> operator-(const vec<n,T>& lhs, const vec<n,U>& rhs) { @@ -465,6 +480,7 @@ namespace mln } template <unsigned n, typename T, typename U> + inline mln_sum_x(T,U) operator*(const vec<n,T>& lhs, const vec<n,U>& rhs) { @@ -475,6 +491,7 @@ namespace mln } template <unsigned n, typename T, typename S> + inline vec<n, mln_trait_op_times(T, S)> operator*(const vec<n,T>& lhs, const mln::value::scalar_<S>& s) { @@ -495,6 +512,7 @@ namespace mln } template <unsigned n, typename T, typename S> + inline vec<n, mln_trait_op_div(T, S)> operator/(const vec<n,T>& lhs, const mln::value::scalar_<S>& s) { @@ -507,6 +525,7 @@ namespace mln template <unsigned n, typename T> + inline std::ostream& operator<<(std::ostream& ostr, const vec<n,T>& v) { @@ -519,6 +538,7 @@ namespace mln // vprod template <typename T, typename U> + inline vec<3, mln_trait_op_times(T,U)> // FIXME: typename binary_arith_trait<T, U>::ret> vprod(const vec<3, T>& lhs, const vec<3, U>& rhs) { diff --git a/milena/mln/morpho/Rd.hh b/milena/mln/morpho/Rd.hh index ea81cad..ac37ce6 100644 --- a/milena/mln/morpho/Rd.hh +++ b/milena/mln/morpho/Rd.hh @@ -62,6 +62,7 @@ namespace mln { template <typename I> + inline std::vector<unsigned> compute_histo(const I& ima) { std::vector<unsigned> h(256, 0); @@ -72,6 +73,7 @@ namespace mln } template <typename I> + inline std::vector<mln_point(I)> histo_reverse_sort(const I& ima) { std::vector<unsigned> h = compute_histo(ima); @@ -108,6 +110,7 @@ namespace mln mln_ch_value(I, point) parent; std::vector<point> S; + inline Rd(const I& f, const I& g, const N& nbh) : f(f), g(g), nbh(nbh), o(f.domain()), @@ -150,16 +153,19 @@ namespace mln } + inline bool is_proc__(const point& n, const point& p) const { return g(n) > g(p) || (g(n) == g(p) && n < p); } + inline void make_set(const point& p) { parent(p) = p; } + inline point find_root(const point& x) { if (parent(x) == x) @@ -168,11 +174,13 @@ namespace mln return parent(x) = find_root(parent(x)); } + inline bool equiv(const point& r, const point& p) { return g(r) == g(p) || g(p) >= o(r); } + inline void do_union(const point& n, const point& p) { point r = find_root(n); @@ -197,6 +205,7 @@ namespace mln // facade template <typename I, typename N> + inline I Rd(const Image<I>& f, const Image<I>& g, const Neighborhood<N>& nbh) { assert(f <= g); diff --git a/milena/mln/morpho/closing.hh b/milena/mln/morpho/closing.hh index 6a100cf..772c17e 100644 --- a/milena/mln/morpho/closing.hh +++ b/milena/mln/morpho/closing.hh @@ -53,6 +53,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I, typename W> + inline mln_concrete(I) closing(const Image<I>& input, const Window<W>& win) { trace::entering("morpho::closing"); diff --git a/milena/mln/morpho/complementation.hh b/milena/mln/morpho/complementation.hh index ae56bf2..2bb63e3 100644 --- a/milena/mln/morpho/complementation.hh +++ b/milena/mln/morpho/complementation.hh @@ -70,6 +70,7 @@ namespace mln // Binary => morphology on sets. template <typename I> + inline mln_concrete(I) complementation_(trait::image::kind::logic, const Image<I>& input) @@ -78,6 +79,7 @@ namespace mln } template <typename I> + inline void complementation_inplace_(trait::image::kind::logic, Image<I>& input) @@ -89,6 +91,7 @@ namespace mln // Otherwise => morphology on functions. template <typename I> + inline mln_concrete(I) complementation_(trait::image::kind::any, const Image<I>& input) @@ -97,6 +100,7 @@ namespace mln } template <typename I> + inline void complementation_inplace_(trait::image::kind::any, Image<I>& input) @@ -110,6 +114,7 @@ namespace mln // Facades. template <typename I> + inline mln_concrete(I) complementation(const Image<I>& input) { trace::entering("morpho::complementation"); @@ -123,6 +128,7 @@ namespace mln } template <typename I> + inline void complementation_inplace(Image<I>& input) { trace::entering("morpho::complementation_inplace"); diff --git a/milena/mln/morpho/contrast.hh b/milena/mln/morpho/contrast.hh index ae4f12e..545dfca 100644 --- a/milena/mln/morpho/contrast.hh +++ b/milena/mln/morpho/contrast.hh @@ -55,6 +55,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I, typename W> + inline mln_concrete(I) contrast(const Image<I>& input, const Window<W>& win) { trace::entering("morpho::contrast"); diff --git a/milena/mln/morpho/dilation.hh b/milena/mln/morpho/dilation.hh index aa2a6a4..9a74c33 100644 --- a/milena/mln/morpho/dilation.hh +++ b/milena/mln/morpho/dilation.hh @@ -64,6 +64,7 @@ namespace mln // On function. template <typename I, typename W, typename O> + inline void dilation_on_function(const Image<I>& input_, const Window<W>& win_, Image<O>& output_) { const I& input = exact(input_); @@ -86,6 +87,7 @@ namespace mln // On set. template <typename I, typename W, typename O> + inline void dilation_on_set(const Image<I>& input_, const Window<W>& win_, Image<O>& output_) { const I& input = exact(input_); @@ -116,6 +118,7 @@ namespace mln // Stage 2: dispatch w.r.t. the value kind. template <typename I, typename W, typename O> + inline void dilation_wrt_value(trait::image::kind::logic, // binary => morphology on sets const Image<I>& input, const Window<W>& win, Image<O>& output) { @@ -123,6 +126,7 @@ namespace mln } template <typename K, typename I, typename W, typename O> + inline void dilation_wrt_value(K, // otherwise => morphology on functions const Image<I>& input, const Window<W>& win, Image<O>& output) { @@ -136,6 +140,7 @@ namespace mln // V template <typename I, typename W, typename O> + inline void dilation_wrt_win(const Image<I>& input, const Window<W>& win, Image<O>& output) { dilation_wrt_value(mln_trait_image_kind(I)(), exact(input), exact(win), output); @@ -146,6 +151,7 @@ namespace mln # ifdef MLN_CORE_WIN_RECTANGLE2D_HH template <typename I, typename O> + inline void dilation_wrt_win(const Image<I>& input, const win::rectangle2d& win, Image<O>& output) { O temp(exact(output).domain()); diff --git a/milena/mln/morpho/dilation_fast.hh b/milena/mln/morpho/dilation_fast.hh index a8566b8..bd551f7 100644 --- a/milena/mln/morpho/dilation_fast.hh +++ b/milena/mln/morpho/dilation_fast.hh @@ -96,6 +96,7 @@ namespace mln // ctor + inline dilation_fast_t(const I& input_, const W& win_, O& output_) : // i/o @@ -119,6 +120,7 @@ namespace mln // parts + inline void init() { max.init(); @@ -127,6 +129,7 @@ namespace mln max.take(input(q)); } + inline void down() { for_all(q_dm) if (input.has(q_dm)) @@ -136,6 +139,7 @@ namespace mln output(p) = max.to_result(); } + inline void fwd() { for_all(q_fm) if (input.has(q_fm)) @@ -145,6 +149,7 @@ namespace mln output(p) = max.to_result(); } + inline void bkd() { for_all(q_bm) if (input.has(q_bm)) @@ -158,6 +163,7 @@ namespace mln template <typename I, typename W, typename O> + inline void dilation_fast_(const Image<I>& input, const Window<W>& win, O& output) { // FIXME: resize border! @@ -171,6 +177,7 @@ namespace mln // Facades. template <typename I, typename W, typename O> + inline void dilation_fast(const Image<I>& input, const Window<W>& win, Image<O>& output) { diff --git a/milena/mln/morpho/erosion.hh b/milena/mln/morpho/erosion.hh index 8ab517f..b9479f1 100644 --- a/milena/mln/morpho/erosion.hh +++ b/milena/mln/morpho/erosion.hh @@ -63,6 +63,7 @@ namespace mln // On function. template <typename I, typename W> + inline mln_concrete(I) erosion_on_function_(const I& input, const W& win) { @@ -89,6 +90,7 @@ namespace mln // On set. template <typename I, typename W> + inline mln_concrete(I) erosion_on_set_(const I& input, const W& win) { @@ -137,6 +139,7 @@ namespace mln // Facades. template <typename I, typename W> + inline mln_concrete(I) erosion(const Image<I>& input, const Window<W>& win) { diff --git a/milena/mln/morpho/erosion.spe.hh b/milena/mln/morpho/erosion.spe.hh index 03b2e14..19b229f 100644 --- a/milena/mln/morpho/erosion.spe.hh +++ b/milena/mln/morpho/erosion.spe.hh @@ -96,6 +96,7 @@ namespace mln template <typename I, typename W> + inline mln_concrete(I) erosion_iterative_(trait::image::kind::any, trait::image::speed::any, @@ -106,6 +107,7 @@ namespace mln template <typename I, typename W> + inline mln_concrete(I) erosion_iterative_(trait::image::kind::any, trait::image::speed::fastest, @@ -139,6 +141,7 @@ namespace mln template <typename I, typename W> + inline mln_concrete(I) erosion_iterative_(trait::image::kind::logic, trait::image::speed::any, @@ -149,6 +152,7 @@ namespace mln template <typename I, typename W> + inline mln_concrete(I) erosion_iterative_(trait::image::kind::logic, trait::image::speed::fastest, @@ -198,6 +202,7 @@ namespace mln // Facade. template <typename I, typename W> + inline mln_concrete(I) erosion_iterative_(const I& input, const W& win) { @@ -322,6 +327,7 @@ namespace mln template <typename I, typename W> + inline mln_concrete(I) erosion_(const I& input, const W& win) { @@ -331,6 +337,7 @@ namespace mln template <typename I> + inline mln_concrete(I) erosion_(const I& input, const win::rectangle2d& win) { @@ -346,6 +353,7 @@ namespace mln template <typename I> + inline mln_concrete(I) erosion_(const I& input, const win::octagon2d& win) { diff --git a/milena/mln/morpho/erosion_fast.hh b/milena/mln/morpho/erosion_fast.hh index af4dd13..ff10f36 100644 --- a/milena/mln/morpho/erosion_fast.hh +++ b/milena/mln/morpho/erosion_fast.hh @@ -96,6 +96,7 @@ namespace mln // ctor + inline erosion_fast_t(const I& input_, const W& win_, O& output_) : // i/o @@ -119,6 +120,7 @@ namespace mln // parts + inline void init() { min.init(); @@ -127,6 +129,7 @@ namespace mln min.take(input(q)); } + inline void down() { for_all(q_dm) if (input.has(q_dm)) @@ -136,6 +139,7 @@ namespace mln output(p) = min.to_result(); } + inline void fwd() { for_all(q_fm) if (input.has(q_fm)) @@ -145,6 +149,7 @@ namespace mln output(p) = min.to_result(); } + inline void bkd() { for_all(q_bm) if (input.has(q_bm)) @@ -158,6 +163,7 @@ namespace mln template <typename I, typename W, typename O> + inline void erosion_fast_(const Image<I>& input, const Window<W>& win, O& output) { // FIXME: resize border! @@ -171,6 +177,7 @@ namespace mln // Facades. template <typename I, typename W, typename O> + inline void erosion_fast(const Image<I>& input, const Window<W>& win, Image<O>& output) { diff --git a/milena/mln/morpho/gradient.hh b/milena/mln/morpho/gradient.hh index 489519e..b41b6ba 100644 --- a/milena/mln/morpho/gradient.hh +++ b/milena/mln/morpho/gradient.hh @@ -71,6 +71,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I, typename W> + inline mln_concrete(I) gradient(const Image<I>& input, const Window<W>& win) { trace::entering("morpho::gradient"); @@ -87,6 +88,7 @@ namespace mln template <typename I, typename W> + inline mln_concrete(I) gradient_internal(const Image<I>& input, const Window<W>& win) { trace::entering("morpho::gradient_internal"); @@ -103,6 +105,7 @@ namespace mln template <typename I, typename W> + inline mln_concrete(I) gradient_external(const Image<I>& input, const Window<W>& win) { trace::entering("morpho::gradient_external"); diff --git a/milena/mln/morpho/hit_or_miss.hh b/milena/mln/morpho/hit_or_miss.hh index dd2150d..5c8b2aa 100644 --- a/milena/mln/morpho/hit_or_miss.hh +++ b/milena/mln/morpho/hit_or_miss.hh @@ -112,6 +112,7 @@ namespace mln // Preconditions. template <typename I, typename Wh, typename Wm> + inline void hit_or_miss_preconditions_(const Image<I>& input, const Window<Wh>& win_hit, const Window<Wm>& win_miss) { @@ -123,6 +124,7 @@ namespace mln // On sets. template <typename I, typename Wh, typename Wm> + inline mln_concrete(I) hit_or_miss_(trait::image::kind::logic, const I& input, @@ -136,6 +138,7 @@ namespace mln // On functions. template <typename I, typename Wh, typename Wm> + inline mln_concrete(I) hit_or_miss_(trait::image::kind::any, const I& input, @@ -194,6 +197,7 @@ namespace mln template <typename I, typename Wh, typename Wm> + inline mln_concrete(I) hit_or_miss(const Image<I>& input, const Window<Wh>& win_hit, const Window<Wm>& win_miss) @@ -211,6 +215,7 @@ namespace mln template <typename I, typename Wh, typename Wm> + inline mln_concrete(I) hit_or_miss_opening(const Image<I>& input, const Window<Wh>& win_hit, const Window<Wm>& win_miss) @@ -227,6 +232,7 @@ namespace mln template <typename I, typename Wh, typename Wm> + inline mln_concrete(I) hit_or_miss_background_opening(const Image<I>& input, const Window<Wh>& win_hit, const Window<Wm>& win_miss) @@ -244,6 +250,7 @@ namespace mln template <typename I, typename Wh, typename Wm> + inline mln_concrete(I) hit_or_miss_closing(const Image<I>& input, const Window<Wh>& win_hit, const Window<Wm>& win_miss) @@ -261,6 +268,7 @@ namespace mln template <typename I, typename Wh, typename Wm> + inline mln_concrete(I) hit_or_miss_background_closing(const Image<I>& input, const Window<Wh>& win_hit, const Window<Wm>& win_miss) diff --git a/milena/mln/morpho/laplacian.hh b/milena/mln/morpho/laplacian.hh index 236c4da..15566db 100644 --- a/milena/mln/morpho/laplacian.hh +++ b/milena/mln/morpho/laplacian.hh @@ -61,6 +61,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I, typename W, typename O> + inline void laplacian(const Image<I>& input, const Window<W>& win, Image<O>& output) { trace::entering("morpho::laplacian"); @@ -76,6 +77,7 @@ namespace mln } template <typename I, typename W> + inline mln_trait_op_minus_twice(mln_concrete(I)) laplacian(const Image<I>& input, const Window<W>& win) { diff --git a/milena/mln/morpho/min.hh b/milena/mln/morpho/min.hh index 8bac228..50b5a56 100644 --- a/milena/mln/morpho/min.hh +++ b/milena/mln/morpho/min.hh @@ -70,6 +70,7 @@ namespace mln // Binary => morphology on sets. template <typename I, typename J, typename O> + inline mln_concrete(I) min_(trait::image::kind::logic, const I& lhs, const J& rhs) { @@ -77,6 +78,7 @@ namespace mln } template <typename I, typename J> + inline void min_inplace_(trait::image::kind::logic, I& lhs, const J& rhs) { @@ -86,6 +88,7 @@ namespace mln // Otherwise => morphology on functions. template <typename I, typename J> + inline mln_concrete(I) min_(trait::image::kind::any, const I& lhs, const J& rhs) { @@ -93,6 +96,7 @@ namespace mln } template <typename I, typename J> + inline void min_inplace_(trait::image::kind::any, I& lhs, const J& rhs) { @@ -105,6 +109,7 @@ namespace mln // Facades. template <typename I, typename J> + inline mln_concrete(I) min(const Image<I>& lhs, const Image<J>& rhs) { @@ -118,6 +123,7 @@ namespace mln } template <typename I, typename J> + inline void min_inplace(Image<I>& lhs, const Image<J>& rhs) { trace::entering("morpho::min_inplace"); diff --git a/milena/mln/morpho/minus.hh b/milena/mln/morpho/minus.hh index 8b13524..5df6be2 100644 --- a/milena/mln/morpho/minus.hh +++ b/milena/mln/morpho/minus.hh @@ -69,6 +69,7 @@ namespace mln // Binary => morphology on sets. template <typename I, typename J> + inline mln_concrete(I) minus_(trait::image::kind::logic, const I& lhs, const J& rhs) { @@ -78,6 +79,7 @@ namespace mln // Otherwise => morphology on functions. template <typename I, typename J> + inline mln_concrete(I) minus_(trait::image::kind::any, const I& lhs, const J& rhs) { @@ -90,6 +92,7 @@ namespace mln // Facades. template <typename I, typename J> + inline mln_concrete(I) minus(const Image<I>& lhs, const Image<J>& rhs) { diff --git a/milena/mln/morpho/opening.hh b/milena/mln/morpho/opening.hh index 486b9b5..14ac91a 100644 --- a/milena/mln/morpho/opening.hh +++ b/milena/mln/morpho/opening.hh @@ -53,6 +53,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I, typename W> + inline mln_concrete(I) opening(const Image<I>& input, const Window<W>& win) { trace::entering("morpho::opening"); diff --git a/milena/mln/morpho/opening_area.hh b/milena/mln/morpho/opening_area.hh index 0b0c690..61cd8e5 100644 --- a/milena/mln/morpho/opening_area.hh +++ b/milena/mln/morpho/opening_area.hh @@ -53,6 +53,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I, typename N, typename O> + inline void opening_area(const Image<I>& input, const Neighborhood<N>& nbh, std::size_t lambda, Image<O>& output) { diff --git a/milena/mln/morpho/opening_attribute.hh b/milena/mln/morpho/opening_attribute.hh index befeea5..04e5967 100644 --- a/milena/mln/morpho/opening_attribute.hh +++ b/milena/mln/morpho/opening_attribute.hh @@ -80,16 +80,19 @@ namespace mln const S s; + inline void init() { // FIXME: border::fill(input, mln_max(mln_value(I))); } + inline bool is_active(const A& attr) const { return attr.to_result() < lambda; } + inline void inactivate(A& attr) { attr.set_value(lambda); @@ -97,6 +100,7 @@ namespace mln // end of requirements + inline opening_attribute_t(const I_& input, const N_& nbh, mln_result(A) lambda, O_& output) : input(input), nbh(nbh), lambda(lambda), output(output), s(level::sort_points_decreasing(input)) @@ -110,6 +114,7 @@ namespace mln template <typename A, typename I, typename N, typename O> + inline void opening_attribute(const Image<I>& input_, const Neighborhood<N>& nbh_, mln_result(A) lambda, Image<O>& output_) diff --git a/milena/mln/morpho/plus.hh b/milena/mln/morpho/plus.hh index f79047c..107955a 100644 --- a/milena/mln/morpho/plus.hh +++ b/milena/mln/morpho/plus.hh @@ -69,6 +69,7 @@ namespace mln // Binary => morphology on sets. template <typename I, typename J> + inline mln_concrete(I) plus_(trait::image::kind::logic, const I& lhs, const J& rhs) { @@ -78,6 +79,7 @@ namespace mln // Otherwise => morphology on functions. template <typename I, typename J> + inline mln_concrete(I) plus_(trait::image::kind::any, const I& lhs, const J& rhs) { @@ -90,6 +92,7 @@ namespace mln // Facades. template <typename I, typename J> + inline mln_concrete(I) plus(const Image<I>& lhs, const Image<J>& rhs) { trace::entering("morpho::plus"); diff --git a/milena/mln/morpho/thick_miss.hh b/milena/mln/morpho/thick_miss.hh index 15a7de2..168842f 100644 --- a/milena/mln/morpho/thick_miss.hh +++ b/milena/mln/morpho/thick_miss.hh @@ -56,6 +56,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I, typename Wfg, typename Wbg> + inline mln_concrete(I) thick_miss(const Image<I>& input, const Window<Wfg>& win_fg, const Window<Wbg>& win_bg) diff --git a/milena/mln/morpho/thickening.hh b/milena/mln/morpho/thickening.hh index b588423..0704bb8 100644 --- a/milena/mln/morpho/thickening.hh +++ b/milena/mln/morpho/thickening.hh @@ -56,6 +56,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I, typename Wfg, typename Wbg> + inline mln_concrete(I) thickening(const Image<I>& input, const Window<Wfg>& win_fg, const Window<Wbg>& win_bg) diff --git a/milena/mln/morpho/thin_fit.hh b/milena/mln/morpho/thin_fit.hh index 19d4826..07e92e9 100644 --- a/milena/mln/morpho/thin_fit.hh +++ b/milena/mln/morpho/thin_fit.hh @@ -56,6 +56,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I, typename Wfg, typename Wbg> + inline mln_concrete(I) thin_fit(const Image<I>& input, const Window<Wfg>& win_fg, const Window<Wbg>& win_bg) diff --git a/milena/mln/morpho/thinning.hh b/milena/mln/morpho/thinning.hh index 6222ea3..50905a7 100644 --- a/milena/mln/morpho/thinning.hh +++ b/milena/mln/morpho/thinning.hh @@ -59,6 +59,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I, typename Wfg, typename Wbg> + inline mln_concrete(I) thinning(const Image<I>& input, const Window<Wfg>& win_fg, const Window<Wbg>& win_bg) diff --git a/milena/mln/morpho/top_hat.hh b/milena/mln/morpho/top_hat.hh index d0e5a54..6128f19 100644 --- a/milena/mln/morpho/top_hat.hh +++ b/milena/mln/morpho/top_hat.hh @@ -78,6 +78,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I, typename W> + inline mln_concrete(I) top_hat_white(const Image<I>& input, const Window<W>& win) { trace::entering("morpho::top_hat_white"); @@ -93,6 +94,7 @@ namespace mln } template <typename I, typename W> + inline mln_concrete(I) top_hat_black(const Image<I>& input, const Window<W>& win) { trace::entering("morpho::top_hat_black"); @@ -108,6 +110,7 @@ namespace mln } template <typename I, typename W> + inline mln_concrete(I) top_hat_self_complementary(const Image<I>& input, const Window<W>& win) { trace::entering("morpho::top_hat_self_complementary"); diff --git a/milena/mln/norm/l1.hh b/milena/mln/norm/l1.hh index b5f094b..6103a78 100644 --- a/milena/mln/norm/l1.hh +++ b/milena/mln/norm/l1.hh @@ -69,6 +69,7 @@ namespace mln namespace impl { template <unsigned n, typename C, typename V> + inline mln_sum(C) l1_(const V& vec) { @@ -79,6 +80,7 @@ namespace mln } template <unsigned n, typename C, typename V> + inline mln_sum(C) l1_distance_(const V& vec1, const V& vec2) { @@ -96,6 +98,7 @@ namespace mln `----------*/ template <unsigned n, typename C> + inline mln_sum(C) l1(const C (&vec)[n]) { @@ -103,6 +106,7 @@ namespace mln } template <unsigned n, typename C> + inline mln_sum(C) l1(const metal::vec<n,C>& vec) { @@ -110,6 +114,7 @@ namespace mln } template <unsigned n, typename C> + inline mln_sum(C) l1_distance(const C (&vec1)[n], const C (&vec2)[n]) { @@ -117,6 +122,7 @@ namespace mln } template <unsigned n, typename C> + inline mln_sum(C) l1_distance(const metal::vec<n,C>& vec1, const metal::vec<n,C>& vec2) { diff --git a/milena/mln/norm/l2.hh b/milena/mln/norm/l2.hh index de9d6d0..32b6361 100644 --- a/milena/mln/norm/l2.hh +++ b/milena/mln/norm/l2.hh @@ -71,6 +71,7 @@ namespace mln { template <unsigned n, typename C, typename V> + inline mln_sum(C) l2_(const V& vec) { @@ -81,6 +82,7 @@ namespace mln } template <unsigned n, typename C, typename V> + inline mln_sum(C) l2_distance_(const V& vec1, const V& vec2) { @@ -98,6 +100,7 @@ namespace mln `----------*/ template <unsigned n, typename C> + inline mln_sum(C) l2(const C (&vec)[n]) { @@ -105,6 +108,7 @@ namespace mln } template <unsigned n, typename C> + inline mln_sum(C) l2(const metal::vec<n,C>& vec) { @@ -112,6 +116,7 @@ namespace mln } template <unsigned n, typename C> + inline mln_sum(C) l2_distance(const C (&vec1)[n], const C (&vec2)[n]) { @@ -119,6 +124,7 @@ namespace mln } template <unsigned n, typename C> + inline mln_sum(C) l2_distance(const metal::vec<n,C>& vec1, const metal::vec<n,C>& vec2) { diff --git a/milena/mln/norm/linfty.hh b/milena/mln/norm/linfty.hh index ac5f917..56365c6 100644 --- a/milena/mln/norm/linfty.hh +++ b/milena/mln/norm/linfty.hh @@ -72,6 +72,7 @@ namespace mln { template <unsigned n, typename C, typename V> + inline C linfty_(const V& vec) { C m = 0; @@ -87,6 +88,7 @@ namespace mln } template <unsigned n, typename C, typename V> + inline C linfty_distance_(const V& vec1, const V& vec2) { C d = 0; @@ -109,24 +111,28 @@ namespace mln `----------*/ template <unsigned n, typename C> + inline C linfty(const C (&vec)[n]) { return impl::linfty_<n, C>(vec); } template <unsigned n, typename C> + inline C linfty(const metal::vec<n,C>& vec) { return impl::linfty_<n, C>(vec); } template <unsigned n, typename C> + inline C linfty_distance(const C (&vec1)[n], const C (&vec2)[n]) { return impl::linfty_distance_<n, C>(vec1, vec2); } template <unsigned n, typename C> + inline C linfty_distance(const metal::vec<n,C>& vec1, const metal::vec<n,C>& vec2) { diff --git a/milena/mln/pw/cst.hh b/milena/mln/pw/cst.hh index 444f391..9887a83 100644 --- a/milena/mln/pw/cst.hh +++ b/milena/mln/pw/cst.hh @@ -71,6 +71,7 @@ namespace mln // pw::cst_<T> template <typename T> + inline cst_<T>::cst_(const T& t) : t_(t) { @@ -78,6 +79,7 @@ namespace mln template <typename T> template <typename P> + inline T cst_<T>::operator()(const P&) const { @@ -87,6 +89,7 @@ namespace mln // pw::cst(t) template <typename T> + inline cst_<T> cst(const T& t) { cst_<T> tmp(t); diff --git a/milena/mln/pw/image.hh b/milena/mln/pw/image.hh index 5a32f04..b0d642f 100644 --- a/milena/mln/pw/image.hh +++ b/milena/mln/pw/image.hh @@ -156,6 +156,7 @@ namespace mln // Operator. template <typename F, typename S> + inline pw::image<F,S> operator | (const Function_p2v<F>& f, const Point_Set<S>& ps) { @@ -169,6 +170,7 @@ namespace mln { template <typename F, typename S> + inline data_< pw::image<F,S> >::data_(const F& f, const S& ps) : f_(f), pset_(ps) @@ -183,23 +185,27 @@ namespace mln { template <typename F, typename S> + inline image<F,S>::image() { } template <typename F, typename S> + inline image<F,S>::image(const Function_p2v<F>& f, const Point_Set<S>& ps) { this->data_ = new internal::data_< pw::image<F,S> >(exact(f), exact(ps)); } template <typename F, typename S> + inline bool image<F,S>::owns_(const mln_psite(S)& p) const { return this->data_->pset_.has(p); } template <typename F, typename S> + inline const S& image<F,S>::domain() const { @@ -207,6 +213,7 @@ namespace mln } template <typename F, typename S> + inline mln_result(F) image<F,S>::operator()(const mln_psite(S)& p) const { @@ -215,6 +222,7 @@ namespace mln } template <typename F, typename S> + inline void image<F,S>::operator()(const mln_psite(S)&) { @@ -222,6 +230,7 @@ namespace mln } template <typename F, typename S> + inline const mln::value::set<mln_result(F)>& image<F,S>::values() const { diff --git a/milena/mln/pw/value.hh b/milena/mln/pw/value.hh index ca4c677..9f6a7e2 100644 --- a/milena/mln/pw/value.hh +++ b/milena/mln/pw/value.hh @@ -72,12 +72,14 @@ namespace mln // pw::value_<I> template <typename I> + inline value_<I>::value_(const I& ima) : ima_(ima) { } template <typename I> + inline mln_rvalue(I) value_<I>::operator()(const mln_psite(I)& p) const { @@ -88,6 +90,7 @@ namespace mln // pw::value(ima) template <typename I> + inline value_<I> value(const Image<I>& ima) { diff --git a/milena/mln/pw/var.hh b/milena/mln/pw/var.hh index 46bb787..0524a69 100644 --- a/milena/mln/pw/var.hh +++ b/milena/mln/pw/var.hh @@ -68,6 +68,7 @@ namespace mln // pw::var_<V> template <typename V> + inline var_<V>::var_(const V& v) : v_(v) { @@ -75,6 +76,7 @@ namespace mln template <typename V> template <typename P> + inline const V& var_<V>::operator()(const P&) const { @@ -84,6 +86,7 @@ namespace mln // pw::var(v) template <typename V> + inline var_<V> var(const V& v) { var_<V> tmp(v); diff --git a/milena/mln/set/diff.hh b/milena/mln/set/diff.hh index e69f17c..8060de0 100644 --- a/milena/mln/set/diff.hh +++ b/milena/mln/set/diff.hh @@ -69,6 +69,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename Wl, typename Wr> + inline window<mln_dpoint(Wl)> diff(const Window<Wl>& lhs, const Window<Wr>& rhs) { @@ -87,6 +88,7 @@ namespace mln } template <typename Wl, typename Wr> + inline p_set<mln_point(Wl)> diff(const Point_Set<Wl>& lhs, const Point_Set<Wr>& rhs) { diff --git a/milena/mln/set/inter.hh b/milena/mln/set/inter.hh index ab70097..deda1c0 100644 --- a/milena/mln/set/inter.hh +++ b/milena/mln/set/inter.hh @@ -66,6 +66,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename Wl, typename Wr> + inline window<mln_dpoint(Wl)> inter(const Window<Wl>& lhs, const Window<Wr>& rhs) { @@ -84,6 +85,7 @@ namespace mln } template <typename Wl, typename Wr> + inline p_set<mln_point(Wl)> inter(const Point_Set<Wl>& lhs, const Point_Set<Wr>& rhs) { diff --git a/milena/mln/set/sym_diff.hh b/milena/mln/set/sym_diff.hh index c2d5978..0b2d96b 100644 --- a/milena/mln/set/sym_diff.hh +++ b/milena/mln/set/sym_diff.hh @@ -65,6 +65,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename Wl, typename Wr> + inline window<mln_dpoint(Wl)> sym_diff(const Window<Wl>& lhs, const Window<Wr>& rhs) { @@ -83,6 +84,7 @@ namespace mln } template <typename Wl, typename Wr> + inline p_set<mln_point(Wl)> sym_diff(const Point_Set<Wl>& lhs, const Point_Set<Wr>& rhs) { diff --git a/milena/mln/set/uni.hh b/milena/mln/set/uni.hh index 1e38c09..79d193a 100644 --- a/milena/mln/set/uni.hh +++ b/milena/mln/set/uni.hh @@ -66,6 +66,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename Wl, typename Wr> + inline window<mln_dpoint(Wl)> uni(const Window<Wl>& lhs, const Window<Wr>& rhs) { @@ -84,6 +85,7 @@ namespace mln } template <typename Wl, typename Wr> + inline p_set<mln_point(Wl)> uni(const Point_Set<Wl>& lhs, const Point_Set<Wr>& rhs) { diff --git a/milena/mln/test/positive.hh b/milena/mln/test/positive.hh index 38c28d5..e796952 100644 --- a/milena/mln/test/positive.hh +++ b/milena/mln/test/positive.hh @@ -53,6 +53,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I> + inline bool positive(const Image<I>& input_) { const I& input = exact(input_); diff --git a/milena/mln/test/predicate.hh b/milena/mln/test/predicate.hh index dbee308..1310c43 100644 --- a/milena/mln/test/predicate.hh +++ b/milena/mln/test/predicate.hh @@ -69,6 +69,7 @@ namespace mln { template <typename I, typename F> + inline bool predicate_(trait::image::speed::any, const I& ima_, const F& f) { const I& ima = exact(ima_); @@ -80,6 +81,7 @@ namespace mln } template <typename I, typename F> + inline bool predicate_(trait::image::speed::fastest, const I& ima_, const F& f) { const I& ima = exact(ima_); @@ -91,6 +93,7 @@ namespace mln } template <typename S, typename F> + inline bool predicate_(const Point_Set<S>& pset, const F& f) { mln_piter(S) p(exact(pset)); @@ -106,6 +109,7 @@ namespace mln // Facades. template <typename I, typename F> + inline bool predicate(const Image<I>& ima, const Function_v2b<F>& f) { mln_precondition(exact(ima).has_data()); @@ -114,6 +118,7 @@ namespace mln } template <typename S, typename F> + inline bool predicate(const Point_Set<S>& pset, const Function_p2b<F>& f) { return impl::predicate_(exact(pset), exact(f)); diff --git a/milena/mln/trace/exiting.hh b/milena/mln/trace/exiting.hh index c8e4a30..d690dd1 100644 --- a/milena/mln/trace/exiting.hh +++ b/milena/mln/trace/exiting.hh @@ -49,6 +49,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY + inline void exiting(const std::string&) { if (quiet) diff --git a/milena/mln/trait/image/print.hh b/milena/mln/trait/image/print.hh index 9b1bfb5..d635e9c 100644 --- a/milena/mln/trait/image/print.hh +++ b/milena/mln/trait/image/print.hh @@ -62,6 +62,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I> + inline void print(std::ostream& ostr) { mlc_is_a(I, Image)::check(); @@ -82,6 +83,7 @@ namespace mln } template <typename I> + inline void print(const Image<I>&, std::ostream& ostr) { print<I>(ostr); diff --git a/milena/mln/trait/value/print.hh b/milena/mln/trait/value/print.hh index 349e3d5..850af63 100644 --- a/milena/mln/trait/value/print.hh +++ b/milena/mln/trait/value/print.hh @@ -62,6 +62,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename V> + inline void print(std::ostream& ostr) { mlc_is_a(V, Value)::check(); // FIXME: What about built-ins? @@ -76,6 +77,7 @@ namespace mln } template <typename V> + inline void print(const Value<V>&, std::ostream& ostr) { print<V>(ostr); diff --git a/milena/mln/util/branch_iter.hh b/milena/mln/util/branch_iter.hh index 88d8209..639e2d2 100644 --- a/milena/mln/util/branch_iter.hh +++ b/milena/mln/util/branch_iter.hh @@ -91,6 +91,7 @@ namespace mln template <typename T> + inline branch_iter<T>::branch_iter(branch<T> branch) : branch_(branch) { @@ -98,6 +99,7 @@ namespace mln } template <typename T> + inline branch_iter<T>::operator node<T>&() const { mln_assertion(n_); @@ -105,6 +107,7 @@ namespace mln } template <typename T> + inline util::node<T>& branch_iter<T>::operator*() { @@ -113,6 +116,7 @@ namespace mln } template <typename T> + inline unsigned branch_iter<T>::deepness() const { @@ -128,6 +132,7 @@ namespace mln } template <typename T> + inline bool branch_iter<T>::is_valid() const { @@ -135,6 +140,7 @@ namespace mln } template <typename T> + inline void branch_iter<T>::invalidate() { @@ -143,6 +149,7 @@ namespace mln template <typename T> + inline void branch_iter<T>::start() { @@ -152,6 +159,7 @@ namespace mln } template <typename T> + inline void branch_iter<T>::next() { diff --git a/milena/mln/util/branch_iter_ind.hh b/milena/mln/util/branch_iter_ind.hh index e50360f..6621226 100644 --- a/milena/mln/util/branch_iter_ind.hh +++ b/milena/mln/util/branch_iter_ind.hh @@ -103,6 +103,7 @@ namespace mln template <typename T> + inline branch_iter_ind<T>::branch_iter_ind(branch<T> branch) : branch_(branch) { @@ -110,6 +111,7 @@ namespace mln } template <typename T> + inline branch_iter_ind<T>::operator node<T>&() const { mln_assertion(n_); @@ -117,6 +119,7 @@ namespace mln } template <typename T> + inline util::node<T>& branch_iter_ind<T>::operator*() { @@ -125,6 +128,7 @@ namespace mln } template <typename T> + inline unsigned branch_iter_ind<T>::deepness() const { @@ -140,6 +144,7 @@ namespace mln } template <typename T> + inline bool branch_iter_ind<T>::is_valid() const { @@ -147,6 +152,7 @@ namespace mln } template <typename T> + inline void branch_iter_ind<T>::invalidate() { @@ -155,6 +161,7 @@ namespace mln template <typename T> + inline void branch_iter_ind<T>::start() { @@ -164,6 +171,7 @@ namespace mln } template <typename T> + inline void branch_iter_ind<T>::next() { diff --git a/milena/mln/util/eat.hh b/milena/mln/util/eat.hh index 14b94fb..27a53d6 100644 --- a/milena/mln/util/eat.hh +++ b/milena/mln/util/eat.hh @@ -60,16 +60,19 @@ namespace mln // eat + inline eat::eat() { } template <typename T> + inline eat::eat(const T&) { } template <typename T> + inline eat& eat::operator=(const T&) { diff --git a/milena/mln/util/graph.hh b/milena/mln/util/graph.hh index 8adca83..0341bcb 100644 --- a/milena/mln/util/graph.hh +++ b/milena/mln/util/graph.hh @@ -153,6 +153,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template<typename N, typename E> + inline graph<N, E>::graph () : nb_node_ (0), nb_link_ (0), @@ -162,6 +163,7 @@ namespace mln } template<typename N, typename E> + inline void graph<N, E>::add_node (void) { @@ -172,6 +174,7 @@ namespace mln } template<typename N, typename E> + inline void graph<N, E>::add_edge (unsigned n1, unsigned n2) { @@ -189,6 +192,7 @@ namespace mln } template<typename N, typename E> + inline void graph<N, E>::consistency () const { @@ -211,6 +215,7 @@ namespace mln } template<typename N, typename E> + inline void graph<N, E>::print_debug (std::ostream& ostr) const { diff --git a/milena/mln/util/ignore.hh b/milena/mln/util/ignore.hh index f8fd50d..2fd547e 100644 --- a/milena/mln/util/ignore.hh +++ b/milena/mln/util/ignore.hh @@ -57,11 +57,13 @@ namespace mln // ignore + inline ignore::ignore() { } template <typename T> + inline ignore::operator T() const { return T(); diff --git a/milena/mln/util/lazy_set.hh b/milena/mln/util/lazy_set.hh index 3d09a8f..b4ad0ef 100644 --- a/milena/mln/util/lazy_set.hh +++ b/milena/mln/util/lazy_set.hh @@ -199,12 +199,14 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename E> + inline lazy_set_<E>::lazy_set_() { needs_update_ = false; } template <typename E> + inline lazy_set_<E>& lazy_set_<E>::insert(const E& elt) { @@ -215,6 +217,7 @@ namespace mln } template <typename E> + inline lazy_set_<E>& lazy_set_<E>::remove(const E& elt) { @@ -226,6 +229,7 @@ namespace mln } template <typename E> + inline const E& lazy_set_<E>::element(unsigned i) const { @@ -236,6 +240,7 @@ namespace mln } template <typename E> + inline const E& lazy_set_<E>::operator[](unsigned i) const { @@ -243,6 +248,7 @@ namespace mln } template <typename E> + inline unsigned lazy_set_<E>::nelements() const { @@ -252,6 +258,7 @@ namespace mln } template <typename E> + inline bool lazy_set_<E>::has(const E& elt) const { @@ -259,6 +266,7 @@ namespace mln } template <typename E> + inline bool lazy_set_<E>::is_empty() const { @@ -266,6 +274,7 @@ namespace mln } template <typename E> + inline void lazy_set_<E>::clear() { @@ -276,6 +285,7 @@ namespace mln } template <typename E> + inline const std::vector<E>& lazy_set_<E>::vect() const { @@ -285,6 +295,7 @@ namespace mln } template <typename E> + inline void lazy_set_<E>::update_() const { diff --git a/milena/mln/util/nil.hh b/milena/mln/util/nil.hh index 8522376..43d73ef 100644 --- a/milena/mln/util/nil.hh +++ b/milena/mln/util/nil.hh @@ -67,16 +67,19 @@ namespace mln // nil + inline nil::nil() { } template <typename T> + inline nil::nil(const T&) { } template <typename T> + inline nil& nil::operator=(const T&) { @@ -84,6 +87,7 @@ namespace mln } template <typename T> + inline nil::operator T() const { return T(); diff --git a/milena/mln/util/ordpair.hh b/milena/mln/util/ordpair.hh index 50ac66c..709ac2a 100644 --- a/milena/mln/util/ordpair.hh +++ b/milena/mln/util/ordpair.hh @@ -76,6 +76,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename T> + inline ordpair_<T>::ordpair_(const T& t1, const T& t2) { if (t1 > t2) @@ -92,12 +93,14 @@ namespace mln } template <typename T> + inline bool operator==(const ordpair_<T>& lhs, const ordpair_<T>& rhs) { return lhs.first == rhs.first && lhs.second == rhs.second; } template <typename T> + inline bool operator< (const ordpair_<T>& lhs, const ordpair_<T>& rhs) { return @@ -106,6 +109,7 @@ namespace mln } template <typename T> + inline bool operator<=(const ordpair_<T>& lhs, const ordpair_<T>& rhs) { return @@ -115,6 +119,7 @@ namespace mln template <typename T> + inline std::ostream& operator<<(std::ostream& ostr, const ordpair_<T>& op) { return ostr << '(' << op.first << ',' << op.second << ')'; @@ -122,6 +127,7 @@ namespace mln template <typename T> + inline ordpair_<T> ordpair(const T& t1, const T& t2) { diff --git a/milena/mln/util/pix.hh b/milena/mln/util/pix.hh index da4f90d..87c9e24 100644 --- a/milena/mln/util/pix.hh +++ b/milena/mln/util/pix.hh @@ -113,6 +113,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename I> + inline pix<I>::pix(const Image<I>& ima, const mln_psite(I)& p) : ima_(exact(ima)), p_(p) @@ -120,6 +121,7 @@ namespace mln } template <typename I> + inline const I& pix<I>::ima() const { @@ -127,6 +129,7 @@ namespace mln } template <typename I> + inline const mln_psite(I)& pix<I>::p() const { @@ -134,6 +137,7 @@ namespace mln } template <typename I> + inline mln_rvalue(I) pix<I>::v() const { diff --git a/milena/mln/util/tracked_ptr.hh b/milena/mln/util/tracked_ptr.hh index bd0d770..80209f2 100644 --- a/milena/mln/util/tracked_ptr.hh +++ b/milena/mln/util/tracked_ptr.hh @@ -105,6 +105,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename T> + inline tracked_ptr<T>::operator bool() const { mln_invariant(run_()); @@ -113,6 +114,7 @@ namespace mln template <typename T> /// Negation (for arithmetical tests). + inline bool tracked_ptr<T>::operator !() const { mln_invariant(run_()); @@ -124,6 +126,7 @@ namespace mln ** ** \invariant Pointer proxy exists. */ + inline const T*const tracked_ptr<T>::operator->() const { mln_invariant(run_()); @@ -136,6 +139,7 @@ namespace mln ** ** \invariant Pointer proxy exists. */ + inline T*const tracked_ptr<T>::operator->() { mln_invariant(run_()); @@ -145,6 +149,7 @@ namespace mln template <typename T> /// Ctor. + inline tracked_ptr<T>::tracked_ptr() : ptr_(0), holders_(0) @@ -154,6 +159,7 @@ namespace mln template <typename T> /// Ctor. + inline tracked_ptr<T>::tracked_ptr(T* ptr) : ptr_(ptr) { @@ -171,6 +177,7 @@ namespace mln template <typename T> /// Cpy ctor. + inline tracked_ptr<T>::tracked_ptr(const tracked_ptr<T>& rhs) : ptr_(rhs.ptr_), holders_(rhs.holders_) @@ -183,6 +190,7 @@ namespace mln template <typename T> /// Assignment. + inline tracked_ptr<T>& tracked_ptr<T>::operator=(const tracked_ptr<T>& rhs) { mln_invariant(run_()); @@ -199,6 +207,7 @@ namespace mln template <typename T> /// Assignment. + inline tracked_ptr<T>& tracked_ptr<T>::operator=(T* ptr) { typedef std::set<tracked_ptr<T>*> holders_t; @@ -221,12 +230,14 @@ namespace mln /// Dtor. template <typename T> + inline tracked_ptr<T>::~tracked_ptr() { clean_(); } template <typename T> + inline bool tracked_ptr<T>::run_() const { typedef std::set<tracked_ptr<T>*> holders_t; @@ -245,6 +256,7 @@ namespace mln } template <typename T> + inline void tracked_ptr<T>::clean_() { mln_invariant(run_()); @@ -264,6 +276,7 @@ namespace mln } template <typename T> + inline std::ostream& operator<<(std::ostream& ostr, const tracked_ptr<T>& tp) { typedef std::set<tracked_ptr<T>*> holders_t; diff --git a/milena/mln/util/tree.hh b/milena/mln/util/tree.hh index 45bd9cb..e4dd6e2 100644 --- a/milena/mln/util/tree.hh +++ b/milena/mln/util/tree.hh @@ -282,12 +282,14 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename T> + inline tree<T>::tree() : root_ (0) { } template <typename T> + inline tree<T>::tree(node<T>* root) : root_ (root) { @@ -295,6 +297,7 @@ namespace mln } template <typename T> + inline node<T>* tree<T>::root() { @@ -302,6 +305,7 @@ namespace mln } template <typename T> + inline branch<T> tree<T>::main_branch() { @@ -309,6 +313,7 @@ namespace mln } template <typename T> + inline void tree<T>::add_tree_up(T& elt) { @@ -319,6 +324,7 @@ namespace mln } template <typename T> + inline void tree<T>::add_tree_down(T& elt) { @@ -328,6 +334,7 @@ namespace mln template <typename T> + inline bool tree<T>::check_consistency() { @@ -335,12 +342,14 @@ namespace mln } template <typename T> + inline node<T>::node() : parent_ (0) { } template <typename T> + inline node<T>::node(T elt) : elt_ (elt), parent_ (0) @@ -348,6 +357,7 @@ namespace mln } template <typename T> + inline const T& node<T>::elt() const { @@ -355,6 +365,7 @@ namespace mln } template <typename T> + inline T& node<T>::elt() { @@ -363,6 +374,7 @@ namespace mln template <typename T> + inline std::vector< node<T>* >& node<T>::children() { @@ -370,6 +382,7 @@ namespace mln } template <typename T> + inline const std::vector< node<T>* >& node<T>::children() const { @@ -377,6 +390,7 @@ namespace mln } template <typename T> + inline node<T>* node<T>::add_child(T elt) { @@ -389,6 +403,7 @@ namespace mln template <typename T> + inline node<T>* node<T>::add_child(node<T>* node) { @@ -408,6 +423,7 @@ namespace mln } template <typename T> + inline node<T>* node<T>::delete_node() { @@ -429,6 +445,7 @@ namespace mln } template <typename T> + inline void node<T>::print(std::ostream& ostr, int level) { @@ -446,6 +463,7 @@ namespace mln template <typename T> + inline void node<T>::set_parent(node<T>* parent) { @@ -455,6 +473,7 @@ namespace mln } template <typename T> + inline node<T>* node<T>::parent() { @@ -462,6 +481,7 @@ namespace mln } template <typename T> + inline int node<T>::search_rec(node<T>** res, T& elt) { @@ -483,6 +503,7 @@ namespace mln } template <typename T> + inline node<T>* node<T>::search(T& elt) { @@ -494,6 +515,7 @@ namespace mln } template <typename T> + inline bool node<T>::check_consistency() { @@ -512,6 +534,7 @@ namespace mln // Branch methods template <typename T> + inline branch<T>::branch(util::tree<T>& tree, util::node<T>& apex) : tree_(tree), @@ -521,6 +544,7 @@ namespace mln template <typename T> + inline util::node<T>& branch<T>::apex() { @@ -528,6 +552,7 @@ namespace mln } template <typename T> + inline util::tree<T>& branch<T>::tree() { diff --git a/milena/mln/util/tree_fast.hh b/milena/mln/util/tree_fast.hh index aab0683..a813c5d 100644 --- a/milena/mln/util/tree_fast.hh +++ b/milena/mln/util/tree_fast.hh @@ -118,11 +118,13 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename T> + inline tree_fast<T>::tree_fast() { } template <typename T> + inline tree_fast<T>::tree_fast(T& elt) { std::vector<unsigned> v; @@ -133,6 +135,7 @@ namespace mln } template <typename T> + inline const unsigned tree_fast<T>::size() const { @@ -141,6 +144,7 @@ namespace mln template <typename T> + inline bool tree_fast<T>::has (T& elt) const { @@ -152,6 +156,7 @@ namespace mln } template <typename T> + inline unsigned tree_fast<T>::search (T& elt) const { @@ -165,6 +170,7 @@ namespace mln } template <typename T> + inline bool tree_fast<T>::is_root (unsigned i) const { @@ -172,6 +178,7 @@ namespace mln } template <typename T> + inline unsigned tree_fast<T>::add_child (unsigned i, T& elt) { @@ -185,6 +192,7 @@ namespace mln } template <typename T> + inline unsigned tree_fast<T>::add_parent (T& elt) { diff --git a/milena/mln/util/tree_fast_to_image.hh b/milena/mln/util/tree_fast_to_image.hh index 41882c1..7882223 100644 --- a/milena/mln/util/tree_fast_to_image.hh +++ b/milena/mln/util/tree_fast_to_image.hh @@ -62,6 +62,7 @@ namespace mln { template <typename T, typename I> + inline void tree_fast_to_image(tree_fast<T>& tree, Image<I>& output_) { @@ -94,6 +95,7 @@ namespace mln template <typename T, typename I> + inline void tree_fast_to_image(tree_fast<T>& tree, Image<I>& output_) { diff --git a/milena/mln/util/tree_to_fast.hh b/milena/mln/util/tree_to_fast.hh index 7379302..a1bbede 100644 --- a/milena/mln/util/tree_to_fast.hh +++ b/milena/mln/util/tree_to_fast.hh @@ -66,6 +66,7 @@ namespace mln { template<typename T> + inline void tree_to_fast_(node<T>* input, tree_fast<T>& tree, unsigned p, unsigned& i) { @@ -85,6 +86,7 @@ namespace mln /// Facade. template<typename T> + inline tree_fast<T> tree_to_fast(tree<T>& input) { diff --git a/milena/mln/util/tree_to_image.hh b/milena/mln/util/tree_to_image.hh index 6bafbac..a5a1263 100644 --- a/milena/mln/util/tree_to_image.hh +++ b/milena/mln/util/tree_to_image.hh @@ -82,6 +82,7 @@ namespace mln { template <typename T, typename I> + inline void tree_to_image_rec(node<T>* node, Image<I>& output_) { @@ -107,6 +108,7 @@ namespace mln } template <typename T, typename J> + inline void display_tree_rec(const Image<J>& ima_, node<T>* node, int level) { @@ -124,6 +126,7 @@ namespace mln template <typename T, typename J, typename K> + inline void display_branch_rec(const Image<J>& ima_, node<T>* node, Image<K>& output_) { @@ -145,6 +148,7 @@ namespace mln template <typename P, typename J> + inline void display_set(const Image<J>& ima_, p_set<P>& s) { @@ -167,6 +171,7 @@ namespace mln template <typename T, typename I> + inline void tree_to_image (tree<T>& tree, Image<I>& output_) { @@ -180,6 +185,7 @@ namespace mln template <typename I, typename J> + inline void display_tree(const Image<J>& ima_, tree<I>& tree) { @@ -197,6 +203,7 @@ namespace mln template <typename I, typename J> + inline void display_branch(const Image<J>& ima_, node<I>* node) { diff --git a/milena/mln/value/cast.hh b/milena/mln/value/cast.hh index 76ae442..3dddfac 100644 --- a/milena/mln/value/cast.hh +++ b/milena/mln/value/cast.hh @@ -56,6 +56,7 @@ namespace mln { template <typename S> + inline const S& cast_(const void*, const S& src) { @@ -63,6 +64,7 @@ namespace mln } template <typename O, typename S> + inline const S& cast_(const Object<O>*, const S& src) { @@ -70,6 +72,7 @@ namespace mln } template <typename V, typename S> + inline mln_value_equiv(S) cast_(const Value<V>*, const S& src) { @@ -80,6 +83,7 @@ namespace mln template <typename Dest, typename Src> + inline Dest cast(const Src& src) { // FIXME: Add static_cast<Dest>? diff --git a/milena/mln/value/concept/scalar.hh b/milena/mln/value/concept/scalar.hh index 210268a..0ca0344 100644 --- a/milena/mln/value/concept/scalar.hh +++ b/milena/mln/value/concept/scalar.hh @@ -76,6 +76,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename S> + inline S& operator++(value::Scalar<S>& rhs) { mlc_converts_to(literal::one_t, S)::check(); @@ -83,6 +84,7 @@ namespace mln } template <typename S> + inline S& operator--(value::Scalar<S>& rhs) { mlc_converts_to(literal::one_t, S)::check(); diff --git a/milena/mln/value/equiv.hh b/milena/mln/value/equiv.hh index dd2d10b..4bf7be8 100644 --- a/milena/mln/value/equiv.hh +++ b/milena/mln/value/equiv.hh @@ -85,6 +85,7 @@ namespace mln template <typename V, typename T> + inline const typename internal::equiv_<V>::ret& run_equiv_(const Value<V>* v, const T*) { @@ -92,6 +93,7 @@ namespace mln } template <typename V> + inline const V& run_equiv_(const void*, const V* v) { @@ -99,6 +101,7 @@ namespace mln } template <typename V> + inline const typename internal::equiv_<V>::ret& run_equiv_(const V& v) { @@ -130,6 +133,7 @@ namespace mln enum { id = sizeof(equiv_selector_(make_<T>::ptr())) }; typedef typename equiv_ret_<id, T>::ret ret; + inline static ret run(const T& t) { return ret::run(t); @@ -141,6 +145,7 @@ namespace mln template <typename V> + inline typename internal::equiv_<V>::ret equiv(const mln::Value<V>& v) { diff --git a/milena/mln/value/float01.hh b/milena/mln/value/float01.hh index b6751da..d2601d5 100644 --- a/milena/mln/value/float01.hh +++ b/milena/mln/value/float01.hh @@ -119,6 +119,7 @@ namespace mln namespace internal { + inline unsigned long two_pow_(unsigned n) { if (n == 0) @@ -127,12 +128,14 @@ namespace mln return 2 * two_pow_(n - 1); } + inline unsigned long two_pow_n_minus_1(unsigned n) { return two_pow_(n) - 1; } template <unsigned n_dest> + inline unsigned long convert(unsigned n_src, unsigned long val) { if (n_dest == n_src) @@ -155,35 +158,41 @@ namespace mln } template <unsigned n> + inline float01::float01(const float01_<n>& g) : nbits_(n), val_(g.to_enc()) { } + inline float01::float01(unsigned nbits, float val) : nbits_(nbits), val_(unsigned(val * internal::two_pow_n_minus_1(nbits))) { } + inline float float01::value() const { mln_invariant(nbits_ != 0); return double(val_) / internal::two_pow_n_minus_1(nbits_); } + inline unsigned long float01::value_ind() const { mln_invariant(nbits_ != 0); return val_; } + inline unsigned float01::nbits() const { return nbits_; } + inline float01& float01::set_nbits(unsigned nbits) { @@ -204,6 +213,7 @@ namespace mln return *this; } + inline const float01 float01::to_nbits(unsigned nbits) const { @@ -214,6 +224,7 @@ namespace mln return tmp; } + inline float01::operator float() const { mln_precondition(nbits_ != 0); @@ -234,11 +245,13 @@ namespace mln // Operators. + inline std::ostream& operator<<(std::ostream& ostr, const float01& g) { return ostr << g.value() << '/' << g.nbits() << "nbits"; } + inline bool operator==(const float01& lhs, const float01& rhs) { mln_precondition(lhs.nbits() != 0 and rhs.nbits() != 0); @@ -254,6 +267,7 @@ namespace mln } } + inline bool operator<(const float01& lhs, const float01& rhs) { mln_precondition(lhs.nbits() != 0 and rhs.nbits() != 0); diff --git a/milena/mln/value/float01_.hh b/milena/mln/value/float01_.hh index 93c472e..1ff5c42 100644 --- a/milena/mln/value/float01_.hh +++ b/milena/mln/value/float01_.hh @@ -154,11 +154,13 @@ namespace mln // Float01_<n>. template <unsigned n> + inline float01_<n>::float01_() { } template <unsigned n> + inline float01_<n>::float01_(float val) { mln_precondition(val >= 0); @@ -167,6 +169,7 @@ namespace mln } template <unsigned n> + inline float float01_<n>::value() const { @@ -174,6 +177,7 @@ namespace mln } template <unsigned n> + inline void float01_<n>::set_ind(unsigned long val) { @@ -181,6 +185,7 @@ namespace mln } template <unsigned n> + inline float01_<n>& float01_<n>::operator=(float val) { @@ -191,6 +196,7 @@ namespace mln } template <unsigned n> + inline float01_<n>::operator float() const { return float(this->v_) / (mln_card(float01_<n>) - 1); @@ -200,18 +206,21 @@ namespace mln // Operators. template <unsigned n> + inline std::ostream& operator<<(std::ostream& ostr, const float01_<n>& f) { return ostr << f.value(); } template <unsigned n, unsigned m> + inline bool approx_equal(const float01_<n>& lhs, const float01_<m>& rhs) { return float01(lhs) == float01(rhs); } template <unsigned n> + inline bool approx_equal(const float01_<n>& lhs, float f) { return float01(lhs) == float01_<n>(f); diff --git a/milena/mln/value/float01_f.hh b/milena/mln/value/float01_f.hh index bf2d813..95e3758 100644 --- a/milena/mln/value/float01_f.hh +++ b/milena/mln/value/float01_f.hh @@ -110,10 +110,12 @@ namespace mln // Float01_F. + inline float01_f::float01_f() { } + inline float01_f::float01_f(float val) { mln_precondition(val >= 0); @@ -121,12 +123,14 @@ namespace mln this->v_ = val; } + inline float float01_f::value() const { return this->v_; } + inline float01_f& float01_f::operator=(float val) { @@ -136,6 +140,7 @@ namespace mln return *this; } + inline float01_f::operator float() const { return this->v_; diff --git a/milena/mln/value/gray.hh b/milena/mln/value/gray.hh index 4199326..2eccffd 100644 --- a/milena/mln/value/gray.hh +++ b/milena/mln/value/gray.hh @@ -189,18 +189,21 @@ namespace mln // Gray. + inline gray::gray() : nbits_(0) { } template <unsigned n> + inline gray::gray(const graylevel<n>& g) : nbits_(n), val_(g.value()) { } + inline gray::gray(const literal::white_t&) : nbits_(1), val_(1) @@ -209,6 +212,7 @@ namespace mln template <unsigned n> + inline gray& gray::operator=(const graylevel<n>& g) { nbits_ = n; @@ -216,6 +220,7 @@ namespace mln return *this; } + inline gray& gray::operator=(const literal::white_t&) { // nbits_ is not modified so that precision does not change. @@ -223,12 +228,14 @@ namespace mln return *this; } + inline gray::gray(const literal::black_t&) : nbits_(1), val_(0) { } + inline gray& gray::operator=(const literal::black_t&) { // nbits_ is not modified so that precision does not change. @@ -236,18 +243,21 @@ namespace mln return *this; } + inline gray::gray(unsigned nbits, long val) : nbits_(nbits), val_(val) { } + inline long gray::value() const { mln_invariant(nbits_ != 0); return val_; } + inline unsigned gray::nbits() const { return nbits_; @@ -256,6 +266,7 @@ namespace mln namespace internal { + inline long two_pow_(unsigned n) { if (n == 0) @@ -264,12 +275,14 @@ namespace mln return 2 * two_pow_(n - 1); } + inline long two_pow_n_minus_1(unsigned n) { return two_pow_(n) - 1; } template <unsigned n_dest> + inline long convert(unsigned n_src, long val) { if (n_dest == n_src) @@ -284,6 +297,7 @@ namespace mln } // end of mln::value::internal + inline void gray::set_nbits(unsigned nbits) { mln_precondition(nbits != 0); @@ -303,6 +317,7 @@ namespace mln } + inline gray gray::to_nbits(unsigned nbits) const { mln_precondition(nbits != 0); @@ -314,6 +329,7 @@ namespace mln template <unsigned n> + inline gray::operator graylevel<n>() const { mln_precondition(nbits_ != 0); @@ -326,11 +342,13 @@ namespace mln // Operators. + inline std::ostream& operator<<(std::ostream& ostr, const gray& g) { return ostr << g.value() << "g/" << g.nbits() << "bits"; } + inline bool operator==(const gray& lhs, const gray& rhs) { mln_precondition(lhs.nbits() != 0 and rhs.nbits() != 0); @@ -342,6 +360,7 @@ namespace mln return lhs.to_nbits(rhs.nbits()).value() == rhs.value(); } + inline bool operator<(const gray& lhs, const gray& rhs) { mln_precondition(lhs.nbits() != 0 and rhs.nbits() != 0); @@ -353,6 +372,7 @@ namespace mln return lhs.to_nbits(rhs.nbits()).value() < rhs.value(); } + inline gray operator+(const gray& lhs, const gray& rhs) { mln_precondition(lhs.nbits() != 0 and rhs.nbits() != 0); @@ -370,6 +390,7 @@ namespace mln } } + inline gray operator-(const gray& lhs, const gray& rhs) { mln_precondition(lhs.nbits() != 0 and rhs.nbits() != 0); @@ -391,6 +412,7 @@ namespace mln } } + inline gray operator*(const gray& lhs, const gray& rhs) { // FIXME: The formula below is wrong but we do not mind, @@ -401,18 +423,21 @@ namespace mln return tmp; } + inline gray operator*(int s, const gray& rhs) { gray tmp(rhs.nbits(), rhs.value() * s); return tmp; } + inline gray operator*(const gray& lhs, int s) { gray tmp(lhs.nbits(), lhs.value() * s); return tmp; } + inline gray operator/(const gray& lhs, int s) { mln_precondition(s != 0); @@ -426,6 +451,7 @@ namespace mln // Op gl + gl template <unsigned n, unsigned m> + inline gray operator+(const graylevel<n>& lhs, const graylevel<m>& rhs) { @@ -435,6 +461,7 @@ namespace mln // Op gl - gl template <unsigned n, unsigned m> + inline gray operator-(const graylevel<n>& lhs, const graylevel<m>& rhs) { @@ -444,6 +471,7 @@ namespace mln // Op gl * gl template <unsigned n, unsigned m> + inline gray operator*(const graylevel<n>& lhs, const graylevel<m>& rhs) { @@ -453,6 +481,7 @@ namespace mln // Op symm gl * Int template <unsigned n, typename I> + inline gray operator*(const graylevel<n>& lhs, const Integer<I>& rhs) { @@ -460,6 +489,7 @@ namespace mln } template <typename I, unsigned n> + inline gray operator*(const Integer<I>& lhs, const graylevel<n>& rhs) { @@ -469,6 +499,7 @@ namespace mln // Op symm gl * Float template <unsigned n, typename F> + inline float operator*(const graylevel<n>& lhs, const Floating<F>& rhs) { @@ -476,6 +507,7 @@ namespace mln } template <typename F, unsigned n> + inline float operator*(const Floating<F>& lhs, const graylevel<n>& rhs) { @@ -496,12 +528,14 @@ namespace mln struct helper_gray_op_< gray > { template <unsigned n, typename S> + inline static gray times(const graylevel<n>& lhs, const scalar_<S>& rhs) { gray tmp(n, lhs.value() * rhs.to_equiv()); return tmp; } template <unsigned n, typename S> + inline static gray div(const graylevel<n>& lhs, const scalar_<S>& rhs) { gray tmp(n, lhs.value() / rhs.to_equiv()); @@ -513,12 +547,14 @@ namespace mln struct helper_gray_op_< float > { template <unsigned n, typename S> + inline static float times(const graylevel<n>& lhs, const scalar_<S>& rhs) { float tmp(lhs.to_float() * float(rhs.to_equiv())); return tmp; } template <unsigned n, typename S> + inline static float div(const graylevel<n>& lhs, const scalar_<S>& rhs) { float tmp(lhs.to_float() / float(rhs.to_equiv())); @@ -529,6 +565,7 @@ namespace mln } // end of namespace mln::value::internal template <unsigned n, typename S> + inline mln_trait_op_times(graylevel<n>, scalar_<S>) operator*(const graylevel<n>& lhs, const scalar_<S>& rhs) { @@ -537,6 +574,7 @@ namespace mln } template <unsigned n, typename S> + inline mln_trait_op_div(graylevel<n>, scalar_<S>) operator/(const graylevel<n>& lhs, const scalar_<S>& rhs) { @@ -555,18 +593,21 @@ namespace mln // 'gray' as a value. + inline const mln::value::gray value_< mln::value::gray >::min() { return mln::value::gray(1, 0); } + inline const mln::value::gray value_< mln::value::gray >::max() { return mln::value::gray(1, 1); } + inline const mln::value::gray value_< mln::value::gray >::epsilon() { diff --git a/milena/mln/value/graylevel.hh b/milena/mln/value/graylevel.hh index 6684b45..03881f7 100644 --- a/milena/mln/value/graylevel.hh +++ b/milena/mln/value/graylevel.hh @@ -313,12 +313,14 @@ namespace mln template <unsigned n> + inline graylevel<n>::graylevel() { } template <unsigned n> + inline graylevel<n>::graylevel(int val) { mln_precondition(val >= 0); @@ -327,6 +329,7 @@ namespace mln } template <unsigned n> + inline graylevel<n>& graylevel<n>::operator=(int val) { @@ -338,6 +341,7 @@ namespace mln template <unsigned n> + inline graylevel<n>::graylevel(const gray& g) { gray tmp = g.to_nbits(n); @@ -345,6 +349,7 @@ namespace mln } template <unsigned n> + inline graylevel<n>& graylevel<n>::operator=(const gray& g) { @@ -354,12 +359,14 @@ namespace mln } template <unsigned n> + inline graylevel<n>::graylevel(const graylevel<n>& rhs) { this->v_ = rhs.v_; } template <unsigned n> + inline graylevel<n>& graylevel<n>::operator=(const graylevel<n>& rhs) { @@ -369,6 +376,7 @@ namespace mln template <unsigned n> template <unsigned m> + inline graylevel<n>::graylevel(const graylevel<m>& rhs) { *this = gray(rhs).to_nbits(n); @@ -376,6 +384,7 @@ namespace mln template <unsigned n> template <unsigned m> + inline graylevel<n>& graylevel<n>::operator=(const graylevel<m>& rhs) { @@ -385,12 +394,14 @@ namespace mln template <unsigned n> + inline graylevel<n>::graylevel(const literal::black_t&) { this->v_ = 0; } template <unsigned n> + inline graylevel<n>& graylevel<n>::operator=(const literal::black_t&) { @@ -399,12 +410,14 @@ namespace mln } template <unsigned n> + inline graylevel<n>::graylevel(const literal::medium_gray_t&) { this->v_ = metal::math::pow_int<2, n - 1>::value; } template <unsigned n> + inline graylevel<n>& graylevel<n>::operator=(const literal::medium_gray_t&) { @@ -413,12 +426,14 @@ namespace mln } template <unsigned n> + inline graylevel<n>::graylevel(const literal::white_t&) { this->v_ = mln_max(mln_enc(int_u<n>)); } template <unsigned n> + inline graylevel<n>& graylevel<n>::operator=(const literal::white_t&) { @@ -428,6 +443,7 @@ namespace mln template <unsigned n> + inline unsigned graylevel<n>::value() const { @@ -435,6 +451,7 @@ namespace mln } template <unsigned n> + inline float graylevel<n>::to_float() const { @@ -448,6 +465,7 @@ namespace mln { template <unsigned n> + inline graylevel<n> convert_< graylevel<n> >::value_at_index(unsigned i) { @@ -456,6 +474,7 @@ namespace mln } template <unsigned n> + inline unsigned convert_< graylevel<n> >::index_of_value(graylevel<n> v) { @@ -467,6 +486,7 @@ namespace mln // Operators. template <unsigned n> + inline std::ostream& operator<<(std::ostream& ostr, const graylevel<n>& g) { return ostr << g.value() << "/gl" << n; // FIXME: Be more explicit! diff --git a/milena/mln/value/int_s.hh b/milena/mln/value/int_s.hh index 13728c2..0b83c0d 100644 --- a/milena/mln/value/int_s.hh +++ b/milena/mln/value/int_s.hh @@ -164,17 +164,20 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <unsigned n> + inline int_s<n>::int_s() { } template <unsigned n> + inline int_s<n>::operator int() const { return this->v_; } template <unsigned n> + inline int_s<n>::int_s(int i) { static const int max = metal::math::pow_int<2, n-1>::value - 1; @@ -185,6 +188,7 @@ namespace mln } template <unsigned n> + inline int_s<n>& int_s<n>::operator=(int i) { @@ -197,12 +201,14 @@ namespace mln } template <unsigned n> + inline int_s<n>::int_s(const literal::zero_t&) { this->v_ = 0; } template <unsigned n> + inline int_s<n>& int_s<n>::operator=(const literal::zero_t&) { @@ -211,12 +217,14 @@ namespace mln } template <unsigned n> + inline int_s<n>::int_s(const literal::one_t&) { this->v_ = 1; } template <unsigned n> + inline int_s<n>& int_s<n>::operator=(const literal::one_t&) { @@ -231,6 +239,7 @@ namespace mln const int_s<n> int_s<n>::one = 1; template <unsigned n> + inline std::ostream& operator<<(std::ostream& ostr, const int_s<n>& i) { return ostr << debug::format(i.to_equiv()); diff --git a/milena/mln/value/int_u.hh b/milena/mln/value/int_u.hh index da98459..4692462 100644 --- a/milena/mln/value/int_u.hh +++ b/milena/mln/value/int_u.hh @@ -175,11 +175,13 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <unsigned n> + inline int_u<n>::int_u() { } template <unsigned n> + inline int_u<n>::int_u(int i) { mln_precondition(i >= 0); @@ -188,12 +190,14 @@ namespace mln } template <unsigned n> + inline int_u<n>::int_u(const literal::zero_t&) { this->v_ = 0; } template <unsigned n> + inline int_u<n>& int_u<n>::operator=(const literal::zero_t&) { @@ -202,12 +206,14 @@ namespace mln } template <unsigned n> + inline int_u<n>::int_u(const literal::one_t&) { this->v_ = 1; } template <unsigned n> + inline int_u<n>& int_u<n>::operator=(const literal::one_t&) { @@ -216,12 +222,14 @@ namespace mln } template <unsigned n> + inline int_u<n>::operator unsigned() const { return this->v_; } template <unsigned n> + inline int int_u<n>::operator-() const { @@ -229,6 +237,7 @@ namespace mln } template <unsigned n> + inline int_u<n>& int_u<n>::operator=(int i) { @@ -239,6 +248,7 @@ namespace mln } template <unsigned n> + inline std::ostream& operator<<(std::ostream& ostr, const int_u<n>& i) { // FIXME: This code could be factored for almost every Value<*>... @@ -246,6 +256,7 @@ namespace mln } template <unsigned n> + inline std::istream& operator>>(std::istream& istr, int_u<n>& i) { return istr >> i.handle_(); diff --git a/milena/mln/value/int_u_sat.hh b/milena/mln/value/int_u_sat.hh index c0fa992..8550c4a 100644 --- a/milena/mln/value/int_u_sat.hh +++ b/milena/mln/value/int_u_sat.hh @@ -123,11 +123,13 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <unsigned n> + inline int_u_sat<n>::int_u_sat() { } template <unsigned n> + inline int_u_sat<n>::int_u_sat(int i) { static const unsigned max_ = mln_max(int_u<n>); @@ -140,12 +142,14 @@ namespace mln } template <unsigned n> + inline int_u_sat<n>::operator int() const { return this->v_; } template <unsigned n> + inline int_u_sat<n>& int_u_sat<n>::operator=(int i) { @@ -160,6 +164,7 @@ namespace mln } template <unsigned n> + inline int_u_sat<n>& int_u_sat<n>::operator+=(int i) { @@ -169,6 +174,7 @@ namespace mln } template <unsigned n> + inline int_u_sat<n>& int_u_sat<n>::operator-=(int i) { @@ -184,6 +190,7 @@ namespace mln const int_u_sat<n> int_u_sat<n>::one = 1; template <unsigned n> + inline std::ostream& operator<<(std::ostream& ostr, const int_u_sat<n>& i) { return ostr << debug::format(i.to_equiv()); diff --git a/milena/mln/value/internal/convert.hh b/milena/mln/value/internal/convert.hh index 1997f5d..2bd52fc 100644 --- a/milena/mln/value/internal/convert.hh +++ b/milena/mln/value/internal/convert.hh @@ -65,6 +65,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename T> + inline T convert_<T>::value_at_index(unsigned i) { @@ -72,6 +73,7 @@ namespace mln } template <typename T> + inline unsigned convert_<T>::index_of_value(const T& v) { @@ -80,6 +82,7 @@ namespace mln // Case of 'bool'. + inline bool convert_<bool>::value_at_index(unsigned i) { @@ -87,6 +90,7 @@ namespace mln return i == 1 ? true : false; } + inline unsigned convert_<bool>::index_of_value(bool v) { diff --git a/milena/mln/value/internal/iterable_set.hh b/milena/mln/value/internal/iterable_set.hh index bc96e4c..b5de0d6 100644 --- a/milena/mln/value/internal/iterable_set.hh +++ b/milena/mln/value/internal/iterable_set.hh @@ -87,6 +87,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename T, typename E> + inline bool iterable_set<T,E>::has(const T&) const { @@ -94,6 +95,7 @@ namespace mln } template <typename T, typename E> + inline T iterable_set<T,E>::operator[](unsigned i) const { @@ -102,6 +104,7 @@ namespace mln } template <typename T, typename E> + inline unsigned iterable_set<T,E>::index_of(const T& v) const { @@ -109,6 +112,7 @@ namespace mln } template <typename T, typename E> + inline unsigned iterable_set<T,E>::nvalues() const { diff --git a/milena/mln/value/internal/value_like.hh b/milena/mln/value/internal/value_like.hh index 26dd7dc..857ac00 100644 --- a/milena/mln/value/internal/value_like.hh +++ b/milena/mln/value/internal/value_like.hh @@ -110,6 +110,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename V, typename C, typename N, typename E> + inline V value_like_<V,C,N,E>::to_equiv() const { @@ -117,6 +118,7 @@ namespace mln } template <typename V, typename C, typename N, typename E> + inline const C& value_like_<V,C,N,E>::to_enc() const { @@ -124,6 +126,7 @@ namespace mln } template <typename V, typename C, typename N, typename E> + inline N value_like_<V,C,N,E>::to_interop() const { @@ -131,6 +134,7 @@ namespace mln } template <typename V, typename C, typename N, typename E> + inline bool operator==(const value_like_<V,C,N,E>& lhs, const value_like_<V,C,N,E>& rhs) { @@ -138,6 +142,7 @@ namespace mln } template <typename V, typename C, typename N, typename E> + inline bool operator<(const value_like_<V,C,N,E>& lhs, const value_like_<V,C,N,E>& rhs) { diff --git a/milena/mln/value/interval.hh b/milena/mln/value/interval.hh index b30ea66..495bd44 100644 --- a/milena/mln/value/interval.hh +++ b/milena/mln/value/interval.hh @@ -65,6 +65,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename T> + inline interval_<T>::interval_(const T& from, const T& to) : from(from), to(to) @@ -74,6 +75,7 @@ namespace mln template <typename T> template <typename U> + inline interval_<T>::operator interval_<U>() const { mln_invariant(from <= to); @@ -83,6 +85,7 @@ namespace mln } template <typename T> + inline interval_<T> interval(const T& from, const T& to) { diff --git a/milena/mln/value/label.hh b/milena/mln/value/label.hh index 355bcf4..5076f61 100644 --- a/milena/mln/value/label.hh +++ b/milena/mln/value/label.hh @@ -173,11 +173,13 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <unsigned n> + inline label<n>::label() { } template <unsigned n> + inline label<n>::label(unsigned i) { mln_precondition(i <= mln_max(enc)); @@ -185,6 +187,7 @@ namespace mln } template <unsigned n> + inline label<n>& label<n>::operator=(unsigned i) { @@ -194,6 +197,7 @@ namespace mln } template <unsigned n> + inline label<n>& label<n>::operator++() { @@ -203,6 +207,7 @@ namespace mln } template <unsigned n> + inline label<n>& label<n>::operator--() { @@ -215,6 +220,7 @@ namespace mln const label<n> label<n>::one = 1; template <unsigned n> + inline const mln_enc(label<n>)& label<n>::to_enc() const { @@ -222,18 +228,21 @@ namespace mln } template <unsigned n> + inline bool operator==(const label<n>& lhs, const label<n>& rhs) { return lhs.to_enc() == rhs.to_enc(); } template <unsigned n> + inline bool operator<(const label<n>& lhs, const label<n>& rhs) { return lhs.to_enc() < rhs.to_enc(); } template <unsigned n> + inline std::ostream& operator<<(std::ostream& ostr, const label<n>& i) { return ostr << i.to_enc(); diff --git a/milena/mln/value/lut_vec.hh b/milena/mln/value/lut_vec.hh index 9e7e861..7520381 100644 --- a/milena/mln/value/lut_vec.hh +++ b/milena/mln/value/lut_vec.hh @@ -100,6 +100,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename S, typename T> + inline bool lut_vec<S,T>::has(const T&) const { @@ -108,6 +109,7 @@ namespace mln } template <typename S, typename T> + inline unsigned lut_vec<S,T>::index_of(const T& v) const { @@ -117,6 +119,7 @@ namespace mln template <typename S, typename T> template <typename F> + inline lut_vec<S,T>::lut_vec(const S& vset, const Function_v2v<F>& f) : vset_(vset) { @@ -128,6 +131,7 @@ namespace mln } template <typename S, typename T> + inline T lut_vec<S,T>::operator()(const mln_value(S)& val) const { @@ -136,6 +140,7 @@ namespace mln } template <typename S, typename T> + inline T lut_vec<S,T>::operator[](unsigned i) const { @@ -144,6 +149,7 @@ namespace mln } template <typename S, typename T> + inline unsigned lut_vec<S,T>::nvalues() const { diff --git a/milena/mln/value/ops.hh b/milena/mln/value/ops.hh index eb70921..21bf42e 100644 --- a/milena/mln/value/ops.hh +++ b/milena/mln/value/ops.hh @@ -208,6 +208,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename Vl, typename Vr> + inline mln_trait_op_plus(Vl, Vr) operator + (const value::Scalar<Vl>& lhs, const value::Scalar<Vr>& rhs) { @@ -215,6 +216,7 @@ namespace mln } template <typename Vl, typename Vr> + inline mln_trait_op_minus(Vl, Vr) operator - (const value::Scalar<Vl>& lhs, const value::Scalar<Vr>& rhs) { @@ -222,6 +224,7 @@ namespace mln } template <typename Vl, typename Vr> + inline mln_trait_op_times(Vl, Vr) operator * (const value::Scalar<Vl>& lhs, const value::Scalar<Vr>& rhs) { @@ -229,6 +232,7 @@ namespace mln } template <typename Vl, typename Vr> + inline mln_trait_op_div(Vl, Vr) operator / (const value::Scalar<Vl>& lhs, const value::Scalar<Vr>& rhs) { @@ -236,6 +240,7 @@ namespace mln } template <typename Vl, typename Vr> + inline mln_trait_op_mod(Vl, Vr) operator % (const value::Scalar<Vl>& lhs, const value::Scalar<Vr>& rhs) { @@ -243,6 +248,7 @@ namespace mln } template <typename S> + inline mln_trait_op_uminus(S) operator - (const value::scalar_<S>& rhs) { @@ -250,6 +256,7 @@ namespace mln } template <typename S, typename O> + inline mln_trait_op_plus(O, value::scalar_<S>) operator + (const value::scalar_<S>& lhs, const Object<O>& rhs) { @@ -257,6 +264,7 @@ namespace mln } template <typename S, typename O> + inline mln_trait_op_times(O, value::scalar_<S>) operator * (const value::scalar_<S>& lhs, const Object<O>& rhs) { @@ -269,6 +277,7 @@ namespace mln // With scalar_ OP scalar_. template <typename Sl, typename Sr> + inline mln_trait_op_plus(Sl, Sr) operator + (const value::scalar_<Sl>& lhs, const value::scalar_<Sr>& rhs) { @@ -276,6 +285,7 @@ namespace mln } template <typename Sl, typename Sr> + inline mln_trait_op_minus(Sl, Sr) operator - (const value::scalar_<Sl>& lhs, const value::scalar_<Sr>& rhs) { @@ -283,6 +293,7 @@ namespace mln } template <typename Sl, typename Sr> + inline mln_trait_op_times(Sl, Sr) operator * (const value::scalar_<Sl>& lhs, const value::scalar_<Sr>& rhs) { @@ -290,6 +301,7 @@ namespace mln } template <typename Sl, typename Sr> + inline mln_trait_op_div(Sl, Sr) operator / (const value::scalar_<Sl>& lhs, const value::scalar_<Sr>& rhs) { @@ -297,6 +309,7 @@ namespace mln } template <typename Sl, typename Sr> + inline mln_trait_op_mod(Sl, Sr) operator % (const value::scalar_<Sl>& lhs, const value::scalar_<Sr>& rhs) { @@ -307,6 +320,7 @@ namespace mln // Operator ==. template <typename Sl, typename Sr> + inline mln_trait_op_eq(Sl, Sr) operator == (const value::scalar_<Sl>& lhs, const value::scalar_<Sr>& rhs) { @@ -314,6 +328,7 @@ namespace mln } template <typename O, typename L> + inline mln_trait_op_eq(O, O) operator==(const value::scalar_<O>& lhs, const Literal<L>& rhs) { @@ -321,6 +336,7 @@ namespace mln } template <typename L, typename O> + inline mln_trait_op_eq(O, O) operator==(const Literal<L>& lhs, const value::scalar_<O>& rhs) { @@ -331,6 +347,7 @@ namespace mln // Operator <. template <typename Sl, typename Sr> + inline mln_trait_op_less(Sl, Sr) operator < (const value::scalar_<Sl>& lhs, const value::scalar_<Sr>& rhs) { @@ -338,6 +355,7 @@ namespace mln } template <typename O, typename L> + inline mln_trait_op_less(O, O) operator < (const value::scalar_<O>& lhs, const Literal<L>& rhs) { @@ -345,6 +363,7 @@ namespace mln } template <typename L, typename O> + inline mln_trait_op_less(O, O) operator < (const Literal<L>& lhs, const value::scalar_<O>& rhs) { diff --git a/milena/mln/value/other.hh b/milena/mln/value/other.hh index 39290c4..b8d3792 100644 --- a/milena/mln/value/other.hh +++ b/milena/mln/value/other.hh @@ -63,6 +63,7 @@ namespace mln return val + 1; } + inline bool other_(const void*, const bool& val) { @@ -71,6 +72,7 @@ namespace mln template <typename V> + inline V other_(mln::trait::value::quant::high, const Value<V>& val_) { @@ -79,6 +81,7 @@ namespace mln } template <typename V> + inline V other_(mln::trait::value::quant::high, const value::Scalar<V>& val_) { @@ -87,6 +90,7 @@ namespace mln } template <typename V> + inline V other_(mln::trait::value::quant::low, const Value<V>& val_) { @@ -98,6 +102,7 @@ namespace mln } template <typename V> + inline V other_(const Value<V>*, const V& val) { @@ -108,6 +113,7 @@ namespace mln template <typename V> + inline V other(const V& val) { V tmp = internal::other_(&val, val); diff --git a/milena/mln/value/proxy.hh b/milena/mln/value/proxy.hh index 28a70c2..c27cf18 100644 --- a/milena/mln/value/proxy.hh +++ b/milena/mln/value/proxy.hh @@ -197,6 +197,7 @@ namespace mln // proxy<I> template <typename I> + inline proxy<I>::proxy(I& ima, const mln_psite(I)& p) : ima_(ima), p_(p) @@ -204,6 +205,7 @@ namespace mln } template <typename I> + inline proxy<I>::~proxy() { mln_value(I) (I::*mr)(const mln_psite(I)&) const = & I::read_; @@ -214,6 +216,7 @@ namespace mln template <typename I> template <typename V> + inline proxy<I>& proxy<I>::operator=(const V& v) { @@ -222,6 +225,7 @@ namespace mln } template <typename I> + inline proxy<I>& proxy<I>::operator=(const proxy<I>& rhs) { @@ -231,6 +235,7 @@ namespace mln template <typename I> template <typename II> + inline proxy<I>& proxy<I>::operator=(const proxy<II>& rhs) { @@ -240,18 +245,21 @@ namespace mln template <typename I> template <typename V> + inline proxy<I>::operator V() const { return ima_.read_(p_); } template <typename I> + inline proxy<I>::operator mln_value(I)() const { return ima_.read_(p_); } template <typename I> + inline mln_value(I) proxy<I>::to_value() const { @@ -261,6 +269,7 @@ namespace mln // proxy<const I> template <typename I> + inline proxy<const I>::proxy(const I& ima, const mln_psite(I)& p) : ima_(ima), p_(p) @@ -268,6 +277,7 @@ namespace mln } template <typename I> + inline proxy<const I>::~proxy() { mln_value(I) (I::*mr)(const mln_psite(I)&) const = & I::read_; @@ -276,18 +286,21 @@ namespace mln template <typename I> template <typename V> + inline proxy<const I>::operator V() const { return ima_.read_(p_); } template <typename I> + inline proxy<const I>::operator mln_value(I)() const { return ima_.read_(p_); } template <typename I> + inline mln_value(I) proxy<const I>::to_value() const { @@ -297,6 +310,7 @@ namespace mln // operator << template <typename I> + inline std::ostream& operator<<(std::ostream& ostr, const proxy<I>& x) { return ostr << x.to_value(); @@ -305,18 +319,21 @@ namespace mln // operator == template <typename I> + inline bool operator==(const proxy<I>& lhs, const mln_value(I)& rhs) { return lhs.to_value() == rhs; } template <typename I> + inline bool operator==(const mln_value(I)& lhs, const proxy<I>& rhs) { return lhs == rhs.to_value(); } template <typename I, typename J> + inline bool operator==(const proxy<I>& lhs, const proxy<J>& rhs) { return lhs.to_value() == rhs.to_value(); @@ -325,18 +342,21 @@ namespace mln // operator < template <typename I> + inline bool operator<(const proxy<I>& lhs, const mln_value(I)& rhs) { return lhs.to_value() < rhs; } template <typename I> + inline bool operator<(const mln_value(I)& lhs, const proxy<I>& rhs) { return lhs < rhs.to_value(); } template <typename I, typename J> + inline bool operator<(const proxy<I>& lhs, const proxy<J>& rhs) { return lhs.to_value() < rhs.to_value(); diff --git a/milena/mln/value/quat.hh b/milena/mln/value/quat.hh index 5cb1cf6..e47460d 100644 --- a/milena/mln/value/quat.hh +++ b/milena/mln/value/quat.hh @@ -256,27 +256,32 @@ namespace mln // Constructors. + inline quat::quat() { } + inline quat::quat(float s, float x, float y, float z) { v_[0] = s; set_v(x, y, z); } + inline quat::quat(float s, const metal::vec<3,float>& v) { v_[0] = s; this->v() = v; } + inline quat::quat(const metal::vec<4,float>& v) { this->v_ = v; } + inline quat& quat::operator=(const metal::vec<4,float>& v) { @@ -287,11 +292,13 @@ namespace mln // With literals. + inline quat::quat(const literal::zero_t&) { v_.set_all(0); } + inline quat& quat::operator=(const literal::zero_t&) { @@ -299,12 +306,14 @@ namespace mln return *this; } + inline quat::quat(const literal::one_t&) { s() = 1; v().set_all(0); } + inline quat& quat::operator=(const literal::one_t&) { @@ -314,24 +323,28 @@ namespace mln } + inline const metal::vec<4,float>& quat::to_vec() const { return this->v_; } + inline float quat::s() const { return this->v_[0]; } + inline float& quat::s() { return this->v_[0]; } + inline const metal::vec<3, float>& quat::v() const { @@ -339,12 +352,14 @@ namespace mln // return make::vec(this->v_[1], this->v_[2], this->v_[3]); } + inline metal::vec<3, float>& quat::v() { return *(metal::vec<3, float>*)(void*)(& this->v_[1]); } + inline void quat::set_v(float x, float y, float z) { this->v_[1] = x; @@ -352,32 +367,38 @@ namespace mln this->v_[3] = z; } + inline float quat::sprod(const quat& rhs) const { return v_ * rhs.to_vec(); } + inline bool quat::is_unit() const { return about_equal(norm::l2(v_), 1.f); } + inline bool quat::is_null() const { return about_equal(norm::l2(v_), 0.f); } + inline bool quat::is_pure() const { return about_equal(v_[0], 0.f); } + inline quat quat::conj() const { return quat(s(), - v()); } + inline quat quat::inv() const { assert(! is_null()); @@ -385,6 +406,7 @@ namespace mln return conj().to_vec() / (f * f); } + inline quat& quat::set_unit() { v_.normalize(); @@ -392,6 +414,7 @@ namespace mln } template <typename T> + inline void quat::set_unit(float theta, const metal::vec<3,T>& uv) { static const float pi = 3.14159265358979323846; @@ -410,24 +433,28 @@ namespace mln // only for unit quaternions described by theta and uv such as: // q = ( cos(theta), sin(theta) * uv ) + inline quat::quat(unsigned one, float theta, const metal::vec<3,float>& uv) { mln_precondition(one == 1); set_unit(theta, uv); } + inline float quat::theta() const { mln_precondition(is_unit()); return acos(s()); } + inline void quat::set_theta(float theta) { mln_precondition(is_unit()); set_unit(theta, uv()); } + inline metal::vec<3, float> quat::uv() const { mln_precondition(is_unit()); @@ -435,6 +462,7 @@ namespace mln return w.normalize(); } + inline void quat::set_uv(const metal::vec<3,float>& uv) { mln_precondition(is_unit()); @@ -444,23 +472,27 @@ namespace mln // Operators. + inline std::ostream& operator<<(std::ostream& ostr, const quat& q) { return ostr << q.to_vec(); } + inline quat operator+(const quat& lhs, const quat& rhs) { quat tmp(lhs.to_vec() + rhs.to_vec()); return tmp; } + inline quat operator-(const quat& lhs, const quat& rhs) { quat tmp(lhs.to_vec() - rhs.to_vec()); return tmp; } + inline quat operator*(const quat& lhs, const quat& rhs) { quat tmp(lhs.s() * rhs.s() - lhs.v() * rhs.v(), @@ -469,6 +501,7 @@ namespace mln } template <typename S> + inline quat operator*(const quat& lhs, const value::scalar_<S>& rhs) { mlc_converts_to(S, float)::check(); @@ -477,6 +510,7 @@ namespace mln } template <typename S> + inline quat operator/(const quat& lhs, const value::scalar_<S>& rhs_) { mlc_converts_to(S, float)::check(); @@ -489,6 +523,7 @@ namespace mln // overloaded math procs + inline quat log(const quat& q) { mln_precondition(q.is_unit()); @@ -496,6 +531,7 @@ namespace mln } + inline quat exp(const quat& q) { mln_precondition(about_equal(q.s(), 0.f)); @@ -507,6 +543,7 @@ namespace mln } + inline quat pow(const quat& q, double t) { mln_precondition(q.is_unit()); @@ -514,6 +551,7 @@ namespace mln } template <typename T> + inline bool about_equal(const T& f, const T& q) { // FIXME: Use abs! @@ -522,6 +560,7 @@ namespace mln return (q - f) < mln_epsilon(T); } + inline bool about_equal(const quat& p, const quat& q) { return about_equal<float>(norm::l2(p.to_vec() - q.to_vec()), 0); @@ -529,6 +568,7 @@ namespace mln // Misc. + inline bool interpol_ok(const quat& p, const quat& q, float h) { return @@ -541,6 +581,7 @@ namespace mln // Linear Quaternion Interpolation. + inline quat lerp(const quat& p, const quat& q, float h) { assert(interpol_ok(p, q, h)); @@ -550,6 +591,7 @@ namespace mln // Spherical Linear Quaternion Interpolation. + inline quat slerp(const quat& p, const quat& q, float h) { assert(interpol_ok(p, q, h)); @@ -560,6 +602,7 @@ namespace mln quat((sin((1-h)*omega) * p + sin(h*omega) * q) / sin(omega)); } + inline quat slerp_2(const quat& p, const quat& q, float h) { assert(interpol_ok(p, q, h)); @@ -568,6 +611,7 @@ namespace mln return tmp; } + inline quat slerp_3(const quat& p, const quat& q, float h) { assert(interpol_ok(p, q, h)); @@ -576,6 +620,7 @@ namespace mln return tmp; } + inline quat slerp_4(const quat& p, const quat& q, float h) { assert(interpol_ok(p, q, h)); @@ -584,6 +629,7 @@ namespace mln return tmp; } + inline quat slerp_5(const quat& p, const quat& q, float h) { assert(interpol_ok(p, q, h)); diff --git a/milena/mln/value/rgb.hh b/milena/mln/value/rgb.hh index eb3fca6..bb4da0a 100644 --- a/milena/mln/value/rgb.hh +++ b/milena/mln/value/rgb.hh @@ -174,23 +174,27 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <unsigned n> + inline rgb<n>::rgb() { } template <unsigned n> + inline rgb<n>::rgb(const metal::vec<3, int>& v) { this->v_ = v; } template <unsigned n> + inline rgb<n>::rgb(const metal::vec<3, int_u<n> >& v) { this->v_ = v; } template <unsigned n> + inline rgb<n>::rgb(int r, int g, int b) { mln_precondition(r >= 0); @@ -205,6 +209,7 @@ namespace mln } template <unsigned n> + inline rgb<n>::rgb(const literal::white_t&) { this->v_[0] = mln_max(int_u<n>); @@ -213,6 +218,7 @@ namespace mln } template <unsigned n> + inline rgb<n>::rgb(const literal::black_t&) { this->v_[0] = 0; @@ -221,6 +227,7 @@ namespace mln } template <unsigned n> + inline rgb<n>::rgb(const literal::red_t&) { this->v_[0] = mln_max(int_u<n>); @@ -229,6 +236,7 @@ namespace mln } template <unsigned n> + inline rgb<n>::rgb(const literal::green_t&) { this->v_[0] = 0; @@ -237,6 +245,7 @@ namespace mln } template <unsigned n> + inline rgb<n>::rgb(const literal::blue_t&) { this->v_[0] = 0; @@ -245,6 +254,7 @@ namespace mln } template <unsigned n> + inline rgb<n>& rgb<n>::operator=(const rgb<n>& rhs) { @@ -258,6 +268,7 @@ namespace mln const rgb<n> rgb<n>::zero(0,0,0); template <unsigned n> + inline rgb<n> rgb<n>::operator-(const rgb<n>& rhs) const { @@ -266,6 +277,7 @@ namespace mln } template <unsigned n> + inline rgb<n> rgb<n>::operator+(const rgb<n>& rhs) const { @@ -274,6 +286,7 @@ namespace mln } template <unsigned n> + inline rgb<n> rgb<n>::operator*(int i) const { @@ -282,6 +295,7 @@ namespace mln } template <unsigned n> + inline rgb<n> rgb<n>::operator/(int i) const { @@ -290,6 +304,7 @@ namespace mln } template <unsigned n> + inline std::ostream& operator<<(std::ostream& ostr, const rgb<n>& v) { return ostr << "(" << debug::format(v.red()) @@ -299,6 +314,7 @@ namespace mln } template <unsigned n> + inline std::istream& operator>>(std::istream& istr, rgb<n>& c) { return istr >> c.red() >> c.green() >> c.blue(); diff --git a/milena/mln/value/rgb8_non_templated.hh b/milena/mln/value/rgb8_non_templated.hh index 4cb6522..518351d 100644 --- a/milena/mln/value/rgb8_non_templated.hh +++ b/milena/mln/value/rgb8_non_templated.hh @@ -126,15 +126,18 @@ namespace mln # ifndef MLN_INCLUDE_ONLY // todo matthieu + inline rgb8::rgb8() { } + inline rgb8::rgb8(int_u8_x3_t a) { std::memcpy(this->c_, a, 3); } + inline rgb8& rgb8::operator=(rgb8& v) { @@ -147,12 +150,14 @@ namespace mln // const rgb8 rgb8::max_green = {0, mln_max(enc), 0}; // const rgb8 rgb8::max_blue = {0, 0, mln_max(enc)}; + inline rgb8& rgb8::operator+=(rgb8& v) { for (int i = 0; i < 3; i++) this->c_[i] += v.c_[i]; } + inline rgb8& rgb8::operator-=(rgb8& v) { @@ -160,6 +165,7 @@ namespace mln this->c_[i] += v.c_[i]; } + inline std::ostream& operator<<(std::ostream& ostr, const rgb8& v) { return ostr << "(R:" << debug::format(v.red()) @@ -168,6 +174,7 @@ namespace mln << ")"; } + inline bool rgb8::operator==(rgb8& v) { @@ -176,6 +183,7 @@ namespace mln this->blue() == v.blue()); } + inline bool rgb8::operator!=(rgb8& v) { diff --git a/milena/mln/value/scalar.hh b/milena/mln/value/scalar.hh index 13209ff..c88c495 100644 --- a/milena/mln/value/scalar.hh +++ b/milena/mln/value/scalar.hh @@ -106,17 +106,20 @@ namespace mln // scalar_<T>. template <typename T> + inline scalar_<T>::scalar_() { } template <typename T> + inline scalar_<T>::scalar_(const T& val) : val_(val) { } template <typename T> + inline T scalar_<T>::to_equiv() const { @@ -126,6 +129,7 @@ namespace mln // Operator. template <typename T> + inline std::ostream& operator<<(std::ostream& ostr, const scalar_<T>& s) { return ostr << s.to_equiv(); @@ -134,6 +138,7 @@ namespace mln // Routine. template <typename T> + inline typename internal::helper_scalar_<T>::ret scalar(const T& s) { diff --git a/milena/mln/value/set.hh b/milena/mln/value/set.hh index 0c5a27f..29f3b3c 100644 --- a/milena/mln/value/set.hh +++ b/milena/mln/value/set.hh @@ -79,6 +79,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY template <typename T> + inline const set<T>& set<T>::the() { diff --git a/milena/mln/value/stack.hh b/milena/mln/value/stack.hh index 654d859..095218e 100644 --- a/milena/mln/value/stack.hh +++ b/milena/mln/value/stack.hh @@ -172,6 +172,7 @@ namespace mln // internal::data_< cast_image_<T,I> > template <unsigned n, typename I> + inline data_< value::stack_image<n,I> >::data_(const metal::vec<n,I>& imas) : imas_(imas), ima_(imas_[0]) @@ -186,11 +187,13 @@ namespace mln // stack_image<n, I> template <unsigned n, typename I> + inline stack_image<n,I>::stack_image() { } template <unsigned n, typename I> + inline stack_image<n,I>::stack_image(const metal::vec<n,I>& imas) { this->data_ = new mln::internal::data_< stack_image<n, I> >(imas); @@ -201,6 +204,7 @@ namespace mln } template <unsigned n, typename I> + inline bool stack_image<n,I>::has_data() const { for (unsigned i = 0; i < n; ++i) @@ -209,6 +213,7 @@ namespace mln } template <unsigned n, typename I> + inline metal::vec<n, mln_value(I)> stack_image<n,I>::read_(const psite& p) const { @@ -220,6 +225,7 @@ namespace mln } template <unsigned n, typename I> + inline metal::vec<n, mln_value(I)> stack_image<n,I>::operator()(const psite& p) const { @@ -227,6 +233,7 @@ namespace mln } template <unsigned n, typename I> + inline void stack_image<n,I>::write_(const psite& p, const value& v) { @@ -237,6 +244,7 @@ namespace mln } template <unsigned n, typename I> + inline typename stack_image<n,I>::lvalue stack_image<n,I>::operator()(const psite& p) { @@ -244,6 +252,7 @@ namespace mln } template <unsigned n, typename I> + inline const mln::value::set< metal::vec<n, mln_value(I)> >& stack_image<n,I>::values() const { @@ -253,6 +262,7 @@ namespace mln // stack(..) template <typename I> + inline stack_image<2, const I> stack(const Image<I>& ima1, const Image<I>& ima2) { @@ -264,6 +274,7 @@ namespace mln } template <typename I> + inline stack_image<2, I> stack(Image<I>& ima1, Image<I>& ima2) { diff --git a/milena/mln/value/viter.hh b/milena/mln/value/viter.hh index 5795fab..afa50fe 100644 --- a/milena/mln/value/viter.hh +++ b/milena/mln/value/viter.hh @@ -123,6 +123,7 @@ namespace mln // fwd_viter_<S> template <typename S> + inline fwd_viter_<S>::fwd_viter_(const Value_Set<S>& s) : s_(exact(s)) { @@ -130,6 +131,7 @@ namespace mln } template <typename S> + inline fwd_viter_<S>::operator mln_value(S) () const { mln_precondition(is_valid()); @@ -137,6 +139,7 @@ namespace mln } template <typename S> + inline bool fwd_viter_<S>::is_valid() const { @@ -144,6 +147,7 @@ namespace mln } template <typename S> + inline void fwd_viter_<S>::invalidate() { @@ -151,6 +155,7 @@ namespace mln } template <typename S> + inline void fwd_viter_<S>::start() { @@ -158,6 +163,7 @@ namespace mln } template <typename S> + inline void fwd_viter_<S>::next_() { @@ -168,6 +174,7 @@ namespace mln // bkd_viter_<S> template <typename S> + inline bkd_viter_<S>::bkd_viter_(const Value_Set<S>& s) : s_(exact(s)) { @@ -175,6 +182,7 @@ namespace mln } template <typename S> + inline bkd_viter_<S>::operator mln_value(S) () const { mln_precondition(is_valid()); @@ -182,6 +190,7 @@ namespace mln } template <typename S> + inline bool bkd_viter_<S>::is_valid() const { @@ -189,6 +198,7 @@ namespace mln } template <typename S> + inline void bkd_viter_<S>::invalidate() { @@ -196,6 +206,7 @@ namespace mln } template <typename S> + inline void bkd_viter_<S>::start() { @@ -203,6 +214,7 @@ namespace mln } template <typename S> + inline void bkd_viter_<S>::next_() { diff --git a/milena/mln/win/backdiag2d.hh b/milena/mln/win/backdiag2d.hh index 2df1b84..6225659 100644 --- a/milena/mln/win/backdiag2d.hh +++ b/milena/mln/win/backdiag2d.hh @@ -134,6 +134,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY + inline backdiag2d::backdiag2d(unsigned length) : length_(length) { @@ -143,31 +144,37 @@ namespace mln insert(make::dpoint2d(col, col)); } + inline bool backdiag2d::is_centered() const { return true; } + inline bool backdiag2d::is_symmetric() const { return true; } + inline unsigned backdiag2d::length() const { return length_; } + inline unsigned backdiag2d::delta() const { return length_ / 2; } + inline backdiag2d& backdiag2d::sym() { return *this; } + inline std::ostream& operator<<(std::ostream& ostr, const backdiag2d& win) { ostr << "[diag 2d: length=" << win.length() << ']'; diff --git a/milena/mln/win/cube3d.hh b/milena/mln/win/cube3d.hh index c5eac95..742345b 100644 --- a/milena/mln/win/cube3d.hh +++ b/milena/mln/win/cube3d.hh @@ -140,6 +140,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY + inline cube3d::cube3d(unsigned length) : length_(length) { @@ -151,31 +152,37 @@ namespace mln insert(make::dpoint3d(sli, row, col)); } + inline bool cube3d::is_centered() const { return true; } + inline bool cube3d::is_symmetric() const { return true; } + inline unsigned cube3d::length() const { return length_; } + inline unsigned cube3d::delta() const { return length_ / 2; } + inline cube3d& cube3d::sym() { return *this; } + inline std::ostream& operator<<(std::ostream& ostr, const cube3d& win) { ostr << "[cube3d: length=" << win.length() << ']'; diff --git a/milena/mln/win/diag2d.hh b/milena/mln/win/diag2d.hh index f69c2d3..ebb87c1 100644 --- a/milena/mln/win/diag2d.hh +++ b/milena/mln/win/diag2d.hh @@ -134,6 +134,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY + inline diag2d::diag2d(unsigned length) : length_(length) { @@ -143,31 +144,37 @@ namespace mln insert(make::dpoint2d(-col, col)); } + inline bool diag2d::is_centered() const { return true; } + inline bool diag2d::is_symmetric() const { return true; } + inline unsigned diag2d::length() const { return length_; } + inline unsigned diag2d::delta() const { return length_ / 2; } + inline diag2d& diag2d::sym() { return *this; } + inline std::ostream& operator<<(std::ostream& ostr, const diag2d& win) { ostr << "[diag 2d: length=" << win.length() << ']'; diff --git a/milena/mln/win/disk2d.hh b/milena/mln/win/disk2d.hh index 9ee05e5..c9f58bd 100644 --- a/milena/mln/win/disk2d.hh +++ b/milena/mln/win/disk2d.hh @@ -125,6 +125,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY + inline disk2d::disk2d(unsigned length) : length_(length) { @@ -137,31 +138,37 @@ namespace mln insert(make::dpoint2d(a, b)); } + inline bool disk2d::is_centered() const { return true; } + inline bool disk2d::is_symmetric() const { return true; } + inline unsigned disk2d::length() const { return length_; } + inline unsigned disk2d::delta() const { return length_ / 2; } + inline disk2d& disk2d::sym() { return *this; } + inline std::ostream& operator<<(std::ostream& ostr, const disk2d& win) { ostr << "[disk2d: length=" << win.length() << ']'; diff --git a/milena/mln/win/line.hh b/milena/mln/win/line.hh index de98e4a..bcd7f13 100644 --- a/milena/mln/win/line.hh +++ b/milena/mln/win/line.hh @@ -131,6 +131,7 @@ namespace mln template <typename M, unsigned i, typename C> + inline line<M,i,C>::line(unsigned length) : length_(length) { @@ -147,36 +148,42 @@ namespace mln } template <typename M, unsigned i, typename C> + inline bool line<M,i,C>::is_centered() const { return true; } template <typename M, unsigned i, typename C> + inline bool line<M,i,C>::is_symmetric() const { return true; } template <typename M, unsigned i, typename C> + inline unsigned line<M,i,C>::length() const { return length_; } template <typename M, unsigned i, typename C> + inline unsigned line<M,i,C>::delta() const { return length_ / 2; } template <typename M, unsigned i, typename C> + inline line<M,i,C>& line<M,i,C>::sym() { return *this; } template <typename M, unsigned i, typename C> + inline std::ostream& operator<<(std::ostream& ostr, const line<M,i,C>& win) { ostr << "[line: length=" << win.length() << ']'; diff --git a/milena/mln/win/octagon2d.hh b/milena/mln/win/octagon2d.hh index 4652012..f97e7cd 100644 --- a/milena/mln/win/octagon2d.hh +++ b/milena/mln/win/octagon2d.hh @@ -142,6 +142,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY + inline octagon2d::octagon2d(unsigned length) : length_(length) { @@ -172,37 +173,44 @@ namespace mln } } + inline bool octagon2d::is_centered() const { return true; } + inline bool octagon2d::is_symmetric() const { return true; } + inline unsigned octagon2d::length() const { return length_; } + inline unsigned octagon2d::delta() const { return length_ / 2; } + inline unsigned octagon2d::area() const { unsigned l = (length_ - 1) / 6; return l * (28 * l + 8) + 4; } + inline octagon2d& octagon2d::sym() { return *this; } + inline std::ostream& operator<<(std::ostream& ostr, const octagon2d& win) { ostr << "[octagon2d: length=" << win.length() << ']'; diff --git a/milena/mln/win/rectangle2d.hh b/milena/mln/win/rectangle2d.hh index 593f559..a58bf17 100644 --- a/milena/mln/win/rectangle2d.hh +++ b/milena/mln/win/rectangle2d.hh @@ -139,6 +139,7 @@ namespace mln # ifndef MLN_INCLUDE_ONLY + inline rectangle2d::rectangle2d(unsigned height, unsigned width) : height_(height), width_(width) @@ -150,41 +151,49 @@ namespace mln insert(make::dpoint2d(row, col)); } + inline bool rectangle2d::is_centered() const { return true; } + inline bool rectangle2d::is_symmetric() const { return true; } + inline unsigned rectangle2d::height() const { return height_; } + inline unsigned rectangle2d::width() const { return width_; } + inline unsigned rectangle2d::area() const { return width_ * height_; } + inline unsigned rectangle2d::delta() const { return width_ > height_ ? width_ / 2 : height_ / 2; } + inline rectangle2d& rectangle2d::sym() { return *this; } + inline std::ostream& operator<<(std::ostream& ostr, const rectangle2d& win) { ostr << "[rectangle2d: width=" << win.width() << ", height=" << win.height() << ']'; -- SIGOURE Benoit aka Tsuna (SUSv3 compliant) _____ "Jesus saves, but only Buddha /EPITA\ Promo 2008.CSI/ACU/YAKA makes incremental backups"