Skip to content

Commit

Permalink
change matching rate computation method
Browse files Browse the repository at this point in the history
  • Loading branch information
kk-mats committed Jun 4, 2019
1 parent e6b140b commit 4b99401
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion asterism.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpplatest</LanguageStandard>
<IntrinsicFunctions>true</IntrinsicFunctions>
<WholeProgramOptimization>true</WholeProgramOptimization>
<WholeProgramOptimization>false</WholeProgramOptimization>
</ClCompile>
<Link>
<AdditionalDependencies>$(QTDIR)\lib\Qt5Widgets.lib;$(QTDIR)\lib\Qt5Gui.lib;$(QTDIR)\lib\Qt5Core.lib;$(QTDIR)\lib\qtmain.lib;%(AdditionalDependencies)</AdditionalDependencies>
Expand Down
19 changes: 19 additions & 0 deletions core/matching_table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,25 @@ bool matching_table::has_matching_pair(const std::shared_ptr<detection_result> &
return false;
}

bool matching_table::has_matching_pair_restrict(const std::shared_ptr<detection_result> &result, const std::shared_ptr<clone_pair> &p) const noexcept
{
bool search_left;
int matched=1;
for(const auto &u:this->values_)
{
search_left=u.first.right()==result;
if(!search_left && u.first.left()!=result)
{
continue;
}
if(u.second.matched_pair(p, search_left).size()>0)
{
++matched;
}
}
return matched==this->results_.size();
}


uint qHash(const query &key, uint seed) noexcept
{
Expand Down
1 change: 1 addition & 0 deletions core/matching_table.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ class matching_table final
std::vector<response> matched_pair(const query &q) const noexcept;
int count_matching_pair(const std::shared_ptr<detection_result> &result, const std::shared_ptr<clone_pair> &p) const noexcept;
bool has_matching_pair(const std::shared_ptr<detection_result> &result, const std::shared_ptr<clone_pair> &p) const noexcept;
bool has_matching_pair_restrict(const std::shared_ptr<detection_result> &result, const std::shared_ptr<clone_pair> &p) const noexcept;

private:
shared_vector<detection_result> results_;
Expand Down
2 changes: 1 addition & 1 deletion layer/heatmap_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ bool heatmap_layer::mismatch_rate::update(const std::shared_ptr<detection_result
int matched=0;
for(const auto &p:(*primitive->clone_pair_layer())[i])
{
if(matching_table_->has_matching_pair(primitive, p))
if(matching_table_->has_matching_pair_restrict(primitive, p))
{
++matched;
}
Expand Down

0 comments on commit 4b99401

Please sign in to comment.