
Index: olena/ChangeLog from Niels Van Vliet <niels@lrde.epita.fr> * olena/oln/arith/internal/opdecls.hh * olena/oln/arith/logic.hh * olena/oln/arith/ops.hh * olena/oln/math/macros.hh * olena/oln/config/pconf-hh.in +2004-03-13 Niels Van Vliet <niels@lrde.epita.fr> * olena/oln/convert/basics.hh: Add comments. * olena/oln/convert/bound.hh: Likewise. * olena/oln/convert/abstract/colorconv.hh: Likewise. Index: olena/oln/arith/internal/opdecls.hh --- olena/oln/arith/internal/opdecls.hh Fri, 07 Nov 2003 17:26:19 +0100 burrus_n (oln/b/22_opdecls.hh 1.15 640) +++ olena/oln/arith/internal/opdecls.hh Sat, 13 Mar 2004 17:49:35 +0100 van-vl_n (oln/b/22_opdecls.hh 1.15 640) @@ -1,4 +1,4 @@ -// Copyright (C) 2001, 2002, 2003 EPITA Research and Development Laboratory +// Copyright (C) 2001, 2002, 2003, 2004 EPITA Research and Development Laboratory // // This file is part of the Olena Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -28,27 +28,31 @@ #ifndef OLENA_ARITH_INTERNAL_OPDECLS_HH # define OLENA_ARITH_INTERNAL_OPDECLS_HH -/* - These macros should be rewritten / split into real code to make - things clearer. - - Operations are defined between two images and between one image and - one constant value (with the cst suffix). - - The two main components are: - - 1) Define functors for each operations, taking two values and - returning the result. - - 2) Define front-end functions applying a functor on the whole image. - 3 versions are defined, leaving the possibility to specify the - return type automatically, manually or using a conversion (from - convert). +/*! \file opdecls.hh +** +** Operations are defined between two images and between one image and +** one constant value (with the cst suffix). +** The two main components are: +** \n +** 1) Define functors for each operations, taking two values and +** returning the result. +**\n +** 2) Define front-end functions applying a functor on the whole image. +** 3 versions are defined, leaving the possibility to specify the +** return type automatically, manually or using a conversion (from +** convert). +** +** \todo FIXME: These macros should be rewritten / split into real code to make +** things clearer. */ -/*------------------. -| Binary functors. | -`------------------*/ +/*! Binary functors. +** +** Produce a functor named f_##OPNAME using the code OPCODE. +** +** \arg OPNAME Will produce the name of the function +** \arg OPCODE Operation that may use \a val1 and \a val2 +*/ # define oln_arith_declare_binrecval_functor_(OPNAME, OPCODE) \ template<class T1, class T2, class Ret> \ @@ -70,8 +74,16 @@ : public f_##OPNAME< T1, T2, ntg_return_type(OPNAME, T1, T2) > \ {} /* no ; */ -// Functor used by operations between an image and a constant + +/*! Unary functor, using a constant. +** +** Produce a functor named f_##OPNAME using the code OPCODE. The object +** is constructed using a constant. +** +** \arg OPNAME Will produce the name of the function +** \arg OPCODE_CST Operation that may use \a val1 and \a cst_ +*/ # define oln_arith_declare_binrecvalcst_functor_(OPNAME, OPCODE_CST) \ template<class T1, class T2, class Ret> \ struct f_##OPNAME##_cst : std::unary_function<const T1&, \ @@ -89,12 +101,25 @@ T2 cst_; \ } /* no ; */ -/* Both the above. */ + +/*! Produces an unary function and a binary and a Unary Functor using a constant. +** +** \arg OPNAME Will produce the name of the function. +** \arg OPCODE Operation that may use \a val1 and \a val2. +** \arg OPCODE_CST Operation that may use \a val1 and \a cst_. +** \see oln_arith_declare_binrecval_functor_ +** \see oln_arith_declare_binrecvalcst_functor_ +*/ # define oln_arith_declare_binrecval_functors_(OPNAME, OPCODE, OPCODE_CST) \ oln_arith_declare_binrecval_functor_(OPNAME, OPCODE); \ oln_arith_declare_binrecvalcst_functor_(OPNAME, OPCODE_CST) -/* For binary functions that work on a single known datatype. */ +/*! For binary functions that work on a single known datatype. +** +** \arg OPNAME Will produce the name of the function. +** \arg OPCODE Operation that may use \a val1 and \a val2. +** \arg TYPE Type that can be used. +*/ # define oln_arith_declare_binfixedtype_functor_(OPNAME, OPCODE, TYPE) \ struct f_##OPNAME : std::binary_function< const TYPE&, const TYPE&, TYPE> \ { \ @@ -106,7 +131,12 @@ } \ } /* no ; */ -/* For binary functions that work on a single known datatype. */ +/*! For Binary functions that work on a single known datatype. +** +** \arg OPNAME Will produce the name of the function. +** \arg OPCODE_CST Operation that may use \a val1 and \a cst_ +** \arg TYPE Type that can be used. +*/ # define oln_arith_declare_binfixedtypecst_functor_(OPNAME, OPCODE_CST, TYPE) \ struct f_##OPNAME##_cst: std::unary_function<const TYPE, TYPE> \ { \ @@ -121,12 +151,13 @@ TYPE cst_; \ } /* no ; */ -/* Both the above. */ +/*! oln_arith_declare_binfixedtype_functor_ & oln_arith_declare_binfixedtypecst_functor_. +*/ # define oln_arith_declare_binfixedtype_functors_(NAME, TYPE, CODE, CODE_CST) \ oln_arith_declare_binfixedtype_functor_(NAME, CODE, TYPE); \ oln_arith_declare_binfixedtypecst_functor_(NAME, CODE_CST, TYPE) -// Shortcuts +/// Shortcut #define default_functor_return_type_(OPNAME, I1, I2) \ typename f_##OPNAME<oln_value_type(I1), \ oln_value_type(I2), \ @@ -134,6 +165,7 @@ oln_value_type(I1), \ oln_value_type(I2))>::result_type +/// Shortcut. #define default_functor_type_cst_(OPNAME, I1, T2) \ f_##OPNAME##_cst<oln_value_type(I1), \ T2, \ @@ -141,13 +173,11 @@ oln_value_type(I1), \ T2)> +/// Shortcut. #define default_functor_return_type_cst_(OPNAME, I1, T2) \ typename default_functor_type_cst_(OPNAME, I1, T2)::result_type -/*----------------------------. -| Declare front-end functions | -`----------------------------*/ - +/// Declare front-end functions. # define oln_arith_declare_binop_procs_(OPNAME) \ /* \ FIXME: this is a workaround for an odd bug of icc and como \ @@ -203,8 +233,8 @@ input1, input2); \ } +/// Apply OPNAME with a constant as second operand. # define oln_arith_declare_binopcst_procs_(OPNAME) \ - /* Apply OPNAME with a constant as second operand. */ \ \ /* FIXME: cf explications above */ \ template <class I, class T> \ @@ -243,8 +273,7 @@ oln_arith_declare_binop_procs_(OPNAME) \ oln_arith_declare_binopcst_procs_(OPNAME) -/* Same as oln_arith_declare_nongenericbinop_procs_ but for non template - functors. */ +/// Same as oln_arith_declare_nongenericbinop_procs_ but for non template functors. # define oln_arith_declare_nongenericbinop_procs_(OPNAME) \ /* Standard application of OPNAME */ \ template<class I1, class I2> inline \ @@ -267,8 +296,9 @@ /* Same as oln_arith_declare_nongenericbinopcst_procs_ but for non template functors. */ + +/// Apply OPNAME with a constant as second operand. # define oln_arith_declare_nongenericbinopcst_procs_(OPNAME) \ - /* Apply OPNAME with a constant as second operand. */ \ template<class I, class T> inline \ typename mute<I, typename f_##OPNAME##_cst::result_type>::ret \ OPNAME##_cst(const abstract::image<I>& input, T val) \ @@ -298,7 +328,7 @@ | Unary functions. | `------------------*/ -/* For binary functions that work on a single known datatype. */ +/*! Unary function for binary functions that work on a single known datatype. */ # define oln_arith_declare_unfixedtype_functor_(OPNAME, TYPE, OPCODE) \ struct f_##OPNAME : std::unary_function< const TYPE&, TYPE> \ { \ Index: olena/oln/arith/logic.hh --- olena/oln/arith/logic.hh Thu, 07 Aug 2003 02:08:21 +0200 david (oln/b/24_logic.hh 1.6.1.3 640) +++ olena/oln/arith/logic.hh Sat, 13 Mar 2004 17:47:54 +0100 van-vl_n (oln/b/24_logic.hh 1.6.1.3 640) @@ -1,4 +1,4 @@ -// Copyright (C) 2001, 2002, 2003 EPITA Research and Development Laboratory +// Copyright (C) 2001, 2002, 2003, 2004 EPITA Research and Development Laboratory // // This file is part of the Olena Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -38,25 +38,33 @@ namespace arith { - // binary operators - + /// Functor AND operators. oln_arith_declare_binfixedtype_functors_(logic_and, ntg::bin, val1 && val2, val && cst_); + + /// Functor OR operators. oln_arith_declare_binfixedtype_functors_(logic_or, ntg::bin, val1 || val2, val || cst_); + /// Functor AND NOT operators. oln_arith_declare_binfixedtype_functors_(logic_and_not, ntg::bin, val1 && ! val2, val && ! cst_); + /// Functor NOT operator. + oln_arith_declare_unfixedtype_functor_(logic_not, ntg::bin, ! val); + + /// AND NOT operators. oln_arith_declare_all_nongenericbinop_procs_(logic_and); + + /// OR operators. oln_arith_declare_all_nongenericbinop_procs_(logic_or); - oln_arith_declare_all_nongenericbinop_procs_(logic_and_not); - // unary operators + /// AND NOT operators. + oln_arith_declare_all_nongenericbinop_procs_(logic_and_not); - oln_arith_declare_unfixedtype_functor_(logic_not, ntg::bin, ! val); + /// NOT operator. oln_arith_declare_nongenericunop_procs_(logic_not); } // end of arith Index: olena/oln/arith/ops.hh --- olena/oln/arith/ops.hh Wed, 08 Oct 2003 23:36:51 +0200 burrus_n (oln/b/23_ops.hh 1.5.1.2.1.8 640) +++ olena/oln/arith/ops.hh Sat, 13 Mar 2004 17:47:54 +0100 van-vl_n (oln/b/23_ops.hh 1.5.1.2.1.8 640) @@ -1,4 +1,4 @@ -// Copyright (C) 2001, 2002, 2003 EPITA Research and Development Laboratory +// Copyright (C) 2001, 2002, 2003, 2004 EPITA Research and Development Laboratory // // This file is part of the Olena Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -38,6 +38,9 @@ # include <functional> namespace oln { + /*! + ** \brief Namespace for arithmetic. + */ namespace arith { oln_arith_declare_binrecval_functors_(plus, Index: olena/oln/math/macros.hh --- olena/oln/math/macros.hh Thu, 07 Aug 2003 02:37:23 +0200 burrus_n (oln/b/21_macros.hh 1.6.1.11 640) +++ olena/oln/math/macros.hh Sat, 13 Mar 2004 17:53:02 +0100 van-vl_n (oln/b/21_macros.hh 1.6.1.11 640) @@ -1,4 +1,4 @@ -// Copyright (C) 2001, 2002, 2003 EPITA Research and Development Laboratory +// Copyright (C) 2001, 2002, 2003, 2004 EPITA Research and Development Laboratory // // This file is part of the Olena Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -33,18 +33,19 @@ namespace oln { + /*! \namespace oln:math + ** useful functions. + ** + ** \note FIXME: I'm not proud of the code below + ** think it could be better... + ** + ** \todo FIXME: this code sounds really odd. Why does the operator() + ** take value<Self> instead of Self directly ? + ** FIXME: Self should be renamed into Exact. + */ namespace math { - // FIXME: I'm not proud of the code below - // I think it could be better... - - // FIXME: this code sounds really odd. Why does the operator() - // take value<Self> instead of Self directly ? - - // FIXME: Self should be renamed into Exact. - - // sqr - + //! \brief Square fctor. template<class T> struct f_sqr { @@ -55,6 +56,7 @@ } }; + //! Square function. template<class T> const T sqr(const T& val) { @@ -62,8 +64,7 @@ return f(val); } - // abs - + //! Absolute value fctor. template<class T> struct f_abs { @@ -76,6 +77,7 @@ } }; + //! Absolute value function. template<class T> const T abs(const T& val) Index: olena/oln/config/pconf-hh.in --- olena/oln/config/pconf-hh.in Sun, 19 Jan 2003 22:14:38 +0100 raph (oln/p/17_pconf-hh.i 1.1 640) +++ olena/oln/config/pconf-hh.in Sat, 13 Mar 2004 17:51:06 +0100 van-vl_n (oln/p/17_pconf-hh.i 1.1 640) @@ -1,11 +1,11 @@ -/* Define to the address where bug reports for this package should be sent. */ +/*! Define to the address where bug reports for this package should be sent. */ #define OLN_PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@" -/* Define to the full name of this package. */ +/*! Define to the full name of this package. */ #define OLN_PACKAGE_NAME "@PACKAGE_NAME@" -/* Define to the full name and version of this package. */ +/*! Define to the full name and version of this package. */ #define OLN_PACKAGE_STRING "@PACKAGE_STRING@" -/* Define to the version of this package. */ +/*! Define to the version of this package. */ #define OLN_PACKAGE_VERSION "@PACKAGE_VERSION@"

"Niels" == Niels Van Vliet <niels@lrde.epita.fr> writes:
+/*! \file opdecls.hh +** +** Operations are defined between two images and between one image and +** one constant value (with the cst suffix). +** The two main components are: +** \n +** 1) Define functors for each operations, taking two values and +** returning the result. +**\n +** 2) Define front-end functions applying a functor on the whole image. +** 3 versions are defined, leaving the possibility to specify the +** return type automatically, manually or using a conversion (from +** convert). +** +** \todo FIXME: These macros should be rewritten / split into real code to make +** things clearer. */
Les listes numérotées, c'est « -# ». http://www.stack.nl/~dimitri/doxygen/lists.html

"Niels" == Niels Van Vliet <niels@lrde.epita.fr> writes:
@@ -38,6 +38,9 @@ # include <functional>
namespace oln { + /*! + ** \brief Namespace for arithmetic. + */ namespace arith {
oln_arith_declare_binrecval_functors_(plus,
Souvent les documentations (et publications d'ailleurs) sont plus agréables à lire quand on supprime les mots inutiles. Ici par exemple, le `Namespace for' est totalement inutile. Plus utile serait de savoir ce qu'est l'arithmétique ici. Par exemple (wild guess): \brief Arithmetic operators on recursive values. (Genre). Tjs dans le genre inutile, voir http://www.lrde.epita.fr/~akim/compil/tc-doc/index.html où on a des choses du genre : arrayexp.cc Implementation for ast/arrayexp.hh arrayexp.hh arrayexp.hxx Inline methods for ast/arrayexp.hh C'est complètement con, on se doute de la correspondance entre les fichiers. Ce qui est plus intelligent c'est de pointer sur la classe, là on a un intérêt hyper-texte : arrayexp.cc Implementation of ast::ArrayExp arrayexp.hh Declaration of ast::Arrayexp arrayexp.hxx Inline methods of ast::ArrayExp Mieux encore, sans mots inutiles : arrayexp.cc ast::ArrayExp implementation arrayexp.hh ast::Arrayexp declaration arrayexp.hxx Inline methods of ast::ArrayExp
participants (2)
-
Akim Demaille
-
Niels Van Vliet