https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Fix warnings due to g++ -Wconversion option.
* mln/value/proxy.hh,
* mln/value/cast.hh,
* mln/value/ops.hh,
* mln/fun/v2v/linear.hh,
* mln/io/fits/load.hh,
* tests/value/float01.cc,
* tests/value/Makefile.am,
* tests/win/cuboid3d.cc,
* tests/win/vline2d.cc,
* tests/win/cube3d.cc,
* tests/win/backdiag2d.cc,
* tests/win/octagon2d.cc,
* tests/win/disk2d.cc,
* tests/win/hline2d.cc,
* tests/win/segment1d.cc,
* tests/win/rectangle2d.cc: Fix warning with Wconversion.
Upgrade file doc style.
Layout.
* mln/value/float01_.hh: Likewise.
(mln_card): Replace by...
(mln_max): ...this. So work for n > 12.
* tests/value/quat.cc: Move in...
* tests/algebra/quat.cc: ...here; where it belongs!
* tests/algebra/Makefile.am: Update.
mln/fun/v2v/linear.hh | 2 +-
mln/io/fits/load.hh | 6 ++++--
mln/value/cast.hh | 2 +-
mln/value/float01_.hh | 16 ++++++++--------
mln/value/ops.hh | 3 ++-
mln/value/proxy.hh | 7 +++----
tests/algebra/Makefile.am | 2 ++
tests/algebra/quat.cc | 14 +++++++-------
tests/value/Makefile.am | 2 --
tests/value/float01.cc | 42 ++++++++++++++++++++++--------------------
tests/win/backdiag2d.cc | 26 ++++++++++++--------------
tests/win/cube3d.cc | 24 +++++++++++-------------
tests/win/cuboid3d.cc | 24 +++++++++++-------------
tests/win/disk2d.cc | 27 ++++++++++++---------------
tests/win/hline2d.cc | 24 +++++++++++-------------
tests/win/octagon2d.cc | 28 +++++++++++++---------------
tests/win/rectangle2d.cc | 20 +++++++++-----------
tests/win/segment1d.cc | 20 +++++++++-----------
tests/win/vline2d.cc | 24 +++++++++++-------------
19 files changed, 149 insertions(+), 164 deletions(-)
Index: mln/value/proxy.hh
--- mln/value/proxy.hh (revision 3113)
+++ mln/value/proxy.hh (working copy)
@@ -29,10 +29,9 @@
#ifndef MLN_VALUE_PROXY_HH
# define MLN_VALUE_PROXY_HH
-/*! \file mln/value/proxy.hh
- *
- * \brief Define a generic proxy class for an image pixel value.
- */
+/// \file mln/value/proxy.hh
+///
+/// Define a generic proxy class for an image pixel value.
# include <mln/core/concept/value.hh>
# include <mln/trait/value_.hh>
Index: mln/value/cast.hh
--- mln/value/cast.hh (revision 3113)
+++ mln/value/cast.hh (working copy)
@@ -88,7 +88,7 @@
{
// FIXME: Add static_cast<Dest>?
// FIXME: Add exact()?
- return internal::cast_(&src, src);
+ return static_cast<Dest>(internal::cast_(&src, src));
}
# endif // ! MLN_INCLUDE_ONLY
Index: mln/value/ops.hh
--- mln/value/ops.hh (revision 3113)
+++ mln/value/ops.hh (working copy)
@@ -243,7 +243,8 @@
mln_trait_op_div(Vl, Vr)
operator / (const value::Scalar<Vl>& lhs, const value::Scalar<Vr>&
rhs)
{
- return value::equiv(lhs) / value::equiv(rhs);
+ typedef mln_trait_op_div(Vl, Vr) R;
+ return static_cast<R>(value::equiv(lhs)) /
static_cast<R>(value::equiv(rhs));
}
template <typename Vl, typename Vr>
Index: mln/value/float01_.hh
--- mln/value/float01_.hh (revision 3113)
+++ mln/value/float01_.hh (working copy)
@@ -167,9 +167,9 @@
inline
float01_<n>::float01_(float val)
{
- mln_precondition(val >= 0);
- mln_precondition(val <= 1);
- this->v_ = static_cast<enc_>(val * (mln_card(float01_<n>) - 1)); //
FIXME
+ mln_precondition(val >= 0.f);
+ mln_precondition(val <= 1.f);
+ this->v_ = static_cast<enc_>(val * (float(mln_max(enc_)) - 1.f)); //
FIXME
}
template <unsigned n>
@@ -177,7 +177,7 @@
float
float01_<n>::value() const
{
- return float(this->v_) / float(mln_card(float01_<n>) - 1); // FIXME
+ return float(this->v_) / (float(mln_max(enc_)) - 1.f); // FIXME
}
template <unsigned n>
@@ -193,9 +193,9 @@
float01_<n>&
float01_<n>::operator=(float val)
{
- mln_precondition(val >= 0);
- mln_precondition(val <= 1);
- this->v_ = static_cast<enc_>(val * (mln_card(float01_<n>) - 1)); //
FIXME
+ mln_precondition(val >= 0.f);
+ mln_precondition(val <= 1.f);
+ this->v_ = static_cast<enc_>(val * (float(mln_max(enc_)) - 1.f)); //
FIXME
return *this;
}
@@ -203,7 +203,7 @@
inline
float01_<n>::operator float() const
{
- return float(this->v_) / float(mln_card(float01_<n>) - 1);
+ return float(this->v_) / (float(mln_max(enc_)) - 1.f);
}
Index: mln/fun/v2v/linear.hh
--- mln/fun/v2v/linear.hh (revision 3113)
+++ mln/fun/v2v/linear.hh (working copy)
@@ -84,7 +84,7 @@
R
linear<V,T,R>::operator()(const V& v) const
{
- return convert::to<R>(a * static_cast<T>(v) + b);
+ return mln::convert::to<R>(a * static_cast<T>(v) + b);
}
template <typename V, typename T, typename R>
Index: mln/io/fits/load.hh
--- mln/io/fits/load.hh (revision 3113)
+++ mln/io/fits/load.hh (working copy)
@@ -1,5 +1,5 @@
// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 EPITA
-// Research and Development Laboratory
+// 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
@@ -44,6 +44,7 @@
//FIXME: Add fitsio dependency
# include <fitsio.h>
+
namespace mln
{
@@ -98,7 +99,8 @@
if (fits_open_file(&fptr, filename.c_str(), READONLY, &status))
fits_exit(status);
- if (fits_read_keys_lng(fptr, "NAXIS", 1, 2, naxes, &nfound, &status))
+ char NAXIS[] = "NAXIS";
+ if (fits_read_keys_lng(fptr, NAXIS, 1, 2, naxes, &nfound, &status))
fits_exit(status);
const int ncols = naxes[0], nrows = naxes[1];
Index: tests/value/float01.cc
--- tests/value/float01.cc (revision 3113)
+++ tests/value/float01.cc (working copy)
@@ -1,4 +1,5 @@
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,10 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/value/float01.cc
- *
- * \brief Tests on mln::value::float01.
- */
+/// \file tests/value/float01.cc
+///
+/// Tests on mln::value::float01.
#include <iostream>
@@ -53,20 +53,20 @@
using namespace mln::value;
using mln::value::int_u8;
-float fi(int) { return 0.5; }
+float fi(int) { return 0.5f; }
int ii(int) { return 1; }
-float fd(double) { return 0.5; }
+float fd(double) { return 0.5f; }
int id(double) { return 1; }
struct tofloat01 : mln::Function_v2v<tofloat01>
{
- typedef float01_<16> result;
+ typedef float01_<12> result;
result operator()(int_u8 v) const
{
- result ret(double(v) / (mln_max(int_u8)));
+ result ret = static_cast<float>(v) /
static_cast<float>(mln_max(int_u8));
// std::cout << v << "-> " << ret <<
std::endl;
return ret;
}
@@ -76,9 +76,9 @@
{
typedef int_u8 result;
- result operator()(float01_<16> v) const
+ result operator()(float01_<12> v) const
{
- result ret = int(v.value() * 255);
+ result ret = static_cast<int>(v.value() * 255);
// FIXME: Dead code.
//std::cout << v << "-> " << ret << std::endl;
return ret;
@@ -96,13 +96,13 @@
assert(approx_equal(b,a));
std::cout << b << std::endl;
- b = b + 0.2;
+ b = b + 0.2f;
std::cout << b << std::endl;
- b = b - 0.2;
+ b = b - 0.2f;
std::cout << b << std::endl;
- b = b * 1.5;
+ b = b * 1.5f;
std::cout << b << std::endl;
- b = b / 4.6;
+ b = b / 4.6f;
std::cout << b << std::endl;
b = b / 3;
@@ -110,14 +110,14 @@
b = b * 1;
std::cout << b << std::endl;
- a = fi(a);
- a = ii(a);
+ a = fi( static_cast<int>(a) );
+ a = static_cast<float>( ii( static_cast<int>(a) ) );
a = fd(a);
- a = id(a);
+ a = static_cast<float>( id(a) );
b = a;
a = b;
- b = 0.34;
+ b = 0.34f;
std::cout << b << std::endl;
b = 0;
std::cout << b << std::endl;
@@ -125,13 +125,15 @@
std::cout << b << std::endl;
{
+ typedef value::float01_<12> float01_12;
+
std::cout << "convert" << std::endl;
image2d<int_u8>
lena = io::pgm::load<int_u8>("../img/lena.pgm"),
ref(lena.domain());
- image2d<float01_16> out(lena.domain());
- image2d<float01_16> tmp(lena.domain());
+ image2d<float01_12> out(lena.domain());
+ image2d<float01_12> tmp(lena.domain());
tmp = level::transform(lena, tofloat01());
Index: tests/value/Makefile.am
--- tests/value/Makefile.am (revision 3113)
+++ tests/value/Makefile.am (working copy)
@@ -19,7 +19,6 @@
int_u8 \
interop \
label \
- quat \
rgb8 \
scalar \
set \
@@ -49,7 +48,6 @@
int_s16_SOURCES = int_s16.cc
int_u8_SOURCES = int_u8.cc
label_SOURCES = label.cc
-quat_SOURCES = quat.cc
rgb8_SOURCES = rgb8.cc
scalar_SOURCES = scalar.cc
set_SOURCES = set.cc
Index: tests/win/cuboid3d.cc
--- tests/win/cuboid3d.cc (revision 3113)
+++ tests/win/cuboid3d.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,19 +25,18 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/win/cuboid3d.cc
- *
- * \brief Tests on mln::win::cuboid3d.
- */
+/// \file tests/win/cuboid3d.cc
+///
+/// Tests on mln::win::cuboid3d.
#include <cmath>
+
#include <mln/win/cuboid3d.hh>
#include <mln/win/sym.hh>
-
#include <mln/convert/to_image.hh>
-
#include <mln/debug/println.hh>
+
int main()
{
using namespace mln;
@@ -52,16 +51,15 @@
mln_assertion(cuboid.delta() == 3);
- for (int s = -7; s <= 7; ++s)
- for (int x = -7; x <= 7; ++x)
- for (int y = -7; y <= 7; ++y)
+ for (def::coord s = -7; s <= 7; ++s)
+ for (def::coord x = -7; x <= 7; ++x)
+ for (def::coord y = -7; y <= 7; ++y)
{
- mln_assertion(((abs(s) <= 3 && abs(x) <= 1 && abs(y) <=
2)) ||
+ mln_assertion((std::abs(s) <= 3 && std::abs(x) <= 1 &&
std::abs(y) <= 2) ||
!cuboid.has(dpoint3d(s, x, y)));
- mln_assertion((abs(s) <= 3 && abs(x) <= 1 && abs(y) <= 2)
==
+ mln_assertion((std::abs(s) <= 3 && std::abs(x) <= 1 &&
std::abs(y) <= 2) ==
(cuboid.has(dpoint3d(s, x, y))));
}
debug::println(convert::to_image(cuboid));
}
-
Index: tests/win/vline2d.cc
--- tests/win/vline2d.cc (revision 3113)
+++ tests/win/vline2d.cc (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,19 +26,17 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/win/vline2d.cc
- *
- * \brief Tests on mln::win::vline2d.
- */
+/// \file tests/win/vline2d.cc
+///
+/// Tests on mln::win::vline2d.
#include <cmath>
#include <mln/win/vline2d.hh>
-
#include <mln/convert/to_image.hh>
-
#include <mln/debug/println.hh>
+
int main()
{
using namespace mln;
@@ -47,15 +46,14 @@
mln_assertion(vline.delta() == 2);
- for (int x = -5; x <= 5; ++x)
- for (int y = -5; y <= 5; ++y)
+ for (def::coord x = -5; x <= 5; ++x)
+ for (def::coord y = -5; y <= 5; ++y)
{
- mln_assertion(((abs(x) <= 2) && (abs(y) <= 2)) ||
+ mln_assertion((std::abs(x) <= 2 && std::abs(y) <= 2) ||
!vline.has(dpoint2d(x, y)));
- mln_assertion((0 == y) == (vline.has(dpoint2d(x, y))) ||
- abs(x) > 2);
+ mln_assertion((0 == y) == vline.has(dpoint2d(x, y)) ||
+ std::abs(x) > 2);
}
debug::println(convert::to_image(vline));
}
-
Index: tests/win/cube3d.cc
--- tests/win/cube3d.cc (revision 3113)
+++ tests/win/cube3d.cc (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,19 +26,17 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/win/cube3d.cc
- *
- * \brief Tests on mln::win::cube3d.
- */
+/// \file tests/win/cube3d.cc
+///
+/// Tests on mln::win::cube3d.
#include <cmath>
#include <mln/win/cube3d.hh>
-
#include <mln/convert/to_image.hh>
-
#include <mln/debug/println.hh>
+
int main()
{
using namespace mln;
@@ -47,16 +46,15 @@
mln_assertion(cube.delta() == 2);
- for (int s = -5; s <= 5; ++s)
- for (int x = -5; x <= 5; ++x)
- for (int y = -5; y <= 5; ++y)
+ for (def::coord s = -5; s <= 5; ++s)
+ for (def::coord x = -5; x <= 5; ++x)
+ for (def::coord y = -5; y <= 5; ++y)
{
- mln_assertion(((abs(x) <= 2) && (abs(y) <= 2) && (abs(s) <= 2))
||
+ mln_assertion((std::abs(x) <= 2 && std::abs(y) <= 2 && std::abs(s)
<= 2) ||
!cube.has(dpoint3d(s, y, x)));
- mln_assertion((abs(x) <= 2 && abs(y) <= 2 && abs(s) <= 2) ==
+ mln_assertion((std::abs(x) <= 2 && std::abs(y) <= 2 && std::abs(s)
<= 2) ==
(cube.has(dpoint3d(s, y, x))));
}
debug::println(convert::to_image(cube));
}
-
Index: tests/win/backdiag2d.cc
--- tests/win/backdiag2d.cc (revision 3113)
+++ tests/win/backdiag2d.cc (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,19 +26,17 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/win/backdiag2d.cc
- *
- * \brief Tests on mln::win::backdiag2d.
- */
+/// \file tests/win/backdiag2d.cc
+///
+/// Tests on mln::win::backdiag2d.
#include <cmath>
#include <mln/win/backdiag2d.hh>
-
#include <mln/convert/to_image.hh>
-
#include <mln/debug/println.hh>
+
int main()
{
using namespace mln;
@@ -47,16 +46,15 @@
mln_assertion(diag.delta() == 4);
- for (int x = -5; x <= 5; ++x)
- for (int y = -5; y <= 5; ++y)
+ for (def::coord x = -5; x <= 5; ++x)
+ for (def::coord y = -5; y <= 5; ++y)
{
- mln_assertion(((abs(x) <= 4) && (abs(y) <= 4)) ||
+ mln_assertion((std::abs(x) <= 4 && std::abs(y) <= 4) ||
!diag.has(dpoint2d(y, x)));
- mln_assertion((x == y) == (diag.has(dpoint2d(x, y))) ||
- abs(x) > 4 ||
- abs(y) > 4);
+ mln_assertion((x == y) == diag.has(dpoint2d(x, y)) ||
+ std::abs(x) > 4 ||
+ std::abs(y) > 4);
}
debug::println(convert::to_image(diag));
}
-
Index: tests/win/disk2d.cc
--- tests/win/disk2d.cc (revision 3113)
+++ tests/win/disk2d.cc (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,19 +26,17 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/win/disk2d.cc
- *
- * \brief Tests on mln::win::disk2d.
- */
+/// \file tests/win/disk2d.cc
+///
+/// Tests on mln::win::disk2d.
#include <cmath>
#include <mln/win/disk2d.hh>
-
#include <mln/convert/to_image.hh>
-
#include <mln/debug/println.hh>
+
int main()
{
using namespace mln;
@@ -48,17 +47,15 @@
mln_assertion(disk.delta() == 27);
- for (int x = -30; x <= 30; ++x)
- for (int y = -30; y <= 30; ++y)
+ for (def::coord x = -30; x <= 30; ++x)
+ for (def::coord y = -30; y <= 30; ++y)
{
- mln_assertion(((abs(x) <= 27) && (abs(y) <= 27)) ||
+ mln_assertion((std::abs(x) <= 27 && std::abs(y) <= 27) ||
!disk.has(dpoint2d(y, x)));
- mln_assertion(((x * x + y * y) <= static_cast<int>(l2)) ==
- (disk.has(dpoint2d(x, y))) ||
- abs(x) > 27 ||
- abs(y) > 27);
+ mln_assertion(((x * x + y * y) <= static_cast<int>(l2)) ==
disk.has(dpoint2d(x, y)) ||
+ std::abs(x) > 27 ||
+ std::abs(y) > 27);
}
debug::println(convert::to_image(disk));
}
-
Index: tests/win/octagon2d.cc
--- tests/win/octagon2d.cc (revision 3113)
+++ tests/win/octagon2d.cc (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,19 +26,17 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/win/octagon2d.cc
- *
- * \brief Tests on mln::win::octagon2d.
- */
+/// \file tests/win/octagon2d.cc
+///
+/// Tests on mln::win::octagon2d.
#include <cmath>
#include <mln/win/octagon2d.hh>
-
#include <mln/convert/to_image.hh>
-
#include <mln/debug/println.hh>
+
int main()
{
using namespace mln;
@@ -47,17 +46,16 @@
mln_assertion(oct.delta() == 6);
- for (int x = -16; x <= 16; ++x)
- for (int y = -16; y <= 16; ++y)
+ for (def::coord x = -16; x <= 16; ++x)
+ for (def::coord y = -16; y <= 16; ++y)
{
- mln_assertion(((abs(x) <= 6) && (abs(y) <= 6)) ||
+ mln_assertion((std::abs(x) <= 6 && std::abs(y) <= 6) ||
!oct.has(dpoint2d(x, y)));
- mln_assertion((abs(x) + abs(y) <= static_cast<int>(l / 2 + l / 6)) ==
- (oct.has(dpoint2d(x, y))) ||
- abs(x) > 2 ||
- abs(y) > 2);
+ mln_assertion((std::abs(x) + std::abs(y) <= static_cast<int>(l / 2 + l /
6)) ==
+ oct.has(dpoint2d(x, y)) ||
+ std::abs(x) > 2 ||
+ std::abs(y) > 2);
}
debug::println(convert::to_image(oct));
}
-
Index: tests/win/hline2d.cc
--- tests/win/hline2d.cc (revision 3113)
+++ tests/win/hline2d.cc (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,19 +26,17 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/win/hline2d.cc
- *
- * \brief Tests on mln::win::hline2d.
- */
+/// \file tests/win/hline2d.cc
+///
+/// Tests on mln::win::hline2d.
#include <cmath>
#include <mln/win/hline2d.hh>
-
#include <mln/convert/to_image.hh>
-
#include <mln/debug/println.hh>
+
int main()
{
using namespace mln;
@@ -47,15 +46,14 @@
mln_assertion(hline.delta() == 2);
- for (int x = -5; x <= 5; ++x)
- for (int y = -5; y <= 5; ++y)
+ for (def::coord x = -5; x <= 5; ++x)
+ for (def::coord y = -5; y <= 5; ++y)
{
- mln_assertion(((abs(x) <= 2) && (abs(y) <= 2)) ||
+ mln_assertion((std::abs(x) <= 2 && std::abs(y) <= 2) ||
!hline.has(dpoint2d(x, y)));
- mln_assertion((0 == x) == (hline.has(dpoint2d(x, y))) ||
- abs(y) > 2);
+ mln_assertion((x == 0) == (hline.has(dpoint2d(x, y))) ||
+ std::abs(y) > 2);
}
debug::println(convert::to_image(hline));
}
-
Index: tests/win/segment1d.cc
--- tests/win/segment1d.cc (revision 3113)
+++ tests/win/segment1d.cc (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,19 +26,17 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/win/segment1d.cc
- *
- * \brief Tests on mln::win::segment1d.
- */
+/// \file tests/win/segment1d.cc
+///
+/// Tests on mln::win::segment1d.
#include <cmath>
#include <mln/win/segment1d.hh>
-
#include <mln/convert/to_image.hh>
-
#include <mln/debug/println.hh>
+
int main()
{
using namespace mln;
@@ -47,12 +46,11 @@
mln_assertion(segm.delta() == 2);
- for (int x = -5; x <= 5; ++x)
+ for (def::coord x = -5; x <= 5; ++x)
{
- mln_assertion((abs(x) <= 2) || !segm.has(dpoint1d(x)));
- mln_assertion((abs(x) <= 2) == (segm.has(dpoint1d(x))));
+ mln_assertion(std::abs(x) <= 2 || ! segm.has(dpoint1d(x)));
+ mln_assertion((std::abs(x) <= 2) == segm.has(dpoint1d(x)));
}
debug::println(convert::to_image(segm));
}
-
Index: tests/win/rectangle2d.cc
--- tests/win/rectangle2d.cc (revision 3113)
+++ tests/win/rectangle2d.cc (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,17 +26,15 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/win/rectangle2d.cc
- *
- * \brief Tests on mln::win::rectangle2d.
- */
+/// \file tests/win/rectangle2d.cc
+///
+/// Tests on mln::win::rectangle2d.
#include <cmath>
+
#include <mln/win/rectangle2d.hh>
#include <mln/win/sym.hh>
-
#include <mln/convert/to_image.hh>
-
#include <mln/debug/println.hh>
@@ -53,12 +52,11 @@
mln_assertion(rec.delta() == 2);
- for (int x = -5; x <= 5; ++x)
- for (int y = -5; y <= 5; ++y)
+ for (def::coord x = -5; x <= 5; ++x)
+ for (def::coord y = -5; y <= 5; ++y)
{
- mln_assertion((abs(x) <= 1 && abs(y) <= 2) == (rec.has(dpoint2d(x,
y))));
+ mln_assertion((std::abs(x) <= 1 && std::abs(y) <= 2) ==
rec.has(dpoint2d(x, y)));
}
debug::println(convert::to_image(rec));
}
-
Index: tests/algebra/Makefile.am
--- tests/algebra/Makefile.am (revision 3113)
+++ tests/algebra/Makefile.am (working copy)
@@ -6,12 +6,14 @@
h_vec \
mat \
mat2 \
+ quat \
vec \
vec2
h_vec_SOURCES = h_vec.cc
mat_SOURCES = mat.cc
mat2_SOURCES = mat2.cc
+quat_SOURCES = quat.cc
vec_SOURCES = vec.cc
vec2_SOURCES = vec2.cc
Index: tests/algebra/quat.cc
--- tests/algebra/quat.cc (revision 3092)
+++ tests/algebra/quat.cc (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,10 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/value/quat.cc
- *
- * \brief Tests on mln::value::quat.
- */
+/// \file tests/algebra/quat.cc
+///
+/// Tests on mln::algebra::quat.
#include <iostream>
@@ -43,7 +43,7 @@
using namespace mln;
algebra::quat q1(3.f, 4.f, 1.6f, 0.5f);
- algebra::quat q2(1.2, make::vec(3, 6, 4));
+ algebra::quat q2(1.2f, make::vec(3, 6, 4));
algebra::quat q3(make::vec(1.3, 3., -6., 4.));
std::cout << q1 << std::endl;
@@ -52,7 +52,7 @@
std::cout << q1.s() << std::endl;
- q1.s() = 2.6;
+ q1.s() = 2.6f;
std::cout << q1 << std::endl;
std::cout << q1.v() << std::endl;
Property changes on: tests/algebra/quat.cc
___________________________________________________________________
Added: svn:mergeinfo