From dc0d217ec1a78c66efc2bf3d867a30a6d1066886 Mon Sep 17 00:00:00 2001 From: Josh Klontz Date: Tue, 31 Aug 2021 18:15:07 -0600 Subject: [PATCH] remove best --- openbr/plugins/output/best.cpp | 74 -------------------------------------------------------------------------- 1 file changed, 0 insertions(+), 74 deletions(-) delete mode 100644 openbr/plugins/output/best.cpp diff --git a/openbr/plugins/output/best.cpp b/openbr/plugins/output/best.cpp deleted file mode 100644 index cd89ab0..0000000 --- a/openbr/plugins/output/best.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright 2012 The MITRE Corporation * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -#include -#include - -namespace br -{ - -/*! - * \ingroup outputs - * \brief The highest scoring matches. - * \author Josh Klontz \cite jklontz - */ -class bestOutput : public Output -{ - Q_OBJECT - - typedef QPair< float, QPair > BestMatch; - QList bestMatches; - - ~bestOutput() - { - if (file.isNull() || bestMatches.isEmpty()) return; - qSort(bestMatches); - QStringList lines; lines.reserve(bestMatches.size()+1); - lines.append("Value,Target,Query"); - for (int i=bestMatches.size()-1; i>=0; i--) - lines.append(QString::number(bestMatches[i].first) + "," + targetFiles[bestMatches[i].second.second] + "," + queryFiles[bestMatches[i].second.first]); - QtUtils::writeFile(file, lines); - } - - void initialize(const FileList &targetFiles, const FileList &queryFiles) - { - Output::initialize(targetFiles, queryFiles); - bestMatches.reserve(queryFiles.size()); - for (int i=0; i::max(), QPair(-1, -1))); - } - - void set(float value, int i, int j) - { - static QMutex lock; - - // Return early for self similar matrices - if (selfSimilar && (i == j)) return; - - if (value > bestMatches[i].first) { - lock.lock(); - if (value > bestMatches[i].first) - bestMatches[i] = BestMatch(value, QPair(i,j)); - lock.unlock(); - } - } -}; - -BR_REGISTER(Output, bestOutput) - -} // namespace br - -#include "output/best.moc" -- libgit2 0.21.4