
* mln/core/image/image1d.hh, * mln/core/image/image2d.hh, * mln/core/image/image3d.hh, * mln/opt/at.hh: rename at() to at_(). * doc/tutorial/images_tour.txt, * doc/tutorial/outputs/ima2d-3.txt, * doc/tutorial/samples/ima2d-3.cc, * doc/tutorial/tutorial.tex: use opt::at(ima,...) instead of ima.at() * doc/tutorial/outputs/ima2d-3-output.txt: remove useless file. --- milena/ChangeLog | 16 ++++++++++++++++ milena/doc/tutorial/images_tour.txt | 4 ++-- milena/doc/tutorial/outputs/ima2d-3-output.txt | 6 ------ milena/doc/tutorial/outputs/ima2d-3.txt | 4 ++-- milena/doc/tutorial/samples/ima2d-3.cc | 4 ++-- milena/doc/tutorial/tutorial.tex | 4 ++-- milena/mln/core/image/image1d.hh | 8 ++++---- milena/mln/core/image/image2d.hh | 8 ++++---- milena/mln/core/image/image3d.hh | 10 +++++----- milena/mln/opt/at.hh | 12 ++++++------ 10 files changed, 43 insertions(+), 33 deletions(-) delete mode 100644 milena/doc/tutorial/outputs/ima2d-3-output.txt diff --git a/milena/ChangeLog b/milena/ChangeLog index 577c1dd..1ab3eff 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,5 +1,21 @@ 2008-12-31 Guillaume Lazzara <z@lrde.epita.fr> + Rename at() to at_(). + + * mln/core/image/image1d.hh, + * mln/core/image/image2d.hh, + * mln/core/image/image3d.hh, + * mln/opt/at.hh: rename at() to at_(). + + * doc/tutorial/images_tour.txt, + * doc/tutorial/outputs/ima2d-3.txt, + * doc/tutorial/samples/ima2d-3.cc, + * doc/tutorial/tutorial.tex: use opt::at(ima,...) instead of ima.at() + + * doc/tutorial/outputs/ima2d-3-output.txt: remove useless file. + +2008-12-31 Guillaume Lazzara <z@lrde.epita.fr> + Rename Image::has_data() to Image::is_valid(). * mln/accu/compute.hh, diff --git a/milena/doc/tutorial/images_tour.txt b/milena/doc/tutorial/images_tour.txt index b9dcefd..693c447 100644 --- a/milena/doc/tutorial/images_tour.txt +++ b/milena/doc/tutorial/images_tour.txt @@ -338,8 +338,8 @@ retrieve v from (the key) p; testing that this image has p is costly. *** example -ima.at(0,0) := 5 -ima.at(1,1) := 7 +opt::at(ima, 0,0) := 5 +opt::at(ima, 1,1) := 7 ima = 5 . . 7 diff --git a/milena/doc/tutorial/outputs/ima2d-3-output.txt b/milena/doc/tutorial/outputs/ima2d-3-output.txt deleted file mode 100644 index 096ef4f..0000000 --- a/milena/doc/tutorial/outputs/ima2d-3-output.txt +++ /dev/null @@ -1,6 +0,0 @@ -ima.at(1,2) = 9 -ima(p) = 9 ---- -ima.at(1,2) = 2 -ima(p) = 2 - diff --git a/milena/doc/tutorial/outputs/ima2d-3.txt b/milena/doc/tutorial/outputs/ima2d-3.txt index b0fda85..a0a8707 100644 --- a/milena/doc/tutorial/outputs/ima2d-3.txt +++ b/milena/doc/tutorial/outputs/ima2d-3.txt @@ -1,5 +1,5 @@ -ima.at(1,2) = 9 +opt::at(ima, 1,2) = 9 ima(p) = 9 --- -ima.at(1,2) = 2 +opt::at(ima, 1,2) = 2 ima(p) = 2 diff --git a/milena/doc/tutorial/samples/ima2d-3.cc b/milena/doc/tutorial/samples/ima2d-3.cc index 3ab11a7..97d1ebf 100644 --- a/milena/doc/tutorial/samples/ima2d-3.cc +++ b/milena/doc/tutorial/samples/ima2d-3.cc @@ -16,7 +16,7 @@ int main() // Associate '9' as value for the site/point2d (1,2). // The value is returned by reference and can be changed. opt::at(ima, 1,2) = 9; - std::cout << "ima.at(1,2) = " << opt::at(ima, 1,2) + std::cout << "opt::at(ima, 1,2) = " << opt::at(ima, 1,2) << std::endl; std::cout << "ima(p) = " << ima(p) << std::endl; @@ -27,7 +27,7 @@ int main() // The value is returned by reference // and can be changed as well. ima(p) = 2; - std::cout << "ima.at(1,2) = " << opt::at(ima, 1,2) + std::cout << "opt::at(ima, 1,2) = " << opt::at(ima, 1,2) << std::endl; std::cout << "ima(p) = " << ima(p) << std::endl; // \} diff --git a/milena/doc/tutorial/tutorial.tex b/milena/doc/tutorial/tutorial.tex index a2affa1..73ac9fd 100644 --- a/milena/doc/tutorial/tutorial.tex +++ b/milena/doc/tutorial/tutorial.tex @@ -1040,7 +1040,7 @@ the default one, e.g 0. By using \code{initialize} \var{img2b} is initialized There are several ways to access/modify an image ``\var{ima}'': \begin{itemize} -\item \code{ima.at(x, y, \dots)} +\item \code{opt::at(ima, x, y, \dots)} \item \code{ima(Site)} \end{itemize} @@ -1048,7 +1048,7 @@ Most of the time, images can be modified and these two methods can be used both to read a value and modify it. Both methods are equivalent. \doxycode{ima2d-3} Output: -\doxyoutput{ima2d-3-output} +\doxyoutput{ima2d-3} Usually, you will want to use the functional way, ``\code{ima(Site)}'', more particularly while iterating over all the sites through an iterator. This use diff --git a/milena/mln/core/image/image1d.hh b/milena/mln/core/image/image1d.hh index d86bc53..4cd48ec 100644 --- a/milena/mln/core/image/image1d.hh +++ b/milena/mln/core/image/image1d.hh @@ -181,10 +181,10 @@ namespace mln // ----------------- /// Read-only access to the image value located at (\p index). - const T& at(def::coord index) const; + const T& at_(def::coord index) const; /// Read-write access to the image value located at (\p index). - T& at(def::coord index); + T& at_(def::coord index); /// Fast Image method @@ -426,7 +426,7 @@ namespace mln template <typename T> inline const T& - image1d<T>::at(def::coord index) const + image1d<T>::at_(def::coord index) const { mln_precondition(this->has(point1d(index))); return this->data_->array_[index]; @@ -435,7 +435,7 @@ namespace mln template <typename T> inline T& - image1d<T>::at(def::coord index) + image1d<T>::at_(def::coord index) { mln_precondition(this->has(point1d(index))); return this->data_->array_[index]; diff --git a/milena/mln/core/image/image2d.hh b/milena/mln/core/image/image2d.hh index 3146b14..c491c10 100644 --- a/milena/mln/core/image/image2d.hh +++ b/milena/mln/core/image/image2d.hh @@ -205,10 +205,10 @@ namespace mln // ----------------- /// Read-only access to the image value located at (\p row, \p col). - const T& at(def::coord row, def::coord col) const; + const T& at_(def::coord row, def::coord col) const; /// Read-write access to the image value located at (\p row, \p col). - T& at(def::coord row, def::coord col); + T& at_(def::coord row, def::coord col); /// Give the number of rows. unsigned nrows() const; @@ -463,7 +463,7 @@ namespace mln template <typename T> inline const T& - image2d<T>::at(def::coord row, def::coord col) const + image2d<T>::at_(def::coord row, def::coord col) const { mln_precondition(this->has(point2d(row, col))); return this->data_->array_[row][col]; @@ -472,7 +472,7 @@ namespace mln template <typename T> inline T& - image2d<T>::at(def::coord row, def::coord col) + image2d<T>::at_(def::coord row, def::coord col) { mln_precondition(this->has(point2d(row, col))); return this->data_->array_[row][col]; diff --git a/milena/mln/core/image/image3d.hh b/milena/mln/core/image/image3d.hh index 839f8d4..8016414 100644 --- a/milena/mln/core/image/image3d.hh +++ b/milena/mln/core/image/image3d.hh @@ -52,7 +52,7 @@ namespace mln { - // Fwd decl. + // Forward declaration. template <typename T> struct image3d; @@ -201,11 +201,11 @@ namespace mln /// Read-only access to the image value located at (\p sli, \p /// row, \p col). - const T& at(def::coord sli, def::coord row, def::coord col) const; + const T& at_(def::coord sli, def::coord row, def::coord col) const; /// Read-write access to the image value located at (\p sli, \p /// row, \p col). - T& at(def::coord sli, def::coord row, def::coord col); + T& at_(def::coord sli, def::coord row, def::coord col); /// Fast Image method @@ -484,7 +484,7 @@ namespace mln template <typename T> inline const T& - image3d<T>::at(def::coord sli, def::coord row, def::coord col) const + image3d<T>::at_(def::coord sli, def::coord row, def::coord col) const { mln_precondition(this->has(point3d(sli, row, col))); return data_->array_[sli][row][col]; @@ -493,7 +493,7 @@ namespace mln template <typename T> inline T& - image3d<T>::at(def::coord sli, def::coord row, def::coord col) + image3d<T>::at_(def::coord sli, def::coord row, def::coord col) { mln_precondition(this->has(point3d(sli, row, col))); return data_->array_[sli][row][col]; diff --git a/milena/mln/opt/at.hh b/milena/mln/opt/at.hh index b064a79..6cfb85a 100644 --- a/milena/mln/opt/at.hh +++ b/milena/mln/opt/at.hh @@ -101,7 +101,7 @@ namespace mln mln_rvalue(I) at_1d_impl(trait::image::category::primary, const Image<I>& ima, def::coord ind) { - return exact(ima).at(ind); + return exact(ima).at_(ind); } @@ -132,7 +132,7 @@ namespace mln mln_lvalue(I) at_1d_impl(trait::image::category::primary, Image<I>& ima, def::coord ind) { - return exact(ima).at(ind); + return exact(ima).at_(ind); } } // end of namespace mln::opt::impl @@ -186,7 +186,7 @@ namespace mln mln_rvalue(I) at_2d_impl(trait::image::category::primary, const Image<I>& ima, def::coord row, def::coord col) { - return exact(ima).at(row, col); + return exact(ima).at_(row, col); } @@ -217,7 +217,7 @@ namespace mln mln_lvalue(I) at_2d_impl(trait::image::category::primary, Image<I>& ima, def::coord row, def::coord col) { - return exact(ima).at(row, col); + return exact(ima).at_(row, col); } } // end of namespace mln::opt::impl @@ -270,7 +270,7 @@ namespace mln mln_rvalue(I) at_3d_impl(trait::image::category::primary, const Image<I>& ima, def::coord sli, def::coord row, def::coord col) { - return exact(ima).at(sli, row, col); + return exact(ima).at_(sli, row, col); } @@ -301,7 +301,7 @@ namespace mln mln_lvalue(I) at_3d_impl(trait::image::category::primary, Image<I>& ima, def::coord sli, def::coord row, def::coord col) { - return exact(ima).at(sli, row, col); + return exact(ima).at_(sli, row, col); } } // end of namespace mln::opt::impl -- 1.5.6.5