blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 2 247 | content_id stringlengths 40 40 | detected_licenses listlengths 0 57 | license_type stringclasses 2 values | repo_name stringlengths 4 111 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 58 | visit_date timestamp[ns]date 2015-07-25 18:16:41 2023-09-06 10:45:08 | revision_date timestamp[ns]date 1970-01-14 14:03:36 2023-09-06 06:22:19 | committer_date timestamp[ns]date 1970-01-14 14:03:36 2023-09-06 06:22:19 | github_id int64 3.89k 689M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 25 values | gha_event_created_at timestamp[ns]date 2012-06-07 00:51:45 2023-09-14 21:58:52 ⌀ | gha_created_at timestamp[ns]date 2008-03-27 23:40:48 2023-08-24 19:49:39 ⌀ | gha_language stringclasses 159 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 7 10.5M | extension stringclasses 111 values | filename stringlengths 1 195 | text stringlengths 7 10.5M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7361396b2aabe951609163bc56256da19fc51dac | 189c3d6d3fd536c95d9a14a34c7de66254dde147 | /ActCrit.cpp | c82dc621a0f189a5c9f414439bb8c46c7cfb845a | [] | no_license | andreseqp/Clean.ActCrit | d1f09407cb01d2692bf38180d9fb180ffcc70b52 | 03f1687d6d0ed02f58fdf2616eb0e677d87ba7b2 | refs/heads/master | 2022-06-16T15:59:55.702956 | 2022-03-10T16:38:48 | 2022-03-10T16:38:48 | 128,222,337 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 24,536 | cpp | ActCrit.cpp | // ActCrit.cpp : Defines the entry point for the console application.
//
/*=============================================================================
ActCrit.cpp
===============================================================================
This is the main file of the project exploring a simple learning model in the
context of the cleaner wrasse mutualism.
The model uses the actor-critic methods from reinforcement learning,
to teach an agent to solve the market expertiment that cleaners face in
experimental trials. In the market experiment individuals are offered two
options of clients to clean. This options can be a visitor, a resident, or
the absence of clients. The difference between the two types of
clients is that visitors leave the cleaning station when they are not served,
while residents wait; thus, are available in the next time step.There are two
types of agent. Fully Aware Agents (FAA) estimate value for
9 state-action pairs. In contrast, partially Aware agents
(PAA) estimate value for 3 potential actions.
Written by:
Andr?s E. Qui?ones
Posdoctoral researcher
Behavioural Ecology Group
Institute of Biology
University of Neuch?tel
Switzerland
Start date:
5 April 2017
=============================================================================*/
#include <stdio.h>
#include <cstdlib>
#include <math.h>
#include <iostream>
#include <fstream>
#include <omp.h>
// #include "tchar.h"
#include "../Cpp/Routines/C++/RandomNumbers/random.h"
//H for house pc, E for laptop, M for office
#include "../Cpp/json.hpp"
// Header for reading and using JSON files see https://github.com/nlohmann/json
#define GET_VARIABLE_NAME(Variable) (#Variable)
using namespace std;
using json = nlohmann::json;
// General parameters
// Classes
enum client { resident, visitor, absence };
// clients can be resident, visitors, or be absent
enum learPar { alphaPar, gammaPar, netaPar , alphathPar};
enum learnScenario {nature, experiment, marketExperiment, ExtendedMarket};
class agent // Learning agent
{
public:
agent(double alphaI, double gammaI, bool netaI,
double alphathI, double initVal);
// constructor providing values for the learning parameters
~agent();
// destructor not really necessary
void update();
// function that updates the value of state-action pairs according to
//current reward and estimates of future values
void act(client newOptions[], int &idNewOptions, double &VisProbLeav,
double &ResProbLeav, double &VisReward, double &ResReward, double &inbr,
double &outbr, double &negativeRew, learnScenario &scenario);
// function where the agent takes the action, gets reward, see new
//state and chooses future action
void printIndData(ofstream &learnSeries, int &seed, double &outbr,
double pV, double pR);
// prints individual data from the learning process
double getLearnPar(learPar parameter);
// function to access the learning parameters
void checkChoice();
// Check that the choice taken is among one of the options,
//otherwise trigger an error
void rebirth(double initVal);
// Function to reset private variables in an individual
void getNewOptions(client newOptions[], int &idNewOptions,
double &VisProbLeav, double &ResProbLeav, double &negativeRew,
double &inbr, double &outbr, learnScenario &scenario);
// Function to get new clients in the station, when in a natural environment
void getExternalOptions(client newOptions[], int &idNewOptions,
double &inbr, double &outbr);
// After unattended clients leave or stay, get new clients
void getExperimentalOptions();
// Get new clients in the experimental setting
void getMarketExperiment();
// Get new clients in the experimental setting of Olle's model
void getExtenededMarket();
// Get new clients in the experimental setting of Noa's experiment
void ObtainReward(double &ResReward, double &VisReward);
// Get reward
double logist();
int mapOptionsDP(client options[], int &choice);
// default function that maps state pairs to indexes in the array
//'values' where values are stored works for DPupdate and for
//state-action pair NOT for action estimation
client cleanOptionsT[2]; // current cleaning options time = t
client cleanOptionsT1[2]; // future cleaning options time = t+1
void choice();
// Function to make a choice
virtual int mapOptions(client options[], int &choice)=0;
// function that maps state action pairs to indexes in the array 'values'
//where values are stored
virtual void updateThet(int curState) = 0;
// function to update the policy parameter Theta
int numEst;
// Number of estimates characterizing bhavioural options 9 for FAA
int countExp;
protected:
double values[6];
// array storing the estimated values of states
double delta;
double piV;
double theta[2]; // policy parameters
int DPid;
int choiceT;// current choice
int choiceT1;// future choice
double alpha;// speed of learning for estimated values
double alphath; // speed of learning for policy parameter
double gamma;// importance of future rewards
bool neta;
// Weight of the negative reward in the total reward obtained by an agent
double currentReward; // reward given by current state action pair
double cumulReward; // Cumulative reward
int age;
double negReward;
};
// Members of agent class
agent::agent(double alphaI = 0.01, double gammaI = 0.5,
bool netaI = 0, double alphathI = 0.01,
double initVal = 0){
// parameterized constructor with defaults
theta[0] = 0, theta[1] = 0;
numEst = 6;
delta = 0;
for (int i = 0; i < numEst; i++) { values[i] = 1+initVal; }
// assigned educated initial values. Reward + guess of
//the expected future reward
values[5] -= 1;
// Value of absence starts with reward of 0
piV = logist();
alpha = alphaI, gamma = gammaI, alphath = alphathI;
neta = netaI;
cleanOptionsT[0] = absence, cleanOptionsT[1] = absence, choiceT = 0;
cleanOptionsT1[0] = absence, cleanOptionsT1[1] = absence, choiceT1 = 0;
currentReward = 0, cumulReward = 0;
age = 0;
countExp = 2;
}
void agent::rebirth(double initVal = 0)
{
age = 0;
cleanOptionsT[0] = absence, cleanOptionsT[1] = absence;
cleanOptionsT1[0] = absence, cleanOptionsT1[1] = absence;
choiceT = 0, choiceT1 = 0;
currentReward = 0;
cumulReward = 0;
for (int i = 0; i < numEst; i++) { values[i] = 1 + initVal; }
values[5] -= 1;
piV = logist();
delta = 0;
theta[0] = 0, theta[1] = 0;
countExp = 2;
}
agent::~agent() {} // Destructor
void agent::checkChoice()
{
if (choiceT > 1 )
{
error("agent::act", "choice is not among the options");
}
}
double agent::getLearnPar(learPar parameter)
{
switch (parameter)
{
case alphaPar:return(alpha);
break;
case gammaPar:
return(gamma);
break;
case netaPar:return(neta);
break;
case alphathPar:return(alphath);
break;
default:error("agent:getlearnPar",
"asking for a parameter that does not exist");
return 0;
break;
}
}
void agent::ObtainReward(double &ResReward, double &VisReward)
{
if (cleanOptionsT[choiceT] == resident) {
currentReward = ResReward, cumulReward += ResReward;
} // Obtain reward if the choice is a resident
else if (cleanOptionsT[choiceT] == visitor) {
currentReward = VisReward, cumulReward += VisReward;
} // Obtain reward if the choice is a visitor
else { currentReward = 0, cumulReward += 0; }
// No reward if there is no client in the choice
}
void agent::getNewOptions(client newOptions[], int &idNewOptions,
double &VisProbLeav, double &ResProbLeav, double &negativeRew,
double &inbr, double &outbr, learnScenario &scenario)
{
if (choiceT == 0) // Define the behaviour of the unattended client
{
if (cleanOptionsT[1] == resident)
{
if (rnd::uniform() > ResProbLeav) {
cleanOptionsT1[0] = cleanOptionsT[1], negReward = 0;
}
// if the unttended client is a resident, it leaves with probability ResPropLeave
else { negReward = negativeRew; }
}
else if (cleanOptionsT[1] == visitor)
{
if (rnd::uniform() > VisProbLeav) {
cleanOptionsT1[0] = cleanOptionsT[1], negReward = 0;
}
// if the unttended client is a visitor, it leaves with probability VisPropLeave
else { negReward = negativeRew; }
}
else { negReward = 0; }
}
else
{
if (cleanOptionsT[0] == resident)
{
if (rnd::uniform() > ResProbLeav) {
cleanOptionsT1[0] = cleanOptionsT[0], negReward = 0;
}
// if the unattended client is a resident, it leaves with probability ResPropLeave
else { negReward = negativeRew; }
}
else if (cleanOptionsT[0] == visitor)
{
if (rnd::uniform() > VisProbLeav) {
cleanOptionsT1[0] = cleanOptionsT[0], negReward = 0; }
// if the unattended client is a visitor, it leaves with probability VisPropLeave
else { negReward = negativeRew; }
}
else { negReward = 0; }
}
switch (scenario) {
case nature: getExternalOptions(newOptions, idNewOptions, inbr, outbr);
break;
case experiment: getExperimentalOptions();
break;
case marketExperiment: getMarketExperiment();
break;
case ExtendedMarket: getExtenededMarket();
break;
default:cout << "unkown scenario!!" << endl;
error("agent:getNewOptions",
"unkown scenario");
break;
}
}
void agent::getExternalOptions(client newOptions[], int &idNewOptions,
double &inbr, double &outbr)
{
if (cleanOptionsT1[0] == absence){
// If none of the clients stayed from the previous interaction
cleanOptionsT1[0] = newOptions[idNewOptions], ++idNewOptions;
if (cleanOptionsT1[0] == absence){
// If the first draw does not yield a client
cleanOptionsT1[1] = newOptions[idNewOptions], ++idNewOptions;
return;
}
}
if (cleanOptionsT1[0] != absence){
// Fill the second option depending on the first option
double probs[3] = { (1 - inbr)*(1 - outbr) + inbr*outbr , 0, 0 };
// Define probabilities depending on parameters
probs[1] = probs[0] + inbr*(1 - outbr);
// First prob is of a random option
probs[2] = probs[1] + outbr*(1 - inbr);
// Second and third homophily, and heterophily respectively
if (probs[2] != 1) error("agent:getExternalOptions",
"probability does not sum up to 1");
double rand = rnd::uniform();
if (probs[0] > rand) {
cleanOptionsT1[1] = newOptions[idNewOptions], ++idNewOptions;
} // Random
else if (probs[1] > rand) cleanOptionsT1[1] = cleanOptionsT1[0];
// homophily
else // heterophily
{
if (cleanOptionsT1[0] == resident) { cleanOptionsT1[1] = visitor; }
else { cleanOptionsT1[1] = resident; }
}
}
}
void agent::getExperimentalOptions() {
// Get new options in an experimental setting
if (cleanOptionsT[0] == resident && cleanOptionsT[1] == visitor) {
return;
} // Every other option is a Resident-Visitor
else {
cleanOptionsT1[0] = resident;
cleanOptionsT1[1] = visitor;
return;
}
}
void agent::getMarketExperiment() {
// Get new options in an experimental setting of Olle's models
if (countExp==0){
//(cleanOptionsT[0] == resident && cleanOptionsT[1] == visitor) {
++countExp;
return;
} // Every other option is a Resident-Visitor
else if (countExp==1){
/*((cleanOptionsT[0] == resident || cleanOptionsT[0] == visitor)
&& cleanOptionsT[1] == absence) {*/
cleanOptionsT1[0] = absence;
cleanOptionsT1[1] = absence;
++countExp;
return;
}
else {
cleanOptionsT1[0] = resident;
cleanOptionsT1[1] = visitor;
countExp = 0;
}
}
void agent::getExtenededMarket() {
// Get new options in the experimental setting of Noa's experiment
if (countExp==0){
//(cleanOptionsT[0] == resident && cleanOptionsT[1] == visitor) {
++countExp;
return;
} // Every other option is a Resident-Visitor
else if (countExp==1){
/*((cleanOptionsT[0] == resident || cleanOptionsT[0] == visitor)
&& cleanOptionsT[1] == absence) {*/
cleanOptionsT1[0] = absence;
cleanOptionsT1[1] = absence;
++countExp;
return;
}
else {
countExp = 0;
double rand = rnd::uniform();
if (rand < 0.5) {
cleanOptionsT1[0] = resident;
cleanOptionsT1[1] = visitor;
}
else if (rand<0.75) {
cleanOptionsT1[0] = resident;
cleanOptionsT1[1] = resident;
}
else {
cleanOptionsT1[0] = visitor;
cleanOptionsT1[1] = visitor;
}
}
}
void agent::act(client newOptions[], int &idNewOptions, double &VisProbLeav,
double &ResProbLeav, double &VisReward, double &ResReward, double &inbr,
double &outbr, double &negativeRew, learnScenario &scenario){
// taking action, obatining reward, seeing new state, choosing future action
++age;
// new time step
cleanOptionsT[0] = cleanOptionsT1[0], cleanOptionsT[1] = cleanOptionsT1[1];
// Future state becomes current state
choiceT = choiceT1;
// Future action becomes current action
checkChoice();
// Check that the choice is among the options
cleanOptionsT1[0] = absence, cleanOptionsT1[1] = absence;
// Future state is unknown
choiceT1 = 2;
ObtainReward(VisReward,ResReward);
getNewOptions(newOptions, idNewOptions, VisProbLeav, ResProbLeav,
negativeRew, inbr, outbr, scenario);
choice();
}
void agent::update(){
// change estimated value according to TD error
// change policy parameter according to TD error
int currState = mapOptions(cleanOptionsT,choiceT);
int nextState = mapOptions(cleanOptionsT1, choiceT);
delta = currentReward +
negReward*neta + gamma*values[nextState] - values[currState];
// construct the TD error
values[currState] += alpha*delta;
// update value
updateThet(currState);
}
void agent::printIndData(ofstream &learnSeries, int &seed, double &outbr,
double pV, double pR)
{
learnSeries << seed << '\t' << age << '\t';
//cout << seed << '\t' << age << '\t';
learnSeries << alpha << '\t' << gamma << '\t';
learnSeries << neta << '\t' << alphath << '\t' << pV << '\t';
learnSeries << pR << '\t' << theta[0] << '\t';
learnSeries << theta[1] << '\t' << outbr << '\t';
learnSeries << cleanOptionsT[0] << '\t' << cleanOptionsT[1] << '\t';
learnSeries << cleanOptionsT[choiceT] << '\t';
//cout << cleanOptionsT[0] << '\t' << cleanOptionsT[1] << '\t' << choiceT << '\t';
learnSeries << currentReward << '\t' << cumulReward << '\t' << negReward << '\t';
//cout << currentReward << '\t' << cumulReward << '\t';
for (int j = 0; j < numEst; j++)
{
learnSeries << values[j] << '\t';
//cout << values[j] << '\t';
}
learnSeries << endl;
//cout << endl;
}
double agent::logist() { return (1 / (1 + exp(-(theta[0]-theta[1]))));}
int agent::mapOptionsDP(client options[], int &choice){
int state;
if (options[0] == absence || options[1] == absence) {
// One of the options is empty
if (options[0] == resident || options[1] == resident){
// the other one is a resident
state = 2; // R0
}
else if (options[0] == visitor || options[1] == visitor){
// the other one is a visitor
state = 1; // V0
}
else { state = 5; } // 00
}
else if (options[0] == resident || options[1] == resident){
// Both options have clients and one of them is a resident
if (options[0] == visitor || options[1] == visitor){
// the other one is a visitor
state = 0; // RV
}
else { state = 3; } // RR
}
else { state = 4; } // VV
return state;
}
void agent::choice() {
if (cleanOptionsT1[0] == absence || cleanOptionsT1[1] == absence) {
// if there is an absence choose the client
bool presence = cleanOptionsT1[0] == absence;
choiceT1 = presence;
}
else if (cleanOptionsT1[0] != cleanOptionsT1[1]) {
// if clients are different use policy (logist)
bool visit = rnd::bernoulli(piV);
if (cleanOptionsT1[1] == visitor) {
choiceT1 = visit;
} else {
choiceT1 = !visit;
}
}
else {
// if the clients are the same - choose randomly
choiceT1 = rnd::bernoulli();
}
}
class FAATyp1 :public agent{ // Fully Aware Agent (FAA)
public:
FAATyp1(double alphaI, double gammaI, double netaI,
double alphaThI, double initVal):agent(alphaI, gammaI,
netaI, alphaThI, initVal){
}
virtual int mapOptions(client options[], int &choice){
return(mapOptionsDP(options, choice));
}
virtual void updateThet(int curState) {
if (curState == 0) {
if (cleanOptionsT[choiceT] == visitor) {
theta[0] += alphath*delta*(1 - piV);
theta[1] -= alphath*delta*(1 - piV);
} else {
theta[0] -= alphath*delta*piV;
theta[1] += alphath*delta*piV;
}
piV = logist();
}
}
};
class PAATyp1 :public agent{ // Partially Aware Agent (PAA)
public:
PAATyp1(double alphaI, double gammaI, double netaI,
double alphaThI, double initVal, double alphaThNchI):agent(alphaI, gammaI,
netaI, alphaThI,initVal){
alphaThNch = alphaThNchI;
numEst = 3;
values[3] -= 1;
}
void rebirth(int initVal=1) {
rebirth();
values[3] -= 1;
}
int mapOptions(client options[], int &choice){
if (options[choice] == resident) { return (0); }
else if (options[choice] == visitor) { return(1); }
else { return(2); }
return(options[choice]);
}
virtual void updateThet(int curStatAct) {
if (curStatAct < 2) {
//int notchoice = (choiceT == 0);
if (curStatAct == 1) {
if (cleanOptionsT[0] == cleanOptionsT[1]) {
theta[0] += alphaThNch*alphath*delta*(1 - piV);
}
else {
theta[0] += alphath*delta*(1 - piV);
}
}
else {
if (cleanOptionsT[0] == cleanOptionsT[1]) {
theta[1] += alphaThNch*alphath*delta*piV;
}
else {
theta[1] += alphath*delta*piV;
}
}
piV = logist();
}
}
private:
double alphaThNch;
};
// Functions external to the agent
void draw(client trainingSet[], int rounds, double probRes, double probVis){
// In a natural setting draw clients according to their abundance
double cumProbs[3] = { probRes, probRes + probVis, 1 };
double rndNum;
for (int i = 0; i < rounds * 2; i++){
rndNum = rnd::uniform();
if (rndNum < cumProbs[0]) { trainingSet[i] = resident; }
else if (rndNum < cumProbs[1]) { trainingSet[i] = visitor; }
else { trainingSet[i] = absence; }
}
}
string create_filename(std::string filename, agent &individual,
nlohmann::json param, double pV, double pR){
// name the file with the parameter specifications
filename.append("alph");
filename.append(douts(individual.getLearnPar(alphaPar)));
filename.append("_gamma");
filename.append(douts(individual.getLearnPar(gammaPar)));
filename.append("_neta");
filename.append(douts(individual.getLearnPar(netaPar)));
filename.append("_pV");
filename.append(douts(pV));
filename.append("_pR");
filename.append(douts(pR));
filename.append("_alphaTh");
filename.append(douts(individual.getLearnPar(alphathPar)));
filename.append("_seed");
filename.append(itos(param["seed"]));
filename.append(".txt");
return(filename);
}
void initializeIndFile(ofstream &indOutput, agent &learner,
nlohmann::json param, double pV, double pR){
std::string namedir = param["folder"];
std::string namedirDP = param["folder"];
std::string folder;
folder = typeid(learner).name();
folder.erase(0, 6).append("_");
cout << folder << '\t' << learner.getLearnPar(alphaPar) << '\t';
cout << learner.getLearnPar(gammaPar) << '\t';
cout << learner.getLearnPar(netaPar) << '\t';
cout << learner.getLearnPar(alphathPar) << endl;
namedir.append(folder);
string IndFile = create_filename(namedir, learner, param, pV,pR);
indOutput.open(IndFile.c_str());
indOutput << "Training" << '\t' << "Age" << '\t' << "Alpha" << '\t';
indOutput << "Gamma" << '\t' << "Neta" << '\t';
indOutput << "AlphaTh" << '\t' << "pV" << '\t' << "pR" << '\t';
indOutput << "ThetaV" << '\t' << "ThetaR" << '\t';
indOutput << "Outbr" << '\t' << "Client1" << '\t' << "Client2" << '\t';
indOutput << "Choice" << '\t' << "Current.Reward" << '\t';
indOutput << "Cum.Reward" << '\t' << "Neg.Reward" << '\t';
if (learner.numEst > 3) {
indOutput << "RV" << '\t' << "V0" << '\t' << "R0" << '\t';
indOutput << "RR" << '\t' << "VV" << '\t' << "00_" << '\t';
}
else {
indOutput << "Resident" << '\t' << "Visitor" << '\t';
indOutput << "Absence" << '\t';
}
indOutput << endl;
}
int main(int argc, char* argv[]){
mark_time(1);
// Hardwire parameter values:
// Only for debugging
// input parameters provided by a JSON file with the following
// structure:
/*json param;
param["totRounds"] = 20000;
param["ResReward"] = 1;
param["VisReward"] = 1;
param["ResProb"] = 0.3;
param["VisProb"] = 0.3;
param["ResProbLeav"] = 0;
param["VisProbLeav"] = 1;
param["negativeRew"] = -0.5;
param["experiment"] = false;
param["inbr"] = 0;
param["outbr"] = 0;
param["trainingRep"] = 10;
param["alphaT"] = 0.01;
param["printGen"] = 1;
param["seed"] = 1;
param["forRat"] = 0.0;
param["alphThRange"] = { 0 };
param["gammaRange"] = { 0.8 };
param["netaRange"] = { 0 };
param["alphaThRange"] = { 0.01 };
param["folder"] = "S:/quinonesa/Simulations/actCrit/test_/";
param["initVal"] = 1;*/
ifstream input(argv[1]);
if (input.fail()) { cout << "JSON file failed" << endl; }
json param = nlohmann::json::parse(input);
// Pass on parameters from JSON to c++
int const totRounds = param["totRounds"];
double ResReward = param["ResReward"];
double VisReward = param["VisReward"];
double ResProbLeav = param["ResProbLeav"];
double VisProbLeav = param["VisProbLeav"];
double negativeRew = param["negativeRew"];
learnScenario scenario = param["scenario"];
double inbr = param["inbr"];
double outbr = param["outbr"];
int trainingRep = param["trainingRep"];
double alphaT = param["alphaT"];
int numlearn = param["numlearn"];
int printGen = param["printGen"];
double propfullPrint = param["propfullPrint"];
int seed = param["seed"];
const double forRat = param["forRat"];
double alphaThNch = param["alphaThNch"];
rnd::set_seed(seed);
// Set of client queuing for cleaning services
client *clientSet;
clientSet = new client[totRounds * 2];
int idClientSet;
// two types of agents
agent *learners[2];
// Iterate vectors with the different parameter combinations
for (json::iterator itVisProb = param["VisProb"].begin();
itVisProb != param["VisProb"].end(); ++itVisProb) {
for (json::iterator itResProb = param["ResProb"].begin();
itResProb != param["ResProb"].end(); ++itResProb) {
double tmpRes = *itResProb;
double tmpVis = *itVisProb;
if (tmpRes + tmpVis <= 1) {
for (json::iterator italTh = param["alphaThRange"].begin();
italTh != param["alphaThRange"].end(); ++italTh) {
for (json::iterator itn = param["netaRange"].begin();
itn != param["netaRange"].end(); ++itn) {
for (json::iterator itg = param["gammaRange"].begin();
itg != param["gammaRange"].end(); ++itg) {
double tmpGam = *itg;
// set initial value according to the environemntal parameters
double init = tmpGam*(1 - pow(1 - tmpRes - tmpVis, 2)) / (1 - tmpGam);
// Initialize agents
learners[1] = new PAATyp1(alphaT, *itg, *itn,
*italTh, init, alphaThNch);
learners[0] = new FAATyp1(alphaT, *itg, *itn,
*italTh, init);
// output of learning trials
ofstream printTest;
// Loop through types of agents
for (int k = 0; k < numlearn; ++k) {
initializeIndFile(printTest, *learners[k],
param, *itVisProb, *itResProb);
// Loop through the number of replicates
for (int i = 0; i < trainingRep; i++) {
draw(clientSet, totRounds, *itResProb, *itVisProb);
idClientSet = 0;
// Loop through the trial rounds
for (int j = 0; j < totRounds; j++) {
learners[k]->act(clientSet, idClientSet,
VisProbLeav, ResProbLeav, VisReward,
ResReward, inbr, outbr, negativeRew,
scenario);
learners[k]->update();
// print the last tenth of the interations
// or every printGen rounds
if (j > totRounds*propfullPrint) {
learners[k]->printIndData(printTest, i,
outbr, *itVisProb, *itResProb);
}
else if (j%printGen == 0) {
learners[k]->printIndData(printTest, i,
outbr, *itVisProb, *itResProb);
}
}
learners[k]->rebirth(init);
}
printTest.close();
delete learners[k];
}
}
}
}
}
}
}
delete[] clientSet;
mark_time(0);
//wait_for_return();
return 0;
}
|
81a82192c38f14b5b403c4440421e7dc72f4e26b | df91c158ef9a810bd9e64d112df72a23c4d6546e | /poj1017.cpp | 580012c4accbd56014a2139e02271a07b28b7441 | [] | no_license | laughinging/poj | 4d6f6cf458ef8bb51cf8570201203130b319f806 | 5e569cf72d4d5a8cfc215528bbbfab9d6d0e4353 | refs/heads/master | 2021-01-20T00:15:06.909255 | 2018-04-20T13:44:07 | 2018-04-20T13:44:07 | 89,102,991 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 656 | cpp | poj1017.cpp | #include <iostream>
#include <cstdio>
#include <cstring> // memset
#include <algorithm> // sort
using namespace std;
int s[4] = {0, 5, 3, 1}; // number of 2*2 after i 3*3
int main() {
int a, b, c, d, e, f;
while (cin >> a >> b >> c >> d >> e >> f) {
if (a + b + c + d + e + f == 0) break;
int ans = 0;
ans += d + e + f;
if (c > 0)
ans += (c-1)/4 + 1;
int k = 5 * d + s[c%4];
if (k < b)
ans += (b-k-1) / 9 + 1;
k = 36*ans - 36*f - 25*e - 16*d - 9*c - 4*b;
if (k < a)
ans += (a - k - 1) / 36 + 1;
cout << ans << endl;
}
return 0;
}
|
f3809475b554a30bddd870382a42596d316ae026 | 0f6b7bc5f36a4c119a9bdadfb9be26b1e556aeb0 | /epoll.cpp | 4900f323900866b199a1824ce5821fbc2d1fcb5e | [] | no_license | FlySky-z/WXTouringServer | b2878bc7e38415877df6eb61ca170d840f304033 | 25680bb336f405118135ed136c7ebf0667dfded9 | refs/heads/master | 2022-11-07T09:28:15.900360 | 2020-06-26T08:53:24 | 2020-06-26T08:53:24 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,217 | cpp | epoll.cpp | //
// Created by Jason.Z on 2020/6/24.
//
#include "epoll.h"
#include "threadpool.h"
#include "util.h"
#include <sys/epoll.h>
#include <cerrno>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <iostream>
#include <cassert>
#include <sys/socket.h>
#include <netinet/in.h>
#include <cstring>
#include <queue>
#include <deque>
epoll_event *Epoll::events;
int Epoll::epoll_fd = 0;
// epoll 初始化(创建事件表+事件队列)
int Epoll::epoll_init(int max_events, int listen_num) {
// 创建epoll事件表
epoll_fd = epoll_create(listen_num+1);
if(epoll_fd == -1){
return -1;
}
events = new epoll_event[max_events];
return 0;
}
// 注册新描述符
int Epoll::epoll_add(int fd, __uint32_t events) {
// 创建事件
struct epoll_event event{};
event.data.fd = fd; // 事件从属目标文件符
event.events = events;
// 加入事件
if(epoll_ctl(epoll_fd, EPOLL_CTL_ADD, fd, &event) == -1){
perror("epoll_add error");
return -1;
}
return 0;
}
// 修改描述符状态
int Epoll::epoll_mod(int fd, __uint32_t events) {
// 创建事件
struct epoll_event event{};
event.data.fd = fd;
event.events = events;
if(epoll_ctl(epoll_fd, EPOLL_CTL_MOD, fd, &event) < 0)
{
perror("epoll_mod error");
return -1;
}
return 0;
}
// 从epoll中删除描述符
int Epoll::epoll_del(int fd, __uint32_t events) {
struct epoll_event event{};
event.data.fd = fd;
event.events = events;
if(epoll_ctl(epoll_fd, EPOLL_CTL_DEL, fd, &event) < 0)
{
perror("epoll_del error");
return -1;
}
return 0;
}
// 轮询
// @var timeout 等待毫秒数
int Epoll::zjx_epoll_wait(int listen_fd, int max_event, int timeout) {
// 返回值事件存在 events 里面
int event_count = epoll_wait(epoll_fd, events, max_event, timeout);
if (event_count < 0){
perror("epoll wait error");
return -1;
}
return event_count;
}
// accept封装
void Epoll::acceptConnection(int listen_fd, int epoll_fd) {
struct sockaddr_in client_addr;
memset(&client_addr, 0, sizeof(struct sockaddr_in));
socklen_t client_addr_len = sizeof(client_addr);
int accept_fd = 0;
printf("acceptConnection Entered && len = %d\n", client_addr_len);
int th = 0;
// accept_fd = accept(listen_fd, (struct sockaddr*)&client_addr, &client_addr_len);
// assert(accept_fd>=0);
while ((accept_fd = accept(listen_fd, (struct sockaddr*)&client_addr, &client_addr_len)) > 0){
// listen_fd 非阻塞了, 一直监听到没有活动为止
assert(accept_fd>=0);
// std::cout << inet_addr(reinterpret_cast<const char *>(client_addr.sin_addr.s_addr)) << std::endl;
// std::cout << ntohs(client_addr.sin_port) << std::endl;
printf("%d th accept\n", th++);
// 将新的socket 设为非阻塞
if(setSocketNonBlocking(accept_fd) == -1){
perror("Set non block failed");
continue;
}
// 将新的socket 加入事件监听队列
if(Epoll::epoll_add(accept_fd, EPOLLIN | EPOLLET | EPOLLONESHOT) == -1){
continue;
}
}
}
|
2c68953c44426c2cb5a4f69ee540c271d09f96e9 | 86a506a4158ff27e4ff4947f5fd1aa790900463e | /LibWorkspace/JNAPipeServerDLL/MT4PipeClientDLL/MT4PipeClientDLL.cpp | 5c040ec561dbe7091f96537f4c23194f697235f4 | [] | no_license | xiaozuwei/FinancialProjectsGroup | 67df462c93c96c840e8d6b97dab1a663e5e07992 | 079a51689b5d3aaf4284d139ee69155dceff9f03 | refs/heads/master | 2021-01-15T08:26:59.660188 | 2015-03-15T09:35:51 | 2015-03-15T09:35:51 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 16,644 | cpp | MT4PipeClientDLL.cpp | // MT4PipeClientDLL.cpp : Defines the exported functions for the DLL application.
//
#include "stdafx.h"
#include <iostream>
#include <windows.h>
using namespace std;
#define BUFFERSIZE 512
#define INITBLOCKSIZE 60*sizeof(double)
#define INITTIMESIZE 60*sizeof(int)
#define STARTDATASIZE 18*sizeof(double)
#define STARTTIMESIZE 5*sizeof(int)
#define QUOTEDATASIZE 2*sizeof(double)
HANDLE pipe1;
HANDLE pipe5;
HANDLE pipe15;
HANDLE pipe30;
HANDLE pipe60;
HANDLE pipe240;
HANDLE pipe1440;
int ClosePipeConnection(const int n)
{
BOOL close_res;
switch(n)
{
case 1 :close_res = CloseHandle(pipe1);
break;
case 5: close_res = CloseHandle(pipe5);
break;
case 15: close_res = CloseHandle(pipe15);
break;
case 30: close_res = CloseHandle(pipe30);
break;
case 60: close_res = CloseHandle(pipe60);
break;
case 240: close_res = CloseHandle(pipe240);
break;
case 1440: close_res = CloseHandle(pipe1440);
break;
}
return close_res;
}
int CreatePipeConnectionForM1()
{
pipe1 = CreateFile(
L"\\\\.\\pipe\\forextradingmasterpipeM1",
GENERIC_READ | GENERIC_WRITE, // only need read access
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL
);
if (pipe1 == INVALID_HANDLE_VALUE) {
return 1;
}
return 0;
}
int CreatePipeConnectionForM5()
{
pipe5 = CreateFile(
L"\\\\.\\pipe\\forextradingmasterpipeM5",
GENERIC_READ | GENERIC_WRITE, // only need read access
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL
);
if (pipe5 == INVALID_HANDLE_VALUE) {
return 1;
}
return 0;
}
int CreatePipeConnectionForM15()
{
pipe15 = CreateFile(
L"\\\\.\\pipe\\forextradingmasterpipeM15",
GENERIC_READ | GENERIC_WRITE, // only need read access
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL
);
if (pipe15 == INVALID_HANDLE_VALUE) {
return 1;
}
return 0;
}
int CreatePipeConnectionForM30()
{
pipe30 = CreateFile(
L"\\\\.\\pipe\\forextradingmasterpipeM30",
GENERIC_READ | GENERIC_WRITE, // only need read access
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL
);
if (pipe30 == INVALID_HANDLE_VALUE) {
return 1;
}
return 0;
}
int CreatePipeConnectionForH1()
{
pipe60 = CreateFile(
L"\\\\.\\pipe\\forextradingmasterpipeH1",
GENERIC_READ | GENERIC_WRITE, // only need read access
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL
);
if (pipe60 == INVALID_HANDLE_VALUE) {
return 1;
}
return 0;
}
int CreatePipeConnectionForH4()
{
pipe240 = CreateFile(
L"\\\\.\\pipe\\forextradingmasterpipeH4",
GENERIC_READ | GENERIC_WRITE, // only need read access
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL
);
if (pipe240 == INVALID_HANDLE_VALUE) {
return 1;
}
return 0;
}
int CreatePipeConnectionForD()
{
pipe1440 = CreateFile(
L"\\\\.\\pipe\\forextradingmasterpipeD",
GENERIC_READ | GENERIC_WRITE, // only need read access
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL
);
if (pipe1440 == INVALID_HANDLE_VALUE) {
return 1;
}
return 0;
}
/************************************************************************/
/* Help Method */
/************************************************************************/
int WriteDoubleToPipeForM1(double *arr,const int arraysize)
{
DWORD numBytesWritten = 0;
BOOL writetoresult = WriteFile(
pipe1, // handle to our outbound pipe
arr, // data to send
arraysize, // length of data to send (bytes)
&numBytesWritten, // will store actual amount of data sent
NULL // not using overlapped IO
);
int fr = FlushFileBuffers(pipe1);
return writetoresult;
}
int WriteDoubleToPipeForM5(double *arr,const int arraysize)
{
DWORD numBytesWritten = 0;
BOOL writetoresult = WriteFile(
pipe5, // handle to our outbound pipe
arr, // data to send
arraysize, // length of data to send (bytes)
&numBytesWritten, // will store actual amount of data sent
NULL // not using overlapped IO
);
int fr = FlushFileBuffers(pipe5);
return writetoresult;
}
int WriteDoubleToPipeForM15(double *arr,const int arraysize)
{
DWORD numBytesWritten = 0;
BOOL writetoresult = WriteFile(
pipe15, // handle to our outbound pipe
arr, // data to send
arraysize, // length of data to send (bytes)
&numBytesWritten, // will store actual amount of data sent
NULL // not using overlapped IO
);
int fr = FlushFileBuffers(pipe15);
return writetoresult;
}
int WriteDoubleToPipeForM30(double *arr,const int arraysize)
{
DWORD numBytesWritten = 0;
BOOL writetoresult = WriteFile(
pipe30, // handle to our outbound pipe
arr, // data to send
arraysize, // length of data to send (bytes)
&numBytesWritten, // will store actual amount of data sent
NULL // not using overlapped IO
);
int fr = FlushFileBuffers(pipe30);
return writetoresult;
}
int WriteDoubleToPipeForH1(double *arr,const int arraysize)
{
DWORD numBytesWritten = 0;
BOOL writetoresult = WriteFile(
pipe60, // handle to our outbound pipe
arr, // data to send
arraysize, // length of data to send (bytes)
&numBytesWritten, // will store actual amount of data sent
NULL // not using overlapped IO
);
int fr = FlushFileBuffers(pipe60);
return writetoresult;
}
int WriteDoubleToPipeForH4(double *arr,const int arraysize)
{
DWORD numBytesWritten = 0;
BOOL writetoresult = WriteFile(
pipe240, // handle to our outbound pipe
arr, // data to send
arraysize, // length of data to send (bytes)
&numBytesWritten, // will store actual amount of data sent
NULL // not using overlapped IO
);
int fr = FlushFileBuffers(pipe240);
return writetoresult;
}
int WriteDoubleToPipeForD(double *arr,const int arraysize)
{
DWORD numBytesWritten = 0;
BOOL writetoresult = WriteFile(
pipe1440, // handle to our outbound pipe
arr, // data to send
arraysize, // length of data to send (bytes)
&numBytesWritten, // will store actual amount of data sent
NULL // not using overlapped IO
);
int fr = FlushFileBuffers(pipe1440);
return writetoresult;
}
int WriteIntToPipeForM1(int *arr,const int arraysize)
{
DWORD numBytesWritten = 0;
BOOL writetoresult = WriteFile(
pipe1, // handle to our outbound pipe
arr, // data to send
arraysize, // length of data to send (bytes)
&numBytesWritten, // will store actual amount of data sent
NULL // not using overlapped IO
);
int fr = FlushFileBuffers(pipe1);
return writetoresult;
}
int WriteIntToPipeForM5(int *arr,const int arraysize)
{
DWORD numBytesWritten = 0;
BOOL writetoresult = WriteFile(
pipe5, // handle to our outbound pipe
arr, // data to send
arraysize, // length of data to send (bytes)
&numBytesWritten, // will store actual amount of data sent
NULL // not using overlapped IO
);
int fr = FlushFileBuffers(pipe5);
return writetoresult;
}
int WriteIntToPipeForM15(int *arr,const int arraysize)
{
DWORD numBytesWritten = 0;
BOOL writetoresult = WriteFile(
pipe15, // handle to our outbound pipe
arr, // data to send
arraysize, // length of data to send (bytes)
&numBytesWritten, // will store actual amount of data sent
NULL // not using overlapped IO
);
int fr = FlushFileBuffers(pipe15);
return writetoresult;
}
int WriteIntToPipeForM30(int *arr,const int arraysize)
{
DWORD numBytesWritten = 0;
BOOL writetoresult = WriteFile(
pipe30, // handle to our outbound pipe
arr, // data to send
arraysize, // length of data to send (bytes)
&numBytesWritten, // will store actual amount of data sent
NULL // not using overlapped IO
);
int fr = FlushFileBuffers(pipe30);
return writetoresult;
}
int WriteIntToPipeForH1(int *arr,const int arraysize)
{
DWORD numBytesWritten = 0;
BOOL writetoresult = WriteFile(
pipe60, // handle to our outbound pipe
arr, // data to send
arraysize, // length of data to send (bytes)
&numBytesWritten, // will store actual amount of data sent
NULL // not using overlapped IO
);
int fr = FlushFileBuffers(pipe60);
return writetoresult;
}
int WriteIntToPipeForH4(int *arr,const int arraysize)
{
DWORD numBytesWritten = 0;
BOOL writetoresult = WriteFile(
pipe240, // handle to our outbound pipe
arr, // data to send
arraysize, // length of data to send (bytes)
&numBytesWritten, // will store actual amount of data sent
NULL // not using overlapped IO
);
int fr = FlushFileBuffers(pipe240);
return writetoresult;
}
int WriteIntToPipeForD(int *arr,const int arraysize)
{
DWORD numBytesWritten = 0;
BOOL writetoresult = WriteFile(
pipe1440, // handle to our outbound pipe
arr, // data to send
arraysize, // length of data to send (bytes)
&numBytesWritten, // will store actual amount of data sent
NULL // not using overlapped IO
);
int fr = FlushFileBuffers(pipe1440);
return writetoresult;
}
/************************************************************************/
/* Help Mehod End */
/************************************************************************/
int WriteInitDataToPipeForM1(double *open, double *close,double *high, double *low, int *time, double *quote)
{
//open
int or = WriteDoubleToPipeForM1(open, INITBLOCKSIZE);
//close
int cr = WriteDoubleToPipeForM1(close, INITBLOCKSIZE);
//high
int hr = WriteDoubleToPipeForM1(high, INITBLOCKSIZE);
//low
int lr = WriteDoubleToPipeForM1(low, INITBLOCKSIZE);
//time
int tr = WriteIntToPipeForM1(time,INITTIMESIZE);
//quote QUOTEDATASIZE
int qr = WriteDoubleToPipeForM1(quote, QUOTEDATASIZE);
return 0;
}
int WriteInitDataToPipeForM5(double *open, double *close,double *high, double *low, int *time, double *quote)
{
//open
int or = WriteDoubleToPipeForM5(open, INITBLOCKSIZE);
//close
int cr = WriteDoubleToPipeForM5(close, INITBLOCKSIZE);
//high
int hr = WriteDoubleToPipeForM5(high, INITBLOCKSIZE);
//low
int lr = WriteDoubleToPipeForM5(low, INITBLOCKSIZE);
//time
int tr = WriteIntToPipeForM5(time,INITTIMESIZE);
//quote QUOTEDATASIZE
int qr = WriteDoubleToPipeForM5(quote, QUOTEDATASIZE);
return 0;
}
int WriteInitDataToPipeForM15(double *open, double *close,double *high, double *low, int *time, double *quote)
{
//open
int or = WriteDoubleToPipeForM15(open, INITBLOCKSIZE);
//close
int cr = WriteDoubleToPipeForM15(close, INITBLOCKSIZE);
//high
int hr = WriteDoubleToPipeForM15(high, INITBLOCKSIZE);
//low
int lr = WriteDoubleToPipeForM15(low, INITBLOCKSIZE);
//time
int tr = WriteIntToPipeForM15(time,INITTIMESIZE);
//quote QUOTEDATASIZE
int qr = WriteDoubleToPipeForM15(quote, QUOTEDATASIZE);
return 0;
}
int WriteInitDataToPipeForM30(double *open, double *close,double *high, double *low, int *time, double *quote)
{
//open
int or = WriteDoubleToPipeForM30(open, INITBLOCKSIZE);
//close
int cr = WriteDoubleToPipeForM30(close, INITBLOCKSIZE);
//high
int hr = WriteDoubleToPipeForM30(high, INITBLOCKSIZE);
//low
int lr = WriteDoubleToPipeForM30(low, INITBLOCKSIZE);
//time
int tr = WriteIntToPipeForM30(time,INITTIMESIZE);
//quote QUOTEDATASIZE
int qr = WriteDoubleToPipeForM30(quote, QUOTEDATASIZE);
return 0;
}
int WriteInitDataToPipeForH1(double *open, double *close,double *high, double *low, int *time, double *quote)
{
//open
int or = WriteDoubleToPipeForH1(open, INITBLOCKSIZE);
//close
int cr = WriteDoubleToPipeForH1(close, INITBLOCKSIZE);
//high
int hr = WriteDoubleToPipeForH1(high, INITBLOCKSIZE);
//low
int lr = WriteDoubleToPipeForH1(low, INITBLOCKSIZE);
//time
int tr = WriteIntToPipeForH1(time,INITTIMESIZE);
//quote QUOTEDATASIZE
int qr = WriteDoubleToPipeForH1(quote, QUOTEDATASIZE);
return 0;
}
int WriteInitDataToPipeForH4(double *open, double *close,double *high, double *low, int *time, double *quote)
{
//open
int or = WriteDoubleToPipeForH4(open, INITBLOCKSIZE);
//close
int cr = WriteDoubleToPipeForH4(close, INITBLOCKSIZE);
//high
int hr = WriteDoubleToPipeForH4(high, INITBLOCKSIZE);
//low
int lr = WriteDoubleToPipeForH4(low, INITBLOCKSIZE);
//time
int tr = WriteIntToPipeForH4(time,INITTIMESIZE);
//quote QUOTEDATASIZE
int qr = WriteDoubleToPipeForH4(quote, QUOTEDATASIZE);
return 0;
}
int WriteInitDataToPipeForD(double *open, double *close,double *high, double *low, int *time, double *quote)
{
//open
int or = WriteDoubleToPipeForD(open, INITBLOCKSIZE);
//close
int cr = WriteDoubleToPipeForD(close, INITBLOCKSIZE);
//high
int hr = WriteDoubleToPipeForD(high, INITBLOCKSIZE);
//low
int lr = WriteDoubleToPipeForD(low, INITBLOCKSIZE);
//time
int tr = WriteIntToPipeForD(time,INITTIMESIZE);
//quote QUOTEDATASIZE
int qr = WriteDoubleToPipeForD(quote, QUOTEDATASIZE);
return 0;
}
int WriteStartDataToPipeForM1(double *arr, int *time)
{
int sr = WriteDoubleToPipeForM1(arr,STARTDATASIZE);
int tr = WriteIntToPipeForM1(time,STARTTIMESIZE);
return 0;
}
int WriteStartDataToPipeForM5(double *arr, int *time)
{
int sr = WriteDoubleToPipeForM5(arr,STARTDATASIZE);
int tr = WriteIntToPipeForM5(time,STARTTIMESIZE);
return 0;
}
int WriteStartDataToPipeForM15(double *arr, int *time)
{
int sr = WriteDoubleToPipeForM15(arr,STARTDATASIZE);
int tr = WriteIntToPipeForM15(time,STARTTIMESIZE);
return 0;
}
int WriteStartDataToPipeForM30(double *arr, int *time)
{
int sr = WriteDoubleToPipeForM30(arr,STARTDATASIZE);
int tr = WriteIntToPipeForM30(time,STARTTIMESIZE);
return 0;
}
int WriteStartDataToPipeForH1(double *arr, int *time)
{
int sr = WriteDoubleToPipeForH1(arr,STARTDATASIZE);
int tr = WriteIntToPipeForH1(time,STARTTIMESIZE);
return 0;
}
int WriteStartDataToPipeForH4(double *arr, int *time)
{
int sr = WriteDoubleToPipeForH4(arr,STARTDATASIZE);
int tr = WriteIntToPipeForH4(time,STARTTIMESIZE);
return 0;
}
int WriteStartDataToPipeForD(double *arr, int *time)
{
int sr = WriteDoubleToPipeForD(arr,STARTDATASIZE);
int tr = WriteIntToPipeForD(time,STARTTIMESIZE);
return 0;
}
/************************************************************************/
/* not used */
/************************************************************************/
/**
double DSum(double a,double b)
{
return a+b;
}
*/
//////////////////////////////////////////////////////////////////////////
/************************************************************************/
/* start to code MT4 client DLL */
/************************************************************************/
/**
struct ForexDataStruct{
double value;
};
double transferdata[2] = {3.14,0.27};//,4.35,3.21,5.6};
*/
/**
int CreatePipeConnection()
{
pipe = CreateFile(
L"\\\\.\\pipe\\forextradingmasterpipe",
GENERIC_READ | GENERIC_WRITE, // only need read access
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL
);
if (pipe == INVALID_HANDLE_VALUE) {
return 1;
}
return 0;
}
*/
/**
int ReadDataFromPipe(double *arr,const int arraysize)
{
DWORD numBytesRead = 0;
BOOL read_result = ReadFile(
pipe,
arr, // the data from the pipe will be put here
arraysize, // number of bytes allocated
&numBytesRead, // this will store number of bytes actually read
NULL // not using overlapped IO
);
return read_result;
}
int WriteDataToPipe(double *arr,const int arraysize)
{
DWORD numBytesWritten = 0;
BOOL writetoresult = WriteFile(
pipe, // handle to our outbound pipe
arr, // data to send
arraysize, // length of data to send (bytes)
&numBytesWritten, // will store actual amount of data sent
NULL // not using overlapped IO
);
int fr = FlushFileBuffers(pipe);
return writetoresult;
}
int WriteIntToPipe(int *arr,const int arraysize)
{
DWORD numBytesWritten = 0;
BOOL writetoresult = WriteFile(
pipe, // handle to our outbound pipe
arr, // data to send
arraysize, // length of data to send (bytes)
&numBytesWritten, // will store actual amount of data sent
NULL // not using overlapped IO
);
int fr = FlushFileBuffers(pipe);
return writetoresult;
}
*/
// int testsizeofdouble()
// {
// return sizeof(transferdata);
//
// }
/************************************************************************/
/* new method */
/************************************************************************/ |
397e497044df0df28e216cbe1b3b0df4ef4622b2 | 995310a5ed19946037e928f9a85bae908694c8fe | /src/eloquent/graphics/colormaps/gist_stern_r.h | e5c49ba374f1812150f250397b7cd0dcdec2fe71 | [] | no_license | eloquentarduino/EloquentArduino | bca073e19af3e9cc5c7f135719cd026631277744 | 15983e68cf82c54afadaf2b6c8fdc95cad268489 | refs/heads/master | 2022-08-26T07:07:02.235025 | 2022-08-21T12:24:04 | 2022-08-21T12:24:04 | 227,818,265 | 162 | 57 | null | 2021-01-07T18:33:09 | 2019-12-13T10:49:33 | C++ | UTF-8 | C++ | false | false | 1,765 | h | gist_stern_r.h | //
// Created by Simone on 18/05/2022.
//
#pragma once
#include "../../macros.h"
namespace Eloquent {
namespace Graphics {
namespace Colormaps {
class Gist_stern_r {
public:
/**
* Convert single byte to RGB color
* @param x
* @param r
* @param g
* @param b
*/
void convert(uint8_t x, uint8_t *r, uint8_t *g, uint8_t *b) {
*r = red[x << 2];
*g = green[x << 2];
*b = blue[x << 2];
}
protected:
uint8_t red[64] = {255, 250, 246, 242, 238, 234, 230, 226, 222, 218, 214, 210, 206, 202, 198, 194, 190, 186, 182, 178, 174, 170, 165, 161, 157, 153, 149, 145, 141, 137, 133, 129, 125, 121, 117, 113, 109, 105, 101, 97, 93, 89, 85, 80, 76, 72, 68, 64, 22, 42, 62, 82, 102, 122, 143, 163, 183, 203, 223, 243, 221, 147, 73, 0};
uint8_t green[64] = {255, 250, 246, 242, 238, 234, 230, 226, 222, 218, 214, 210, 206, 202, 198, 194, 190, 186, 182, 178, 174, 170, 165, 161, 157, 153, 149, 145, 141, 137, 133, 129, 125, 121, 117, 113, 109, 105, 101, 97, 93, 89, 85, 80, 76, 72, 68, 64, 60, 56, 52, 48, 44, 40, 36, 32, 28, 24, 20, 16, 12, 8, 4, 0};
uint8_t blue[64] = {255, 239, 224, 209, 193, 178, 163, 148, 132, 117, 102, 86, 71, 56, 41, 25, 10, 5, 22, 39, 56, 74, 91, 108, 125, 143, 160, 177, 194, 211, 229, 246, 250, 242, 234, 226, 218, 210, 202, 194, 186, 178, 170, 161, 153, 145, 137, 129, 121, 113, 105, 97, 89, 80, 72, 64, 56, 48, 40, 32, 24, 16, 8, 0};
};
}
}
}
ELOQUENT_SINGLETON(Eloquent::Graphics::Colormaps::Gist_stern_r gist_stern_r); |
cb842510f7f16897215504e6f2d659c98b94f97b | 4bcc9806152542ab43fc2cf47c499424f200896c | /tensorflow/compiler/xla/mlir_hlo/tools/mlir_interpreter/dialects/complex.cc | 2f420ab68d1fecf915c10f1bb5f8e2ae5046a0d7 | [
"Apache-2.0",
"LicenseRef-scancode-generic-cla",
"BSD-2-Clause"
] | permissive | tensorflow/tensorflow | 906276dbafcc70a941026aa5dc50425ef71ee282 | a7f3934a67900720af3d3b15389551483bee50b8 | refs/heads/master | 2023-08-25T04:24:41.611870 | 2023-08-25T04:06:24 | 2023-08-25T04:14:08 | 45,717,250 | 208,740 | 109,943 | Apache-2.0 | 2023-09-14T20:55:50 | 2015-11-07T01:19:20 | C++ | UTF-8 | C++ | false | false | 2,891 | cc | complex.cc | /* Copyright 2023 The TensorFlow Authors. All Rights Reserved.
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 "mlir/Dialect/Complex/IR/Complex.h"
#include "tools/mlir_interpreter/dialects/cwise_math.h"
#include "tools/mlir_interpreter/framework/interpreter_value_util.h"
#include "tools/mlir_interpreter/framework/registration.h"
namespace mlir {
namespace interpreter {
namespace {
InterpreterValue constant(InterpreterState&, complex::ConstantOp constant) {
auto ty = constant->getResultTypes()[0];
return dispatchScalarType(ty, [&](auto dummy) -> InterpreterValue {
if constexpr (is_complex_v<decltype(dummy)>) {
using T = typename decltype(dummy)::value_type;
auto values =
llvm::to_vector(constant.getValue().getAsValueRange<FloatAttr>());
return {decltype(dummy){static_cast<T>(values[0].convertToDouble()),
static_cast<T>(values[1].convertToDouble())}};
} else {
llvm_unreachable("invalid constant");
}
});
}
REGISTER_MLIR_INTERPRETER_OP("complex.abs", "math.absf");
REGISTER_MLIR_INTERPRETER_OP("complex.add", "arith.addf");
REGISTER_MLIR_INTERPRETER_OP("complex.cos", applyCwiseMap<Cos>);
REGISTER_MLIR_INTERPRETER_OP("complex.create", applyCwiseBinaryMap<Complex>);
REGISTER_MLIR_INTERPRETER_OP("complex.div", applyCwiseBinaryMap<Divide>);
REGISTER_MLIR_INTERPRETER_OP("complex.exp", applyCwiseMap<Exp>);
REGISTER_MLIR_INTERPRETER_OP("complex.expm1", applyCwiseMap<ExpM1>);
REGISTER_MLIR_INTERPRETER_OP("complex.im", applyCwiseMap<Imag>);
REGISTER_MLIR_INTERPRETER_OP("complex.log", applyCwiseMap<Log>);
REGISTER_MLIR_INTERPRETER_OP("complex.log1p", applyCwiseMap<Log1P>);
REGISTER_MLIR_INTERPRETER_OP("complex.mul", applyCwiseBinaryMap<Multiply>);
REGISTER_MLIR_INTERPRETER_OP("complex.neg", applyCwiseMap<Neg>);
REGISTER_MLIR_INTERPRETER_OP("complex.pow", applyCwiseBinaryMap<Power>);
REGISTER_MLIR_INTERPRETER_OP("complex.re", applyCwiseMap<Real>);
REGISTER_MLIR_INTERPRETER_OP("complex.rsqrt", applyCwiseMap<RSqrt>);
REGISTER_MLIR_INTERPRETER_OP("complex.sin", applyCwiseMap<Sin>);
REGISTER_MLIR_INTERPRETER_OP("complex.sqrt", applyCwiseMap<Sqrt>);
REGISTER_MLIR_INTERPRETER_OP("complex.tanh", applyCwiseMap<TanH>);
REGISTER_MLIR_INTERPRETER_OP(constant);
} // namespace
} // namespace interpreter
} // namespace mlir
|
230db9010f8945d0aa0457bb56ad9464fdb7ad95 | 766eab9734986b22dbc66973b769f589592594df | /rabbit_stepUP/gen/opt/J_Ce1_vec6_five_link_walker.cc | 5e87c76de9e31e01d4a91d429a0f923cb20aa97c | [] | no_license | Emungai/mpc_fiveLink | 3a7dddca216365138f3534b8ce17234db6f41ebe | b79d08838af15433dc7ab0b3f585e028b489b70b | refs/heads/master | 2020-09-05T11:24:34.315317 | 2019-12-23T22:34:18 | 2019-12-23T22:34:18 | 220,082,653 | 3 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 12,896 | cc | J_Ce1_vec6_five_link_walker.cc | /*
* Automatically Generated from Mathematica.
* Tue 3 Dec 2019 15:22:08 GMT-05:00
*/
#ifdef MATLAB_MEX_FILE
#include <stdexcept>
#include <cmath>
/**
* Copied from Wolfram Mathematica C Definitions file mdefs.hpp
* Changed marcos to inline functions (Eric Cousineau)
*/
inline double Power(double x, double y) { return pow(x, y); }
inline double Sqrt(double x) { return sqrt(x); }
inline double Abs(double x) { return fabs(x); }
inline double Exp(double x) { return exp(x); }
inline double Log(double x) { return log(x); }
inline double Sin(double x) { return sin(x); }
inline double Cos(double x) { return cos(x); }
inline double Tan(double x) { return tan(x); }
inline double ArcSin(double x) { return asin(x); }
inline double ArcCos(double x) { return acos(x); }
inline double ArcTan(double x) { return atan(x); }
/* update ArcTan function to use atan2 instead. */
inline double ArcTan(double x, double y) { return atan2(y,x); }
inline double Sinh(double x) { return sinh(x); }
inline double Cosh(double x) { return cosh(x); }
inline double Tanh(double x) { return tanh(x); }
const double E = 2.71828182845904523536029;
const double Pi = 3.14159265358979323846264;
const double Degree = 0.01745329251994329576924;
#endif
/*
* Sub functions
*/
static void output1(double *p_output1,const double *var1,const double *var2)
{
double t4655;
double t4645;
double t4651;
double t4609;
double t4670;
double t2820;
double t4662;
double t4663;
double t4664;
double t4667;
double t4668;
double t4826;
double t4827;
double t4829;
double t4610;
double t4652;
double t4653;
double t4654;
double t4854;
double t4855;
double t4856;
double t4798;
double t4816;
double t4823;
double t4861;
double t4669;
double t4723;
double t4724;
double t4725;
double t4824;
double t4857;
double t4858;
double t4859;
double t4871;
double t4872;
double t4873;
double t4874;
double t4875;
double t4876;
double t4877;
double t4878;
double t4879;
double t4880;
double t4882;
double t4883;
double t4884;
double t4886;
double t4898;
double t4899;
double t4900;
double t4901;
double t4902;
double t4903;
double t4889;
double t4890;
double t4891;
double t4885;
double t4887;
double t4888;
double t4892;
double t4893;
double t4906;
double t4907;
double t4908;
double t4909;
double t4910;
double t4930;
double t4931;
double t4932;
double t4933;
double t4934;
double t4935;
double t4936;
double t4939;
double t4921;
double t4922;
double t4923;
double t4940;
double t4943;
double t4944;
double t4945;
double t4830;
double t4949;
double t4950;
double t4951;
double t4952;
double t4849;
double t4955;
double t4960;
double t4860;
double t4867;
double t4961;
double t4962;
double t4963;
double t4964;
double t4973;
double t4974;
double t4975;
double t4966;
double t4967;
double t4968;
double t4978;
double t4979;
double t4980;
double t4917;
double t4918;
double t4919;
double t4853;
double t4868;
double t4869;
double t4870;
double t4894;
double t5002;
double t5003;
double t5004;
double t4998;
double t4999;
double t5000;
double t5012;
double t5013;
double t5014;
double t5007;
double t5008;
double t5009;
double t5006;
double t5034;
double t5035;
double t5015;
double t5019;
double t5038;
double t5039;
double t5041;
double t5042;
double t5023;
double t5028;
double t5029;
double t5030;
double t5031;
double t5032;
double t5033;
double t5036;
double t5037;
double t5040;
double t5043;
double t5044;
double t5045;
double t5046;
double t5047;
double t5048;
double t5049;
double t5050;
double t5051;
double t5052;
double t5053;
double t5054;
double t5055;
double t5056;
double t5057;
double t5058;
double t5059;
double t5060;
double t5061;
double t5062;
double t5067;
double t5068;
double t5070;
double t5071;
double t5073;
double t5074;
double t5075;
double t5081;
double t5082;
double t5083;
double t5097;
double t5098;
double t5099;
double t5100;
double t5101;
double t5113;
double t5114;
double t5115;
t4655 = Cos(var1[6]);
t4645 = Sin(var1[2]);
t4651 = Sin(var1[5]);
t4609 = Cos(var1[5]);
t4670 = Sin(var1[6]);
t2820 = Cos(var1[2]);
t4662 = -1.*t4655;
t4663 = 1. + t4662;
t4664 = 0.4*t4663;
t4667 = 0.64*t4655;
t4668 = t4664 + t4667;
t4826 = t4609*t4655;
t4827 = -1.*t4651*t4670;
t4829 = t4826 + t4827;
t4610 = -1.*t2820*t4609;
t4652 = t4645*t4651;
t4653 = t4610 + t4652;
t4654 = 0.748*t4653;
t4854 = t4668*t4670;
t4855 = -0.24*t4655*t4670;
t4856 = t4854 + t4855;
t4798 = -1.*t4655*t4651;
t4816 = -1.*t4609*t4670;
t4823 = t4798 + t4816;
t4861 = -1.*t4645*t4829;
t4669 = t4668*t4655;
t4723 = Power(t4670,2);
t4724 = 0.24*t4723;
t4725 = t4669 + t4724;
t4824 = -1.*t4645*t4823;
t4857 = t4655*t4651;
t4858 = t4609*t4670;
t4859 = t4857 + t4858;
t4871 = t2820*t4823;
t4872 = t4871 + t4861;
t4873 = 3.2*t4856*t4872;
t4874 = -1.*t4609*t4655;
t4875 = t4651*t4670;
t4876 = t4874 + t4875;
t4877 = t2820*t4876;
t4878 = t4824 + t4877;
t4879 = 3.2*t4725*t4878;
t4880 = t4654 + t4873 + t4879;
t4882 = Power(t4655,2);
t4883 = -0.24*t4882;
t4884 = t4669 + t4883;
t4886 = t2820*t4829;
t4898 = t4645*t4859;
t4899 = t4898 + t4877;
t4900 = 3.2*t4725*t4899;
t4901 = t4645*t4876;
t4902 = t4871 + t4901;
t4903 = 3.2*t4856*t4902;
t4889 = -1.*t4668*t4670;
t4890 = 0.24*t4655*t4670;
t4891 = t4889 + t4890;
t4885 = -1.*t4645*t4859;
t4887 = t4885 + t4886;
t4888 = 3.2*t4884*t4887;
t4892 = 3.2*t4891*t4872;
t4893 = t4888 + t4873 + t4892 + t4879;
t4906 = t4645*t4823;
t4907 = t4906 + t4886;
t4908 = 3.2*t4884*t4907;
t4909 = 3.2*t4891*t4902;
t4910 = t4908 + t4900 + t4903 + t4909;
t4930 = -1.*t4609*t4645;
t4931 = -1.*t2820*t4651;
t4932 = t4930 + t4931;
t4933 = 0.748*t4932;
t4934 = 3.2*t4856*t4887;
t4935 = 3.2*t4725*t4872;
t4936 = t4933 + t4934 + t4935;
t4939 = 3.2*t4856*t4907;
t4921 = t2820*t4859;
t4922 = t4645*t4829;
t4923 = t4921 + t4922;
t4940 = 3.2*t4725*t4902;
t4943 = 3.2*t4891*t4907;
t4944 = 3.2*t4884*t4923;
t4945 = t4939 + t4943 + t4944 + t4940;
t4830 = -1.*t2820*t4829;
t4949 = t4609*t4645;
t4950 = t2820*t4651;
t4951 = t4949 + t4950;
t4952 = 0.748*t4951;
t4849 = t4824 + t4830;
t4955 = -1.*t2820*t4823;
t4960 = 3.2*t4856*t4849;
t4860 = -1.*t2820*t4859;
t4867 = t4860 + t4861;
t4961 = -1.*t4645*t4876;
t4962 = t4955 + t4961;
t4963 = 3.2*t4725*t4962;
t4964 = t4952 + t4960 + t4963;
t4973 = 3.2*t4856*t4878;
t4974 = t4921 + t4961;
t4975 = 3.2*t4725*t4974;
t4966 = 3.2*t4891*t4849;
t4967 = 3.2*t4884*t4867;
t4968 = t4960 + t4966 + t4967 + t4963;
t4978 = 3.2*t4884*t4872;
t4979 = 3.2*t4891*t4878;
t4980 = t4978 + t4973 + t4979 + t4975;
t4917 = -1.*t4668*t4655;
t4918 = 0.24*t4882;
t4919 = t4917 + t4918;
t4853 = 3.2*t4725*t4849;
t4868 = 3.2*t4856*t4867;
t4869 = t4654 + t4853 + t4868;
t4870 = -0.5*var2[2]*t4869;
t4894 = -0.5*var2[6]*t4893;
t5002 = t4609*t4668;
t5003 = -0.24*t4651*t4670;
t5004 = t5002 + t5003;
t4998 = -1.*t4668*t4651;
t4999 = -0.24*t4609*t4670;
t5000 = t4998 + t4999;
t5012 = t4668*t4651;
t5013 = 0.24*t4609*t4670;
t5014 = t5012 + t5013;
t5007 = -1.*t4609*t4668;
t5008 = 0.24*t4651*t4670;
t5009 = t5007 + t5008;
t5006 = -1.*t4859*t5004;
t5034 = -0.24*t4655*t4651;
t5035 = t5034 + t4999;
t5015 = -1.*t5014*t4876;
t5019 = t4823*t5014;
t5038 = 0.24*t4609*t4655;
t5039 = t5038 + t5003;
t5041 = -0.24*t4609*t4655;
t5042 = t5041 + t5008;
t5023 = t5004*t4876;
t5028 = t5000*t4829;
t5029 = t5014*t4829;
t5030 = t4823*t5004;
t5031 = t4859*t5004;
t5032 = t5028 + t5029 + t5030 + t5031;
t5033 = 3.2*t4891*t5032;
t5036 = -1.*t5035*t4829;
t5037 = -1.*t4823*t5004;
t5040 = -1.*t4823*t5039;
t5043 = -1.*t4823*t5042;
t5044 = -1.*t5000*t4876;
t5045 = -1.*t5035*t4876;
t5046 = t5036 + t5037 + t5006 + t5040 + t5043 + t5044 + t5045 + t5015;
t5047 = 3.2*t4856*t5046;
t5048 = -1.*t4823*t5000;
t5049 = -1.*t4823*t5014;
t5050 = -1.*t4829*t5004;
t5051 = -1.*t5004*t4876;
t5052 = t5048 + t5049 + t5050 + t5051;
t5053 = 3.2*t4884*t5052;
t5054 = t4823*t5000;
t5055 = t4823*t5035;
t5056 = t5035*t4859;
t5057 = t4829*t5004;
t5058 = t4829*t5039;
t5059 = t4829*t5042;
t5060 = t5054 + t5055 + t5019 + t5056 + t5057 + t5058 + t5059 + t5023;
t5061 = 3.2*t4725*t5060;
t5062 = t5033 + t5047 + t5053 + t5061;
t5067 = -1.*t5014*t4829;
t5068 = t5067 + t5037;
t5070 = t5014*t4859;
t5071 = t5070 + t5057;
t5073 = t5035*t4829;
t5074 = t4859*t5039;
t5075 = t5073 + t5029 + t5030 + t5074;
t5081 = -1.*t4823*t5035;
t5082 = -1.*t4829*t5039;
t5083 = t5081 + t5049 + t5082 + t5051;
t5097 = 3.2*t4884*t5068;
t5098 = 3.2*t4891*t5071;
t5099 = 3.2*t4725*t5075;
t5100 = 3.2*t4856*t5083;
t5101 = t5097 + t5098 + t5099 + t5100;
t5113 = 6.4*t4884*t4856;
t5114 = 6.4*t4891*t4725;
t5115 = t5113 + t5114;
p_output1[0]=var2[5]*(t4870 + t4894 - 0.5*t4880*var2[5]);
p_output1[1]=var2[5]*(-0.5*t4880*var2[2] - 0.5*(t4654 + t4900 + t4903)*var2[5] - 0.5*t4910*var2[6]);
p_output1[2]=var2[5]*(-0.5*t4893*var2[2] - 0.5*t4910*var2[5] - 0.5*(t4900 + 6.4*t4891*t4902 + t4903 + 6.4*t4884*t4907 + 3.2*t4907*t4919 + 3.2*t4891*t4923)*var2[6]);
p_output1[3]=-0.5*t4936*var2[5];
p_output1[4]=-0.5*t4936*var2[2] - 1.*(t4933 + t4939 + t4940)*var2[5] - 0.5*t4945*var2[6];
p_output1[5]=-0.5*t4945*var2[5];
p_output1[6]=var2[5]*(-0.5*(3.2*t4856*(t4830 + t4898) + t4952 + 3.2*t4725*(t4922 + t4955))*var2[2] - 0.5*t4964*var2[5] - 0.5*t4968*var2[6]);
p_output1[7]=var2[5]*(-0.5*t4964*var2[2] - 0.5*(t4952 + t4973 + t4975)*var2[5] - 0.5*t4980*var2[6]);
p_output1[8]=var2[5]*(-0.5*t4968*var2[2] - 0.5*t4980*var2[5] - 0.5*(6.4*t4872*t4884 + 6.4*t4878*t4891 + 3.2*t4887*t4891 + 3.2*t4872*t4919 + t4973 + t4975)*var2[6]);
p_output1[9]=-0.5*t4869*var2[5];
p_output1[10]=t4870 + t4894 - 1.*t4880*var2[5];
p_output1[11]=-0.5*t4893*var2[5];
p_output1[12]=var2[5]*(-0.5*(3.2*t4856*(-1.*t4829*t5000 - 2.*t4876*t5000 - 2.*t4823*t5004 + t5006 - 1.*t4823*t5009 + t5015) + 3.2*t4725*(2.*t4823*t5000 + t4859*t5000 + 2.*t4829*t5004 + t4829*t5009 + t5019 + t5023))*var2[5] - 0.5*t5062*var2[6]);
p_output1[13]=var2[5]*(-0.5*t5062*var2[5] - 0.5*(3.2*t4856*(t5006 + t5015 - 2.*t4876*t5035 + t5036 - 2.*t4823*t5039 + t5043) + 3.2*t4725*(t5019 + t5023 + 2.*t4823*t5035 + 2.*t4829*t5039 + t5056 + t5059) + 3.2*t4891*t5068 + 3.2*t4919*t5071 + 6.4*t4891*t5075 + 6.4*t4884*t5083)*var2[6]);
p_output1[14]=-1.*(3.2*t4725*t5032 + 3.2*t4856*t5052)*var2[5] - 0.5*t5101*var2[6];
p_output1[15]=-0.5*t5101*var2[5];
p_output1[16]=-0.5*(6.4*Power(t4884,2) + 6.4*t4856*t4891 + 6.4*Power(t4891,2) + 6.4*t4725*t4919)*var2[5]*var2[6];
p_output1[17]=-0.5*t5115*var2[6];
p_output1[18]=-0.5*t5115*var2[5];
p_output1[19]=-0.384*t4919*var2[5]*var2[6];
p_output1[20]=-0.384*t4891*var2[6];
p_output1[21]=-0.384*t4891*var2[5];
}
#ifdef MATLAB_MEX_FILE
#include "mex.h"
/*
* Main function
*/
void mexFunction( int nlhs, mxArray *plhs[],
int nrhs, const mxArray *prhs[] )
{
size_t mrows, ncols;
double *var1,*var2;
double *p_output1;
/* Check for proper number of arguments. */
if( nrhs != 2)
{
mexErrMsgIdAndTxt("MATLAB:MShaped:invalidNumInputs", "Two input(s) required (var1,var2).");
}
else if( nlhs > 1)
{
mexErrMsgIdAndTxt("MATLAB:MShaped:maxlhs", "Too many output arguments.");
}
/* The input must be a noncomplex double vector or scaler. */
mrows = mxGetM(prhs[0]);
ncols = mxGetN(prhs[0]);
if( !mxIsDouble(prhs[0]) || mxIsComplex(prhs[0]) ||
( !(mrows == 7 && ncols == 1) &&
!(mrows == 1 && ncols == 7)))
{
mexErrMsgIdAndTxt( "MATLAB:MShaped:inputNotRealVector", "var1 is wrong.");
}
mrows = mxGetM(prhs[1]);
ncols = mxGetN(prhs[1]);
if( !mxIsDouble(prhs[1]) || mxIsComplex(prhs[1]) ||
( !(mrows == 7 && ncols == 1) &&
!(mrows == 1 && ncols == 7)))
{
mexErrMsgIdAndTxt( "MATLAB:MShaped:inputNotRealVector", "var2 is wrong.");
}
/* Assign pointers to each input. */
var1 = mxGetPr(prhs[0]);
var2 = mxGetPr(prhs[1]);
/* Create matrices for return arguments. */
plhs[0] = mxCreateDoubleMatrix((mwSize) 22, (mwSize) 1, mxREAL);
p_output1 = mxGetPr(plhs[0]);
/* Call the calculation subroutine. */
output1(p_output1,var1,var2);
}
#else // MATLAB_MEX_FILE
#include "J_Ce1_vec6_five_link_walker.hh"
namespace RightStance
{
void J_Ce1_vec6_five_link_walker_raw(double *p_output1, const double *var1,const double *var2)
{
// Call Subroutines
output1(p_output1, var1, var2);
}
}
#endif // MATLAB_MEX_FILE
|
1629ce05090ff554750461ea8916fbafd6fa8dde | 3831d4c8152ebb48589bf2abb6364fad05ced079 | /src/BlockNot.h | 3e563f25c3e7bb90affaa909a720446a0444de41 | [] | no_license | mggates39/BlockNot | e71d382c2c787c5e88e1bbc6e98ad0fc01634bf9 | f85983ddd6ec31813f2dc0230eefea94fb6ccee3 | refs/heads/main | 2023-03-17T14:02:03.180133 | 2021-03-16T14:52:07 | 2021-03-16T14:52:07 | 346,507,218 | 0 | 0 | null | 2021-03-10T22:17:11 | 2021-03-10T22:17:10 | null | UTF-8 | C++ | false | false | 4,213 | h | BlockNot.h | #include <Arduino.h>
#ifndef BlockNot_h
#define BlockNot_h
#pragma once
#define WITH_RESET true
#define NO_RESET false
//Macros - their usage and significance is described in README.md
#define TIME_PASSED timeSinceLastReset()
#define TIME_SINCE_RESET timeSinceLastReset()
#define ELAPSED timeSinceLastReset()
#define TIME_REMAINING getTimeUntilTrigger()
#define REMAINING getTimeUntilTrigger()
#define DURATION getDuration()
#define DONE triggered()
#define TRIGGERED triggered()
#define DONE_NO_RESET triggered(NO_RESET)
#define HAS_TRIGGERED triggered(NO_RESET)
#define NOT_DONE notTriggered()
#define NOT_TRIGGERED notTriggered()
#define FIRST_TRIGGER firstTrigger()
#define RESET reset()
#define ENABLE enable()
#define DISABLE disable()
#define SWAP negateState()
#define FLIP negateState()
#define SWAP_STATE negateState()
#define FLIP_STATE negateState()
#define ENABLED isEnabled()
class BlockNot {
public:
/*
This library is very simple as libraries go. Each method in the library is described in README.md
see: https://github.com/EasyG0ing1/BlockNot for complete documentation.
*/
BlockNot(unsigned long milliseconds) {
duration = milliseconds;
reset();
}
BlockNot(unsigned long milliseconds, unsigned long disableReturnValue) {
duration = milliseconds;
disableReturn = disableReturnValue;
reset();
}
void setDuration(const unsigned long milliseconds, bool resetOption = WITH_RESET) {
if (enabled) {
duration = milliseconds;
if (resetOption) reset();
}
};
void addTime(const unsigned long milliseconds, bool resetOption = NO_RESET) {
if (enabled) {
const unsigned long newDuration = duration + milliseconds;
duration = newDuration;
if (resetOption) reset();
}
}
void takeTime(const unsigned long milliseconds, bool resetOption = NO_RESET) {
if (enabled) {
long newDuration = duration - milliseconds;
duration = newDuration > 0 ? newDuration : 0;
if (resetOption) reset();
}
}
boolean triggered(bool resetOption = true) {
bool triggered = hasTriggered();
if (resetOption && triggered) {
reset();
}
return triggered;
}
boolean notTriggered() { return hasNotTriggered(); }
boolean firstTrigger() {
if (hasTriggered() && !onceTriggered) {
onceTriggered = true;
return true;
}
return false;
}
boolean isEnabled() {
return enabled;
}
unsigned long getTimeUntilTrigger() { return remaining(); }
unsigned long getDuration() { return enabled ? duration : disableReturn; }
unsigned long timeSinceLastReset() { return timeSinceReset(); }
void setDisableReturnValue(unsigned long disableReturnValue) {
disableReturn = disableReturnValue;
}
void enable() { enabled = true; }
void disable() { enabled = false; }
void negateState() { enabled = !enabled; }
void reset() { resetTimer(); }
private:
/*
* Private methods and variables used by the library, All calculations happen here.
*/
unsigned long zero = 0;
unsigned long duration = 0;
unsigned long startTime = 0;
unsigned long disableReturn = 0;
bool enabled = true;
bool onceTriggered = false;
void resetTimer() {
startTime = enabled ? millis() : startTime;
onceTriggered = enabled ? false : onceTriggered;
}
unsigned long remaining() { return enabled ? (startTime + duration) - millis() : disableReturn; }
unsigned long timeSinceReset() { return enabled ? (millis() - startTime) : disableReturn; }
bool hasTriggered() { return enabled ? ((millis() - startTime) >= duration) : false; }
boolean hasNotTriggered() { return enabled ? ((millis() - startTime) < duration) : false; }
};
#endif
|
8f3b6139be1c488d276272520f33b286342724d5 | bb4a53bf1b39d94d0c7afd9081ec73ce5d68e658 | /TREE_Diameter.cpp | 63b06a449cef6c9893b8ae54dc8d14e74f7e374d | [] | no_license | abhinav-kipper/Algo-DS | a3dd3a88fe076bfe66bdf2df05253758f0b6efe7 | cda01550b9bf5e4f69bea7f7bd8be74a7a4dcbf4 | refs/heads/master | 2022-02-13T17:11:14.535450 | 2022-01-25T07:15:24 | 2022-01-25T07:15:24 | 141,478,541 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 415 | cpp | TREE_Diameter.cpp | //geeks
int mxheight(Node * node)
{
if (!node) return 0;
return 1+max(mxheight(node->left),mxheight(node->right));
}
int diameter(Node* node)
{
if (!node) return 0;
int l_height=mxheight(node->left);
int r_height=mxheight(node->right);
int l_diameter=diameter(node->left);
int r_diameter=diameter(node->right);
return max(l_height+r_height+1,max(l_diameter,r_diameter));
}
|
98af4d49507e64a73d92fc4292fdc635d54b922b | 05d6200fc863173a29c84ec3f3c883fc70bcdc6a | /main.cpp | bfc7740e7d87249803397e5ada802f1c93614ca1 | [] | no_license | PierreLouis98/ECE_projet_c-- | 4c2aa8aada8eadfa7c13a7f74efcd4d59978d759 | 877e9563aec9c57875492a6c9562591a86e0cc6e | refs/heads/master | 2022-10-13T20:28:26.404485 | 2020-06-09T16:12:12 | 2020-06-09T16:12:12 | null | 0 | 0 | null | null | null | null | ISO-8859-1 | C++ | false | false | 1,547 | cpp | main.cpp | #include "grman/grman.h"
#include <iostream>
#include "graph.h"
int main()
{
/// A appeler en 1er avant d'instancier des objets graphiques etc...
/// Le nom du répertoire où se trouvent les images à charger
grman::set_pictures_path("pics");
/// Un exemple de graphe
Graph g;
int choix;
std::string choixsommet;
std::string choixarete;
std::cout << "quel graphe voulez vous ouvrir : 1, 2 ou 3 ?"<< std::endl;
std::cin>>choix;
switch (choix)
{
case 1:
choixsommet="sommetschaine_1.txt";
choixarete="areteschaine_1.txt";
break;
case 2:
choixsommet="sommetschaine_2.txt";
choixarete="areteschaine_2.txt";
break;
case 3:
choixsommet="sommetschaine_2.txt";
choixarete="areteschaine_2.txt";
break;
}
grman::init();
g.lecture_vertex(choixsommet);
g.lecture_edge(choixarete);
g.afficher_les_comp_fort_connexe();
/// Vous gardez la main sur la "boucle de jeu"
/// ( contrairement à des frameworks plus avancés )
while ( !key[KEY_ESC] )
{
/// Il faut appeler les méthodes d'update des objets qui comportent des widgets
g.update(choixsommet, choixarete);
/// Mise à jour générale (clavier/souris/buffer etc...)
grman::mettre_a_jour();
}
grman::fermer_allegro();
return 0;
}
END_OF_MAIN();
|
84a689719eaba0d84d38191b661ab826c56659b5 | 6ca8f9a932f25494401c8974b463078745fef963 | /Client/Header/Projectile.h | 834d8eb775e51192998a2c1c94be442af9a74f82 | [] | no_license | jang6556/DungeonDefenders | 29cca6047e828d8f2b5c77c0059cfbaace4d53bf | 526fe493b89ac4f8e883074f60a05a7b96fa0c43 | refs/heads/master | 2023-02-01T12:39:34.271291 | 2020-12-07T16:55:03 | 2020-12-07T16:55:03 | 319,384,221 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 889 | h | Projectile.h | #pragma once
#include "GameObject.h"
_BEGIN(Client)
class CProjectile :
public CGameObject
{
private:
CTransform* m_pParentsTransform = nullptr;
CTransform* m_pTransform = nullptr;
CShader* m_pShader = nullptr;
CMeshStatic* m_pMeshStatic = nullptr;
virtual HRESULT Initialize() override;
virtual HRESULT Initialize(void* pArg);
virtual HRESULT Initialize_Prototype() override;
HRESULT AddComponent();
explicit CProjectile(LPDIRECT3DDEVICE9 _m_pGraphicDev);
explicit CProjectile(const CProjectile & rhs);
virtual ~CProjectile() = default;
public:
virtual _int Progress(const _float& fTimeDelta) override;
virtual _int LateProgress(const _float& fTimeDelta) override;
virtual HRESULT Render() override;
virtual CGameObject* Clone(void* pArg = nullptr) override;
virtual void Free() override;
static CProjectile* Create(LPDIRECT3DDEVICE9 _m_pGraphicDev);
};
_END
|
3d1f59b24b916197590feb4e22b913689a585b97 | 66c45d0edaf4598a6b3acd24f73a1c600bfb72b0 | /projects/01/PlayListTester.h | f54a28c3e008ccdc295b93c46d61f0e39dd25df1 | [] | no_license | iangraham20/cs112 | 8b5b10248e4ce881d9261ce61a5b3034e087f606 | 8e4c2d46fe99290c5f159e1149ac4f705f6a0673 | refs/heads/master | 2020-03-30T14:10:39.209346 | 2018-10-02T18:38:46 | 2018-10-02T18:38:46 | 151,304,519 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 604 | h | PlayListTester.h | /* PlayListTester.h tests the PlayList class.
* Student Name: Ian G. Christensen (igc2)
* Date: February 12, 2017
* Begun by: Joel Adams, for CS 112 proj01 at Calvin College.
*/
#ifndef PLAYLISTTESTER_
#define PLAYLISTTESTER_
#include "PlayList.h"
class PlayListTester {
public:
void runTests();
void testConstructors();
void testSearchByArtist();
void testSearchByYear();
void testSearchByTitlePhrase();
void testAddSong();
void testRemoveSong();
void testSaveSong();
void testSave() const;
};
#endif /*PLAYLISTTESTER_*/
|
d8e1e83c45fa93733e79170a859eb8a4c7c1c152 | 63c71060f36866bca4ac27304cef6d5755fdc35c | /src/SeAdmin/Exe/main.cpp | 05a4459df5fae22a8a354a243d857ec891a95862 | [] | no_license | 15831944/barry_dev | bc8441cbfbd4b62fbb42bee3dcb79ff7f5fcaf8a | d4a83421458aa28ca293caa7a5567433e9358596 | refs/heads/master | 2022-03-24T07:00:26.810732 | 2015-12-22T07:19:58 | 2015-12-22T07:19:58 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,866 | cpp | main.cpp | ////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2005
// Packet Engineering, Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification is not permitted unless authorized in writing by a duly
// appointed officer of Packet Engineering, Inc. or its derivatives
//
// Description:
//
// Modification History:
// 01/03/2010: Created by Chen Ding
////////////////////////////////////////////////////////////////////////////
#include "Alarm/Alarm.h"
#include "Actions/ActAddAttr.h"
#include "AppMgr/App.h"
#include "DataStore/StoreMgr.h"
#include "Debug/Debug.h"
#include "IdGen/IdGenMgr.h"
#include "Porting/Sleep.h"
#include "Proggie/ReqDistr/ReqDistr.h"
#include "Query/QueryMgr.h"
#include "SEUtil/SeXmlParser.h"
#include "SEUtil/XmlTag.h"
#include "SEUtil/XmlDoc.h"
#include "SEUtilServer/CloudidSvr.h"
#include "SearchEngine/IIL.h"
#include "SearchEngine/IILMgr.h"
#include "SearchEngine/WordMgr.h"
#include "SiteMgr/SiteMgr.h"
#include "Util/OmnNew.h"
#include "SearchEngine/DocServer.h"
#include "SeAdmin/SeAdmin.h"
#include "WordParser/Ptrs.h"
#include "WordParser/WordParser.h"
#include "SEServer/ImgProc.h"
#include <stdlib.h>
int gAosLogLevel = 1;
#include <dirent.h>
int
main(int argc, char **argv)
{
//aos_global_data_init();
int index = 1;
OmnApp theApp(argc, argv);
u64 startdocid, enddocid;
OmnString siteid;
while (index < argc)
{
if (strcmp(argv[index], "-config") == 0)
{
// '-config fname'
OmnApp::setConfig(argv[index+1]);
index += 2;
continue;
}
if (strcmp(argv[index], "-addCloudid") == 0)
{
siteid = argv[index +1];
startdocid = atoll(argv[index+2]);
enddocid = atoll(argv[index+3]);
}
index++;
}
bool isRepairing = false;
AosIIL::staticInit(OmnApp::getAppConfig());
AosXmlDoc::staticInit(OmnApp::getAppConfig());
AosWordParser::init(OmnApp::getAppConfig());
try
{
theApp.startSingleton(OmnNew AosWordMgrSingleton());
theApp.startSingleton(OmnNew AosDocServerSingleton());
theApp.startSingleton(OmnNew AosIILMgrSingleton());
AosIILMgrSelf->start(OmnApp::getAppConfig());
OmnString dirname = OmnApp::getAppConfig()->getAttrStr(AOSCONFIG_DIRNAME);
OmnString logfname = OmnApp::getAppConfig()->getAttrStr("logfilename");
OmnString wordhashName = OmnApp::getAppConfig()->getAttrStr(AOSCONFIG_WORDID_HASHNAME);
u32 wordidTablesize = OmnApp::getAppConfig()->getAttrU64(AOSCONFIG_WORDID_TABLESIZE, 0);
AosWordMgrSelf->start(dirname, wordhashName, wordidTablesize);
AosDocServerSelf->setRepairing(isRepairing);
AosDocServerSelf->start(OmnApp::getAppConfig());
}
catch (const OmnExcept &e)
{
OmnAlarm << "Failed to start the application: " << e.toString() << enderr;
return 0;
}
for (u64 docid=startdocid; docid<enddocid; docid++)
{
OmnScreen <<"####### docid:" << docid <<endl;
if (docid == 58245)
OmnMark;
AosXmlTagPtr doc = AosDocServerSelf->getDoc(docid);
if (!doc) continue;
u64 creator = doc->getAttrU64(AOSTAG_CREATOR,AOS_INVDID);
if (creator == AOS_INVDID)
{
OmnAlarm << "Doc missing creator " << creator << " docid:"<< docid << enderr;
continue;
}
AosXmlTagPtr udoc = AosDocServerSelf->getDoc(creator);
if (udoc)
{
//creator 是userid 并是一条userAccount
if (udoc->getAttrStr(AOSTAG_OTYPE) == AOSOTYPE_USERACCT)
{
// The creator is the docid of the user's account doc. Need
// to change to cloud id.
OmnString cid = udoc->getAttrStr(AOSTAG_CLOUDID);
if (cid == "")
{
// The user account did not have a cloud id yet. Need to
// add one.
cid = AosCloudidSvr::getCloudid(creator);
aos_assert_r(cid!="", false);
AosDocServerSelf->modifyDoc(udoc, AOSTAG_CLOUDID, cid, false, true, true);
AosXmlTagPtr aa = AosDocServerSelf->getDoc(creator);
}
// Need to modify the creator
AosDocServerSelf->modifyDoc(doc, AOSTAG_CREATOR, cid, false, true, true);
}
else
{
// The retrieve is not a user account. This is an error.
OmnString type = udoc->getAttrStr(AOSTAG_OTYPE);
OmnAlarm << "Missing user Account!"<< " creator: "<< creator
<<" otype: "<< type << enderr;
continue;
}
}
else
{
// Did not retrieve a doc. It could be the case that 'creator'
// is a cloud id, not docid.
OmnString cid;
cid << creator;
udoc = AosDocServerSelf->getDocByCloudid(siteid, cid);
if (!udoc)
{
OmnAlarm <<"Missing cid!"<< enderr;
}
else
{
// 'creator' is a cloud id. Do nothing
if (udoc->getAttrStr(AOSTAG_OTYPE) == AOSOTYPE_USERACCT)
{
OmnString crtor ;
crtor << creator;
aos_assert_r(udoc->getAttrStr(AOSTAG_CLOUDID) == crtor, false);
}
else
{
OmnAlarm << "Missing user Account!"<< enderr;
return false;
}
}
}
}
return true;
}
|
9d7ca6e21cfcaf7d601d3e3fee4e8c1afdc2b2af | e32e47ec121d70d975bad723ca143efb0157e1fc | /Samples/Chapter 4/StringComparisons/main.cpp | b0837b6acc28f8e1e1be295bc8a2ed845819c5bf | [
"MIT"
] | permissive | Anil1111/COSC1436 | 02d781045fad38066e7f21c836566a52a53cacb4 | 33a607e51f2a51c70ab11a24945f3f06de50f7fc | refs/heads/master | 2020-03-30T18:33:22.439731 | 2017-08-15T01:05:01 | 2017-08-15T01:05:01 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,156 | cpp | main.cpp | /*
* Demonstrates string comparison.
*/
#include <iostream>
#include <string>
using namespace std;
void main ( )
{
#pragma region Char Way
char charOption;
cout << endl << "Using char ==" << endl;
cout << "Select an option: " << endl;
cout << "C)reate a new account" << endl;
cout << "D)elete an existing account" << endl;
cout << "U)pdate an existing account" << endl;
cin >> charOption;
if ((charOption = 'C') || (charOption = 'c'))
cout << "Creating an account" << endl;
else if ((charOption = 'D') || (charOption = 'd'))
cout << "Deleting an account" << endl;
else if ((charOption = 'U') || (charOption = 'u'))
cout << "Updating an account" << endl;
else
cout << "Unknown option" << endl;
#pragma endregion
#pragma region String Way
string stringOption;
cout << endl << "Using strcmp" << endl;
cout << "Select an option: " << endl;
cout << "C)reate a new account" << endl;
cout << "D)elete an existing account" << endl;
cout << "U)pdate an existing account" << endl;
cin >> stringOption;
if (stringOption == "C")
cout << "Creating an account" << endl;
else if (stringOption == "D")
cout << "Deleting an account" << endl;
else if (stringOption == "U")
cout << "Updating an account" << endl;
else
cout << "Unknown option" << endl;
#pragma endregion
#pragma region C-Style Way
char wrongOption[10];
cout << endl << "Using string == " << endl;
cout << "Select an option: " << endl;
cout << "C)reate a new account" << endl;
cout << "D)elete an existing account" << endl;
cout << "U)pdate an existing account" << endl;
cin >> wrongOption;
if (wrongOption == "C")
cout << "Creating an account" << endl;
else if (wrongOption == "D")
cout << "Deleting an account" << endl;
else if (wrongOption == "U")
cout << "Updating an account" << endl;
else
cout << "Unknown option" << endl;
#pragma endregion
#pragma region Wait
cout << endl << "Press ENTER to quit";
cin.ignore();
cin.get();
#pragma endregion
} |
561ee55a84b997fba04cf03936ea211436e39e75 | 60619a8daa4603fb65f4f86f383a6ddde841e326 | /2014-04-17/Iconst.cpp | 7950faa7c0d2bfe3ad6f6d9680e48e1203d22088 | [] | no_license | MYREarth/secret-weapon | f4b1d4b995951546b2fb1e40190707a805fb88b5 | 77f3ff1111aafaaae8f56893b78e3be9134437a9 | refs/heads/master | 2020-05-22T02:29:43.024017 | 2015-10-03T08:17:46 | 2015-10-03T08:17:46 | 186,199,326 | 3 | 0 | null | 2019-05-12T01:46:13 | 2019-05-12T01:46:13 | null | UTF-8 | C++ | false | false | 310 | cpp | Iconst.cpp | #include <cstdio>
const int RESULT[] = {1,1,2,5,14,43,140,474,1648,5839};
int main() {
freopen("immetric.in", "r", stdin);
freopen("immetric.out", "w", stdout);
int tests = 0, n;
while (scanf("%d", &n) == 1 && n) {
printf("Case #%d: %d\n", ++ tests, RESULT[n]);
}
return 0;
}
|
051f337ddea8a55d4bfbb7c59eddbde66a6baeb5 | a7eda48d34b9de96dab9fef2e3c2db5d1d58358e | /cppConSnippets/2015/cppInTheAudioIndustry/release_pool.hh | 2775686fba41f64e8df69dfc6d525f963c1f2d6f | [] | no_license | zclewell/CPP-Playground | f0626b351e346ec92c00bd692b862dbd2cc4e2c4 | 3da3ff06ca3749a6d9633a07f018e573471c3291 | refs/heads/master | 2023-05-01T01:20:59.284220 | 2021-05-16T23:27:07 | 2021-05-16T23:27:07 | 367,975,603 | 0 | 0 | null | 2021-05-16T23:27:08 | 2021-05-16T20:09:35 | C++ | UTF-8 | C++ | false | false | 768 | hh | release_pool.hh | #ifndef __RELEASE_POOL_HH__
#define __RELEASE_POOL_HH__
#include <unistd.h>
#include <mutex>
#include <algorithm>
#include "timed_thread.hh"
class ReleasePool : public TimedThread {
public:
ReleasePool(useconds_t timeout) : TimedThread(timeout) {
}
~ReleasePool() {
stop();
}
void add(std::shared_ptr<void> p) {
const std::lock_guard<std::mutex> lock(m_mutex);
m_vector.push_back(p);
}
protected:
void doSomething() override {
const std::lock_guard<std::mutex> lock(m_mutex);
m_vector.erase(std::remove_if(m_vector.begin(), m_vector.end(), [](std::shared_ptr<void> &p) { return p.use_count() <= 1; }), m_vector.end());
}
std::vector<std::shared_ptr<void> > m_vector;
std::mutex m_mutex;
};
#endif /* __RELEASE_POOL_HH__ */
|
e24e89e95203ecba950848aa5482c5d7db4edb9a | 39fcc0c3f6633bb26210d824e8ff87b110286ec7 | /proc/reader.h | 9ecb885b84aa9b6207cecdf2579f4543e626b741 | [] | no_license | dimak24/MIPT-industrial-programming | 557c7f2b742e7edb365cc70f835c125464f38b6a | 998e70bc9fef889b26c2b3f034e295282dd05d2c | refs/heads/master | 2020-03-29T07:43:33.587471 | 2019-01-06T15:16:25 | 2019-01-06T15:16:25 | 149,676,504 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 701 | h | reader.h | #pragma once
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <string.h>
#include "processor.h"
static std::pair<const char*, size_t> read_text(const char* filename) {
int fd = open(filename, O_RDONLY);
if (fd == -1)
PANIC();
struct stat s = {};
if (fstat(fd, &s) == -1)
PANIC();
size_t size = s.st_size;
char* text = new char [size];
for (size_t n_read = 0; n_read != size; ) {
ssize_t r = read(fd, text + n_read, size - n_read);
if (r == -1)
PANIC();
if (!r)
break;
n_read += r;
}
close(fd);
return {text, size};
}
|
e4f9917824003509cca9c2056cc809ff0e25cd8b | cd473056c7e351d4877a22d7830b9ee72b138556 | /src/cfdapi_update_witness_json.cpp | 7a8f5ae65f53088edfd2cd31958e31ea1bc7ee87 | [
"MIT"
] | permissive | cryptogarageinc/cg-cfd-js | a3ee599fcb7dd203ca53b4e8a4e77d655b4eba14 | 87fd4709aa1ed9ecd0debbbeca67eec708ab849d | refs/heads/master | 2023-03-08T18:46:39.718071 | 2023-03-02T00:16:26 | 2023-03-02T00:16:26 | 205,845,641 | 0 | 0 | MIT | 2023-03-02T00:16:27 | 2019-09-02T11:49:09 | C++ | UTF-8 | C++ | false | false | 7,968 | cpp | cfdapi_update_witness_json.cpp | // Copyright 2019 CryptoGarage
/**
* @file cfdapi_update_witness_json.cpp
*
* @brief JSONマッピングファイル (自動生成)
*/
#include <set>
#include <string>
#include <vector>
#include "cfdapi_update_witness_json.h" // NOLINT
namespace cfd {
namespace js {
namespace api {
namespace json {
using cfd::core::JsonClassBase;
using cfd::core::JsonObjectVector;
using cfd::core::JsonValueVector;
using cfd::core::JsonVector;
// clang-format off
// @formatter:off
// ------------------------------------------------------------------------
// WitnessStackData
// ------------------------------------------------------------------------
cfd::core::JsonTableMap<WitnessStackData>
WitnessStackData::json_mapper;
std::vector<std::string> WitnessStackData::item_list;
void WitnessStackData::CollectFieldName() {
if (!json_mapper.empty()) {
return;
}
cfd::core::CLASS_FUNCTION_TABLE<WitnessStackData> func_table; // NOLINT
func_table = {
WitnessStackData::GetIndexString,
WitnessStackData::SetIndexString,
WitnessStackData::GetIndexFieldType,
};
json_mapper.emplace("index", func_table);
item_list.push_back("index");
func_table = {
WitnessStackData::GetHexString,
WitnessStackData::SetHexString,
WitnessStackData::GetHexFieldType,
};
json_mapper.emplace("hex", func_table);
item_list.push_back("hex");
func_table = {
WitnessStackData::GetTypeString,
WitnessStackData::SetTypeString,
WitnessStackData::GetTypeFieldType,
};
json_mapper.emplace("type", func_table);
item_list.push_back("type");
func_table = {
WitnessStackData::GetDerEncodeString,
WitnessStackData::SetDerEncodeString,
WitnessStackData::GetDerEncodeFieldType,
};
json_mapper.emplace("derEncode", func_table);
item_list.push_back("derEncode");
func_table = {
WitnessStackData::GetSighashTypeString,
WitnessStackData::SetSighashTypeString,
WitnessStackData::GetSighashTypeFieldType,
};
json_mapper.emplace("sighashType", func_table);
item_list.push_back("sighashType");
func_table = {
WitnessStackData::GetSighashAnyoneCanPayString,
WitnessStackData::SetSighashAnyoneCanPayString,
WitnessStackData::GetSighashAnyoneCanPayFieldType,
};
json_mapper.emplace("sighashAnyoneCanPay", func_table);
item_list.push_back("sighashAnyoneCanPay");
}
void WitnessStackData::ConvertFromStruct(
const WitnessStackDataStruct& data) {
index_ = data.index;
hex_ = data.hex;
type_ = data.type;
der_encode_ = data.der_encode;
sighash_type_ = data.sighash_type;
sighash_anyone_can_pay_ = data.sighash_anyone_can_pay;
ignore_items = data.ignore_items;
}
WitnessStackDataStruct WitnessStackData::ConvertToStruct() const { // NOLINT
WitnessStackDataStruct result;
result.index = index_;
result.hex = hex_;
result.type = type_;
result.der_encode = der_encode_;
result.sighash_type = sighash_type_;
result.sighash_anyone_can_pay = sighash_anyone_can_pay_;
result.ignore_items = ignore_items;
return result;
}
// ------------------------------------------------------------------------
// UpdateWitnessStackTxInRequest
// ------------------------------------------------------------------------
cfd::core::JsonTableMap<UpdateWitnessStackTxInRequest>
UpdateWitnessStackTxInRequest::json_mapper;
std::vector<std::string> UpdateWitnessStackTxInRequest::item_list;
void UpdateWitnessStackTxInRequest::CollectFieldName() {
if (!json_mapper.empty()) {
return;
}
cfd::core::CLASS_FUNCTION_TABLE<UpdateWitnessStackTxInRequest> func_table; // NOLINT
func_table = {
UpdateWitnessStackTxInRequest::GetTxidString,
UpdateWitnessStackTxInRequest::SetTxidString,
UpdateWitnessStackTxInRequest::GetTxidFieldType,
};
json_mapper.emplace("txid", func_table);
item_list.push_back("txid");
func_table = {
UpdateWitnessStackTxInRequest::GetVoutString,
UpdateWitnessStackTxInRequest::SetVoutString,
UpdateWitnessStackTxInRequest::GetVoutFieldType,
};
json_mapper.emplace("vout", func_table);
item_list.push_back("vout");
func_table = {
UpdateWitnessStackTxInRequest::GetWitnessStackString,
UpdateWitnessStackTxInRequest::SetWitnessStackString,
UpdateWitnessStackTxInRequest::GetWitnessStackFieldType,
};
json_mapper.emplace("witnessStack", func_table);
item_list.push_back("witnessStack");
}
void UpdateWitnessStackTxInRequest::ConvertFromStruct(
const UpdateWitnessStackTxInRequestStruct& data) {
txid_ = data.txid;
vout_ = data.vout;
witness_stack_.ConvertFromStruct(data.witness_stack);
ignore_items = data.ignore_items;
}
UpdateWitnessStackTxInRequestStruct UpdateWitnessStackTxInRequest::ConvertToStruct() const { // NOLINT
UpdateWitnessStackTxInRequestStruct result;
result.txid = txid_;
result.vout = vout_;
result.witness_stack = witness_stack_.ConvertToStruct();
result.ignore_items = ignore_items;
return result;
}
// ------------------------------------------------------------------------
// UpdateWitnessStackRequest
// ------------------------------------------------------------------------
cfd::core::JsonTableMap<UpdateWitnessStackRequest>
UpdateWitnessStackRequest::json_mapper;
std::vector<std::string> UpdateWitnessStackRequest::item_list;
void UpdateWitnessStackRequest::CollectFieldName() {
if (!json_mapper.empty()) {
return;
}
cfd::core::CLASS_FUNCTION_TABLE<UpdateWitnessStackRequest> func_table; // NOLINT
func_table = {
UpdateWitnessStackRequest::GetTxString,
UpdateWitnessStackRequest::SetTxString,
UpdateWitnessStackRequest::GetTxFieldType,
};
json_mapper.emplace("tx", func_table);
item_list.push_back("tx");
func_table = {
UpdateWitnessStackRequest::GetIsElementsString,
UpdateWitnessStackRequest::SetIsElementsString,
UpdateWitnessStackRequest::GetIsElementsFieldType,
};
json_mapper.emplace("isElements", func_table);
item_list.push_back("isElements");
func_table = {
UpdateWitnessStackRequest::GetTxinString,
UpdateWitnessStackRequest::SetTxinString,
UpdateWitnessStackRequest::GetTxinFieldType,
};
json_mapper.emplace("txin", func_table);
item_list.push_back("txin");
}
void UpdateWitnessStackRequest::ConvertFromStruct(
const UpdateWitnessStackRequestStruct& data) {
tx_ = data.tx;
is_elements_ = data.is_elements;
txin_.ConvertFromStruct(data.txin);
ignore_items = data.ignore_items;
}
UpdateWitnessStackRequestStruct UpdateWitnessStackRequest::ConvertToStruct() const { // NOLINT
UpdateWitnessStackRequestStruct result;
result.tx = tx_;
result.is_elements = is_elements_;
result.txin = txin_.ConvertToStruct();
result.ignore_items = ignore_items;
return result;
}
// ------------------------------------------------------------------------
// UpdateWitnessStackResponse
// ------------------------------------------------------------------------
cfd::core::JsonTableMap<UpdateWitnessStackResponse>
UpdateWitnessStackResponse::json_mapper;
std::vector<std::string> UpdateWitnessStackResponse::item_list;
void UpdateWitnessStackResponse::CollectFieldName() {
if (!json_mapper.empty()) {
return;
}
cfd::core::CLASS_FUNCTION_TABLE<UpdateWitnessStackResponse> func_table; // NOLINT
func_table = {
UpdateWitnessStackResponse::GetHexString,
UpdateWitnessStackResponse::SetHexString,
UpdateWitnessStackResponse::GetHexFieldType,
};
json_mapper.emplace("hex", func_table);
item_list.push_back("hex");
}
void UpdateWitnessStackResponse::ConvertFromStruct(
const UpdateWitnessStackResponseStruct& data) {
hex_ = data.hex;
ignore_items = data.ignore_items;
}
UpdateWitnessStackResponseStruct UpdateWitnessStackResponse::ConvertToStruct() const { // NOLINT
UpdateWitnessStackResponseStruct result;
result.hex = hex_;
result.ignore_items = ignore_items;
return result;
}
// @formatter:on
// clang-format on
} // namespace json
} // namespace api
} // namespace js
} // namespace cfd
|
1932b3cfa717db16c291949983ac85e1d2271590 | afd2087e80478010d9df66e78280f75e1ff17d45 | /third_party/nvfuser/csrc/ir_cloner.h | 116f8074beaedc3b15330c4021621b04771e202a | [
"BSD-Source-Code",
"MIT",
"BSD-3-Clause",
"BSL-1.0",
"JSON",
"Apache-2.0",
"BSD-2-Clause",
"LicenseRef-scancode-secret-labs-2011",
"LicenseRef-scancode-generic-cla"
] | permissive | pytorch/pytorch | 7521ac50c47d18b916ae47a6592c4646c2cb69b5 | a6f7dd4707ac116c0f5fb5f44f42429f38d23ab4 | refs/heads/main | 2023-08-03T05:05:02.822937 | 2023-08-03T00:40:33 | 2023-08-03T04:14:52 | 65,600,975 | 77,092 | 24,610 | NOASSERTION | 2023-09-14T21:58:39 | 2016-08-13T05:26:41 | Python | UTF-8 | C++ | false | false | 3,832 | h | ir_cloner.h | #pragma once
#include <c10/macros/Export.h>
#include <dispatch.h>
#include <ir_builder.h>
#include <unordered_map>
#include <vector>
namespace torch {
namespace jit {
namespace fuser {
namespace cuda {
class IrContainer;
//! Clones nodes from an exiting Fusion
//!
//! \warning IrCloner machinery is a specialized helper for implementing
//! Fusion copy operations and the and limited scope of RecomputeTv below.
//! It is not intended for any other uses.
//!
class TORCH_CUDA_CU_API IrCloner : private OptInConstDispatch {
friend class Statement;
friend class IrBuilder;
public:
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init)
explicit IrCloner(IrContainer* container);
Statement* clone(const Statement* statement);
template <class T>
T* clone(const T* node) {
return node ? clone(node->template as<Statement>())->template as<T>()
: nullptr;
}
template <class T>
std::vector<T*> clone(const std::vector<T*>& container) {
// NOLINTNEXTLINE(cppcoreguidelines-init-variables)
std::vector<T*> copy;
copy.reserve(container.size());
for (auto p : container) {
copy.push_back(clone(p));
}
return copy;
}
IrContainer* container() const {
return ir_container_;
}
protected:
void registerClone(const Statement* src, Statement* clone);
void handle(const Statement*) override;
void handle(const Val*) override;
void handle(const Expr*) override;
void handle(const TensorDomain*) override;
void handle(const TensorView*) override;
void handle(const IterDomain*) override;
void handle(const Bool*) override;
void handle(const Double*) override;
void handle(const Int*) override;
void handle(const ComplexDouble*) override;
void handle(const NamedScalar*) override;
void handle(const FullOp*) override;
void handle(const ARangeOp*) override;
void handle(const EyeOp*) override;
void handle(const UnaryOp*) override;
void handle(const BinaryOp*) override;
void handle(const TernaryOp*) override;
void handle(const RNGOp*) override;
void handle(const BroadcastOp*) override;
void handle(const ReductionOp*) override;
void handle(const GroupedReductionOp*) override;
void handle(const WelfordOp*) override;
void handle(const LoadStoreOp*) override;
void handle(const MmaOp*) override;
void handle(const TransposeOp*) override;
void handle(const ExpandOp*) override;
void handle(const ShiftOp*) override;
void handle(const GatherOp*) override;
void handle(const ViewAsScalar*) override;
void handle(const ViewOp*) override;
void handle(const Split*) override;
void handle(const Merge*) override;
void handle(const Swizzle2D*) override;
protected:
// We keep track of the original -> clone map so we don't
// duplicate clones of the same object if referenced multiple times
std::unordered_map<const Statement*, Statement*> clones_map_;
private:
// The destination Fusion container
IrContainer* ir_container_ = nullptr;
// The dispatch interface doesn't allow returning values from
// individual `handle()` methods, so they are storing the
// result here
Statement* clone_ = nullptr;
// Builder to make all the new nodes
IrBuilder builder_;
};
// Replicates all expressions used to generate the provided TensorView. Does not
// replicate inputs. Does not replicate scalar values. In other words the value
// provided will be recomputed from the inputs of the fusion.
class RecomputeTv : private IrCloner {
public:
// Replicates expressions and values in provided expressions.
static TensorView* recompute(TensorView* tv);
private:
RecomputeTv(Fusion* fusion, std::vector<Expr*> exprs);
void handle(const TensorDomain*) final;
Fusion* fusion_;
};
} // namespace cuda
} // namespace fuser
} // namespace jit
} // namespace torch
|
d8946843950a0761046052d507d0bd2d92bab3c9 | 8ee0be0b14ec99858712a5c37df4116a52cb9801 | /Client/Interface/DLGs/SubClass/CUpgradeDlgStateResult.h | fbf21173085c9d179f03fb617d4ee12e3d280391 | [] | no_license | eRose-DatabaseCleaning/Sources-non-evo | 47968c0a4fd773d6ff8c9eb509ad19caf3f48d59 | 2b152f5dba3bce3c135d98504ebb7be5a6c0660e | refs/heads/master | 2021-01-13T14:31:36.871082 | 2019-05-24T14:46:41 | 2019-05-24T14:46:41 | 72,851,710 | 6 | 3 | null | 2016-11-14T23:30:24 | 2016-11-04T13:47:51 | C++ | UHC | C++ | false | false | 945 | h | CUpgradeDlgStateResult.h | #ifndef _CUpgradeDlgStateResult_
#define _CUpgradeDlgStateResult_
#include "cupgradedlgstate.h"
class CGuage;
class CUpgradeDlg;
/**
* 제련인터페이스 창의 State Class : 서버로부터 제련요청에 대한 응답을 받고 출력하는 상태
*
* @Author 최종진
* @Date 2005/9/15
*/
class CUpgradeDlgStateResult : public CUpgradeDlgState
{
public:
CUpgradeDlgStateResult( CUpgradeDlg* pParent );
virtual ~CUpgradeDlgStateResult(void);
virtual void Enter();
virtual void Leave();
virtual void Update( POINT ptMouse );
virtual void Draw();
virtual unsigned Process( unsigned uiMsg, WPARAM wParam, LPARAM lParam ){ return 1; }
virtual void MoveWindow( POINT ptMouse );
private:
CUpgradeDlg* m_pParent;
CGuage* m_pResultGuage;
DWORD m_dwPrevTime;
int m_iRedGuageImageID;
int m_iGreenGuageImageID;
int m_iVirtualSuccessPoint;
bool m_bWaitUserinput;
};
#endif |
fb3eea23db996baae66159ee847d4d1449392004 | 48f8d354c6d3f74bdcf52cda1ea0f9c127971418 | /rosplan/test/fwk/rosplan_dispatch_msgs/ActionDispatch.h | a3b7d37969020698d6b640dac36eb0b9b03b5924 | [] | no_license | mgou123/task-planning | 5f7144189bb5d3e0130f7e9e47f38b7d75374672 | b58193decf48cb290f3e5211381cd31849e30a5b | refs/heads/master | 2022-01-13T01:08:05.127015 | 2018-04-27T12:05:11 | 2018-04-27T12:05:11 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 363 | h | ActionDispatch.h |
#ifndef rosplan_action_dispatch
#define rosplan_action_dispatch
#include "diagnostic_msgs/KeyValue.h"
namespace rosplan_dispatch_msgs {
class ActionDispatch
{
public:
int action_id;
std::string name;
std::vector<diagnostic_msgs::KeyValue> parameters;
double duration;
double dispatch_time;
};
}
#endif
|
26135a28b42e062e492f2eb940e664d04d28b6a0 | 37b84200d4fa797a82b897f0ab95279472426fd7 | /qsort.cpp | 96fe2099e2641da40c658eb315a0631856132e6c | [] | no_license | zhezhituan/leetcode | e9b5e9dae06779e5e20b22152da46e13c49a4383 | 274bb0300096b1081ad15a4e100a33dc117574c9 | refs/heads/master | 2020-08-12T00:02:41.923478 | 2019-10-13T08:35:59 | 2019-10-13T08:35:59 | 214,652,408 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 1,186 | cpp | qsort.cpp | #include <iostream>
#include<stdlib.h>
#include<string>
using namespace std;
struct sheep
{
string name;
int weight;
};
int comparInt(const void * a, const void * b) {
return *(int*)a - *(int*)b;
}
int compareSheep(const void *a, const void* b) {
cout<< (*(sheep*)a).weight<<" "<< (*(sheep*)b).weight<<endl;
return (*(sheep*)a).weight - (*(sheep*)b).weight;
}
void creatSheeps(sheep* &sheeps,int num) {
for (int i = 0; i < num; i++) {
int weight = 0;
string name;
cout << "输入羊的名字" <<endl;
cin >> name;
cout << "输入羊的重量"<<endl;
cin >> weight;
sheeps[i].name = name;
sheeps[i].weight = weight;
}
}
int main() {
int a[5] = { 1,2,3,5,2 };
qsort(a, sizeof(a) / sizeof(a[0]), sizeof(a[0]), comparInt);
cout << a[0] << a[1] << a[2] << a[3] << a[4] << endl;
int num = 0;
cout << "输入羊的个数"<<endl;
cin >> num;
sheep* sheeps = new sheep[num];
creatSheeps(sheeps, num);
cout << sheeps[0].name << sheeps[1].name << sheeps[2].name << sheeps[3].weight << endl;
qsort(sheeps, num, sizeof(sheeps[0]), compareSheep);
cout << sheeps[0].weight << sheeps[1].weight << sheeps[2].weight << sheeps[3].weight<<endl;
system("pause");
} |
069c2cf6968d3815c860b410e3c6fa991cef8d7c | 1838307a41914ef70071981fdd1067eea3e87d5f | /Project/Custom Shell/src/shell/Terminal.h | 5c3b3049efb71f40f067440f073b12f5d55f1431 | [] | no_license | Salmon42/NDS8-2019-Group-820 | cd56bf0e5fcf59edbdba7956669d64d8fd1588d0 | 6e065c26a4b3f672093f8678d32e3755fbb98286 | refs/heads/master | 2023-03-18T08:52:33.365564 | 2019-08-13T12:02:21 | 2019-08-13T12:02:21 | 537,874,294 | 1 | 0 | null | 2022-09-17T16:58:57 | 2022-09-17T16:58:56 | null | UTF-8 | C++ | false | false | 1,302 | h | Terminal.h | ///
/// Custom Shell: the JumpShell
/// Made by Andrej, Pierre and Sebastian
///
#ifndef NDS_TERMINAL_H
#define NDS_TERMINAL_H
#include "../header.hpp"
#include <termios.h> // struct termios, tcgetattr(), tcsetattr()
#include <stdio.h> // perror(), stderr, stdin, fileno()
/// Terminal Mode
enum TMode {
SINGLECHAR = 0, /// using termios.h
STANDARD = 1 /// using std::cin
};
typedef struct {
bool valid; /// is this char valid?
char value; /// the content
} Character;
class Terminal {
private:
bool m_tdmap[256] = { false }; /// token delimiter map ; used for getInputLine
TMode m_mode; /// terminal mode
struct termios m_terminal {}; /// configuration for terminal behavior
struct termios m_restore {}; /// behavior before modification
std::streambuf *m_readbuffer; /// readbuffer used by singlechar mode
Character sc_getChar(); /// sc == single char mode
String sc_getLine();
String std_getLine(); /// std == standard mode
public:
Terminal();
~Terminal();
void enterSCMode();
void restoreTerminal();
StringVec getInputLine();
String joinLine(const StringVec& vector);
};
#endif //NDS_TERMINAL_H
|
faa3820682e937d781a0d0b55d4bb994521bdd4d | cb80a8562d90eb969272a7ff2cf52c1fa7aeb084 | /inletTest9/0.025/turbulenceProperties.L | 365f078a6fa1dc37954238600a8a4f6c56d6df7a | [] | no_license | mahoep/inletCFD | eb516145fad17408f018f51e32aa0604871eaa95 | 0df91e3fbfa60d5db9d52739e212ca6d3f0a28b2 | refs/heads/main | 2023-08-30T22:07:41.314690 | 2021-10-14T19:23:51 | 2021-10-14T19:23:51 | 314,657,843 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 141,043 | l | turbulenceProperties.L | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0.025";
object turbulenceProperties:L;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 0 0 0 0 0];
internalField nonuniform List<scalar>
12716
(
1999.99
1999.99
2000
2000
2000
2000
2000
2000
2000
1999.94
1999.75
1999.3
1998.62
1997.9
1997.25
1996.71
1996.28
1995.93
1995.62
1995.35
1995.09
1994.85
1994.61
1994.39
1994.19
1993.99
1993.81
1993.63
1993.47
1993.3
1993.13
1992.95
1992.74
1992.47
1992.08
1991.46
1990.41
1988.56
1985.25
1979.2
1968.1
1947.79
1910.97
1845.73
1734.99
1560.3
1314.33
1017.88
720.25
470.62
290.13
172.493
100.468
57.908
33.5144
20.5122
16.8843
11.8126
9.89772
9.71228
8.8726
4.23133
2.4274
1.53144
0.811265
0.341162
0.130506
0.0351022
0.00381939
0.000672655
4.6074e-05
4.38443e-05
0.000303742
0.00137124
0.000845577
0.000224027
4.19729e-05
4.07043e-05
0.000195875
0.000655508
0.00057531
0.000185434
4.03149e-05
3.99366e-05
0.000177563
0.000521348
0.000492248
0.000174202
3.97924e-05
3.9709e-05
0.000171011
0.000466016
0.000454126
0.000170116
3.96664e-05
3.96147e-05
0.000166995
0.000435644
0.000430232
0.000166854
3.95788e-05
3.95366e-05
0.000164248
0.000417207
0.000413647
0.000164332
3.95078e-05
3.94722e-05
0.000162007
0.000403454
0.000400875
0.000162138
3.94484e-05
3.94176e-05
0.000160069
0.000392302
0.000390358
0.000160111
3.9397e-05
3.93696e-05
0.000158265
0.000382849
0.00038135
0.000158241
3.93512e-05
3.93261e-05
0.000156562
0.000374604
0.00037343
0.000156507
3.93091e-05
3.92857e-05
0.000154962
0.000367291
0.000366338
0.000154892
3.92698e-05
3.92477e-05
0.000153455
0.000360715
0.000359925
0.00015338
3.92325e-05
3.92112e-05
0.000152031
0.000354734
0.000354071
0.00015196
3.91966e-05
3.91759e-05
0.000150685
0.000349236
0.000348681
0.000150622
3.91616e-05
3.91413e-05
0.000149411
0.000344148
0.000343683
0.000149359
3.91272e-05
3.91072e-05
0.000148202
0.00033941
0.000339019
0.000148163
3.90932e-05
3.90733e-05
0.000147051
0.000334963
0.000334641
0.000147026
3.90593e-05
3.90394e-05
0.000145954
0.000330761
0.000330509
0.000145941
3.90252e-05
3.90052e-05
0.000144903
0.000326791
0.0003266
0.000144905
3.89908e-05
3.89706e-05
0.000143897
0.000323028
0.00032289
0.000143913
3.89559e-05
3.89353e-05
0.000142932
0.000319448
0.000319354
0.000142961
3.89203e-05
3.88993e-05
0.000142003
0.000316026
0.000315968
0.000142044
3.88838e-05
3.88622e-05
0.000141104
0.00031274
0.00031271
0.000141157
3.88461e-05
3.88238e-05
0.000140233
0.000309571
0.000309562
0.000140297
3.88071e-05
3.8784e-05
0.000139385
0.0003065
0.000306508
0.000139459
3.87665e-05
3.87424e-05
0.000138557
0.000303515
0.000303535
0.000138643
3.8724e-05
3.86987e-05
0.000137746
0.000300601
0.00030063
0.000137843
3.86793e-05
3.86526e-05
0.00013695
0.000297747
0.000297779
0.000137056
3.8632e-05
3.86038e-05
0.000136163
0.000294938
0.000294969
0.000136278
3.85818e-05
3.85518e-05
0.000135381
0.00029216
0.000292183
0.000135505
3.85282e-05
3.84961e-05
0.0001346
0.000289398
0.000289408
0.000134732
3.84707e-05
3.84362e-05
0.000133816
0.000286639
0.000286632
0.000133958
3.84086e-05
3.83713e-05
0.000133028
0.000283872
0.000283846
0.000133181
3.83413e-05
3.83008e-05
0.000132235
0.00028109
0.000281043
0.000132401
3.8268e-05
3.82237e-05
0.000131435
0.000278285
0.000278214
0.000131607
3.81878e-05
3.81392e-05
0.000130624
0.000275448
0.00027535
0.000130807
3.80995e-05
3.8046e-05
0.000129804
0.000272573
0.000272449
0.000130001
3.80021e-05
3.79429e-05
0.000128977
0.000269657
0.000269509
0.000129189
3.78942e-05
3.78284e-05
0.000128143
0.000266703
0.000266536
0.000128378
3.77742e-05
3.77008e-05
0.00012731
0.000263719
0.00026354
0.000127574
3.76403e-05
3.75583e-05
0.000126488
0.000260721
0.000260545
0.000126791
3.74907e-05
3.73991e-05
0.000125692
0.00025774
0.000257629
0.00012605
3.73235e-05
3.72212e-05
0.000124959
0.000254837
0.000254853
0.00012538
3.7137e-05
3.70231e-05
0.000124335
0.000252081
0.00025227
0.000124824
3.69301e-05
3.68041e-05
0.000123847
0.00024955
0.000249996
0.000124434
3.67022e-05
3.65644e-05
0.000123558
0.000247374
0.000248091
0.000124276
3.64548e-05
3.63065e-05
0.000123536
0.000245686
0.000246829
0.00012443
3.61912e-05
3.60354e-05
0.000123871
0.000244721
0.000246411
0.000124983
3.59184e-05
3.57599e-05
0.000124647
0.000244659
0.000246999
0.000126015
3.56466e-05
3.54922e-05
0.000125932
0.000245671
0.000248754
0.000127574
3.53891e-05
3.5246e-05
0.000127753
0.000247894
0.000251742
0.000129668
3.51595e-05
3.50349e-05
0.000130096
0.000251458
0.000255981
0.000132244
3.49699e-05
3.48687e-05
0.000132852
0.000256234
0.000261338
0.000135165
3.4827e-05
3.47513e-05
0.000135844
0.000262033
0.000267537
0.000138256
3.47296e-05
3.46839e-05
0.00013883
0.000268623
0.000274132
0.000140967
3.46787e-05
3.46572e-05
0.000141115
0.000275252
0.000280722
0.000143084
3.46591e-05
3.46501e-05
0.000143004
0.000281815
0.000287165
0.000144816
3.46582e-05
3.46565e-05
0.000144569
0.00028802
0.000293099
0.000146202
3.4669e-05
3.46725e-05
0.000145801
0.000293616
0.000298316
0.000147213
3.46905e-05
3.46969e-05
0.000146709
0.000298473
0.000302754
0.000147874
3.47181e-05
3.47257e-05
0.000147287
0.000302551
0.000306427
0.000148241
3.47478e-05
3.47559e-05
0.000147594
0.000305899
0.000309408
0.000148379
3.4778e-05
3.47864e-05
0.000147697
0.000308632
0.000311795
0.000148338
3.4808e-05
3.48174e-05
0.000147639
0.000310852
0.000313627
0.00014815
3.48393e-05
3.48496e-05
0.000147462
0.000312551
0.000314989
0.000147856
3.48702e-05
3.48804e-05
0.000147179
0.000313798
0.000315934
0.0001475
3.48999e-05
3.49094e-05
0.000146843
0.00031467
0.000316534
0.000147099
3.49274e-05
3.49363e-05
0.000146464
0.00031525
0.000316901
0.000146674
3.49529e-05
3.49612e-05
0.000146059
0.000315597
0.000317068
0.000146252
3.49766e-05
3.49844e-05
0.000145645
0.000315767
0.000317055
0.00014582
3.49988e-05
3.50061e-05
0.000145217
0.000315758
0.000316882
0.000145378
3.50194e-05
3.50261e-05
0.000144768
0.00031558
0.000316568
0.000144928
3.50383e-05
3.50443e-05
0.000144319
0.00031524
0.000316132
0.000144478
3.50552e-05
3.50606e-05
0.000143872
0.000314756
0.000315612
0.000144028
3.50704e-05
3.5075e-05
0.000143421
0.000314154
0.000314979
0.000143574
3.50836e-05
3.50875e-05
0.000142964
0.00031345
0.000314244
0.000143112
3.50949e-05
3.5098e-05
0.000142499
0.000312665
0.00031342
0.000142641
3.51043e-05
3.51065e-05
0.000142024
0.000311788
0.000312503
0.000142161
3.51119e-05
3.51132e-05
0.000141535
0.0003108
0.00031155
0.000141682
3.51176e-05
3.51107e-05
0.00014104
0.000309751
0.000310382
0.000141087
3.51287e-05
3.50844e-05
0.000140522
0.000308479
0.000310173
0.000141094
3.52556e-05
3.53972e-05
0.000140803
0.000310551
0.000315279
0.000143257
3.60597e-05
3.63319e-05
0.000144685
0.000318916
0.000316652
0.000143828
3.67867e-05
3.72249e-05
0.00014861
0.000328171
0.000331427
0.000150426
3.80198e-05
0.0008202
0.00143511
0.00204881
0.00263629
0.00309843
0.00356512
0.00393485
0.00423437
0.00444328
0.00457318
0.00461921
0.00458136
0.00446368
0.00426189
0.00399485
0.00365031
0.00326731
0.00281917
0.00244144
0.00198807
0.00144043
0.00100474
0.000777551
0.000394377
0.000133096
6.66297e-05
1.93548e-05
1.23192e-05
6.06243e-05
0.000114811
4.41427e-05
1.90921e-05
6.46911e-06
8.6806e-06
4.03194e-05
9.13337e-05
8.42681e-05
3.66542e-05
9.59622e-06
9.677e-06
3.96466e-05
9.06821e-05
8.49949e-05
3.68734e-05
9.5397e-06
9.46097e-06
3.79813e-05
8.7072e-05
8.33204e-05
3.60996e-05
9.33449e-06
9.2624e-06
3.75038e-05
8.56679e-05
8.31061e-05
3.59931e-05
9.14354e-06
9.16996e-06
3.7169e-05
8.59614e-05
8.33688e-05
3.59067e-05
9.15931e-06
9.19348e-06
3.72817e-05
8.62844e-05
8.40071e-05
3.61568e-05
9.18176e-06
9.21629e-06
3.74272e-05
8.68096e-05
8.45017e-05
3.63032e-05
9.20581e-06
9.23899e-06
3.75785e-05
8.73302e-05
8.50238e-05
3.6445e-05
9.22834e-06
9.26309e-06
3.77351e-05
8.7893e-05
8.556e-05
3.65994e-05
9.25293e-06
9.28753e-06
3.78977e-05
8.84514e-05
8.61089e-05
3.67533e-05
9.27761e-06
9.31295e-06
3.80672e-05
8.90424e-05
8.6679e-05
3.69188e-05
9.30344e-06
9.33891e-06
3.8242e-05
8.96389e-05
8.72606e-05
3.70867e-05
9.32973e-06
9.36569e-06
3.84247e-05
9.02607e-05
8.78613e-05
3.72626e-05
9.35675e-06
9.39302e-06
3.86117e-05
9.08915e-05
8.8477e-05
3.74435e-05
9.3845e-06
9.42112e-06
3.88075e-05
9.15486e-05
8.91112e-05
3.76314e-05
9.41283e-06
9.44988e-06
3.90078e-05
9.2214e-05
8.97604e-05
3.78252e-05
9.442e-06
9.4794e-06
3.92174e-05
9.29061e-05
9.04291e-05
3.80265e-05
9.4718e-06
9.50967e-06
3.94322e-05
9.36075e-05
9.11135e-05
3.82342e-05
9.50247e-06
9.54072e-06
3.96565e-05
9.43371e-05
9.18186e-05
3.84496e-05
9.53382e-06
9.57256e-06
3.98862e-05
9.50761e-05
9.25394e-05
3.86711e-05
9.56605e-06
9.60524e-06
4.0127e-05
9.58442e-05
9.32822e-05
3.8901e-05
9.59904e-06
9.63882e-06
4.03746e-05
9.66224e-05
9.40409e-05
3.91382e-05
9.63303e-06
9.67335e-06
4.06324e-05
9.74296e-05
9.48213e-05
3.93839e-05
9.66789e-06
9.70882e-06
4.08967e-05
9.82452e-05
9.56158e-05
3.96367e-05
9.70373e-06
9.74521e-06
4.11708e-05
9.90894e-05
9.64325e-05
3.98978e-05
9.74044e-06
9.78258e-06
4.14518e-05
9.9943e-05
9.72644e-05
4.01663e-05
9.77823e-06
9.82103e-06
4.17427e-05
0.000100827
9.81194e-05
4.04429e-05
9.81706e-06
9.86062e-06
4.20394e-05
0.000101718
9.89862e-05
4.07255e-05
9.8571e-06
9.90139e-06
4.23441e-05
0.000102637
9.98756e-05
4.10144e-05
9.89816e-06
9.94326e-06
4.26527e-05
0.000103562
0.000100774
4.13076e-05
9.94043e-06
9.98633e-06
4.29666e-05
0.000104512
0.000101693
4.16039e-05
9.98389e-06
1.00307e-05
4.32801e-05
0.000105464
0.000102617
4.18997e-05
1.00287e-05
1.00762e-05
4.35927e-05
0.00010644
0.000103563
4.21922e-05
1.00747e-05
1.01232e-05
4.38971e-05
0.000107417
0.000104507
4.24757e-05
1.01223e-05
1.01719e-05
4.41889e-05
0.000108407
0.000105459
4.2743e-05
1.01717e-05
1.02229e-05
4.44582e-05
0.000109383
0.0001064
4.29851e-05
1.02241e-05
1.02779e-05
4.46996e-05
0.000110391
0.000107394
4.3194e-05
1.02815e-05
1.03403e-05
4.49144e-05
0.000111495
0.000108547
4.3386e-05
1.03487e-05
1.04163e-05
4.51565e-05
0.000112907
0.000110083
4.3639e-05
1.04359e-05
1.05137e-05
4.55679e-05
0.000114813
0.000112143
4.4162e-05
1.05419e-05
1.06121e-05
4.66421e-05
0.000118309
0.000115193
4.4847e-05
1.07322e-05
1.0807e-05
4.82642e-05
0.000121451
0.000118272
4.60814e-05
1.08005e-05
1.0958e-05
4.97709e-05
0.000125551
0.000121951
4.76463e-05
1.10527e-05
1.13046e-05
5.11783e-05
0.000128714
0.000126005
4.98925e-05
1.14123e-05
1.15685e-05
5.26886e-05
0.000133185
0.000130391
5.11779e-05
1.16746e-05
1.19172e-05
5.39237e-05
0.000137605
0.000135762
5.37874e-05
1.22377e-05
1.24753e-05
5.76859e-05
0.000143513
0.000141094
5.59381e-05
1.26737e-05
1.29217e-05
5.93132e-05
0.000147456
0.000145416
5.79247e-05
1.31326e-05
1.34713e-05
6.11123e-05
0.000151907
0.000150371
6.03098e-05
1.38096e-05
1.4275e-05
6.36898e-05
0.000155773
0.000152694
6.30126e-05
1.46358e-05
1.50345e-05
6.3793e-05
0.000155543
0.000150988
6.34528e-05
1.56117e-05
1.62789e-05
6.49663e-05
0.00015354
0.000148186
6.41571e-05
1.7363e-05
1.91556e-05
7.11162e-05
0.000150893
0.000143393
7.6724e-05
1.38825e-05
8.38949e-06
2.20762e-05
5.61449e-05
0.000127237
5.30324e-05
1.15143e-05
1.31347e-05
5.04165e-05
0.000123254
0.0001329
5.67409e-05
1.4393e-05
1.5506e-05
5.60925e-05
0.000135283
0.000162919
6.11804e-05
1.67134e-05
2.84632e-05
7.22893e-05
0.000261858
0.000363782
0.000168571
4.13541e-05
4.71165e-05
0.000165421
0.000388119
0.00046352
0.000222195
5.22141e-05
5.45227e-05
0.000239282
0.000490384
0.000471259
0.00022839
5.19052e-05
4.87087e-05
0.000182101
0.000365691
0.000444287
0.000201072
5.16466e-05
5.48262e-05
0.000220832
0.000462361
0.000487471
0.000231732
5.79049e-05
5.92405e-05
0.000238531
0.000505022
0.000501089
0.000240319
6.16497e-05
6.39516e-05
0.000273943
0.000581551
0.000596361
0.000288431
6.57098e-05
6.27176e-05
0.000293759
0.000610802
0.000491102
0.000247431
5.82111e-05
5.56614e-05
0.000248859
0.000500194
0.000467442
0.000237273
5.46522e-05
5.20187e-05
0.000241199
0.000475269
0.00038055
0.000205868
4.85355e-05
4.80705e-05
0.000211252
0.000404911
0.000446012
0.000228789
5.0052e-05
5.16857e-05
0.000242613
0.000480781
0.000476126
0.000247612
5.09864e-05
5.13932e-05
0.000240016
0.000441076
0.00052
0.000259297
5.33453e-05
5.77049e-05
0.000294709
0.00063198
0.000706293
0.000341718
5.79344e-05
6.18336e-05
0.000391824
0.000756203
0.000872272
0.000451381
6.5517e-05
7.1806e-05
0.000494779
0.000867289
0.000874333
0.000525918
7.3157e-05
8.01658e-05
0.000516161
0.000848321
0.000758866
0.000484217
7.39109e-05
6.64326e-05
0.000327356
0.000592939
0.000709868
0.000267216
5.97594e-05
4.78436e-05
0.000103168
0.000270943
0.000234366
8.60318e-05
4.63516e-05
4.25092e-05
7.33444e-05
0.000206953
0.000119639
6.14166e-05
4.18443e-05
4.08887e-05
6.2237e-05
0.000135085
0.000134096
6.1484e-05
4.186e-05
4.05808e-05
5.68593e-05
9.75991e-05
0.000120955
6.12113e-05
4.16464e-05
4.20245e-05
6.28276e-05
0.000116046
0.000109892
6.09106e-05
4.08255e-05
3.90088e-05
5.74556e-05
8.89973e-05
0.000113159
6.35759e-05
4.02724e-05
4.09576e-05
6.70666e-05
0.000112575
0.00011056
6.63002e-05
3.97395e-05
3.86124e-05
6.42839e-05
9.37927e-05
0.00012142
7.2708e-05
4.05051e-05
4.47779e-05
7.52635e-05
0.000115096
0.000174154
9.4087e-05
5.05448e-05
5.51967e-05
0.000104997
0.000195943
0.000204404
0.000111768
5.47905e-05
5.42167e-05
0.000109188
0.000175233
0.000232425
0.000127299
5.631e-05
5.81356e-05
0.000136864
0.000234935
0.000228622
0.000132601
5.45844e-05
5.14454e-05
0.000123396
0.000190125
0.000236332
0.000140093
5.24964e-05
5.49009e-05
0.00015017
0.000247174
0.000239665
0.000146589
5.23054e-05
4.74392e-05
0.000134821
0.000231864
0.000189224
0.000117741
4.29288e-05
4.36347e-05
0.00013724
0.000239437
0.0002305
0.000129275
4.30508e-05
3.59174e-05
0.000115738
0.000200303
0.000124781
4.60423e-05
2.14297e-05
1.60766e-05
5.82874e-05
0.000162056
0.000143914
5.59514e-05
2.06043e-05
1.75664e-05
4.90054e-05
0.000113549
0.000111451
4.84638e-05
1.45571e-05
1.01706e-05
2.39272e-05
5.55981e-05
0.000118606
7.16589e-05
1.56237e-05
2.07095e-05
7.10762e-05
0.000121415
0.00010736
5.31414e-05
1.78434e-05
1.42484e-05
4.89978e-05
0.000102489
4.81614e-05
2.20361e-05
9.75549e-06
1.44562e-05
6.61182e-05
0.000111103
0.000108038
5.79724e-05
1.90549e-05
1.54658e-05
5.15445e-05
0.000101935
4.83049e-05
2.25103e-05
1.06309e-05
1.52557e-05
6.67181e-05
0.000111566
0.000106211
5.65417e-05
1.97183e-05
1.57496e-05
4.88206e-05
9.7024e-05
4.5674e-05
2.19812e-05
1.08104e-05
1.52585e-05
6.16668e-05
0.000106632
0.000105213
5.86758e-05
1.99486e-05
1.7071e-05
4.4798e-05
9.08585e-05
8.77886e-05
4.29454e-05
1.39163e-05
9.80974e-06
1.93409e-05
4.07563e-05
9.67994e-05
5.55422e-05
1.41555e-05
1.86608e-05
5.04919e-05
9.22334e-05
8.36424e-05
4.32445e-05
1.48094e-05
1.00794e-05
1.91833e-05
3.91325e-05
9.07159e-05
5.24763e-05
1.39338e-05
1.82312e-05
4.62851e-05
8.44216e-05
7.95048e-05
4.1676e-05
1.45878e-05
1.02294e-05
1.88519e-05
3.82655e-05
9.07867e-05
5.26922e-05
1.43599e-05
1.88381e-05
4.80177e-05
8.6994e-05
7.92339e-05
4.16731e-05
1.49231e-05
1.02402e-05
1.83847e-05
3.72172e-05
8.47946e-05
4.92426e-05
1.3927e-05
1.83047e-05
4.42631e-05
7.92182e-05
7.43313e-05
3.97181e-05
1.46094e-05
1.02098e-05
1.81128e-05
3.59636e-05
8.35825e-05
4.89508e-05
1.40237e-05
1.85151e-05
4.52406e-05
8.0296e-05
7.31769e-05
3.84686e-05
1.47526e-05
1.00992e-05
1.75743e-05
3.47861e-05
7.79304e-05
4.61502e-05
1.33967e-05
1.69364e-05
4.43966e-05
7.74959e-05
3.87442e-05
2.04528e-05
1.17925e-05
1.55081e-05
5.15893e-05
8.63505e-05
8.06948e-05
4.64541e-05
1.99704e-05
1.57757e-05
3.98296e-05
7.21536e-05
3.55444e-05
1.83028e-05
1.0831e-05
1.45283e-05
4.71865e-05
7.81725e-05
7.52182e-05
4.36807e-05
1.90685e-05
1.52933e-05
3.84366e-05
6.93114e-05
3.41279e-05
1.74115e-05
1.05647e-05
1.36809e-05
4.35822e-05
7.10621e-05
6.93382e-05
4.13041e-05
1.69343e-05
1.16182e-05
1.92217e-05
3.53941e-05
7.42761e-05
4.60005e-05
1.48899e-05
1.91907e-05
4.18888e-05
6.982e-05
6.50814e-05
3.7376e-05
1.52064e-05
1.05737e-05
1.71127e-05
3.30841e-05
6.66586e-05
4.16255e-05
1.37273e-05
1.71061e-05
4.01508e-05
6.56291e-05
3.43715e-05
1.90532e-05
1.18421e-05
1.52254e-05
4.43924e-05
7.05343e-05
6.8007e-05
4.17253e-05
1.97797e-05
1.5811e-05
3.65653e-05
6.26809e-05
3.23176e-05
1.73738e-05
1.09355e-05
1.39309e-05
4.10476e-05
6.442e-05
6.33556e-05
3.9325e-05
1.7211e-05
1.18518e-05
1.88458e-05
3.35057e-05
6.71898e-05
4.28307e-05
1.4969e-05
1.92079e-05
3.94661e-05
6.34058e-05
5.89449e-05
3.47784e-05
1.51941e-05
1.05777e-05
1.69993e-05
3.06393e-05
5.90097e-05
3.85566e-05
1.3604e-05
1.69938e-05
3.68527e-05
5.81758e-05
3.20546e-05
1.87084e-05
1.17458e-05
1.48802e-05
4.07408e-05
6.15013e-05
5.99263e-05
3.85251e-05
1.93114e-05
1.52989e-05
3.32001e-05
5.5298e-05
2.88861e-05
1.66908e-05
1.05146e-05
1.33164e-05
3.66065e-05
5.4934e-05
5.4062e-05
3.49248e-05
1.6546e-05
1.13118e-05
1.78878e-05
2.98709e-05
5.6884e-05
3.85997e-05
1.40812e-05
1.73648e-05
3.63335e-05
5.53317e-05
3.08118e-05
1.86527e-05
1.18986e-05
1.46366e-05
3.91226e-05
5.66919e-05
5.48308e-05
3.61851e-05
1.79385e-05
1.23553e-05
1.92185e-05
3.13463e-05
5.81021e-05
3.95973e-05
1.52591e-05
1.947e-05
3.69768e-05
5.65999e-05
5.18753e-05
3.25876e-05
1.53625e-05
1.07072e-05
1.70103e-05
2.82851e-05
5.2233e-05
3.54696e-05
1.35626e-05
1.68343e-05
3.38662e-05
5.05443e-05
2.87746e-05
1.81268e-05
1.15936e-05
1.4183e-05
3.61896e-05
5.19135e-05
5.02531e-05
3.42765e-05
1.73569e-05
1.19524e-05
1.86089e-05
2.90566e-05
5.27963e-05
3.69905e-05
1.4697e-05
1.79493e-05
3.48843e-05
5.08031e-05
2.98779e-05
1.9278e-05
1.24484e-05
1.55937e-05
3.75366e-05
5.37867e-05
5.3497e-05
3.62728e-05
2.00407e-05
1.59226e-05
3.17154e-05
4.87918e-05
2.70654e-05
1.70986e-05
1.0988e-05
1.3657e-05
3.40429e-05
4.93212e-05
4.77577e-05
3.26505e-05
1.68997e-05
1.16301e-05
1.80337e-05
2.73744e-05
4.97453e-05
3.50513e-05
1.42203e-05
1.74785e-05
3.32984e-05
4.77955e-05
2.79138e-05
1.85652e-05
1.20613e-05
1.46656e-05
3.55056e-05
4.96583e-05
4.76911e-05
3.34643e-05
1.78685e-05
1.22851e-05
1.88687e-05
2.81004e-05
5.02951e-05
3.58463e-05
1.4904e-05
1.81544e-05
3.39987e-05
4.82494e-05
2.84844e-05
1.91923e-05
1.2546e-05
1.5192e-05
3.60808e-05
5.01083e-05
4.79474e-05
3.40085e-05
1.8447e-05
1.28057e-05
1.95444e-05
2.86822e-05
5.03763e-05
3.58259e-05
1.56636e-05
1.99117e-05
3.4479e-05
4.8917e-05
4.52538e-05
3.05417e-05
1.57148e-05
1.08373e-05
1.6853e-05
2.56198e-05
4.50463e-05
3.18085e-05
1.35406e-05
1.68014e-05
3.06919e-05
4.36925e-05
2.56961e-05
1.78361e-05
1.16049e-05
1.39981e-05
3.2239e-05
4.45378e-05
4.30044e-05
3.08259e-05
1.71339e-05
1.17733e-05
1.79883e-05
2.57963e-05
4.47371e-05
3.25674e-05
1.43072e-05
1.74787e-05
3.09961e-05
4.30498e-05
2.59001e-05
1.82987e-05
1.20096e-05
1.44226e-05
3.25647e-05
4.44826e-05
4.29567e-05
3.11471e-05
1.7604e-05
1.21845e-05
1.84617e-05
2.60968e-05
4.48785e-05
3.29226e-05
1.47309e-05
1.78893e-05
3.13205e-05
4.32214e-05
2.62783e-05
1.87399e-05
1.23445e-05
1.49108e-05
3.29855e-05
4.48662e-05
4.33673e-05
3.15144e-05
1.81173e-05
1.25821e-05
1.89677e-05
2.65409e-05
4.53871e-05
3.34563e-05
1.51444e-05
1.83245e-05
3.1847e-05
4.37169e-05
2.67533e-05
1.91592e-05
1.27304e-05
1.52462e-05
3.33975e-05
4.53197e-05
4.38403e-05
3.20246e-05
1.84949e-05
1.2964e-05
1.94701e-05
2.69984e-05
4.59991e-05
3.39929e-05
1.5676e-05
1.89577e-05
3.24404e-05
4.44064e-05
2.77276e-05
2.00515e-05
1.34029e-05
1.64595e-05
3.45612e-05
4.70733e-05
4.66069e-05
3.40895e-05
2.07625e-05
1.65139e-05
3.00585e-05
4.26384e-05
2.51994e-05
1.76367e-05
1.15046e-05
1.41773e-05
3.1074e-05
4.31104e-05
4.19416e-05
2.99529e-05
1.74079e-05
1.2139e-05
1.82167e-05
2.53673e-05
4.33716e-05
3.18468e-05
1.46558e-05
1.77498e-05
3.04905e-05
4.19615e-05
2.56647e-05
1.85883e-05
1.23238e-05
1.47967e-05
3.19921e-05
4.3176e-05
4.15964e-05
3.05481e-05
1.78829e-05
1.24537e-05
1.86994e-05
2.57013e-05
4.34241e-05
3.22391e-05
1.50145e-05
1.8121e-05
3.0903e-05
4.201e-05
2.60384e-05
1.89049e-05
1.26051e-05
1.51355e-05
3.23902e-05
4.35187e-05
4.19651e-05
3.09174e-05
1.82562e-05
1.26833e-05
1.89974e-05
2.60759e-05
4.38037e-05
3.25342e-05
1.52762e-05
1.84699e-05
3.11797e-05
4.23727e-05
2.64422e-05
1.92892e-05
1.29474e-05
1.55085e-05
3.283e-05
4.39139e-05
4.23574e-05
3.13767e-05
1.86299e-05
1.30359e-05
1.94429e-05
2.64919e-05
4.42443e-05
3.31043e-05
1.57161e-05
1.89308e-05
3.17297e-05
4.2825e-05
2.69298e-05
1.97104e-05
1.32718e-05
1.58864e-05
3.33287e-05
4.43931e-05
4.28574e-05
3.18798e-05
1.90696e-05
1.33861e-05
1.98658e-05
2.70483e-05
4.48672e-05
3.35619e-05
1.61447e-05
1.94948e-05
3.22906e-05
4.35169e-05
2.78768e-05
2.05058e-05
1.39046e-05
1.69884e-05
3.42141e-05
4.59468e-05
4.51077e-05
3.37581e-05
2.11843e-05
1.67412e-05
2.97772e-05
4.10599e-05
2.52141e-05
1.76196e-05
1.16677e-05
1.42983e-05
3.00365e-05
4.0937e-05
4.00785e-05
2.92263e-05
1.74831e-05
1.23791e-05
1.84722e-05
2.52709e-05
4.07054e-05
3.05907e-05
1.48718e-05
1.79077e-05
2.93174e-05
3.93767e-05
2.51703e-05
1.85089e-05
1.24894e-05
1.49877e-05
3.04644e-05
4.01793e-05
3.9127e-05
2.93796e-05
1.80786e-05
1.26863e-05
1.88501e-05
2.5222e-05
4.0517e-05
3.08367e-05
1.5247e-05
1.83177e-05
2.96398e-05
3.92576e-05
2.54434e-05
1.9037e-05
1.28685e-05
1.5427e-05
3.10026e-05
4.07539e-05
3.96924e-05
2.99946e-05
1.85109e-05
1.30978e-05
1.93398e-05
2.57491e-05
4.14935e-05
3.15877e-05
1.58434e-05
1.89819e-05
3.03381e-05
4.02789e-05
2.6203e-05
1.97087e-05
1.33948e-05
1.61241e-05
3.2009e-05
4.19984e-05
4.09511e-05
3.09838e-05
1.9367e-05
1.39535e-05
2.04563e-05
2.6996e-05
4.3879e-05
3.31484e-05
1.7185e-05
2.14052e-05
3.30703e-05
4.32172e-05
3.97874e-05
2.95109e-05
1.70958e-05
1.20611e-05
1.80676e-05
2.52603e-05
4.03363e-05
3.00892e-05
1.49859e-05
1.83301e-05
2.93266e-05
3.96275e-05
2.54846e-05
1.91415e-05
1.30714e-05
1.56754e-05
3.10327e-05
4.07241e-05
3.95227e-05
2.98573e-05
1.88052e-05
1.3324e-05
1.94737e-05
2.5731e-05
4.12897e-05
3.15636e-05
1.59801e-05
1.91312e-05
3.04235e-05
4.02382e-05
2.63825e-05
1.99433e-05
1.36395e-05
1.64088e-05
3.21556e-05
4.19027e-05
4.06781e-05
3.09977e-05
1.95325e-05
1.39857e-05
2.03856e-05
2.68904e-05
4.27547e-05
3.25026e-05
1.69788e-05
2.10565e-05
3.23135e-05
4.15718e-05
3.89335e-05
2.9178e-05
1.69667e-05
1.2206e-05
1.82477e-05
2.52762e-05
3.96975e-05
2.99061e-05
1.51378e-05
1.83411e-05
2.89918e-05
3.88785e-05
2.53651e-05
1.91185e-05
1.30732e-05
1.58278e-05
3.05954e-05
4.00051e-05
3.91887e-05
2.98197e-05
1.90408e-05
1.37508e-05
1.99819e-05
2.60979e-05
4.17613e-05
3.18204e-05
1.69339e-05
2.11519e-05
3.18961e-05
4.08738e-05
3.79444e-05
2.87746e-05
1.70766e-05
1.22424e-05
1.8094e-05
2.48697e-05
3.90577e-05
2.94114e-05
1.52046e-05
1.84549e-05
2.88005e-05
3.84255e-05
2.53349e-05
1.93427e-05
1.32609e-05
1.60128e-05
3.07593e-05
3.99148e-05
3.87478e-05
2.96055e-05
1.90822e-05
1.3586e-05
1.98196e-05
2.58572e-05
4.08093e-05
3.11844e-05
1.65363e-05
2.06564e-05
3.11204e-05
3.95864e-05
3.73266e-05
2.83364e-05
1.6767e-05
1.21782e-05
1.80534e-05
2.46708e-05
3.8444e-05
2.91553e-05
1.51261e-05
1.83318e-05
2.83892e-05
3.77293e-05
2.50598e-05
1.90942e-05
1.31591e-05
1.5938e-05
3.01846e-05
3.91573e-05
3.83831e-05
2.94497e-05
1.91896e-05
1.40185e-05
2.02397e-05
2.60535e-05
4.14526e-05
3.18226e-05
1.73205e-05
2.16007e-05
3.20068e-05
4.06145e-05
3.78677e-05
2.90494e-05
1.76227e-05
1.27974e-05
1.88703e-05
2.53498e-05
3.95404e-05
3.01447e-05
1.59977e-05
1.93576e-05
2.95435e-05
3.89365e-05
2.64268e-05
2.04105e-05
1.41937e-05
1.75665e-05
3.1975e-05
4.15133e-05
4.06986e-05
3.21275e-05
2.17268e-05
1.74536e-05
2.91656e-05
3.77476e-05
2.51432e-05
1.85877e-05
1.25859e-05
1.56615e-05
2.96519e-05
3.91706e-05
3.8781e-05
2.91915e-05
1.9155e-05
1.42097e-05
2.02959e-05
2.64327e-05
4.11393e-05
3.17677e-05
1.76847e-05
2.20094e-05
3.20977e-05
4.03838e-05
3.77609e-05
2.93134e-05
1.79794e-05
1.3139e-05
1.9292e-05
2.58321e-05
3.95576e-05
3.03345e-05
1.63793e-05
2.04908e-05
3.05153e-05
3.85453e-05
3.68677e-05
2.81975e-05
1.68419e-05
1.25523e-05
1.83196e-05
2.48855e-05
3.82084e-05
2.89881e-05
1.58387e-05
1.92118e-05
2.85316e-05
3.76941e-05
2.60011e-05
2.02744e-05
1.4208e-05
1.77322e-05
3.14049e-05
4.05067e-05
3.9905e-05
3.18809e-05
2.21713e-05
1.84051e-05
2.9514e-05
3.76675e-05
2.61127e-05
1.98518e-05
1.36419e-05
1.72986e-05
3.1388e-05
4.09898e-05
4.02849e-05
3.16936e-05
2.17328e-05
1.80938e-05
2.91476e-05
3.79562e-05
2.6102e-05
1.96594e-05
1.35188e-05
1.72641e-05
3.1032e-05
4.06306e-05
4.01052e-05
3.15623e-05
2.17595e-05
1.8271e-05
2.92584e-05
3.8223e-05
2.6485e-05
1.98075e-05
1.36949e-05
1.73463e-05
3.11963e-05
4.06499e-05
3.9986e-05
3.15308e-05
2.167e-05
1.80921e-05
2.90087e-05
3.78171e-05
2.61419e-05
1.96826e-05
1.36508e-05
1.74081e-05
3.09121e-05
4.04371e-05
3.96665e-05
3.08242e-05
2.19202e-05
1.92646e-05
2.94369e-05
3.73591e-05
3.69202e-05
2.78212e-05
1.64776e-05
1.26744e-05
1.85134e-05
2.56298e-05
3.88663e-05
2.94799e-05
1.64383e-05
2.09138e-05
2.98783e-05
3.81818e-05
3.65561e-05
2.77487e-05
1.77327e-05
1.3439e-05
1.92631e-05
2.5481e-05
3.94524e-05
3.01194e-05
1.73224e-05
2.21566e-05
3.02897e-05
3.91606e-05
3.7145e-05
2.88373e-05
1.98094e-05
1.68709e-05
2.81272e-05
3.66656e-05
2.52909e-05
1.88253e-05
1.31582e-05
1.74733e-05
3.00228e-05
4.00542e-05
3.99707e-05
3.01652e-05
2.2474e-05
2.0001e-05
2.92703e-05
3.74946e-05
3.66306e-05
2.75744e-05
1.69947e-05
1.30898e-05
1.9028e-05
2.5497e-05
3.98269e-05
3.00146e-05
1.69056e-05
2.16218e-05
2.98018e-05
3.90186e-05
3.80348e-05
2.92248e-05
1.97756e-05
1.82e-05
2.71765e-05
3.66207e-05
3.70518e-05
2.64309e-05
1.64052e-05
1.30989e-05
1.8888e-05
2.56039e-05
4.05889e-05
3.02419e-05
1.7592e-05
2.29817e-05
3.03954e-05
4.05107e-05
3.98827e-05
3.00974e-05
2.17191e-05
2.03758e-05
2.87679e-05
3.87626e-05
3.89541e-05
2.82245e-05
1.90652e-05
1.76667e-05
2.60154e-05
3.63006e-05
3.64715e-05
2.49708e-05
1.59794e-05
1.28895e-05
1.80685e-05
2.46284e-05
3.94413e-05
2.92158e-05
1.72077e-05
2.19949e-05
2.92945e-05
3.93592e-05
3.79001e-05
2.84401e-05
2.04686e-05
1.98642e-05
2.81401e-05
3.78942e-05
3.78421e-05
2.76045e-05
1.92938e-05
1.89118e-05
2.66744e-05
3.80393e-05
3.74996e-05
2.60691e-05
1.88393e-05
1.86961e-05
2.58882e-05
3.80615e-05
3.73082e-05
2.5853e-05
1.86143e-05
1.86849e-05
2.61151e-05
3.7529e-05
3.72285e-05
2.67861e-05
1.86816e-05
1.86535e-05
2.74878e-05
3.75109e-05
3.75929e-05
2.83919e-05
1.86138e-05
1.85688e-05
2.93083e-05
3.79479e-05
3.83148e-05
3.02119e-05
1.85261e-05
1.8481e-05
3.08897e-05
3.87323e-05
3.9249e-05
3.16155e-05
1.84394e-05
1.8397e-05
3.21831e-05
3.9729e-05
4.03798e-05
3.26676e-05
1.83581e-05
1.83205e-05
3.33556e-05
4.09165e-05
4.17762e-05
3.35541e-05
1.82853e-05
1.82532e-05
3.43045e-05
4.24043e-05
4.35489e-05
3.43413e-05
1.82224e-05
1.81953e-05
3.51072e-05
4.42381e-05
4.55366e-05
3.51428e-05
1.81689e-05
1.81469e-05
3.5932e-05
4.63106e-05
4.76645e-05
3.59563e-05
1.81244e-05
1.81086e-05
3.67917e-05
4.85881e-05
4.99989e-05
3.68109e-05
1.80895e-05
1.808e-05
3.76581e-05
5.10559e-05
5.24943e-05
3.76689e-05
1.8064e-05
1.80595e-05
3.85643e-05
5.35969e-05
5.48939e-05
3.85741e-05
1.80466e-05
1.80451e-05
3.94914e-05
5.59389e-05
5.7086e-05
3.94856e-05
1.80356e-05
1.80361e-05
4.04368e-05
5.80885e-05
5.90737e-05
4.04176e-05
1.80295e-05
1.80314e-05
4.13515e-05
6.0016e-05
6.08786e-05
4.13049e-05
1.80272e-05
1.80298e-05
4.22446e-05
6.17977e-05
6.25223e-05
4.21792e-05
1.80272e-05
1.80303e-05
4.30811e-05
6.34033e-05
6.4033e-05
4.29835e-05
1.80288e-05
1.80323e-05
4.38796e-05
6.49201e-05
6.54234e-05
4.37578e-05
1.80312e-05
1.80355e-05
4.46085e-05
6.63019e-05
6.67049e-05
4.44434e-05
1.80345e-05
1.80392e-05
4.52846e-05
6.75861e-05
6.78902e-05
4.50943e-05
1.80383e-05
1.80431e-05
4.5883e-05
6.87619e-05
6.89868e-05
4.56612e-05
1.80423e-05
1.80472e-05
4.64395e-05
6.98649e-05
7.00068e-05
4.61984e-05
1.80464e-05
1.80514e-05
4.69248e-05
7.0875e-05
7.09545e-05
4.66516e-05
1.80506e-05
1.80557e-05
4.73753e-05
7.18338e-05
7.18438e-05
4.70897e-05
1.80549e-05
1.80598e-05
4.77637e-05
7.27156e-05
7.26777e-05
4.74499e-05
1.80591e-05
1.80639e-05
4.81255e-05
7.35606e-05
7.34647e-05
4.78015e-05
1.80632e-05
1.80679e-05
4.84324e-05
7.43399e-05
7.42082e-05
4.80822e-05
1.80672e-05
1.80718e-05
4.8722e-05
7.50993e-05
7.4918e-05
4.83681e-05
1.8071e-05
1.80756e-05
4.89671e-05
7.58032e-05
7.55877e-05
4.85863e-05
1.80748e-05
1.80795e-05
4.92026e-05
7.65071e-05
7.62566e-05
4.88244e-05
1.80788e-05
1.80831e-05
4.94138e-05
7.71533e-05
7.68823e-05
4.90037e-05
1.80824e-05
1.80867e-05
4.96077e-05
7.77986e-05
7.74884e-05
4.91941e-05
1.8086e-05
1.80902e-05
4.97749e-05
7.8398e-05
7.80727e-05
4.93363e-05
1.80894e-05
1.80936e-05
4.99354e-05
7.89974e-05
7.86377e-05
4.94967e-05
1.80928e-05
1.8097e-05
5.00731e-05
7.95535e-05
7.91886e-05
4.96128e-05
1.80962e-05
1.81002e-05
5.02112e-05
8.01108e-05
7.97065e-05
4.97504e-05
1.80994e-05
1.81033e-05
5.03255e-05
8.06166e-05
8.02014e-05
4.98434e-05
1.81025e-05
1.81064e-05
5.04384e-05
8.11197e-05
8.06688e-05
4.996e-05
1.81056e-05
1.81095e-05
5.05332e-05
8.15719e-05
8.11129e-05
5.00342e-05
1.81087e-05
1.81125e-05
5.0629e-05
8.20154e-05
8.15169e-05
5.01334e-05
1.81116e-05
1.81153e-05
5.07046e-05
8.24008e-05
8.18992e-05
5.01891e-05
1.81144e-05
1.81179e-05
5.07813e-05
8.27925e-05
8.22555e-05
5.0271e-05
1.81171e-05
1.81205e-05
5.0839e-05
8.31211e-05
8.25843e-05
5.03097e-05
1.81196e-05
1.81229e-05
5.08994e-05
8.34729e-05
8.28914e-05
5.03758e-05
1.8122e-05
1.81251e-05
5.09409e-05
8.37437e-05
8.31648e-05
5.03978e-05
1.81242e-05
1.81271e-05
5.09843e-05
8.40427e-05
8.34183e-05
5.04467e-05
1.81262e-05
1.8129e-05
5.10089e-05
8.42611e-05
8.36448e-05
5.04529e-05
1.8128e-05
1.81307e-05
5.1038e-05
8.45178e-05
8.38598e-05
5.0489e-05
1.81297e-05
1.81323e-05
5.10506e-05
8.46992e-05
8.40523e-05
5.04849e-05
1.81313e-05
1.81337e-05
5.10706e-05
8.49234e-05
8.42385e-05
5.05143e-05
1.81327e-05
1.81351e-05
5.10772e-05
8.50791e-05
8.44104e-05
5.05061e-05
1.8134e-05
1.81364e-05
5.10931e-05
8.52844e-05
8.45771e-05
5.05318e-05
1.81353e-05
1.81376e-05
5.10951e-05
8.54172e-05
8.47246e-05
5.05191e-05
1.81365e-05
1.81386e-05
5.11059e-05
8.55965e-05
8.48651e-05
5.05401e-05
1.81375e-05
1.81396e-05
5.11028e-05
8.57022e-05
8.49865e-05
5.05227e-05
1.81385e-05
1.81405e-05
5.11091e-05
8.58555e-05
8.51027e-05
5.05397e-05
1.81393e-05
1.81412e-05
5.11023e-05
8.59386e-05
8.52056e-05
5.05191e-05
1.81401e-05
1.81419e-05
5.11062e-05
8.60765e-05
8.53086e-05
5.05341e-05
1.81408e-05
1.81426e-05
5.10975e-05
8.61462e-05
8.5398e-05
5.0512e-05
1.81414e-05
1.81432e-05
5.11e-05
8.62696e-05
8.54868e-05
5.0526e-05
1.81421e-05
1.81438e-05
5.10906e-05
8.6326e-05
8.55665e-05
5.05037e-05
1.81426e-05
1.81444e-05
5.1093e-05
8.64424e-05
8.565e-05
5.05176e-05
1.81432e-05
1.81449e-05
5.10832e-05
8.6493e-05
8.57221e-05
5.04947e-05
1.81437e-05
1.81454e-05
5.10846e-05
8.65983e-05
8.57912e-05
5.05077e-05
1.81442e-05
1.81458e-05
5.10738e-05
8.66316e-05
8.58473e-05
5.04842e-05
1.81446e-05
1.81463e-05
5.1075e-05
8.67238e-05
8.59087e-05
5.04974e-05
1.8145e-05
1.81466e-05
5.10646e-05
8.67546e-05
8.59662e-05
5.04743e-05
1.81454e-05
1.8147e-05
5.10658e-05
8.68486e-05
8.60253e-05
5.04871e-05
1.81457e-05
1.81473e-05
5.10543e-05
8.68701e-05
8.6067e-05
5.04627e-05
1.81461e-05
1.81476e-05
5.10545e-05
8.69439e-05
8.61079e-05
5.0475e-05
1.81464e-05
1.81479e-05
5.10433e-05
8.69532e-05
8.61484e-05
5.04519e-05
1.81466e-05
1.81481e-05
5.10451e-05
8.70355e-05
8.62017e-05
5.04656e-05
1.81468e-05
1.81483e-05
5.10345e-05
8.70546e-05
8.62419e-05
5.04422e-05
1.81471e-05
1.81485e-05
5.10352e-05
8.7124e-05
8.62731e-05
5.04547e-05
1.81472e-05
1.81487e-05
5.10239e-05
8.71177e-05
8.62956e-05
5.04316e-05
1.81474e-05
1.81489e-05
5.10261e-05
8.71817e-05
8.63352e-05
5.04464e-05
1.81476e-05
1.8149e-05
5.10172e-05
8.71927e-05
8.63747e-05
5.04252e-05
1.81477e-05
1.81492e-05
5.10201e-05
8.72667e-05
8.64117e-05
5.04397e-05
1.81479e-05
1.81493e-05
5.10101e-05
8.72635e-05
8.64315e-05
5.04174e-05
1.8148e-05
1.81494e-05
5.10125e-05
8.73176e-05
8.6455e-05
5.04321e-05
1.81482e-05
1.81496e-05
5.10036e-05
8.73089e-05
8.64782e-05
5.04116e-05
1.81483e-05
1.81497e-05
5.10081e-05
8.73734e-05
8.65161e-05
5.04284e-05
1.81485e-05
1.81499e-05
5.10008e-05
8.738e-05
8.65499e-05
5.04083e-05
1.81486e-05
1.815e-05
5.10044e-05
8.74458e-05
8.65754e-05
5.04231e-05
1.81488e-05
1.81502e-05
5.09944e-05
8.74264e-05
8.65782e-05
5.0401e-05
1.81489e-05
1.81504e-05
5.09976e-05
8.74666e-05
8.65975e-05
5.04173e-05
1.81491e-05
1.81505e-05
5.09907e-05
8.74653e-05
8.66369e-05
5.03984e-05
1.81493e-05
1.81506e-05
5.09956e-05
8.75453e-05
8.66758e-05
5.04138e-05
1.81494e-05
1.81508e-05
5.09853e-05
8.7531e-05
8.66707e-05
5.03907e-05
1.81495e-05
1.81509e-05
5.09871e-05
8.75522e-05
8.66681e-05
5.04065e-05
1.81497e-05
1.81511e-05
5.0981e-05
8.75339e-05
8.67034e-05
5.039e-05
1.81499e-05
1.81513e-05
5.09893e-05
8.76229e-05
8.67598e-05
5.04092e-05
1.815e-05
1.81515e-05
5.09823e-05
8.76273e-05
8.67663e-05
5.03889e-05
1.81503e-05
1.81517e-05
5.09864e-05
8.76501e-05
8.67562e-05
5.0407e-05
1.81506e-05
1.81521e-05
5.09831e-05
8.7621e-05
8.67852e-05
5.03944e-05
1.8151e-05
1.81526e-05
5.09965e-05
8.77127e-05
8.68547e-05
5.0419e-05
1.81515e-05
1.81532e-05
5.09843e-05
8.77219e-05
8.69018e-05
5.03999e-05
1.81521e-05
1.81653e-05
5.10279e-05
8.77782e-05
8.69159e-05
5.04194e-05
1.8175e-05
1.81929e-05
5.10823e-05
8.79587e-05
8.7122e-05
5.07797e-05
1.82706e-05
1.84134e-05
5.15488e-05
8.87183e-05
9.06662e-05
5.24285e-05
1.88086e-05
1.953e-05
5.32811e-05
9.24254e-05
0.000102601
5.8198e-05
2.11069e-05
2.29486e-05
6.16189e-05
0.000108843
0.000120827
6.87848e-05
2.4795e-05
0.000225228
0.000404792
0.000605994
0.00100178
0.00167427
0.00201749
0.00279874
0.00471062
0.00612053
0.0081744
0.0107875
0.0141325
0.0183841
0.0236828
0.030151
0.0378527
0.0468039
0.0569543
0.0681925
0.0803354
0.0931653
0.10637
0.119684
0.132567
0.144705
0.155233
0.163855
0.170028
0.173864
0.175668
0.176763
0.178787
0.181705
0.185446
0.18987
0.194903
0.200431
0.206457
0.212989
0.22008
0.227803
0.23625
0.245537
0.25581
0.267254
0.280112
0.294703
0.31147
0.331039
0.354352
0.385814
0.440366
0.546671
0.741603
1.07989
1.65812
2.6634
4.47426
7.86207
14.3349
26.4008
45.8156
70.5635
93.8905
110.482
120.39
125.961
129.605
132.299
134.484
136.389
138.145
139.839
141.533
143.273
145.096
147.035
149.116
151.365
153.806
156.46
159.348
162.49
165.904
169.61
173.622
177.958
182.633
187.661
193.057
198.832
205
211.572
218.56
225.974
233.826
242.124
250.877
260.096
269.789
279.962
290.624
301.782
313.441
325.607
338.284
351.478
365.19
379.424
394.18
409.459
425.259
441.579
458.415
475.763
493.617
511.971
530.816
550.144
569.943
590.202
610.907
632.046
653.603
675.561
697.905
720.616
743.676
767.065
790.765
814.755
839.014
863.522
888.258
913.201
938.329
963.622
989.059
1014.62
1040.28
1066.03
1091.83
1117.68
1143.56
1169.44
1195.3
1221.14
1246.93
1272.65
1298.28
1323.81
1349.22
1374.49
1399.6
1424.52
1449.23
1473.71
1497.93
1521.85
1545.46
1568.71
1591.58
1614.02
1636.01
1657.51
1678.5
1698.94
1718.81
1738.08
1756.73
1774.75
1792.11
1808.82
1824.86
1840.23
1854.92
1868.93
1882.26
1894.92
1906.89
1918.19
1928.8
1938.74
1947.98
1956.54
1964.37
1971.45
1977.73
1983.15
1987.67
1991.26
1993.99
1996.02
1997.58
1998.81
1999.63
1999.94
1999.95
1999.94
1999.94
1999.92
1999.88
1999.65
1999.05
1997.85
1995.93
1993.4
1990.6
1987.95
1985.66
1983.74
1982.08
1980.6
1979.24
1977.95
1976.72
1975.55
1974.44
1973.37
1972.37
1971.4
1970.47
1969.54
1968.58
1967.5
1966.19
1964.42
1961.79
1957.58
1950.49
1938.21
1916.64
1878.84
1813.69
1705.56
1537.65
1302.8
1018.54
729.05
481.457
299.111
178.758
104.706
60.8875
35.4118
20.6542
12.0769
7.07236
4.1648
2.51052
1.60768
1.14177
0.921322
0.810985
0.706457
0.506601
0.266843
0.0984449
0.0212361
0.00869211
0.00274902
0.00228944
0.00205607
0.00183536
0.00173107
0.00159304
0.00153444
0.00143932
0.00140219
0.00133202
0.00130579
0.00125195
0.00123235
0.00118933
0.00117414
0.00113861
0.00112651
0.00109635
0.00108652
0.00106038
0.00105225
0.00102922
0.00102234
0.00100182
0.000995912
0.000977404
0.000972264
0.000955388
0.000950872
0.000935338
0.000931334
0.000916921
0.000913345
0.000899888
0.000896674
0.00088404
0.000881131
0.000869201
0.000866545
0.000855213
0.000852764
0.00084194
0.000839656
0.000829276
0.000827113
0.000817098
0.000815035
0.00080533
0.000803347
0.000793901
0.000791979
0.000782739
0.000780857
0.000771771
0.000769909
0.000760926
0.000759064
0.000750149
0.00074826
0.000739379
0.00073744
0.000728553
0.000726548
0.000717628
0.000715542
0.000706562
0.000704382
0.000695317
0.000693031
0.00068386
0.000681459
0.00067217
0.000669651
0.000660238
0.000657603
0.000648074
0.000645334
0.000635713
0.00063289
0.000623222
0.000620359
0.000610727
0.000607893
0.000598415
0.000595684
0.000586502
0.000583979
0.000575349
0.000573126
0.000565423
0.000563556
0.000557044
0.000555803
0.000550051
0.000550291
0.000545456
0.000547433
0.000543654
0.000547576
0.000544955
0.000550984
0.000549567
0.000557606
0.000557324
0.000567131
0.000567832
0.000579075
0.000580529
0.000592668
0.000594516
0.000607083
0.000609108
0.000621837
0.000623859
0.000636479
0.000638366
0.000650646
0.000652314
0.000664095
0.000665501
0.000676725
0.000677865
0.000688451
0.000689308
0.000699231
0.00069979
0.000708985
0.000709231
0.000717731
0.000717689
0.000725541
0.000725227
0.000732454
0.00073187
0.000738509
0.000737666
0.000743761
0.000742663
0.00074825
0.000746904
0.000752017
0.00075043
0.000755109
0.000753286
0.000757569
0.000755512
0.00075943
0.00075715
0.000760734
0.000758239
0.000761522
0.000758821
0.000761801
0.000758966
0.000761674
0.000758659
0.000761028
0.000755961
0.000762794
0.000759818
0.000771233
0.000779411
0.000784945
0.0007899
0.00140671
0.00203427
0.00201687
0.00139069
0.00138325
0.00199475
0.00193464
0.00135885
0.00132157
0.00183489
0.00279682
0.00266153
0.00264941
0.00264308
0.00308759
0.00306614
0.00302939
0.00360668
0.00358901
0.003575
0.00393786
0.00393961
0.00392913
0.00379721
0.00375117
0.00276769
0.00194489
0.00134334
0.00131845
0.00182724
0.00193612
0.00133802
0.00131757
0.00182501
0.00276146
0.00275671
0.00193222
0.00133633
0.00131555
0.00182159
0.00192777
0.00133377
0.00131309
0.00181697
0.0027533
0.00274673
0.00192235
0.00133068
0.00130943
0.00181102
0.00191558
0.00132657
0.00130472
0.00180358
0.00273955
0.0027298
0.00190723
0.00132139
0.00129887
0.00179464
0.00189726
0.00131504
0.00129183
0.00178404
0.00271828
0.00270421
0.00188554
0.00130747
0.00128352
0.00177178
0.00187204
0.00129862
0.00127389
0.00175777
0.00268801
0.00266934
0.00185669
0.00128844
0.0012629
0.00174198
0.00183948
0.00127689
0.00125053
0.0017244
0.00264831
0.00262483
0.00182039
0.00126396
0.00123676
0.00170505
0.00179947
0.00124965
0.00122161
0.001684
0.00259902
0.00257099
0.00177681
0.00123397
0.00120512
0.00166137
0.00175255
0.00121698
0.00118735
0.00163732
0.00254095
0.00250922
0.00172688
0.00119874
0.00116836
0.00161201
0.00169997
0.0011793
0.00114822
0.00158563
0.00247621
0.00244244
0.00167211
0.00115878
0.00112715
0.00155853
0.00164369
0.00113744
0.00110541
0.00153113
0.00240854
0.00237513
0.00161525
0.00111554
0.00108333
0.00150399
0.00158739
0.00109341
0.00106124
0.00147776
0.00234304
0.00231391
0.00156084
0.00107139
0.00103951
0.00145308
0.0015364
0.00104987
0.0010186
0.00143023
0.00228865
0.00226907
0.0015151
0.00102948
0.00099923
0.00141048
0.00149784
0.00101094
0.000982251
0.00139492
0.00225655
0.00225268
0.00148564
0.000995082
0.000968512
0.00138459
0.00147956
0.000982727
0.000958841
0.00138046
0.00225907
0.00227686
0.00148054
0.000974638
0.000953866
0.00138337
0.00148926
0.00097142
0.000954094
0.0013937
0.00230777
0.00234615
0.00150588
0.000973356
0.000960681
0.00141189
0.00153007
0.00098279
0.000972593
0.00143668
0.00239593
0.002461
0.00155992
0.000997193
0.000988393
0.00146759
0.00159633
0.00101558
0.00100747
0.00150375
0.00253906
0.00262513
0.00163809
0.00103738
0.00102968
0.00154365
0.0016841
0.00106187
0.0010543
0.00158639
0.00271765
0.00281533
0.00173291
0.00108831
0.00108066
0.00163139
0.00178331
0.001116
0.00110813
0.00167779
0.002917
0.00302159
0.00183454
0.00114439
0.00113616
0.00172491
0.00188601
0.00117311
0.00116445
0.00177221
0.00312851
0.00323669
0.00193727
0.00120185
0.00119265
0.00181944
0.00198829
0.00123033
0.00122052
0.00186626
0.00334587
0.00345575
0.0020391
0.00125842
0.00124796
0.00191232
0.00208962
0.00128604
0.00127494
0.00195789
0.00356638
0.0036779
0.00213967
0.00131319
0.00130144
0.00200303
0.00218932
0.00133988
0.00132751
0.00204784
0.00379054
0.00390475
0.00223871
0.00136617
0.00135321
0.00209244
0.002288
0.00139215
0.0013786
0.00213688
0.00402152
0.0041407
0.00233731
0.00141789
0.0014038
0.00218135
0.00238678
0.00144352
0.00142892
0.00222608
0.00426215
0.00438644
0.00243663
0.00146915
0.00145408
0.00227134
0.00248718
0.00149494
0.00147943
0.00231738
0.00451451
0.00464709
0.0025387
0.00152106
0.00150513
0.00236448
0.00259152
0.00154765
0.00153136
0.00241301
0.00478485
0.00492855
0.00264607
0.00157496
0.00155837
0.0024634
0.00270284
0.00160322
0.00158638
0.00251625
0.00507896
0.0052368
0.0027625
0.00163271
0.00161567
0.00257238
0.00282607
0.00166371
0.00164653
0.00263297
0.00540266
0.00557691
0.00289497
0.00169644
0.00167912
0.00269782
0.00296877
0.00173113
0.00171372
0.00276763
0.00576642
0.00597451
0.00304849
0.00176813
0.0017507
0.00284308
0.00313491
0.00180784
0.00179047
0.00292513
0.00620283
0.00645521
0.00322927
0.00185085
0.0018336
0.00301507
0.00333309
0.00189771
0.00188071
0.00311448
0.00673676
0.0070538
0.00344827
0.0019492
0.00193257
0.00322532
0.00357732
0.00200616
0.00199003
0.0033498
0.00741469
0.00783051
0.00372285
0.00206961
0.00205419
0.00349072
0.0038883
0.00214097
0.00212653
0.00365158
0.00831556
0.00888643
0.00407798
0.00222207
0.00220901
0.00383689
0.00429743
0.00231546
0.00230445
0.00405424
0.00955937
0.0103737
0.00455655
0.0024247
0.00241661
0.00431198
0.0048694
0.00255472
0.00255084
0.00462395
0.0113875
0.0126818
0.00525473
0.00271256
0.00271483
0.00501301
0.00574206
0.00290914
0.00292221
0.00551316
0.0143884
0.0167326
0.0063789
0.00316263
0.00319527
0.00618055
0.00724478
0.00350323
0.00356938
0.00711267
0.0201329
0.0254458
0.00849251
0.00398982
0.00411819
0.0085038
0.0104003
0.00471564
0.00501226
0.0108662
0.0346687
0.0529698
0.0137371
0.00595184
0.00675053
0.0155396
0.142317
0.0880886
0.0616327
0.0469745
0.0379212
0.0318543
0.0275335
0.0243111
0.0218209
0.0198411
0.0182262
0.016879
0.0157378
0.0147589
0.0139096
0.0131638
0.0125021
0.0119097
0.0113751
0.0108893
0.0104454
0.0100379
0.00965767
0.00929992
0.00896177
0.0086409
0.00833555
0.0080437
0.00776463
0.00749438
0.00722636
0.00696266
0.00670472
0.00645329
0.00620841
0.00596983
0.00573735
0.00551077
0.00529015
0.00507557
0.00486798
0.00466761
0.0044762
0.00429532
0.00412738
0.00397484
0.00384212
0.00373158
0.00363874
0.0035654
0.00351455
0.00348173
0.00346092
0.00345832
0.00346789
0.00348692
0.00351269
0.00354266
0.00357468
0.0036068
0.00363763
0.00366623
0.00369208
0.00371478
0.00373421
0.0037504
0.00376343
0.00377353
0.00378088
0.00378584
0.00378845
0.00378936
0.00378807
0.00378608
0.00378114
0.003778
0.00376817
0.00376922
0.0044268
0.00439648
0.00440047
0.00427223
0.00425544
0.00424209
0.00444915
0.00445785
0.00446021
0.00461068
0.00459605
0.00458228
0.00462944
0.00464392
0.00465901
0.00467734
0.00469358
0.00463389
0.00461424
0.00461743
0.00460526
0.00459165
0.00447614
0.00449369
0.0045151
0.00428308
0.00427799
0.0042695
0.00400461
0.00402024
0.00404215
0.00420734
0.00421404
0.00425922
0.00468105
0.00473498
0.00476765
0.00444404
0.00446861
0.00448973
0.00484368
0.00480617
0.0047684
0.0047214
0.00429642
0.00434325
0.00438925
0.00481549
0.00486684
0.0048841
0.0045128
0.00453485
0.00492549
0.00496891
0.00455733
0.0045792
0.00501376
0.00503975
0.004979
0.00492095
0.00449563
0.00444076
0.00362279
0.00358132
0.00354646
0.00350767
0.00348433
0.00344491
0.00347918
0.00362624
0.003637
0.00364215
0.00325037
0.00324884
0.00326334
0.00261499
0.00267924
0.00273168
0.00232164
0.00228547
0.00227663
0.00239008
0.00235404
0.00149271
0.00138207
0.00148376
0.00154641
0.00164311
0.00164422
0.000962548
0.000933603
0.000841585
0.000394373
0.000205528
0.000239237
0.000497838
0.000448322
0.000235585
0.000258975
0.00052215
0.000891218
0.000881615
0.000503073
0.000446828
0.000237788
0.000247373
0.000233174
0.000439175
0.000499606
0.000853749
0.000832706
0.000853177
0.000836246
0.00138772
0.00150355
0.002379
0.00239107
0.00241601
0.00243657
0.00153477
0.00141686
0.00152392
0.00140674
0.00151285
0.00139685
0.00084482
0.000859189
0.00050791
0.00044434
0.000504056
0.00044023
0.000502776
0.000440323
0.000499269
0.000437447
0.0002333
0.000244961
0.000245318
0.000234375
0.000247206
0.00023592
0.000248966
0.000237298
0.000250341
0.000238605
0.000445272
0.000508506
0.000449099
0.000240633
0.000251859
0.000253646
0.000513099
0.000867353
0.000853268
0.000513742
0.000450038
0.000241751
0.000255195
0.000243846
0.000453903
0.000518365
0.000876122
0.000861853
0.000885037
0.000870663
0.00142759
0.00154641
0.00246223
0.0024878
0.00366547
0.00371307
0.00455516
0.00461798
0.00468704
0.00510482
0.00506053
0.00460074
0.00462142
0.00510891
0.00515912
0.00464108
0.0046592
0.00521094
0.00532839
0.00524897
0.00517456
0.00476183
0.00484367
0.00493305
0.00402828
0.00395204
0.00388333
0.00382211
0.0037649
0.00254781
0.00251685
0.00157156
0.00145047
0.00155856
0.00143867
0.000879656
0.000894164
0.000529233
0.000463832
0.000524446
0.000459822
0.000523742
0.000458805
0.000519027
0.000454866
0.000244995
0.000257045
0.000258628
0.000247146
0.000260542
0.000248351
0.000262182
0.000250561
0.00026415
0.000251808
0.000464873
0.000529947
0.000468937
0.000254068
0.000265831
0.000267851
0.000534808
0.000903526
0.000888916
0.000535557
0.000470014
0.00025536
0.000269583
0.00025768
0.000474159
0.000540524
0.000913193
0.000898499
0.00146292
0.00158538
0.00147625
0.000908483
0.000923231
0.000546396
0.000479526
0.000541323
0.000475293
0.000259023
0.000271664
0.000273452
0.000261406
0.000275595
0.0002628
0.000480709
0.000547236
0.000485026
0.000265238
0.000277431
0.000279629
0.000552428
0.00093373
0.00160031
0.00258223
0.00261999
0.00266234
0.00270977
0.00165462
0.00152382
0.00163453
0.00150638
0.00161657
0.00149063
0.000918997
0.000944848
0.00093023
0.000559636
0.000492103
0.000558727
0.000490731
0.000553354
0.000486282
0.000266678
0.00028152
0.000269182
0.000283789
0.000270681
0.000285743
0.000273265
0.000496689
0.000565262
0.000956771
0.000942383
0.000969751
0.000955758
0.00154347
0.00167748
0.00276361
0.0041134
0.00503124
0.00541312
0.00526338
0.00467532
0.00468901
0.00531691
0.00537122
0.00469952
0.00470638
0.00542501
0.00570203
0.00559982
0.00550354
0.00513952
0.00525943
0.00539267
0.00554107
0.00580996
0.00547742
0.00470892
0.00470661
0.00552715
0.00557204
0.00469932
0.00468748
0.0056116
0.00615784
0.00603944
0.00592286
0.00570572
0.00588814
0.00608756
0.00630379
0.00627542
0.00564491
0.00467195
0.00465424
0.00566975
0.00568809
0.00463717
0.00462376
0.0057025
0.00658614
0.00649357
0.00638857
0.00653363
0.00677246
0.0070113
0.00723555
0.00666576
0.00571698
0.00461829
0.0046293
0.00574039
0.00577217
0.00465743
0.0046988
0.00583071
0.00688677
0.00680468
0.00673581
0.00744184
0.00763009
0.007812
0.00829577
0.0079597
0.00746632
0.00700545
0.00657276
0.00615743
0.00578947
0.00546998
0.00519426
0.0049602
0.00475851
0.00458716
0.00444184
0.00431719
0.00420881
0.00282318
0.00289019
0.00296812
0.00177419
0.00162454
0.00173575
0.00159267
0.00170397
0.00156602
0.000970829
0.000984119
0.000579573
0.000509678
0.000573365
0.000504693
0.000572182
0.000502988
0.000566271
0.000498203
0.000274825
0.000288092
0.00029012
0.000277503
0.000292573
0.00027915
0.00029469
0.000281918
0.000297237
0.000283651
0.000511612
0.000581048
0.000516958
0.000286569
0.000299474
0.000302201
0.000587793
0.0010004
0.000988146
0.00058972
0.000519333
0.000288452
0.000304595
0.000291517
0.000525098
0.000597023
0.001019
0.00100811
0.00104072
0.00103219
0.00166351
0.00182071
0.00306001
0.00317973
0.00333278
0.0035164
0.00204769
0.00185995
0.00195352
0.00177868
0.00187825
0.0017134
0.00106139
0.00106739
0.000623075
0.000547175
0.000612415
0.000538782
0.000608161
0.000534542
0.000599594
0.000527966
0.000293556
0.000307485
0.00031013
0.000296972
0.000313585
0.000299734
0.000317337
0.000304621
0.000322993
0.000308981
0.000553323
0.000629071
0.000563222
0.000315771
0.000329881
0.000335813
0.000641042
0.0010993
0.00109713
0.000647868
0.000570642
0.000321412
0.000342779
0.000327895
0.000581273
0.000659118
0.00113798
0.0011396
0.00118466
0.00119421
0.0019653
0.00216964
0.00374851
0.00404053
0.00442183
0.0049351
0.00298534
0.00257345
0.00256697
0.00228026
0.00233091
0.00209911
0.00126546
0.00124432
0.000697053
0.000619867
0.000686256
0.000609056
0.000678969
0.000600897
0.000667122
0.000589461
0.000335151
0.000349054
0.000355066
0.000342655
0.000362891
0.000349381
0.000369225
0.000357269
0.000374663
0.000362063
0.000627171
0.0007048
0.000637962
0.000366362
0.000378314
0.000381795
0.000716201
0.00132453
0.00135679
0.000725993
0.000647839
0.000368745
0.000382425
0.000371651
0.000664578
0.000749419
0.00144449
0.00155371
0.00181723
0.00197211
0.00301991
0.00341335
0.00548058
0.00616182
0.00709001
0.00788871
0.00564378
0.00518593
0.00482651
0.00417901
0.00394998
0.00349699
0.00233517
0.00218
0.0012397
0.00109637
0.00112354
0.000973309
0.00101795
0.000792593
0.000809519
0.000700897
0.000380282
0.000386158
0.000410216
0.00043014
0.000223301
0.000297817
0.000605372
0.000593051
0.000662206
0.000671733
0.000283309
0.000290371
0.000284562
0.000414724
0.000751255
0.000758691
0.00121764
0.00138594
0.00137266
0.000951442
0.000942436
0.000636824
0.000476608
0.000654244
0.000747702
0.00106191
0.0015327
0.00259945
0.00286688
0.00174382
0.00155017
0.00110867
0.00125842
0.00140848
0.00185461
0.00192111
0.00328702
0.00356901
0.00205417
0.00119047
0.00111176
0.00107704
0.00105138
0.000893219
0.000794073
0.000645546
0.000721663
0.000753216
0.000782975
0.000831625
0.000791209
0.00111469
0.00140287
0.00240095
0.00301593
0.0016722
0.00133504
0.000953363
0.000965466
0.00118221
0.00131841
0.00184007
0.00242742
0.00432615
0.00692202
0.00835206
0.00867124
0.00809667
0.00704955
0.00592303
0.00477412
0.00487378
0.00608414
0.00631975
0.0050159
0.00519988
0.00662646
0.00815954
0.00770272
0.0073258
0.00849712
0.00903029
0.0096865
0.0104468
0.00868494
0.00698251
0.00541969
0.00566897
0.0073752
0.00780003
0.00594245
0.00623597
0.00824957
0.0105409
0.00988673
0.0092636
0.0112785
0.0121677
0.0130958
0.0140519
0.0112183
0.0087187
0.00654607
0.00686975
0.0092021
0.0096962
0.00720381
0.0075485
0.0101988
0.0133297
0.0126167
0.0119117
0.0150252
0.0160116
0.0170058
0.0180065
0.0140489
0.0107079
0.00790122
0.00826209
0.0112233
0.0117452
0.00863076
0.00900774
0.0122751
0.016249
0.0155068
0.0147743
0.0190131
0.0200269
0.0210504
0.0268012
0.0254167
0.0240391
0.0226663
0.021297
0.0199324
0.0185733
0.0172282
0.0158967
0.0145995
0.0133377
0.0121576
0.0110351
0.010094
0.00927774
0.00916248
0.0103767
0.0119979
0.0120647
0.00982325
0.00790464
0.0057422
0.00456641
0.0032813
0.00275195
0.00198062
0.00156063
0.00100341
0.00087825
0.000847433
0.0013362
0.00151177
0.00113145
0.000986793
0.000699253
0.000607184
0.000597756
0.0007788
0.000952812
0.00134114
0.00173803
0.00251536
0.00278731
0.00349696
0.00410228
0.00442693
0.00513042
0.00394473
0.00320879
0.00245505
0.00222358
0.00208753
0.00190926
0.00156072
0.00175058
0.00190852
0.00159705
0.00141607
0.00121199
0.000852796
0.000683626
0.00106055
0.001269
0.00110538
0.00122442
0.00148001
0.00179634
0.00211898
0.00237879
0.00265874
0.00298096
0.00221255
0.0020294
0.00165329
0.00177232
0.00208391
0.00231212
0.00276201
0.00357951
0.00398221
0.00572239
0.0037983
0.00319795
0.00235872
0.00222059
0.00189451
0.00155254
0.00127783
0.00116891
0.00125106
0.00157199
0.00133917
0.00114217
0.000931984
0.00119784
0.00153367
0.00163017
0.00182227
0.00228757
0.00211145
0.00316248
0.00213553
0.0020745
0.00152686
0.00109528
0.000835098
0.000733813
0.00109612
0.00117048
0.000783754
0.000396834
0.000550314
0.000372037
0.000219373
0.000325062
0.000255305
0.000180152
0.000268999
0.000216995
0.000186469
0.00015507
0.00022686
0.000192651
0.000185906
0.000161159
0.000228528
0.000330291
0.000236512
0.000348375
0.00034932
0.0003137
0.000452327
0.000391557
0.000369472
0.000313845
0.000415138
0.000402107
0.000378692
0.000361845
0.000305438
0.000423423
0.000356283
0.000313571
0.000243285
0.000366793
0.000248213
0.000221353
0.000222746
0.000167885
0.000298346
0.000290739
0.000238567
0.000231394
0.000163366
0.000302258
0.000256867
0.000250069
0.00016785
0.000320258
0.000262189
0.000248386
0.000163123
0.000299399
0.0002724
0.000222892
0.000222713
0.000146975
0.000299763
0.000241952
0.000228754
0.000140282
0.000287826
0.000230752
0.000225933
0.000140289
0.000298769
0.000238055
0.000223359
0.00013193
0.000280381
0.000221506
0.000215671
0.000129337
0.000286928
0.000225674
0.000211538
0.000123274
0.00025399
0.000247637
0.000134566
0.000303475
0.000231583
0.000211695
0.000121027
0.000266912
0.000212562
0.000198987
0.000111992
0.000235605
0.000222986
0.000114625
0.000259202
0.000195595
0.000184237
0.00010435
0.0002236
0.000211028
0.00010915
0.00026389
0.000202829
0.000185699
0.000101392
0.000219955
0.000206528
0.000104425
0.000239144
0.000176801
0.000164212
9.0996e-05
0.000200878
0.000188039
9.44177e-05
0.000237177
0.000178803
0.000160534
8.51389e-05
0.000191305
0.000179883
8.96718e-05
0.000195774
0.000181144
8.81415e-05
0.000200921
0.000181471
9.02986e-05
0.000209052
0.000154345
0.00013772
7.74665e-05
0.000171703
0.000152993
7.74616e-05
0.000173706
0.000159784
7.96892e-05
0.000181264
0.00016038
8.09477e-05
0.000201989
0.000153878
0.000130256
7.27778e-05
0.000161377
0.000146047
7.42178e-05
0.000163415
0.000142713
7.30122e-05
0.000165124
0.000144633
7.42784e-05
0.000163074
0.000140634
7.31054e-05
0.000165199
0.000140719
7.32956e-05
0.000166398
0.000121252
0.000104085
6.4225e-05
0.00013381
0.000114615
6.34882e-05
0.00013596
0.000116762
6.41783e-05
0.000138866
0.000115273
6.34321e-05
0.000135199
0.00011571
6.41295e-05
0.000138753
0.000115163
6.39811e-05
0.000135224
0.000115609
6.48064e-05
0.000137385
0.000114432
6.44593e-05
0.000133985
0.000114986
6.54986e-05
0.000137806
0.000115901
6.63681e-05
0.000151746
0.000112954
9.46328e-05
6.07559e-05
0.000118242
0.000104184
6.16936e-05
0.000118724
0.000103133
6.08748e-05
0.000119402
0.000103515
6.14318e-05
0.000116556
0.000101754
6.10319e-05
0.000117231
0.000102132
6.1719e-05
0.000114863
0.000100806
6.13581e-05
0.000116132
0.000101763
6.22313e-05
0.000113866
0.000100848
6.18651e-05
0.000115143
0.000101918
6.27044e-05
0.000113627
0.000101469
6.29174e-05
0.000128853
9.65856e-05
8.46839e-05
5.58518e-05
9.24316e-05
8.7716e-05
5.50245e-05
9.76916e-05
8.80584e-05
5.43932e-05
9.63651e-05
8.86441e-05
5.50336e-05
0.000100052
8.98425e-05
5.53452e-05
9.96346e-05
9.13397e-05
5.66088e-05
0.000103279
9.25231e-05
5.72918e-05
0.000103454
9.45876e-05
5.95567e-05
0.000120834
9.1874e-05
8.17603e-05
5.42763e-05
9.55239e-05
9.00733e-05
5.54259e-05
0.000100008
9.24689e-05
5.66247e-05
9.95639e-05
9.23054e-05
5.69488e-05
0.000101867
9.37398e-05
5.75973e-05
0.000107233
8.34387e-05
7.7592e-05
5.26264e-05
9.12043e-05
8.61041e-05
5.36893e-05
9.44835e-05
8.98549e-05
5.59408e-05
0.000111047
8.5382e-05
7.78668e-05
5.2011e-05
9.01053e-05
8.72324e-05
5.38518e-05
9.5535e-05
8.98896e-05
5.46423e-05
0.000101277
7.90953e-05
7.4735e-05
5.0773e-05
8.73747e-05
8.37421e-05
5.23244e-05
9.10437e-05
8.85979e-05
5.54445e-05
0.000108747
8.44192e-05
7.81737e-05
5.2501e-05
9.07075e-05
8.8507e-05
5.52926e-05
0.000109055
8.46446e-05
7.86557e-05
5.22353e-05
8.57344e-05
8.44474e-05
5.42139e-05
0.000105683
8.27122e-05
7.70801e-05
5.14802e-05
9.59131e-05
7.59009e-05
7.36404e-05
5.0049e-05
8.73928e-05
8.49112e-05
5.36126e-05
0.0001072
8.59764e-05
8.16129e-05
5.43547e-05
0.000106146
8.38643e-05
7.96389e-05
5.36782e-05
9.89666e-05
8.11497e-05
7.82703e-05
5.31449e-05
0.000103478
8.16417e-05
7.81572e-05
5.32189e-05
9.28898e-05
8.50356e-05
6.98799e-05
7.02387e-05
4.96778e-05
9.95121e-05
7.8597e-05
7.62867e-05
5.22143e-05
9.64644e-05
9.37516e-05
7.72899e-05
7.72561e-05
5.39389e-05
9.9874e-05
9.78475e-05
7.65535e-05
7.64229e-05
5.27776e-05
9.71201e-05
8.80576e-05
7.8498e-05
7.18665e-05
7.44727e-05
5.40784e-05
0.000110367
9.74766e-05
9.40596e-05
8.42816e-05
8.4278e-05
7.28793e-05
7.51483e-05
5.39103e-05
0.0001009
9.75745e-05
8.42419e-05
8.52946e-05
7.97488e-05
8.21972e-05
7.75392e-05
8.07652e-05
7.69608e-05
7.96306e-05
7.61977e-05
7.91538e-05
7.61143e-05
7.92097e-05
7.65518e-05
7.98469e-05
7.72623e-05
8.06684e-05
7.80678e-05
8.1565e-05
7.89558e-05
8.24503e-05
8.00776e-05
8.35624e-05
8.13688e-05
8.46252e-05
8.23825e-05
8.54183e-05
8.31258e-05
8.60329e-05
8.38165e-05
8.66559e-05
8.45206e-05
8.72791e-05
8.52766e-05
8.80022e-05
8.61646e-05
8.88078e-05
8.71468e-05
8.97401e-05
8.82239e-05
9.07536e-05
8.9359e-05
9.18876e-05
9.06197e-05
9.31304e-05
9.20023e-05
9.45303e-05
9.35168e-05
9.60428e-05
9.50863e-05
9.76821e-05
9.67701e-05
9.94278e-05
9.85576e-05
0.000101316
0.000100481
0.000103303
0.000102483
0.0001054
0.000104585
0.00010756
0.000106738
0.000109795
0.000108944
0.000112051
0.000111146
0.000114342
0.000113393
0.000116579
0.000115581
0.000118806
0.000117738
0.000120981
0.000119854
0.000123111
0.000121894
0.000125138
0.000123841
0.000127099
0.000125727
0.00012899
0.00012755
0.00013082
0.000129296
0.000132552
0.000130945
0.000134201
0.000132516
0.000135777
0.000134038
0.000137319
0.000135504
0.000138772
0.000136879
0.000140157
0.000138198
0.000141479
0.000139457
0.00014275
0.00014066
0.000143957
0.000141812
0.000145134
0.000142929
0.000146252
0.000143978
0.000147311
0.000144972
0.000148304
0.000145915
0.000149271
0.000146839
0.000150196
0.000147721
0.000151092
0.000148565
0.000151931
0.000149357
0.000152732
0.000150107
0.000153481
0.000150823
0.000154223
0.00015153
0.000154932
0.000152194
0.000155601
0.000152807
0.000156205
0.00015338
0.000156807
0.000153963
0.000157408
0.00015454
0.000158001
0.000155081
0.000158521
0.000155547
0.000158991
0.000155988
0.000159447
0.000156446
0.000159954
0.000156942
0.00016045
0.000157381
0.000160867
0.000157727
0.00016119
0.000158038
0.000161555
0.000158438
0.000161999
0.000158872
0.000162431
0.00015922
0.000162719
0.000159445
0.000162955
0.0001597
0.000163263
0.000160046
0.000163656
0.00016041
0.000163986
0.000160671
0.000164227
0.000160875
0.000164428
0.000161078
0.000164669
0.00016133
0.000164944
0.000161616
0.000165261
0.000161905
0.000165511
0.000162075
0.000165641
0.000162165
0.000165752
0.000162351
0.000166047
0.000162704
0.000166394
0.000162945
0.000166531
0.000162955
0.000166507
0.000163002
0.000166705
0.000163342
0.000167103
0.000163675
0.000167323
0.000163713
0.000167269
0.000163669
0.000167381
0.000163961
0.000167715
0.000164302
0.000168038
0.000164452
0.000168012
0.000164451
0.000170867
0.000170594
0.000173726
0.000192865
0.00019904
0.000356725
0.00034773
0.000294212
0.000511093
0.000275784
0.000294617
0.000444603
0.000271643
0.000295678
0.000433587
0.000270561
0.000294285
0.000431106
0.000268971
0.000293081
0.000415386
0.000269822
0.000293741
0.000425803
0.000269021
0.000293208
0.000414905
0.00026943
0.000292572
0.000423719
0.00026762
0.000291321
0.000413506
0.000267948
0.000291539
0.000422189
0.000267183
0.000291205
0.000412188
0.000267748
0.000290837
0.000420647
0.000266109
0.000289536
0.000410523
0.000266206
0.000289361
0.000419009
0.000265111
0.000288817
0.000408989
0.000265653
0.000288643
0.000417339
0.000264253
0.000287531
0.000407199
0.000264365
0.000287132
0.000415503
0.000262949
0.00028618
0.000405335
0.000263191
0.000285875
0.000413579
0.000261819
0.000284938
0.000403377
0.000262096
0.00028463
0.000411552
0.000260656
0.000283475
0.00040126
0.00026063
0.000282838
0.000409349
0.000258989
0.000281718
0.000399049
0.000259178
0.000281445
0.000407102
0.000257825
0.000280378
0.000396754
0.000257819
0.000279635
0.000404675
0.000255992
0.000278207
0.000394253
0.000255862
0.000277643
0.000402146
0.000254332
0.000276537
0.000391737
0.000254359
0.000275875
0.000399517
0.000252573
0.000274369
0.000389017
0.000252263
0.000273485
0.000396722
0.000250412
0.000272105
0.000386223
0.000250261
0.000271366
0.000393859
0.000248467
0.000269901
0.000383324
0.000248146
0.000268898
0.000390849
0.000246106
0.000267258
0.000380284
0.000245693
0.00026626
0.000387744
0.000243711
0.000264713
0.000377198
0.000243342
0.000263675
0.000384571
0.000241253
0.000261954
0.000374
0.000240707
0.000260771
0.000381315
0.00023854
0.000259054
0.000370717
0.000238025
0.000257909
0.000378019
0.000235852
0.000256143
0.000367379
0.000235255
0.0002549
0.000374659
0.00023299
0.000253083
0.000363992
0.000232374
0.000251872
0.000371279
0.000230145
0.000250121
0.00036061
0.000229578
0.00024894
0.000367892
0.000227333
0.000247152
0.000357179
0.000226714
0.000245926
0.000364459
0.000224424
0.000244161
0.000353672
0.00022387
0.000243061
0.000360998
0.000221687
0.000241425
0.000350234
0.000221223
0.000240395
0.000357585
0.000219056
0.000238802
0.000346778
0.000218643
0.000237853
0.000354159
0.000216521
0.000236353
0.000343305
0.000216201
0.000235533
0.000350753
0.000214162
0.000234163
0.000339855
0.000213959
0.000233457
0.00034739
0.000211944
0.000232145
0.000336448
0.000211783
0.00023151
0.000344118
0.00020978
0.000230284
0.000333187
0.000209683
0.000229794
0.000341066
0.00020756
0.000228519
0.000330219
0.000207217
0.000227866
0.000338522
0.000205264
0.000226844
0.000327419
0.000204958
0.00022621
0.000336033
0.000203064
0.000225069
0.000324827
0.000202828
0.000224602
0.00033358
0.000201108
0.000223519
0.000322538
0.000200966
0.000223266
0.000331493
0.000199501
0.00022239
0.000320549
0.000199627
0.000222476
0.000329681
0.000198405
0.000221766
0.000318776
0.000198811
0.000222151
0.000328137
0.000197758
0.000221809
0.000317319
0.000198516
0.000222296
0.000327002
0.000197433
0.000221835
0.000316255
0.000198212
0.000222123
0.000326327
0.000196975
0.000221463
0.000315733
0.000197599
0.000221457
0.000326304
0.000195944
0.000220201
0.000315948
0.00019592
0.000219352
0.000327466
0.000193188
0.000216959
0.000317677
0.000192094
0.000215425
0.000330023
0.000188856
0.000213264
0.000320713
0.000188108
0.000212864
0.000332671
0.000186098
0.000211975
0.000323844
0.000186336
0.000211908
0.000336265
0.000184738
0.000211061
0.000329278
0.000184984
0.000211427
0.000342798
0.000183812
0.000211172
0.000338922
0.000184315
0.000212067
0.000353797
0.000183561
0.000212603
0.000354784
0.000184581
0.000214698
0.000370814
0.000185209
0.00021683
0.00037563
0.000187171
0.00022078
0.000399437
0.000188306
0.000223918
0.000412551
0.000192139
0.000231585
0.000454652
0.000201082
0.00025482
0.000499149
0.000236568
0.000342353
0.000166103
0.000165912
0.000308451
0.000610608
0.000669152
0.000383508
0.000203388
0.000207023
0.000348865
0.00041524
0.000245802
0.000258426
0.000383441
0.000786832
0.000888641
0.000447747
0.000326774
0.000383409
0.000176288
0.000177725
0.000434963
0.000409602
0.00017285
0.00023361
0.000556701
0.000218643
0.000343748
0.000158434
0.000169316
0.000318594
0.000691926
0.00205092
0.00124034
0.00122101
0.0019466
0.00356993
0.00184918
0.00304589
0.00165695
0.00132597
0.00267738
0.00140598
0.00112028
0.00235428
0.00120155
0.001007
0.00215103
0.00110965
0.000957447
0.00202879
0.00106133
0.000929046
0.00193641
0.00102999
0.000907327
0.00186675
0.00100641
0.000891819
0.00182365
0.000989802
0.000879687
0.0017896
0.000977451
0.000870873
0.00176185
0.00096867
0.000864565
0.00173872
0.000962364
0.000860085
0.00171924
0.000957792
0.000857054
0.00170275
0.000954606
0.000855137
0.00168875
0.00095252
0.000854074
0.0016768
0.000951252
0.000853605
0.00166631
0.000950508
0.000853523
0.0016567
0.000950105
0.000853653
0.00164915
0.000950032
0.000853949
0.00164182
0.000949924
0.000854242
0.00163629
0.000949954
0.000854956
0.00163099
0.000950228
0.000855759
0.00162682
0.000950687
0.00085675
0.00162268
0.000951261
0.000857795
0.00161962
0.000951889
0.000858898
0.00161626
0.000952521
0.000859992
0.00161404
0.000953289
0.000861149
0.0016111
0.000953816
0.000862224
0.00160933
0.000954604
0.000863518
0.00160731
0.000955372
0.000864712
0.00160584
0.000956114
0.000865909
0.00160394
0.000956834
0.000867084
0.00160275
0.000957582
0.000868297
0.00160092
0.000958309
0.000869443
0.00159997
0.000959021
0.000870606
0.00159814
0.000959715
0.000871744
0.00159743
0.000960512
0.000873039
0.00159555
0.000961386
0.000874268
0.00159508
0.000962208
0.000875414
0.00159298
0.000962822
0.000876337
0.00159271
0.000963424
0.000877382
0.00159036
0.000964081
0.000878401
0.00159044
0.000964854
0.000879531
0.00158781
0.000965509
0.000880409
0.00158829
0.000966149
0.000881426
0.00158521
0.00096673
0.000882232
0.00158622
0.000967377
0.000883231
0.00158258
0.000967903
0.000883916
0.00158433
0.000968514
0.000884835
0.00157996
0.000969031
0.000885371
0.0015836
0.000969524
0.000886501
0.00157568
0.000969839
0.000886303
0.00160016
0.000969563
0.000887124
0.00157003
0.000957528
0.000884869
0.00181158
0.00101696
0.00108595
0.00136224
0.000608484
0.000500993
0.000502564
0.000489014
0.00179773
0.00176043
0.0017604
0.00385069
0.00201913
0.00354265
0.0034051
0.00332503
0.00530245
0.00534751
0.00552874
0.00570329
0.00791907
0.00778044
0.00765408
0.0076119
0.0104406
0.0104655
0.0105439
0.0106357
0.0140582
0.0140075
0.0139738
0.0139715
0.0183959
0.0183673
0.0183588
0.0183693
0.0237214
0.023762
0.0238193
0.0238924
0.023974
0.0184347
0.0139838
0.0104332
0.00758679
0.00526018
0.00331268
0.0033022
0.00330797
0.00330788
0.00527817
0.00526747
0.00527049
0.0075962
0.00759995
0.00761494
0.00762516
0.00528353
0.00331386
0.00331599
0.00332136
0.00332468
0.00531119
0.00530128
0.00529356
0.00763993
0.00765278
0.00766804
0.0105526
0.0105323
0.0105135
0.010494
0.0104772
0.0104584
0.0104459
0.014006
0.0140312
0.0140581
0.0185718
0.0185251
0.0184793
0.0240591
0.0241447
0.0242307
0.0243162
0.0186184
0.0140851
0.0141129
0.0141408
0.0141693
0.0187575
0.0187112
0.0186648
0.0244013
0.0244859
0.0245699
0.0246534
0.0188037
0.014198
0.0105731
0.00768268
0.00532026
0.00332957
0.00333358
0.00333828
0.00334283
0.00535168
0.00534071
0.00533057
0.00769889
0.00771521
0.00773269
0.00775071
0.00536288
0.00334763
0.00335266
0.00335771
0.00336318
0.00540026
0.00538719
0.00537484
0.00776984
0.00778997
0.00781109
0.0107432
0.0107157
0.0106894
0.0106642
0.0106402
0.010617
0.0105947
0.0142274
0.0142572
0.0142877
0.0189418
0.0188958
0.0188498
0.0247361
0.0248181
0.0248994
0.0249799
0.0189879
0.0143189
0.0143509
0.0143837
0.0144175
0.0191265
0.0190801
0.0190339
0.0250595
0.0251383
0.0252162
0.0330565
0.0329093
0.0327607
0.0326108
0.0324596
0.0323074
0.0321543
0.0320004
0.0318458
0.0316906
0.0315352
0.0313794
0.0312237
0.0310678
0.0309127
0.0307583
0.0306078
0.0304672
0.0303447
0.0302417
0.0380004
0.0381841
0.0383983
0.0386388
0.0480184
0.047637
0.047298
0.0470131
0.0572318
0.0576383
0.0581376
0.0587065
0.0705844
0.0697802
0.0690875
0.0685422
0.080762
0.0814573
0.082371
0.0834546
0.0970449
0.095647
0.0944957
0.0936521
0.106914
0.107896
0.109288
0.111021
0.125007
0.122933
0.121308
0.120214
0.133135
0.134348
0.1362
0.138609
0.15142
0.148687
0.146607
0.145267
0.156003
0.157563
0.15989
0.162927
0.172434
0.169127
0.166574
0.164805
0.171121
0.173048
0.175786
0.179315
0.183513
0.179834
0.176972
0.174975
0.18789
0.18353
0.176386
0.166544
0.154654
0.141432
0.127403
0.112992
0.0986102
0.084651
0.0714614
0.0593204
0.0484266
0.0388949
0.039158
0.0394243
0.039693
0.0497157
0.0492787
0.0488485
0.0599599
0.0606164
0.0612881
0.0619749
0.0501591
0.0399636
0.040236
0.0405101
0.0407854
0.0515267
0.051065
0.050609
0.0626766
0.0633934
0.0641248
0.0785347
0.0774349
0.0763653
0.0753256
0.0743155
0.0733345
0.0723823
0.0859178
0.087237
0.0886058
0.10387
0.102037
0.100283
0.115119
0.117368
0.119732
0.122215
0.105783
0.0900247
0.0914954
0.0930195
0.0945982
0.112036
0.109862
0.107779
0.124825
0.127567
0.130449
0.13348
0.114304
0.0962325
0.0796647
0.0648706
0.0519939
0.0410618
0.0413391
0.0416169
0.0418951
0.053425
0.0529434
0.0524663
0.0656305
0.066404
0.0671907
0.0679904
0.0539108
0.0421735
0.0424519
0.0427301
0.043008
0.0553919
0.0548943
0.0544006
0.0688025
0.0696272
0.0704647
0.0883959
0.0870631
0.0857586
0.0844822
0.083234
0.0820148
0.0808248
0.0979234
0.0996711
0.101475
0.121696
0.119132
0.116668
0.136665
0.140013
0.143527
0.147212
0.124361
0.103336
0.105252
0.107222
0.109246
0.132944
0.129988
0.127126
0.151066
0.155089
0.159272
0.187853
0.18209
0.176598
0.171385
0.166452
0.161792
0.157396
0.15325
0.149338
0.145647
0.142161
0.138866
0.13575
0.132801
0.130016
0.144544
0.147887
0.15145
0.166338
0.162156
0.158256
0.170604
0.175031
0.179802
0.18493
0.17081
0.155239
0.159269
0.163562
0.168139
0.186225
0.180721
0.175595
0.190444
0.196384
0.202801
0.216765
0.209531
0.202869
0.196713
0.191013
0.185728
0.180845
0.188293
0.193519
0.199189
0.204184
0.198274
0.192838
0.210591
0.205325
0.211968
0.219182
0.227045
0.233365
0.225103
0.217541
0.242437
0.235655
0.22465
0.209754
0.192146
0.173026
0.178251
0.183844
0.189832
0.212896
0.205429
0.198531
0.217311
0.225553
0.234572
0.244474
0.220987
0.196242
0.203096
0.210405
0.218165
0.249485
0.23925
0.229757
0.25537
0.267376
0.280586
0.309176
0.292641
0.277983
0.264939
0.253271
0.242775
0.233281
0.245132
0.255624
0.267319
0.276079
0.263596
0.252456
0.2902
0.280456
0.295343
0.312386
0.33212
0.34716
0.32508
0.306352
0.375219
0.355286
0.327823
0.295028
0.26044
0.226347
0.193868
0.163607
0.135993
0.111323
0.0897578
0.0713155
0.0558934
0.0432854
0.033202
0.0252931
0.0191731
0.0144525
0.0107721
0.00783296
0.00541384
0.00336859
0.00337451
0.00338039
0.00338686
0.00545905
0.00544319
0.00542822
0.00785637
0.00788081
0.00790671
0.00793395
0.00547574
0.00339335
0.00340047
0.00340772
0.00341566
0.00553132
0.00551176
0.00549341
0.00796276
0.00799316
0.0080254
0.0110226
0.0109805
0.0109409
0.0109034
0.0108679
0.0108343
0.0108024
0.0144887
0.0145264
0.0145656
0.0193157
0.0192676
0.0192201
0.0253691
0.0254441
0.025518
0.0255908
0.0193646
0.0146066
0.0146496
0.0146948
0.0147425
0.0195182
0.0194656
0.0194144
0.0256625
0.0257332
0.025803
0.0258721
0.0195728
0.0147931
0.0110673
0.00805952
0.00555203
0.00342372
0.00343293
0.00344209
0.00345255
0.00562212
0.00559727
0.00557401
0.00809572
0.00813415
0.00817503
0.00821859
0.00564851
0.00346327
0.00347544
0.00348851
0.00350231
0.00573986
0.00570716
0.00567686
0.00826514
0.00831496
0.00836851
0.0114763
0.0114049
0.0113386
0.0112768
0.0112192
0.0111653
0.0111147
0.0148468
0.0149041
0.0149654
0.0197532
0.0196898
0.0196298
0.0259408
0.0260096
0.0260793
0.0261508
0.019821
0.0150311
0.0151019
0.0151783
0.0152611
0.0200589
0.0199728
0.0198938
0.0262253
0.0263041
0.026389
0.0264822
0.0201533
0.0153511
0.0115533
0.00842617
0.00577524
0.00351808
0.00353522
0.00355443
0.00357587
0.00590133
0.00585547
0.0058136
0.0084885
0.00855612
0.00862978
0.00871042
0.00595193
0.00359999
0.00362743
0.00365889
0.0036953
0.0061415
0.00607082
0.00600807
0.00879914
0.00889729
0.00900657
0.0123327
0.0121859
0.012054
0.0119347
0.0118263
0.0117274
0.0116367
0.0154491
0.0155563
0.0156739
0.0205008
0.0203724
0.0202573
0.0265861
0.0267007
0.0268312
0.0270128
0.0206441
0.0158034
0.0159464
0.0161065
0.0162788
0.0213399
0.0210107
0.0207976
0.0273786
0.027934
0.0287009
0.0295736
0.0217978
0.0165135
0.0124981
0.00912923
0.00622186
0.00373786
0.0037884
0.00384973
0.00392594
0.00655119
0.00642311
0.0063145
0.0092682
0.0094275
0.00965483
0.00994363
0.0067349
0.00402138
0.00414869
0.00432314
0.00455627
0.00758036
0.00725488
0.00696435
0.0102653
0.0106122
0.0110343
0.015027
0.0144974
0.0140644
0.0136836
0.0133204
0.0129575
0.0126792
0.0168543
0.0173155
0.0177871
0.0236251
0.0230674
0.0224483
0.0304383
0.0311828
0.0319269
0.0327901
0.0241974
0.0182144
0.0186969
0.0192665
0.019969
0.0267077
0.0257005
0.0248809
0.0338519
0.0351797
0.0368857
0.0566597
0.0522849
0.0491276
0.0467882
0.0450141
0.0436269
0.0424375
0.0412434
0.0399762
0.0387313
0.0375088
0.0364522
0.0357253
0.0353112
0.0351977
0.0350836
0.0349871
0.0348932
0.0347987
0.034702
0.0346018
0.0344969
0.0343869
0.0342714
0.0341509
0.0340257
0.0338962
0.033763
0.0336266
0.0334874
0.0333457
0.0435621
0.0438378
0.044112
0.0574237
0.0569092
0.0563992
0.0721805
0.0730613
0.0739595
0.074877
0.0579424
0.0443842
0.0446536
0.044919
0.0451789
0.0595171
0.0589905
0.0584651
0.0758156
0.0767767
0.0777603
0.100428
0.0987395
0.0971172
0.0955544
0.0940436
0.0925777
0.0911506
0.113456
0.115649
0.11791
0.145697
0.142363
0.139131
0.168085
0.172696
0.177444
0.182346
0.149151
0.120252
0.12269
0.125245
0.127938
0.160584
0.156549
0.152755
0.187449
0.192807
0.19838
0.205571
0.165015
0.13079
0.102187
0.0787654
0.060042
0.0454316
0.0456751
0.0459071
0.0461252
0.0615606
0.0610707
0.0605617
0.0797898
0.0808312
0.0818741
0.0828629
0.0620214
0.0463282
0.0465166
0.0466901
0.0468472
0.063321
0.062867
0.0624564
0.0838126
0.0853896
0.0885932
0.134201
0.121079
0.113796
0.109995
0.108045
0.105956
0.104019
0.133756
0.136916
0.141065
0.190276
0.176816
0.16947
0.217729
0.241707
0.288494
0.371987
0.218316
0.148694
0.163737
0.189891
0.229127
0.451829
0.343247
0.266996
0.507766
0.713324
1.00576
2.39116
1.61742
1.0853
0.733716
0.51243
0.380084
0.304895
0.264564
0.24536
0.234346
0.226887
0.21989
0.213139
0.20654
0.200107
0.234899
0.243746
0.252805
0.296676
0.284115
0.272029
0.310591
0.327861
0.351314
0.391111
0.312974
0.261878
0.272884
0.289716
0.321613
0.479962
0.388654
0.339106
0.46259
0.590343
0.810793
1.43432
0.968986
0.690638
0.526627
0.432584
0.37974
0.34926
0.387353
0.443917
0.546927
0.66624
0.507407
0.420724
0.942206
0.72778
1.03505
1.55005
2.42021
3.60547
2.20871
1.4104
6.13397
3.92783
2.21657
1.18309
0.642054
0.383173
0.4969
0.694693
1.02785
2.18313
1.39131
0.920722
1.81053
2.88074
4.72951
7.90942
3.50919
1.57636
2.45468
3.81202
5.83576
14.1727
9.10253
5.68371
13.1752
21.2343
32.2302
61.6226
44.3248
28.8235
17.3825
10.1324
5.92784
3.56068
6.61946
11.5071
20.1966
34.3856
19.5118
10.8321
55.5414
34.3343
53.6139
74.3499
91.9762
111.78
98.5349
78.9375
119.756
104.513
77.548
45.2523
21.1484
8.7563
3.49441
1.40858
0.596103
0.280479
0.152729
0.0945434
0.0645755
0.0469555
0.0473789
0.0483425
0.0499616
0.0748831
0.0707616
0.0669412
0.102859
0.112297
0.122023
0.133068
0.0791247
0.0520416
0.054106
0.0562434
0.0585379
0.0947294
0.0887916
0.0836261
0.146491
0.16366
0.186282
0.491972
0.398087
0.325374
0.270968
0.23066
0.200019
0.174888
0.344053
0.425553
0.53326
1.39792
1.04668
0.787722
1.96489
2.73644
3.78556
5.15783
1.87613
0.680645
0.881296
1.14281
1.46798
4.17832
3.27423
2.50212
6.82687
8.71591
10.7378
12.815
5.19453
1.87338
0.617158
0.216378
0.101637
0.061004
0.0635977
0.0666474
0.0706285
0.137518
0.121391
0.110059
0.258173
0.317452
0.394853
0.486068
0.161138
0.0760858
0.0835535
0.093806
0.108112
0.30593
0.242182
0.194576
0.607609
0.752099
0.921663
2.48631
2.11606
1.79502
1.48774
1.22872
0.991974
0.783094
2.34632
2.86801
3.41849
8.51375
7.37078
6.26221
14.8923
17.0033
19.1563
21.403
9.72359
4.01308
4.65731
5.33606
6.10629
13.8832
12.3722
10.9989
23.7522
26.2668
28.9645
53.5983
49.5497
45.684
41.9867
38.3912
34.8766
31.3783
27.8703
24.2884
20.6141
16.8975
13.2761
9.96412
7.19343
5.05297
12.7857
17.9362
23.8899
48.651
39.3455
29.8223
58.4816
70.2487
79.9448
87.8037
57.0752
30.1234
36.1835
41.8888
47.2158
76.8543
71.0081
64.4771
94.2931
99.8154
104.652
123.867
120.485
116.672
112.204
106.73
99.6894
90.2481
112.988
118.846
123.178
131.299
128.499
124.882
133.64
126.617
129.517
132.09
134.473
139.547
137.661
135.72
141.44
136.765
126.976
109.011
82.1947
52.2336
57.0297
61.6845
66.2529
96.4091
91.8735
87.1646
113.039
116.854
120.547
124.196
100.852
70.8048
75.3801
80.0417
84.8189
114.235
109.71
105.265
127.863
131.604
135.464
148.123
144.783
141.619
138.596
135.672
132.8
129.924
139.036
141.344
143.734
147.594
145.428
143.388
149.916
146.245
148.911
151.761
154.821
158.064
155.127
152.419
161.249
158.117
151.668
139.485
118.89
89.7688
57.8916
31.8887
15.5293
6.9345
2.87967
1.09957
0.376966
0.127973
0.0623881
0.0391548
0.027941
0.020823
0.01567
0.0115494
0.00802273
0.00489219
0.00532005
0.00586007
0.00654791
0.0099732
0.00920534
0.00854141
0.012177
0.0129442
0.0138436
0.014911
0.0108765
0.00737383
0.00449222
0.00479093
0.00241139
0.00112582
0.000521889
0.000356484
0.000171248
0.000187049
0.000225738
0.000532618
0.000230483
0.000361516
0.000176725
0.000200948
0.000346531
0.000712237
0.000900868
0.00046046
0.000295774
0.000377399
0.000158522
0.000170428
0.000473141
0.000433374
0.00018425
0.00027767
0.00071463
0.000304679
0.000153065
0.000184443
0.000268491
0.00045698
0.000932358
0.000462597
0.00238834
0.00140148
0.00130223
0.0021681
0.00371973
0.00213826
0.00312561
0.00163082
0.00123765
0.00163838
0.00594087
0.00661837
0.0101194
0.00935044
0.00809833
0.0118541
0.0161232
0.0175625
0.0130869
0.0142168
0.0191522
0.0256492
0.0233941
0.0214892
0.0198983
0.0185477
0.0174092
0.0164581
0.0218752
0.0231569
0.0247195
0.0340206
0.0314559
0.0294925
0.0422332
0.0462511
0.0514333
0.05816
0.0372962
0.0266265
0.0289738
0.0319068
0.0354816
0.0530786
0.0465661
0.0413437
0.0669207
0.0788756
0.0948458
0.118082
0.0616207
0.0398973
0.028421
0.0211647
0.0159623
0.0117475
0.00798507
0.00489874
0.00538195
0.00284392
0.00165511
0.00070287
0.000259164
0.000191534
0.000166146
0.000362247
0.00042157
0.00062102
0.00113652
0.00063277
0.000311417
0.000153487
0.000186087
0.000271528
0.000462046
0.000895055
0.000454753
0.00158318
0.00212845
0.00126171
0.000635825
0.000366863
0.000172054
0.000200912
0.000274581
0.000705537
0.000331457
0.000184665
0.000232782
0.000358283
0.000158936
0.000182808
0.000488142
0.000234728
0.000369597
0.000162214
0.000194738
0.000375052
0.000770829
0.00104596
0.000555124
0.000306753
0.000420708
0.000178243
0.000212533
0.000617321
0.00055131
0.000311569
0.000146302
0.000184002
0.000275932
0.0004871
0.000958913
0.000452268
0.00122181
0.000683098
0.000387465
0.000186461
0.000231648
0.000353786
0.000163592
0.000196299
0.00038323
0.000776928
0.000461113
0.000680242
0.00156227
0.00272957
0.00174852
0.00148353
0.00242675
0.00399577
0.00246441
0.00326428
0.00170205
0.00127174
0.00233516
0.000904572
0.000448587
0.000439066
0.00165773
0.00213661
0.00379515
0.00488103
0.00790061
0.00690635
0.0105532
0.00881828
0.0127111
0.0147113
0.0158943
0.0115984
0.013622
0.0094787
0.00589757
0.00709799
0.0107282
0.0126234
0.00867465
0.00546272
0.00626889
0.00358822
0.00201976
0.00106504
0.000551251
0.000307746
0.000425082
0.000186146
0.000225833
0.000614913
0.000327564
0.000172003
0.000227717
0.000354689
0.000159007
0.000189358
0.000507691
0.000248883
0.000408092
0.000177358
0.000226146
0.000433397
0.000842495
0.00118863
0.000668108
0.000374816
0.000181392
0.000231418
0.000452844
0.000779988
0.000677976
0.000355284
0.00016409
0.000201254
0.000387489
0.000559343
0.000313866
0.000435021
0.000194514
0.000241034
0.000625565
0.000358466
0.000181975
0.000247019
0.000394213
0.000168374
0.000204146
0.000574269
0.000509645
0.000993501
0.000493053
0.00176103
0.00309545
0.00157127
0.0010928
0.000559611
0.00191654
0.00160312
0.00265072
0.00426945
0.0027487
0.00341374
0.00181843
0.00126009
0.0023254
0.00155981
0.00209884
0.000950538
0.000447727
0.000449192
0.00487181
0.00596626
0.0092299
0.00805905
0.011945
0.00983658
0.0140584
0.0189554
0.0173465
0.0148715
0.0199179
0.0184094
0.0245828
0.0212728
0.0196618
0.0172724
0.0232138
0.0261367
0.0288871
0.0333913
0.0370164
0.0267507
0.0315071
0.0232382
0.0253089
0.0346497
0.049141
0.0439513
0.0650522
0.0537238
0.0471783
0.0404987
0.0358596
0.0317242
0.0454444
0.0522451
0.061063
0.10964
0.0879777
0.0728445
0.150813
0.19861
0.265769
0.343596
0.140696
0.072986
0.0877093
0.111885
0.140286
0.0754749
0.0962467
0.0601169
0.0416096
0.029885
0.0221276
0.0165165
0.0181052
0.0132751
0.0158318
0.0111974
0.00727053
0.00894231
0.00573291
0.00668352
0.0040004
0.00243338
0.00142405
0.00183553
0.000966898
0.000447309
0.000190944
0.000247883
0.000481011
0.000753635
0.000418733
0.000197621
0.000259955
0.000415063
0.0001871
0.000240457
0.000474215
0.000909324
0.000509472
0.000766202
0.00135435
0.00286335
0.0017269
0.00225567
0.00129791
0.000716604
0.000402439
0.000194491
0.000254668
0.000391989
0.000177455
0.000223213
0.000432146
0.00085362
0.000484599
0.000734146
0.00117316
0.000630743
0.000346272
0.000483885
0.000217848
0.000273885
0.000720263
0.000420516
0.000206363
0.000284825
0.000472569
0.00020476
0.00026335
0.000719237
0.000398103
0.000197989
0.000272907
0.000448761
0.000197593
0.00025557
0.000687411
0.000392854
0.000187828
0.000262721
0.000434088
0.00018584
0.000236737
0.000688806
0.000352094
0.000162918
0.000217661
0.000329243
0.000582403
0.00109844
0.000513432
0.00265616
0.0014241
0.000835393
0.000473757
0.000235524
0.000302884
0.000573094
0.00102297
0.000876734
0.000481515
0.000218
0.000283884
0.000553885
0.000840104
0.000474802
0.000231428
0.000301867
0.00058044
0.00103758
0.000879981
0.00144846
0.00222442
0.00359673
0.0021505
0.0045875
0.00298197
0.00194793
0.00231864
0.00147398
0.000825019
0.000469261
0.000236029
0.000304229
0.000480206
0.00022414
0.000286546
0.000548893
0.00100107
0.000568659
0.000855301
0.00139351
0.000823531
0.000472752
0.000239887
0.000306113
0.000572848
0.00101621
0.000862239
0.000478543
0.000229802
0.000288434
0.00054256
0.00080792
0.000468397
0.000247821
0.000310424
0.000560103
0.000974426
0.000835208
0.00142528
0.00222614
0.00189249
0.0029007
0.00445834
0.00304741
0.00344851
0.00188398
0.00212898
0.00132896
0.000795036
0.000459892
0.000238405
0.000290905
0.000544325
0.000949194
0.000824861
0.000404379
0.000514529
0.000290828
0.000365432
0.000574412
0.000289576
0.000343498
0.000835535
0.000521676
0.00028632
0.000367499
0.000580846
0.000289678
0.000343214
0.000853721
0.000751707
0.00126589
0.000697799
0.00206948
0.00338004
0.00212409
0.0012838
0.000707049
0.000747174
0.00180162
0.00180298
0.00281375
0.00435844
0.00296746
0.00682916
0.00576388
0.00872252
0.00699867
0.00588316
0.00351887
0.00312289
0.00194475
0.00221536
0.00878081
0.00736844
0.00585093
0.00490961
0.00360913
0.0020897
0.00109082
0.000557569
0.00059316
0.00149006
0.00224994
0.00147608
0.00271008
0.00112178
0.000560638
0.000588597
0.00153228
0.00113462
0.000589778
0.000628158
0.00215035
0.00379224
0.00230324
0.00266898
0.00155688
0.00176701
0.00235912
0.00380596
0.0051106
0.00821102
0.00643627
0.00534979
0.00856733
0.00987078
0.0121663
0.0170367
0.0141413
0.012617
0.0103011
0.0149266
0.0128062
0.017463
0.0233552
0.0213351
0.0286381
0.0242507
0.0329774
0.0397233
0.0441167
0.0316683
0.0381258
0.0276794
0.0205411
0.0229442
0.01732
0.0194906
0.0229282
0.0304326
0.0265235
0.0365673
0.0306667
0.0425795
0.0610412
0.05416
0.080772
0.063887
0.0566794
0.0461658
0.0682216
0.0869441
0.101852
0.137729
0.169186
0.0936515
0.123892
0.0766594
0.052121
0.0592269
0.0417187
0.0497927
0.0348712
0.025466
0.0188949
0.0137144
0.00955078
0.00631014
0.00776004
0.00491259
0.00608798
0.00763383
0.0112244
0.0093795
0.0134953
0.0116549
0.016575
0.0185905
0.0220089
0.0159554
0.018397
0.0131076
0.00893312
0.0110343
0.0156809
0.017914
0.0126999
0.0153105
0.0105533
0.0126557
0.0147317
0.010185
0.0124613
0.00852481
0.00565239
0.00667021
0.00426844
0.00275445
0.00173253
0.00216341
0.00129826
0.000688231
0.000363914
0.000286842
0.000515683
0.000568762
0.00029098
0.000343972
0.000827364
0.000734782
0.000515647
0.000287387
0.000364937
0.000570142
0.000289728
0.00034129
0.000833175
0.000733564
0.00123376
0.000684466
0.00205108
0.00327397
0.0029101
0.00170677
0.00420689
0.00269186
0.0016886
0.00209542
0.00125449
0.000656817
0.000355833
0.000285053
0.000500676
0.0005422
0.000270541
0.000310456
0.000766432
0.000410594
0.000629018
0.000316904
0.000380965
0.000681084
0.00117721
0.00198588
0.00319265
0.00284099
0.00164888
0.00404548
0.0025827
0.00163346
0.0010021
0.000603386
0.000336018
0.000401778
0.000605664
0.000320016
0.00037588
0.000675979
0.00119822
0.000713373
0.00104538
0.00157341
0.000966133
0.000588613
0.00033444
0.000396948
0.000591767
0.000316071
0.00036632
0.000657658
0.00114479
0.000689327
0.000995632
0.00193549
0.00305253
0.00203625
0.00272301
0.00389435
0.00243674
0.00150839
0.000926477
0.00055992
0.000315765
0.000364893
0.000496683
0.00107163
0.000606413
0.000364064
0.00044143
0.000659709
0.000358308
0.000412621
0.000927598
0.00059127
0.000350439
0.000427015
0.000631645
0.00032868
0.000367075
0.000873456
0.000474313
0.000694802
0.000373229
0.000436268
0.000732826
0.00124809
0.00273221
0.00166564
0.00131989
0.000755996
0.000798239
0.00227789
0.0037999
0.00241158
0.00284074
0.00193194
0.00255852
0.0013542
0.000801995
0.000839125
0.00175206
0.00501953
0.00605436
0.00899816
0.0076422
0.00620079
0.00520329
0.00785968
0.00638577
0.00534638
0.00805656
0.00655416
0.00551041
0.0083176
0.00973611
0.0140723
0.0121763
0.00994473
0.0143664
0.0202297
0.0176461
0.0242483
0.0207596
0.0177325
0.0242556
0.0213347
0.0288461
0.0245883
0.0215482
0.0291036
0.0248862
0.0333228
0.0297305
0.0250037
0.0225809
0.0302678
0.0337221
0.0406371
0.05787
0.0475506
0.0413347
0.0585091
0.0695895
0.0848913
0.101264
0.0668811
0.0461625
0.0564781
0.0395881
0.0454279
0.0331438
0.0388682
0.0547382
0.0804692
0.065268
0.097443
0.0830931
0.129111
0.157089
0.206433
0.123822
0.149336
0.0949834
0.0639735
0.0447338
0.0327555
0.0384925
0.0284902
0.0326721
0.0378846
0.0278799
0.0326685
0.0240641
0.01734
0.0198657
0.027443
0.0323719
0.023662
0.0169412
0.0118364
0.0138118
0.00953791
0.0115136
0.0134691
0.00926794
0.0112061
0.0130736
0.0186414
0.0160643
0.0225852
0.0191444
0.0164908
0.0231363
0.0195377
0.0270792
0.0369081
0.0432547
0.0318474
0.0364874
0.026662
0.0312047
0.0358822
0.0260848
0.0304773
0.0219862
0.0155676
0.0107858
0.00730215
0.00477595
0.00575055
0.00350587
0.00213565
0.0011871
0.000654179
0.000367184
0.000417985
0.000718222
0.000972272
0.000614387
0.000359528
0.00040838
0.000697406
0.00110342
0.000997436
0.00149008
0.00220472
0.00281935
0.00188215
0.00211658
0.00136064
0.000812782
0.000476357
0.000403952
0.000638571
0.000538257
0.000676328
0.000368747
0.000405215
0.000902349
0.000514647
0.000726616
0.000409372
0.000467097
0.000760702
0.00124862
0.00194245
0.00320837
0.00178097
0.00292357
0.00438662
0.0054834
0.00832363
0.00695844
0.0103536
0.00868833
0.0126963
0.0150043
0.0175544
0.0122373
0.0144304
0.00986367
0.00648444
0.00393582
0.00246414
0.00160353
0.00102087
0.000665728
0.000399426
0.000447391
0.000576369
0.00113455
0.000673458
0.000436042
0.000507668
0.000702471
0.000398219
0.000433248
0.000922843
0.000541192
0.00074808
0.0004333
0.000488152
0.000776181
0.00124872
0.00153445
0.00101872
0.000680215
0.000413311
0.000456077
0.000754531
0.00112029
0.00103299
0.000571608
0.000655886
0.00041163
0.000468317
0.000608237
0.000886
0.00133799
0.000831968
0.00208319
0.00187927
0.00274671
0.00437728
0.00281242
0.00304798
0.00161264
0.00108191
0.000742954
0.000475944
0.000526322
0.000677739
0.000423597
0.000458845
0.000706617
0.00117454
0.000817021
0.00109006
0.00181974
0.00218541
0.0013864
0.000874578
0.000602883
0.00070492
0.000431265
0.000455687
0.000926732
0.000537335
0.00070271
0.000436187
0.00047022
0.00070008
0.00114201
0.0024146
0.00131598
0.000864959
0.000608524
0.000704003
0.00043693
0.000458888
0.000914426
0.000534269
0.000690851
0.000437022
0.000468245
0.000688505
0.00112885
0.00175456
0.00324539
0.0017709
0.00608778
0.00500539
0.00376093
0.00224967
0.00175549
0.00669669
0.00563606
0.00894998
0.00733595
0.00607031
0.00361484
0.00209706
0.00167449
0.00276765
0.00134759
0.000838824
0.000861106
0.00194761
0.00255256
0.00510538
0.00798501
0.0118241
0.0137976
0.00935449
0.0112237
0.0163123
0.0189433
0.0133222
0.0156054
0.0106179
0.0128345
0.00843911
0.0100289
0.0149799
0.0209953
0.0182883
0.0251351
0.0218855
0.0300391
0.0262378
0.0228779
0.0196696
0.0169707
0.023782
0.0205064
0.0285446
0.0246391
0.0212615
0.0181338
0.0254082
0.0295714
0.0340611
0.0467509
0.0406444
0.035057
0.0479851
0.0417105
0.0570291
0.0489474
0.04255
0.0582325
0.0496483
0.0693256
0.0593614
0.0502466
0.0437673
0.0373071
0.0510594
0.0440197
0.06141
0.0521806
0.0441497
0.0625004
0.0533875
0.077869
0.118296
0.143215
0.0923389
0.113613
0.0755245
0.0897568
0.109021
0.0730452
0.087454
0.0604674
0.0709392
0.104591
0.16031
0.131739
0.206207
0.169557
0.137147
0.218651
0.179829
0.29505
0.233535
0.191434
0.323348
0.249564
0.425245
0.356272
0.272342
0.222246
0.168682
0.133714
0.107291
0.0859281
0.0730401
0.114469
0.0886136
0.150579
0.297891
0.238995
0.479305
0.349099
0.282377
0.199464
0.15965
0.115825
0.249588
0.193986
0.442851
0.325596
0.252934
0.185121
0.453358
0.583629
0.741724
0.95008
1.1602
0.546242
0.734217
0.346425
0.425743
0.879153
1.77037
1.50629
3.01251
2.40335
1.98192
1.59199
1.29367
1.02992
0.828064
0.645703
0.515
0.390911
0.308941
0.236292
0.181804
0.14177
0.114007
0.0944337
0.0804461
0.0701515
0.156415
0.19565
0.249612
0.713523
0.578424
0.465405
1.32064
1.56749
1.8645
2.20107
0.872481
0.316102
0.394815
0.504731
0.630692
1.56221
1.29836
1.06087
2.61118
3.08423
3.64496
8.1295
6.97089
6.04139
5.18752
4.50339
3.87066
3.3599
7.90872
8.95707
10.2265
21.79
19.4303
17.3934
35.0887
38.5729
42.4386
46.6327
24.3539
11.591
13.2709
15.0679
17.3044
34.4865
30.6177
27.3734
51.3313
56.3789
62.0751
68.1021
38.5773
19.682
9.41077
4.31978
1.90804
0.797436
0.97582
1.23721
1.48061
3.27974
2.78911
2.27471
5.08466
6.05886
7.08389
8.52043
4.06189
1.87708
2.21645
2.80045
3.28637
6.72969
5.88532
4.7026
9.84748
12.0009
13.6531
26.997
23.6385
20.064
17.3557
14.848
12.7592
10.9767
22.6454
25.7909
29.6662
54.7787
48.6072
43.4978
74.9435
82.0446
90.1521
98.3995
61.0937
33.8268
38.7761
44.2852
50.3801
85.4414
76.3943
68.6736
107.847
117.284
128.076
169.082
158.199
148.224
138.373
129.316
120.495
112.36
104.542
97.3108
90.4444
84.0813
78.0929
72.5279
67.3164
62.45
94.9125
100.297
105.942
133.983
128.731
123.709
143.699
148.141
152.834
157.806
139.498
111.878
118.129
124.706
131.645
157.816
151.393
145.293
163.077
168.667
174.592
184.267
178.639
173.362
168.423
163.803
159.485
155.447
161.671
165.503
169.632
172.491
168.445
164.704
176.859
174.076
178.851
183.973
189.457
192.04
186.619
181.563
197.84
195.316
190.262
180.871
164.577
138.926
146.614
154.643
163.128
187.05
179.178
171.697
187.516
194.542
201.963
209.787
195.3
171.938
181.258
190.872
201.057
222.55
213.033
203.973
218.031
226.697
235.805
243.549
234.646
226.191
218.173
210.582
203.408
196.638
201.563
208.209
215.268
217.634
210.626
204.031
225.068
222.749
230.663
239.02
247.829
250.023
241.253
232.938
259.257
257.1
252.907
245.352
232.457
211.497
179.979
138.758
94.8255
57.7133
32.1399
16.8074
8.44441
4.13615
4.83389
6.07839
7.03785
3.56113
4.54131
2.30861
1.168
0.582788
0.702511
0.936706
1.11195
0.580536
0.773261
0.406339
0.209598
0.260739
0.13938
0.186438
0.238633
0.429238
0.353653
0.654882
0.492286
0.919403
1.7185
1.46044
2.7598
2.12394
1.80994
1.3816
2.69816
3.49015
4.06175
5.22171
6.05467
3.22344
4.16162
2.23927
1.20897
1.42494
0.77876
1.02317
0.563615
0.306697
0.39024
0.481187
0.616789
1.06512
0.868642
0.680292
1.2082
1.57454
1.85572
3.29862
2.82441
2.1806
1.85925
3.39345
2.622
4.84177
8.93224
7.73297
14.2906
11.3277
9.84809
7.75362
6.71763
5.25691
10.1823
8.87599
17.1198
13.7404
12.0592
9.64448
18.9627
23.3323
26.2724
32.1581
36.0973
19.4465
24.1183
12.8348
14.6826
27.3043
49.0589
43.8862
75.5741
63.7069
57.5848
48.1388
43.3471
36.1473
64.865
74.5976
82.6451
128.137
116.618
105.239
150.811
162.824
175.953
189.417
141.838
95.2497
104.21
119.748
129.791
83.2005
97.7708
59.1473
33.6207
18.3889
20.9589
26.0574
29.5718
16.3733
20.5001
11.3265
6.2072
7.19186
3.95744
5.08433
5.90378
10.5556
9.15028
16.3924
13.0285
23.3845
41.1789
36.4621
62.8117
51.9209
46.2831
37.902
65.7926
78.5708
86.9094
102.712
112.921
70.0748
83.9106
50.3127
29.0372
32.9633
18.7707
23.4219
13.3226
7.52534
4.24219
2.37413
1.317
0.739384
0.958491
0.554717
0.655476
0.388044
0.496314
0.596119
0.358019
0.449877
0.272934
0.332028
0.41242
0.253988
0.310333
0.19555
0.126737
0.0850659
0.100839
0.121689
0.0825503
0.0974948
0.0677352
0.0801102
0.0942439
0.0661156
0.0775933
0.0556777
0.0643534
0.090982
0.133237
0.112162
0.16766
0.139228
0.116844
0.176325
0.14551
0.224135
0.185651
0.152333
0.237764
0.291237
0.354057
0.433856
0.273696
0.331486
0.212191
0.257745
0.311572
0.201263
0.243264
0.159496
0.107531
0.0749558
0.0540193
0.0393175
0.0451874
0.0328657
0.0377532
0.0273967
0.0315304
0.0433129
0.0598596
0.0519931
0.0721943
0.0623145
0.0875578
0.102936
0.121525
0.0839294
0.0982447
0.0690909
0.0495985
0.0360103
0.0411575
0.046979
0.0342191
0.0388694
0.0285664
0.0324461
0.0241156
0.0176347
0.012158
0.00754963
0.00400795
0.00224006
0.00138961
0.00084058
0.000597584
0.000682931
0.000424731
0.000437656
0.00087429
0.000474952
0.000591645
0.00104687
0.000634577
0.000435737
0.000478207
0.000582347
0.000809914
0.00121205
0.000787594
0.00246983
0.00173002
0.00229065
0.00344726
0.00160096
0.000966796
0.000687357
0.0004473
0.00047327
0.000554122
0.00101207
0.000603798
0.000413918
0.000449667
0.000530902
0.000726477
0.00117312
0.000725783
0.00142737
0.000854273
0.000588546
0.000725022
0.000426991
0.00043579
0.000887496
0.000844088
0.000472903
0.000609516
0.0011269
0.000633375
0.000444921
0.000516911
0.000601388
0.000815501
0.00138128
0.000814536
0.00371225
0.00164608
0.00100106
0.000734193
0.000535423
0.000563838
0.000789496
0.0010758
0.000997643
0.000605113
0.000608714
0.00091687
0.000582846
0.000573056
0.000805258
0.00147588
0.00256611
0.00528157
0.00239396
0.00781269
0.00366733
0.00188852
0.00107898
0.000730614
0.000832152
0.000570498
0.000565159
0.00120833
0.000546125
0.000940927
0.000507451
0.000321625
0.000299916
0.000386944
0.000623719
0.000416795
0.000294157
0.000345946
0.000420763
0.000607087
0.000924125
0.000546135
0.00146224
0.000829388
0.000590678
0.000410649
0.000500382
0.000721151
0.00102318
0.00151988
0.00111768
0.000804385
0.000572732
0.000772201
0.00107007
0.00156836
0.00120347
0.000957253
0.00137434
0.00191258
0.00171086
0.00158791
0.00221248
0.00314913
0.00535928
0.00341224
0.00232284
0.00253027
0.00259079
0.00162127
0.00194641
0.00232381
0.00143032
0.00173243
0.00229981
0.00326533
0.00505554
0.00343586
0.00444105
0.00387017
0.00605315
0.00856295
0.0078902
0.00792061
0.00793181
0.00900123
0.00910551
0.0081495
0.00634044
0.00669664
0.0121021
0.0153162
0.0149865
0.0136347
0.0153746
0.0171111
0.0189276
0.0220944
0.0197829
0.0171096
0.0191445
0.0222427
0.0256105
0.0294845
0.0249075
0.0209829
0.0158957
0.0117594
0.0124354
0.0153729
0.00991181
0.00741119
0.00973478
0.0142676
0.0115216
0.00927853
0.00525185
0.00339201
0.00230691
0.00331261
0.00164172
0.00103321
0.00188007
0.00631777
0.00268398
0.00448629
0.0119181
0.0146609
0.0214146
0.0181187
0.0136806
0.0101511
0.00786083
0.00584802
0.00315748
0.00184756
0.00209221
0.00330922
0.00238187
0.00446947
0.00222957
0.00173426
0.00847584
0.00676465
0.00545833
0.00948728
0.0113643
0.0137282
0.0164114
0.0105503
0.0131653
0.0195172
0.0231557
0.0161122
0.0207274
0.0297609
0.042395
0.0325128
0.026739
0.0232027
0.0199793
0.0170699
0.0145256
0.0204095
0.0234448
0.0268911
0.0355159
0.0310072
0.0273705
0.036731
0.0419616
0.0493122
0.0611142
0.0417415
0.0307902
0.0364166
0.0473281
0.0595654
0.0825159
0.0691324
0.053069
0.0792343
0.0983583
0.115281
0.16274
0.139032
0.115855
0.0919621
0.0725632
0.0595341
0.0507872
0.0442786
0.0621022
0.0537946
0.0762184
0.0656366
0.0569706
0.0801763
0.0936813
0.110738
0.165963
0.137915
0.115924
0.172966
0.144495
0.218417
0.181546
0.151776
0.127368
0.191085
0.230121
0.277692
0.336255
0.407608
0.263918
0.320189
0.208559
0.253336
0.389129
0.597559
0.494192
0.763177
0.632363
0.522642
0.431111
0.355923
0.293698
0.458867
0.378744
0.597533
0.490703
0.404646
0.644182
0.527125
0.848
0.697447
0.569641
0.46643
0.380658
0.62059
0.502932
0.827022
0.681542
0.545731
0.908752
0.755681
1.28716
1.00396
0.849938
1.46179
1.12755
1.97685
1.64988
2.83769
3.5204
4.29789
2.51666
2.95282
1.71254
2.20268
2.57226
1.52404
1.92549
1.14046
1.37206
1.70195
1.02382
1.242
0.757671
0.927662
1.52197
2.50845
2.04692
3.3848
2.84457
2.28622
3.82333
3.26573
5.539
4.37466
3.76724
6.39835
5.16161
9.06049
7.35084
6.25781
4.94307
8.69802
10.9984
12.6692
21.88
19.1474
15.2979
26.6915
33.0161
37.4351
45.8645
27.1302
15.784
18.3004
10.8163
12.9591
7.5088
9.34604
15.6664
26.1302
22.2749
37.7623
30.9456
51.7912
62.6321
70.7599
43.3111
51.746
31.055
18.3809
10.8432
6.42086
8.012
4.77245
5.61012
6.8848
4.15013
4.94203
3.01366
1.84281
1.13081
1.37396
1.66745
1.034
1.25114
0.781114
0.94979
1.1473
0.723761
0.877296
0.557107
0.674364
1.0584
1.66457
1.38574
2.19397
1.82416
1.51591
2.42612
2.01171
3.24545
2.69724
2.23597
3.65177
4.37587
5.25217
8.52309
7.11649
5.98126
9.81872
8.11987
13.3587
11.4328
9.31974
15.5216
13.4079
22.2903
36.7298
42.8829
25.8681
31.1839
18.9437
21.9797
26.431
16.1295
18.8998
11.5949
13.8569
22.5247
36.4754
30.7421
49.6854
42.9913
36.0611
58.6344
50.7441
81.1023
69.9935
59.7736
95.2764
84.0617
131.472
112.336
100.625
84.5925
75.6263
62.727
55.8534
45.8148
40.5687
68.3745
56.5171
93.051
144.169
131.984
191.831
168.655
155.923
135.504
124.504
107.044
159.451
148.125
201.782
183.298
170.318
154.155
203.382
218.413
233.016
249.624
264.797
215.479
235.93
180.282
193.068
250.512
298.662
282.865
317.755
301.656
286.423
271.451
256.948
243.084
229.365
216.55
203.705
191.871
222.572
233.864
245.842
264.955
253.642
242.856
255.364
265.826
276.774
288.181
276.651
258.016
270.903
284
297.787
314.752
301.541
288.905
300.094
312.473
325.373
331.831
319.07
306.819
295.061
283.801
273.024
262.73
266.84
277.058
287.761
289.822
279.149
268.963
300.99
298.956
310.649
322.845
335.55
337.516
324.831
312.658
350.715
348.767
345.094
338.746
328.356
311.85
326.527
341.591
357.151
333.711
350.907
317.985
272.485
216
230.367
254.971
271.021
206.452
231.949
166.456
110.211
121.435
76.361
91.3751
101.483
155.748
142.032
206.051
180.856
248.635
314.64
296.825
351.927
328.14
311.218
288.154
334.535
354.875
372.327
403.393
385.849
367.624
389.681
373.236
387.891
372.289
357.132
342.538
352.65
367.032
381.95
397.35
413.283
404.022
420.637
406.783
424.127
437.738
446.646
429.704
435.483
419.135
403.292
387.973
373.162
358.875
362.501
376.751
391.523
393.428
378.669
364.432
408.707
406.812
422.622
438.948
455.79
452.351
469.72
464.08
455.359
442.221
422.557
393.466
411.94
370.21
394.446
341.193
275.888
294.751
222.936
250.49
179.611
119.894
132.637
154.426
170.328
242.669
222.916
196.202
270.047
299.323
321.592
396.45
373.298
344.23
323.168
387.736
360.794
414.123
453.272
433.712
461.011
440.997
460.479
479.526
498.708
480.392
501.185
475.576
438.641
459.668
409.064
436.162
459.07
506.667
484.396
519.015
496.222
521.519
538.762
518.661
530.599
511.042
492.028
473.423
482.017
500.445
519.354
538.748
558.598
550.54
571.007
559.574
543.041
564.305
540.697
563.971
531.605
486.217
425.808
351.992
271.668
195.21
214.771
146.725
168.718
111.027
126.09
144.453
93.5374
108.07
68.9457
79.2308
92.2472
58.5115
67.5512
42.4408
26.399
16.3481
10.1159
6.26852
3.89429
4.65325
2.90869
3.48403
4.15264
2.62458
3.13435
1.99545
1.27439
0.81544
0.982207
1.17891
1.40831
0.916796
1.09563
0.718818
0.471798
0.308932
0.202017
0.133075
0.0896412
0.10751
0.0728137
0.0877893
0.10918
0.164579
0.132171
0.200516
0.162471
0.247504
0.375845
0.453261
0.302415
0.364579
0.245873
0.295552
0.20193
0.1371
0.167246
0.197646
0.232008
0.333692
0.28387
0.241118
0.349673
0.411573
0.483777
0.706975
0.601766
0.511236
0.433317
0.639317
0.540414
0.804854
0.678782
0.568317
0.858999
1.02032
1.20673
1.42357
0.950461
1.11986
0.753691
0.886872
1.04131
1.54533
1.3169
1.96955
1.67609
2.52585
2.14726
1.82188
1.54269
1.30266
1.98594
1.67546
2.57508
2.17084
1.82463
1.52743
2.38145
2.83468
3.36264
5.23464
4.42392
3.72771
5.85981
4.94202
7.82225
6.59453
5.55062
8.87116
7.46822
12.0183
19.363
22.7801
14.2117
16.7797
10.5077
12.4206
14.6406
9.24839
10.9155
6.93553
8.1864
12.8498
20.2134
17.2244
27.1946
23.205
19.7557
31.3974
26.7955
42.6415
36.4244
31.1474
49.8076
57.8289
67.2732
77.7813
49.6699
57.7701
36.7204
42.8253
49.823
31.7918
37.0835
23.6738
15.0985
9.6448
6.18143
3.97942
4.69802
3.0459
3.59485
2.34766
2.7691
4.23418
6.50927
5.53543
8.56491
7.28315
11.338
13.3031
15.5774
10.0524
11.7758
7.63998
4.97773
3.25984
3.83014
4.49146
2.96527
3.47411
2.30958
2.70256
1.8094
1.21973
0.828382
0.56704
0.391403
0.27244
0.191145
0.13501
0.0957911
0.0683976
0.0496522
0.0361463
0.0259673
0.0302555
0.0420586
0.0520617
0.0384598
0.0284351
0.0206438
0.0256951
0.0201728
0.025967
0.0210747
0.0176004
0.0235585
0.0281383
0.0339304
0.0399412
0.0329439
0.0277689
0.0337495
0.0394792
0.0479646
0.0538628
0.0451675
0.0385619
0.0334216
0.0288302
0.0246329
0.0207429
0.0225794
0.0244207
0.0262631
0.0319576
0.0295206
0.0270478
0.0320529
0.035263
0.0384451
0.0416163
0.0343983
0.0281058
0.0299464
0.0317869
0.033629
0.0416632
0.0392467
0.0368252
0.0447685
0.0479084
0.0510387
0.0619142
0.0579009
0.0538838
0.049844
0.0458092
0.041705
0.0376792
0.0440717
0.0489684
0.0541922
0.0642062
0.0576943
0.0519781
0.0622724
0.0690028
0.0771007
0.0846254
0.0703335
0.0592269
0.064347
0.0694317
0.074544
0.0895805
0.0831009
0.076739
0.0927008
0.100751
0.109068
0.117556
0.0961327
0.0796706
0.0659249
0.0541654
0.0440804
0.035477
0.0281962
0.0220871
0.0170036
0.0128152
0.0093938
0.00979023
0.0133688
0.0139408
0.0101988
0.0106221
0.0145377
0.0193921
0.0185695
0.0177752
0.0231413
0.0242178
0.0253216
0.0264573
0.0202489
0.0151687
0.0110637
0.0115307
0.0158453
0.0165609
0.0120249
0.0125462
0.0173122
0.0230509
0.0220764
0.0211439
0.0276305
0.0288475
0.0301189
0.031459
0.0240775
0.0181055
0.0130977
0.0136828
0.0189473
0.0198455
0.0143051
0.0149676
0.0208099
0.0276026
0.026336
0.0251675
0.0328832
0.0344106
0.0360632
0.0378658
0.0289966
0.0218534
0.0156716
0.0164162
0.0230007
0.0242679
0.0172245
0.0181125
0.025668
0.0341845
0.0322853
0.0305586
0.0398407
0.0419954
0.0443497
0.0566386
0.0537576
0.0511115
0.0486675
0.0464032
0.0442991
0.042336
0.0404939
0.0387538
0.0370982
0.0355116
0.0339799
0.032491
0.0310355
0.0296059
0.0373358
0.0392121
0.0411141
0.051408
0.0489435
0.0465044
0.0572963
0.0604407
0.0636102
0.0668182
0.0539098
0.0430521
0.0450386
0.047088
0.0492155
0.0617847
0.0590825
0.0564629
0.0700799
0.073412
0.076833
0.0950025
0.0906195
0.0863492
0.0821665
0.0780499
0.073981
0.0699438
0.0848307
0.0900343
0.0952984
0.116524
0.109596
0.102803
0.126286
0.135275
0.144571
0.154235
0.123626
0.100645
0.106102
0.111701
0.117482
0.14647
0.138537
0.130945
0.164345
0.174993
0.186298
0.198405
0.154828
0.123493
0.0995278
0.0803636
0.0645868
0.0514376
0.0537715
0.0562357
0.0588499
0.0737876
0.0705664
0.0675072
0.0840271
0.0878504
0.0918665
0.0961152
0.077199
0.0616356
0.0646193
0.0678343
0.071322
0.0889633
0.08474
0.0808355
0.100647
0.105523
0.110819
0.139491
0.132334
0.125845
0.119885
0.114349
0.109153
0.10423
0.129795
0.136463
0.143591
0.183651
0.173269
0.163717
0.211493
0.225788
0.24157
0.259188
0.195072
0.151297
0.159734
0.169097
0.179637
0.238674
0.222185
0.207801
0.279084
0.301815
0.32808
0.462996
0.421447
0.385626
0.354442
0.327028
0.302694
0.280884
0.261153
0.24314
0.226552
0.211152
0.196746
0.183176
0.170316
0.158061
0.146322
0.135064
0.124172
0.113773
0.103476
0.0939774
0.083963
0.0754322
0.0656776
0.0577089
0.0490821
0.0408347
0.0341476
0.0439046
0.0339684
0.0453409
0.0607615
0.0741593
0.0568597
0.0649776
0.0509288
0.0618111
0.0707009
0.0887705
0.0785658
0.10119
0.0846803
0.112437
0.0980533
0.0820138
0.0705416
0.0584145
0.0815324
0.0959653
0.111962
0.154461
0.132195
0.113533
0.158669
0.184487
0.215312
0.249998
0.180064
0.131753
0.151863
0.177414
0.132681
0.150631
0.114308
0.133044
0.103318
0.0816586
0.0926979
0.104071
0.11649
0.147367
0.131675
0.116417
0.149766
0.170242
0.190809
0.213618
0.164112
0.128938
0.142344
0.156149
0.170764
0.220842
0.200782
0.181966
0.237835
0.263915
0.291937
0.393626
0.354112
0.317585
0.284123
0.252662
0.224747
0.197246
0.174679
0.233943
0.202558
0.277186
0.241741
0.208275
0.289567
0.334952
0.385043
0.442649
0.319182
0.36338
0.265316
0.302564
0.341333
0.469169
0.414539
0.576704
0.505345
0.711996
0.622523
0.541853
0.470765
0.407547
0.351807
0.303323
0.260341
0.223647
0.318316
0.37094
0.431709
0.62031
0.533211
0.4573
0.662725
0.7729
0.899096
1.04334
0.719685
0.500729
0.579927
0.66964
0.771215
1.10865
0.962304
0.83336
1.20813
1.39546
1.60819
2.35158
2.0399
1.76566
1.52471
1.31365
1.1292
0.968279
1.42557
1.66228
1.93377
2.8662
2.46427
2.11399
3.15572
3.67695
4.27523
4.96053
3.32643
2.24451
2.59934
3.00366
3.46358
5.13489
4.45202
3.85229
5.74397
6.63813
7.65709
8.81676
5.91116
3.98571
2.70485
1.84893
1.27408
0.885976
1.01455
1.15927
0.812954
0.924461
0.654441
0.741567
0.530626
0.385107
0.432108
0.483807
0.54001
0.751772
0.671049
0.59733
0.837096
0.943074
1.05985
1.51109
1.34089
1.18732
1.0493
1.50113
1.32053
1.90492
1.66999
1.46033
2.12079
2.42734
2.77221
3.16017
2.16854
2.46343
1.7021
1.92645
2.17644
3.16366
2.7938
4.08593
3.59599
5.2895
4.64127
4.06623
3.55644
3.10466
4.57767
5.24792
6.00616
8.926
7.7925
6.79263
10.1352
11.6331
13.3339
15.265
10.2106
6.86361
7.83305
8.92968
6.02061
6.84561
4.63674
5.25686
3.57839
2.45555
1.70024
1.18899
0.840575
0.601482
0.436531
0.322056
0.242148
0.186084
0.202275
0.219416
0.237648
0.315543
0.28931
0.264924
0.354512
0.389574
0.427609
0.469013
0.343883
0.257138
0.278091
0.300758
0.325444
0.445066
0.408213
0.374643
0.514299
0.564061
0.619029
0.872597
0.790606
0.716812
0.650034
0.589328
0.533916
0.483154
0.66874
0.742479
0.823544
1.16484
1.04583
0.938181
1.3318
1.49012
1.66594
1.86204
1.29678
0.912884
1.01168
1.12151
1.24416
1.79231
1.60796
1.44371
2.08162
2.32831
2.60704
2.92388
2.00055
1.38187
0.964186
0.680102
0.485779
0.352523
0.382451
0.415792
0.453236
0.639007
0.581776
0.531059
0.74838
0.825231
0.912352
1.01188
0.704096
0.495644
0.544089
0.599923
0.664865
0.965813
0.865054
0.778731
1.12651
1.25969
1.41587
2.09397
1.85104
1.64502
1.46862
1.31626
1.18357
1.06712
1.53753
1.71461
1.91747
2.81965
2.50787
2.23725
3.28568
3.70162
4.18373
4.74655
3.18175
2.15171
2.42442
2.74472
3.12455
4.70333
4.10631
3.60566
5.40873
6.195
7.13773
10.9104
9.41627
8.17617
7.13754
6.25922
5.51007
4.86707
4.31142
3.82742
3.40348
3.03046
2.70035
2.40681
2.14495
1.91056
2.76746
3.1168
3.50911
5.15911
4.56796
4.04402
5.95605
6.74619
7.64151
8.65933
5.82823
3.95106
4.45078
5.01849
5.6664
8.45099
7.45618
6.5885
9.82083
11.152
12.6848
19.1388
16.7724
14.725
12.9451
11.3913
10.0298
8.83291
7.77782
11.5784
10.1711
15.1923
13.318
11.6667
17.458
19.95
22.7844
26.0129
17.3228
19.7489
13.1766
14.9955
17.0716
25.6862
22.5177
33.9086
29.6965
44.7193
39.1409
34.2566
29.9733
26.2121
22.9064
19.9992
17.4417
15.1921
13.214
11.4756
9.94941
8.61094
7.43875
6.41376
5.51908
4.73965
4.062
6.14002
5.25662
7.99506
6.84005
5.84065
8.95
10.4648
12.2127
18.7142
16.067
13.7682
21.2344
18.2051
28.181
24.1838
20.7119
17.7012
27.6627
32.2564
37.5293
43.5701
50.4715
32.7713
38.0318
24.7197
28.721
44.0462
67.2778
58.3371
88.8305
77.2627
67.0355
58.0197
50.0967
43.1514
66.9146
57.8153
89.2295
77.4132
66.9584
103.272
89.8126
136.846
119.641
104.448
90.5519
78.6668
121.634
105.586
160.302
141.478
123.37
185.104
163.731
236.693
212.815
188.178
265.768
242.246
325.374
294.707
376.829
407.879
434.972
351.602
383.397
295.324
322.705
354.007
263.955
291.93
208.55
233.376
260.707
182.081
204.89
138.57
158.049
230.437
320.086
289.215
385.978
353.328
321.904
417.579
384.697
476.283
445.015
412.446
495.269
466.351
536.257
506.799
480.26
450.813
510.494
537.679
563.079
604.455
580.157
554.971
586.604
610.37
633.851
658.119
629.941
590.346
616.628
563.98
593.449
526.808
557.06
622.022
670.986
644.035
680.834
655.011
682.34
707.107
731.966
706.536
732.712
698.578
651.534
588.703
509.449
542.236
450.775
485.079
519.989
420.14
455.178
352.164
257.401
178.967
202.263
227.391
155.77
176.778
118.428
135.324
154.131
102.553
117.511
77.2443
88.9287
134.239
197.865
174.939
252.375
224.996
199.798
284.18
254.776
350.858
317.781
286.763
386.198
421.443
458.196
496.031
385.611
422.106
315.73
349.301
384.865
281.991
313.836
222.997
152.87
102.103
116.904
133.472
151.946
101.873
116.533
77.4141
50.9073
33.3056
21.7563
14.2257
9.3272
10.8606
7.15777
8.32793
9.67077
14.6424
12.6222
19.1944
16.5396
25.2458
38.5477
44.5295
29.2407
33.8061
22.2348
25.7111
16.9551
11.209
12.9681
14.977
17.2681
26.0558
22.616
19.5986
29.6796
34.2034
39.3538
59.3495
51.6907
44.9457
39.0142
59.0854
51.3419
77.6307
67.584
58.7163
88.8749
101.798
116.328
132.62
88.9871
101.794
67.8705
77.819
89.0648
132.38
116.204
171.131
150.832
219.266
194.297
171.687
151.289
132.955
195.17
172.468
248.832
221.41
196.341
173.53
250.408
280.153
312.257
422.401
384.108
347.893
461.499
422.302
540.179
499.532
460.111
574.739
534.964
643.127
604.387
566.129
528.366
491.43
591.43
555.452
643.591
609.576
575.893
651.547
619.813
680.67
726.022
753.819
710.256
739.729
683.122
714.921
746.683
677.706
711.902
627.689
664.247
746.129
810.254
778.485
828.765
799.046
769.394
809.614
781.619
812.071
785.446
758.926
782.616
757.213
774.853
750.174
725.838
701.714
678.027
654.504
631.549
608.666
586.521
602.194
580.57
591.842
599.669
578.919
584.243
563.974
544.164
524.825
505.965
487.596
490.998
473.14
475.01
457.663
440.828
424.508
492.863
511.215
509.351
528.197
530.058
549.383
547.523
567.321
587.578
608.283
604.958
626.108
620.867
613.17
634.855
624.043
646.432
669.078
679.467
656.989
664.487
642.468
647.675
650.977
629.421
631.276
610.139
589.436
569.18
652.83
674.787
672.937
669.648
692.006
686.88
709.654
702.347
692.179
715.555
739.312
763.342
772.972
749.112
725.552
732.773
756.233
780.004
784.958
761.23
737.815
714.736
717.998
695.283
697.13
719.84
742.9
741.062
764.459
788.168
789.991
766.29
813.983
812.169
808.981
804.074
797.139
787.693
812.299
799.756
824.933
808.304
834.165
860.242
838.903
865.854
837.665
865.826
894.044
858.484
888.209
841.977
780.315
700.914
737.672
774.401
682.149
721.371
615.246
656.3
697.756
581.892
624.485
502.306
544.559
667.777
781.269
739.46
839.054
799.921
760.659
847.554
811.054
882.292
848.438
814.437
873.629
905.186
936.63
967.937
915.96
949.415
883.852
919.892
955.628
877.974
916.6
823.048
711.583
588.075
462.662
346.723
383.521
278.682
311.012
220.179
247.61
345.847
463.835
422.589
548.505
504.751
632.658
678.103
724.199
593.735
640.233
507.131
383.186
277.562
310.116
345.327
246.734
276.829
193.685
218.664
150.494
101.755
68.0343
45.2108
29.9732
19.8783
22.8498
26.2304
30.0752
45.2615
39.4996
34.4307
51.8652
59.4192
67.9892
77.7072
51.8098
34.4478
39.4217
45.0824
51.5298
77.3352
67.7127
59.2522
88.7232
101.208
115.357
170.139
149.824
131.78
115.768
101.572
88.9974
77.8703
116.05
132.126
150.175
218.348
193.282
170.731
246.236
276.567
309.809
346.1
246.133
170.402
193.032
218.301
246.46
347.845
310.683
276.844
385.56
428.276
474.301
620.287
567.419
517.236
469.873
425.416
383.904
345.332
309.664
423.805
383.225
509.683
465.192
422.991
552.322
599.219
647.608
785.058
736.133
687.778
817.502
770.735
888.42
844.304
800.019
755.722
864.671
906.023
946.997
987.497
1027.43
932.216
975.555
864.294
910.916
1018.31
1105.32
1066.73
1138.6
1103.03
1066.83
1030.03
992.69
954.86
1026.02
991.017
1048.21
1015.57
982.626
1030.06
999.088
1036.2
1006.75
977.2
947.583
917.913
950.632
922.321
947.443
920.147
892.948
912.882
886.48
901.719
875.928
850.32
862.275
837.173
846.277
821.577
828.419
853.021
877.858
871.211
896.364
887.598
913.114
938.808
927.684
953.798
939.418
966.075
992.83
974.815
1002.24
978.964
1007.3
1029.71
1046.56
1019.67
1032.85
1006.4
980.045
990.639
964.656
972.915
947.236
921.712
928.157
902.911
907.606
882.61
857.827
833.277
836.442
860.967
885.721
887.497
862.757
838.245
912.445
910.685
935.837
932.791
958.148
953.577
979.148
983.653
986.622
961.157
962.88
937.58
988.324
1013.89
1012.21
1009.29
1004.85
998.729
1024.66
1016.74
1042.93
1069.19
1059.37
1085.93
1073.5
1057.2
1035.61
1063.9
1092.12
1065.55
1094.77
1060.84
1091.39
1121.71
1080.53
1112.5
1060.6
1094.72
1144.1
1181.52
1151.76
1181.44
1152.74
1123.84
1148.31
1120.27
1139.57
1112.15
1084.69
1100.45
1127.4
1154.33
1165.72
1139.13
1112.53
1121.86
1095.51
1102.92
1076.77
1050.68
1056.57
1030.67
1035.03
1037.91
1063.69
1060.86
1086.75
1082.55
1108.57
1134.63
1129.09
1155.28
1148.22
1174.58
1181.47
1186.75
1160.7
1164.65
1138.67
1112.7
1115.43
1089.54
1091.14
1065.32
1039.56
1117
1142.89
1141.35
1167.27
1193.19
1190.62
1216.56
1212.78
1207.62
1200.9
1192.28
1181.21
1166.92
1194.19
1176.24
1204.02
1231.62
1209.92
1238.16
1210.98
1175.31
1128.35
1161.47
1194.03
1226.03
1173.5
1207.7
1143.13
1060.37
957.182
834.308
697.255
556.322
604.931
467.031
512.824
561.069
707.183
655.298
799.287
747.903
883.643
1002.92
1047.97
932.829
981.641
851.131
903.159
760.319
611.605
664.232
718.708
774.752
924.265
869.168
814.415
955.098
1006.69
1057.67
1169.21
1123.82
1077.32
1029.87
1135.45
1092.19
1181.43
1142.01
1101.64
1180.13
1216.25
1251.46
1285.73
1219.81
1257.11
1177.64
1218.67
1258.46
1328.28
1293.28
1351.33
1319.02
1367.13
1336.86
1305.76
1273.85
1241.15
1288.21
1257.43
1295.66
1266.28
1236.42
1206.09
1240.09
1268.85
1297.22
1321.15
1293.8
1266.13
1286.22
1259.03
1275.19
1248.35
1221.34
1234.74
1208.02
1218.77
1227.17
1253.37
1245.19
1271.5
1261.34
1287.8
1314.08
1301.85
1328.28
1313.15
1339.81
1354.47
1366.04
1340.17
1349.55
1323.7
1297.68
1305.45
1279.46
1285.7
1259.76
1233.72
1238.77
1264.68
1290.51
1316.22
1311.53
1337.23
1331.28
1356.95
1382.43
1375.19
1400.6
1391.66
1380.39
1366.17
1348.15
1325.18
1352.71
1324.52
1352.84
1318.35
1347.83
1380.61
1406.38
1379.79
1401.01
1374.78
1392.19
1417.86
1443.14
1426.82
1452.19
1432.49
1407.81
1376.63
1404.74
1432.14
1396.57
1425.16
1382.63
1412.9
1362.1
1296.94
1213.37
1107.83
979.388
832.051
675.651
523.642
388.508
277.771
192.99
131.39
88.2861
58.8808
67.2733
76.8694
51.1029
58.4243
38.737
44.2879
29.3232
19.4486
22.1801
25.3321
28.9855
43.9837
38.3574
33.5127
50.6901
58.1002
66.7097
76.7535
50.5478
33.2414
21.888
14.4594
9.59787
6.40952
7.26773
8.26563
9.43269
14.3042
12.4808
10.9284
16.5258
18.9462
21.8009
25.1941
16.4635
10.8077
12.4428
14.4042
16.7766
25.9115
22.1449
19.0419
29.2571
34.1595
40.1289
62.1693
52.7595
45.0425
38.6593
33.3392
28.874
25.0997
38.2253
44.0953
51.0517
78.0618
67.3136
58.2437
88.5205
102.367
118.734
138.166
90.8706
59.3488
69.3102
81.3534
96.0216
147.162
124.727
106.222
161.333
189.062
222.364
262.452
174.503
114.016
73.7427
47.4679
30.5296
19.6743
12.7281
8.27938
5.42252
3.57955
2.38332
1.60087
1.08457
0.741123
0.511661
0.358753
0.257801
0.191676
0.147493
0.116634
0.0935665
0.0751329
0.0597995
0.0469395
0.0362837
0.0272212
0.0190925
0.0201807
0.0289531
0.0308925
0.0213962
0.0227631
0.033067
0.0441828
0.0412331
0.0386187
0.0498139
0.0530401
0.0567209
0.0610148
0.0475756
0.0355022
0.0243142
0.026102
0.0383018
0.0415722
0.02819
0.0306624
0.0454408
0.0615827
0.0561391
0.0515222
0.0659899
0.0717533
0.0784724
0.0863965
0.0680562
0.0500876
0.0336406
0.0373093
0.0557896
0.063
0.0419515
0.048009
0.0724087
0.0983435
0.0856643
0.0758638
0.0960295
0.108034
0.123328
0.143384
0.115311
0.0851507
0.0562166
0.0678902
0.103234
0.130508
0.0855963
0.114773
0.175024
0.227732
0.173372
0.13891
0.17038
0.209248
0.269996
0.327556
0.251944
0.204251
0.172241
0.148906
0.131135
0.117163
0.105913
0.0967613
0.0890713
0.0824564
0.0766913
0.07164
0.067213
0.063299
0.0793294
0.0839874
0.089199
0.11054
0.10424
0.0986262
0.123092
0.130367
0.138698
0.148424
0.117709
0.0950761
0.101765
0.109484
0.118564
0.147693
0.135823
0.126012
0.160025
0.174169
0.191809
0.26336
0.234785
0.212266
0.194189
0.179401
0.167067
0.156578
0.205638
0.22209
0.241787
0.339265
0.307013
0.28027
0.394969
0.438215
0.490462
0.554368
0.378683
0.265753
0.295383
0.332626
0.380156
0.567228
0.488914
0.427524
0.633571
0.733141
0.860282
1.02553
0.66881
0.441792
0.300318
0.214338
0.16244
0.129527
0.143149
0.160488
0.183239
0.239686
0.206093
0.181293
0.243832
0.283405
0.337825
0.414831
0.286682
0.214193
0.258317
0.325212
0.432293
0.62857
0.459873
0.355133
0.527993
0.702087
0.98378
1.59955
1.12101
0.826418
0.635555
0.506122
0.415028
0.34912
0.523266
0.63331
0.785583
1.23705
0.984882
0.803165
1.24473
1.54236
1.95747
2.55557
1.59806
1.00259
1.32387
1.82165
2.63368
4.34472
2.9723
2.13556
3.45184
4.85528
7.17457
11.2832
6.7506
4.04509
2.42599
1.46745
0.91631
0.613162
0.453959
0.370559
0.317393
0.253866
0.167897
0.274883
0.40437
0.479208
0.552379
0.681929
0.941776
1.44352
2.35949
3.95879
6.68204
11.2881
19.1135
32.5048
18.9385
11.8898
7.95476
5.59542
4.09931
3.10788
2.42473
1.93817
1.5819
1.31469
1.11
0.950253
0.823508
0.721437
0.638113
0.569243
0.831586
0.940079
1.07174
1.60414
1.39639
1.22602
1.82234
2.09057
2.4195
2.82837
1.86086
1.23361
1.43543
1.69099
2.02023
3.12426
2.59273
2.18272
3.34414
4.00535
4.86817
7.64581
6.23774
5.16557
4.33446
3.67968
3.15611
2.7317
4.13056
4.80572
5.64355
8.72406
7.37745
6.29832
9.67686
11.4077
13.5788
16.3393
10.4276
6.69754
8.04335
9.79001
12.0978
19.2617
15.4694
12.6149
19.9014
24.5724
30.8057
39.284
24.3993
15.2078
9.53193
6.01642
3.82691
2.4526
3.03276
3.83051
4.95879
7.96434
6.091
4.77626
7.57852
9.75712
12.8837
17.5231
10.7244
6.60867
9.11665
13.1029
19.8169
33.2295
21.7214
14.9506
24.6755
36.2141
55.9577
94.2424
60.5674
40.9235
28.8007
20.9791
15.7408
12.1148
19.4922
25.5421
34.3292
56.2983
41.5993
31.5119
51.059
67.7893
92.1564
128.576
78.3683
47.5084
67.9857
101.156
157.638
259.117
167.509
112.572
184.402
272.14
412.374
623.915
427.537
295.635
208.151
149.684
110.032
82.6258
63.2912
49.3727
39.1587
31.5267
25.7272
21.2508
17.7455
14.9636
23.2536
27.7262
33.3819
52.513
43.4261
36.2537
56.5781
67.9988
82.4649
100.988
64.1655
40.6259
50.0345
62.4363
79.0389
125.796
99.2238
79.3016
124.964
156.325
197.737
304.181
242.323
194.564
157.56
128.712
106.05
88.096
136.241
163.874
198.446
299.702
249.084
207.97
310.756
368.92
438.733
521.977
362.013
241.915
296.73
365.847
452.605
643.096
531.468
438.45
620.143
733.997
863.007
1004.75
774.213
560.375
384.259
252.818
161.689
101.626
132.859
176.727
239.178
371.594
278.274
210.723
326.35
424.309
553.292
718.749
499.582
328.808
457.275
638.381
881.738
1151.91
891.426
671.235
921.618
1153.72
1393.61
1581.19
1387.33
1175.48
966.978
778.137
617.645
487.246
691.746
847.16
1023.18
1255.87
1086.74
923.555
1154.54
1305.54
1449.8
1579.82
1420.47
1211.2
1398.09
1569.06
1711.56
1795.61
1696.35
1569.97
1690.37
1779.36
1847.46
1897.26
1868
1818.72
1737.37
1608.94
1420.95
1175.14
897.591
631.746
414.23
257.848
155.364
92.0473
54.2155
31.9672
55.5205
94.9461
161.426
269.677
435.236
664.599
941.505
1224.75
1469.19
1651.08
1772.19
1847.15
1891.62
1917.5
1932.54
1941.42
1914.62
1878.84
1831.31
1769.39
1690.89
1594.9
1482.54
1357.09
1223.6
1087.87
955.44
830.802
716.965
615.465
526.625
449.911
384.287
328.491
281.215
241.218
207.374
178.701
154.357
133.635
115.944
100.791
87.7716
76.5479
66.8423
100.476
87.8613
131.206
114.978
100.759
149.56
170.151
193.485
219.921
149.743
170.941
114.984
131.703
151.011
222.989
195.203
283.732
249.858
356.152
315.863
279.757
247.475
218.664
312.5
350.913
393.263
532.8
480.897
432.821
576.251
632.018
690.759
752.216
588.524
439.781
490.657
546.023
400.98
450.684
322.012
365.188
254.82
173.354
199.256
229.325
264.264
380.644
332.993
291.276
413.756
468.189
528.9
596.192
434.915
304.867
352.014
406.64
469.691
643.382
565.826
496.458
670.191
750.775
837.5
1032.59
944.863
859.981
778.996
702.68
631.529
565.802
505.553
670.309
605.927
777.304
711.01
647.987
816.047
881.831
949.069
1017.19
846.465
917.968
738.977
811.58
887.592
1065.33
991.17
1153.6
1085.59
1229.12
1168.05
1105.74
1042.67
979.356
916.295
853.967
792.821
733.263
890.258
949.006
1007.91
1141.84
1088.47
1034.22
1156.94
1204.83
1251.32
1296.3
1194.07
1066.59
1124.65
1181.72
1237.44
1341.6
1294.15
1244.91
1339.64
1381.27
1421.12
1481.38
1447.75
1412.55
1375.78
1337.44
1297.56
1256.18
1334.09
1369.85
1404.23
1456.31
1426.11
1394.71
1442.16
1470.38
1497.58
1523.77
1485.31
1437.21
1468.81
1499.05
1527.97
1565.31
1539.78
1513.12
1548.95
1573.14
1596.36
1618.64
1589.76
1555.59
1513.47
1459.15
1387.11
1291.48
1343.57
1393.45
1288.49
1345.72
1220.56
1285.83
1139.61
966.305
1046.83
1128.13
1209.06
1354.46
1285.04
1213.14
1348.81
1408.96
1465.82
1547
1501.28
1452.38
1400.45
1485.86
1440.93
1511.02
1471.89
1430.57
1495.36
1529.74
1562.31
1593.11
1547.93
1582.64
1528.15
1567.76
1604.69
1645.63
1615.19
1649.58
1622.18
1651.99
1627.05
1600.77
1573.12
1544.03
1581.97
1607.15
1631.2
1656.99
1635.55
1613.16
1640.01
1660.49
1680.13
1698.96
1677.52
1654.15
1676.07
1697.01
1675.68
1698.15
1675.39
1699.67
1674.05
1638.98
1589.46
1519.07
1420.63
1288.4
1121.86
929.526
729.181
542.03
624.313
716.821
819.243
1029.4
923.441
822.844
1025.59
1124.02
1222.78
1319.64
1138.49
930.455
1048.36
1169.88
1291.13
1455.66
1354.68
1247.94
1412.36
1498.93
1577.73
1662.99
1603.48
1536.63
1462.92
1383.24
1298.81
1211.14
1364.99
1437.74
1505.75
1593.96
1540.79
1482.91
1568.46
1613.89
1655.36
1692.96
1642.26
1568.31
1625.02
1675.73
1720.52
1758.9
1724.5
1685.71
1726.89
1757.4
1784.8
1809.42
1789.33
1759.71
1715.09
1647.75
1548.27
1407.86
1516.04
1612.49
1695.29
1761.4
1701.65
1630.59
1708.58
1760.41
1803.92
1840.13
1810.6
1763.97
1819.37
1863.28
1897.84
1909.6
1883.03
1850.59
1870.24
1895.53
1917.18
1922.4
1903.82
1882.98
1859.08
1831.23
1798.52
1760.07
1793.8
1823.39
1849.12
1861.32
1840.05
1816.21
1831.62
1851.75
1870.16
1887.16
1880.5
1871.67
1891.67
1909.7
1926.3
1929.49
1914.22
1898.01
1903.02
1918
1932.31
1934.96
1921.39
1907.31
1892.57
1877.03
1860.51
1842.79
1823.64
1802.81
1780.05
1755.1
1727.72
1697.65
1664.69
1628.67
1670.73
1700.05
1727.1
1748.27
1725.25
1700.55
1722.52
1744.03
1764.3
1783.41
1769.74
1752.03
1775.03
1796.29
1815.99
1826.24
1808.59
1789.8
1801.46
1818.56
1834.8
1842.42
1827.23
1811.36
1794.74
1777.31
1759
1739.75
1719.49
1736.16
1717.02
1734.19
1716.07
1697.2
1717.02
1734.36
1751.03
1767.95
1752.33
1736.05
1719.07
1701.37
1682.91
1663.68
1643.64
1622.78
1601.09
1578.55
1555.15
1530.89
1505.76
1479.76
1452.89
1484.78
1458.83
1485.79
1460.41
1434.41
1458.07
1483.12
1507.62
1525.41
1501.5
1477.09
1492.46
1468.02
1480.78
1456.22
1431.29
1406
1416.99
1442.03
1466.73
1491.07
1515.02
1504.93
1528.64
1516.46
1539.98
1551.91
1561.66
1538.56
1546.59
1523.16
1499.34
1475.14
1450.6
1425.74
1432.69
1407.68
1413.26
1388.12
1362.76
1367.24
1341.81
1345.16
1319.66
1294.02
1268.28
1242.45
1244.9
1219.07
1220.51
1194.66
1168.78
1246.31
1272.05
1270.67
1296.36
1297.7
1323.24
1321.93
1347.39
1372.7
1370.52
1395.71
1392.5
1417.56
1442.4
1438.17
1462.81
1457.42
1481.86
1487.17
1491.28
1466.98
1470.02
1445.49
1420.71
1422.8
1397.84
1399.06
1373.95
1348.67
1424
1448.72
1447.54
1472.04
1496.28
1494.29
1518.25
1515.27
1511.2
1505.96
1529.7
1553.05
1575.99
1569.59
1592.14
1584.3
1574.7
1563
1548.79
1531.54
1510.54
1534.63
1510
1534.47
1558.19
1580.84
1558.07
1577.62
1554.88
1571.63
1585.51
1607.48
1593.91
1615.61
1599.75
1621.26
1602.93
1581.16
1603.36
1624.81
1645.49
1665.06
1645.04
1624.33
1642.13
1662.35
1681.91
1696.38
1677.12
1657.23
1636.72
1649.75
1628.9
1640.01
1618.77
1596.99
1606.46
1628.11
1649.23
1669.8
1660.69
1680.8
1670.02
1689.69
1708.74
1719.23
1700.31
1709.23
1689.81
1697.28
1677.34
1656.84
1635.79
1614.21
1620.51
1598.49
1603.56
1581.1
1558.2
1534.89
1538.92
1562.2
1585.08
1588.01
1565.14
1541.88
1543.84
1520.22
1521.36
1497.43
1473.2
1544.97
1568.22
1567.1
1589.96
1591.08
1613.53
1612.41
1610.46
1607.53
1629.52
1625.56
1647.07
1642.04
1663.05
1668.06
1672
1651.02
1653.94
1632.44
1634.39
1655.89
1676.88
1674.92
1695.36
1692.43
1688.5
1683.51
1703.41
1722.73
1716.63
1735.38
1728.04
1746.24
1737.52
1727.17
1715
1700.82
1684.38
1665.42
1684.6
1703.04
1720.74
1738.13
1720.91
1702.99
1719.05
1736.61
1753.5
1769.71
1754.66
1737.73
1754.02
1769.63
1784.58
1800.22
1785.69
1770.51
1785.26
1800.15
1814.39
1826.94
1812.92
1798.25
1782.92
1766.94
1750.28
1732.97
1744.95
1762.09
1778.57
1788.55
1772.19
1755.17
1763.81
1780.73
1797.01
1812.62
1804.25
1794.39
1809.55
1824.05
1837.89
1847.35
1833.65
1819.28
1827.56
1841.83
1855.43
1862.24
1848.71
1834.51
1819.64
1804.09
1787.88
1771.02
1753.52
1759.53
1741.44
1746.35
1727.67
1708.38
1712.3
1731.58
1750.25
1753.15
1734.49
1715.22
1717.18
1697.31
1698.44
1678
1657.02
1635.52
1718.31
1737.58
1736.45
1755.1
1756.23
1774.25
1773.12
1771.18
1768.29
1764.41
1781.84
1776.98
1793.8
1809.95
1814.73
1798.61
1802.44
1785.69
1788.56
1790.5
1807.22
1805.29
1821.36
1818.52
1833.95
1830.19
1825.45
1840.27
1854.42
1867.89
1872.5
1859.08
1844.97
1848.69
1862.77
1876.16
1878.9
1865.53
1851.48
1836.76
1838.65
1823.27
1824.37
1808.33
1791.62
1839.75
1854.44
1853.36
1867.38
1880.73
1881.79
1868.46
1894.45
1893.4
1891.58
1888.88
1885.25
1880.68
1875.08
1868.36
1860.39
1851.08
1840.32
1828
1814.11
1798.9
1782.96
1767.06
1751.6
1768.35
1754.47
1772.01
1788.82
1800.02
1784.48
1797.41
1782.51
1797.38
1812.62
1825.77
1811.26
1824.65
1811.8
1825.72
1815.01
1804.95
1820.44
1835.33
1849.66
1857.02
1843.49
1829.49
1839.21
1852.29
1864.98
1877.3
1870.11
1863.47
1856.98
1850.25
1842.89
1834.31
1851.44
1867.55
1882.78
1887.92
1873.61
1858.64
1865.01
1879.15
1892.74
1905.86
1901.66
1897.29
1911.21
1924.6
1937.56
1940.17
1927.75
1914.93
1918.58
1930.89
1942.82
1945.53
1934.07
1922.23
1910.01
1897.43
1884.43
1870.97
1876.8
1889.67
1902.13
1906.98
1895.07
1882.79
1889.26
1900.89
1912.18
1923.15
1918.53
1914.2
1925.94
1937.31
1948.3
1951.15
1940.65
1929.76
1933.82
1944.18
1954.15
1963.65
1961.18
1958.83
1956.56
1954.35
1952.21
1950.13
1948.1
1946.08
1944.02
1941.82
1939.28
1936.09
1931.7
1925.11
1946.83
1950.34
1952.78
1954.67
1956.28
1957.76
1959.2
1960.65
1962.15
1963.71
1965.33
1967.02
1968.77
1970.6
1972.52
1974.59
1966.31
1957.4
1948.03
1938.3
1928.29
1918.02
1907.46
1896.61
1885.47
1874.01
1862.23
1850.1
1837.59
1850.52
1838.39
1852.2
1840.08
1827.39
1840.98
1853.37
1865.17
1876.41
1863.79
1874.87
1862.2
1873.46
1884.35
1895.65
1885.48
1897.29
1887.11
1898.16
1887.74
1876.76
1865.21
1853.07
1863.63
1875.56
1886.88
1895.63
1884.52
1872.77
1880.61
1892.21
1903.15
1913.46
1906.14
1897.61
1907.78
1917.39
1908.04
1917.41
1906.98
1916.21
1905.42
1894.9
1905.15
1915.11
1924.81
1932.71
1923.92
1914.83
1925
1933.39
1941.41
1949.09
1941.24
1934.25
1943.46
1952.42
1961.07
1965.37
1957.59
1949.53
1956.47
1963.58
1970.41
1975.97
1970.05
1963.76
1957.1
1950.05
1942.57
1934.65
1926.27
1935.04
1926.47
1934.2
1925.4
1916.06
1923.16
1932.25
1940.77
1948.73
1942.46
1950.2
1943.1
1950.67
1957.75
1964.17
1957.43
1963.04
1956.15
1961.17
1954.06
1946.38
1938.1
1929.22
1919.71
1909.55
1898.74
1887.25
1892.78
1904.2
1914.93
1919.37
1908.69
1897.31
1900.91
1912.25
1922.91
1932.86
1929.35
1924.98
1934.36
1943.08
1951.15
1955.18
1947.25
1938.65
1942.11
1950.66
1958.49
1961.06
1953.26
1944.74
1935.5
1925.55
1914.92
1903.59
1905.39
1916.7
1927.33
1928.35
1917.73
1906.43
1938.29
1937.27
1946.51
1955.04
1962.84
1963.9
1956.07
1947.53
1970.97
1969.9
1968.13
1965.63
1962.44
1958.59
1965.43
1971.68
1967.73
1973.74
1969.41
1975.25
1970.39
1964.36
1970.5
1976.18
1981.4
1985.98
1981.31
1976.11
1980.55
1985.3
1989.49
1992.15
1988.39
1984.08
1979.19
1982.45
1977.36
1980.41
1975.04
1969.05
1972.07
1977.85
1982.97
1987.41
1985.17
1989.29
1986.94
1990.84
1994.18
1995.64
1992.77
1994.2
1991.15
1992.5
1989.13
1984.99
1980.1
1974.48
1976.2
1981.71
1986.42
1987.28
1982.7
1977.25
1990.97
1990.3
1993.35
1995.66
1995.13
1997.15
1996.6
1998.39
1997.86
1996.88
1995.3
1993.07
1990.04
1986.08
1981.46
1976.85
1972.76
1969.29
1976.9
1979.58
1982.74
1986.36
1990.09
1993.38
1995.89
1997.65
1998.74
1999.28
1999.49
1999.59
1998.65
1998.77
1997.42
1997.54
1995.91
1993.8
1998.81
1999.63
1999.63
0.00387116
0.00676521
0.00526153
0.00110075
0.000737907
0.000944422
0.000824138
0.00221935
0.000863146
0.000871088
0.000746235
0.00103749
0.000837922
0.000455826
0.000390793
0.000653357
0.000751011
0.0010666
0.00158566
0.00102985
0.000647414
0.000954014
0.000691616
0.000288142
0.000234239
0.000479868
0.000541528
0.000284196
0.000220203
0.000478314
0.000546624
0.000638049
0.00253484
0.000268215
0.0019536
0.000549816
0.00180618
0.000428671
0.000619787
0.0003875
0.000474772
0.000259035
0.000225833
0.000430702
0.000786828
0.000413491
0.00158575
0.00343238
0.00506065
0.00950208
0.0357682
0.0190967
0.0116548
0.0293751
0.0539891
0.100873
0.23937
0.12762
0.225689
0.581898
0.431433
1.06151
1.50805
1.71732
1.90076
2.34157
3.34023
5.19556
8.66762
14.8642
25.6671
44.3736
76.7
132.109
224.823
372.39
587.764
863.854
1163.3
1434.03
1641.14
1780.25
1865.78
1915.63
1943.84
1959.61
1968.43
1973.41
1976.3
1978.05
1979.18
1979.98
1980.61
1981.15
1981.67
1982.18
1982.71
1983.25
1983.83
1984.44
1985.09
1985.78
1986.5
1987.26
1988.07
1988.96
1989.98
1991.17
1992.61
1994.3
1996.13
1997.82
1999.06
1999.69
1999.93
2000
1999.99
1999.99
1999.99
)
;
boundaryField
{
bottomEmptyFaces
{
type empty;
}
topEmptyFaces
{
type empty;
}
inlet
{
type calculated;
value nonuniform List<scalar>
69
(
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
)
;
}
outlet
{
type calculated;
value nonuniform List<scalar>
33
(
0.173864
0.170028
0.163855
0.155233
0.144705
0.132567
0.119684
0.10637
0.0931653
0.0803354
0.0681925
0.0569543
0.0468039
0.0378527
0.030151
0.0236828
0.0183841
0.0141325
0.0107875
0.0081744
0.00612053
0.00471062
0.00279874
0.00201749
0.00167427
0.00100178
0.000605994
0.000404792
0.000225228
0.175668
2.4795e-05
6.87848e-05
0.000120827
)
;
}
walls
{
type calculated;
value nonuniform List<scalar>
900
(
1.80788e-05
1.80831e-05
1.80824e-05
1.80867e-05
1.8086e-05
1.80902e-05
1.80894e-05
1.80936e-05
1.80928e-05
1.8097e-05
1.80962e-05
1.81002e-05
1.80994e-05
1.81033e-05
1.81025e-05
1.81064e-05
1.81056e-05
1.81095e-05
1.81087e-05
1.81125e-05
1.81116e-05
1.81153e-05
1.81144e-05
1.81179e-05
1.81171e-05
1.81205e-05
1.81196e-05
1.81229e-05
1.8122e-05
1.81251e-05
1.81242e-05
1.81271e-05
1.81262e-05
1.8129e-05
1.8128e-05
1.81307e-05
1.81297e-05
1.81323e-05
1.81313e-05
1.81337e-05
1.81327e-05
1.81351e-05
1.8134e-05
1.81364e-05
1.81353e-05
1.81376e-05
1.81365e-05
1.81386e-05
1.81375e-05
1.81396e-05
1.81385e-05
1.81405e-05
1.81393e-05
1.81412e-05
1.81401e-05
1.81419e-05
1.81408e-05
1.81426e-05
1.81414e-05
1.81432e-05
1.81421e-05
1.81438e-05
1.81426e-05
1.81444e-05
1.81432e-05
1.81449e-05
1.81437e-05
1.81454e-05
1.81442e-05
1.81458e-05
1.81446e-05
1.81463e-05
1.8145e-05
1.81466e-05
1.81454e-05
1.8147e-05
1.81457e-05
1.81473e-05
1.81461e-05
1.81476e-05
1.81464e-05
1.81479e-05
1.81466e-05
1.81481e-05
1.81468e-05
1.81483e-05
1.81471e-05
1.81485e-05
1.81472e-05
1.81487e-05
1.81474e-05
1.81489e-05
1.81476e-05
1.8149e-05
1.81477e-05
1.81492e-05
1.81479e-05
1.81493e-05
1.8148e-05
1.81494e-05
1.81482e-05
1.81496e-05
1.81483e-05
1.81497e-05
1.81485e-05
1.81499e-05
1.81486e-05
1.815e-05
1.81488e-05
1.81502e-05
1.81489e-05
1.81504e-05
1.81491e-05
1.81505e-05
1.81493e-05
1.81506e-05
1.81494e-05
1.81508e-05
1.81495e-05
1.81509e-05
1.81497e-05
1.81511e-05
1.81499e-05
1.81513e-05
1.815e-05
1.81515e-05
1.81503e-05
1.81517e-05
1.81506e-05
1.81521e-05
1.8151e-05
1.81526e-05
1.81515e-05
1.81532e-05
1.81521e-05
1.81653e-05
1.8175e-05
1.81929e-05
1.82706e-05
1.84134e-05
1.88086e-05
1.953e-05
2.11069e-05
2.29486e-05
4.25092e-05
4.63516e-05
4.78436e-05
5.97594e-05
6.64326e-05
4.186e-05
4.20245e-05
4.16464e-05
4.05808e-05
4.09576e-05
3.97395e-05
4.08255e-05
4.02724e-05
3.90088e-05
4.08887e-05
4.18443e-05
7.39109e-05
8.01658e-05
7.1806e-05
7.3157e-05
6.5517e-05
5.79344e-05
6.18336e-05
5.77049e-05
5.33453e-05
5.09864e-05
5.13932e-05
5.16857e-05
5.0052e-05
4.80705e-05
5.20187e-05
4.85355e-05
1.99486e-05
1.7071e-05
1.39163e-05
1.41555e-05
9.80974e-06
1.82312e-05
1.86608e-05
1.48094e-05
1.39338e-05
1.00794e-05
1.45878e-05
1.43599e-05
1.02294e-05
1.88381e-05
1.49231e-05
1.83047e-05
1.46094e-05
1.40237e-05
1.02098e-05
1.69364e-05
1.85151e-05
1.47526e-05
1.33967e-05
1.00992e-05
1.3927e-05
1.02402e-05
1.90685e-05
1.52933e-05
1.69343e-05
1.36809e-05
1.05647e-05
1.97797e-05
1.5811e-05
1.91907e-05
1.52064e-05
1.37273e-05
1.05737e-05
1.48899e-05
1.16182e-05
1.71061e-05
1.52254e-05
1.18421e-05
1.99704e-05
1.55081e-05
1.17925e-05
1.57757e-05
1.45283e-05
1.0831e-05
2.10565e-05
1.69667e-05
1.51378e-05
1.2206e-05
1.83411e-05
1.58278e-05
1.30732e-05
1.90408e-05
1.69339e-05
1.37508e-05
2.11519e-05
1.70766e-05
1.71339e-05
1.43072e-05
1.17733e-05
1.74787e-05
1.44226e-05
1.20096e-05
1.84549e-05
1.90822e-05
1.60128e-05
1.32609e-05
2.06564e-05
1.6767e-05
1.51261e-05
1.21782e-05
1.65363e-05
1.3586e-05
1.52046e-05
1.22424e-05
2.07625e-05
1.65139e-05
1.74079e-05
1.41773e-05
1.15046e-05
1.81173e-05
1.51444e-05
1.25821e-05
1.83245e-05
1.52462e-05
1.27304e-05
1.7604e-05
1.47309e-05
1.21845e-05
1.78893e-05
1.49108e-05
1.23445e-05
1.84949e-05
1.5676e-05
1.2964e-05
1.89577e-05
1.64595e-05
1.34029e-05
1.93114e-05
1.52989e-05
1.6546e-05
1.33164e-05
1.05146e-05
1.73648e-05
1.79385e-05
1.46366e-05
1.18986e-05
1.40812e-05
1.13118e-05
2.00407e-05
1.59226e-05
1.74785e-05
1.68997e-05
1.3657e-05
1.0988e-05
1.42203e-05
1.16301e-05
2.21713e-05
1.84051e-05
1.947e-05
1.53625e-05
1.35626e-05
1.07072e-05
1.73569e-05
1.4697e-05
1.19524e-05
1.68343e-05
1.4183e-05
1.15936e-05
1.52591e-05
1.23553e-05
1.79493e-05
1.55937e-05
1.24484e-05
1.92079e-05
1.7211e-05
1.39309e-05
1.09355e-05
1.4969e-05
1.18518e-05
2.17328e-05
1.72986e-05
1.36419e-05
1.51941e-05
1.3604e-05
1.05777e-05
1.69938e-05
1.48802e-05
1.17458e-05
1.80938e-05
1.72641e-05
1.35188e-05
2.17595e-05
1.8271e-05
2.167e-05
1.73463e-05
1.36949e-05
1.81544e-05
1.99117e-05
1.8447e-05
1.5192e-05
1.2546e-05
1.56636e-05
1.28057e-05
1.78685e-05
1.46656e-05
1.20613e-05
1.4904e-05
1.22851e-05
1.57148e-05
1.35406e-05
1.08373e-05
1.68014e-05
1.39981e-05
1.16049e-05
1.91896e-05
1.73205e-05
1.40185e-05
1.93576e-05
2.16007e-05
5.51967e-05
1.76227e-05
1.59977e-05
1.27974e-05
5.47905e-05
5.631e-05
5.42167e-05
5.49009e-05
5.81356e-05
5.45844e-05
5.24964e-05
5.14454e-05
1.9155e-05
1.76847e-05
1.42097e-05
2.20094e-05
1.79794e-05
2.17268e-05
1.75665e-05
1.41937e-05
1.74536e-05
2.06043e-05
1.75664e-05
1.56615e-05
1.25859e-05
5.23054e-05
1.83318e-05
4.74392e-05
1.5938e-05
4.30508e-05
4.36347e-05
4.29288e-05
1.31591e-05
3.59174e-05
1.60766e-05
2.14297e-05
5.05448e-05
4.47779e-05
4.05051e-05
3.86124e-05
5.46522e-05
5.56614e-05
6.27176e-05
5.82111e-05
2.04908e-05
1.68419e-05
1.58387e-05
1.25523e-05
1.63793e-05
1.3139e-05
1.92118e-05
1.77322e-05
1.4208e-05
1.45571e-05
1.56237e-05
1.01706e-05
2.07095e-05
1.78434e-05
1.90549e-05
1.54658e-05
1.42484e-05
1.44562e-05
9.75549e-06
1.97183e-05
1.52557e-05
1.06309e-05
1.57496e-05
1.52585e-05
1.08104e-05
6.57098e-05
6.39516e-05
6.16497e-05
5.92405e-05
5.79049e-05
5.48262e-05
2.19202e-05
5.16466e-05
5.19052e-05
4.87087e-05
1.92646e-05
5.45227e-05
5.22141e-05
1.64776e-05
1.64383e-05
4.71165e-05
1.26744e-05
4.13541e-05
2.09138e-05
2.84632e-05
1.67134e-05
1.77327e-05
1.80921e-05
1.74081e-05
1.36508e-05
2.21566e-05
1.98094e-05
1.68709e-05
1.73224e-05
1.3439e-05
2.2474e-05
1.74733e-05
1.31582e-05
2.0001e-05
1.69947e-05
1.5506e-05
1.4393e-05
1.31347e-05
1.15143e-05
1.38825e-05
8.38949e-06
2.16218e-05
1.91556e-05
1.97756e-05
1.7363e-05
1.82e-05
1.62789e-05
1.56117e-05
1.64052e-05
1.50345e-05
1.7592e-05
1.30989e-05
2.29817e-05
1.46358e-05
1.4275e-05
2.17191e-05
1.38096e-05
1.34713e-05
1.31326e-05
1.29217e-05
2.03758e-05
1.90652e-05
1.76667e-05
1.59794e-05
2.19949e-05
1.26737e-05
1.24753e-05
2.04686e-05
1.22377e-05
1.98642e-05
1.19172e-05
1.72077e-05
1.28895e-05
1.16746e-05
1.69056e-05
1.30898e-05
1.15685e-05
1.14123e-05
1.13046e-05
1.10527e-05
1.0958e-05
1.08005e-05
1.0807e-05
1.07322e-05
1.06121e-05
1.05419e-05
1.05137e-05
1.04359e-05
1.04163e-05
1.03487e-05
1.03403e-05
1.02815e-05
1.02779e-05
1.02241e-05
1.02229e-05
1.01717e-05
1.01719e-05
1.01223e-05
1.01232e-05
1.00747e-05
1.00762e-05
1.00287e-05
1.00307e-05
9.98389e-06
9.98633e-06
9.94043e-06
9.94326e-06
9.89816e-06
9.90139e-06
9.8571e-06
9.86062e-06
9.81706e-06
9.82103e-06
9.77823e-06
9.78258e-06
9.74044e-06
9.74521e-06
9.70373e-06
9.70882e-06
9.66789e-06
9.67335e-06
9.63303e-06
9.63882e-06
9.59904e-06
9.60524e-06
9.56605e-06
9.57256e-06
9.53382e-06
9.54072e-06
9.50247e-06
9.50967e-06
9.4718e-06
9.4794e-06
9.442e-06
9.44988e-06
9.41283e-06
9.42112e-06
9.3845e-06
9.39302e-06
9.35675e-06
9.36569e-06
9.32973e-06
9.33891e-06
9.30344e-06
9.31295e-06
9.27761e-06
9.28753e-06
9.25293e-06
9.26309e-06
9.22834e-06
9.23899e-06
9.20581e-06
9.21629e-06
9.18176e-06
9.19348e-06
9.15931e-06
9.16996e-06
9.14354e-06
9.2624e-06
9.33449e-06
9.46097e-06
9.5397e-06
9.677e-06
9.59622e-06
8.6806e-06
1.23192e-05
6.46911e-06
1.92938e-05
1.89118e-05
1.88393e-05
1.86961e-05
1.86143e-05
1.86849e-05
1.86816e-05
1.86535e-05
1.86138e-05
1.85688e-05
1.85261e-05
1.8481e-05
1.84394e-05
1.8397e-05
1.83581e-05
1.83205e-05
1.82853e-05
1.82532e-05
1.82224e-05
1.81953e-05
1.81689e-05
1.81469e-05
1.81244e-05
1.81086e-05
1.80895e-05
1.808e-05
1.8064e-05
1.80595e-05
1.80466e-05
1.80451e-05
1.80356e-05
1.80361e-05
1.80295e-05
1.80314e-05
1.80272e-05
1.80298e-05
1.80272e-05
1.80303e-05
1.80288e-05
1.80323e-05
1.89308e-05
1.90696e-05
1.58864e-05
1.32718e-05
1.80312e-05
1.80355e-05
1.80345e-05
1.80392e-05
1.80383e-05
1.80431e-05
1.80423e-05
1.80472e-05
1.85109e-05
1.58434e-05
1.30978e-05
1.80464e-05
1.80514e-05
1.80506e-05
1.80557e-05
1.80549e-05
1.80598e-05
1.80591e-05
1.80639e-05
1.74831e-05
1.48718e-05
1.23791e-05
1.80632e-05
1.94948e-05
1.80679e-05
2.11843e-05
1.69884e-05
1.39046e-05
1.61447e-05
1.33861e-05
1.67412e-05
1.42983e-05
1.16677e-05
1.80672e-05
1.80718e-05
1.80786e-05
1.5247e-05
1.26863e-05
1.8071e-05
1.79077e-05
1.49877e-05
1.24894e-05
1.83177e-05
1.5427e-05
1.28685e-05
1.80756e-05
1.80748e-05
1.80795e-05
1.8121e-05
1.82562e-05
1.51355e-05
1.26051e-05
1.77498e-05
1.78829e-05
1.47967e-05
1.23238e-05
1.46558e-05
1.2139e-05
1.50145e-05
1.24537e-05
1.84699e-05
1.86299e-05
1.55085e-05
1.29474e-05
1.52762e-05
1.26833e-05
1.57161e-05
1.30359e-05
1.83301e-05
1.9367e-05
1.7185e-05
1.39535e-05
1.89819e-05
1.61241e-05
1.33948e-05
2.14052e-05
1.70958e-05
1.49859e-05
1.20611e-05
1.91312e-05
1.88052e-05
1.56754e-05
1.30714e-05
1.59801e-05
1.3324e-05
1.95325e-05
1.64088e-05
1.36395e-05
1.69788e-05
1.39857e-05
2.4795e-05
1.93548e-05
4.38443e-05
4.19729e-05
4.07043e-05
4.03149e-05
3.99366e-05
3.97924e-05
3.9709e-05
3.96664e-05
3.96147e-05
3.95788e-05
3.95366e-05
3.95078e-05
3.94722e-05
3.94484e-05
3.94176e-05
3.9397e-05
3.93696e-05
3.93512e-05
3.93261e-05
3.93091e-05
3.92857e-05
3.92698e-05
3.92477e-05
3.92325e-05
3.92112e-05
3.91966e-05
3.91759e-05
3.91616e-05
3.91413e-05
3.91272e-05
3.91072e-05
3.90932e-05
3.90733e-05
3.90593e-05
3.90394e-05
3.90252e-05
3.90052e-05
3.89908e-05
3.89706e-05
3.89559e-05
3.89353e-05
3.89203e-05
3.88993e-05
3.88838e-05
3.88622e-05
3.88461e-05
3.88238e-05
3.88071e-05
3.8784e-05
3.87665e-05
3.87424e-05
3.8724e-05
3.86987e-05
3.86793e-05
3.86526e-05
3.8632e-05
3.86038e-05
3.85818e-05
3.85518e-05
3.85282e-05
3.84961e-05
3.84707e-05
3.84362e-05
3.84086e-05
3.83713e-05
3.83413e-05
3.83008e-05
3.8268e-05
3.82237e-05
3.81878e-05
3.81392e-05
3.80995e-05
3.8046e-05
3.80021e-05
3.79429e-05
3.78942e-05
3.78284e-05
3.77742e-05
3.77008e-05
3.76403e-05
3.75583e-05
3.74907e-05
3.73991e-05
3.73235e-05
3.72212e-05
3.7137e-05
3.70231e-05
3.69301e-05
3.68041e-05
3.67022e-05
3.65644e-05
3.64548e-05
3.63065e-05
3.61912e-05
3.60354e-05
3.59184e-05
3.57599e-05
3.56466e-05
3.54922e-05
3.53891e-05
3.5246e-05
3.51595e-05
3.50349e-05
3.49699e-05
3.48687e-05
3.4827e-05
3.47513e-05
3.47296e-05
3.46839e-05
3.46787e-05
3.46572e-05
3.46591e-05
3.46501e-05
3.46582e-05
3.46565e-05
3.4669e-05
3.46725e-05
3.46905e-05
3.46969e-05
3.47181e-05
3.47257e-05
3.47478e-05
3.47559e-05
3.4778e-05
3.47864e-05
3.4808e-05
3.48174e-05
3.48393e-05
3.48496e-05
3.48702e-05
3.48804e-05
3.48999e-05
3.49094e-05
3.49274e-05
3.49363e-05
3.49529e-05
3.49612e-05
3.49766e-05
3.49844e-05
3.49988e-05
3.50061e-05
3.50194e-05
3.50261e-05
3.50383e-05
3.50443e-05
3.50552e-05
3.50606e-05
3.50704e-05
3.5075e-05
3.50836e-05
3.50875e-05
3.50949e-05
3.5098e-05
3.51043e-05
3.51065e-05
3.51119e-05
3.51132e-05
3.51176e-05
3.51107e-05
3.51287e-05
3.50844e-05
3.52556e-05
3.53972e-05
3.60597e-05
3.63319e-05
3.67867e-05
3.72249e-05
3.80198e-05
4.6074e-05
)
;
}
rightWall
{
type calculated;
value nonuniform List<scalar>
30
(
0.000394377
0.000777551
0.00100474
0.00144043
0.00198807
0.00244144
0.00281917
0.00326731
0.00365031
0.00399485
0.00426189
0.00446368
0.00458136
0.00461921
0.00457318
0.00444328
0.00423437
0.00393485
0.00356512
0.00309843
0.00263629
0.00204881
0.00143511
0.0008202
3.80198e-05
0.000150426
0.000331427
1.93548e-05
6.66297e-05
0.000133096
)
;
}
symmetryLine
{
type symmetryPlane;
}
}
// ************************************************************************* //
|
f6326d80c561d2906a445fe1c5bb6ad1d2eb44b3 | 5deab316a4ab518e3a409ab69885d372f4d45706 | /progvar.fun/Sums and Asymptotics/546A.cpp | a102703581f65c795d2059c5ef592e600c63349c | [] | no_license | af-orozcog/competitiveProgramming | 9c01937b321b74f3d6b24e1b8d67974cad841e17 | 5bbfbd4da9155a7d1ad372298941a04489207ff5 | refs/heads/master | 2023-04-28T11:44:04.320533 | 2021-05-19T19:04:30 | 2021-05-19T19:04:30 | 203,208,784 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 260 | cpp | 546A.cpp | #include<bits/Stdc++.h>
#define ll long long
using namespace std;
ll fastSum(ll n){
return (n*(n+1ll))>>1;
}
int main(){
ll k,n,w;
scanf(" %lld %lld %lld",&k,&n,&w);
ll see = fastSum(w)*k;
printf("%lld\n",max(0ll,see-n));
return 0;
}
|
c797c2e01457ec1a784c2cdf831152e6fda644ba | a96a11257637428b50672e90e78247cf0d9750e6 | /src/1992/1992.cpp | 91373e537141e5dee35c02d14552f2bfb4e0698f | [] | no_license | sklationd/boj | 3492d1ee44a6d96dd438358222fc4ea0c57d7ed2 | 1ce8e1b4b2c06b7a2d0067167e0ecfd6d732d0b6 | refs/heads/master | 2021-07-19T03:59:05.745419 | 2021-06-27T08:51:32 | 2021-06-27T08:51:32 | 250,503,840 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,092 | cpp | 1992.cpp | #include <iostream>
#include <vector>
#include <cstring>
using namespace std;
int N;
char paper[65][65] = {0,};
bool equal4(string a, string b, string c, string d){
return (!a.compare("1") || !a.compare("0")) && !a.compare(b) && !b.compare(c) && !c.compare(d);
}
string divconq(int x, int y, int size){
if(size == 1){
if(paper[x][y] == '1')
return "1";
else
return "0";
} else {
int offset = size/2;
string ld,lu,rd,ru;
ld = divconq(x,y,offset);
lu = divconq(x,y+offset,offset);
rd = divconq(x+offset,y,offset);
ru = divconq(x+offset,y+offset,offset);
if(equal4(ld,lu,rd,ru)){
return ld;
} else {
return "(" + ld + lu + rd + ru + ")";
}
}
}
int main(){
// for fast io
ios_base :: sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
cin >> N;
for(int i=0;i<N;i++){
for(int j=0;j<N;j++){
cin >> paper[i][j];
}
}
string result = divconq(0,0,N);
cout << result;
} |
95571c2c1bc16fefc8cb20368e7978637adbf73c | 84a696a8817c6fd60a85d57745fa33a4621f15d6 | /MorseCode.cpp | 155b3777f4b1a8551e464fc5d3836e55e7f29542 | [] | no_license | substance-r2d2/CodeEval | fc34e11bf3a7503cc1f79c77d7bdc691139f924d | db828856bef5a00275fead17979bb862e3e38578 | refs/heads/master | 2016-09-06T17:35:10.405233 | 2014-05-04T12:05:53 | 2014-05-04T12:05:53 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,533 | cpp | MorseCode.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <unordered_map>
#include <string>
#include <algorithm>
using namespace std;
unordered_map<string, string> morseCode;
void createMorseCode()
{
morseCode.insert(pair<string, string>(".-", "A"));
morseCode.insert(pair<string, string>("-...", "B"));
morseCode.insert(pair<string, string>("-.-.", "C"));
morseCode.insert(pair<string, string>("-..", "D"));
morseCode.insert(pair<string, string>(".", "E"));
morseCode.insert(pair<string, string>("..-.", "F"));
morseCode.insert(pair<string, string>("--.", "G"));
morseCode.insert(pair<string, string>("....", "H"));
morseCode.insert(pair<string, string>("..", "I"));
morseCode.insert(pair<string, string>(".---", "J"));
morseCode.insert(pair<string, string>("-.-", "K"));
morseCode.insert(pair<string, string>(".-..", "L"));
morseCode.insert(pair<string, string>("--", "M"));
morseCode.insert(pair<string, string>("-.", "N"));
morseCode.insert(pair<string, string>("---", "O"));
morseCode.insert(pair<string, string>(".--.", "P"));
morseCode.insert(pair<string, string>("--.-", "Q"));
morseCode.insert(pair<string, string>(".-.", "R"));
morseCode.insert(pair<string, string>("...", "S"));
morseCode.insert(pair<string, string>("-", "T"));
morseCode.insert(pair<string, string>("..-", "U"));
morseCode.insert(pair<string, string>("...-", "V"));
morseCode.insert(pair<string, string>(".--", "W"));
morseCode.insert(pair<string, string>("-..-", "X"));
morseCode.insert(pair<string, string>("-.--", "Y"));
morseCode.insert(pair<string, string>("--..", "Z"));
morseCode.insert(pair<string, string>(".----", "1"));
morseCode.insert(pair<string, string>("..---", "2"));
morseCode.insert(pair<string, string>("...--", "3"));
morseCode.insert(pair<string, string>("....-", "4"));
morseCode.insert(pair<string, string>(".....", "5"));
morseCode.insert(pair<string, string>("-....", "6"));
morseCode.insert(pair<string, string>("--...", "7"));
morseCode.insert(pair<string, string>("---..", "8"));
morseCode.insert(pair<string, string>("----.", "9"));
morseCode.insert(pair<string, string>("-----", "0"));
morseCode.insert(pair<string, string>("", " "));
}
int main(int argc, const char * argv[])
{
createMorseCode();
ifstream ifs(argv[1]);
string token;
while (getline(ifs, token))
{
stringstream ss(token);
while (getline(ss, token, ' '))
{
cout << (morseCode.find(token))->second;
}
cout << endl;
}
system("pause");
return 0;
} |
ee65615857bc0d6a31263398c28079f9828bd2e9 | 2ae0b8d95d439ccfd55ea7933ad4a2994ad0f6c5 | /src/plugins/intel_gpu/src/kernel_selector/kernels/shape_of/shape_of_kernel_selector.cpp | f56027b41ccd02cedc51098700051160a4ae0c2d | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | openvinotoolkit/openvino | 38ea745a247887a4e14580dbc9fc68005e2149f9 | e4bed7a31c9f00d8afbfcabee3f64f55496ae56a | refs/heads/master | 2023-08-18T03:47:44.572979 | 2023-08-17T21:24:59 | 2023-08-17T21:24:59 | 153,097,643 | 3,953 | 1,492 | Apache-2.0 | 2023-09-14T21:42:24 | 2018-10-15T10:54:40 | C++ | UTF-8 | C++ | false | false | 498 | cpp | shape_of_kernel_selector.cpp | // Copyright (C) 2018-2023 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "shape_of_kernel_selector.h"
#include "shape_of_kernel_ref.h"
namespace kernel_selector {
shape_of_kernel_selector::shape_of_kernel_selector() {
Attach<ShapeOfKernelRef>();
}
KernelsData shape_of_kernel_selector::GetBestKernels(const Params& params, const optional_params& options) const {
return GetNaiveBestKernel(params, options, KernelType::SHAPE_OF);
}
} // namespace kernel_selector
|
933c1d8ea2bd150636cf374416d990706cb0d946 | 7348a87f288f4234ad399a9653a2f466bc527263 | /HW4/deck.cpp | ea8ee314154b4035770f41baf536a1e219f94125 | [] | no_license | Ian-An/CS172 | 0a03e392790d688afc713e23ec229b0679e0da56 | ba888dc401a114d11a775e8496af8d4fc4e4472f | refs/heads/master | 2021-01-20T03:29:36.341502 | 2017-04-27T02:38:22 | 2017-04-27T02:38:22 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,098 | cpp | deck.cpp | //
// deck.cpp
// HW4
//
// Created by AnYi on 5/15/16.
// Copyright © 2016 Yi An. All rights reserved.
//
#include "deck.h"
#include<vector>
#include <cstdlib>
#include<iterator>
#include<algorithm>
using namespace std;
bool deck::GameOver()
{
if(card_.size()==0)
return true;
else
return false;
}
void deck::SetCard(vector<card> card)
{
card_=card;
}
void deck::deck_shuffle()
{
random_shuffle (card_.begin(), card_.end() );
}
vector<card> deck::Get_Card()
{
return card_;
}
deck deck::Get_Deck(int n)
{
deck a;// Create a new vector for returning
vector<card> c_new;
for(int i=0;i<n;i++)
{ c_new.push_back(card_[i]);
}
a.SetCard(c_new);
card_.erase(card_.begin(),card_.begin()+n);// Delete the cards taken from the deck
return a;
}
int deck::Get_Number()
{
return int(card_.size());
}
void deck::Add_New_Card(card c)
{
card_.push_back(c);
}
card deck::Get_One_Card()
{
card temp;
temp=card_[0];
card_.erase(card_.begin());
return temp;
}
|
90b3e9b4e40e758db7571e9e1fb60dcb7c2b152a | 1d0fbe9a48f4ed333d0fb4fbdfee8d22af83b9c0 | /libraries/features/tracer/simulation/bsg_manycore_tracer.cpp | b6824f392ddc2ac9435cd110c1b77742020be082 | [
"LicenseRef-scancode-free-unknown",
"BSD-3-Clause"
] | permissive | sripathi-muralitharan/bsg_replicant | 7cfcf2cfa18556606d43b73f25b1c859e1fb8e88 | f29dccb246f17efcfc81948e73ff6532283f998d | refs/heads/main | 2023-07-25T09:19:36.993455 | 2021-07-09T00:42:15 | 2021-07-09T00:42:15 | 343,248,877 | 0 | 0 | BSD-3-Clause | 2021-03-01T00:39:40 | 2021-03-01T00:39:39 | null | UTF-8 | C++ | false | false | 4,979 | cpp | bsg_manycore_tracer.cpp | // Copyright (c) 2020, University of Washington All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// Redistributions of source code must retain the above copyright notice, this list
// of conditions and the following disclaimer.
//
// Redistributions in binary form must reproduce the above copyright notice, this
// list of conditions and the following disclaimer in the documentation and/or
// other materials provided with the distribution.
//
// Neither the name of the copyright holder nor the names of its contributors may
// be used to endorse or promote products derived from this software without
// specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <bsg_nonsynth_dpi_gpio.hpp>
#include <bsg_manycore_printing.h>
#include <bsg_manycore_coordinate.h>
#include <bsg_manycore_tracer.hpp>
#include <string>
#include <sstream>
#include <vector>
using namespace bsg_nonsynth_dpi;
using namespace std;
// There are TWO GPIO pins:
// -- One to control the TRACER (vanilla_operation_trace.csv)
// -- One to control the LOGGGER (vanilla.log)
// These correspond to the methods below
#define HB_MC_TRACER_TRACE_IDX 0
#define HB_MC_TRACER_LOG_IDX 1
#define HB_MC_TRACER_PINS 2
/**
* Initialize an hb_mc_tracer_t instance
* @param[in] p A pointer to the hb_mc_tracer_t instance to initialize
* @param[in] hier An implementation-dependent string. See the implementation for more details.
* @return HB_MC_SUCCESS on success. Otherwise an error code defined in bsg_manycore_errno.h.
*
* NOTE: In this implementation, the argument hier indicates the path
* to the top level module in simulation.
*/
int hb_mc_tracer_init(hb_mc_tracer_t *p, string &hier){
dpi_gpio<HB_MC_TRACER_PINS> *tracer = new dpi_gpio<HB_MC_TRACER_PINS>(hier + ".trace_control");
// Save the 2D vector
*p = reinterpret_cast<hb_mc_tracer_t>(tracer);
return HB_MC_SUCCESS;
}
/**
* Clean up an hb_mc_tracer_t instance
* @return HB_MC_SUCCESS on success. Otherwise an error code defined in bsg_manycore_errno.h.
*/
int hb_mc_tracer_cleanup(hb_mc_tracer_t *p){
dpi_gpio<HB_MC_TRACER_PINS> *tracer = reinterpret_cast<dpi_gpio<HB_MC_TRACER_PINS> *>(*p);
delete tracer;
return HB_MC_SUCCESS;
}
/**
* Enable trace file generation (vanilla_operation_trace.csv)
* @param[in] p A tracer instance initialized with hb_mc_tracer_init()
* @return HB_MC_SUCCESS on success. Otherwise an error code defined in bsg_manycore_errno.h.
*/
int hb_mc_tracer_trace_enable(hb_mc_tracer_t p){
dpi_gpio<HB_MC_TRACER_PINS> *tracer = reinterpret_cast<dpi_gpio<HB_MC_TRACER_PINS> *>(p);
tracer->set(HB_MC_TRACER_TRACE_IDX, true);
return HB_MC_SUCCESS;
}
/**
* Disable trace file generation (vanilla_operation_trace.csv)
* @param[in] p A tracer instance initialized with hb_mc_tracer_init()
* @return HB_MC_SUCCESS on success. Otherwise an error code defined in bsg_manycore_errno.h.
*/
int hb_mc_tracer_trace_disable(hb_mc_tracer_t p){
dpi_gpio<HB_MC_TRACER_PINS> *tracer = reinterpret_cast<dpi_gpio<HB_MC_TRACER_PINS> *>(p);
tracer->set(HB_MC_TRACER_TRACE_IDX, false);
return HB_MC_SUCCESS;
}
/**
* Enable log file generation (vanilla.log)
* @param[in] p A tracer instance initialized with hb_mc_tracer_init()
* @return HB_MC_SUCCESS on success. Otherwise an error code defined in bsg_manycore_errno.h.
*/
int hb_mc_tracer_log_enable(hb_mc_tracer_t p){
dpi_gpio<HB_MC_TRACER_PINS> *tracer = reinterpret_cast<dpi_gpio<HB_MC_TRACER_PINS> *>(p);
tracer->set(HB_MC_TRACER_LOG_IDX, true);
return HB_MC_SUCCESS;
}
/**
* Disable log file generation (vanilla.log)
* @param[in] p A tracer instance initialized with hb_mc_tracer_init()
* @return HB_MC_SUCCESS on success. Otherwise an error code defined in bsg_manycore_errno.h.
*/
int hb_mc_tracer_log_disable(hb_mc_tracer_t p){
dpi_gpio<HB_MC_TRACER_PINS> *tracer = reinterpret_cast<dpi_gpio<HB_MC_TRACER_PINS> *>(p);
tracer->set(HB_MC_TRACER_LOG_IDX, false);
return HB_MC_SUCCESS;
}
|
ab7aa22bea1e3f579071cc76e1050098b3bdd5c4 | 0eff74b05b60098333ad66cf801bdd93becc9ea4 | /second/download/mutt/gumtree/mutt_repos_function_196_mutt-1.4.2.3.cpp | 330510060ceac2ef14ecbd9835a83558d4112093 | [] | no_license | niuxu18/logTracker-old | 97543445ea7e414ed40bdc681239365d33418975 | f2b060f13a0295387fe02187543db124916eb446 | refs/heads/master | 2021-09-13T21:39:37.686481 | 2017-12-11T03:36:34 | 2017-12-11T03:36:34 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 92 | cpp | mutt_repos_function_196_mutt-1.4.2.3.cpp | char *mutt_pgp_hook (ADDRESS *adr)
{
return _mutt_string_hook (adr->mailbox, M_PGPHOOK);
} |
e0eef390022c064d4fa04280cd7e2c62720a3e83 | 2b804fedb2c279a9aa64ecdcdc3aac1e453e4cf8 | /ext/rgrep/librgrep/query.cpp | c2b01bec60effcd993f4855b11a829c5da756865 | [] | no_license | DanSnow/ruby-rgrep | d99e22113561a55ea188208989a1836a5b5c488c | 34b9e45d8683b5335ddca7f3b746546a8c519341 | refs/heads/master | 2021-01-10T17:58:47.086449 | 2016-04-01T05:38:47 | 2016-04-01T05:38:47 | 55,206,407 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,450 | cpp | query.cpp | #include "query.hpp"
#include "record.hpp"
#include "utils.hpp"
#include <iostream>
#include <algorithm>
#include <set>
using namespace std;
using namespace RGrep;
namespace RGrep {
struct RankData {
size_t pos;
int rank_value;
RankData(size_t pos, int rank_value) : pos(pos), rank_value(rank_value) {
}
bool operator<(const RankData &oth) {
if(rank_value != oth.rank_value) {
return rank_value < oth.rank_value;
} else {
return pos < oth.pos;
}
}
};
}
Query::Query(const char *q, bool ins) : query(q), insensitive(ins) {
parse();
}
Query::Query(const string &q, bool ins) : query(q), insensitive(ins) {
parse();
}
void Query::parse() {
if(query.find(',') != string::npos) {
type = BEST_MATCH;
} else if(query.find('&') != string::npos || query.find('|') != string::npos) {
type = BOOLEAN;
} else {
type = SINGLE;
}
}
void Query::run(Record &record_parser, const function<bool (Record &, int)> &callback) {
switch(type) {
case SINGLE:
search_single(record_parser, callback);
break;
case BEST_MATCH:
search_multi(record_parser, callback);
break;
case BOOLEAN:
search_boolean(record_parser, callback);
break;
}
}
void Query::search_single(Record &record_parser, const function<bool (Record &, int)> &callback) {
BMSearch query_search(query);
while(record_parser.search(query_search, insensitive)) {
if(!callback(record_parser, 0)) {
break;
}
record_parser.next_record();
}
}
void Query::search_boolean(Record &record_parser, const function<bool (Record &, int)> &callback) {
set<size_t> found_record;
vector<vector<string>> compiled_pattern;
vector<BMSearch> pat_searches;
compile_boolean(compiled_pattern);
for(auto term : compiled_pattern) {
int len = term.size();
for(auto pattern : term) {
pat_searches.push_back(BMSearch(pattern));
}
while(record_parser.search_record(pat_searches[0], insensitive)) {
bool all_match = true;
for(int i = 1; i < len; ++i) {
if(!record_parser.search_in_record(pat_searches[i], insensitive)) {
all_match = false;
break;
}
}
if(all_match) {
found_record.insert(record_parser.get_position());
}
record_parser.next_record();
}
}
for(size_t pos : found_record) {
record_parser.set_position(pos);
if(!callback(record_parser, 0)) {
break;
}
}
}
void Query::search_multi(Record &record_parser, const function<bool(Record &, int)> &callback) {
vector<string> must_patterns;
vector<string> not_patterns;
vector<string> patterns;
vector<BMSearch> must_searches, not_searches, pattern_searches;
vector<RankData> found_record;
set<size_t> explored_set;
int must_len, pat_len, rank_value;
size_t pos;
compile_multi(must_patterns, not_patterns, patterns);
for(auto pat : must_patterns) {
must_searches.push_back(BMSearch(pat));
}
for(auto pat : not_patterns) {
not_searches.push_back(BMSearch(pat));
}
for(auto pat : patterns) {
pattern_searches.push_back(BMSearch(pat));
}
must_len = must_patterns.size();
pat_len = patterns.size();
if(must_len) { // If have must have pattern
while(record_parser.search_record(must_searches[0], insensitive)) {
bool skip_record = false;
pos = record_parser.get_position();
rank_value = 0;
for(int i = 1; i < must_len; ++i) {
if(!record_parser.search_in_record(must_searches[i], insensitive)) {
skip_record = true;
break;
}
}
if(!skip_record) {
for(auto matcher : not_searches) {
if(record_parser.search_in_record(matcher, insensitive)) {
skip_record = true;
break;
}
}
}
if(!skip_record) {
for(auto matcher : pattern_searches) {
if(record_parser.search_in_record(matcher, insensitive)) {
rank_value += 10;
}
}
found_record.push_back(RankData(pos, rank_value));
push_heap(found_record.begin(), found_record.end());
}
record_parser.next_record();
}
} else {
for(int i = 0; i < pat_len; ++i) {
while(record_parser.search_record(pattern_searches[i], insensitive)) {
bool skip_record = false;
rank_value = 10;
pos = record_parser.get_position();
if(explored_set.find(pos) != explored_set.end()) {
skip_record = true;
}
if(!skip_record) {
for(auto matcher : not_searches) {
if(record_parser.search_in_record(matcher, insensitive)) {
skip_record = true;
break;
}
}
}
if(!skip_record) {
for(int j = 0; j < pat_len; ++j) {
if(j == i) {
continue;
}
if(record_parser.search_in_record(pattern_searches[j], insensitive)) {
rank_value += 10;
}
}
found_record.push_back(RankData(pos, rank_value));
push_heap(found_record.begin(), found_record.end());
}
explored_set.insert(pos);
record_parser.next_record();
}
record_parser.rewind();
}
}
while(!found_record.empty()) {
pos = found_record[0].pos;
rank_value = found_record[0].rank_value;
record_parser.set_position(pos);
if(!callback(record_parser, rank_value)) {
break;
}
pop_heap(found_record.begin(), found_record.end());
found_record.pop_back();
}
}
void Query::compile_boolean(vector<vector<string>> &compiled_pattern) {
vector<string> tokens;
vector<string> term;
string_split(tokens, query);
for(auto token : tokens) {
if(token != "&" && token != "|") {
term.push_back(token);
} else if(token == "|") {
compiled_pattern.push_back(term);
term.clear();
}
}
if(!term.empty()) {
compiled_pattern.push_back(term);
}
}
void Query::compile_multi(
vector<string> &must_patterns,
vector<string> ¬_patterns,
vector<string> &patterns
) {
vector<string> tokens;
string_split(tokens, query, ", ");
for(auto token : tokens) {
if(token[0] == '+') {
must_patterns.push_back(token.substr(1));
} else if (token[0] == '-') {
not_patterns.push_back(token.substr(1));
} else {
patterns.push_back(token);
}
}
}
|
9a002b1cb431a380bf5769a505456f7b0fbc23d3 | 2cfb31bf995318540bd1a7b6e19eb8b12cb8acd9 | /LightOJ/1232.cpp | 3b5ef5dab8a91ad7a0addfd5a9fe58dbb0b9d645 | [] | no_license | aurko96/Competitive-Programming | cf6265456450355e04c34acf9b7500b1cc30fd58 | 7b5a22d077f29145b92caef0883734ca40096227 | refs/heads/master | 2020-03-18T15:08:14.533253 | 2018-05-25T19:07:25 | 2018-05-25T19:07:25 | 134,889,195 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 640 | cpp | 1232.cpp | #include<bits/stdc++.h>
using namespace std;
int val[105],n,k;
long long dp[10005];
int mod=100000007;
long long call(int sum)
{
for(int i=0;i<n;i++)
{
for(int j=1;j<=k;j++)
{
if(val[i]<=j)
{
dp[j]=dp[j]%mod + dp[j-val[i]]%mod;
}
}
}
return dp[sum];
}
int main()
{
int i,j,y,z,t;
long long x;
scanf("%d",&t);
for(i=1;i<=t;i++)
{
scanf("%d %d",&n,&k);
for(j=0;j<n;j++) scanf("%d",&val[j]);
dp[0]=1;
for(j=1;j<=k;j++) dp[j]=0;
x=call(k);
printf("Case %d: %lld\n",i,x%mod);
}
}
|
f86e0d3b5087e073f65df3ee2cacf1a002985780 | 3ffe7d58df70dfe86347d058c5c7eba29fec0555 | /Chapter05/5_5_2/pra5_21.cpp | e11cbb008bed8b8ddc7925a09f741e5c60ab2df9 | [] | no_license | Exrealaz/cpp_primer_exeicise | ec508e39a6f4728d0c6acd4ca5e286a2817c137f | e111e6d7dfa7a9cac5ee01087e5699cd5a1f3efd | refs/heads/master | 2022-10-05T02:40:14.738994 | 2020-06-05T11:42:15 | 2020-06-05T11:42:15 | 267,763,316 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 660 | cpp | pra5_21.cpp | /*
修改 5.5.1 节的练习题程序,实习找到重复的单词必须以大写字母开头
*/
#include <iostream>
#include <string>
using std::cin; using std::cout; using std::endl; using std::string;
int main()
{
string s1, s2;
bool flag = false;
cin >> s2;
while (cin >> s1)
{
if (s1[0] != toupper(s1[0]))
continue;
if(s1 == s2)
{
cout << "\n连续重复出现的单词: " << s1 << endl;
flag = true;
break;
}
else
s2 = s1;
}
if (!flag)
cout << "\n没有任何单词是连续重复出现的" << endl;
return 0;
} |
dc9544ed563cf81944f66d3af8358ca4588e88b1 | 62ec94314f194157f62c49c206dd777a159e0817 | /src/editor/path_anchor_handle.h | 23f4b7fbf643c4e17ebb2ae820d0d6591293bb73 | [] | no_license | telishev/sneakPic | e6c3a9ceee97caf5c46808225e0e3e68a1ca2bf0 | 25cac33adfec70f161cc526123df5376ece9b950 | refs/heads/master | 2020-04-14T19:04:56.660200 | 2014-07-19T20:37:38 | 2014-07-19T20:37:38 | 10,853,376 | 2 | 3 | null | null | null | null | UTF-8 | C++ | false | false | 1,424 | h | path_anchor_handle.h | #ifndef PATH_ANCHOR_HANDLE_H
#define PATH_ANCHOR_HANDLE_H
#include "editor/base_anchor_handle.h"
#include <QPointF>
#include <string>
class QRect;
class QColor;
class svg_item_path;
class svg_path_geom;
class path_handles_editor;
class path_edit_operation;
class SkCanvas;
class SkPaint;
struct SkRect;
enum class node_type_t : char;
struct single_path_point;
class path_anchor_handle : public base_anchor_handle
{
path_handles_editor *m_editor;
QPointF m_drag_start;
QPointF m_drag_cur;
unique_ptr<path_edit_operation> m_edit_operation;
public:
path_anchor_handle (path_handles_editor *editor, svg_item_path *item, svg_path_geom_iterator path_it);
virtual ~path_anchor_handle ();
int point_id () const { return (int)m_path_it.point_index (); }
string item_name () const;
virtual QPointF get_handle_center () const override;
protected:
virtual bool start_drag (QPointF local_pos, QTransform transform) override;
virtual bool drag (QPointF local_pos, QTransform transform, keyboard_modifier modifier) override;
virtual bool end_drag (QPointF local_pos, QTransform transform, keyboard_modifier modifier) override;
virtual node_type_t node_type () const override;
virtual QTransform get_path_transform () const;
virtual void interrupt_drag () override;
private:
void apply_drag ();
void move_point ();
const svg_path_geom *get_path () const;
};
#endif // PATH_ANCHOR_HANDLE_H
|
6f4ea0a734b6a8f09a7d5a421f67a7683b8b00a1 | ca3e59b557caf2ff22d464963e48eff61dc119fb | /imagemosaicequal.cpp | fd7bdab02c58fe0ca667d4be05a3956702cf2f38 | [] | no_license | mbax4qf3/Image-Mosaics | fab0a6aa2e47ed441545b84f14646073ad3ea071 | 0bc2604743f1f40f3cc89a6a8612658fc10d3849 | refs/heads/master | 2022-12-07T12:30:43.429847 | 2020-08-18T11:27:22 | 2020-08-18T11:27:22 | 288,432,969 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 57,973 | cpp | imagemosaicequal.cpp | #include "stdafx.h"
#include <stdlib.h>
#include <opencv2/opencv.hpp>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <algorithm>
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
using namespace std;
using namespace cv;
int cut_hor; //number of blocks horizantally
int cut_ver; //number of blocks vertically
string ss; //name of each image
Mat src; //image (master)
Scalar mean_src; //rgb of average color of whole image
double meanB, meanG, meanR; //r,g,b of above
double v_d, s_d, h_d; //hsv of the rgb in double
int h, s, v; //hsv in integer of above
string color_of_image; //color.yaml
vector<Mat> blocks; //64 blocks of each image
vector<Mat> master_blocks;
int n = 0; //counter
Mat tmp; //tmp - refer to each block when processing
Vec3d lab_block; //Lab of each block
int L_color_blocks[64]; //average L in int of each block
int a_color_blocks[64]; //average a in int of each block
int b_color_blocks[64]; //average b in int of each block
int L_compare[64]; //
int a_compare[64]; //
int b_compare[64]; //
int num_of_each_color[10] = { 0 }; //num of image in each color
int black[100], grey[100], white[100], red[100], orange[100], yellow[100];
int green[100], cyan[100], blue[100], purple[100]; //index of image in each color
double dis_finger = 0.0; //distance of two fingerprint
double min_dis = 999.0; //init value
int min_dis_pic[10000] = { 0 }; //store the image index chosen of each block
int k; //index for fingerprint operation
int num_library; //the total number of liabrary images
string resolution, overlay_percent; //resolution setting and overlay
string s1; //used to store in yaml
string master, output; //name of master image and output image
vector<Mat>::iterator it, it_m; //iterator
int block_resize; //resize factor, how many times enlarge than original one;
//main
int main() {
/*********************/
cv::FileStorage fs1("black.yaml", cv::FileStorage::WRITE);
cv::FileStorage fs2("grey.yaml", cv::FileStorage::WRITE);
cv::FileStorage fs3("white.yaml", cv::FileStorage::WRITE);
cv::FileStorage fs4("red.yaml", cv::FileStorage::WRITE);
cv::FileStorage fs5("orange.yaml", cv::FileStorage::WRITE);
cv::FileStorage fs6("yellow.yaml", cv::FileStorage::WRITE);
cv::FileStorage fs7("green.yaml", cv::FileStorage::WRITE);
cv::FileStorage fs8("cyan.yaml", cv::FileStorage::WRITE);
cv::FileStorage fs9("blue.yaml", cv::FileStorage::WRITE);
cv::FileStorage fs10("purple.yaml", cv::FileStorage::WRITE);
cut_hor = 8;
cut_ver = 8;
System::String ^ num_lib = num_lib_img->Text;
num_library = System::Convert::ToInt16(num_lib);
for (int i = 1; i <= num_library; i++)
{
ss = "library/" + to_string(i) + ".jpg";
src = imread(ss);
//get mean from BGR
mean_src = mean(src);
//mean BGR
meanB = mean_src[0] / 255;
meanG = mean_src[1] / 255;
meanR = mean_src[2] / 255;
//get hsv from rgb
v_d = get_v(meanB, meanG, meanR);
s_d = get_s(v_d, meanB, meanG, meanR);
h_d = get_h(v_d, meanB, meanG, meanR);
//around to int
//USE THESE H S V TO STORE IN THE DATABASE
//use them to sort the image to which color bin
v = (int)(v_d * 100 + 0.5);
s = (int)(s_d * 100 + 0.5);
h = (int)(h_d + 0.5);
//sort image into color bin
color_of_image = color_image(h, s, v);
//cout << color_of_image << endl;
//BELOW PROCESS 9 BLOCKS
// \/ \/ \/ \/ \/ \/ \/ \/ \/ \/
//cut each library image into 8*8 = 64 pieces
blocks = CutPics_direct(imread(ss), cut_hor, cut_ver);
n = 0;
/* convert mean colour of each
* block to Lab mode
*/
it = blocks.begin();
while (it != blocks.end())
{
tmp = *it;
Scalar mean_blocks = mean(tmp);
lab_block = get_Lab(mean_blocks[2], mean_blocks[1], mean_blocks[0]);
L_color_blocks[n] = (int)(lab_block[0] + 0.5);
a_color_blocks[n] = (int)(lab_block[1] + 0.5);
b_color_blocks[n] = (int)(lab_block[2] + 0.5);
n++;
it++;
}//while
//write to files
s1 = "pic" + to_string(i);
if (color_of_image == "black.yaml")
{
black[num_of_each_color[0]] = i;
num_of_each_color[0]++;
fs1 << s1 << "[";
for (k = 0; k < 64; k++) {
fs1 << L_color_blocks[k] << a_color_blocks[k] << b_color_blocks[k];
}
fs1 << "]";
}
else if (color_of_image == "grey.yaml")
{
grey[num_of_each_color[1]] = i;
num_of_each_color[1]++;
fs2 << s1 << "[";
for (k = 0; k < 64; k++) {
fs2 << L_color_blocks[k] << a_color_blocks[k] << b_color_blocks[k];
}
fs2 << "]";
}
else if (color_of_image == "white.yaml")
{
white[num_of_each_color[2]] = i;
num_of_each_color[2]++;
fs3 << s1 << "[";
for (k = 0; k < 64; k++) {
fs3 << L_color_blocks[k] << a_color_blocks[k] << b_color_blocks[k];
}
fs3 << "]";
}
else if (color_of_image == "red.yaml")
{
red[num_of_each_color[3]] = i;
num_of_each_color[3]++;
fs4 << s1 << "[";
for (k = 0; k < 64; k++) {
fs4 << L_color_blocks[k] << a_color_blocks[k] << b_color_blocks[k];
}
fs4 << "]";
}
else if (color_of_image == "orange.yaml")
{
orange[num_of_each_color[4]] = i;
num_of_each_color[4]++;
fs5 << s1 << "[";
for (k = 0; k < 64; k++) {
fs5 << L_color_blocks[k] << a_color_blocks[k] << b_color_blocks[k];
}
fs5 << "]";
}
else if (color_of_image == "yellow.yaml")
{
yellow[num_of_each_color[5]] = i;
num_of_each_color[5]++;
fs6 << s1 << "[";
for (k = 0; k < 64; k++) {
fs6 << L_color_blocks[k] << a_color_blocks[k] << b_color_blocks[k];
}
fs6 << "]";
}
else if (color_of_image == "green.yaml")
{
green[num_of_each_color[6]] = i;
num_of_each_color[6]++;
fs7 << s1 << "[";
for (k = 0; k < 64; k++) {
fs7 << L_color_blocks[k] << a_color_blocks[k] << b_color_blocks[k];
}
fs7 << "]";
}
else if (color_of_image == "cyan.yaml")
{
cyan[num_of_each_color[7]] = i;
num_of_each_color[7]++;
fs8 << s1 << "[";
for (k = 0; k < 64; k++) {
fs8 << L_color_blocks[k] << a_color_blocks[k] << b_color_blocks[k];
}
fs8 << "]";
}
else if (color_of_image == "blue.yaml")
{
blue[num_of_each_color[8]] = i;
num_of_each_color[8]++;
fs9 << s1 << "[";
for (k = 0; k < 64; k++) {
fs9 << L_color_blocks[k] << a_color_blocks[k] << b_color_blocks[k];
}
fs9 << "]";
}
else if (color_of_image == "purple.yaml")
{
purple[num_of_each_color[9]] = i;
num_of_each_color[9]++;
fs10 << s1 << "[";
for (k = 0; k < 64; k++) {
fs10 << L_color_blocks[k] << a_color_blocks[k] << b_color_blocks[k];
}
fs10 << "]";
}
}//for each library images
fs1.open("black.yaml", FileStorage::READ);
fs2.open("grey.yaml", FileStorage::READ);
fs3.open("white.yaml", FileStorage::READ);
fs4.open("red.yaml", FileStorage::READ);
fs5.open("orange.yaml", FileStorage::READ);
fs6.open("yellow.yaml", FileStorage::READ);
fs7.open("green.yaml", FileStorage::READ);
fs8.open("cyan.yaml", FileStorage::READ);
fs9.open("blue.yaml", FileStorage::READ);
fs10.open("purple.yaml", FileStorage::READ);
/* Operation to master image
* mean colour
* 8 x 8 fingerprint store in master.yaml
*/
System::String ^ in_image = master_image_name->Text;
MarshalString(in_image, master); //now we read name of master in String
master = master;
System::String ^ out_image = target_image->Text;
MarshalString(out_image, output); //now we read name of target in String
output = "target/" + output;
string chosen_block_size;
MarshalString(block_size_box->Text, chosen_block_size);
if (chosen_block_size == "small") {
cut_hor = 60;
cut_ver = 60;
}
else if (chosen_block_size == "median") {
cut_hor = 50;
cut_ver = 50;
}
else {
cut_hor = 40;
cut_ver = 40;
}
src = imread(master);
int adjust_row = (src.rows / 8) * 8;
int adjust_colomn = (src.cols / 8) * 8;
resize(src, src, cv::Size(adjust_colomn, adjust_row), 0, 0, INTER_NEAREST);
vector<Mat> blocks_of_blocks_master;
master_blocks = CutPics_direct(imread(master), cut_hor, cut_ver);
cv::FileStorage fs11("master.yaml", cv::FileStorage::WRITE);
/* For each bloc, do the matching process
*
* very long due to the repeated operation
*/
for (int i = 1; i <= (cut_hor * cut_ver); i++)
{
mean_src = mean(master_blocks[i - 1]);
meanB = mean_src[0] / 255;
meanG = mean_src[1] / 255;
meanR = mean_src[2] / 255;
v_d = get_v(meanB, meanG, meanR);
s_d = get_s(v_d, meanB, meanG, meanR);
h_d = get_h(v_d, meanB, meanG, meanR);
v = (int)(v_d * 100 + 0.5);
s = (int)(s_d * 100 + 0.5);
h = (int)(h_d + 0.5);
color_of_image = color_image(h, s, v);
//cout << color_of_image << " " << h << " " << s << " " << v << endl;
//cut_hor = 8;
//cut_ver = 8;
blocks_of_blocks_master = CutPics_direct(master_blocks[i - 1], 8, 8);
it_m = blocks_of_blocks_master.begin();
n = 0;
while (it_m != blocks_of_blocks_master.end())
{
tmp = *it_m;
Scalar mean_blocks = mean(tmp);
lab_block = get_Lab(mean_blocks[2], mean_blocks[1], mean_blocks[0]);
L_color_blocks[n] = (int)(lab_block[0] + 0.5);
a_color_blocks[n] = (int)(lab_block[1] + 0.5);
b_color_blocks[n] = (int)(lab_block[2] + 0.5);
n++;
it_m++;
}
s1 = "m" + to_string(i);
fs11 << s1 << "[";
for (k = 0; k < 64; k++)
{
fs11 << L_color_blocks[k] << a_color_blocks[k] << b_color_blocks[k];
}
fs11 << "]";
int store_cout = 0;
//store top 6 unrepeated matching
double top_six_dis[6] = { 999.0, 999.0, 999.0, 999.0, 999.0, 999.0 };
int top_six_index[6] = { 1, 1, 1, 1, 1, 1 };
int max_index, min_index;
int tmp_max_index;
min_dis = 999.0;
double max_dis = 999.0;
//search color bin
if (color_of_image == "black.yaml")
{
//fs1.open("black.yaml", FileStorage::READ);
for (int e = 0; e < num_of_each_color[0]; e++)
{
ss = "pic" + to_string(black[e]);
FileNode node = fs1[ss];
FileNodeIterator it_read = node.begin();
store_cout = 0;
while (it_read != node.end())
{
if (store_cout % 3 == 0) {
L_compare[store_cout / 3] = (int)*it_read;
}
else if (store_cout % 3 == 1) {
a_compare[(store_cout / 3)] = (int)*it_read;
}
else if (store_cout % 3 == 2) {
b_compare[(store_cout / 3)] = (int)*it_read;
}
it_read++;
store_cout++;
}//while
//compute color dis of blocks
dis_finger = finger_dis(L_color_blocks, a_color_blocks, b_color_blocks, L_compare, a_compare, b_compare);
if (dis_finger <= min_dis) {
min_dis = dis_finger;
min_index = black[e];
}
tmp_max_index = max6_index(top_six_dis);
max_dis = top_six_dis[tmp_max_index];
max_index = top_six_index[tmp_max_index];
if ((dis_finger < max_dis) && (check_repeat(black[e], i) == 1)) {
top_six_dis[tmp_max_index] = dis_finger;
top_six_index[tmp_max_index] = black[e];
max_dis = top_six_dis[max6_index(top_six_dis)];
}//if
}//for e
//fs2.open("grey.yaml", FileStorage::READ);
for (int e = 0; e < num_of_each_color[1]; e++)
{
ss = "pic" + to_string(grey[e]);
FileNode node = fs2[ss];
FileNodeIterator it_read = node.begin();
store_cout = 0;
while (it_read != node.end())
{
if (store_cout % 3 == 0) {
L_compare[store_cout / 3] = (int)*it_read;
}
else if (store_cout % 3 == 1) {
a_compare[(store_cout / 3)] = (int)*it_read;
}
else if (store_cout % 3 == 2) {
b_compare[(store_cout / 3)] = (int)*it_read;
}
it_read++;
store_cout++;
}//while
//compute color dis of blocks
dis_finger = finger_dis(L_color_blocks, a_color_blocks, b_color_blocks, L_compare, a_compare, b_compare);
if (dis_finger <= min_dis) {
min_dis = dis_finger;
min_index = grey[e];
}
tmp_max_index = max6_index(top_six_dis);
max_dis = top_six_dis[tmp_max_index];
max_index = top_six_index[tmp_max_index];
if ((dis_finger < max_dis) && (check_repeat(grey[e], i) == 1)) {
top_six_dis[tmp_max_index] = dis_finger;
top_six_index[tmp_max_index] = grey[e];
max_dis = top_six_dis[max6_index(top_six_dis)];
}//if
}//for e
//choose
if (check_repeat_bigger(min_index, i) == 1) {
min_dis_pic[i] = min_index;
}
else {
min_dis_pic[i] = top_six_index[rand() % 6];
}
}
else if (color_of_image == "grey.yaml")
{
//fs1.open("black.yaml", FileStorage::READ);
for (int e = 0; e < num_of_each_color[0]; e++)
{
ss = "pic" + to_string(black[e]);
FileNode node = fs1[ss];
FileNodeIterator it_read = node.begin();
store_cout = 0;
while (it_read != node.end())
{
if (store_cout % 3 == 0) {
L_compare[store_cout / 3] = (int)*it_read;
}
else if (store_cout % 3 == 1) {
a_compare[(store_cout / 3)] = (int)*it_read;
}
else if (store_cout % 3 == 2) {
b_compare[(store_cout / 3)] = (int)*it_read;
}
it_read++;
store_cout++;
}//while
//compute color dis of blocks
dis_finger = finger_dis(L_color_blocks, a_color_blocks, b_color_blocks, L_compare, a_compare, b_compare);
if (dis_finger <= min_dis) {
min_dis = dis_finger;
min_index = black[e];
}
tmp_max_index = max6_index(top_six_dis);
max_dis = top_six_dis[tmp_max_index];
max_index = top_six_index[tmp_max_index];
if ((dis_finger < max_dis) && (check_repeat(black[e], i) == 1)) {
top_six_dis[tmp_max_index] = dis_finger;
top_six_index[tmp_max_index] = black[e];
max_dis = top_six_dis[max6_index(top_six_dis)];
}//if
}//for e
//fs2.open("grey.yaml", FileStorage::READ);
for (int e = 0; e < num_of_each_color[1]; e++)
{
ss = "pic" + to_string(grey[e]);
FileNode node = fs2[ss];
FileNodeIterator it_read = node.begin();
store_cout = 0;
while (it_read != node.end())
{
if (store_cout % 3 == 0) {
L_compare[store_cout / 3] = (int)*it_read;
}
else if (store_cout % 3 == 1) {
a_compare[(store_cout / 3)] = (int)*it_read;
}
else if (store_cout % 3 == 2) {
b_compare[(store_cout / 3)] = (int)*it_read;
}
it_read++;
store_cout++;
}//while
//compute color dis of blocks
dis_finger = finger_dis(L_color_blocks, a_color_blocks, b_color_blocks, L_compare, a_compare, b_compare);
if (dis_finger <= min_dis) {
min_dis = dis_finger;
min_index = grey[e];
}
tmp_max_index = max6_index(top_six_dis);
max_dis = top_six_dis[tmp_max_index];
max_index = top_six_index[tmp_max_index];
if ((dis_finger < max_dis) && (check_repeat(grey[e], i) == 1)) {
top_six_dis[tmp_max_index] = dis_finger;
top_six_index[tmp_max_index] = grey[e];
max_dis = top_six_dis[max6_index(top_six_dis)];
}//if
}//for e
//fs3.open("white.yaml", FileStorage::READ);
for (int e = 0; e < num_of_each_color[2]; e++)
{
ss = "pic" + to_string(white[e]);
FileNode node = fs3[ss];
FileNodeIterator it_read = node.begin();
store_cout = 0;
while (it_read != node.end())
{
if (store_cout % 3 == 0) {
L_compare[store_cout / 3] = (int)*it_read;
}
else if (store_cout % 3 == 1) {
a_compare[(store_cout / 3)] = (int)*it_read;
}
else if (store_cout % 3 == 2) {
b_compare[(store_cout / 3)] = (int)*it_read;
}
it_read++;
store_cout++;
}//while
//compute color dis of blocks
dis_finger = finger_dis(L_color_blocks, a_color_blocks, b_color_blocks, L_compare, a_compare, b_compare);
if (dis_finger <= min_dis) {
min_dis = dis_finger;
min_index = white[e];
}
tmp_max_index = max6_index(top_six_dis);
max_dis = top_six_dis[tmp_max_index];
max_index = top_six_index[tmp_max_index];
if ((dis_finger < max_dis) && (check_repeat(white[e], i) == 1)) {
top_six_dis[tmp_max_index] = dis_finger;
top_six_index[tmp_max_index] = white[e];
max_dis = top_six_dis[max6_index(top_six_dis)];
}//if
}//for e
//choose
if (check_repeat_bigger(min_index, i) == 1) {
min_dis_pic[i] = min_index;
}
else {
min_dis_pic[i] = top_six_index[rand() % 6];
}
}
else if (color_of_image == "white.yaml")
{
//fs2.open("grey.yaml", FileStorage::READ);
for (int e = 0; e < num_of_each_color[1]; e++)
{
ss = "pic" + to_string(grey[e]);
FileNode node = fs2[ss];
FileNodeIterator it_read = node.begin();
store_cout = 0;
while (it_read != node.end())
{
if (store_cout % 3 == 0) {
L_compare[store_cout / 3] = (int)*it_read;
}
else if (store_cout % 3 == 1) {
a_compare[(store_cout / 3)] = (int)*it_read;
}
else if (store_cout % 3 == 2) {
b_compare[(store_cout / 3)] = (int)*it_read;
}
it_read++;
store_cout++;
}//while
//compute color dis of blocks
dis_finger = finger_dis(L_color_blocks, a_color_blocks, b_color_blocks, L_compare, a_compare, b_compare);
if (dis_finger <= min_dis) {
min_dis = dis_finger;
min_index = grey[e];
}
tmp_max_index = max6_index(top_six_dis);
max_dis = top_six_dis[tmp_max_index];
max_index = top_six_index[tmp_max_index];
if ((dis_finger < max_dis) && (check_repeat(grey[e], i) == 1)) {
top_six_dis[tmp_max_index] = dis_finger;
top_six_index[tmp_max_index] = grey[e];
max_dis = top_six_dis[max6_index(top_six_dis)];
}//if
}//for e
//fs3.open("white.yaml", FileStorage::READ);
for (int e = 0; e < num_of_each_color[2]; e++)
{
ss = "pic" + to_string(white[e]);
FileNode node = fs3[ss];
FileNodeIterator it_read = node.begin();
store_cout = 0;
while (it_read != node.end())
{
if (store_cout % 3 == 0) {
L_compare[store_cout / 3] = (int)*it_read;
}
else if (store_cout % 3 == 1) {
a_compare[(store_cout / 3)] = (int)*it_read;
}
else if (store_cout % 3 == 2) {
b_compare[(store_cout / 3)] = (int)*it_read;
}
it_read++;
store_cout++;
}//while
//compute color dis of blocks
dis_finger = finger_dis(L_color_blocks, a_color_blocks, b_color_blocks, L_compare, a_compare, b_compare);
if (dis_finger <= min_dis) {
min_dis = dis_finger;
min_index = white[e];
}
tmp_max_index = max6_index(top_six_dis);
max_dis = top_six_dis[tmp_max_index];
max_index = top_six_index[tmp_max_index];
if ((dis_finger < max_dis) && (check_repeat(white[e], i) == 1)) {
top_six_dis[tmp_max_index] = dis_finger;
top_six_index[tmp_max_index] = white[e];
max_dis = top_six_dis[max6_index(top_six_dis)];
}//if
}//for e
//choose
if (check_repeat_bigger(min_index, i) == 1) {
min_dis_pic[i] = min_index;
}
else {
min_dis_pic[i] = top_six_index[rand() % 6];
}
}
else if (color_of_image == "red.yaml")
{
//red
for (int e = 0; e < num_of_each_color[3]; e++) //change
{
ss = "pic" + to_string(red[e]); //change
FileNode node = fs4[ss]; //change
FileNodeIterator it_read = node.begin();
store_cout = 0;
while (it_read != node.end())
{
if (store_cout % 3 == 0) {
L_compare[store_cout / 3] = (int)*it_read;
}
else if (store_cout % 3 == 1) {
a_compare[(store_cout / 3)] = (int)*it_read;
}
else if (store_cout % 3 == 2) {
b_compare[(store_cout / 3)] = (int)*it_read;
}
it_read++;
store_cout++;
}//while
//compute color dis of blocks
dis_finger = finger_dis(L_color_blocks, a_color_blocks, b_color_blocks, L_compare, a_compare, b_compare);
if (dis_finger <= min_dis) {
min_dis = dis_finger;
min_index = red[e];
}
tmp_max_index = max6_index(top_six_dis);
max_dis = top_six_dis[tmp_max_index];
max_index = top_six_index[tmp_max_index];
if ((dis_finger < max_dis) && (check_repeat(red[e], i) == 1)) {
top_six_dis[tmp_max_index] = dis_finger;
top_six_index[tmp_max_index] = red[e];
max_dis = top_six_dis[max6_index(top_six_dis)];
}//if
}//for e
//orange
for (int e = 0; e < num_of_each_color[4]; e++) //change
{
ss = "pic" + to_string(orange[e]); //change
FileNode node = fs5[ss]; //change
FileNodeIterator it_read = node.begin();
store_cout = 0;
while (it_read != node.end())
{
if (store_cout % 3 == 0) {
L_compare[store_cout / 3] = (int)*it_read;
}
else if (store_cout % 3 == 1) {
a_compare[(store_cout / 3)] = (int)*it_read;
}
else if (store_cout % 3 == 2) {
b_compare[(store_cout / 3)] = (int)*it_read;
}
it_read++;
store_cout++;
}//while
//compute color dis of blocks
dis_finger = finger_dis(L_color_blocks, a_color_blocks, b_color_blocks, L_compare, a_compare, b_compare);
if (dis_finger <= min_dis) {
min_dis = dis_finger;
min_index = orange[e];
}
tmp_max_index = max6_index(top_six_dis);
max_dis = top_six_dis[tmp_max_index];
max_index = top_six_index[tmp_max_index];
if ((dis_finger < max_dis) && (check_repeat(orange[e], i) == 1)) {
top_six_dis[tmp_max_index] = dis_finger;
top_six_index[tmp_max_index] = orange[e];
max_dis = top_six_dis[max6_index(top_six_dis)];
}//if
}//for e
//purple
for (int e = 0; e < num_of_each_color[9]; e++) //change
{
ss = "pic" + to_string(purple[e]); //change
FileNode node = fs10[ss]; //change
FileNodeIterator it_read = node.begin();
store_cout = 0;
while (it_read != node.end())
{
if (store_cout % 3 == 0) {
L_compare[store_cout / 3] = (int)*it_read;
}
else if (store_cout % 3 == 1) {
a_compare[(store_cout / 3)] = (int)*it_read;
}
else if (store_cout % 3 == 2) {
b_compare[(store_cout / 3)] = (int)*it_read;
}
it_read++;
store_cout++;
}//while
//compute color dis of blocks
dis_finger = finger_dis(L_color_blocks, a_color_blocks, b_color_blocks, L_compare, a_compare, b_compare);
if (dis_finger <= min_dis) {
min_dis = dis_finger;
min_index = purple[e];
}
tmp_max_index = max6_index(top_six_dis);
max_dis = top_six_dis[tmp_max_index];
max_index = top_six_index[tmp_max_index];
if ((dis_finger < max_dis) && (check_repeat(purple[e], i) == 1)) {
top_six_dis[tmp_max_index] = dis_finger;
top_six_index[tmp_max_index] = purple[e];
max_dis = top_six_dis[max6_index(top_six_dis)];
}//if
}//for e
//choose
if (check_repeat_bigger(min_index, i) == 1) {
min_dis_pic[i] = min_index;
}
else {
min_dis_pic[i] = top_six_index[rand() % 6];
}
}
else if (color_of_image == "orange.yaml")
{
//red
for (int e = 0; e < num_of_each_color[3]; e++) //change
{
ss = "pic" + to_string(red[e]); //change
FileNode node = fs4[ss]; //change
FileNodeIterator it_read = node.begin();
store_cout = 0;
while (it_read != node.end())
{
if (store_cout % 3 == 0) {
L_compare[store_cout / 3] = (int)*it_read;
}
else if (store_cout % 3 == 1) {
a_compare[(store_cout / 3)] = (int)*it_read;
}
else if (store_cout % 3 == 2) {
b_compare[(store_cout / 3)] = (int)*it_read;
}
it_read++;
store_cout++;
}//while
//compute color dis of blocks
dis_finger = finger_dis(L_color_blocks, a_color_blocks, b_color_blocks, L_compare, a_compare, b_compare);
if (dis_finger <= min_dis) {
min_dis = dis_finger;
min_index = red[e];
}
tmp_max_index = max6_index(top_six_dis);
max_dis = top_six_dis[tmp_max_index];
max_index = top_six_index[tmp_max_index];
if ((dis_finger < max_dis) && (check_repeat(red[e], i) == 1)) {
top_six_dis[tmp_max_index] = dis_finger;
top_six_index[tmp_max_index] = red[e];
max_dis = top_six_dis[max6_index(top_six_dis)];
}//if
}//for e
//orange
for (int e = 0; e < num_of_each_color[4]; e++) //change
{
ss = "pic" + to_string(orange[e]); //change
FileNode node = fs5[ss]; //change
FileNodeIterator it_read = node.begin();
store_cout = 0;
while (it_read != node.end())
{
if (store_cout % 3 == 0) {
L_compare[store_cout / 3] = (int)*it_read;
}
else if (store_cout % 3 == 1) {
a_compare[(store_cout / 3)] = (int)*it_read;
}
else if (store_cout % 3 == 2) {
b_compare[(store_cout / 3)] = (int)*it_read;
}
it_read++;
store_cout++;
}//while
//compute color dis of blocks
dis_finger = finger_dis(L_color_blocks, a_color_blocks, b_color_blocks, L_compare, a_compare, b_compare);
if (dis_finger <= min_dis) {
min_dis = dis_finger;
min_index = orange[e];
}
tmp_max_index = max6_index(top_six_dis);
max_dis = top_six_dis[tmp_max_index];
max_index = top_six_index[tmp_max_index];
if ((dis_finger < max_dis) && (check_repeat(orange[e], i) == 1)) {
top_six_dis[tmp_max_index] = dis_finger;
top_six_index[tmp_max_index] = orange[e];
max_dis = top_six_dis[max6_index(top_six_dis)];
}//if
}//for e
//yellow
for (int e = 0; e < num_of_each_color[5]; e++) //change
{
ss = "pic" + to_string(yellow[e]); //change
FileNode node = fs6[ss]; //change
FileNodeIterator it_read = node.begin();
store_cout = 0;
while (it_read != node.end())
{
if (store_cout % 3 == 0) {
L_compare[store_cout / 3] = (int)*it_read;
}
else if (store_cout % 3 == 1) {
a_compare[(store_cout / 3)] = (int)*it_read;
}
else if (store_cout % 3 == 2) {
b_compare[(store_cout / 3)] = (int)*it_read;
}
it_read++;
store_cout++;
}//while
//compute color dis of blocks
dis_finger = finger_dis(L_color_blocks, a_color_blocks, b_color_blocks, L_compare, a_compare, b_compare);
if (dis_finger <= min_dis) {
min_dis = dis_finger;
min_index = yellow[e];
}
tmp_max_index = max6_index(top_six_dis);
max_dis = top_six_dis[tmp_max_index];
max_index = top_six_index[tmp_max_index];
if ((dis_finger < max_dis) && (check_repeat(yellow[e], i) == 1)) {
top_six_dis[tmp_max_index] = dis_finger;
top_six_index[tmp_max_index] = yellow[e];
max_dis = top_six_dis[max6_index(top_six_dis)];
}//if
}//for e
//choose
if (check_repeat_bigger(min_index, i) == 1) {
min_dis_pic[i] = min_index;
}
else {
min_dis_pic[i] = top_six_index[rand() % 6];
}
}
else if (color_of_image == "yellow.yaml")
{
//green
for (int e = 0; e < num_of_each_color[6]; e++) //change
{
ss = "pic" + to_string(green[e]); //change
FileNode node = fs7[ss]; //change
FileNodeIterator it_read = node.begin();
store_cout = 0;
while (it_read != node.end())
{
if (store_cout % 3 == 0) {
L_compare[store_cout / 3] = (int)*it_read;
}
else if (store_cout % 3 == 1) {
a_compare[(store_cout / 3)] = (int)*it_read;
}
else if (store_cout % 3 == 2) {
b_compare[(store_cout / 3)] = (int)*it_read;
}
it_read++;
store_cout++;
}//while
//compute color dis of blocks
dis_finger = finger_dis(L_color_blocks, a_color_blocks, b_color_blocks, L_compare, a_compare, b_compare);
if (dis_finger <= min_dis) {
min_dis = dis_finger;
min_index = green[e];
}
tmp_max_index = max6_index(top_six_dis);
max_dis = top_six_dis[tmp_max_index];
max_index = top_six_index[tmp_max_index];
if ((dis_finger < max_dis) && (check_repeat(green[e], i) == 1)) {
top_six_dis[tmp_max_index] = dis_finger;
top_six_index[tmp_max_index] = green[e];
max_dis = top_six_dis[max6_index(top_six_dis)];
}//if
}//for e
//orange
for (int e = 0; e < num_of_each_color[4]; e++) //change
{
ss = "pic" + to_string(orange[e]); //change
FileNode node = fs5[ss]; //change
FileNodeIterator it_read = node.begin();
store_cout = 0;
while (it_read != node.end())
{
if (store_cout % 3 == 0) {
L_compare[store_cout / 3] = (int)*it_read;
}
else if (store_cout % 3 == 1) {
a_compare[(store_cout / 3)] = (int)*it_read;
}
else if (store_cout % 3 == 2) {
b_compare[(store_cout / 3)] = (int)*it_read;
}
it_read++;
store_cout++;
}//while
//compute color dis of blocks
dis_finger = finger_dis(L_color_blocks, a_color_blocks, b_color_blocks, L_compare, a_compare, b_compare);
if (dis_finger <= min_dis) {
min_dis = dis_finger;
min_index = orange[e];
}
tmp_max_index = max6_index(top_six_dis);
max_dis = top_six_dis[tmp_max_index];
max_index = top_six_index[tmp_max_index];
if ((dis_finger < max_dis) && (check_repeat(orange[e], i) == 1)) {
top_six_dis[tmp_max_index] = dis_finger;
top_six_index[tmp_max_index] = orange[e];
max_dis = top_six_dis[max6_index(top_six_dis)];
}//if
}//for e
//yellow
for (int e = 0; e < num_of_each_color[5]; e++) //change
{
ss = "pic" + to_string(yellow[e]); //change
FileNode node = fs6[ss]; //change
FileNodeIterator it_read = node.begin();
store_cout = 0;
while (it_read != node.end())
{
if (store_cout % 3 == 0) {
L_compare[store_cout / 3] = (int)*it_read;
}
else if (store_cout % 3 == 1) {
a_compare[(store_cout / 3)] = (int)*it_read;
}
else if (store_cout % 3 == 2) {
b_compare[(store_cout / 3)] = (int)*it_read;
}
it_read++;
store_cout++;
}//while
//compute color dis of blocks
dis_finger = finger_dis(L_color_blocks, a_color_blocks, b_color_blocks, L_compare, a_compare, b_compare);
if (dis_finger <= min_dis) {
min_dis = dis_finger;
min_index = yellow[e];
}
tmp_max_index = max6_index(top_six_dis);
max_dis = top_six_dis[tmp_max_index];
max_index = top_six_index[tmp_max_index];
if ((dis_finger < max_dis) && (check_repeat(yellow[e], i) == 1)) {
top_six_dis[tmp_max_index] = dis_finger;
top_six_index[tmp_max_index] = yellow[e];
max_dis = top_six_dis[max6_index(top_six_dis)];
}//if
}//for e
//choose
if (check_repeat_bigger(min_index, i) == 1) {
min_dis_pic[i] = min_index;
}
else {
min_dis_pic[i] = top_six_index[rand() % 6];
}
}
else if (color_of_image == "green.yaml")
{
//green
for (int e = 0; e < num_of_each_color[6]; e++) //change
{
ss = "pic" + to_string(green[e]); //change
FileNode node = fs7[ss]; //change
FileNodeIterator it_read = node.begin();
store_cout = 0;
while (it_read != node.end())
{
if (store_cout % 3 == 0) {
L_compare[store_cout / 3] = (int)*it_read;
}
else if (store_cout % 3 == 1) {
a_compare[(store_cout / 3)] = (int)*it_read;
}
else if (store_cout % 3 == 2) {
b_compare[(store_cout / 3)] = (int)*it_read;
}
it_read++;
store_cout++;
}//while
//compute color dis of blocks
dis_finger = finger_dis(L_color_blocks, a_color_blocks, b_color_blocks, L_compare, a_compare, b_compare);
if (dis_finger <= min_dis) {
min_dis = dis_finger;
min_index = green[e];
}
tmp_max_index = max6_index(top_six_dis);
max_dis = top_six_dis[tmp_max_index];
max_index = top_six_index[tmp_max_index];
if ((dis_finger < max_dis) && (check_repeat(green[e], i) == 1)) {
top_six_dis[tmp_max_index] = dis_finger;
top_six_index[tmp_max_index] = green[e];
max_dis = top_six_dis[max6_index(top_six_dis)];
}//if
}//for e
//cyan
for (int e = 0; e < num_of_each_color[7]; e++) //change
{
ss = "pic" + to_string(cyan[e]); //change
FileNode node = fs8[ss]; //change
FileNodeIterator it_read = node.begin();
store_cout = 0;
while (it_read != node.end())
{
if (store_cout % 3 == 0) {
L_compare[store_cout / 3] = (int)*it_read;
}
else if (store_cout % 3 == 1) {
a_compare[(store_cout / 3)] = (int)*it_read;
}
else if (store_cout % 3 == 2) {
b_compare[(store_cout / 3)] = (int)*it_read;
}
it_read++;
store_cout++;
}//while
//compute color dis of blocks
dis_finger = finger_dis(L_color_blocks, a_color_blocks, b_color_blocks, L_compare, a_compare, b_compare);
if (dis_finger <= min_dis) {
min_dis = dis_finger;
min_index = cyan[e];
}
tmp_max_index = max6_index(top_six_dis);
max_dis = top_six_dis[tmp_max_index];
max_index = top_six_index[tmp_max_index];
if ((dis_finger < max_dis) && (check_repeat(cyan[e], i) == 1)) {
top_six_dis[tmp_max_index] = dis_finger;
top_six_index[tmp_max_index] = cyan[e];
max_dis = top_six_dis[max6_index(top_six_dis)];
}//if
}//for e
//yellow
for (int e = 0; e < num_of_each_color[5]; e++) //change
{
ss = "pic" + to_string(yellow[e]); //change
FileNode node = fs6[ss]; //change
FileNodeIterator it_read = node.begin();
store_cout = 0;
while (it_read != node.end())
{
if (store_cout % 3 == 0) {
L_compare[store_cout / 3] = (int)*it_read;
}
else if (store_cout % 3 == 1) {
a_compare[(store_cout / 3)] = (int)*it_read;
}
else if (store_cout % 3 == 2) {
b_compare[(store_cout / 3)] = (int)*it_read;
}
it_read++;
store_cout++;
}//while
//compute color dis of blocks
dis_finger = finger_dis(L_color_blocks, a_color_blocks, b_color_blocks, L_compare, a_compare, b_compare);
if (dis_finger <= min_dis) {
min_dis = dis_finger;
min_index = yellow[e];
}
tmp_max_index = max6_index(top_six_dis);
max_dis = top_six_dis[tmp_max_index];
max_index = top_six_index[tmp_max_index];
if ((dis_finger < max_dis) && (check_repeat(yellow[e], i) == 1)) {
top_six_dis[tmp_max_index] = dis_finger;
top_six_index[tmp_max_index] = yellow[e];
max_dis = top_six_dis[max6_index(top_six_dis)];
}//if
}//for e
//choose
if (check_repeat_bigger(min_index, i) == 1) {
min_dis_pic[i] = min_index;
}
else {
min_dis_pic[i] = top_six_index[rand() % 6];
}
}
else if (color_of_image == "cyan.yaml")
{
//green
for (int e = 0; e < num_of_each_color[6]; e++) //change
{
ss = "pic" + to_string(green[e]); //change
FileNode node = fs7[ss]; //change
FileNodeIterator it_read = node.begin();
store_cout = 0;
while (it_read != node.end())
{
if (store_cout % 3 == 0) {
L_compare[store_cout / 3] = (int)*it_read;
}
else if (store_cout % 3 == 1) {
a_compare[(store_cout / 3)] = (int)*it_read;
}
else if (store_cout % 3 == 2) {
b_compare[(store_cout / 3)] = (int)*it_read;
}
it_read++;
store_cout++;
}//while
//compute color dis of blocks
dis_finger = finger_dis(L_color_blocks, a_color_blocks, b_color_blocks, L_compare, a_compare, b_compare);
if (dis_finger <= min_dis) {
min_dis = dis_finger;
min_index = green[e];
}
tmp_max_index = max6_index(top_six_dis);
max_dis = top_six_dis[tmp_max_index];
max_index = top_six_index[tmp_max_index];
if ((dis_finger < max_dis) && (check_repeat(green[e], i) == 1)) {
top_six_dis[tmp_max_index] = dis_finger;
top_six_index[tmp_max_index] = green[e];
max_dis = top_six_dis[max6_index(top_six_dis)];
}//if
}//for e
//cyan
for (int e = 0; e < num_of_each_color[7]; e++) //change
{
ss = "pic" + to_string(cyan[e]); //change
FileNode node = fs8[ss]; //change
FileNodeIterator it_read = node.begin();
store_cout = 0;
while (it_read != node.end())
{
if (store_cout % 3 == 0) {
L_compare[store_cout / 3] = (int)*it_read;
}
else if (store_cout % 3 == 1) {
a_compare[(store_cout / 3)] = (int)*it_read;
}
else if (store_cout % 3 == 2) {
b_compare[(store_cout / 3)] = (int)*it_read;
}
it_read++;
store_cout++;
}//while
//compute color dis of blocks
dis_finger = finger_dis(L_color_blocks, a_color_blocks, b_color_blocks, L_compare, a_compare, b_compare);
if (dis_finger <= min_dis) {
min_dis = dis_finger;
min_index = cyan[e];
}
tmp_max_index = max6_index(top_six_dis);
max_dis = top_six_dis[tmp_max_index];
max_index = top_six_index[tmp_max_index];
if ((dis_finger < max_dis) && (check_repeat(cyan[e], i) == 1)) {
top_six_dis[tmp_max_index] = dis_finger;
top_six_index[tmp_max_index] = cyan[e];
max_dis = top_six_dis[max6_index(top_six_dis)];
}//if
}//for e
//blue
for (int e = 0; e < num_of_each_color[8]; e++) //change
{
ss = "pic" + to_string(blue[e]); //change
FileNode node = fs9[ss]; //change
FileNodeIterator it_read = node.begin();
store_cout = 0;
while (it_read != node.end())
{
if (store_cout % 3 == 0) {
L_compare[store_cout / 3] = (int)*it_read;
}
else if (store_cout % 3 == 1) {
a_compare[(store_cout / 3)] = (int)*it_read;
}
else if (store_cout % 3 == 2) {
b_compare[(store_cout / 3)] = (int)*it_read;
}
it_read++;
store_cout++;
}//while
//compute color dis of blocks
dis_finger = finger_dis(L_color_blocks, a_color_blocks, b_color_blocks, L_compare, a_compare, b_compare);
if (dis_finger <= min_dis) {
min_dis = dis_finger;
min_index = blue[e];
}
tmp_max_index = max6_index(top_six_dis);
max_dis = top_six_dis[tmp_max_index];
max_index = top_six_index[tmp_max_index];
if ((dis_finger < max_dis) && (check_repeat(blue[e], i) == 1)) {
top_six_dis[tmp_max_index] = dis_finger;
top_six_index[tmp_max_index] = blue[e];
max_dis = top_six_dis[max6_index(top_six_dis)];
}//if
}//for e
//choose
if (check_repeat_bigger(min_index, i) == 1) {
min_dis_pic[i] = min_index;
}
else {
min_dis_pic[i] = top_six_index[rand() % 6];
}
}
else if (color_of_image == "blue.yaml")
{
//purple
for (int e = 0; e < num_of_each_color[9]; e++) //change
{
ss = "pic" + to_string(purple[e]); //change
FileNode node = fs10[ss]; //change
FileNodeIterator it_read = node.begin();
store_cout = 0;
while (it_read != node.end())
{
if (store_cout % 3 == 0) {
L_compare[store_cout / 3] = (int)*it_read;
}
else if (store_cout % 3 == 1) {
a_compare[(store_cout / 3)] = (int)*it_read;
}
else if (store_cout % 3 == 2) {
b_compare[(store_cout / 3)] = (int)*it_read;
}
it_read++;
store_cout++;
}//while
//compute color dis of blocks
dis_finger = finger_dis(L_color_blocks, a_color_blocks, b_color_blocks, L_compare, a_compare, b_compare);
if (dis_finger <= min_dis) {
min_dis = dis_finger;
min_index = purple[e];
}
tmp_max_index = max6_index(top_six_dis);
max_dis = top_six_dis[tmp_max_index];
max_index = top_six_index[tmp_max_index];
if ((dis_finger < max_dis) && (check_repeat(purple[e], i) == 1)) {
top_six_dis[tmp_max_index] = dis_finger;
top_six_index[tmp_max_index] = purple[e];
max_dis = top_six_dis[max6_index(top_six_dis)];
}//if
}//for e
//cyan
for (int e = 0; e < num_of_each_color[7]; e++) //change
{
ss = "pic" + to_string(cyan[e]); //change
FileNode node = fs8[ss]; //change
FileNodeIterator it_read = node.begin();
store_cout = 0;
while (it_read != node.end())
{
if (store_cout % 3 == 0) {
L_compare[store_cout / 3] = (int)*it_read;
}
else if (store_cout % 3 == 1) {
a_compare[(store_cout / 3)] = (int)*it_read;
}
else if (store_cout % 3 == 2) {
b_compare[(store_cout / 3)] = (int)*it_read;
}
it_read++;
store_cout++;
}//while
//compute color dis of blocks
dis_finger = finger_dis(L_color_blocks, a_color_blocks, b_color_blocks, L_compare, a_compare, b_compare);
if (dis_finger <= min_dis) {
min_dis = dis_finger;
min_index = cyan[e];
}
tmp_max_index = max6_index(top_six_dis);
max_dis = top_six_dis[tmp_max_index];
max_index = top_six_index[tmp_max_index];
if ((dis_finger < max_dis) && (check_repeat(cyan[e], i) == 1)) {
top_six_dis[tmp_max_index] = dis_finger;
top_six_index[tmp_max_index] = cyan[e];
max_dis = top_six_dis[max6_index(top_six_dis)];
}//if
}//for e
//blue
for (int e = 0; e < num_of_each_color[8]; e++) //change
{
ss = "pic" + to_string(blue[e]); //change
FileNode node = fs9[ss]; //change
FileNodeIterator it_read = node.begin();
store_cout = 0;
while (it_read != node.end())
{
if (store_cout % 3 == 0) {
L_compare[store_cout / 3] = (int)*it_read;
}
else if (store_cout % 3 == 1) {
a_compare[(store_cout / 3)] = (int)*it_read;
}
else if (store_cout % 3 == 2) {
b_compare[(store_cout / 3)] = (int)*it_read;
}
it_read++;
store_cout++;
}//while
//compute color dis of blocks
dis_finger = finger_dis(L_color_blocks, a_color_blocks, b_color_blocks, L_compare, a_compare, b_compare);
if (dis_finger <= min_dis) {
min_dis = dis_finger;
min_index = blue[e];
}
tmp_max_index = max6_index(top_six_dis);
max_dis = top_six_dis[tmp_max_index];
max_index = top_six_index[tmp_max_index];
if ((dis_finger < max_dis) && (check_repeat(blue[e], i) == 1)) {
top_six_dis[tmp_max_index] = dis_finger;
top_six_index[tmp_max_index] = blue[e];
max_dis = top_six_dis[max6_index(top_six_dis)];
}//if
}//for e
//choose
if (check_repeat_bigger(min_index, i) == 1) {
min_dis_pic[i] = min_index;
}
else {
min_dis_pic[i] = top_six_index[rand() % 6];
}
}
else if (color_of_image == "purple.yaml")
{
//purple
for (int e = 0; e < num_of_each_color[9]; e++) //change
{
ss = "pic" + to_string(purple[e]); //change
FileNode node = fs10[ss]; //change
FileNodeIterator it_read = node.begin();
store_cout = 0;
while (it_read != node.end())
{
if (store_cout % 3 == 0) {
L_compare[store_cout / 3] = (int)*it_read;
}
else if (store_cout % 3 == 1) {
a_compare[(store_cout / 3)] = (int)*it_read;
}
else if (store_cout % 3 == 2) {
b_compare[(store_cout / 3)] = (int)*it_read;
}
it_read++;
store_cout++;
}//while
//compute color dis of blocks
dis_finger = finger_dis(L_color_blocks, a_color_blocks, b_color_blocks, L_compare, a_compare, b_compare);
if (dis_finger <= min_dis) {
min_dis = dis_finger;
min_index = purple[e];
}
tmp_max_index = max6_index(top_six_dis);
max_dis = top_six_dis[tmp_max_index];
max_index = top_six_index[tmp_max_index];
if ((dis_finger < max_dis) && (check_repeat(purple[e], i) == 1)) {
top_six_dis[tmp_max_index] = dis_finger;
top_six_index[tmp_max_index] = purple[e];
max_dis = top_six_dis[max6_index(top_six_dis)];
}//if
}//for e
//red
for (int e = 0; e < num_of_each_color[3]; e++) //change
{
ss = "pic" + to_string(red[e]); //change
FileNode node = fs4[ss]; //change
FileNodeIterator it_read = node.begin();
store_cout = 0;
while (it_read != node.end())
{
if (store_cout % 3 == 0) {
L_compare[store_cout / 3] = (int)*it_read;
}
else if (store_cout % 3 == 1) {
a_compare[(store_cout / 3)] = (int)*it_read;
}
else if (store_cout % 3 == 2) {
b_compare[(store_cout / 3)] = (int)*it_read;
}
it_read++;
store_cout++;
}//while
//compute color dis of blocks
dis_finger = finger_dis(L_color_blocks, a_color_blocks, b_color_blocks, L_compare, a_compare, b_compare);
if (dis_finger <= min_dis) {
min_dis = dis_finger;
min_index = red[e];
}
tmp_max_index = max6_index(top_six_dis);
max_dis = top_six_dis[tmp_max_index];
max_index = top_six_index[tmp_max_index];
if ((dis_finger < max_dis) && (check_repeat(red[e], i) == 1)) {
top_six_dis[tmp_max_index] = dis_finger;
top_six_index[tmp_max_index] = red[e];
max_dis = top_six_dis[max6_index(top_six_dis)];
}//if
}//for e
//blue
for (int e = 0; e < num_of_each_color[8]; e++) //change
{
ss = "pic" + to_string(blue[e]); //change
FileNode node = fs9[ss]; //change
FileNodeIterator it_read = node.begin();
store_cout = 0;
while (it_read != node.end())
{
if (store_cout % 3 == 0) {
L_compare[store_cout / 3] = (int)*it_read;
}
else if (store_cout % 3 == 1) {
a_compare[(store_cout / 3)] = (int)*it_read;
}
else if (store_cout % 3 == 2) {
b_compare[(store_cout / 3)] = (int)*it_read;
}
it_read++;
store_cout++;
}//while
//compute color dis of blocks
dis_finger = finger_dis(L_color_blocks, a_color_blocks, b_color_blocks, L_compare, a_compare, b_compare);
if (dis_finger <= min_dis) {
min_dis = dis_finger;
min_index = blue[e];
}
tmp_max_index = max6_index(top_six_dis);
max_dis = top_six_dis[tmp_max_index];
max_index = top_six_index[tmp_max_index];
if ((dis_finger < max_dis) && (check_repeat(blue[e], i) == 1)) {
top_six_dis[tmp_max_index] = dis_finger;
top_six_index[tmp_max_index] = blue[e];
max_dis = top_six_dis[max6_index(top_six_dis)];
}//if
}//for e
//choose
if (check_repeat_bigger(min_index, i) == 1) {
min_dis_pic[i] = min_index;
}
else {
min_dis_pic[i] = top_six_index[rand() % 6];
}
}
} //for each block of master image
fs1.release();
fs2.release();
fs3.release();
fs4.release();
fs5.release();
fs6.release();
fs7.release();
fs8.release();
fs9.release();
fs10.release();
fs11.release();
//the final resolution
MarshalString(resolution_box->Text, resolution);
if (resolution == "low") {
block_resize = 2;
}
else if (resolution == "median") {
block_resize = 5;
}
else if (resolution == "high") {
block_resize = 8;
}
//set the final block size to decide the final resolution
int block_height = (src.rows * block_resize) / cut_ver;
int block_width = (src.cols * block_resize) / cut_hor;
//create the backgroud of the result
Mat3b target(block_height * cut_ver, block_width * cut_hor);
Mat3b resize_master(block_height * cut_ver, block_width * cut_hor);
it = master_blocks.begin();
for (int i = 1; i <= (cut_hor * cut_ver); i++)
{
//timing
Mat resize_ori, resize_dst, tmp_dst, final_image;
resize_ori = imread("library/" + to_string(min_dis_pic[i]) + ".jpg");
resize(resize_ori, resize_dst, cv::Size(block_width, block_height), 0, 0, CV_INTER_LINEAR);
//linear blend the original blocks
tmp = *it;
resize(tmp, tmp_dst, cv::Size(block_width, block_height), 0, 0, CV_INTER_LINEAR);
final_image = resize_dst;
int cols = ((i - 1) % cut_hor) * block_width;
int rows = ((i - 1) / cut_hor) * block_height;
final_image.copyTo(target(Rect(cols, rows, block_width, block_height)));
tmp_dst.copyTo(resize_master(Rect(cols, rows, block_width, block_height)));
it++;
}//for each block
MarshalString(overlay_box->Text, overlay_percent);
double alpha_1;
if (overlay_percent == "10%") {
alpha_1 = 0.9;
}
else if (overlay_percent == "20%") {
alpha_1 = 0.8;
}
else if (overlay_percent == "30%") {
alpha_1 = 0.7;
}
else if (overlay_percent == "40%") {
alpha_1 = 0.6;
}
else if (overlay_percent == "50%") {
alpha_1 = 0.5;
}
else {
alpha_1 = 1.0;
}
addWeighted(target, alpha_1, resize_master, (1 - alpha_1), 0.0, target);
imwrite(output, target);
//master_image_show->ImageLocation = gcnew System::String(output.c_str());
}
void MarshalString ( System::String ^ s, string& os ) {
using namespace Runtime::InteropServices;
const char* chars =
(const char*)(Marshal::StringToHGlobalAnsi(s)).ToPointer();
os = chars;
Marshal::FreeHGlobal(IntPtr((void*)chars));
}
string num2str(int i)
{
stringstream ss;
ss << i;
return ss.str();
}
double max3(double a, double b, double c)
{
return max(max(a, b), c);
}
int max6_index(double a[6])
{
double tmp_max = max(max3(a[0], a[1], a[2]), max3(a[3], a[4], a[5]));
if (tmp_max == a[0]) {
return 0;
}
else if (tmp_max == a[1]) {
return 1;
}
else if (tmp_max == a[2]) {
return 2;
}
else if (tmp_max == a[3]) {
return 3;
}
else if (tmp_max == a[4]) {
return 4;
}
else if (tmp_max == a[5]) {
return 5;
}
return 0;
}
double min3(double a, double b, double c)
{
return min(min(a, b), c);
}
double get_v(double b, double g, double r)
{
return max3(b, g, r);
}
double get_s(double v, double b, double g, double r)
{
if (v == 0.0)
{
return 0.0;
}
else
{
return ((v - min3(b, g, r)) / v);
}
}
double get_h(double v, double b, double g, double r)
{
double h;
if (v == min3(r, g, b)) {
h = 0.0;
}
else if ((v == r) && (g >= b)) {
h = (60.0 * (g - b)) / (v - min3(r, g, b));
}
else if ((v == r) && (g < b)) {
h = (60.0 * (g - b)) / (v - min3(r, g, b)) + 360.0;
}
else if (v == g) {
h = (60.0 * (b - r)) / (v - min3(r, g, b)) + 120.0;
}
else if (v == b) {
h = (60.0 * (r - g)) / (v - min3(r, g, b)) + 240.0;
}
return h;
}
Vec3d get_Lab(double r, double g, double b)
{
double var_R = (r / 255.0);
double var_G = (g / 255.0);
double var_B = (b / 255.0);
if (var_R > 0.04045) {
var_R = pow(((var_R + 0.055) / 1.055), 2.4);
}
else {
var_R = var_R / 12.92;
}
if (var_G > 0.04045) {
var_G = pow(((var_G + 0.055) / 1.055), 2.4);
}
else {
var_G = var_G / 12.92;
}
if (var_B > 0.04045) {
var_B = pow(((var_B + 0.055) / 1.055), 2.4);
}
else {
var_B = var_B / 12.92;
}
var_R = var_R * 100.0;
var_G = var_G * 100.0;
var_B = var_B * 100.0;
double X = var_R * 0.4124 + var_G * 0.3576 + var_B * 0.1805;
double Y = var_R * 0.2126 + var_G * 0.7152 + var_B * 0.0722;
double Z = var_R * 0.0193 + var_G * 0.1192 + var_B * 0.9505;
//95.047 100.00 108.883
double var_X = X / 95.047;
double var_Y = Y / 100.00;
double var_Z = Z / 108.883;
if (var_X > 0.008856) {
var_X = pow(var_X, (1.0 / 3.0));
}
else {
var_X = (7.787 * var_X) + (16.0 / 116.0);
}
if (var_Y > 0.008856) {
var_Y = pow(var_Y, (1.0 / 3.0));
}
else {
var_Y = (7.787 * var_Y) + (16.0 / 116.0);
}
if (var_Z > 0.008856) {
var_Z = pow(var_Z, (1.0 / 3.0));
}
else {
var_Z = (7.787 * var_Z) + (16.0 / 116.0);
}
double get_L = (116 * var_Y) - 16.0;
double get_a = 500.0 * (var_X - var_Y);
double get_b = 200.0 * (var_Y - var_Z);
Vec3d lab;
lab[0] = get_L;
lab[1] = get_a;
lab[2] = get_b;
return lab;
}
vector<Mat> CutPics_direct(Mat srcImg, int c_h, int c_v)
{
vector<Mat> cell;
int height = srcImg.rows;
int width = srcImg.cols;
int cell_h = (int)(height / c_v);
int cell_w = (int)(width / c_h);
int cell_lower_h = height - (c_v - 1) * cell_h;
int cell_right_w = width - (c_h - 1) * cell_w;
for (int i = 0; i < (c_v - 1); i++)
for (int j = 0; j < c_h; j++)
{
if (j < (c_h - 1))
{
Rect rect(j * cell_w, i * cell_h, cell_w, cell_h);
cell.push_back(srcImg(rect));
} else{
Rect rect((c_h - 1) * cell_w, i * cell_h, cell_right_w, cell_h);
cell.push_back(srcImg(rect));
}
}
for (int i = 0; i < c_h; i++)
{
if (i < (c_h - 1))
{
Rect rect(i * cell_w, (c_v - 1) * cell_h, cell_w, cell_lower_h);
cell.push_back(srcImg(rect));
} else {
Rect rect((c_h - 1) * cell_w, (c_v - 1) * cell_h, cell_right_w, cell_lower_h);
cell.push_back(srcImg(rect));
}
}
return cell;
}
string color_image(int h, int s, int v)
{
if ((h >= 0) && (h <= 360) && (s >= 0) && (s <= 100) && (v >= 0) && (v <= 18))
{
return "black.yaml";
}//black
if ((h >= 0) && (h <= 360) && (s >= 0) && (s <= 17) && (v >= 18) && (v <= 86))
{
return "grey.yaml";
}//grey
if ((h >= 0) && (h <= 360) && (s >= 0) && (s <= 17) && (v >= 80) && (v <= 100))
{
return "white.yaml";
}//white
if ((h >= 0) && (h <= 20) && (s >= 17) && (s <= 100) && (v >= 18) && (v <= 100))
{
return "red.yaml";
}//red
if ((h >= 311) && (h <= 360) && (s >= 17) && (s <= 100) && (v >= 18) && (v <= 100))
{
return "red.yaml";
}//red
if ((h >= 21) && (h <= 50) && (s >= 17) && (s <= 100) && (v >= 18) && (v <= 100))
{
return "orange.yaml";
}//orange
if ((h >= 51) && (h <= 68) && (s >= 17) && (s <= 100) && (v >= 18) && (v <= 100))
{
return "yellow.yaml";
}//yellow
if ((h >= 69) && (h <= 154) && (s >= 17) && (s <= 100) && (v >= 18) && (v <= 100))
{
return "green.yaml";
}//green
if ((h >= 155) && (h <= 198) && (s >= 17) && (s <= 100) && (v >= 18) && (v <= 100))
{
return "cyan.yaml";
}//cyan
if ((h >= 199) && (h <= 248) && (s >= 17) && (s <= 100) && (v >= 18) && (v <= 100))
{
return "blue.yaml";
}//blue
if ((h >= 249) && (h <= 310) && (s >= 17) && (s <= 100) && (v >= 18) && (v <= 100))
{
return "purple.yaml";
}//purple
return "blank";
}
double color_dis(Vec3i lab1, Vec3i lab2)
{
double L1 = (double)(lab1[0]);
double L2 = (double)(lab2[0]);
double a1 = (double)(lab1[1]);
double a2 = (double)(lab2[1]);
double b1 = (double)(lab1[2]);
double b2 = (double)(lab2[2]);
double c1 = sqrt((a1 * a1) + (b1 * b1));
double c2 = sqrt((a2 * a2) + (b2 * b2));
double delta_L = L1 - L2;
double delta_C = c1 - c2;
double delta_a = a1 - a2;
double delta_b = b1 - b2;
double delta_H = (delta_a * delta_a) + (delta_b * delta_b) - (delta_C * delta_C);
double sc = 1.0 + 0.045 * c1;
double sh = 1.0 + 0.015 * c1;
double first = (delta_L);
double second = (delta_C) / (sc);
double third = (delta_H) / (sh * sh);
double delta = sqrt((first * first) + (second * second) + (third));
return delta;
}
double finger_dis(int L1[64], int a1[64], int b1[64], int L2[64], int a2[64], int b2[64])
{
Vec3i temp1, temp2;
int p;
double dis_finger = 0.0;
for (p = 0; p < 64; p++)
{
temp1[0] = L1[p];
temp1[1] = a1[p];
temp1[2] = b1[p];
temp2[0] = L2[p];
temp2[1] = a2[p];
temp2[2] = b2[p];
dis_finger += color_dis(temp1, temp2);
}
return (dis_finger / 64.0);
}
int check_repeat(int img_index, int location)
{
//left
if ((location - 1) > 0) {
if (min_dis_pic[location - 1] == img_index) {
return 0;
}
}
//left left
if ((location - 2) > 0) {
if (min_dis_pic[location - 2] == img_index) {
return 0;
}
}
//up right
if ((location - cut_hor + 1) > 0) {
if (min_dis_pic[location - cut_hor + 1] == img_index) {
return 0;
}
}
//up
if ((location - cut_hor) > 0) {
if (min_dis_pic[location - cut_hor] == img_index) {
return 0;
}
}
//up left
if ((location - cut_hor - 1) > 0) {
if (min_dis_pic[location - cut_hor - 1] == img_index) {
return 0;
}
}
//up left left
if ((location - cut_hor - 2) > 0) {
if (min_dis_pic[location - cut_hor - 2] == img_index) {
return 0;
}
}
//up up right
if ((location - 2 * cut_hor + 1) > 0) {
if (min_dis_pic[location - 2 * cut_hor + 1] == img_index) {
return 0;
}
}
//up up left left
if ((location - 2 * cut_hor - 2) > 0) {
if (min_dis_pic[location - 2 * cut_hor - 2] == img_index) {
return 0;
}
}
//up up
if ((location - 2 * cut_hor) > 0) {
if (min_dis_pic[location - 2 * cut_hor] == img_index) {
return 0;
}
}
//up up left
if ((location - 2 * cut_hor - 1) > 0) {
if (min_dis_pic[location - 2 * cut_hor - 1] == img_index) {
return 0;
}
}
return 1;
}
int check_repeat_bigger(int img_index, int location) {
if (check_repeat(img_index, location)) {
//left left left
if ((location - 3) > 0) {
if (min_dis_pic[location - 3] == img_index) {
return 0;
}
}
else if ((location - cut_hor - 3) > 0) {
// up l l l
if (min_dis_pic[location - cut_hor - 3] == img_index) {
return 0;
}
} if ((location - 2 * cut_hor - 2) > 0) {
//up up l l l
if (min_dis_pic[location - 2 * cut_hor - 3] == img_index) {
return 0;
}
}
return 1;
}
else {
return 0;
}
return 1;
}
|
d67665eda21f25a3d22e61f46178079c2eb2de0c | 60fc2981def65ef62571eaea645380e823914f6d | /prime_n/prime_n.cpp | 563280824a4157620703b6f9cfa9435e210b26b2 | [] | no_license | aleslu-0/ConsoleApplication2 | 4cfd5ddb6c31eb3526289361358e029cddb8248d | c6a857fd1374957844fc1535b9d0d74c9c4b165f | refs/heads/master | 2023-01-09T15:11:53.856133 | 2020-11-14T17:04:25 | 2020-11-14T17:04:25 | 310,741,016 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 442 | cpp | prime_n.cpp | #include <iostream>
using namespace std;
bool isPrime(int n) {
if (n <= 1)
return false;
//Return false if not prime
for (int i = 2; i < n; i++)
if (n % i == 0)
return false;
return true;
}
int main()
{
cout << "Test if integer is a prime number: \n";
//Input
int x;
cin >> x;
//Function call
bool result = isPrime(x);
cout << boolalpha << result;
return 0;
}
|
7008e9f3056125ce6cc06292d1ea6a587a6f7b8c | 7bcc8146c058a69cb08bbffd13dd5cf00c20b113 | /SODVASG2/monthlyPhoneBill/monthlyPhoneBill.cpp | 883e206308344fea0d8687013cde97bb4d208efa | [] | no_license | TheBudderMan/C-PP_Fundamentals_Progression | 7b9bf381671dc92d561c41457bb7f400e87c7b17 | 37b7bc7211f6410e24cf571016821a184bc15ed2 | refs/heads/main | 2023-03-07T19:59:07.806811 | 2021-02-18T07:11:20 | 2021-02-18T07:11:20 | 339,958,490 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,974 | cpp | monthlyPhoneBill.cpp | // monthlyPhoneBill.cpp : This file contains the 'main' function. Program execution begins and ends there.
#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <regex>
#include <sstream>
using namespace std;
/*
the two functions additive charge and chooseBill are the main drivers for this program.
as per usual inputData collects the inputs to distribute to the rest of the program.
This time there's only one value to collect which is sent to additiveCharge to select
the charge rate. callCount is also sent too chooseBill which selects the max bill increments
and handles multiplication and subtraction needed to get the isolated integers for
100 - 150, and 150 - 200.
*/
void clearScreen() {
int i;
for (i = 0; i < 10; i++)
printf("\n\n\n\n\n\n\n\n\n\n");
}
double additiveCharge(int callCount) {
const double chargeRate1 = 0.40, chargeRate2 = 0.50, chargeRate3 = 0.60, chargeRate4 = 0;
if (callCount >= 200) {
return chargeRate1;
}
else if (callCount >= 150) {
return chargeRate2;
}
else if (callCount >= 100) {
return chargeRate3;
}
else
return chargeRate4;
}
void outputMessage(int callCount) {
const double INITBILL = 200, BILLINCREMENTONE = 230, BILLINCREMENTTWO = 255, FRSTFDY = 100, SCNDFDY = 150, FIDDY = 50;
string message = "";
double firstFiddy = 0;
double conversion = 0;
double conversion2 = 0;
double billOut = 0;
int callOut = 0;
if (callCount > INITBILL) {
//should multiply 0.4
firstFiddy = callCount - INITBILL;
cout << "\n---------------------------------\n";
cout << "You are at the max rate available this month!!";
cout << "\n---------------------------------\n";
}
else if (callCount > SCNDFDY && callCount < INITBILL) {
//should multiply 0.5
firstFiddy = callCount - SCNDFDY;
cout << "\n---------------------------------\n";
cout << "You have: " << (INITBILL - callCount) << " calls left before \nyour rate changes this month.";
cout << "\n---------------------------------\n";
}
else if (callCount > FRSTFDY && callCount < SCNDFDY) {
callOut = firstFiddy = callCount - FRSTFDY;
cout << "\n---------------------------------\n";
cout << "You have: " << (SCNDFDY - callCount) << " calls left before \nyour rate changes this month.";
cout << "\n---------------------------------\n";
}
else if (callCount < FRSTFDY) {
//outputs initialized bill of 200
cout << "\n---------------------------------\n";
cout << "You have: " << (FRSTFDY - callCount) << " calls left before \nyour rate changes this month.";
cout << "\n---------------------------------\n";
}
}
double chooseBill(int callCount) {
const double INITBILL = 200, BILLINCREMENTONE = 230, BILLINCREMENTTWO = 255, FRSTFDY = 100, SCNDFDY = 150, FIDDY = 50;
string message = "";
double firstFiddy = 0;
double conversion = 0;
double conversion2 = 0;
double billOut = 0;
int callOut = 0;
if (callCount > INITBILL) {
//should multiply 0.4
firstFiddy = callCount - INITBILL;
conversion = firstFiddy * additiveCharge(callCount);
return billOut = BILLINCREMENTTWO + conversion;
}
else if (callCount > SCNDFDY && callCount < INITBILL) {
//should multiply 0.5
firstFiddy = callCount - SCNDFDY;
conversion = firstFiddy * additiveCharge(callCount);
return billOut = BILLINCREMENTONE + conversion;
}
else if (callCount > FRSTFDY && callCount < SCNDFDY) {
//should multiply 0.6
callOut = firstFiddy = callCount - FRSTFDY;
conversion = firstFiddy * additiveCharge(callCount);
return billOut = INITBILL + conversion;
}
else if (callCount < FRSTFDY) {
//outputs initialized bill of 200
return billOut = INITBILL;
}
return 0;
}
void stringMeSilly(int callCount) {
//Values added together for output
clearScreen();
cout << "\n\nYour bill below!\n\n";
cout << " \\****************************//\n";
cout << " \\**************************//\n";
cout << " //**************************\\ \n";
cout << " //****************************\\ \n";
cout << "---------------------------------\n";
cout << "Amount of calls: " << callCount;
cout << "\nAdditional rate charged:$" << additiveCharge(callCount);
outputMessage(callCount);
cout << "Bill Total:$" << chooseBill(callCount) << "\n";
cout << "---------------------------------\n";
cout << " \\****************************//\n";
cout << " \\**************************//\n";
cout << " //**************************\\ \n";
cout << " //****************************\\ \n";
}
string q2b(char a, int b, bool c) {
string ret = "The ";
if (b % 3 > 0){
ret += "quick ";
}
else {
ret += "slow ";
}
c = (!c || c) && (a >= 'A' && a <= 'Z');
if (c){
ret += "brown ";
}
else {
ret += "blue ";
}
switch (b) {
case 4:
ret += "fox.";
break;
case 5:
ret += "penguin.";
break;
case 6:
ret += "bear.";
break;
default:
ret += "cat.";
break;
}
return ret;
}
void inputData(int callCount) {
//Function for receiving data from user or file
cout << "Welcome to the monthly phone bill writer!\n\n";
/*Inputs collected here */
cout << "We are going to collect the inputs now. \n";
cout << "Please input the amount of calls for the month. \n\n";
cin >> callCount;
stringMeSilly(callCount);
//Values passed to the processData function
}//**********************************************
//---Run Program function ----------------------
void runSpecialProgram() {
//Created to cleanup the main function
int callCount = 0;
inputData(callCount);
}//**********************************************
void loopMe() {
/*Loop that runs the program until you choose no.*/
bool woah = true;
string ans = "";
while (woah) {
cout << "Would you like to run the monthly phone bill writer today?(Y for yes, N for no.) \n";
cin >> ans;
char an = ans[0];
if (an == 'Y' || an == 'y') {
runSpecialProgram();
}
else {
cout << "\nAlright, bye! \n";
woah = false;
}
}
}
int main() {
//loopMe();
cout << q2b('R',5,false);
return 0;
}
|
019f7c1784b60076e0766690ab9122f9b6b2ce6a | 7be8e3636bf08ebdc6662879dc5afec548705537 | /ios/Pods/Flipper-RSocket/rsocket/tck-test/TestSuite.h | f705e0d1356b8c8c720b5a9be79dc732cd99e7fd | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0",
"MIT"
] | permissive | rdhox/react-native-smooth-picker | 3c7384f1fed0e37f076361cce96071d01b70e209 | ae9316c49512f7ed9824c5a3ad50cdf5e80fffa9 | refs/heads/master | 2023-01-08T16:59:40.709147 | 2021-07-03T14:13:21 | 2021-07-03T14:13:21 | 160,224,312 | 230 | 31 | MIT | 2023-01-06T01:46:04 | 2018-12-03T16:54:10 | TypeScript | UTF-8 | C++ | false | false | 1,910 | h | TestSuite.h | // Copyright (c) Facebook, Inc. and its affiliates.
//
// 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.
#pragma once
#include <string>
#include <vector>
namespace rsocket {
namespace tck {
class TestCommand {
public:
explicit TestCommand(std::vector<std::string> params)
: params_(std::move(params)) {}
const std::string& name() const {
return params_[1];
}
template <typename T>
T as() const {
return T(*this);
}
const std::vector<std::string>& params() const {
return params_;
}
bool valid() const;
private:
std::vector<std::string> params_;
};
class Test {
public:
const std::string& name() const {
return name_;
}
void setName(const std::string& name) {
name_ = name;
}
bool resumption() const {
return resumption_;
}
void setResumption(bool resumption) {
resumption_ = resumption;
}
void addCommand(TestCommand command);
const std::vector<TestCommand>& commands() const {
return commands_;
}
bool empty() const {
return commands_.empty();
}
private:
std::string name_;
bool resumption_{false};
std::vector<TestCommand> commands_;
};
class TestSuite {
public:
void addTest(Test test) {
tests_.push_back(std::move(test));
}
const std::vector<Test>& tests() const {
return tests_;
}
private:
std::vector<Test> tests_;
};
} // namespace tck
} // namespace rsocket
|
3250dd2580bc4cb299dd522f86603ba58061875a | 01ee1fc4fc08623b6176d21710b37942b7a9db4c | /DigitalClockItem.h | 0400cd37ab6eb876b29d40c8eb11b37a38c214a8 | [] | no_license | XOOIOOX/ClockGadget | 85a677b520ec660a8cb092ca76d23117db0e2c44 | eb7c05524301e38873df323c4b22b3cd59548249 | refs/heads/master | 2023-02-28T05:42:24.626237 | 2021-01-30T02:09:38 | 2021-01-30T02:09:38 | 259,689,605 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 355 | h | DigitalClockItem.h | #pragma once
#include "ClockItem.h"
class DigitalClockItem : public ClockItem
{
public:
DigitalClockItem(QObject* parent = nullptr);
~DigitalClockItem();
void advance(int phase) override;
void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = nullptr) override;
private:
int fontSize = 32;
QString clockText;
};
|
df9949945908b1e34b07e4ef9e83572fb0b36897 | e2fe051db2887441101fd164a3fe5a29fae0b86f | /src/MainHeader.h | 93322e39efddcf532057b20b182348fc04d3f7a9 | [] | no_license | dannysheyn/backtracking-maze | 06e9b9ae73bf16b0cad089547af0f56d473a32b3 | 4d5f31c47d995770fb2b854be5c3ced667d6e13f | refs/heads/main | 2023-04-13T07:44:09.188531 | 2021-04-26T05:18:12 | 2021-04-26T05:18:12 | 361,623,792 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 203 | h | MainHeader.h | #ifndef __MAINHEADER_H
#define __MAINHEADER_H
#include <iostream>
#pragma warning(disable: 4996)
using namespace std;
void AllocationTest(void* ptr);
int getRand();
#endif // !__MAINHEADER_H
|
da4d7906351fd61a43d188b856d122fe042d275b | 19668b1c9f0e6669ba1d59a8158b495792f8687d | /Bolt-Core/src/Graphics/Assets/Meshes/Materials/MaterialGraph/MaterialGraph.cpp | d73f29266fdfa3077b2f351e18052ca10894a0e8 | [] | no_license | Totomosic/Bolt | a80f50ce2da4cc7dabe92023df9448eb7b57f026 | 3ca257f9f33ef0d04b213365ef42d9a4925b29ef | refs/heads/master | 2021-06-28T19:06:30.656098 | 2020-09-09T13:26:23 | 2020-09-09T13:26:23 | 144,455,421 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,983 | cpp | MaterialGraph.cpp | #include "bltpch.h"
#include "MaterialGraph.h"
#include "../Material.h"
#include "Graphics/Assets/AssetManager.h"
namespace Bolt
{
MaterialGraph::MaterialGraph(AssetManager* manager)
: m_Resources(manager), m_MasterNodes(), m_Nodes(), m_Builder(), m_IsBuilt(false)
{
}
AssetManager& MaterialGraph::GetAssetManager() const
{
if (m_Resources == nullptr)
{
return AssetManager::Get();
}
return *m_Resources;
}
const std::unordered_map<std::string, std::unique_ptr<MasterNode>>& MaterialGraph::GetMasterNodes() const
{
return m_MasterNodes;
}
const std::vector<std::unique_ptr<MaterialNode>>& MaterialGraph::GetNodes() const
{
return m_Nodes;
}
const MaterialGraphBuilder& MaterialGraph::GetBuilder() const
{
return m_Builder;
}
MaterialGraphBuilder& MaterialGraph::GetBuilder()
{
return m_Builder;
}
const MaterialGraphContext& MaterialGraph::GetContext() const
{
return GetBuilder().GetContext();
}
MaterialNode& MaterialGraph::AddNode(std::unique_ptr<MaterialNode>&& node)
{
MaterialNode* ptr = node.get();
ptr->ConnectDefaults(*this, m_Builder.GetContext());
m_Nodes.push_back(std::move(node));
m_IsBuilt = false;
return *ptr;
}
void MaterialGraph::Build(bool isTransparent)
{
m_Builder.Reset();
m_Builder.GetBuilder().SetIsTransparent(isTransparent);
m_IsBuilt = true;
std::unordered_map<std::string, ShaderValuePtr> masterNodeResults;
for (const auto& pair : m_MasterNodes)
{
masterNodeResults[pair.first] = m_Builder.BuildNode(*pair.second);
}
FinaliseBuild(masterNodeResults);
}
MasterNode& MaterialGraph::AddMasterNode(const std::string& name, std::unique_ptr<MasterNode>&& masterNode)
{
BLT_ASSERT(m_MasterNodes.find(name) == m_MasterNodes.end(), "Master node with name {0} already exists", name);
MasterNode* ptr = masterNode.get();
ptr->ConnectDefaults(*this, m_Builder.GetContext());
m_MasterNodes[name] = std::move(masterNode);
m_IsBuilt = false;
return *ptr;
}
} |
7e09f177b9fed3f64c3dc0373624427763ae635f | 78ba4338ae6fa4eb91441cbb5c78c6a826d31c9c | /Main/UserSession.h | 352340954e9927bd9a4cfee74b9bc705f8497d07 | [] | no_license | inevs/TripService_CPP | c4d54d136b49cffff1f51afb9c84088cde87cf9a | 8e1e4b11ad56452d450636e6a8786f40cf74626c | refs/heads/master | 2020-06-17T21:51:47.280728 | 2016-11-28T11:29:15 | 2016-11-28T11:31:39 | 74,966,964 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 718 | h | UserSession.h | #ifndef TRIPSERVICE_USERSESSION_H
#define TRIPSERVICE_USERSESSION_H
#include "TripServiceSupport.h"
class UserSession;
UserSession *oneUserSession = 0;
class UserSession {
public:
inline static UserSession *GetInstance() {
if (!oneUserSession) { oneUserSession = new UserSession(); }
return oneUserSession;
}
protected:
UserSession() {}
private:
UserSession(const UserSession &);
public:
inline User *GetLoggedUser() {
throw "UserSession.GetLoggedUser() should not be called in an unit test";
}
inline bool IsUserLoggedIn() {
throw "UserSession.IsUserLoggedIn() should not be called in an unit test";
}
};
#endif //TRIPSERVICE_USERSESSION_H
|
db53a60bf69ce3984bde93287fbc203789c45965 | b1cea8ff64c514f4db6a4bf6a3d23a7a23e7bf21 | /tictactoe/src/Board.cpp | 33f1713057173ea602c17508b4f47e188f702760 | [] | no_license | yperess/practice_cpp | 78576319f07c31085d290b5165bd9d1df395903e | be62d0e23a21fa4400f5ccd30e62b290fc50ed4b | refs/heads/master | 2021-01-01T03:38:58.269123 | 2016-04-25T21:23:50 | 2016-04-25T21:23:50 | 56,941,175 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 209 | cpp | Board.cpp | /*
* Board.cpp
*
* Created on: Apr 25, 2016
* Author: peress
*/
#include "Board.h"
namespace tictactoe {
Board::Board() {
// TODO Auto-generated constructor stub
}
} /* namespace tictactoe */
|
1ebf3673a06d898a6d640ab5c5bc54d82757de8d | d4e433e6c595484811be47cf4a4ac4ec7fa3134f | /B1_28/Source.cpp | 59f01e89540b921222af267dfb492e7b113536d3 | [] | no_license | yjglab/cpp_programming_study | 27ea90309677b02354a68c1e65cb8dbeedc789c1 | 058fad00c96e1805a9f341376d2e5a54a7df6b2f | refs/heads/master | 2023-03-15T09:20:31.020044 | 2021-03-06T17:57:42 | 2021-03-06T17:57:42 | 333,762,605 | 2 | 0 | null | null | null | null | UHC | C++ | false | false | 1,207 | cpp | Source.cpp | #include <iostream>
using namespace std;
// *** 소멸자 Destructor ***
/*
소멸자는 인스턴스가 메모리에서 해제될 때 내부에서 자동으로 호출됨.
동적 할당으로 만들어진 경우에는 영역을 벗어나도 자동으로 메모리가 해제되지
않기 때문에 delete으로 메모리를 해제할때에만 소멸자가 호출됨
소멸자를 프로그래머가 직접 호출하는 것은 대부분의 경우 권장하지 않음
*/
class Simple {
private:
int _id;
public:
Simple(const int& id_in)
: _id(id_in)
{
cout << "Constructor " << _id << endl;
}
~Simple() // 소멸자 | parameter 없음
{
cout << "Destructor " << _id << endl;
}
};
class IntArr {
private:
int* _arr = nullptr;
int _length = 0;
public:
IntArr(const int length_in)
{
_length = length_in;
_arr = new int[_length];
}
int getLength() {
return _length;
}
~IntArr()
{
if (_arr != nullptr) {
delete[] _arr; // 메모리 leak이 일어나는 현상을 해결
}
}
};
int main2() {
Simple sp1(0);
Simple sp2(1);
Simple* sp3 = new Simple(5);
delete sp3;
cout << endl;
// 소멸자 사용 예시
/*while (1) {
IntArr myIntArr(10000);
}*/
return 0;
} |
44f6efe4a949bbcfe2d84b584fe175bb5736c2cb | 026b1dbe7d85ccf92e95f054185d9d4168b7cdb6 | /day01/ex00/Pony.hpp | a45c0d8b9af3ab9a205c11320af587dd30dd486d | [] | no_license | anvv5/studingCPP | 5e8462dcaf62f6d7f6ae75744b0b63888473fc54 | 2a11ae9bc77b9a88479ef07ee7582cb805246f07 | refs/heads/master | 2023-05-14T17:25:49.918495 | 2021-05-29T11:10:57 | 2021-05-29T11:10:57 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 312 | hpp | Pony.hpp | //
// Created by Shantay Budding on 4/13/21.
//
#ifndef EX00_PONY_HPP
#define EX00_PONY_HPP
#include <iostream>
#include <string>
class Pony
{
std::string _name;
public:
Pony( std::string name );
~Pony( void );
void eat( void );
void sleep( void );
void think( void );
};
#endif //EX00_PONY_HPP
|
3040dbb7a467873d850617a6fc43d0e68a2d101e | e07c5fa6fe97239293573d1729a8d3d5a3628372 | /Bio_Informatics-task2/main.cpp | 3274e22f58fda7b93575a21fea8b8f080d1426b2 | [] | no_license | srutak/srutak.github.io | 041cee72b27e549a4f6912fa0fec67e4fe24cfe7 | 7b7b2df89b38ee4c1a6992041aca04bf0b82a3fb | refs/heads/master | 2020-05-21T04:51:54.856812 | 2017-02-10T20:28:38 | 2017-02-10T20:28:38 | 49,970,239 | 0 | 0 | null | 2016-05-24T14:57:07 | 2016-01-19T17:32:58 | C++ | UTF-8 | C++ | false | false | 20,990 | cpp | main.cpp | #include <iostream>
#include<fstream>
#include<sstream>
#include <vector>
#include<stdlib.h>
#include<iomanip>
#include<string>
#include<cmath>
using namespace std;
struct atompdb
{
string atomName;
int num;
string calpha;
string residueName;
string chainid;
int atomdataerialNumber;
double xCoordinate;
double yCoordinate;
double zCoordinate;
string sym;
};
struct sheetpdb
{
string shetname;
string residueName;
int sheetid;
string chainid1;
string terres;
string chainid2;
int terseqid;
};
struct seqNumR
{
int start;
int end;
};
std::vector<sheetpdb> sheetdata;
std::vector<atompdb> atomdata;
std::vector<string> data;
std::vector<atompdb> atomdiff;
std::vector<atompdb> CAdiff;
std::vector<seqNumR> range;
std::vector<seqNumR> CAlpharan;
void rotation()
{
double x1 = (atomdata[0].xCoordinate);
double y1 = (atomdata[0].yCoordinate);
double z1 = (atomdata[0].zCoordinate);
double x2 = (atomdata[1].xCoordinate);
double y2 = (atomdata[1].yCoordinate);
double z2 = (atomdata[1].zCoordinate);
double r = sqrt((pow((x2-x1),2)) + (pow((y2-y1),2)) + (pow((z2-z1),2)));
double theta = atan((y2-y1)/(x2-x1));
double si = acos((z2-z1)/r);
for(int i=3;i<atomdata.size();i=i+2){
atompdb aData1;
double x3 = (atomdata[i-1].xCoordinate);
double y3 = (atomdata[i-1].yCoordinate);
double z3 = (atomdata[i-1].zCoordinate);
aData1.atomName=atomdata[i].atomName;
aData1.atomdataerialNumber=atomdata[i].atomdataerialNumber;
double x4 = (atomdata[i].xCoordinate);
double y4 = (atomdata[i].yCoordinate);
double z4 = (atomdata[i].zCoordinate);
double R = sqrt((pow((x4-x3),2)) + (pow((y4-y3),2)) + (pow((z4-z3),2)));
double x5 = R * cos(theta) * sin(si);
double y5 = R * sin(theta) * sin(si);
double z5 = R * cos(si);
x5 += x1;
y5 += y1;
z5 += z1;
atomdata[i].xCoordinate = x5;
atomdata[i].yCoordinate = y5;
atomdata[i].zCoordinate = z5;
aData1.xCoordinate=x5-x4;
aData1.yCoordinate=y5-y4;
aData1.zCoordinate=z5-z4;
CAdiff.push_back(aData1);
}
}
void CAlphadata()
{
ifstream inFile;
ofstream outFile;
string line;
inFile.open("difference.pdb");
outFile.open("CAlpha.pdb");
int i=0;
while(!inFile.eof()&&getline(inFile,line))
{
if(line.substr(0,1)=="-" || line.substr(0,1)=="#")
{
}
else
{
string sheetid=line.substr(22,4);
string cAlpha=line.substr(12,4);
string xCoordinate=line.substr(30,8);
string yCoordinate=line.substr(38,8);
string zCoordinate=line.substr(46,8);
string chainIdentifier=line.substr(21,1);
int num=stoi(sheetid.c_str());
if(num>=CAlpharan[i+1].start && num<=CAlpharan[i+1].end )
{
string x1=to_string(CAdiff[i].xCoordinate);
string dec=x1.substr(x1.find(".")+1);
if(dec.length()>3)
for(int i=3;i<dec.length();i++)
x1.erase(x1.size()-1);
double x=stod(x1)+stod(xCoordinate);
string y1=to_string(CAdiff[i].yCoordinate);
dec=y1.substr(y1.find(".")+1);
if(dec.length()>3)
for(int i=3;i<dec.length();i++)
y1.erase(y1.size()-1);
double y=stod(y1)+stod(yCoordinate);
string z1=to_string(CAdiff[i].zCoordinate);
dec=z1.substr(z1.find(".")+1);
if(dec.length()>3)
for(int i=3;i<dec.length();i++)
z1.erase(z1.size()-1);
double z=stod(z1)+stod(zCoordinate);
string str = to_string (x);
str.erase ( str.find_last_not_of('0') + 1, std::string::npos );
dec=str.substr(str.find(".")+1);
for(int i=dec.length();i<3;i++)
str=str+"0";
for(int i=0;i<=(xCoordinate.length()-str.length()+1);i++)
str=" "+str;
if( str.length()>8)
str.erase(0,1);
string str1 = to_string (y);
str1.erase ( str1.find_last_not_of('0') + 1, std::string::npos );
dec=str1.substr(str1.find(".")+1);
for(int i=dec.length();i<3;i++)
str1=str1+"0";
for(int i=0;i<=(yCoordinate.length()-str1.length()+1);i++)
str1=" "+str1;
if( str1.length()>8)
str1.erase(0,1);
string str2 = to_string (z);
str2.erase ( str2.find_last_not_of('0') + 1, std::string::npos );
dec=str2.substr(str2.find(".")+1);
for(int i=dec.length();i<3;i++)
str2=str2+"0";
for(int i=0;i<=(zCoordinate.length()-str2.length()+1);i++)
str2=" "+str2;
if( str2.length()>8)
str2.erase(0,1);
line.replace(line.find(xCoordinate), xCoordinate.length(),str );
line.replace(line.find(yCoordinate), yCoordinate.length(),str1);
line.replace(line.find(zCoordinate), zCoordinate.length(),str2);
if(num==(CAlpharan[i+1].end))
{
i++;
}
}
}
outFile<<line<<endl;
}
}
void rplcatomdata()
{
ifstream inFile;
ofstream outFile;
string line;
inFile.open("Aligneddata.pdb");
outFile.open("difference.pdb");
int i=0;
while(!inFile.eof()&&getline(inFile,line))
{
if(line.substr(0,1)=="-" || line.substr(0,1)=="#")
{
}
else
{
string sheetid=line.substr(22,4);
string cAlpha=line.substr(12,4);
string xCoordinate=line.substr(30,8);
string yCoordinate=line.substr(38,8);
string zCoordinate=line.substr(46,8);
string chainIdentifier=line.substr(21,1);
int num=stoi(sheetid.c_str());
if(num>=range[i+1].start && num<=range[i+1].end )
{
double x=atomdiff[i].xCoordinate+stod(xCoordinate);
double y=atomdiff[i].yCoordinate+stod(yCoordinate);
double z=atomdiff[i].zCoordinate+stod(zCoordinate);
string str = to_string (x);
str.erase ( str.find_last_not_of('0') + 1, std::string::npos );
string dec=str.substr(str.find(".")+1);
for(int i=dec.length();i<3;i++)
str=str+"0";
for(int i=0;i<=(xCoordinate.length()-str.length()+1);i++)
str=" "+str;
if( str.length()>8)
str.erase(0,1);
string str1 = to_string (y);
str1.erase ( str1.find_last_not_of('0') + 1, std::string::npos );
dec=str1.substr(str1.find(".")+1);
for(int i=dec.length();i<3;i++)
str1=str1+"0";
for(int i=0;i<=(yCoordinate.length()-str1.length()+1);i++)
str1=" "+str1;
if( str1.length()>8)
str1.erase(0,1);
string str2 = to_string (z);
str2.erase ( str2.find_last_not_of('0') + 1, std::string::npos );
dec=str2.substr(str2.find(".")+1);
for(int i=dec.length();i<3;i++)
str2=str2+"0";
for(int i=0;i<=(zCoordinate.length()-str2.length()+1);i++)
str2=" "+str2;
if( str2.length()>8)
str2.erase(0,1);
line.replace(line.find(xCoordinate), xCoordinate.length(),str );
line.replace(line.find(yCoordinate), yCoordinate.length(),str1);
line.replace(line.find(zCoordinate), zCoordinate.length(),str2);
if(num==(range[i+1].end-1))
{
i++;
}
}
}
outFile<<line<<endl;
}
}
void replaceCoordinates()
{
ifstream inFile;
ofstream outFile;
string line;
inFile.open("CAlpha.pdb");
outFile.open("Final_atomdata.pdb");
while(!inFile.eof() && getline(inFile,line))
{
if(line.substr(0,5)=="-ATOM")
{
string sheetid=line.substr(23,4);
string cAlpha=line.substr(13,4);
string xCoordinate=line.substr(31,8);
string yCoordinate=line.substr(39,8);
string zCoordinate=line.substr(47,8);
string chainIdentifier=line.substr(22,1);
string markerAtom="-ATOM";
string atomdatatring="ATOM";
line.replace(line.find(markerAtom), markerAtom.length(),atomdatatring);
for(int i=2;i<atomdata.size();i=i+2 )
{
if(atomdata[i].atomdataerialNumber==atoi(sheetid.c_str()) && cAlpha==" CA ")
{
string str = to_string (atomdata[0].xCoordinate);
str.erase ( str.find_last_not_of('0') + 1, std::string::npos );
string dec=str.substr(str.find(".")+1);
for(int i=dec.length();i<3;i++)
str=str+"0";
for(int i=0;i<=(xCoordinate.length()-str.length()+1);i++)
str=" "+str;
if( str.length()>8)
str.erase(0,1);
string str1 = to_string (atomdata[0].yCoordinate);
str1.erase ( str1.find_last_not_of('0') + 1, std::string::npos );
dec=str1.substr(str1.find(".")+1);
for(int i=dec.length();i<3;i++)
str1=str1+"0";
for(int i=0;i<=(yCoordinate.length()-str1.length()+1);i++)
str1=" "+str1;
if( str1.length()>8)
str1.erase(0,1);
string str2 = to_string (atomdata[0].zCoordinate);
str2.erase ( str2.find_last_not_of('0') + 1, std::string::npos );
dec=str2.substr(str2.find(".")+1);
for(int i=dec.length();i<3;i++)
str2=str2+"0";
for(int i=0;i<=(zCoordinate.length()-str2.length()+1);i++)
str2=" "+str2;
if( str2.length()>8)
str2.erase(0,1);
line.replace(line.find(xCoordinate), xCoordinate.length(),str );
line.replace(line.find(yCoordinate), yCoordinate.length(),str1);
line.replace(line.find(zCoordinate), zCoordinate.length(),str2);
break;
}
}
}
if(line.substr(0,5)=="#ATOM")
{
string sheetid=line.substr(23,4);
string cAlpha=line.substr(13,4);
string xCoordinate=line.substr(31,8);
string yCoordinate=line.substr(39,8);
string zCoordinate=line.substr(47,8);
string chainIdentifier=line.substr(22,1);
string markerAtom="#ATOM";
string atomdatatring="ATOM";
line.replace(line.find(markerAtom), markerAtom.length(),atomdatatring);
for(int i=3;i<atomdata.size();i=i+2 )
{
if(atomdata[i].atomdataerialNumber==atoi(sheetid.c_str()) && cAlpha==" CA ")
{
string str = to_string (atomdata[i].xCoordinate);
str.erase ( str.find_last_not_of('0') + 1, std::string::npos );
string dec=str.substr(str.find(".")+1);
for(int i=dec.length();i<3;i++)
str=str+"0";
str = (str.substr(0,str.find(".")) + str.substr(str.find("."),4));
for(int i=0;i<=(xCoordinate.length()-str.length()+1);i++)
str=" "+str;
if( str.length()>8)
str.erase(0,1);
string str1 = to_string (atomdata[i].yCoordinate);
str1.erase ( str1.find_last_not_of('0') + 1, std::string::npos );
dec=str1.substr(str1.find(".")+1);
for(int i=dec.length();i<3;i++)
str1=str1+"0";
str1 = (str1.substr(0,str1.find(".")) + str1.substr(str1.find("."),4));
for(int i=0;i<=(yCoordinate.length()-str1.length()+1);i++)
str1=" "+str1;
if( str1.length()>8)
str1.erase(0,1);
string str2 = to_string (atomdata[i].zCoordinate);
str2.erase ( str2.find_last_not_of('0') + 1, std::string::npos );
dec=str2.substr(str2.find(".")+1);
for(int i=dec.length();i<3;i++)
str2=str2+"0";
str2 = (str2.substr(0,str2.find(".")) + str2.substr(str2.find("."),4));
for(int i=0;i<=(zCoordinate.length()-str2.length()+1);i++)
str2=" "+str2;
if( str2.length()>8)
str2.erase(0,1);
line.replace(line.find(xCoordinate), xCoordinate.length(),str );
line.replace(line.find(yCoordinate), yCoordinate.length(),str1);
line.replace(line.find(zCoordinate), zCoordinate.length(),str2);
break;
}
}
}
outFile<<line<<endl;
}
}
void difatm()
{
atompdb aData1;
for(int i=2;i<atomdata.size();i=i+2)
{
aData1.atomName=atomdata[i].atomName;
aData1.atomdataerialNumber=atomdata[i].atomdataerialNumber;
aData1.xCoordinate=atomdata[0].xCoordinate-atomdata[i].xCoordinate;
aData1.yCoordinate=atomdata[0].yCoordinate-atomdata[i].yCoordinate;
aData1.zCoordinate=atomdata[0].zCoordinate-atomdata[i].zCoordinate;
atomdata[i].xCoordinate=atomdata[i].xCoordinate+ aData1.xCoordinate;
atomdata[i].yCoordinate=atomdata[i].yCoordinate+ aData1.yCoordinate;
atomdata[i].zCoordinate=atomdata[i].zCoordinate+ aData1.zCoordinate;
atomdata[i+1].xCoordinate=atomdata[i+1].xCoordinate+ aData1.xCoordinate;
atomdata[i+1].yCoordinate=atomdata[i+1].yCoordinate+ aData1.yCoordinate;
atomdata[i+1].zCoordinate=atomdata[i+1].zCoordinate+ aData1.zCoordinate;
cout<<endl;
atomdiff.push_back(aData1);
}
}
void Avect(int aStart,int aEnd)
{
ifstream inFile;
string temp,marker,word,word1,s;
int num;
inFile.open("Aligneddata.pdb");
while(!inFile.eof())
{
atompdb aData1;
atompdb aData2;
getline(inFile,s);
marker=s.substr(0,1);
if(marker=="-" || marker=="#")
{
temp=s.substr(23,4);
marker=s.substr(0,1);
num=atoi(temp.c_str());
if(num==aStart && marker=="-" )
{
word=s.substr(1,4);
aData1.atomName=word;
word=s.substr(23,4);
aData1.atomdataerialNumber=atoi(word.c_str());
word=s.substr(31,8);
aData1.xCoordinate=stod(word.c_str());
word=s.substr(39,8);
aData1.yCoordinate=stod(word.c_str());
word=s.substr(47,8);
aData1.zCoordinate=stod(word.c_str());
}
if(num==aEnd&& marker=="#" )
{
word=s.substr(1,4);
aData2.atomName=word;
word=s.substr(23,4);
aData2.atomdataerialNumber=atoi(word.c_str());
word=s.substr(31,8);
aData2.xCoordinate=stod(word.c_str());
word=s.substr(39,8);
aData2.yCoordinate=stod(word.c_str());
word=s.substr(47,8);
aData2.zCoordinate=stod(word.c_str());
atomdata.push_back(aData1);
atomdata.push_back(aData2);
}
}
}
}
void Outputdata()
{
ofstream outFile;
outFile.open("Aligneddata.pdb");
int counter=0;
for(int i=0;i<sheetdata.size();i++)
{
for(int j=0;j<atomdata.size();j++)
{
int index=j;
if((sheetdata[i].sheetid==atomdata[j].atomdataerialNumber ) )
{
for(int k=sheetdata[i].sheetid;k<=sheetdata[i].terseqid;k++)
{
int atomDifference= sheetdata[i].terseqid-sheetdata[i].sheetid;
if(atomDifference>=2 )
{
if(counter!=0)
{
outFile<<endl;
if(k==sheetdata[i].sheetid)
outFile<<"#";
if(k==sheetdata[i].sheetid+2)
outFile<<"-";
}
outFile<<data[index];
index++;
counter++;
}
}
}
}
int aStart=sheetdata[i].sheetid;
int aEnd=sheetdata[i].sheetid+2;
Avect(aStart,aEnd);
}
}
void Dataout(string s, ofstream & outfile)
{
string word;
sheetpdb sData;
atompdb aData;
int value;
word=s.substr(0,5);
string temp="";
if(word=="SHEET")
{
temp=s.substr(21,1);
}
if(word=="SHEET")
{
outfile<<endl;
sData.shetname=word;
outfile<<word<<" ";
word=s.substr(17,3);
outfile<<word<<" ";
sData.residueName=word;
word=s.substr(21,1);
outfile<<word<<" ";
sData.chainid1=word;
word=s.substr(22,4);
outfile<<word<<" ";
sData.sheetid=atoi(word.c_str());
word=s.substr(28,3);
outfile<<word<<" ";
sData.terres=word;
word=s.substr(32,1);
outfile<<word<<" ";
sData.chainid2=word;
word=s.substr(33,4);
outfile<<word<<" ";
sData.terseqid=atoi(word.c_str());
sheetdata.push_back(sData);
}
word=s.substr(0,4);
string word1="";
string word2="";
if(word=="ATOM")
{
word1=s.substr(13,2);
word2=s.substr(21,1);
}
if(word=="ATOM" && word1=="CA"&& word2=="A")
{
outfile<<endl;
aData.atomName=word;
outfile<<word<<" ";
word=s.substr(6,4);
aData.num=atoi(word.c_str());
outfile<<word<<" ";
word=s.substr(13,2);
aData.calpha=word.c_str();
outfile<<word<<" ";
word=s.substr(17,3);
aData.residueName=word.c_str();
outfile<<word<<" ";
word=s.substr(21,1);
aData.chainid=word.c_str();
outfile<<word<<" ";
word=s.substr(22,4);
aData.atomdataerialNumber=atoi(word.c_str());
outfile<<word<<" ";
word=s.substr(30,8);
aData.xCoordinate=stod(word.c_str());
outfile<<word<<" ";
word=s.substr(38,8);
aData.yCoordinate=stod(word.c_str());
outfile<<word<<" ";
word=s.substr(46,8);
aData.zCoordinate=stod(word.c_str());
outfile<<word<<" ";
word=s.substr(76,2);
aData.sym=(word.c_str());
outfile<<word<<" ";
data.push_back(s);
atomdata.push_back(aData);
}
}
int main()
{
string s,filename;
ifstream inFile;
ofstream outFile;
cout<<endl<<"Enter the file name:";
cin>>filename;
inFile.open(filename.c_str());
outFile.open("output.txt");
if(inFile.fail())
{
cout<<endl<<" Cannot open the file please check for the file"<<endl;
exit(0);
}
else
{
while(!inFile.eof())
{
getline(inFile,s);
Dataout(s, outFile);
}
}
Outputdata();
return 0;
}
|
d000e1063fba4beaedc91489e8f9950faf8b4ca0 | 43929e1e68957fbb30dcd1e6b14e9745ac1b636e | /Digger Project/Text.h | 6d1afc7d979d5b975029729082436e4105136b67 | [] | no_license | BoyanDimov20/Projects | 7de0b4c4e5f12d2476271f01be94734cbf359d08 | 4fa63337bf4c42c7e31c1c682fe59f0e5ba2f77d | refs/heads/master | 2020-04-29T04:57:21.673254 | 2019-03-01T21:49:42 | 2019-03-01T21:49:42 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 721 | h | Text.h | #pragma once
#include <SDL_ttf.h>
#include <SDL.h>
#include <string>
class Text
{
private:
size_t score = 0;
std::string text;
SDL_Color color;
TTF_Font * font = nullptr;
SDL_Texture* text_texture = nullptr;
SDL_Rect text_rect;
public:
Text(const std::string& font_path, int font_size, const std::string& message_text, const SDL_Color& color, SDL_Renderer* renderer);
~Text();
size_t get_score()const { return score; }
void add_to_Score(size_t points) { score += points; }
void reset_score() { score = 0; }
void display(int x, int y, SDL_Renderer* renderer);
static SDL_Texture* loadFont(TTF_Font * font_path, int font_size, const std::string& message_text, const SDL_Color& color, SDL_Renderer*);
};
|
aa7d664eb2d3a22404eb0b75d736c69d5e0ef3c0 | d61428bf9e781221bf6a5bfe2dfa24f28cebce1d | /FloatModulo.cpp | da7ba131bd0da2a08e81ff7e44cde177b4e51d6e | [] | no_license | KuldeepSoni17/Algorithms | 442e344b99293b88d57b491d868fb140251115d7 | 0566f0c15805505407a62a23b6e5e6ec8f10a232 | refs/heads/master | 2021-01-11T11:32:03.722640 | 2016-12-20T05:07:27 | 2016-12-20T05:07:27 | 76,924,413 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 113 | cpp | FloatModulo.cpp | #include<iostream>
using namespace std;
int main()
{
float q = 12.1213;
q = (int)q%10;
cout << q;
}
|
0beacf8b41df96580144bdc65865c6c352a0a0be | 19933a074da4e7ffb1761feaf0c8a1a338dab647 | /experiment/experimentmain.cc | 95bd3b673655f4a67765a63964306e5a9682b167 | [] | no_license | somaproject/recorder | a0393e0870a478a74dc454579007b18229d1d8d3 | 05810cb9ed37d8aaab10ddd09f9bb4305b2731dd | refs/heads/master | 2021-01-22T19:44:59.719101 | 2009-06-15T20:55:58 | 2009-06-15T20:55:58 | 100,265 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,981 | cc | experimentmain.cc | #include <boost/program_options.hpp>
#include "boost/filesystem/operations.hpp"
#include "boost/filesystem/fstream.hpp"
#include <iostream>
#include <fstream>
#include <gtkmm.h>
#include <glibmm.h>
#include <unistd.h>
#include <dbus-c++/dbus.h>
#include <dbus-c++/glib-integration.h>
#include <somanetwork/network.h>
#include "dbusexperiment.h"
#include "dbusrecorderproxy.h"
#include "dbusrecordermanager.h"
#include "logging.h"
using namespace soma;
using namespace boost;
namespace bf = boost::filesystem;
using namespace std;
namespace po = boost::program_options;
std::string LOGROOT("soma.recordering.experiment");
int main(int argc, char * argv[])
{
// Declare the supported options.
po::options_description desc("Allowed options");
desc.add_options()
("help", "produce help message")
("create-file", po::value<string>(), "name of experiment file to create")
("open-file", po::value<string>(), "name of experiment file to open")
("dbus", po::value<string>(), "DBUS bus address to connect to")
("soma-ip", po::value<string>(), "The IP of the soma hardware")
("request-dbus-name", po::value<string>(), "Request the target dbus name for debugging")
("no-register", "register with primary recorder (soma.Recorder) on DBus")
("domain-socket-dir", po::value<string>(), "Domain socket directory to use for testing; overrides soma IP")
;
po::variables_map vm;
desc.add(logging_desc());
po::store(po::parse_command_line(argc, argv, desc), vm);
po::notify(vm);
int loglevel = config_logging(vm, LOGROOT);
if (vm.count("help")) {
cout << desc << "\n";
return 1;
}
log4cpp::Category& logrecorder = log4cpp::Category::getInstance(LOGROOT);
log4cpp::Category& logdbus = log4cpp::Category::getInstance(LOGROOT + ".dbus");
if (vm.count("create-file") and vm.count("open-file")) {
logrecorder.fatal("Cannot both create and open a file");
return -1;
} else if (not (vm.count("create-file") or vm.count("open-file"))) {
logrecorder.fatal("Must specify either create-file or open-file");
return -1;
}
std::string filename;
bool create = false;
if (vm.count("create-file")) {
filename = vm["create-file"].as<string>();
create = true;
}
if (vm.count("open-file")) {
filename = vm["open-file"].as<string>();
create = false;
}
if (create) {
logrecorder.infoStream() << "create file: " << filename;
} else {
logrecorder.infoStream() << "open file: " << filename;
}
somanetwork::pNetworkInterface_t network;
if (vm.count("soma-ip")) {
std::string somaip = vm["soma-ip"].as<string>();
logrecorder.infoStream() << "Using IP network to talk to soma";
logrecorder.infoStream() << "soma hardware IP: " << somaip;
network = somanetwork::Network::createINet(somaip);
} else if (vm.count("domain-socket-dir")) {
bf::path domainsockdir(vm["domain-socket-dir"].as<string>());
logrecorder.infoStream() << "Using domain sockets to talk to local process";
logrecorder.infoStream() << "domain socket dir: " << domainsockdir;
network = somanetwork::Network::createDomain(domainsockdir);
} else {
logrecorder.fatal("soma-ip not specified, domain-socket-dir not specified; no way to get data");
return -1;
}
// by default, we try and discover and use the link-local soma bus
DBus::Glib::BusDispatcher dispatcher;
dispatcher.set_priority(1000);
Glib::RefPtr<Glib::MainLoop> mainloop;
DBus::default_dispatcher = &dispatcher;
dispatcher.attach(NULL);
if (!vm.count("dbus")) {
logrecorder.fatal("Need to specify dbus bus to connect to");
return -1;
}
//DBus::Connection conn = DBus::Connection::SessionBus();
DBus::Connection conn =
DBus::Connection::Connection(vm["dbus"].as<string>().c_str(), false);
conn.register_bus();
if (vm.count("request-dbus-name")) {
std::string dbusname = vm["request-dbus-name"].as<string>();
conn.request_name(dbusname.c_str());
logdbus.infoStream() << "requesting dbus name" << dbusname;
}
mainloop = Glib::MainLoop::create();
soma::recorder::DBUSExperiment server(conn, mainloop,
filename, network, create);
logdbus.infoStream() << "running with path=" << server.path();
// Must do DBUS stuff AFTER fork so that recorder can respond
soma::recorder::DBusRecorderManager * precorder;
precorder = new soma::recorder::DBusRecorderManager(conn, "/manager",
"soma.recording.Manager");
// now optionally register
if (vm.count("no-register")) {
// do not register
logdbus.warnStream() << "not registering experiment with DBus";
} else {
precorder->Register(filename);
logdbus.infoStream() << "dbus registered with "
<< filename << "," << conn.unique_name();
}
mainloop->run();
if (!vm.count("no-register")) {
precorder->Unregister();
}
}
|
7e51943dc4b0478b5b5dca4eebeda1ff30774c3d | e393fad837587692fa7dba237856120afbfbe7e8 | /prac/first/AGC_010_A-Addition.cpp | 79c23c94c4557b99c926efc3c686dd98da649deb | [] | no_license | XapiMa/procon | 83e36c93dc55f4270673ac459f8c59bacb8c6924 | e679cd5d3c325496490681c9126b8b6b546e0f27 | refs/heads/master | 2020-05-03T20:18:47.783312 | 2019-05-31T12:33:33 | 2019-05-31T12:33:33 | 178,800,254 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 490 | cpp | AGC_010_A-Addition.cpp | #include <iostream>
#include <map>
#include <algorithm>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define REP(i,k,n) for(int i = k; i < (int)(n); i++)
using namespace std;
int main(){
int N,tmp;
int odd=0,even=0;
cin >> N;
rep(i,N){
cin>>tmp;
if(tmp%2==0) even++;
else odd++;
}
string ans = "YES";
if (odd%2 != 0) ans = "NO";
cout << ans << endl;
return 0;
}
|
440cb34dc442ea2c82e00f994fc5933ff728bd21 | 41259b2e45ab46ee6ef4d6668d2329d590436386 | /DM_Analyzer/plugins/scout.cc | de66d85fd1a3ceeb5ce1111e91ee253004528c0a | [] | no_license | SiewYan/DM_analyzer | 8b5075fcd3c6b1ce8f6551c393c1424eff61e758 | 8fc621ab6f4a98f55387c1eed6cd3e2938659852 | refs/heads/master | 2020-04-20T06:28:01.685744 | 2019-01-04T06:53:35 | 2019-01-04T06:53:35 | 168,684,938 | 0 | 0 | null | 2019-02-01T11:01:39 | 2019-02-01T11:01:39 | null | UTF-8 | C++ | false | false | 9,333 | cc | scout.cc | // -*- C++ -*-
//
// Package: EDMAnalyzer/DM_Analyzer
// Class: DM_Analyzer
//
/**\class DM_Analyzer DM_Analyzer.cc EDMAnalyzer/DM_Analyzer/plugins/DM_Analyzer.cc
Description: [one line class summary]
Implementation:
[Notes on implementation]
*/
//
// Original Author: Siew Yan Hoh
// Created: Wed, 11 May 2016 15:18:40 GMT
//
//
// system include files
#include <memory>
#include <vector>
#include <algorithm>
// user include files
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
//ROOT required dependencies
#include "TH1D.h"
#include "TH1F.h"
#include "TTree.h"
#include "TLorentzVector.h"
//Helper
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "CommonTools/UtilAlgos/interface/TFileService.h"
#include "FWCore/Utilities/interface/InputTag.h"
// Analysis-specified
#include "DataFormats/HepMCCandidate/interface/GenParticle.h"
#include "DataFormats/Candidate/interface/Candidate.h"
//
// class declaration
//
// If the analyzer does not use TFileService, please remove
// the template argument to the base class so the class inherits
// from edm::one::EDAnalyzer<> and also remove the line from
// constructor "usesResource("TFileService");"
// This will improve performance in multithreaded jobs.
class scout : public edm::one::EDAnalyzer<edm::one::SharedResources> {
public:
explicit scout(const edm::ParameterSet&);
~scout();
static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
private:
virtual void beginJob() override;
virtual void analyze(const edm::Event&, const edm::EventSetup&) override;
virtual void endJob() override;
// ----------member data ---------------------------
// std::vector<reco::GenParticle> IndexByPt(std::vector<reco::GenParticle> vector);
//struct comp {
//bool operator() (reco::GenParticle& i,reco::GenParticle& j) { return ( (i.pt()) > (j.pt()) ); } // sort in descending order
// };
//Token
edm::EDGetTokenT<reco::GenParticleCollection> tok_gen;
//InputTag
edm::InputTag genParticleTag_;
//vector
//std::vector<reco::GenParticle> bjets;
//LorentzVector
//TLorentzVector dmSystem;
//TLorentzVector dm;
//TH1D
//TH1D *Njet;
//TH1D *pdg;
//TH1D *status;
//TH1F
//TH1F *ptb1;
//TH1F *ptb2;
//TH1F *etab1;
//TH1F *etab2;
//TH1F *phipt;
//TH1F *etaphi;
//TH1F *phimass;
//TH1F *chichipt;
//TH1F *chichimass;
//third jet
//TH1F *ptj3;
//TH1F *etaj3;
//bjet1 daughter
//TH1D *Ndoug;
//TH1D *dougstatus;
//TH1D *dougpdgid;
//Tree for acceptance
//Double_t met[7];
//Float_t acc[7];
//TTree *a;
//variable
//double countEvent = 0;
//double countEventPass[7]={0.,0.,0.,0.,0.,0.,0.};
int counter;
};
//
// constants, enums and typedefs
//
//
// static data member definitions
//
//
// constructors and destructor
//
scout::scout(const edm::ParameterSet& iConfig):
genParticleTag_(iConfig.getUntrackedParameter<edm::InputTag>("genParticleTag"))
{
//now do what ever initialization is needed
// usesResource("TFileService");
//Token
tok_gen = consumes<reco::GenParticleCollection>(genParticleTag_);
//edm::Service<TFileService> fs;
//global
//Njet = fs->make<TH1D>( "Njet" , "Jet Multiplicity" , 10 , -0.5 , 9.5 );
//pdg = fs->make<TH1D>( "pdg" , "pdgid in event" , 30 , -30. , 30. );
//status = fs->make<TH1D>( "status" , "status code of Event" , 100 , 0. , 100 );
//process kinematics
//ptb1 = fs->make<TH1F>( "ptb1" , "P_{T} of the leading b jet; Pt_{bjet1} [GeV/c]; Events" , 100 , 0. , 500. );
//ptb2 = fs->make<TH1F>( "ptb2" , "P_{T} of second leading b jet; Pt_{bjet2} [GeV/c]; Events" , 100 , 0. , 500. );
//etab1 = fs->make<TH1F>( "etab1" , "Eta of the leading b jet; #eta_{bjet1}; Events" , 100 , -5. , 5. );
//etab2 = fs->make<TH1F>( "etab2" , "Eta of the second leading b jet; #eta_{bjet2} ; Events" , 100 , -5. , 5. );
//phipt = fs->make<TH1F>( "phipt" , "P_{T} of #Phi; Pt_{#Phi} [GeV/c]; Events" , 100 , 0. , 500. );
//etaphi = fs->make<TH1F>( "etaphi" , "Eta of #Phi; #eta_{#Phi} ; Events" , 100 , -5. , 5. );
//phimass = fs->make<TH1F>( "phimass" , "Inv mass of #Phi; M(#Phi) [GeV/c^{2}]; Events" , 100 , 0. , 1500. );
//chichipt = fs->make<TH1F>( "chichipt" , "P_{T} of #chi#tilde{#chi}; Pt_{#chi#tilde{#chi}} [GeV/c]; Events" , 100 , 0. , 500. );
//chichimass = fs->make<TH1F>( "chichimass" , "Inv mass of #chi#tilde{#chi}; M(#chi#chi) [GeV/c^{2}]; Events" , 100 , 0. , 1500. );
//ptj3 = fs->make<TH1F>( "ptj3" , "P_{T} of the third light jet; Pt_{jet3} [GeV/c]; Events" , 100 , 0. , 500. );
//etaj3 = fs->make<TH1F>( "etaj3" , "Eta of the third light jet; #eta_{jet3}; Events" , 100 , -5. , 5. );
//bjet1 daughter
//Ndoug = fs->make<TH1D>( "Ndoug" , "leading bjet number of daugther" , 10 , -0.5 , 9.5 );
//dougstatus = fs->make<TH1D>( "dougstatus" , "leading bjet daughter status" , 100 , -0.5 , 99.5 );
//dougpdgid = fs->make<TH1D>( "dougpdgid" , "leading bjet daughter pdgid" , 10 , -0.5 , 9.5 );
//Tree
//a = fs->make<TTree>("a","Acceptance");
//a->Branch("met",met,"met[7]/D");
//a->Branch("acc",acc,"acc[7]/F");
//variable initialization
//bjets.clear();
counter=0;
}
scout::~scout()
{
// do anything here that needs to be done at desctruction time
// (e.g. close files, deallocate resources etc.)
}
//
// member functions
//
/*
std::vector<reco::GenParticle> scout::IndexByPt(std::vector<reco::GenParticle> vector)
{
comp comparator;
std::sort (vector.begin() , vector.end() , comparator);
return vector;
}
*/
// ------------ method called for each event ------------
void
scout::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
{
using namespace edm;
using namespace reco;
//using reco::GenParticleCollection;
Handle<GenParticleCollection> var1;
iEvent.getByToken(tok_gen, var1);
std::cout<<"Each event contains a huge collection of genParticles"<<std::endl;
std::cout<<"Into genParticleCollection in nEvent = "<<counter<<std::endl;
std::cout<<"The size of genParticleCollection = "<<var1->size()<<std::endl;
for( size_t i=0 ; i < var1->size() ; ++i )
{
//std::cout<<"here loop"<<std::endl;
const GenParticle &p = (*var1)[i];
const Candidate *mom = p.mother();
//std::cout<<"here loop middle before mother"<<std::endl;
if( /*abs(p.pdgId()) == 5 ||
abs(p.pdgId()) == 9100000*/
/*(abs(p.pdgId()) < 6 && p.status() == 71)*/
/*(p.status() == 71)*/
/*abs(p.pdgId()) <= 4 && ( (p.status() > 70) && (p.status() < 80 ) )*/
/*p.isHardProcess() */ //hardprocess with 21,22,23
/*( abs(p.pdgId()) == 5 || p.pdgId() == -2 ) && p.status() == 71*/
p.isHardProcess()
/*(p.status() == 22) || (p.status() == 23)*/
/*p.fromHardProcessFinalState()*/ //only the chi dark matter
/*p.fromHardProcessDecayed()*/ //null
/*p.fromHardProcessBeforeFSR()*/
/*(mom->status() == 23)*/ )
{
size_t n = p.numberOfDaughters();
std::cout<<"======================================================"<<std::endl;
std::cout<<"->Find a pdgid = "<<p.pdgId()<<" and status = "<<p.status() <<" particle in genParticleCollection"<<std::endl;
std::cout<<"-->Who has a mother pdgid= "<<mom->pdgId()<<" and status = "<<mom->status()<<std::endl;
std::cout<<"--->The daughter(s) is(are):"<<std::endl;
for(size_t j = 0; j < n; ++ j)
{
const Candidate *d = p.daughter(j);
std::cout<<"----> ("<<j<<") daughter.pdgId() = "<<d->pdgId()<<" & daughter.status() = "<<d->status()<<std::endl;
}
std::cout<<"=================================================="<<std::endl;
}
//std::cout<<"here loop end"<<std::endl;
}
counter++;
#ifdef THIS_IS_AN_EVENT_EXAMPLE
Handle<ExampleData> pIn;
iEvent.getByLabel("example",pIn);
#endif
#ifdef THIS_IS_AN_EVENTSETUP_EXAMPLE
ESHandle<SetupData> pSetup;
iSetup.get<SetupRecord>().get(pSetup);
#endif
}
// ------------ method called once each job just before starting event loop ------------
void
scout::beginJob()
{
}
// ------------ method called once each job just after ending the event loop ------------
void
scout::endJob()
{
std::cout<<"nEvent = "<<counter<<std::endl;
}
// ------------ method fills 'descriptions' with the allowed parameters for the module ------------
void
scout::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
//The following says we do not know what parameters are allowed so do no validation
// Please change this to state exactly what you do use, even if it is no parameters
edm::ParameterSetDescription desc;
desc.setUnknown();
descriptions.addDefault(desc);
}
//define this as a plug-in
DEFINE_FWK_MODULE(scout);
|
4f1e17ae2fa5892f38ad6cafa5bf47ee160eaf01 | 323a70000f7e396f6d5c74322f79ffd17b884117 | /data_vel16_zedleft/reproject/coloring.cpp | f824bd7dbb929cdea6d770ddc061555ae258a55c | [] | no_license | eglrp/LaserSeteroCalibration | 629a09a5f024a11f7bb22e66cc7e098cfa0560a9 | f9a70a9a486b160bd85fe1b33daf110a9e5b028d | refs/heads/master | 2020-04-06T22:51:44.926711 | 2018-03-01T20:39:21 | 2018-03-01T20:39:21 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 9,146 | cpp | coloring.cpp | /*
* coloring the pointcloud with the image
*/
#include <cstdlib>
#include <cstdio>
#include <boost/foreach.hpp>
#include <math.h>
#include "opencv2/opencv.hpp"
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <pcl/io/pcd_io.h>
#include <pcl/common/eigen.h>
#include <pcl/common/transforms.h>
// offline process the recorded data
#define USE_RECORDED_FILES 1
#define USE_ONLY_XYZ 1
using namespace std;
using namespace cv;
using namespace pcl;
/*
string CAMERA_FRAME_TOPIC;
string CAMERA_INFO_TOPIC;
string VELODYNE_TOPIC;
string VELODYNE_COLOR_TOPIC;
pcl::PointCloud<Velodyne::Point> origin_pc;
#ifdef USE_ONLY_XYZ
pcl::PointCloud<pcl::PointXYZ> visible_points;
#else
pcl::PointCloud<Velodyne::Point> visible_points;
#endif
//float DoF[6] = {0.0503676, -0.14093, -0.0114802, -0.00142857, -0.00428571, 0.01};
std::vector<float> DoF;
// Mat empty = Mat::zeros(frame.size(), CV_8UC1);
Mat result_channel(frame.size(), CV_8UC3);
Mat in[] = {image, plane};
int from_to[] = {0, 0, 1, 1, 2, 2};
mixChannels(in, 2, &result_channel, 1, from_to, 3);
cv::imwrite("mixChannels.png", result_channel);
return result_channel;
*/
static cv::Vec3b atf(cv::Mat rgb, cv::Point2f xy_f)
{
cv::Vec3i color_i;
color_i.val[0] = color_i.val[1] = color_i.val[2] = 0;
int x = xy_f.x;
int y = xy_f.y;
for (int row = 0; row <= 1; row++)
{
for (int col = 0; col <= 1; col++)
{
cv::Vec3b c = rgb.at<cv::Vec3b>(cv::Point(x + col, y + row));
color_i.val[0] += c.val[0];
color_i.val[1] += c.val[1];
color_i.val[2] += c.val[2];
}
}
cv::Vec3b color;
color.val[0] = color_i.val[0] / 4;
color.val[1] = color_i.val[1] / 4;
color.val[2] = color_i.val[2] / 4;
return color;
}
static cv::Point2f projectfo(const PointXYZI &pt, const cv::Mat &extrinsic, const cv::Mat &intrinsic, float d[4])
{
cv::Mat pt_3D(4, 1, CV_32FC1);
pt_3D.at<float>(0) = pt.x;
pt_3D.at<float>(1) = pt.y;
pt_3D.at<float>(2) = pt.z;
pt_3D.at<float>(3) = 1.0f;//is homogenious coords. the point's 4. coord is 1
cv::Mat pt_2D = extrinsic * pt_3D;
float w = pt_2D.at<float>(2);
float x = pt_2D.at<float>(0) / w;
float y = pt_2D.at<float>(1) / w;
// add distortion
float r2 = x*x + y*y;
float r4 = r2 * r2;
float xd = x*(1 + d[0]*r2 + d[1]*r4) + 2*d[2]*x*y + d[3]*(r2 + 2*x*x);
float yd = y*(1 + d[0]*r2 + d[1]*r4) + 2*d[3]*x*y + d[2]*(r2 + 2*y*y);
//std::cout << xd - x << std::endl;
// image coordinates
x = intrinsic.at<float>(0, 0)*x + intrinsic.at<float>(0, 2);
y = intrinsic.at<float>(1, 1)*y + intrinsic.at<float>(1, 2);
return cv::Point2f(x, y);
}
static cv::Point2f projectfo(const PointXYZ &pt, const cv::Mat &extrinsic, const cv::Mat &intrinsic, float d[4])
{
cv::Mat pt_3D(4, 1, CV_32FC1);
pt_3D.at<float>(0) = pt.x;
pt_3D.at<float>(1) = pt.y;
pt_3D.at<float>(2) = pt.z;
pt_3D.at<float>(3) = 1.0f;//is homogenious coords. the point's 4. coord is 1
cv::Mat pt_2D = extrinsic * pt_3D;
float w = pt_2D.at<float>(2);
float x = pt_2D.at<float>(0) / w;
float y = pt_2D.at<float>(1) / w;
// add distortion
float r2 = x*x + y*y;
float r4 = r2 * r2;
float xd = x*(1 + d[0]*r2 + d[1]*r4) + 2*d[2]*x*y + d[3]*(r2 + 2*x*x);
float yd = y*(1 + d[0]*r2 + d[1]*r4) + 2*d[3]*x*y + d[2]*(r2 + 2*y*y);
//std::cout << xd - x << std::endl;
// image coordinates
x = intrinsic.at<float>(0, 0)*xd + intrinsic.at<float>(0, 2);
y = intrinsic.at<float>(1, 1)*yd + intrinsic.at<float>(1, 2);
return cv::Point2f(x, y);
}
PointCloud<PointXYZRGB> colouring(pcl::PointCloud<PointXYZI> &pc,
cv::Mat& frame_rgb, cv::Mat& extrinsic, cv::Mat& intrinsic, float distortion[4])
{
PointCloud<PointXYZRGB> color_cloud;
unsigned int Cols = frame_rgb.cols;
unsigned int Rows = frame_rgb.rows;
for (pcl::PointCloud<pcl::PointXYZI>::iterator pt=pc.begin(); pt<pc.end(); pt++)
{
Point2f xy = projectfo(*pt, extrinsic, intrinsic, distortion);
if( xy.x >= 0 && xy.x < Cols && xy.y >= 0 && xy.y < Rows)
{
Vec3b rgb = atf(frame_rgb, xy);
PointXYZRGB pt_rgb(rgb.val[2], rgb.val[1], rgb.val[0]);
pt_rgb.x = pt->x;
pt_rgb.y = pt->y;
pt_rgb.z = pt->z;
color_cloud.push_back(pt_rgb);
}
}
return color_cloud;
}
PointCloud<PointXYZRGB> colouring(pcl::PointCloud<PointXYZ> &pc,
cv::Mat& frame_rgb, cv::Mat& extrinsic, cv::Mat& intrinsic, float distortion[4])
{
PointCloud<PointXYZRGB> color_cloud;
unsigned int Cols = frame_rgb.cols;
unsigned int Rows = frame_rgb.rows;
for (pcl::PointCloud<pcl::PointXYZ>::iterator pt=pc.begin(); pt<pc.end(); pt++)
{
Point2f xy = projectfo(*pt, extrinsic, intrinsic, distortion);
if( xy.x >= 0 && xy.x < Cols && xy.y >= 0 && xy.y < Rows)
{
Vec3b rgb = atf(frame_rgb, xy);
PointXYZRGB pt_rgb(rgb.val[2], rgb.val[1], rgb.val[0]);
pt_rgb.x = pt->x;
pt_rgb.y = pt->y;
pt_rgb.z = pt->z;
color_cloud.push_back(pt_rgb);
}
}
return color_cloud;
}
int main(int argc, char** argv)
{
cv::Mat intrinsic;
cv::Mat extrinsic;
cv::Mat img;
std::cout << "Loading camera image... " << std::endl;
img = cv::imread("left_17.png");
if(img.empty())
{
std::cout << "error load image" << std::endl;
return -1;
}
pcl::PointCloud<pcl::PointXYZI> pc_xyzi;
//* load the pointcloud
if (pcl::io::loadPCDFile<pcl::PointXYZI> ("cloud17.pcd", pc_xyzi) == -1)
{
PCL_ERROR ("Couldn't read file pcd \n");
return (-1);
}
std::cout << pc_xyzi.width * pc_xyzi.height << "points Loaded" << std::endl;
float p[9] = { 700.5756, 0., 644.1857,
0., 700.5844, 347.3933,
0., 0., 1.0};
cv::Mat(3, 3, CV_32FC1, &p).copyTo(intrinsic);
float e[16] = { 0.9990, -0.0430, 0.0147, 0.1169170,
0.0154, 0.0166, -0.9997, -0.0499314,
0.0428, 0.9989, 0.0173, -0.2737781,
0.0, 0.0, 0.0, 1.0};
cv::Mat(4, 4, CV_32FC1, &e).copyTo(extrinsic);
float distortion[4] = {-0.173361922215230, 0.025608197114975, -0.000352813925344, 0.000446588643795};
std::cout << "extrinsic" << extrinsic << std::endl;
PointCloud<PointXYZRGB> color_cloud
= colouring(pc_xyzi, img, extrinsic, intrinsic, distortion);
pcl::io::savePCDFile("color_cloud.pcd", color_cloud);
return 0;
}
/*
#else
void pointCloudCallback(const sensor_msgs::PointCloud2ConstPtr& msg)
{
// if no rgb frame for coloring:
if (frame_rgb.data == NULL)
{
return;
}
pcl::PointCloud<Velodyne::Point> pc;
pcl::PointCloud<Velodyne::Point> tmp;
pcl::PointCloud<Velodyne::Point> new_cloud;
fromROSMsg(*msg, pc);
Eigen::Affine3f transf1 = getTransformation(0, 0, 0, M_PI / 2, -M_PI/2, 0);
Eigen::Affine3f transf2 = getTransformation(DoF[0], DoF[1], DoF[2],
DoF[3], DoF[4], DoF[5]);
transformPointCloud(pc, tmp, transf1);
transformPointCloud(tmp, new_cloud, transf2);
Image::Image img(frame_rgb);
project( new_cloud, frame_rgb, projection_matrix );
Velodyne::Velodyne visible_scan(visible_points);
PointCloud<PointXYZRGB> color_cloud
= visible_scan.colour(frame_rgb, projection_matrix);
// reverse axix switching:
Eigen::Affine3f transf = getTransformation(0, 0, 0, -M_PI / 2, 0, 0);
transformPointCloud(color_cloud, color_cloud, transf);
sensor_msgs::PointCloud2 color_cloud2;
toROSMsg(color_cloud, color_cloud2);
color_cloud2.header = msg->header;
pub.publish(color_cloud2);
// std::cout <<" color cloud published!" << std::endl;
}
void cameraInfoCallback(const sensor_msgs::CameraInfoConstPtr& msg)
{
float p[12];
float *pp = p;
for (boost::array<double, 12ul>::const_iterator i = msg->P.begin();
i != msg->P.end(); i++)
{
*pp = (float)(*i);
pp++;
}
cv::Mat(3, 4, CV_32FC1, &p).copyTo(projection_matrix);
}
void imageCallback(const sensor_msgs::ImageConstPtr& msg)
{
cv_bridge::CvImagePtr cv_ptr =
cv_bridge::toCvCopy(msg, sensor_msgs::image_encodings::BGR8);
frame_rgb = cv_ptr->image;
}
int main(int argc, char** argv)
{
ros::init(argc, argv, "coloring_node");
ros::NodeHandle n;
n.getParam("/but_calibration_camera_velodyne/camera_frame_topic",
CAMERA_FRAME_TOPIC);
n.getParam("/but_calibration_camera_velodyne/camera_info_topic",
CAMERA_INFO_TOPIC);
n.getParam("/but_calibration_camera_velodyne/velodyne_topic",
VELODYNE_TOPIC);
n.getParam("/but_calibration_camera_velodyne/velodyne_color_topic",
VELODYNE_COLOR_TOPIC);
n.getParam("/but_calibration_camera_velodyne/6DoF", DoF);
pub = n.advertise<sensor_msgs::PointCloud2>(VELODYNE_COLOR_TOPIC, 1);
// Subscribe input camera image
image_transport::ImageTransport it(n);
image_transport::Subscriber sub =
it.subscribe(CAMERA_FRAME_TOPIC, 10, imageCallback);
ros::Subscriber info_sub =
n.subscribe(CAMERA_INFO_TOPIC, 10, cameraInfoCallback);
ros::Subscriber pc_sub =
n.subscribe<sensor_msgs::PointCloud2>(VELODYNE_TOPIC, 1, pointCloudCallback);
ros::spin();
return EXIT_SUCCESS;
}
#endif
*/
|
40dda26cf723f0997772a2dbc8305b6758457399 | e211a5ac470b6e58c511b1a2acaebade67c404e0 | /transnode/FileQueue.h | 4435a5b8cbf91555bf661007dd22f6b370436ca3 | [] | no_license | taylorlu/transcli | 030b4bb52a054fa698b56268a8c0d3949c0ec087 | 94f75e2333b9e7a7738839243b46de9e8cc24642 | refs/heads/master | 2020-04-28T13:54:14.602129 | 2019-03-13T01:30:17 | 2019-03-13T01:30:17 | 175,320,906 | 0 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 4,174 | h | FileQueue.h | #ifndef _FILE_QUEUE_H_
#define _FILE_QUEUE_H_
#include <string>
#include <vector>
#include <map>
#include "bit_osdep.h"
#include "tsdef.h"
using namespace std;
class CFileQueue
{
public:
CFileQueue(void);
~CFileQueue(void);
typedef struct {
std::string fileName;
stream_type_t type;
video_info_t* vinfo;
audio_info_t* ainfo;
} queue_item_t;
void SetWorkerId(int id) {m_workerId = id;}
bool SetTempDir(const char* dir) ;
const char* GetTempDir() {return m_tempDir.c_str();}
void CleanTempDir();
void AddSrcFile(const std::string& fileName);
const char* GetFirstSrcFile();
const char* GetCurSrcFile();
std::string GetCurSrcFileExt(){return m_curSrcFileExt;}
std::string GetTempSrcFile(const char* srcFile);
size_t GetSrcFileCount() {return m_srcFiles.size();}
bool IsAllSrcFilesConsumed() {return m_srcFileIter == m_srcFiles.end();}
void RewindSrcFiles() {m_srcFileIter = m_srcFiles.begin();}
void AddDestFile(const std::string& fileName);
const char* GetCurDestFile();
void RewindDestFiles() {m_destFileIter = m_destFiles.begin();};
bool ModifyDestFileNames(const char* postfix, int index = 0, const char *prefix = NULL);
std::vector<std::string> GetDestFiles() {return m_destFiles;}
std::vector<std::string> GetTempDestFiles() {return m_tempDstFiles;}
void SetSubTitleFile(const char* subFile) {m_subTitleFile = subFile;}
const char* GetSubTitleFile() {return m_subTitleFile.c_str();}
// Get temp stream file name
std::string GetStreamFileName(stream_type_t streamType, int format=-1, int streamId=0, const char* ext=NULL);
size_t GetAudioItemCount() {return m_audioItems.size();}
size_t GetVideoItemCount() {return m_videoItems.size();}
queue_item_t* GetAudioFileItem(size_t id);
queue_item_t* GetVideoFileItem(size_t id);
std::string GetEncoderStatFile(int videoStreamId);
void RenameX264StatFile();
void Enqueue(const queue_item_t& fileItem);
queue_item_t* GetFirst(stream_type_t type);
queue_item_t* GetNext(stream_type_t type);
void SetRelativeDir(const char* relativeDir) {if(relativeDir) m_relativeDir = relativeDir;}
const char* GetRelativeDir() {return m_relativeDir.c_str();}
void AddAudioSegFile(std::string audioSegFile) {m_vctAudioSegFiles.push_back(audioSegFile);}
void AddVideoSegFile(std::string videoSegFile) {m_vctVideoSegFiles.push_back(videoSegFile);}
bool ModifyAudioStreamFile(int curIdx);
bool ModifyVideoStreamFile(int curIdx);
void RemoveCurSplitTempFile();
void SetKeepTemp(bool bKeep) {m_keepTemp = bKeep;}
bool GetKeepTemp() {return m_keepTemp;}
void ClearAudioFiles();
void ClearVideoFiles();
void ClearDestFiles() {m_destFiles.clear();}
void ClearSrcFiles() {m_srcFiles.clear();}
void ClearTempSrcFiles();
void ClearTempDstFiles();
void ClearEncoderStatFiles();
void ClearAVSegmentFiles();
void Clear();
private:
std::vector<queue_item_t> m_audioItems;
std::vector<queue_item_t> m_videoItems;
std::vector<queue_item_t> m_subItems;
std::vector<queue_item_t>::iterator m_audioIter;
std::vector<queue_item_t>::iterator m_videoIter;
std::vector<queue_item_t>::iterator m_subIter;
std::vector<std::string> m_destFiles;
std::vector<std::string>::iterator m_destFileIter;
std::vector<std::string> m_srcFiles;
std::vector<std::string>::iterator m_srcFileIter;
std::string m_curSrcFileExt;
std::map<std::string, std::string> m_tempSrcFiles; // Temp source file on local node(in temp dir)
std::vector<std::string> m_tempDstFiles; // Temp dest file on local node(in temp dir)
std::vector<std::string> m_tempSubFiles;
std::vector<std::string> m_encoderStatFiles;
std::string m_tempDir;
std::string m_subTitleFile;
std::string m_relativeDir; // When keep directory structure of source watch folder, use this
// Used for modifying segment files
std::vector<std::string> m_vctDestFileTitle;
// Segment audio/video stream files
std::vector<std::string> m_vctAudioSegFiles;
std::vector<std::string> m_vctVideoSegFiles;
int m_workerId;
int m_srcFileIndex;
int m_curProcessId;
bool m_keepTemp;
};
#endif
|
fda2e48669f4d089daed628e9cfcc01086246efb | 75e49b7e53cf60c99b7ab338127028a457e2721b | /sources/plug_doxmlparser/src/luna/bind_IDocParameterList.cpp | 5846b16c67ef95978b0cb6a9abc89fb069cc07db | [] | no_license | roche-emmanuel/singularity | 32f47813c90b9cd5655f3bead9997215cbf02d6a | e9165d68fc09d2767e8acb1e9e0493a014b87399 | refs/heads/master | 2021-01-12T01:21:39.961949 | 2012-10-05T10:48:21 | 2012-10-05T10:48:21 | 78,375,325 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,476 | cpp | bind_IDocParameterList.cpp | #include <plug_common.h>
class luna_wrapper_IDocParameterList {
public:
typedef Luna< IDocParameterList > luna_t;
// Function checkers:
inline static bool _lg_typecheck_sectType(lua_State *L) {
if( lua_gettop(L)!=1 ) return false;
return true;
}
inline static bool _lg_typecheck_params(lua_State *L) {
if( lua_gettop(L)!=1 ) return false;
return true;
}
// Operator checkers:
// (found 0 valid operators)
// Function binds:
static int _bind_sectType(lua_State *L) {
if (!_lg_typecheck_sectType(L)) {
luna_printStack(L);
luaL_error(L, "luna typecheck failed in sectType function, expected prototype:\nsectType()");
}
IDocParameterList* self=dynamic_cast< IDocParameterList* >(Luna< IDoc >::check(L,1));
if(!self) {
luaL_error(L, "Invalid object in function call sectType(...)");
}
IDocParameterList::Types lret = self->sectType();
lua_pushnumber(L,lret);
return 1;
}
static int _bind_params(lua_State *L) {
if (!_lg_typecheck_params(L)) {
luna_printStack(L);
luaL_error(L, "luna typecheck failed in params function, expected prototype:\nparams()");
}
IDocParameterList* self=dynamic_cast< IDocParameterList* >(Luna< IDoc >::check(L,1));
if(!self) {
luaL_error(L, "Invalid object in function call params(...)");
}
IDocIterator * lret = self->params();
if(!lret) return 0; // Do not write NULL pointers.
Luna< IDocIterator >::push(L,lret,false);
return 1;
}
// Operator binds:
};
IDocParameterList* LunaTraits< IDocParameterList >::_bind_ctor(lua_State *L) {
return NULL; // Class is abstract.
}
void LunaTraits< IDocParameterList >::_bind_dtor(IDocParameterList* obj) {
delete obj;
}
const char LunaTraits< IDocParameterList >::className[] = "IDocParameterList";
const char LunaTraits< IDocParameterList >::moduleName[] = "doxmlparser";
const char* LunaTraits< IDocParameterList >::parents[] = {"doxmlparser.IDoc", 0};
const int LunaTraits< IDocParameterList >::uniqueIDs[] = {2243631,0};
luna_RegType LunaTraits< IDocParameterList >::methods[] = {
{"sectType", &luna_wrapper_IDocParameterList::_bind_sectType},
{"params", &luna_wrapper_IDocParameterList::_bind_params},
{0,0}
};
luna_RegEnumType LunaTraits< IDocParameterList >::enumValues[] = {
{"Param", IDocParameterList::Param},
{"RetVal", IDocParameterList::RetVal},
{"Exception", IDocParameterList::Exception},
{0,0}
};
|
da40ca187e2712c40a974f45eca30fd19d20acc0 | 0eff74b05b60098333ad66cf801bdd93becc9ea4 | /second/download/squid/gumtree/squid_repos_function_3297_squid-3.5.27.cpp | 4a7f730c74305e295dfe036819b26a030198832d | [] | no_license | niuxu18/logTracker-old | 97543445ea7e414ed40bdc681239365d33418975 | f2b060f13a0295387fe02187543db124916eb446 | refs/heads/master | 2021-09-13T21:39:37.686481 | 2017-12-11T03:36:34 | 2017-12-11T03:36:34 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 475 | cpp | squid_repos_function_3297_squid-3.5.27.cpp | void
MemStore::unlink(StoreEntry &e)
{
if (e.mem_obj && e.mem_obj->memCache.index >= 0) {
map->freeEntry(e.mem_obj->memCache.index);
disconnect(e);
} else if (map) {
// the entry may have been loaded and then disconnected from the cache
map->freeEntryByKey(reinterpret_cast<cache_key*>(e.key));
}
e.destroyMemObject(); // XXX: but it may contain useful info such as a client list. The old code used to do that though, right?
} |
f50fe3b5548c0505c80b21eeb06106d1062aa4fa | 89d71656f1ba411c081f7e26258b498b7f10aaa2 | /AoJ/DSL/RangeQuery/RangeMinQuery/array.cpp | f0bdf25339aff953f81a548ed1e268c16fbaa670 | [] | no_license | noblesseoblige6/Algorithms | 4b06d01b7ca015c5b2b28398ae3142f10a281048 | ae8d1085009e0cd98e805795b4cc31a4e2e161ac | refs/heads/master | 2023-08-29T09:22:47.419651 | 2023-08-02T06:50:05 | 2023-08-02T06:50:05 | 51,254,943 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,103 | cpp | array.cpp | #include <bits/stdc++.h>
#define INI_VAL 2147483647
#define PrintDebug cout<<"TEST"<<endl;
using namespace std;
const int MAX_N = 131072;
int n;
int dat[MAX_N * 4];
void init()
{
for(int i = 0; i < 2*n-1; ++i)
dat[i] = INI_VAL;
}
void Update(int i, int x)
{
i += n-1;
dat[i] = x;
// Trace back until parent
while(i > 0)
{
i = (i-1)/2;
dat[i] = min(dat[2*i+1], dat[2*i+2]);
}
}
int Query(int a, int b, int k, int l, int r)
{
if(r <= a || b <= l)
return INI_VAL;
// In range completely
if(a <= l && r <= b)
{
// cout<<"TEST "<<k<<endl;
return dat[k];
}
else
{
int vl = Query(a, b, k * 2 + 1, l, (l + r)/2);
int vr = Query(a, b, k * 2 + 2, (l + r)/2, r);
return min(vl, vr);
}
}
int main()
{
int q;
cin >> n >> q;
int num = n;
n = n % 2 == 0 ? n : n + 1;
init();
int o, x, y;
for(int i = 0; i < q; ++i){
// cin >> o >> x >> y;
scanf("%d %d %d", &o, &x, &y);
if(o == 0)
{
Update(x, y);
}
else if(o == 1)
{
printf("%d\n", Query(x, y+1, 0, 0, num));
}
}
return 0;
}
|
2102252ffc78311bfe5613246dca868329b8c55f | 4e0590ddf391d3b70e01e332b9bb61b644d4312d | /code/pm/src/rest.cpp | 02b67ac0e94d0143335f6cd72ec1dc701af931df | [] | no_license | ktbolt/ProteinMechanica | 8724f2f12ba892a32b69423fd4dbb52b169a4981 | e02effec46550b1a91061dd052af54ae56a7546f | refs/heads/master | 2020-06-22T04:41:28.728730 | 2020-06-09T04:21:36 | 2020-06-09T04:21:36 | 197,635,184 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 19,763 | cpp | rest.cpp | /* -------------------------------------------------------------------------- *
* Protein Mechanica *
* -------------------------------------------------------------------------- *
* This is part of the Protein Mechanica coarse-grained molecular motor *
* modeling application originating from Simbios, the NIH National Center for *
* Physics-Based Simulation of Biological Structures at Stanford, funded *
* under the NIH Roadmap for Medical Research, grant U54 GM072970. *
* See https://simtk.org. *
* *
* Portions copyright (c) 2010 Stanford University and the Authors. *
* Authors: David Parker *
* Contributors: *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the "Software"), *
* to deal in the Software without restriction, including without limitation *
* the rights to use, copy, modify, merge, publish, distribute, sublicense, *
* and/or sell copies of the Software, and to permit persons to whom the *
* Software is furnished to do so, subject to the following conditions: *
* *
* The above copyright notice and this permission notice shall be included in *
* all copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
* THE AUTHORS, CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
//*============================================================*
//* rest: r e s t r a i n t *
//*============================================================*
#include "rest.h"
#include "sobj.h"
#include "pobj.h"
#include "graphics.h"
//===== debug symbols =====//
#define ndbg_PmRestraint_compForces
namespace ProteinMechanica {
//*============================================================*
//*========== constructors / destructor ==========*
//*============================================================*
PmRestraint::PmRestraint(const string name)
{
this->name = name;
type = PM_RESTRAINT_CENTER;
initialized = false;
line_geometry = NULL;
active = false;
has_power_params = false;
power_params[0] = 0.0;
power_params[1] = 0.0;
distance = 0.0;
use_absolute_distance = false;
has_ramp = false;
ramp_init = true;
ramp_start = 0.0;
ramp_time = 0.0;
dramp = 0.0;
compute_energy = false;
current_energy = 0.0;
current_residual = 0.0;
color.set(1,0,1);
width = 1;
show = false;
}
//*============================================================*
//*========== convType ==========*
//*============================================================*
// convert a string restraint type to a symbol.
void
PmRestraint::convType(const string str, PmRestraintType& type)
{
type = PM_RESTRAINT_UNKNOWN;
if (str == "all") {
type = PM_RESTRAINT_ALL;
}
else if (str == "center") {
type = PM_RESTRAINT_CENTER;
}
}
//*============================================================*
//*========== setType ==========*
//*============================================================*
// set restraint type.
void
PmRestraint::setType(const PmRestraintType type) {
this->type = type;
}
//*============================================================*
//*========== hasEnergy ==========*
//*============================================================*
bool
PmRestraint::hasEnergy() {
return compute_energy;
}
//*============================================================*
//*========== setCompEnergy ==========*
//*============================================================*
void
PmRestraint::setCompEnergy(const bool flag) {
compute_energy = flag;
}
//*============================================================*
//*========== getEnergy ==========*
//*============================================================*
void
PmRestraint::getEnergy(float& energy) {
energy = this->current_energy;
}
//*============================================================*
//*========== getName ==========*
//*============================================================*
void
PmRestraint::getName(string& name) {
name = this->name;
}
//*============================================================*
//*========== getResidual ==========*
//*============================================================*
void
PmRestraint::getResidual(float& residual)
{
residual = current_residual;
}
//*============================================================*
//*========== isActive ==========*
//*============================================================*
// check if a force is active for the given time.
bool
PmRestraint::isActive(float t)
{
//fprintf (stderr, "\n>>>>>>> PmRestraint::isActive %s t[%f] \n", name.c_str(), t);
bool has_time = time_interval.hasTime(t);
//fprintf (stderr, " >>>> has time[%d] \n", has_time);
// if the restraint is active then deactivate it //
if (active && !has_time) {
if (line_geometry && show) {
PmGraphicsAttributes atts;
atts.setVisible(false);
PmGraphicsLine *line = dynamic_cast<PmGraphicsLine*>(line_geometry);
line->setAttributes(atts);
line->display();
PmGraphicsPoint *point = dynamic_cast<PmGraphicsPoint*>(point_geometry);
point->setAttributes(atts);
point->display();
}
active = false;
}
else if (!active && has_time) {
if (line_geometry && show) {
PmGraphicsAttributes atts;
atts.setVisible(true);
PmGraphicsLine *line = dynamic_cast<PmGraphicsLine*>(line_geometry);
line->setAttributes(atts);
line->display();
PmGraphicsPoint *point = dynamic_cast<PmGraphicsPoint*>(point_geometry);
point->setAttributes(atts);
point->display();
}
active = true;
}
return (active);
}
//*============================================================*
//*========== compForces ==========*
//*============================================================*
void
PmRestraint::compForces(const bool upd, const float time)
{
#ifdef dbg_PmRestraint_compForces
fprintf (stderr, ">>>>>> PmRestraint::compForces[%s] \n", name.c_str());
#endif
bool has_time = time_interval.hasTime(time);
if (!has_time) {
this->current_energy = 0.0;
return;
}
if (!initialized) {
this->init();
}
if (points1.size() == 0) {
return;
}
//===== transform restraint points =====//
this->xformPoints();
//===== compute force on bodies due to restraint spring =====//
PmVector3 dl, dir, force;
float d, ds, d0, k, dist, fmag, total_energy, residual;
float pmax, pmin;
float rampf;
bool abs_dist;
k = this->force_const;
dist = this->distance;
total_energy = 0.0;
residual = 0.0;
for (unsigned int i = 0; i < points1.size(); i++) {
#ifdef dbg_PmRestraint_compForces
fprintf (stderr, "----- %d -----\n", i);
#endif
dl = points1[i] - points2[i];
d0 = dl.length();
dir = current_points1[i] - current_points2[i];
d = dir.length();
residual += d;
fmag = 0.0;
#ifdef dbg_PmRestraint_compForces
fprintf (stderr, ">>> d0=%g \n", d0);
fprintf (stderr, ">>> dir=%g %g %g\n", dir[0], dir[1], dir[2]);
#endif
if (use_absolute_distance) {
ds = dist;
}
else {
ds = d0*(1.0 - dist);
}
if (this->has_power_params) {
pmin = this->power_params[0];
pmax = this->power_params[1];
ds = exp(-10.0*d/d0);
if (pmax*ds < pmin) {
fmag = -pmin;
}
else {
fmag = -pmax*ds;
}
}
else {
if (d == 0.0) {
fmag = -k;
}
else {
fmag = k*(ds / d - 1.0);
}
if (this->getRampParams(time, rampf)) {
fmag = fmag * rampf;
}
}
#ifdef dbg_PmRestraint_compForces
fprintf (stderr, ">>> fmag=%g d=%g ds=%g d-ds=%g \n", fmag, d, ds, d-ds);
#endif
force = fmag*dir;
this->sobjs[0]->addForce(current_points1[i], force);
force = -force;
this->sobjs[1]->addForce(current_points2[i], force);
if (compute_energy) {
//total_energy += 0.5*k*(d-ds)*(d-ds);
total_energy += 0.5*k*d*d;
}
this->current_residual = residual;
}
if (compute_energy) {
this->current_energy = total_energy;
}
//===== show the restraint =====//
this->display();
}
//*============================================================*
//*========== xformPoints ==========*
//*============================================================*
void
PmRestraint::xformPoints()
{
PmXform xform;
PmPhysicalObj *pobj;
PmSimulationObj *sobj;
sobj = sobjs[0];
sobj->getPhysicalObj(&pobj);
pobj->getXform(xform);
PmMatrix3x3 mat = xform.matrix;
for (unsigned int i = 0; i < points1.size(); i++) {
current_points1[i] = mat*(points1[i]-xform.center) + xform.translation + xform.center;
}
sobj = sobjs[1];
sobj->getPhysicalObj(&pobj);
pobj->getXform(xform);
mat = xform.matrix;
for (unsigned int i = 0; i < points2.size(); i++) {
current_points2[i] = mat*(points2[i]-xform.center) + xform.translation + xform.center;
}
}
//*============================================================*
//*========== get/setSimObjs ==========*
//*============================================================*
void
PmRestraint::getSimObjs(PmSimulationObj **sobj1, PmSimulationObj **sobj2)
{
*sobj1 = this->sobjs[0];
*sobj2 = this->sobjs[1];
}
void
PmRestraint::setSimObjs (PmSimulationObj *sobj1, PmSimulationObj *sobj2)
{
this->sobjs[0] = sobj1;
this->sobjs[1] = sobj2;
}
//*============================================================*
//*========== setTime ==========*
//*============================================================*
void
PmRestraint::setTime (PmTimeInterval& time) {
this->time_interval = time;
}
//*============================================================*
//*========== getPointDistance ==========*
//*============================================================*
// get current distance between restraint point.
void
PmRestraint::getPointDistance(float& dist, float& pdist)
{
dist = current_residual;
}
//*============================================================*
//*========== getRampParams ==========*
//*============================================================*
// get ramp params.
bool
PmRestraint::getRampParams(const float time, float& dramp)
{
dramp = 0.0;
if (!has_ramp) {
return false;
}
if (ramp_init) {
ramp_start = time;
ramp_init = false;
}
else if (ramp_start + ramp_time < time) {
return false;
}
dramp = (time - ramp_start) / ramp_time;
return true;
}
//*============================================================*
//*========== setRampParams ==========*
//*============================================================*
// set ramp params.
void
PmRestraint::setRampParams(const float param)
{
if (param == 0.0) {
return;
}
ramp_time = param;
ramp_init = true;
has_ramp = true;
}
//*============================================================*
//*========== setRegions ==========*
//*============================================================*
// set regions.
void
PmRestraint::setRegions(const string rgn1, const string rgn2) {
this->regions[0] = rgn1;
this->regions[1] = rgn2;
}
//*============================================================*
//*========== init ==========*
//*============================================================*
void
PmRestraint::init()
{
#ifdef dbg_PmRestraint_init
fprintf (stderr, ">>>>>> PmRestraint::init[%s] \n", name.c_str());
fprintf (stderr, ">>> type=%d \n", type);
#endif
PmPhysicalObj *pobj;
PmSimulationObj *sobj;
PmVector3 center;
if (!sobjs[0] || !sobjs[1]) {
pm_ErrorWarnReport (PM, "restraint \"%s\" doesn't have simulation objects.", "*",
name.c_str());
return;
}
//===== compute the center of each region =====//
if (type == PM_RESTRAINT_CENTER) {
#ifdef dbg_PmRestraint_init
fprintf (stderr, ">>> type=center \n");
#endif
sobjs[0]->getPhysicalObj(&pobj);
pobj->getRegionCenter(regions[0], center);
points1.push_back(center);
current_points1.push_back(center);
sobjs[1]->getPhysicalObj(&pobj);
pobj->getRegionCenter(regions[1], center);
points2.push_back(center);
current_points2.push_back(center);
}
else if (type == PM_RESTRAINT_ALL) {
#ifdef dbg_PmRestraint_init
fprintf (stderr, ">>> type=all\n");
#endif
vector<PmVector3> coords1, coords2;
sobjs[0]->getRegionCoords(regions[0], coords1);
sobjs[1]->getRegionCoords(regions[1], coords2);
if (coords1.size() != coords2.size()) {
pm_ErrorWarnReport (PM, "restraint \"%s\" regions don't have the same number of coordinates.", "*", name.c_str());
pm_ErrorWarnReport (PM, "rgn 1 coords size %d ", "*", coords1.size());
pm_ErrorWarnReport (PM, "rgn 2 coords size %d ", "*", coords2.size());
return;
}
#ifdef dbg_PmRestraint_init
fprintf (stderr, ">>> coords1.size=%d \n", coords1.size());
#endif
for (unsigned int i = 0; i < coords1.size(); i++) {
points1.push_back(coords1[i]);
current_points1.push_back(coords1[i]);
points2.push_back(coords2[i]);
current_points2.push_back(coords2[i]);
}
}
initialized = true;
}
//*============================================================*
//*========== setPowerParams ==========*
//*============================================================*
// set power params.
void
PmRestraint::setPowerParams(const float params[2])
{
power_params[0] = params[0];
power_params[1] = params[1];
has_power_params = true;
}
//*============================================================*
//*========== getPowerParams ==========*
//*============================================================*
// get power params.
bool
PmRestraint::getPowerParams(float params[2])
{
if (!has_power_params) {
params[0] = 0;
params[1] = 0;
}
else {
params[0] = power_params[0];
params[1] = power_params[1];
}
return has_power_params;
}
//*============================================================*
//*========== get/setSpringData ==========*
//*============================================================*
void
PmRestraint::getSpringData(float *k, float *dist)
{
*k = this->force_const;
*dist = this->distance;
}
void
PmRestraint::setSpringData(const float k, const float dist)
{
this->force_const = k;
this->distance = dist;
}
//*============================================================*
//*========== getAbsoluteDistance ==========*
//*============================================================*
void
PmRestraint::getAbsoluteDistance(bool& flag) {
flag = this->use_absolute_distance;
}
void
PmRestraint::setAbsoluteDistance(const bool flag) {
this->use_absolute_distance = flag;
}
//*============================================================*
//*========== setColor ==========*
//*============================================================*
void
PmRestraint::setColor(const PmVector3 color) {
this->color = color;
}
//*============================================================*
//*========== setWidth ==========*
//*============================================================*
void
PmRestraint::setWidth(const float val) {
this->width = val;
}
//*============================================================*
//*========== setShow ==========*
//*============================================================*
void
PmRestraint::setShow(const bool val) {
this->show = val;
}
//*============================================================*
//*========== display ==========*
//*============================================================*
// display a restraint.
void
PmRestraint::display()
{
PmGraphicsLine *line;
PmGraphicsPoint *point;
PmGraphicsAttributes patts;
int n = current_points1.size();
if (!line_geometry) {
string geom_name;
geom_name = "force[" + name + "]";
PmVector3 *verts = new PmVector3[2*n];
for (unsigned int i = 0; i < current_points1.size(); i++) {
verts[2*i] = current_points1[i];
verts[2*i+1] = current_points2[i];
}
line = new PmGraphicsLine(geom_name, 2*n, verts);
patts.setVisible(this->show);
patts.setColor(this->color);
patts.setLineWidth(this->width);
patts.setDisjoint(true);
line->setAttributes(patts);
line_geometry = dynamic_cast<PmGraphicsGeometry*>(line);
line->display();
patts.setScale(0.1);
patts.setMarker(false);
point = new PmGraphicsPoint(geom_name, 2*n, verts);
point->setAttributes(patts);
point_geometry = dynamic_cast<PmGraphicsGeometry*>(point);
point->display();
geometry_vertices = verts;
}
else {
line = dynamic_cast<PmGraphicsLine*>(line_geometry);
point = dynamic_cast<PmGraphicsPoint*>(point_geometry);
for (unsigned int i = 0; i < current_points1.size(); i++) {
geometry_vertices[2*i] = current_points1[i];
geometry_vertices[2*i+1] = current_points2[i];
}
line->update(2*n, geometry_vertices);
point->update(2*n, geometry_vertices);
}
}
//*============================================================*
//*========== getRegionCenter ==========*
//*============================================================*
// get the center of a region for a restraint.
void
PmRestraint::getRegionCenter(const int rgn_num, PmVector3& center)
{
string rgn;
PmPhysicalObj *pobj;
PmSimulationObj *sobj;
if (rgn_num == 1) {
rgn = regions[0];
sobj = sobjs[0];
}
else {
rgn = regions[1];
sobj = sobjs[1];
}
if (!sobj) {
return;
}
sobj->getPhysicalObj(&pobj);
pobj->getRegionCenter(rgn, center);
}
}
|
ef77baf7dbf5a877f771b599331863fa04e58f6f | 293c244b17524210780b4fcb644c03d5cd6f1729 | /src/bugengine/scheduler/api/bugengine/scheduler/range/sequence.inl | e4f176bd0b5b29c8d8988e25e2f2fa895fc1dfd6 | [
"BSD-3-Clause"
] | permissive | bugengine/BugEngine | 380c0aee8ba48a07e5b820877352f922cbba0a21 | 1b3831d494ee06b0bd74a8227c939dd774b91226 | refs/heads/master | 2021-08-08T00:20:11.200535 | 2021-07-31T13:53:24 | 2021-07-31T13:53:24 | 20,094,089 | 4 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,499 | inl | sequence.inl | /* BugEngine <bugengine.devel@gmail.com>
see LICENSE for detail */
#ifndef BE_SCHEDULER_RANGE_SEQUENCE_INL_
#define BE_SCHEDULER_RANGE_SEQUENCE_INL_
/**************************************************************************************************/
#include <bugengine/scheduler/stdafx.h>
#include <bugengine/scheduler/range/sequence.hh>
namespace BugEngine { namespace Task {
template < typename T >
range_sequence< T >::range_sequence(T begin, T end, size_t grain)
: m_begin(begin)
, m_end(end)
, m_grain(grain)
{
}
template < typename T >
range_sequence< T >::~range_sequence()
{
}
template < typename T >
T& range_sequence< T >::begin()
{
return m_begin;
}
template < typename T >
T& range_sequence< T >::end()
{
return m_end;
}
template < typename T >
size_t range_sequence< T >::size() const
{
return m_end - m_begin;
}
template < typename T >
bool range_sequence< T >::atomic() const
{
return size() <= m_grain;
}
template < typename T >
u32 range_sequence< T >::partCount(u32 /*workerCount*/) const
{
return (m_end - m_begin + m_grain - 1) / m_grain;
}
template < typename T >
range_sequence< T > range_sequence< T >::part(u32 index, u32 total) const
{
T begin = m_begin + index * m_grain;
T end = (index == total - 1) ? m_end : begin + m_grain;
return range_sequence< T >(begin, end);
}
}} // namespace BugEngine::Task
/**************************************************************************************************/
#endif
|
32ef4b3c3d36ab2ac8a21d4e531a19284219af25 | 625671e57ad5a28f16525961813a7bcd2eca3306 | /septa_gt.cpp | e0232cb1e22e04fc5608b58bc8f8503fc52ee31c | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | knausb/triplo_gt | 945671aae98e17c3aa80a86e01d9cc4d602489f0 | 700a523661956ac8cd8367dfb4e1ba11eb099f0a | refs/heads/master | 2020-05-16T21:36:43.114696 | 2014-12-18T19:28:18 | 2014-12-18T19:28:18 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 45,132 | cpp | septa_gt.cpp | // Compile with:
// g++ -std=c++0x septa_gt.cpp -lgmpxx -lgmp -o septa_gt
#include <iostream>
#include <fstream>
#include <string>
#include <array>
#include <vector>
#include <stdio.h>
#include <math.h> /* log10 */
#include <cstddef>
#include <gmp.h> // GNU multiple precision arithmetic library, not standard: libgmp3-dev.
#include <boost/algorithm/string.hpp> // Not standard on Macs or Ubuntu: libboost1.46-dev.
using namespace std;
//using namespace boost;
/* ----- ----- ***** ----- ----- */
/* Functions */
/* ----- ----- ***** ----- ----- */
void refA(std::string nucs, int sampn, int nuc_cnt[][8]){
for (int i = 0; i < nucs.size(); i++){
if (nucs[i] == '.') nuc_cnt[sampn][0]++;
if (nucs[i] == ',') nuc_cnt[sampn][1]++;
if (nucs[i] == 'C') nuc_cnt[sampn][2]++;
if (nucs[i] == 'c') nuc_cnt[sampn][3]++;
if (nucs[i] == 'G') nuc_cnt[sampn][4]++;
if (nucs[i] == 'g') nuc_cnt[sampn][5]++;
if (nucs[i] == 'T') nuc_cnt[sampn][6]++;
if (nucs[i] == 't') nuc_cnt[sampn][7]++;
}
}
void refC(std::string nucs, int sampn, int nuc_cnt[][8]){
for (int i = 0; i < nucs.size(); i++){
if (nucs[i] == 'A') nuc_cnt[sampn][0]++;
if (nucs[i] == 'a') nuc_cnt[sampn][1]++;
if (nucs[i] == '.') nuc_cnt[sampn][2]++;
if (nucs[i] == ',') nuc_cnt[sampn][3]++;
if (nucs[i] == 'G') nuc_cnt[sampn][4]++;
if (nucs[i] == 'g') nuc_cnt[sampn][5]++;
if (nucs[i] == 'T') nuc_cnt[sampn][6]++;
if (nucs[i] == 't') nuc_cnt[sampn][7]++;
}
}
void refG(std::string nucs, int sampn, int nuc_cnt[][8]){
for (int i = 0; i < nucs.size(); i++){
if (nucs[i] == 'A') nuc_cnt[sampn][0]++;
if (nucs[i] == 'a') nuc_cnt[sampn][1]++;
if (nucs[i] == 'C') nuc_cnt[sampn][2]++;
if (nucs[i] == 'c') nuc_cnt[sampn][3]++;
if (nucs[i] == '.') nuc_cnt[sampn][4]++;
if (nucs[i] == ',') nuc_cnt[sampn][5]++;
if (nucs[i] == 'T') nuc_cnt[sampn][6]++;
if (nucs[i] == 't') nuc_cnt[sampn][7]++;
}
}
void refT(std::string nucs, int sampn, int nuc_cnt[][8]){
for (int i = 0; i < nucs.size(); i++){
if (nucs[i] == 'A') nuc_cnt[sampn][0]++;
if (nucs[i] == 'a') nuc_cnt[sampn][1]++;
if (nucs[i] == 'C') nuc_cnt[sampn][2]++;
if (nucs[i] == 'c') nuc_cnt[sampn][3]++;
if (nucs[i] == 'G') nuc_cnt[sampn][4]++;
if (nucs[i] == 'g') nuc_cnt[sampn][5]++;
if (nucs[i] == '.') nuc_cnt[sampn][6]++;
if (nucs[i] == ',') nuc_cnt[sampn][7]++;
}
}
void get_rd(int rds[], int sampn, int nuc_cnts[][8]){
// cout << "\nget_rd sampn: " << sampn << "\n";
for(int i=0; i<sampn; i++){ // Samples
rds[i] = nuc_cnts[i][0];
for(int j=1; j<8; j++){
rds[i] = rds[i] + nuc_cnts[i][j];
}
}
}
/* Calculate possibe ways of getting counts */
double possible_counts(int nuc_cnt[4]){
int rd = nuc_cnt[0] + nuc_cnt[1] + nuc_cnt[2] + nuc_cnt[3];
/* Multiple precision variables. */
mpz_t fac [5]; // Factorials n, A, C, G, T.
mpf_t pos [3]; // Floats for num, den, pos;
// Initialize mp ints.
for(int j=0; j<5; j++){
mpz_init(fac[j]);
mpz_set_ui(fac[j],0);
}
// Initialize mp floats.
for(int j=0; j<3; j++){
mpf_init(pos[j]);
mpf_set_ui(pos[j],0);
}
// Factorials.
mpz_fac_ui(fac[0], rd);
mpz_fac_ui(fac[1], nuc_cnt[0]);
mpz_fac_ui(fac[2], nuc_cnt[1]);
mpz_fac_ui(fac[3], nuc_cnt[2]);
mpz_fac_ui(fac[4], nuc_cnt[3]);
// Multiply denominators.
mpz_mul(fac[1],fac[1],fac[2]);
mpz_mul(fac[1],fac[1],fac[3]);
mpz_mul(fac[1],fac[1],fac[4]);
// Recast mp ints to floats for division.
mpf_set_z(pos[1], fac[0]);
mpf_set_z(pos[2], fac[1]);
// Divide.
mpf_div(pos[0], pos[1], pos[2]);
// cout << "pos0=" << pos[0] << "\n";
double posd = mpf_get_d(pos[0]);
// Clean up the mpz_t handles or else we will leak memory
for (int j=0; j<5; j++){mpz_clear(fac[j]);}
for (int j=0; j<3; j++){mpf_clear(pos[j]);}
return(posd);
}
void int_to_nucs(string gts[27], vector<pair<int,int>> moves){
/* Convert pairs to array of ints. */
int nucs[4];
for(int i=0; i<4; i++){
nucs[i] = moves[i].second;
}
// cout << nucs[0] << "," << nucs[1] << "," << nucs[2] << "," << nucs[3];
// cout << "\n";
// cout << nucs[0] << "," << nucs[1] << "," << nucs[2] << "," << nucs[3];
// cout << "\n";
/* Array indices */
/* 0 = Homozyote 1/0/0/0 */
/* 1 = Bi-allelic heterozyote 1/1 */
/* 2 = Bi-allelic triploid 2/1 */
/* 3 = Tri-allelic triploid 1/1/1 */
/* 4 = Bi-allelic tetraploid loci 3/1/0/0 */
/* 5 = Tri-allelic tetraploid loci 2/1/1/0 */
/* 6 = Tetra-allelic tetraploid loci 1/1/1/1 */
/* 7 = Bi-allelic pentaploid 4/1/0/0 */
/* 8 = Bi-allelic pentaploid 3/2/0/0 */
/* 9 = Tri-allelic pentaploid 3/1/1/0 */
/* 10 = Tri-allelic pentaploid 2/2/1/0 */
/* 11 = Tetra-allelic pentaploid 2/1/1/1 */
/* 12 = Bi-allelic hexaploid loci */
/* 13 = Tri-allelic hexaploid loci 4/1/1 */
/* 14 = Tri-allelic hexaploid loci 3/2/1 */
/* 15 = Tetra-allelic hexaploid loci 3/1/1/1 */
/* 16 = Tetra-allelic hexaploid loci 2/2/1/1 */
/* 17 = Bi-allelic septaploid loci 6/1 */
/* 18 = Bi-allelic septaploid loci 5/2 */
/* 19 = Bi-allelic septaploid loci 4/3 */
/* 20 = Tri-allelic septaploid loci 5/1/1 */
/* 21 = Tri-allelic septaploid loci 4/2/1 */
/* 22 = Tri-allelic septaploid loci 3/3/1 */
/* 23 = Tri-allelic septaploid loci 3/2/2 */
/* 24 = Tetra-allelic septaploid loci 4/1/1/1 */
/* 25 = Tetra-allelic septaploid loci 3/2/1/1 */
/* 26 = Tetra-allelic septaploid loci 2/2/2/1 */
if(nucs[0] == 0){
gts[0] = "A/A";
if(nucs[1] == 1){
/* A/C Bi-allelic */
gts[1] = "A/C";
gts[2] = "A/A/C";
gts[4] = "A/A/A/C";
gts[7] = "A/A/A/A/C";
gts[8] = "A/A/A/C/C";
gts[12] = "A/A/A/A/A/C";
gts[17] = "A/A/A/A/A/A/C";
gts[18] = "A/A/A/A/A/C/C";
gts[19] = "A/A/A/A/C/C/C";
if(nucs[2] == 2){
/* A/C/G Tri-allelic */
gts[3] = "A/C/G";
gts[5] = "A/A/C/G";
gts[9] = "A/A/A/C/G";
gts[10] = "A/A/C/C/G";
gts[13] = "A/A/A/A/C/G";
gts[14] = "A/A/A/C/C/G";
gts[20] = "A/A/A/A/A/C/G";
gts[21] = "A/A/A/A/C/C/G";
gts[22] = "A/A/A/C/C/C/G";
gts[23] = "A/A/A/C/C/G/G";
// if(nucs[3]==3){
/* A/C/G/T Tetra-allelic */
gts[6] = "A/C/G/T";
gts[11] = "A/A/C/G/T";
gts[15] = "A/A/A/C/G/T";
gts[16] = "A/A/C/C/G/T";
gts[24] = "A/A/A/A/C/G/T";
gts[25] = "A/A/A/C/C/G/T";
gts[26] = "A/A/C/C/G/G/T";
// }
} else if(nucs[2] == 3){
/* A/C/T Tri-allelic */
gts[3] = "A/C/T";
gts[5] = "A/A/C/T";
gts[9] = "A/A/A/C/T";
gts[10] = "A/A/C/C/T";
gts[13] = "A/A/A/A/C/T";
gts[14] = "A/A/A/C/C/T";
gts[20] = "A/A/A/A/A/C/T";
gts[21] = "A/A/A/A/C/C/T";
gts[22] = "A/A/A/C/C/C/T";
gts[23] = "A/A/A/C/C/T/T";
/* A/C/T/G Tetra-allelic */
gts[6] = "A/C/T/G";
gts[11] = "A/A/C/T/G";
gts[15] = "A/A/A/C/T/G";
gts[16] = "A/A/C/C/T/G";
gts[24] = "A/A/A/A/C/T/G";
gts[25] = "A/A/A/C/C/T/G";
gts[26] = "A/A/C/C/T/T/G";
}
} else if(nucs[1] == 2){
/* Bi-allelic */
gts[1] = "A/G";
gts[2] = "A/A/G";
gts[4] = "A/A/A/G";
gts[7] = "A/A/A/A/G";
gts[8] = "A/A/A/G/G";
gts[12] = "A/A/A/A/A/G";
gts[17] = "A/A/A/A/A/A/G";
gts[18] = "A/A/A/A/A/G/G";
gts[19] = "A/A/A/A/G/G/G";
if(nucs[2] == 1){
/* Tri-allelic */
gts[3] = "A/G/C";
gts[5] = "A/A/G/C";
gts[9] = "A/A/A/G/C";
gts[10] = "A/A/G/G/C";
gts[13] = "A/A/A/A/G/C";
gts[14] = "A/A/A/G/G/C";
gts[20] = "A/A/A/A/A/G/C";
gts[21] = "A/A/A/A/G/G/C";
gts[22] = "A/A/A/G/G/G/C";
gts[23] = "A/A/A/G/G/C/C";
/* Tetra-allelic */
gts[6] = "A/G/C/T";
gts[11] = "A/A/G/C/T";
gts[15] = "A/A/A/G/C/T";
gts[16] = "A/A/G/G/C/T";
gts[24] = "A/A/A/A/G/C/T";
gts[25] = "A/A/A/G/G/C/T";
gts[26] = "A/A/G/G/C/C/T";
} else if(nucs[2] == 3){
/* Tri-allelic */
gts[3] = "A/G/T";
gts[5] = "A/A/G/T";
gts[9] = "A/A/A/G/T";
gts[10] = "A/A/G/G/T";
gts[13] = "A/A/A/A/G/T";
gts[14] = "A/A/A/G/G/T";
gts[20] = "A/A/A/A/A/G/T";
gts[21] = "A/A/A/A/G/G/T";
gts[22] = "A/A/A/G/G/G/T";
gts[23] = "A/A/A/G/G/T/T";
/* Tetra-allelic */
gts[6] = "A/G/T/C";
gts[11] = "A/A/G/T/C";
gts[15] = "A/A/A/G/T/C";
gts[16] = "A/A/G/G/T/C";
gts[24] = "A/A/A/A/G/T/C";
gts[25] = "A/A/A/G/G/T/C";
gts[26] = "A/A/G/G/T/T/C";
}
} else if(nucs[1] == 3){
/* Bi-allelic */
gts[1] = "A/T";
gts[2] = "A/A/T";
gts[4] = "A/A/A/T";
gts[7] = "A/A/A/A/T";
gts[8] = "A/A/A/T/T";
gts[12] = "A/A/A/A/A/T";
gts[17] = "A/A/A/A/A/A/T";
gts[18] = "A/A/A/A/A/T/T";
gts[19] = "A/A/A/A/T/T/T";
if(nucs[2] == 1){
/* Tri-allelic */
gts[3] = "A/T/C";
gts[5] = "A/A/T/C";
gts[9] = "A/A/A/T/C";
gts[10] = "A/A/T/T/C";
gts[13] = "A/A/A/A/T/C";
gts[14] = "A/A/A/T/T/C";
gts[20] = "A/A/A/A/A/T/C";
gts[21] = "A/A/A/A/T/T/C";
gts[22] = "A/A/A/T/T/T/C";
gts[23] = "A/A/A/T/T/C/C";
/* Tetra-allelic */
gts[6] = "A/T/C/G";
gts[11] = "A/A/T/C/G";
gts[15] = "A/A/A/T/C/G";
gts[16] = "A/A/T/T/C/G";
gts[24] = "A/A/A/A/T/C/G";
gts[25] = "A/A/A/T/T/C/G";
gts[26] = "A/A/T/T/C/C/G";
} else if(nucs[2] == 2){
/* Tri-allelic */
gts[3] = "A/T/G";
gts[5] = "A/A/T/G";
gts[9] = "A/A/A/T/G";
gts[10] = "A/A/T/T/G";
gts[13] = "A/A/A/A/T/G";
gts[14] = "A/A/A/T/T/G";
gts[20] = "A/A/A/A/A/T/G";
gts[21] = "A/A/A/A/T/T/G";
gts[22] = "A/A/A/T/T/T/G";
gts[23] = "A/A/A/T/T/G/G";
/* Tetra-allelic */
gts[6] = "A/T/G/C";
gts[11] = "A/A/T/G/C";
gts[15] = "A/A/A/T/G/C";
gts[16] = "A/A/T/T/G/C";
gts[24] = "A/A/A/A/T/G/C";
gts[25] = "A/A/A/T/T/G/C";
gts[26] = "A/A/T/T/G/G/C";
}
}
} else if (nucs[0] == 1) {
gts[0] = "C/C";
if(nucs[1] == 0){
/* Bi-allelic */
gts[1] = "C/A";
gts[2] = "C/C/A";
gts[4] = "C/C/C/A";
gts[7] = "C/C/C/C/A";
gts[8] = "C/C/C/A/A";
gts[12] = "C/C/C/C/C/A";
gts[17] = "C/C/C/C/C/C/A";
gts[18] = "C/C/C/C/C/A/A";
gts[19] = "C/C/C/C/A/A/A";
if(nucs[2] == 2){
/* Tri-allelic */
gts[3] = "C/A/G";
gts[5] = "C/C/A/G";
gts[9] = "C/C/C/A/G";
gts[10] = "C/C/A/A/G";
gts[13] = "C/C/C/C/A/G";
gts[14] = "C/C/C/A/A/G";
gts[20] = "C/C/C/C/C/A/G";
gts[21] = "C/C/C/C/A/A/G";
gts[22] = "C/C/C/A/A/A/G";
gts[23] = "C/C/C/A/A/G/G";
/* Tetra-allelic */
gts[6] = "C/A/G/T";
gts[11] = "C/C/A/G/T";
gts[15] = "C/C/C/A/G/T";
gts[16] = "C/C/A/A/G/T";
gts[24] = "C/C/C/C/A/G/T";
gts[25] = "C/C/C/A/A/G/T";
gts[26] = "C/C/A/A/G/G/T";
} else if(nucs[2] == 3){
/* Tri-allelic */
gts[3] = "C/A/T";
gts[5] = "C/C/A/T";
gts[9] = "C/C/C/A/T";
gts[10] = "C/C/A/A/T";
gts[13] = "C/C/C/C/A/T";
gts[14] = "C/C/C/A/A/T";
gts[20] = "C/C/C/C/C/A/T";
gts[21] = "C/C/C/C/A/A/T";
gts[22] = "C/C/C/A/A/A/T";
gts[23] = "C/C/C/A/A/T/T";
/* Tetra-allelic */
gts[6] = "C/A/T/G";
gts[11] = "C/C/A/T/G";
gts[15] = "C/C/C/A/T/G";
gts[16] = "C/C/A/A/T/G";
gts[24] = "C/C/C/C/A/T/G";
gts[25] = "C/C/C/A/A/T/G";
gts[26] = "C/C/A/A/T/T/G";
}
} else if(nucs[1] == 2){
/* Bi-allelic */
gts[1] = "C/G";
gts[2] = "C/C/G";
gts[4] = "C/C/C/G";
gts[7] = "C/C/C/C/G";
gts[8] = "C/C/C/G/G";
gts[12] = "C/C/C/C/C/G";
gts[17] = "C/C/C/C/C/C/G";
gts[18] = "C/C/C/C/C/G/G";
gts[19] = "C/C/C/C/G/G/G";
if(nucs[2] == 0){
/* Tri-allelic */
gts[3] = "C/G/A";
gts[5] = "C/C/G/A";
gts[9] = "C/C/C/G/A";
gts[10] = "C/C/G/G/A";
gts[13] = "C/C/C/C/G/A";
gts[14] = "C/C/C/G/G/A";
gts[20] = "C/C/C/C/C/G/A";
gts[20] = "C/C/C/C/C/G/A";
gts[21] = "C/C/C/C/G/G/A";
gts[22] = "C/C/C/G/G/G/A";
gts[23] = "C/C/C/G/G/A/A";
/* Tetra-allelic */
gts[6] = "C/G/A/T";
gts[11] = "C/C/G/A/T";
gts[15] = "C/C/C/G/A/T";
gts[16] = "C/C/G/G/A/T";
gts[24] = "C/C/C/C/G/A/T";
gts[25] = "C/C/C/G/G/A/T";
gts[26] = "C/C/G/G/A/A/T";
} else if(nucs[2] == 3){
/* Tri-allelic */
gts[3] = "C/G/T";
gts[5] = "C/C/G/T";
gts[9] = "C/C/C/G/T";
gts[10] = "C/C/G/G/T";
gts[13] = "C/C/C/C/G/T";
gts[14] = "C/C/C/G/G/T";
gts[20] = "C/C/C/C/C/G/T";
gts[21] = "C/C/C/C/G/G/T";
gts[22] = "C/C/C/G/G/G/T";
gts[23] = "C/C/C/G/G/T/T";
/* Tetra-allelic */
gts[6] = "C/G/T/A";
gts[11] = "C/C/G/T/A";
gts[15] = "C/C/C/G/T/A";
gts[16] = "C/C/G/G/T/A";
gts[24] = "C/C/C/C/G/T/A";
gts[25] = "C/C/C/G/G/T/A";
gts[26] = "C/C/G/G/T/T/A";
}
} else if(nucs[1] == 3){
/* Bi-allelic */
gts[1] = "C/T";
gts[2] = "C/C/T";
gts[4] = "C/C/C/T";
gts[7] = "C/C/C/C/T";
gts[8] = "C/C/C/T/T";
gts[12] = "C/C/C/C/C/T";
gts[17] = "C/C/C/C/C/C/T";
gts[18] = "C/C/C/C/C/T/T";
gts[19] = "C/C/C/C/T/T/T";
if(nucs[2] == 0){
/* Tri-allelic */
gts[3] = "C/T/A";
gts[5] = "C/C/T/A";
gts[9] = "C/C/C/T/A";
gts[10] = "C/C/T/T/A";
gts[13] = "C/C/C/C/T/A";
gts[14] = "C/C/C/T/T/A";
gts[20] = "C/C/C/C/C/T/A";
gts[21] = "C/C/C/C/T/T/A";
gts[22] = "C/C/C/T/T/T/A";
gts[23] = "C/C/C/T/T/A/A";
/* Tetra-allelic */
gts[6] = "C/T/A/G";
gts[11] = "C/C/T/A/G";
gts[15] = "C/C/C/T/A/G";
gts[16] = "C/C/T/T/A/G";
gts[24] = "C/C/C/C/T/A/G";
gts[25] = "C/C/C/T/T/A/G";
gts[26] = "C/C/T/T/A/A/G";
} else if(nucs[2] == 2){
/* Tri-allelic */
gts[3] = "C/T/G";
gts[5] = "C/C/T/G";
gts[9] = "C/C/C/T/G";
gts[10] = "C/C/T/T/G";
gts[13] = "C/C/C/C/T/G";
gts[14] = "C/C/C/T/T/G";
gts[20] = "C/C/C/C/C/T/G";
gts[21] = "C/C/C/C/T/T/G";
gts[22] = "C/C/C/T/T/T/G";
gts[23] = "C/C/C/T/T/G/G";
/* Tetra-allelic */
gts[6] = "C/T/G/A";
gts[11] = "C/C/T/G/A";
gts[15] = "C/C/C/T/G/A";
gts[16] = "C/C/T/T/G/A";
gts[24] = "C/C/C/C/T/G/A";
gts[25] = "C/C/C/T/T/G/A";
gts[26] = "C/C/T/T/G/G/A";
}
}
} else if (nucs[0] == 2) {
gts[0] = "G/G";
if(nucs[1] == 0){
/* Bi-allelic */
gts[1] = "G/A";
gts[2] = "G/G/A";
gts[4] = "G/G/G/A";
gts[7] = "G/G/G/G/A";
gts[8] = "G/G/G/A/A";
gts[12] = "G/G/G/G/G/A";
gts[17] = "G/G/G/G/G/G/A";
gts[18] = "G/G/G/G/G/A/A";
gts[19] = "G/G/G/G/A/A/A";
if(nucs[2] == 1){
/* Tri-allelic */
gts[3] = "G/A/C";
gts[5] = "G/G/A/C";
gts[9] = "G/G/G/A/C";
gts[10] = "G/G/A/A/C";
gts[13] = "G/G/G/G/A/C";
gts[14] = "G/G/G/A/A/C";
gts[20] = "G/G/G/G/G/A/C";
gts[21] = "G/G/G/G/A/A/C";
gts[22] = "G/G/G/A/A/A/C";
gts[23] = "G/G/G/A/A/C/C";
/* Tetra-allelic */
gts[6] = "G/A/C/T";
gts[11] = "G/G/A/C/T";
gts[15] = "G/G/G/A/C/T";
gts[16] = "G/G/A/A/C/T";
gts[24] = "G/G/G/G/A/C/T";
gts[25] = "G/G/G/A/A/C/T";
gts[26] = "G/G/A/A/C/C/T";
} else if(nucs[2] == 3){
/* Tri-allelic */
gts[3] = "G/A/T";
gts[5] = "G/G/A/T";
gts[9] = "G/G/G/A/T";
gts[10] = "G/G/A/A/T";
gts[13] = "G/G/G/G/A/T";
gts[14] = "G/G/G/A/A/T";
gts[20] = "G/G/G/G/G/A/T";
gts[21] = "G/G/G/G/A/A/T";
gts[22] = "G/G/G/A/A/A/T";
gts[23] = "G/G/G/A/A/T/T";
/* Tetra-allelic */
gts[6] = "G/A/T/C";
gts[11] = "G/G/A/T/C";
gts[15] = "G/G/G/A/T/C";
gts[16] = "G/G/A/A/T/C";
gts[24] = "G/G/G/G/A/T/C";
gts[25] = "G/G/G/A/A/T/C";
gts[26] = "G/G/A/A/T/T/C";
}
} else if(nucs[1] == 1){
/* Bi-allelic */
gts[1] = "G/C";
gts[2] = "G/G/C";
gts[4] = "G/G/G/C";
gts[7] = "G/G/G/G/C";
gts[8] = "G/G/G/C/C";
gts[12] = "G/G/G/G/G/C";
gts[17] = "G/G/G/G/G/G/C";
gts[18] = "G/G/G/G/G/C/C";
gts[19] = "G/G/G/G/C/C/C";
if(nucs[2] == 0){
/* Tri-allelic */
gts[3] = "G/C/A";
gts[5] = "G/G/C/A";
gts[9] = "G/G/G/C/A";
gts[10] = "G/G/C/C/A";
gts[13] = "G/G/G/G/C/A";
gts[14] = "G/G/G/C/C/A";
gts[20] = "G/G/G/G/G/C/A";
gts[21] = "G/G/G/G/C/C/A";
gts[22] = "G/G/G/C/C/C/A";
gts[23] = "G/G/G/C/C/A/A";
/* Tetra-allelic */
gts[6] = "G/C/A/T";
gts[11] = "G/G/C/A/T";
gts[15] = "G/G/G/C/A/T";
gts[16] = "G/G/C/C/A/T";
gts[24] = "G/G/G/G/C/A/T";
gts[25] = "G/G/G/C/C/A/T";
gts[26] = "G/G/C/C/A/A/T";
} else if(nucs[2] == 3){
/* Tri-allelic */
gts[3] = "G/C/T";
gts[5] = "G/G/C/T";
gts[9] = "G/G/G/C/T";
gts[10] = "G/G/C/C/T";
gts[13] = "G/G/G/G/C/T";
gts[14] = "G/G/G/C/C/T";
gts[20] = "G/G/G/G/G/C/T";
gts[21] = "G/G/G/G/C/C/T";
gts[22] = "G/G/G/C/C/C/T";
gts[23] = "G/G/G/C/C/T/T";
/* Tetra-allelic */
gts[6] = "G/C/T/A";
gts[11] = "G/G/C/T/A";
gts[15] = "G/G/G/C/T/A";
gts[16] = "G/G/C/C/T/A";
gts[24] = "G/G/G/G/C/T/A";
gts[25] = "G/G/G/C/C/T/A";
gts[26] = "G/G/C/C/T/T/A";
}
} else if(nucs[1] == 3){
/* Bi-allelic */
gts[1] = "G/T";
gts[2] = "G/G/T";
gts[4] = "G/G/G/T";
gts[7] = "G/G/G/G/T";
gts[8] = "G/G/G/T/T";
gts[12] = "G/G/G/G/G/T";
gts[17] = "G/G/G/G/G/G/T";
gts[18] = "G/G/G/G/G/T/T";
gts[19] = "G/G/G/G/T/T/T";
if(nucs[2] == 0){
/* Tri-allelic */
gts[3] = "G/T/A";
gts[5] = "G/G/T/A";
gts[9] = "G/G/G/T/A";
gts[10] = "G/G/T/T/A";
gts[13] = "G/G/G/G/T/A";
gts[14] = "G/G/G/T/T/A";
gts[20] = "G/G/G/G/G/T/A";
gts[21] = "G/G/G/G/T/T/A";
gts[22] = "G/G/G/T/T/T/A";
gts[23] = "G/G/G/T/T/A/A";
/* Tetra-allelic */
gts[6] = "G/T/A/C";
gts[11] = "G/G/T/A/C";
gts[15] = "G/G/G/T/A/C";
gts[16] = "G/G/T/T/A/C";
gts[24] = "G/G/G/G/T/A/C";
gts[25] = "G/G/G/T/T/A/C";
gts[26] = "G/G/T/T/A/A/C";
} else if(nucs[2] == 1){
/* Tri-allelic */
gts[3] = "G/T/C";
gts[5] = "G/G/T/C";
gts[9] = "G/G/G/T/C";
gts[10] = "G/G/T/T/C";
gts[13] = "G/G/G/G/T/C";
gts[14] = "G/G/G/T/T/C";
gts[20] = "G/G/G/G/G/T/C";
gts[21] = "G/G/G/G/T/T/C";
gts[22] = "G/G/G/T/T/T/C";
gts[23] = "G/G/G/T/T/C/C";
/* Tetra-allelic */
gts[6] = "G/T/C/A";
gts[11] = "G/G/T/C/A";
gts[15] = "G/G/G/T/C/A";
gts[16] = "G/G/T/T/C/A";
gts[24] = "G/G/G/G/T/C/A";
gts[25] = "G/G/G/T/T/C/A";
gts[26] = "G/G/T/T/C/C/A";
}
}
} else if (nucs[0] == 3) {
gts[0] = "T/T";
if(nucs[1] == 0){
/* Bi-allelic */
gts[1] = "T/A";
gts[2] = "T/T/A";
gts[4] = "T/T/T/A";
gts[7] = "T/T/T/T/A";
gts[8] = "T/T/T/A/A";
gts[12] = "T/T/T/T/T/A";
gts[17] = "T/T/T/T/T/T/A";
gts[18] = "T/T/T/T/T/A/A";
gts[19] = "T/T/T/T/A/A/A";
if(nucs[2] == 1){
/* Tri-allelic */
gts[3] = "T/A/C";
gts[5] = "T/T/A/C";
gts[9] = "T/T/T/A/C";
gts[10] = "T/T/A/A/C";
gts[13] = "T/T/T/T/A/C";
gts[14] = "T/T/T/A/A/C";
gts[20] = "T/T/T/T/T/A/C";
gts[21] = "T/T/T/T/A/A/C";
gts[22] = "T/T/T/A/A/A/C";
gts[23] = "T/T/T/A/A/C/C";
/* Tetra-allelic */
gts[6] = "T/A/C/G";
gts[11] = "T/T/A/C/G";
gts[15] = "T/T/T/A/C/G";
gts[16] = "T/T/A/A/C/G";
gts[24] = "T/T/T/T/A/C/G";
gts[25] = "T/T/T/A/A/C/G";
gts[26] = "T/T/A/A/C/C/G";
} else if(nucs[2] == 2){
/* Tri-allelic */
gts[3] = "T/A/G";
gts[5] = "T/T/A/G";
gts[9] = "T/T/T/A/G";
gts[10] = "T/T/A/A/G";
gts[13] = "T/T/T/T/A/G";
gts[14] = "T/T/T/A/A/G";
gts[20] = "T/T/T/T/T/A/G";
gts[21] = "T/T/T/T/A/A/G";
gts[22] = "T/T/T/A/A/A/G";
gts[23] = "T/T/T/A/A/G/G";
/* Tetra-allelic */
gts[6] = "T/A/G/C";
gts[11] = "T/T/A/G/C";
gts[15] = "T/T/T/A/G/C";
gts[16] = "T/T/A/A/G/C";
gts[24] = "T/T/T/T/A/G/C";
gts[25] = "T/T/T/A/A/G/C";
gts[26] = "T/T/A/A/G/G/C";
}
} else if(nucs[1] == 1){
/* Bi-allelic */
gts[1] = "T/C";
gts[2] = "T/T/C";
gts[4] = "T/T/T/C";
gts[7] = "T/T/T/T/C";
gts[8] = "T/T/T/C/C";
gts[12] = "T/T/T/T/T/C";
gts[17] = "T/T/T/T/T/T/C";
gts[18] = "T/T/T/T/T/C/C";
gts[19] = "T/T/T/T/C/C/C";
if(nucs[2] == 0){
/* Tri-allelic */
gts[3] = "T/C/A";
gts[5] = "T/T/C/A";
gts[9] = "T/T/T/C/A";
gts[10] = "T/T/C/C/A";
gts[13] = "T/T/T/T/C/A";
gts[14] = "T/T/T/C/C/A";
gts[20] = "T/T/T/T/T/C/A";
gts[21] = "T/T/T/T/C/C/A";
gts[22] = "T/T/T/C/C/C/A";
gts[23] = "T/T/T/C/C/A/A";
/* Tetra-allelic */
gts[6] = "T/C/A/G";
gts[11] = "T/T/C/A/G";
gts[15] = "T/T/T/C/A/G";
gts[16] = "T/T/C/C/A/G";
gts[24] = "T/T/T/T/C/A/G";
gts[25] = "T/T/T/C/C/A/G";
gts[26] = "T/T/C/C/A/A/G";
} else if(nucs[2] == 2){
/* Tri-allelic */
gts[3] = "T/C/G";
gts[3] = "T/C/G";
gts[5] = "T/T/C/G";
gts[9] = "T/T/T/C/G";
gts[10] = "T/T/C/C/G";
gts[13] = "T/T/T/T/C/G";
gts[14] = "T/T/T/C/C/G";
gts[20] = "T/T/T/T/T/C/G";
gts[21] = "T/T/T/T/C/C/G";
gts[22] = "T/T/T/C/C/C/G";
gts[23] = "T/T/T/C/C/G/G";
/* Tetra-allelic */
gts[6] = "T/C/G/A";
gts[11] = "T/T/C/G/A";
gts[15] = "T/T/T/C/G/A";
gts[16] = "T/T/C/C/G/A";
gts[24] = "T/T/T/T/C/G/A";
gts[25] = "T/T/T/C/C/G/A";
gts[26] = "T/T/C/C/G/G/A";
}
} else if(nucs[1] == 2){
/* Bi-allelic */
gts[1] = "T/G";
gts[2] = "T/T/G";
gts[4] = "T/T/T/G";
gts[7] = "T/T/T/T/G";
gts[8] = "T/T/T/G/G";
gts[12] = "T/T/T/T/T/G";
gts[17] = "T/T/T/T/T/T/G";
gts[18] = "T/T/T/T/T/G/G";
gts[19] = "T/T/T/T/G/G/G";
if(nucs[2] == 0){
/* Tri-allelic */
gts[3] = "T/G/A";
gts[5] = "T/T/G/A";
gts[9] = "T/T/T/G/A";
gts[10] = "T/T/G/G/A";
gts[13] = "T/T/T/T/G/A";
gts[14] = "T/T/T/G/G/A";
gts[20] = "T/T/T/T/T/G/A";
gts[21] = "T/T/T/T/G/G/A";
gts[22] = "T/T/T/G/G/G/A";
gts[23] = "T/T/T/G/G/A/A";
/* Tetra-allelic */
gts[6] = "T/G/A/C";
gts[11] = "T/T/G/A/C";
gts[15] = "T/T/T/G/A/C";
gts[16] = "T/T/G/G/A/C";
gts[24] = "T/T/T/T/G/A/C";
gts[25] = "T/T/T/G/G/A/C";
gts[26] = "T/T/G/G/A/A/C";
} else if(nucs[2] == 1){
/* Tri-allelic */
gts[3] = "T/G/C";
gts[3] = "T/G/C";
gts[5] = "T/T/G/C";
gts[9] = "T/T/T/G/C";
gts[10] = "T/T/G/G/C";
gts[13] = "T/T/T/T/G/C";
gts[14] = "T/T/T/G/G/C";
gts[20] = "T/T/T/T/T/G/C";
gts[21] = "T/T/T/T/G/G/C";
gts[22] = "T/T/T/G/G/G/C";
gts[23] = "T/T/T/G/G/C/C";
/* Tetra-allelic */
gts[6] = "T/G/C/A";
gts[11] = "T/T/G/C/A";
gts[15] = "T/T/T/G/C/A";
gts[16] = "T/T/G/G/C/A";
gts[24] = "T/T/T/T/G/C/A";
gts[25] = "T/T/T/G/G/C/A";
gts[26] = "T/T/G/G/C/C/A";
}
}
}
/*
cout << "*** Debug int_to_nucs ***";
cout << "\n";
cout << nucs[0] << "," << nucs[1] << "," << nucs[2]<< "," << nucs[3];
cout << "\n";
cout << gts[0] << "," << gts[1];
cout << "\n";
*/
// cout << "\n";
}
/* Create type and function to help sort nucleotides. */
typedef std::pair<int,int> mypair;
bool comparator ( const mypair& l, const mypair& r)
{ return l.first > r.first; }
//void counts_2_plh(int mlhs[51], int nuc_cnts[8], float error, int min_cnt, int debug=0){
//void counts_2_plh(int mlhs[27], int nuc_cnts[8], float error, int debug=0){
void counts_2_plh(int& mlhs, string& gt, int nuc_cnts[8], float error,
int min_count, int max_count, int debug=0){
/* Add forward and reverse counts. */
int nuc_cnt[4];
nuc_cnt[0] = nuc_cnts[0] + nuc_cnts[1];
nuc_cnt[1] = nuc_cnts[2] + nuc_cnts[3];
nuc_cnt[2] = nuc_cnts[4] + nuc_cnts[5];
nuc_cnt[3] = nuc_cnts[6] + nuc_cnts[7];
/* Sum total coverage. */
int total_cov = nuc_cnt[0] + nuc_cnt[1] + nuc_cnt[2] + nuc_cnt[3];
/* Apply minimum threshold */
for(int i=0; i < 4; i++){
if(nuc_cnt[i] < min_count){nuc_cnt[i] = 0;}
}
/* Sort nucleotide counts. */
vector<pair<int,int>> moves = {
{nuc_cnt[0], 0},
{nuc_cnt[1], 1},
{nuc_cnt[2], 2},
{nuc_cnt[3], 3}
};
std::sort(moves.begin(), moves.end(), comparator);
/* Possible ways to obtain observed counts */
double poss_counts = possible_counts(nuc_cnt);
/* --*-- --*-- --*-- */
/* Models. */
/* --*-- --*-- --*-- */
/* Likelihoods. */
float mls [27];
for(int j=0; j<27; j++){mls[j]=0;}
/* Homozygote. */
mls[0] = poss_counts *
pow(1-(3*error)/4, moves[0].first) *
pow(error/4, moves[1].first+moves[2].first+moves[3].first);
/* Bi-allelic heterozygote. */
mls[1] = poss_counts *
pow(0.5-error/4, moves[0].first+moves[1].first) *
pow(error/4, moves[2].first+moves[3].first);
/* Bi-allelic triploid. */
float prop3 = 0.3333333;
float prop6 = 0.6666667;
mls[2] = poss_counts *
pow(0.6666667-error/4, moves[0].first) *
pow(0.3333333-error/4, moves[1].first) *
pow(error/4, moves[2].first+moves[3].first);
/* Tri-allelic triploid loci. */
mls[3] = poss_counts *
pow(0.3333333-error/4, moves[0].first+moves[1].first+moves[2].first) *
pow(error/4, moves[3].first);
/* Bi-allelic tetraploid loci */
mls[4] = poss_counts *
pow(0.75-error/4, moves[0].first) *
pow(0.25-error/4, moves[1].first) *
pow(error/4, moves[2].first+moves[3].first);
/* Tri-allelic tetraploid loci */
mls[5] = poss_counts *
pow(0.5-error/4, moves[0].first) *
pow(0.25-error/4, moves[1].first) *
pow(0.25-error/4, moves[2].first) *
pow(error/4, moves[3].first);
/* Tetra-allelic tetraploid loci */
mls[6] = poss_counts *
pow(0.25-error/4, moves[0].first) *
pow(0.25-error/4, moves[1].first) *
pow(0.25-error/4, moves[2].first) *
pow(0.25-error/4, moves[3].first);
/* Bi-allelic pentaploid */
mls[7] = poss_counts *
pow(0.8-error/4, moves[0].first) *
pow(0.2-error/4, moves[1].first) *
pow(error/4, moves[2].first+moves[3].first);
mls[8] = poss_counts *
pow(0.6-error/4, moves[0].first) *
pow(0.4-error/4, moves[1].first) *
pow(error/4, moves[2].first+moves[3].first);
/* Tri-allelic pentaploid */
mls[9] = poss_counts *
pow(0.6-error/4, moves[0].first) *
pow(0.2-error/4, moves[1].first) *
pow(0.2-error/4, moves[1].first) *
pow(error/4, moves[3].first);
mls[10] = poss_counts *
pow(0.4-error/4, moves[0].first) *
pow(0.4-error/4, moves[1].first) *
pow(0.2-error/4, moves[1].first) *
pow(error/4, moves[3].first);
/* Tetra-allelic pentaploid */
mls[11] = poss_counts *
pow(0.4-error/4, moves[0].first) *
pow(0.2-error/4, moves[1].first) *
pow(0.2-error/4, moves[2].first) *
pow(0.2-error/4, moves[3].first);
/* Bi-allelic hexaploid */
mls[12] = poss_counts *
pow(0.8333333-error/4, moves[0].first) *
pow(0.1666667-error/4, moves[1].first) *
pow(error/4, moves[2].first+moves[3].first);
/* Tri-allelic hexaploid */
mls[13] = poss_counts *
pow(0.6666667-error/4, moves[0].first) *
pow(0.1666667-error/4, moves[1].first) *
pow(0.1666667-error/4, moves[1].first) *
pow(error/4, moves[3].first);
mls[14] = poss_counts *
pow(0.5-error/4, moves[0].first) *
pow(0.3333333-error/4, moves[1].first) *
pow(0.1666667-error/4, moves[1].first) *
pow(error/4, moves[3].first);
/* Tetra-allelic hexaploid */
mls[15] = poss_counts *
pow(0.5-error/4, moves[0].first) *
pow(0.1666667-error/4, moves[1].first) *
pow(0.1666667-error/4, moves[2].first) *
pow(0.1666667-error/4, moves[3].first);
mls[16] = poss_counts *
pow(0.3333333-error/4, moves[0].first) *
pow(0.3333333-error/4, moves[1].first) *
pow(0.1666667-error/4, moves[2].first) *
pow(0.1666667-error/4, moves[3].first);
/* Bi-allelic septaploid */
mls[17] = poss_counts *
pow(0.8571429-error/4, moves[0].first) *
pow(0.1428571-error/4, moves[1].first) *
pow(error/4, moves[2].first+moves[3].first);
mls[18] = poss_counts *
pow(0.7142857-error/4, moves[0].first) *
pow(0.2857143-error/4, moves[1].first) *
pow(error/4, moves[2].first+moves[3].first);
mls[19] = poss_counts *
pow(0.5714286-error/4, moves[0].first) *
pow(0.4285714-error/4, moves[1].first) *
pow(error/4, moves[2].first+moves[3].first);
/* Tri-allelic septaploid */
mls[20] = poss_counts *
pow(0.7142857-error/4, moves[0].first) *
pow(0.1428571-error/4, moves[1].first) *
pow(0.1428571-error/4, moves[1].first) *
pow(error/4, moves[3].first);
mls[21] = poss_counts *
pow(0.5714286-error/4, moves[0].first) *
pow(0.2857143-error/4, moves[1].first) *
pow(0.1428571-error/4, moves[1].first) *
pow(error/4, moves[3].first);
mls[22] = poss_counts *
pow(0.4285714-error/4, moves[0].first) *
pow(0.4285714-error/4, moves[1].first) *
pow(0.1428571-error/4, moves[1].first) *
pow(error/4, moves[3].first);
mls[23] = poss_counts *
pow(0.4285714-error/4, moves[0].first) *
pow(0.2857143-error/4, moves[1].first) *
pow(0.2857143-error/4, moves[1].first) *
pow(error/4, moves[3].first);
/* Tetra-allelic septaploid */
mls[24] = poss_counts *
pow(0.5714286-error/4, moves[0].first) *
pow(0.1428571-error/4, moves[1].first) *
pow(0.1428571-error/4, moves[2].first) *
pow(0.1428571-error/4, moves[3].first);
mls[25] = poss_counts *
pow(0.4285714-error/4, moves[0].first) *
pow(0.2857143-error/4, moves[1].first) *
pow(0.1428571-error/4, moves[2].first) *
pow(0.1428571-error/4, moves[3].first);
mls[26] = poss_counts *
pow(0.2857143-error/4, moves[0].first) *
pow(0.2857143-error/4, moves[1].first) *
pow(0.2857143-error/4, moves[2].first) *
pow(0.1428571-error/4, moves[3].first);
/* Convert ints to nucleotides */
string gts[27];
int_to_nucs(gts, moves);
/* Identify genotype with the maximum likelihood. */
int maxl = 0;
float suml = mls[0];
for (int j = 1; j < 27; j++){
if(mls[j] > mls[maxl]){
maxl = j;
}
suml = suml + mls[j];
}
/* Phred scale the likelihoods. */
for (int j = 0; j < 27; j++){
if (mls[j] == 0){
mls[j] = 9999;
} else {
mls[j] = trunc(-10 * log10(mls[j]));
if(mls[j] == -0){mls[j] = 0;}
}
}
/* Debuging */
// debug = 1;
if(debug == 1){
cout << "\n";
cout << "*** Debug counts_2_phredlh ***\n";
cout << "Counts: " << nuc_cnt[0] << "," << nuc_cnt[1] << "," << nuc_cnt[2]<< "," << nuc_cnt[3];
cout << "\n";
cout << "possible counts=" << poss_counts;
cout << "\n";
cout << 0 << "\t" << mls[0] << "\t" << gts[0];
cout << "\n";
for (int j = 1; j < 27; j++){
cout << j << "\t" << mls[j] << "\t" << gts[j];
cout << "\n";
}
cout << "\n";
cout << "Most likely genotype: " << gts[maxl];
cout << "\n";
if(suml >= 27){
cout << "All genotypes equally likely: sum = " << suml;
cout << "\n";
cout << "Set genotype to null: ./.";
cout << "\n";
}
}
/* Transfer values to parent. */
if(suml >= 27){
/* All likelihoods are equal. */
mlhs = int(mls[maxl]);
gt = "./.";
} else if(maxl >= 17){
/* Called genotype is septaploid */
mlhs = int(mls[maxl]);
gt = "./.";
// } else if(nuc_cnt[0] + nuc_cnt[1] + nuc_cnt[2] + nuc_cnt[3] >= max_count){
} else if(total_cov > max_count){
/* Called genotype has coverage above max threshold */
gt = "./.";
} else {
mlhs = int(mls[maxl]);
gt = gts[maxl];
}
}
/* Parse each site to samples */
//void mult_pl(int pls[][27], int nsamp, float err, int nuc_cnts[][8]){
void mult_pl(int pls[], string gts[], int nsamp, float err, int nuc_cnts[][8], vector <int> min_count, vector <int> max_count){
for(int i=0; i<nsamp; i++){
counts_2_plh(pls[i], gts[i], nuc_cnts[i], err, min_count[i], max_count[i]);
}
}
/* Determine if a site is polymorphic */
int site_polymorphic(int nsamp, string gts[]){
// cout << gts[0];
int comp = 0;
if(gts[0] == gts[1]){comp = 1;}
for(int i=1; i<nsamp; i++){
// cout << "," << gts[i];
if(gts[0] == gts[i]){comp = comp + 1;}
// comp = comp + gts[0] == gts[i];
}
// cout << "\n";
// cout << "Comparison = " << comp;
// cout << "; Number of samples = " << nsamp;
// cout << "\n";
// cout << "\n";
if(comp == nsamp){
return(0);
} else {
return(1);
}
}
//int diff_ref(int nsamp, string gts[]){
int diff_ref(string ref, int nsamp, string gts[]){
vector <string> haps;
int gtsum = 0;
for(int i=0; i<nsamp; i++){
if(gts[i] != "./."){
split( haps, gts[i], boost::algorithm::is_any_of( "/" ) );
for(int j=1; j<haps.size(); j++){
if(haps[j] != ref){gtsum++;}
}
}
}
if(gtsum > 0){
return(1);
} else {
return (0);
}
}
/* ----- ----- ***** ----- ----- */
/* Print functions */
/* ----- ----- ***** ----- ----- */
void print_usage(){
cerr << "\n";
cerr << " -c print allele counts in genotpye section.\n";
cerr << " -e allowable genotyping error [default = 1e-9]; must not be zero.\n";
cerr << " -h print this help message.\n";
cerr << " -m print vcf header (meta) information.\n";
cerr << " -p print phred scaled likelihoods in genotype section.\n";
cerr << " -s file with sample names in same order as in\n the s/bam file, one name per line.\n";
cerr << " -t file with lower and upper count thresholds for calling genotypes\n";
cerr << " on row one and two, same number of columns as samples.\n";
cerr << "\n";
cerr << "Expects piped output from SAMTools::mpileup where\n";
cerr << "each sample consists of three columns starting at\n";
cerr << "the fourth column.\n";
cerr << "\n";
}
void print_header(float error, string sfile, string tfile){
vector <string> fields;
cout << "##fileformat=VCFv4.2\n";
cout << "##source=gtV0.0.0\n";
/* Threshold file */
if(tfile != "NA"){
string line;
ifstream myfile (tfile);
if (myfile.is_open())
{
cout << "##FILTER=<ID=NA,Description=\"Lower count threshold for calling genotypes = ";
getline (myfile,line);
split( fields, line, boost::algorithm::is_any_of( "\t " ) );
cout << fields[0];
for(int i=1; i<fields.size(); i++){
cout << "," << fields[i];
}
cout << "\">";
cout << "\n";
cout << "##FILTER=<ID=NA,Description=\"Upper count threshold for calling genotypes = ";
getline (myfile,line);
split( fields, line, boost::algorithm::is_any_of( "\t " ) );
cout << fields[0];
for(int i=1; i<fields.size(); i++){
cout << "," << fields[i];
}
cout << "\">";
cout << "\n";
myfile.close();
}
else cout << "Unable to open file";
}
//
// cout << "\n";
cout << "##FILTER=<ID=NA,Description=\"Error rate of " << error << " used for likelihood calculation\">\n";
cout << "##FORMAT=<ID=RD,Number=1,Type=Integer,Description=\"Read depth\">\n";
cout << "##FORMAT=<ID=CT,Number=8,Type=Integer,Description=\"Count of each nucleotide (A,a,C,c,G,g,T,t)\">\n";
cout << "##FORMAT=<ID=GT,Number=1,Type=String,Description=\"Genotype\">\n";
cout << "##FORMAT=<ID=PL,Number=26,Type=Integer,Description=\"Phred scaled likelihood for 26 genotpyes\">\n";
cout << "#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT";
//
if(sfile != "NA"){
string line;
ifstream myfile (sfile);
if (myfile.is_open())
{
while ( getline (myfile,line) )
{
cout << "\t" << line;
}
myfile.close();
}
else cout << "Unable to open file";
}
//
cout << "\n";
}
void print_fix(vector <string> fields){
cout << fields[0] << "\t" << fields[1] << "\t" << ".";
cout << "\t" << fields[2] << "\t" << ".";
cout << "\t" << "." << "\t" << ".";
cout << "\t" << ".";
}
//void print_locus(vector <string> fields, int counts, int phred, int nsamp, int rds[], int nuc_cnts[][8], int pls[][51], string gts[]){
void print_locus(vector <string> fields, int counts, int phred, int nsamp, int rds[], int nuc_cnts[][8], int pls[], string gts[]){
/* Print fixed portion of locus. */
print_fix(fields);
cout << "\t";
cout << "RD";
if(counts == 1){cout << ":CT";}
if(phred == 1){cout << ":PL";}
cout << ":GT";
for(int i=0; i<nsamp; i++){
cout << "\t";
// Read depth.
cout << rds[i];
// Counts.
if(counts == 1){
cout << ":" << nuc_cnts[i][0];
for(int j=1; j<8; j++){cout << "," << nuc_cnts[i][j];}
}
// Phred-scaled likelihoods.
if(phred == 1){
cout << ":" << pls[i];
// for(int j=1; j<25; j++){cout << "," << pls[i][j];}
}
// Genotype.
cout << ":" << gts[i];
}
cout << "\n";
}
/* ----- ----- ***** ----- ----- */
/* Main */
/* ----- ----- ***** ----- ----- */
int main(int argc, char **argv) {
string lineInput;
vector <string> fields;
vector <int> min_count;
vector <int> max_count;
int opt; // options
int header = 0; // print header/meta data
int counts = 0; // print counts
int phred = 0; // Scale likelihoods as phred values
float error = 0.000000001; // Can not be zero!!!
string sfile = "NA";
string tfile = "NA";
/* Parse command line options. */
// while ((opt = getopt(argc, argv, "ce:hmps:t:")) != -1) {
while ((opt = getopt(argc, argv, "ce:hmps:t:")) != -1) {
switch (opt) {
case 'c': // print counts
counts = 1;
break;
case 'e': // permissible error
error = atof(optarg);
break;
case 'h': // print usage and exit
print_usage();
exit(EXIT_FAILURE);
case 'm': // print header/meta data
header = 1;
break;
case 'p': // phred scale likelihoods
phred = 1;
break;
case 's': // file containing sample names
sfile = optarg;
break;
case 't': // file containing upper and lower count thresholds
tfile = optarg;
break;
default: /* '?' */
fprintf(stderr, "Usage: %s [-ce:hmps]\n", argv[0]);
print_usage();
exit(EXIT_FAILURE);
}
}
/* Print header */
if(header == 1){print_header(error, sfile, tfile);}
/* Read in thresholds */
if(tfile != "NA"){
string line;
ifstream myfile (tfile);
if (myfile.is_open()){
/* Minimum threshold */
getline (myfile,line);
split( fields, line, boost::algorithm::is_any_of( "\t " ) );
for(int i=0; i<fields.size(); i++){
min_count.push_back(stoi(fields[i]));
}
/* Maximum threshold */
getline (myfile,line);
split( fields, line, boost::algorithm::is_any_of( "\t " ) );
for(int i=0; i<fields.size(); i++){
max_count.push_back(stoi(fields[i]));
}
myfile.close();
}
else cout << "Unable to open file";
}
/*
for(int i=0; i < min_count.size(); i++){
cout << min_count[i] << "\t" << max_count[i] << "\n";
}
*/
// }
/* Parse each line (site) by sample (column). */
while (getline(cin,lineInput)) {
split( fields, lineInput, boost::algorithm::is_any_of( "\t " ) );
/* Declare variables */
int nsamp = (fields.size()-3)/3; // Determine the number of samples.
// int nsamp = (fields.size()-2)/2; // Determine the number of samples.
int nuc_cnts [nsamp][8]; // A,a,C,c,G,g,T,t.
int rds [nsamp]; // Read depth.
string gts [nsamp]; // Genotypes.
int pls [nsamp]; // Phred scaled likelihoods.
// int pls [nsamp][27]; // Phred scaled likelihoods.
/* Initialize variables. */
for(int i=0; i<nsamp; i++){
rds[i] = 0;
gts[i] = "./.";
pls[i] = 9999;
if(tfile == "NA"){
min_count.push_back(0);
max_count.push_back(10000000);
}
}
/* Process each sample in the line. */
int sampn = -1; // sample counter.
for(int i = 4; i <= fields.size(); i++){
if((i-1) % 3 == 0){
/* New sample */
sampn++;
// cout << "Processing sample " << sampn << "\n";
for(int j=0; j<8; j++){nuc_cnts[sampn][j] = 0;}
if(fields[i] == "*"){
// cout << fields[i] << ": no data string\n";
// No data.
//for(int j=0; j<8; j++){nuc_cnts[sampn][j] = 0;}
} else {
// Count each nucleotide.
// cout << fields[i] << ": count string\n";
if(fields[2] == "A"){refA(fields[i], sampn, nuc_cnts);}
if(fields[2] == "C"){refC(fields[i], sampn, nuc_cnts);}
if(fields[2] == "G"){refG(fields[i], sampn, nuc_cnts);}
if(fields[2] == "T"){refT(fields[i], sampn, nuc_cnts);}
}
}
}
/* Get read depths */
get_rd(rds, nsamp, nuc_cnts);
/* Calculate Phred-scaled likelihoods */
// mult_pl(pls, nsamp, error, nuc_cnts, min_cnt);
// string gts[27];
// mult_pl(pls, nsamp, error, nuc_cnts);
mult_pl(pls, gts, nsamp, error, nuc_cnts, min_count, max_count);
/*
cout << gts[0];
for(int j=1; j<nsamp; j++){
cout << "," << gts[j];
}
cout << "\n";
cout << pls[0];
for(int j=1; j<nsamp; j++){
cout << "," << pls[j];
}
cout << "\n";
*/
/* Print locus. */
// int unique_gt = site_polymorphic(nsamp, gts);
int unique_gt = diff_ref(fields[2], nsamp, gts);
// int unique_gt = diff_ref(nsamp, gts);
// print_locus(fields, counts, phred, nsamp, rds, nuc_cnts, pls, gts);
if(unique_gt == 1){
print_locus(fields, counts, phred, nsamp, rds, nuc_cnts, pls, gts);
/* Debug */
// debug1(fields, counts, phred, nsamp, rds, nuc_cnts, pls, gts, error, min_cnt);
}
}
return 0;
}
/* ----- ----- ***** ----- ----- */
// EOF.
|
64a68b2ce7ae0a14c97315e5115446a6dcf3a7eb | 6523e31b44c749d210c0571698afefc5a7f9dc29 | /hw5/code/fitcurve.h | df425971b93ad4ae42f68e14dfd3ed05fecd1728 | [] | no_license | dongm0/games102-assignment | db00e4ff520eb4aaafc099b483b22b8beb3818ed | 0e8837743f7cf4b942d09dab075e3ea5af444dba | refs/heads/master | 2023-01-18T18:12:20.841140 | 2020-11-20T17:35:16 | 2020-11-20T17:35:16 | 304,319,200 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,825 | h | fitcurve.h | #include <math.h>
#include <vector>
enum Segmentation {
B_SPLINE_2ND,
B_SPLINE_3RD,
INTERPOLATION
};
struct mypoint {
double x;
double y;
mypoint operator+(mypoint p1) {return{p1.x+x, p1.y+y};}
mypoint operator-(mypoint p1) {return{x-p1.x, y-p1.y};}
mypoint operator*(double a) {return{a*x, a*y};}
};
class ControlPointArray2D {
public:
bool closed() {return m_closed;}
int sizeC() {return m_ctrlPoints.size();}
int sizeD() {return m_drawPoints.size();}
int getClosePoint(mypoint p);
std::vector<mypoint>& getDrawPoint() {return m_drawPoints;}
std::vector<mypoint>& getCtrlPoint() {return m_ctrlPoints;}
void makeClose() {
if (sizeC() >= 2)
m_closed = true;
updateDrawPoints();
}
void pushBack(mypoint p) {
m_ctrlPoints.push_back(p);
updateDrawPoints();
}
void setPos(int i, mypoint newp) {
m_ctrlPoints.at(i) = newp;
updateDrawPoints();
}
void setItTime(int time) {
m_itTime = time;
updateDrawPoints();
}
void setSegmentation(Segmentation m) {
m_method = m;
updateDrawPoints();
}
void setInterpolationPara(double l) {
m_interpolationPara = l;
updateDrawPoints();
}
void clear() {
m_closed = false;
m_ctrlPoints.clear();
m_drawPoints.clear();
}
private:
void updateDrawPoints();
void updateDrawPoints_1();
void updateDrawPoints_2();
void updateDrawPoints_3();
private:
bool m_closed = false;
std::vector<mypoint> m_ctrlPoints;
std::vector<mypoint> m_drawPoints;
double m_closePointDist = 0.02;
//控制层
int m_itTime = 0;
Segmentation m_method = Segmentation::B_SPLINE_2ND;
double m_interpolationPara = 0.05;
};
|
f4b456149114c8d806d2af3ee60ddba8e6ed6da6 | 7b460bd397fcc365973d063657b15a7bde6ed795 | /source/vulkan/vulkan_hooks_device.cpp | 8320d517be3ab7c0b15241353c7cc28f0152f583 | [
"BSD-3-Clause"
] | permissive | Redundanz/reshade | 6f05d8105adb9add0516db380bfe6da859514478 | c1d826febc23fc2b18dfc8fc18ac7806169b85dd | refs/heads/main | 2023-03-18T02:58:40.769804 | 2021-05-24T20:00:32 | 2021-05-24T20:00:32 | 353,998,079 | 1 | 0 | BSD-3-Clause | 2021-04-02T11:24:59 | 2021-04-02T11:24:59 | null | UTF-8 | C++ | false | false | 84,916 | cpp | vulkan_hooks_device.cpp | /*
* Copyright (C) 2014 Patrick Mours. All rights reserved.
* License: https://github.com/crosire/reshade#license
*/
#include "dll_log.hpp"
#include "hook_manager.hpp"
#include "vulkan_hooks.hpp"
#include "lockfree_table.hpp"
#include "runtime_vk.hpp"
lockfree_table<void *, reshade::vulkan::device_impl *, 16> g_vulkan_devices;
static lockfree_table<VkQueue, reshade::vulkan::command_queue_impl *, 16> s_vulkan_queues;
static lockfree_table<VkCommandBuffer, reshade::vulkan::command_list_impl *, 4096> s_vulkan_command_buffers;
extern lockfree_table<void *, VkLayerInstanceDispatchTable, 16> g_instance_dispatch;
extern lockfree_table<VkSurfaceKHR, HWND, 16> g_surface_windows;
static lockfree_table<VkSwapchainKHR, reshade::vulkan::runtime_impl *, 16> s_vulkan_runtimes;
#define GET_DISPATCH_PTR(name, object) \
GET_DISPATCH_PTR_FROM(name, g_vulkan_devices.at(dispatch_key_from_handle(object)))
#define GET_DISPATCH_PTR_FROM(name, data) \
assert((data) != nullptr); \
PFN_vk##name trampoline = (data)->_dispatch_table.name; \
assert(trampoline != nullptr)
#define INIT_DISPATCH_PTR(name) \
dispatch_table.name = reinterpret_cast<PFN_vk##name>(get_device_proc(device, "vk" #name))
static inline const char *vk_format_to_string(VkFormat format)
{
switch (format)
{
case VK_FORMAT_UNDEFINED:
return "VK_FORMAT_UNDEFINED";
case VK_FORMAT_R8G8B8A8_UNORM:
return "VK_FORMAT_R8G8B8A8_UNORM";
case VK_FORMAT_R8G8B8A8_SRGB:
return "VK_FORMAT_R8G8B8A8_SRGB";
case VK_FORMAT_B8G8R8A8_UNORM:
return "VK_FORMAT_B8G8R8A8_UNORM";
case VK_FORMAT_B8G8R8A8_SRGB:
return "VK_FORMAT_B8G8R8A8_SRGB";
case VK_FORMAT_A2R10G10B10_UNORM_PACK32:
return "VK_FORMAT_A2R10G10B10_UNORM_PACK32";
case VK_FORMAT_R16G16B16A16_SFLOAT:
return "VK_FORMAT_R16G16B16A16_SFLOAT";
default:
return nullptr;
}
}
VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDevice *pDevice)
{
LOG(INFO) << "Redirecting " << "vkCreateDevice" << '(' << "physicalDevice = " << physicalDevice << ", pCreateInfo = " << pCreateInfo << ", pAllocator = " << pAllocator << ", pDevice = " << pDevice << ')' << " ...";
assert(pCreateInfo != nullptr && pDevice != nullptr);
// Look for layer link info if installed as a layer (provided by the Vulkan loader)
VkLayerDeviceCreateInfo *const link_info = find_layer_info<VkLayerDeviceCreateInfo>(
pCreateInfo->pNext, VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO, VK_LAYER_LINK_INFO);
// Get trampoline function pointers
PFN_vkCreateDevice trampoline = nullptr;
PFN_vkGetDeviceProcAddr get_device_proc = nullptr;
PFN_vkGetInstanceProcAddr get_instance_proc = nullptr;
if (link_info != nullptr)
{
assert(link_info->u.pLayerInfo != nullptr);
assert(link_info->u.pLayerInfo->pfnNextGetDeviceProcAddr != nullptr);
assert(link_info->u.pLayerInfo->pfnNextGetInstanceProcAddr != nullptr);
// Look up functions in layer info
get_device_proc = link_info->u.pLayerInfo->pfnNextGetDeviceProcAddr;
get_instance_proc = link_info->u.pLayerInfo->pfnNextGetInstanceProcAddr;
trampoline = reinterpret_cast<PFN_vkCreateDevice>(get_instance_proc(nullptr, "vkCreateDevice"));
// Advance the link info for the next element on the chain
link_info->u.pLayerInfo = link_info->u.pLayerInfo->pNext;
}
#ifdef RESHADE_TEST_APPLICATION
else
{
trampoline = reshade::hooks::call(vkCreateDevice);
get_device_proc = reshade::hooks::call(vkGetDeviceProcAddr);
get_instance_proc = reshade::hooks::call(vkGetInstanceProcAddr);
}
#endif
if (trampoline == nullptr) // Unable to resolve next 'vkCreateDevice' function in the call chain
return VK_ERROR_INITIALIZATION_FAILED;
LOG(INFO) << "> Dumping enabled device extensions:";
for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; ++i)
LOG(INFO) << " " << pCreateInfo->ppEnabledExtensionNames[i];
auto enum_queue_families = g_instance_dispatch.at(dispatch_key_from_handle(physicalDevice)).GetPhysicalDeviceQueueFamilyProperties;
assert(enum_queue_families != nullptr);
auto enum_device_extensions = g_instance_dispatch.at(dispatch_key_from_handle(physicalDevice)).EnumerateDeviceExtensionProperties;
assert(enum_device_extensions != nullptr);
uint32_t num_queue_families = 0;
enum_queue_families(physicalDevice, &num_queue_families, nullptr);
std::vector<VkQueueFamilyProperties> queue_families(num_queue_families);
enum_queue_families(physicalDevice, &num_queue_families, queue_families.data());
uint32_t graphics_queue_family_index = std::numeric_limits<uint32_t>::max();
for (uint32_t i = 0, queue_family_index; i < pCreateInfo->queueCreateInfoCount; ++i)
{
queue_family_index = pCreateInfo->pQueueCreateInfos[i].queueFamilyIndex;
assert(queue_family_index < num_queue_families);
// Find the first queue family which supports graphics and has at least one queue
if (pCreateInfo->pQueueCreateInfos[i].queueCount > 0 && (queue_families[queue_family_index].queueFlags & VK_QUEUE_GRAPHICS_BIT) != 0)
{
if (pCreateInfo->pQueueCreateInfos[i].pQueuePriorities[0] < 1.0f)
LOG(WARN) << "Vulkan queue used for rendering has a low priority (" << pCreateInfo->pQueueCreateInfos[i].pQueuePriorities[0] << ").";
graphics_queue_family_index = queue_family_index;
break;
}
}
VkPhysicalDeviceFeatures enabled_features = {};
const VkPhysicalDeviceFeatures2 *features2 = find_in_structure_chain<VkPhysicalDeviceFeatures2>(
pCreateInfo->pNext, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2);
if (features2 != nullptr) // The features from the structure chain take precedence
enabled_features = features2->features;
else if (pCreateInfo->pEnabledFeatures != nullptr)
enabled_features = *pCreateInfo->pEnabledFeatures;
std::vector<const char *> enabled_extensions;
enabled_extensions.reserve(pCreateInfo->enabledExtensionCount);
for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; ++i)
enabled_extensions.push_back(pCreateInfo->ppEnabledExtensionNames[i]);
// Check if the device is used for presenting
if (std::find_if(enabled_extensions.begin(), enabled_extensions.end(),
[](const char *name) { return strcmp(name, VK_KHR_SWAPCHAIN_EXTENSION_NAME) == 0; }) == enabled_extensions.end())
{
LOG(WARN) << "Skipping device because it is not created with the \"" VK_KHR_SWAPCHAIN_EXTENSION_NAME "\" extension.";
graphics_queue_family_index = std::numeric_limits<uint32_t>::max();
}
// Only have to enable additional features if there is a graphics queue, since ReShade will not run otherwise
else if (graphics_queue_family_index == std::numeric_limits<uint32_t>::max())
{
LOG(WARN) << "Skipping device because it is not created with a graphics queue.";
}
else
{
uint32_t num_extensions = 0;
enum_device_extensions(physicalDevice, nullptr, &num_extensions, nullptr);
std::vector<VkExtensionProperties> extensions(num_extensions);
enum_device_extensions(physicalDevice, nullptr, &num_extensions, extensions.data());
// Make sure the driver actually supports the requested extensions
const auto add_extension = [&extensions, &enabled_extensions, &graphics_queue_family_index](const char *name, bool required) {
if (const auto it = std::find_if(extensions.begin(), extensions.end(),
[name](const auto &props) { return strncmp(props.extensionName, name, VK_MAX_EXTENSION_NAME_SIZE) == 0; });
it != extensions.end())
{
enabled_extensions.push_back(name);
return true;
}
if (required)
{
LOG(ERROR) << "Required extension \"" << name << "\" is not supported on this device. Initialization failed.";
// Reset queue family index to prevent ReShade initialization
graphics_queue_family_index = std::numeric_limits<uint32_t>::max();
}
else
{
LOG(WARN) << "Optional extension \"" << name << "\" is not supported on this device.";
}
return false;
};
// Enable features that ReShade requires
enabled_features.shaderImageGatherExtended = true;
enabled_features.shaderStorageImageWriteWithoutFormat = true;
// Enable extensions that ReShade requires
add_extension(VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME, false); // This is optional, see imgui code in 'runtime_impl'
add_extension(VK_KHR_IMAGE_FORMAT_LIST_EXTENSION_NAME, true);
add_extension(VK_KHR_SWAPCHAIN_MUTABLE_FORMAT_EXTENSION_NAME, true);
}
VkDeviceCreateInfo create_info = *pCreateInfo;
create_info.enabledExtensionCount = uint32_t(enabled_extensions.size());
create_info.ppEnabledExtensionNames = enabled_extensions.data();
// Patch the enabled features
if (features2 != nullptr)
// This is evil, because overwriting application memory, but whatever (RenderDoc does this too)
const_cast<VkPhysicalDeviceFeatures2 *>(features2)->features = enabled_features;
else
create_info.pEnabledFeatures = &enabled_features;
// Continue calling down the chain
const VkResult result = trampoline(physicalDevice, &create_info, pAllocator, pDevice);
if (result != VK_SUCCESS)
{
LOG(WARN) << "vkCreateDevice" << " failed with error code " << result << '.';
return result;
}
VkDevice device = *pDevice;
// Initialize the device dispatch table
VkLayerDispatchTable dispatch_table = { get_device_proc };
// ---- Core 1_0 commands
INIT_DISPATCH_PTR(DestroyDevice);
INIT_DISPATCH_PTR(GetDeviceQueue);
INIT_DISPATCH_PTR(QueueSubmit);
INIT_DISPATCH_PTR(QueueWaitIdle);
INIT_DISPATCH_PTR(DeviceWaitIdle);
INIT_DISPATCH_PTR(AllocateMemory);
INIT_DISPATCH_PTR(FreeMemory);
INIT_DISPATCH_PTR(MapMemory);
INIT_DISPATCH_PTR(UnmapMemory);
INIT_DISPATCH_PTR(FlushMappedMemoryRanges);
INIT_DISPATCH_PTR(InvalidateMappedMemoryRanges);
INIT_DISPATCH_PTR(BindBufferMemory);
INIT_DISPATCH_PTR(BindImageMemory);
INIT_DISPATCH_PTR(GetBufferMemoryRequirements);
INIT_DISPATCH_PTR(GetImageMemoryRequirements);
INIT_DISPATCH_PTR(CreateFence);
INIT_DISPATCH_PTR(DestroyFence);
INIT_DISPATCH_PTR(ResetFences);
INIT_DISPATCH_PTR(GetFenceStatus);
INIT_DISPATCH_PTR(WaitForFences);
INIT_DISPATCH_PTR(CreateSemaphore);
INIT_DISPATCH_PTR(DestroySemaphore);
INIT_DISPATCH_PTR(CreateQueryPool);
INIT_DISPATCH_PTR(DestroyQueryPool);
INIT_DISPATCH_PTR(GetQueryPoolResults);
INIT_DISPATCH_PTR(CreateBuffer);
INIT_DISPATCH_PTR(DestroyBuffer);
INIT_DISPATCH_PTR(CreateBufferView);
INIT_DISPATCH_PTR(DestroyBufferView);
INIT_DISPATCH_PTR(CreateImage);
INIT_DISPATCH_PTR(DestroyImage);
INIT_DISPATCH_PTR(GetImageSubresourceLayout);
INIT_DISPATCH_PTR(CreateImageView);
INIT_DISPATCH_PTR(DestroyImageView);
INIT_DISPATCH_PTR(CreateShaderModule);
INIT_DISPATCH_PTR(DestroyShaderModule);
INIT_DISPATCH_PTR(CreateGraphicsPipelines);
INIT_DISPATCH_PTR(CreateComputePipelines);
INIT_DISPATCH_PTR(DestroyPipeline);
INIT_DISPATCH_PTR(CreatePipelineLayout);
INIT_DISPATCH_PTR(DestroyPipelineLayout);
INIT_DISPATCH_PTR(CreateSampler);
INIT_DISPATCH_PTR(DestroySampler);
INIT_DISPATCH_PTR(CreateDescriptorSetLayout);
INIT_DISPATCH_PTR(DestroyDescriptorSetLayout);
INIT_DISPATCH_PTR(CreateDescriptorPool);
INIT_DISPATCH_PTR(DestroyDescriptorPool);
INIT_DISPATCH_PTR(ResetDescriptorPool);
INIT_DISPATCH_PTR(AllocateDescriptorSets);
INIT_DISPATCH_PTR(FreeDescriptorSets);
INIT_DISPATCH_PTR(UpdateDescriptorSets);
INIT_DISPATCH_PTR(CreateFramebuffer);
INIT_DISPATCH_PTR(DestroyFramebuffer);
INIT_DISPATCH_PTR(CreateRenderPass);
INIT_DISPATCH_PTR(DestroyRenderPass);
INIT_DISPATCH_PTR(CreateCommandPool);
INIT_DISPATCH_PTR(DestroyCommandPool);
INIT_DISPATCH_PTR(ResetCommandPool);
INIT_DISPATCH_PTR(AllocateCommandBuffers);
INIT_DISPATCH_PTR(FreeCommandBuffers);
INIT_DISPATCH_PTR(BeginCommandBuffer);
INIT_DISPATCH_PTR(EndCommandBuffer);
INIT_DISPATCH_PTR(ResetCommandBuffer);
INIT_DISPATCH_PTR(CmdBindPipeline);
INIT_DISPATCH_PTR(CmdSetViewport);
INIT_DISPATCH_PTR(CmdSetScissor);
INIT_DISPATCH_PTR(CmdSetDepthBias);
INIT_DISPATCH_PTR(CmdSetBlendConstants);
INIT_DISPATCH_PTR(CmdSetStencilCompareMask);
INIT_DISPATCH_PTR(CmdSetStencilWriteMask);
INIT_DISPATCH_PTR(CmdSetStencilReference);
INIT_DISPATCH_PTR(CmdBindDescriptorSets);
INIT_DISPATCH_PTR(CmdBindIndexBuffer);
INIT_DISPATCH_PTR(CmdBindVertexBuffers);
INIT_DISPATCH_PTR(CmdDraw);
INIT_DISPATCH_PTR(CmdDrawIndexed);
INIT_DISPATCH_PTR(CmdDrawIndirect);
INIT_DISPATCH_PTR(CmdDrawIndexedIndirect);
INIT_DISPATCH_PTR(CmdDispatch);
INIT_DISPATCH_PTR(CmdDispatchIndirect);
INIT_DISPATCH_PTR(CmdCopyBuffer);
INIT_DISPATCH_PTR(CmdCopyImage);
INIT_DISPATCH_PTR(CmdBlitImage);
INIT_DISPATCH_PTR(CmdCopyBufferToImage);
INIT_DISPATCH_PTR(CmdCopyImageToBuffer);
INIT_DISPATCH_PTR(CmdUpdateBuffer);
INIT_DISPATCH_PTR(CmdClearColorImage);
INIT_DISPATCH_PTR(CmdClearDepthStencilImage);
INIT_DISPATCH_PTR(CmdClearAttachments);
INIT_DISPATCH_PTR(CmdResolveImage);
INIT_DISPATCH_PTR(CmdPipelineBarrier);
INIT_DISPATCH_PTR(CmdBeginQuery);
INIT_DISPATCH_PTR(CmdEndQuery);
INIT_DISPATCH_PTR(CmdResetQueryPool);
INIT_DISPATCH_PTR(CmdWriteTimestamp);
INIT_DISPATCH_PTR(CmdCopyQueryPoolResults);
INIT_DISPATCH_PTR(CmdPushConstants);
INIT_DISPATCH_PTR(CmdBeginRenderPass);
INIT_DISPATCH_PTR(CmdNextSubpass);
INIT_DISPATCH_PTR(CmdEndRenderPass);
INIT_DISPATCH_PTR(CmdExecuteCommands);
// ---- Core 1_1 commands
INIT_DISPATCH_PTR(BindBufferMemory2);
INIT_DISPATCH_PTR(BindImageMemory2);
INIT_DISPATCH_PTR(GetBufferMemoryRequirements2);
INIT_DISPATCH_PTR(GetImageMemoryRequirements2);
INIT_DISPATCH_PTR(GetDeviceQueue2);
// ---- Core 1_2 commands
INIT_DISPATCH_PTR(CreateRenderPass2);
if (dispatch_table.CreateRenderPass2 == nullptr) // Try the KHR version if the core version does not exist
dispatch_table.CreateRenderPass2 = reinterpret_cast<PFN_vkCreateRenderPass2KHR>(get_device_proc(device, "vkCreateRenderPass2KHR"));
// ---- VK_KHR_swapchain extension commands
INIT_DISPATCH_PTR(CreateSwapchainKHR);
INIT_DISPATCH_PTR(DestroySwapchainKHR);
INIT_DISPATCH_PTR(GetSwapchainImagesKHR);
INIT_DISPATCH_PTR(QueuePresentKHR);
// ---- VK_KHR_push_descriptor extension commands
INIT_DISPATCH_PTR(CmdPushDescriptorSetKHR);
// ---- VK_EXT_debug_utils extension commands
INIT_DISPATCH_PTR(SetDebugUtilsObjectNameEXT);
INIT_DISPATCH_PTR(QueueBeginDebugUtilsLabelEXT);
INIT_DISPATCH_PTR(QueueEndDebugUtilsLabelEXT);
INIT_DISPATCH_PTR(QueueInsertDebugUtilsLabelEXT);
INIT_DISPATCH_PTR(CmdBeginDebugUtilsLabelEXT);
INIT_DISPATCH_PTR(CmdEndDebugUtilsLabelEXT);
INIT_DISPATCH_PTR(CmdInsertDebugUtilsLabelEXT);
// Initialize per-device data
const auto device_impl = new reshade::vulkan::device_impl(
device,
physicalDevice,
g_instance_dispatch.at(dispatch_key_from_handle(physicalDevice)),
dispatch_table,
enabled_features);
device_impl->_graphics_queue_family_index = graphics_queue_family_index;
g_vulkan_devices.emplace(dispatch_key_from_handle(device), device_impl);
// Initialize all queues associated with this device
for (uint32_t i = 0; i < pCreateInfo->queueCreateInfoCount; ++i)
{
const VkDeviceQueueCreateInfo &queue_create_info = pCreateInfo->pQueueCreateInfos[i];
for (uint32_t queue_index = 0; queue_index < queue_create_info.queueCount; ++queue_index)
{
VkQueue queue = VK_NULL_HANDLE;
dispatch_table.GetDeviceQueue(device, queue_create_info.queueFamilyIndex, queue_index, &queue);
assert(VK_NULL_HANDLE != queue);
const auto queue_impl = new reshade::vulkan::command_queue_impl(
device_impl,
queue_create_info.queueFamilyIndex,
queue_families[queue_create_info.queueFamilyIndex],
queue);
s_vulkan_queues.emplace(queue, queue_impl);
}
}
#if RESHADE_VERBOSE_LOG
LOG(INFO) << "Returning Vulkan device " << device << '.';
#endif
return VK_SUCCESS;
}
void VKAPI_CALL vkDestroyDevice(VkDevice device, const VkAllocationCallbacks *pAllocator)
{
LOG(INFO) << "Redirecting " << "vkDestroyDevice" << '(' << "device = " << device << ", pAllocator = " << pAllocator << ')' << " ...";
s_vulkan_command_buffers.clear(); // Reset all command buffer data
// Remove from device dispatch table since this device is being destroyed
reshade::vulkan::device_impl *const device_impl = g_vulkan_devices.erase(dispatch_key_from_handle(device));
assert(device_impl != nullptr);
// Destroy all queues associated with this device
const std::vector<reshade::vulkan::command_queue_impl *> queues = device_impl->_queues;
for (reshade::vulkan::command_queue_impl *queue_impl : queues)
{
s_vulkan_queues.erase(queue_impl->_orig);
delete queue_impl; // This will remove the queue from the queue list of the device too (see 'command_queue_impl' destructor)
}
assert(device_impl->_queues.empty());
// Get function pointer before data is destroyed next
GET_DISPATCH_PTR_FROM(DestroyDevice, device_impl);
// Finally destroy the device
delete device_impl;
trampoline(device, pAllocator);
}
VkResult VKAPI_CALL vkCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchain)
{
LOG(INFO) << "Redirecting " << "vkCreateSwapchainKHR" << '(' << "device = " << device << ", pCreateInfo = " << pCreateInfo << ", pAllocator = " << pAllocator << ", pSwapchain = " << pSwapchain << ')' << " ...";
assert(pCreateInfo != nullptr && pSwapchain != nullptr);
reshade::vulkan::device_impl *const device_impl = g_vulkan_devices.at(dispatch_key_from_handle(device));
assert(device_impl != nullptr);
VkSwapchainCreateInfoKHR create_info = *pCreateInfo;
VkImageFormatListCreateInfoKHR format_list_info { VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO_KHR };
std::vector<VkFormat> format_list; std::vector<uint32_t> queue_family_list;
// Only have to enable additional features if there is a graphics queue, since ReShade will not run otherwise
if (device_impl->_graphics_queue_family_index != std::numeric_limits<uint32_t>::max())
{
// Add required usage flags to create info
create_info.imageUsage |= VK_IMAGE_USAGE_TRANSFER_SRC_BIT;
// Add required formats, so views with different formats can be created for the swap chain images
format_list.push_back(reshade::vulkan::convert_format(
reshade::api::format_to_default_typed(reshade::vulkan::convert_format(create_info.imageFormat))));
format_list.push_back(reshade::vulkan::convert_format(
reshade::api::format_to_default_typed_srgb(reshade::vulkan::convert_format(create_info.imageFormat))));
// Only have to make format mutable if they are actually different
if (format_list[0] != format_list[1])
create_info.flags |= VK_SWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHR;
// Patch the format list in the create info of the application
if (const VkImageFormatListCreateInfoKHR *format_list_info2 = find_in_structure_chain<VkImageFormatListCreateInfoKHR>(
pCreateInfo->pNext, VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO_KHR); format_list_info2 != nullptr)
{
format_list.insert(format_list.end(),
format_list_info2->pViewFormats, format_list_info2->pViewFormats + format_list_info2->viewFormatCount);
// Remove duplicates from the list (since the new formats may have already been added by the application)
std::sort(format_list.begin(), format_list.end());
format_list.erase(std::unique(format_list.begin(), format_list.end()), format_list.end());
// This is evil, because writing into the application memory, but eh =)
const_cast<VkImageFormatListCreateInfoKHR *>(format_list_info2)->viewFormatCount = static_cast<uint32_t>(format_list.size());
const_cast<VkImageFormatListCreateInfoKHR *>(format_list_info2)->pViewFormats = format_list.data();
}
else if (format_list[0] != format_list[1])
{
format_list_info.pNext = create_info.pNext;
format_list_info.viewFormatCount = static_cast<uint32_t>(format_list.size());
format_list_info.pViewFormats = format_list.data();
create_info.pNext = &format_list_info;
}
// Add required queue family indices, so images can be used on the graphics queue
if (create_info.imageSharingMode == VK_SHARING_MODE_CONCURRENT)
{
queue_family_list.reserve(create_info.queueFamilyIndexCount + 1);
queue_family_list.push_back(device_impl->_graphics_queue_family_index);
for (uint32_t i = 0; i < create_info.queueFamilyIndexCount; ++i)
if (create_info.pQueueFamilyIndices[i] != device_impl->_graphics_queue_family_index)
queue_family_list.push_back(create_info.pQueueFamilyIndices[i]);
create_info.queueFamilyIndexCount = static_cast<uint32_t>(queue_family_list.size());
create_info.pQueueFamilyIndices = queue_family_list.data();
}
}
LOG(INFO) << "> Dumping swap chain description:";
LOG(INFO) << " +-----------------------------------------+-----------------------------------------+";
LOG(INFO) << " | Parameter | Value |";
LOG(INFO) << " +-----------------------------------------+-----------------------------------------+";
LOG(INFO) << " | flags | " << std::setw(39) << std::hex << create_info.flags << std::dec << " |";
LOG(INFO) << " | surface | " << std::setw(39) << create_info.surface << " |";
LOG(INFO) << " | minImageCount | " << std::setw(39) << create_info.minImageCount << " |";
if (const char *format_string = vk_format_to_string(create_info.imageFormat); format_string != nullptr)
LOG(INFO) << " | imageFormat | " << std::setw(39) << format_string << " |";
else
LOG(INFO) << " | imageFormat | " << std::setw(39) << create_info.imageFormat << " |";
LOG(INFO) << " | imageColorSpace | " << std::setw(39) << create_info.imageColorSpace << " |";
LOG(INFO) << " | imageExtent | " << std::setw(19) << create_info.imageExtent.width << ' ' << std::setw(19) << create_info.imageExtent.height << " |";
LOG(INFO) << " | imageArrayLayers | " << std::setw(39) << create_info.imageArrayLayers << " |";
LOG(INFO) << " | imageUsage | " << std::setw(39) << std::hex << create_info.imageUsage << std::dec << " |";
LOG(INFO) << " | imageSharingMode | " << std::setw(39) << create_info.imageSharingMode << " |";
LOG(INFO) << " | queueFamilyIndexCount | " << std::setw(39) << create_info.queueFamilyIndexCount << " |";
LOG(INFO) << " | preTransform | " << std::setw(39) << std::hex << create_info.preTransform << std::dec << " |";
LOG(INFO) << " | compositeAlpha | " << std::setw(39) << std::hex << create_info.compositeAlpha << std::dec << " |";
LOG(INFO) << " | presentMode | " << std::setw(39) << create_info.presentMode << " |";
LOG(INFO) << " | clipped | " << std::setw(39) << (create_info.clipped ? "true" : "false") << " |";
LOG(INFO) << " | oldSwapchain | " << std::setw(39) << create_info.oldSwapchain << " |";
LOG(INFO) << " +-----------------------------------------+-----------------------------------------+";
GET_DISPATCH_PTR_FROM(CreateSwapchainKHR, device_impl);
const VkResult result = trampoline(device, &create_info, pAllocator, pSwapchain);
if (result != VK_SUCCESS)
{
LOG(WARN) << "vkCreateSwapchainKHR" << " failed with error code " << result << '.';
return result;
}
// Add swap chain images to the image list
uint32_t num_swapchain_images = 0;
device_impl->_dispatch_table.GetSwapchainImagesKHR(device, *pSwapchain, &num_swapchain_images, nullptr);
std::vector<VkImage> swapchain_images(num_swapchain_images);
device_impl->_dispatch_table.GetSwapchainImagesKHR(device, *pSwapchain, &num_swapchain_images, swapchain_images.data());
VkImageCreateInfo image_create_info { VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO };
image_create_info.imageType = VK_IMAGE_TYPE_2D;
image_create_info.format = create_info.imageFormat;
image_create_info.extent = { create_info.imageExtent.width, create_info.imageExtent.height, 1 };
image_create_info.mipLevels = 1;
image_create_info.arrayLayers = create_info.imageArrayLayers;
image_create_info.samples = VK_SAMPLE_COUNT_1_BIT;
image_create_info.usage = create_info.imageUsage;
image_create_info.sharingMode = create_info.imageSharingMode;
image_create_info.initialLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;
for (uint32_t i = 0; i < num_swapchain_images; ++i)
device_impl->register_image(swapchain_images[i], image_create_info);
reshade::vulkan::command_queue_impl *queue_impl = nullptr;
if (device_impl->_graphics_queue_family_index != std::numeric_limits<uint32_t>::max())
{
// Get the main graphics queue for command submission
// There has to be at least one queue, or else this runtime would not have been created with this queue family index, so it is safe to get the first one here
VkQueue graphics_queue = VK_NULL_HANDLE;
device_impl->_dispatch_table.GetDeviceQueue(device, device_impl->_graphics_queue_family_index, 0, &graphics_queue);
assert(VK_NULL_HANDLE != graphics_queue);
queue_impl = s_vulkan_queues.at(graphics_queue);
}
if (queue_impl != nullptr)
{
// Remove old swap chain from the list so that a call to 'vkDestroySwapchainKHR' won't reset the runtime again
reshade::vulkan::runtime_impl *runtime = s_vulkan_runtimes.erase(create_info.oldSwapchain);
if (runtime != nullptr)
{
assert(create_info.oldSwapchain != VK_NULL_HANDLE);
#if RESHADE_ADDON
reshade::invoke_addon_event<reshade::addon_event::resize>(
runtime, create_info.imageExtent.width, create_info.imageExtent.height);
#endif
// Re-use the existing runtime if this swap chain was not created from scratch, but reset it before initializing again below
runtime->on_reset();
}
else
{
runtime = new reshade::vulkan::runtime_impl(device_impl, queue_impl);
}
// Look up window handle from surface
const HWND hwnd = g_surface_windows.at(create_info.surface);
if (!runtime->on_init(*pSwapchain, create_info, hwnd))
LOG(ERROR) << "Failed to initialize Vulkan runtime environment on runtime " << runtime << '.';
if (!s_vulkan_runtimes.emplace(*pSwapchain, runtime))
delete runtime;
}
else
{
s_vulkan_runtimes.emplace(*pSwapchain, nullptr);
}
#if RESHADE_VERBOSE_LOG
LOG(INFO) << "Returning Vulkan swapchain " << *pSwapchain << '.';
#endif
return VK_SUCCESS;
}
void VKAPI_CALL vkDestroySwapchainKHR(VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks *pAllocator)
{
LOG(INFO) << "Redirecting " << "vkDestroySwapchainKHR" << '(' << device << ", " << swapchain << ", " << pAllocator << ')' << " ...";
reshade::vulkan::device_impl *const device_impl = g_vulkan_devices.at(dispatch_key_from_handle(device));
assert(device_impl != nullptr);
// Remove runtime from global list
delete s_vulkan_runtimes.erase(swapchain);
// Remove swap chain images from the image list
uint32_t num_swapchain_images = 0;
device_impl->_dispatch_table.GetSwapchainImagesKHR(device, swapchain, &num_swapchain_images, nullptr);
std::vector<VkImage> swapchain_images(num_swapchain_images);
device_impl->_dispatch_table.GetSwapchainImagesKHR(device, swapchain, &num_swapchain_images, swapchain_images.data());
for (uint32_t i = 0; i < num_swapchain_images; ++i)
device_impl->unregister_image(swapchain_images[i]);
GET_DISPATCH_PTR_FROM(DestroySwapchainKHR, device_impl);
trampoline(device, swapchain, pAllocator);
}
VkResult VKAPI_CALL vkQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo *pSubmits, VkFence fence)
{
assert(pSubmits != nullptr);
#if RESHADE_ADDON
reshade::vulkan::command_queue_impl *const queue_impl = s_vulkan_queues.at(queue);
if (queue_impl != nullptr)
{
queue_impl->flush_immediate_command_list();
for (uint32_t i = 0; i < submitCount; ++i)
{
for (uint32_t k = 0; k < pSubmits[i].commandBufferCount; ++k)
{
assert(pSubmits[i].pCommandBuffers[k] != VK_NULL_HANDLE);
reshade::invoke_addon_event<reshade::addon_event::execute_command_list>(
queue_impl, s_vulkan_command_buffers.at(pSubmits[i].pCommandBuffers[k]));
}
}
}
#endif
// The loader uses the same dispatch table pointer for queues and devices, so can use queue to perform lookup here
GET_DISPATCH_PTR(QueueSubmit, queue);
return trampoline(queue, submitCount, pSubmits, fence);
}
VkResult VKAPI_CALL vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *pPresentInfo)
{
assert(pPresentInfo != nullptr);
std::vector<VkSemaphore> wait_semaphores(
pPresentInfo->pWaitSemaphores, pPresentInfo->pWaitSemaphores + pPresentInfo->waitSemaphoreCount);
reshade::vulkan::command_queue_impl *const queue_impl = s_vulkan_queues.at(queue);
if (queue_impl != nullptr)
{
for (uint32_t i = 0; i < pPresentInfo->swapchainCount; ++i)
{
if (const auto runtime = s_vulkan_runtimes.at(pPresentInfo->pSwapchains[i]);
runtime != nullptr)
{
#if RESHADE_ADDON
reshade::invoke_addon_event<reshade::addon_event::present>(queue_impl, runtime);
#endif
runtime->on_present(queue, pPresentInfo->pImageIndices[i], wait_semaphores);
}
}
static_cast<reshade::vulkan::device_impl *>(queue_impl->get_device())->advance_transient_descriptor_pool();
}
// Override wait semaphores based on the last queue submit from above
VkPresentInfoKHR present_info = *pPresentInfo;
present_info.waitSemaphoreCount = static_cast<uint32_t>(wait_semaphores.size());
present_info.pWaitSemaphores = wait_semaphores.data();
GET_DISPATCH_PTR(QueuePresentKHR, queue);
return trampoline(queue, &present_info);
}
VkResult VKAPI_CALL vkCreateBuffer(VkDevice device, const VkBufferCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkBuffer *pBuffer)
{
reshade::vulkan::device_impl *const device_impl = g_vulkan_devices.at(dispatch_key_from_handle(device));
GET_DISPATCH_PTR_FROM(CreateBuffer, device_impl);
#if RESHADE_ADDON
assert(pCreateInfo != nullptr);
VkBufferCreateInfo create_info = *pCreateInfo;
VkResult result = VK_ERROR_UNKNOWN;
reshade::invoke_addon_event<reshade::addon_event::create_resource>(
[device_impl, trampoline, &result, &create_info, pAllocator, pBuffer](reshade::api::device *,const reshade::api::resource_desc &desc, const reshade::api::subresource_data *initial_data, reshade::api::resource_usage initial_state) {
if (desc.type != reshade::api::resource_type::buffer || desc.heap != reshade::api::memory_heap::unknown || initial_data != nullptr || initial_state != reshade::api::resource_usage::undefined)
return false;
reshade::vulkan::convert_resource_desc(desc, create_info);
result = trampoline(device_impl->_orig, &create_info, pAllocator, pBuffer);
if (result == VK_SUCCESS)
{
assert(pBuffer != nullptr);
device_impl->register_buffer(*pBuffer, create_info);
return true;
}
else
{
LOG(WARN) << "vkCreateBuffer" << " failed with error code " << result << '.';
return false;
}
}, device_impl, reshade::vulkan::convert_resource_desc(create_info), nullptr, reshade::api::resource_usage::undefined);
return result;
#else
return trampoline(device, pCreateInfo, pAllocator, pBuffer);
#endif
}
void VKAPI_CALL vkDestroyBuffer(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks *pAllocator)
{
reshade::vulkan::device_impl *const device_impl = g_vulkan_devices.at(dispatch_key_from_handle(device));
GET_DISPATCH_PTR_FROM(DestroyBuffer, device_impl);
#if RESHADE_ADDON
device_impl->unregister_buffer(buffer);
#endif
trampoline(device, buffer, pAllocator);
}
VkResult VKAPI_CALL vkCreateBufferView(VkDevice device, const VkBufferViewCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkBufferView *pView)
{
reshade::vulkan::device_impl *const device_impl = g_vulkan_devices.at(dispatch_key_from_handle(device));
GET_DISPATCH_PTR_FROM(CreateBufferView, device_impl);
#if RESHADE_ADDON
assert(pCreateInfo != nullptr);
VkBufferViewCreateInfo create_info = *pCreateInfo;
VkResult result = VK_ERROR_UNKNOWN;
reshade::invoke_addon_event<reshade::addon_event::create_resource_view>(
[device_impl, trampoline, &result, &create_info, pAllocator, pView](reshade::api::device *, reshade::api::resource resource, reshade::api::resource_usage, const reshade::api::resource_view_desc &desc) {
if (desc.type != reshade::api::resource_view_type::buffer)
return false;
create_info.buffer = (VkBuffer)resource.handle;
reshade::vulkan::convert_resource_view_desc(desc, create_info);
result = trampoline(device_impl->_orig, &create_info, pAllocator, pView);
if (result == VK_SUCCESS)
{
assert(pView != nullptr);
device_impl->register_buffer_view(*pView, create_info);
return true;
}
else
{
LOG(WARN) << "vkCreateBufferView" << " failed with error code " << result << '.';
return false;
}
}, device_impl, reshade::api::resource { (uint64_t)create_info.buffer }, reshade::api::resource_usage::undefined, reshade::vulkan::convert_resource_view_desc(create_info));
return result;
#else
return trampoline(device, pCreateInfo, pAllocator, pView);
#endif
}
void VKAPI_CALL vkDestroyBufferView(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks *pAllocator)
{
reshade::vulkan::device_impl *const device_impl = g_vulkan_devices.at(dispatch_key_from_handle(device));
GET_DISPATCH_PTR_FROM(DestroyBufferView, device_impl);
#if RESHADE_ADDON
device_impl->unregister_buffer_view(bufferView);
#endif
trampoline(device, bufferView, pAllocator);
}
VkResult VKAPI_CALL vkCreateImage(VkDevice device, const VkImageCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkImage *pImage)
{
reshade::vulkan::device_impl *const device_impl = g_vulkan_devices.at(dispatch_key_from_handle(device));
GET_DISPATCH_PTR_FROM(CreateImage, device_impl);
#if RESHADE_ADDON
assert(pCreateInfo != nullptr);
VkImageCreateInfo create_info = *pCreateInfo;
VkResult result = VK_ERROR_UNKNOWN;
reshade::invoke_addon_event<reshade::addon_event::create_resource>(
[device_impl, trampoline, &result, &create_info, pAllocator, pImage](reshade::api::device *, const reshade::api::resource_desc &desc, const reshade::api::subresource_data *initial_data, reshade::api::resource_usage initial_state) {
if (desc.type == reshade::api::resource_type::buffer || desc.heap != reshade::api::memory_heap::unknown || initial_data != nullptr || initial_state != reshade::api::resource_usage::undefined)
return false;
reshade::vulkan::convert_resource_desc(desc, create_info);
result = trampoline(device_impl->_orig, &create_info, pAllocator, pImage);
if (result == VK_SUCCESS)
{
assert(pImage != nullptr);
device_impl->register_image(*pImage, create_info);
return true;
}
else
{
LOG(WARN) << "vkCreateImage" << " failed with error code " << result << '.';
return false;
}
}, device_impl, reshade::vulkan::convert_resource_desc(create_info), nullptr, create_info.initialLayout == VK_IMAGE_LAYOUT_PREINITIALIZED ? reshade::api::resource_usage::cpu_access : reshade::api::resource_usage::undefined);
return result;
#else
return trampoline(device, pCreateInfo, pAllocator, pImage);
#endif
}
void VKAPI_CALL vkDestroyImage(VkDevice device, VkImage image, const VkAllocationCallbacks *pAllocator)
{
reshade::vulkan::device_impl *const device_impl = g_vulkan_devices.at(dispatch_key_from_handle(device));
GET_DISPATCH_PTR_FROM(DestroyImage, device_impl);
#if RESHADE_ADDON
device_impl->unregister_image(image);
#endif
trampoline(device, image, pAllocator);
}
VkResult VKAPI_CALL vkCreateImageView(VkDevice device, const VkImageViewCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkImageView *pView)
{
reshade::vulkan::device_impl *const device_impl = g_vulkan_devices.at(dispatch_key_from_handle(device));
GET_DISPATCH_PTR_FROM(CreateImageView, device_impl);
#if RESHADE_ADDON
assert(pCreateInfo != nullptr);
VkImageViewCreateInfo create_info = *pCreateInfo;
VkResult result = VK_ERROR_UNKNOWN;
reshade::invoke_addon_event<reshade::addon_event::create_resource_view>(
[device_impl, trampoline, &result, &create_info, pAllocator, pView](reshade::api::device *, reshade::api::resource resource, reshade::api::resource_usage, const reshade::api::resource_view_desc &desc) {
if (desc.type == reshade::api::resource_view_type::buffer)
return false;
create_info.image = (VkImage)resource.handle;
reshade::vulkan::convert_resource_view_desc(desc, create_info);
result = trampoline(device_impl->_orig, &create_info, pAllocator, pView);
if (result == VK_SUCCESS)
{
assert(pView != nullptr);
device_impl->register_image_view(*pView, create_info);
return true;
}
else
{
LOG(WARN) << "vkCreateImageView" << " failed with error code " << result << '.';
return false;
}
}, device_impl, reshade::api::resource { (uint64_t)create_info.image }, reshade::api::resource_usage::undefined, reshade::vulkan::convert_resource_view_desc(create_info));
return result;
#else
return trampoline(device, pCreateInfo, pAllocator, pView);
#endif
}
void VKAPI_CALL vkDestroyImageView(VkDevice device, VkImageView imageView, const VkAllocationCallbacks *pAllocator)
{
reshade::vulkan::device_impl *const device_impl = g_vulkan_devices.at(dispatch_key_from_handle(device));
GET_DISPATCH_PTR_FROM(DestroyImageView, device_impl);
#if RESHADE_ADDON
device_impl->unregister_image_view(imageView);
#endif
trampoline(device, imageView, pAllocator);
}
VkResult VKAPI_CALL vkCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkShaderModule *pShaderModule)
{
reshade::vulkan::device_impl *const device_impl = g_vulkan_devices.at(dispatch_key_from_handle(device));
GET_DISPATCH_PTR_FROM(CreateShaderModule, device_impl);
#if RESHADE_ADDON
#endif
return trampoline(device, pCreateInfo, pAllocator, pShaderModule);
}
VkResult VKAPI_CALL vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkGraphicsPipelineCreateInfo *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines)
{
reshade::vulkan::device_impl *const device_impl = g_vulkan_devices.at(dispatch_key_from_handle(device));
GET_DISPATCH_PTR_FROM(CreateGraphicsPipelines, device_impl);
const VkResult result = trampoline(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines);
if (result != VK_SUCCESS)
{
LOG(WARN) << "vkCreateGraphicsPipelines" << " failed with error code " << result << '.';
return result;
}
return VK_SUCCESS;
}
VkResult VKAPI_CALL vkCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkComputePipelineCreateInfo *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines)
{
reshade::vulkan::device_impl *const device_impl = g_vulkan_devices.at(dispatch_key_from_handle(device));
GET_DISPATCH_PTR_FROM(CreateComputePipelines, device_impl);
const VkResult result = trampoline(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines);
if (result != VK_SUCCESS)
{
LOG(WARN) << "vkCreateComputePipelines" << " failed with error code " << result << '.';
return result;
}
return VK_SUCCESS;
}
VkResult VKAPI_CALL vkCreateSampler(VkDevice device, const VkSamplerCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSampler *pSampler)
{
reshade::vulkan::device_impl *const device_impl = g_vulkan_devices.at(dispatch_key_from_handle(device));
GET_DISPATCH_PTR_FROM(CreateSampler, device_impl);
#if RESHADE_ADDON
assert(pCreateInfo != nullptr);
VkSamplerCreateInfo create_info = *pCreateInfo;
VkResult result = VK_ERROR_UNKNOWN;
reshade::invoke_addon_event<reshade::addon_event::create_sampler>(
[device_impl, trampoline, &result, &create_info, pAllocator, pSampler](reshade::api::device *, const reshade::api::sampler_desc &desc) {
reshade::vulkan::convert_sampler_desc(desc, create_info);
result = trampoline(device_impl->_orig, &create_info, pAllocator, pSampler);
if (result == VK_SUCCESS)
{
return true;
}
else
{
LOG(WARN) << "vkCreateSampler" << " failed with error code " << result << '.';
return false;
}
}, device_impl, reshade::vulkan::convert_sampler_desc(create_info));
return result;
#else
return trampoline(device, pCreateInfo, pAllocator, pSampler);
#endif
}
void VKAPI_CALL vkDestroySampler(VkDevice device, VkSampler sampler, const VkAllocationCallbacks *pAllocator)
{
reshade::vulkan::device_impl *const device_impl = g_vulkan_devices.at(dispatch_key_from_handle(device));
GET_DISPATCH_PTR_FROM(DestroySampler, device_impl);
trampoline(device, sampler, pAllocator);
}
VkResult VKAPI_CALL vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass)
{
reshade::vulkan::device_impl *const device_impl = g_vulkan_devices.at(dispatch_key_from_handle(device));
GET_DISPATCH_PTR_FROM(CreateRenderPass, device_impl);
assert(pCreateInfo != nullptr && pRenderPass != nullptr);
const VkResult result = trampoline(device, pCreateInfo, pAllocator, pRenderPass);
if (result != VK_SUCCESS)
{
LOG(WARN) << "vkCreateRenderPass" << " failed with error code " << result << '.';
return result;
}
#if RESHADE_ADDON
auto &renderpass_data = device_impl->_render_pass_list.emplace(*pRenderPass);
renderpass_data.subpasses.reserve(pCreateInfo->subpassCount);
renderpass_data.cleared_attachments.reserve(pCreateInfo->attachmentCount);
for (uint32_t subpass = 0; subpass < pCreateInfo->subpassCount; ++subpass)
{
auto &subpass_data = renderpass_data.subpasses.emplace_back();
subpass_data.color_attachments.resize(pCreateInfo->pSubpasses[subpass].colorAttachmentCount);
for (uint32_t i = 0; i < pCreateInfo->pSubpasses[subpass].colorAttachmentCount; ++i)
{
const VkAttachmentReference *const reference = pCreateInfo->pSubpasses[subpass].pColorAttachments + i;
if (reference->attachment != VK_ATTACHMENT_UNUSED)
subpass_data.color_attachments[i] = *reference;
else
subpass_data.color_attachments[i] = { VK_ATTACHMENT_UNUSED, VK_IMAGE_LAYOUT_UNDEFINED };
}
{
const VkAttachmentReference *const reference = pCreateInfo->pSubpasses[subpass].pDepthStencilAttachment;
if (reference != nullptr && reference->attachment != VK_ATTACHMENT_UNUSED)
subpass_data.depth_stencil_attachment = *reference;
else
subpass_data.depth_stencil_attachment = { VK_ATTACHMENT_UNUSED, VK_IMAGE_LAYOUT_UNDEFINED };
}
}
for (uint32_t attachment = 0; attachment < pCreateInfo->attachmentCount; ++attachment)
{
const uint32_t clear_flags =
(pCreateInfo->pAttachments[attachment].loadOp == VK_ATTACHMENT_LOAD_OP_CLEAR ? 0x1 : 0x0) |
(pCreateInfo->pAttachments[attachment].stencilLoadOp == VK_ATTACHMENT_LOAD_OP_CLEAR ? 0x2 : 0x0);
if (clear_flags != 0)
renderpass_data.cleared_attachments.push_back({ clear_flags, attachment, pCreateInfo->pAttachments[attachment].initialLayout });
}
#endif
return VK_SUCCESS;
}
VkResult VKAPI_CALL vkCreateRenderPass2(VkDevice device, const VkRenderPassCreateInfo2 *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass)
{
reshade::vulkan::device_impl *const device_impl = g_vulkan_devices.at(dispatch_key_from_handle(device));
GET_DISPATCH_PTR_FROM(CreateRenderPass2, device_impl);
assert(pCreateInfo != nullptr && pRenderPass != nullptr);
const VkResult result = trampoline(device, pCreateInfo, pAllocator, pRenderPass);
if (result != VK_SUCCESS)
{
LOG(WARN) << "vkCreateRenderPass2" << " failed with error code " << result << '.';
return result;
}
#if RESHADE_ADDON
auto &renderpass_data = device_impl->_render_pass_list.emplace(*pRenderPass);
renderpass_data.subpasses.reserve(pCreateInfo->subpassCount);
renderpass_data.cleared_attachments.reserve(pCreateInfo->attachmentCount);
for (uint32_t subpass = 0; subpass < pCreateInfo->subpassCount; ++subpass)
{
auto &subpass_data = renderpass_data.subpasses.emplace_back();
subpass_data.color_attachments.resize(pCreateInfo->pSubpasses[subpass].colorAttachmentCount);
for (uint32_t i = 0; i < pCreateInfo->pSubpasses[subpass].colorAttachmentCount; ++i)
{
const VkAttachmentReference2 *const reference = pCreateInfo->pSubpasses[subpass].pColorAttachments + i;
if (reference->attachment != VK_ATTACHMENT_UNUSED)
subpass_data.color_attachments[i] = { reference->attachment, reference->layout };
else
subpass_data.color_attachments[i] = { VK_ATTACHMENT_UNUSED, VK_IMAGE_LAYOUT_UNDEFINED };
}
{
const VkAttachmentReference2 *const reference = pCreateInfo->pSubpasses[subpass].pDepthStencilAttachment;
if (reference != nullptr && reference->attachment != VK_ATTACHMENT_UNUSED)
subpass_data.depth_stencil_attachment = { reference->attachment, reference->layout };
else
subpass_data.depth_stencil_attachment = { VK_ATTACHMENT_UNUSED, VK_IMAGE_LAYOUT_UNDEFINED };
}
}
for (uint32_t attachment = 0; attachment < pCreateInfo->attachmentCount; ++attachment)
{
const uint32_t clear_flags =
(pCreateInfo->pAttachments[attachment].loadOp == VK_ATTACHMENT_LOAD_OP_CLEAR ? 0x1 : 0x0) |
(pCreateInfo->pAttachments[attachment].stencilLoadOp == VK_ATTACHMENT_LOAD_OP_CLEAR ? 0x2 : 0x0);
if (clear_flags != 0)
renderpass_data.cleared_attachments.push_back({ clear_flags, attachment, pCreateInfo->pAttachments[attachment].initialLayout });
}
#endif
return VK_SUCCESS;
}
void VKAPI_CALL vkDestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks *pAllocator)
{
reshade::vulkan::device_impl *const device_impl = g_vulkan_devices.at(dispatch_key_from_handle(device));
GET_DISPATCH_PTR_FROM(DestroyRenderPass, device_impl);
#if RESHADE_ADDON
device_impl->_render_pass_list.erase(renderPass);
#endif
trampoline(device, renderPass, pAllocator);
}
VkResult VKAPI_CALL vkCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkFramebuffer *pFramebuffer)
{
reshade::vulkan::device_impl *const device_impl = g_vulkan_devices.at(dispatch_key_from_handle(device));
GET_DISPATCH_PTR_FROM(CreateFramebuffer, device_impl);
const VkResult result = trampoline(device, pCreateInfo, pAllocator, pFramebuffer);
if (result != VK_SUCCESS)
{
LOG(WARN) << "vkCreateFramebuffer" << " failed with error code " << result << '.';
return result;
}
#if RESHADE_ADDON
// Keep track of the frame buffer attachments
auto &attachments = device_impl->_framebuffer_list.emplace(*pFramebuffer);
attachments.resize(pCreateInfo->attachmentCount);
for (uint32_t i = 0; i < pCreateInfo->attachmentCount; ++i)
attachments[i] = { (uint64_t)pCreateInfo->pAttachments[i] };
#endif
return VK_SUCCESS;
}
void VKAPI_CALL vkDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks *pAllocator)
{
reshade::vulkan::device_impl *const device_impl = g_vulkan_devices.at(dispatch_key_from_handle(device));
GET_DISPATCH_PTR_FROM(DestroyFramebuffer, device_impl);
#if RESHADE_ADDON
device_impl->_framebuffer_list.erase(framebuffer);
#endif
trampoline(device, framebuffer, pAllocator);
}
VkResult VKAPI_CALL vkAllocateCommandBuffers(VkDevice device, const VkCommandBufferAllocateInfo *pAllocateInfo, VkCommandBuffer *pCommandBuffers)
{
reshade::vulkan::device_impl *const device_impl = g_vulkan_devices.at(dispatch_key_from_handle(device));
GET_DISPATCH_PTR_FROM(AllocateCommandBuffers, device_impl);
const VkResult result = trampoline(device, pAllocateInfo, pCommandBuffers);
if (result != VK_SUCCESS)
{
LOG(WARN) << "vkAllocateCommandBuffers" << " failed with error code " << result << '.';
return result;
}
#if RESHADE_ADDON
for (uint32_t i = 0; i < pAllocateInfo->commandBufferCount; ++i)
{
const auto cmd_impl = new reshade::vulkan::command_list_impl(device_impl, pCommandBuffers[i]);
if (!s_vulkan_command_buffers.emplace(pCommandBuffers[i], cmd_impl))
delete cmd_impl;
}
#endif
return VK_SUCCESS;
}
void VKAPI_CALL vkFreeCommandBuffers(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, const VkCommandBuffer *pCommandBuffers)
{
#if RESHADE_ADDON
for (uint32_t i = 0; i < commandBufferCount; ++i)
{
delete s_vulkan_command_buffers.erase(pCommandBuffers[i]);
}
#endif
GET_DISPATCH_PTR(FreeCommandBuffers, device);
trampoline(device, commandPool, commandBufferCount, pCommandBuffers);
}
VkResult VKAPI_CALL vkBeginCommandBuffer(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo *pBeginInfo)
{
#if RESHADE_ADDON
// Begin does perform an implicit reset if command pool was created with 'VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT'
reshade::invoke_addon_event<reshade::addon_event::reset_command_list>(
s_vulkan_command_buffers.at(commandBuffer));
#endif
GET_DISPATCH_PTR(BeginCommandBuffer, commandBuffer);
return trampoline(commandBuffer, pBeginInfo);
}
void VKAPI_CALL vkCmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline)
{
GET_DISPATCH_PTR(CmdBindPipeline, commandBuffer);
trampoline(commandBuffer, pipelineBindPoint, pipeline);
#if RESHADE_ADDON
reshade::invoke_addon_event<reshade::addon_event::bind_pipeline>(
s_vulkan_command_buffers.at(commandBuffer),
pipelineBindPoint == VK_PIPELINE_BIND_POINT_GRAPHICS ? reshade::api::pipeline_type::graphics : pipelineBindPoint == VK_PIPELINE_BIND_POINT_COMPUTE ? reshade::api::pipeline_type::compute : reshade::api::pipeline_type::unknown,
reshade::api::pipeline { (uint64_t)pipeline });
#endif
}
void VKAPI_CALL vkCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewport *pViewports)
{
GET_DISPATCH_PTR(CmdSetViewport, commandBuffer);
trampoline(commandBuffer, firstViewport, viewportCount, pViewports);
#if RESHADE_ADDON
static_assert(sizeof(*pViewports) == (sizeof(float) * 6));
reshade::invoke_addon_event<reshade::addon_event::bind_viewports>(
s_vulkan_command_buffers.at(commandBuffer), firstViewport, viewportCount, reinterpret_cast<const float *>(pViewports));
#endif
}
void VKAPI_CALL vkCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D *pScissors)
{
GET_DISPATCH_PTR(CmdSetScissor, commandBuffer);
trampoline(commandBuffer, firstScissor, scissorCount, pScissors);
#if RESHADE_ADDON
const auto rect_data = static_cast<int32_t *>(alloca(sizeof(int32_t) * 4 * scissorCount));
for (uint32_t i = 0, k = 0; i < scissorCount; ++i, k += 4)
{
rect_data[k + 0] = pScissors[i].offset.x;
rect_data[k + 1] = pScissors[i].offset.y;
rect_data[k + 2] = pScissors[i].offset.x + pScissors[i].extent.width;
rect_data[k + 3] = pScissors[i].offset.y + pScissors[i].extent.height;
}
reshade::invoke_addon_event<reshade::addon_event::bind_scissor_rects>(
s_vulkan_command_buffers.at(commandBuffer), firstScissor, scissorCount, rect_data);
#endif
}
void VKAPI_CALL vkCmdSetDepthBias(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor)
{
GET_DISPATCH_PTR(CmdSetDepthBias, commandBuffer);
trampoline(commandBuffer, depthBiasConstantFactor, depthBiasClamp, depthBiasSlopeFactor);
#if RESHADE_ADDON
const reshade::api::pipeline_state states[3] = { reshade::api::pipeline_state::depth_bias, reshade::api::pipeline_state::depth_bias_clamp, reshade::api::pipeline_state::depth_bias_slope_scaled };
const uint32_t values[3] = { static_cast<uint32_t>(static_cast<int32_t>(depthBiasConstantFactor)), *reinterpret_cast<const uint32_t *>(&depthBiasClamp), *reinterpret_cast<const uint32_t *>(&depthBiasSlopeFactor) };
reshade::invoke_addon_event<reshade::addon_event::bind_pipeline_states>(
s_vulkan_command_buffers.at(commandBuffer), 3, states, values);
#endif
}
void VKAPI_CALL vkCmdSetBlendConstants(VkCommandBuffer commandBuffer, const float blendConstants[4])
{
GET_DISPATCH_PTR(CmdSetBlendConstants, commandBuffer);
trampoline(commandBuffer, blendConstants);
#if RESHADE_ADDON
const reshade::api::pipeline_state state = reshade::api::pipeline_state::blend_constant;
const uint32_t value =
((static_cast<uint32_t>(blendConstants[0] * 255.f) & 0xFF) ) |
((static_cast<uint32_t>(blendConstants[1] * 255.f) & 0xFF) << 8) |
((static_cast<uint32_t>(blendConstants[2] * 255.f) & 0xFF) << 16) |
((static_cast<uint32_t>(blendConstants[3] * 255.f) & 0xFF) << 24);
reshade::invoke_addon_event<reshade::addon_event::bind_pipeline_states>(
s_vulkan_command_buffers.at(commandBuffer), 1, &state, &value);
#endif
}
void VKAPI_CALL vkCmdSetStencilCompareMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t compareMask)
{
GET_DISPATCH_PTR(CmdSetStencilCompareMask, commandBuffer);
trampoline(commandBuffer, faceMask, compareMask);
#if RESHADE_ADDON
if (faceMask != VK_STENCIL_FACE_FRONT_AND_BACK)
return;
const reshade::api::pipeline_state state = reshade::api::pipeline_state::stencil_read_mask;
reshade::invoke_addon_event<reshade::addon_event::bind_pipeline_states>(
s_vulkan_command_buffers.at(commandBuffer), 1, &state, &compareMask);
#endif
}
void VKAPI_CALL vkCmdSetStencilWriteMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t writeMask)
{
GET_DISPATCH_PTR(CmdSetStencilWriteMask, commandBuffer);
trampoline(commandBuffer, faceMask, writeMask);
#if RESHADE_ADDON
if (faceMask != VK_STENCIL_FACE_FRONT_AND_BACK)
return;
const reshade::api::pipeline_state state = reshade::api::pipeline_state::stencil_write_mask;
reshade::invoke_addon_event<reshade::addon_event::bind_pipeline_states>(
s_vulkan_command_buffers.at(commandBuffer), 1, &state, &writeMask);
#endif
}
void VKAPI_CALL vkCmdSetStencilReference(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t reference)
{
GET_DISPATCH_PTR(CmdSetStencilReference, commandBuffer);
trampoline(commandBuffer, faceMask, reference);
#if RESHADE_ADDON
if (faceMask != VK_STENCIL_FACE_FRONT_AND_BACK)
return;
const reshade::api::pipeline_state state = reshade::api::pipeline_state::stencil_reference_value;
reshade::invoke_addon_event<reshade::addon_event::bind_pipeline_states>(
s_vulkan_command_buffers.at(commandBuffer), 1, &state, &reference);
#endif
}
void VKAPI_CALL vkCmdBindDescriptorSets(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount, const VkDescriptorSet *pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t *pDynamicOffsets)
{
GET_DISPATCH_PTR(CmdBindDescriptorSets, commandBuffer);
trampoline(commandBuffer, pipelineBindPoint, layout, firstSet, descriptorSetCount, pDescriptorSets, dynamicOffsetCount, pDynamicOffsets);
#if RESHADE_ADDON
static_assert(sizeof(*pDescriptorSets) == sizeof(reshade::api::descriptor_set));
reshade::invoke_addon_event<reshade::addon_event::bind_descriptor_sets>(
s_vulkan_command_buffers.at(commandBuffer),
pipelineBindPoint == VK_PIPELINE_BIND_POINT_GRAPHICS ? reshade::api::pipeline_type::graphics : pipelineBindPoint == VK_PIPELINE_BIND_POINT_COMPUTE ? reshade::api::pipeline_type::compute : reshade::api::pipeline_type::unknown,
reshade::api::pipeline_layout { (uint64_t)layout },
firstSet,
descriptorSetCount,
reinterpret_cast<const reshade::api::descriptor_set *>(pDescriptorSets));
#endif
}
void VKAPI_CALL vkCmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType)
{
GET_DISPATCH_PTR(CmdBindIndexBuffer, commandBuffer);
trampoline(commandBuffer, buffer, offset, indexType);
#if RESHADE_ADDON
reshade::invoke_addon_event<reshade::addon_event::bind_index_buffer>(
s_vulkan_command_buffers.at(commandBuffer), reshade::api::resource { (uint64_t)buffer }, offset, buffer == VK_NULL_HANDLE ? 0 : indexType == VK_INDEX_TYPE_UINT8_EXT ? 1 : indexType == VK_INDEX_TYPE_UINT16 ? 2 : 4);
#endif
}
void VKAPI_CALL vkCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer *pBuffers, const VkDeviceSize *pOffsets)
{
GET_DISPATCH_PTR(CmdBindVertexBuffers, commandBuffer);
trampoline(commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets);
#if RESHADE_ADDON
static_assert(sizeof(*pBuffers) == sizeof(reshade::api::resource));
reshade::invoke_addon_event<reshade::addon_event::bind_vertex_buffers>(
s_vulkan_command_buffers.at(commandBuffer), firstBinding, bindingCount, reinterpret_cast<const reshade::api::resource *>(pBuffers), pOffsets, nullptr);
#endif
}
void VKAPI_CALL vkCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance)
{
#if RESHADE_ADDON
if (reshade::invoke_addon_event<reshade::addon_event::draw>(
s_vulkan_command_buffers.at(commandBuffer), vertexCount, instanceCount, firstVertex, firstInstance))
return;
#endif
GET_DISPATCH_PTR(CmdDraw, commandBuffer);
trampoline(commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance);
}
void VKAPI_CALL vkCmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance)
{
#if RESHADE_ADDON
if (reshade::invoke_addon_event<reshade::addon_event::draw_indexed>(
s_vulkan_command_buffers.at(commandBuffer), indexCount, instanceCount, firstIndex, vertexOffset, firstInstance))
return;
#endif
GET_DISPATCH_PTR(CmdDrawIndexed, commandBuffer);
trampoline(commandBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance);
}
void VKAPI_CALL vkCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride)
{
#if RESHADE_ADDON
if (reshade::invoke_addon_event<reshade::addon_event::draw_or_dispatch_indirect>(
s_vulkan_command_buffers.at(commandBuffer), 1, reshade::api::resource { (uint64_t)buffer }, offset, drawCount, stride))
return;
#endif
GET_DISPATCH_PTR(CmdDrawIndirect, commandBuffer);
trampoline(commandBuffer, buffer, offset, drawCount, stride);
}
void VKAPI_CALL vkCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride)
{
#if RESHADE_ADDON
if (reshade::invoke_addon_event<reshade::addon_event::draw_or_dispatch_indirect>(
s_vulkan_command_buffers.at(commandBuffer), 2, reshade::api::resource { (uint64_t)buffer }, offset, drawCount, stride))
return;
#endif
GET_DISPATCH_PTR(CmdDrawIndexedIndirect, commandBuffer);
trampoline(commandBuffer, buffer, offset, drawCount, stride);
}
void VKAPI_CALL vkCmdDispatch(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ)
{
#if RESHADE_ADDON
if (reshade::invoke_addon_event<reshade::addon_event::dispatch>(
s_vulkan_command_buffers.at(commandBuffer), groupCountX, groupCountY, groupCountZ))
return;
#endif
GET_DISPATCH_PTR(CmdDispatch, commandBuffer);
trampoline(commandBuffer, groupCountX, groupCountY, groupCountZ);
}
void VKAPI_CALL vkCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset)
{
#if RESHADE_ADDON
if (reshade::invoke_addon_event<reshade::addon_event::draw_or_dispatch_indirect>(
s_vulkan_command_buffers.at(commandBuffer), 3, reshade::api::resource { (uint64_t)buffer }, offset, 1, 0))
return;
#endif
GET_DISPATCH_PTR(CmdDispatchIndirect, commandBuffer);
trampoline(commandBuffer, buffer, offset);
}
void VKAPI_CALL vkCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferCopy *pRegions)
{
#if RESHADE_ADDON
for (uint32_t i = 0; i < regionCount; ++i)
{
const VkBufferCopy ®ion = pRegions[i];
if (reshade::invoke_addon_event<reshade::addon_event::copy_buffer_region>(
s_vulkan_command_buffers.at(commandBuffer),
reshade::api::resource { (uint64_t)srcBuffer }, region.srcOffset,
reshade::api::resource { (uint64_t)dstBuffer }, region.dstOffset, region.size))
return; // TODO: This skips copy of all regions, rather than just the one specified to this event call
}
#endif
GET_DISPATCH_PTR(CmdCopyBuffer, commandBuffer);
trampoline(commandBuffer, srcBuffer, dstBuffer, regionCount, pRegions);
}
void VKAPI_CALL vkCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy *pRegions)
{
reshade::vulkan::device_impl *const device_impl = g_vulkan_devices.at(dispatch_key_from_handle(commandBuffer));
assert(device_impl != nullptr);
#if RESHADE_ADDON
for (uint32_t i = 0; i < regionCount; ++i)
{
const VkImageCopy ®ion = pRegions[i];
const int32_t src_box[6] = {
region.srcOffset.x,
region.srcOffset.y,
region.srcOffset.z,
region.srcOffset.x + static_cast<int32_t>(region.extent.width),
region.srcOffset.y + static_cast<int32_t>(region.extent.height),
region.srcOffset.z + static_cast<int32_t>(region.extent.depth)
};
const int32_t dst_box[6] = {
region.dstOffset.x,
region.dstOffset.y,
region.dstOffset.z,
region.dstOffset.x + static_cast<int32_t>(region.extent.width),
region.dstOffset.y + static_cast<int32_t>(region.extent.height),
region.dstOffset.z + static_cast<int32_t>(region.extent.depth)
};
for (uint32_t layer = 0; layer < region.srcSubresource.layerCount; ++layer)
{
if (reshade::invoke_addon_event<reshade::addon_event::copy_texture_region>(
s_vulkan_command_buffers.at(commandBuffer),
reshade::api::resource { (uint64_t)srcImage }, device_impl->get_subresource_index(srcImage, region.srcSubresource, layer), src_box,
reshade::api::resource { (uint64_t)dstImage }, device_impl->get_subresource_index(dstImage, region.dstSubresource, layer), dst_box,
reshade::api::texture_filter::min_mag_mip_point))
return; // TODO: This skips copy of all regions, rather than just the one specified to this event call
}
}
#endif
GET_DISPATCH_PTR_FROM(CmdCopyImage, device_impl);
trampoline(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions);
}
void VKAPI_CALL vkCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageBlit *pRegions, VkFilter filter)
{
reshade::vulkan::device_impl *const device_impl = g_vulkan_devices.at(dispatch_key_from_handle(commandBuffer));
GET_DISPATCH_PTR_FROM(CmdBlitImage, device_impl);
#if RESHADE_ADDON
for (uint32_t i = 0; i < regionCount; ++i)
{
const VkImageBlit ®ion = pRegions[i];
for (uint32_t layer = 0; layer < region.srcSubresource.layerCount; ++layer)
{
if (reshade::invoke_addon_event<reshade::addon_event::copy_texture_region>(
s_vulkan_command_buffers.at(commandBuffer),
reshade::api::resource { (uint64_t)srcImage }, device_impl->get_subresource_index(srcImage, region.srcSubresource, layer), ®ion.srcOffsets[0].x,
reshade::api::resource { (uint64_t)dstImage }, device_impl->get_subresource_index(dstImage, region.dstSubresource, layer), ®ion.dstOffsets[0].x,
filter == VK_FILTER_NEAREST ? reshade::api::texture_filter::min_mag_mip_point : reshade::api::texture_filter::min_mag_mip_linear))
return; // TODO: This skips copy of all regions, rather than just the one specified to this event call
}
}
#endif
trampoline(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions, filter);
}
void VKAPI_CALL vkCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkBufferImageCopy *pRegions)
{
reshade::vulkan::device_impl *const device_impl = g_vulkan_devices.at(dispatch_key_from_handle(commandBuffer));
GET_DISPATCH_PTR_FROM(CmdCopyBufferToImage, device_impl);
#if RESHADE_ADDON
for (uint32_t i = 0; i < regionCount; ++i)
{
const VkBufferImageCopy ®ion = pRegions[i];
for (uint32_t layer = 0; layer < region.imageSubresource.layerCount; ++layer)
{
const int32_t dst_box[6] = {
region.imageOffset.x,
region.imageOffset.y,
region.imageOffset.z,
region.imageOffset.x + static_cast<int32_t>(region.imageExtent.width),
region.imageOffset.y + static_cast<int32_t>(region.imageExtent.height),
region.imageOffset.z + static_cast<int32_t>(region.imageExtent.depth)
};
// TODO: Calculate correct buffer offset for layers following the first
if (reshade::invoke_addon_event<reshade::addon_event::copy_buffer_to_texture>(
s_vulkan_command_buffers.at(commandBuffer),
reshade::api::resource { (uint64_t)srcBuffer }, region.bufferOffset, region.bufferRowLength, region.bufferImageHeight,
reshade::api::resource { (uint64_t)dstImage }, device_impl->get_subresource_index(dstImage, region.imageSubresource, layer), dst_box))
return; // TODO: This skips copy of all regions, rather than just the one specified to this event call
}
}
#endif
trampoline(commandBuffer, srcBuffer, dstImage, dstImageLayout, regionCount, pRegions);
}
void VKAPI_CALL vkCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy *pRegions)
{
reshade::vulkan::device_impl *const device_impl = g_vulkan_devices.at(dispatch_key_from_handle(commandBuffer));
GET_DISPATCH_PTR_FROM(CmdCopyImageToBuffer, device_impl);
#if RESHADE_ADDON
for (uint32_t i = 0; i < regionCount; ++i)
{
const VkBufferImageCopy ®ion = pRegions[i];
for (uint32_t layer = 0; layer < region.imageSubresource.layerCount; ++layer)
{
const int32_t src_box[6] = {
region.imageOffset.x,
region.imageOffset.y,
region.imageOffset.z,
region.imageOffset.x + static_cast<int32_t>(region.imageExtent.width),
region.imageOffset.y + static_cast<int32_t>(region.imageExtent.height),
region.imageOffset.z + static_cast<int32_t>(region.imageExtent.depth)
};
// TODO: Calculate correct buffer offset for layers following the first
if (reshade::invoke_addon_event<reshade::addon_event::copy_texture_to_buffer>(
s_vulkan_command_buffers.at(commandBuffer),
reshade::api::resource { (uint64_t)srcImage }, device_impl->get_subresource_index(srcImage, region.imageSubresource, layer), src_box,
reshade::api::resource { (uint64_t)dstBuffer }, region.bufferOffset, region.bufferRowLength, region.bufferImageHeight))
return; // TODO: This skips copy of all regions, rather than just the one specified to this event call
}
}
#endif
trampoline(commandBuffer, srcImage, srcImageLayout, dstBuffer, regionCount, pRegions);
}
void VKAPI_CALL vkCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue *pColor, uint32_t rangeCount, const VkImageSubresourceRange *pRanges)
{
reshade::vulkan::device_impl *const device_impl = g_vulkan_devices.at(dispatch_key_from_handle(commandBuffer));
GET_DISPATCH_PTR_FROM(CmdClearColorImage, device_impl);
#if RESHADE_ADDON
VkImageMemoryBarrier transition { VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER };
transition.oldLayout = imageLayout;
transition.newLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
transition.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
transition.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
transition.image = image;
for (uint32_t i = 0; i < rangeCount; ++i)
{
transition.subresourceRange.aspectMask |= pRanges[i].aspectMask;
transition.subresourceRange.baseMipLevel = std::min(transition.subresourceRange.baseMipLevel, pRanges[i].baseMipLevel);
transition.subresourceRange.levelCount = std::max(transition.subresourceRange.levelCount, pRanges[i].levelCount);
transition.subresourceRange.baseArrayLayer = std::min(transition.subresourceRange.baseArrayLayer, pRanges[i].baseArrayLayer);
transition.subresourceRange.layerCount = std::max(transition.subresourceRange.layerCount, pRanges[i].layerCount);
}
device_impl->_dispatch_table.CmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, 0, 0, nullptr, 0, nullptr, 1, &transition);
const reshade::api::resource_view rtv = device_impl->get_default_view(image);
const bool skip = reshade::invoke_addon_event<reshade::addon_event::clear_render_target_views>(
s_vulkan_command_buffers.at(commandBuffer),
1,
&rtv,
pColor->float32);
std::swap(transition.oldLayout, transition.newLayout);
device_impl->_dispatch_table.CmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, 0, 0, nullptr, 0, nullptr, 1, &transition);
if (skip)
return;
#endif
trampoline(commandBuffer, image, imageLayout, pColor, rangeCount, pRanges);
}
void VKAPI_CALL vkCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue *pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange *pRanges)
{
reshade::vulkan::device_impl *const device_impl = g_vulkan_devices.at(dispatch_key_from_handle(commandBuffer));
GET_DISPATCH_PTR_FROM(CmdClearDepthStencilImage, device_impl);
#if RESHADE_ADDON
VkImageMemoryBarrier transition { VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER };
transition.oldLayout = imageLayout;
transition.newLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
transition.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
transition.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
transition.image = image;
for (uint32_t i = 0; i < rangeCount; ++i)
{
transition.subresourceRange.aspectMask |= pRanges[i].aspectMask;
transition.subresourceRange.baseMipLevel = std::min(transition.subresourceRange.baseMipLevel, pRanges[i].baseMipLevel);
transition.subresourceRange.levelCount = std::max(transition.subresourceRange.levelCount, pRanges[i].levelCount);
transition.subresourceRange.baseArrayLayer = std::min(transition.subresourceRange.baseArrayLayer, pRanges[i].baseArrayLayer);
transition.subresourceRange.layerCount = std::max(transition.subresourceRange.layerCount, pRanges[i].layerCount);
}
device_impl->_dispatch_table.CmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, 0, 0, nullptr, 0, nullptr, 1, &transition);
const bool skip = reshade::invoke_addon_event<reshade::addon_event::clear_depth_stencil_view>(
s_vulkan_command_buffers.at(commandBuffer),
device_impl->get_default_view(image),
(transition.subresourceRange.aspectMask & VK_IMAGE_ASPECT_DEPTH_BIT ? 0x1 : 0x0) | (transition.subresourceRange.aspectMask & VK_IMAGE_ASPECT_STENCIL_BIT ? 0x2 : 0x0),
pDepthStencil->depth,
static_cast<uint8_t>(pDepthStencil->stencil));
std::swap(transition.oldLayout, transition.newLayout);
device_impl->_dispatch_table.CmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, 0, 0, nullptr, 0, nullptr, 1, &transition);
if (skip)
return;
#endif
trampoline(commandBuffer, image, imageLayout, pDepthStencil, rangeCount, pRanges);
}
void VKAPI_CALL vkCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount, const VkClearAttachment *pAttachments, uint32_t rectCount, const VkClearRect *pRects)
{
reshade::vulkan::device_impl *const device_impl = g_vulkan_devices.at(dispatch_key_from_handle(commandBuffer));
GET_DISPATCH_PTR_FROM(CmdClearAttachments, device_impl);
#if RESHADE_ADDON
reshade::vulkan::command_list_impl *const cmd_impl = s_vulkan_command_buffers.at(commandBuffer);
if (cmd_impl != nullptr)
{
assert(cmd_impl->current_renderpass != VK_NULL_HANDLE);
assert(cmd_impl->current_framebuffer != VK_NULL_HANDLE);
const auto &attachments = device_impl->_framebuffer_list.at(cmd_impl->current_framebuffer);
const auto &renderpass_data = device_impl->_render_pass_list.at(cmd_impl->current_renderpass);
const auto &renderpass_data_subpass = renderpass_data.subpasses[cmd_impl->current_subpass];
for (uint32_t i = 0; i < attachmentCount; ++i)
{
const VkClearAttachment &attachment = pAttachments[i];
if (attachment.aspectMask & VK_IMAGE_ASPECT_COLOR_BIT)
{
if (const reshade::api::resource_view rtv = attachments[attachment.colorAttachment];
reshade::invoke_addon_event<reshade::addon_event::clear_render_target_views>(cmd_impl, 1, &rtv, attachment.clearValue.color.float32))
return; // This will skip clears of all attachments, not just the one from this event
}
else
{
assert(renderpass_data_subpass.depth_stencil_attachment.attachment != VK_ATTACHMENT_UNUSED);
if (const reshade::api::resource_view dsv = attachments[renderpass_data_subpass.depth_stencil_attachment.attachment];
reshade::invoke_addon_event<reshade::addon_event::clear_depth_stencil_view>(
cmd_impl,
dsv,
(attachment.aspectMask & VK_IMAGE_ASPECT_DEPTH_BIT ? 0x1 : 0x0) | (attachment.aspectMask & VK_IMAGE_ASPECT_STENCIL_BIT ? 0x2 : 0x0),
attachment.clearValue.depthStencil.depth,
static_cast<uint8_t>(attachment.clearValue.depthStencil.stencil)))
return;
}
}
}
#endif
trampoline(commandBuffer, attachmentCount, pAttachments, rectCount, pRects);
}
void VKAPI_CALL vkCmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageResolve *pRegions)
{
reshade::vulkan::device_impl *const device_impl = g_vulkan_devices.at(dispatch_key_from_handle(commandBuffer));
GET_DISPATCH_PTR_FROM(CmdResolveImage, device_impl);
#if RESHADE_ADDON
for (uint32_t i = 0; i < regionCount; ++i)
{
const VkImageResolve ®ion = pRegions[i];
const int32_t src_box[6] = {
region.srcOffset.x,
region.srcOffset.y,
region.srcOffset.z,
region.srcOffset.x + static_cast<int32_t>(region.extent.width),
region.srcOffset.y + static_cast<int32_t>(region.extent.height),
region.srcOffset.z + static_cast<int32_t>(region.extent.depth)
};
const int32_t dst_box[6] = {
region.dstOffset.x,
region.dstOffset.y,
region.dstOffset.z,
region.dstOffset.x + static_cast<int32_t>(region.extent.width),
region.dstOffset.y + static_cast<int32_t>(region.extent.height),
region.dstOffset.z + static_cast<int32_t>(region.extent.depth)
};
for (uint32_t layer = 0; layer < region.srcSubresource.layerCount; ++layer)
{
if (reshade::invoke_addon_event<reshade::addon_event::resolve_texture_region>(
s_vulkan_command_buffers.at(commandBuffer),
reshade::api::resource { (uint64_t)srcImage }, device_impl->get_subresource_index(srcImage, region.srcSubresource, layer), src_box,
reshade::api::resource { (uint64_t)dstImage }, device_impl->get_subresource_index(dstImage, region.dstSubresource, layer), dst_box, reshade::api::format::unknown))
return; // TODO: This skips resolve of all regions, rather than just the one specified to this event call
}
}
#endif
trampoline(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions);
}
void VKAPI_CALL vkCmdPushConstants(VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const void *pValues)
{
GET_DISPATCH_PTR(CmdPushConstants, commandBuffer);
trampoline(commandBuffer, layout, stageFlags, offset, size, pValues);
#if RESHADE_ADDON
reshade::invoke_addon_event<reshade::addon_event::push_constants>(
s_vulkan_command_buffers.at(commandBuffer),
static_cast<reshade::api::shader_stage>(stageFlags),
reshade::api::pipeline_layout { (uint64_t)layout },
0,
offset / 4,
size / 4,
static_cast<const uint32_t *>(pValues));
#endif
}
void VKAPI_CALL vkCmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo *pRenderPassBegin, VkSubpassContents contents)
{
reshade::vulkan::device_impl *const device_impl = g_vulkan_devices.at(dispatch_key_from_handle(commandBuffer));
GET_DISPATCH_PTR_FROM(CmdBeginRenderPass, device_impl);
#if RESHADE_ADDON
reshade::vulkan::command_list_impl *const cmd_impl = s_vulkan_command_buffers.at(commandBuffer);
if (cmd_impl != nullptr)
{
cmd_impl->current_subpass = 0;
cmd_impl->current_renderpass = pRenderPassBegin->renderPass;
cmd_impl->current_framebuffer = pRenderPassBegin->framebuffer;
const auto &attachments = device_impl->_framebuffer_list.at(cmd_impl->current_framebuffer);
const auto &renderpass_data = device_impl->_render_pass_list.at(cmd_impl->current_renderpass);
const auto &renderpass_data_subpass = renderpass_data.subpasses[0];
assert(renderpass_data.cleared_attachments.size() == pRenderPassBegin->clearValueCount);
for (uint32_t i = 0; i < renderpass_data.cleared_attachments.size() && i < pRenderPassBegin->clearValueCount; ++i)
{
const VkClearValue &clear_value = pRenderPassBegin->pClearValues[i];
if (renderpass_data.cleared_attachments[i].index != renderpass_data_subpass.depth_stencil_attachment.attachment)
{
if (!reshade::addon::event_list[static_cast<uint32_t>(reshade::addon_event::clear_render_target_views)].empty())
{
reshade::api::resource image = { 0 };
device_impl->get_resource_from_view(attachments[renderpass_data.cleared_attachments[i].index], &image);
VkImageMemoryBarrier transition { VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER };
transition.oldLayout = renderpass_data.cleared_attachments[i].initial_layout;
transition.newLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
transition.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
transition.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
transition.image = (VkImage)image.handle;
transition.subresourceRange = { VK_IMAGE_ASPECT_COLOR_BIT, 0, VK_REMAINING_MIP_LEVELS, 0, VK_REMAINING_ARRAY_LAYERS };
assert(renderpass_data.cleared_attachments[i].clear_flags == 0x1);
device_impl->_dispatch_table.CmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, 0, 0, nullptr, 0, nullptr, 1, &transition);
reshade::invoke_addon_event<reshade::addon_event::clear_render_target_views>( // Cannot be skipped
cmd_impl, 1, &attachments[renderpass_data.cleared_attachments[i].index], clear_value.color.float32);
std::swap(transition.oldLayout, transition.newLayout);
device_impl->_dispatch_table.CmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, 0, 0, nullptr, 0, nullptr, 1, &transition);
}
}
else
{
if (!reshade::addon::event_list[static_cast<uint32_t>(reshade::addon_event::clear_depth_stencil_view)].empty())
{
reshade::api::resource image = { 0 };
device_impl->get_resource_from_view(attachments[renderpass_data.cleared_attachments[i].index], &image);
VkImageMemoryBarrier transition { VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER };
transition.oldLayout = renderpass_data.cleared_attachments[i].initial_layout;
transition.newLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
transition.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
transition.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
transition.image = (VkImage)image.handle;
transition.subresourceRange = { 0, 0, VK_REMAINING_MIP_LEVELS, 0, VK_REMAINING_ARRAY_LAYERS };
if ((renderpass_data.cleared_attachments[i].clear_flags & 0x1) == 0x1)
transition.subresourceRange.aspectMask |= VK_IMAGE_ASPECT_DEPTH_BIT;
if ((renderpass_data.cleared_attachments[i].clear_flags & 0x2) == 0x2)
transition.subresourceRange.aspectMask |= VK_IMAGE_ASPECT_STENCIL_BIT;
device_impl->_dispatch_table.CmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, 0, 0, nullptr, 0, nullptr, 1, &transition);
reshade::invoke_addon_event<reshade::addon_event::clear_depth_stencil_view>( // Cannot be skipped
cmd_impl, attachments[renderpass_data.cleared_attachments[i].index], renderpass_data.cleared_attachments[i].clear_flags, clear_value.depthStencil.depth, static_cast<uint8_t>(clear_value.depthStencil.stencil));
std::swap(transition.oldLayout, transition.newLayout);
device_impl->_dispatch_table.CmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, 0, 0, nullptr, 0, nullptr, 1, &transition);
}
}
}
}
#endif
trampoline(commandBuffer, pRenderPassBegin, contents);
#if RESHADE_ADDON
if (cmd_impl != nullptr)
{
const auto &attachments = device_impl->_framebuffer_list.at(cmd_impl->current_framebuffer);
const auto &renderpass_data = device_impl->_render_pass_list.at(cmd_impl->current_renderpass);
const auto &renderpass_data_subpass = renderpass_data.subpasses[0];
auto rtvs = static_cast<reshade::api::resource_view *>(alloca(sizeof(reshade::api::resource_view) * renderpass_data_subpass.color_attachments.size()));
for (uint32_t i = 0; i < renderpass_data_subpass.color_attachments.size(); ++i)
if (renderpass_data_subpass.color_attachments[i].attachment != VK_ATTACHMENT_UNUSED)
rtvs[i] = attachments[renderpass_data_subpass.color_attachments[i].attachment];
else
rtvs[i] = reshade::api::resource_view { 0 };
reshade::api::resource_view dsv = { 0 };
if (renderpass_data_subpass.depth_stencil_attachment.attachment != VK_ATTACHMENT_UNUSED)
dsv = attachments[renderpass_data_subpass.depth_stencil_attachment.attachment];
reshade::invoke_addon_event<reshade::addon_event::begin_render_pass>(cmd_impl, static_cast<uint32_t>(renderpass_data_subpass.color_attachments.size()), rtvs, dsv);
}
#endif
}
void VKAPI_CALL vkCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents)
{
reshade::vulkan::device_impl *const device_impl = g_vulkan_devices.at(dispatch_key_from_handle(commandBuffer));
GET_DISPATCH_PTR_FROM(CmdNextSubpass, device_impl);
#if RESHADE_ADDON
reshade::vulkan::command_list_impl *const cmd_impl = s_vulkan_command_buffers.at(commandBuffer);
if (cmd_impl != nullptr)
{
reshade::invoke_addon_event<reshade::addon_event::finish_render_pass>(cmd_impl);
cmd_impl->current_subpass++;
assert(cmd_impl->current_renderpass != VK_NULL_HANDLE);
assert(cmd_impl->current_framebuffer != VK_NULL_HANDLE);
}
#endif
trampoline(commandBuffer, contents);
#if RESHADE_ADDON
if (cmd_impl != nullptr)
{
const auto &attachments = device_impl->_framebuffer_list.at(cmd_impl->current_framebuffer);
const auto &renderpass_data = device_impl->_render_pass_list.at(cmd_impl->current_renderpass);
const auto &renderpass_data_subpass = renderpass_data.subpasses[cmd_impl->current_subpass];
auto rtvs = static_cast<reshade::api::resource_view *>(alloca(sizeof(reshade::api::resource_view) * renderpass_data_subpass.color_attachments.size()));
for (uint32_t i = 0; i < renderpass_data_subpass.color_attachments.size(); ++i)
if (renderpass_data_subpass.color_attachments[i].attachment != VK_ATTACHMENT_UNUSED)
rtvs[i] = attachments[renderpass_data_subpass.color_attachments[i].attachment];
else
rtvs[i] = reshade::api::resource_view { 0 };
reshade::api::resource_view dsv = { 0 };
if (renderpass_data_subpass.depth_stencil_attachment.attachment != VK_ATTACHMENT_UNUSED)
dsv = attachments[renderpass_data_subpass.depth_stencil_attachment.attachment];
reshade::invoke_addon_event<reshade::addon_event::begin_render_pass>(cmd_impl, static_cast<uint32_t>(renderpass_data_subpass.color_attachments.size()), rtvs, dsv);
}
#endif
}
void VKAPI_CALL vkCmdEndRenderPass(VkCommandBuffer commandBuffer)
{
#if RESHADE_ADDON
reshade::vulkan::command_list_impl *const cmd_impl = s_vulkan_command_buffers.at(commandBuffer);
if (cmd_impl != nullptr)
{
reshade::invoke_addon_event<reshade::addon_event::finish_render_pass>(cmd_impl);
cmd_impl->current_subpass = std::numeric_limits<uint32_t>::max();
cmd_impl->current_renderpass = VK_NULL_HANDLE;
cmd_impl->current_framebuffer = VK_NULL_HANDLE;
}
#endif
GET_DISPATCH_PTR(CmdEndRenderPass, commandBuffer);
trampoline(commandBuffer);
}
void VKAPI_CALL vkCmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBufferCount, const VkCommandBuffer *pCommandBuffers)
{
#if RESHADE_ADDON
for (uint32_t i = 0; i < commandBufferCount; ++i)
reshade::invoke_addon_event<reshade::addon_event::execute_secondary_command_list>(
s_vulkan_command_buffers.at(commandBuffer),
s_vulkan_command_buffers.at(pCommandBuffers[i]));
#endif
GET_DISPATCH_PTR(CmdExecuteCommands, commandBuffer);
trampoline(commandBuffer, commandBufferCount, pCommandBuffers);
}
|
3bd1b9a0c3f09aa89b8c5ebf75e196be1451abea | eef9cdafb7476427d194374cc11a54a068c30325 | /dataModelControl.cpp | 16af9173d1c966ff27116b919d196e969bf5b565 | [] | no_license | geetika016/FindMeAPet | 3988ecbb87fa0c92c2424f8b628d741cf99810b6 | 43a7dcceb1c01a170d3101c30017a541df89b02b | refs/heads/master | 2020-06-20T09:43:33.569960 | 2019-07-15T22:44:58 | 2019-07-15T22:44:58 | 197,078,766 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,476 | cpp | dataModelControl.cpp | #include "dataModelControl.h"
DataModelControl::DataModelControl(QObject *parent) : QObject(parent)
{
}
bool DataModelControl::buildModel(DataModel *output, DBSettings *settings)
{
output->setEditStrategy(settings->editStrategy);
output->setTable(settings->table);
if ((settings->colHeaderOperation->name) == QString("replace"))
{
for(int i=0; i<output->columnCount(); i++)
output->setHeaderData(i, Qt::Horizontal, output->headerData(i, Qt::Horizontal).
toString().replace(settings->colHeaderOperation->arg1, settings->colHeaderOperation->arg2));
}
if (!output->select())
return false;
if ((settings->cellsOperation != NULL) && (settings->cellsOperation->name) == QString("overwrite"))
{
QMetaType::Type dataType = settings->cellsOperation->dataType;
for(int i=0; i<output->rowCount(); i++)
for(int j=0; j<output->columnCount(); j++)
{
if (output->data(output->index(i, j)).userType() == dataType)
{
if (dataType == QMetaType::QString)
if(output->data(output->index(i, j)).toString() == settings->cellsOperation->arg1)
output->setData(output->index(i, j), settings->cellsOperation->arg2);
}
}
}
if (output->lastError().type() != QSqlError::NoError)
return false;
return true;
}
|
6d46df999b9b84ed6f4c89dd0f56e6261f50da1f | fea4453cb3ad97e03fae8166aedc7965db57eb52 | /Hacker rank/20-20 hack oct-2013.cpp | 8cdbfb200c5b59bdec91e4b98badc9d73b58f2e1 | [] | no_license | gauravchl/sourcecode | 59652b02fe6d7c952b4efdae05ad8ec15113de1e | da8589088040fc80cea1f72e035c1951290bbff0 | refs/heads/master | 2021-06-02T03:50:12.143969 | 2018-12-11T09:21:35 | 2018-12-11T09:21:35 | 15,161,449 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 402 | cpp | 20-20 hack oct-2013.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int t,n,c,m,tc,rw,temp;
cin>>t;
for(int x=0;x<t;x++)
{ cin>>n>>c>>m;
tc=n/c;
rw=tc;
while(m<=rw)
{
temp=rw/m;
tc=tc+temp;
rw=(rw%m)+temp;
}
cout<<tc<<endl;
}
} |
658ed1761ac7d2dd1b1fb72a2bb86806a5ff67cc | 112021b2aab61cd24847b72aeb856e887c028d25 | /Assignments/Solutions/Manika Joshi/Assignment16/Q1.cpp | 50f7cf68c80099f26f9132d2465538cf1bf8a9f7 | [] | no_license | amanraj-iit/DSA_Uplift_Project | 0ad8b82da3ebfe7ebd6ab245e3c9fa0179bfbef1 | 11cf887fdbad4b98b0dfe317f625eedd15460c57 | refs/heads/master | 2023-07-28T06:37:36.313839 | 2021-09-15T11:29:34 | 2021-09-15T11:29:34 | 406,765,764 | 10 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 964 | cpp | Q1.cpp | class Solution {
public:
bool isValid(string s) {
int i=0;
string str;
stack<char> stack;
/* if(s[i]=='{' ||s[i]=='(' ||s[i]=='[')
{
stack.push(s[i]);
}
*/
while(s[i])
{
if(s[i]=='{' ||s[i]=='(' ||s[i]=='[')
stack.push(s[i]);
else if(stack.size()!=0)
{
if(stack.top()=='{' && s[i]=='}')
stack.pop();
else if(stack.top()=='(' && s[i]==')')
stack.pop();
else if(stack.top()=='[' && s[i]==']')
stack.pop();
else
break;
}
else
stack.push(s[i]);
i++;
}
if(stack.size()==0)
return true;
else return false;
}
};
|
45db693148241477db2b085f1ac2cedeba7121a9 | f0bcb33947a68900a6ce2b92a4fd8362bf537311 | /Encounter-Server/Chest.h | 197934e8855d093a4f481d578e006d137cf0b0db | [] | no_license | paolo21d/Encounter-Server | b84445733df4b90248faa832424d678de0b02085 | c5794a38ccbe57b762ef08af58daf664e9000784 | refs/heads/master | 2020-04-05T09:43:29.187584 | 2018-12-23T22:30:20 | 2018-12-23T22:30:20 | 156,771,070 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 275 | h | Chest.h | #pragma once
#include "Object.h"
#include "Deck.h"
class Chest : public Object {
Deck myDeck; //kart
int gold; //pieniądze w skrzyni
public:
Chest();
Chest(Deck&& myDeck_, int gold_);
~Chest();
virtual void interaction(Hero& invader); //odpal skrzynkę
};
|
45284eaa41c55f9c4d0d7666d529293c784da0a7 | c0f86cdbc48ed2d9315dfc356adae28d41810ff6 | /GameTemplate/Source/GameEngine/PhysicsManager.cpp | 0dd08094862e17274b493fab8431979410e9afdc | [] | no_license | ElToChetao/gameEngine | 0d2b8d96bf3910e0f82a2c05774e0c5e0c42722d | cc642be3d8bdffcce45bff4874255cc0d18a866c | refs/heads/main | 2023-02-23T22:24:11.684910 | 2021-01-10T19:55:09 | 2021-01-10T19:55:09 | 314,352,567 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,841 | cpp | PhysicsManager.cpp | #include "PhysicsManager.h"
PhysicsManager::PhysicsManager(){}
void PhysicsManager::Update() {
vector<GameObject*> go = GameObjectManager::GetInstance().GetGameObjects();
for (int i = 0; i < go.size(); i++) {
if (go[i]->collider != NULL)
{
for (int j = i + 1; j < go.size(); j++)
{
if (go[j]->collider != NULL)
{
bool isColliding = CheckCollisions(go[i], go[j]);
UpdateState(go[i], isColliding, go[j]);
UpdateState(go[j], isColliding, go[i]);
}
}
}
}
}
void PhysicsManager::UpdateState(GameObject* go, bool collision, GameObject* go2)
{
if (!go->collider->isOnCollision && collision)
{
go->onCollisionEnter(go2);
}
else if (go->collider->isOnCollision && collision)
{
go->onCollisionStay(go2);
}
else if (go->collider->isOnCollision && !collision)
{
go->onCollisionExit(go2);
}
go->collider->isOnCollision = collision;
}
bool PhysicsManager::CheckCollisions(GameObject* go, GameObject* other) {
if (go->collider->isRect && other->collider->isRect)
{
return CheckRectCollisions(go, other);
}
else if (!go->collider->isRect && !other->collider->isRect)
{
return CheckCircleCollisions(go, other);
}
else
{
//go must always be RectCollider
if (go->collider->isRect)
{
return CheckRectCircleCollisions(go, other);
}
else
{
return CheckRectCircleCollisions(other, go);
}
}
}
bool PhysicsManager::CheckCircleCollisions(GameObject* go, GameObject* other)
{
Vector2 centerCircle1 = go->getCenterPosition();
Vector2 centerCircle2 = other->getCenterPosition();
//Calculate total radius squared
int totalRadiusSquared = go->collider->radius + other->collider->radius;
totalRadiusSquared = totalRadiusSquared * totalRadiusSquared;
//If the distance between the centers of the circles is less than the sum of their radii
return (distanceSquared(centerCircle1.x, centerCircle1.y, centerCircle2.x, centerCircle2.y) < (totalRadiusSquared));
}
bool PhysicsManager::CheckCircleCollisions(Vector2 position, float radius, GameObject* other)
{
Vector2 centerCircle2 = other->getCenterPosition();
//Calculate total radius squared
int totalRadiusSquared = radius + other->collider->radius;
totalRadiusSquared = totalRadiusSquared * totalRadiusSquared;
//If the distance between the centers of the circles is less than the sum of their radii
return (distanceSquared(position.x, position.y, centerCircle2.x, centerCircle2.y) < (totalRadiusSquared));
}
double PhysicsManager::distanceSquared(int x1, int y1, int x2, int y2)
{
int deltaX = x2 - x1;
int deltaY = y2 - y1;
return deltaX * deltaX + deltaY * deltaY;
}
bool PhysicsManager::CheckRectCollisions(GameObject* go, GameObject* other)
{
return (go->transform.position.x < other->transform.position.x + other->transform.size.x &&
go->transform.position.x + other->transform.size.x > other->transform.size.x &&
go->transform.position.y < other->transform.position.y + other->transform.size.y &&
go->transform.size.y + go->transform.position.y > other->transform.position.y);
}
bool PhysicsManager::CheckRectCircleCollisions(GameObject* rect, GameObject* circle)
{
Vector2 centerCircle = circle->getCenterPosition();
// temporary variables to set edges for testing
int testX = 0;
int testY = 0;
// which edge is closest?
if (centerCircle.x < rect->transform.position.x)
{
testX = rect->transform.position.x; // left edge
}
else if (centerCircle.x > rect->transform.position.x + rect->transform.size.x)
{
testX = rect->transform.position.x + rect->transform.size.x; // right edge
}
else
{
testX = centerCircle.x;
}
if (centerCircle.y < rect->transform.position.y) {
testY = rect->transform.position.y; // top edge
}
else if (centerCircle.y > rect->transform.position.y + rect->transform.size.y)
{
testY = rect->transform.position.y + rect->transform.size.y; // bottom edge
}
else
{
testY = centerCircle.y;
}
// if the distance is less than the radius, collision!
return distanceSquared(centerCircle.x, centerCircle.y, testX, testY) < (circle->collider->radius * circle->collider->radius);
}
bool PhysicsManager::CheckRectCircleCollisions(GameObject* rect, Vector2 centerCircle, float radius)
{
// temporary variables to set edges for testing
int testX = 0;
int testY = 0;
// which edge is closest?
if (centerCircle.x < rect->transform.position.x)
{
testX = rect->transform.position.x; // left edge
}
else if (centerCircle.x > rect->transform.position.x + rect->transform.size.x)
{
testX = rect->transform.position.x + rect->transform.size.x; // right edge
}
else
{
testX = centerCircle.x;
}
if (centerCircle.y < rect->transform.position.y) {
testY = rect->transform.position.y; // top edge
}
else if (centerCircle.y > rect->transform.position.y + rect->transform.size.y)
{
testY = rect->transform.position.y + rect->transform.size.y; // bottom edge
}
else
{
testY = centerCircle.y;
}
// if the distance is less than the radius, collision!
return distanceSquared(centerCircle.x, centerCircle.y, testX, testY) < (radius * radius);
}
GameObject* PhysicsManager::CheckSphere(Vector2 position, float radius, GameObject* self = NULL)
{
vector<GameObject*> go = GameObjectManager::GetInstance().GetGameObjects();
for (int i = 0; i < go.size(); i++) {
if (go[i] != self && go[i]->collider != NULL)
{
if (go[i]->collider->isRect)
{
if (CheckRectCircleCollisions(go[i], position, radius))
{
return go[i];
}
}
else
{
if (CheckCircleCollisions(position, radius, go[i]))
{
return go[i];
}
}
}
}
return NULL;
} |
27397560453297460651357af84f723be4c0fcd1 | be33dfd5ab44d90045c4ae9dbaa1c82e47e43609 | /include/game/Controller/tabletcontroller.hpp | 41455fa08573a93f44f16d0b475c59b36838e774 | [] | no_license | fishmaker/fishing | 767aae5c509b65f648348df40c2a2d85d9d55ed0 | 2a680a59ecb60dd78b35b9d47755fe9a07d9901b | refs/heads/master | 2021-01-12T04:39:43.524758 | 2017-01-08T21:52:17 | 2017-01-08T21:52:17 | 77,695,768 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 485 | hpp | tabletcontroller.hpp | #ifndef TABLETCONTROLLER_H
#define TABLETCONTROLLER_H
#include <QObject>
#include <QWidget>
#include "game/Interfaces/iformbase.hpp"
#include "game/View/tabletview.hpp"
namespace game {
class TabletController : public QObject, public IFormBase
{
Q_OBJECT
public:
explicit TabletController(QWidget *a_Parent =0);
~TabletController();
void Startup();
void Endup();
private:
TabletView *m_View;
};
} // namespace game
#endif // TABLETCONTROLLER_H
|
305d1439e98472ff0e687c1032723d826c8ba370 | fb7efe44f4d9f30d623f880d0eb620f3a81f0fbd | /chromeos/components/tether/connection_priority.cc | 72692e09676c91890061428400aa288c2e1e0b68 | [
"BSD-3-Clause"
] | permissive | wzyy2/chromium-browser | 2644b0daf58f8b3caee8a6c09a2b448b2dfe059c | eb905f00a0f7e141e8d6c89be8fb26192a88c4b7 | refs/heads/master | 2022-11-23T20:25:08.120045 | 2018-01-16T06:41:26 | 2018-01-16T06:41:26 | 117,618,467 | 3 | 2 | BSD-3-Clause | 2022-11-20T22:03:57 | 2018-01-16T02:09:10 | null | UTF-8 | C++ | false | false | 1,219 | cc | connection_priority.cc | // Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chromeos/components/tether/connection_priority.h"
#include "base/logging.h"
namespace chromeos {
namespace tether {
ConnectionPriority PriorityForMessageType(MessageType message_type) {
switch (message_type) {
case CONNECT_TETHERING_REQUEST:
case DISCONNECT_TETHERING_REQUEST:
return ConnectionPriority::CONNECTION_PRIORITY_HIGH;
case KEEP_ALIVE_TICKLE:
return ConnectionPriority::CONNECTION_PRIORITY_MEDIUM;
default:
return ConnectionPriority::CONNECTION_PRIORITY_LOW;
}
}
ConnectionPriority HighestPriorityForMessageTypes(
std::set<MessageType> message_types) {
DCHECK(!message_types.empty());
ConnectionPriority highest_priority =
ConnectionPriority::CONNECTION_PRIORITY_LOW;
for (const auto& message_type : message_types) {
ConnectionPriority priority_for_type = PriorityForMessageType(message_type);
if (priority_for_type > highest_priority)
highest_priority = priority_for_type;
}
return highest_priority;
}
} // namespace tether
} // namespace chromeos
|
18221ef8c0931ed7b382c9081175899e03ce1fef | d51f82fe0b94b7b55ad096027d36c3c6ac164f2d | /tools/include/votca/tools/random.h | 0b372e38d81d581353e80da76b666f6a15e078a9 | [
"Apache-2.0"
] | permissive | votca/votca | c45e0d830ca2ef8cb000441935cf681a272afdb4 | 4645704e18767051905d821447f6f211c55475f6 | refs/heads/master | 2023-08-03T15:02:40.949525 | 2023-07-18T19:48:29 | 2023-07-18T19:48:29 | 75,022,030 | 54 | 44 | Apache-2.0 | 2023-09-10T21:44:34 | 2016-11-28T23:02:45 | C++ | UTF-8 | C++ | false | false | 1,630 | h | random.h | /*
* Copyright 2009-2020 The VOTCA Development Team (http://www.votca.org)
*
* 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.
*
*/
#ifndef VOTCA_TOOLS_RANDOM_H
#define VOTCA_TOOLS_RANDOM_H
// Standard includes
#include <random>
// Local VOTCA includes
#include "types.h"
namespace votca {
namespace tools {
class Random {
public:
void init(Index seed) {
if (seed < 0) {
throw std::runtime_error("seed integer must be positive.");
}
mt_ = std::mt19937(unsigned(seed));
}
// draws a random double from [0,1)
double rand_uniform() { return distribution_(mt_); }
// sets maxint for a uniform integer distribution [0,maxint]
void setMaxInt(Index maxint) {
int_distribution_ = std::uniform_int_distribution<Index>{0, maxint};
}
// draws from a uniform integer distribution [0,maxint]
Index rand_uniform_int() { return int_distribution_(mt_); }
private:
std::mt19937 mt_;
std::uniform_real_distribution<double> distribution_{0.0, 1.0};
std::uniform_int_distribution<Index> int_distribution_;
};
} // namespace tools
} // namespace votca
#endif // VOTCA_TOOLS_RANDOM_H
|
9a473894c954d5296c4b954627191ec6bc3bbf45 | f866001c2bee6bfdcec1e7c11ad95c2073d3b71b | /src/AlgoMath.cpp | 794af74144b0eca751174606adff84df6e55fac9 | [] | no_license | ldkv/Maths5A_Coons | c1b68e429f9c586dc729fd9c118d2e4805e3c795 | 23c87b6e4a33273d352b8b49499eaab98122dea1 | refs/heads/master | 2021-01-20T15:09:47.411055 | 2017-05-12T16:12:35 | 2017-05-12T16:12:35 | 90,725,294 | 0 | 0 | null | null | null | null | ISO-8859-1 | C++ | false | false | 1,933 | cpp | AlgoMath.cpp | #include "stdafx.h"
#include "AlgoMath.h"
// Fonction intermédiaire pour l'algo de Casteljau
QVector3D getCasteljauPoint(vector<QVector3D> poly, double t)
{
int N = poly.size();
for (int k = 1; k < N; k++)
for (int i = 0; i < N - k; i++)
poly[i] = (1 - t)*poly[i] + t*poly[i + 1];
return poly[0];
}
// Calculer la surface de Bézier à partir d'un ensemble de points de contrôle
vector<vector<QVector3D>> calcSurfaceBezier(vector<vector<QVector3D>> pts, int precision)
{
vector<vector<QVector3D>> curvePoints;
if (pts.size() > 0 && pts[0].size() > 0 && precision > 0)
{
int degU = pts.size();
curvePoints.resize(precision+1);
for (int ui = 0; ui <= precision; ui++)
{
float u = (float)ui / (float)precision;
for (int vi = 0; vi <= precision; vi++)
{
float v = (float)vi / (float)precision;
vector<QVector3D> qPoints;
for (int i = 0; i < degU; i++)
qPoints.push_back(getCasteljauPoint(pts[i], v));
curvePoints[ui].push_back(getCasteljauPoint(qPoints, u));
}
}
}
return curvePoints;
}
// Génération aléatoire d'un nombre entier dans l'intervalle donnée
int randomGeneration(int min, int max)
{
// the random device that will seed the generator
std::random_device seeder;
// make a mersenne twister engine
std::mt19937 engine(seeder());
// the distribution
std::uniform_int_distribution<int> dist(min, max);
// generate the integer
return dist(engine);
}
// Convertir la classe QVector3D pour utiliser avec les fonctions OpenGL
void glVector3D(QVector3D p, bool vertex)
{
GLfloat *temp = new GLfloat[3];
temp[0] = p.x();
temp[1] = p.y();
temp[2] = p.z();
if (vertex)
glVertex3fv(temp);
else
glColor3fv(temp);
delete[] temp;
}
// Convertir les couleurs entre valeurs entières et normalisées
QColor convertColor(QVector3D col)
{
int r = (int)(col.x() * 255);
int g = (int)(col.y() * 255);
int b = (int)(col.z() * 255);
return QColor(r, g, b);
} |
4a4294e472dabfcb48645c11b8915626fbf75f44 | c4f3d6aaeecda81b20b9ce3e90aa49459b4b7bbc | /fixedInfector.cpp | 55dbf1806f9aa03d348f86759c7a28a790a08e45 | [] | no_license | jcohen1964/MadCow | f030a37d78cd76528116569637c19d12a38cecdd | ae7abf926e15436d398e63d164d1d2cce79e2969 | refs/heads/master | 2020-03-22T10:22:49.348843 | 2018-07-05T21:16:58 | 2018-07-05T21:16:58 | 139,898,542 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,060 | cpp | fixedInfector.cpp | #include "FixedInfector.h"
#include "bovine.h"
#include "sickBovine.h"
#include "bovineHerd.h"
#include "bovineGroup.h"
#include "reporter.h"
#include <string>
#include <iostream>
//Takes three arguments (bovine type, gender, and age in months) and returns number of infected
//bovines with those characteristics introduced into the herd at the beginning of the simulation
FunctTable<Bovine::Type, FunctTable<Bovine::Gender, FunctInterStep<int, int> > > FixedInfector::numCases;
//Loops through all BovineGroups in the BovineHerd. Each bovineGroup accepts the fixed infector.
void FixedInfector::visit(BovineHerd* herd) {
BovineHerd::iterator end = herd->end();
for(BovineHerd::iterator it = herd->begin(); it != end; ++it) {
it->accept(*this);
}
}
//For each BovineGroup, make bovineGroup.numCases additional animals sick.
void FixedInfector::visit(BovineGroup* group) {
Bovine bovine = group->getBovine(); //Get a represenative bovine from this group
int num = numCases(bovine.getType()) //Lookup number of fixed cases to be added to
(bovine.getGender())(bovine.getAge()); //this group at the beginning of the simulation
while(num--) { //For each sick animal to be added
Bovine* removed = group->removeRandomBovine(); //Remove a healthy bovine ???
group->addBovine(SickBovine(*removed)); //Add one sick bovine
delete removed; //Clean up
Reporter::instance()-> //Notify reporter
reportInfectSource(Reporter::FIXED);
}
}
void FixedInfector::readError() {
std::cerr << "Error reading FixedInfector data" << std::endl;
exit(0);
}
std::istream& operator>>(std::istream& stream, FixedInfector& me) {
std::string word;
stream >> word;
char dump[256];
while((word != "</fixedInfector>") && !stream.eof()) {
if(word == "<numCases>" ) stream.getline(dump, 256).getline(dump, 256) >> me.numCases >> word;
else FixedInfector::readError();
stream >> word;
} if(word != "</fixedInfector>") FixedInfector::readError();
return stream;
}
|
f3405b065efc5add09db67e3c9ab23a211f39b03 | e8fb2ccc34338ff5fdb27fe0a856da9611cd09fb | /ExpressSystem/ListSortImpl.cpp | 3a08102d527ef3a133a6b42e294563d1ad1eff9b | [] | no_license | SimonJsx/ExpressSystem | 5b3c21a65363e091606a1a615b24d9ff18115e48 | a5265959e21fcbc89f799d8a1aa06afa8e5b5450 | refs/heads/master | 2021-01-01T05:36:36.530222 | 2014-09-16T06:57:11 | 2014-09-16T06:57:11 | 24,084,552 | 1 | 0 | null | null | null | null | GB18030 | C++ | false | false | 1,757 | cpp | ListSortImpl.cpp | #include "stdafx.h"
#include "ListSortImpl.h"
#include <sstream>
int CALLBACK compareFun(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
{
ListSortImpl* pListImpl = reinterpret_cast<ListSortImpl*>(lParamSort);
CListCtrl* pList = pListImpl->listHandle_;
int nItem1, nItem2;
LVFINDINFO FindInfo;
FindInfo.flags = LVFI_PARAM; // 指定查找方式
FindInfo.lParam = lParam1;
nItem1 = pList->FindItem(&FindInfo, -1); // 得到对应Item索引
FindInfo.lParam = lParam2;
nItem2 = pList->FindItem(&FindInfo, -1);
if ((nItem1 == -1) || (nItem2 == -1))
{
TRACE("无法找到!/n");
return 0;
}
CString str1, str2;
str1 = pList->GetItemText(nItem1, pListImpl->columnClicked_); // 得到排序列的Text
str2 = pList->GetItemText(nItem2, pListImpl->columnClicked_);
/*
HDITEM headerItem;
headerItem.mask = HDI_LPARAM;
CHeaderCtrl* pHeaderCtrl = pList->GetHeaderCtrl();
pHeaderCtrl->GetItem(pListImpl->columnClicked_, &headerItem);
UINT nType = (UINT)(headerItem.lParam);
*/
int iCompRes = 0;
if (pListImpl->isLongLong_ != 0)
{
unsigned long long i1, i2;
USES_CONVERSION;
std::stringstream ss;
ss << T2A(str1);
ss >> i1;
ss.clear();
ss << T2A(str2);
ss >> i2;
if (i1 > i2)
iCompRes = 1;
else if (i1 == i2)
iCompRes = 0;
else
iCompRes = -1;
}
else
{
if (str1 > str2)
iCompRes = 1;
else if (str1 == str2)
iCompRes = 0;
else
iCompRes = -1;
}
if (pListImpl->isSameColumn_)
return -iCompRes;
return iCompRes;
}
ListSortImpl::ListSortImpl(CListCtrl* listCtrl, int columnSet, int isLongLong)
: listHandle_(listCtrl)
, columnClicked_(columnSet)
, isLongLong_(isLongLong)
{
}
void ListSortImpl::sortItems()
{
listHandle_->SortItems(compareFun, reinterpret_cast<DWORD>(this));
}
|
503fc26fe88cdab84026231b0a40645f4c4db147 | b6c32b7029a63616d3cf654eaa4dea9e7c4aa504 | /developer/norokko_slepc/frank_matfree_1proc.cpp | d9f8af0ffbdee72c68ac09fff2b666d6b3cb33e5 | [
"BSL-1.0"
] | permissive | wistaria/rokko | 9cbfb47bd4ac81a30fc0ff6e5ae24374c3b0a1b4 | 7cd9d5155e82f038039a46c1dc8f382b3fe7e2b7 | refs/heads/master | 2020-05-30T11:27:18.015330 | 2019-06-01T22:20:58 | 2019-06-01T22:20:58 | 189,702,188 | 0 | 0 | BSL-1.0 | 2019-06-01T07:10:01 | 2019-06-01T07:10:01 | null | UTF-8 | C++ | false | false | 4,300 | cpp | frank_matfree_1proc.cpp | #include <slepceps.h>
#include <petscblaslapack.h>
#include <rokko/localized_matrix.hpp>
#include <rokko/utility/frank_matrix.hpp>
/*
User-defined routines
*/
PetscErrorCode MatMult_myMat(Mat A,Vec x,Vec y);
PetscErrorCode MatGetDiagonal_myMat(Mat A,Vec diag);
#undef __FUNCT__
#define __FUNCT__ "main"
int main(int argc,char **argv)
{
Mat A; /* operator matrix */
EPS eps; /* eigenproblem solver context */
EPSType type;
PetscMPIInt size;
PetscInt N, nev;
PetscErrorCode ierr;
SlepcInitialize(&argc, &argv, (char*)0, 0);
ierr = MPI_Comm_size(PETSC_COMM_WORLD,&size);CHKERRQ(ierr);
if (size != 1) SETERRQ(PETSC_COMM_WORLD,1,"This is a uniprocessor example only");
N = 100;
ierr = PetscOptionsGetInt(NULL,"-N",&N,NULL);CHKERRQ(ierr);
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Compute the operator matrix that defines the eigensystem, Ax=kx
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
rokko::localized_matrix<double, rokko::matrix_col_major> mat(N, N);
rokko::frank_matrix::generate(mat);
ierr = MatCreateShell(PETSC_COMM_WORLD,N,N,N,N,&mat,&A);CHKERRQ(ierr);
ierr = MatSetFromOptions(A);CHKERRQ(ierr);
ierr = MatShellSetOperation(A,MATOP_MULT,(void(*)())MatMult_myMat);CHKERRQ(ierr);
ierr = MatShellSetOperation(A,MATOP_MULT_TRANSPOSE,(void(*)())MatMult_myMat);CHKERRQ(ierr);
ierr = MatShellSetOperation(A,MATOP_GET_DIAGONAL,(void(*)())MatGetDiagonal_myMat);CHKERRQ(ierr);
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Create the eigensolver and set various options
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*
Create eigensolver context
*/
ierr = EPSCreate(PETSC_COMM_WORLD,&eps);CHKERRQ(ierr);
/*
Set operators. In this case, it is a standard eigenvalue problem
*/
ierr = EPSSetOperators(eps,A,NULL);CHKERRQ(ierr);
ierr = EPSSetProblemType(eps,EPS_HEP);CHKERRQ(ierr);
/*
Set solver parameters at runtime
*/
ierr = EPSSetFromOptions(eps);CHKERRQ(ierr);
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Solve the eigensystem
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
ierr = EPSSolve(eps);CHKERRQ(ierr);
/*
Optional: Get some information from the solver and display it
*/
ierr = EPSGetType(eps,&type);CHKERRQ(ierr);
ierr = PetscPrintf(PETSC_COMM_WORLD," Solution method: %s\n\n",type);CHKERRQ(ierr);
ierr = EPSGetDimensions(eps,&nev,NULL,NULL);CHKERRQ(ierr);
ierr = PetscPrintf(PETSC_COMM_WORLD," Number of requested eigenvalues: %D\n",nev);CHKERRQ(ierr);
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Display solution and clean up
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
ierr = EPSPrintSolution(eps,NULL);CHKERRQ(ierr);
ierr = EPSDestroy(&eps);CHKERRQ(ierr);
ierr = MatDestroy(&A);CHKERRQ(ierr);
ierr = SlepcFinalize();
return 0;
}
#undef __FUNCT__
#define __FUNCT__ "MatMult_myMat"
PetscErrorCode MatMult_myMat(Mat A,Vec x,Vec y)
{
PetscFunctionBeginUser;
PetscErrorCode ierr;
rokko::localized_matrix<double, rokko::matrix_col_major> *mat;
ierr = MatShellGetContext(A, &mat); CHKERRQ(ierr);
const PetscScalar *px;
PetscScalar *py;
ierr = VecGetArrayRead(x, &px); CHKERRQ(ierr);
ierr = VecGetArray(y, &py); CHKERRQ(ierr);
for (int i=0; i<(*mat).rows(); ++i) {
for (int j=0;j<(*mat).cols(); ++j) {
py[i] += (*mat)(i,j) * px[j];
}
}
ierr = VecRestoreArrayRead(x,&px); CHKERRQ(ierr);
ierr = VecRestoreArray(y,&py); CHKERRQ(ierr);
PetscFunctionReturn(0);
}
#undef __FUNCT__
#define __FUNCT__ "MatGetDiagonal_myMat"
PetscErrorCode MatGetDiagonal_myMat(Mat A, Vec diag)
{
PetscFunctionBeginUser;
PetscErrorCode ierr;
rokko::localized_matrix<double, rokko::matrix_col_major> *mat;
ierr = MatShellGetContext(A, &mat); CHKERRQ(ierr);
PetscScalar *pd;
ierr = VecGetArray(diag, &pd); CHKERRQ(ierr);
for (int i=0; i<(*mat).rows(); ++i) {
pd[i] = (*mat)(i,i);
}
ierr = VecRestoreArray(diag ,&pd); CHKERRQ(ierr);
PetscFunctionReturn(0);
}
|
f524909f1d5f5479db0b52df88922180563941eb | dd8dd5cab1d4a678c412c64f30ef10f9c5d210f1 | /cpp/leetcode/5108. encode-number.cpp | a9c1c648601b73ac7815c8e5baf8a71d2365cf59 | [] | no_license | blacksea3/leetcode | e48a35ad7a1a1bb8dd9a98ffc1af6694c09061ee | 18f87742b64253861ca37a2fb197bb8cb656bcf2 | refs/heads/master | 2021-07-12T04:45:59.428804 | 2020-07-19T02:01:29 | 2020-07-19T02:01:29 | 184,689,901 | 6 | 2 | null | null | null | null | GB18030 | C++ | false | false | 679 | cpp | 5108. encode-number.cpp | #include "public.h"
//数学题
class Solution {
public:
string encode(int num) {
int stlen = log(num + 1) / log(2);
int remain = num - (pow(2, stlen) - 1);
//求remain的stlen位二进制表示
string res;
for (int i = 0; i < stlen; ++i)
{
res += "0";
}
int precount = 0;
while (remain > 0)
{
if (remain % 2)
{
res[precount] = '1';
}
remain /= 2;
precount++;
}
reverse(res.begin(), res.end());
return res;
}
};
/*
int main()
{
Solution* s = new Solution();
cout << s->encode(0) << endl;
cout << s->encode(2) << endl;
cout << s->encode(6) << endl;
cout << s->encode(23) << endl;
cout << s->encode(107) << endl;
}
*/
|
f17d455842f3b3eaa2cbc0d12633fbae2f846928 | 21fbf7be299ee40483d727a8caf0faead2990e17 | /Code/Compile/445.916.cpp | fcf1c7eac01e1f02ceed008080d28df3bbcf7589 | [] | no_license | sihcpro/DetectSimilarCode | 2576dfd321190118a39db7d1181384f05f359003 | 312752160e2c18466f0957d89243913311f5ca7e | refs/heads/master | 2021-04-15T07:48:39.836713 | 2018-10-05T08:34:24 | 2018-10-05T08:34:24 | 126,775,044 | 0 | 1 | null | 2018-10-05T07:46:47 | 2018-03-26T04:53:49 | null | UTF-8 | C++ | false | false | 459 | cpp | 445.916.cpp | # 1 "./Process/445.916.cpp"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 1 "<command-line>" 2
# 1 "./Process/445.916.cpp"
int main()
{
long long l,n, maxa=0, mina = 0,u,v;
cin >> l >> n;
while (n--)
{
long long a;
cin >> a;
u = min(a,l-a);
v = max(a,l-a);
if (mina < u) mina = u;
if (maxa < v) maxa = v;
}
cout << mina << " " << maxa;
return 0;
}
|
698fa378afb162411dbe2032ae6daa12aca7fe3f | 166facd141cfb42292db448578fbd0bdf9b795ac | /ImasiEngine/Source/Graphics/Buffers/IndexBuffer.cpp | c1a724b7c751fec0ab60296f419eb325083b0cbd | [] | no_license | imasiprojects/ImasiEngine | 7dbcd75d2b4215e603a1bf8bcac1dd586d2ae921 | 03fe836099aec3d567fb16aefa923c245ddab9f8 | refs/heads/master | 2021-09-10T01:59:12.237695 | 2021-09-02T23:04:40 | 2021-09-02T23:04:40 | 161,831,834 | 1 | 1 | null | 2021-09-02T23:04:41 | 2018-12-14T19:33:20 | C++ | UTF-8 | C++ | false | false | 547 | cpp | IndexBuffer.cpp | #include "IndexBuffer.hpp"
#include <GL/glew.h>
#include "../Opengl/OpenglHelper.hpp"
namespace ImasiEngine
{
void IndexBuffer::bind(const IndexBuffer& buffer)
{
GL(glBindBuffer(GLEnums::BufferType::Index, buffer.getGLObjectId()));
}
void IndexBuffer::unbind()
{
GL(glBindBuffer(GLEnums::BufferType::Index, NULL_ID));
}
IndexBuffer::IndexBuffer(IndexBuffer&& buffer) noexcept
: Buffer(std::move(buffer))
{
}
IndexBuffer::~IndexBuffer()
{
}
}
|
479b7e50997f16c0afb1893e60ed87f5bf1f9b43 | 42ae6f3f0d6cee31ad2afb14d494d9bec3721689 | /LinkedList.h | 25b9652b5c9a1a50fc93479c224cd13e039993e2 | [
"MIT"
] | permissive | ginge/GuiLibrary | 0bb0cec5011a56d0cc6e28f0c33779e9c821f685 | f9b90686ba910c6fa63f3b7826a0b75264948586 | refs/heads/master | 2021-05-16T02:00:09.304888 | 2019-02-20T13:43:44 | 2019-02-20T13:43:44 | 40,813,934 | 37 | 26 | MIT | 2019-02-20T13:43:45 | 2015-08-16T11:43:32 | C++ | UTF-8 | C++ | false | false | 2,110 | h | LinkedList.h | /*====================================================================================
Copyright (c) 2015 Barry Carter <barry.carter@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
A simple GUI Widget library for TFT screens.
====================================================================================
*/
#ifndef _LINKEDLIST_H_
#define _LINKEDLIST_H_
#if ARDUINO < 100
#include <WProgram.h>
#else
#include <Arduino.h>
#endif
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
// Node class
class GuiNode {
char *data_element;
GuiNode *next_element;
public:
GuiNode() {};
void setElement(char *element) { data_element = element; };
void setNext(GuiNode* aNext) { next_element = aNext; };
char *element() { return data_element; };
GuiNode *next() { return next_element; };
};
//////////////////
class GuiList {
GuiNode *head_element;
public:
GuiList() { head_element = NULL; }
GuiNode *head() { return head_element; };
void addElement(char *element);
char* getNthElement(uint8_t index);
int8_t count = 0;
};
#endif |
001df64249bca3a2cda70878d0d13857ba4a88d5 | a71785c71eef6acb0afb76b2b0990f9e89f00585 | /Codes/Sort/InsertionSort/main.cpp | fa3212ade21e0e5c2e5e973899af18f60882422d | [] | no_license | chichuyun/Algorithm | c0e980e2eb6d53f9830c62044ebea94431ea22e0 | 8ae69df3af5214b3019156b3ca6e3ee09d1cea86 | refs/heads/master | 2023-04-08T11:01:17.841373 | 2023-04-05T15:19:03 | 2023-04-05T15:19:03 | 154,915,602 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 807 | cpp | main.cpp | #include<iostream>
#include<vector>
#include<utility>
using namespace std;
typedef vector<int> vecInt;
void insertionsort(vecInt &);
int main() {
vecInt lst;
int in, num;
cout<<"num: "<<endl;
cin>>num;
cout<<"Input nums: "<<num<<endl;
for(int i=0;i<num;++i) {
cin>>in;
lst.push_back(in);
}
cout<<"Raw array: "<<endl;
for(int i=0;i<lst.size();++i)
cout<<lst[i]<<" ";
cout<<endl;
insertionsort(lst);
cout<<"Sored array: "<<endl;
for(int i=0;i<lst.size();++i)
cout<<lst[i]<<" ";
cout<<endl;
}
void insertionsort(vecInt &lst) {
for(int i=0;i<lst.size();++i) {
int j = i - 1, num = lst[i];
while(j>=0 && lst[j]>num) {
swap(lst[j],lst[j+1]);
--j;
}
}
}
|
036c58d5012fe0239b3136c805b7851a878078db | 99d78ea422d89601932299b53352159a4154c5bc | /KappaAnalysis/interface/Producers/PFCandidatesProducer.h | 9e0e6a339fa1fed2e04958b06adcc6a40efd69cc | [] | no_license | KIT-CMS/Artus | 379c10e0313951540806c7ab6b8aaa73f4a2012e | d7cffddcfd95924db8c3d43e004094334fa464fe | refs/heads/master | 2023-02-08T14:49:18.474550 | 2022-12-20T10:33:04 | 2022-12-20T10:33:04 | 99,791,453 | 4 | 4 | null | 2022-02-23T12:22:08 | 2017-08-09T09:38:26 | C++ | UTF-8 | C++ | false | false | 821 | h | PFCandidatesProducer.h | #pragma once
#include "Kappa/DataFormats/interface/Kappa.h"
#include "Artus/KappaAnalysis/interface/KappaProducerBase.h"
#include "Artus/Consumer/interface/LambdaNtupleConsumer.h"
/**
\brief Producer, that devides packedPFCandidates according to pddId. Source :
https://twiki.cern.ch/twiki/bin/view/CMSPublic/WorkBookMiniAOD2016
*/
class PFCandidatesProducer : public KappaProducerBase
{
public:
void Init(KappaSettings const& settings) override;
std::string GetProducerId() const override { return "PFCandidatesProducer"; };
void Produce(KappaEvent const& event, KappaProduct& product, KappaSettings const& settings) const override;
private:
void fill_pfCandidate(std::vector<const KPFCandidate*>&, std::vector<const KPFCandidate*>&, std::vector<const KPFCandidate*>&, const KPFCandidate*) const;
};
|
4e4d310d194c8a801dd588dcc178ef96f59f474f | 98d27b90c0dead59c23304b0b62dc3483047da44 | /trunk/src/SystemBox.h | e235c418e298de18fb0d4ff9b52c57f040dca64a | [] | no_license | BackupTheBerlios/qshapes-svn | 254ea3d50d200f50d159185ba3f1f66469160298 | 445842e8b18efb85f3344bda563b7bb3473e2e97 | refs/heads/master | 2020-05-18T01:20:13.427326 | 2006-05-08T16:37:24 | 2006-05-08T16:37:24 | 40,775,310 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,532 | h | SystemBox.h | /*
* This file is part of QShapes project
* Copyright (C) 2006 QShapes development team
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef SYSTEMBOX_H_
#define SYSTEMBOX_H_
#include <qtcanvas.h>
#include "DiagramBox.h"
/*! \class SystemBox
\brief The class describing the system box item.
\author Flavio Castelli
SystemBox is a common rectangle with some text inside
*/
class SystemBox : public DiagramBox, public QtCanvasRectangle
{
public:
enum { RTTI = 1001 }; //!< value used for identifying subclasses of QtCanvasItem
//! constructor
SystemBox(QtCanvas *canvas = 0);
//! constructor
SystemBox(SystemBox *box, QtCanvas *canvas = 0);
//! desctructor
virtual ~SystemBox();
QString getType() { return QString ("SystemBox"); }
//! function used to draw item's shape
void drawShape(QPainter &painter);
QRect boundingRect() const;
//! method used for identifying subclasses of QtCanvasItem
int rtti() const { return RTTI; }
//! return the area surrounding the line
QPolygon areaPoints() const;
void changePen (QPen pen);
void changeBrush (QBrush brush);
// specific methods
//! return the rectangle surrounding the item
QRect getSurroundingRect() const;
//! set box's top left point
void setTopLeft (QPoint& topLeft);
//! set box's height
void setHeight (int height);
//! set box's width
void setWidth (int width);
void moveResizing (int mouseX, int mouseY, int width, int height);
void setText(QString newText);
DiagramItem* clone ();
};
#endif /*SYSTEMBOX_H_*/
|
d6ab0b300a4bc06f71993dd2c1bf641a87a96781 | 3345d1b8171a54c088e9bc26d23cb14f7f5ed05a | /Prime_Numbers/main.cpp | 81e309ee2cc9680e58e01ea1a629242a86263369 | [] | no_license | LuigiMagrelli/Prime_Numbers | 535063c10140ebfa2b7265fa055b8784f78e81a0 | 405e00e7e166e7c78461480c35b7883845aeb913 | refs/heads/master | 2020-08-14T18:10:01.434924 | 2019-10-15T05:24:00 | 2019-10-15T05:24:00 | 215,213,339 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,485 | cpp | main.cpp | /****************************************
* main.cpp
* Luigi's Prime Calculator
*
* Created by Luigi Magrelli on 6-10-2019
* Copyright © 2019 Techilepsy, LLC. All rights reserved.
*
* This program should ask the user for a maximum value
* and calculate all of the primes from 0-maxVal
* Bonus points:
* -Styling
* -Efficiency
*
* Things to watch out for:
* -Incorrect use of tabs
* -Incorrect loop type
* -Poorly named variables
****************************************/
// includes
#include <iostream>
#include <math.h>
// main function
int main()
{
// DONE: Declare variables
int maxVal;
int num;
bool prime;
int newPrime;
// DONE: output directions and take input
std::cout << "Enter a number to check all prime values: ";
std::cin >> maxVal; // <--------Value is set for maxValue
// DONE: Create a loop to check if primes
// HINT: 0 and 1 are NOT primes
// You do not need to check the remainder of every number.
// Think of ways to make as few iterations as possible
for(num = 2; num <= maxVal; num ++){
int iter = sqrt(num);// <---here
prime = true;
for(int i = 2; i <= iter; i++){
if(num % i == 0){
prime = false;
}
}
if(prime){
newPrime = num;
//std::cout << num << "\n";
}
}
//DONE: return and end
return 0;
}
|
b386adb30c4e4f5ede99a64ee23c8f04d8fe62ed | 0af703b294681f3a4f65375811d14d88bb20424f | /cards/main.cpp | 0adb150a68762f073c31dd3040a89f18e99edcdb | [] | no_license | DanielKaczocha/Cpp | 28e2518242c72e2ab91aa7911760e6d4a593f16a | 94fef31d363853d4ceb13373dd0d2476389d1518 | refs/heads/master | 2020-03-16T15:55:55.391196 | 2018-05-09T20:41:29 | 2018-05-09T20:41:29 | 132,764,601 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 676 | cpp | main.cpp | #include <iostream>
using namespace std;
void deck(string fig[13], string col[4]);
void print (string card[13*4]);
string fig[13] = {"2","3","4","5","6","7","8","9","10","J","Q","K","A"};
string col[4] = {" Pik", " Karo", " Trefl", " Kier"};
string card[13*4] = {};
int main() {
deck(fig, col);
print(card);
return 0;
}
void deck(string fig[13], string col[4])
{
int element = 0;
for( int i = 0; i < 4; i++)
{
for(int j = 0; j < 13; j++)
{
card[element++] = fig[j] + col[i];
}
}
}
void print (string card[13*4])
{
for(int i = 0; i <= (13*4); i++)
{
cout << card[i] << endl;
}
} |
7c3e887c84000dadadf6fae3e665b22a86fb4a9a | fc9453f8531d0058832fc97989807eb1b7a96c03 | /Task7/Task7.cpp | 1f290c17111b5debeebf829f9f12053cad7e3579 | [] | no_license | Aitoly/FA-3sem-Lab2 | a43750ea23d86fb4a3da2bb54eab1ff7e118e296 | 1610dca84d398f4ae7d7b1513be0a69459c9c85e | refs/heads/master | 2022-12-14T05:18:56.342874 | 2020-09-01T11:29:17 | 2020-09-01T11:29:17 | 291,969,155 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 452 | cpp | Task7.cpp | #pragma warning(disable:4996)
#include<stdio.h>
#include<iostream>
#include<ctype.h>
#include<math.h>
#include<time.h>
#include<stdarg.h>
double middle_geometric(int n, ...)
{
double out = 1;
va_list args;
va_start(args, n);
for (int i = 0; i < n; i++)
{
out *= va_arg(args, int);
}
va_end(args);
return pow(out, 1.0 / n);
}
int main()
{
printf("middle_geometric = %lf\n", middle_geometric(3, 3, 9, 27));
system("pause");
return 0;
} |
c0284b91beec3030eae2bbff88a3be08490e644f | b84f4db846184e7d478b49f4f9c5a771c0eb9567 | /PrimeraPrograED/thread_almacen_machines.cpp | b119abc25f4a86c83addd07257c4dcab0bb19fa7 | [] | no_license | TheCsarbeat/Progra_1_ED | 7111442958ec61bdb4bfa91138e7807c03f636c4 | 53e2ef1625a8a3718e9d83d0b465ee19fe9c1d87 | refs/heads/main | 2023-08-25T20:16:30.231260 | 2021-10-19T20:47:36 | 2021-10-19T20:47:36 | 413,277,311 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,056 | cpp | thread_almacen_machines.cpp | #include "thread_almacen_machines.h"
ThreadAlmacenMachines::ThreadAlmacenMachines(){
}
void ThreadAlmacenMachines::__init__(Almacen * almacen, Machine * machine, QMutex * mutex, ColaPeticiones * colaPeticiones,EstructuraProgressBar * progressBar, QCheckBox * checkOnOff) {
this->almacen = almacen;
this->running = false;
this->paused = false;
this->mutex = mutex;
this->machine = machine;
this->colaPeticiones= colaPeticiones;
this->progressBar = progressBar;
this->checkOnOff = checkOnOff;
}
void ThreadAlmacenMachines::run() {
this->running = true;
this->almacen->carrito->libre = false;
getCantPeticion();
almacen->carrito->imprimir();
while (running) {
while (paused) {
if(checkOnOff->isChecked()) resume();
msleep(500);
}
if(!checkOnOff->isChecked()) pause();
else{
//Own Statements
this->almacen->carrito->sumarSegundo();
this->almacen->carrito->lbTitulo->setText("Llevando a: "+this->machine->nombre);
this->progressBar->setValue(((double)this->almacen->carrito->timeActual/this->almacen->carrito->duracionTotal)*100);
sleep(1);
//Stop Condition
if(this->almacen->carrito->duracionTotal == this->almacen->carrito->timeActual){
this->mutex->lock();
this->machine->cantNow += this->almacen->carrito->cargaNow;
if(colaPeticiones->verFrente()->peticion->cant == 0)colaPeticiones->desencolar();
this->mutex->unlock();
resetDatos();
//if(colaPeticiones->vacia())checkOnOff->setChecked(false);
stop();
}
}
}
}
void ThreadAlmacenMachines::pause() {
this->paused = true;
this->almacen->carrito->lbTitulo->setText("Waiting...");
}
void ThreadAlmacenMachines::stop() {
this->running = false;
colaPeticiones->imprimir();
machine->imprimirDatos();
almacen->carrito->imprimir();
}
void ThreadAlmacenMachines::resume() {
this->paused = false;
}
void ThreadAlmacenMachines::getCantPeticion(){
Peticion * peticion = colaPeticiones->verFrente()->peticion;
int cantPeticion = peticion->cant;
int cargaCarrito = almacen->carrito->capacidad;
colaPeticiones->imprimir();
if(cantPeticion>= cargaCarrito){
this->almacen->carrito->cargaNow = almacen->carrito->capacidad;
peticion->cant = peticion->cant-cargaCarrito;
}else{
this->almacen->carrito->cargaNow = peticion->cant;
peticion->cant = 0;
}
}
void ThreadAlmacenMachines::resetDatos(){
//Visuales
this->almacen->carrito->lbTitulo->setText("Waiting...");
almacen->carrito->imprimir();
this->progressBar->setValue(0);
//Code
this->almacen->carrito->libre = true;
this->almacen->carrito->timeActual = 0;
this->almacen->carrito->cargaNow=0;
}
void ThreadAlmacenMachines::updateData(){
}
|
6b1e04e17d99df25ddb2fa1b359fd66dda036fb7 | 98dec71e5abd9f33f4966f2f94784828b81d29a0 | /src/filters/FilterNMS.cpp | b72084add48dcb475c276a35c31a348c3346a8ba | [
"BSD-3-Clause"
] | permissive | caomw/PartsBasedDetectorOnVideo | b3c0c2486a83afc0b7be87d1adbd3b4385620e49 | 0d19a662a2b705ca7854de45685b3a1b2d66d970 | refs/heads/master | 2021-01-20T10:04:47.214086 | 2014-05-23T14:53:48 | 2014-05-23T14:53:48 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,122 | cpp | FilterNMS.cpp | /*
* PartsBasedDetectorOnVideo
*
* Software License Agreement (BSD License)
*
* Copyright (c) 2013, Chili lab, EPFL.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of Chili, EPFL nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* File: FilterNMS.cpp
* Author: Mirko Raca <name.lastname@epfl.ch>
* Created: November 26, 2013
*/
#include "FilterNMS.h"
#include <opencv2/core/core.hpp>
#include <exception>
#include <list>
#include <algorithm>
#include <utility>
#include <string>
#include <stdio.h>
#include "globalIncludes.h"
typedef std::pair<float, int> tOrderPair;
bool compareSortOrder(const tOrderPair& _l, const tOrderPair& _r);
void calculateOverlapMatrix( vectorCandidate& _candidates, cv::Mat & _overlapMat );
float calcOverlap(const cv::Rect _r1, const cv::Rect _r2);
std::string rect2str(const cv::Rect _r);
FilterNMS::FilterNMS(float _overlap)
: mOverlap(_overlap)
{
if(mOverlap > 1.0f)
mOverlap /= 100.0f;
DLOG(INFO) << "Created NMS filter for overlap greater then " << _overlap*100.0 << " %";
}
/*
Sorting trick found here
http://stackoverflow.com/questions/1577475/c-sorting-and-keeping-track-of-indexes
*/
void FilterNMS::process(vectorCandidate& _candidates){
// sort all candidates in descending order based on the result
vectorCandidate orderedCandidates;
{
std::list<Candidate> orderedCandidatesList; // just to control the memory consumption a bit. The result ends in orderedCandidates
std::vector<tOrderPair> resortBuffer; // <score, original_index>
int idx = 0;
for( const Candidate& cand : _candidates )
resortBuffer.push_back( tOrderPair(cand.score(), idx++) );
std::sort(resortBuffer.begin(), resortBuffer.end(), compareSortOrder);
for( const tOrderPair& elem : resortBuffer )
orderedCandidatesList.push_back( _candidates.at(elem.second) );
std::copy(orderedCandidatesList.begin(), orderedCandidatesList.end(), std::back_inserter(orderedCandidates));
}
// create overlap matrix
cv::Mat overlapMat = cv::Mat::zeros(orderedCandidates.size(), orderedCandidates.size(), CV_32FC1);
calculateOverlapMatrix(orderedCandidates, overlapMat);
// interate and insert only the top-scoring
std::list<Candidate> outputResults;
{
for(int idx = 0; idx < orderedCandidates.size(); ++idx){
cv::Mat curRow = overlapMat.row(idx);
DLOG(INFO) << "Cur row:";
DLOG(INFO) << curRow;
cv::Mat boolSelection = curRow > mOverlap; // this is outputing 255 instead of "1" for true conditions. Not really a problem, but weird
DLOG(INFO) << "Cur binary selection";
DLOG(INFO) << boolSelection;
if( cv::sum(boolSelection).val[0] == 0 )
outputResults.push_back(orderedCandidates[idx]);
}
}
// re-insert the top-scoring candidates in the output vector
_candidates.clear();
std::copy(outputResults.begin(), outputResults.end(), std::back_inserter(_candidates));
}
// made for descending sort
bool compareSortOrder(const tOrderPair& _l, const tOrderPair& _r){
return _l.first > _r.first;
}
/*
* Important to note that the overlapMat encodes the information
* overlap.at<float>(x,y) = (x & y)/x;
* The matrix will be 0.0 for any idx <= of the current outer idx
*/
void calculateOverlapMatrix( vectorCandidate& _candidates, cv::Mat &_overlapMat ){
int outerIdx = 0;
for( const Candidate& _outerC : _candidates ){
int innerIdx = 0;
for( const Candidate& _innerC : _candidates ){
if(innerIdx >= outerIdx){
break;
}
_overlapMat.at<float>(outerIdx, innerIdx) = calcOverlap(_outerC.boundingBox(), _innerC.boundingBox());
++innerIdx;
}
++outerIdx;
}
DLOG(INFO) << "Overlap matrix: " << _overlapMat;
}
/*
* Overlap percentage from the "viewpoint" of the first rectangle.
* (meaning, the intersection coverage area is devided by the area of the
* of the first rectangle.
*/
float calcOverlap(const cv::Rect _r1, const cv::Rect _r2){
DLOG(INFO) << "Overlap between " << rect2str(_r1) << " and " << rect2str(_r2);
cv::Rect intersection = _r1 & _r2;
DLOG(INFO) << " is " << rect2str(intersection);
float overlapPct = (float)intersection.area()/(float)_r1.area();
DLOG(INFO) << " in the pct of the first rect: " << overlapPct;
return overlapPct;
}
std::string rect2str(const cv::Rect _r){
char buffer[100];
sprintf(buffer, "[%d, %d, %d, %d]", _r.x, _r.y, _r.width, _r.height);
return std::string(buffer);
}
|
bb7abb6038feb5d0bbece36acc33e88de174d3dd | 7e6c6300633c9165335f962799f6bd490ff0360b | /test.cpp | 53a5718d5de6771843267f4a5fbc8c47489c8541 | [] | no_license | saveunhappy/SymmetricMatrix | 9393d1826d3799b967ec0aad7b4f0c19d1727611 | 7de04264f38017a1b64cfb4191c1f7435f2705ef | refs/heads/master | 2021-05-31T11:23:28.382833 | 2016-05-26T15:07:03 | 2016-05-26T15:07:03 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 520 | cpp | test.cpp | #define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
using namespace std;
#include <stdlib.h>
#include "Matrix.h"
void test1()
{
int a[6][5] =
{
{ 1, 0, 3, 0, 5 },
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
{ 2, 0, 4, 0, 6 },
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
};
SparseMatrix<int> sm1((int*)a, 6, 5, 0);
sm1.Display();
SparseMatrix<int> sm2 = sm1.Transport();
sm2.Display();
SparseMatrix<int> sm3 = sm1.FastTransport();
sm3.Display();
}
int main()
{
test1();
system("pause");
return 0;
}
|
33d43e118bf0efd8073ef1aa10de55b03a11e86e | 5664ab66deeecea95313faeea037fa832cca34ce | /modules/canbus/proto/vehicle_parameter.pb.cc | c4be791cc0d9c9a6ffa013f6fa68ff5b6aad53a7 | [] | no_license | Forrest-Z/t1 | 5d1f8c17dc475394ab4d071a577953289238c9f4 | bdacd5398e7f0613e2463b0c2197ba9354f1d3e3 | refs/heads/master | 2023-08-02T03:58:50.032599 | 2021-10-08T05:38:10 | 2021-10-08T05:38:10 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | true | 17,667 | cc | vehicle_parameter.pb.cc | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: modules/canbus/proto/vehicle_parameter.proto
#include "modules/canbus/proto/vehicle_parameter.pb.h"
#include <algorithm>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/wire_format_lite.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>
PROTOBUF_PRAGMA_INIT_SEG
namespace apollo {
namespace canbus {
constexpr VehicleParameter::VehicleParameter(
::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
: max_engine_pedal_(0)
, brand_(0)
, max_enable_fail_attempt_(0)
, driving_mode_(0)
{}
struct VehicleParameterDefaultTypeInternal {
constexpr VehicleParameterDefaultTypeInternal()
: _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
~VehicleParameterDefaultTypeInternal() {}
union {
VehicleParameter _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT VehicleParameterDefaultTypeInternal _VehicleParameter_default_instance_;
} // namespace canbus
} // namespace apollo
static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_modules_2fcanbus_2fproto_2fvehicle_5fparameter_2eproto[1];
static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_modules_2fcanbus_2fproto_2fvehicle_5fparameter_2eproto = nullptr;
static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_modules_2fcanbus_2fproto_2fvehicle_5fparameter_2eproto = nullptr;
const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_modules_2fcanbus_2fproto_2fvehicle_5fparameter_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
PROTOBUF_FIELD_OFFSET(::apollo::canbus::VehicleParameter, _has_bits_),
PROTOBUF_FIELD_OFFSET(::apollo::canbus::VehicleParameter, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
PROTOBUF_FIELD_OFFSET(::apollo::canbus::VehicleParameter, brand_),
PROTOBUF_FIELD_OFFSET(::apollo::canbus::VehicleParameter, max_engine_pedal_),
PROTOBUF_FIELD_OFFSET(::apollo::canbus::VehicleParameter, max_enable_fail_attempt_),
PROTOBUF_FIELD_OFFSET(::apollo::canbus::VehicleParameter, driving_mode_),
1,
0,
2,
3,
};
static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, 10, -1, sizeof(::apollo::canbus::VehicleParameter)},
};
static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::apollo::canbus::_VehicleParameter_default_instance_),
};
const char descriptor_table_protodef_modules_2fcanbus_2fproto_2fvehicle_5fparameter_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
"\n,modules/canbus/proto/vehicle_parameter"
".proto\022\rapollo.canbus\032\"modules/canbus/pr"
"oto/chassis.proto\0321modules/common/config"
"s/proto/vehicle_config.proto\"\263\001\n\020Vehicle"
"Parameter\022*\n\005brand\030\001 \001(\0162\033.apollo.common"
".VehicleBrand\022\030\n\020max_engine_pedal\030\002 \001(\001\022"
"\037\n\027max_enable_fail_attempt\030\003 \001(\005\0228\n\014driv"
"ing_mode\030\004 \001(\0162\".apollo.canbus.Chassis.D"
"rivingMode"
;
static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_modules_2fcanbus_2fproto_2fvehicle_5fparameter_2eproto_deps[2] = {
&::descriptor_table_modules_2fcanbus_2fproto_2fchassis_2eproto,
&::descriptor_table_modules_2fcommon_2fconfigs_2fproto_2fvehicle_5fconfig_2eproto,
};
static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_modules_2fcanbus_2fproto_2fvehicle_5fparameter_2eproto_once;
const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_modules_2fcanbus_2fproto_2fvehicle_5fparameter_2eproto = {
false, false, 330, descriptor_table_protodef_modules_2fcanbus_2fproto_2fvehicle_5fparameter_2eproto, "modules/canbus/proto/vehicle_parameter.proto",
&descriptor_table_modules_2fcanbus_2fproto_2fvehicle_5fparameter_2eproto_once, descriptor_table_modules_2fcanbus_2fproto_2fvehicle_5fparameter_2eproto_deps, 2, 1,
schemas, file_default_instances, TableStruct_modules_2fcanbus_2fproto_2fvehicle_5fparameter_2eproto::offsets,
file_level_metadata_modules_2fcanbus_2fproto_2fvehicle_5fparameter_2eproto, file_level_enum_descriptors_modules_2fcanbus_2fproto_2fvehicle_5fparameter_2eproto, file_level_service_descriptors_modules_2fcanbus_2fproto_2fvehicle_5fparameter_2eproto,
};
PROTOBUF_ATTRIBUTE_WEAK const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* descriptor_table_modules_2fcanbus_2fproto_2fvehicle_5fparameter_2eproto_getter() {
return &descriptor_table_modules_2fcanbus_2fproto_2fvehicle_5fparameter_2eproto;
}
// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY static ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptorsRunner dynamic_init_dummy_modules_2fcanbus_2fproto_2fvehicle_5fparameter_2eproto(&descriptor_table_modules_2fcanbus_2fproto_2fvehicle_5fparameter_2eproto);
namespace apollo {
namespace canbus {
// ===================================================================
class VehicleParameter::_Internal {
public:
using HasBits = decltype(std::declval<VehicleParameter>()._has_bits_);
static void set_has_brand(HasBits* has_bits) {
(*has_bits)[0] |= 2u;
}
static void set_has_max_engine_pedal(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
static void set_has_max_enable_fail_attempt(HasBits* has_bits) {
(*has_bits)[0] |= 4u;
}
static void set_has_driving_mode(HasBits* has_bits) {
(*has_bits)[0] |= 8u;
}
};
VehicleParameter::VehicleParameter(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned)
: ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
SharedCtor();
if (!is_message_owned) {
RegisterArenaDtor(arena);
}
// @@protoc_insertion_point(arena_constructor:apollo.canbus.VehicleParameter)
}
VehicleParameter::VehicleParameter(const VehicleParameter& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
::memcpy(&max_engine_pedal_, &from.max_engine_pedal_,
static_cast<size_t>(reinterpret_cast<char*>(&driving_mode_) -
reinterpret_cast<char*>(&max_engine_pedal_)) + sizeof(driving_mode_));
// @@protoc_insertion_point(copy_constructor:apollo.canbus.VehicleParameter)
}
void VehicleParameter::SharedCtor() {
::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
reinterpret_cast<char*>(&max_engine_pedal_) - reinterpret_cast<char*>(this)),
0, static_cast<size_t>(reinterpret_cast<char*>(&driving_mode_) -
reinterpret_cast<char*>(&max_engine_pedal_)) + sizeof(driving_mode_));
}
VehicleParameter::~VehicleParameter() {
// @@protoc_insertion_point(destructor:apollo.canbus.VehicleParameter)
if (GetArenaForAllocation() != nullptr) return;
SharedDtor();
_internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}
inline void VehicleParameter::SharedDtor() {
GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
}
void VehicleParameter::ArenaDtor(void* object) {
VehicleParameter* _this = reinterpret_cast< VehicleParameter* >(object);
(void)_this;
}
void VehicleParameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void VehicleParameter::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
void VehicleParameter::Clear() {
// @@protoc_insertion_point(message_clear_start:apollo.canbus.VehicleParameter)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x0000000fu) {
::memset(&max_engine_pedal_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&driving_mode_) -
reinterpret_cast<char*>(&max_engine_pedal_)) + sizeof(driving_mode_));
}
_has_bits_.Clear();
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}
const char* VehicleParameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
_Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
switch (tag >> 3) {
// optional .apollo.common.VehicleBrand brand = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
if (PROTOBUF_PREDICT_TRUE(::apollo::common::VehicleBrand_IsValid(val))) {
_internal_set_brand(static_cast<::apollo::common::VehicleBrand>(val));
} else {
::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
}
} else
goto handle_unusual;
continue;
// optional double max_engine_pedal = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 17)) {
_Internal::set_has_max_engine_pedal(&has_bits);
max_engine_pedal_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
ptr += sizeof(double);
} else
goto handle_unusual;
continue;
// optional int32 max_enable_fail_attempt = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
_Internal::set_has_max_enable_fail_attempt(&has_bits);
max_enable_fail_attempt_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
} else
goto handle_unusual;
continue;
// optional .apollo.canbus.Chassis.DrivingMode driving_mode = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
if (PROTOBUF_PREDICT_TRUE(::apollo::canbus::Chassis_DrivingMode_IsValid(val))) {
_internal_set_driving_mode(static_cast<::apollo::canbus::Chassis_DrivingMode>(val));
} else {
::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(4, val, mutable_unknown_fields());
}
} else
goto handle_unusual;
continue;
default:
goto handle_unusual;
} // switch
handle_unusual:
if ((tag == 0) || ((tag & 7) == 4)) {
CHK_(ptr);
ctx->SetLastTag(tag);
goto message_done;
}
ptr = UnknownFieldParse(
tag,
_internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
ptr, ctx);
CHK_(ptr != nullptr);
} // while
message_done:
_has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
goto message_done;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* VehicleParameter::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:apollo.canbus.VehicleParameter)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// optional .apollo.common.VehicleBrand brand = 1;
if (cached_has_bits & 0x00000002u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
1, this->_internal_brand(), target);
}
// optional double max_engine_pedal = 2;
if (cached_has_bits & 0x00000001u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(2, this->_internal_max_engine_pedal(), target);
}
// optional int32 max_enable_fail_attempt = 3;
if (cached_has_bits & 0x00000004u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_max_enable_fail_attempt(), target);
}
// optional .apollo.canbus.Chassis.DrivingMode driving_mode = 4;
if (cached_has_bits & 0x00000008u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
4, this->_internal_driving_mode(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:apollo.canbus.VehicleParameter)
return target;
}
size_t VehicleParameter::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:apollo.canbus.VehicleParameter)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x0000000fu) {
// optional double max_engine_pedal = 2;
if (cached_has_bits & 0x00000001u) {
total_size += 1 + 8;
}
// optional .apollo.common.VehicleBrand brand = 1;
if (cached_has_bits & 0x00000002u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_brand());
}
// optional int32 max_enable_fail_attempt = 3;
if (cached_has_bits & 0x00000004u) {
total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_max_enable_fail_attempt());
}
// optional .apollo.canbus.Chassis.DrivingMode driving_mode = 4;
if (cached_has_bits & 0x00000008u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_driving_mode());
}
}
return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
}
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData VehicleParameter::_class_data_ = {
::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
VehicleParameter::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*VehicleParameter::GetClassData() const { return &_class_data_; }
void VehicleParameter::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
const ::PROTOBUF_NAMESPACE_ID::Message& from) {
static_cast<VehicleParameter *>(to)->MergeFrom(
static_cast<const VehicleParameter &>(from));
}
void VehicleParameter::MergeFrom(const VehicleParameter& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:apollo.canbus.VehicleParameter)
GOOGLE_DCHECK_NE(&from, this);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = from._has_bits_[0];
if (cached_has_bits & 0x0000000fu) {
if (cached_has_bits & 0x00000001u) {
max_engine_pedal_ = from.max_engine_pedal_;
}
if (cached_has_bits & 0x00000002u) {
brand_ = from.brand_;
}
if (cached_has_bits & 0x00000004u) {
max_enable_fail_attempt_ = from.max_enable_fail_attempt_;
}
if (cached_has_bits & 0x00000008u) {
driving_mode_ = from.driving_mode_;
}
_has_bits_[0] |= cached_has_bits;
}
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}
void VehicleParameter::CopyFrom(const VehicleParameter& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:apollo.canbus.VehicleParameter)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool VehicleParameter::IsInitialized() const {
return true;
}
void VehicleParameter::InternalSwap(VehicleParameter* other) {
using std::swap;
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
::PROTOBUF_NAMESPACE_ID::internal::memswap<
PROTOBUF_FIELD_OFFSET(VehicleParameter, driving_mode_)
+ sizeof(VehicleParameter::driving_mode_)
- PROTOBUF_FIELD_OFFSET(VehicleParameter, max_engine_pedal_)>(
reinterpret_cast<char*>(&max_engine_pedal_),
reinterpret_cast<char*>(&other->max_engine_pedal_));
}
::PROTOBUF_NAMESPACE_ID::Metadata VehicleParameter::GetMetadata() const {
return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
&descriptor_table_modules_2fcanbus_2fproto_2fvehicle_5fparameter_2eproto_getter, &descriptor_table_modules_2fcanbus_2fproto_2fvehicle_5fparameter_2eproto_once,
file_level_metadata_modules_2fcanbus_2fproto_2fvehicle_5fparameter_2eproto[0]);
}
// @@protoc_insertion_point(namespace_scope)
} // namespace canbus
} // namespace apollo
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::apollo::canbus::VehicleParameter* Arena::CreateMaybeMessage< ::apollo::canbus::VehicleParameter >(Arena* arena) {
return Arena::CreateMessageInternal< ::apollo::canbus::VehicleParameter >(arena);
}
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
|
4eff46c67ecbd27c38743e5aa088bc05da6779a7 | ee699ab7683802dc32ff6b34c4a2c6d9fd5ae555 | /SpringMass/Spring.cpp | 909ece46d33b12a2f0ad629cd20479e12ebd2d95 | [] | no_license | Lyszard/PARACHUTE | 38507bf7eaeeb050cdaefcd1e1b43acbfa28d705 | 16b711ffef2b9a53b87cd6d1945d6f1ebb64fffc | refs/heads/master | 2021-05-09T09:41:29.338643 | 2018-01-29T23:33:06 | 2018-01-29T23:33:06 | 119,452,868 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,042 | cpp | Spring.cpp | #include "Spring.h"
#include <iostream>
using namespace std;
Spring::Spring(double pos, double len, int pointsNumber, double springConstant):
position(pos),
length(len),
pointsNumber(pointsNumber),
springConstant(springConstant),
type(type),
G(9.81)
{
for (int i = 0; i <= pointsNumber; i++)
points.push_back(new Point(ofVec3f(position + (length / pointsNumber)*i, 600, 0), 5));
for (int i = 0; i < points.size(); i++)
{
if (i == 0)
{
points[i]->connectPoints(points[i + 1]);
points[i]->addSpring(points[i], points[i + 1]);
}
else if (i == points.size() - 1)
{
points[i]->connectPoints(points[i - 1]);
points[i]->addSpring(points[i], points[i - 1]);
}
else
{
points[i]->connectPoints(points[i + 1]);
points[i]->connectPoints(points[i - 1]);
points[i]->addSpring(points[i], points[i + 1]);
points[i]->addSpring(points[i], points[i - 1]);
}
}
}
Spring::~Spring()
{
}
vector<Point*> Spring::getPoints()
{
return points;
}
void Spring::update( Attractor * att)
{
ofVec2f SumForce;
for (int i = points.size() - 2; i > 0; i--)
{
SumForce = ofVec2f(0, 0);
for (int j = 0; j < points[i]->getConnectedSize(); j++)
{
SumForce += points[i]->calculateSpringForce(points[i]->getPosition(), points[i]->getConnected(j)->getPosition(), springConstant, points[i]->getSpring(j));
}
SumForce += att->CalculateAttraction(points[i]);
//cout << "SumF " << SumForce[0] <<" "<< SumForce[1] <<" "<< SumForce[2]<<endl;
points[i]->setAcceleration(ofVec3f(SumForce[0] - points[i]->getDamping()[0], (SumForce[1] + points[i]->getMass() * G) - points[i]->getDamping()[1], 0));
}
for (int i = 0; i < points.size(); i++)
{
points[i]->update();
}
}
void Spring::draw()
{
ofSetColor(139, 69, 19);
for (int i = 1; i < points.size(); i++)
{
ofLine(points[i]->getPosition()[0], points[i]->getPosition()[1], points[i - 1]->getPosition()[0], points[i - 1]->getPosition()[1]);
}
for (int i = 0; i < points.size(); i++)
{
points[i]->draw();
}
}
|
0b3a0a211d95ee167073ef304afe664d34c43d60 | be9b099fe82ad79f269fe878d4c8db3ebe47d4b1 | /Classes/PG_Controller.cpp | 6fbf11baa3d87bd36c7df6fbb766ea42aacabd58 | [] | no_license | lovePC/paoku3d | 989d563a23cd648fd14336ce7a28e7d9a33677ab | d9d44184ee6328175d4d22d22307cbca969914e3 | refs/heads/master | 2020-04-15T13:35:27.400080 | 2014-11-18T14:32:54 | 2014-11-18T14:32:54 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 4,240 | cpp | PG_Controller.cpp | #include "PG_Controller.h"
#include <stdlib.h>
#include <time.h>
#include "Obstacle.h"
#include "Coin.h"
#include "DecorationAction.h"
#include "GroundAction.h"
#define TRACK_0 0
#define TRACK_1 1
#define TRACK_2 2
PG_Controller::PG_Controller():current_sequence(nullptr)
{
srand((unsigned int)clock());
}
PG_Controller::~PG_Controller()
{
}
//随机生成障碍物
void PG_Controller::randomGenerate(Player* player,Node* render_node,float dt)
{
static float step=0;
static float obstacle_step=0;
step+=dt;
obstacle_step+=dt;
if (obstacle_step>0.4)
{
generateObsacle(player,render_node);
obstacle_step=0;
}
if (step>=3.87)
{
generateScene(player,render_node);
step=0;
}
}
//障碍物场景
void PG_Controller::generateScene(Player* player,Node* render_node)
{
auto sprite_left=Sprite3D::create("model/scene.c3b");
sprite_left->setScale(0.2);
sprite_left->setRotation3D(Vec3(0,90,0));
render_node->addChild(sprite_left,10);
//增加装饰物
auto action=new DecorationAction();
sprite_left->setPosition3D(Vec3(0,-5,-550));
sprite_left->runAction(action);
sprite_left->setName("scene");
render_node->setCameraMask(2);
}
//产生障碍物
void PG_Controller::generateObsacle(Player* player,Node* render_node)
{
auto sequence=pump();
switch (sequence.L)
{
case MONSTER:
{
auto a=new Obstacle();
a->initDefault(player,render_node);
a->bindTo(render_node);
a->getSpirte()->setPosition3D(Vec3(-10,-5,-250));
}
break;
case EMPTY:
//do nothing
break;
case COIN:
{
auto a=new Coin(player,render_node);
a->bindToLayer(render_node);
a->getSprite()->setPosition3D(Vec3(-10,0,-250));
a->getSprite()->setRotation3D(Vec3(90,0,180));
}
break;
default:
break;
}
switch (sequence.M)
{
case MONSTER:
{
auto a=new Obstacle();
a->initDefault(player,render_node);
a->bindTo(render_node);
a->getSpirte()->setPosition3D(Vec3(0,-5,-250));
}
break;
case EMPTY:
//do nothing
break;
case COIN:
{
auto a=new Coin(player,render_node);
a->bindToLayer(render_node);
a->getSprite()->setPosition3D(Vec3(0,0,-250));
a->getSprite()->setRotation3D(Vec3(90,0,180));
}
break;
default:
break;
}
switch (sequence.R)
{
case MONSTER:
{
auto a=new Obstacle();
a->initDefault(player,render_node);
a->bindTo(render_node);
a->getSpirte()->setPosition3D(Vec3(10,-5,-250));
}
break;
case EMPTY:
//do nothing
break;
case COIN:
{
auto a=new Coin(player,render_node);
a->bindToLayer(render_node);
a->getSprite()->setPosition3D(Vec3(10,0,-250));
a->getSprite()->setRotation3D(Vec3(90,0,180));
}
break;
default:
break;
}
}
void PG_Controller::generateCoin(Player* player,Node* render_node)
{
}
void PG_Controller::insertMapSequence(MapSequence* map_sequence)
{
this->sequence_list.push_back(map_sequence);
}
SequenceInfo PG_Controller::pump()
{
if (!current_sequence||current_sequence->isEos())
{
if (current_sequence)
{
current_sequence->rewind();
int index=rand()%this->sequence_list.size();
current_sequence=this->sequence_list[index];
return pump();
}else{
int index=rand()%this->sequence_list.size();
current_sequence=this->sequence_list[index];
return pump();
}
}else
{
return current_sequence->pump();
}
}
//产生背景
void PG_Controller::generateGround(Node* render_node)
{
auto road=Sprite::create("ground.png");
render_node->addChild(road,1);
road->setPosition3D(Vec3(0,-1,-250));
road->setRotation3D(Vec3(90,0,0));
render_node->setCameraMask(2);
auto action=new GroundAction();
road->runAction(action);
}
void PG_Controller::preGenerate(Node* render_node)
{
auto scene_1=Sprite3D::create("model/scene.c3b");
scene_1->setScale(0.2);
scene_1->setRotation3D(Vec3(0,90,0));
render_node->addChild(scene_1,10);
auto action_1=new DecorationAction();
scene_1->setPosition3D(Vec3(0,-5,0));
scene_1->runAction(action_1);
render_node->setCameraMask(2);
auto scene_2=Sprite3D::create("model/scene.c3b");
scene_2->setScale(0.2);
scene_2->setRotation3D(Vec3(0,90,0));
render_node->addChild(scene_2,10);
auto action_2=new DecorationAction();
scene_2->setPosition3D(Vec3(0,-5,-470));
scene_2->runAction(action_2);
render_node->setCameraMask(2);
} |
6ec8e78c9dc1172fbff9cff47eee4df7193003dd | ce0fb3ad2300ec9d690167a703778aaf47b4040f | /Platfo/camera3DSystem.h | 4798e1da5d117b516a023bf988b4988e281e7618 | [
"MIT"
] | permissive | johndpope/Platfo | c024137646bad0df86bd7f334a51c8f5b9efc17b | f5c22b5a1193e7b4d3535701c15f479159d17357 | refs/heads/master | 2021-06-01T01:47:37.965660 | 2016-06-20T14:41:09 | 2016-06-20T14:41:09 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 633 | h | camera3DSystem.h | #ifndef CAMERA3DSYSTEM_H_INCLUDED
#define CAMERA3DSYSTEM_H_INCLUDED
#include "system.h"
class Camera3DSystem : public System
{
private:
static SystemID ID;
public:
Camera3DSystem();
virtual ~Camera3DSystem();
EntityID activeCamera;
//Auto generation of ID
SystemID getID() {if(ID == 0) {ID = systemIDIncrementor++;} return ID;}
static SystemID getStaticID() {if(ID == 0) {ID = systemIDIncrementor++;} return ID;}
void entitySubscribed(Entity*,int);
void update();
void setActiveCamera(EntityID);
};
#endif // CAMERA3DSYSTEM_H_INCLUDED
|
df02b966fa3ceac5ba34b86d24d765b792ef346e | 841f348d00b9845020b8df3887db724d03ead126 | /TinySync.cpp | 9e13ed38449a6c74e2b759560ddd36334bd13acd | [] | no_license | nokotan/TinySync | 85f07665ef6cbe443c166139e2947516c43db640 | 7a9c195e6c3dfa2c77311848f71d715263666c81 | refs/heads/master | 2021-04-15T04:16:44.494270 | 2018-03-22T17:45:36 | 2018-03-22T17:48:00 | 126,374,341 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,463 | cpp | TinySync.cpp | #include "TinySync.h"
#include <map>
#include <memory>
#include <xhash>
struct SyncronizationInfo {
void* DataPointer;
size_t PreviousDataHash;
size_t DataSize;
int Operation;
};
struct SendingData {
size_t StructSize;
size_t DataNameHash;
char DataBuffer[1];
};
static std::map<size_t, SyncronizationInfo> Variables;
static DataSendingFunction SendingFunction = nullptr;
static DataReceivingFunction ReceivingFunction = nullptr;
static size_t GetDataHash(void* Data, size_t DataSize) {
return std::_Hash_bytes(static_cast<const unsigned char*>(Data), DataSize);
}
bool AddSyncronizedObject(const char DataName[], void* Data, size_t DataSize, int Operation) {
Variables[std::hash_value(DataName)] = { Data, GetDataHash(Data, DataSize), DataSize, Operation };
return false;
}
bool DeleteSyncronizedObject(const char DataName[]) {
Variables.erase(std::hash_value(DataName));
return false;
}
bool RegisterDataSendingFunction(DataSendingFunction Function) {
SendingFunction = Function;
return false;
}
bool RegisterDataReceivingFunction(DataReceivingFunction Function) {
ReceivingFunction = Function;
return false;
}
void ExecuteAllDataSyncronization() {
for (auto& Item : Variables) {
bool ExecuteSend = false;
DataSyncronizationOperation SyncronizeTiming = static_cast<DataSyncronizationOperation>(Item.second.Operation & DataSyncronizationOperation::SyncronizeTimingOperationMask);
bool SyncronizeWrite = Item.second.Operation & DataSyncronizationOperation::SyncronizeWrite;
if (SyncronizeTiming == DataSyncronizationOperation::AlwaysSyncronize) {
ExecuteSend = SyncronizeWrite;
} else if (SyncronizeTiming == DataSyncronizationOperation::SyncronizeOnDataChanged) {
size_t DataHash = GetDataHash(Item.second.DataPointer, Item.second.DataSize);
if (DataHash != Item.second.PreviousDataHash) {
ExecuteSend = SyncronizeWrite;
Item.second.PreviousDataHash = DataHash;
}
}
if (ExecuteSend) {
auto AllocateSize = Item.second.DataSize + sizeof(size_t) * 2;
auto SendData = static_cast<SendingData*>(_malloca(Item.second.DataSize + sizeof(size_t) * 2));
SendData->StructSize = AllocateSize;
SendData->DataNameHash = Item.first;
memcpy_s(SendData->DataBuffer, AllocateSize - sizeof(size_t) * 2, Item.second.DataPointer, Item.second.DataSize);
SendingFunction(SendData, AllocateSize);
_freea(SendData);
}
}
size_t StructSize;
while (ReceivingFunction(&StructSize, sizeof(size_t)) == sizeof(size_t)) {
auto ReceivingData = static_cast<SendingData*>(_malloca(StructSize));
if (ReceivingFunction(&ReceivingData->DataNameHash, StructSize - sizeof(size_t)) == StructSize - sizeof(size_t)) {
bool ExecuteReceive = false;
auto& Item = Variables[ReceivingData->DataNameHash];
DataSyncronizationOperation SyncronizeTiming = static_cast<DataSyncronizationOperation>(Item.Operation & DataSyncronizationOperation::SyncronizeTimingOperationMask);
bool SyncronizeRead = Item.Operation & DataSyncronizationOperation::SyncronizeRead;
if (SyncronizeTiming != DataSyncronizationOperation::SyncronizeExplicitly) {
ExecuteReceive = SyncronizeRead;
}
if (ExecuteReceive) {
memcpy_s(Item.DataPointer, Item.DataSize, ReceivingData->DataBuffer, StructSize - sizeof(size_t) * 2);
Item.PreviousDataHash = GetDataHash(Item.DataPointer, Item.DataSize);
}
}
}
}
void ExecuteDataSyncronization(const char DataName[]) {
auto VariableHash = std::hash_value(DataName);
auto& Item = Variables[VariableHash];
auto AllocateSize = Item.DataSize + sizeof(size_t) * 2;
auto SendData = static_cast<SendingData*>(_malloca(Item.DataSize + sizeof(size_t) * 2));
SendData->StructSize = AllocateSize;
SendData->DataNameHash = VariableHash;
memcpy_s(SendData->DataBuffer, AllocateSize - sizeof(size_t) * 2, Item.DataPointer, Item.DataSize);
Item.PreviousDataHash = GetDataHash(Item.DataPointer, Item.DataSize);
SendingFunction(SendData, AllocateSize);
_freea(SendData);
} |
b2cd11c5e90c3af2c04a5339f2dcd9516876e87d | c9e05d02afbb3360a498876a0bc9d68b1394b074 | /EduServer/sublogin/loginform.cpp | b5372423d1652fd820cc82fcc3d962946624d535 | [] | no_license | duier2018/EduMSForNetBase | 971cdb96ae8293f16685620aaa2a537a82b43327 | 7e908b75522e06cf25103c1f855e982ff5094d76 | refs/heads/master | 2020-07-06T08:45:36.584843 | 2019-08-18T04:31:03 | 2019-08-18T04:31:03 | 202,959,860 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 958 | cpp | loginform.cpp | #include "loginform.h"
#include "ui_loginform.h"
#include <QPaintEvent>
#include <QPainter>
#include <QPixmap>
#include <QMessageBox>
LoginForm::LoginForm(QWidget *parent) :
QWidget(parent),
ui(new Ui::LoginForm)
{
ui->setupUi(this);
}
LoginForm::~LoginForm()
{
delete ui;
}
void LoginForm::paintEvent(QPaintEvent *)
{
QPainter p(this);
QPixmap pix(":/images/back.jpg");
p.drawPixmap(0,0,pix);
}
void LoginForm::on_pb_login_clicked()
{
emit signalUserLogin(ui->le_uid->text(),
ui->le_pswd->text());
}
void LoginForm::userLoginFail(void)
{
QMessageBox msgBox(this);
msgBox.setStyleSheet("background-color: rgb(172, 88, 42);");
msgBox.setText("登录失败!");
msgBox.setInformativeText("用户名或者密码错误,请重新输入!");
msgBox.setStandardButtons(QMessageBox::Retry | QMessageBox::Close);
msgBox.setDefaultButton(QMessageBox::Retry);
msgBox.exec();
}
|
d31e6d89e70747fdd1ef7c3a6b6d068da1ac3c52 | 866efabadb19cd98a1d55447aa0a9777bce0eedd | /resource.cpp | 51dd1e6813fa76631c30c65b0fa513e3f89745c3 | [] | no_license | Snowdroplet/GatehouseRewriteRepository | 301e4048f98b8c5856c75932d2c3e2d582b72361 | f3a561e7f98de56ef6a256ce6c872cbf1f8b1827 | refs/heads/master | 2023-06-23T13:31:39.102856 | 2021-07-21T17:12:25 | 2021-07-21T17:12:25 | 387,786,191 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 384 | cpp | resource.cpp | #include "resource.h"
/// Declaration
ALLEGRO_BITMAP *gfxActorSheet = nullptr;
ALLEGRO_BITMAP *gfxTileSheet = nullptr;
/// Constants
void LoadResources()
{
gfxActorSheet = al_load_bitmap("gfxActorSheet32.png");
gfxTileSheet = al_load_bitmap("gfxTileSheet32.png");
}
void UnloadResources()
{
al_destroy_bitmap(gfxActorSheet);
al_destroy_bitmap(gfxTileSheet);
}
|
ca6ea81744230873137a16127ca939b2d4d6257f | edc691f8d5dfc134c65420ee5decdc95d0418339 | /BiuroPodrozy/include/WycieczkaObjazdowa.h | f52453bcb7e3d336f458e96dda257f81b83e2695 | [] | no_license | alicja-lachman/BiuroPodrozy | 0d591a895479114ea572c7e97a8effbe670476f1 | 41241bc457d1b2dd73b62b23680b8ce8b45fbf4a | HEAD | 2016-08-12T06:02:46.907838 | 2016-01-12T09:47:50 | 2016-01-12T09:47:50 | 47,417,549 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 911 | h | WycieczkaObjazdowa.h | #ifndef WYCIECZKAOBJAZDOWA_H
#define WYCIECZKAOBJAZDOWA_H
#include <vector>
#include <set>
#include <Wycieczka.h>
#include <string>
using namespace std;
class Wczasy;
class WycieczkaLaczona;
class WycieczkaObjazdowa : public Wycieczka
{
private:
string dojazd;
struct tm data_zakonczenia;
vector <string> lista_miast;
set <string> lista_krajow;
string ostatni_kraj;
public:
WycieczkaObjazdowa(string nazwa1, struct tm data_rozp, float koszt_wyc, string dojazd, struct tm data_zak, vector <string> lista_m, set <string> lista_k, string ostatni_k);
~WycieczkaObjazdowa();
void drukuj(BiuroPodrozy *biuro, int mnoznik=1);
void sprawdz(BiuroPodrozy *biuro);
struct tm getDataZak();
string getListaMiast(int i);
int getListaMiastRozmiar();
set <string> getListaKrajow();
};
#endif // WYCIECZKAOBJAZDOWA_H
|
6836c212bbf6815e42876f1c0f75b6e5e3f4f654 | 25e826022550f3ee197018b7caf13f034141b425 | /AM/src/MCRIU.cc | 42086cdfd024554276d80f44f7be4e00c6ba9b4b | [
"BSD-3-Clause"
] | permissive | siqiyan/MTF | c7ecab05228714be0be09e200650e70fa7eeb176 | 9a76388c907755448bb7223420fe74349130f636 | refs/heads/master | 2022-04-20T22:17:06.090391 | 2020-04-23T07:09:01 | 2020-04-23T07:09:01 | 256,113,963 | 1 | 0 | BSD-3-Clause | 2020-04-16T05:02:00 | 2020-04-16T05:01:59 | null | UTF-8 | C++ | false | false | 207 | cc | MCRIU.cc | #include "mtf/AM/MCRIU.h"
_MTF_BEGIN_NAMESPACE
MCRIU::MCRIU(const ParamType *riu_params) :
RIU(riu_params, 3){
name = "mcriu";
printf("Using Multi Channel variant\n");
}
_MTF_END_NAMESPACE
|
c0ddcf3f96b7fe93e79abdf436d3b932959155f4 | 9eb936a4f5c65cd25467199e30cce1fc5a8946ae | /src/serialization/allocators.hh | 499749fdba4c4914734b0535f07370a10b20340e | [
"MIT"
] | permissive | mellowagain/rpc-wine | 9d49b718e35f26e017d937138b625013fec09409 | e432eb6918523b329f8afffa6c65f86bae27e54f | refs/heads/master | 2022-10-17T14:05:34.647610 | 2022-09-08T01:44:58 | 2022-09-08T01:44:58 | 137,587,190 | 52 | 5 | MIT | 2022-09-08T01:44:59 | 2018-06-16T14:39:21 | C++ | UTF-8 | C++ | false | false | 1,082 | hh | allocators.hh | #ifndef RPC_WINE_ALLOCATORS_HH
#define RPC_WINE_ALLOCATORS_HH
#include <cstddef>
namespace rpc_wine::serialization {
class linear_allocator {
private:
char *buffer;
char *end;
public:
static const bool kNeedFree = false;
linear_allocator() = default;
linear_allocator(char *buffer, size_t size);
void *malloc(size_t size);
void *realloc(void*, size_t, size_t new_size);
static void free(void*);
};
template <size_t size>
class fixed_linear_allocator : public linear_allocator {
public:
static const bool kNeedFree = false;
char fixed_buffer[size] {};
fixed_linear_allocator() : linear_allocator(this->fixed_buffer, size) {
// Initialized in initializer list
}
void *Realloc(void *original_ptr, size_t original_size, size_t new_size) {
return realloc(original_ptr, original_size, new_size);
}
static void Free(void *ptr) {
free(ptr);
}
};
}
#endif //RPC_WINE_ALLOCATORS_HH
|
bb5f48025157af9a31cf66f87ceeccdc4d794606 | 4601fb207346ec8921d47e6612102a8b15872645 | /src/typedefs.h | 992efcb316b9634f124e4a77e01a380bba521e28 | [
"Apache-2.0"
] | permissive | chinesejie/reflect | 2761abb168636af29f817b7eabf6d6adbcd826d6 | e063ec18bf29c05e1067b91871063618e2ea6035 | refs/heads/master | 2020-12-26T03:55:33.885148 | 2015-05-28T07:40:36 | 2015-05-28T07:40:36 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 407 | h | typedefs.h | #ifndef _TYPEDEFS_H
#define _TYPEDEFS_H
typedef unsigned char uchar;
#include <string>
#include <vector>
#include <exception>
#include <sstream>
#include <iostream>
using std::string;
using std::vector;
using std::ostream;
using std::cout;
using std::endl;
using std::cin;
enum {
INT8 = 0,
INT32,
STRING, // how to handle this three type
POINTER,
OBJECT,
};
#define MAXINT INT32
#endif
|
74e33482719cd8eb96b6f430233fa2931a2c2d9f | 865bfdce73e6c142ede4a7c9163c2ac9aac5ceb6 | /Source/Generic/Types/Plane.h | 9d781c779408131a64f1fe976b7763b2306be20a | [] | no_license | TLeonardUK/ZombieGrinder | d1b77aa0fcdf4a5b765e394711147d5621c8d4e8 | 8fc3c3b7f24f9980b75a143cbf37fab32cf66bbf | refs/heads/master | 2021-03-19T14:20:54.990622 | 2019-08-26T16:35:58 | 2019-08-26T16:35:58 | 78,782,741 | 6 | 3 | null | null | null | null | UTF-8 | C++ | false | false | 851 | h | Plane.h | // ===================================================================
// Copyright (C) 2013 Tim Leonard
// ===================================================================
#ifndef _GENERIC_PLANE_
#define _GENERIC_PLANE_
#include "Generic/Types/Vector3.h"
class Plane
{
//MEMORY_ALLOCATOR(Plane, "Data Types");
private:
Vector3 m_normal;
Vector3 m_point;
float m_d;
public:
Plane()
{
}
Plane(Vector3 v1,
Vector3 v2,
Vector3 v3)
{
Vector3 aux1 = v1 - v2;
Vector3 aux2 = v3 - v2;
m_normal = aux2.Cross(aux1);
m_normal = m_normal.Normalize();
m_point = v2;
m_d = -(m_normal.Dot(m_point));
}
Vector3 Get_Normal()
{
return m_normal;
}
float Get_Distance()
{
return m_d;
}
float Get_Distance_To_Point(Vector3 point)
{
float distance = m_d + m_normal.Dot(point);
return distance;
}
};
#endif |
b563d412e65d059f3881a53cf70419519f302cb3 | 1d827f46ed78e1d5f72e0f4ce882dfb54879a4a0 | /Arduino/cio_007_Lookups.ino | 3dbdf93f5ead5ddb3ee2121a1656b61c95ed621e | [] | no_license | mackelec/CANio-18 | e771063029db4d89555da410001efa1eeb54b79e | 7da9c43119f657cd2ec8e3f3311d8bf52305f455 | refs/heads/main | 2023-07-17T21:24:53.279573 | 2021-08-22T22:09:29 | 2021-08-22T22:09:29 | 398,897,774 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 67,376 | ino | cio_007_Lookups.ino |
uint8_t const gaugeTempLookup[] = {
20 , 20 , 20 , 21 , 21 , 22 , 22 , 23 , 23 , 24 ,
24 , 25 , 25 , 26 , 26 , 27 , 27 , 28 , 28 , 29 ,
29 , 30 , 30 , 31 , 31 , 32 , 36 , 40 , 45 , 49 ,
53 , 58 , 62 , 66 , 71 , 75 , 79 , 84 , 88 , 93 ,
97 , 101 , 106 , 110 , 114 , 119 , 123 , 127 , 132 , 136 ,
141 , 143 , 145 , 148 , 150 , 152 , 155 , 157 , 159 , 162 ,
164 , 166 , 169 , 171 , 174 , 176 , 178 , 181 , 183 , 185 ,
188 , 190 , 192 , 195 , 197 , 200 , 202 , 204 , 206 , 208 ,
211 , 213 , 215 , 217 , 219 , 222 , 224 , 226 , 228 , 230 ,
233 , 235 , 237 , 239 , 241 , 244 , 246 , 248 , 250 , 252 ,
255
};
uint8_t const gaugeFuelLookup[] = {
28 , 28 , 28 , 28 , 28 , 29 , 29 , 29 , 29 , 30 ,
30 , 30 , 30 , 31 , 31 , 31 , 31 , 32 , 32 , 32 ,
32 , 33 , 33 , 33 , 33 , 34 , 34 , 35 , 35 , 36 ,
36 , 37 , 38 , 38 , 39 , 39 , 40 , 41 , 41 , 42 ,
43 , 44 , 45 , 46 , 46 , 47 , 48 , 49 , 50 , 51 ,
52 , 53 , 54 , 55 , 56 , 57 , 58 , 59 , 60 , 61 ,
62 , 63 , 65 , 67 , 70 , 73 , 75 , 78 , 81 , 83 ,
86 , 89 , 91 , 94 , 97 , 100 , 102 , 105 , 107 , 110 ,
112 , 115 , 117 , 120 , 122 , 125 , 127 , 130 , 135 , 140 ,
145 , 150 , 155 , 160 , 165 , 170 , 185 , 200 , 215 , 230 ,
245
};
uint16_t const gaugeRPMLookup[] = {
40 , 40 , 40 , 40 , 40 , 40 , 40 , 40 , 40 , 40 ,
40 , 40 , 40 , 40 , 40 , 40 , 40 , 40 , 40 , 40 ,
40 , 40 , 40 , 40 , 40 , 40 , 40 , 40 , 40 , 40 ,
40 , 40 , 40 , 40 , 40 , 40 , 40 , 40 , 40 , 40 ,
40 , 40 , 40 , 40 , 40 , 40 , 40 , 40 , 40 , 40 ,
40 , 40 , 40 , 40 , 40 , 40 , 40 , 40 , 40 , 40 ,
40 , 40 , 40 , 40 , 40 , 40 , 40 , 40 , 40 , 40 ,
40 , 40 , 40 , 40 , 40 , 40 , 40 , 40 , 40 , 40 ,
40 , 40 , 40 , 40 , 40 , 40 , 40 , 40 , 40 , 40 ,
40 , 40 , 40 , 40 , 40 , 40 , 40 , 40 , 40 , 40 ,
40 , 40 , 40 , 41 , 41 , 41 , 42 , 42 , 43 , 43 ,
43 , 44 , 44 , 44 , 45 , 45 , 46 , 46 , 46 , 47 ,
47 , 47 , 48 , 48 , 49 , 49 , 49 , 50 , 50 , 50 ,
51 , 51 , 52 , 52 , 52 , 53 , 53 , 53 , 54 , 54 ,
55 , 55 , 55 , 56 , 56 , 56 , 57 , 57 , 58 , 58 ,
58 , 59 , 59 , 59 , 60 , 60 , 61 , 61 , 61 , 62 ,
62 , 62 , 63 , 63 , 64 , 64 , 64 , 65 , 65 , 65 ,
66 , 66 , 67 , 67 , 67 , 68 , 68 , 68 , 69 , 69 ,
70 , 70 , 70 , 71 , 71 , 71 , 72 , 72 , 73 , 73 ,
73 , 74 , 74 , 74 , 75 , 75 , 76 , 76 , 76 , 77 ,
77 , 77 , 78 , 78 , 79 , 79 , 79 , 80 , 80 , 80 ,
81 , 81 , 82 , 82 , 82 , 83 , 83 , 83 , 84 , 84 ,
85 , 85 , 85 , 86 , 86 , 86 , 87 , 87 , 88 , 88 ,
88 , 89 , 89 , 89 , 90 , 90 , 91 , 91 , 91 , 92 ,
92 , 92 , 93 , 93 , 94 , 94 , 94 , 95 , 95 , 95 ,
96 , 96 , 97 , 97 , 97 , 98 , 98 , 98 , 99 , 99 ,
100 , 100 , 100 , 101 , 101 , 101 , 102 , 102 , 102 , 103 ,
103 , 103 , 104 , 104 , 104 , 105 , 105 , 106 , 106 , 106 ,
107 , 107 , 107 , 108 , 108 , 108 , 109 , 109 , 109 , 110 ,
110 , 110 , 111 , 111 , 112 , 112 , 112 , 113 , 113 , 113 ,
114 , 114 , 114 , 115 , 115 , 115 , 116 , 116 , 117 , 117 ,
117 , 118 , 118 , 118 , 119 , 119 , 119 , 120 , 120 , 120 ,
121 , 121 , 121 , 122 , 122 , 123 , 123 , 123 , 124 , 124 ,
124 , 125 , 125 , 125 , 126 , 126 , 126 , 127 , 127 , 127 ,
128 , 128 , 129 , 129 , 129 , 130 , 130 , 130 , 131 , 131 ,
131 , 132 , 132 , 132 , 133 , 133 , 134 , 134 , 134 , 135 ,
135 , 135 , 136 , 136 , 136 , 137 , 137 , 137 , 138 , 138 ,
138 , 139 , 139 , 140 , 140 , 140 , 141 , 141 , 141 , 142 ,
142 , 142 , 143 , 143 , 143 , 144 , 144 , 144 , 145 , 145 ,
146 , 146 , 146 , 147 , 147 , 147 , 148 , 148 , 148 , 149 ,
149 , 149 , 150 , 150 , 151 , 151 , 151 , 152 , 152 , 152 ,
153 , 153 , 153 , 154 , 154 , 154 , 155 , 155 , 155 , 156 ,
156 , 157 , 157 , 157 , 158 , 158 , 158 , 159 , 159 , 159 ,
160 , 160 , 160 , 161 , 161 , 161 , 162 , 162 , 163 , 163 ,
163 , 164 , 164 , 164 , 165 , 165 , 165 , 166 , 166 , 166 ,
167 , 167 , 168 , 168 , 168 , 169 , 169 , 169 , 170 , 170 ,
170 , 171 , 171 , 171 , 172 , 172 , 172 , 173 , 173 , 174 ,
174 , 174 , 175 , 175 , 175 , 176 , 176 , 176 , 177 , 177 ,
177 , 178 , 178 , 178 , 179 , 179 , 180 , 180 , 180 , 181 ,
181 , 181 , 182 , 182 , 182 , 183 , 183 , 183 , 184 , 184 ,
185 , 185 , 185 , 186 , 186 , 187 , 187 , 188 , 188 , 189 ,
189 , 189 , 190 , 190 , 191 , 191 , 192 , 192 , 193 , 193 ,
194 , 194 , 194 , 195 , 195 , 196 , 196 , 197 , 197 , 198 ,
198 , 198 , 199 , 199 , 200 , 200 , 201 , 201 , 202 , 202 ,
203 , 203 , 203 , 204 , 204 , 205 , 205 , 206 , 206 , 207 ,
207 , 207 , 208 , 208 , 209 , 209 , 210 , 210 , 211 , 211 ,
212 , 212 , 212 , 213 , 213 , 214 , 214 , 215 , 215 , 216 ,
216 , 216 , 217 , 217 , 218 , 218 , 219 , 219 , 220 , 220 ,
221 , 221 , 221 , 222 , 222 , 223 , 223 , 224 , 224 , 225 ,
225 , 225 , 226 , 226 , 227 , 227 , 228 , 228 , 229 , 229 ,
230 , 230 , 230 , 231 , 231 , 232 , 232 , 233 , 233 , 234 ,
234 , 234 , 235 , 235 , 236 , 236 , 237 , 237 , 238 , 238 ,
239 , 239 , 239 , 240 , 240 , 241 , 241 , 242 , 242 , 243 ,
243 , 243 , 244 , 244 , 245 , 245 , 246 , 246 , 247 , 247 ,
248 , 248 , 248 , 249 , 249 , 250 , 250 , 251 , 251 , 252 ,
252 , 252 , 253 , 253 , 254 , 254 , 255 , 255 , 256 , 256 ,
257 , 257 , 257 , 258 , 258 , 259 , 259 , 260 , 260 , 261 ,
261 , 261 , 262 , 262 , 263 , 263 , 264 , 264 , 265 , 265 ,
266 , 266 , 266 , 267 , 267 , 268 , 268 , 269 , 269 , 270 ,
270 , 270 , 271 , 271 , 272 , 272 , 273 , 273 , 274 , 274 ,
275 , 275 , 275 , 276 , 276 , 277 , 277 , 278 , 278 , 279 ,
279 , 279 , 280 , 280 , 281 , 281 , 282 , 282 , 283 , 283 ,
284 , 284 , 284 , 285 , 285 , 286 , 286 , 287 , 287 , 288 ,
288 , 288 , 289 , 289 , 290 , 290 , 291 , 291 , 292 , 292 ,
293 , 293 , 293 , 294 , 294 , 295 , 295 , 296 , 296 , 297 ,
297 , 297 , 298 , 298 , 299 , 299 , 300 , 300 , 301 , 301 ,
302 , 302 , 302 , 303 , 303 , 304 , 304 , 305 , 305 , 306 ,
306 , 306 , 307 , 307 , 308 , 308 , 309 , 309 , 310 , 310 ,
311 , 311 , 311 , 312 , 312 , 313 , 313 , 314 , 314 , 315 ,
315 , 315 , 316 , 316 , 317 , 317 , 318 , 318 , 319 , 319 ,
320 , 320 , 320 , 321 , 321 , 322 , 322 , 323 , 323 , 324 ,
324 , 324 , 325 , 325 , 326 , 326 , 327 , 327 , 328 , 328 ,
329 , 329 , 329 , 330 , 330 , 331 , 331 , 332 , 332 , 333 ,
333 , 333 , 334 , 334 , 335 , 335 , 336 , 336 , 337 , 337 ,
338 , 338 , 338 , 339 , 339 , 340 , 340 , 341 , 341 , 342 ,
342 , 342 , 343 , 343 , 344 , 344 , 345 , 345 , 346 , 346 ,
347 , 347 , 347 , 348 , 348 , 349 , 349 , 350 , 350 , 351 ,
351 , 351 , 352 , 352 , 353 , 353 , 354 , 354 , 355 , 355 ,
356 , 356 , 356 , 357 , 357 , 358 , 358 , 359 , 359 , 360 ,
360 , 360 , 361 , 361 , 362 , 362 , 363 , 363 , 364 , 364 ,
365 , 365 , 365 , 366 , 366 , 367 , 367 , 368 , 368 , 369 ,
369 , 369 , 370 , 370 , 371 , 371 , 372 , 372 , 373 , 373 ,
374 , 374 , 374 , 375 , 375 , 376 , 376 , 377 , 377 , 378 ,
378 , 378 , 379 , 379 , 380 , 380 , 381 , 381 , 382 , 382 ,
383 , 383 , 383 , 384 , 384 , 385 , 385 , 386 , 386 , 387 ,
387 , 387 , 388 , 388 , 389 , 389 , 390 , 390 , 391 , 391 ,
392 , 392 , 392 , 393 , 393 , 394 , 394 , 395 , 395 , 396 ,
396 , 396 , 397 , 397 , 398 , 398 , 399 , 399 , 400 , 400 ,
401 , 401 , 401 , 402 , 402 , 403 , 403 , 404 , 404 , 405 ,
405 , 405 , 406 , 406 , 407 , 407 , 408 , 408 , 409 , 409 ,
410 , 410 , 410 , 411 , 411 , 411 , 412 , 412 , 412 , 413 ,
413 , 414 , 414 , 414 , 415 , 415 , 415 , 416 , 416 , 417 ,
417 , 417 , 418 , 418 , 418 , 419 , 419 , 419 , 420 , 420 ,
421 , 421 , 421 , 422 , 422 , 422 , 423 , 423 , 424 , 424 ,
424 , 425 , 425 , 425 , 426 , 426 , 427 , 427 , 427 , 428 ,
428 , 428 , 429 , 429 , 429 , 430 , 430 , 431 , 431 , 431 ,
432 , 432 , 432 , 433 , 433 , 434 , 434 , 434 , 435 , 435 ,
435 , 436 , 436 , 437 , 437 , 437 , 438 , 438 , 438 , 439 ,
439 , 439 , 440 , 440 , 441 , 441 , 441 , 442 , 442 , 442 ,
443 , 443 , 444 , 444 , 444 , 445 , 445 , 445 , 446 , 446 ,
447 , 447 , 447 , 448 , 448 , 448 , 449 , 449 , 449 , 450 ,
450 , 451 , 451 , 451 , 452 , 452 , 452 , 453 , 453 , 454 ,
454 , 454 , 455 , 455 , 455 , 456 , 456 , 456 , 457 , 457 ,
458 , 458 , 458 , 459 , 459 , 459 , 460 , 460 , 461 , 461 ,
461 , 462 , 462 , 462 , 463 , 463 , 464 , 464 , 464 , 465 ,
465 , 465 , 466 , 466 , 466 , 467 , 467 , 468 , 468 , 468 ,
469 , 469 , 469 , 470 , 470 , 471 , 471 , 471 , 472 , 472 ,
472 , 473 , 473 , 474 , 474 , 474 , 475 , 475 , 475 , 476 ,
476 , 476 , 477 , 477 , 478 , 478 , 478 , 479 , 479 , 479 ,
480 , 480 , 481 , 481 , 481 , 482 , 482 , 482 , 483 , 483 ,
484 , 484 , 484 , 485 , 485 , 485 , 486 , 486 , 486 , 487 ,
487 , 488 , 488 , 488 , 489 , 489 , 489 , 490 , 490 , 491 ,
491 , 491 , 492 , 492 , 492 , 493 , 493 , 493 , 494 , 494 ,
495 , 495 , 495 , 496 , 496 , 496 , 497 , 497 , 498 , 498 ,
498 , 499 , 499 , 499 , 500 , 500 , 501 , 501 , 501 , 502 ,
502 , 502 , 503 , 503 , 503 , 504 , 504 , 505 , 505 , 505 ,
506 , 506 , 506 , 507 , 507 , 508 , 508 , 508 , 509 , 509 ,
509 , 510 , 510 , 511 , 511 , 511 , 512 , 512 , 512 , 513 ,
513 , 513 , 514 , 514 , 515 , 515 , 515 , 516 , 516 , 516 ,
517 , 517 , 518 , 518 , 518 , 519 , 519 , 519 , 520 , 520 ,
521 , 521 , 521 , 522 , 522 , 522 , 523 , 523 , 523 , 524 ,
524 , 525 , 525 , 525 , 526 , 526 , 526 , 527 , 527 , 528 ,
528 , 528 , 529 , 529 , 529 , 530 , 530 , 530 , 531 , 531 ,
532 , 532 , 532 , 533 , 533 , 533 , 534 , 534 , 535 , 535 ,
535 , 536 , 536 , 536 , 537 , 537 , 538 , 538 , 538 , 539 ,
539 , 539 , 540 , 540 , 540 , 541 , 541 , 542 , 542 , 542 ,
543 , 543 , 543 , 544 , 544 , 545 , 545 , 545 , 546 , 546 ,
546 , 547 , 547 , 548 , 548 , 548 , 549 , 549 , 549 , 550 ,
550 , 550 , 551 , 551 , 552 , 552 , 552 , 553 , 553 , 553 ,
554 , 554 , 555 , 555 , 555 , 556 , 556 , 556 , 557 , 557 ,
558 , 558 , 558 , 559 , 559 , 559 , 560 , 560 , 560 , 561 ,
561 , 562 , 562 , 562 , 563 , 563 , 563 , 564 , 564 , 565 ,
565 , 565 , 566 , 566 , 566 , 567 , 567 , 567 , 568 , 568 ,
569 , 569 , 569 , 570 , 570 , 570 , 571 , 571 , 572 , 572 ,
572 , 573 , 573 , 573 , 574 , 574 , 575 , 575 , 575 , 576 ,
576 , 576 , 577 , 577 , 577 , 578 , 578 , 579 , 579 , 579 ,
580 , 580 , 580 , 581 , 581 , 582 , 582 , 582 , 583 , 583 ,
583 , 584 , 584 , 585 , 585 , 585 , 586 , 586 , 586 , 587 ,
587 , 587 , 588 , 588 , 589 , 589 , 589 , 590 , 590 , 590 ,
591 , 591 , 592 , 592 , 592 , 593 , 593 , 593 , 594 , 594 ,
595 , 595 , 595 , 596 , 596 , 596 , 597 , 597 , 597 , 598 ,
598 , 599 , 599 , 599 , 600 , 600 , 600 , 601 , 601 , 602 ,
602 , 602 , 603 , 603 , 603 , 604 , 604 , 604 , 605 , 605 ,
606 , 606 , 606 , 607 , 607 , 607 , 608 , 608 , 609 , 609 ,
609 , 610 , 610 , 610 , 611 , 611 , 612 , 612 , 612 , 613 ,
613 , 613 , 614 , 614 , 614 , 615 , 615 , 616 , 616 , 616 ,
617 , 617 , 617 , 618 , 618 , 619 , 619 , 619 , 620 , 620 ,
620 , 621 , 621 , 622 , 622 , 622 , 623 , 623 , 623 , 624 ,
624 , 624 , 625 , 625 , 626 , 626 , 626 , 627 , 627 , 627 ,
628 , 628 , 629 , 629 , 629 , 630 , 630 , 630 , 631 , 631 ,
632 , 632 , 632 , 633 , 633 , 633 , 634 , 634 , 634 , 635 ,
635 , 636 , 636 , 636 , 637 , 637 , 637 , 638 , 638 , 639 ,
639 , 639 , 640 , 640 , 640 , 641 , 641 , 641 , 642 , 642 ,
643 , 643 , 643 , 644 , 644 , 644 , 645 , 645 , 646 , 646 ,
646 , 647 , 647 , 647 , 648 , 648 , 649 , 649 , 649 , 650 ,
650 , 650 , 651 , 651 , 651 , 652 , 652 , 653 , 653 , 653 ,
654 , 654 , 654 , 655 , 655 , 656 , 656 , 656 , 657 , 657 ,
657 , 658 , 658 , 659 , 659 , 659 , 660 , 660 , 660 , 661 ,
661 , 661 , 662 , 662 , 663 , 663 , 663 , 664 , 664 , 664 ,
665 , 665 , 666 , 666 , 666 , 667 , 667 , 667 , 668 , 668 ,
669 , 669 , 669 , 670 , 670 , 670 , 671 , 671 , 671 , 672 ,
672 , 673 , 673 , 673 , 674 , 674 , 674 , 675 , 675 , 676 ,
676 , 676 , 677 , 677 , 677 , 678 , 678 , 678 , 679 , 679 ,
680 , 680 , 680 , 681 , 681 , 681 , 682 , 682 , 683 , 683 ,
683 , 684 , 684 , 684 , 685 , 685 , 686 , 686 , 686 , 687 ,
687 , 687 , 688 , 688 , 688 , 689 , 689 , 690 , 690 , 690 ,
691 , 691 , 691 , 692 , 692 , 693 , 693 , 693 , 694 , 694 ,
694 , 695 , 695 , 696 , 696 , 696 , 697 , 697 , 697 , 698 ,
698 , 698 , 699 , 699 , 700 , 700 , 700 , 701 , 701 , 701 ,
702 , 702 , 703 , 703 , 703 , 704 , 704 , 704 , 705 , 705 ,
706 , 706 , 706 , 707 , 707 , 707 , 708 , 708 , 708 , 709 ,
709 , 710 , 710 , 710 , 711 , 711 , 711 , 712 , 712 , 713 ,
713 , 713 , 714 , 714 , 714 , 715 , 715 , 715 , 716 , 716 ,
717 , 717 , 717 , 718 , 718 , 718 , 719 , 719 , 720 , 720 ,
720 , 721 , 721 , 721 , 722 , 722 , 723 , 723 , 723 , 724 ,
724 , 724 , 725 , 725 , 725 , 726 , 726 , 727 , 727 , 727 ,
728 , 728 , 728 , 729 , 729 , 730 , 730 , 730 , 731 , 731 ,
731 , 732 , 732 , 733 , 733 , 733 , 734 , 734 , 734 , 735 ,
735 , 735 , 736 , 736 , 737 , 737 , 737 , 738 , 738 , 738 ,
739 , 739 , 740 , 740 , 740 , 741 , 741 , 741 , 742 , 742 ,
743 , 743 , 743 , 744 , 744 , 744 , 745 , 745 , 745 , 746 ,
746 , 747 , 747 , 747 , 748 , 748 , 748 , 749 , 749 , 750 ,
750 , 750 , 751 , 751 , 751 , 752 , 752 , 752 , 753 , 753 ,
754 , 754 , 754 , 755 , 755 , 755 , 756 , 756 , 757 , 757 ,
757 , 758 , 758 , 758 , 759 , 759 , 760 , 760 , 760 , 761 ,
761 , 761 , 762 , 762 , 762 , 763 , 763 , 764 , 764 , 764 ,
765 , 765 , 765 , 766 , 766 , 767 , 767 , 767 , 768 , 768 ,
768 , 769 , 769 , 770 , 770 , 770 , 771 , 771 , 771 , 772 ,
772 , 772 , 773 , 773 , 774 , 774 , 774 , 775 , 775 , 775 ,
776 , 776 , 777 , 777 , 777 , 778 , 778 , 778 , 779 , 779 ,
780 , 780 , 780 , 781 , 781 , 781 , 782 , 782 , 783 , 783 ,
783 , 784 , 784 , 785 , 785 , 785 , 786 , 786 , 787 , 787 ,
787 , 788 , 788 , 788 , 789 , 789 , 790 , 790 , 790 , 791 ,
791 , 792 , 792 , 792 , 793 , 793 , 794 , 794 , 794 , 795 ,
795 , 795 , 796 , 796 , 797 , 797 , 797 , 798 , 798 , 799 ,
799 , 799 , 800 , 800 , 801 , 801 , 801 , 802 , 802 , 803 ,
803 , 803 , 804 , 804 , 804 , 805 , 805 , 806 , 806 , 806 ,
807 , 807 , 808 , 808 , 808 , 809 , 809 , 810 , 810 , 810 ,
811 , 811 , 811 , 812 , 812 , 813 , 813 , 813 , 814 , 814 ,
815 , 815 , 815 , 816 , 816 , 817 , 817 , 817 , 818 , 818 ,
819 , 819 , 819 , 820 , 820 , 820 , 821 , 821 , 822 , 822 ,
822 , 823 , 823 , 824 , 824 , 824 , 825 , 825 , 826 , 826 ,
826 , 827 , 827 , 827 , 828 , 828 , 829 , 829 , 829 , 830 ,
830 , 831 , 831 , 831 , 832 , 832 , 833 , 833 , 833 , 834 ,
834 , 834 , 835 , 835 , 836 , 836 , 836 , 837 , 837 , 838 ,
838 , 838 , 839 , 839 , 840 , 840 , 840 , 841 , 841 , 842 ,
842 , 842 , 843 , 843 , 843 , 844 , 844 , 845 , 845 , 845 ,
846 , 846 , 847 , 847 , 847 , 848 , 848 , 849 , 849 , 849 ,
850 , 850 , 850 , 851 , 851 , 852 , 852 , 852 , 853 , 853 ,
854 , 854 , 854 , 855 , 855 , 856 , 856 , 856 , 857 , 857 ,
858 , 858 , 858 , 859 , 859 , 859 , 860 , 860 , 861 , 861 ,
861 , 862 , 862 , 863 , 863 , 863 , 864 , 864 , 865 , 865 ,
865 , 866 , 866 , 866 , 867 , 867 , 868 , 868 , 868 , 869 ,
869 , 870 , 870 , 870 , 871 , 871 , 872 , 872 , 872 , 873 ,
873 , 873 , 874 , 874 , 875 , 875 , 875 , 876 , 876 , 877 ,
877 , 877 , 878 , 878 , 879 , 879 , 879 , 880 , 880 , 881 ,
881 , 881 , 882 , 882 , 882 , 883 , 883 , 884 , 884 , 884 ,
885 , 885 , 886 , 886 , 886 , 887 , 887 , 888 , 888 , 888 ,
889 , 889 , 889 , 890 , 890 , 891 , 891 , 891 , 892 , 892 ,
893 , 893 , 893 , 894 , 894 , 895 , 895 , 895 , 896 , 896 ,
897 , 897 , 897 , 898 , 898 , 898 , 899 , 899 , 900 , 900 ,
900 , 901 , 901 , 902 , 902 , 902 , 903 , 903 , 904 , 904 ,
904 , 905 , 905 , 905 , 906 , 906 , 907 , 907 , 907 , 908 ,
908 , 909 , 909 , 909 , 910 , 910 , 911 , 911 , 911 , 912 ,
912 , 912 , 913 , 913 , 914 , 914 , 914 , 915 , 915 , 916 ,
916 , 916 , 917 , 917 , 918 , 918 , 918 , 919 , 919 , 920 ,
920 , 920 , 921 , 921 , 921 , 922 , 922 , 923 , 923 , 923 ,
924 , 924 , 925 , 925 , 925 , 926 , 926 , 927 , 927 , 927 ,
928 , 928 , 928 , 929 , 929 , 930 , 930 , 930 , 931 , 931 ,
932 , 932 , 932 , 933 , 933 , 934 , 934 , 934 , 935 , 935 ,
936 , 936 , 936 , 937 , 937 , 937 , 938 , 938 , 939 , 939 ,
939 , 940 , 940 , 941 , 941 , 941 , 942 , 942 , 943 , 943 ,
943 , 944 , 944 , 944 , 945 , 945 , 946 , 946 , 946 , 947 ,
947 , 948 , 948 , 948 , 949 , 949 , 950 , 950 , 950 , 951 ,
951 , 951 , 952 , 952 , 953 , 953 , 953 , 954 , 954 , 955 ,
955 , 955 , 956 , 956 , 957 , 957 , 957 , 958 , 958 , 959 ,
959 , 959 , 960 , 960 , 960 , 961 , 961 , 962 , 962 , 962 ,
963 , 963 , 964 , 964 , 964 , 965 , 965 , 966 , 966 , 966 ,
967 , 967 , 967 , 968 , 968 , 969 , 969 , 969 , 970 , 970 ,
971 , 971 , 971 , 972 , 972 , 973 , 973 , 973 , 974 , 974 ,
975 , 975 , 975 , 976 , 976 , 976 , 977 , 977 , 978 , 978 ,
978 , 979 , 979 , 980 , 980 , 980 , 981 , 981 , 982 , 982 ,
982 , 983 , 983 , 983 , 984 , 984 , 985 , 985 , 985 , 986 ,
986 , 987 , 987 , 987 , 988 , 988 , 989 , 989 , 989 , 990 ,
990 , 990 , 991 , 991 , 992 , 992 , 992 , 993 , 993 , 994 ,
994 , 994 , 995 , 995 , 996 , 996 , 996 , 997 , 997 , 998 ,
998 , 998 , 999 , 999 , 999 , 1000 , 1000 , 1001 , 1001 , 1001 ,
1002 , 1002 , 1003 , 1003 , 1003 , 1004 , 1004 , 1005 , 1005 , 1005 ,
1006 , 1006 , 1006 , 1007 , 1007 , 1008 , 1008 , 1008 , 1009 , 1009 ,
1010 , 1010 , 1010 , 1011 , 1011 , 1012 , 1012 , 1012 , 1013 , 1013 ,
1014 , 1014 , 1014 , 1015 , 1015 , 1015 , 1016 , 1016 , 1017 , 1017 ,
1017 , 1018 , 1018 , 1019 , 1019 , 1019 , 1020 , 1020 , 1021 , 1021 ,
1021 , 1022 , 1022 , 1022 , 1023 , 1023 , 1024 , 1024 , 1024 , 1025 ,
1025 , 1026 , 1026 , 1026 , 1027 , 1027 , 1028 , 1028 , 1028 , 1029 ,
1029 , 1029 , 1030 , 1030 , 1031 , 1031 , 1031 , 1032 , 1032 , 1033 ,
1033 , 1033 , 1034 , 1034 , 1035 , 1035 , 1035 , 1036 , 1036 , 1037 ,
1037 , 1037 , 1038 , 1038 , 1038 , 1039 , 1039 , 1040 , 1040 , 1040 ,
1041 , 1041 , 1042 , 1042 , 1042 , 1043 , 1043 , 1044 , 1044 , 1044 ,
1045 , 1045 , 1045 , 1046 , 1046 , 1047 , 1047 , 1047 , 1048 , 1048 ,
1049 , 1049 , 1049 , 1050 , 1050 , 1051 , 1051 , 1051 , 1052 , 1052 ,
1053 , 1053 , 1053 , 1054 , 1054 , 1054 , 1055 , 1055 , 1056 , 1056 ,
1056 , 1057 , 1057 , 1058 , 1058 , 1058 , 1059 , 1059 , 1060 , 1060 ,
1060 , 1061 , 1061 , 1061 , 1062 , 1062 , 1063 , 1063 , 1063 , 1064 ,
1064 , 1065 , 1065 , 1065 , 1066 , 1066 , 1067 , 1067 , 1067 , 1068 ,
1068 , 1068 , 1069 , 1069 , 1070 , 1070 , 1070 , 1071 , 1071 , 1072 ,
1072 , 1072 , 1073 , 1073 , 1074 , 1074 , 1074 , 1075 , 1075 , 1076 ,
1076 , 1076 , 1077 , 1077 , 1077 , 1078 , 1078 , 1079 , 1079 , 1079 ,
1080 , 1080 , 1081 , 1081 , 1081 , 1082 , 1082 , 1083 , 1083 , 1083 ,
1084 , 1084 , 1084 , 1085 , 1085 , 1086 , 1086 , 1086 , 1087 , 1087 ,
1088 , 1088 , 1088 , 1089 , 1089 , 1090 , 1090 , 1090 , 1091 , 1091 ,
1092 , 1092 , 1092 , 1093 , 1093 , 1093 , 1094 , 1094 , 1095 , 1095 ,
1095 , 1096 , 1096 , 1097 , 1097 , 1097 , 1098 , 1098 , 1099 , 1099 ,
1099 , 1100 , 1100 , 1100 , 1101 , 1101 , 1102 , 1102 , 1102 , 1103 ,
1103 , 1104 , 1104 , 1104 , 1105 , 1105 , 1106 , 1106 , 1106 , 1107 ,
1107 , 1107 , 1108 , 1108 , 1109 , 1109 , 1109 , 1110 , 1110 , 1111 ,
1111 , 1111 , 1112 , 1112 , 1113 , 1113 , 1113 , 1114 , 1114 , 1115 ,
1115 , 1115 , 1116 , 1116 , 1116 , 1117 , 1117 , 1118 , 1118 , 1118 ,
1119 , 1119 , 1120 , 1120 , 1120 , 1121 , 1121 , 1122 , 1122 , 1122 ,
1123 , 1123 , 1123 , 1124 , 1124 , 1125 , 1125 , 1125 , 1126 , 1126 ,
1127 , 1127 , 1127 , 1128 , 1128 , 1129 , 1129 , 1129 , 1130 , 1130 ,
1131 , 1131 , 1131 , 1132 , 1132 , 1132 , 1133 , 1133 , 1134 , 1134 ,
1134 , 1135 , 1135 , 1136 , 1136 , 1136 , 1137 , 1137 , 1138 , 1138 ,
1138 , 1139 , 1139 , 1139 , 1140 , 1140 , 1141 , 1141 , 1141 , 1142 ,
1142 , 1143 , 1143 , 1143 , 1144 , 1144 , 1145 , 1145 , 1145 , 1146 ,
1146 , 1146 , 1147 , 1147 , 1148 , 1148 , 1148 , 1149 , 1149 , 1150 ,
1150 , 1150 , 1151 , 1151 , 1152 , 1152 , 1152 , 1153 , 1153 , 1154 ,
1154 , 1154 , 1155 , 1155 , 1155 , 1156 , 1156 , 1157 , 1157 , 1157 ,
1158 , 1158 , 1159 , 1159 , 1159 , 1160 , 1160 , 1161 , 1161 , 1161 ,
1162 , 1162 , 1162 , 1163 , 1163 , 1164 , 1164 , 1164 , 1165 , 1165 ,
1166 , 1166 , 1166 , 1167 , 1167 , 1168 , 1168 , 1168 , 1169 , 1169 ,
1170 , 1170 , 1170 , 1171 , 1171 , 1171 , 1172 , 1172 , 1173 , 1173 ,
1173 , 1174 , 1174 , 1174 , 1175 , 1175 , 1176 , 1176 , 1176 , 1177 ,
1177 , 1177 , 1178 , 1178 , 1179 , 1179 , 1179 , 1180 , 1180 , 1180 ,
1181 , 1181 , 1182 , 1182 , 1182 , 1183 , 1183 , 1183 , 1184 , 1184 ,
1185 , 1185 , 1185 , 1186 , 1186 , 1186 , 1187 , 1187 , 1188 , 1188 ,
1188 , 1189 , 1189 , 1189 , 1190 , 1190 , 1191 , 1191 , 1191 , 1192 ,
1192 , 1192 , 1193 , 1193 , 1194 , 1194 , 1194 , 1195 , 1195 , 1195 ,
1196 , 1196 , 1197 , 1197 , 1197 , 1198 , 1198 , 1198 , 1199 , 1199 ,
1200 , 1200 , 1200 , 1201 , 1201 , 1201 , 1202 , 1202 , 1203 , 1203 ,
1203 , 1204 , 1204 , 1204 , 1205 , 1205 , 1206 , 1206 , 1206 , 1207 ,
1207 , 1207 , 1208 , 1208 , 1209 , 1209 , 1209 , 1210 , 1210 , 1210 ,
1211 , 1211 , 1212 , 1212 , 1212 , 1213 , 1213 , 1213 , 1214 , 1214 ,
1215 , 1215 , 1215 , 1216 , 1216 , 1216 , 1217 , 1217 , 1218 , 1218 ,
1218 , 1219 , 1219 , 1219 , 1220 , 1220 , 1221 , 1221 , 1221 , 1222 ,
1222 , 1222 , 1223 , 1223 , 1224 , 1224 , 1224 , 1225 , 1225 , 1225 ,
1226 , 1226 , 1227 , 1227 , 1227 , 1228 , 1228 , 1228 , 1229 , 1229 ,
1230 , 1230 , 1230 , 1231 , 1231 , 1231 , 1232 , 1232 , 1233 , 1233 ,
1233 , 1234 , 1234 , 1234 , 1235 , 1235 , 1236 , 1236 , 1236 , 1237 ,
1237 , 1237 , 1238 , 1238 , 1239 , 1239 , 1239 , 1240 , 1240 , 1240 ,
1241 , 1241 , 1242 , 1242 , 1242 , 1243 , 1243 , 1243 , 1244 , 1244 ,
1245 , 1245 , 1245 , 1246 , 1246 , 1246 , 1247 , 1247 , 1248 , 1248 ,
1248 , 1249 , 1249 , 1249 , 1250 , 1250 , 1251 , 1251 , 1251 , 1252 ,
1252 , 1252 , 1253 , 1253 , 1254 , 1254 , 1254 , 1255 , 1255 , 1255 ,
1256 , 1256 , 1257 , 1257 , 1257 , 1258 , 1258 , 1258 , 1259 , 1259 ,
1260 , 1260 , 1260 , 1261 , 1261 , 1261 , 1262 , 1262 , 1263 , 1263 ,
1263 , 1264 , 1264 , 1264 , 1265 , 1265 , 1266 , 1266 , 1266 , 1267 ,
1267 , 1267 , 1268 , 1268 , 1269 , 1269 , 1269 , 1270 , 1270 , 1270 ,
1271 , 1271 , 1272 , 1272 , 1272 , 1273 , 1273 , 1273 , 1274 , 1274 ,
1275 , 1275 , 1275 , 1276 , 1276 , 1276 , 1277 , 1277 , 1278 , 1278 ,
1278 , 1279 , 1279 , 1279 , 1280 , 1280 , 1281 , 1281 , 1281 , 1282 ,
1282 , 1282 , 1283 , 1283 , 1284 , 1284 , 1284 , 1285 , 1285 , 1285 ,
1286 , 1286 , 1287 , 1287 , 1287 , 1288 , 1288 , 1288 , 1289 , 1289 ,
1290 , 1290 , 1290 , 1291 , 1291 , 1291 , 1292 , 1292 , 1293 , 1293 ,
1293 , 1294 , 1294 , 1294 , 1295 , 1295 , 1296 , 1296 , 1296 , 1297 ,
1297 , 1297 , 1298 , 1298 , 1299 , 1299 , 1299 , 1300 , 1300 , 1300 ,
1301 , 1301 , 1302 , 1302 , 1302 , 1303 , 1303 , 1303 , 1304 , 1304 ,
1305 , 1305 , 1305 , 1306 , 1306 , 1306 , 1307 , 1307 , 1308 , 1308 ,
1308 , 1309 , 1309 , 1309 , 1310 , 1310 , 1311 , 1311 , 1311 , 1312 ,
1312 , 1312 , 1313 , 1313 , 1314 , 1314 , 1314 , 1315 , 1315 , 1315 ,
1316 , 1316 , 1317 , 1317 , 1317 , 1318 , 1318 , 1318 , 1319 , 1319 ,
1320 , 1320 , 1320 , 1321 , 1321 , 1321 , 1322 , 1322 , 1323 , 1323 ,
1323 , 1324 , 1324 , 1324 , 1325 , 1325 , 1326 , 1326 , 1326 , 1327 ,
1327 , 1327 , 1328 , 1328 , 1329 , 1329 , 1329 , 1330 , 1330 , 1330 ,
1331 , 1331 , 1332 , 1332 , 1332 , 1333 , 1333 , 1333 , 1334 , 1334 ,
1335 , 1335 , 1335 , 1336 , 1336 , 1336 , 1337 , 1337 , 1338 , 1338 ,
1338 , 1339 , 1339 , 1339 , 1340 , 1340 , 1341 , 1341 , 1341 , 1342 ,
1342 , 1342 , 1343 , 1343 , 1344 , 1344 , 1344 , 1345 , 1345 , 1345 ,
1346 , 1346 , 1347 , 1347 , 1347 , 1348 , 1348 , 1348 , 1349 , 1349 ,
1350 , 1350 , 1350 , 1351 , 1351 , 1351 , 1352 , 1352 , 1353 , 1353 ,
1353 , 1354 , 1354 , 1354 , 1355 , 1355 , 1356 , 1356 , 1356 , 1357 ,
1357 , 1357 , 1358 , 1358 , 1359 , 1359 , 1359 , 1360 , 1360 , 1360 ,
1361 , 1361 , 1362 , 1362 , 1362 , 1363 , 1363 , 1363 , 1364 , 1364 ,
1365 , 1365 , 1365 , 1366 , 1366 , 1366 , 1367 , 1367 , 1368 , 1368 ,
1368 , 1369 , 1369 , 1369 , 1370 , 1370 , 1371 , 1371 , 1371 , 1372 ,
1372 , 1372 , 1373 , 1373 , 1374 , 1374 , 1374 , 1375 , 1375 , 1375 ,
1376 , 1376 , 1377 , 1377 , 1377 , 1378 , 1378 , 1378 , 1379 , 1379 ,
1380 , 1380 , 1380 , 1381 , 1381 , 1381 , 1382 , 1382 , 1383 , 1383 ,
1383 , 1384 , 1384 , 1384 , 1385 , 1385 , 1386 , 1386 , 1386 , 1387 ,
1387 , 1387 , 1388 , 1388 , 1389 , 1389 , 1389 , 1390 , 1390 , 1390 ,
1391 , 1391 , 1392 , 1392 , 1392 , 1393 , 1393 , 1393 , 1394 , 1394 ,
1395 , 1395 , 1395 , 1396 , 1396 , 1396 , 1397 , 1397 , 1398 , 1398 ,
1398 , 1399 , 1399 , 1399 , 1400 , 1400 , 1401 , 1401 , 1401 , 1402 ,
1402 , 1402 , 1403 , 1403 , 1404 , 1404 , 1404 , 1405 , 1405 , 1405 ,
1406 , 1406 , 1407 , 1407 , 1407 , 1408 , 1408 , 1408 , 1409 , 1409 ,
1410 , 1410 , 1410 , 1411 , 1411 , 1411 , 1412 , 1412 , 1413 , 1413 ,
1413 , 1414 , 1414 , 1414 , 1415 , 1415 , 1416 , 1416 , 1416 , 1417 ,
1417 , 1417 , 1418 , 1418 , 1419 , 1419 , 1419 , 1420 , 1420 , 1420 ,
1421 , 1421 , 1422 , 1422 , 1422 , 1423 , 1423 , 1423 , 1424 , 1424 ,
1425 , 1425 , 1425 , 1426 , 1426 , 1426 , 1427 , 1427 , 1428 , 1428 ,
1428 , 1429 , 1429 , 1429 , 1430 , 1430 , 1431 , 1431 , 1431 , 1432 ,
1432 , 1432 , 1433 , 1433 , 1434 , 1434 , 1434 , 1435 , 1435 , 1435 ,
1436 , 1436 , 1437 , 1437 , 1437 , 1438 , 1438 , 1438 , 1439 , 1439 ,
1440 , 1440 , 1440 , 1441 , 1441 , 1441 , 1442 , 1442 , 1443 , 1443 ,
1443 , 1444 , 1444 , 1444 , 1445 , 1445 , 1446 , 1446 , 1446 , 1447 ,
1447 , 1447 , 1448 , 1448 , 1449 , 1449 , 1449 , 1450 , 1450 , 1450 ,
1451 , 1451 , 1452 , 1452 , 1452 , 1453 , 1453 , 1453 , 1454 , 1454 ,
1455 , 1455 , 1455 , 1456 , 1456 , 1456 , 1457 , 1457 , 1458 , 1458 ,
1458 , 1459 , 1459 , 1459 , 1460 , 1460 , 1461 , 1461 , 1461 , 1462 ,
1462 , 1462 , 1463 , 1463 , 1464 , 1464 , 1464 , 1465 , 1465 , 1465 ,
1466 , 1466 , 1467 , 1467 , 1467 , 1468 , 1468 , 1468 , 1469 , 1469 ,
1470 , 1470 , 1470 , 1471 , 1471 , 1471 , 1472 , 1472 , 1473 , 1473 ,
1473 , 1474 , 1474 , 1474 , 1475 , 1475 , 1476 , 1476 , 1476 , 1477 ,
1477 , 1477 , 1478 , 1478 , 1479 , 1479 , 1479 , 1480 , 1480 , 1480 ,
1481 , 1481 , 1482 , 1482 , 1482 , 1483 , 1483 , 1483 , 1484 , 1484 ,
1485 , 1485 , 1485 , 1486 , 1486 , 1486 , 1487 , 1487 , 1488 , 1488 ,
1488 , 1489 , 1489 , 1489 , 1490 , 1490 , 1491 , 1491 , 1491 , 1492 ,
1492 , 1492 , 1493 , 1493 , 1494 , 1494 , 1494 , 1495 , 1495 , 1495 ,
1496 , 1496 , 1497 , 1497 , 1497 , 1498 , 1498 , 1498 , 1499 , 1499 ,
1500 , 1500 , 1500 , 1501 , 1501 , 1501 , 1502 , 1502 , 1503 , 1503 ,
1503 , 1504 , 1504 , 1504 , 1505 , 1505 , 1506 , 1506 , 1506 , 1507 ,
1507 , 1507 , 1508 , 1508 , 1509 , 1509 , 1509 , 1510 , 1510 , 1510 ,
1511 , 1511 , 1512 , 1512 , 1512 , 1513 , 1513 , 1513 , 1514 , 1514 ,
1515 , 1515 , 1515 , 1516 , 1516 , 1516 , 1517 , 1517 , 1518 , 1518 ,
1518 , 1519 , 1519 , 1519 , 1520 , 1520 , 1521 , 1521 , 1521 , 1522 ,
1522 , 1522 , 1523 , 1523 , 1524 , 1524 , 1524 , 1525 , 1525 , 1525 ,
1526 , 1526 , 1527 , 1527 , 1527 , 1528 , 1528 , 1528 , 1529 , 1529 ,
1530 , 1530 , 1530 , 1531 , 1531 , 1531 , 1532 , 1532 , 1533 , 1533 ,
1533 , 1534 , 1534 , 1534 , 1535 , 1535 , 1536 , 1536 , 1536 , 1537 ,
1537 , 1537 , 1538 , 1538 , 1539 , 1539 , 1539 , 1540 , 1540 , 1540 ,
1541 , 1541 , 1542 , 1542 , 1542 , 1543 , 1543 , 1543 , 1544 , 1544 ,
1545 , 1545 , 1545 , 1546 , 1546 , 1546 , 1547 , 1547 , 1547 , 1548 ,
1548 , 1548 , 1549 , 1549 , 1549 , 1550 , 1550 , 1551 , 1551 , 1551 ,
1552 , 1552 , 1552 , 1553 , 1553 , 1553 , 1554 , 1554 , 1554 , 1555 ,
1555 , 1556 , 1556 , 1556 , 1557 , 1557 , 1557 , 1558 , 1558 , 1558 ,
1559 , 1559 , 1559 , 1560 , 1560 , 1560 , 1561 , 1561 , 1562 , 1562 ,
1562 , 1563 , 1563 , 1563 , 1564 , 1564 , 1564 , 1565 , 1565 , 1565 ,
1566 , 1566 , 1567 , 1567 , 1567 , 1568 , 1568 , 1568 , 1569 , 1569 ,
1569 , 1570 , 1570 , 1570 , 1571 , 1571 , 1571 , 1572 , 1572 , 1573 ,
1573 , 1573 , 1574 , 1574 , 1574 , 1575 , 1575 , 1575 , 1576 , 1576 ,
1576 , 1577 , 1577 , 1578 , 1578 , 1578 , 1579 , 1579 , 1579 , 1580 ,
1580 , 1580 , 1581 , 1581 , 1581 , 1582 , 1582 , 1582 , 1583 , 1583 ,
1584 , 1584 , 1584 , 1585 , 1585 , 1585 , 1586 , 1586 , 1586 , 1587 ,
1587 , 1587 , 1588 , 1588 , 1589 , 1589 , 1589 , 1590 , 1590 , 1590 ,
1591 , 1591 , 1591 , 1592 , 1592 , 1592 , 1593 , 1593 , 1593 , 1594 ,
1594 , 1595 , 1595 , 1595 , 1596 , 1596 , 1596 , 1597 , 1597 , 1597 ,
1598 , 1598 , 1598 , 1599 , 1599 , 1600 , 1600 , 1600 , 1601 , 1601 ,
1601 , 1602 , 1602 , 1602 , 1603 , 1603 , 1603 , 1604 , 1604 , 1604 ,
1605 , 1605 , 1606 , 1606 , 1606 , 1607 , 1607 , 1607 , 1608 , 1608 ,
1608 , 1609 , 1609 , 1609 , 1610 , 1610 , 1611 , 1611 , 1611 , 1612 ,
1612 , 1612 , 1613 , 1613 , 1613 , 1614 , 1614 , 1614 , 1615 , 1615 ,
1616 , 1616 , 1616 , 1617 , 1617 , 1617 , 1618 , 1618 , 1618 , 1619 ,
1619 , 1619 , 1620 , 1620 , 1620 , 1621 , 1621 , 1622 , 1622 , 1622 ,
1623 , 1623 , 1623 , 1624 , 1624 , 1624 , 1625 , 1625 , 1625 , 1626 ,
1626 , 1627 , 1627 , 1627 , 1628 , 1628 , 1628 , 1629 , 1629 , 1629 ,
1630 , 1630 , 1630 , 1631 , 1631 , 1631 , 1632 , 1632 , 1633 , 1633 ,
1633 , 1634 , 1634 , 1634 , 1635 , 1635 , 1635 , 1636 , 1636 , 1636 ,
1637 , 1637 , 1638 , 1638 , 1638 , 1639 , 1639 , 1639 , 1640 , 1640 ,
1640 , 1641 , 1641 , 1641 , 1642 , 1642 , 1642 , 1643 , 1643 , 1644 ,
1644 , 1644 , 1645 , 1645 , 1645 , 1646 , 1646 , 1646 , 1647 , 1647 ,
1647 , 1648 , 1648 , 1649 , 1649 , 1649 , 1650 , 1650 , 1650 , 1651 ,
1651 , 1651 , 1652 , 1652 , 1652 , 1653 , 1653 , 1653 , 1654 , 1654 ,
1655 , 1655 , 1655 , 1656 , 1656 , 1656 , 1657 , 1657 , 1657 , 1658 ,
1658 , 1658 , 1659 , 1659 , 1660 , 1660 , 1660 , 1661 , 1661 , 1661 ,
1662 , 1662 , 1662 , 1663 , 1663 , 1663 , 1664 , 1664 , 1664 , 1665 ,
1665 , 1666 , 1666 , 1666 , 1667 , 1667 , 1667 , 1668 , 1668 , 1668 ,
1669 , 1669 , 1669 , 1670 , 1670 , 1671 , 1671 , 1671 , 1672 , 1672 ,
1672 , 1673 , 1673 , 1673 , 1674 , 1674 , 1674 , 1675 , 1675 , 1675 ,
1676 , 1676 , 1677 , 1677 , 1677 , 1678 , 1678 , 1678 , 1679 , 1679 ,
1679 , 1680 , 1680 , 1680 , 1681 , 1681 , 1682 , 1682 , 1682 , 1683 ,
1683 , 1683 , 1684 , 1684 , 1684 , 1685 , 1685 , 1685 , 1686 , 1686 ,
1687 , 1687 , 1687 , 1688 , 1688 , 1688 , 1689 , 1689 , 1689 , 1690 ,
1690 , 1690 , 1691 , 1691 , 1691 , 1692 , 1692 , 1693 , 1693 , 1693 ,
1694 , 1694 , 1694 , 1695 , 1695 , 1695 , 1696 , 1696 , 1696 , 1697 ,
1697 , 1698 , 1698 , 1698 , 1699 , 1699 , 1699 , 1700 , 1700 , 1700 ,
1701 , 1701 , 1701 , 1702 , 1702 , 1702 , 1703 , 1703 , 1704 , 1704 ,
1704 , 1705 , 1705 , 1705 , 1706 , 1706 , 1706 , 1707 , 1707 , 1707 ,
1708 , 1708 , 1709 , 1709 , 1709 , 1710 , 1710 , 1710 , 1711 , 1711 ,
1711 , 1712 , 1712 , 1712 , 1713 , 1713 , 1713 , 1714 , 1714 , 1715 ,
1715 , 1715 , 1716 , 1716 , 1716 , 1717 , 1717 , 1717 , 1718 , 1718 ,
1718 , 1719 , 1719 , 1720 , 1720 , 1720 , 1721 , 1721 , 1721 , 1722 ,
1722 , 1722 , 1723 , 1723 , 1723 , 1724 , 1724 , 1724 , 1725 , 1725 ,
1726 , 1726 , 1726 , 1727 , 1727 , 1727 , 1728 , 1728 , 1728 , 1729 ,
1729 , 1729 , 1730 , 1730 , 1731 , 1731 , 1731 , 1732 , 1732 , 1732 ,
1733 , 1733 , 1733 , 1734 , 1734 , 1734 , 1735 , 1735 , 1735 , 1736 ,
1736 , 1737 , 1737 , 1737 , 1738 , 1738 , 1738 , 1739 , 1739 , 1739 ,
1740 , 1740 , 1740 , 1741 , 1741 , 1742 , 1742 , 1742 , 1743 , 1743 ,
1743 , 1744 , 1744 , 1744 , 1745 , 1745 , 1745 , 1746 , 1746 , 1746 ,
1747 , 1747 , 1748 , 1748 , 1748 , 1749 , 1749 , 1749 , 1750 , 1750 ,
1750 , 1751 , 1751 , 1751 , 1752 , 1752 , 1753 , 1753 , 1753 , 1754 ,
1754 , 1754 , 1755 , 1755 , 1755 , 1756 , 1756 , 1756 , 1757 , 1757 ,
1758 , 1758 , 1758 , 1759 , 1759 , 1759 , 1760 , 1760 , 1760 , 1761 ,
1761 , 1761 , 1762 , 1762 , 1762 , 1763 , 1763 , 1764 , 1764 , 1764 ,
1765 , 1765 , 1765 , 1766 , 1766 , 1766 , 1767 , 1767 , 1767 , 1768 ,
1768 , 1769 , 1769 , 1769 , 1770 , 1770 , 1770 , 1771 , 1771 , 1771 ,
1772 , 1772 , 1772 , 1773 , 1773 , 1773 , 1774 , 1774 , 1775 , 1775 ,
1775 , 1776 , 1776 , 1776 , 1777 , 1777 , 1777 , 1778 , 1778 , 1778 ,
1779 , 1779 , 1780 , 1780 , 1780 , 1781 , 1781 , 1781 , 1782 , 1782 ,
1782 , 1783 , 1783 , 1783 , 1784 , 1784 , 1784 , 1785 , 1785 , 1786 ,
1786 , 1786 , 1787 , 1787 , 1787 , 1788 , 1788 , 1788 , 1789 , 1789 ,
1789 , 1790 , 1790 , 1791 , 1791 , 1791 , 1792 , 1792 , 1792 , 1793 ,
1793 , 1793 , 1794 , 1794 , 1794 , 1795 , 1795 , 1795 , 1796 , 1796 ,
1797 , 1797 , 1797 , 1798 , 1798 , 1798 , 1799 , 1799 , 1799 , 1800 ,
1800 , 1800 , 1801 , 1801 , 1802 , 1802 , 1802 , 1803 , 1803 , 1803 ,
1804 , 1804 , 1804 , 1805 , 1805 , 1805 , 1806 , 1806 , 1806 , 1807 ,
1807 , 1808 , 1808 , 1808 , 1809 , 1809 , 1809 , 1810 , 1810 , 1810 ,
1811 , 1811 , 1811 , 1812 , 1812 , 1813 , 1813 , 1813 , 1814 , 1814 ,
1814 , 1815 , 1815 , 1815 , 1816 , 1816 , 1816 , 1817 , 1817 , 1817 ,
1818 , 1818 , 1819 , 1819 , 1819 , 1820 , 1820 , 1820 , 1821 , 1821 ,
1821 , 1822 , 1822 , 1822 , 1823 , 1823 , 1824 , 1824 , 1824 , 1825 ,
1825 , 1825 , 1826 , 1826 , 1826 , 1827 , 1827 , 1827 , 1828 , 1828 ,
1829 , 1829 , 1829 , 1830 , 1830 , 1830 , 1831 , 1831 , 1831 , 1832 ,
1832 , 1832 , 1833 , 1833 , 1833 , 1834 , 1834 , 1835 , 1835 , 1835 ,
1836 , 1836 , 1836 , 1837 , 1837 , 1837 , 1838 , 1838 , 1838 , 1839 ,
1839 , 1840 , 1840 , 1840 , 1841 , 1841 , 1841 , 1842 , 1842 , 1842 ,
1843 , 1843 , 1843 , 1844 , 1844 , 1844 , 1845 , 1845 , 1846 , 1846 ,
1846 , 1847 , 1847 , 1847 , 1848 , 1848 , 1848 , 1849 , 1849 , 1849 ,
1850 , 1850 , 1851 , 1851 , 1851 , 1852 , 1852 , 1852 , 1853 , 1853 ,
1853 , 1854 , 1854 , 1854 , 1855 , 1855 , 1855 , 1856 , 1856 , 1857 ,
1857 , 1857 , 1858 , 1858 , 1858 , 1859 , 1859 , 1859 , 1860 , 1860 ,
1860 , 1861 , 1861 , 1862 , 1862 , 1862 , 1863 , 1863 , 1863 , 1864 ,
1864 , 1864 , 1865 , 1865 , 1865 , 1866 , 1866 , 1866 , 1867 , 1867 ,
1868 , 1868 , 1868 , 1869 , 1869 , 1869 , 1870 , 1870 , 1870 , 1871 ,
1871 , 1871 , 1872 , 1872 , 1873 , 1873 , 1873 , 1874 , 1874 , 1874 ,
1875 , 1875 , 1875 , 1876 , 1876 , 1876 , 1877 , 1877 , 1877 , 1878 ,
1878 , 1879 , 1879 , 1879 , 1880 , 1880 , 1880 , 1881 , 1881 , 1881 ,
1882 , 1882 , 1882 , 1883 , 1883 , 1884 , 1884 , 1884 , 1885 , 1885 ,
1885 , 1886 , 1886 , 1886 , 1887 , 1887 , 1887 , 1888 , 1888 , 1888 ,
1889 , 1889 , 1890 , 1890 , 1890 , 1891 , 1891 , 1891 , 1892 , 1892 ,
1892 , 1893 , 1893 , 1893 , 1894 , 1894 , 1895 , 1895 , 1895 , 1896 ,
1896 , 1896 , 1897 , 1897 , 1897 , 1898 , 1898 , 1898 , 1899 , 1899 ,
1900 , 1900 , 1900 , 1901 , 1901 , 1902 , 1902 , 1902 , 1903 , 1903 ,
1904 , 1904 , 1905 , 1905 , 1905 , 1906 , 1906 , 1907 , 1907 , 1907 ,
1908 , 1908 , 1909 , 1909 , 1910 , 1910 , 1910 , 1911 , 1911 , 1912 ,
1912 , 1913 , 1913 , 1913 , 1914 , 1914 , 1915 , 1915 , 1915 , 1916 ,
1916 , 1917 , 1917 , 1918 , 1918 , 1918 , 1919 , 1919 , 1920 , 1920 ,
1921 , 1921 , 1921 , 1922 , 1922 , 1923 , 1923 , 1923 , 1924 , 1924 ,
1925 , 1925 , 1926 , 1926 , 1926 , 1927 , 1927 , 1928 , 1928 , 1928 ,
1929 , 1929 , 1930 , 1930 , 1931 , 1931 , 1931 , 1932 , 1932 , 1933 ,
1933 , 1934 , 1934 , 1934 , 1935 , 1935 , 1936 , 1936 , 1936 , 1937 ,
1937 , 1938 , 1938 , 1939 , 1939 , 1939 , 1940 , 1940 , 1941 , 1941 ,
1942 , 1942 , 1942 , 1943 , 1943 , 1944 , 1944 , 1944 , 1945 , 1945 ,
1946 , 1946 , 1947 , 1947 , 1947 , 1948 , 1948 , 1949 , 1949 , 1949 ,
1950 , 1950 , 1951 , 1951 , 1952 , 1952 , 1952 , 1953 , 1953 , 1954 ,
1954 , 1955 , 1955 , 1955 , 1956 , 1956 , 1957 , 1957 , 1957 , 1958 ,
1958 , 1959 , 1959 , 1960 , 1960 , 1960 , 1961 , 1961 , 1962 , 1962 ,
1963 , 1963 , 1963 , 1964 , 1964 , 1965 , 1965 , 1965 , 1966 , 1966 ,
1967 , 1967 , 1968 , 1968 , 1968 , 1969 , 1969 , 1970 , 1970 , 1970 ,
1971 , 1971 , 1972 , 1972 , 1973 , 1973 , 1973 , 1974 , 1974 , 1975 ,
1975 , 1976 , 1976 , 1976 , 1977 , 1977 , 1978 , 1978 , 1978 , 1979 ,
1979 , 1980 , 1980 , 1981 , 1981 , 1981 , 1982 , 1982 , 1983 , 1983 ,
1984 , 1984 , 1984 , 1985 , 1985 , 1986 , 1986 , 1986 , 1987 , 1987 ,
1988 , 1988 , 1989 , 1989 , 1989 , 1990 , 1990 , 1991 , 1991 , 1991 ,
1992 , 1992 , 1993 , 1993 , 1994 , 1994 , 1994 , 1995 , 1995 , 1996 ,
1996 , 1997 , 1997 , 1997 , 1998 , 1998 , 1999 , 1999 , 1999 , 2000 ,
2000 , 2001 , 2001 , 2002 , 2002 , 2002 , 2003 , 2003 , 2004 , 2004 ,
2005 , 2005 , 2005 , 2006 , 2006 , 2007 , 2007 , 2007 , 2008 , 2008 ,
2009 , 2009 , 2010 , 2010 , 2010 , 2011 , 2011 , 2012 , 2012 , 2012 ,
2013 , 2013 , 2014 , 2014 , 2015 , 2015 , 2015 , 2016 , 2016 , 2017 ,
2017 , 2018 , 2018 , 2018 , 2019 , 2019 , 2020 , 2020 , 2020 , 2021 ,
2021 , 2022 , 2022 , 2023 , 2023 , 2023 , 2024 , 2024 , 2025 , 2025 ,
2026 , 2026 , 2026 , 2027 , 2027 , 2028 , 2028 , 2028 , 2029 , 2029 ,
2030 , 2030 , 2031 , 2031 , 2031 , 2032 , 2032 , 2033 , 2033 , 2033 ,
2034 , 2034 , 2035 , 2035 , 2036 , 2036 , 2036 , 2037 , 2037 , 2038 ,
2038 , 2039 , 2039 , 2039 , 2040 , 2040 , 2041 , 2041 , 2041 , 2042 ,
2042 , 2043 , 2043 , 2044 , 2044 , 2044 , 2045 , 2045 , 2046 , 2046 ,
2047 , 2047 , 2047 , 2048 , 2048 , 2049 , 2049 , 2049 , 2050 , 2050 ,
2051 , 2051 , 2052 , 2052 , 2052 , 2053 , 2053 , 2054 , 2054 , 2054 ,
2055 , 2055 , 2056 , 2056 , 2057 , 2057 , 2057 , 2058 , 2058 , 2059 ,
2059 , 2060 , 2060 , 2060 , 2061 , 2061 , 2062 , 2062 , 2062 , 2063 ,
2063 , 2064 , 2064 , 2065 , 2065 , 2065 , 2066 , 2066 , 2067 , 2067 ,
2068 , 2068 , 2068 , 2069 , 2069 , 2070 , 2070 , 2070 , 2071 , 2071 ,
2072 , 2072 , 2073 , 2073 , 2073 , 2074 , 2074 , 2075 , 2075 , 2075 ,
2076 , 2076 , 2077 , 2077 , 2078 , 2078 , 2078 , 2079 , 2079 , 2080 ,
2080 , 2081 , 2081 , 2081 , 2082 , 2082 , 2083 , 2083 , 2083 , 2084 ,
2084 , 2085 , 2085 , 2086 , 2086 , 2086 , 2087 , 2087 , 2088 , 2088 ,
2089 , 2089 , 2089 , 2090 , 2090 , 2091 , 2091 , 2091 , 2092 , 2092 ,
2093 , 2093 , 2094 , 2094 , 2094 , 2095 , 2095 , 2096 , 2096 , 2096 ,
2097 , 2097 , 2098 , 2098 , 2099 , 2099 , 2099 , 2100 , 2100 , 2101 ,
2101 , 2102 , 2102 , 2102 , 2103 , 2103 , 2104 , 2104 , 2104 , 2105 ,
2105 , 2106 , 2106 , 2107 , 2107 , 2107 , 2108 , 2108 , 2109 , 2109 ,
2110 , 2110 , 2110 , 2111 , 2111 , 2112 , 2112 , 2112 , 2113 , 2113 ,
2114 , 2114 , 2115 , 2115 , 2115 , 2116 , 2116 , 2117 , 2117 , 2117 ,
2118 , 2118 , 2119 , 2119 , 2120 , 2120 , 2120 , 2121 , 2121 , 2122 ,
2122 , 2123 , 2123 , 2123 , 2124 , 2124 , 2125 , 2125 , 2125 , 2126 ,
2126 , 2127 , 2127 , 2128 , 2128 , 2128 , 2129 , 2129 , 2130 , 2130 ,
2131 , 2131 , 2131 , 2132 , 2132 , 2133 , 2133 , 2133 , 2134 , 2134 ,
2135 , 2135 , 2136 , 2136 , 2136 , 2137 , 2137 , 2138 , 2138 , 2138 ,
2139 , 2139 , 2140 , 2140 , 2141 , 2141 , 2141 , 2142 , 2142 , 2143 ,
2143 , 2144 , 2144 , 2144 , 2145 , 2145 , 2146 , 2146 , 2146 , 2147 ,
2147 , 2148 , 2148 , 2149 , 2149 , 2149 , 2150 , 2150 , 2151 , 2151 ,
2152 , 2152 , 2152 , 2153 , 2153 , 2154 , 2154 , 2154 , 2155 , 2155 ,
2156 , 2156 , 2157 , 2157 , 2157 , 2158 , 2158 , 2159 , 2159 , 2159 ,
2160 , 2160 , 2161 , 2161 , 2162 , 2162 , 2162 , 2163 , 2163 , 2164 ,
2164 , 2165 , 2165 , 2165 , 2166 , 2166 , 2167 , 2167 , 2167 , 2168 ,
2168 , 2169 , 2169 , 2170 , 2170 , 2170 , 2171 , 2171 , 2172 , 2172 ,
2173 , 2173 , 2173 , 2174 , 2174 , 2175 , 2175 , 2175 , 2176 , 2176 ,
2177 , 2177 , 2178 , 2178 , 2178 , 2179 , 2179 , 2180 , 2180 , 2180 ,
2181 , 2181 , 2182 , 2182 , 2183 , 2183 , 2183 , 2184 , 2184 , 2185 ,
2185 , 2186 , 2186 , 2186 , 2187 , 2187 , 2188 , 2188 , 2188 , 2189 ,
2189 , 2190 , 2190 , 2191 , 2191 , 2191 , 2192 , 2192 , 2193 , 2193 ,
2194 , 2194 , 2194 , 2195 , 2195 , 2196 , 2196 , 2196 , 2197 , 2197 ,
2198 , 2198 , 2199 , 2199 , 2199 , 2200 , 2200 , 2201 , 2201 , 2201 ,
2202 , 2202 , 2203 , 2203 , 2204 , 2204 , 2204 , 2205 , 2205 , 2206 ,
2206 , 2207 , 2207 , 2207 , 2208 , 2208 , 2209 , 2209 , 2209 , 2210 ,
2210 , 2211 , 2211 , 2212 , 2212 , 2212 , 2213 , 2213 , 2214 , 2214 ,
2215 , 2215 , 2215 , 2216 , 2216 , 2217 , 2217 , 2217 , 2218 , 2218 ,
2219 , 2219 , 2220 , 2220 , 2220 , 2221 , 2221 , 2222 , 2222 , 2222 ,
2223 , 2223 , 2224 , 2224 , 2225 , 2225 , 2225 , 2226 , 2226 , 2227 ,
2227 , 2228 , 2228 , 2228 , 2229 , 2229 , 2230 , 2230 , 2230 , 2231 ,
2231 , 2232 , 2232 , 2233 , 2233 , 2233 , 2234 , 2234 , 2235 , 2235 ,
2236 , 2236 , 2236 , 2237 , 2237 , 2238 , 2238 , 2238 , 2239 , 2239 ,
2240 , 2240 , 2241 , 2241 , 2241 , 2242 , 2242 , 2243 , 2243 , 2243 ,
2244 , 2244 , 2245 , 2245 , 2246 , 2246 , 2246 , 2247 , 2247 , 2248 ,
2248 , 2249 , 2249 , 2249 , 2250 , 2250 , 2251 , 2251 , 2251 , 2252 ,
2252 , 2253 , 2253 , 2254 , 2254 , 2254 , 2255 , 2255 , 2256 , 2256 ,
2257 , 2257 , 2257 , 2258 , 2258 , 2259 , 2259 , 2259 , 2260 , 2260 ,
2261 , 2261 , 2262 , 2262 , 2262 , 2263 , 2263 , 2264 , 2264 , 2264 ,
2265 , 2265 , 2266 , 2266 , 2267 , 2267 , 2267 , 2268 , 2268 , 2269 ,
2269 , 2270 , 2270 , 2270 , 2271 , 2271 , 2272 , 2272 , 2272 , 2273 ,
2273 , 2274 , 2274 , 2275 , 2275 , 2275 , 2276 , 2276 , 2277 , 2277 ,
2278 , 2278 , 2278 , 2279 , 2279 , 2280 , 2280 , 2280 , 2281 , 2281 ,
2282 , 2282 , 2283 , 2283 , 2283 , 2284 , 2284 , 2285 , 2285 , 2285 ,
2286 , 2286 , 2287 , 2287 , 2288 , 2288 , 2288 , 2289 , 2289 , 2290 ,
2290 , 2291 , 2291 , 2291 , 2292 , 2292 , 2293 , 2293 , 2293 , 2294 ,
2294 , 2295 , 2295 , 2296 , 2296 , 2296 , 2297 , 2297 , 2298 , 2298 ,
2299 , 2299 , 2299 , 2300 , 2300 , 2301 , 2301 , 2301 , 2302 , 2302 ,
2303 , 2303 , 2304 , 2304 , 2304 , 2305 , 2305 , 2306 , 2306 , 2306 ,
2307 , 2307 , 2308 , 2308 , 2309 , 2309 , 2309 , 2310 , 2310 , 2311 ,
2311 , 2312 , 2312 , 2312 , 2313 , 2313 , 2314 , 2314 , 2314 , 2315 ,
2315 , 2316 , 2316 , 2317 , 2317 , 2317 , 2318 , 2318 , 2319 , 2319 ,
2320
};
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.