1 # include <mln/core/image/image2d.hh>
2 # include <mln/util/timer.hh>
4 # include <mln/core/pixter2d.hh>
5 # include <mln/opt/at.hh>
13 unsigned len = size * size;
14 int* buf =
new int[len];
19 for (
unsigned i = 0; i < len; ++i)
32 int** array =
data.array_;
33 for (
int row = 0; row < size; ++row)
34 for (
int col = 0; col < size; ++col)
47 for (
int row = 0; row < size; ++row)
48 for (
int col = 0; col < size; ++col)
62 int** array =
data.array_;
65 for (row = 0; row < size; ++row)
66 for (col = 0; col < size; ++col)
82 for (row = 0; row < size; ++row)
83 for (col = 0; col < size; ++col)
97 mln_piter_(I) p(ima.domain());
111 mln_piter_(I) p(ima.domain());
112 for (p.start(); p.is_valid(); p.next())
125 mln_pixter_(I) p(ima);
132 void usage(
char* argv[])
134 std::cerr <<
"usage: " << argv[0] <<
" size" << std::endl;
139 int main(
int argc,
char* argv[])
143 size = std::atoi(argv[1]);
145 std::cout <<
"*p++ " << a_la_C() << std::endl;
146 std::cout <<
"for (r,c) " << loops() << std::endl;
147 std::cout <<
"for at(r,c) " << for_at() << std::endl;
148 std::cout <<
"for &(r,c) " << loops_ref() << std::endl;
149 std::cout <<
"hybrid_1 " << hybrid_1() << std::endl;
150 std::cout <<
"for_all(p) " << milena() << std::endl;
151 std::cout <<
"optim " << optim() << std::endl;
152 std::cout <<
"for_all(pix) " << fast() << std::endl;