Commit 9c11b307 authored by Thierry Geraud's avatar Thierry Geraud
Browse files

Fix compilation errors.

	* tests/run_pset.cc: Fix and clean.
	* tests/README: Augment.
	* tests/erosion.cc: Clean.
	* mln/core/internal/run_pset.hh: Fix.
	* mln/core/concept/function.hh: Add explicit calls to cpy
	ctors.


git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@1057 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent 66f4ade1
2007-08-28 Thierry Geraud <thierry.geraud@lrde.epita.fr>
Fix compilation errors.
* tests/run_pset.cc: Fix and clean.
* tests/README: Augment.
* tests/erosion.cc: Clean.
* mln/core/internal/run_pset.hh: Fix.
* mln/core/concept/function.hh: Add explicit calls to cpy
ctors.
2007-08-27 Thierry Geraud <thierry.geraud@lrde.epita.fr>
Augment morpho and add saturation for int-like types.
......
......@@ -148,7 +148,8 @@ namespace mln
}
template <typename E>
Function<E>::Function(const Function<E>&)
Function<E>::Function(const Function<E>& rhs)
: Object<E>(rhs)
{
}
......@@ -158,7 +159,8 @@ namespace mln
}
template <typename E>
Function_v2v<E>::Function_v2v(const Function_v2v<E>&)
Function_v2v<E>::Function_v2v(const Function_v2v<E>& rhs)
: Function<E>(rhs)
{
}
......@@ -168,7 +170,8 @@ namespace mln
}
template <typename E>
Function_i2v<E>::Function_i2v(const Function_i2v<E>&)
Function_i2v<E>::Function_i2v(const Function_i2v<E>& rhs)
: Function_v2v<E>(rhs)
{
}
......@@ -178,7 +181,8 @@ namespace mln
}
template <typename E>
Function_p2v<E>::Function_p2v(const Function_p2v<E>&)
Function_p2v<E>::Function_p2v(const Function_p2v<E>& rhs)
: Function_v2v<E>(rhs)
{
}
......@@ -188,7 +192,8 @@ namespace mln
}
template <typename E>
Function_v2b<E>::Function_v2b(const Function_v2b<E>&)
Function_v2b<E>::Function_v2b(const Function_v2b<E>& rhs)
: Function_v2v<E>(rhs)
{
}
......@@ -198,7 +203,10 @@ namespace mln
}
template <typename E>
Function_p2b<E>::Function_p2b(const Function_p2b<E>&)
Function_p2b<E>::Function_p2b(const Function_p2b<E>& rhs)
: Function_v2v<E>(rhs),
Function_p2v<E>(rhs),
Function_v2b<E>(rhs)
{
}
......@@ -208,7 +216,8 @@ namespace mln
}
template <typename E>
Function_p2p<E>::Function_p2p(const Function_p2p<E>&)
Function_p2p<E>::Function_p2p(const Function_p2p<E>& rhs)
: Function_p2v<E>(rhs)
{
}
......
......@@ -217,7 +217,7 @@ namespace mln
}
template <typename P, typename E>
run_piter_<P, E>::operator typename run_piter_<P, E>::psite () const
run_piter_<P, E>::operator internal::run_psite<P> () const
{
return site_;
}
......
......@@ -4,14 +4,28 @@
* compilation
** g++-4.1
*** options
-ansi -pedantic -W -Wall -Wextra -Wconversion
*** sample
g++-4.1 -ansi -pedantic -W -Wall -Wextra -Wconversion -I.. sample.cc
** g++-2.95
*** options
-ansi -pedantic -W -Wall -Wconversion -ftemplate-depth-51
*** sample
g++-2.95 -ansi -pedantic -W -Wall -Wconversion -ftemplate-depth-51 -I.. sample.cc
** icpc-9.1
*** options
-w1 -Wcheck -Werror -ansi
*** sample
icpc-9.1 -w1 -Wcheck -Werror -ansi -I.. sample.cc
* bench
** median
naive: 18s
median: 1s
approx: 0.05s
......@@ -54,12 +54,13 @@ int main()
win::rectangle2d rec(21, 21);
border::thickness = 66;
image2d_b<int_u8>
lena = io::load_pgm("../img/lena.pgm"),
out(lena.domain());
image2d_b<int_u8> lena = io::load_pgm("../img/lena.pgm");
{
image2d_b<int_u8> out(lena.domain());
morpho::erosion(lena, rec, out);
io::save_pgm(out, "out.pgm");
}
{
image2d_b<bool> bin(lena.domain()), out(lena.domain());
......
#include <mln/core/internal/run_pset.hh>
// Copyright (C) 2007 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
// of the GNU General Public License version 2 as published by the
// Free Software Foundation.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this library; see the file COPYING. If not, write to
// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
// Boston, MA 02111-1307, USA.
//
// As a special exception, you may use this file as part of a free
// software library without restriction. Specifically, if other files
// instantiate templates or use macros or inline functions from this
// file, or you compile this file and link it with other files to
// produce an executable, this file does not by itself cause the
// resulting executable to be covered by the GNU General Public
// License. This exception does not however invalidate any other
// reasons why the executable file might be covered by the GNU General
// Public License.
/*! \file tests/run_pset.cc
*
* \brief Test on mln::internal::run_pset_ and related tools.
*/
#include <mln/core/image2d_b.hh>
#include <iostream>
#include <mln/core/internal/run_pset.hh>
using namespace mln;
template <typename Pset>
void
parc(const Pset& pset)
void parc(const Pset& pset)
{
typename Pset::fwd_piter it_(pset);
mln_fwd_piter(Pset) it_(pset);
for_all(it_)
{
std::cout << (typename Pset::point) it_ << std::endl;
}
typename Pset::bkd_piter rit_(pset);
std::cout << it_ << std::endl;
mln_bkd_piter(Pset) rit_(pset);
for_all(rit_)
{
std::cout << (typename Pset::point) rit_ << std::endl;
}
std::cout << rit_ << std::endl;
}
int
main()
int main()
{
using namespace mln;
point2d p, q, r;
p = make::point2d(2, 4);
q = make::point2d(18, 42);
r = make::point2d(50, 76);
// Psite declaration
run_psite<point2d> site(p, 5, 0);
run_psite<point2d> site2(r, 40, 0);
internal::run_psite<point2d> site(p, 5, 0);
internal::run_psite<point2d> site2(r, 40, 0);
// Pset test
internal::run_pset_<point2d> ps;
ps.insert(p, 7);
assert(ps.npoints() == 7);
mln_assertion(ps.npoints() == 7);
ps.insert(q, 42);
assert(ps.npoints() == 49);
mln_assertion(ps.npoints() == 49);
assert(ps.has(site));
assert(!ps.has(site2));
mln_assertion(ps.has(site));
mln_assertion(!ps.has(site2));
ps.insert(r, 14);
assert(!ps.has(site2));
// FIXME bbox test
mln_assertion(!ps.has(site2));
parc(ps);
return 0;
// parc(ps);
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment