
* mln/math/all.hh: add new includes. * mln/math/pi.hh: add constant. * mln/math/sin.hh: Add math::sin(). --- milena/ChangeLog | 10 +++++++ milena/mln/math/all.hh | 11 ++++--- milena/mln/math/{all.hh => pi.hh} | 38 ++++++++++------------------ milena/mln/math/{all.hh => sin.hh} | 48 +++++++++++++++++++---------------- 4 files changed, 56 insertions(+), 51 deletions(-) copy milena/mln/math/{all.hh => pi.hh} (67%) copy milena/mln/math/{all.hh => sin.hh} (68%) diff --git a/milena/ChangeLog b/milena/ChangeLog index bd1f274..3ece40a 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,3 +1,13 @@ +2009-03-30 Guillaume Lazzara <lazzara@lrde.epita.fr> + + Add math::sin and math::pi. + + * mln/math/all.hh: add new includes. + + * mln/math/pi.hh: add constant. + + * mln/math/sin.hh: Add math::sin(). + 2009-03-30 Fabien Freling <fabien.freling@lrde.epita.fr> Add a plot format save() routine. diff --git a/milena/mln/math/all.hh b/milena/mln/math/all.hh index ce8b3b2..60d528c 100644 --- a/milena/mln/math/all.hh +++ b/milena/mln/math/all.hh @@ -1,4 +1,4 @@ -// Copyright (C) 2008 EPITA Research and Development Laboratory +// Copyright (C) 2008, 2009 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,10 +28,9 @@ #ifndef MLN_MATH_ALL_HH # define MLN_MATH_ALL_HH -/*! \file mln/math/all.hh - * - * \brief File that includes all mathematical routines. - */ +/// \file mln/math/all.hh +/// +/// File that includes all mathematical routines. namespace mln @@ -49,7 +48,9 @@ namespace mln # include <mln/math/max.hh> # include <mln/math/min.hh> # include <mln/math/round.hh> +# include <mln/math/pi.hh> # include <mln/math/sign.hh> +# include <mln/math/sin.hh> # include <mln/math/sqr.hh> # include <mln/math/sqrt.hh> # include <mln/math/cos.hh> diff --git a/milena/mln/math/all.hh b/milena/mln/math/pi.hh similarity index 67% copy from milena/mln/math/all.hh copy to milena/mln/math/pi.hh index ce8b3b2..08f6d07 100644 --- a/milena/mln/math/all.hh +++ b/milena/mln/math/pi.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2008 EPITA Research and Development Laboratory +// Copyright (C) 2009 EPITA Research and Development Laboratory +// (LRDE) // // This file is part of the Olena Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -25,36 +26,25 @@ // reasons why the executable file might be covered by the GNU General // Public License. -#ifndef MLN_MATH_ALL_HH -# define MLN_MATH_ALL_HH - -/*! \file mln/math/all.hh - * - * \brief File that includes all mathematical routines. - */ - +#ifndef MLN_MATH_PI_HH +# define MLN_MATH_PI_HH namespace mln { - /// Namespace of mathematical routines. - namespace math {} + namespace math + { + + extern const double pi; -} +# ifndef MLN_INCLUDE_ONLY + const double pi = 3.1415926535; -# include <mln/math/abs.hh> -# include <mln/math/diff_abs.hh> -# include <mln/math/jacobi.hh> -# include <mln/math/max.hh> -# include <mln/math/min.hh> -# include <mln/math/round.hh> -# include <mln/math/sign.hh> -# include <mln/math/sqr.hh> -# include <mln/math/sqrt.hh> -# include <mln/math/cos.hh> -# include <mln/math/acos.hh> +# endif // ! MLN_INCLUDE_ONLY + } // end of namespace mln::math +} // end of namespace mln -#endif // ! MLN_MATH_ALL_HH +#endif // ! MLN_MATH_PI_HH diff --git a/milena/mln/math/all.hh b/milena/mln/math/sin.hh similarity index 68% copy from milena/mln/math/all.hh copy to milena/mln/math/sin.hh index ce8b3b2..b39ee08 100644 --- a/milena/mln/math/all.hh +++ b/milena/mln/math/sin.hh @@ -1,4 +1,4 @@ -// Copyright (C) 2008 EPITA Research and Development Laboratory +// Copyright (C) 2009 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 @@ -25,36 +25,40 @@ // reasons why the executable file might be covered by the GNU General // Public License. -#ifndef MLN_MATH_ALL_HH -# define MLN_MATH_ALL_HH +#ifndef MLN_MATH_SIN_HH +# define MLN_MATH_SIN_HH -/*! \file mln/math/all.hh - * - * \brief File that includes all mathematical routines. - */ +/// \file mln/math/sin.hh +/// +/// Define the sininus (sin) routine. + +# include <cmath> namespace mln { - /// Namespace of mathematical routines. - namespace math {} + namespace math + { + + template <typename T> + T sin(const T& v); + + +# ifndef MLN_INCLUDE_ONLY -} + template <typename T> + inline + T sin(const T& v) + { + return std::sin(v); + } +# endif // ! MLN_INCLUDE_ONLY -# include <mln/math/abs.hh> -# include <mln/math/diff_abs.hh> -# include <mln/math/jacobi.hh> -# include <mln/math/max.hh> -# include <mln/math/min.hh> -# include <mln/math/round.hh> -# include <mln/math/sign.hh> -# include <mln/math/sqr.hh> -# include <mln/math/sqrt.hh> -# include <mln/math/cos.hh> -# include <mln/math/acos.hh> + } // end of namespace mln::math +} // end of namespace mln -#endif // ! MLN_MATH_ALL_HH +#endif // ! MLN_MATH_SIN_HH -- 1.5.6.5