Skip to content

Commit

Permalink
Fix wrong assertion error in 2D fixed kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
meshtag committed Aug 20, 2021
1 parent 723499d commit c16c5b7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
7 changes: 2 additions & 5 deletions include/boost/gil/extension/numeric/kernel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,7 @@ class kernel_2d_adaptor : public Core
explicit kernel_2d_adaptor(std::size_t center_y, std::size_t center_x)
: center_(center_x, center_y)
{
Core c;
BOOST_ASSERT(center_.y < c.size() && center_.x < c.size());
// std::cout << this->size() << " " << center_.y << " " << center_.x << "\n";
// BOOST_ASSERT(center_.y < this->size() && center_.x < this->size());
BOOST_ASSERT(center_.y < this->size() && center_.x < this->size());
}

kernel_2d_adaptor(std::size_t size, std::size_t center_y, std::size_t center_x)
Expand Down Expand Up @@ -246,7 +243,7 @@ class kernel_2d_adaptor : public Core

std::size_t size() const
{
return square_size;
return square_size ? square_size : std::sqrt((Core ()).size());
}

typename Core::value_type at(std::size_t x, std::size_t y) const
Expand Down
1 change: 0 additions & 1 deletion test/extension/numeric/kernel_fixed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//
#define BOOST_DISABLE_ASSERTS 1 // kernel_1d_adaptor assertions are too strict
#include <boost/gil.hpp>
#include <boost/gil/extension/numeric/kernel.hpp>

Expand Down

0 comments on commit c16c5b7

Please sign in to comment.