2003-08-14 00:02:15 +00:00
|
|
|
// The contents of this file are subject to the BOINC Public License
|
|
|
|
// Version 1.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://boinc.berkeley.edu/license_1.0.txt
|
|
|
|
//
|
|
|
|
// Software distributed under the License is distributed on an "AS IS"
|
|
|
|
// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
|
|
// License for the specific language governing rights and limitations
|
|
|
|
// under the License.
|
|
|
|
//
|
|
|
|
// The Original Code is the Berkeley Open Infrastructure for Network Computing.
|
|
|
|
//
|
|
|
|
// The Initial Developer of the Original Code is the SETI@home project.
|
|
|
|
// Portions created by the SETI@home project are Copyright (C) 2002
|
|
|
|
// University of California at Berkeley. All Rights Reserved.
|
|
|
|
//
|
|
|
|
// Contributor(s):
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef H_VALIDATE_UTIL
|
|
|
|
#define H_VALIDATE_UTIL
|
|
|
|
|
|
|
|
#include "boinc_db.h"
|
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
typedef int (*init_result_f)(RESULT const&, void*&);
|
2004-09-09 22:25:10 +00:00
|
|
|
typedef int (*check_pair_with_data_f)(RESULT &, void*, RESULT const&, void*, bool&);
|
2003-08-14 00:02:15 +00:00
|
|
|
typedef int (*cleanup_result_f)(RESULT const&, void*);
|
2004-06-30 18:17:21 +00:00
|
|
|
extern int get_output_file_path(RESULT const& result, std::string& path);
|
|
|
|
extern double median_mean_credit(std::vector<RESULT> const& results);
|
2003-09-20 17:38:13 +00:00
|
|
|
|
2004-07-13 12:23:47 +00:00
|
|
|
int generic_check_set(
|
|
|
|
std::vector<RESULT>& results, int& canonicalid, double& credit,
|
|
|
|
init_result_f init_result_f,
|
|
|
|
check_pair_with_data_f check_pair_with_data_f,
|
|
|
|
cleanup_result_f cleanup_result_f,
|
2004-07-13 13:54:09 +00:00
|
|
|
size_t min_valid);
|
2004-07-13 12:23:47 +00:00
|
|
|
|
2003-08-26 18:33:21 +00:00
|
|
|
int generic_check_set_majority(
|
2004-06-30 18:17:21 +00:00
|
|
|
std::vector<RESULT>& results, int& canonicalid, double& credit,
|
2003-08-26 18:33:21 +00:00
|
|
|
init_result_f init_result_f,
|
|
|
|
check_pair_with_data_f check_pair_with_data_f,
|
2004-07-13 12:23:47 +00:00
|
|
|
cleanup_result_f cleanup_result_f);
|
|
|
|
|
2003-08-26 18:33:21 +00:00
|
|
|
int generic_check_pair(
|
2004-09-09 22:25:10 +00:00
|
|
|
RESULT & r1, RESULT const& r2,
|
2003-08-26 18:33:21 +00:00
|
|
|
init_result_f init_result_f,
|
|
|
|
check_pair_with_data_f check_pair_with_data_f,
|
2004-07-13 12:23:47 +00:00
|
|
|
cleanup_result_f cleanup_result_f);
|
2003-08-14 00:02:15 +00:00
|
|
|
|
|
|
|
#endif
|