30 lines
1.0 KiB
C++
30 lines
1.0 KiB
C++
#ifndef _DEMO_CHI2_H
|
|
#define _DEMO_CHI2_H
|
|
|
|
#include "palisade.h"
|
|
#include <boost/mpi/communicator.hpp>
|
|
|
|
using namespace lbcrypto;
|
|
using namespace std;
|
|
namespace mpi = boost::mpi;
|
|
|
|
const double EPSILON = 1.0E-08;
|
|
|
|
void RunChi2(const string &SNPDir,
|
|
const string &SNPFileName, const string &pValue, const string &Runtime, const string &SampleSize, const string &SNPs,
|
|
size_t file_start,
|
|
double &keyGenTime, double &encryptionTime, double &computationTime, double &decryptionTime, double &endToEndTime,
|
|
CryptoContext<DCRTPoly> &cc, auto &keyPair, int batch_num, mpi::communicator &world);
|
|
|
|
|
|
Ciphertext<DCRTPoly> BinaryTreeAdd(std::vector<Ciphertext<DCRTPoly>> &vector);
|
|
|
|
void ReadSNPFile(vector<string>& headers, std::vector<std::vector<double>> & dataColumns, std::vector<double> &y, string dataFileName, size_t N, size_t M, size_t from);
|
|
|
|
double normalCFD(double value) { return 0.5 * erfc(-value * M_SQRT1_2); }
|
|
|
|
double sf(double value) { return 1 - normalCFD(value); }
|
|
|
|
double IncompleteGamma(double val, double p);
|
|
|
|
#endif //demo-chi2.h
|