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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
12c57202b5091ee496dfc614cae57af0fb374699 | 389c5a4865d2a13126db7eec15dde7cfc778c168 | /Labs/lab2/word.cc | 049d949befc17748f24be4153757934ef2f6bfd7 | [] | no_license | obakanue/cpp-edaf50 | 3e693497557bc170106d0e732ba956d641f46425 | 243e8da41dc2c721f7646b1518105151f09e8eba | refs/heads/master | 2021-01-06T18:21:17.254251 | 2020-03-09T21:31:57 | 2020-03-09T21:31:57 | 241,436,713 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 727 | cc | word.cc | #include <string>
#include <vector>
#include "word.h"
using namespace std;
Word::Word(const string& w, const vector<string>& t) {
this->word = w;
this->trigrams = t;
}
string Word::get_word() const {
return this->word;
}
unsigned int Word::get_matches(const vector<string>& t) const {
auto matches = 0;
auto trigramsSize = this->trigrams.size();
auto tSize = t.size();
unsigned int i = 0;
unsigned int j = 0;
while(i < trigramsSize && j < tSize){
if (this->trigrams.at(i) == t.at(j)){
++matches;
++i;
++j;
} else if (this->trigrams.at(i) > t.at(j)){
++j;
} else {
++i;
}
}
return matches;
}
|
95e874c7c86ecb5767b7a926f07d36a972c19d09 | 464d6cb42fb8981595cbf7260069cd1e6a67fe2f | /DP/Standard Seen Problems.cpp/Box Stacking.cpp | c60962a5cfb0c79af115fb53dea2d6091f0f540a | [] | no_license | rahul799/leetcode_problems | fd42276f85dc881b869072b74654f5811c6618ea | cc7f086eb9ac9bbd20ea004c46d89aa84df10d36 | refs/heads/main | 2023-04-14T05:09:31.016878 | 2021-04-20T19:46:52 | 2021-04-20T19:46:52 | 359,933,382 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,717 | cpp | Box Stacking.cpp |
You are given a set of N types of rectangular 3-D boxes, where the ith box has height h, width w and length l. You task is to create a stack of boxes which is as tall
as possible, but you can only stack a box on top of another box if the dimensions of the 2-D base of the lower box are each strictly larger than those of the 2-D base of the
higher box. Of course, you can rotate a box so that any side functions as its base.It is also allowable to use multiple
instances of the same type of box. You task is to complete the function maxHeight which returns the height of the highest possible stack so formed.
1) Generate all 3 rotations of all boxes. The size of rotation array becomes 3 times the size of the original array. For simplicity, we consider width as always smaller than or equal to depth.
2) Sort the above generated 3n boxes in decreasing order of base area.
3) After sorting the boxes, the problem is same as LIS with following optimal substructure property.
MSH(i) = Maximum possible Stack Height with box i at top of stack
MSH(i) = { Max ( MSH(j) ) + height(i) } where j < i and width(j) > width(i) and depth(j) > depth(i).
If there is no such j then MSH(i) = height(i)
4) To get overall maximum height, we return max(MSH(i)) where 0 < i < n
Following is the implementation of the above solution.
Input:
n = 4
height[] = {4,1,4,10}
width[] = {6,2,5,12}
length[] = {7,3,6,32}
Output: 60
Explanation: One way of placing the boxes is
as follows in the bottom to top manner:
(Denoting the boxes in (l, w, h) manner)
(12, 32, 10) (10, 12, 32) (6, 7, 4) (5, 6, 4)
(4, 5, 6) (2, 3, 1) (1, 2, 3)
Hence, the total height of this stack is
10 + 32 + 4 + 4 + 6 + 1 + 3 = 60.
No other combination of boxes produces a height
greater than this.
Input:
n = 3
height[] = {1,4,3}
width[] = {2,5,4}
length[] = {3,6,1}
Output: 15
#include<bits/stdc++.h>
using namespace std;
int maxHeight(int height[],int width[],int length[],int n);
int main()
{
int t;
cin>>t;
while(t--){
int n;
cin>>n;
int A[1000],B[1000],C[10001];
for(int i=0;i<n;i++)
{
int a,b,c;
cin>>a>>b>>c;
A[i]=a;
B[i]=b;
C[i]=c;
}
cout<<maxHeight(A,B,C,n)<<endl;
}
} // } Driver Code Ends
/*The function takes an array of heights, width and
length as its 3 arguments where each index i value
determines the height, width, length of the ith box.
Here n is the total no of boxes.*/
struct Cube
{
int l;
int b;
int h;
Cube(int len,int wid,int hei)
{
l = len;
b = wid;
h = hei;
}
};
bool compare(Cube x, Cube y)
{
int l1 = min(x.l,x.b);
int b1 = max(x.l,x.b);
int l2 = min(y.l,y.b);
int b2 = max(y.l,y.b);
if(l1 < l2 && b1 < b2)
return true;
if(l1 == l2)
return b1 < b2;
return l1 < l2;
}
int maxHeight(int height[],int width[],int length[],int n)
{
vector<Cube> v;
for(int i=0; i<n; i++)
{
Cube x = Cube(length[i],width[i],height[i]);
Cube y = Cube(length[i],height[i],width[i]);
Cube z = Cube(width[i],height[i],length[i]);
v.push_back(x);
v.push_back(y);
v.push_back(z);
}
sort(v.begin(),v.end(),compare);
int l = 3*n;
int dp[l];
int ans = 0;
for(int i=0; i<l; i++)
{
dp[i] = v[i].h;
int l1 = min(v[i].l,v[i].b);
int b1 = max(v[i].l,v[i].b);
for(int j=0; j<i; j++)
{
int l2 = min(v[j].l,v[j].b);
int b2 = max(v[j].l,v[j].b);
if(l2 < l1 && b2 < b1)
dp[i] = max(dp[i],dp[j] + v[i].h);
}
ans = max(ans,dp[i]);
}
return ans;
}
|
23d19ef554b962f3f1bf2afb164e31281f8212b3 | be86675778e8a4872eb28eaece3623c6ed8b4a38 | /uva 10405.cpp | 1bcd62dfd25346a3eca92b7cb8745c09d5a3d528 | [] | no_license | notanchowdhury/Uva-Online-Judge | bfc97d9030c930671660717e535054ac7da853ca | 5da3a0d3db0d5dfdc69dca68bad6f129b0962624 | refs/heads/master | 2022-03-29T13:46:28.497497 | 2019-11-20T10:51:37 | 2019-11-20T10:51:37 | 197,809,019 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 867 | cpp | uva 10405.cpp | #include<cstdio>
#include<iostream>
#include<string.h>
using namespace std;
#define MAXC 1008
char A[MAXC],B[MAXC];
int lenA,lenB;
int dp[MAXC][MAXC];
bool visited[MAXC][MAXC];
int calcLCS(int i,int j)
{
if(A[i]=='\0' or B[j]=='\0') return 0;
if(visited[i][j])return dp[i][j];
int ans=0;
if(A[i]==B[j]) ans=1+calcLCS(i+1,j+1);
else
{
int val1=calcLCS(i+1,j);
int val2=calcLCS(i,j+1);
ans=max(val1,val2);
}
visited[i][j]=1;
dp[i][j]=ans;
return dp[i][j];
}
int main() {
while(gets(A))
{
if(strlen(A)==0)
break;
gets(B);
if(strlen(A)==0||strlen(B)==0)
break;
for(int i=0;i<MAXC;i++)
{
for(int j=0;j<MAXC;j++)
{
dp[i][j]=0;
visited[i][j]=0;
}
}
printf("%d\n",calcLCS(0,0));
}
return 0;
}
|
6ed041f51e04fabc9abcf936d980d4eaccf405cc | 4f62ade008f32e00485ba487a914bcdecb892057 | /calculator.cpp | 014ccd9503e9cf37a05c26984c38eedfb0501cce | [] | no_license | nunanas21/CIS108lab2 | bbbcf5cc42652edf44d660a3211733fe9cbdb397 | 772d96c4847f21be584ec317bf6c96353c3df4d4 | refs/heads/master | 2020-04-19T08:14:15.036012 | 2019-05-09T00:54:15 | 2019-05-09T00:54:15 | 168,070,091 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,286 | cpp | calculator.cpp | #include "calculator.h"
#include <cmath>
namespace calculator
{
double current_value = (0.0);
void memory_store(double);
double memoryStore;
void memory_recall(double);
double memoryRecall;
double memory_clear;
double currentValue()
{
return current_value;
}
double add(double left, double right)
{
current_value = left + right;
return current_value;
}
double subract(double left, double right) //subtracting two numbers and returing the difference
{
current_value = left - right;
return current_value;
}
double multiply(double left, double right) // multiplying two numbers and returning the product
{
current_value = left * right;
return current_value;
}
double divide(double left, double right) // dividing two numbers and returning the quotiant
{
current_value = left / right;
return current_value;
}
double pow(double left, double right)
{
current_value = left ^ right;
return current_value;
}
void memory_store(double) //
{
memoryStore = currentValue;
}
void memory_recall(double) // recalling the value that was stored last.
{
memoryRecall = memoryStore;
}
double memory_clear // clearing the screen to zero.
{
memoryClear = 0;
}
}
|
9191880319f322a81958c6b3dc7c0d3f36627dfa | b7d4fc29e02e1379b0d44a756b4697dc19f8a792 | /deps/boost/libs/icl/test/fastest_partial_icl_quantifier_cases.hpp | 862e6ce66cb9d9ff92111b7ba62274fd99c11c5b | [
"GPL-1.0-or-later",
"MIT",
"BSL-1.0"
] | permissive | vslavik/poedit | 45140ca86a853db58ddcbe65ab588da3873c4431 | 1b0940b026b429a10f310d98eeeaadfab271d556 | refs/heads/master | 2023-08-29T06:24:16.088676 | 2023-08-14T15:48:18 | 2023-08-14T15:48:18 | 477,156 | 1,424 | 275 | MIT | 2023-09-01T16:57:47 | 2010-01-18T08:23:13 | C++ | UTF-8 | C++ | false | false | 4,526 | hpp | fastest_partial_icl_quantifier_cases.hpp | /*-----------------------------------------------------------------------------+
Copyright (c) 2008-2009: Joachim Faulhaber
+------------------------------------------------------------------------------+
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENCE.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
+-----------------------------------------------------------------------------*/
#ifndef BOOST_ICL_FASTEST_PARTIAL_ICL_QUANTIFIER_CASES_HPP_JOFA_100819
#define BOOST_ICL_FASTEST_PARTIAL_ICL_QUANTIFIER_CASES_HPP_JOFA_100819
//------------------------------------------------------------------------------
// partial_absorber
//------------------------------------------------------------------------------
BOOST_AUTO_TEST_CASE
(fastest_itl_partial_icl_quantifier_check_monoid_plus_4_bicremental_types)
{ icl_quantifier_check_monoid_plus_4_bicremental_types<bicremental_type_1, std::string, partial_absorber, INTERVAL_MAP>();}
BOOST_AUTO_TEST_CASE
(fastest_itl_partial_icl_quantifier_check_monoid_et_4_bicremental_types)
{ icl_quantifier_check_monoid_et_4_bicremental_types<bicremental_type_2, int, partial_absorber, INTERVAL_MAP>();}
BOOST_AUTO_TEST_CASE
(fastest_itl_partial_icl_quantifier_check_abelian_monoid_plus_4_bicremental_types)
{ icl_quantifier_check_abelian_monoid_plus_4_bicremental_types<bicremental_type_3, std::string, partial_absorber, INTERVAL_MAP>();}
BOOST_AUTO_TEST_CASE
(fastest_itl_partial_icl_quantifier_check_abelian_monoid_et_4_bicremental_types)
{ icl_quantifier_check_abelian_monoid_et_4_bicremental_types<bicremental_type_4, int, partial_absorber, INTERVAL_MAP>();}
// x - x = 0 | partial absorber
BOOST_AUTO_TEST_CASE
(fastest_itl_partial_icl_quantifier_check_partial_invertive_monoid_plus_4_bicremental_types)
{ icl_quantifier_check_partial_invertive_monoid_plus_4_bicremental_types<bicremental_type_5, int, partial_absorber, INTERVAL_MAP>();}
//------------------------------------------------------------------------------
// partial_enricher
//------------------------------------------------------------------------------
BOOST_AUTO_TEST_CASE
(fastest_itl_partial_enricher_icl_quantifier_check_monoid_plus_4_bicremental_types)
{ icl_quantifier_check_monoid_plus_4_bicremental_types<bicremental_type_6, std::string, partial_enricher, INTERVAL_MAP>();}
BOOST_AUTO_TEST_CASE
(fastest_itl_partial_enricher_icl_quantifier_check_monoid_et_4_bicremental_types)
{ icl_quantifier_check_monoid_et_4_bicremental_types<bicremental_type_7, int, partial_enricher, INTERVAL_MAP>();}
BOOST_AUTO_TEST_CASE
(fastest_itl_partial_enricher_icl_quantifier_check_abelian_monoid_plus_4_bicremental_types)
{ icl_quantifier_check_abelian_monoid_plus_4_bicremental_types<bicremental_type_8, std::string, partial_enricher, INTERVAL_MAP>();}
BOOST_AUTO_TEST_CASE
(fastest_itl_partial_enricher_icl_quantifier_check_abelian_monoid_et_4_bicremental_types)
{ icl_quantifier_check_abelian_monoid_et_4_bicremental_types<bicremental_type_1, int, partial_enricher, INTERVAL_MAP>();}
// x - x =d= 0 | partial enricher
BOOST_AUTO_TEST_CASE
(fastest_itl_partial_enricher_icl_quantifier_check_partial_invertive_monoid_plus_prot_inv_4_bicremental_types)
{ icl_quantifier_check_partial_invertive_monoid_plus_prot_inv_4_bicremental_types<bicremental_type_2, int, partial_enricher, INTERVAL_MAP>();}
// absorber enricher
// partial x - x == 0 x - x =d= 0 partiality of subtraction
// total (-x)+ x == 0 (-x)+ x =d= 0 totality of subtraction
//------------------------------------------------------------------------------
// Containedness
//------------------------------------------------------------------------------
BOOST_AUTO_TEST_CASE
(fastest_itl_partial_icl_quantifier_check_containedness_4_bicremental_types)
{ icl_quantifier_check_containedness_4_bicremental_types<bicremental_type_1, mono, partial_absorber, INTERVAL_MAP>();}
BOOST_AUTO_TEST_CASE
(fastest_itl_partial_enricher_icl_quantifier_check_containedness_4_bicremental_types)
{ icl_quantifier_check_containedness_4_bicremental_types<bicremental_type_1, mono, partial_enricher, INTERVAL_MAP>();}
#endif // BOOST_ICL_FASTEST_PARTIAL_ICL_QUANTIFIER_CASES_HPP_JOFA_100819
|
6334c26fd858cd135792a7d7544bf64b39220149 | 9777b8f325e8602d7d2be295238a740390ab8661 | /MPU_6050.ino | c2033f45e1478a0f9f9dce107c2494ec17524dad | [] | no_license | PrzemekMi/MPU-6050-Angle-Gauge | afc7c6eb239e655e8d1b3ea8bcebbdb226b1c6e2 | 142854828e259a7465e92b41dcd5e1be43b0d63a | refs/heads/master | 2020-03-07T00:54:02.513255 | 2018-03-28T16:41:27 | 2018-03-28T16:41:27 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,062 | ino | MPU_6050.ino | #include <Wire.h>
#include <MPU6050.h>
MPU6050 mpu;
void setup() {
Serial.begin(115200);
Serial.println("Initialize MPU6050");
while (!mpu.begin(MPU6050_SCALE_2000DPS, MPU6050_RANGE_2G))
{
Serial.println("Could not find a valid MPU6050 sensor, chceck wiring!");
delay(500);
}
mpu.calibrateGyro();
mpu.setThreshold(3);
checkSettings();
}
void checkSettings()
{
Serial.println();
Serial.print(" * Sleep Mode: ");
Serial.println(mpu.getSleepEnabled() ? "Enabled" : "Disabled");
Serial.print(" * Clock Source: ");
switch(mpu.getClockSource())
{
case MPU6050_CLOCK_KEEP_RESET: Serial.println("Stops the clock and keeps the timing generator in reset"); break;
case MPU6050_CLOCK_EXTERNAL_19MHZ: Serial.println("PLL with external 19.2MHz reference"); break;
case MPU6050_CLOCK_EXTERNAL_32KHZ: Serial.println("PLL with external 32.768kHz reference"); break;
case MPU6050_CLOCK_PLL_ZGYRO: Serial.println("PLL with Z axis gyroscope reference"); break;
case MPU6050_CLOCK_PLL_YGYRO: Serial.println("PLL with Y axis gyroscope reference"); break;
case MPU6050_CLOCK_PLL_XGYRO: Serial.println("PLL with X axis gyroscope reference"); break;
case MPU6050_CLOCK_INTERNAL_8MHZ: Serial.println("Internal 8MHz oscillator"); break;
}
Serial.print(" * Accelerometer: ");
switch(mpu.getRange())
{
case MPU6050_RANGE_16G: Serial.println("+/- 16 g"); break;
case MPU6050_RANGE_8G: Serial.println("+/- 8 g"); break;
case MPU6050_RANGE_4G: Serial.println("+/- 4 g"); break;
case MPU6050_RANGE_2G: Serial.println("+/- 2 g"); break;
}
Serial.print(" * Accelerometer offsets: ");
Serial.print(mpu.getAccelOffsetX());
Serial.print(" / ");
Serial.print(mpu.getAccelOffsetY());
Serial.print(" / ");
Serial.println(mpu.getAccelOffsetZ());
Serial.println();
Serial.print(" * Gyroscope: ");
switch(mpu.getScale())
{
case MPU6050_SCALE_2000DPS: Serial.println("2000 dps"); break;
case MPU6050_SCALE_1000DPS: Serial.println("1000 dps"); break;
case MPU6050_SCALE_500DPS: Serial.println("500 dps"); break;
case MPU6050_SCALE_250DPS: Serial.println("250 dps"); break;
}
Serial.print(" * Gyroscope offsets: ");
Serial.print(mpu.getGyroOffsetX());
Serial.print(" / ");
Serial.print(mpu.getGyroOffsetY());
Serial.print(" / ");
Serial.println(mpu.getGyroOffsetZ());
}
void loop() {
Vector rawGyro = mpu.readRawGyro();
Serial.println("Gyroscope raw data");
Serial.print(" Xraw = ");
Serial.print(rawGyro.XAxis);
Serial.print(" Yraw = ");
Serial.print(rawGyro.YAxis);
Serial.print(" Zraw = ");
Serial.println(rawGyro.ZAxis);
Vector rawAccel = mpu.readRawAccel();
Serial.println("Accelerator raw data");
Serial.print(" Xraw = ");
Serial.print(rawAccel.XAxis);
Serial.print(" Yraw = ");
Serial.print(rawAccel.YAxis);
Serial.print(" Zraw = ");
delay(1000);
}
|
587cce253fb71bb6bc50b2ceaeccfd78ad045c70 | 02fefdf8f7362035767933f8c639727fefb5f137 | /radiobutton.h | 8580da297c060b5b470b374f91ab13dc8621b8ec | [] | no_license | mitchworsey/8TilePuzzle | fb2c64bec6cd96519f73e5a50512f6602c224d87 | 676f2527baf827f61e01ee91d6fd6873b72f67af | refs/heads/master | 2021-01-10T20:50:52.606467 | 2015-03-04T14:01:59 | 2015-03-04T14:01:59 | 31,659,343 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 296 | h | radiobutton.h | #ifndef RADIOBUTTON_H
#define RADIOBUTTON_H
#include <QWidget>
#include <QRadioButton>
#include <QString>
class RadioButton : public QWidget{
//Q_OBJECT
private:
QRadioButton *qrb;
std::string s;
public:
RadioButton(std::string);
bool isChecked();
std::string getName();
};
#endif
|
9b1f90a6713a270ae4c34804227aaa106a62054a | cb8c337a790b62905ad3b30f7891a4dff0ae7b6d | /st-ericsson/multimedia/audio/afm/nmf/hst/bindings/shm/shmout/inc/shmout.hpp | bcbf44143077327292d6b32022e04757d68e5377 | [] | no_license | CustomROMs/android_vendor | 67a2a096bfaa805d47e7d72b0c7a0d7e4830fa31 | 295e660547846f90ac7ebe42a952e613dbe1b2c3 | refs/heads/master | 2020-04-27T15:01:52.612258 | 2019-03-11T13:26:23 | 2019-03-12T11:23:02 | 174,429,381 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,879 | hpp | shmout.hpp | /*****************************************************************************/
/*
* Copyright (C) ST-Ericsson SA 2009,2010. All rights reserved.
* This code is ST-Ericsson proprietary and confidential.
* Any use of the code for whatever purpose is subject to
* specific written permission of ST-Ericsson SA.
*
*/
/**
* \file shmout.hpp
* \brief
* \author ST-Ericsson
*/
/*****************************************************************************/
#ifndef _shm_shmout_hpp_
#define _shm_shmout_hpp_
#include "Component.h"
#include "common_interface.h"
class hst_bindings_shm_shmout : public Component, public hst_bindings_shm_shmoutTemplate
{
public:
//Component virtual functions
virtual void process() ;
virtual void reset() ;
virtual void disablePortIndication(t_uint32 portIdx) ;
virtual void enablePortIndication(t_uint32 portIdx) ;
virtual void flushPortIndication(t_uint32 portIdx) ;
virtual void fsmInit(fsmInit_t initFsm);
virtual void setTunnelStatus(t_sint16 portIdx, t_uint16 isTunneled);
virtual void sendCommand(OMX_COMMANDTYPE cmd, t_uword param) { Component::sendCommand(cmd, param) ; }
virtual void processEvent(void) { Component::processEvent() ; }
virtual void emptyThisBuffer(OMX_BUFFERHEADERTYPE_p buffer) { Component::deliverBuffer(INPUT_PORT, buffer); }
virtual void fillThisBuffer(OMX_BUFFERHEADERTYPE_p buffer) { Component::deliverBuffer(OUTPUT_PORT, buffer); }
virtual void setParameter(ShmConfig_t config);
private:
typedef enum {INPUT_PORT, OUTPUT_PORT} portname;
#define MAX_NB_BUFFERS 4
virtual void newFormat(t_sample_freq sample_freq, t_uint16 chans_nb, t_uint16 sample_size);
static void swap_bytes(t_uint8 *buffer, t_uint32 size, t_swap_mode swap_mode);
ShmConfig_t mShmConfig;
bool mBufferSent;
Port mPorts[2];
};
#endif // _shm_shmout_hpp_
|
e7ed5ee648ec5f59f29e02ad87c396a4f977f85d | 3998f24b410d0b523b216831e876fde87d78ad54 | /指针/指针热身1.cpp | 367732278930130ebd978150d5139a390d63a0db | [] | no_license | HugeMan-Lee/C | 293e81192520ff1700ada2d5971b463965f7b40d | 3af547f68caf3c27ed8a02438a3c0317f00b58f3 | refs/heads/master | 2022-12-13T13:15:24.112996 | 2020-06-12T06:07:04 | 2020-06-12T06:07:04 | 296,282,126 | 0 | 0 | null | 2020-09-17T09:36:09 | 2020-09-17T09:36:08 | null | GB18030 | C++ | false | false | 525 | cpp | 指针热身1.cpp | # include <stdio.h>
int main(void)
{
int * p; //p是变量名;int * 表示表示p变量存放的是int类型变量的地址
//不表示定义一个叫* p的变量
//p是变量名,p的数据类型是int * 类型;
//所谓int * 类型:就是存放int变量地址的类型
int i = 3;
int j;
p = &i;
// p = i; //error 类型不一致,p只能存放int类型变量的地址,不能存放int类型变量的值
// p = 55; //error
return 0;
} |
7fe1db01ef40a89b74317b0778bb174e9845be96 | 6f9805642bac90fb4db1d8c2b216279618b2f6d8 | /src/rtmp/rtmp.h | 7fb4087250571271ea70b87a11ca069541ad62ec | [
"MIT"
] | permissive | commshare/RtspServer-1 | 3762ba1e85ce69b7f1758fc043b71f0f88178ac8 | a31b54c33fd1aabc433811afe54c312ba55b3e11 | refs/heads/master | 2020-06-06T20:34:19.033164 | 2019-06-22T16:52:27 | 2019-06-22T16:52:27 | 192,846,698 | 1 | 0 | null | 2019-06-20T04:10:11 | 2019-06-20T04:10:10 | null | GB18030 | C++ | false | false | 6,646 | h | rtmp.h | #pragma once
#include <memory>
#include <string>
#include <cstdlib>
#include "rtmp/comm.h"
#include "zlm/Buffer.h"
#define PORT 1935
#define DEFAULT_CHUNK_LEN 128
#if !defined(_WIN32)
#define PACKED __attribute__((packed))
#else
#define PACKED
#endif //!defined(_WIN32)
#define HANDSHAKE_PLAINTEXT 0x03
#define RANDOM_LEN (1536 - 8)
#define MSG_SET_CHUNK 1 /*Set Chunk Size (1)*/
#define MSG_ABORT 2 /*Abort Message (2)*/
#define MSG_ACK 3 /*Acknowledgement (3)*/
#define MSG_USER_CONTROL 4 /*User Control Messages (4)*/
#define MSG_WIN_SIZE 5 /*Window Acknowledgement Size (5)*/
#define MSG_SET_PEER_BW 6 /*Set Peer Bandwidth (6)*/
#define MSG_AUDIO 8 /*Audio Message (8)*/
#define MSG_VIDEO 9 /*Video Message (9)*/
#define MSG_DATA 18 /*Data Message (18, 15) AMF0*/
#define MSG_DATA3 15 /*Data Message (18, 15) AMF3*/
#define MSG_CMD 20 /*Command Message AMF0 */
#define MSG_CMD3 17 /*Command Message AMF3 */
#define MSG_OBJECT3 16 /*Shared Object Message (19, 16) AMF3*/
#define MSG_OBJECT 19 /*Shared Object Message (19, 16) AMF0*/
#define MSG_AGGREGATE 22 /*Aggregate Message (22)*/
#define CONTROL_STREAM_BEGIN 0
#define CONTROL_STREAM_EOF 1
#define CONTROL_STREAM_DRY 2
#define CONTROL_SETBUFFER 3
#define CONTROL_STREAM_ISRECORDED 4
#define CONTROL_PING_REQUEST 6
#define CONTROL_PING_RESPONSE 7
#define STREAM_CONTROL 0
#define STREAM_MEDIA 1
#define CHUNK_SERVER_REQUEST 2 /*服务器像客户端发出请求时的chunkID*/
#define CHUNK_CLIENT_REQUEST_BEFORE 3 /*客户端在createStream前,向服务器发出请求的chunkID*/
#define CHUNK_CLIENT_REQUEST_AFTER 4 /*客户端在createStream后,向服务器发出请求的chunkID*/
#define CHUNK_AUDIO 6 /*音频chunkID*/
#define CHUNK_VIDEO 7 /*视频chunkID*/
#define FLV_KEY_FRAME 1
#define FLV_INTER_FRAME 2
#if defined(_WIN32)
#pragma pack(push, 1)
#endif // defined(_WIN32)
class RtmpHandshake {
public:
RtmpHandshake(uint32_t _time, uint8_t* _random = nullptr) {
_time = htonl(_time);
memcpy(timeStamp, &_time, 4);
if (!_random) {
random_generate((char*)random, sizeof(random));
}
else {
memcpy(random, _random, sizeof(random));
}
}
uint8_t timeStamp[4];
uint8_t zero[4] = { 0 };
uint8_t random[RANDOM_LEN];
void random_generate(char* bytes, int size) {
static char cdata[] = { 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x2d, 0x72,
0x74, 0x6d, 0x70, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72,
0x2d, 0x77, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x2d, 0x77, 0x69,
0x6e, 0x74, 0x65, 0x72, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72,
0x40, 0x31, 0x32, 0x36, 0x2e, 0x63, 0x6f, 0x6d };
for (int i = 0; i < size; i++) {
bytes[i] = cdata[rand() % (sizeof(cdata) - 1)];
}
}
}PACKED;
class RtmpHeader {
public:
uint8_t flags;
uint8_t timeStamp[3];
uint8_t bodySize[3];
uint8_t typeId;
uint8_t streamId[4]; /* Note, this is little-endian while others are BE */
}PACKED;
#if defined(_WIN32)
#pragma pack(pop)
#endif // defined(_WIN32)
class RtmpPacket : public toolkit::Buffer {
public:
typedef std::shared_ptr<RtmpPacket> Ptr;
uint8_t typeId;
uint32_t bodySize = 0;
uint32_t timeStamp = 0;
bool hasAbsStamp = false;
bool hasExtStamp = false;
uint32_t deltaStamp = 0;
uint32_t streamId;
uint32_t chunkId;
std::string strBuf;
public:
char* data() const override {
return (char*)strBuf.data();
}
uint32_t size() const override {
return strBuf.size();
};
public:
RtmpPacket() = default;
RtmpPacket(const RtmpPacket& that) = default;
RtmpPacket& operator=(const RtmpPacket& that) = default;
RtmpPacket& operator=(RtmpPacket&& that) = default;
//主要是右值得来?
RtmpPacket(RtmpPacket&& that) {
typeId = that.typeId;
bodySize = that.bodySize;
timeStamp = that.timeStamp;
hasAbsStamp = that.hasAbsStamp;
hasExtStamp = that.hasExtStamp;
deltaStamp = that.deltaStamp;
streamId = that.streamId;
chunkId = that.chunkId;
strBuf = std::move(that.strBuf); //这是字符串复制
}
bool isVideoKeyFrame() const {
return typeId == MSG_VIDEO && (uint8_t)strBuf[0] >> 4 == FLV_KEY_FRAME
&& (uint8_t)strBuf[1] == 1;
}
bool isCfgFrame() const {
return (typeId == MSG_VIDEO || typeId == MSG_AUDIO)
&& (uint8_t)strBuf[1] == 0;
}
int getMediaType() const {
switch (typeId) {
case MSG_VIDEO: {
return (uint8_t)strBuf[0] & 0x0F;
}
break;
case MSG_AUDIO: {
return (uint8_t)strBuf[0] >> 4;
}
break;
default:
break;
}
return 0;
}
int getAudioSampleRate() const {
if (typeId != MSG_AUDIO) {
return 0;
}
int flvSampleRate = ((uint8_t)strBuf[0] & 0x0C) >> 2;
const static int sampleRate[] = { 5512, 11025, 22050, 44100 };
return sampleRate[flvSampleRate];
}
int getAudioSampleBit() const {
if (typeId != MSG_AUDIO) {
return 0;
}
int flvSampleBit = ((uint8_t)strBuf[0] & 0x02) >> 1;
const static int sampleBit[] = { 8, 16 };
return sampleBit[flvSampleBit];
}
int getAudioChannel() const {
if (typeId != MSG_AUDIO) {
return 0;
}
int flvStereoOrMono = (uint8_t)strBuf[0] & 0x01;
const static int channel[] = { 1, 2 };
return channel[flvStereoOrMono];
}
/**
* 返回不带0x00 00 00 01头的sps
* @return
*/
string getH264SPS() const {
string ret;
if (getMediaType() != 7) {
return ret;
}
if (!isCfgFrame()) {
return ret;
}
if (strBuf.size() < 13) {
WarnL << "bad H264 cfg!";
return ret;
}
uint16_t sps_size;
memcpy(&sps_size, strBuf.data() + 11, 2);
sps_size = ntohs(sps_size);
if ((int)strBuf.size() < 13 + sps_size) {
WarnL << "bad H264 cfg!";
return ret;
}
ret.assign(strBuf.data() + 13, sps_size);
return ret;
}
/**
* 返回不带0x00 00 00 01头的pps
* @return
*/
string getH264PPS() const {
string ret;
if (getMediaType() != 7) {
return ret;
}
if (!isCfgFrame()) {
return ret;
}
if (strBuf.size() < 13) {
WarnL << "bad H264 cfg!";
return ret;
}
uint16_t sps_size;
memcpy(&sps_size, strBuf.data() + 11, 2);
sps_size = ntohs(sps_size);
if ((int)strBuf.size() < 13 + sps_size + 1 + 2) {
WarnL << "bad H264 cfg!";
return ret;
}
uint16_t pps_size;
memcpy(&pps_size, strBuf.data() + 13 + sps_size + 1, 2);
pps_size = ntohs(pps_size);
if ((int)strBuf.size() < 13 + sps_size + 1 + 2 + pps_size) {
WarnL << "bad H264 cfg!";
return ret;
}
ret.assign(strBuf.data() + 13 + sps_size + 1 + 2, pps_size);
return ret;
}
string getAacCfg() const {
string ret;
if (getMediaType() != 10) {
return ret;
}
if (!isCfgFrame()) {
return ret;
}
if (strBuf.size() < 4) {
WarnL << "bad aac cfg!";
return ret;
}
ret = strBuf.substr(2, 2);
return ret;
}
};
|
9035c5c1dfa0bac4d408cd155e4c036b5e3e8e1a | 087db87afc8cafcd21cfdaeeebaf31d7fafb6511 | /libsponge/tcp_helpers/tuntap_adapter.hh | b6506a55eb3a2efd61b1242cd4d348d868198dd4 | [] | no_license | ViXbob/CS144-Lab-Assignment | beb95b2b46206c6922aa9b4d2966c1957336ffdf | 77ded007a0367e61507fe272c219b710c65904be | refs/heads/master | 2023-07-12T07:39:35.171677 | 2021-08-31T11:13:26 | 2021-08-31T11:13:26 | 395,590,005 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,346 | hh | tuntap_adapter.hh | #ifndef SPONGE_LIBSPONGE_TUNFD_ADAPTER_HH
#define SPONGE_LIBSPONGE_TUNFD_ADAPTER_HH
#include "tcp_over_ip.hh"
#include "tun.hh"
#include <optional>
#include <unordered_map>
#include <utility>
//! \brief A FD adapter for IPv4 datagrams read from and written to a TUN device
class TCPOverIPv4OverTunFdAdapter : public TCPOverIPv4Adapter {
private:
TunFD _tun;
public:
//! Construct from a TunFD
explicit TCPOverIPv4OverTunFdAdapter(TunFD &&tun) : _tun(std::move(tun)) {}
//! Attempts to read and parse an IPv4 datagram containing a TCP segment related to the current connection
std::optional<TCPSegment> read() {
InternetDatagram ip_dgram;
if (ip_dgram.parse(_tun.read()) != ParseResult::NoError) {
return {};
}
return unwrap_tcp_in_ip(ip_dgram);
}
//! Creates an IPv4 datagram from a TCP segment and writes it to the TUN device
void write(TCPSegment &seg) { _tun.write(wrap_tcp_in_ip(seg).serialize()); }
//! Access the underlying TUN device
operator TunFD &() { return _tun; }
//! Access the underlying TUN device
operator const TunFD &() const { return _tun; }
};
//! Typedef for TCPOverIPv4OverTunFdAdapter
using LossyTCPOverIPv4OverTunFdAdapter = LossyFdAdapter<TCPOverIPv4OverTunFdAdapter>;
#endif // SPONGE_LIBSPONGE_TUNFD_ADAPTER_HH
|
7d69ee49fc92b66961409b7e4efc69a8a0e59822 | 6360ba1826780966347255ae49d89e312bae3078 | /Trim_Behind/Trim_Behind.cpp | b1da4be165d288825998c7be97f3fb8883645799 | [] | no_license | HopeLi/trim_behind | 0697304328f10a829928c5761a67ae21668bc385 | f16e89955f769333fe5375d7eb3cc876a20658e9 | refs/heads/master | 2016-09-15T23:27:28.475334 | 2012-09-02T10:41:43 | 2012-09-02T10:41:43 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 2,763 | cpp | Trim_Behind.cpp | // Trim_Behind.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <iostream>
#include <getopt.h>
#include <string>
#include <boost/algorithm/string.hpp>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
string delimiter = ":"; //default delimiter is ':'
//phase command line
static struct option long_options[] =
{
{"delimiter", required_argument, 0, 's'}, //specify the symbol behind which to trim off.
{"help", no_argument, 0, 'h'}, //specify the symbol behind which to trim off.
{0, 0, 0, 0}
};
int opt_return, option_index;
while((opt_return=getopt_long(argc, argv, "s:h", long_options, &option_index))!=-1)
{
switch (opt_return)
{
case 's':
if(optarg)
{
delimiter = optarg;
}
break;
case 'h':
cout<<"trim_behind input_file [output_file] [option]\n\n";
exit(0);
break;
case '?':
exit(0);
break;
default:
abort ();
}
}
//too many non-option arguments
if(optind+2 <argc)
{
cout<<"too many non-option arguments\n";
cout<<"use -h or --help option to see usage"<<endl;
exit(0);
}
bool pure_console = false;
if(optind==argc)
{
pure_console = true;
cout<<"do not specified non-option arguments, for more help, use -h"<<endl;
}
//read input file
errno_t in_file_err;
FILE *in_file = NULL;
if(optind!=argc)
{
in_file_err = _tfreopen_s(&in_file,argv[optind++],"r",stdin);
if(in_file_err!=0)
{
_tfreopen_s(&in_file,"con", "r", stdin);
cout<<"cannot open input file, and use command line as input!!"<<endl;
}
}
else
{
cout<<"not specified in_file, get input from console!!"<<endl;
}
//reopen stdout
errno_t out_file_err;
FILE *out_file = NULL;
if(optind!=argc)
{
out_file_err = _tfreopen_s(&out_file,argv[optind++],"w",stdout);
if(out_file_err!=0)
{
_tfreopen_s(&out_file,"con", "r", stdin);
cout<<"cannot open the file, send output to console!!"<<endl;
}
}
else
{
cout<<"not specified out_file, output results to console!!"<<endl;
}
cout<<endl;
// process input file, output it to stdout
string line;
while(getline(cin,line))
{
if(pure_console)
cout<<"-------------------------------------------------------------------------------"
<<endl;
if(boost::starts_with(line,delimiter))
{
cout<<delimiter<<endl;
}
else
{
cout<<line<<endl;
}
if(pure_console)
cout<<endl<<endl;
}
//close file
if(in_file!=NULL)
{
fclose(in_file);
}
if(out_file!=NULL)
{
fclose(out_file);
}
cout<<"\n...exit program..."<<endl;
return 0;
}
|
e64bbb30ecdc7718b53e32e374cac8c3c4405428 | 268ef75668b1be37167ef59addfc1bd11f8be0f6 | /Algorithms/Game Theory/Tower Breakers, Revisited!/solution.cpp | 64d746277a85a96ca2ee3e4ddda02be62b498bf6 | [
"MIT"
] | permissive | satyampandeygit/ds-algo-solutions | 2756e3aa00d50e84308c07a1d71bacc73049a333 | 4f04b25503be3d3fbc9037313acbf48b90505d44 | refs/heads/main | 2023-02-09T03:48:58.290364 | 2021-01-04T19:50:04 | 2021-01-04T19:50:04 | 322,667,019 | 1 | 0 | MIT | 2020-12-18T17:52:30 | 2020-12-18T17:52:29 | null | UTF-8 | C++ | false | false | 1,913 | cpp | solution.cpp | /*
Imagine each tower as a Nim pile which has a Nimvalue equal to the number of prime factors of hi.
Reducing a tower to its divisor is the same as taking away a non-zero prime factor from it.
Thus, this game is the same as a Nim game and our answer is the XOR of all Nim piles.
If the Nim sum is 0, then player 2wins;
otherwise, player 1 wins.
*/
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
// Cool problem! Trick is to realize that each tower is really a nim heap of size # of prime factors
int main() {
int T;
cin>>T;
while(T > 0) {
int N;
cin>>N;
long tmp, nimSum = 0;
for(int i = 0; i < N; i++) {
cin>>tmp;
// Determine number of prime factors
int numPrimeFactors = 0;
if(tmp == 1) {
numPrimeFactors = 0;
} else if(((tmp != 0) && !(tmp & (tmp - 1)))) {
// If tmp is a power of 2
numPrimeFactors = tmp/2;
} else {
// Calculate # of prime factors
while(tmp > 1) {
bool foundFactor = false;
for(long j = 2; j*j <= tmp; j++) {
if(tmp%j == 0) {
numPrimeFactors++;
tmp /= j;
foundFactor = true;
break;
}
}
if(!foundFactor) {
// tmp is prime
numPrimeFactors++;
break;
}
}
}
nimSum ^= numPrimeFactors;
}
if(nimSum != 0) {
cout<<"1\n";
} else {
cout<<"2\n";
}
T--;
}
return 0;
} |
60bc63a78423998ed56785fdc13a1be81dee6011 | e783616ef24e17252960c0b02c9d60a775007178 | /hls_old/hls/systolic_array.cpp | c5db44bbf2c78e60bd6ed2adea98b5341560f903 | [] | no_license | dhm2013724/systolic_array_hls | 0450a7149d139951fb834fe884c7b824f216d240 | ddadd9169c55146c3d278976f60f922f1ed888b0 | refs/heads/main | 2023-04-07T00:08:58.097791 | 2021-04-15T13:12:38 | 2021-04-15T13:12:38 | 341,474,501 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 134,293 | cpp | systolic_array.cpp |
#include "systolic_array.h"
//////////////////////////////////////////v14 start////////////////////////////////////////
typedef struct {
int K_MIN;
bool write_back;
bool init;
} cwrap_s;
template<int MIN_R,int MID_C>
void compute_pe(hls::stream<int> &A_in, hls::stream<int> &B_in, hls::stream<int> &C_in, hls::stream<int> &A_out, hls::stream<int> &B_out, hls::stream<int> &C_out,
hls::stream<cwrap_s> &cws_in, hls::stream<cwrap_s> &cws_out)
{
cwrap_s cws;
cws_in >> cws;
int K = cws.K_MIN;
bool write_back = cws.write_back;
bool init = cws.init;
cws_out << cws;
#pragma HLS INLINE off
static int C_local;
int A_tmp, B_tmp;
if(init){
C_local = 0;
}
for(int k=0; k<K; k++)
{
DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
#pragma HLS PIPELINE II=1
A_in >> A_tmp;
B_in >> B_tmp;
C_local += A_tmp * B_tmp;
A_out << A_tmp;
B_out << B_tmp;
}
if(write_back){
C_out.write(C_local);
//tranfer neighbor PE's output
for(int k=0; k<MID_C; k++){
#pragma HLS PIPELINE II=1
int tmp_in, tmp_out;
C_in >> tmp_in;
tmp_out = tmp_in;
C_out << tmp_out;
}
}
return;
}
void Drain(hls::stream<int> &in, int data_num)
{
int drain;
for(int k = 0; k<data_num; k++){
DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
#pragma HLS PIPELINE II=1
in >> drain;
}
}
void Load_wrapper(int A_local[TILE_M][TILE_K], int B_local[TILE_K][TILE_N],
hls::stream<int> Ain_s[TILE_M], hls::stream<int> Bin_s[TILE_N],
hls::stream<cwrap_s> cws_s[TILE_M], bool init, int M_MIN, int N_MIN, int K_MIN, int K_MAX){
static int K_cnt;
if(init){
K_cnt = 0;
}
K_cnt += K_MIN;
for(int k=0; k<K_MIN; k++)
{
DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
#pragma HLS PIPELINE II=1
for(int i=0; i<TILE_M; i++){
int tmp = 0;
if(i<M_MIN)
tmp = A_local[i][k];
Ain_s[i] << tmp;
}
for(int j=0; j<TILE_N; j++){
int tmp = 0;
if(j<N_MIN)
tmp = B_local[k][j];
Bin_s[j] << tmp;
}
}
bool wb = (K_cnt == K_MAX);
for(int i=0; i<TILE_M; i++){
#pragma HLS UNROLL
cwrap_s cws;
cws.K_MIN = K_MIN;
cws.write_back = wb;
cws.init = init;
cws_s[i] << cws;
}
// cwrap_s cws;
// cws.K_MIN = K_MIN;
// cws.write_back = wb;
// cws.init = init;
// cws0.write(cws);
}
void Compute_wrapper(hls::stream<int> Ain_s[TILE_M], hls::stream<int> Bin_s[TILE_N],
hls::stream<int> Cout_s[TILE_M], hls::stream<cwrap_s> cws_s[TILE_M], hls::stream<bool> &wb1){
#pragma HLS DATAFLOW
hls::stream<int> A_inter[TILE_M][TILE_N+1];
#pragma HLS STREAM variable=A_inter dim=1 depth=DEPTH_TILE_K
#pragma HLS STREAM variable=A_inter dim=2 depth=DEPTH_TILE_K
hls::stream<int> B_inter[TILE_M+1][TILE_N];
#pragma HLS STREAM variable=B_inter dim=1 depth=DEPTH_TILE_K
#pragma HLS STREAM variable=B_inter dim=2 depth=DEPTH_TILE_K
hls::stream<int> C_out[TILE_M][TILE_N+1];
#pragma HLS STREAM variable=C_out dim=1 depth=DEPTH_TILE_N
#pragma HLS STREAM variable=C_out dim=2 depth=DEPTH_TILE_N
hls::stream<cwrap_s> cws_inter[TILE_M][TILE_N+1];
#pragma HLS STREAM variable=cws_inter dim=1 depth=2
#pragma HLS STREAM variable=cws_inter dim=2 depth=2
// cwrap_s cws;
// cws = cws0.read();
compute_pe<0, 0>( Ain_s[0], Bin_s[0], C_out[0][0], A_inter[0][1], B_inter[0+1][0], C_out[0][1], cws_s[0], cws_inter[0][1]);
compute_pe<0, 1>(A_inter[0][1], Bin_s[1], C_out[0][1], A_inter[0][2], B_inter[0+1][1], C_out[0][2], cws_inter[0][1], cws_inter[0][2]);
compute_pe<0, 2>(A_inter[0][2], Bin_s[2], C_out[0][2], A_inter[0][3], B_inter[0+1][2], C_out[0][3], cws_inter[0][2], cws_inter[0][3]);
compute_pe<0, 3>(A_inter[0][3], Bin_s[3], C_out[0][3], A_inter[0][4], B_inter[0+1][3], C_out[0][4], cws_inter[0][3], cws_inter[0][4]);
compute_pe<0, 4>(A_inter[0][4], Bin_s[4], C_out[0][4], A_inter[0][5], B_inter[0+1][4], C_out[0][5], cws_inter[0][4], cws_inter[0][5]);
compute_pe<0, 5>(A_inter[0][5], Bin_s[5], C_out[0][5], A_inter[0][6], B_inter[0+1][5], C_out[0][6], cws_inter[0][5], cws_inter[0][6]);
compute_pe<0, 6>(A_inter[0][6], Bin_s[6], C_out[0][6], A_inter[0][7], B_inter[0+1][6], C_out[0][7], cws_inter[0][6], cws_inter[0][7]);
compute_pe<0, 7>(A_inter[0][7], Bin_s[7], C_out[0][7], A_inter[0][8], B_inter[0+1][7], C_out[0][8], cws_inter[0][7], cws_inter[0][8]);
compute_pe<0, 8>(A_inter[0][8], Bin_s[8], C_out[0][8], A_inter[0][9], B_inter[0+1][8], Cout_s[0], cws_inter[0][8], cws_inter[0][9]);
compute_pe<1, 0>( Ain_s[1], B_inter[1][0], C_out[1][0], A_inter[1][1], B_inter[1+1][0], C_out[1][1], cws_s[1], cws_inter[1][1]);
compute_pe<1, 1>(A_inter[1][1], B_inter[1][1], C_out[1][1], A_inter[1][2], B_inter[1+1][1], C_out[1][2], cws_inter[1][1], cws_inter[1][2]);
compute_pe<1, 2>(A_inter[1][2], B_inter[1][2], C_out[1][2], A_inter[1][3], B_inter[1+1][2], C_out[1][3], cws_inter[1][2], cws_inter[1][3]);
compute_pe<1, 3>(A_inter[1][3], B_inter[1][3], C_out[1][3], A_inter[1][4], B_inter[1+1][3], C_out[1][4], cws_inter[1][3], cws_inter[1][4]);
compute_pe<1, 4>(A_inter[1][4], B_inter[1][4], C_out[1][4], A_inter[1][5], B_inter[1+1][4], C_out[1][5], cws_inter[1][4], cws_inter[1][5]);
compute_pe<1, 5>(A_inter[1][5], B_inter[1][5], C_out[1][5], A_inter[1][6], B_inter[1+1][5], C_out[1][6], cws_inter[1][5], cws_inter[1][6]);
compute_pe<1, 6>(A_inter[1][6], B_inter[1][6], C_out[1][6], A_inter[1][7], B_inter[1+1][6], C_out[1][7], cws_inter[1][6], cws_inter[1][7]);
compute_pe<1, 7>(A_inter[1][7], B_inter[1][7], C_out[1][7], A_inter[1][8], B_inter[1+1][7], C_out[1][8], cws_inter[1][7], cws_inter[1][8]);
compute_pe<1, 8>(A_inter[1][8], B_inter[1][8], C_out[1][8], A_inter[1][9], B_inter[1+1][8], Cout_s[1], cws_inter[1][8], cws_inter[1][9]);
compute_pe<2, 0>( Ain_s[2], B_inter[2][0], C_out[2][0], A_inter[2][1], B_inter[2+1][0], C_out[2][1], cws_s[2], cws_inter[2][1]);
compute_pe<2, 1>(A_inter[2][1], B_inter[2][1], C_out[2][1], A_inter[2][2], B_inter[2+1][1], C_out[2][2], cws_inter[2][1], cws_inter[2][2]);
compute_pe<2, 2>(A_inter[2][2], B_inter[2][2], C_out[2][2], A_inter[2][3], B_inter[2+1][2], C_out[2][3], cws_inter[2][2], cws_inter[2][3]);
compute_pe<2, 3>(A_inter[2][3], B_inter[2][3], C_out[2][3], A_inter[2][4], B_inter[2+1][3], C_out[2][4], cws_inter[2][3], cws_inter[2][4]);
compute_pe<2, 4>(A_inter[2][4], B_inter[2][4], C_out[2][4], A_inter[2][5], B_inter[2+1][4], C_out[2][5], cws_inter[2][4], cws_inter[2][5]);
compute_pe<2, 5>(A_inter[2][5], B_inter[2][5], C_out[2][5], A_inter[2][6], B_inter[2+1][5], C_out[2][6], cws_inter[2][5], cws_inter[2][6]);
compute_pe<2, 6>(A_inter[2][6], B_inter[2][6], C_out[2][6], A_inter[2][7], B_inter[2+1][6], C_out[2][7], cws_inter[2][6], cws_inter[2][7]);
compute_pe<2, 7>(A_inter[2][7], B_inter[2][7], C_out[2][7], A_inter[2][8], B_inter[2+1][7], C_out[2][8], cws_inter[2][7], cws_inter[2][8]);
compute_pe<2, 8>(A_inter[2][8], B_inter[2][8], C_out[2][8], A_inter[2][9], B_inter[2+1][8], Cout_s[2], cws_inter[2][8], cws_inter[2][9]);
compute_pe<3, 0>( Ain_s[3], B_inter[3][0], C_out[3][0], A_inter[3][1], B_inter[3+1][0], C_out[3][1], cws_s[3], cws_inter[3][1]);
compute_pe<3, 1>(A_inter[3][1], B_inter[3][1], C_out[3][1], A_inter[3][2], B_inter[3+1][1], C_out[3][2], cws_inter[3][1], cws_inter[3][2]);
compute_pe<3, 2>(A_inter[3][2], B_inter[3][2], C_out[3][2], A_inter[3][3], B_inter[3+1][2], C_out[3][3], cws_inter[3][2], cws_inter[3][3]);
compute_pe<3, 3>(A_inter[3][3], B_inter[3][3], C_out[3][3], A_inter[3][4], B_inter[3+1][3], C_out[3][4], cws_inter[3][3], cws_inter[3][4]);
compute_pe<3, 4>(A_inter[3][4], B_inter[3][4], C_out[3][4], A_inter[3][5], B_inter[3+1][4], C_out[3][5], cws_inter[3][4], cws_inter[3][5]);
compute_pe<3, 5>(A_inter[3][5], B_inter[3][5], C_out[3][5], A_inter[3][6], B_inter[3+1][5], C_out[3][6], cws_inter[3][5], cws_inter[3][6]);
compute_pe<3, 6>(A_inter[3][6], B_inter[3][6], C_out[3][6], A_inter[3][7], B_inter[3+1][6], C_out[3][7], cws_inter[3][6], cws_inter[3][7]);
compute_pe<3, 7>(A_inter[3][7], B_inter[3][7], C_out[3][7], A_inter[3][8], B_inter[3+1][7], C_out[3][8], cws_inter[3][7], cws_inter[3][8]);
compute_pe<3, 8>(A_inter[3][8], B_inter[3][8], C_out[3][8], A_inter[3][9], B_inter[3+1][8], Cout_s[3], cws_inter[3][8], cws_inter[3][9]);
compute_pe<4, 0>( Ain_s[4], B_inter[4][0], C_out[4][0], A_inter[4][1], B_inter[4+1][0], C_out[4][1], cws_s[4], cws_inter[4][1]);
compute_pe<4, 1>(A_inter[4][1], B_inter[4][1], C_out[4][1], A_inter[4][2], B_inter[4+1][1], C_out[4][2], cws_inter[4][1], cws_inter[4][2]);
compute_pe<4, 2>(A_inter[4][2], B_inter[4][2], C_out[4][2], A_inter[4][3], B_inter[4+1][2], C_out[4][3], cws_inter[4][2], cws_inter[4][3]);
compute_pe<4, 3>(A_inter[4][3], B_inter[4][3], C_out[4][3], A_inter[4][4], B_inter[4+1][3], C_out[4][4], cws_inter[4][3], cws_inter[4][4]);
compute_pe<4, 4>(A_inter[4][4], B_inter[4][4], C_out[4][4], A_inter[4][5], B_inter[4+1][4], C_out[4][5], cws_inter[4][4], cws_inter[4][5]);
compute_pe<4, 5>(A_inter[4][5], B_inter[4][5], C_out[4][5], A_inter[4][6], B_inter[4+1][5], C_out[4][6], cws_inter[4][5], cws_inter[4][6]);
compute_pe<4, 6>(A_inter[4][6], B_inter[4][6], C_out[4][6], A_inter[4][7], B_inter[4+1][6], C_out[4][7], cws_inter[4][6], cws_inter[4][7]);
compute_pe<4, 7>(A_inter[4][7], B_inter[4][7], C_out[4][7], A_inter[4][8], B_inter[4+1][7], C_out[4][8], cws_inter[4][7], cws_inter[4][8]);
compute_pe<4, 8>(A_inter[4][8], B_inter[4][8], C_out[4][8], A_inter[4][9], B_inter[4+1][8], Cout_s[4], cws_inter[4][8], cws_inter[4][9]);
compute_pe<5, 0>( Ain_s[5], B_inter[5][0], C_out[5][0], A_inter[5][1], B_inter[5+1][0], C_out[5][1], cws_s[5], cws_inter[5][1]);
compute_pe<5, 1>(A_inter[5][1], B_inter[5][1], C_out[5][1], A_inter[5][2], B_inter[5+1][1], C_out[5][2], cws_inter[5][1], cws_inter[5][2]);
compute_pe<5, 2>(A_inter[5][2], B_inter[5][2], C_out[5][2], A_inter[5][3], B_inter[5+1][2], C_out[5][3], cws_inter[5][2], cws_inter[5][3]);
compute_pe<5, 3>(A_inter[5][3], B_inter[5][3], C_out[5][3], A_inter[5][4], B_inter[5+1][3], C_out[5][4], cws_inter[5][3], cws_inter[5][4]);
compute_pe<5, 4>(A_inter[5][4], B_inter[5][4], C_out[5][4], A_inter[5][5], B_inter[5+1][4], C_out[5][5], cws_inter[5][4], cws_inter[5][5]);
compute_pe<5, 5>(A_inter[5][5], B_inter[5][5], C_out[5][5], A_inter[5][6], B_inter[5+1][5], C_out[5][6], cws_inter[5][5], cws_inter[5][6]);
compute_pe<5, 6>(A_inter[5][6], B_inter[5][6], C_out[5][6], A_inter[5][7], B_inter[5+1][6], C_out[5][7], cws_inter[5][6], cws_inter[5][7]);
compute_pe<5, 7>(A_inter[5][7], B_inter[5][7], C_out[5][7], A_inter[5][8], B_inter[5+1][7], C_out[5][8], cws_inter[5][7], cws_inter[5][8]);
compute_pe<5, 8>(A_inter[5][8], B_inter[5][8], C_out[5][8], A_inter[5][9], B_inter[5+1][8], Cout_s[5], cws_inter[5][8], cws_inter[5][9]);
compute_pe<6, 0>( Ain_s[6], B_inter[6][0], C_out[6][0], A_inter[6][1], B_inter[6+1][0], C_out[6][1], cws_s[6], cws_inter[6][1]);
compute_pe<6, 1>(A_inter[6][1], B_inter[6][1], C_out[6][1], A_inter[6][2], B_inter[6+1][1], C_out[6][2], cws_inter[6][1], cws_inter[6][2]);
compute_pe<6, 2>(A_inter[6][2], B_inter[6][2], C_out[6][2], A_inter[6][3], B_inter[6+1][2], C_out[6][3], cws_inter[6][2], cws_inter[6][3]);
compute_pe<6, 3>(A_inter[6][3], B_inter[6][3], C_out[6][3], A_inter[6][4], B_inter[6+1][3], C_out[6][4], cws_inter[6][3], cws_inter[6][4]);
compute_pe<6, 4>(A_inter[6][4], B_inter[6][4], C_out[6][4], A_inter[6][5], B_inter[6+1][4], C_out[6][5], cws_inter[6][4], cws_inter[6][5]);
compute_pe<6, 5>(A_inter[6][5], B_inter[6][5], C_out[6][5], A_inter[6][6], B_inter[6+1][5], C_out[6][6], cws_inter[6][5], cws_inter[6][6]);
compute_pe<6, 6>(A_inter[6][6], B_inter[6][6], C_out[6][6], A_inter[6][7], B_inter[6+1][6], C_out[6][7], cws_inter[6][6], cws_inter[6][7]);
compute_pe<6, 7>(A_inter[6][7], B_inter[6][7], C_out[6][7], A_inter[6][8], B_inter[6+1][7], C_out[6][8], cws_inter[6][7], cws_inter[6][8]);
compute_pe<6, 8>(A_inter[6][8], B_inter[6][8], C_out[6][8], A_inter[6][9], B_inter[6+1][8], Cout_s[6], cws_inter[6][8], cws_inter[6][9]);
// Loop_M:for(int i=0; i<TILE_M; i++)
// {
//#pragma HLS UNROLL
// compute_pe<0, 0>(A_inter[i][0], B_inter[i][0], A_inter[i][1], B_inter[i+1][0], C_out[i][0], K_MIN, K_MAX, init, &C_local_array[i][0], &k_cnt_array[i][0]);
// compute_pe<0, 1>(A_inter[i][1], B_inter[i][1], A_inter[i][2], B_inter[i+1][1], C_out[i][1], K_MIN, K_MAX, init, &C_local_array[i][1], &k_cnt_array[i][1]);
// compute_pe<0, 2>(A_inter[i][2], B_inter[i][2], A_inter[i][3], B_inter[i+1][2], C_out[i][2], K_MIN, K_MAX, init, &C_local_array[i][2], &k_cnt_array[i][2]);
// compute_pe<0, 3>(A_inter[i][3], B_inter[i][3], A_inter[i][4], B_inter[i+1][3], C_out[i][3], K_MIN, K_MAX, init, &C_local_array[i][3], &k_cnt_array[i][3]);
// compute_pe<0, 4>(A_inter[i][4], B_inter[i][4], A_inter[i][5], B_inter[i+1][4], C_out[i][4], K_MIN, K_MAX, init, &C_local_array[i][4], &k_cnt_array[i][4]);
// compute_pe<0, 5>(A_inter[i][5], B_inter[i][5], A_inter[i][6], B_inter[i+1][5], C_out[i][5], K_MIN, K_MAX, init, &C_local_array[i][5], &k_cnt_array[i][5]);
// compute_pe<0, 6>(A_inter[i][6], B_inter[i][6], A_inter[i][7], B_inter[i+1][6], C_out[i][6], K_MIN, K_MAX, init, &C_local_array[i][6], &k_cnt_array[i][6]);
// compute_pe<0, 7>(A_inter[i][7], B_inter[i][7], A_inter[i][8], B_inter[i+1][7], C_out[i][7], K_MIN, K_MAX, init, &C_local_array[i][7], &k_cnt_array[i][7]);
// compute_pe<0, 8>(A_inter[i][8], B_inter[i][8], A_inter[i][9], B_inter[i+1][8], C_out[i][8], K_MIN, K_MAX, init, &C_local_array[i][8], &k_cnt_array[i][8]);
// }
// Loop_M:for(int i=0; i<TILE_M; i++)
// {
//#pragma HLS UNROLL
// Loop_N:for(int j=0; j<TILE_N; j++)
// {
//#pragma HLS UNROLL
// PE_array[i][j].compute(A_inter[i][j], B_inter[i][j], A_inter[i][j+1], B_inter[i+1][j], C_out[i][j], K_MIN, K_MAX, init);
// }
// }
DRAIN_AB:{
cwrap_s cws;
cws_inter[0][9] >> cws;
for(int i=1; i<TILE_M; i++)
{
#pragma HLS UNROLL
cwrap_s cws_t;
cws_inter[i][9] >> cws_t;
}
for(int i=0; i<TILE_M; i++)
{
#pragma HLS UNROLL
Drain(A_inter[i][TILE_N], cws.K_MIN);
}
for(int j=0; j<TILE_N; j++)
{
#pragma HLS UNROLL
Drain(B_inter[TILE_M][j], cws.K_MIN);
}
wb1.write(cws.write_back);
}
}
void Write_wrapper(int C_local[TILE_M][TILE_N], hls::stream<int> Cout_s[TILE_M], int M_MIN, int N_MIN, int K_MIN, hls::stream<bool> &wb1)
{
bool write_back = wb1.read();
if(write_back){
for(int j=0; j<TILE_N; j++){
#pragma HLS PIPELINE II=1
for(int i=0; i<TILE_M; i++)
{
int tmp_out;
Cout_s[i] >> tmp_out;
C_local[i][TILE_N-1-j] = tmp_out;
}
}
}
}
void Compute_SA(int A_local[TILE_M][TILE_K], int B_local[TILE_K][TILE_N], int C_local[TILE_M][TILE_N], bool init, int M_MIN, int N_MIN, int K_MIN, int K_MAX)
{
#pragma HLS DATAFLOW
hls::stream<int> Ain_s[TILE_M];
#pragma HLS STREAM variable=Ain_s depth=DEPTH_TILE_K
//DO_PRAGMA(#pragma HLS STREAM variable=Ain_s depth=TILE_K)
hls::stream<int> Bin_s[TILE_N];
#pragma HLS STREAM variable=Bin_s depth=DEPTH_TILE_K
//DO_PRAGMA(#pragma HLS STREAM variable=Bin_s depth=TILE_K)
hls::stream<int> Cout_s[TILE_M];
#pragma HLS STREAM variable=Cout_s depth=DEPTH_TILE_N
//DO_PRAGMA(#pragma HLS STREAM variable=Cout_s depth=TILE_N)
hls::stream<cwrap_s> cws_s[TILE_M];
#pragma HLS STREAM variable=cws_s
hls::stream<bool> wb1;
Load_wrapper( A_local, B_local, Ain_s, Bin_s, cws_s, init, M_MIN, N_MIN, K_MIN, K_MAX);
Compute_wrapper( Ain_s, Bin_s, Cout_s, cws_s, wb1);
Write_wrapper( C_local, Cout_s, M_MIN, N_MIN, K_MIN, wb1);
}
void Load_A(int A_local[TILE_M][TILE_K], int *A, int M_base, int K_base, int K_len, int M_MIN, int K_MIN)
{
int base_offset = M_base*K_len + K_base;
Loop_M:for(int i=0; i<M_MIN; i++)
DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_M)
Loop_K:for(int k=0; k<K_MIN; k++)
{
DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
#pragma HLS PIPELINE II=1
A_local[i][k] = A[base_offset + i*K_len + k];
}
}
void Load_B(int B_local[TILE_K][TILE_N], int *B, int K_base, int N_base, int N_len, int K_MIN, int N_MIN)
{
int base_offset = K_base*N_len + N_base;
Loop_K:for(int i=0; i<K_MIN; i++)
DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
Loop_N:for(int k=0; k<N_MIN; k++)
{
DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_N)
#pragma HLS PIPELINE II=1
B_local[i][k] = B[base_offset + i*N_len + k];
}
}
void Load_AB_wrapper(int A_local[TILE_M][TILE_K], int B_local[TILE_K][TILE_N], int *A, int *B,
int K, int N, int i, int j, bool k_init, int M_MIN, int N_MIN, int K_MIN0[1], int k0[1])
{
static int k;
if(k_init){
k = 0;
}else{
k += TILE_K;
}
int K_MIN = MIN(TILE_K, K-k);
Load_A(A_local, A, i, k, K, M_MIN, K_MIN);
Load_B(B_local, B, k, j, N, K_MIN, N_MIN);
K_MIN0[0] = K_MIN;
k0[0] = k;
}
void Store_C(int C_local[TILE_M][TILE_N], int *C, int M_base, int N_base, int N_len, int M_MIN, int N_MIN)
{
int base_offset = M_base*N_len + N_base;
Loop_K:for(int i=0; i<M_MIN; i++)
DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_M)
Loop_N:for(int k=0; k<N_MIN; k++)
{
DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_N)
#pragma HLS PIPELINE II=1
C[base_offset + i*N_len + k] = C_local[i][k];
}
}
void DATAFLOW_Load_Compute(int C_local[TILE_M][TILE_N], int *A, int *B, int M, int N, int K, int kloops, int i, int j, int M_MIN, int N_MIN)
{
static int A_local[TILE_M][TILE_K];
#pragma HLS ARRAY_PARTITION variable=A_local complete dim=1
static int B_local[TILE_K][TILE_N];
#pragma HLS ARRAY_PARTITION variable=B_local complete dim=2
int K_MIN0[1], k0[1];
Loop_K:for(int k=0; k<kloops; k++)
{
DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=NUM_K)
#pragma HLS DATAFLOW
Load_AB_wrapper( A_local, B_local, A, B, K, N, i, j, k==0, M_MIN, N_MIN, K_MIN0, k0);
Compute_SA(A_local, B_local, C_local, k0[0]==0, M_MIN, N_MIN, K_MIN0[0], K);
}
}
void MUL(int *A, int *B, int *C, int M, int N, int K, int kloops)//A[MxK]*B[KxN]=C[MxN]
{
#pragma HLS INTERFACE m_axi depth=384 port=A offset=slave bundle=DB_A
#pragma HLS INTERFACE m_axi depth=768 port=B offset=slave bundle=DB_B
#pragma HLS INTERFACE m_axi depth=2048 port=C offset=slave bundle=DB_C
#pragma HLS INTERFACE s_axilite register port=return bundle=CB
#pragma HLS INTERFACE s_axilite register port=M bundle=CB
#pragma HLS INTERFACE s_axilite register port=N bundle=CB
#pragma HLS INTERFACE s_axilite register port=K bundle=CB
#pragma HLS INTERFACE s_axilite register port=kloops bundle=CB
#pragma HLS INTERFACE s_axilite register port=A bundle=CB
#pragma HLS INTERFACE s_axilite register port=B bundle=CB
#pragma HLS INTERFACE s_axilite register port=C bundle=CB
static int C_local[TILE_M][TILE_N];
#pragma HLS ARRAY_PARTITION variable=C_local complete dim=1
int M_MIN, N_MIN;
Loop_M:for(int i=0; i<M; i+= TILE_M)
{
DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=NUM_M)
M_MIN = MIN(TILE_M, M-i);
Loop_N:for(int j=0; j<N; j+= TILE_N)
{
DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=NUM_N)
N_MIN = MIN(TILE_N, N-j);
DATAFLOW_Load_Compute( C_local, A, B, M, N, K, kloops, i, j, M_MIN, N_MIN);
Store_C(C_local, C, i, j, N, M_MIN, N_MIN);
}
}
}
//////////////////////////////////////////v14 end////////////////////////////////////////
////////////////////////////////////////////v13 start////////////////////////////////////////
//
//typedef struct {
// int K_MIN;
// bool write_back;
// bool init;
//} cwrap_s;
//
//template<int MIN_R,int MID_C>
//void compute_pe(hls::stream<int> &A_in, hls::stream<int> &B_in, hls::stream<int> &C_in, hls::stream<int> &A_out, hls::stream<int> &B_out, hls::stream<int> &C_out, cwrap_s cws)
//{
// int K = cws.K_MIN;
// bool write_back = cws.write_back;
// bool init = cws.init;
//
//#pragma HLS INLINE off
// static int C_local;
// int A_tmp, B_tmp;
//
// if(init){
// C_local = 0;
// }
//
// for(int k=0; k<K; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
//#pragma HLS PIPELINE II=1
// A_in >> A_tmp;
// B_in >> B_tmp;
//
// C_local += A_tmp * B_tmp;
// A_out << A_tmp;
// B_out << B_tmp;
// }
//
// if(write_back){
// C_out.write(C_local);
// //tranfer neighbor PE's output
// for(int k=0; k<MID_C; k++){
//#pragma HLS PIPELINE II=1
// int tmp_in, tmp_out;
// C_in >> tmp_in;
// tmp_out = tmp_in;
// C_out << tmp_out;
// }
// }
//
// return;
//}
//
//void Drain(hls::stream<int> &in, int data_num)
//{
// int drain;
// for(int k = 0; k<data_num; k++){
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
//#pragma HLS PIPELINE II=1
// in >> drain;
// }
//}
//
//void Load_wrapper(int A_local[TILE_M][TILE_K], int B_local[TILE_K][TILE_N],
// hls::stream<int> Ain_s[TILE_M], hls::stream<int> Bin_s[TILE_N],
// hls::stream<cwrap_s> &cws0, bool init, int M_MIN, int N_MIN, int K_MIN, int K_MAX){
//
// static int K_cnt;
// if(init){
// K_cnt = 0;
// }
// K_cnt += K_MIN;
//
// for(int k=0; k<K_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
//#pragma HLS PIPELINE II=1
// for(int i=0; i<TILE_M; i++){
// int tmp = 0;
// if(i<M_MIN)
// tmp = A_local[i][k];
// Ain_s[i] << tmp;
// }
//
// for(int j=0; j<TILE_N; j++){
// int tmp = 0;
// if(j<N_MIN)
// tmp = B_local[k][j];
// Bin_s[j] << tmp;
// }
// }
//
// bool wb = (K_cnt == K_MAX);
//
// cwrap_s cws;
// cws.K_MIN = K_MIN;
// cws.write_back = wb;
// cws.init = init;
// cws0.write(cws);
//}
//
//void Compute_wrapper(hls::stream<int> Ain_s[TILE_M], hls::stream<int> Bin_s[TILE_N],
// hls::stream<int> Cout_s[TILE_M], hls::stream<cwrap_s> &cws0, hls::stream<bool> &wb1){
//
// hls::stream<int> A_inter[TILE_M][TILE_N+1];
//#pragma HLS STREAM variable=A_inter dim=1 depth=DEPTH_TILE_K
//#pragma HLS STREAM variable=A_inter dim=2 depth=DEPTH_TILE_K
// hls::stream<int> B_inter[TILE_M+1][TILE_N];
//#pragma HLS STREAM variable=B_inter dim=1 depth=DEPTH_TILE_K
//#pragma HLS STREAM variable=B_inter dim=2 depth=DEPTH_TILE_K
// hls::stream<int> C_out[TILE_M][TILE_N+1];
//#pragma HLS STREAM variable=C_out dim=1 depth=DEPTH_TILE_N
//#pragma HLS STREAM variable=C_out dim=2 depth=DEPTH_TILE_N
//
// cwrap_s cws;
// cws = cws0.read();
//
// compute_pe<0, 0>( Ain_s[0], Bin_s[0], C_out[0][0], A_inter[0][1], B_inter[0+1][0], C_out[0][1], cws);
// compute_pe<0, 1>(A_inter[0][1], Bin_s[1], C_out[0][1], A_inter[0][2], B_inter[0+1][1], C_out[0][2], cws);
// compute_pe<0, 2>(A_inter[0][2], Bin_s[2], C_out[0][2], A_inter[0][3], B_inter[0+1][2], C_out[0][3], cws);
// compute_pe<0, 3>(A_inter[0][3], Bin_s[3], C_out[0][3], A_inter[0][4], B_inter[0+1][3], C_out[0][4], cws);
// compute_pe<0, 4>(A_inter[0][4], Bin_s[4], C_out[0][4], A_inter[0][5], B_inter[0+1][4], C_out[0][5], cws);
// compute_pe<0, 5>(A_inter[0][5], Bin_s[5], C_out[0][5], A_inter[0][6], B_inter[0+1][5], C_out[0][6], cws);
// compute_pe<0, 6>(A_inter[0][6], Bin_s[6], C_out[0][6], A_inter[0][7], B_inter[0+1][6], C_out[0][7], cws);
// compute_pe<0, 7>(A_inter[0][7], Bin_s[7], C_out[0][7], A_inter[0][8], B_inter[0+1][7], C_out[0][8], cws);
// compute_pe<0, 8>(A_inter[0][8], Bin_s[8], C_out[0][8], A_inter[0][9], B_inter[0+1][8], Cout_s[0], cws);
//
// compute_pe<1, 0>( Ain_s[1], B_inter[1][0], C_out[1][0], A_inter[1][1], B_inter[1+1][0], C_out[1][1], cws);
// compute_pe<1, 1>(A_inter[1][1], B_inter[1][1], C_out[1][1], A_inter[1][2], B_inter[1+1][1], C_out[1][2], cws);
// compute_pe<1, 2>(A_inter[1][2], B_inter[1][2], C_out[1][2], A_inter[1][3], B_inter[1+1][2], C_out[1][3], cws);
// compute_pe<1, 3>(A_inter[1][3], B_inter[1][3], C_out[1][3], A_inter[1][4], B_inter[1+1][3], C_out[1][4], cws);
// compute_pe<1, 4>(A_inter[1][4], B_inter[1][4], C_out[1][4], A_inter[1][5], B_inter[1+1][4], C_out[1][5], cws);
// compute_pe<1, 5>(A_inter[1][5], B_inter[1][5], C_out[1][5], A_inter[1][6], B_inter[1+1][5], C_out[1][6], cws);
// compute_pe<1, 6>(A_inter[1][6], B_inter[1][6], C_out[1][6], A_inter[1][7], B_inter[1+1][6], C_out[1][7], cws);
// compute_pe<1, 7>(A_inter[1][7], B_inter[1][7], C_out[1][7], A_inter[1][8], B_inter[1+1][7], C_out[1][8], cws);
// compute_pe<1, 8>(A_inter[1][8], B_inter[1][8], C_out[1][8], A_inter[1][9], B_inter[1+1][8], Cout_s[1], cws);
//
// compute_pe<2, 0>( Ain_s[2], B_inter[2][0], C_out[2][0], A_inter[2][1], B_inter[2+1][0], C_out[2][1], cws);
// compute_pe<2, 1>(A_inter[2][1], B_inter[2][1], C_out[2][1], A_inter[2][2], B_inter[2+1][1], C_out[2][2], cws);
// compute_pe<2, 2>(A_inter[2][2], B_inter[2][2], C_out[2][2], A_inter[2][3], B_inter[2+1][2], C_out[2][3], cws);
// compute_pe<2, 3>(A_inter[2][3], B_inter[2][3], C_out[2][3], A_inter[2][4], B_inter[2+1][3], C_out[2][4], cws);
// compute_pe<2, 4>(A_inter[2][4], B_inter[2][4], C_out[2][4], A_inter[2][5], B_inter[2+1][4], C_out[2][5], cws);
// compute_pe<2, 5>(A_inter[2][5], B_inter[2][5], C_out[2][5], A_inter[2][6], B_inter[2+1][5], C_out[2][6], cws);
// compute_pe<2, 6>(A_inter[2][6], B_inter[2][6], C_out[2][6], A_inter[2][7], B_inter[2+1][6], C_out[2][7], cws);
// compute_pe<2, 7>(A_inter[2][7], B_inter[2][7], C_out[2][7], A_inter[2][8], B_inter[2+1][7], C_out[2][8], cws);
// compute_pe<2, 8>(A_inter[2][8], B_inter[2][8], C_out[2][8], A_inter[2][9], B_inter[2+1][8], Cout_s[2], cws);
//
// compute_pe<3, 0>( Ain_s[3], B_inter[3][0], C_out[3][0], A_inter[3][1], B_inter[3+1][0], C_out[3][1], cws);
// compute_pe<3, 1>(A_inter[3][1], B_inter[3][1], C_out[3][1], A_inter[3][2], B_inter[3+1][1], C_out[3][2], cws);
// compute_pe<3, 2>(A_inter[3][2], B_inter[3][2], C_out[3][2], A_inter[3][3], B_inter[3+1][2], C_out[3][3], cws);
// compute_pe<3, 3>(A_inter[3][3], B_inter[3][3], C_out[3][3], A_inter[3][4], B_inter[3+1][3], C_out[3][4], cws);
// compute_pe<3, 4>(A_inter[3][4], B_inter[3][4], C_out[3][4], A_inter[3][5], B_inter[3+1][4], C_out[3][5], cws);
// compute_pe<3, 5>(A_inter[3][5], B_inter[3][5], C_out[3][5], A_inter[3][6], B_inter[3+1][5], C_out[3][6], cws);
// compute_pe<3, 6>(A_inter[3][6], B_inter[3][6], C_out[3][6], A_inter[3][7], B_inter[3+1][6], C_out[3][7], cws);
// compute_pe<3, 7>(A_inter[3][7], B_inter[3][7], C_out[3][7], A_inter[3][8], B_inter[3+1][7], C_out[3][8], cws);
// compute_pe<3, 8>(A_inter[3][8], B_inter[3][8], C_out[3][8], A_inter[3][9], B_inter[3+1][8], Cout_s[3], cws);
//
// compute_pe<4, 0>( Ain_s[4], B_inter[4][0], C_out[4][0], A_inter[4][1], B_inter[4+1][0], C_out[4][1], cws);
// compute_pe<4, 1>(A_inter[4][1], B_inter[4][1], C_out[4][1], A_inter[4][2], B_inter[4+1][1], C_out[4][2], cws);
// compute_pe<4, 2>(A_inter[4][2], B_inter[4][2], C_out[4][2], A_inter[4][3], B_inter[4+1][2], C_out[4][3], cws);
// compute_pe<4, 3>(A_inter[4][3], B_inter[4][3], C_out[4][3], A_inter[4][4], B_inter[4+1][3], C_out[4][4], cws);
// compute_pe<4, 4>(A_inter[4][4], B_inter[4][4], C_out[4][4], A_inter[4][5], B_inter[4+1][4], C_out[4][5], cws);
// compute_pe<4, 5>(A_inter[4][5], B_inter[4][5], C_out[4][5], A_inter[4][6], B_inter[4+1][5], C_out[4][6], cws);
// compute_pe<4, 6>(A_inter[4][6], B_inter[4][6], C_out[4][6], A_inter[4][7], B_inter[4+1][6], C_out[4][7], cws);
// compute_pe<4, 7>(A_inter[4][7], B_inter[4][7], C_out[4][7], A_inter[4][8], B_inter[4+1][7], C_out[4][8], cws);
// compute_pe<4, 8>(A_inter[4][8], B_inter[4][8], C_out[4][8], A_inter[4][9], B_inter[4+1][8], Cout_s[4], cws);
//
// compute_pe<5, 0>( Ain_s[5], B_inter[5][0], C_out[5][0], A_inter[5][1], B_inter[5+1][0], C_out[5][1], cws);
// compute_pe<5, 1>(A_inter[5][1], B_inter[5][1], C_out[5][1], A_inter[5][2], B_inter[5+1][1], C_out[5][2], cws);
// compute_pe<5, 2>(A_inter[5][2], B_inter[5][2], C_out[5][2], A_inter[5][3], B_inter[5+1][2], C_out[5][3], cws);
// compute_pe<5, 3>(A_inter[5][3], B_inter[5][3], C_out[5][3], A_inter[5][4], B_inter[5+1][3], C_out[5][4], cws);
// compute_pe<5, 4>(A_inter[5][4], B_inter[5][4], C_out[5][4], A_inter[5][5], B_inter[5+1][4], C_out[5][5], cws);
// compute_pe<5, 5>(A_inter[5][5], B_inter[5][5], C_out[5][5], A_inter[5][6], B_inter[5+1][5], C_out[5][6], cws);
// compute_pe<5, 6>(A_inter[5][6], B_inter[5][6], C_out[5][6], A_inter[5][7], B_inter[5+1][6], C_out[5][7], cws);
// compute_pe<5, 7>(A_inter[5][7], B_inter[5][7], C_out[5][7], A_inter[5][8], B_inter[5+1][7], C_out[5][8], cws);
// compute_pe<5, 8>(A_inter[5][8], B_inter[5][8], C_out[5][8], A_inter[5][9], B_inter[5+1][8], Cout_s[5], cws);
//
// compute_pe<6, 0>( Ain_s[6], B_inter[6][0], C_out[6][0], A_inter[6][1], B_inter[6+1][0], C_out[6][1], cws);
// compute_pe<6, 1>(A_inter[6][1], B_inter[6][1], C_out[6][1], A_inter[6][2], B_inter[6+1][1], C_out[6][2], cws);
// compute_pe<6, 2>(A_inter[6][2], B_inter[6][2], C_out[6][2], A_inter[6][3], B_inter[6+1][2], C_out[6][3], cws);
// compute_pe<6, 3>(A_inter[6][3], B_inter[6][3], C_out[6][3], A_inter[6][4], B_inter[6+1][3], C_out[6][4], cws);
// compute_pe<6, 4>(A_inter[6][4], B_inter[6][4], C_out[6][4], A_inter[6][5], B_inter[6+1][4], C_out[6][5], cws);
// compute_pe<6, 5>(A_inter[6][5], B_inter[6][5], C_out[6][5], A_inter[6][6], B_inter[6+1][5], C_out[6][6], cws);
// compute_pe<6, 6>(A_inter[6][6], B_inter[6][6], C_out[6][6], A_inter[6][7], B_inter[6+1][6], C_out[6][7], cws);
// compute_pe<6, 7>(A_inter[6][7], B_inter[6][7], C_out[6][7], A_inter[6][8], B_inter[6+1][7], C_out[6][8], cws);
// compute_pe<6, 8>(A_inter[6][8], B_inter[6][8], C_out[6][8], A_inter[6][9], B_inter[6+1][8], Cout_s[6], cws);
//
//// Loop_M:for(int i=0; i<TILE_M; i++)
//// {
////#pragma HLS UNROLL
//// compute_pe<0, 0>(A_inter[i][0], B_inter[i][0], A_inter[i][1], B_inter[i+1][0], C_out[i][0], K_MIN, K_MAX, init, &C_local_array[i][0], &k_cnt_array[i][0]);
//// compute_pe<0, 1>(A_inter[i][1], B_inter[i][1], A_inter[i][2], B_inter[i+1][1], C_out[i][1], K_MIN, K_MAX, init, &C_local_array[i][1], &k_cnt_array[i][1]);
//// compute_pe<0, 2>(A_inter[i][2], B_inter[i][2], A_inter[i][3], B_inter[i+1][2], C_out[i][2], K_MIN, K_MAX, init, &C_local_array[i][2], &k_cnt_array[i][2]);
//// compute_pe<0, 3>(A_inter[i][3], B_inter[i][3], A_inter[i][4], B_inter[i+1][3], C_out[i][3], K_MIN, K_MAX, init, &C_local_array[i][3], &k_cnt_array[i][3]);
//// compute_pe<0, 4>(A_inter[i][4], B_inter[i][4], A_inter[i][5], B_inter[i+1][4], C_out[i][4], K_MIN, K_MAX, init, &C_local_array[i][4], &k_cnt_array[i][4]);
//// compute_pe<0, 5>(A_inter[i][5], B_inter[i][5], A_inter[i][6], B_inter[i+1][5], C_out[i][5], K_MIN, K_MAX, init, &C_local_array[i][5], &k_cnt_array[i][5]);
//// compute_pe<0, 6>(A_inter[i][6], B_inter[i][6], A_inter[i][7], B_inter[i+1][6], C_out[i][6], K_MIN, K_MAX, init, &C_local_array[i][6], &k_cnt_array[i][6]);
//// compute_pe<0, 7>(A_inter[i][7], B_inter[i][7], A_inter[i][8], B_inter[i+1][7], C_out[i][7], K_MIN, K_MAX, init, &C_local_array[i][7], &k_cnt_array[i][7]);
//// compute_pe<0, 8>(A_inter[i][8], B_inter[i][8], A_inter[i][9], B_inter[i+1][8], C_out[i][8], K_MIN, K_MAX, init, &C_local_array[i][8], &k_cnt_array[i][8]);
//// }
//
//// Loop_M:for(int i=0; i<TILE_M; i++)
//// {
////#pragma HLS UNROLL
//// Loop_N:for(int j=0; j<TILE_N; j++)
//// {
////#pragma HLS UNROLL
//// PE_array[i][j].compute(A_inter[i][j], B_inter[i][j], A_inter[i][j+1], B_inter[i+1][j], C_out[i][j], K_MIN, K_MAX, init);
//// }
//// }
//
// DRAIN_AB:{
// for(int i=0; i<TILE_M; i++)
// {
//#pragma HLS UNROLL
// Drain(A_inter[i][TILE_N], cws.K_MIN);
// }
//
// for(int j=0; j<TILE_N; j++)
// {
//#pragma HLS UNROLL
// Drain(B_inter[TILE_M][j], cws.K_MIN);
// }
// }
//
// wb1.write(cws.write_back);
//}
//
//void Write_wrapper(int C_local[TILE_M][TILE_N], hls::stream<int> Cout_s[TILE_M], int M_MIN, int N_MIN, int K_MIN, hls::stream<bool> &wb1)
//{
// bool write_back = wb1.read();
// if(write_back){
// for(int j=0; j<TILE_N; j++){
//#pragma HLS PIPELINE II=1
// for(int i=0; i<TILE_M; i++)
// {
// int tmp_out;
// Cout_s[i] >> tmp_out;
// C_local[i][TILE_N-1-j] = tmp_out;
// }
// }
// }
//}
//
//void Compute_SA(int A_local[TILE_M][TILE_K], int B_local[TILE_K][TILE_N], int C_local[TILE_M][TILE_N], bool init, int M_MIN, int N_MIN, int K_MIN, int K_MAX)
//{
//
//#pragma HLS DATAFLOW
//
// hls::stream<int> Ain_s[TILE_M];
//#pragma HLS STREAM variable=Ain_s depth=DEPTH_TILE_K
////DO_PRAGMA(#pragma HLS STREAM variable=Ain_s depth=TILE_K)
// hls::stream<int> Bin_s[TILE_N];
//#pragma HLS STREAM variable=Bin_s depth=DEPTH_TILE_K
////DO_PRAGMA(#pragma HLS STREAM variable=Bin_s depth=TILE_K)
// hls::stream<int> Cout_s[TILE_M];
//#pragma HLS STREAM variable=Cout_s depth=DEPTH_TILE_N
////DO_PRAGMA(#pragma HLS STREAM variable=Cout_s depth=TILE_N)
//
// hls::stream<cwrap_s> cws0;
// hls::stream<bool> wb1;
//
// Load_wrapper( A_local, B_local, Ain_s, Bin_s, cws0, init, M_MIN, N_MIN, K_MIN, K_MAX);
//
// Compute_wrapper( Ain_s, Bin_s, Cout_s, cws0, wb1);
//
// Write_wrapper( C_local, Cout_s, M_MIN, N_MIN, K_MIN, wb1);
//
//}
//
//void Load_A(int A_local[TILE_M][TILE_K], int *A, int M_base, int K_base, int K_len, int M_MIN, int K_MIN)
//{
// int base_offset = M_base*K_len + K_base;
// Loop_M:for(int i=0; i<M_MIN; i++)
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_M)
// Loop_K:for(int k=0; k<K_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
//#pragma HLS PIPELINE II=1
// A_local[i][k] = A[base_offset + i*K_len + k];
// }
//}
//
//void Load_B(int B_local[TILE_K][TILE_N], int *B, int K_base, int N_base, int N_len, int K_MIN, int N_MIN)
//{
// int base_offset = K_base*N_len + N_base;
// Loop_K:for(int i=0; i<K_MIN; i++)
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
// Loop_N:for(int k=0; k<N_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_N)
//#pragma HLS PIPELINE II=1
// B_local[i][k] = B[base_offset + i*N_len + k];
// }
//}
//
//void Load_AB_wrapper(int A_local[TILE_M][TILE_K], int B_local[TILE_K][TILE_N], int *A, int *B,
// int K, int N, int i, int j, bool k_init, int M_MIN, int N_MIN, int K_MIN0[1], int k0[1])
//{
//
// static int k;
// if(k_init){
// k = 0;
// }else{
// k += TILE_K;
// }
//
// int K_MIN = MIN(TILE_K, K-k);
//
// Load_A(A_local, A, i, k, K, M_MIN, K_MIN);
// Load_B(B_local, B, k, j, N, K_MIN, N_MIN);
//
// K_MIN0[0] = K_MIN;
// k0[0] = k;
//}
//
//void Store_C(int C_local[TILE_M][TILE_N], int *C, int M_base, int N_base, int N_len, int M_MIN, int N_MIN)
//{
// int base_offset = M_base*N_len + N_base;
// Loop_K:for(int i=0; i<M_MIN; i++)
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_M)
// Loop_N:for(int k=0; k<N_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_N)
//#pragma HLS PIPELINE II=1
// C[base_offset + i*N_len + k] = C_local[i][k];
// }
//}
//
//void DATAFLOW_Load_Compute(int C_local[TILE_M][TILE_N], int *A, int *B, int M, int N, int K, int kloops, int i, int j, int M_MIN, int N_MIN)
//{
// static int A_local[TILE_M][TILE_K];
//#pragma HLS ARRAY_PARTITION variable=A_local complete dim=1
// static int B_local[TILE_K][TILE_N];
//#pragma HLS ARRAY_PARTITION variable=B_local complete dim=2
//
// int K_MIN0[1], k0[1];
//
// Loop_K:for(int k=0; k<kloops; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=NUM_K)
//#pragma HLS DATAFLOW
// Load_AB_wrapper( A_local, B_local, A, B, K, N, i, j, k==0, M_MIN, N_MIN, K_MIN0, k0);
//
// Compute_SA(A_local, B_local, C_local, k0[0]==0, M_MIN, N_MIN, K_MIN0[0], K);
// }
//}
//
//void MUL(int *A, int *B, int *C, int M, int N, int K, int kloops)//A[MxK]*B[KxN]=C[MxN]
//{
//#pragma HLS INTERFACE m_axi depth=384 port=A offset=slave bundle=DB_A
//#pragma HLS INTERFACE m_axi depth=768 port=B offset=slave bundle=DB_B
//#pragma HLS INTERFACE m_axi depth=2048 port=C offset=slave bundle=DB_C
//
//#pragma HLS INTERFACE s_axilite register port=return bundle=CB
//#pragma HLS INTERFACE s_axilite register port=M bundle=CB
//#pragma HLS INTERFACE s_axilite register port=N bundle=CB
//#pragma HLS INTERFACE s_axilite register port=K bundle=CB
//#pragma HLS INTERFACE s_axilite register port=kloops bundle=CB
//
//#pragma HLS INTERFACE s_axilite register port=A bundle=CB
//#pragma HLS INTERFACE s_axilite register port=B bundle=CB
//#pragma HLS INTERFACE s_axilite register port=C bundle=CB
//
// static int C_local[TILE_M][TILE_N];
//#pragma HLS ARRAY_PARTITION variable=C_local complete dim=1
//
// int M_MIN, N_MIN;
//
// Loop_M:for(int i=0; i<M; i+= TILE_M)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=NUM_M)
// M_MIN = MIN(TILE_M, M-i);
// Loop_N:for(int j=0; j<N; j+= TILE_N)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=NUM_N)
// N_MIN = MIN(TILE_N, N-j);
//
// DATAFLOW_Load_Compute( C_local, A, B, M, N, K, kloops, i, j, M_MIN, N_MIN);
//
// Store_C(C_local, C, i, j, N, M_MIN, N_MIN);
// }
// }
//}
////////////////////////////////////////////v13 end////////////////////////////////////////
////////////////////////////////////////////v12 start////////////////////////////////////////
//template<int MIN_R,int MID_C>
//void compute_pe(hls::stream<int> &A_in, hls::stream<int> &B_in, hls::stream<int> &A_out, hls::stream<int> &B_out, hls::stream<int> &C_out, int K, bool write_back, bool init)
//{
//#pragma HLS INLINE off
// static int C_local;
// int A_tmp, B_tmp;
//
// if(init){
// C_local = 0;
// }
//
// for(int k=0; k<K; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
//#pragma HLS PIPELINE II=1
// A_in >> A_tmp;
// B_in >> B_tmp;
//
// C_local += A_tmp * B_tmp;
// A_out << A_tmp;
// B_out << B_tmp;
// }
//
// if(write_back){
// C_out.write(C_local);
// }
//
// return;
//}
//
//void Drain(hls::stream<int> &in, int data_num)
//{
// int drain;
// for(int k = 0; k<data_num; k++){
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
//#pragma HLS PIPELINE II=1
// in >> drain;
// }
//}
//
//void Load_wrapper(int A_local[TILE_M][TILE_K], int B_local[TILE_K][TILE_N],
// hls::stream<int> Ain_s[TILE_M], hls::stream<int> Bin_s[TILE_N],
// int *K_cnt0, bool *init0, bool init, int M_MIN, int N_MIN, int K_MIN){
//
// static int K_cnt;
// if(init){
// K_cnt = 0;
// }
// K_cnt += K_MIN;
//
// for(int k=0; k<K_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
//#pragma HLS PIPELINE II=1
// for(int i=0; i<TILE_M; i++){
// int tmp = 0;
// if(i<M_MIN)
// tmp = A_local[i][k];
// Ain_s[i] << tmp;
// }
//
// for(int j=0; j<TILE_N; j++){
// int tmp = 0;
// if(j<N_MIN)
// tmp = B_local[k][j];
// Bin_s[j] << tmp;
// }
// }
//
// *K_cnt0 = K_cnt;
// *init0 = init;
//}
//
//void Compute_wrapper(hls::stream<int> Ain_s[TILE_M], hls::stream<int> Bin_s[TILE_N],
// hls::stream<int> Cout_s[TILE_M], bool init, int K_MIN, int K_MAX, int K_cnt, int *K_cnt1){
//
// hls::stream<int> A_inter[TILE_M][TILE_N+1];
//#pragma HLS STREAM variable=A_inter dim=1 depth=DEPTH_TILE_K
//#pragma HLS STREAM variable=A_inter dim=2 depth=DEPTH_TILE_K
// hls::stream<int> B_inter[TILE_M+1][TILE_N];
//#pragma HLS STREAM variable=B_inter dim=1 depth=DEPTH_TILE_K
//#pragma HLS STREAM variable=B_inter dim=2 depth=DEPTH_TILE_K
//hls::stream<int> C_out[TILE_M][TILE_N+1];
//#pragma HLS STREAM variable=C_out dim=1 depth=DEPTH_TILE_N
//#pragma HLS STREAM variable=C_out dim=2 depth=DEPTH_TILE_N
//
// bool write_back = (K_cnt == K_MAX);
//
////#pragma HLS DATAFLOW
// LOAD_AB:for(int k=0; k<K_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
//#pragma HLS PIPELINE II=1
// for(int i=0; i<TILE_M; i++){
// int tmp = Ain_s[i].read();
// A_inter[i][0].write(tmp);
// }
//
// for(int j=0; j<TILE_N; j++){
// int tmp = Bin_s[j].read();
// B_inter[0][j].write(tmp);
// }
// }
//
// COMPUTE_C:{
// compute_pe<0, 0>(A_inter[0][0], B_inter[0][0], A_inter[0][1], B_inter[0+1][0], C_out[0][0], K_MIN, write_back, init);
// compute_pe<0, 1>(A_inter[0][1], B_inter[0][1], A_inter[0][2], B_inter[0+1][1], C_out[0][1], K_MIN, write_back, init);
// compute_pe<0, 2>(A_inter[0][2], B_inter[0][2], A_inter[0][3], B_inter[0+1][2], C_out[0][2], K_MIN, write_back, init);
// compute_pe<0, 3>(A_inter[0][3], B_inter[0][3], A_inter[0][4], B_inter[0+1][3], C_out[0][3], K_MIN, write_back, init);
// compute_pe<0, 4>(A_inter[0][4], B_inter[0][4], A_inter[0][5], B_inter[0+1][4], C_out[0][4], K_MIN, write_back, init);
// compute_pe<0, 5>(A_inter[0][5], B_inter[0][5], A_inter[0][6], B_inter[0+1][5], C_out[0][5], K_MIN, write_back, init);
// compute_pe<0, 6>(A_inter[0][6], B_inter[0][6], A_inter[0][7], B_inter[0+1][6], C_out[0][6], K_MIN, write_back, init);
// compute_pe<0, 7>(A_inter[0][7], B_inter[0][7], A_inter[0][8], B_inter[0+1][7], C_out[0][7], K_MIN, write_back, init);
// compute_pe<0, 8>(A_inter[0][8], B_inter[0][8], A_inter[0][9], B_inter[0+1][8], C_out[0][8], K_MIN, write_back, init);
//
// compute_pe<1, 0>(A_inter[1][0], B_inter[1][0], A_inter[1][1], B_inter[1+1][0], C_out[1][0], K_MIN, write_back, init);
// compute_pe<1, 1>(A_inter[1][1], B_inter[1][1], A_inter[1][2], B_inter[1+1][1], C_out[1][1], K_MIN, write_back, init);
// compute_pe<1, 2>(A_inter[1][2], B_inter[1][2], A_inter[1][3], B_inter[1+1][2], C_out[1][2], K_MIN, write_back, init);
// compute_pe<1, 3>(A_inter[1][3], B_inter[1][3], A_inter[1][4], B_inter[1+1][3], C_out[1][3], K_MIN, write_back, init);
// compute_pe<1, 4>(A_inter[1][4], B_inter[1][4], A_inter[1][5], B_inter[1+1][4], C_out[1][4], K_MIN, write_back, init);
// compute_pe<1, 5>(A_inter[1][5], B_inter[1][5], A_inter[1][6], B_inter[1+1][5], C_out[1][5], K_MIN, write_back, init);
// compute_pe<1, 6>(A_inter[1][6], B_inter[1][6], A_inter[1][7], B_inter[1+1][6], C_out[1][6], K_MIN, write_back, init);
// compute_pe<1, 7>(A_inter[1][7], B_inter[1][7], A_inter[1][8], B_inter[1+1][7], C_out[1][7], K_MIN, write_back, init);
// compute_pe<1, 8>(A_inter[1][8], B_inter[1][8], A_inter[1][9], B_inter[1+1][8], C_out[1][8], K_MIN, write_back, init);
//
// compute_pe<2, 0>(A_inter[2][0], B_inter[2][0], A_inter[2][1], B_inter[2+1][0], C_out[2][0], K_MIN, write_back, init);
// compute_pe<2, 1>(A_inter[2][1], B_inter[2][1], A_inter[2][2], B_inter[2+1][1], C_out[2][1], K_MIN, write_back, init);
// compute_pe<2, 2>(A_inter[2][2], B_inter[2][2], A_inter[2][3], B_inter[2+1][2], C_out[2][2], K_MIN, write_back, init);
// compute_pe<2, 3>(A_inter[2][3], B_inter[2][3], A_inter[2][4], B_inter[2+1][3], C_out[2][3], K_MIN, write_back, init);
// compute_pe<2, 4>(A_inter[2][4], B_inter[2][4], A_inter[2][5], B_inter[2+1][4], C_out[2][4], K_MIN, write_back, init);
// compute_pe<2, 5>(A_inter[2][5], B_inter[2][5], A_inter[2][6], B_inter[2+1][5], C_out[2][5], K_MIN, write_back, init);
// compute_pe<2, 6>(A_inter[2][6], B_inter[2][6], A_inter[2][7], B_inter[2+1][6], C_out[2][6], K_MIN, write_back, init);
// compute_pe<2, 7>(A_inter[2][7], B_inter[2][7], A_inter[2][8], B_inter[2+1][7], C_out[2][7], K_MIN, write_back, init);
// compute_pe<2, 8>(A_inter[2][8], B_inter[2][8], A_inter[2][9], B_inter[2+1][8], C_out[2][8], K_MIN, write_back, init);
//
// compute_pe<3, 0>(A_inter[3][0], B_inter[3][0], A_inter[3][1], B_inter[3+1][0], C_out[3][0], K_MIN, write_back, init);
// compute_pe<3, 1>(A_inter[3][1], B_inter[3][1], A_inter[3][2], B_inter[3+1][1], C_out[3][1], K_MIN, write_back, init);
// compute_pe<3, 2>(A_inter[3][2], B_inter[3][2], A_inter[3][3], B_inter[3+1][2], C_out[3][2], K_MIN, write_back, init);
// compute_pe<3, 3>(A_inter[3][3], B_inter[3][3], A_inter[3][4], B_inter[3+1][3], C_out[3][3], K_MIN, write_back, init);
// compute_pe<3, 4>(A_inter[3][4], B_inter[3][4], A_inter[3][5], B_inter[3+1][4], C_out[3][4], K_MIN, write_back, init);
// compute_pe<3, 5>(A_inter[3][5], B_inter[3][5], A_inter[3][6], B_inter[3+1][5], C_out[3][5], K_MIN, write_back, init);
// compute_pe<3, 6>(A_inter[3][6], B_inter[3][6], A_inter[3][7], B_inter[3+1][6], C_out[3][6], K_MIN, write_back, init);
// compute_pe<3, 7>(A_inter[3][7], B_inter[3][7], A_inter[3][8], B_inter[3+1][7], C_out[3][7], K_MIN, write_back, init);
// compute_pe<3, 8>(A_inter[3][8], B_inter[3][8], A_inter[3][9], B_inter[3+1][8], C_out[3][8], K_MIN, write_back, init);
//
// compute_pe<4, 0>(A_inter[4][0], B_inter[4][0], A_inter[4][1], B_inter[4+1][0], C_out[4][0], K_MIN, write_back, init);
// compute_pe<4, 1>(A_inter[4][1], B_inter[4][1], A_inter[4][2], B_inter[4+1][1], C_out[4][1], K_MIN, write_back, init);
// compute_pe<4, 2>(A_inter[4][2], B_inter[4][2], A_inter[4][3], B_inter[4+1][2], C_out[4][2], K_MIN, write_back, init);
// compute_pe<4, 3>(A_inter[4][3], B_inter[4][3], A_inter[4][4], B_inter[4+1][3], C_out[4][3], K_MIN, write_back, init);
// compute_pe<4, 4>(A_inter[4][4], B_inter[4][4], A_inter[4][5], B_inter[4+1][4], C_out[4][4], K_MIN, write_back, init);
// compute_pe<4, 5>(A_inter[4][5], B_inter[4][5], A_inter[4][6], B_inter[4+1][5], C_out[4][5], K_MIN, write_back, init);
// compute_pe<4, 6>(A_inter[4][6], B_inter[4][6], A_inter[4][7], B_inter[4+1][6], C_out[4][6], K_MIN, write_back, init);
// compute_pe<4, 7>(A_inter[4][7], B_inter[4][7], A_inter[4][8], B_inter[4+1][7], C_out[4][7], K_MIN, write_back, init);
// compute_pe<4, 8>(A_inter[4][8], B_inter[4][8], A_inter[4][9], B_inter[4+1][8], C_out[4][8], K_MIN, write_back, init);
//
// compute_pe<5, 0>(A_inter[5][0], B_inter[5][0], A_inter[5][1], B_inter[5+1][0], C_out[5][0], K_MIN, write_back, init);
// compute_pe<5, 1>(A_inter[5][1], B_inter[5][1], A_inter[5][2], B_inter[5+1][1], C_out[5][1], K_MIN, write_back, init);
// compute_pe<5, 2>(A_inter[5][2], B_inter[5][2], A_inter[5][3], B_inter[5+1][2], C_out[5][2], K_MIN, write_back, init);
// compute_pe<5, 3>(A_inter[5][3], B_inter[5][3], A_inter[5][4], B_inter[5+1][3], C_out[5][3], K_MIN, write_back, init);
// compute_pe<5, 4>(A_inter[5][4], B_inter[5][4], A_inter[5][5], B_inter[5+1][4], C_out[5][4], K_MIN, write_back, init);
// compute_pe<5, 5>(A_inter[5][5], B_inter[5][5], A_inter[5][6], B_inter[5+1][5], C_out[5][5], K_MIN, write_back, init);
// compute_pe<5, 6>(A_inter[5][6], B_inter[5][6], A_inter[5][7], B_inter[5+1][6], C_out[5][6], K_MIN, write_back, init);
// compute_pe<5, 7>(A_inter[5][7], B_inter[5][7], A_inter[5][8], B_inter[5+1][7], C_out[5][7], K_MIN, write_back, init);
// compute_pe<5, 8>(A_inter[5][8], B_inter[5][8], A_inter[5][9], B_inter[5+1][8], C_out[5][8], K_MIN, write_back, init);
//
// compute_pe<6, 0>(A_inter[6][0], B_inter[6][0], A_inter[6][1], B_inter[6+1][0], C_out[6][0], K_MIN, write_back, init);
// compute_pe<6, 1>(A_inter[6][1], B_inter[6][1], A_inter[6][2], B_inter[6+1][1], C_out[6][1], K_MIN, write_back, init);
// compute_pe<6, 2>(A_inter[6][2], B_inter[6][2], A_inter[6][3], B_inter[6+1][2], C_out[6][2], K_MIN, write_back, init);
// compute_pe<6, 3>(A_inter[6][3], B_inter[6][3], A_inter[6][4], B_inter[6+1][3], C_out[6][3], K_MIN, write_back, init);
// compute_pe<6, 4>(A_inter[6][4], B_inter[6][4], A_inter[6][5], B_inter[6+1][4], C_out[6][4], K_MIN, write_back, init);
// compute_pe<6, 5>(A_inter[6][5], B_inter[6][5], A_inter[6][6], B_inter[6+1][5], C_out[6][5], K_MIN, write_back, init);
// compute_pe<6, 6>(A_inter[6][6], B_inter[6][6], A_inter[6][7], B_inter[6+1][6], C_out[6][6], K_MIN, write_back, init);
// compute_pe<6, 7>(A_inter[6][7], B_inter[6][7], A_inter[6][8], B_inter[6+1][7], C_out[6][7], K_MIN, write_back, init);
// compute_pe<6, 8>(A_inter[6][8], B_inter[6][8], A_inter[6][9], B_inter[6+1][8], C_out[6][8], K_MIN, write_back, init);
// }
//
//// Loop_M:for(int i=0; i<TILE_M; i++)
//// {
////#pragma HLS UNROLL
//// compute_pe<0, 0>(A_inter[i][0], B_inter[i][0], A_inter[i][1], B_inter[i+1][0], C_out[i][0], K_MIN, K_MAX, init, &C_local_array[i][0], &k_cnt_array[i][0]);
//// compute_pe<0, 1>(A_inter[i][1], B_inter[i][1], A_inter[i][2], B_inter[i+1][1], C_out[i][1], K_MIN, K_MAX, init, &C_local_array[i][1], &k_cnt_array[i][1]);
//// compute_pe<0, 2>(A_inter[i][2], B_inter[i][2], A_inter[i][3], B_inter[i+1][2], C_out[i][2], K_MIN, K_MAX, init, &C_local_array[i][2], &k_cnt_array[i][2]);
//// compute_pe<0, 3>(A_inter[i][3], B_inter[i][3], A_inter[i][4], B_inter[i+1][3], C_out[i][3], K_MIN, K_MAX, init, &C_local_array[i][3], &k_cnt_array[i][3]);
//// compute_pe<0, 4>(A_inter[i][4], B_inter[i][4], A_inter[i][5], B_inter[i+1][4], C_out[i][4], K_MIN, K_MAX, init, &C_local_array[i][4], &k_cnt_array[i][4]);
//// compute_pe<0, 5>(A_inter[i][5], B_inter[i][5], A_inter[i][6], B_inter[i+1][5], C_out[i][5], K_MIN, K_MAX, init, &C_local_array[i][5], &k_cnt_array[i][5]);
//// compute_pe<0, 6>(A_inter[i][6], B_inter[i][6], A_inter[i][7], B_inter[i+1][6], C_out[i][6], K_MIN, K_MAX, init, &C_local_array[i][6], &k_cnt_array[i][6]);
//// compute_pe<0, 7>(A_inter[i][7], B_inter[i][7], A_inter[i][8], B_inter[i+1][7], C_out[i][7], K_MIN, K_MAX, init, &C_local_array[i][7], &k_cnt_array[i][7]);
//// compute_pe<0, 8>(A_inter[i][8], B_inter[i][8], A_inter[i][9], B_inter[i+1][8], C_out[i][8], K_MIN, K_MAX, init, &C_local_array[i][8], &k_cnt_array[i][8]);
//// }
//
//// Loop_M:for(int i=0; i<TILE_M; i++)
//// {
////#pragma HLS UNROLL
//// Loop_N:for(int j=0; j<TILE_N; j++)
//// {
////#pragma HLS UNROLL
//// PE_array[i][j].compute(A_inter[i][j], B_inter[i][j], A_inter[i][j+1], B_inter[i+1][j], C_out[i][j], K_MIN, K_MAX, init);
//// }
//// }
//
// DRAIN_AB:{
// for(int i=0; i<TILE_M; i++)
// {
//#pragma HLS UNROLL
// Drain(A_inter[i][TILE_N], K_MIN);
// }
//
// for(int j=0; j<TILE_N; j++)
// {
//#pragma HLS UNROLL
// Drain(B_inter[TILE_M][j], K_MIN);
// }
// }
//
// if(write_back){
////tranfer neighbor PE's output
// for(int j=TILE_N-1; j>-1; j--){
// for(int k=0; k<TILE_N-1-j; k++){
//#pragma HLS PIPELINE II=1
// for(int i=0; i<TILE_M; i++){
// int tmp_in, tmp_out;
// C_out[i][j+1] >> tmp_in;
// tmp_out = tmp_in;
// C_out[i][j] << tmp_out;
// }
// }
// }
//
// for(int i=0; i<TILE_M; i++)
// {
//#pragma HLS UNROLL
// for(int j=0; j<TILE_N; j++){
//#pragma HLS PIPELINE II=1
// int tmp_in, tmp_out;
// C_out[i][0] >> tmp_in;
// tmp_out = tmp_in;
// Cout_s[i] << tmp_out;
// }
// }
// }
//
// *K_cnt1 = K_cnt;
//}
//
//void Write_wrapper(int C_local[TILE_M][TILE_N], hls::stream<int> Cout_s[TILE_M],
// int M_MIN, int N_MIN, int K_MIN, int K_cnt, int K_MAX){
// if(K_cnt == K_MAX){
// for(int j=0; j<TILE_N; j++){
//#pragma HLS PIPELINE II=1
// for(int i=0; i<TILE_M; i++)
// {
// int tmp_out;
// Cout_s[i] >> tmp_out;
// if((i < M_MIN) && (j < N_MIN))
// C_local[i][j] = tmp_out;
// }
// }
// }
//}
//
//void Compute_SA(int A_local[TILE_M][TILE_K], int B_local[TILE_K][TILE_N], int C_local[TILE_M][TILE_N], bool init, int M_MIN, int N_MIN, int K_MIN, int K_MAX)
//{
//
//#pragma HLS DATAFLOW
//
// hls::stream<int> Ain_s[TILE_M];
//#pragma HLS STREAM variable=Ain_s depth=DEPTH_TILE_K
////DO_PRAGMA(#pragma HLS STREAM variable=Ain_s depth=TILE_K)
// hls::stream<int> Bin_s[TILE_N];
//#pragma HLS STREAM variable=Bin_s depth=DEPTH_TILE_K
////DO_PRAGMA(#pragma HLS STREAM variable=Bin_s depth=TILE_K)
//hls::stream<int> Cout_s[TILE_M];
//#pragma HLS STREAM variable=Cout_s depth=DEPTH_TILE_N
////DO_PRAGMA(#pragma HLS STREAM variable=Cout_s depth=TILE_N)
//
// int K_cnt0[1], K_cnt1[1];
// bool init0[1];
//
// Load_wrapper( A_local, B_local, Ain_s, Bin_s, K_cnt0, init0, init, M_MIN, N_MIN, K_MIN);
//
// Compute_wrapper( Ain_s, Bin_s, Cout_s, init0[0], K_MIN, K_MAX, K_cnt0[0], K_cnt1);
//
// Write_wrapper( C_local, Cout_s, M_MIN, N_MIN, K_MIN, K_cnt1[0], K_MAX);
//
//}
//
//void Load_A(int A_local[TILE_M][TILE_K], int *A, int M_base, int K_base, int K_len, int M_MIN, int K_MIN)
//{
// int base_offset = M_base*K_len + K_base;
// Loop_M:for(int i=0; i<M_MIN; i++)
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_M)
// Loop_K:for(int k=0; k<K_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
//#pragma HLS PIPELINE II=1
// A_local[i][k] = A[base_offset + i*K_len + k];
// }
//}
//
//void Load_B(int B_local[TILE_K][TILE_N], int *B, int K_base, int N_base, int N_len, int K_MIN, int N_MIN)
//{
// int base_offset = K_base*N_len + N_base;
// Loop_K:for(int i=0; i<K_MIN; i++)
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
// Loop_N:for(int k=0; k<N_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_N)
//#pragma HLS PIPELINE II=1
// B_local[i][k] = B[base_offset + i*N_len + k];
// }
//}
//
//void Load_AB_wrapper(int A_local[TILE_M][TILE_K], int B_local[TILE_K][TILE_N], int *A, int *B,
// int K, int N, int i, int j, bool k_init, int M_MIN, int N_MIN, int K_MIN0[1], int k0[1])
//{
//
// static int k;
// if(k_init){
// k = 0;
// }else{
// k += TILE_K;
// }
//
// int K_MIN = MIN(TILE_K, K-k);
//
// Load_A(A_local, A, i, k, K, M_MIN, K_MIN);
// Load_B(B_local, B, k, j, N, K_MIN, N_MIN);
//
// K_MIN0[0] = K_MIN;
// k0[0] = k;
//}
//
//void Store_C(int C_local[TILE_M][TILE_N], int *C, int M_base, int N_base, int N_len, int M_MIN, int N_MIN)
//{
// int base_offset = M_base*N_len + N_base;
// Loop_K:for(int i=0; i<M_MIN; i++)
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_M)
// Loop_N:for(int k=0; k<N_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_N)
//#pragma HLS PIPELINE II=1
// C[base_offset + i*N_len + k] = C_local[i][k];
// }
//}
//
//void DATAFLOW_Load_Compute(int C_local[TILE_M][TILE_N], int *A, int *B, int M, int N, int K, int kloops, int i, int j, int M_MIN, int N_MIN)
//{
// static int A_local[TILE_M][TILE_K];
//#pragma HLS ARRAY_PARTITION variable=A_local complete dim=1
// static int B_local[TILE_K][TILE_N];
//#pragma HLS ARRAY_PARTITION variable=B_local complete dim=2
//
// int K_MIN0[1], k0[1];
//
// Loop_K:for(int k=0; k<kloops; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=NUM_K)
//#pragma HLS DATAFLOW
// Load_AB_wrapper( A_local, B_local, A, B, K, N, i, j, k==0, M_MIN, N_MIN, K_MIN0, k0);
//
// Compute_SA(A_local, B_local, C_local, k0[0]==0, M_MIN, N_MIN, K_MIN0[0], K);
// }
//}
//
//void MUL(int *A, int *B, int *C, int M, int N, int K, int kloops)//A[MxK]*B[KxN]=C[MxN]
//{
//#pragma HLS INTERFACE m_axi depth=384 port=A offset=slave bundle=DB_A
//#pragma HLS INTERFACE m_axi depth=768 port=B offset=slave bundle=DB_B
//#pragma HLS INTERFACE m_axi depth=2048 port=C offset=slave bundle=DB_C
//
//#pragma HLS INTERFACE s_axilite register port=return bundle=CB
//#pragma HLS INTERFACE s_axilite register port=M bundle=CB
//#pragma HLS INTERFACE s_axilite register port=N bundle=CB
//#pragma HLS INTERFACE s_axilite register port=K bundle=CB
//#pragma HLS INTERFACE s_axilite register port=kloops bundle=CB
//
//#pragma HLS INTERFACE s_axilite register port=A bundle=CB
//#pragma HLS INTERFACE s_axilite register port=B bundle=CB
//#pragma HLS INTERFACE s_axilite register port=C bundle=CB
//
// static int C_local[TILE_M][TILE_N];
//#pragma HLS ARRAY_PARTITION variable=C_local complete dim=1
//
// int M_MIN, N_MIN;
//
// Loop_M:for(int i=0; i<M; i+= TILE_M)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=NUM_M)
// M_MIN = MIN(TILE_M, M-i);
// Loop_N:for(int j=0; j<N; j+= TILE_N)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=NUM_N)
// N_MIN = MIN(TILE_N, N-j);
//
// DATAFLOW_Load_Compute( C_local, A, B, M, N, K, kloops, i, j, M_MIN, N_MIN);
//
// Store_C(C_local, C, i, j, N, M_MIN, N_MIN);
// }
// }
//}
////////////////////////////////////////////v12 end////////////////////////////////////////
////////////////////////////////////////////v11 start////////////////////////////////////////
//template<int MIN_R,int MID_C>
//void compute_pe(hls::stream<int> &A_in, hls::stream<int> &B_in, hls::stream<int> &A_out, hls::stream<int> &B_out, hls::stream<int> &C_out, int K, int K_MAX, bool init,
// int *C_local_array, int *k_cnt_array)
//{
//#pragma HLS INLINE off
// int C_local;
// int k_cnt;
//
// int A_tmp, B_tmp;
// if(init){
// C_local = 0;
// k_cnt = 0;
// }else
// {
// C_local = *C_local_array;
// k_cnt = *k_cnt_array;
// }
//
// for(int k=0; k<K; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
//#pragma HLS PIPELINE II=1
// A_in >> A_tmp;
// B_in >> B_tmp;
//
// C_local += A_tmp * B_tmp;
// A_out << A_tmp;
// B_out << B_tmp;
// k_cnt++;
// }
//
// if(k_cnt == K_MAX){
// C_out.write(C_local);
// }else{
// *C_local_array = C_local;
// *k_cnt_array = k_cnt;
// }
//
// return;
//}
//
//void Drain(hls::stream<int> &in, int data_num)
//{
// int drain;
// for(int k = 0; k<data_num; k++){
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
//#pragma HLS PIPELINE II=1
// in >> drain;
// }
//}
//
//void Load_wrapper(int A_local[TILE_M][TILE_K], int B_local[TILE_K][TILE_N],
// hls::stream<int> Ain_s[TILE_M], hls::stream<int> Bin_s[TILE_N],
// int *K_cnt0, bool *init0, bool init, int M_MIN, int N_MIN, int K_MIN){
//
// static int K_cnt;
// if(init){
// K_cnt = 0;
// }
// K_cnt += K_MIN;
//
// for(int k=0; k<K_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
//#pragma HLS PIPELINE II=1
// for(int i=0; i<TILE_M; i++){
// int tmp = 0;
// if(i<M_MIN)
// tmp = A_local[i][k];
// Ain_s[i] << tmp;
// }
//
// for(int j=0; j<TILE_N; j++){
// int tmp = 0;
// if(j<N_MIN)
// tmp = B_local[k][j];
// Bin_s[j] << tmp;
// }
// }
//
// *K_cnt0 = K_cnt;
// *init0 = init;
//}
//
//void Compute_wrapper(hls::stream<int> Ain_s[TILE_M], hls::stream<int> Bin_s[TILE_N],
// hls::stream<int> Cout_s[TILE_M], bool init, int K_MIN, int K_MAX, int K_cnt, int *K_cnt1){
//
// hls::stream<int> A_inter[TILE_M][TILE_N+1];
//#pragma HLS STREAM variable=A_inter dim=1 depth=DEPTH_TILE_K
//#pragma HLS STREAM variable=A_inter dim=2 depth=DEPTH_TILE_K
// hls::stream<int> B_inter[TILE_M+1][TILE_N];
//#pragma HLS STREAM variable=B_inter dim=1 depth=DEPTH_TILE_K
//#pragma HLS STREAM variable=B_inter dim=2 depth=DEPTH_TILE_K
//hls::stream<int> C_out[TILE_M][TILE_N+1];
//#pragma HLS STREAM variable=C_out dim=1 depth=DEPTH_TILE_N
//#pragma HLS STREAM variable=C_out dim=2 depth=DEPTH_TILE_N
//
// static int C_local_array[TILE_M][TILE_N];
//#pragma HLS ARRAY_PARTITION variable=C_local_array complete dim=0
// static int k_cnt_array[TILE_M][TILE_N];
//#pragma HLS ARRAY_PARTITION variable=k_cnt_array complete dim=0
//
// LOAD_AB:for(int k=0; k<K_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
//#pragma HLS PIPELINE II=1
// for(int i=0; i<TILE_M; i++){
// int tmp = Ain_s[i].read();
// A_inter[i][0].write(tmp);
// }
//
// for(int j=0; j<TILE_N; j++){
// int tmp = Bin_s[j].read();
// B_inter[0][j].write(tmp);
// }
// }
//
// COMPUTE_C:{
// int i;
// i = 0;
// compute_pe<0, 0>(A_inter[i][0], B_inter[i][0], A_inter[i][1], B_inter[i+1][0], C_out[i][0], K_MIN, K_MAX, init, &C_local_array[i][0], &k_cnt_array[i][0]);
// compute_pe<0, 1>(A_inter[i][1], B_inter[i][1], A_inter[i][2], B_inter[i+1][1], C_out[i][1], K_MIN, K_MAX, init, &C_local_array[i][1], &k_cnt_array[i][1]);
// compute_pe<0, 2>(A_inter[i][2], B_inter[i][2], A_inter[i][3], B_inter[i+1][2], C_out[i][2], K_MIN, K_MAX, init, &C_local_array[i][2], &k_cnt_array[i][2]);
// compute_pe<0, 3>(A_inter[i][3], B_inter[i][3], A_inter[i][4], B_inter[i+1][3], C_out[i][3], K_MIN, K_MAX, init, &C_local_array[i][3], &k_cnt_array[i][3]);
// compute_pe<0, 4>(A_inter[i][4], B_inter[i][4], A_inter[i][5], B_inter[i+1][4], C_out[i][4], K_MIN, K_MAX, init, &C_local_array[i][4], &k_cnt_array[i][4]);
// compute_pe<0, 5>(A_inter[i][5], B_inter[i][5], A_inter[i][6], B_inter[i+1][5], C_out[i][5], K_MIN, K_MAX, init, &C_local_array[i][5], &k_cnt_array[i][5]);
// compute_pe<0, 6>(A_inter[i][6], B_inter[i][6], A_inter[i][7], B_inter[i+1][6], C_out[i][6], K_MIN, K_MAX, init, &C_local_array[i][6], &k_cnt_array[i][6]);
// compute_pe<0, 7>(A_inter[i][7], B_inter[i][7], A_inter[i][8], B_inter[i+1][7], C_out[i][7], K_MIN, K_MAX, init, &C_local_array[i][7], &k_cnt_array[i][7]);
// compute_pe<0, 8>(A_inter[i][8], B_inter[i][8], A_inter[i][9], B_inter[i+1][8], C_out[i][8], K_MIN, K_MAX, init, &C_local_array[i][8], &k_cnt_array[i][8]);
// i = 1;
// compute_pe<1, 0>(A_inter[i][0], B_inter[i][0], A_inter[i][1], B_inter[i+1][0], C_out[i][0], K_MIN, K_MAX, init, &C_local_array[i][0], &k_cnt_array[i][0]);
// compute_pe<1, 1>(A_inter[i][1], B_inter[i][1], A_inter[i][2], B_inter[i+1][1], C_out[i][1], K_MIN, K_MAX, init, &C_local_array[i][1], &k_cnt_array[i][1]);
// compute_pe<1, 2>(A_inter[i][2], B_inter[i][2], A_inter[i][3], B_inter[i+1][2], C_out[i][2], K_MIN, K_MAX, init, &C_local_array[i][2], &k_cnt_array[i][2]);
// compute_pe<1, 3>(A_inter[i][3], B_inter[i][3], A_inter[i][4], B_inter[i+1][3], C_out[i][3], K_MIN, K_MAX, init, &C_local_array[i][3], &k_cnt_array[i][3]);
// compute_pe<1, 4>(A_inter[i][4], B_inter[i][4], A_inter[i][5], B_inter[i+1][4], C_out[i][4], K_MIN, K_MAX, init, &C_local_array[i][4], &k_cnt_array[i][4]);
// compute_pe<1, 5>(A_inter[i][5], B_inter[i][5], A_inter[i][6], B_inter[i+1][5], C_out[i][5], K_MIN, K_MAX, init, &C_local_array[i][5], &k_cnt_array[i][5]);
// compute_pe<1, 6>(A_inter[i][6], B_inter[i][6], A_inter[i][7], B_inter[i+1][6], C_out[i][6], K_MIN, K_MAX, init, &C_local_array[i][6], &k_cnt_array[i][6]);
// compute_pe<1, 7>(A_inter[i][7], B_inter[i][7], A_inter[i][8], B_inter[i+1][7], C_out[i][7], K_MIN, K_MAX, init, &C_local_array[i][7], &k_cnt_array[i][7]);
// compute_pe<1, 8>(A_inter[i][8], B_inter[i][8], A_inter[i][9], B_inter[i+1][8], C_out[i][8], K_MIN, K_MAX, init, &C_local_array[i][8], &k_cnt_array[i][8]);
// i = 2;
// compute_pe<2, 0>(A_inter[i][0], B_inter[i][0], A_inter[i][1], B_inter[i+1][0], C_out[i][0], K_MIN, K_MAX, init, &C_local_array[i][0], &k_cnt_array[i][0]);
// compute_pe<2, 1>(A_inter[i][1], B_inter[i][1], A_inter[i][2], B_inter[i+1][1], C_out[i][1], K_MIN, K_MAX, init, &C_local_array[i][1], &k_cnt_array[i][1]);
// compute_pe<2, 2>(A_inter[i][2], B_inter[i][2], A_inter[i][3], B_inter[i+1][2], C_out[i][2], K_MIN, K_MAX, init, &C_local_array[i][2], &k_cnt_array[i][2]);
// compute_pe<2, 3>(A_inter[i][3], B_inter[i][3], A_inter[i][4], B_inter[i+1][3], C_out[i][3], K_MIN, K_MAX, init, &C_local_array[i][3], &k_cnt_array[i][3]);
// compute_pe<2, 4>(A_inter[i][4], B_inter[i][4], A_inter[i][5], B_inter[i+1][4], C_out[i][4], K_MIN, K_MAX, init, &C_local_array[i][4], &k_cnt_array[i][4]);
// compute_pe<2, 5>(A_inter[i][5], B_inter[i][5], A_inter[i][6], B_inter[i+1][5], C_out[i][5], K_MIN, K_MAX, init, &C_local_array[i][5], &k_cnt_array[i][5]);
// compute_pe<2, 6>(A_inter[i][6], B_inter[i][6], A_inter[i][7], B_inter[i+1][6], C_out[i][6], K_MIN, K_MAX, init, &C_local_array[i][6], &k_cnt_array[i][6]);
// compute_pe<2, 7>(A_inter[i][7], B_inter[i][7], A_inter[i][8], B_inter[i+1][7], C_out[i][7], K_MIN, K_MAX, init, &C_local_array[i][7], &k_cnt_array[i][7]);
// compute_pe<2, 8>(A_inter[i][8], B_inter[i][8], A_inter[i][9], B_inter[i+1][8], C_out[i][8], K_MIN, K_MAX, init, &C_local_array[i][8], &k_cnt_array[i][8]);
// i = 3;
// compute_pe<3, 0>(A_inter[i][0], B_inter[i][0], A_inter[i][1], B_inter[i+1][0], C_out[i][0], K_MIN, K_MAX, init, &C_local_array[i][0], &k_cnt_array[i][0]);
// compute_pe<3, 1>(A_inter[i][1], B_inter[i][1], A_inter[i][2], B_inter[i+1][1], C_out[i][1], K_MIN, K_MAX, init, &C_local_array[i][1], &k_cnt_array[i][1]);
// compute_pe<3, 2>(A_inter[i][2], B_inter[i][2], A_inter[i][3], B_inter[i+1][2], C_out[i][2], K_MIN, K_MAX, init, &C_local_array[i][2], &k_cnt_array[i][2]);
// compute_pe<3, 3>(A_inter[i][3], B_inter[i][3], A_inter[i][4], B_inter[i+1][3], C_out[i][3], K_MIN, K_MAX, init, &C_local_array[i][3], &k_cnt_array[i][3]);
// compute_pe<3, 4>(A_inter[i][4], B_inter[i][4], A_inter[i][5], B_inter[i+1][4], C_out[i][4], K_MIN, K_MAX, init, &C_local_array[i][4], &k_cnt_array[i][4]);
// compute_pe<3, 5>(A_inter[i][5], B_inter[i][5], A_inter[i][6], B_inter[i+1][5], C_out[i][5], K_MIN, K_MAX, init, &C_local_array[i][5], &k_cnt_array[i][5]);
// compute_pe<3, 6>(A_inter[i][6], B_inter[i][6], A_inter[i][7], B_inter[i+1][6], C_out[i][6], K_MIN, K_MAX, init, &C_local_array[i][6], &k_cnt_array[i][6]);
// compute_pe<3, 7>(A_inter[i][7], B_inter[i][7], A_inter[i][8], B_inter[i+1][7], C_out[i][7], K_MIN, K_MAX, init, &C_local_array[i][7], &k_cnt_array[i][7]);
// compute_pe<3, 8>(A_inter[i][8], B_inter[i][8], A_inter[i][9], B_inter[i+1][8], C_out[i][8], K_MIN, K_MAX, init, &C_local_array[i][8], &k_cnt_array[i][8]);
// i = 4;
// compute_pe<4, 0>(A_inter[i][0], B_inter[i][0], A_inter[i][1], B_inter[i+1][0], C_out[i][0], K_MIN, K_MAX, init, &C_local_array[i][0], &k_cnt_array[i][0]);
// compute_pe<4, 1>(A_inter[i][1], B_inter[i][1], A_inter[i][2], B_inter[i+1][1], C_out[i][1], K_MIN, K_MAX, init, &C_local_array[i][1], &k_cnt_array[i][1]);
// compute_pe<4, 2>(A_inter[i][2], B_inter[i][2], A_inter[i][3], B_inter[i+1][2], C_out[i][2], K_MIN, K_MAX, init, &C_local_array[i][2], &k_cnt_array[i][2]);
// compute_pe<4, 3>(A_inter[i][3], B_inter[i][3], A_inter[i][4], B_inter[i+1][3], C_out[i][3], K_MIN, K_MAX, init, &C_local_array[i][3], &k_cnt_array[i][3]);
// compute_pe<4, 4>(A_inter[i][4], B_inter[i][4], A_inter[i][5], B_inter[i+1][4], C_out[i][4], K_MIN, K_MAX, init, &C_local_array[i][4], &k_cnt_array[i][4]);
// compute_pe<4, 5>(A_inter[i][5], B_inter[i][5], A_inter[i][6], B_inter[i+1][5], C_out[i][5], K_MIN, K_MAX, init, &C_local_array[i][5], &k_cnt_array[i][5]);
// compute_pe<4, 6>(A_inter[i][6], B_inter[i][6], A_inter[i][7], B_inter[i+1][6], C_out[i][6], K_MIN, K_MAX, init, &C_local_array[i][6], &k_cnt_array[i][6]);
// compute_pe<4, 7>(A_inter[i][7], B_inter[i][7], A_inter[i][8], B_inter[i+1][7], C_out[i][7], K_MIN, K_MAX, init, &C_local_array[i][7], &k_cnt_array[i][7]);
// compute_pe<4, 8>(A_inter[i][8], B_inter[i][8], A_inter[i][9], B_inter[i+1][8], C_out[i][8], K_MIN, K_MAX, init, &C_local_array[i][8], &k_cnt_array[i][8]);
// i = 5;
// compute_pe<5, 0>(A_inter[i][0], B_inter[i][0], A_inter[i][1], B_inter[i+1][0], C_out[i][0], K_MIN, K_MAX, init, &C_local_array[i][0], &k_cnt_array[i][0]);
// compute_pe<5, 1>(A_inter[i][1], B_inter[i][1], A_inter[i][2], B_inter[i+1][1], C_out[i][1], K_MIN, K_MAX, init, &C_local_array[i][1], &k_cnt_array[i][1]);
// compute_pe<5, 2>(A_inter[i][2], B_inter[i][2], A_inter[i][3], B_inter[i+1][2], C_out[i][2], K_MIN, K_MAX, init, &C_local_array[i][2], &k_cnt_array[i][2]);
// compute_pe<5, 3>(A_inter[i][3], B_inter[i][3], A_inter[i][4], B_inter[i+1][3], C_out[i][3], K_MIN, K_MAX, init, &C_local_array[i][3], &k_cnt_array[i][3]);
// compute_pe<5, 4>(A_inter[i][4], B_inter[i][4], A_inter[i][5], B_inter[i+1][4], C_out[i][4], K_MIN, K_MAX, init, &C_local_array[i][4], &k_cnt_array[i][4]);
// compute_pe<5, 5>(A_inter[i][5], B_inter[i][5], A_inter[i][6], B_inter[i+1][5], C_out[i][5], K_MIN, K_MAX, init, &C_local_array[i][5], &k_cnt_array[i][5]);
// compute_pe<5, 6>(A_inter[i][6], B_inter[i][6], A_inter[i][7], B_inter[i+1][6], C_out[i][6], K_MIN, K_MAX, init, &C_local_array[i][6], &k_cnt_array[i][6]);
// compute_pe<5, 7>(A_inter[i][7], B_inter[i][7], A_inter[i][8], B_inter[i+1][7], C_out[i][7], K_MIN, K_MAX, init, &C_local_array[i][7], &k_cnt_array[i][7]);
// compute_pe<5, 8>(A_inter[i][8], B_inter[i][8], A_inter[i][9], B_inter[i+1][8], C_out[i][8], K_MIN, K_MAX, init, &C_local_array[i][8], &k_cnt_array[i][8]);
// i = 6;
// compute_pe<6, 0>(A_inter[i][0], B_inter[i][0], A_inter[i][1], B_inter[i+1][0], C_out[i][0], K_MIN, K_MAX, init, &C_local_array[i][0], &k_cnt_array[i][0]);
// compute_pe<6, 1>(A_inter[i][1], B_inter[i][1], A_inter[i][2], B_inter[i+1][1], C_out[i][1], K_MIN, K_MAX, init, &C_local_array[i][1], &k_cnt_array[i][1]);
// compute_pe<6, 2>(A_inter[i][2], B_inter[i][2], A_inter[i][3], B_inter[i+1][2], C_out[i][2], K_MIN, K_MAX, init, &C_local_array[i][2], &k_cnt_array[i][2]);
// compute_pe<6, 3>(A_inter[i][3], B_inter[i][3], A_inter[i][4], B_inter[i+1][3], C_out[i][3], K_MIN, K_MAX, init, &C_local_array[i][3], &k_cnt_array[i][3]);
// compute_pe<6, 4>(A_inter[i][4], B_inter[i][4], A_inter[i][5], B_inter[i+1][4], C_out[i][4], K_MIN, K_MAX, init, &C_local_array[i][4], &k_cnt_array[i][4]);
// compute_pe<6, 5>(A_inter[i][5], B_inter[i][5], A_inter[i][6], B_inter[i+1][5], C_out[i][5], K_MIN, K_MAX, init, &C_local_array[i][5], &k_cnt_array[i][5]);
// compute_pe<6, 6>(A_inter[i][6], B_inter[i][6], A_inter[i][7], B_inter[i+1][6], C_out[i][6], K_MIN, K_MAX, init, &C_local_array[i][6], &k_cnt_array[i][6]);
// compute_pe<6, 7>(A_inter[i][7], B_inter[i][7], A_inter[i][8], B_inter[i+1][7], C_out[i][7], K_MIN, K_MAX, init, &C_local_array[i][7], &k_cnt_array[i][7]);
// compute_pe<6, 8>(A_inter[i][8], B_inter[i][8], A_inter[i][9], B_inter[i+1][8], C_out[i][8], K_MIN, K_MAX, init, &C_local_array[i][8], &k_cnt_array[i][8]);
// }
//
//// Loop_M:for(int i=0; i<TILE_M; i++)
//// {
////#pragma HLS UNROLL
//// compute_pe<0, 0>(A_inter[i][0], B_inter[i][0], A_inter[i][1], B_inter[i+1][0], C_out[i][0], K_MIN, K_MAX, init, &C_local_array[i][0], &k_cnt_array[i][0]);
//// compute_pe<0, 1>(A_inter[i][1], B_inter[i][1], A_inter[i][2], B_inter[i+1][1], C_out[i][1], K_MIN, K_MAX, init, &C_local_array[i][1], &k_cnt_array[i][1]);
//// compute_pe<0, 2>(A_inter[i][2], B_inter[i][2], A_inter[i][3], B_inter[i+1][2], C_out[i][2], K_MIN, K_MAX, init, &C_local_array[i][2], &k_cnt_array[i][2]);
//// compute_pe<0, 3>(A_inter[i][3], B_inter[i][3], A_inter[i][4], B_inter[i+1][3], C_out[i][3], K_MIN, K_MAX, init, &C_local_array[i][3], &k_cnt_array[i][3]);
//// compute_pe<0, 4>(A_inter[i][4], B_inter[i][4], A_inter[i][5], B_inter[i+1][4], C_out[i][4], K_MIN, K_MAX, init, &C_local_array[i][4], &k_cnt_array[i][4]);
//// compute_pe<0, 5>(A_inter[i][5], B_inter[i][5], A_inter[i][6], B_inter[i+1][5], C_out[i][5], K_MIN, K_MAX, init, &C_local_array[i][5], &k_cnt_array[i][5]);
//// compute_pe<0, 6>(A_inter[i][6], B_inter[i][6], A_inter[i][7], B_inter[i+1][6], C_out[i][6], K_MIN, K_MAX, init, &C_local_array[i][6], &k_cnt_array[i][6]);
//// compute_pe<0, 7>(A_inter[i][7], B_inter[i][7], A_inter[i][8], B_inter[i+1][7], C_out[i][7], K_MIN, K_MAX, init, &C_local_array[i][7], &k_cnt_array[i][7]);
//// compute_pe<0, 8>(A_inter[i][8], B_inter[i][8], A_inter[i][9], B_inter[i+1][8], C_out[i][8], K_MIN, K_MAX, init, &C_local_array[i][8], &k_cnt_array[i][8]);
//// }
//
//// Loop_M:for(int i=0; i<TILE_M; i++)
//// {
////#pragma HLS UNROLL
//// Loop_N:for(int j=0; j<TILE_N; j++)
//// {
////#pragma HLS UNROLL
//// PE_array[i][j].compute(A_inter[i][j], B_inter[i][j], A_inter[i][j+1], B_inter[i+1][j], C_out[i][j], K_MIN, K_MAX, init);
//// }
//// }
//
// DRAIN_AB:{
// for(int i=0; i<TILE_M; i++)
// {
//#pragma HLS UNROLL
// Drain(A_inter[i][TILE_N], K_MIN);
// }
//
// for(int j=0; j<TILE_N; j++)
// {
//#pragma HLS UNROLL
// Drain(B_inter[TILE_M][j], K_MIN);
// }
// }
//
// if(K_cnt == K_MAX){
////tranfer neighbor PE's output
// for(int j=TILE_N-1; j>-1; j--){
// for(int k=0; k<TILE_N-1-j; k++){
//#pragma HLS PIPELINE II=1
// for(int i=0; i<TILE_M; i++){
// int tmp_in, tmp_out;
// C_out[i][j+1] >> tmp_in;
// tmp_out = tmp_in;
// C_out[i][j] << tmp_out;
// }
// }
// }
//
// for(int i=0; i<TILE_M; i++)
// {
//#pragma HLS UNROLL
// for(int j=0; j<TILE_N; j++){
//#pragma HLS PIPELINE II=1
// int tmp_in, tmp_out;
// C_out[i][0] >> tmp_in;
// tmp_out = tmp_in;
// Cout_s[i] << tmp_out;
// }
// }
// }
//
// *K_cnt1 = K_cnt;
//}
//
//void Write_wrapper(int C_local[TILE_M][TILE_N], hls::stream<int> Cout_s[TILE_M],
// int M_MIN, int N_MIN, int K_MIN, int K_cnt, int K_MAX){
// if(K_cnt == K_MAX){
// for(int j=0; j<TILE_N; j++){
//#pragma HLS PIPELINE II=1
// for(int i=0; i<TILE_M; i++)
// {
// int tmp_out;
// Cout_s[i] >> tmp_out;
// if((i < M_MIN) && (j < N_MIN))
// C_local[i][j] = tmp_out;
// }
// }
// }
//}
//
//void Compute_SA(int A_local[TILE_M][TILE_K], int B_local[TILE_K][TILE_N], int C_local[TILE_M][TILE_N], bool init, int M_MIN, int N_MIN, int K_MIN, int K_MAX)
//{
//
//#pragma HLS DATAFLOW
//
// hls::stream<int> Ain_s[TILE_M];
//#pragma HLS STREAM variable=Ain_s depth=DEPTH_TILE_K
////DO_PRAGMA(#pragma HLS STREAM variable=Ain_s depth=TILE_K)
// hls::stream<int> Bin_s[TILE_N];
//#pragma HLS STREAM variable=Bin_s depth=DEPTH_TILE_K
////DO_PRAGMA(#pragma HLS STREAM variable=Bin_s depth=TILE_K)
//hls::stream<int> Cout_s[TILE_M];
//#pragma HLS STREAM variable=Cout_s depth=DEPTH_TILE_N
////DO_PRAGMA(#pragma HLS STREAM variable=Cout_s depth=TILE_N)
//
// int K_cnt0[1], K_cnt1[1];
// bool init0[1];
//
// Load_wrapper( A_local, B_local, Ain_s, Bin_s, K_cnt0, init0, init, M_MIN, N_MIN, K_MIN);
//
// Compute_wrapper( Ain_s, Bin_s, Cout_s, init0[0], K_MIN, K_MAX, K_cnt0[0], K_cnt1);
//
// Write_wrapper( C_local, Cout_s, M_MIN, N_MIN, K_MIN, K_cnt1[0], K_MAX);
//
//}
//
//void Load_A(int A_local[TILE_M][TILE_K], int *A, int M_base, int K_base, int K_len, int M_MIN, int K_MIN)
//{
// int base_offset = M_base*K_len + K_base;
// Loop_M:for(int i=0; i<M_MIN; i++)
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_M)
// Loop_K:for(int k=0; k<K_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
//#pragma HLS PIPELINE II=1
// A_local[i][k] = A[base_offset + i*K_len + k];
// }
//}
//
//void Load_B(int B_local[TILE_K][TILE_N], int *B, int K_base, int N_base, int N_len, int K_MIN, int N_MIN)
//{
// int base_offset = K_base*N_len + N_base;
// Loop_K:for(int i=0; i<K_MIN; i++)
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
// Loop_N:for(int k=0; k<N_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_N)
//#pragma HLS PIPELINE II=1
// B_local[i][k] = B[base_offset + i*N_len + k];
// }
//}
//
//void Load_AB_wrapper(int A_local[TILE_M][TILE_K], int B_local[TILE_K][TILE_N], int *A, int *B,
// int K, int N, int i, int j, bool k_init, int M_MIN, int N_MIN, int K_MIN0[1], int k0[1])
//{
//
// static int k;
// if(k_init){
// k = 0;
// }else{
// k += TILE_K;
// }
//
// int K_MIN = MIN(TILE_K, K-k);
//
// Load_A(A_local, A, i, k, K, M_MIN, K_MIN);
// Load_B(B_local, B, k, j, N, K_MIN, N_MIN);
//
// K_MIN0[0] = K_MIN;
// k0[0] = k;
//}
//
//void Store_C(int C_local[TILE_M][TILE_N], int *C, int M_base, int N_base, int N_len, int M_MIN, int N_MIN)
//{
// int base_offset = M_base*N_len + N_base;
// Loop_K:for(int i=0; i<M_MIN; i++)
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_M)
// Loop_N:for(int k=0; k<N_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_N)
//#pragma HLS PIPELINE II=1
// C[base_offset + i*N_len + k] = C_local[i][k];
// }
//}
//
//void DATAFLOW_Load_Compute(int C_local[TILE_M][TILE_N], int *A, int *B, int M, int N, int K, int kloops, int i, int j, int M_MIN, int N_MIN)
//{
// static int A_local[TILE_M][TILE_K];
//#pragma HLS ARRAY_PARTITION variable=A_local complete dim=1
// static int B_local[TILE_K][TILE_N];
//#pragma HLS ARRAY_PARTITION variable=B_local complete dim=2
//
// int K_MIN0[1], k0[1];
// Loop_K:for(int k=0; k<kloops; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=NUM_K)
//#pragma HLS DATAFLOW
// Load_AB_wrapper( A_local, B_local, A, B, K, N, i, j, k==0, M_MIN, N_MIN, K_MIN0, k0);
//
// Compute_SA(A_local, B_local, C_local, k0[0]==0, M_MIN, N_MIN, K_MIN0[0], K);
// }
//}
//
//void MUL(int *A, int *B, int *C, int M, int N, int K, int kloops)//A[MxK]*B[KxN]=C[MxN]
//{
//#pragma HLS INTERFACE m_axi depth=384 port=A offset=slave bundle=DB_A
//#pragma HLS INTERFACE m_axi depth=768 port=B offset=slave bundle=DB_B
//#pragma HLS INTERFACE m_axi depth=2048 port=C offset=slave bundle=DB_C
//
//#pragma HLS INTERFACE s_axilite register port=return bundle=CB
//#pragma HLS INTERFACE s_axilite register port=M bundle=CB
//#pragma HLS INTERFACE s_axilite register port=N bundle=CB
//#pragma HLS INTERFACE s_axilite register port=K bundle=CB
//#pragma HLS INTERFACE s_axilite register port=kloops bundle=CB
//
//#pragma HLS INTERFACE s_axilite register port=A bundle=CB
//#pragma HLS INTERFACE s_axilite register port=B bundle=CB
//#pragma HLS INTERFACE s_axilite register port=C bundle=CB
//
// static int C_local[TILE_M][TILE_N];
//#pragma HLS ARRAY_PARTITION variable=C_local complete dim=1
//
// int M_MIN, N_MIN;
//
// Loop_M:for(int i=0; i<M; i+= TILE_M)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=NUM_M)
// M_MIN = MIN(TILE_M, M-i);
// Loop_N:for(int j=0; j<N; j+= TILE_N)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=NUM_N)
// N_MIN = MIN(TILE_N, N-j);
//
// DATAFLOW_Load_Compute( C_local, A, B, M, N, K, kloops, i, j, M_MIN, N_MIN);
//
// Store_C(C_local, C, i, j, N, M_MIN, N_MIN);
// }
// }
//}
////////////////////////////////////////////v11 end////////////////////////////////////////
////////////////////////////////////////////v10 start////////////////////////////////////////
//#define MAX(x,y) ((x)>(y)?(x):(y))
//#define MIN(x,y) ((x)<(y)?(x):(y))
//
//#define TILE_M 7
//#define TILE_N 9
//#define TILE_K 5
//
//const int DEPTH_TILE_M = TILE_M;
//const int DEPTH_TILE_N = TILE_N;
//const int DEPTH_TILE_K = TILE_K;
//
//template<int MIN_R,int MID_C>
//void compute_pe(hls::stream<int> &A_in, hls::stream<int> &B_in, hls::stream<int> &A_out, hls::stream<int> &B_out, hls::stream<int> &C_out, int K, int K_MAX, bool init,
// int *C_local_array, int *k_cnt_array)
//{
//#pragma HLS INLINE off
// int C_local;
// int k_cnt;
//
// int A_tmp, B_tmp;
// if(init){
// C_local = 0;
// k_cnt = 0;
// }else
// {
// C_local = *C_local_array;
// k_cnt = *k_cnt_array;
// }
//
// for(int k=0; k<K; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
//#pragma HLS PIPELINE II=1
// A_in >> A_tmp;
// B_in >> B_tmp;
//
// C_local += A_tmp * B_tmp;
// A_out << A_tmp;
// B_out << B_tmp;
// k_cnt++;
// }
//
// if(k_cnt == K_MAX){
// C_out.write(C_local);
// }else{
// *C_local_array = C_local;
// *k_cnt_array = k_cnt;
// }
//
// return;
//}
//
//void Drain(hls::stream<int> &in, int data_num)
//{
// int drain;
// for(int k = 0; k<data_num; k++){
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
//#pragma HLS PIPELINE II=1
// in >> drain;
// }
//}
//
//void Load_wrapper(int A_local[TILE_M][TILE_K], int B_local[TILE_K][TILE_N],
// hls::stream<int> Ain_s[TILE_M], hls::stream<int> Bin_s[TILE_N],
// int *K_cnt0, bool *init0, bool init, int M_MIN, int N_MIN, int K_MIN){
//
// static int K_cnt;
// if(init){
// K_cnt = 0;
// }
// K_cnt += K_MIN;
//
// for(int k=0; k<K_MIN; k++)
// {
//#pragma HLS PIPELINE II=1
// for(int i=0; i<TILE_M; i++){
// int tmp = 0;
// if(i<M_MIN)
// tmp = A_local[i][k];
// Ain_s[i] << tmp;
// }
//
// for(int j=0; j<TILE_N; j++){
// int tmp = 0;
// if(j<N_MIN)
// tmp = B_local[k][j];
// Bin_s[j] << tmp;
// }
// }
//
// *K_cnt0 = K_cnt;
// *init0 = init;
//}
//
//void Compute_wrapper(hls::stream<int> Ain_s[TILE_M], hls::stream<int> Bin_s[TILE_N],
// hls::stream<int> Cout_s[TILE_M], bool init, int K_MIN, int K_MAX, int K_cnt, int *K_cnt1){
//
// hls::stream<int> A_inter[TILE_M][TILE_N+1];
//#pragma HLS STREAM variable=A_inter dim=1 depth=DEPTH_TILE_K
//#pragma HLS STREAM variable=A_inter dim=2 depth=DEPTH_TILE_K
////DO_PRAGMA(#pragma HLS STREAM variable=A_inter dim=1 depth=TILE_K)
////DO_PRAGMA(#pragma HLS STREAM variable=A_inter dim=2 depth=TILE_K)
// hls::stream<int> B_inter[TILE_M+1][TILE_N];
//#pragma HLS STREAM variable=B_inter dim=1 depth=DEPTH_TILE_K
//#pragma HLS STREAM variable=B_inter dim=2 depth=DEPTH_TILE_K
////DO_PRAGMA(#pragma HLS STREAM variable=B_inter dim=1 depth=TILE_K)
////DO_PRAGMA(#pragma HLS STREAM variable=B_inter dim=2 depth=TILE_K)
//hls::stream<int> C_out[TILE_M][TILE_N+1];
//#pragma HLS STREAM variable=C_out dim=1 depth=DEPTH_TILE_N
//#pragma HLS STREAM variable=C_out dim=2 depth=DEPTH_TILE_N
////DO_PRAGMA(#pragma HLS STREAM variable=C_out dim=1 depth=TILE_N)
////DO_PRAGMA(#pragma HLS STREAM variable=C_out dim=2 depth=TILE_N)
//
// static int C_local_array[TILE_M][TILE_N];
//#pragma HLS ARRAY_PARTITION variable=C_local_array complete dim=0
// static int k_cnt_array[TILE_M][TILE_N];
//#pragma HLS ARRAY_PARTITION variable=k_cnt_array complete dim=0
//
// LOAD_AB:for(int k=0; k<K_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
//#pragma HLS PIPELINE II=1
// for(int i=0; i<TILE_M; i++){
// int tmp = Ain_s[i].read();
// A_inter[i][0].write(tmp);
// }
//
// for(int j=0; j<TILE_N; j++){
// int tmp = Bin_s[j].read();
// B_inter[0][j].write(tmp);
// }
// }
//
// COMPUTE_C:{
// int i;
// i = 0;
// compute_pe<0, 0>(A_inter[i][0], B_inter[i][0], A_inter[i][1], B_inter[i+1][0], C_out[i][0], K_MIN, K_MAX, init, &C_local_array[i][0], &k_cnt_array[i][0]);
// compute_pe<0, 1>(A_inter[i][1], B_inter[i][1], A_inter[i][2], B_inter[i+1][1], C_out[i][1], K_MIN, K_MAX, init, &C_local_array[i][1], &k_cnt_array[i][1]);
// compute_pe<0, 2>(A_inter[i][2], B_inter[i][2], A_inter[i][3], B_inter[i+1][2], C_out[i][2], K_MIN, K_MAX, init, &C_local_array[i][2], &k_cnt_array[i][2]);
// compute_pe<0, 3>(A_inter[i][3], B_inter[i][3], A_inter[i][4], B_inter[i+1][3], C_out[i][3], K_MIN, K_MAX, init, &C_local_array[i][3], &k_cnt_array[i][3]);
// compute_pe<0, 4>(A_inter[i][4], B_inter[i][4], A_inter[i][5], B_inter[i+1][4], C_out[i][4], K_MIN, K_MAX, init, &C_local_array[i][4], &k_cnt_array[i][4]);
// compute_pe<0, 5>(A_inter[i][5], B_inter[i][5], A_inter[i][6], B_inter[i+1][5], C_out[i][5], K_MIN, K_MAX, init, &C_local_array[i][5], &k_cnt_array[i][5]);
// compute_pe<0, 6>(A_inter[i][6], B_inter[i][6], A_inter[i][7], B_inter[i+1][6], C_out[i][6], K_MIN, K_MAX, init, &C_local_array[i][6], &k_cnt_array[i][6]);
// compute_pe<0, 7>(A_inter[i][7], B_inter[i][7], A_inter[i][8], B_inter[i+1][7], C_out[i][7], K_MIN, K_MAX, init, &C_local_array[i][7], &k_cnt_array[i][7]);
// compute_pe<0, 8>(A_inter[i][8], B_inter[i][8], A_inter[i][9], B_inter[i+1][8], C_out[i][8], K_MIN, K_MAX, init, &C_local_array[i][8], &k_cnt_array[i][8]);
// i = 1;
// compute_pe<1, 0>(A_inter[i][0], B_inter[i][0], A_inter[i][1], B_inter[i+1][0], C_out[i][0], K_MIN, K_MAX, init, &C_local_array[i][0], &k_cnt_array[i][0]);
// compute_pe<1, 1>(A_inter[i][1], B_inter[i][1], A_inter[i][2], B_inter[i+1][1], C_out[i][1], K_MIN, K_MAX, init, &C_local_array[i][1], &k_cnt_array[i][1]);
// compute_pe<1, 2>(A_inter[i][2], B_inter[i][2], A_inter[i][3], B_inter[i+1][2], C_out[i][2], K_MIN, K_MAX, init, &C_local_array[i][2], &k_cnt_array[i][2]);
// compute_pe<1, 3>(A_inter[i][3], B_inter[i][3], A_inter[i][4], B_inter[i+1][3], C_out[i][3], K_MIN, K_MAX, init, &C_local_array[i][3], &k_cnt_array[i][3]);
// compute_pe<1, 4>(A_inter[i][4], B_inter[i][4], A_inter[i][5], B_inter[i+1][4], C_out[i][4], K_MIN, K_MAX, init, &C_local_array[i][4], &k_cnt_array[i][4]);
// compute_pe<1, 5>(A_inter[i][5], B_inter[i][5], A_inter[i][6], B_inter[i+1][5], C_out[i][5], K_MIN, K_MAX, init, &C_local_array[i][5], &k_cnt_array[i][5]);
// compute_pe<1, 6>(A_inter[i][6], B_inter[i][6], A_inter[i][7], B_inter[i+1][6], C_out[i][6], K_MIN, K_MAX, init, &C_local_array[i][6], &k_cnt_array[i][6]);
// compute_pe<1, 7>(A_inter[i][7], B_inter[i][7], A_inter[i][8], B_inter[i+1][7], C_out[i][7], K_MIN, K_MAX, init, &C_local_array[i][7], &k_cnt_array[i][7]);
// compute_pe<1, 8>(A_inter[i][8], B_inter[i][8], A_inter[i][9], B_inter[i+1][8], C_out[i][8], K_MIN, K_MAX, init, &C_local_array[i][8], &k_cnt_array[i][8]);
// i = 2;
// compute_pe<2, 0>(A_inter[i][0], B_inter[i][0], A_inter[i][1], B_inter[i+1][0], C_out[i][0], K_MIN, K_MAX, init, &C_local_array[i][0], &k_cnt_array[i][0]);
// compute_pe<2, 1>(A_inter[i][1], B_inter[i][1], A_inter[i][2], B_inter[i+1][1], C_out[i][1], K_MIN, K_MAX, init, &C_local_array[i][1], &k_cnt_array[i][1]);
// compute_pe<2, 2>(A_inter[i][2], B_inter[i][2], A_inter[i][3], B_inter[i+1][2], C_out[i][2], K_MIN, K_MAX, init, &C_local_array[i][2], &k_cnt_array[i][2]);
// compute_pe<2, 3>(A_inter[i][3], B_inter[i][3], A_inter[i][4], B_inter[i+1][3], C_out[i][3], K_MIN, K_MAX, init, &C_local_array[i][3], &k_cnt_array[i][3]);
// compute_pe<2, 4>(A_inter[i][4], B_inter[i][4], A_inter[i][5], B_inter[i+1][4], C_out[i][4], K_MIN, K_MAX, init, &C_local_array[i][4], &k_cnt_array[i][4]);
// compute_pe<2, 5>(A_inter[i][5], B_inter[i][5], A_inter[i][6], B_inter[i+1][5], C_out[i][5], K_MIN, K_MAX, init, &C_local_array[i][5], &k_cnt_array[i][5]);
// compute_pe<2, 6>(A_inter[i][6], B_inter[i][6], A_inter[i][7], B_inter[i+1][6], C_out[i][6], K_MIN, K_MAX, init, &C_local_array[i][6], &k_cnt_array[i][6]);
// compute_pe<2, 7>(A_inter[i][7], B_inter[i][7], A_inter[i][8], B_inter[i+1][7], C_out[i][7], K_MIN, K_MAX, init, &C_local_array[i][7], &k_cnt_array[i][7]);
// compute_pe<2, 8>(A_inter[i][8], B_inter[i][8], A_inter[i][9], B_inter[i+1][8], C_out[i][8], K_MIN, K_MAX, init, &C_local_array[i][8], &k_cnt_array[i][8]);
// i = 3;
// compute_pe<3, 0>(A_inter[i][0], B_inter[i][0], A_inter[i][1], B_inter[i+1][0], C_out[i][0], K_MIN, K_MAX, init, &C_local_array[i][0], &k_cnt_array[i][0]);
// compute_pe<3, 1>(A_inter[i][1], B_inter[i][1], A_inter[i][2], B_inter[i+1][1], C_out[i][1], K_MIN, K_MAX, init, &C_local_array[i][1], &k_cnt_array[i][1]);
// compute_pe<3, 2>(A_inter[i][2], B_inter[i][2], A_inter[i][3], B_inter[i+1][2], C_out[i][2], K_MIN, K_MAX, init, &C_local_array[i][2], &k_cnt_array[i][2]);
// compute_pe<3, 3>(A_inter[i][3], B_inter[i][3], A_inter[i][4], B_inter[i+1][3], C_out[i][3], K_MIN, K_MAX, init, &C_local_array[i][3], &k_cnt_array[i][3]);
// compute_pe<3, 4>(A_inter[i][4], B_inter[i][4], A_inter[i][5], B_inter[i+1][4], C_out[i][4], K_MIN, K_MAX, init, &C_local_array[i][4], &k_cnt_array[i][4]);
// compute_pe<3, 5>(A_inter[i][5], B_inter[i][5], A_inter[i][6], B_inter[i+1][5], C_out[i][5], K_MIN, K_MAX, init, &C_local_array[i][5], &k_cnt_array[i][5]);
// compute_pe<3, 6>(A_inter[i][6], B_inter[i][6], A_inter[i][7], B_inter[i+1][6], C_out[i][6], K_MIN, K_MAX, init, &C_local_array[i][6], &k_cnt_array[i][6]);
// compute_pe<3, 7>(A_inter[i][7], B_inter[i][7], A_inter[i][8], B_inter[i+1][7], C_out[i][7], K_MIN, K_MAX, init, &C_local_array[i][7], &k_cnt_array[i][7]);
// compute_pe<3, 8>(A_inter[i][8], B_inter[i][8], A_inter[i][9], B_inter[i+1][8], C_out[i][8], K_MIN, K_MAX, init, &C_local_array[i][8], &k_cnt_array[i][8]);
// i = 4;
// compute_pe<4, 0>(A_inter[i][0], B_inter[i][0], A_inter[i][1], B_inter[i+1][0], C_out[i][0], K_MIN, K_MAX, init, &C_local_array[i][0], &k_cnt_array[i][0]);
// compute_pe<4, 1>(A_inter[i][1], B_inter[i][1], A_inter[i][2], B_inter[i+1][1], C_out[i][1], K_MIN, K_MAX, init, &C_local_array[i][1], &k_cnt_array[i][1]);
// compute_pe<4, 2>(A_inter[i][2], B_inter[i][2], A_inter[i][3], B_inter[i+1][2], C_out[i][2], K_MIN, K_MAX, init, &C_local_array[i][2], &k_cnt_array[i][2]);
// compute_pe<4, 3>(A_inter[i][3], B_inter[i][3], A_inter[i][4], B_inter[i+1][3], C_out[i][3], K_MIN, K_MAX, init, &C_local_array[i][3], &k_cnt_array[i][3]);
// compute_pe<4, 4>(A_inter[i][4], B_inter[i][4], A_inter[i][5], B_inter[i+1][4], C_out[i][4], K_MIN, K_MAX, init, &C_local_array[i][4], &k_cnt_array[i][4]);
// compute_pe<4, 5>(A_inter[i][5], B_inter[i][5], A_inter[i][6], B_inter[i+1][5], C_out[i][5], K_MIN, K_MAX, init, &C_local_array[i][5], &k_cnt_array[i][5]);
// compute_pe<4, 6>(A_inter[i][6], B_inter[i][6], A_inter[i][7], B_inter[i+1][6], C_out[i][6], K_MIN, K_MAX, init, &C_local_array[i][6], &k_cnt_array[i][6]);
// compute_pe<4, 7>(A_inter[i][7], B_inter[i][7], A_inter[i][8], B_inter[i+1][7], C_out[i][7], K_MIN, K_MAX, init, &C_local_array[i][7], &k_cnt_array[i][7]);
// compute_pe<4, 8>(A_inter[i][8], B_inter[i][8], A_inter[i][9], B_inter[i+1][8], C_out[i][8], K_MIN, K_MAX, init, &C_local_array[i][8], &k_cnt_array[i][8]);
// i = 5;
// compute_pe<5, 0>(A_inter[i][0], B_inter[i][0], A_inter[i][1], B_inter[i+1][0], C_out[i][0], K_MIN, K_MAX, init, &C_local_array[i][0], &k_cnt_array[i][0]);
// compute_pe<5, 1>(A_inter[i][1], B_inter[i][1], A_inter[i][2], B_inter[i+1][1], C_out[i][1], K_MIN, K_MAX, init, &C_local_array[i][1], &k_cnt_array[i][1]);
// compute_pe<5, 2>(A_inter[i][2], B_inter[i][2], A_inter[i][3], B_inter[i+1][2], C_out[i][2], K_MIN, K_MAX, init, &C_local_array[i][2], &k_cnt_array[i][2]);
// compute_pe<5, 3>(A_inter[i][3], B_inter[i][3], A_inter[i][4], B_inter[i+1][3], C_out[i][3], K_MIN, K_MAX, init, &C_local_array[i][3], &k_cnt_array[i][3]);
// compute_pe<5, 4>(A_inter[i][4], B_inter[i][4], A_inter[i][5], B_inter[i+1][4], C_out[i][4], K_MIN, K_MAX, init, &C_local_array[i][4], &k_cnt_array[i][4]);
// compute_pe<5, 5>(A_inter[i][5], B_inter[i][5], A_inter[i][6], B_inter[i+1][5], C_out[i][5], K_MIN, K_MAX, init, &C_local_array[i][5], &k_cnt_array[i][5]);
// compute_pe<5, 6>(A_inter[i][6], B_inter[i][6], A_inter[i][7], B_inter[i+1][6], C_out[i][6], K_MIN, K_MAX, init, &C_local_array[i][6], &k_cnt_array[i][6]);
// compute_pe<5, 7>(A_inter[i][7], B_inter[i][7], A_inter[i][8], B_inter[i+1][7], C_out[i][7], K_MIN, K_MAX, init, &C_local_array[i][7], &k_cnt_array[i][7]);
// compute_pe<5, 8>(A_inter[i][8], B_inter[i][8], A_inter[i][9], B_inter[i+1][8], C_out[i][8], K_MIN, K_MAX, init, &C_local_array[i][8], &k_cnt_array[i][8]);
// i = 6;
// compute_pe<6, 0>(A_inter[i][0], B_inter[i][0], A_inter[i][1], B_inter[i+1][0], C_out[i][0], K_MIN, K_MAX, init, &C_local_array[i][0], &k_cnt_array[i][0]);
// compute_pe<6, 1>(A_inter[i][1], B_inter[i][1], A_inter[i][2], B_inter[i+1][1], C_out[i][1], K_MIN, K_MAX, init, &C_local_array[i][1], &k_cnt_array[i][1]);
// compute_pe<6, 2>(A_inter[i][2], B_inter[i][2], A_inter[i][3], B_inter[i+1][2], C_out[i][2], K_MIN, K_MAX, init, &C_local_array[i][2], &k_cnt_array[i][2]);
// compute_pe<6, 3>(A_inter[i][3], B_inter[i][3], A_inter[i][4], B_inter[i+1][3], C_out[i][3], K_MIN, K_MAX, init, &C_local_array[i][3], &k_cnt_array[i][3]);
// compute_pe<6, 4>(A_inter[i][4], B_inter[i][4], A_inter[i][5], B_inter[i+1][4], C_out[i][4], K_MIN, K_MAX, init, &C_local_array[i][4], &k_cnt_array[i][4]);
// compute_pe<6, 5>(A_inter[i][5], B_inter[i][5], A_inter[i][6], B_inter[i+1][5], C_out[i][5], K_MIN, K_MAX, init, &C_local_array[i][5], &k_cnt_array[i][5]);
// compute_pe<6, 6>(A_inter[i][6], B_inter[i][6], A_inter[i][7], B_inter[i+1][6], C_out[i][6], K_MIN, K_MAX, init, &C_local_array[i][6], &k_cnt_array[i][6]);
// compute_pe<6, 7>(A_inter[i][7], B_inter[i][7], A_inter[i][8], B_inter[i+1][7], C_out[i][7], K_MIN, K_MAX, init, &C_local_array[i][7], &k_cnt_array[i][7]);
// compute_pe<6, 8>(A_inter[i][8], B_inter[i][8], A_inter[i][9], B_inter[i+1][8], C_out[i][8], K_MIN, K_MAX, init, &C_local_array[i][8], &k_cnt_array[i][8]);
// }
//
//// Loop_M:for(int i=0; i<TILE_M; i++)
//// {
////#pragma HLS UNROLL
//// compute_pe<0, 0>(A_inter[i][0], B_inter[i][0], A_inter[i][1], B_inter[i+1][0], C_out[i][0], K_MIN, K_MAX, init, &C_local_array[i][0], &k_cnt_array[i][0]);
//// compute_pe<0, 1>(A_inter[i][1], B_inter[i][1], A_inter[i][2], B_inter[i+1][1], C_out[i][1], K_MIN, K_MAX, init, &C_local_array[i][1], &k_cnt_array[i][1]);
//// compute_pe<0, 2>(A_inter[i][2], B_inter[i][2], A_inter[i][3], B_inter[i+1][2], C_out[i][2], K_MIN, K_MAX, init, &C_local_array[i][2], &k_cnt_array[i][2]);
//// compute_pe<0, 3>(A_inter[i][3], B_inter[i][3], A_inter[i][4], B_inter[i+1][3], C_out[i][3], K_MIN, K_MAX, init, &C_local_array[i][3], &k_cnt_array[i][3]);
//// compute_pe<0, 4>(A_inter[i][4], B_inter[i][4], A_inter[i][5], B_inter[i+1][4], C_out[i][4], K_MIN, K_MAX, init, &C_local_array[i][4], &k_cnt_array[i][4]);
//// compute_pe<0, 5>(A_inter[i][5], B_inter[i][5], A_inter[i][6], B_inter[i+1][5], C_out[i][5], K_MIN, K_MAX, init, &C_local_array[i][5], &k_cnt_array[i][5]);
//// compute_pe<0, 6>(A_inter[i][6], B_inter[i][6], A_inter[i][7], B_inter[i+1][6], C_out[i][6], K_MIN, K_MAX, init, &C_local_array[i][6], &k_cnt_array[i][6]);
//// compute_pe<0, 7>(A_inter[i][7], B_inter[i][7], A_inter[i][8], B_inter[i+1][7], C_out[i][7], K_MIN, K_MAX, init, &C_local_array[i][7], &k_cnt_array[i][7]);
//// compute_pe<0, 8>(A_inter[i][8], B_inter[i][8], A_inter[i][9], B_inter[i+1][8], C_out[i][8], K_MIN, K_MAX, init, &C_local_array[i][8], &k_cnt_array[i][8]);
//// }
//
//// Loop_M:for(int i=0; i<TILE_M; i++)
//// {
////#pragma HLS UNROLL
//// Loop_N:for(int j=0; j<TILE_N; j++)
//// {
////#pragma HLS UNROLL
//// PE_array[i][j].compute(A_inter[i][j], B_inter[i][j], A_inter[i][j+1], B_inter[i+1][j], C_out[i][j], K_MIN, K_MAX, init);
//// }
//// }
// DRAIN_AB:{
// for(int i=0; i<TILE_M; i++)
// {
//#pragma HLS UNROLL
// Drain(A_inter[i][TILE_N], K_MIN);
// }
//
// for(int j=0; j<TILE_N; j++)
// {
//#pragma HLS UNROLL
// Drain(B_inter[TILE_M][j], K_MIN);
// }
// }
//
// if(K_cnt == K_MAX){
////tranfer neighbor PE's output
// for(int j=TILE_N-1; j>-1; j--){
// for(int k=0; k<TILE_N-1-j; k++){
//#pragma HLS PIPELINE II=1
// for(int i=0; i<TILE_M; i++){
// int tmp_in, tmp_out;
// C_out[i][j+1] >> tmp_in;
// tmp_out = tmp_in;
// C_out[i][j] << tmp_out;
// }
// }
// }
//
// for(int i=0; i<TILE_M; i++)
// {
//#pragma HLS UNROLL
// for(int j=0; j<TILE_N; j++){
//#pragma HLS PIPELINE II=1
// int tmp_in, tmp_out;
// C_out[i][0] >> tmp_in;
// tmp_out = tmp_in;
// Cout_s[i] << tmp_out;
// }
// }
// }
//
// *K_cnt1 = K_cnt;
//}
//
//void Write_wrapper(int C_local[TILE_M][TILE_N], hls::stream<int> Cout_s[TILE_M],
// int M_MIN, int N_MIN, int K_MIN, int K_cnt, int K_MAX){
// if(K_cnt == K_MAX){
// for(int j=0; j<TILE_N; j++){
//#pragma HLS PIPELINE II=1
// for(int i=0; i<TILE_M; i++)
// {
// int tmp_out;
// Cout_s[i] >> tmp_out;
// if((i < M_MIN) && (j < N_MIN))
// C_local[i][j] = tmp_out;
// }
// }
// }
//}
//
//void Compute_SA(int A_local[TILE_M][TILE_K], int B_local[TILE_K][TILE_N], int C_local[TILE_M][TILE_N], bool init, int M_MIN, int N_MIN, int K_MIN, int K_MAX)
//{
//
//#pragma HLS DATAFLOW
//
// hls::stream<int> Ain_s[TILE_M];
//#pragma HLS STREAM variable=Ain_s depth=DEPTH_TILE_K
////DO_PRAGMA(#pragma HLS STREAM variable=Ain_s depth=TILE_K)
// hls::stream<int> Bin_s[TILE_N];
//#pragma HLS STREAM variable=Bin_s depth=DEPTH_TILE_K
////DO_PRAGMA(#pragma HLS STREAM variable=Bin_s depth=TILE_K)
//hls::stream<int> Cout_s[TILE_M];
//#pragma HLS STREAM variable=Cout_s depth=DEPTH_TILE_N
////DO_PRAGMA(#pragma HLS STREAM variable=Cout_s depth=TILE_N)
//
// int K_cnt0[1], K_cnt1[1];
// bool init0[1];
//
// Load_wrapper( A_local, B_local, Ain_s, Bin_s, K_cnt0, init0, init, M_MIN, N_MIN, K_MIN);
//
// Compute_wrapper( Ain_s, Bin_s, Cout_s, init0[0], K_MIN, K_MAX, K_cnt0[0], K_cnt1);
//
// Write_wrapper( C_local, Cout_s, M_MIN, N_MIN, K_MIN, K_cnt1[0], K_MAX);
//
//}
//
//void Load_A(int A_local[TILE_M][TILE_K], int *A, int M_base, int K_base, int K_len, int M_MIN, int K_MIN)
//{
// int base_offset = M_base*K_len + K_base;
// Loop_M:for(int i=0; i<M_MIN; i++)
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_M)
// Loop_K:for(int k=0; k<K_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
//#pragma HLS PIPELINE II=1
// A_local[i][k] = A[base_offset + i*K_len + k];
// }
//}
//
//void Load_B(int B_local[TILE_K][TILE_N], int *B, int K_base, int N_base, int N_len, int K_MIN, int N_MIN)
//{
// int base_offset = K_base*N_len + N_base;
// Loop_K:for(int i=0; i<K_MIN; i++)
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
// Loop_N:for(int k=0; k<N_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_N)
//#pragma HLS PIPELINE II=1
// B_local[i][k] = B[base_offset + i*N_len + k];
// }
//}
//
//void Store_C(int C_local[TILE_M][TILE_N], int *C, int M_base, int N_base, int N_len, int M_MIN, int N_MIN)
//{
// int base_offset = M_base*N_len + N_base;
// Loop_K:for(int i=0; i<M_MIN; i++)
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_M)
// Loop_N:for(int k=0; k<N_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_N)
//#pragma HLS PIPELINE II=1
// C[base_offset + i*N_len + k] = C_local[i][k];
// }
//}
//
//void MUL(int *A, int *B, int *C, int M, int N, int K)//A[MxK]*B[KxN]=C[MxN]
//{
//
//#pragma HLS INTERFACE m_axi depth=384 port=A offset=slave bundle=DB_A
//#pragma HLS INTERFACE m_axi depth=768 port=B offset=slave bundle=DB_B
//#pragma HLS INTERFACE m_axi depth=2048 port=C offset=slave bundle=DB_C
//
//#pragma HLS INTERFACE s_axilite register port=return bundle=CB
//#pragma HLS INTERFACE s_axilite register port=M bundle=CB
//#pragma HLS INTERFACE s_axilite register port=N bundle=CB
//#pragma HLS INTERFACE s_axilite register port=K bundle=CB
//
//#pragma HLS INTERFACE s_axilite register port=A bundle=CB
//#pragma HLS INTERFACE s_axilite register port=B bundle=CB
//#pragma HLS INTERFACE s_axilite register port=C bundle=CB
//
// static int A_local[TILE_M][TILE_K];
//#pragma HLS ARRAY_PARTITION variable=A_local complete dim=1
// static int B_local[TILE_K][TILE_N];
//#pragma HLS ARRAY_PARTITION variable=B_local complete dim=2
// static int C_local[TILE_M][TILE_N];
//#pragma HLS ARRAY_PARTITION variable=C_local complete dim=1
//
// int M_MIN, N_MIN, K_MIN;
//
// Loop_M:for(int i=0; i<M; i+= TILE_M)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=NUM_M)
// M_MIN = MIN(TILE_M, M-i);
// Loop_N:for(int j=0; j<N; j+= TILE_N)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=NUM_N)
// N_MIN = MIN(TILE_N, N-j);
// Loop_K:for(int k=0; k<K; k+= TILE_K)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=NUM_K)
// K_MIN = MIN(TILE_K, K-k);
//
// Load_A(A_local, A, i, k, K, M_MIN, K_MIN);
// Load_B(B_local, B, k, j, N, K_MIN, N_MIN);
//
// Compute_SA(A_local, B_local, C_local, k==0, M_MIN, N_MIN, K_MIN, K);
// }
//
// Store_C(C_local, C, i, j, N, M_MIN, N_MIN);
// }
// }
//}
////////////////////////////////////////////v10 end////////////////////////////////////////
////////////////////////////////////////////v9 start////////////////////////////////////////
//#define MAX(x,y) ((x)>(y)?(x):(y))
//#define MIN(x,y) ((x)<(y)?(x):(y))
//
//#define TILE_M 7
//#define TILE_N 9
//#define TILE_K 5
//
//class PE_cls {
//protected:
// int C_local;
// int k_cnt;
//public:
// void compute(hls::stream<int> &A_in, hls::stream<int> &B_in,
// hls::stream<int> &A_out, hls::stream<int> &B_out, hls::stream<int> &C_out, int K, int K_MAX, bool init);
//};
//
//void PE_cls::compute(hls::stream<int> &A_in, hls::stream<int> &B_in,
// hls::stream<int> &A_out, hls::stream<int> &B_out, hls::stream<int> &C_out, int K, int K_MAX, bool init)
//{
// int A_tmp, B_tmp;
// if(init){
// C_local = 0;
// k_cnt = 0;
// }
//
// for(int k=0; k<K; k++)
// {
//#pragma HLS PIPELINE II=1
// A_in >> A_tmp;
// B_in >> B_tmp;
//
// C_local += A_tmp * B_tmp;
//
// A_out << A_tmp;
// B_out << B_tmp;
// k_cnt++;
// }
//
// if(k_cnt == K_MAX){
// C_out << C_local;
// }
//
// return;
//}
//
//void Drain(hls::stream<int> &in, int data_num)
//{
// int drain;
// for(int k = 0; k<data_num; k++){
//#pragma HLS PIPELINE II=1
// in >> drain;
// }
//}
//
//void Compute_SA(int A_local[TILE_M][TILE_K], int B_local[TILE_K][TILE_N], int C_local[TILE_M][TILE_N], bool init, int M_MIN, int N_MIN, int K_MIN, int K_MAX)
//{
// hls::stream<int> A_inter[TILE_M][TILE_N+1];
//#pragma HLS STREAM variable=A_inter
// hls::stream<int> B_inter[TILE_M+1][TILE_N];
//#pragma HLS STREAM variable=B_inter
// hls::stream<int> C_out[TILE_M][TILE_N+1];
//#pragma HLS STREAM variable=C_out
//
// static PE_cls PE_array[TILE_M][TILE_N];
// static int K_cnt;
//
//#pragma HLS DATAFLOW
//
// if(init){
// K_cnt = 0;
// }
// K_cnt += K_MIN;
//
// for(int k=0; k<K_MIN; k++)
// {
//#pragma HLS PIPELINE II=1
// for(int i=0; i<TILE_M; i++){
// int tmp = 0;
// if(i<M_MIN)
// tmp = A_local[i][k];
// A_inter[i][0] << tmp;
// }
// }
//
// for(int k=0; k<K_MIN; k++)
// {
//#pragma HLS PIPELINE II=1
// for(int j=0; j<TILE_N; j++){
// int tmp = 0;
// if(j<N_MIN)
// tmp = B_local[k][j];
// B_inter[0][j] << tmp;
// }
// }
//
// Loop_M:for(int i=0; i<TILE_M; i++){
//#pragma HLS UNROLL
// Loop_N:for(int j=0; j<TILE_N; j++)
// {
//#pragma HLS UNROLL
// PE_array[i][j].compute(A_inter[i][j], B_inter[i][j], A_inter[i][j+1], B_inter[i+1][j], C_out[i][j], K_MIN, K_MAX, init);
// }
// }
//
// for(int i=0; i<TILE_M; i++)
// {
//#pragma HLS UNROLL
// Drain(A_inter[i][TILE_N], K_MIN);
// }
//
// for(int j=0; j<TILE_N; j++)
// {
//#pragma HLS UNROLL
// Drain(B_inter[TILE_M][j], K_MIN);
// }
//
// if(K_cnt == K_MAX){
////tranfer neighbor PE's output
// for(int j=TILE_N-1; j>=0; j--)
// for(int k=0; k<TILE_N-1-j; k++){
//#pragma HLS PIPELINE II=1
// for(int i=0; i<TILE_M; i++){
// int tmp_in, tmp_out;
// C_out[i][j+1] >> tmp_in;
// tmp_out = tmp_in;
// C_out[i][j] << tmp_out;
// }
// }
//
// for(int j=0; j<TILE_N; j++){
//#pragma HLS PIPELINE II=1
// for(int i=0; i<TILE_M; i++)
// {
// int tmp_out;
// C_out[i][0] >> tmp_out;
// if((i < M_MIN) && (j < N_MIN))
// C_local[i][j] = tmp_out;
// }
// }
// }
//}
//
//void Load_A(int A_local[TILE_M][TILE_K], int *A, int M_base, int K_base, int K_len, int M_MIN, int K_MIN)
//{
// int base_offset = M_base*K_len + K_base;
// Loop_M:for(int i=0; i<M_MIN; i++)
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_M)
// Loop_K:for(int k=0; k<K_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
//#pragma HLS PIPELINE II=1
// A_local[i][k] = A[base_offset + i*K_len + k];
// }
//}
//
//void Load_B(int B_local[TILE_K][TILE_N], int *B, int K_base, int N_base, int N_len, int K_MIN, int N_MIN)
//{
// int base_offset = K_base*N_len + N_base;
// Loop_K:for(int i=0; i<K_MIN; i++)
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
// Loop_N:for(int k=0; k<N_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_N)
//#pragma HLS PIPELINE II=1
// B_local[i][k] = B[base_offset + i*N_len + k];
// }
//}
//
//void Store_C(int C_local[TILE_M][TILE_N], int *C, int M_base, int N_base, int N_len, int M_MIN, int N_MIN)
//{
// int base_offset = M_base*N_len + N_base;
// Loop_K:for(int i=0; i<M_MIN; i++)
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_M)
// Loop_N:for(int k=0; k<N_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_N)
//#pragma HLS PIPELINE II=1
// C[base_offset + i*N_len + k] = C_local[i][k];
// }
//}
//
//void MUL(int *A, int *B, int *C, int M, int N, int K)//A[MxK]*B[KxN]=C[MxN]
//{
//
//#pragma HLS INTERFACE m_axi depth=384 port=A offset=slave bundle=DB_A
//#pragma HLS INTERFACE m_axi depth=768 port=B offset=slave bundle=DB_B
//#pragma HLS INTERFACE m_axi depth=2048 port=C offset=slave bundle=DB_C
//
//#pragma HLS INTERFACE s_axilite register port=return bundle=CB
//#pragma HLS INTERFACE s_axilite register port=M bundle=CB
//#pragma HLS INTERFACE s_axilite register port=N bundle=CB
//#pragma HLS INTERFACE s_axilite register port=K bundle=CB
//
//#pragma HLS INTERFACE s_axilite register port=A bundle=CB
//#pragma HLS INTERFACE s_axilite register port=B bundle=CB
//#pragma HLS INTERFACE s_axilite register port=C bundle=CB
//
// static int A_local[TILE_M][TILE_K];
//#pragma HLS ARRAY_PARTITION variable=A_local complete dim=1
// static int B_local[TILE_K][TILE_N];
//#pragma HLS ARRAY_PARTITION variable=B_local complete dim=2
// static int C_local[TILE_M][TILE_N];
//#pragma HLS ARRAY_PARTITION variable=C_local complete dim=1
//
// int M_MIN, N_MIN, K_MIN;
//
// Loop_M:for(int i=0; i<M; i+= TILE_M)
// {
// M_MIN = MIN(TILE_M, M-i);
// Loop_N:for(int j=0; j<N; j+= TILE_N)
// {
// N_MIN = MIN(TILE_N, N-j);
// Loop_K:for(int k=0; k<K; k+= TILE_K)
// {
// K_MIN = MIN(TILE_K, K-k);
//
// Load_A(A_local, A, i, k, K, M_MIN, K_MIN);
// Load_B(B_local, B, k, j, N, K_MIN, N_MIN);
//
// Compute_SA(A_local, B_local, C_local, k==0, M_MIN, N_MIN, K_MIN, K);
// }
//
// Store_C(C_local, C, i, j, N, M_MIN, N_MIN);
// }
// }
//}
////////////////////////////////////////////v9 end////////////////////////////////////////
////////////////////////////////////////////v8 start////////////////////////////////////////
//#define MAX(x,y) ((x)>(y)?(x):(y))
//#define MIN(x,y) ((x)<(y)?(x):(y))
//
//#define TILE_M 7
//#define TILE_N 9
//#define TILE_K 5
//
//class PE_cls {
//protected:
// int C_local;
// int k_cnt;
//public:
//// int trans_num;
// void compute(hls::stream<int> &A_in, hls::stream<int> &B_in, //hls::stream<int> &C_in,
// hls::stream<int> &A_out, hls::stream<int> &B_out, hls::stream<int> &C_out, int K, int K_MAX, bool init);
//};
//
//void PE_cls::compute(hls::stream<int> &A_in, hls::stream<int> &B_in, //hls::stream<int> &C_in,
// hls::stream<int> &A_out, hls::stream<int> &B_out, hls::stream<int> &C_out, int K, int K_MAX, bool init)
//{
// int A_tmp, B_tmp;
// if(init){
// C_local = 0;
// k_cnt = 0;
// }
//
// for(int k=0; k<K; k++)
// {
// A_in >> A_tmp;
// B_in >> B_tmp;
//
// C_local += A_tmp * B_tmp;
//
// A_out << A_tmp;
// B_out << B_tmp;
// k_cnt++;
// }
//
// if(k_cnt == K_MAX){
// C_out << C_local;
// }
//
// return;
//}
//
//void Drain(hls::stream<int> &in, int data_num)
//{
// int drain;
// for(int k = 0; k<data_num; k++){
// in >> drain;
// }
//}
//
//void Compute_SA(int A_local[TILE_M][TILE_K], int B_local[TILE_K][TILE_N], int C_local[TILE_M][TILE_N], bool init, int M_MIN, int N_MIN, int K_MIN, int K_MAX)
//{
// hls::stream<int> A_inter[TILE_M][TILE_N+1];
//#pragma HLS STREAM variable=A_inter
// hls::stream<int> B_inter[TILE_M+1][TILE_N];
//#pragma HLS STREAM variable=B_inter
// hls::stream<int> C_out[TILE_M][TILE_N+1];
//#pragma HLS STREAM variable=C_out
//
// static PE_cls PE_array[TILE_M][TILE_N];
// static int K_cnt;
//
// for(int i=0; i<TILE_M; i++)
// for(int k=0; k<K_MIN; k++)
// {
// int tmp = 0;
// if(i<M_MIN)
// tmp = A_local[i][k];
// A_inter[i][0] << tmp;
// }
//
// for(int j=0; j<TILE_N; j++)
// for(int k=0; k<K_MIN; k++)
// {
// int tmp = 0;
// if(j<N_MIN)
// tmp = B_local[k][j];
// B_inter[0][j] << tmp;
// }
//
// Loop_M:for(int i=0; i<TILE_M; i++)
// Loop_N:for(int j=0; j<TILE_N; j++)
// {
// PE_array[i][j].compute(A_inter[i][j], B_inter[i][j], /*C_out[i][j+1],*/ A_inter[i][j+1], B_inter[i+1][j], C_out[i][j], K_MIN, K_MAX, init);
// }
//
// for(int i=0; i<TILE_M; i++)
// {
// Drain(A_inter[i][TILE_N], K_MIN);
// }
//
// for(int j=0; j<TILE_N; j++)
// {
// Drain(B_inter[TILE_M][j], K_MIN);
// }
//
//
// if(init){
// K_cnt = 0;
// }
// K_cnt += K_MIN;
//
// if(K_cnt == K_MAX){
// for(int i=0; i<TILE_M; i++)//tranfer neighbor PE's output
// for(int j=TILE_N-1; j>=0; j--)
// {
// for(int k=0; k<TILE_N-1-j; k++){
// int tmp_in, tmp_out;
// C_out[i][j+1] >> tmp_in;
// tmp_out = tmp_in;
// C_out[i][j] << tmp_out;
// }
// }
//
// for(int j=0; j<TILE_N; j++)
// for(int i=0; i<TILE_M; i++)
// {
//#pragma HLS PIPELINE II=1
// int tmp_out;
// C_out[i][0] >> tmp_out;
//// C_out[i][j] >> tmp_out;
// if((i < M_MIN) && (j < N_MIN))
// C_local[i][j] = tmp_out;
// }
// }
//}
//
//void Load_A(int A_local[TILE_M][TILE_K], int *A, int M_base, int K_base, int K_len, int M_MIN, int K_MIN)
//{
// int base_offset = M_base*K_len + K_base;
// Loop_M:for(int i=0; i<M_MIN; i++)
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_M)
// Loop_K:for(int k=0; k<K_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
//
// A_local[i][k] = A[base_offset + i*K_len + k];
// }
//}
//
//void Load_B(int B_local[TILE_K][TILE_N], int *B, int K_base, int N_base, int N_len, int K_MIN, int N_MIN)
//{
// int base_offset = K_base*N_len + N_base;
// Loop_K:for(int i=0; i<K_MIN; i++)
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
// Loop_N:for(int k=0; k<N_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_N)
//
// B_local[i][k] = B[base_offset + i*N_len + k];
// }
//}
//
//void Store_C(int C_local[TILE_M][TILE_N], int *C, int M_base, int N_base, int N_len, int M_MIN, int N_MIN)
//{
// int base_offset = M_base*N_len + N_base;
// Loop_K:for(int i=0; i<M_MIN; i++)
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_M)
// Loop_N:for(int k=0; k<N_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_N)
// C[base_offset + i*N_len + k] = C_local[i][k];
// }
//}
//
//void MUL(int *A, int *B, int *C, int M, int N, int K)//A[MxK]*B[KxN]=C[MxN]
//{
//
//#pragma HLS INTERFACE m_axi depth=384 port=A offset=slave bundle=DB_A
//#pragma HLS INTERFACE m_axi depth=768 port=B offset=slave bundle=DB_B
//#pragma HLS INTERFACE m_axi depth=2048 port=C offset=slave bundle=DB_C
//
//#pragma HLS INTERFACE s_axilite register port=return bundle=CB
//#pragma HLS INTERFACE s_axilite register port=M bundle=CB
//#pragma HLS INTERFACE s_axilite register port=N bundle=CB
//#pragma HLS INTERFACE s_axilite register port=K bundle=CB
//
//#pragma HLS INTERFACE s_axilite register port=A bundle=CB
//#pragma HLS INTERFACE s_axilite register port=B bundle=CB
//#pragma HLS INTERFACE s_axilite register port=C bundle=CB
//
// static int A_local[TILE_M][TILE_K];
// static int B_local[TILE_K][TILE_N];
// static int C_local[TILE_M][TILE_N];
//
// int M_MIN, N_MIN, K_MIN;
//
// Loop_M:for(int i=0; i<M; i+= TILE_M)
// {
// M_MIN = MIN(TILE_M, M-i);
// Loop_N:for(int j=0; j<N; j+= TILE_N)
// {
// N_MIN = MIN(TILE_N, N-j);
// Loop_K:for(int k=0; k<K; k+= TILE_K)
// {
// K_MIN = MIN(TILE_K, K-k);
//
// Load_A(A_local, A, i, k, K, M_MIN, K_MIN);
// Load_B(B_local, B, k, j, N, K_MIN, N_MIN);
//
// Compute_SA(A_local, B_local, C_local, k==0, M_MIN, N_MIN, K_MIN, K);
// }
//
// Store_C(C_local, C, i, j, N, M_MIN, N_MIN);
// }
// }
//}
////////////////////////////////////////////v8 end////////////////////////////////////////
////////////////////////////////////////////v7 start////////////////////////////////////////
//#define MAX(x,y) ((x)>(y)?(x):(y))
//#define MIN(x,y) ((x)<(y)?(x):(y))
//
//#define TILE_M 7
//#define TILE_N 9
//#define TILE_K 5
//
//class PE_cls {
//protected:
// int C_local;
// int k_cnt;
//public:
//// int trans_num;
// void compute(hls::stream<int> &A_in, hls::stream<int> &B_in, //hls::stream<int> &C_in,
// hls::stream<int> &A_out, hls::stream<int> &B_out, hls::stream<int> &C_out, int K, int K_MAX, bool init);
//};
//
//void PE_cls::compute(hls::stream<int> &A_in, hls::stream<int> &B_in, //hls::stream<int> &C_in,
// hls::stream<int> &A_out, hls::stream<int> &B_out, hls::stream<int> &C_out, int K, int K_MAX, bool init)
//{
// int A_tmp, B_tmp;
// if(init){
// C_local = 0;
// k_cnt = 0;
// }
// for(int k=0; k<K; k++)
// {
// A_in >> A_tmp;
// B_in >> B_tmp;
//
// C_local += A_tmp * B_tmp;
//
// A_out << A_tmp;
// B_out << B_tmp;
// k_cnt++;
// }
//
// if(k_cnt == K_MAX){
// C_out << C_local;
//// for(int k=0; k<trans_num; k++)
//// C_out.write(C_in.read());
// }
//
// return;
//}
//
//void Drain(hls::stream<int> &in, int data_num)
//{
// int drain;
// for(int k = 0; k<data_num; k++){
// in >> drain;
// }
//}
//
//void Compute_SA(int A_local[TILE_M][TILE_K], int B_local[TILE_K][TILE_N], int C_local[TILE_M][TILE_N], bool init, int M_MIN, int N_MIN, int K_MIN, int K_MAX)
//{
// hls::stream<int> A_inter[TILE_M][TILE_N+1];
//#pragma HLS STREAM variable=A_inter
// hls::stream<int> B_inter[TILE_M+1][TILE_N];
//#pragma HLS STREAM variable=B_inter
// hls::stream<int> C_out[TILE_M][TILE_N+1];
//// hls::stream<int> C_out[TILE_M][TILE_N];
//#pragma HLS STREAM variable=C_out
//
// static PE_cls PE_array[TILE_M][TILE_N];
// static int K_cnt;
//
// for(int i=0; i<TILE_M; i++)
// for(int k=0; k<K_MIN; k++)
// {
// int tmp = 0;
// if(i<M_MIN)
// tmp = A_local[i][k];
// A_inter[i][0] << tmp;
//// A_inter[i][0] << A_local[i*K_MIN + k];
// }
//
// for(int j=0; j<TILE_N; j++)
// for(int k=0; k<K_MIN; k++)
// {
// int tmp = 0;
// if(j<N_MIN)
// tmp = B_local[k][j];
// B_inter[0][j] << tmp;
//// B_inter[0][j] << B_local[k*N_MIN + j];
// }
//
// Loop_M:for(int i=0; i<TILE_M; i++)
// Loop_N:for(int j=0; j<TILE_N; j++)
// {
//// PE_array[i][j].compute(A_inter[i][j], B_inter[i][j], A_inter[i][j+1], B_inter[i+1][j], &C_local[i][j], K_MIN, K_MAX, init);//, C_out[i][j], K_MIN);
//// PE_array[i][j].trans_num = TILE_N-j-1;
// PE_array[i][j].compute(A_inter[i][j], B_inter[i][j], /*C_out[i][j+1],*/ A_inter[i][j+1], B_inter[i+1][j], C_out[i][j], K_MIN, K_MAX, init);//, C_out[i][j], K_MIN);
// }
//
// for(int i=0; i<TILE_M; i++)
// {
// Drain(A_inter[i][TILE_N], K_MIN);
// }
//
// for(int j=0; j<TILE_N; j++)
// {
// Drain(B_inter[TILE_M][j], K_MIN);
// }
//
//
// if(init){
// K_cnt = 0;
// }
// K_cnt += K_MIN;
//
// if(K_cnt == K_MAX){
// for(int i=0; i<TILE_M; i++)
////DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_M)
// for(int j=0; j<TILE_N; j++)
// {
////DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_N)
//#pragma HLS PIPELINE II=1
// int tmp_out;
//// C_out[i][0] >> tmp_out;
// tmp_out = C_out[i][j].read();
//// C_out[i][j] >> tmp_out;
// if((i < M_MIN) && (j < N_MIN))
// C_local[i][j] = tmp_out;
// }
// }
//}
//
//void Load_A(int A_local[TILE_M][TILE_K], int *A, int M_base, int K_base, int K_len, int M_MIN, int K_MIN)
//{
// int base_offset = M_base*K_len + K_base;
// Loop_M:for(int i=0; i<M_MIN; i++)
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_M)
// Loop_K:for(int k=0; k<K_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
//
// A_local[i][k] = A[base_offset + i*K_len + k];
// }
//}
//
//void Load_B(int B_local[TILE_K][TILE_N], int *B, int K_base, int N_base, int N_len, int K_MIN, int N_MIN)
//{
// int base_offset = K_base*N_len + N_base;
// Loop_K:for(int i=0; i<K_MIN; i++)
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
// Loop_N:for(int k=0; k<N_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_N)
//
// B_local[i][k] = B[base_offset + i*N_len + k];
// }
//}
//
//void Store_C(int C_local[TILE_M][TILE_N], int *C, int M_base, int N_base, int N_len, int M_MIN, int N_MIN)
//{
// int base_offset = M_base*N_len + N_base;
// Loop_K:for(int i=0; i<M_MIN; i++)
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_M)
// Loop_N:for(int k=0; k<N_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_N)
// C[base_offset + i*N_len + k] = C_local[i][k];
// }
//}
//
//void MUL(int *A, int *B, int *C, int M, int N, int K)//A[MxK]*B[KxN]=C[MxN]
//{
//
//#pragma HLS INTERFACE m_axi depth=384 port=A offset=slave bundle=DB_A
//#pragma HLS INTERFACE m_axi depth=768 port=B offset=slave bundle=DB_B
//#pragma HLS INTERFACE m_axi depth=2048 port=C offset=slave bundle=DB_C
//
//#pragma HLS INTERFACE s_axilite register port=return bundle=CB
//#pragma HLS INTERFACE s_axilite register port=M bundle=CB
//#pragma HLS INTERFACE s_axilite register port=N bundle=CB
//#pragma HLS INTERFACE s_axilite register port=K bundle=CB
//
//#pragma HLS INTERFACE s_axilite register port=A bundle=CB
//#pragma HLS INTERFACE s_axilite register port=B bundle=CB
//#pragma HLS INTERFACE s_axilite register port=C bundle=CB
//
// static int A_local[TILE_M][TILE_K];
// static int B_local[TILE_K][TILE_N];
// static int C_local[TILE_M][TILE_N];
//
// int M_MIN, N_MIN, K_MIN;
//
// Loop_M:for(int i=0; i<M; i+= TILE_M)
// {
// M_MIN = MIN(TILE_M, M-i);
// Loop_N:for(int j=0; j<N; j+= TILE_N)
// {
// N_MIN = MIN(TILE_N, N-j);
// Loop_K:for(int k=0; k<K; k+= TILE_K)
// {
// K_MIN = MIN(TILE_K, K-k);
//
// Load_A(A_local, A, i, k, K, M_MIN, K_MIN);
// Load_B(B_local, B, k, j, N, K_MIN, N_MIN);
//
// Compute_SA(A_local, B_local, C_local, k==0, M_MIN, N_MIN, K_MIN, K);
// }
//
// Store_C(C_local, C, i, j, N, M_MIN, N_MIN);
// }
// }
//}
////////////////////////////////////////////v7 end////////////////////////////////////////
////////////////////////////////////////////v6 start////////////////////////////////////////
//#define MAX(x,y) ((x)>(y)?(x):(y))
//#define MIN(x,y) ((x)<(y)?(x):(y))
//
//#define TILE_M 7
//#define TILE_N 9
//#define TILE_K 5
//
//class PE_cls {
//protected:
// int C_local;
//// int k_cnt;
//public:
// int pe_id;
// void compute(hls::stream<int> &A_in, hls::stream<int> &B_in, hls::stream<int> &A_out, hls::stream<int> &B_out, int *C_out, int K, int K_MAX, bool init);
//};
//
//void PE_cls::compute(hls::stream<int> &A_in, hls::stream<int> &B_in, hls::stream<int> &A_out, hls::stream<int> &B_out, int *C_out, int K, int K_MAX, bool init)
//{
// int A_tmp, B_tmp;
// if(init){
// C_local = 0;
//// k_cnt = 0;
// }
// for(int k=0; k<K; k++)
// {
// A_in >> A_tmp;
// B_in >> B_tmp;
//
// C_local += A_tmp * B_tmp;
//
// A_out << A_tmp;
// B_out << B_tmp;
//// k_cnt++;
// }
//// if(k_cnt == K_MAX)
// *C_out = C_local;
// return;
//}
//
//void Drain(hls::stream<int> &in, int data_num)
//{
// int drain;
// for(int k = 0; k<data_num; k++){
// in >> drain;
// }
//}
//
//void Compute_SA(int A_local[TILE_M][TILE_K], int B_local[TILE_K][TILE_N], int C_local[TILE_M][TILE_N], bool init, int M_MIN, int N_MIN, int K_MIN, int K_MAX)
//{
// hls::stream<int> A_inter[TILE_M][TILE_N+1];
//#pragma HLS STREAM variable=A_inter
// hls::stream<int> B_inter[TILE_M+1][TILE_N];
//#pragma HLS STREAM variable=B_inter
//// hls::stream<int> C_out[TILE_M][TILE_N];
////#pragma HLS STREAM variable=C_out
//
// PE_cls PE_array[TILE_M][TILE_N];
//
// for(int i=0; i<TILE_M; i++)
// for(int k=0; k<K_MIN; k++)
// {
// int tmp = 0;
// if(i<M_MIN)
// tmp = A_local[i][k];
// A_inter[i][0] << tmp;
//// A_inter[i][0] << A_local[i*K_MIN + k];
// }
//
// for(int j=0; j<TILE_N; j++)
// for(int k=0; k<K_MIN; k++)
// {
// int tmp = 0;
// if(j<N_MIN)
// tmp = B_local[k][j];
// B_inter[0][j] << tmp;
//// B_inter[0][j] << B_local[k*N_MIN + j];
// }
//
// Loop_M:for(int i=0; i<TILE_M; i++)
// Loop_N:for(int j=0; j<TILE_N; j++)
// {
// PE_array[i][j].compute(A_inter[i][j], B_inter[i][j], A_inter[i][j+1], B_inter[i+1][j], &C_local[i][j], K_MIN, K_MAX, init);//, C_out[i][j], K_MIN);
// }
//
// for(int i=0; i<TILE_M; i++)
// {
// Drain(A_inter[i][TILE_N], K_MIN);
// }
//
// for(int j=0; j<TILE_N; j++)
// {
// Drain(B_inter[TILE_M][j], K_MIN);
// }
//
//// int src_offset = 0;
//// for(int i=0; i<M_MIN; i++)
////DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_M)
//// for(int j=0; j<N_MIN; j++)
//// {
////DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_N)
////#pragma HLS PIPELINE II=1
//// C_out[i][j] >> C_local[src_offset];
//// src_offset++;
//// }
//}
//
//void Load_A(int A_local[TILE_M][TILE_K], int *A, int M_base, int K_base, int K_len, int M_MIN, int K_MIN)
//{
// int base_offset = M_base*K_len + K_base;
// Loop_M:for(int i=0; i<M_MIN; i++)
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_M)
// Loop_K:for(int k=0; k<K_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
//
// A_local[i][k] = A[base_offset + i*K_len + k];
// }
//}
//
//void Load_B(int B_local[TILE_K][TILE_N], int *B, int K_base, int N_base, int N_len, int K_MIN, int N_MIN)
//{
// int base_offset = K_base*N_len + N_base;
// Loop_K:for(int i=0; i<K_MIN; i++)
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
// Loop_N:for(int k=0; k<N_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_N)
//
// B_local[i][k] = B[base_offset + i*N_len + k];
// }
//}
//
//void Store_C(int C_local[TILE_M][TILE_N], int *C, int M_base, int N_base, int N_len, int M_MIN, int N_MIN)
//{
// int base_offset = M_base*N_len + N_base;
// Loop_K:for(int i=0; i<M_MIN; i++)
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_M)
// Loop_N:for(int k=0; k<N_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_N)
// C[base_offset + i*N_len + k] = C_local[i][k];
// }
//}
//
//void MUL(int *A, int *B, int *C, int M, int N, int K)//A[MxK]*B[KxN]=C[MxN]
//{
//
//#pragma HLS INTERFACE m_axi depth=384 port=A offset=slave bundle=DB_A
//#pragma HLS INTERFACE m_axi depth=768 port=B offset=slave bundle=DB_B
//#pragma HLS INTERFACE m_axi depth=2048 port=C offset=slave bundle=DB_C
//
//#pragma HLS INTERFACE s_axilite register port=return bundle=CB
//#pragma HLS INTERFACE s_axilite register port=M bundle=CB
//#pragma HLS INTERFACE s_axilite register port=N bundle=CB
//#pragma HLS INTERFACE s_axilite register port=K bundle=CB
//
//#pragma HLS INTERFACE s_axilite register port=A bundle=CB
//#pragma HLS INTERFACE s_axilite register port=B bundle=CB
//#pragma HLS INTERFACE s_axilite register port=C bundle=CB
//
// static int A_local[TILE_M][TILE_K];
// static int B_local[TILE_K][TILE_N];
// static int C_local[TILE_M][TILE_N];
//
// int M_MIN, N_MIN, K_MIN;
//
// Loop_M:for(int i=0; i<M; i+= TILE_M)
// {
// M_MIN = MIN(TILE_M, M-i);
// Loop_N:for(int j=0; j<N; j+= TILE_N)
// {
// N_MIN = MIN(TILE_N, N-j);
// Loop_K:for(int k=0; k<K; k+= TILE_K)
// {
// K_MIN = MIN(TILE_K, K-k);
//
// Load_A(A_local, A, i, k, K, M_MIN, K_MIN);
// Load_B(B_local, B, k, j, N, K_MIN, N_MIN);
//
// Compute_SA(A_local, B_local, C_local, k==0, M_MIN, N_MIN, K_MIN, K);
// }
//
// Store_C(C_local, C, i, j, N, M_MIN, N_MIN);
// }
// }
//}
////////////////////////////////////////////v6 end////////////////////////////////////////
////////////////////////////////////////////v5 start////////////////////////////////////////
//#define MAX(x,y) ((x)>(y)?(x):(y))
//#define MIN(x,y) ((x)<(y)?(x):(y))
//
//#define TILE_M 4
//#define TILE_N 9
//#define TILE_K 5
//
//void PE(hls::stream<int> &A_in, hls::stream<int> &B_in, hls::stream<int> &A_out, hls::stream<int> &B_out, int *C_out, int K, bool init)//, hls::stream<int> &C_out, int K)
//{
// int A_tmp, B_tmp;
// static int C_local;
// if(init)
// C_local = 0;
// else
// C_local = *C_out;
// for(int k=0; k<K; k++)
// {
// A_in >> A_tmp;
// B_in >> B_tmp;
//
// C_local += A_tmp * B_tmp;
//
// A_out << A_tmp;
// B_out << B_tmp;
// }
// *C_out = C_local;
// return;
//}
//
//void Drain(hls::stream<int> &in, int data_num)
//{
// int drain;
// for(int k = 0; k<data_num; k++){
// in >> drain;
// }
//}
//
//void Compute_SA(int *A_local, int *B_local, int *C_local, bool init, int M_MIN, int N_MIN, int K_MIN)
//{
// hls::stream<int> A_inter[TILE_M][TILE_N+1];
//#pragma HLS STREAM variable=A_inter
// hls::stream<int> B_inter[TILE_M+1][TILE_N];
//#pragma HLS STREAM variable=B_inter
//// hls::stream<int> C_out[TILE_M][TILE_N];
////#pragma HLS STREAM variable=C_out
//
// for(int i=0; i<TILE_M; i++)
// for(int k=0; k<K_MIN; k++)
// {
// int tmp = 0;
// if(i<M_MIN)
// tmp = A_local[i*K_MIN + k];
// A_inter[i][0] << tmp;
//// A_inter[i][0] << A_local[i*K_MIN + k];
// }
//
// for(int j=0; j<TILE_N; j++)
// for(int k=0; k<K_MIN; k++)
// {
// int tmp = 0;
// if(j<N_MIN)
// tmp = B_local[k*N_MIN + j];
// B_inter[0][j] << tmp;
//// B_inter[0][j] << B_local[k*N_MIN + j];
// }
//
// Loop_M:for(int i=0; i<TILE_M; i++)
// Loop_N:for(int j=0; j<TILE_N; j++)
// {
// PE(A_inter[i][j], B_inter[i][j], A_inter[i][j+1], B_inter[i+1][j], &C_local[i*TILE_N + j], K_MIN, init);//, C_out[i][j], K_MIN);
// }
//
// for(int i=0; i<TILE_M; i++)
// {
// Drain(A_inter[i][TILE_N], K_MIN);
// }
//
// for(int j=0; j<TILE_N; j++)
// {
// Drain(B_inter[TILE_M][j], K_MIN);
// }
//
//// int src_offset = 0;
//// for(int i=0; i<M_MIN; i++)
////DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_M)
//// for(int j=0; j<N_MIN; j++)
//// {
////DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_N)
////#pragma HLS PIPELINE II=1
//// C_out[i][j] >> C_local[src_offset];
//// src_offset++;
//// }
//}
//
//void Compute(int *A_local, int *B_local, int *C_local, bool init, int M_MIN, int N_MIN, int K_MIN)
//{
// Loop_M:for(int i=0; i<M_MIN; i++)
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_M)
// Loop_N:for(int j=0; j<N_MIN; j++)
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_N)
// Loop_K:for(int k=0; k<K_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
//
// int tmp;
// if(init&&k==0)
// tmp = 0;
// else
// tmp = C_local[i*N_MIN + j];
//
// C_local[i*N_MIN + j] = tmp + A_local[i*K_MIN + k] * B_local[k*N_MIN + j];
// }
//}
//
//void Load_A(int *A_local, int *A, int M_base, int K_base, int K_len, int M_MIN, int K_MIN)
//{
// int dst_offset = 0;
// int base_offset = M_base*K_len + K_base;
// Loop_M:for(int i=0; i<M_MIN; i++)
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_M)
// Loop_K:for(int k=0; k<K_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
//
// A_local[dst_offset] = A[base_offset + i*K_len + k];
// dst_offset++;
// }
//}
//
//void Load_B(int *B_local, int *B, int K_base, int N_base, int N_len, int K_MIN, int N_MIN)
//{
// int dst_offset = 0;
// int base_offset = K_base*N_len + N_base;
// Loop_K:for(int i=0; i<K_MIN; i++)
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
// Loop_N:for(int k=0; k<N_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_N)
//
// B_local[dst_offset] = B[base_offset + i*N_len + k];
// dst_offset++;
// }
//}
//
//void Store_C(int *C_local, int *C, int M_base, int N_base, int N_len, int M_MIN, int N_MIN)
//{
//// int src_offset = 0;
// int base_offset = M_base*N_len + N_base;
// Loop_K:for(int i=0; i<M_MIN; i++)
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_M)
// Loop_N:for(int k=0; k<N_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_N)
// C[base_offset + i*N_len + k] = C_local[i*TILE_N + k];
//// C[base_offset + i*N_len + k] = C_local[src_offset];
//// src_offset++;
// }
//}
//
//void MUL(int *A, int *B, int *C, int M, int N, int K)//A[MxK]*B[KxN]=C[MxN]
//{
//
//#pragma HLS INTERFACE m_axi depth=384 port=A offset=slave bundle=DB_A
//#pragma HLS INTERFACE m_axi depth=768 port=B offset=slave bundle=DB_B
//#pragma HLS INTERFACE m_axi depth=2048 port=C offset=slave bundle=DB_C
//
//#pragma HLS INTERFACE s_axilite register port=return bundle=CB
//#pragma HLS INTERFACE s_axilite register port=M bundle=CB
//#pragma HLS INTERFACE s_axilite register port=N bundle=CB
//#pragma HLS INTERFACE s_axilite register port=K bundle=CB
//
//#pragma HLS INTERFACE s_axilite register port=A bundle=CB
//#pragma HLS INTERFACE s_axilite register port=B bundle=CB
//#pragma HLS INTERFACE s_axilite register port=C bundle=CB
//
// static int A_local[TILE_M*TILE_K];
// static int B_local[TILE_K*TILE_N];
// static int C_local[TILE_M*TILE_N];
//
// int M_MIN, N_MIN, K_MIN;
//
// Loop_M:for(int i=0; i<M; i+= TILE_M)
// {
// M_MIN = MIN(TILE_M, M-i);
// Loop_N:for(int j=0; j<N; j+= TILE_N)
// {
// N_MIN = MIN(TILE_N, N-j);
// Loop_K:for(int k=0; k<K; k+= TILE_K)
// {
// K_MIN = MIN(TILE_K, K-k);
//
// Load_A(A_local, A, i, k, K, M_MIN, K_MIN);
// Load_B(B_local, B, k, j, N, K_MIN, N_MIN);
//
// Compute_SA(A_local, B_local, C_local, k==0, M_MIN, N_MIN, K_MIN);
// }
//
// Store_C(C_local, C, i, j, N, M_MIN, N_MIN);
// }
// }
//}
////////////////////////////////////////////v5 end////////////////////////////////////////
////////////////////////////////////////////v4 start////////////////////////////////////////
//#define MAX(x,y) ((x)>(y)?(x):(y))
//#define MIN(x,y) ((x)<(y)?(x):(y))
//
//#define TILE_M 3
//#define TILE_N 5
//#define TILE_K 7
//
//void Load_A(int *A_local, int *A, int M_base, int K_base, int K_len, int M_MIN, int K_MIN)
//{
// int dst_offset = 0;
// int base_offset = M_base*K_len + K_base;
// Loop_M:for(int i=0; i<M_MIN; i++)
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_M)
// Loop_K:for(int k=0; k<K_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
//
// A_local[dst_offset] = A[base_offset + i*K_len + k];
// dst_offset++;
// }
//}
//
//void Load_B(int *B_local, int *B, int K_base, int N_base, int N_len, int K_MIN, int N_MIN)
//{
// int dst_offset = 0;
// int base_offset = K_base*N_len + N_base;
// Loop_K:for(int i=0; i<K_MIN; i++)
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
// Loop_N:for(int k=0; k<N_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_N)
//
// B_local[dst_offset] = B[base_offset + i*N_len + k];
// dst_offset++;
// }
//}
//
//void Compute(int *A_local, int *B_local, int *C_local, bool init, int M_MIN, int N_MIN, int K_MIN)
//{
// Loop_M:for(int i=0; i<M_MIN; i++)
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_M)
// Loop_N:for(int j=0; j<N_MIN; j++)
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_N)
// Loop_K:for(int k=0; k<K_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_K)
//
// int tmp;
// if(init&&k==0)
// tmp = 0;
// else
// tmp = C_local[i*N_MIN + j];
//
// C_local[i*N_MIN + j] = tmp + A_local[i*K_MIN + k] * B_local[k*N_MIN + j];
// }
//}
//
//void Store_C(int *C_local, int *C, int M_base, int N_base, int N_len, int M_MIN, int N_MIN)
//{
// int src_offset = 0;
// int base_offset = M_base*N_len + N_base;
// Loop_K:for(int i=0; i<M_MIN; i++)
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_M)
// Loop_N:for(int k=0; k<N_MIN; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=TILE_N)
//
// C[base_offset + i*N_len + k] = C_local[src_offset];
// src_offset++;
// }
//}
//
//void MUL(int *A, int *B, int *C, int M, int N, int K)//A[MxK]*B[KxN]=C[MxN]
//{
//
//#pragma HLS INTERFACE m_axi depth=65535 port=A offset=slave bundle=DB_A
//#pragma HLS INTERFACE m_axi depth=65535 port=B offset=slave bundle=DB_B
//#pragma HLS INTERFACE m_axi depth=65535 port=C offset=slave bundle=DB_C
//
//#pragma HLS INTERFACE s_axilite register port=return bundle=CB
//#pragma HLS INTERFACE s_axilite register port=M bundle=CB
//#pragma HLS INTERFACE s_axilite register port=N bundle=CB
//#pragma HLS INTERFACE s_axilite register port=K bundle=CB
//
//#pragma HLS INTERFACE s_axilite register port=A bundle=CB
//#pragma HLS INTERFACE s_axilite register port=B bundle=CB
//#pragma HLS INTERFACE s_axilite register port=C bundle=CB
//
// static int A_local[TILE_M*TILE_K];
// static int B_local[TILE_K*TILE_N];
// static int C_local[TILE_M*TILE_N];
//
// int M_MIN, N_MIN, K_MIN;
//
// Loop_M:for(int i=0; i<M; i+= TILE_M)
// {
// M_MIN = MIN(TILE_M, M-i);
// Loop_N:for(int j=0; j<N; j+= TILE_N)
// {
// N_MIN = MIN(TILE_N, N-j);
// Loop_K:for(int k=0; k<K; k+= TILE_K)
// {
// K_MIN = MIN(TILE_K, K-k);
//
// Load_A(A_local, A, i, k, K, M_MIN, K_MIN);
// Load_B(B_local, B, k, j, N, K_MIN, N_MIN);
//
// Compute(A_local, B_local, C_local, k==0, M_MIN, N_MIN, K_MIN);
// }
//
// Store_C(C_local, C, i, j, N, M_MIN, N_MIN);
// }
// }
//}
////////////////////////////////////////////v4 end////////////////////////////////////////
////////////////////////////////////////////v3 start////////////////////////////////////////
//#define MAX(x,y) ((x)>(y)?(x):(y))
//#define MIN(x,y) ((x)<(y)?(x):(y))
//
//#define TILE_M 3
//#define TILE_N 5
//#define TILE_K 7
//
//void Load_A(int *A_local, int *A, int M_base, int K_base, int K_len, int M_MIN, int K_MIN)
//{
// int dst_offset = 0;
// int base_offset = M_base*K_len + K_base;
// Loop_M:for(int i=0; i<M_MIN; i++)
// Loop_K:for(int k=0; k<K_MIN; k++)
// {
// A_local[dst_offset] = A[base_offset + i*K_len + k];
// dst_offset++;
// }
//}
//
//void Load_B(int *B_local, int *B, int K_base, int N_base, int N_len, int K_MIN, int N_MIN)
//{
// int dst_offset = 0;
// int base_offset = K_base*N_len + N_base;
// Loop_K:for(int i=0; i<K_MIN; i++)
// Loop_N:for(int k=0; k<N_MIN; k++)
// {
// B_local[dst_offset] = B[base_offset + i*N_len + k];
// dst_offset++;
// }
//}
//
//void Compute(int *A_local, int *B_local, int *C_local, bool init, int M_MIN, int N_MIN, int K_MIN)
//{
// Loop_M:for(int i=0; i<M_MIN; i++)
// Loop_N:for(int j=0; j<N_MIN; j++)
// Loop_K:for(int k=0; k<K_MIN; k++)
// {
// int tmp;
// if(init&&k==0)
// tmp = 0;
// else
// tmp = C_local[i*N_MIN + j];
//
// C_local[i*N_MIN + j] = tmp + A_local[i*K_MIN + k] * B_local[k*N_MIN + j];
// }
//}
//
//void Store_C(int *C_local, int *C, int M_base, int N_base, int N_len, int M_MIN, int N_MIN)
//{
// int src_offset = 0;
// int base_offset = M_base*N_len + N_base;
// Loop_K:for(int i=0; i<M_MIN; i++)
// Loop_N:for(int k=0; k<N_MIN; k++)
// {
// C[base_offset + i*N_len + k] = C_local[src_offset];
// src_offset++;
// }
//}
//
//void MUL(int *A, int *B, int *C, int M, int N, int K)//A[MxK]*B[KxN]=C[MxN]
//{
//
//#pragma HLS INTERFACE m_axi depth=65535 port=A offset=slave bundle=DB_A
//#pragma HLS INTERFACE m_axi depth=65535 port=B offset=slave bundle=DB_B
//#pragma HLS INTERFACE m_axi depth=65535 port=C offset=slave bundle=DB_C
//
//#pragma HLS INTERFACE s_axilite register port=return bundle=CB
//#pragma HLS INTERFACE s_axilite register port=M bundle=CB
//#pragma HLS INTERFACE s_axilite register port=N bundle=CB
//#pragma HLS INTERFACE s_axilite register port=K bundle=CB
//
//#pragma HLS INTERFACE s_axilite register port=A bundle=CB
//#pragma HLS INTERFACE s_axilite register port=B bundle=CB
//#pragma HLS INTERFACE s_axilite register port=C bundle=CB
//
// static int A_local[TILE_M*TILE_K];
// static int B_local[TILE_K*TILE_N];
// static int C_local[TILE_M*TILE_N];
//
// int M_MIN, N_MIN, K_MIN;
//
// Loop_M:for(int i=0; i<M; i+= TILE_M)
// {
// M_MIN = MIN(TILE_M, M-i);
// Loop_N:for(int j=0; j<N; j+= TILE_N)
// {
// N_MIN = MIN(TILE_N, N-j);
// Loop_K:for(int k=0; k<K; k+= TILE_K)
// {
// K_MIN = MIN(TILE_K, K-k);
//
// Load_A(A_local, A, i, k, K, M_MIN, K_MIN);
// Load_B(B_local, B, k, j, N, K_MIN, N_MIN);
//
// Compute(A_local, B_local, C_local, k==0, M_MIN, N_MIN, K_MIN);
// }
//
// Store_C(C_local, C, i, j, N, M_MIN, N_MIN);
// }
// }
//}
////////////////////////////////////////////v3 end////////////////////////////////////////
//////////////////////////////////////////v2 start////////////////////////////////////////
//void MUL(int *A, int *B, int *C, int M, int N, int K)//A[MxK]*B[KxN]=C[MxN]
//{
//
//#pragma HLS INTERFACE m_axi depth=65535 port=A offset=slave bundle=DB_A
//#pragma HLS INTERFACE m_axi depth=65535 port=B offset=slave bundle=DB_B
//#pragma HLS INTERFACE m_axi depth=65535 port=C offset=slave bundle=DB_C
//
//#pragma HLS INTERFACE s_axilite register port=return bundle=CB
//#pragma HLS INTERFACE s_axilite register port=M bundle=CB
//#pragma HLS INTERFACE s_axilite register port=N bundle=CB
//#pragma HLS INTERFACE s_axilite register port=K bundle=CB
//
//#pragma HLS INTERFACE s_axilite register port=A bundle=CB
//#pragma HLS INTERFACE s_axilite register port=B bundle=CB
//#pragma HLS INTERFACE s_axilite register port=C bundle=CB
//
// Loop_M:for(int i=0; i<M; i++)
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=NUM_M)
// Loop_N:for(int j=0; j<N; j++)
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=NUM_N)
// Loop_K:for(int k=0; k<K; k++)
// {
//DO_PRAGMA(HLS LOOP_TRIPCOUNT min=1 max=NUM_K)
//
// int tmp;
// if(k==0)
// tmp = 0;
// else
// tmp = C[i*N + j];
//
// C[i*N + j] = tmp + A[i*K + k]*B[k*N + j];
// }
//}
//////////////////////////////////////////v2 end////////////////////////////////////////
//////////////////////////////////////////v1 start////////////////////////////////////////
//void MUL(int *A, int *B, int *C, int M, int N, int K)//A[MxK]*B[KxN]=C[MxN]
//{
// for(int i=0; i<M; i++)
// for(int j=0; j<N; j++)
// for(int k=0; k<K; k++)
// {
// int tmp;
// if(k==0)
// tmp = 0;
// else
// tmp = C[i*N + j];
//
// C[i*N + j] = tmp + A[i*K + k]*B[k*N + j];
// }
//}
//////////////////////////////////////////v1 end////////////////////////////////////////
|
231eb08fd72acbe4b7392d05e509b0b13d2bf519 | b86886c28d2a8ccaf8a35af78556f60bb95ad563 | /File.h | 724e965a6c66b379a0d9b06b7fb0f7262fd8d7d3 | [
"MIT"
] | permissive | gochaorg/zipsfx-cpp | 5b6b00351d6996a8c98e3c7d59cc409f662b3add | bcfa69f3bf5009f1e4c3e426feb176268312d340 | refs/heads/master | 2021-01-24T11:03:07.046126 | 2016-10-07T19:15:26 | 2016-10-07T19:15:26 | 70,267,214 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 947 | h | File.h | /*
* File: File.h
* Author: User
*
* Created on 14 Январь 2012 г., 23:35
*/
#ifndef _FILE_H
#define _FILE_H
#include <sys/stat.h>
#include <libgen.h>
#include <vector>
#include "String.h"
class RandomAccessFile;
#include "RandomAccessFile.h"
#include "IOError.h"
class File {
protected:
String name;
public:
File(const String& name);
File(const File& orig);
File(const File& parent,const String& childName);
virtual ~File();
bool File::isExists();
bool File::isFile();
bool File::isDir();
String getPath();
String getName();
File getParent();
long getSize();
bool mkdir(bool withParents);
RandomAccessFile open(const String& mode) throw (IOError);
std::vector<File> readdir();
void copy(const File& target);
static File getTempDir();
static File getCurrentDir();
static bool setCurrentDir(File& file);
bool remove();
};
#endif /* _FILE_H */
|
38e4ab4c88e88d4bfec3bb28659c455b7cf8a68a | 59bde1cf03f3bc8d4e3a068a27f75a5f8a8a2aa5 | /test/dxtionary_bind_test.cpp | 6472e5a9573f3847594091d59e569907de33c2c6 | [] | no_license | hpb-htw/dxtionary-db | 708caa28c8dd321c7d5e223f55312d8e41d3b143 | 51da97f240b312dcde4169d153e6da6c387f4de5 | refs/heads/master | 2021-07-10T01:13:30.079606 | 2021-03-15T14:00:04 | 2021-03-15T14:00:04 | 235,292,070 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,768 | cpp | dxtionary_bind_test.cpp | #include <iostream>
#include "gtest/gtest.h"
#include "dxtionary_bind.h"
using namespace std;
ostringstream output;
int callback(void* NotUse, int argc, char** argv, char** azColName)
{
cout << argc << ' ';
for(int i = 0; i < argc; ++i)
{
output << azColName[i] << " = " << (argv[i] ? argv[i] : "NULL") << endl;
}
output << endl;
return 0;
}
namespace TEST_DXTIONARY_BIND {
static const char* dbPath = "dictionray-db.sqlite";
class DbTestFixture: public ::testing::Test {
public:
DbTestFixture( ) = default;
// code here will execute just before the test ensues
void SetUp( ) override {
int rc = std::remove(dbPath);
if(rc != 0)
{
cout << "Info: remove returned " << rc;
}
output.str("");
output.clear();
}
// code here will be called just after the test completes
// ok to through exceptions from here if need be
void TearDown( ) override {
}
~DbTestFixture( ) override = default;
};
}
namespace TEST_DXTIONARY_BIND {
TEST_F(DbTestFixture, dxtionary_bind_test_editdist3_active) {
const char* filename = ":memory:";
const char* query = "SELECT editdist3('Phantom', 'Fantom') AS editdist3;";
ostringstream err;
int rc = executeSqlQuery(filename, query, callback, err);
ASSERT_EQ(rc, 0);
string collectedResult = output.str();
string expectedResult = "editdist3 = 250\n\n";
ASSERT_EQ(collectedResult, expectedResult);
string errorText = err.str();
ASSERT_EQ(errorText, ""); // no error
}
TEST_F(DbTestFixture, dxtionary_bind_test_soundex_active) {
const char* filename = ":memory:";
const char* query = "SELECT soundex('Phantom') AS soundex;";
ostringstream err;
int rc = executeSqlQuery(filename, query, callback, err);
ASSERT_EQ(rc, 0);
string collectedResult = output.str();
string expectedResult = "soundex = P535\n\n";
ASSERT_EQ(collectedResult, expectedResult);
string errorText = err.str();
ASSERT_EQ(errorText, ""); // no error
}
TEST_F(DbTestFixture, dxtionary_bind_test_full_text_search_5_active)
{
vector<string> sql = {
string("CREATE VIRTUAL TABLE email USING fts5 (sender, title, body);"),
string("INSERT INTO email(sender, title, body) VALUES ('test-sender', 'todo', 'test body'), ('test-sender 2', 'todo task', 'test body');"),
string("SELECT sender FROM email;")
};
//";
vector<string> expected = {
"", "", "sender = test-sender\n\nsender = test-sender 2\n\n"
};
for(size_t i = 0; i < sql.size(); ++i)
{
size_t cmdLength = sql[i].length() + 1;
char* query = new char[cmdLength];
size_t copy = (sql[i]).copy(query, cmdLength);
query[copy] = '\0';
ostringstream err;
int rc = executeSqlQuery(dbPath, query, callback, err);
ASSERT_EQ(rc, 0);
string collectedResult = output.str();
string expectedResult = expected[i];
ASSERT_EQ(collectedResult, expectedResult);
string errorText = err.str();
ASSERT_EQ(errorText, ""); // no error at all
delete [] query;
}
}
// = test not happy execution-path =
// == test error code when database does not exist ==
TEST_F(DbTestFixture, dxtionary_bind_test_return_error_code_when_db_file_not_accesabel) {
const char* filename = "/tmp/not/existing/db/file.sqlite";
const char* query = "SELECT soundex('Phantom') AS soundex;";
ostringstream err;
int rc = executeSqlQuery(filename, query, callback, err);
ASSERT_EQ(rc, dxtionary::BAD_DATABASE_FILE);
}
// == test error code when syntax of querey not correct
TEST_F(DbTestFixture, dxtionary_bind_test_return_error_code_when_syntax_not_correct) {
const char* filename = ":memory:";
const char* query = "SELECT not_a_function('Phantom') AS soundex;";
ostringstream err;
int rc = executeSqlQuery(filename, query, callback, err);
ASSERT_EQ(rc, dxtionary::BAD_QUERY);
}
} |
d8d19698e3ca850f104d249f5baab0a194f90558 | ba51a4d94fefb4d840765b482af3728075382db3 | /runner/src/include/kourt/runner/logging.h | 73bee59a77c943d556da61156daf01915914c71f | [] | no_license | lfyuomr-gylo/kourt | c8a86febf88bae3df1d7cba9fcd4d9278645798e | 187c2ac88a276dbce17ebd5d7701e694af3720d0 | refs/heads/master | 2022-04-02T17:25:55.743671 | 2020-02-04T19:23:32 | 2020-02-04T19:23:32 | 163,358,699 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,988 | h | logging.h | #ifndef RUNNER_SRC_LOGGING_H_
#define RUNNER_SRC_LOGGING_H_
#include <ctime>
#include <cstdio>
#include <string>
#include <stdexcept>
enum class LoggingLevel {
kTrace = 10,
kDebug = 20,
kInfo = 30,
kWarn = 40,
kError = 50
};
const char *LoggingLevelToString(LoggingLevel level);
bool IsLoggingLevelActive(LoggingLevel level);
template<typename... Params>
void KourtDoLog(LoggingLevel level,
const char *file_name,
size_t line_number,
const std::string &message_template,
Params... message_params) {
timespec raw_now{};
clock_gettime(CLOCK_REALTIME, &raw_now);
tm now{};
localtime_r(&raw_now.tv_sec, &now);
const char *line_end = (message_template[message_template.length() - 1] == '\n')
? ""
: "\n";
std::string template_str = "%.4d-%.2d-%.2dT%.2d:%.2d:%.2d.%.3u\t%s\t%s:%d\t" + message_template + line_end;
fprintf(
stderr,
template_str.c_str(),
1900 + now.tm_year,
now.tm_mon + 1,
now.tm_mday,
now.tm_hour,
now.tm_min,
now.tm_sec,
raw_now.tv_nsec / 1'000'000,
LoggingLevelToString(level),
file_name,
line_number,
message_params...
);
}
#define LOG(level, args...) \
if (IsLoggingLevelActive(level)) { \
KourtDoLog(level, __FILE__, __LINE__, args); \
}
#ifndef TRACE
#define TRACE(args...) LOG(LoggingLevel::kTrace, args)
#else
#error "TRACE macro is already defined"
#endif
#ifndef DEBUG
#define DEBUG(args...) LOG(LoggingLevel::kDebug, args)
#else
#error "DEBUG macro is already defined"
#endif
#ifndef INFO
#define INFO(args...) LOG(LoggingLevel::kInfo, args)
#else
#error "INFO macro is already defined"
#endif
#ifndef WARN
#define WARN(args...) LOG(LoggingLevel::kWarn, args)
#else
#error "WARN macro is already defined"
#endif
#ifndef ERROR
#define ERROR(args...) LOG(LoggingLevel::kError, args)
#else
#error "ERROR macro is already defined"
#endif
#endif //RUNNER_SRC_LOGGING_H_
|
531b1414d2922311ec1e29c7b4986ab30a896888 | f5df78bad31c0d8c4923878727e9222c52ca1974 | /Scranton_IEEE_Micromouse-2016-04-04/Scranton IEEE Micromouse/nav.cpp | ad6ce4238ba2cc0bdbabce0e6e1f3651fdecc30f | [] | no_license | cameron-klales/microMouseSAC16 | d0578c6d3a2dd9b31fdcda0c4f4f009901f626bb | 604010ffe216e51b5d7f36cf5ab4d62c33a6cde2 | refs/heads/master | 2021-01-10T12:56:06.605702 | 2016-04-09T06:31:14 | 2016-04-09T06:31:14 | 54,745,657 | 0 | 0 | null | 2016-04-04T18:32:11 | 2016-03-25T20:26:29 | C | UTF-8 | C++ | false | false | 13,088 | cpp | nav.cpp | #include "nav.h"
#include "queue.h"
#include "motor.h"
#include "Arduino.h"
#define DEBUG
extern "C"
{
int nav_is_pos_in_bounds(struct nav_array *array, pos_t *position)
{
return (position->column >= 0) && (position->row >= 0) && (position->column < array->columns) && (position->row < array->rows);
}
int nav_is_in_bounds(struct nav_array *array, int8_t row, int8_t column)
{
return (row >= 0) && (column >= 0) && (row < array->rows) && (column < array->columns);
}
int nav_size(struct nav_array *array)
{
return (array->rows * array->columns);
}
void nav_init(struct nav_array *array, struct nav_cell *cells, int8_t rows, int8_t columns)
{
array->rows = rows;
array->columns = columns;
array->cells = cells;
int size = nav_size(array);
int i;
for (i = 0; i < size; i++)
{
struct nav_cell *cell = &array->cells[i];
cell->wall = 0;
cell->has_visited = 0;
cell->flood_num = -1;
cell->row = (i / array->columns);
cell->column = (i % array->columns);
}
}
struct nav_cell *nav_get_cell_pos(struct nav_array *array, pos_t *position)
{
return nav_get_cell(array, position->row, position->column);
}
struct nav_cell *nav_get_cell(struct nav_array *array, int8_t row, int8_t column)
{
int index;
/*if (! nav_is_in_bounds(array, row, column))
return 0;*/
index = (row * array->columns) + column;
return &array->cells[index];
}
void nav_reset_flood_num(struct nav_array *array)
{
int i;
int size = nav_size(array);
for(i = 0; i < size; i++)
{
struct nav_cell *cell = &array->cells[i];
cell->flood_num = -1;
}
}
int nav_is_flooded(struct nav_cell *cell)
{
return (cell->flood_num != -1);
}
void nav_flood(struct nav_array *array, pos_t *start)
{
/*Declare our buffer on the stack*/
nav_queue_cell cells[256];
nav_queue queue;
struct nav_cell *first;
nav_reset_flood_num(array);
nav_queue_init(&queue, cells, 256);
/*Start at the first cell and queue it*/
first = nav_get_cell_pos(array, start);
/*Add it to the queue*/
nav_queue_enqueue(&queue, first, 0);
while(! nav_queue_empty(&queue))
{
/*Declare our buffer on the stack*/
nav_queue_cell queue_cell;
/*Current cell*/
struct nav_cell *cell;
/*Dequeue and fill our buffer*/
nav_queue_dequeue(&queue, &queue_cell);
/*Assign our current cell*/
cell = queue_cell.cell;
/*Assign n to the flood number*/
queue_cell.cell->flood_num = queue_cell.n;
/*North*/
if (!nav_north_wall(queue_cell.cell) && nav_is_in_bounds(array, cell->row - 1, cell->column))
{
struct nav_cell *north_cell = nav_get_cell(array, cell->row - 1, cell->column);
if (!nav_is_flooded(north_cell) && !nav_queue_is_queued(&queue, north_cell))
{
nav_queue_enqueue(&queue, north_cell, queue_cell.n + 1);
}
}
/*East*/
if (!nav_east_wall(queue_cell.cell) && nav_is_in_bounds(array, cell->row, cell->column + 1))
{
struct nav_cell *east_cell = nav_get_cell(array, cell->row, cell->column + 1);
if (!nav_is_flooded(east_cell) && !nav_queue_is_queued(&queue, east_cell))
{
nav_queue_enqueue(&queue, east_cell, queue_cell.n + 1);
}
}
/*South*/
if (!nav_south_wall(queue_cell.cell) && nav_is_in_bounds(array, cell->row + 1, cell->column))
{
struct nav_cell *south_cell = nav_get_cell(array, cell->row + 1, cell->column);
if (!nav_is_flooded(south_cell) && !nav_queue_is_queued(&queue, south_cell))
{
nav_queue_enqueue(&queue, south_cell, queue_cell.n + 1);
}
}
/*West*/
if (!nav_west_wall(queue_cell.cell) && nav_is_in_bounds(array, cell->row , cell->column - 1))
{
struct nav_cell *west_cell = nav_get_cell(array, cell->row, cell->column - 1);
if (!nav_is_flooded(west_cell) && !nav_queue_is_queued(&queue, west_cell))
{
nav_queue_enqueue(&queue, west_cell, queue_cell.n + 1);
}
}
}
}
void nav_drive_to_target(struct nav_array *array, pos_t *start, pos_t *target)
{
while(! position_equal_location(start, target))
{
/*Get the next lowest neighbor*/
struct nav_cell *next_cell = nav_get_next_neighbor(array, start->row, start->column);
/*Get the direction to the next cell*/
dir_t dir = position_get_direction_to(start, next_cell->row, next_cell->column);
/*Turn to a direction*/
motor_turn_to_direction(start, dir);
start->direction = dir;
/*Move forward*/
motor_move_forward();
position_move_forward(start);
}
}
struct nav_cell *nav_get_next_neighbor(struct nav_array *array, int8_t row, int8_t column)
{
struct nav_cell *cell = nav_get_cell(array, row, column);
int target = cell->flood_num - 1;
#ifdef DEBUG
Serial.println("Checking north");
#endif
/*North*/
if (nav_is_in_bounds(array, row - 1, column) && !nav_north_wall(cell))
{
#ifdef DEBUG
Serial.println("Seeing if North is target");
#endif
struct nav_cell *north = nav_get_cell(array, row - 1, column);
if (north->flood_num == target)
{
#ifdef DEBUG
Serial.println("North is target");
#endif
return north;
}
}
#ifdef DEBUG
Serial.println("Checking East");
#endif
/*East*/
if (nav_is_in_bounds(array, row, column + 1) && !nav_east_wall(cell))
{
#ifdef DEBUG
Serial.println("Seeing if East is target");
#endif
struct nav_cell *east = nav_get_cell(array, row, column + 1);
if (east->flood_num == target)
{
#ifdef DEBUG
Serial.println("East is target");
#endif
return east;
}
}
#ifdef DEBUG
Serial.println("Checking South");
#endif
/*South*/
if (nav_is_in_bounds(array, row + 1, column) && !nav_south_wall(cell))
{
struct nav_cell *south = nav_get_cell(array, row + 1, column);
#ifdef DEBUG
Serial.println("Seeing if South is target");
#endif
if (south->flood_num == target)
{
#ifdef DEBUG
Serial.println("South is target");
#endif
return south;
}
}
#ifdef DEBUG
Serial.println("Checking West");
#endif
/*West*/
if (nav_is_in_bounds(array, row, column - 1) && !nav_west_wall(cell))
{
#ifdef DEBUG
Serial.println("Seeing if West is target");
#endif
struct nav_cell *west = nav_get_cell(array, row, column - 1);
if (west->flood_num == target)
{
#ifdef DEBUG
Serial.println("West is target");
#endif
return west;
}
}
#ifdef DEBUG
Serial.println("---- ERROR ----");
Serial.println("Reached end of condition");
Serial.println("---- ERROR ----");
#endif
// This should never happen
return 0;
}
void nav_explore(struct nav_array *array, pos_t *start)
{
nav_explore_rec(array, start);
}
void nav_explore_rec(struct nav_array *array, pos_t *current)
{
/*Get current position*/
struct nav_cell *cell = nav_get_cell_pos(array, current);
//Update the wall detection
//delay(250);
detection_update_walls(array, current);
detection_update_front_wall(array, current);
/*Mark cell as visited*/
cell->has_visited = 1;
/*North*/
if (nav_is_in_bounds(array, cell->row - 1, cell->column) && !nav_north_wall(cell))
{
struct nav_cell *north_cell = nav_get_cell(array, cell->row - 1, cell->column);
if (!north_cell->has_visited)
{
// Turn to the direction and move forward
motor_turn_to_direction(current, north);
current->direction = north;
motor_move_forward();
position_move_forward(current);
// Explore new cell
nav_explore_rec(array, current);
// Move back to original cell
motor_turn_to_direction(current, south);
current->direction = south;
motor_move_forward();
position_move_forward(current);
}
}
/*East*/
if (nav_is_in_bounds(array, cell->row, cell->column + 1) && !nav_east_wall(cell))
{
struct nav_cell *east_cell = nav_get_cell(array, cell->row, cell->column + 1);
if (!east_cell->has_visited)
{
/*Turn to the direction and move forward*/
motor_turn_to_direction(current, east);
current->direction = east;
motor_move_forward();
position_move_forward(current);
/*Explore new cell*/
nav_explore_rec(array, current);
/*Move back to original cell*/
motor_turn_to_direction(current, west);
current->direction = west;
motor_move_forward();
position_move_forward(current);
}
}
/*South*/
if (nav_is_in_bounds(array, cell->row + 1, cell->column) && !nav_south_wall(cell))
{
struct nav_cell *south_cell = nav_get_cell(array, cell->row + 1, cell->column);
if (!south_cell->has_visited)
{
/*Turn to the direction and move forward*/
motor_turn_to_direction(current, south);
current->direction = south;
motor_move_forward();
position_move_forward(current);
/*Explore new cell*/
nav_explore_rec(array, current);
/*Move back to original cell*/
motor_turn_to_direction(current, north);
current->direction = north;
motor_move_forward();
position_move_forward(current);
}
}
/*West*/
if (nav_is_in_bounds(array, cell->row, cell->column - 1) && !nav_west_wall(cell))
{
struct nav_cell *west_cell = nav_get_cell(array, cell->row, cell->column - 1);
if (!west_cell->has_visited)
{
/*Turn to the direction and move forward*/
motor_turn_to_direction(current, west);
current->direction = west;
motor_move_forward();
position_move_forward(current);
/*Explore new cell*/
nav_explore_rec(array, current);
/*Move back to original cell*/
motor_turn_to_direction(current, east);
current->direction = east;
motor_move_forward();
position_move_forward(current);
}
}
}
void nav_update_wall_cell(struct nav_cell *cell, dir_t dir)
{
if (dir == north)
{
cell->wall |= 0x01;
}
else if (dir == east)
{
cell->wall |= 0x02;
}
else if (dir == south)
{
cell->wall |= 0x04;
}
else
{
cell->wall |= 0x08;
}
}
void nav_update_wall(struct nav_array *array, pos_t *position, facing_t dir)
{
struct nav_cell *cell = nav_get_cell_pos(array, position);
/*Convert the scalar to a direction*/
dir_t wall_dir = position_convert_to_direction(position, dir);
/*Update our nav cell*/
nav_update_wall_cell(cell, wall_dir);
/*Update coresponding cell
TODO put this code somewhere else in its own subroutine*/
if (wall_dir == north && nav_is_in_bounds(array, position->row - 1, position->column))
{
struct nav_cell *north_cell = nav_get_cell(array, position->row - 1, position->column);
nav_update_wall_cell(north_cell, south);
}
else if (wall_dir == east && nav_is_in_bounds(array, position->row, position->column + 1))
{
struct nav_cell *east_cell = nav_get_cell(array, position->row, position->column + 1);
nav_update_wall_cell(east_cell, west);
}
else if (wall_dir == south && nav_is_in_bounds(array, position->row + 1, position->column))
{
struct nav_cell *south_cell = nav_get_cell(array, position->row + 1, position->column);
nav_update_wall_cell(south_cell, north);
}
else if (wall_dir == west && nav_is_in_bounds(array, position->row, position->column - 1))
{
struct nav_cell *west_cell = nav_get_cell(array, position->row, position->column - 1);
nav_update_wall_cell(west_cell, east);
}
}
uint8_t nav_north_wall(struct nav_cell *cell)
{
return cell->wall & 0x01;
}
uint8_t nav_east_wall(struct nav_cell *cell)
{
return cell->wall & 0x02;
}
uint8_t nav_south_wall(struct nav_cell *cell)
{
return cell->wall & 0x04;
}
uint8_t nav_west_wall(struct nav_cell *cell)
{
return cell->wall & 0x08;
}
}
|
85c0a9b055e0b22b526c1c9cd6bd2e413c1f4c48 | e1221f0b590a608478a3677798c9736c8b74c907 | /Black-Hole/black_hole.cpp | aa8e00ddb0d63585788f1426b2e2fb771e2de464 | [] | no_license | CyserixXx/SourceParts_Entity | a1486a6601aea6753dfa0d8038975acb76d4d51d | d9e8def3c86105878d4279dbaa10ecc482ce2f00 | refs/heads/master | 2021-01-22T02:28:54.208371 | 2013-01-23T22:11:33 | 2013-01-23T22:11:33 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,062 | cpp | black_hole.cpp | /* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
/* If you are missing that file, acquire a complete release at teeworlds.com. */
#include <engine/config.h>
#include <game/generated/protocol.h>
#include <game/server/gamecontext.h>
#include "black_hole.h"
/* Cyser!xXx's BlackHole Code 23.01.2013*/
//////////////////////////////////////////////////
// CBlackHole
//////////////////////////////////////////////////
const int m_Longitude = 150;
const int m_Strength = 4;
CBlackHole::CBlackHole(CGameWorld *pGameWorld, vec2 Pos, int Owner)
: CEntity(pGameWorld, NULL/*CGameWorld::ENTTYPE_LASER*/)
{
m_Pos = Pos;
m_Owner = Owner;
GoingToKill = false;
GameWorld()->InsertEntity(this);
}
void CBlackHole::Reset()
{
GameServer()->m_World.DestroyEntity(this);
}
void CBlackHole::Attract()
{
CCharacter *pOwnerChar = GameServer()->GetPlayerChar(m_Owner);
CCharacter *pChr = GameServer()->m_World.ClosestCharacter(m_Pos, m_Longitude, 0x0);
/*For Automatic BlackHole: */
if(pOwnerChar && pChr && pOwnerChar->GetPlayer()->GetTeam() == pChr->GetPlayer()->GetTeam())
return;
/*Don't fire if the tee is behind the wall*/
if(pChr && GameServer()->Collision()->IntersectLine(m_Pos, pChr->m_Pos, 0x0, 0))
return;
if(!pChr)
return;
if(length(m_Pos-pChr->m_Pos)>/*28*/35 && length(m_Pos-pChr->m_Pos) < m_Longitude)
{
vec2 Temp = pChr->m_Core.m_Vel +(normalize(m_Pos-pChr->m_Pos)*m_Strength);
pChr->m_Core.m_Vel = Temp;
Attracting = true;
GoingToKill = true;
}
else if(length(m_Pos-pChr->m_Pos)>m_Longitude)
{
Attracting = false;
GoingToKill = false;
}
// Hit Character:
if(GoingToKill == true)
m_Timer++;
else
m_Timer = 1;
if(GoingToKill == true)
{
if(m_Timer == 2)
GameServer()->SendBroadcast("3", pChr->GetPlayer()->GetCID());
if(m_Timer == 50)
GameServer()->SendBroadcast("2", pChr->GetPlayer()->GetCID());
if(m_Timer == 100)
GameServer()->SendBroadcast("1", pChr->GetPlayer()->GetCID());
if(m_Timer == 149)
{
GameServer()->CreateExplosion(m_Pos, m_Owner, WEAPON_HAMMER, false);
GameServer()->CreateExplosion(m_Pos, m_Owner, WEAPON_HAMMER, false);
m_Timer = 1;
}
}
//
}
void CBlackHole::CreateHole()
{
m_Buffer++;
if(m_Buffer > 5)
{
GameServer()->CreateDeath(m_Pos, m_Owner);
m_Buffer = 1;
}
}
void CBlackHole::Tick()
{
CCharacter *pOwnerChar = GameServer()->GetPlayerChar(m_Owner);
if(m_Owner != -1 && !pOwnerChar)
Reset();
Attract();
CreateHole();
}
void CBlackHole::Snap(int SnappingClient)
{
/*CCharacter *pOwnerChar = GameServer()->GetPlayerChar(m_Owner);
CNetObj_Laser *pObj = static_cast<CNetObj_Laser*>(Server()->SnapNewItem(NETOBJTYPE_LASER, m_ID, sizeof(CNetObj_Laser)));
pObj->m_X = (int)m_Pos.x;
pObj->m_Y = (int)m_Pos.y;
if(pOwnerChar && Attracting == true)
{
pObj->m_FromX = (int)pOwnerChar->m_Pos.x;
pObj->m_FromY = (int)pOwnerChar->m_Pos.y;
}
else
{
pObj->m_FromX = (int)m_Pos.x;
pObj->m_FromY = (int)m_Pos.y;
}
pObj->m_StartTick = Server()->Tick();*/
} |
c74defcb4489d5b4f036445b831aa771503e9d2f | 12440c14338552847954cece4afe6659b764bca9 | /comp4/ps0/main.cpp | f6a6dc94de98a19068ebd2e8a1234abfb4a6b7cd | [] | no_license | alex-a-pereira/school-cs | d22442710f6ec5f7f3101c8611a3d02c33fbaf28 | d33ee8012a5f0c0fe40bbd3a3e55fdd24dc61870 | refs/heads/master | 2020-04-19T20:58:39.658440 | 2019-03-05T14:13:02 | 2019-03-05T14:13:02 | 168,429,197 | 0 | 0 | null | 2019-01-30T23:50:45 | 2019-01-30T23:05:26 | null | UTF-8 | C++ | false | false | 2,516 | cpp | main.cpp | #include <SFML/Graphics.hpp>
using namespace std;
using namespace sf;
int main()
{
RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
window.setFramerateLimit(60);
RectangleShape background(Vector2f(200, 200));
background.setFillColor(Color(43, 53, 52));
CircleShape circle_frame(100.f);
circle_frame.setFillColor(Color(107, 134, 144));
Texture sprite_texture;
sprite_texture.loadFromFile("./sprite.png");
Sprite my_sprite(sprite_texture);
// Size of my sprite
int texture_x = sprite_texture.getSize().x;
int texture_y = sprite_texture.getSize().y;
// Window attributes
int max_boundary_x = window.getSize().x - texture_x;
int max_boundary_y = window.getSize().y - texture_y;
int center_x = (window.getSize().x - texture_x) / 2;
int center_y = (window.getSize().y - texture_y) / 2;
// Position of my sprite, originally start in center
int location_x = center_x;
int location_y = center_y;
// Movement directions.. bool b/c it can move more than one direction at once
bool north = false;
bool south = false;
bool east = false;
bool west = false;
while (window.isOpen())
{
my_sprite.setPosition(location_x, location_y);
Event event;
while (window.pollEvent(event))
{
if (event.type == Event::Closed) {
window.close();
}
else if (event.type == Event::KeyPressed) {
if (event.key.code == Keyboard::Space) {
location_x = center_x;
location_y = center_y;
break;
}
switch (event.key.code) {
case Keyboard::Up:
north = true;
break;
case Keyboard::Right:
east = true;
break;
case Keyboard::Down:
south = true;
break;
case Keyboard::Left:
west = true;
break;
default: break;
}
}
else if (event.type == Event::KeyReleased) {
switch (event.key.code) {
case Keyboard::Up:
north = false;
break;
case Keyboard::Right:
east = false;
break;
case Keyboard::Down:
south = false;
break;
case Keyboard::Left:
west = false;
break;
default: break;
}
}
}
// Handle sprite movement
if (north && location_y - 2 > 0) {
location_y -= 2;
}
if (east && location_x + 2 < max_boundary_x) {
location_x += 2;
}
if (south && location_y + 2 < max_boundary_y) {
location_y += 2;
}
if (west && location_x - 2 > 0) {
location_x -= 2;
}
window.clear();
window.draw(background);
window.draw(circle_frame);
window.draw(my_sprite);
window.display();
}
return 0;
}
|
1f374a487404d5e4debfbc2f0443ab9c8ae3b5e5 | c60583df124939d7faf1a01447f1e28e1b2bd9b5 | /스타듀 밸리/tree3.cpp | ba4ccbf4893436cdc821764f0e1be26933e753cf | [] | no_license | parkSee/stardewValley | cee55876f9723b71e56fbf711dc40f3ea2603bd3 | 843cd9992b4607fb0cb165ba5dae64ed232e866a | refs/heads/master | 2021-07-16T01:20:15.500751 | 2017-10-23T12:34:01 | 2017-10-23T12:34:01 | 106,686,250 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 82 | cpp | tree3.cpp | #include "stdafx.h"
#include "tree3.h"
tree3::tree3()
{
}
tree3::~tree3()
{
}
|
93c821c3ace82e5c211284c1348a51aba48d07b0 | 1f1e344a8eb537db075a08a82301f961bfc55d37 | /Polinomios/Polinomio.cpp | f43e26b77ffc7638943aa494820cf111262a1193 | [] | no_license | Alan-Poisot/Practicas | b21a7b8da70f5888dcf231273a52dd6a9b2e2619 | 056a90a4a6cc2f79df57b11c671384f4e92b712e | refs/heads/master | 2023-01-28T03:54:37.217895 | 2020-12-08T07:43:40 | 2020-12-08T07:43:40 | 298,356,867 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,091 | cpp | Polinomio.cpp | #include "Polinomio.h"
Polinomio::Polinomio() {
int n=0;
double c;
while (n<1) {
cout << "Introduzca el grado del polinomio:";
cin >> n;
}
orden=n;
for (int i = 0; i < n+1; ++i) {
cout << "Introduzca el coeficiente de x^"<<n-i<<":";
cin >> c;
coef.push_back(c);
}
}
void Polinomio::Derivar() {
coef.pop_back();
orden--;
}
void Polinomio::Integrar() {
orden++;
coef.push_back(0);
}
void Polinomio::sumar(vector<double>* A, int s) {
int lim=max(s,orden);
while (orden<lim){
orden++;
coef.insert(coef.begin(),0);
}
if (s<lim){
for (int i = 0; i < s+1; ++i) {
coef[orden-i]+=(*A)[s-i];
}
} else {
for (int i = 0; i < lim+1; ++i) {
coef[i]+=(*A)[i];
}
}
}
void Polinomio::getPol() {
for (int i = 0; i < orden; ++i) {
cout <<coef[i]<<"x^"<<orden-i;
if (coef[i+1]>=0){
cout<<"+";
}
}
cout <<coef[orden]<<"\n";
} |
6775284ee54237d35f6816969ab0954b4b50b3e0 | 8f11b828a75180161963f082a772e410ad1d95c6 | /packages/estimation/include/modules/RangeEstimationModule.h | c2cb2ca3b0451b7f7e96ecb77e5f1d6f380b5c2c | [] | no_license | venkatarajasekhar/tortuga | c0d61703d90a6f4e84d57f6750c01786ad21d214 | f6336fb4d58b11ddfda62ce114097703340e9abd | refs/heads/master | 2020-12-25T23:57:25.036347 | 2017-02-17T05:01:47 | 2017-02-17T05:01:47 | 43,284,285 | 0 | 0 | null | 2017-02-17T05:01:48 | 2015-09-28T06:39:21 | C++ | UTF-8 | C++ | false | false | 1,018 | h | RangeEstimationModule.h | /*
* Copyright (C) 2011 Robotics at Maryland
* Copyright (C) 2011 Eliot Rudnick-Cohen <erudnick@umd.edu>
* All rights reserved.
*
* Author: Eliot Rudnick-Cohen <erudnick@umd.edu>
* File: packages/estimation/include/modules/RangeEstimation.h
*/
#ifndef RAM_ESTIMATION_RANGEMODULE
#define RAM_ESTIMATION_RANGEMODULE
// STD Includes
#include <iostream>
// Library Includes
#include <log4cpp/Category.hh>
//Project Includes
#include "vehicle/include/Events.h"
#include "estimation/include/EstimatedState.h"
#include "estimation/include/EstimationModule.h"
#include "core/include/ConfigNode.h"
#include "core/include/Event.h"
namespace ram {
namespace estimation {
class RangeModule : public EstimationModule
{
public:
RangeModule(core::ConfigNode config,core::EventHubPtr eventHub,
EstimatedStatePtr estimatedState);
virtual ~RangeModule(){};
virtual void update(core::EventPtr event);
};
} // namespace estimation
} // namespace ram
#endif // RAM_ESTIMATION_RANGEMODULE
|
34180a75cb8bf57c7162238f53ecd6ccf05d7e90 | fccd69cc574da2f1f2588079acf616b6d39ac3dc | /HPSExchangeProgressDialog.cpp | abd69e761026554614518394a688dea65a5322e2 | [
"MIT"
] | permissive | PMK3D/bim_viewer_tutorial | 9707d85c025cf9e2f231b9979e5fdc82afeeaefe | 9005094a4cb3d32c1a398f82188c3201ab8600df | refs/heads/main | 2023-06-05T03:51:05.273961 | 2021-06-25T15:15:33 | 2021-06-25T15:15:33 | 380,277,323 | 0 | 0 | MIT | 2021-06-25T15:18:09 | 2021-06-25T15:18:08 | null | UTF-8 | C++ | false | false | 6,854 | cpp | HPSExchangeProgressDialog.cpp | #include "stdafx.h"
#include "HPSExchangeProgressDialog.h"
#include "afxdialogex.h"
#include "CHPSView.h"
#include <mutex>
#ifdef USING_EXCHANGE
#include "sprk_exchange.h"
#endif
std::mutex mtx;
namespace
{
bool isAbsolutePath(char const * path)
{
bool starts_with_drive_letter = strlen(path) >= 3
&& isalpha(path[0])
&& path[1] == ':'
&& strchr("/\\", path[2]);
bool starts_with_network_drive_prefix = strlen(path) >= 2
&& strchr("/\\", path[0])
&& strchr("/\\", path[1]);
return starts_with_drive_letter || starts_with_network_drive_prefix;
}
}
HPS::EventHandler::HandleResult ImportStatusEventHandler::Handle(HPS::Event const * in_event)
{
if (_progress_dlg)
{
HPS::UTF8 message = static_cast<HPS::ImportStatusEvent const *>(in_event)->import_status_message;
if (message.IsValid())
{
bool update_message = true;
if (message == HPS::UTF8("Import and Tessellation"))
_progress_dlg->SetMessage(HPS::UTF8("Stage 1/3 : Import and Tessellation"));
else if (message == HPS::UTF8("Creating Graphics Database"))
_progress_dlg->SetMessage(HPS::UTF8("Stage 2/3 : Creating Graphics Database"));
else if (isAbsolutePath(message))
{
std::string path = message;
message = path.substr(path.find_last_of("/\\") + 1).c_str();
_progress_dlg->AddLogEntry(HPS::UTF8(message));
update_message = false;
}
else
update_message = false;
if (update_message)
_progress_dlg->SetTimer(CHPSExchangeProgressDialog::STATUS_TIMER_ID, 15, NULL);
}
}
return HPS::EventHandler::HandleResult::Handled;
}
IMPLEMENT_DYNAMIC(CHPSExchangeProgressDialog, CDialogEx)
BEGIN_MESSAGE_MAP(CHPSExchangeProgressDialog, CDialogEx)
ON_WM_TIMER()
ON_BN_CLICKED(IDCANCEL, &CHPSExchangeProgressDialog::OnBnClickedCancel)
ON_BN_CLICKED(IDC_CHECK_KEEP_OPEN, &CHPSExchangeProgressDialog::OnBnClickedCheckKeepOpen)
END_MESSAGE_MAP()
CHPSExchangeProgressDialog::CHPSExchangeProgressDialog(CHPSDoc * doc, HPS::IONotifier & notifier, HPS::UTF8 const & in_title)
: CDialogEx(CHPSExchangeProgressDialog::IDD)
, _doc(doc)
, _notifier(notifier)
, _title(in_title)
, _success(false)
, _keep_dialog_open(false)
{
_import_status_event = new ImportStatusEventHandler(this);
}
CHPSExchangeProgressDialog::~CHPSExchangeProgressDialog()
{
delete _import_status_event;
}
void CHPSExchangeProgressDialog::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Control(pDX, IDC_EDIT_MESSAGES, _edit_box);
DDX_Control(pDX, IDC_PROGRESS_BAR, _progress_ctrl);
}
BOOL CHPSExchangeProgressDialog::OnInitDialog()
{
CDialogEx::OnInitDialog();
SetTimer(CHPSExchangeProgressDialog::TIMER_ID, 50, NULL);
// Set our progress bar range
_progress_ctrl.SetRange(0, 100);
_progress_ctrl.ModifyStyle(0, PBS_MARQUEE);
_progress_ctrl.SetMarquee(TRUE, 50);
GetDlgItem(IDC_IMPORT_MESSAGE)->SetWindowTextW(L"Stage 1/3 : Import and Tessellation");
HPS::WCharArray wtitle;
_title.ToWStr(wtitle);
std::wstring str_title(wtitle.data());
size_t found = str_title.find_last_of(L"/");
if (found == std::wstring::npos)
{
found = str_title.find_last_of(L"\\");
if (found == std::wstring::npos)
SetWindowText(str_title.data());
else
SetWindowText(str_title.substr(found + 1).data());
}
else
SetWindowText(str_title.substr(found + 1).data());
HPS::Database::GetEventDispatcher().Subscribe(*_import_status_event, HPS::Object::ClassID<HPS::ImportStatusEvent>());
return TRUE;
}
void CHPSExchangeProgressDialog::OnTimer(UINT_PTR nIDEvent)
{
if (nIDEvent == CHPSExchangeProgressDialog::TIMER_ID)
{
try
{
{
//update the import log
std::lock_guard<std::mutex> lock(mtx);
if (!_log_messages.empty())
{
int length = _edit_box.GetWindowTextLengthW();
wchar_t * buffer = new wchar_t[length + 1];
_edit_box.GetWindowTextW(buffer, length + 1);
HPS::UTF8 text(buffer);
delete [] buffer;
for (auto it = _log_messages.begin(), e = _log_messages.end(); it != e; ++it)
{
if (text != HPS::UTF8(""))
text += HPS::UTF8("\r\n");
text = text + HPS::UTF8("Reading ") + *it;
}
_log_messages.clear();
HPS::WCharArray wtext;
text.ToWStr(wtext);
_edit_box.SetWindowTextW(wtext.data());
_edit_box.LineScroll(_edit_box.GetLineCount());
}
}
HPS::IOResult status;
status = _notifier.Status();
if (status != HPS::IOResult::InProgress)
{
HPS::Database::GetEventDispatcher().UnSubscribe(*_import_status_event);
KillTimer(nIDEvent);
if (status == HPS::IOResult::Success)
PerformInitialUpdate();
if (!_keep_dialog_open)
EndDialog(0);
}
}
catch (HPS::IOException const &)
{
// notifier not yet created
}
}
else if (nIDEvent == CHPSExchangeProgressDialog::STATUS_TIMER_ID)
{
//update the import message
if (_message.IsValid())
{
HPS::WCharArray wchar_message;
_message.ToWStr(wchar_message);
GetDlgItem(IDC_IMPORT_MESSAGE)->SetWindowText(wchar_message.data());
KillTimer(nIDEvent);
_message = HPS::UTF8();
}
}
}
void CHPSExchangeProgressDialog::PerformInitialUpdate()
{
#ifdef USING_EXCHANGE
GetDlgItem(IDCANCEL)->EnableWindow(FALSE);
GetDlgItem(IDC_IMPORT_MESSAGE)->SetWindowText(L"Stage 3/3 : Performing Initial Update");
CHPSView * mfcView = _doc->GetCHPSView();
HPS::CADModel cadModel;
cadModel = static_cast<HPS::Exchange::ImportNotifier>(_notifier).GetCADModel();
if (!cadModel.Empty())
{
cadModel.GetModel().GetSegmentKey().GetPerformanceControl().SetStaticModel(HPS::Performance::StaticModel::Attribute);
mfcView->AttachView(cadModel.ActivateDefaultCapture().FitWorld());
}
else
ASSERT(0);
HPS::UpdateNotifier updateNotifier = mfcView->GetCanvas().UpdateWithNotifier(HPS::Window::UpdateType::Exhaustive);
updateNotifier.Wait();
GetDlgItem(IDCANCEL)->EnableWindow(TRUE);
GetDlgItem(IDCANCEL)->SetWindowTextW(L"Close Dialog");
_progress_ctrl.SetMarquee(FALSE, 9999);
_progress_ctrl.SetRange(0, 100);
_progress_ctrl.SetPos(100);
GetDlgItem(IDC_IMPORT_MESSAGE)->SetWindowText(L"Import Complete");
_progress_ctrl.Invalidate();
_progress_ctrl.UpdateWindow();
_success = true;
#endif
}
void CHPSExchangeProgressDialog::OnBnClickedCancel()
{
if (_success)
EndDialog(0);
else
{
_notifier.Cancel();
KillTimer(CHPSExchangeProgressDialog::TIMER_ID);
this->OnCancel();
}
}
void CHPSExchangeProgressDialog::OnBnClickedCheckKeepOpen()
{
CWnd * item = GetDlgItem(IDC_CHECK_KEEP_OPEN);
CButton * button = static_cast<CButton *>(item);
int check_status = button->GetCheck();
if (check_status == BST_CHECKED)
_keep_dialog_open = true;
else if (check_status == BST_UNCHECKED)
_keep_dialog_open = false;
}
void CHPSExchangeProgressDialog::AddLogEntry(HPS::UTF8 const & in_log_entry)
{
std::lock_guard<std::mutex> lock(mtx);
_log_messages.push_back(in_log_entry);
} |
be25dbb0871d07d8d596a51d8262ea570b55345e | dda4724fb249d3fab65231c26c6cac18c3e813be | /Nokia5110 Graphical Display/Nokia5110 Graphical Display/Nokia5110 Graphical Display.h | 531256bc5874b0c029e4177a10da630136614b30 | [] | no_license | MiladHajiShafiee/avr-example-projects | a7904dd1530985fb81abaf460f1fed363a6749d8 | ce2f7fee7ec9f55c5b2a4146e92455ef60262b39 | refs/heads/main | 2023-03-24T14:19:57.936691 | 2021-03-15T16:52:48 | 2021-03-15T16:52:48 | 348,051,690 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 586 | h | Nokia5110 Graphical Display.h | /*
* Nokia5110_Graphical_Display.h
*
* Created: 2018/08/24 8:53:06 صـبـح
* Author: Milad
*/
#ifndef NOKIA5110 GRAPHICAL DISPLAY_H_
#define NOKIA5110 GRAPHICAL DISPLAY_H_
#define F_CPU 8000000UL
#include <util/delay.h>
#include <string.h>
#include "AnimKid.h"
#include "SPI.h"
#include "Font.h"
class NokiaDisplay
{
public:
Spi spi;
void Command(char DATA);
void Print(char *DATA);
void Reset();
void Init();
void SetXy(char x, char y);
void Clear();
void Image(const unsigned char *image_data);
};
#endif /* NOKIA5110 GRAPHICAL DISPLAY_H_ */
|
ea84d2e6a723e598cbaa69cd0eb90d781e97f199 | 21b7d8820a0fbf8350d2d195f711c35ce9865a21 | /Card Game.cpp | dfdc5e8621807906ce1e86c4fb8d6d33056dae83 | [] | no_license | HarshitCd/Codeforces-Solutions | 16e20619971c08e036bb19186473e3c77b9c4634 | d8966129b391875ecf93bc3c03fc7b0832a2a542 | refs/heads/master | 2022-12-25T22:00:17.077890 | 2020-10-12T16:18:20 | 2020-10-12T16:18:20 | 286,409,002 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 411 | cpp | Card Game.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
map<char, int> m;
m['6']=6;
m['7']=7;
m['8']=8;
m['9']=9;
m['T']=10;
m['J']=11;
m['Q']=12;
m['K']=13;
m['A']=14;
char t; string c1, c2;
cin>>t;
cin>>c1>>c2;
if(c1[1]==t && c1[1]!=c2[1]) cout<<"YES";
else if(m[c1[0]]>m[c2[0]] && c2[1]==c1[1]) cout<<"YES";
else cout<<"NO";
return 0;
}
|
c58876076319ef4803591eaafc6b988c9962d3ca | 881a639922b568785674fe25ebfec5258c22c057 | /RayTracer.cpp | ab8dd9926bc90e51cae206b774abf2ae79f08b7e | [] | no_license | fxthomas/renderboy | 571e310616e94d53003521087b85c501154b3b43 | 557f63eb7558707dd73daf95aa0972d5de3a399b | refs/heads/master | 2021-01-19T05:29:22.212588 | 2013-02-08T14:12:52 | 2013-02-08T14:13:49 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 16,501 | cpp | RayTracer.cpp | // *********************************************************
// Ray Tracer Class
// Author : Tamy Boubekeur (boubek@gmail.com).
// Copyright (C) 2010 Tamy Boubekeur.
// All rights reserved.
// *********************************************************
#include "RayTracer.h"
#include "Ray.h"
#include "Scene.h"
#define NB_RAY 64
static RayTracer * instance = NULL;
RayTracer * RayTracer::getInstance () {
if (instance == NULL)
instance = new RayTracer ();
return instance;
}
void RayTracer::destroyInstance () {
if (instance != NULL) {
delete instance;
instance = NULL;
}
}
inline int clamp (float f, int inf, int sup) {
int v = static_cast<int> (f);
return (v < inf ? inf : (v > sup ? sup : v));
}
Vec3Df RayTracer::getColor (const Vec3Df & eye, const Vec3Df & point, const Vec3Df & normal, const Material & mat, unsigned int nb_iter, const vector <vector<Vec3Df> > & rand_lpoints) {
Vec3Df diffuseSelf,specularSelf;
Vec3Df c = mat.getColor();
Vec3Df vv = eye - point;
Vec3Df lpos, lm;
Light light;
vv.normalize();
// Occlusion (shadows)
bool occlusion = false;
Vec3Df oc_dir;
Vertex tmp;
float ir, iu_tmp, iv_tmp;
unsigned int tri_tmp;
const Object* intersectionObject;
double visibility;
for (unsigned int j = 0; j < Scene::getInstance()->getLights().size(); j++) {
light = Scene::getInstance()->getLights()[j];
lpos = cam.toWorld (light.getPos());
//lpos = light->getPos();
lm = lpos - point;
lm.normalize();
visibility=1.0f;
occlusion = false;
for(unsigned int i=0;i<nb_iter;i++) {
//don't forget to change lpos to rand_lpos for an extended source of light
// Test Occlusion
oc_dir=rand_lpoints[i][j]-point;
Ray oc_ray (point, oc_dir);
occlusion = (oc_ray.intersect(*Scene::getInstance(), tmp, &intersectionObject, ir, iu_tmp, iv_tmp, tri_tmp)) && (ir<oc_dir.getLength());
if (occlusion && (ir <0.000001)) {
//cout<<"Je m'auto intersecte"<<ir<<endl;
Ray oc_ray2(point+ oc_dir*(ir + 0.000001), oc_dir);
occlusion = (oc_ray2.intersect(*Scene::getInstance(), tmp, &intersectionObject, ir, iu_tmp, iv_tmp, tri_tmp)) && (ir<oc_dir.getLength());
}
if (occlusion) {
//cout<<"en théorie il y a occlusion"<<ir<<endl;
visibility-= 1.0f/nb_iter;
//cout<<"diminution de la visibilité..."<<visibility<<endl;
continue;
}
}
//cout<<"visibilité finale"<<visibility<<endl;
oc_dir=rand_lpoints[0][j]-point;
Ray oc_ray (point, oc_dir);
// Diffuse Light
float sc = Vec3D<float>::dotProduct(lm, normal);
diffuseSelf += light.getColor() * fabs (sc);
// Specular Light
sc = Vec3D<float>::dotProduct(normal*sc*2.f-lm, vv);
if (sc > 0.) {
sc = pow (sc, mat.getShininess() * 40.f);
specularSelf += light.getColor() * sc;
}
}
// Total color blend
c[0] = (mat.getDiffuse()*c[0]*diffuseSelf[0] + mat.getSpecular()*specularSelf[0])*visibility;
c[1] = (mat.getDiffuse()*c[1]*diffuseSelf[1] + mat.getSpecular()*specularSelf[1])*visibility;
c[2] = (mat.getDiffuse()*c[2]*diffuseSelf[2] + mat.getSpecular()*specularSelf[2])*visibility;
return c;
}
Vec3Df RayTracer::lightModel (const Vec3Df & eye, const Vec3Df & point, const Vec3Df & normal, const Material & mat, const PointCloud & pc, bool debug, unsigned int nb_iter, const vector <vector<Vec3Df> > & rand_lpoints) {
Vec3Df cdirect = getColor (eye, point, normal, mat, nb_iter, rand_lpoints);
Vec3Df cindirect;
Vec3Df diffuseSelf,specularSelf;
Vec3Df c = mat.getColor();
Vec3Df vv = eye - point;
Vec3Df lpos, lm;
vv.normalize();
float ff = 0.f;
for (vector<Surfel>::const_iterator surfel = pc.getSurfels().begin(); surfel != pc.getSurfels().end(); surfel++) {
ff += (surfel->getRadius()*surfel->getRadius());
lpos = surfel->getPosition();
lm = lpos - point;
lm.normalize();
// Diffuse Light
float sc = Vec3D<float>::dotProduct(lm, normal);
diffuseSelf += surfel->getColor() * fabs (sc);
// Specular Light
sc = Vec3D<float>::dotProduct(normal*sc*2.f-lm, vv);
if (sc > 0.) {
sc = pow (sc, mat.getShininess() * 40.f);
specularSelf += surfel->getColor() * sc;
}
}
// Total color blend
cindirect[0] = (mat.getDiffuse()*c[0]*diffuseSelf[0] + mat.getSpecular()*specularSelf[0]);
cindirect[1] = (mat.getDiffuse()*c[1]*diffuseSelf[1] + mat.getSpecular()*specularSelf[1]);
cindirect[2] = (mat.getDiffuse()*c[2]*diffuseSelf[2] + mat.getSpecular()*specularSelf[2]);
cindirect /= ff;
if (pc.getSurfels().size() !=0){
c = (cindirect + cdirect) / 2.f;
//Vec3Df c = cdirect;
}
else c=cdirect;
// Debug total color
if (debug) {
cout << " [ Color blend ]" << endl;
cout << " Computed Color: " << c << endl;
cout << " Computed Clamped Color: (" << clamp (c[0]*255.,0,255) << ", " << clamp (c[1]*255.,0,255) << ", " << clamp (c[2]*255.,0,255) << ")" << endl << endl;
}
return c;
}
Vec3Df RayTracer::lightBounce (const Vec3Df & eye, const Vec3Df & dir, const Vec3Df & point, const Vec3Df & normal, const Material & mat, const PointCloud & pc, bool debug, int d, unsigned int nb_iter, const vector <vector<Vec3Df> > & rand_lpoints) {
// If no refraction, or depth too big, return classic light model
if (d >= depth) return lightModel (eye, point, normal, mat, pc, debug, nb_iter, rand_lpoints);
if (debug) cout << " (I) Bounce depth " << d << endl;
if (debug) cout << " (I) For point " << point << endl;
// Prepare color variables
Vec3Df dirRefr, dirRefl;
Vec3Df colRefr, colRefl, colSelf;
Ray ray;
const Object* intersectionObject;
unsigned int triangle;
float ir, iu, iv;
Vertex intersectionPoint;
bool hasIntersection;
// Get color from self lighting
colSelf = lightModel (eye, point, normal, mat, pc, debug, nb_iter, rand_lpoints);
// Compute refraction/reflection vector
bool refract = dir.bounce (mat.getIOR(), normal, dirRefr, dirRefl);
// Compute refracted ray
if (refract && mat.getIOR() != 1.f && mat.getRefract() > 0.f) {
ray = Ray (point, dirRefr);
intersectionObject = NULL;
hasIntersection = ray.intersect (*Scene::getInstance(), intersectionPoint, &intersectionObject, ir, iu, iv, triangle);
if (!hasIntersection) {
colRefr = backgroundColor;
} else {
// Get color from bouncing, and compute next normal
Vec3Df p0 = intersectionObject->getMesh().getVertices()[intersectionObject->getMesh().getTriangles()[triangle].getVertex (0)].getNormal();
Vec3Df p1 = intersectionObject->getMesh().getVertices()[intersectionObject->getMesh().getTriangles()[triangle].getVertex (1)].getNormal();
Vec3Df p2 = intersectionObject->getMesh().getVertices()[intersectionObject->getMesh().getTriangles()[triangle].getVertex (2)].getNormal();
Vec3Df nor = (1-iu-iv)*p0 + iv*p1 + iu*p2;
nor.normalize();
colRefr = lightBounce (point, dirRefr, intersectionPoint.getPos(), nor, intersectionObject->getMaterial(), pc, debug, d+1, nb_iter, rand_lpoints);
}
}
// Compute reflected ray
if (mat.getReflect() > 0.f) {
ray = Ray (point, dirRefl);
intersectionObject = NULL;
hasIntersection = ray.intersect (*Scene::getInstance(), intersectionPoint, &intersectionObject, ir, iu, iv, triangle);
if (!hasIntersection) {
colRefl = backgroundColor;
} else {
// Get color from bouncing, and compute next normal
Vec3Df p0 = intersectionObject->getMesh().getVertices()[intersectionObject->getMesh().getTriangles()[triangle].getVertex (0)].getNormal();
Vec3Df p1 = intersectionObject->getMesh().getVertices()[intersectionObject->getMesh().getTriangles()[triangle].getVertex (1)].getNormal();
Vec3Df p2 = intersectionObject->getMesh().getVertices()[intersectionObject->getMesh().getTriangles()[triangle].getVertex (2)].getNormal();
Vec3Df nor = (1-iu-iv)*p0 + iv*p1 + iu*p2;
nor.normalize();
colRefl = lightBounce (point, dirRefl, intersectionPoint.getPos(), nor, intersectionObject->getMaterial(), pc, debug, d+1, nb_iter, rand_lpoints);
}
}
// Total color blend
Vec3Df c = colRefl*mat.getReflect() + colRefr*mat.getRefract() + colSelf*(1.f-mat.getRefract());
if (debug) {
cout << " [ Total color blend ]" << endl;
cout << " Computed Color: " << c << endl;
cout << " Computed Clamped Color: (" << clamp (c[0]*255.,0,255) << ", " << clamp (c[1]*255.,0,255) << ", " << clamp (c[2]*255.,0,255) << ")" << endl << endl;
}
c.scale (1.f);
return c;
}
/**
* Raytrace a single point
*/
Vec3Df RayTracer::raytraceSingle (const PointCloud & pc, float i, float j, bool debug, BoundingBox & bb, unsigned int nb_iter, const vector <vector<Vec3Df> > & rand_lpoints) {
Scene * scene = Scene::getInstance ();
const Vec3Df camPos = cam.position();
const Vec3Df direction = cam.viewDirection();
const Vec3Df upVector = cam.upVector();
const Vec3Df rightVector = cam.rightVector();
float fieldOfView = cam.horizontalFieldOfView();
float aspectRatio = cam.aspectRatio();
unsigned int screenWidth = cam.screenWidth();
unsigned int screenHeight = cam.screenHeight();
float tanX = tan (fieldOfView);
float tanY = tanX/aspectRatio;
Vec3Df stepX = (float (i) - screenWidth/2.f)/screenWidth * tanX * rightVector;
Vec3Df stepY = (float (j) - screenHeight/2.f)/screenHeight * tanY * upVector;
Vec3Df step = stepX + stepY;
Vec3Df dir = direction + step;
dir.normalize();
if (debug) {
cout << " [ Basic Information ]" << endl;
cout << " Ray Direction: " << dir << endl << endl;
}
Ray ray (camPos, dir);
Vertex intersectionPoint;
const Object* intersectionObject = NULL;
unsigned int triangle;
float ir, iu, iv;
bool hasIntersection = ray.intersect (*scene, intersectionPoint, &intersectionObject, ir, iu, iv, triangle);
if (debug) {
cout << " [ kD-Tree ]" << endl;
float f,fu,fv;
Vertex vd;
const KDTreeNode* kdt = ray.intersect (Scene::getInstance()->getObjects()[1].getKdTree(), vd, f, fu, fv, triangle);
if (kdt != NULL) {
bb = kdt->getBoundingBox();
cout << " Point distance: " << f << endl;
for (vector<unsigned int>::const_iterator it = kdt->getTriangles().begin(); it != kdt->getTriangles().end(); it++) cout << " Triangle: " << *it << endl;
} else cout << " Not found... ;(" << endl;
cout << endl;
}
if (hasIntersection) {
if (debug) {
cout << " [ Intersection ]" << endl;
cout << " Intersection with " << intersectionPoint.getPos() << endl;
cout << " Object number of triangles: " << intersectionObject->getMesh().getTriangles().size() << endl;
cout << " Intersection with triangle: " << triangle << endl;
cout << " Material: " << intersectionObject->getMaterial() << endl << endl;
}
Vec3Df p0 = intersectionObject->getMesh().getVertices()[intersectionObject->getMesh().getTriangles()[triangle].getVertex (0)].getNormal();
Vec3Df p1 = intersectionObject->getMesh().getVertices()[intersectionObject->getMesh().getTriangles()[triangle].getVertex (1)].getNormal();
Vec3Df p2 = intersectionObject->getMesh().getVertices()[intersectionObject->getMesh().getTriangles()[triangle].getVertex (2)].getNormal();
Vec3Df normal = (1-iu-iv)*p0 + iv*p1 + iu*p2;
normal.normalize();
return lightBounce (camPos, dir, intersectionPoint.getPos(), normal, intersectionObject->getMaterial(), pc, debug, 0, nb_iter, rand_lpoints);
} else {
if (debug) cout << " [ No intersection ]" << endl << endl;
return backgroundColor;
}
}
/**
* Renders the given scene with the given camera parameters into a QImage, and returns it.
*/
QImage RayTracer::render () {
// Count elapsed time
cout << " (R) Generating point cloud..." << endl;
PointCloud pc;
for (vector<Object>::iterator it = Scene::getInstance()->getObjects().begin(); it != Scene::getInstance()->getObjects().end(); it++) {
it->getMesh().recomputeSmoothVertexNormals(1);
pc.add (*it, cam);
}
QTime timer;
timer.start();
cout << " (R) Raytracing: Start" << endl;
//for (vector<Object>::iterator it = Scene::getInstance()->getObjects().begin(); it != Scene::getInstance()->getObjects().end(); it++) it->getKdTree()->show();
// Create an image to hold the final raytraced render
QImage image (QSize (cam.screenWidth(), cam.screenHeight()), QImage::Format_RGB888);
// For each camera pixel, cast a ray and compute its reflecting color
BoundingBox b;
Scene * scene = Scene::getInstance ();
unsigned int nb_iter = NB_RAY;
vector <vector<Vec3Df> > rand_lpoints(nb_iter, vector<Vec3Df>(scene->getLights().size(), Vec3Df(0.f,0.f,0.f)));
for (vector<Light>::iterator light = scene->getLights().begin(); light != scene->getLights().end(); light++) {
int num_light=0;
Vec3Df lpos = cam.toWorld (light->getPos());
float lrad= light->getRadius();
Vec3Df lor= cam.toWorld (light->getOrientation());
const float PI = 3.1415926535;
if (lrad==0) nb_iter=1;
rand_lpoints[0][num_light]=lpos;
for(unsigned int j=1;j<nb_iter;j++){
double rand_rad =((double)rand() / ((double)RAND_MAX + 1) * lrad);
double rand_ang =((double)rand() / ((double)RAND_MAX + 1) * 2 * PI);
Vec3Df v0 (0.0f, -lor[2], lor[1]);
Vec3Df v1 (lor[1]*lor[1]+lor[2]*lor[2], -lor[0]*lor[1], -lor[0]*lor[2]);
v0.normalize();
v1.normalize();
rand_lpoints[j][num_light]= lpos+ rand_rad* (cos(rand_ang)*v0+sin(rand_ang)*v1);
}
num_light++;
}
if (b.getAliasing()==1){
#pragma omp parallel for default(shared) schedule(dynamic)
for (unsigned int i = 0; i < 2*(unsigned int)cam.screenWidth(); i++) {
emit progress (i/2);
for (unsigned int j = 0; j < 2*(unsigned int)cam.screenHeight(); j++) {
// Raytrace
if ((i%2==0)&&(j%2==0)){
Vec3Df c1 = raytraceSingle (pc/*PointCloud()*/, (float)i/2.0f, (float)j/2.0f, false, b, nb_iter, rand_lpoints);
Vec3Df c2 = raytraceSingle (pc/*PointCloud()*/, (float)(i-1)/2.0f, (float)j/2.0f, false, b, nb_iter, rand_lpoints);
Vec3Df c3 = raytraceSingle (pc/*PointCloud()*/, (float)i/2.0f, (float)(j-1)/2.0f, false, b, nb_iter, rand_lpoints);
Vec3Df c4 = raytraceSingle (pc/*PointCloud()*/, (float)(i-1)/2.0f, (float)(j-1)/2.0f, false, b, nb_iter, rand_lpoints);
Vec3Df c=(c1+c2+c3+c4)/4;
// Depth map
//float f = (c - cam.position()).getSquaredLength();
//image.setPixel (i, ((cam.screenHeight()-1)-j), qRgb (clamp (f, 0, 255), clamp (f, 0, 255), clamp (f, 0, 255)));
// Computed lighting
image.setPixel (i/2, ((cam.screenHeight()-1)-j/2), qRgb (clamp (c[0]*255., 0, 255), clamp (c[1]*255., 0, 255), clamp (c[2]*255., 0, 255)));
}
}
}
}
else {
for (unsigned int i = 0; i < (unsigned int)cam.screenWidth(); i++) {
emit progress (i);
for (unsigned int j = 0; j < (unsigned int)cam.screenHeight(); j++) {
// Raytrace
Vec3Df c = raytraceSingle (pc/*PointCloud()*/, i, j, false, b, nb_iter, rand_lpoints);
// Depth map
//float f = (c - cam.position()).getSquaredLength();
//image.setPixel (i, ((cam.screenHeight()-1)-j), qRgb (clamp (f, 0, 255), clamp (f, 0, 255), clamp (f, 0, 255)));
// Computed lighting
image.setPixel (i, ((cam.screenHeight()-1)-j), qRgb (clamp (c[0]*255., 0, 255), clamp (c[1]*255., 0, 255), clamp (c[2]*255., 0, 255)));
}
}
}
// Return image
cout << " (R) Raytracing done! (" << timer.elapsed() << " ms)" << endl;
emit progress ((unsigned int)cam.screenWidth());
return image;
}
BoundingBox RayTracer::debug (unsigned int i, unsigned int j) {
BoundingBox bb;
Scene * scene = Scene::getInstance ();
unsigned int nb_iter = NB_RAY;
vector <vector<Vec3Df> > rand_lpoints(nb_iter, vector<Vec3Df>(scene->getLights().size(), Vec3Df(0.f,0.f,0.f)));
for (vector<Light>::iterator light = scene->getLights().begin(); light != scene->getLights().end(); light++) {
int num_light=0;
Vec3Df lpos = cam.toWorld (light->getPos());
float lrad= light->getRadius();
Vec3Df lor= cam.toWorld (light->getOrientation());
const float PI = 3.1415926535;
if (lrad==0) nb_iter=1;
for(unsigned int k=0;k<scene->getLights().size();k++){
rand_lpoints[0][k]=lpos;
}
for(unsigned int j=1;j<nb_iter;j++){
double rand_rad =((double)rand() / ((double)RAND_MAX + 1) * lrad);
double rand_ang =((double)rand() / ((double)RAND_MAX + 1) * 2 * PI);
Vec3Df v0 (0.0f, -lor[2], lor[1]);
Vec3Df v1 (lor[1]*lor[1]+lor[2]*lor[2], -lor[0]*lor[1], -lor[0]*lor[2]);
v0.normalize();
v1.normalize();
rand_lpoints[j][num_light]= lpos+ rand_rad* (cos(rand_ang)*v0+sin(rand_ang)*v1);
}
num_light++;
}
raytraceSingle (PointCloud(), i, j, true, bb, nb_iter, rand_lpoints);
return bb;
}
|
60b9227038d8266fb5d72f460a3f5bbe29330db1 | 880557ea1db4b385e7dca82afb82818e7e47f5dd | /tests/physicsTests/physicsWorldTests.cpp | c640926a06c26706cbe1bc8ade3492ba629f5dc4 | [] | no_license | fscur/phi | 45db0903463add36108be948381511a7f74f4c8d | 4b147bbd589b0bec89f59fa3ed843b927b6b0004 | refs/heads/master | 2021-01-20T11:44:18.781654 | 2017-02-22T13:53:22 | 2017-02-22T13:53:22 | 82,651,381 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,067 | cpp | physicsWorldTests.cpp | #include <precompiled.h>
#include <phi.h>
#include <gtest\gtest.h>
#include <core\node.h>
#include <physics\physicsWorld.h>
using namespace phi;
class physicsWorldWithCubeFixture :
public testing::Test
{
public:
physicsWorld* physicsWorld = nullptr;
node* cubeNode = nullptr;
public:
void SetUp()
{
cubeNode = new node();
auto cubeCollider = new boxCollider(vec3(), vec3(1.0f));
cubeNode->addComponent(cubeCollider);
physicsWorld = new phi::physicsWorld();
physicsWorld->addCollider(cubeCollider);
}
void TearDown()
{
safeDelete(physicsWorld);
safeDelete(cubeNode);
}
};
TEST_F(physicsWorldWithCubeFixture, sweep_cubeAlmostCollidingFromTheSide_doesNotCollide)
{
//Arrange
auto cube = new boxCollider(vec3(1.001f, 1.0f, 0.0f), vec3(1.0f));
//auto cube = new boxCollider(vec3(1.00010002f, 1.00079584f, 0.0f), vec3(1.0f));
auto sweepTest = sweep::singleToSceneTest();
sweepTest.collider = cube;
sweepTest.transform = new transform();
sweepTest.parameters.direction = vec3(0.0f, -1.0f, 0.0f);
sweepTest.parameters.distance = 1.0f;
sweepTest.parameters.maximumHits = 1;
sweepTest.parameters.disregardDivergentNormals = false;
//Act
auto testResult = physicsWorld->sweep(sweepTest);
//Assert
ASSERT_FALSE(testResult.collided);
}
TEST_F(physicsWorldWithCubeFixture, sweep_cubeHittingFromTheSide_collidesWithCorrectDistance)
{
//Arrange
auto cube = new boxCollider(vec3(1.5f, 0.0f, 0.0f), vec3(1.0f));
auto sweepTest = sweep::singleToSceneTest();
sweepTest.collider = cube;
sweepTest.transform = new transform();
sweepTest.parameters.direction = vec3(-1.0f, 0.0f, 0.0f);
sweepTest.parameters.distance = 0.5f;
sweepTest.parameters.maximumHits = 1;
sweepTest.parameters.disregardDivergentNormals = false;
//Act
auto testResult = physicsWorld->sweep(sweepTest);
//Assert
ASSERT_TRUE(testResult.collided);
ASSERT_EQ(testResult.collisions[0].distance, 0.5f);
} |
fa8050af8a8a79d63a0ccde62c744b3e57e8101b | b40ebc7b656076cc75ca57c5ff44e487c855e6ec | /ClothDemo/include/Spring.h | 1976d1caf284eb62b8945c5184f1eaba05955242 | [] | no_license | pxk5958/QUIX-Engine | 9c6a462cd162f847c0190155fe7802ec4764638e | 5f4ca058d39a3c86c4b2dc39eaf6c5783e9e1be8 | refs/heads/master | 2020-05-20T18:42:31.378816 | 2017-03-10T13:02:56 | 2017-03-10T13:02:56 | 84,506,353 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 931 | h | Spring.h | #ifndef SPRING_H
#define SPRING_H
class Spring
{
public:
Spring(float _stiffness, float _damping, Particle* _start, Particle* _end, float length)
{
stiffness = _stiffness;
damping = _damping;
restLength = length;
start = _start;
end = _end;
}
~Spring();
void applyForce()
{
Vector3 dir = start->getPos() - end->getPos();
D3DXVECTOR3 direction = D3DXVECTOR3(dir.getX(), dir.getY(), dir.getZ());
if( direction != D3DXVECTOR3(0,0,0) )
{
float currentLength = D3DXVec3Length(&direction);
D3DXVec3Normalize(&direction, &direction);
D3DXVECTOR3 force = -stiffness * ((currentLength - restLength) * direction);
force -= damping * D3DXVec3Dot( &(start->velocity - end->velocity), &direction) * direction;
start->force += force;
end->force -= force;
}
}
void clearForce();
private:
float stiffness;
float damping;
float restLength;
Particle* start;
Particle* end;
};
#endif |
a5bfcb224b11604eb2b10993e63916e42ec0de5f | 74548248cdf4aa7ab9213b9b801ee2dde669a9ad | /part-4/9/2.cpp | fd3d616cee5d7fd389b842dbdaf6ed156e59324c | [] | no_license | f2rkan/intro-to-Programming-w-c-plus-plus | e92e9da15d70b10030ba1ff73c2884df8b25e8d6 | 263637d797e385290daf2f6806a82149f5e87c1e | refs/heads/main | 2023-06-14T16:57:10.772542 | 2021-07-03T11:11:56 | 2021-07-03T11:11:56 | 382,592,830 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 844 | cpp | 2.cpp | #include<iostream>
const int Max = 10;
int main(void)
{
using namespace std;
double donation[Max];
double value, total = 0;
int index = 0;
cout << "donation " << index + 1 << ": ";
cin >> value;
while(cin.good() && index < Max)
{
donation[index] = value;
total += value;
if(Max > ++index)
{
cout << "donation " << index + 1 << ": ";
cin >> value;
}
}
cout << "bagis ortalamasi: " << total / index << endl;
int ortalama_ustu = 0;
for(int i = 0; i < index; i++)
{
if(donation[i] > total / index)
{
ortalama_ustu++;
}
}
cout << "ortalama ustu bagis yapan kisi sayisi: " << ortalama_ustu << endl;
cout << "Bye." << endl;
return 0;
} |
b2dc0d501d2d30cfa6b17c3e2a0f045709f6cd89 | 44125a330e13a988b9d01aded6cdf59b1b0411fa | /56 Merge Intervals/56 LL.cpp | 222d7eacf49b1a62351f4a2fb4247d0334987cf1 | [] | no_license | LindongLi/Leetcode | 38da93d85b2722358faf10ab1b3f48159400fa11 | 3cb38b21cd19467c758bc248527360e3202152e9 | refs/heads/master | 2021-01-10T22:14:00.186644 | 2015-10-16T03:01:35 | 2015-10-16T03:01:35 | 35,410,660 | 1 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 1,366 | cpp | 56 LL.cpp | #include <vector>
#include <iostream>
using namespace std;
struct Interval
{
int start;
int end;
Interval() : start(0), end(0) {}
Interval(int s, int e) : start(s), end(e) {}
};
/*
https://leetcode.com/problems/merge-intervals/
Given a collection of intervals, merge all overlapping intervals.
For example,
Given [1,3],[2,6],[8,10],[15,18],
return [1,6],[8,10],[15,18].
*/
class Solution
{
private:
static bool compare(Interval &a, Interval &b)
{
return (a.start < b.start);
}
public:
vector<Interval> merge(vector<Interval>& intervals)
{
if (intervals.size() < 2) return intervals;
sort(intervals.begin(), intervals.end(), Solution::compare);
vector<Interval>::iterator read = intervals.begin() + 1;
vector<Interval>::iterator write = intervals.begin();
for (; read != intervals.end(); ++read)
{
if (write[0].end >= read[0].start)
{
write[0].end = max(write[0].end, read[0].end);
continue;
}
++write;
write[0].start = read[0].start;
write[0].end = read[0].end;
}
intervals.erase(write + 1, intervals.end());
return intervals;
}
};
/*
idea: sort and loop merge, delete tail
complexity: Time O(NlogN)
*/
int main(void)
{
vector<Interval> intervals;
intervals.push_back(Interval(1, 3));
intervals.push_back(Interval(2, 6));
Solution engine;
cout << engine.merge(intervals).size() << '\n';
return 0;
} |
5f7102ef71cc067f2d75475b3373b779a1553f07 | c4ec391748dc6a684de66d817305d6021a820fb1 | /src/Cipher.h | a0d5cf0778b228b6921aea5256fbd3a47a78bb82 | [] | no_license | lucinda27/Final-project1 | 6bfc8f107d1823b2f730b3fd36f9ad509a7570b4 | 486a9e1af6686b6ddb82baccdf1e33793d45ea2a | refs/heads/main | 2023-05-07T11:41:49.541397 | 2021-06-03T06:57:44 | 2021-06-03T06:57:44 | 367,151,139 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 479 | h | Cipher.h | #ifndef Cipher_H
#define Cipher_H
#include <string>
using namespace std;
class Cipher
{
private:
int count1=0;
int count2=0;
int l;
int length;
public:
Cipher();
void setPlaintext(const string ptext);
string noSpace();
int setLength();
string lowerCase();
string subString();
int detPos();
int movePos();
int revPos();
string enCipher();
string deCipher();
};
#endif
|
7a350d48ac52bec9a6bd6fcaa6197d49d3d503fc | b58b041560d9383893536f9f05a0275c74a6efeb | /include/cpp-sort/detail/low_comparisons/sort12.h | a795bc0139ed0711b57e4fe060e33607a7ff2d41 | [
"MIT",
"BSL-1.0",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"LLVM-exception",
"Zlib",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | afakihcpr/cpp-sort | 314fa90342983f195edb5e70783d4d8c70883cbb | 8e4d3728f26d654899f54dc261e3765fdd782acb | refs/heads/master | 2023-08-26T11:36:42.195133 | 2021-07-27T14:31:38 | 2021-07-27T14:31:38 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,965 | h | sort12.h | /*
* Copyright (c) 2015-2017 Morwenn
* SPDX-License-Identifier: MIT
*/
#ifndef CPPSORT_DETAIL_LOW_COMPARISONS_SORT12_H_
#define CPPSORT_DETAIL_LOW_COMPARISONS_SORT12_H_
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <functional>
#include <type_traits>
#include <utility>
#include <cpp-sort/sorter_traits.h>
#include <cpp-sort/utility/as_function.h>
#include <cpp-sort/utility/functional.h>
#include <cpp-sort/utility/iter_move.h>
#include "../swap_if.h"
namespace cppsort
{
namespace detail
{
template<>
struct low_comparisons_sorter_impl<12u>
{
template<
typename RandomAccessIterator,
typename Compare = std::less<>,
typename Projection = utility::identity,
typename = std::enable_if_t<is_projection_iterator_v<
Projection, RandomAccessIterator, Compare
>>
>
auto operator()(RandomAccessIterator first, RandomAccessIterator,
Compare compare={}, Projection projection={}) const
-> void
{
using utility::iter_swap;
auto&& comp = utility::as_function(compare);
auto&& proj = utility::as_function(projection);
low_comparisons_sorter<10u>{}(first+1u, first+11u, compare, projection);
iter_swap_if(first, first + 11u, compare, projection);
if (comp(proj(first[1u]), proj(first[0u]))) {
iter_swap(first, first + 1u);
if (comp(proj(first[2u]), proj(first[1u]))) {
iter_swap(first + 1u, first + 2u);
if (comp(proj(first[3u]), proj(first[2u]))) {
iter_swap(first + 2u, first + 3u);
if (comp(proj(first[4u]), proj(first[3u]))) {
iter_swap(first + 3u, first + 4u);
if (comp(proj(first[5u]), proj(first[4u]))) {
iter_swap(first + 4u, first + 5u);
if (comp(proj(first[6u]), proj(first[5u]))) {
iter_swap(first + 5u, first + 6u);
if (comp(proj(first[7u]), proj(first[6u]))) {
iter_swap(first + 6u, first + 7u);
if (comp(proj(first[8u]), proj(first[7u]))) {
iter_swap(first + 7u, first + 8u);
if (comp(proj(first[9u]), proj(first[8u]))) {
iter_swap(first + 8u, first + 9u);
iter_swap_if(first + 9u, first + 10u,
compare, projection);
}
}
}
}
}
}
}
}
}
if (comp(proj(first[11u]), proj(first[10u]))) {
iter_swap(first + 10u, first + 11u);
if (comp(proj(first[10u]), proj(first[9u]))) {
iter_swap(first + 9u, first + 10u);
if (comp(proj(first[9u]), proj(first[8u]))) {
iter_swap(first + 8u, first + 9u);
if (comp(proj(first[8u]), proj(first[7u]))) {
iter_swap(first + 7u, first + 8u);
if (comp(proj(first[7u]), proj(first[6u]))) {
iter_swap(first + 6u, first + 7u);
if (comp(proj(first[6u]), proj(first[5u]))) {
iter_swap(first + 5u, first + 6u);
if (comp(proj(first[5u]), proj(first[4u]))) {
iter_swap(first + 4u, first + 5u);
if (comp(proj(first[4u]), proj(first[3u]))) {
iter_swap(first + 3u, first + 4u);
if (comp(proj(first[3u]), proj(first[2u]))) {
iter_swap(first + 2u, first + 3u);
iter_swap_if(first + 1u, first + 2u,
std::move(compare), std::move(projection));
}
}
}
}
}
}
}
}
}
}
};
}}
#endif // CPPSORT_DETAIL_LOW_COMPARISONS_SORT12_H_
|
d6195b06cbb9cbacc370ffa50ba5f9aec3f32015 | 195f0527395e43b1bdfc2707c776c6f6fa263d33 | /modules/gui/src/main.cpp | abf285937f7fdbe75d352ddb32cec6358684a087 | [] | no_license | smanthe/camera_calibration_tool | 6f52a484d1d35767167e9ed92791ee9f5bcde627 | 7d9c693929b6332c3b70ccb4a1cb63eb2b79c0a0 | refs/heads/master | 2022-02-23T13:19:33.473194 | 2022-02-22T07:09:58 | 2022-02-22T07:09:58 | 53,418,496 | 5 | 1 | null | 2017-06-24T16:59:30 | 2016-03-08T14:27:29 | C++ | UTF-8 | C++ | false | false | 364 | cpp | main.cpp | /*
* main.cpp
*
* Created on: 30.12.2013
* Author: Stephan Manthe
*/
#include "CalibrationWidget.h"
#include <QApplication>
#include <QtGui>
int main(int argc, char* argv[])
{
setenv("LC_ALL", "C", 1);
QApplication app(argc, argv);
CalibrationWidget calibWidget;
calibWidget.show();
calibWidget.raise();
return app.exec();
}
|
15bf307b3165a3d6be17ad4b0a40dde630f54868 | ec8364edc6db44b15a38b2baf34899f74c6e8d39 | /include/winrt/Windows.Services.Maps.0.h | 8eca935abf54793e2aa5ebe5632367db3f6845f6 | [] | no_license | adrianstephens/win_arty | 2ff906a5b0c4b080ddc366c75098d12c56967da4 | 3fef806596e11ab66d33cb2649aee22071daba66 | refs/heads/master | 2020-03-11T17:16:46.134747 | 2018-04-19T03:12:22 | 2018-04-19T03:12:22 | 130,142,466 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,088 | h | Windows.Services.Maps.0.h | #pragma once
// generated by isopod tools
#include "pre_include.h"
namespace iso_winrt {
// forward types
namespace Windows { namespace Services { namespace Maps {
enum class MapRouteOptimization : int {
Time = 0,
Distance = 1,
TimeWithTraffic = 2,
Scenic = 3,
};
enum class MapRouteRestrictions : unsigned {
None = 0x0,
Highways = 0x1,
TollRoads = 0x2,
Ferries = 0x4,
Tunnels = 0x8,
DirtRoads = 0x10,
Motorail = 0x20,
};
enum class MapRouteManeuverKind : int {
None = 0,
Start = 1,
Stopover = 2,
StopoverResume = 3,
End = 4,
GoStraight = 5,
UTurnLeft = 6,
UTurnRight = 7,
TurnKeepLeft = 8,
TurnKeepRight = 9,
TurnLightLeft = 10,
TurnLightRight = 11,
TurnLeft = 12,
TurnRight = 13,
TurnHardLeft = 14,
TurnHardRight = 15,
FreewayEnterLeft = 16,
FreewayEnterRight = 17,
FreewayLeaveLeft = 18,
FreewayLeaveRight = 19,
FreewayContinueLeft = 20,
FreewayContinueRight = 21,
TrafficCircleLeft = 22,
TrafficCircleRight = 23,
TakeFerry = 24,
};
enum class MapManeuverNotices : unsigned {
None = 0x0,
Toll = 0x1,
Unpaved = 0x2,
};
enum class MapLocationFinderStatus : int {
Success = 0,
UnknownError = 1,
InvalidCredentials = 2,
BadLocation = 3,
IndexFailure = 4,
NetworkFailure = 5,
NotSupported = 6,
};
enum class MapRouteFinderStatus : int {
Success = 0,
UnknownError = 1,
InvalidCredentials = 2,
NoRouteFound = 3,
NoRouteFoundWithGivenOptions = 4,
StartPointNotFound = 5,
EndPointNotFound = 6,
NoPedestrianRouteFound = 7,
NetworkFailure = 8,
NotSupported = 9,
};
enum class MapLocationDesiredAccuracy : int {
High = 0,
Low = 1,
};
enum class WaypointKind : int {
Stop = 0,
Via = 1,
};
enum class MapServiceDataUsagePreference : int {
Default = 0,
OfflineMapDataOnly = 1,
};
enum class TrafficCongestion : int {
Unknown = 0,
Light = 1,
Mild = 2,
Medium = 3,
Heavy = 4,
};
enum class ManeuverWarningKind : int {
None = 0,
Accident = 1,
AdministrativeDivisionChange = 2,
Alert = 3,
BlockedRoad = 4,
CheckTimetable = 5,
Congestion = 6,
Construction = 7,
CountryChange = 8,
DisabledVehicle = 9,
GateAccess = 10,
GetOffTransit = 11,
GetOnTransit = 12,
IllegalUTurn = 13,
MassTransit = 14,
Miscellaneous = 15,
NoIncident = 16,
Other = 17,
OtherNews = 18,
OtherTrafficIncidents = 19,
PlannedEvent = 20,
PrivateRoad = 21,
RestrictedTurn = 22,
RoadClosures = 23,
RoadHazard = 24,
ScheduledConstruction = 25,
SeasonalClosures = 26,
Tollbooth = 27,
TollRoad = 28,
TollZoneEnter = 29,
TollZoneExit = 30,
TrafficFlow = 31,
TransitLineChange = 32,
UnpavedRoad = 33,
UnscheduledConstruction = 34,
Weather = 35,
};
enum class ManeuverWarningSeverity : int {
None = 0,
LowImpact = 1,
Minor = 2,
Moderate = 3,
Serious = 4,
};
struct IMapRouteDrivingOptions;
struct IMapRouteDrivingOptions2;
struct IMapAddress;
struct IMapAddress2;
struct IMapLocation;
struct MapAddress;
struct IMapLocationFinderResult;
struct MapLocation;
struct IMapRouteManeuver;
struct IMapRouteManeuver2;
struct IMapRouteManeuver3;
struct IManeuverWarning;
struct ManeuverWarning;
struct IMapRouteLeg;
struct MapRouteManeuver;
struct IMapRouteLeg2;
struct IMapRoute;
struct MapRouteLeg;
struct IMapRoute2;
struct IMapRoute3;
struct IMapRoute4;
struct IMapRouteFinderResult;
struct MapRoute;
struct IMapRouteFinderResult2;
struct IEnhancedWaypoint;
struct IEnhancedWaypointFactory;
struct EnhancedWaypoint;
struct IMapLocationFinderStatics;
struct MapLocationFinderResult;
struct IMapLocationFinderStatics2;
struct IMapRouteFinderStatics;
struct MapRouteFinderResult;
struct IMapRouteFinderStatics2;
struct MapRouteDrivingOptions;
struct IMapRouteFinderStatics3;
struct IMapServiceStatics;
struct IMapManagerStatics;
struct IMapServiceStatics2;
struct IMapServiceStatics3;
struct IMapServiceStatics4;
struct IPlaceInfoCreateOptions;
struct IPlaceInfoStatics;
struct IPlaceInfoStatics2;
struct IPlaceInfo;
struct PlaceInfo;
struct PlaceInfoCreateOptions;
struct MapLocationFinder;
struct MapRouteFinder;
struct MapService;
struct MapManager;
struct GuidanceContract {};
struct LocalSearchContract {};
}}}
} // namespace iso_winrt
|
7852de8046f1d601f0c109c575f11f47f9706937 | 41d88e239eb01ece403bec3049f80b87e178b0c0 | /Pod/AnimationBundle.cpp | c003d513a1e40f54643c555b9c41b148d98397dc | [] | no_license | phucgo240699/Pod | c88ae6bd317ae42dabb4beb3bb0efcf88ec8dcf3 | f79580657c7ff2518dda1f53c3e7ae0eadded9c8 | refs/heads/master | 2023-07-04T14:47:34.183545 | 2021-07-31T05:06:45 | 2021-07-31T05:06:45 | 322,143,610 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 14,627 | cpp | AnimationBundle.cpp | #include "AnimationBundle.h"
AnimationBundle* AnimationBundle::instance;
AnimationBundle* AnimationBundle::getInstance()
{
if (AnimationBundle::instance == nullptr) {
instance = new AnimationBundle();
}
return instance;
}
void AnimationBundle::load()
{
fstream fs;
fs.open(FilePath::getInstance()->animation_bundle, ios::in);
vector<string> data = vector<string>();
string line;
while (!fs.eof()) { // End of line
getline(fs, line);
if (line[0] == '#') continue; // Comment
if (line == "") continue; // Empty
data.push_back(line);
}
fs.close();
this->loadAnimations(data, '>', ',');
}
void AnimationBundle::loadAnimations(vector<string> data, char endSperator, char seperator)
{
int id = 0;
int startIndexFrame = 0;
int animDelay = 0;
this->animations = new vector<Animation>();
vector<pair<RECT, RECT>>* frames = new vector<pair<RECT, RECT>>();
for (size_t i = 0; i < data.size(); ++i) {
if (data[i][0] == '>') {
vector<string> v = Tool::splitToVectorStringFrom(data[i], ' ');
id = stoi(v[1]);
startIndexFrame = stoi(v[2]);
animDelay = stoi(v[3]);
this->animations->push_back(Animation(id, startIndexFrame, animDelay, frames));
frames = new vector<pair<RECT, RECT>>();
continue;
}
vector<int> v = Tool::splitToVectorIntegerFrom(data[i], seperator);
if (v.size() == 8) {
RECT rectBounds = RECT();
rectBounds.left = v[0];
rectBounds.top = v[1];
rectBounds.right = rectBounds.left + v[2];
rectBounds.bottom = rectBounds.top + v[3];
RECT rectFrame = RECT();
rectFrame.left = v[4];
rectFrame.top = v[5];
rectFrame.right = rectFrame.left + v[6];
rectFrame.bottom = rectFrame.top + v[7];
frames->push_back(pair<RECT, RECT>(rectBounds, rectFrame));
}
else {
RECT rectFrame = RECT();
rectFrame.left = v[0];
rectFrame.top = v[1];
rectFrame.right = rectFrame.left + v[2];
rectFrame.bottom = rectFrame.top + v[3];
frames->push_back(pair<RECT, RECT>(rectFrame, rectFrame));
}
}
}
Animation AnimationBundle::getWMario()
{
return this->animations->at(97);
}
Animation AnimationBundle::getGrasses()
{
return this->animations->at(98);
}
Animation AnimationBundle::getHelpLabel()
{
return this->animations->at(99);
}
Animation AnimationBundle::getWTurtle()
{
return this->animations->at(100);
}
//Animation AnimationBundle::getAnimationAt(int index)
//{
// return this->animations->at(index);
//}
Animation AnimationBundle::getMarioStanding()
{
return this->animations->at(18);
}
Animation AnimationBundle::getMarioWalking()
{
return this->animations->at(19);
}
Animation AnimationBundle::getMarioDropping()
{
return this->animations->at(20);
}
Animation AnimationBundle::getMarioJumping()
{
return this->animations->at(20);
}
Animation AnimationBundle::getMarioDie()
{
return this->animations->at(21);
}
Animation AnimationBundle::getMarioConverting()
{
return this->animations->at(22);
}
Animation AnimationBundle::getGoldenBrick()
{
return this->animations->at(0);
}
Animation AnimationBundle::getFullGiftBrick()
{
return this->animations->at(1);
}
Animation AnimationBundle::getEmptyGiftBrick()
{
return this->animations->at(2);
}
Animation AnimationBundle::getCoinGiftBrick()
{
return this->animations->at(3);
}
Animation AnimationBundle::get100Points()
{
return this->animations->at(13);
}
Animation AnimationBundle::getGoombaMoving()
{
return this->animations->at(4);
}
Animation AnimationBundle::getTrampledGoomba()
{
return this->animations->at(5);
}
Animation AnimationBundle::getGreenPipe3Floor()
{
return this->animations->at(6);
}
Animation AnimationBundle::getGreenPipe2Floor()
{
return this->animations->at(7);
}
Animation AnimationBundle::getSuperMushroom()
{
return this->animations->at(8);
}
Animation AnimationBundle::getSuperMarioStanding()
{
return this->animations->at(23);
}
Animation AnimationBundle::getSuperMarioWalking()
{
return this->animations->at(24);
}
Animation AnimationBundle::getSuperMarioDropping()
{
return this->animations->at(25);
}
Animation AnimationBundle::getSuperMarioJumping()
{
return this->animations->at(25);
}
Animation AnimationBundle::getMarioScalingUp()
{
return this->animations->at(26);
}
Animation AnimationBundle::getMarioScalingDown()
{
return this->animations->at(27);
}
Animation AnimationBundle::getSuperMarioConverting()
{
return this->animations->at(28);
}
Animation AnimationBundle::getMarioFireStanding()
{
return this->animations->at(29);
}
Animation AnimationBundle::getMarioFireWalking()
{
return this->animations->at(30);
}
Animation AnimationBundle::getMarioFireDropping()
{
return this->animations->at(31);
}
Animation AnimationBundle::getMarioFireJumping()
{
return this->animations->at(31);
}
Animation AnimationBundle::getMarioFireDie()
{
return this->animations->at(32);
}
Animation AnimationBundle::getMarioFireConverting()
{
return this->animations->at(33);
}
Animation AnimationBundle::getSuperMarioFireStanding()
{
return this->animations->at(34);
}
Animation AnimationBundle::getSuperMarioFireWalking()
{
return this->animations->at(35);
}
Animation AnimationBundle::getSuperMarioFireDropping()
{
return this->animations->at(36);
}
Animation AnimationBundle::getSuperMarioFireJumping()
{
return this->animations->at(36);
}
Animation AnimationBundle::getMarioFireScalingUp()
{
return this->animations->at(37);
}
Animation AnimationBundle::getMarioFireScalingDown()
{
return this->animations->at(38);
}
Animation AnimationBundle::getSuperMarioFireConverting()
{
return this->animations->at(39);
}
Animation AnimationBundle::getKoopaGreenMoving()
{
return this->animations->at(40);
}
Animation AnimationBundle::getKoopaGreenShrinkage()
{
return this->animations->at(41);
}
Animation AnimationBundle::getKoopaGreenShrinkageMoving()
{
return this->animations->at(42);
}
Animation AnimationBundle::getKoopaGreenShrinkageShaking()
{
return this->animations->at(43);
}
Animation AnimationBundle::getThrownAwayGoomba()
{
return this->animations->at(44);
}
Animation AnimationBundle::getFlashLight()
{
return this->animations->at(45);
}
Animation AnimationBundle::getSuperLeaf()
{
return this->animations->at(46);
}
Animation AnimationBundle::getCloudEffect()
{
return this->animations->at(47);
}
Animation AnimationBundle::getSuperMarioFlyingStanding()
{
return this->animations->at(48);
}
Animation AnimationBundle::getSuperMarioFlyingFireStanding()
{
return this->animations->at(53);
}
Animation AnimationBundle::getSuperMarioFlyingFireWalking()
{
return this->animations->at(54);
}
Animation AnimationBundle::getSuperMarioFlyingFireJumping()
{
return this->animations->at(55);
}
Animation AnimationBundle::getSuperMarioFlyingFireDropping()
{
return this->animations->at(56);
}
Animation AnimationBundle::getSuperMarioFlyingFireConverting()
{
return this->animations->at(57);
}
Animation AnimationBundle::getRedFireFlowerStandingLookUp()
{
return this->animations->at(58);
}
Animation AnimationBundle::getRedFireFlowerStandingLookDown()
{
return this->animations->at(59);
}
Animation AnimationBundle::getRedFireFlowerGrowingUp()
{
return this->animations->at(60);
}
Animation AnimationBundle::getRedFireFlowerDropping()
{
return this->animations->at(61);
}
Animation AnimationBundle::getRedFlower()
{
return this->animations->at(62);
}
Animation AnimationBundle::getGreenFireFlowerStandingLookUp()
{
return this->animations->at(63);
}
Animation AnimationBundle::getGreenFireFlowerStandingLookDown()
{
return this->animations->at(64);
}
Animation AnimationBundle::getGreenFireFlowerGrowingUp()
{
return this->animations->at(65);
}
Animation AnimationBundle::getGreenFireFlowerDropping()
{
return this->animations->at(66);
}
Animation AnimationBundle::getGreenFlower()
{
return this->animations->at(67);
}
Animation AnimationBundle::getFireFlowerBall()
{
return this->animations->at(68);
}
Animation AnimationBundle::getFireBall()
{
return this->animations->at(68);
}
Animation AnimationBundle::getRedFireFlowerStandingLookUpHalfSize()
{
return this->animations->at(69);
}
Animation AnimationBundle::getRedFireFlowerStandingLookDownHalfSize()
{
return this->animations->at(70);
}
Animation AnimationBundle::getRedFireFlowerGrowingUpHalfSize()
{
return this->animations->at(71);
}
Animation AnimationBundle::getRedFireFlowerDroppingHalfSize()
{
return this->animations->at(72);
}
Animation AnimationBundle::getRedFlowerHalfSize()
{
return this->animations->at(73);
}
Animation AnimationBundle::getGreenFireFlowerStandingLookUpHalfSize()
{
return this->animations->at(74);
}
Animation AnimationBundle::getGreenFireFlowerStandingLookDownHalfSize()
{
return this->animations->at(75);
}
Animation AnimationBundle::getGreenFireFlowerGrowingUpHalfSize()
{
return this->animations->at(76);
}
Animation AnimationBundle::getGreenFireFlowerDroppingHalfSize()
{
return this->animations->at(77);
}
Animation AnimationBundle::getGreenFlowerHalfSize()
{
return this->animations->at(78);
}
Animation AnimationBundle::getKoopaRedThrownAway()
{
return this->animations->at(79);
}
Animation AnimationBundle::getKoopaGreenThrownAway()
{
return this->animations->at(80);
}
Animation AnimationBundle::getFireBallSplash()
{
return this->animations->at(81);
}
Animation AnimationBundle::getSuperMarioFlyingFireTurningAround()
{
return this->animations->at(83);
}
Animation AnimationBundle::getSuperMarioFlyingTurningAround()
{
return this->animations->at(82);
}
Animation AnimationBundle::getSuperMarioPreFlyingUp()
{
return this->animations->at(84);
}
Animation AnimationBundle::getSuperMarioFlyingUp()
{
return this->animations->at(85);
}
Animation AnimationBundle::getSuperMarioFirePreFlyingUp()
{
return this->animations->at(86);
}
Animation AnimationBundle::getSuperMarioFireFlyingUp()
{
return this->animations->at(87);
}
Animation AnimationBundle::getGoldenBrickFragment()
{
return this->animations->at(89);
}
Animation AnimationBundle::getPButtonOn()
{
return this->animations->at(90);
}
Animation AnimationBundle::getPButtonOff()
{
return this->animations->at(91);
}
Animation AnimationBundle::getKoopaFlying()
{
return this->animations->at(92);
}
Animation AnimationBundle::getGoombaRedFlying()
{
return this->animations->at(93);
}
Animation AnimationBundle::getGoombaRedMoving()
{
return this->animations->at(94);
}
Animation AnimationBundle::getGoombaRedTrampled()
{
return this->animations->at(95);
}
Animation AnimationBundle::getGoombaRedThrownAway()
{
return this->animations->at(96);
}
Animation AnimationBundle::getSuperMarioFlyingDroppingDownPipe()
{
return this->animations->at(101);
}
Animation AnimationBundle::getSuperMarioFlyingFireDroppingDownPipe()
{
return this->animations->at(102);
}
Animation AnimationBundle::getCoinFromUnderground()
{
return this->animations->at(103);
}
Animation AnimationBundle::getBlackPipe2FloorDown()
{
return this->animations->at(104);
}
Animation AnimationBundle::getSuperMushroomGreen()
{
return this->animations->at(105);
}
Animation AnimationBundle::getOneUp()
{
return this->animations->at(106);
}
Animation AnimationBundle::getFireBallFromUnderground()
{
return this->animations->at(107);
}
Animation AnimationBundle::getMarioFireDroppingDownPipe()
{
return this->animations->at(109);
}
Animation AnimationBundle::getSuperMarioDroppingDownPipe()
{
return this->animations->at(110);
}
Animation AnimationBundle::getSuperMarioFireDroppingDownPipe()
{
return this->animations->at(111);
}
Animation AnimationBundle::getMusicBox()
{
return this->animations->at(112);
}
Animation AnimationBundle::getMusicBoxRed()
{
return this->animations->at(113);
}
Animation AnimationBundle::getBoomerangMoving()
{
return this->animations->at(114);
}
Animation AnimationBundle::getBoomerangMovingHolding()
{
return this->animations->at(115);
}
Animation AnimationBundle::getBoomerangDead()
{
return this->animations->at(116);
}
Animation AnimationBundle::getBoomerang()
{
return this->animations->at(117);
}
Animation AnimationBundle::getBossFlying()
{
return this->animations->at(118);
}
Animation AnimationBundle::getBomb()
{
return this->animations->at(119);
}
Animation AnimationBundle::getBossMoving()
{
return this->animations->at(120);
}
Animation AnimationBundle::getBossDropping()
{
return this->animations->at(121);
}
Animation AnimationBundle::getBombAttachedMario()
{
return this->animations->at(122);
}
Animation AnimationBundle::getItems()
{
return this->animations->at(123);
}
Animation AnimationBundle::getWMarioFire()
{
return this->animations->at(124);
}
Animation AnimationBundle::getWMarioBig()
{
return this->animations->at(125);
}
Animation AnimationBundle::getWMarioBigFire()
{
return this->animations->at(126);
}
Animation AnimationBundle::getWMarioFlying()
{
return this->animations->at(127);
}
Animation AnimationBundle::getWMaiorFlyingFire()
{
return this->animations->at(128);
}
//Animation AnimationBundle::getGoombaRedFlyingMoving()
//{
// return this->animations->at(122);
//}
Animation AnimationBundle::getSuperMarioFlyingWalking()
{
return this->animations->at(49);
}
Animation AnimationBundle::getSuperMarioFlyingJumping()
{
return this->animations->at(50);
}
Animation AnimationBundle::getSuperMarioFlyingDropping()
{
return this->animations->at(51);
}
Animation AnimationBundle::getSuperMarioFlyingConverting()
{
return this->animations->at(52);
}
Animation AnimationBundle::getKoopaMoving()
{
return this->animations->at(9);
}
Animation AnimationBundle::getKoopaShrinkage()
{
return this->animations->at(10);
}
Animation AnimationBundle::getKoopaShrinkageMoving()
{
return this->animations->at(11);
}
Animation AnimationBundle::getKoopaShrinkageShaking()
{
return this->animations->at(12);
}
Animation AnimationBundle::get200Points()
{
return this->animations->at(14);
}
Animation AnimationBundle::getPoints(int points)
{
if (points == 200) {
return this->get200Points();
}
else if (points == 400) {
return this->get400Points();
}
else if (points == 800) {
return this->get800Points();
}
else if (points == 1000) {
return this->get1000Points();
}
//else {
return this->get100Points();
//}
}
Animation AnimationBundle::get400Points()
{
return this->animations->at(15);
}
Animation AnimationBundle::get800Points()
{
return this->animations->at(16);
}
Animation AnimationBundle::get1000Points()
{
return this->animations->at(17);
}
Animation AnimationBundle::getCoin()
{
return this->animations->at(88);
}
Animation AnimationBundle::getMarioDroppingDownPipe()
{
return this->animations->at(108);
}
|
32a35b0913edd051cb21b70629a2b605bab78bc5 | 44d47822748b60c9aa88a90e458a7090e4ccacf5 | /src/constraint.cpp | d3745c6a2b5b40efc68a831abc80906334e701b8 | [
"MIT"
] | permissive | ctriley/optimystic | c22272fe0204daa0126e3b736620ffa0e4ba9277 | ed65c0c3a5b42ec7577aab0ac243538985095c90 | refs/heads/master | 2021-07-14T22:17:46.988382 | 2021-03-04T19:15:21 | 2021-03-04T19:15:21 | 235,645,961 | 1 | 0 | MIT | 2020-03-04T23:40:50 | 2020-01-22T19:10:19 | CMake | UTF-8 | C++ | false | false | 1,154 | cpp | constraint.cpp | //
// Created by connor on 9/20/19.
//
#include "constraint.hpp"
#include <utility>
namespace optimystic {
#ifdef GUROBI
Constraint::Constraint(std::shared_ptr<GRBConstr> constr): _grb_constr(std::move(constr)) {}
std::shared_ptr<GRBConstr> Constraint::getGRBConstr() {
return _grb_constr;
}
#elif defined CPLEX
Constraint::Constraint(std::shared_ptr<IloEnv> env, std::shared_ptr<IloModel> model,
std::shared_ptr<IloCplex> solver,
std::shared_ptr<IloRange> constr): _cplex_env(env),
_cplex_model(model), _cplex_solver(solver),
_cplex_constr(constr) {}
std::shared_ptr<IloRange> Constraint::getCplexConstraint() {
return _cplex_constr;
}
#endif
double Constraint::getDualValue() {
#ifdef GUROBI
return _grb_constr->get(GRB_DoubleAttr_Pi);
#elif defined CPLEX
return _cplex_solver->getDual(*_cplex_constr);
#endif
}
void Constraint::setName(const std::string& name) {
#ifdef GUROBI
_grb_constr->set(GRB_StringAttr_ConstrName, name);
#elif defined CPLEX
_cplex_constr->setName(name.c_str());
#endif
}
}
|
07a432a2c57c73cbaf725a5ba720507cf75dd545 | 49df3f33b58159b410ff82bfa04a1a8eacf5e737 | /test/lib/opengl/test_shader.cpp | a7692ad1cc09ae52bb1a299a99a2d65fd6258553 | [] | no_license | scryver/scrutils | 17d6a6d04a6e203ff28bcdb91284d266ffde286b | c004145af13d8c4c7f7d55edaac240e5387509a8 | refs/heads/master | 2021-01-22T06:23:01.926616 | 2017-04-28T23:28:14 | 2017-04-28T23:28:14 | 81,754,682 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 20,041 | cpp | test_shader.cpp | #include <gtest/gtest.h>
#include "glmock.hpp"
#include "Scryver/OpenGL/Shader.hpp"
#include "Scryver/Math/Matrix4.hpp"
using Scryver::OpenGL::Shader;
using Scryver::OpenGL::shader_t;
using Scryver::OpenGL::uniform_t;
using Scryver::Math::Matrix4f;
const std::string brokenFile = "build/test/files/broken.glsl";
const std::string vertexFile = "build/test/files/vertex.glsl";
const std::string fragmentFile = "build/test/files/fragment.glsl";
const std::string linkErrorFile = "build/test/files/linker_error.glsl";
TEST(Shader, FailForNoPath)
{
Shader s;
ASSERT_FALSE(s.initialize("some", "thing", true));
ASSERT_FALSE(s.initialize(vertexFile, "thing", true));
ASSERT_FALSE(s.initialize("some", fragmentFile, true));
}
TEST(Shader, FailOnShaderFileCompilation)
{
const char* shaderError = "Shader Error";
EXPECT_CALL(GLMock, CreateShader(GL_VERTEX_SHADER))
.Times(2)
.WillOnce(testing::Return(1))
.WillOnce(testing::Return(2));
EXPECT_CALL(GLMock, CreateShader(GL_FRAGMENT_SHADER))
.Times(1)
.WillOnce(testing::Return(3));
EXPECT_CALL(GLMock, ShaderSource(1, 1, testing::_, testing::_))
.Times(1);
EXPECT_CALL(GLMock, CompileShader(1)).Times(1);
EXPECT_CALL(GLMock, GetShaderiv(1, GL_COMPILE_STATUS, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(GL_FALSE));
EXPECT_CALL(GLMock, GetShaderiv(1, GL_INFO_LOG_LENGTH, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(12));
EXPECT_CALL(GLMock, GetShaderInfoLog(1, 12, testing::_, testing::_))
.Times(1)
.WillOnce(testing::SetArrayArgument<3>(shaderError, shaderError + 12));
EXPECT_CALL(GLMock, DeleteShader(1)).Times(1);
EXPECT_CALL(GLMock, ShaderSource(2, 1, testing::_, testing::_))
.Times(1);
EXPECT_CALL(GLMock, CompileShader(2)).Times(1);
EXPECT_CALL(GLMock, GetShaderiv(2, GL_COMPILE_STATUS, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(GL_TRUE));
EXPECT_CALL(GLMock, GetShaderiv(2, GL_INFO_LOG_LENGTH, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(0));
EXPECT_CALL(GLMock, DeleteShader(2)).Times(1);
EXPECT_CALL(GLMock, ShaderSource(3, 1, testing::_, testing::_))
.Times(1);
EXPECT_CALL(GLMock, CompileShader(3)).Times(1);
EXPECT_CALL(GLMock, GetShaderiv(3, GL_COMPILE_STATUS, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(GL_FALSE));
EXPECT_CALL(GLMock, GetShaderiv(3, GL_INFO_LOG_LENGTH, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(0));
EXPECT_CALL(GLMock, DeleteShader(3)).Times(1);
Shader s;
ASSERT_FALSE(s.initialize(brokenFile, fragmentFile));
ASSERT_FALSE(s.initialize(vertexFile, brokenFile));
}
TEST(Shader, CompileLinkSimpleShaderFiles)
{
EXPECT_CALL(GLMock, CreateShader(GL_VERTEX_SHADER))
.Times(1)
.WillOnce(testing::Return(1));
EXPECT_CALL(GLMock, ShaderSource(1, 1, testing::_, testing::_))
.Times(1);
EXPECT_CALL(GLMock, CompileShader(1)).Times(1);
EXPECT_CALL(GLMock, GetShaderiv(1, GL_COMPILE_STATUS, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(GL_TRUE));
EXPECT_CALL(GLMock, GetShaderiv(1, GL_INFO_LOG_LENGTH, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(0));
EXPECT_CALL(GLMock, CreateShader(GL_FRAGMENT_SHADER))
.Times(1)
.WillOnce(testing::Return(2));
EXPECT_CALL(GLMock, ShaderSource(2, 1, testing::_, testing::_))
.Times(1);
EXPECT_CALL(GLMock, CompileShader(2)).Times(1);
EXPECT_CALL(GLMock, GetShaderiv(2, GL_COMPILE_STATUS, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(GL_TRUE));
EXPECT_CALL(GLMock, GetShaderiv(2, GL_INFO_LOG_LENGTH, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(0));
EXPECT_CALL(GLMock, CreateProgram()).Times(1).WillOnce(testing::Return(3));
EXPECT_CALL(GLMock, AttachShader(3, 1)).Times(1);
EXPECT_CALL(GLMock, AttachShader(3, 2)).Times(1);
EXPECT_CALL(GLMock, LinkProgram(3));
EXPECT_CALL(GLMock, DetachShader(3, 1)).Times(1);
EXPECT_CALL(GLMock, DetachShader(3, 2)).Times(1);
EXPECT_CALL(GLMock, DeleteShader(1)).Times(1);
EXPECT_CALL(GLMock, DeleteShader(2)).Times(1);
EXPECT_CALL(GLMock, GetProgramiv(3, GL_LINK_STATUS, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(GL_TRUE));
EXPECT_CALL(GLMock, GetProgramiv(3, GL_INFO_LOG_LENGTH, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(0));
Shader s;
ASSERT_TRUE(s.initialize(vertexFile, fragmentFile));
// Ignore deletion check
s.identifier = shader_t::invalid();
}
TEST(Shader, FailOnShaderFileLinking)
{
EXPECT_CALL(GLMock, CreateShader(GL_VERTEX_SHADER))
.Times(1)
.WillOnce(testing::Return(1));
EXPECT_CALL(GLMock, CreateShader(GL_FRAGMENT_SHADER))
.Times(1)
.WillOnce(testing::Return(2));
EXPECT_CALL(GLMock, ShaderSource(1, 1, testing::_, testing::_))
.Times(1);
EXPECT_CALL(GLMock, ShaderSource(2, 1, testing::_, testing::_))
.Times(1);
EXPECT_CALL(GLMock, CompileShader(1)).Times(1);
EXPECT_CALL(GLMock, CompileShader(2)).Times(1);
EXPECT_CALL(GLMock, GetShaderiv(1, GL_COMPILE_STATUS, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(GL_TRUE));
EXPECT_CALL(GLMock, GetShaderiv(1, GL_INFO_LOG_LENGTH, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(0));
EXPECT_CALL(GLMock, GetShaderiv(2, GL_COMPILE_STATUS, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(GL_TRUE));
EXPECT_CALL(GLMock, GetShaderiv(2, GL_INFO_LOG_LENGTH, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(0));
EXPECT_CALL(GLMock, CreateProgram()).Times(1).WillOnce(testing::Return(3));
EXPECT_CALL(GLMock, AttachShader(3, 1)).Times(1);
EXPECT_CALL(GLMock, AttachShader(3, 2)).Times(1);
EXPECT_CALL(GLMock, LinkProgram(3));
EXPECT_CALL(GLMock, GetProgramiv(3, GL_LINK_STATUS, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(GL_FALSE));
EXPECT_CALL(GLMock, GetProgramiv(3, GL_INFO_LOG_LENGTH, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(0));
EXPECT_CALL(GLMock, DetachShader(3, 1)).Times(1);
EXPECT_CALL(GLMock, DetachShader(3, 2)).Times(1);
EXPECT_CALL(GLMock, DeleteShader(1)).Times(1);
EXPECT_CALL(GLMock, DeleteShader(2)).Times(1);
EXPECT_CALL(GLMock, DeleteProgram(3)).Times(1);
Shader s;
ASSERT_FALSE(s.initialize(vertexFile, linkErrorFile));
}
TEST(Shader, FailOnShaderCompilation)
{
EXPECT_CALL(GLMock, CreateShader(GL_VERTEX_SHADER))
.Times(2)
.WillOnce(testing::Return(1))
.WillOnce(testing::Return(2));
EXPECT_CALL(GLMock, CreateShader(GL_FRAGMENT_SHADER))
.Times(1)
.WillOnce(testing::Return(3));
EXPECT_CALL(GLMock, ShaderSource(1, 1, testing::_, testing::_))
.Times(1);
EXPECT_CALL(GLMock, ShaderSource(2, 1, testing::_, testing::_))
.Times(1);
EXPECT_CALL(GLMock, ShaderSource(3, 1, testing::_, testing::_))
.Times(1);
EXPECT_CALL(GLMock, CompileShader(1)).Times(1);
EXPECT_CALL(GLMock, CompileShader(2)).Times(1);
EXPECT_CALL(GLMock, CompileShader(3)).Times(1);
EXPECT_CALL(GLMock, GetShaderiv(1, GL_COMPILE_STATUS, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(GL_FALSE));
EXPECT_CALL(GLMock, GetShaderiv(1, GL_INFO_LOG_LENGTH, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(0));
EXPECT_CALL(GLMock, GetShaderiv(2, GL_COMPILE_STATUS, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(GL_TRUE));
EXPECT_CALL(GLMock, GetShaderiv(2, GL_INFO_LOG_LENGTH, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(0));
EXPECT_CALL(GLMock, GetShaderiv(3, GL_COMPILE_STATUS, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(GL_FALSE));
EXPECT_CALL(GLMock, GetShaderiv(3, GL_INFO_LOG_LENGTH, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(0));
EXPECT_CALL(GLMock, DeleteShader(1)).Times(1);
EXPECT_CALL(GLMock, DeleteShader(2)).Times(1);
EXPECT_CALL(GLMock, DeleteShader(3)).Times(1);
Shader s;
ASSERT_FALSE(s.initialize("vec2 outC;\nmain(){}", "main(){}", false));
ASSERT_FALSE(s.initialize(
"#version 330 core\n"
"layout(location=0) in vec3 position;\n"
"void main() {\n"
" gl_Position = vec4(position, 1.0);\n"
"}", "void main(){ colour = vec4(); }", false));
}
TEST(Shader, CompileLinkSimpleShader)
{
EXPECT_CALL(GLMock, CreateShader(GL_VERTEX_SHADER))
.Times(1)
.WillOnce(testing::Return(1));
EXPECT_CALL(GLMock, CreateShader(GL_FRAGMENT_SHADER))
.Times(1)
.WillOnce(testing::Return(2));
EXPECT_CALL(GLMock, ShaderSource(1, 1, testing::_, testing::_))
.Times(1);
EXPECT_CALL(GLMock, ShaderSource(2, 1, testing::_, testing::_))
.Times(1);
EXPECT_CALL(GLMock, CompileShader(1)).Times(1);
EXPECT_CALL(GLMock, CompileShader(2)).Times(1);
EXPECT_CALL(GLMock, GetShaderiv(1, GL_COMPILE_STATUS, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(GL_TRUE));
EXPECT_CALL(GLMock, GetShaderiv(1, GL_INFO_LOG_LENGTH, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(0));
EXPECT_CALL(GLMock, GetShaderiv(2, GL_COMPILE_STATUS, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(GL_TRUE));
EXPECT_CALL(GLMock, GetShaderiv(2, GL_INFO_LOG_LENGTH, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(0));
EXPECT_CALL(GLMock, CreateProgram()).Times(1).WillOnce(testing::Return(3));
EXPECT_CALL(GLMock, AttachShader(3, 1)).Times(1);
EXPECT_CALL(GLMock, AttachShader(3, 2)).Times(1);
EXPECT_CALL(GLMock, LinkProgram(3));
EXPECT_CALL(GLMock, GetProgramiv(3, GL_LINK_STATUS, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(GL_TRUE));
EXPECT_CALL(GLMock, GetProgramiv(3, GL_INFO_LOG_LENGTH, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(0));
EXPECT_CALL(GLMock, DetachShader(3, 1)).Times(1);
EXPECT_CALL(GLMock, DetachShader(3, 2)).Times(1);
EXPECT_CALL(GLMock, DeleteShader(1)).Times(1);
EXPECT_CALL(GLMock, DeleteShader(2)).Times(1);
EXPECT_CALL(GLMock, DeleteProgram(3)).Times(1);
const char* simpleSrc = "#version 330 core\nvoid main() {}";
Shader s;
ASSERT_TRUE(s.initialize(simpleSrc, simpleSrc, false));
}
TEST(Shader, FailOnShaderLinking)
{
const char* vertex = "#version 330 core\nlayout(location=0) in vec3 position;\nout vec3 colour;\nvoid main() { colour = vec3(1, 0, 0.4);}";
const char* fragment = "#version 330 core\nin vec2 colour;\nout vec3 col;\nvoid main() { col = vec3(colour,0); }";
const char* linkerError = "Linker Error";
EXPECT_CALL(GLMock, CreateShader(GL_VERTEX_SHADER))
.Times(1)
.WillOnce(testing::Return(1));
EXPECT_CALL(GLMock, CreateShader(GL_FRAGMENT_SHADER))
.Times(1)
.WillOnce(testing::Return(2));
EXPECT_CALL(GLMock, ShaderSource(1, 1, testing::_, testing::_))
.Times(1);
EXPECT_CALL(GLMock, ShaderSource(2, 1, testing::_, testing::_))
.Times(1);
EXPECT_CALL(GLMock, CompileShader(1)).Times(1);
EXPECT_CALL(GLMock, CompileShader(2)).Times(1);
EXPECT_CALL(GLMock, GetShaderiv(1, GL_COMPILE_STATUS, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(GL_TRUE));
EXPECT_CALL(GLMock, GetShaderiv(1, GL_INFO_LOG_LENGTH, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(0));
EXPECT_CALL(GLMock, GetShaderiv(2, GL_COMPILE_STATUS, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(GL_TRUE));
EXPECT_CALL(GLMock, GetShaderiv(2, GL_INFO_LOG_LENGTH, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(0));
EXPECT_CALL(GLMock, CreateProgram()).Times(1).WillOnce(testing::Return(3));
EXPECT_CALL(GLMock, AttachShader(3, 1)).Times(1);
EXPECT_CALL(GLMock, AttachShader(3, 2)).Times(1);
EXPECT_CALL(GLMock, LinkProgram(3));
EXPECT_CALL(GLMock, GetProgramiv(3, GL_LINK_STATUS, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(GL_FALSE));
EXPECT_CALL(GLMock, GetProgramiv(3, GL_INFO_LOG_LENGTH, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(12));
EXPECT_CALL(GLMock, GetProgramInfoLog(3, 12, testing::_, testing::_))
.Times(1)
.WillOnce(testing::SetArrayArgument<3>(linkerError, linkerError + 12));
EXPECT_CALL(GLMock, DetachShader(3, 1)).Times(1);
EXPECT_CALL(GLMock, DetachShader(3, 2)).Times(1);
EXPECT_CALL(GLMock, DeleteShader(1)).Times(1);
EXPECT_CALL(GLMock, DeleteShader(2)).Times(1);
EXPECT_CALL(GLMock, DeleteProgram(3)).Times(1);
Shader s;
ASSERT_FALSE(s.initialize(vertex, fragment, false));
}
TEST(Shader, UseSimpleShaderFiles)
{
EXPECT_CALL(GLMock, CreateShader(GL_VERTEX_SHADER))
.Times(1)
.WillOnce(testing::Return(1));
EXPECT_CALL(GLMock, ShaderSource(1, 1, testing::_, testing::_))
.Times(1);
EXPECT_CALL(GLMock, CompileShader(1)).Times(1);
EXPECT_CALL(GLMock, GetShaderiv(1, GL_COMPILE_STATUS, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(GL_TRUE));
EXPECT_CALL(GLMock, GetShaderiv(1, GL_INFO_LOG_LENGTH, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(0));
EXPECT_CALL(GLMock, CreateShader(GL_FRAGMENT_SHADER))
.Times(1)
.WillOnce(testing::Return(2));
EXPECT_CALL(GLMock, ShaderSource(2, 1, testing::_, testing::_))
.Times(1);
EXPECT_CALL(GLMock, CompileShader(2)).Times(1);
EXPECT_CALL(GLMock, GetShaderiv(2, GL_COMPILE_STATUS, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(GL_TRUE));
EXPECT_CALL(GLMock, GetShaderiv(2, GL_INFO_LOG_LENGTH, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(0));
EXPECT_CALL(GLMock, CreateProgram()).Times(1).WillOnce(testing::Return(3));
EXPECT_CALL(GLMock, AttachShader(3, 1)).Times(1);
EXPECT_CALL(GLMock, AttachShader(3, 2)).Times(1);
EXPECT_CALL(GLMock, LinkProgram(3));
EXPECT_CALL(GLMock, DetachShader(3, 1)).Times(1);
EXPECT_CALL(GLMock, DetachShader(3, 2)).Times(1);
EXPECT_CALL(GLMock, DeleteShader(1)).Times(1);
EXPECT_CALL(GLMock, DeleteShader(2)).Times(1);
EXPECT_CALL(GLMock, GetProgramiv(3, GL_LINK_STATUS, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(GL_TRUE));
EXPECT_CALL(GLMock, GetProgramiv(3, GL_INFO_LOG_LENGTH, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(0));
EXPECT_CALL(GLMock, UseProgram(3)).Times(1);
Shader s;
ASSERT_TRUE(s.initialize(vertexFile, fragmentFile));
s.use();
// Ignore deletion check
s.identifier = shader_t::invalid();
}
TEST(Shader, GetUniformLocation)
{
EXPECT_CALL(GLMock, CreateShader(GL_VERTEX_SHADER))
.Times(1)
.WillOnce(testing::Return(1));
EXPECT_CALL(GLMock, ShaderSource(1, 1, testing::_, testing::_))
.Times(1);
EXPECT_CALL(GLMock, CompileShader(1)).Times(1);
EXPECT_CALL(GLMock, GetShaderiv(1, GL_COMPILE_STATUS, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(GL_TRUE));
EXPECT_CALL(GLMock, GetShaderiv(1, GL_INFO_LOG_LENGTH, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(0));
EXPECT_CALL(GLMock, CreateShader(GL_FRAGMENT_SHADER))
.Times(1)
.WillOnce(testing::Return(2));
EXPECT_CALL(GLMock, ShaderSource(2, 1, testing::_, testing::_))
.Times(1);
EXPECT_CALL(GLMock, CompileShader(2)).Times(1);
EXPECT_CALL(GLMock, GetShaderiv(2, GL_COMPILE_STATUS, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(GL_TRUE));
EXPECT_CALL(GLMock, GetShaderiv(2, GL_INFO_LOG_LENGTH, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(0));
EXPECT_CALL(GLMock, CreateProgram()).Times(1).WillOnce(testing::Return(3));
EXPECT_CALL(GLMock, AttachShader(3, 1)).Times(1);
EXPECT_CALL(GLMock, AttachShader(3, 2)).Times(1);
EXPECT_CALL(GLMock, LinkProgram(3));
EXPECT_CALL(GLMock, DetachShader(3, 1)).Times(1);
EXPECT_CALL(GLMock, DetachShader(3, 2)).Times(1);
EXPECT_CALL(GLMock, DeleteShader(1)).Times(1);
EXPECT_CALL(GLMock, DeleteShader(2)).Times(1);
EXPECT_CALL(GLMock, GetProgramiv(3, GL_LINK_STATUS, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(GL_TRUE));
EXPECT_CALL(GLMock, GetProgramiv(3, GL_INFO_LOG_LENGTH, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(0));
const char* uniformName = "MyName";
EXPECT_CALL(GLMock, GetUniformLocation(3, testing::StrEq(uniformName)))
.Times(1)
.WillOnce(testing::Return(5));
Shader s;
ASSERT_TRUE(s.initialize(vertexFile, fragmentFile));
ASSERT_EQ(uniform_t(5), s.getUniform(uniformName));
// Ignore deletion check
s.identifier = shader_t::invalid();
}
TEST(Shader, UploadUniform)
{
Matrix4f m;
m.initTranslation(1.0f, 2.0f, 3.0f);
EXPECT_CALL(GLMock, CreateShader(GL_VERTEX_SHADER))
.Times(1)
.WillOnce(testing::Return(1));
EXPECT_CALL(GLMock, ShaderSource(1, 1, testing::_, testing::_))
.Times(1);
EXPECT_CALL(GLMock, CompileShader(1)).Times(1);
EXPECT_CALL(GLMock, GetShaderiv(1, GL_COMPILE_STATUS, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(GL_TRUE));
EXPECT_CALL(GLMock, GetShaderiv(1, GL_INFO_LOG_LENGTH, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(0));
EXPECT_CALL(GLMock, CreateShader(GL_FRAGMENT_SHADER))
.Times(1)
.WillOnce(testing::Return(2));
EXPECT_CALL(GLMock, ShaderSource(2, 1, testing::_, testing::_))
.Times(1);
EXPECT_CALL(GLMock, CompileShader(2)).Times(1);
EXPECT_CALL(GLMock, GetShaderiv(2, GL_COMPILE_STATUS, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(GL_TRUE));
EXPECT_CALL(GLMock, GetShaderiv(2, GL_INFO_LOG_LENGTH, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(0));
EXPECT_CALL(GLMock, CreateProgram()).Times(1).WillOnce(testing::Return(3));
EXPECT_CALL(GLMock, AttachShader(3, 1)).Times(1);
EXPECT_CALL(GLMock, AttachShader(3, 2)).Times(1);
EXPECT_CALL(GLMock, LinkProgram(3));
EXPECT_CALL(GLMock, DetachShader(3, 1)).Times(1);
EXPECT_CALL(GLMock, DetachShader(3, 2)).Times(1);
EXPECT_CALL(GLMock, DeleteShader(1)).Times(1);
EXPECT_CALL(GLMock, DeleteShader(2)).Times(1);
EXPECT_CALL(GLMock, GetProgramiv(3, GL_LINK_STATUS, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(GL_TRUE));
EXPECT_CALL(GLMock, GetProgramiv(3, GL_INFO_LOG_LENGTH, testing::_))
.Times(1)
.WillOnce(testing::SetArgPointee<2>(0));
const char* uniformName = "MyName";
EXPECT_CALL(GLMock, GetUniformLocation(3, testing::StrEq(uniformName)))
.Times(1)
.WillOnce(testing::Return(5));
EXPECT_CALL(GLMock, UniformMatrix4fv(5u, 1, GL_TRUE, &m.m[0][0]))
.Times(1);
EXPECT_CALL(GLMock, Uniform1i(5u, 3))
.Times(1);
Shader s;
ASSERT_TRUE(s.initialize(vertexFile, fragmentFile));
uniform_t u = s.getUniform(uniformName);
ASSERT_EQ(uniform_t(5), u);
s.uploadUniform(u, m);
s.uploadUniform(u, 3);
// Ignore deletion check
s.identifier = shader_t::invalid();
}
|
c4632f8e686ab3974f6ecae42a74df75966effd0 | 741da9d97b90ffb3d111aebfc71f9ae52ab79711 | /src/2DLineDrawings.cpp | b10a9ba88cce75fbaef5bc0ab9ef0201988be377 | [] | no_license | Joren-S/CG-Engine | 9918a4f2e17de2db2924f3613d50413702f01198 | d265d5871958c236aafcb586a516e5c814e28707 | refs/heads/master | 2021-09-15T05:54:14.262618 | 2018-05-27T13:21:13 | 2018-05-27T13:21:13 | 126,495,055 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,422 | cpp | 2DLineDrawings.cpp | //
// Created by joren on 21/04/2018.
//
#include "../headers/2DLineDrawings.h"
LineDrawing2D::LineDrawing2D(const ImageInfo *imgInfo) {
info = imgInfo;
}
img::EasyImage LineDrawing2D::LinesToImage(const LinesList2D &lines) {
// Variables
double x_min, x_max, y_min, y_max,
x_range, y_range;
// Iterate over all 2DLines.
bool firstItr = true;
for (LinesList2D::const_iterator itr = lines.begin(); itr != lines.end(); itr++) {
Line2D *cur_line = (*itr);
Point2D *start = cur_line->start;
Point2D *end = cur_line->end;
// Calculate requirements for x-range and y-range.
if (firstItr) {
x_min = start->x < end->x ? start->x : end->x;
y_min = start->y < end->y ? start->y : end->y;
x_max = start->x > end->x ? start->x : end->x;
y_max = start->y > end->y ? start->y : end->y;
firstItr = false;
}
else {
// x_min
if (start->x < x_min || end->x < x_min) {
x_min = end->x;
if (start->x < end->x) {
x_min = start->x;
}
}
// y_min
if (start->y < y_min || end->y < y_min) {
y_min = end->y;
if (start->y < end->y) {
y_min = start->y;
}
}
// x_max
if (start->x > x_max || end->x > x_max) {
x_max = end->x;
if (start->x > end->x) {
x_max = start->x;
}
}
// y_max
if (start->y > y_max || end->y > y_max) {
y_max = end->y;
if (start->y > end->y) {
y_max = start->y;
}
}
}
}
// Calculate x_range and y_range.
x_range = x_max - x_min;
y_range = y_max - y_min;
// Calculate image size (when scaled).
unsigned int image_x = getInfo()->getSize() * (x_range / __max(x_range, y_range));
unsigned int image_y = getInfo()->getSize() * (y_range / __max(x_range, y_range));
// Scaling factor (d)
double d = 0.95 * (image_x / x_range);
// Add padding if it's a single horizontal/vertical line.
if (image_x == 0) {
image_x += 3;
}
if (image_y == 0) {
image_y += 3;
}
// multiply coordinates of all points with d
for (LinesList2D::const_iterator itr = lines.begin(); itr != lines.end(); ++itr) {
Line2D *curLine = *itr;
curLine->start->x *= d;
curLine->start->y *= d;
curLine->end->x *= d;
curLine->end->y *= d;
}
// Calculate center point (when scaled).
int DC_x = d * ((x_min + x_max) / 2);
int DC_y = d * ((y_min + y_max) / 2);
// Calculate offset on x and y.
int dx = (image_x / 2) - DC_x;
int dy = (image_y / 2) - DC_y;
// Add (dx, dy) to all coordinates and round
for (LinesList2D::const_iterator itr = lines.begin(); itr != lines.end(); ++itr) {
Line2D *curLine = *itr;
// add
curLine->start->x += dx;
curLine->start->y += dy;
curLine->end->x += dx;
curLine->end->y += dy;
// round
curLine->start->x = round(curLine->start->x);
curLine->start->y = round(curLine->start->y);
curLine->end->x = round(curLine->end->x);
curLine->end->y = round(curLine->end->y);
}
// Setup background color
img::Color background((uint8_t)(getInfo()->getBGColor()->r),
(uint8_t)(getInfo()->getBGColor()->g),
(uint8_t)(getInfo()->getBGColor()->b));
// Setup image with correct dimensions and set correct background color.
img::EasyImage image(image_x, image_y);
image.clear(background);
// Iterate over all lines
for (LinesList2D::const_iterator itr = lines.begin(); itr != lines.end(); ++itr) {
Line2D *curLine = *itr;
// Draw line.
img::Color color((uint8_t) curLine->color->r,
(uint8_t) curLine->color->g,
(uint8_t) curLine->color->b);
image.draw_line(curLine->start->x, curLine->start->y, curLine->end->x, curLine->end->y, color);
}
// Return resulting image.
return image;
}
const ImageInfo *LineDrawing2D::getInfo() const {
return info;
} |
90b887c29bbe3cc7c259384bb71ed9dd139ac9db | efef070fea2d91ad8a698ad792bd46035f3a6b9c | /Tutorials/t76STLset.cpp | a982bac76eb4b559ee61c7fbaec38822af9ec893 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | Aaryan-R-S/Cpp-Tutorials | 904782e611b00034379cdc6b41b08e32760d9f65 | 4bedec0971e043f9a4a91af7867d7775d3bb33b0 | refs/heads/master | 2023-04-22T21:21:55.294778 | 2021-05-09T11:41:21 | 2021-05-09T11:41:21 | 365,734,054 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 366 | cpp | t76STLset.cpp | #include<iostream>
#include<set>
#include<string>
using namespace std;
// no duplicate values
// sorted by default
// order of sorting can also be given
// logathmic complexity as it works on special type of tree
int main()
{
set<int> s1 = {1,9,7,4,5,6,3,2,4,5,6,5};
for (const auto&e: s1)
{
cout<<e<<" ";
}
cout<<endl;
return 0;
} |
341fd5ef7b843e8ab3315dcda79286ac2c1d33da | 1f515c64253d340a22436628623d68fd13ec3513 | /blingfirecompile.library/inc/FARSNfa_ar_judy.h | b4d3ba92ff01d90dfc352225f57845a534f18d9e | [
"LicenseRef-scancode-generic-cla",
"MIT"
] | permissive | microsoft/BlingFire | 92467240018cdbed9a3288b7f8d33f04bc9b28c5 | 5dad17aa31dd87c9992d9570ab0dd20e84246fa6 | refs/heads/master | 2023-08-20T23:43:13.448077 | 2023-06-27T13:00:11 | 2023-06-27T13:00:11 | 175,482,543 | 574 | 81 | MIT | 2023-06-27T13:00:13 | 2019-03-13T19:04:41 | C++ | UTF-8 | C++ | false | false | 3,165 | h | FARSNfa_ar_judy.h | /**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
#ifndef _FA_RSNFA_AR_JUDY_H_
#define _FA_RSNFA_AR_JUDY_H_
#include "FAConfig.h"
#include "FARSNfaA.h"
#include "FAArray_t.h"
#include "FAArray_cont_t.h"
namespace BlingFire
{
class FAMultiMap_judy;
class FAAllocatorA;
//
// FARSNfaA implementation, see FARSNfaA.h for the methods description
//
class FARSNfa_ar_judy : public FARSNfaA {
public:
FARSNfa_ar_judy (FAAllocatorA * pAlloc);
virtual ~FARSNfa_ar_judy ();
public:
const int GetMaxState () const;
const int GetMaxIw () const;
const int GetInitials (const int ** ppStates) const;
const int GetFinals (const int ** ppStates) const;
const bool IsFinal (const int State) const;
const bool IsFinal (const int * pStates, const int Size) const;
const int GetIWs (
const int State,
const int ** ppIws
) const;
const int GetDest (
const int State,
const int Iw,
const int ** ppIwDstStates
) const;
const int GetDest (
const int State,
const int Iw,
int * pDstStates,
const int MaxCount
) const;
public:
// call this method before Create
void SetMaxState (const int MaxState);
// call this method before Create
void SetMaxIw (const int MaxIw);
// must be called before any transitions have been added
void Create ();
// call this method once for each pair <FromState, Iw>
void SetTransition (const int FromState,
const int Iw,
const int * pDstStates,
const int DstStatesCount);
// adds a transition
void SetTransition (const int FromState, const int Iw, const int DstState);
void SetInitials (const int * pStates, const int StateCount);
// expects finals to have the largest numbers amoung all the states, e.g.
// f > q \forall f \in F and q \in Q/F
void SetFinals (const int * pStates, const int StateCount);
// must be called after all transitions have been added
void Prepare ();
/// return Nfa into the just after constructor call (frees memory)
void Clear ();
public:
/// additional functionality
void PrepareState (const int State);
/// adds more states to the automaton,
/// new size is OldSize + StatesCount states
void AddStateCount (const int StatesCount);
/// actually, just increments m_IwCount
/// the new IwCount is old IwCount plus IwCount
void AddIwCount (const int IwCount);
private:
/// creates all necessary structures for the State
inline void create_state (const int State);
private:
unsigned int m_IwCount;
unsigned int m_StateCount;
FAArray_cont_t < int > m_initials;
FAArray_cont_t < int > m_finals;
int m_min_final;
FAArray_cont_t < FAArray_cont_t < int > * > m_state2iws;
FAArray_cont_t < FAMultiMap_judy * > m_state_iw2dsts;
FAAllocatorA * m_pAlloc;
};
}
#endif
|
018fecd4df16d9629db6e18137131e6fa725cb50 | 8ca37e18b25d0b9cbf1ebe003f460ca3098e64ee | /homework5_4/main.cpp | 1506fc75a9e17c7df0b2ba4a04e4bfb13677b3bd | [] | no_license | FredyJMartinez/Coding-Problems- | b87d7ce83eb13f0338779fbf133326559cb9101f | 3948f356e2246d824b29ffa00ce94a05fd8ce61a | refs/heads/master | 2020-03-25T15:57:17.091381 | 2018-08-07T17:50:00 | 2018-08-07T17:50:00 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 671 | cpp | main.cpp | #include <iostream>
#include <vector>
#include "MinQueue.h"
int main() {
MinQueue a;
std::cout<< " Creating MinQueue object a and enqueuing values" << std::endl;
a.enqueue(5);
a.enqueue(4);
a.enqueue(2);
a.enqueue(6);
a.enqueue(1);
a.enqueue(3);
a.enqueue(-2);
a.displayQueue();
std::cout << " The minimum value in the queue is : " << a.queueMin() << std::endl;
MinQueue b;
std::cout<< " Creating MinQueue object b and enqueuing values -99 to 99" << std::endl;
for (int i = -99; i < 99 ; ++i) {
b.enqueue(i);
}
b.displayQueue();
std::cout << " The minimum value in the queue is : " << b.queueMin() << std::endl;
return 0;
} |
18017e8a8fa4788d367ee41dacee35fad4f6694c | 85ea311b64319d745976412914d7dbd7b87d790f | /1052_Linked_List_Sorting.cpp | 22c8f45278f2bd89bac7966a534f1030e984a7bb | [] | no_license | h-hkai/PAT_ADVANCED | 2865418d5770ef46716221da6699d6041e3e306e | 7d3d0b5866eb494e513b131e0596ad8b0160c216 | refs/heads/master | 2023-04-10T13:21:04.301098 | 2021-04-23T13:39:35 | 2021-04-23T13:39:35 | 286,212,040 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,009 | cpp | 1052_Linked_List_Sorting.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node {
int address;
int val;
int next;
};
bool cmp(Node a, Node b) { return a.val < b.val; }
int main() {
int n, head;
cin >> n >> head;
map<int, Node> mp;
for (int i = 0; i < n; ++i) {
int address, val, next;
cin >> address >> val >> next;
mp[address] = {address, val, next};
}
int cur = head;
vector<Node> link;
while (cur != -1) {
if (mp.find(cur) != mp.end()) {
link.push_back(mp[cur]);
cur = mp[cur].next;
}
}
sort(link.begin(), link.end(), cmp);
int len = link.size();
if (len == 0)
printf("0 -1\n");
else
printf("%d %05d\n", len, link[0].address);
for (int i = 0; i < len - 1; ++i) {
printf("%05d %d %05d\n", link[i].address, link[i].val,
link[i + 1].address);
}
if (len > 0)
printf("%05d %d -1\n", link[len - 1].address, link[len - 1].val);
return 0;
} |
1143637835e2e799dcd654bcecded2b0be405b38 | 7dd1a7796a6c1e47dfdac036013c193f6bfdd142 | /Essential Math Tutorial 6 Starter/SpriteLib3.0-v2.0/Trigger.h | 0bbf01f0d7861ca56c09d483d7cc5702b9a3148e | [] | no_license | MsMarvel97/Animal-Crossing-Cobalt-Horizons | 434f714aca4c2aa4eeeef6f766ed037918666a99 | d664c54a7b302fe3a1e072ea2a9e60ba9e2abbf1 | refs/heads/main | 2023-01-23T06:21:08.894302 | 2020-12-06T21:57:00 | 2020-12-06T21:57:00 | 311,548,613 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,233 | h | Trigger.h | #pragma once
#include <vector>
#include "PhysicsBody.h"
class Trigger
{
public:
//Depreciated use OnEnter and OnExit instead
virtual void OnTrigger();
virtual void OnEnter();
virtual void OnExit();
void SetTriggerEntity(int triggerEnt);
int GetTriggerEntity();
void AddTargetMoveX(float x);
void AddTargetMoveY(float y);
void SetScalar(float x);
void SetFixtures(int y);
void SetSpriteScale(std::string sprite);
void SetVectorMove(b2Vec2 move);
void TriggeredBodies(PhysicsBody body);
void SetRotationAngle(float r);
void AddTargetEntity(int entity);
void SetTargetEntities(std::vector<int> entities);
void SetCheck(bool checking);
bool GetCheck();
std::vector<int> GetTargetEntities();
b2Vec2 movement = (b2Vec2(0.f, 0.f));
void SetFlag(int setTrue);
void SetDiaNum(int setTrue);//used for dialogue trigger
protected:
int m_triggerEntity;
float scalar = 0;
float fixtures = 0;
float rotation = 0;
std::string spriteScale;
std::vector<int> m_targetEntities;
std::vector<PhysicsBody> m_bodies;
std::vector<int> m_targetX;
std::vector<int> m_targetY;
bool check = false;
int flag = 0;
int diaNum = 0;//used for dialogue trigger
};
|
53f91854dd14ec2059c5228288087865a7bf6d65 | 18bff2dd27cfbd0480c2f7b50fd437955fe47b87 | /build-tools/ssgnc-db-split.cc | 1e0363bdc78441e33f31574fadafea419fd6ef59 | [
"BSD-3-Clause"
] | permissive | xen/ssgnc | 44b42c88da32cea2fb0480e24d15facae8bdc75e | f40c581bb148b38b14f660dba8b9fe4653fecf14 | refs/heads/master | 2016-09-06T05:28:53.272911 | 2010-09-24T17:45:09 | 2010-09-24T17:45:09 | 33,755,852 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,282 | cc | ssgnc-db-split.cc | #include "tools-common.h"
namespace {
ssgnc::Int32 num_tokens;
ssgnc::VocabDic vocab_dic;
bool readNgram(ssgnc::ByteReader *byte_reader, ssgnc::Int16 *freq,
ssgnc::StringBuilder *ngram_buf)
{
if (!ssgnc::tools::readFreq(byte_reader, ngram_buf, freq))
{
if (byte_reader->bad())
SSGNC_ERROR << "ssgnc::tools::readFreq() failed" << std::endl;
return false;
}
if (*freq == 0)
return true;
if (!ssgnc::tools::readTokens(num_tokens, vocab_dic,
byte_reader, ngram_buf, NULL))
{
SSGNC_ERROR << "ssgnc::tools::readTokens() failed" << std::endl;
return false;
}
return true;
}
bool openNextFile(ssgnc::FilePath *file_path, std::ofstream *file)
{
if (file_path->tell() != 0)
{
if (!file->flush())
{
SSGNC_ERROR << "std::ofstream::flush() failed" << std::endl;
return false;
}
file->close();
}
ssgnc::StringBuilder path;
if (!file_path->read(&path))
{
SSGNC_ERROR << "ssgnc::FilePath::read() failed" << std::endl;
return false;
}
if (file->is_open())
file->close();
file->open(path.ptr(), std::ios::binary);
if (!*file)
{
SSGNC_ERROR << "std::ofstream::open() failed: "
<< path.str() << std::endl;
return false;
}
return true;
}
bool writeNgramOffset(ssgnc::Int32 file_id, ssgnc::UInt32 offset)
{
ssgnc::NgramIndex::FileEntry entries;
if (!entries.set_file_id(file_id))
{
SSGNC_ERROR << "ssgnc::NgramIndex::FileEntry::set_file_id() failed: "
<< file_id << std::endl;
return false;
}
if (!entries.set_offset(offset))
{
SSGNC_ERROR << "ssgnc::NgramIndex::FileEntry::set_offset() failed: "
<< offset << std::endl;
return false;
}
if (!ssgnc::Writer(&std::cout).write(entries))
{
SSGNC_ERROR << "ssgnc::Writer::write() failed" << std::endl;
return false;
}
return true;
}
bool splitDatabase(ssgnc::FilePath *file_path)
{
static const ssgnc::UInt32 MAX_FILE_SIZE = 0x7FFFFFFFU;
std::ofstream file;
ssgnc::ByteReader byte_reader;
if (!byte_reader.open(&std::cin))
{
SSGNC_ERROR << "ssgnc::ByteReader::open() failed" << std::endl;
return false;
}
ssgnc::UInt64 num_ngrams = 0;
ssgnc::UInt32 file_size = MAX_FILE_SIZE + 1;
ssgnc::UInt64 total_size = 0;
if (!writeNgramOffset(0, 0))
{
SSGNC_ERROR << "writeNgramOffset() failed" << std::endl;
return false;
}
ssgnc::Int16 freq;
ssgnc::StringBuilder ngram_buf;
while (readNgram(&byte_reader, &freq, &ngram_buf))
{
if (file_size + ngram_buf.length() > MAX_FILE_SIZE)
{
if (file_path->tell() != 0)
{
std::cerr << "File ID: " << (file_path->tell() - 1)
<< ", File size: " << file_size << std::endl;
}
if (!openNextFile(file_path, &file))
{
SSGNC_ERROR << "openNextFile() failed" << std::endl;
return false;
}
file_size = 0;
}
if (freq == 0)
{
file.put('\0');
++file_size;
if (!writeNgramOffset(file_path->tell() - 1, file_size))
{
SSGNC_ERROR << "writeNgramOffset() failed" << std::endl;
return false;
}
continue;
}
file << ngram_buf;
if (!file)
{
SSGNC_ERROR << "std::ofstream::operator<<() failed" << std::endl;
}
file_size += ngram_buf.length();
total_size += ngram_buf.length();
++num_ngrams;
}
if (!file.flush())
{
SSGNC_ERROR << "std::ofstream::flush() failed" << std::endl;
return false;
}
else if (!std::cout.flush())
{
SSGNC_ERROR << "std::ostream::flush() failed" << std::endl;
return false;
}
if (byte_reader.bad())
{
SSGNC_ERROR << "readNgram() failed" << std::endl;
return false;
}
else if (!byte_reader.eof())
{
SSGNC_ERROR << "Extra bytes" << std::endl;
return false;
}
std::cerr << "File ID: " << (file_path->tell() - 1)
<< ", File size: " << file_size << std::endl;
std::cerr << "No. ngrams: " << num_ngrams
<< ", Total size: " << total_size << std::endl;
return true;
}
} // namespace
int main(int argc, char *argv[])
{
ssgnc::tools::initIO();
if (argc != 4)
{
std::cerr << "Usage: " << argv[0]
<< " NUM_TOKENS VOCAB_DIC INDEX_DIR" << std::endl;
return 1;
}
if (!ssgnc::tools::parseNumTokens(argv[1], &num_tokens))
return 2;
if (!vocab_dic.open(argv[2]))
return 3;
ssgnc::FilePath file_path;
if (!ssgnc::tools::initFilePath(argv[3], "db", num_tokens, &file_path))
return 4;
if (!splitDatabase(&file_path))
return 5;
return 0;
}
|
2af3a33a52d054963960499907e87f5c2426cf4d | 9abcffbd3b5ce320d193d99c0212776c5cc2b8f1 | /Read.h | ce99bb50d0f46b26d9045a321cd77cec9a33bba1 | [] | no_license | szmflis/OOP-WGGIOS | 0ffd1b3f56a113d4a9f85255dd75a4e08134b4a7 | 3074311a587f34d40386b09b4ee786cef993950e | refs/heads/master | 2023-02-03T23:13:16.728099 | 2020-12-23T18:57:23 | 2020-12-23T18:57:23 | 314,559,108 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 260 | h | Read.h | //
// Created by szymo on 12/22/2020.
//
#ifndef FLISSZYMON_ETAP1_READ_H
#define FLISSZYMON_ETAP1_READ_H
#include <string>
class Read {
public:
Read() = default;
double readNum();
std::string readString();
};
#endif //FLISSZYMON_ETAP1_READ_H
|
5b9d43862a2288895f80af2f3bac3e90e0687e8d | 7d283a9814a0052b99daccafa0825f2d3a2e2840 | /ParticalEffect/Screen.cpp | d5d752d8bfd1aaa47a2efa2fc795d5283e886dfd | [] | no_license | RadiumP/ParticalEffect | 186a2ad1d147cc4c55d0d2550fa950f92c45c014 | 10449c469c3c530bb5992c1af0a35e1f14ff3606 | refs/heads/master | 2021-01-11T18:46:51.528350 | 2017-02-04T23:20:23 | 2017-02-04T23:20:23 | 79,625,606 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,200 | cpp | Screen.cpp | #include "Screen.h"
#include <iostream>
Screen::Screen():
window(NULL), renderer(NULL),texture(NULL), buffer(NULL), buffer2(NULL)
{
}
Screen::~Screen()
{
}
bool Screen::init()
{
if (SDL_Init(SDL_INIT_VIDEO) < 0)
{
return false;
}
// init window
window = SDL_CreateWindow("Particle", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCR_W, SCR_H, SDL_WINDOW_SHOWN);
if (window == NULL)
{
SDL_Quit();
return false;
}
//init render, texture and buffer
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_PRESENTVSYNC);
texture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_ABGR8888, SDL_TEXTUREACCESS_STATIC, SCR_W, SCR_H);//255
if (renderer == NULL)
{
SDL_DestroyWindow(window);
SDL_Quit();
return false;
}
if (texture == NULL)
{
SDL_DestroyWindow(window);
SDL_Quit();
return false;
}
buffer = new Uint32[SCR_W*SCR_H];
buffer2 = new Uint32[SCR_W*SCR_H];
memset(buffer, 0, SCR_W*SCR_H*sizeof(Uint32));//set block of memory; init to white
memset(buffer2, 0, SCR_W*SCR_H*sizeof(Uint32));//set block of memory; init to white
return true;
}
void Screen::boxBlur()
{
//swap buffers, so pixel is in buffer2 and drawing to buffer
Uint32 *temp = buffer;
buffer = buffer2;
buffer2 = temp;
for (int y = 0; y < SCR_H; y++)
{
for (int x = 0; x < SCR_W; x++)
{
int redTotal = 0;
int greenTotal = 0;
int blueTotal = 0;
for (int row = -1; row <= 1; row++)
{
for (int col = -1; col <= 1; col++)
{
int currentX = x + col;
int currentY = y + row;
if (currentX >= 0 && currentX < SCR_W && currentY >= 0 && currentY < SCR_H)
{
Uint32 color = buffer2[currentY * SCR_W + currentX];
Uint8 red = color;
Uint8 green = color >> 8;
Uint8 blue = color>>16;
redTotal += red;
greenTotal += green;
blueTotal += blue;
}
}
}
Uint8 red = redTotal / 9;
Uint8 green = greenTotal / 9;
Uint8 blue = blueTotal / 9;
setPixel(x,y,red, green, blue);
}
}
}
void Screen::update()
{
SDL_UpdateTexture(texture, NULL, buffer, SCR_W*sizeof(Uint32));
SDL_RenderClear(renderer);
SDL_RenderCopy(renderer, texture, NULL, NULL);
SDL_RenderPresent(renderer);
}
void Screen::setPixel(int x, int y, Uint8 red, Uint8 green, Uint8 blue)
{
if (x < 0 || x >= SCR_W || y < 0 || y >= SCR_H)
{
return;
}
Uint32 color = 0;
color += 0xFF;
color <<= 8;
color += blue;
color <<= 8;
color += green;
color <<= 8;
color += red;
//color += red;
//color <<= 8;
//color += green;
//color <<= 8;
//color += blue;
//color <<= 8;
//color += 0xFF;
buffer[(y * SCR_W) + x] = color;//0x00FF00;
}
void Screen::clear()
{
memset(buffer, 0, SCR_W*SCR_H*sizeof(Uint32));//set block of memory; init to white
memset(buffer2, 0, SCR_W*SCR_H*sizeof(Uint32));//set block of memory; init to white
}
bool Screen::processEvents()
{
SDL_Event event;
while (SDL_PollEvent(&event))
{
if (event.type == SDL_QUIT)
{
return false;
}
}
return true;
}
void Screen::close()
{
//close
delete[] buffer;
delete[] buffer2;
SDL_DestroyRenderer(renderer);
SDL_DestroyTexture(texture);
SDL_DestroyWindow(window);
SDL_Quit();
}
|
bf005e2a9330253cdd58f8518cd08a3fdc710375 | c2fe43fd81fb705e9d764fee57eeb8bc7e25a9db | /pl0-Lexer/pl0-Lexer/Token.h | bd15d381b1318dc8b2377eda32e907e27265df13 | [] | no_license | qmpzqaz/pl0-Lexer | 014ff03fa230c28995d29ad994927beb889de7f6 | fb3a100ea5fc6a28c9efb488234f4c8e6b454448 | refs/heads/master | 2021-01-10T04:52:29.952477 | 2016-03-26T12:11:41 | 2016-03-26T12:11:41 | 54,768,060 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 771 | h | Token.h | #pragma once
#include "Tag.h"
#include <string>
class Token {
public:
Token();
Token(std::string, Tag, int);
virtual ~Token();
Tag tag();
int lineno();
void set_tag(Tag);
std::string name();
virtual std::string ContentToString();
private:
std::string name_;
Tag tag_;
int lineno_ = 1;
};
Token::Token() {
}
inline Token::Token(std::string name, Tag tag, int lineno)
:name_(name), tag_(tag), lineno_(lineno) {
}
Token::~Token() {
}
inline Tag Token::tag() {
return tag_;
}
inline int Token::lineno() {
return lineno_;
}
inline void Token::set_tag(Tag tag) {
tag_ = tag;
}
inline std::string Token::name() {
return name_;
}
inline std::string Token::ContentToString() {
return std::string();
}
|
aacd18612ac9a1917960bad6cf5b9d3217a0e277 | c0361e6cc93bea1a8b7fcdc43db80a8c46b929c8 | /server/server.cpp | 7689920b374d31fc767617839c7ab16b3a4f54c5 | [] | no_license | zoujiaqing/DistributedLevelDB | 2b51304fb11e1e6eb83071e44c803172727760cb | 43d03acc0bda64e7111865496873ce3a360a47dc | refs/heads/master | 2021-01-21T00:16:19.094563 | 2013-12-23T17:17:29 | 2013-12-23T17:17:29 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,763 | cpp | server.cpp | //server.cpp
#include "include/server.h"
server::server(const uint16_t port, const char* ip)
{
try
{
//socket construction:
if ((socket_fd=socket(AF_INET, SOCK_STREAM, 0))==-1)
throw SOCKET_CONSTRUCT_ERROR;
/* setsockopt: Handy debugging trick that lets
* us rerun the server immediately after we kill it;
* otherwise we have to wait about 20 secs.
* Eliminates "ERROR on binding: Address already in use" error.
*/
int optval = 1;
setsockopt(socket_fd, SOL_SOCKET, SO_REUSEADDR,
(const void *)&optval , sizeof(int));
memset(hostname, 0, 256);
gethostname(hostname, 256);
memset(&svaddr, 0, sizeof(struct sockaddr_in));
svaddr.sin_family = AF_INET;
svaddr.sin_port = htons(port);
if (!ip)
{
// code from
// http://stackoverflow.com/questions/212528/get-the-ip-address-of-the-machine
bool foundip = false;
struct ifaddrs* ifaAddrStruct = NULL;
struct ifaddrs* ifa = NULL; //iterator to scan each
//ip address on host
getifaddrs(&ifaAddrStruct);
for(ifa = ifaAddrStruct; ifa!=NULL; ifa = ifa->ifa_next)
{
if (ifa->ifa_addr->sa_family==AF_INET //ipv4
&& strcmp(ifa->ifa_name,"eth0")==0) //eth0 or lo
{
//only deal with ethernet ipv4 for now...
//may support ipv6 in future
svaddr.sin_addr =
((struct sockaddr_in*)ifa->ifa_addr)->sin_addr;
foundip = true;
break;
}
}
if (!foundip)
throw SOCKET_BIND_ERROR;
}
else
inet_pton(AF_INET, ip, (void*)&svaddr.sin_addr);
//convert presentation format ip address
//to struct in_addr binary format
//socket binding:
if (bind(socket_fd, (struct sockaddr*)&svaddr, sizeof(struct sockaddr_in))==-1)
throw SOCKET_BIND_ERROR;
//socket listening:
if (listen(socket_fd, MAX_CONN)==-1)
throw SOCKET_LISTEN_ERROR;
}
catch(int e)
{
throw;
}
}
server::~server()
{
if (close(socket_fd)==-1)
throw SOCKET_CLOSE_ERROR;
}
// returns client socket file descriptor
// will also print client address info in stdout
int server::accept_conn()
{
try
{
struct sockaddr_in claddr; //client address
socklen_t claddr_len = sizeof(claddr);
struct hostent *hostp; // client host info
char *hostaddrp; // dotted decimal host addr string
int comm_sock_fd; // socket descriptor to communicat with clienet
bool knownclient = true;
// note this is not the same as sock_fd!!!
//socket accepting:
if ((comm_sock_fd =
accept(socket_fd, (struct sockaddr*) &claddr, &claddr_len))<0)
{
std::cerr<<"sock accept err 1"<<std::endl;
throw SOCKET_ACCEPT_ERROR;
}
// gethostbyaddr: determine who sent the message
hostp = gethostbyaddr((const char *)&claddr.sin_addr.s_addr,
sizeof(claddr.sin_addr.s_addr), AF_INET);
if (hostp == NULL)
{
//client ip unknown
knownclient = false;
//throw SOCKET_ACCEPT_ERROR;
}
else
{
hostaddrp = inet_ntoa(claddr.sin_addr);
if (hostaddrp == NULL)
{
//client port unknown
knownclient = false;
//throw SOCKET_ACCEPT_ERROR;
}
}
if(knownclient)
{
printf("server established connection with %s (%s)\n",
hostp->h_name, hostaddrp);
}
return comm_sock_fd;
}
catch(int e)
{
throw;
}
}
uint16_t server::getport()
{
return ntohs(svaddr.sin_port);
}
std::string server::getip()
{
char ip[INET_ADDRSTRLEN];
inet_ntop(AF_INET, (void*)&svaddr.sin_addr, ip, INET_ADDRSTRLEN);
return std::string(ip);
}
std::string server::getsvrname()
{
return std::string(hostname);
}
int server::getsockfd()
{
return socket_fd;
}
|
1d14b70498f0e8b343fa79fb2a301a38036b41cd | 07faf13693a4770e4a1a0b951b397c976d4f529c | /Ouroboros/Source/test_services.h | 15cbc5e94ef44fc9542746051f0c7f0c48d85302 | [
"MIT"
] | permissive | dismalion/oooii | 5bb3a8b5f9c97c4d280e3380730bd6b170edaaf3 | 0866541aee7bef8fc4a877b8aac8bd7cdebde755 | refs/heads/master | 2021-01-10T13:02:43.269614 | 2014-09-24T05:25:43 | 2014-09-24T05:25:43 | 48,484,964 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 5,293 | h | test_services.h | // Copyright (c) 2014 Antony Arciuolo. See License.txt regarding use.
// This is an abstraction for the implementations required to run unit tests.
// Libraries in Ouroboros are broken up into dependencies on each other and on
// system resources. For example oBase is dependent on C++11/compiler features
// and oCore is dependent on non-standard operating system API. To be able to
// test a library sometimes requires extra features not available directly to
// the library so to keep each library isolated to the point it can be used in
// a different library without other higher-level Ouroboros libraries and expose
// an abstract interface for enabling the unit tests - it would be up to client
// code to implement these interfaces.
#pragma once
#include <oMemory/allocate.h>
#include <oSurface/image.h>
#include <chrono>
#include <cstdarg>
#include <functional>
#include <memory>
#include <stdexcept>
#define oTEST_THROW(msg, ...) do { services.error(msg, ## __VA_ARGS__); } while(false)
#define oTEST(expr, msg, ...) do { if (!(expr)) services.error(msg, ## __VA_ARGS__); } while(false)
#define oTEST0(expr) do { if (!(expr)) services.error("\"" #expr "\" failed"); } while(false)
namespace ouro {
namespace surface { class buffer; }
class test_services
{
public:
class finally
{
public:
explicit finally(std::function<void()>&& f) : fin(std::move(f)) {}
~finally() { fin(); }
private:
std::function<void()> fin;
};
// Detail some timings to TTY
class timer
{
public:
timer(test_services& services) : srv(services) { start = srv.now(); }
void reset() { start = srv.now(); }
double seconds() const { return srv.now() - start; }
private:
double start;
test_services& srv;
};
// Detail some timings to TTY
class scoped_timer
{
public:
scoped_timer(test_services& services, const char* name) : srv(services), n(name) { start = srv.now(); }
~scoped_timer() { trace(); }
double seconds() const { return srv.now() - start; }
inline void trace() { srv.report("%s took %.03f sec", n ? n : "(null)", seconds()); }
private:
const char* n;
double start;
test_services& srv;
};
// Generate a random number. The seed is often configurable from the test
// infrastructure so behavior can be reproduced.
virtual int rand() = 0;
// Returns a timer reasonably suited for benchmarking performance in unit
// tests.
inline double now() const { return std::chrono::duration_cast<std::chrono::duration<double, std::ratio<1>>>(std::chrono::high_resolution_clock::now().time_since_epoch()).count(); }
// Write to the test infrastructure's TTY
virtual void vreport(const char* fmt, va_list args) = 0;
inline void report(const char* fmt, ...) { va_list a; va_start(a, fmt); vreport(fmt, a); va_end(a); }
// throws the specified message
inline void verror(const char* fmt, va_list args) { char msg[1024]; vsnprintf(msg, 1024, fmt, args); throw std::logic_error(msg); }
inline void error(const char* fmt, ...) { va_list a; va_start(a, fmt); verror(fmt, a); va_end(a); }
inline void vskip(const char* fmt, va_list args) { char msg[1024]; vsnprintf(msg, 1024, fmt, args); throw std::system_error(std::make_error_code(std::errc::permission_denied), msg); }
inline void skip(const char* fmt, ...) { va_list a; va_start(a, fmt); vskip(fmt, a); va_end(a); }
// Abstracts vsnprintf and snprintf (since Visual Studio complains about it)
virtual int vsnprintf(char* dst, size_t dst_size, const char* fmt, va_list args) = 0;
inline int snprintf(char* dst, size_t dst_size, const char* fmt, ...) { va_list a; va_start(a, fmt); int x = vsnprintf(dst, dst_size, fmt, a); va_end(a); return x; }
template<size_t size> int snprintf(char (&dst)[size], const char* fmt, ...) { va_list a; va_start(a, fmt); int x = vsnprintf(dst, size, fmt, a); va_end(a); return x; }
virtual void begin_thread(const char* name) = 0;
virtual void update_thread() = 0;
virtual void end_thread() = 0;
// Returns the root path from which any test data should be loaded.
virtual char* test_root_path(char* dst, size_t dst_size) const = 0;
template<size_t size> char* test_root_path(char (&dst)[size]) const { return test_root_path(dst, size); }
// Load the entire contents of the specified file into a newly allocated
// buffer.
virtual ouro::scoped_allocation load_buffer(const char* _Path) = 0;
virtual bool is_debugger_attached() const = 0;
virtual bool is_remote_session() const = 0;
virtual size_t total_physical_memory() const = 0;
// Returns the average and peek percent usage of the CPU by this process
virtual void get_cpu_utilization(float* out_avg, float* out_peek) = 0;
// Resets the frame of recording average and peek percentage CPU utilization
virtual void reset_cpu_utilization() = 0;
// This function compares the specified surface to a golden image named after
// the test's name suffixed with nth. If nth is 0 then the golden
// image should not have a suffix. If max_rms_error is negative a default
// should be used. If the surfaces are not similar this throws an exception.
virtual void check(const surface::image& img, int nth = 0, float max_rms_error = -1.0f) = 0;
};
}
|
4db7caea3f43da951b82fd32d2800f61c9339887 | e6652252222ce9e4ff0664e539bf450bc9799c50 | /d0707/20160707/test/source/tyz-lps/elf.cpp | ffc1afc81594a9b257bd6e6f2df5d6d19a0d43ee | [] | no_license | cjsoft/inasdfz | db0cea1cf19cf6b753353eda38d62f1b783b8f76 | 3690e76404b9189e4dd52de3770d59716c81a4df | refs/heads/master | 2021-01-17T23:13:51.000569 | 2016-07-12T07:21:19 | 2016-07-12T07:21:19 | 62,596,117 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,253 | cpp | elf.cpp | #include<iostream>
#include<stdio.h>
#include<string.h>
using namespace std;
char s[45];
char ss[45];
long long a[45];
long long t;
char tt[45];
int nex[45];
int n,m,sum;
void get()
{
int j=-1;
for(int i=0;i<m;i++)
{
while(j!=-1&&ss[i]!=ss[j+1]) j=nex[j];
if(ss[i]==ss[j+1]&&i!=0) j++;
nex[i]=j;
}
}
bool kmp()
{
int j=-1;
for(int i=0;i<=39;i++)
{
while(j!=-1&&tt[i]!=ss[j+1]) j=nex[j];
if(tt[i]==ss[j+1]) j++;
if(j==m-1)
return 1;
}
return 0;
}
void dfs(int x,long long now)
{
if(x==n+1)
{
for(int j=39;j>=0;j--)
{
if(((1LL<<j)&now)!=0)
{
tt[39-j]='1';
}
else
tt[39-j]='0';
}
if(kmp()) sum++;
return ;
}
dfs(x+1,now^a[x]);
dfs(x+1,now);
}
int main()
{
freopen("elf","r",stdin);
freopen("elf","w",stdout);
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
long long tmp=0;
scanf("%s",s);
for(int j=0;j<=39;j++)
{
if(s[j]=='1')
tmp+=(1LL<<(39-j));
}
a[i]=tmp;
}
scanf("%d",&m);
scanf("%s",ss);
long long tmp=0;
for(int j=0;j<=m-1;j++)
{
if(ss[j]=='1')
tmp+=(1LL<<(m-1-j));
}
t=tmp;
get();
sum=0;
dfs(1,0);
printf("%d\n",sum);
}
|
7d2988ea4632d49d685e9786674862e95bc974d2 | 4fcf2967da46f37c831b72b7b97f705d3364306d | /problems/acmicpc_14931.cpp | 5a1b059a468c7e5a5f5a6b58384d8b11d07b0064 | [
"MIT"
] | permissive | qawbecrdtey/BOJ-sol | e2be11e60c3c19e88439665d586cb69234f2e5db | 249b988225a8b4f52d27c5f526d7c8d3f4de557c | refs/heads/master | 2023-08-03T15:04:50.837332 | 2023-07-30T08:25:58 | 2023-07-30T08:25:58 | 205,078,469 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 423 | cpp | acmicpc_14931.cpp | #include <stdio.h>
using ll = long long;
int main() {
int n;
scanf("%d", &n);
auto a = new int[n + 1];
a[0] = 0;
for(int i = 1; i <= n; i++) {
scanf("%d", &a[i]);
}
int idx = 0;
ll res = 0;
for(int i = 1; i <= n; i++) {
ll sum = 0;
for(int j = i; j <= n; j += i) {
sum += a[j];
}
if(!idx || res < sum) {
idx = i;
res = sum;
}
}
if(res < 0) printf("0 0");
else printf("%d %lld", idx, res);
} |
b4bded96c8a2f4fae126171d7262bd7d3caf6416 | 95ab8a21dda989fde5b0796d1488c30128a01391 | /CodeForces/C++/1485E.cpp | 9181c0adff3b2d9e9d503f860bad887814f04885 | [] | no_license | neelaryan2/CompetitiveProgramming | caa20ffcdee57fb2e15ceac0e7ebbe4e7277dc34 | 959c3092942751f833b489cc91744fc68f8c65d2 | refs/heads/master | 2021-06-28T14:10:50.545527 | 2021-02-15T17:34:03 | 2021-02-15T17:34:03 | 216,887,910 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,954 | cpp | 1485E.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "trace.h"
#else
#define trace(args...)
#endif
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using vi = vector<int>;
using vpi = vector<pii>;
#define mp make_pair
#define ub upper_bound
#define lb lower_bound
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
const ll inf = 1e18 + 7;
vector<vi> adj, nodes;
vector<ll> a, par;
void dfs(int v, int p = -1, int d = 0) {
par[v] = p;
if (d == nodes.size())
nodes.eb();
nodes[d++].eb(v);
for (int u : adj[v]) {
if (u == p) continue;
dfs(u, v, d);
}
}
void solve(int test) {
int n;
cin >> n;
adj.assign(n, {});
nodes.clear();
for (int i = 1, v; i < n; i++) {
cin >> v, v--;
adj[v].eb(i);
adj[i].eb(v);
}
a.assign(n, 0);
par.resize(n);
for (int i = 1; i < n; i++)
cin >> a[i];
dfs(0);
vector<ll> dp(n, -inf);
dp[0] = 0;
for (int i = 1; i < nodes.size(); i++) {
vi& cur = nodes[i];
ll minuss = -inf, pluss = -inf;
ll mxa = -inf, mna = inf;
for (int& u : cur) {
int v = par[u];
mxa = max(mxa, a[u]);
mna = min(mna, a[u]);
pluss = max(pluss, dp[v] + a[u]);
minuss = max(minuss, dp[v] - a[u]);
}
for (int& u : cur) {
int v = par[u], mx = max(abs(mna - a[u]), abs(mxa - a[u]));
dp[u] = max({dp[v] + mx, pluss - a[u], minuss + a[u]});
}
}
ll ans = *max_element(all(dp));
cout << ans;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int t = 1;
cin >> t;
for (int i = 1; i <= t; i++) {
// cout << "Case #" << i << ": ";
solve(i);
cout << '\n';
}
}
|
9db033f4f393fe4a5f597f73dc419eab7843d89d | 174e4d6cdf38d9af67c2c3729ade5f427c9520a5 | /.vs/LandingOnRivalSpace/LandingOnRivalSpace/LandingOnRivalSpace.cpp | d416cf72d96837c1ccd48dfdd06a64248f9c3710 | [] | no_license | TheConfusedOne1/GDW-Group-16_Text-Boardgame | 145e6d8ea5507c44c74fb7e4e369172e0a0c44b7 | 55916e1faf17777565181ac961cc5b55c12c7504 | refs/heads/main | 2023-01-03T05:34:30.735272 | 2020-10-25T22:35:05 | 2020-10-25T22:35:05 | 306,154,210 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 69,559 | cpp | LandingOnRivalSpace.cpp |
void rivalpropertyLanding(int player)
{
switch (player)
{
case 1:
//if statements used to take player's health for landing on rival property
if (hpValues[player1Space] == 10 && propertySpaceOwnership[player1Space] == 3)
{
cout << "Player 1 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player1Space] == 1)
{
cout << "Player 1 has lost 10HP " << endl;
player1Hp = player1Hp - 10;
}
else if (propertySpaceUpgradeAmount[player1Space] == 2)
{
cout << "Player 1 has lost 15HP " << endl;
player1Hp = player1Hp - 15;
}
else if (propertySpaceUpgradeAmount[player1Space] == 3)
{
cout << "Player 1 has lost 20HP " << endl;
player1Hp = player1Hp - 20;
}
else if (propertySpaceUpgradeAmount[player1Space] == 4)
{
cout << "Player 1 has lost 30HP " << endl;
player1Hp = player1Hp - 30;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player1Space] == 15 && propertySpaceOwnership[player1Space] == 3)
{
cout << "Player 1 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player1Space] == 1)
{
cout << "Player 1 has lost 15HP " << endl;
player1Hp = player1Hp - 15;
}
else if (propertySpaceUpgradeAmount[player1Space] == 2)
{
cout << "Player 1 has lost 20HP " << endl;
player1Hp = player1Hp - 20;
}
else if (propertySpaceUpgradeAmount[player1Space] == 3)
{
cout << "Player 1 has lost 25HP " << endl;
player1Hp = player1Hp - 25;
}
else if (propertySpaceUpgradeAmount[player1Space] == 4)
{
cout << "Player 1 has lost 35HP " << endl;
player1Hp = player1Hp - 35;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player1Space] == 20 && propertySpaceOwnership[player1Space] == 3)
{
cout << "Player 1 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player1Space] == 1)
{
cout << "Player 1 has lost 20HP " << endl;
player1Hp = player1Hp - 20;
}
else if (propertySpaceUpgradeAmount[player1Space] == 2)
{
cout << "Player 1 has lost 25HP " << endl;
player1Hp = player1Hp - 25;
}
else if (propertySpaceUpgradeAmount[player1Space] == 3)
{
cout << "Player 1 has lost 30HP " << endl;
player1Hp = player1Hp - 30;
}
else if (propertySpaceUpgradeAmount[player1Space] == 4)
{
cout << "Player 1 has lost 40HP " << endl;
player1Hp = player1Hp - 40;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player1Space] == 25 && propertySpaceOwnership[player1Space] == 3)
{
cout << "Player 1 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player1Space] == 1)
{
cout << "Player 1 has lost 25HP " << endl;
player1Hp = player1Hp - 25;
}
else if (propertySpaceUpgradeAmount[player1Space] == 2)
{
cout << "Player 1 has lost 30HP " << endl;
player1Hp = player1Hp - 30;
}
else if (propertySpaceUpgradeAmount[player1Space] == 3)
{
cout << "Player 1 has lost 35HP " << endl;
player1Hp = player1Hp - 35;
}
else if (propertySpaceUpgradeAmount[player1Space] == 4)
{
cout << "Player 1 has lost 45HP " << endl;
player1Hp = player1Hp - 45;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player1Space] == 30 && propertySpaceOwnership[player1Space] == 3)
{
cout << "Player 1 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player1Space] == 1)
{
cout << "Player 1 has lost 30HP " << endl;
player1Hp = player1Hp - 30;
}
else if (propertySpaceUpgradeAmount[player1Space] == 2)
{
cout << "Player 1 has lost 35HP " << endl;
player1Hp = player1Hp - 35;
}
else if (propertySpaceUpgradeAmount[player1Space] == 3)
{
cout << "Player 1 has lost 40HP " << endl;
player1Hp = player1Hp - 40;
}
else if (propertySpaceUpgradeAmount[player1Space] == 4)
{
cout << "Player 1 has lost 50HP " << endl;
player1Hp = player1Hp - 50;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player1Space] == 10 && propertySpaceOwnership[player1Space] == 4)
{
cout << "Player 1 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player1Space] == 1)
{
cout << "Player 1 has lost 10HP " << endl;
player1Hp = player1Hp - 10;
}
else if (propertySpaceUpgradeAmount[player1Space] == 2)
{
cout << "Player 1 has lost 15HP " << endl;
player1Hp = player1Hp - 15;
}
else if (propertySpaceUpgradeAmount[player1Space] == 3)
{
cout << "Player 1 has lost 20HP " << endl;
player1Hp = player1Hp - 20;
}
else if (propertySpaceUpgradeAmount[player1Space] == 4)
{
cout << "Player 1 has lost 30HP " << endl;
player1Hp = player1Hp - 30;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player1Space] == 15 && propertySpaceOwnership[player1Space] == 4)
{
cout << "Player 1 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player1Space] == 1)
{
cout << "Player 1 has lost 15HP " << endl;
player1Hp = player1Hp - 15;
}
else if (propertySpaceUpgradeAmount[player1Space] == 2)
{
cout << "Player 1 has lost 20HP " << endl;
player1Hp = player1Hp - 20;
}
else if (propertySpaceUpgradeAmount[player1Space] == 3)
{
cout << "Player 1 has lost 25HP " << endl;
player1Hp = player1Hp - 25;
}
else if (propertySpaceUpgradeAmount[player1Space] == 4)
{
cout << "Player 1 has lost 35HP " << endl;
player1Hp = player1Hp - 35;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player1Space] == 20 && propertySpaceOwnership[player1Space] == 4)
{
cout << "Player 1 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player1Space] == 1)
{
cout << "Player 1 has lost 20HP " << endl;
player1Hp = player1Hp - 20;
}
else if (propertySpaceUpgradeAmount[player1Space] == 2)
{
cout << "Player 1 has lost 25HP " << endl;
player1Hp = player1Hp - 25;
}
else if (propertySpaceUpgradeAmount[player1Space] == 3)
{
cout << "Player 1 has lost 30HP " << endl;
player1Hp = player1Hp - 30;
}
else if (propertySpaceUpgradeAmount[player1Space] == 4)
{
cout << "Player 1 has lost 40HP " << endl;
player1Hp = player1Hp - 40;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player1Space] == 25 && propertySpaceOwnership[player1Space] == 4)
{
cout << "Player 1 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player1Space] == 1)
{
cout << "Player 1 has lost 25HP " << endl;
player1Hp = player1Hp - 25;
}
else if (propertySpaceUpgradeAmount[player1Space] == 2)
{
cout << "Player 1 has lost 30HP " << endl;
player1Hp = player1Hp - 30;
}
else if (propertySpaceUpgradeAmount[player1Space] == 3)
{
cout << "Player 1 has lost 35HP " << endl;
player1Hp = player1Hp - 35;
}
else if (propertySpaceUpgradeAmount[player1Space] == 4)
{
cout << "Player 1 has lost 45HP " << endl;
player1Hp = player1Hp - 45;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player1Space] == 30 && propertySpaceOwnership[player1Space] == 4)
{
cout << "Player 1 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player1Space] == 1)
{
cout << "Player 1 has lost 30HP " << endl;
player1Hp = player1Hp - 30;
}
else if (propertySpaceUpgradeAmount[player1Space] == 2)
{
cout << "Player 1 has lost 35HP " << endl;
player1Hp = player1Hp - 35;
}
else if (propertySpaceUpgradeAmount[player1Space] == 3)
{
cout << "Player 1 has lost 40HP " << endl;
player1Hp = player1Hp - 40;
}
else if (propertySpaceUpgradeAmount[player1Space] == 4)
{
cout << "Player 1 has lost 50HP " << endl;
player1Hp = player1Hp - 50;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player1Space] == 10 && propertySpaceOwnership[player1Space] == 5)
{
cout << "Player 1 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player1Space] == 1)
{
cout << "Player 1 has lost 10HP " << endl;
player1Hp = player1Hp - 10;
}
else if (propertySpaceUpgradeAmount[player1Space] == 2)
{
cout << "Player 1 has lost 15HP " << endl;
player1Hp = player1Hp - 15;
}
else if (propertySpaceUpgradeAmount[player1Space] == 3)
{
cout << "Player 1 has lost 20HP " << endl;
player1Hp = player1Hp - 20;
}
else if (propertySpaceUpgradeAmount[player1Space] == 4)
{
cout << "Player 1 has lost 30HP " << endl;
player1Hp = player1Hp - 30;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player1Space] == 15 && propertySpaceOwnership[player1Space] == 5)
{
cout << "Player 1 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player1Space] == 1)
{
cout << "Player 1 has lost 15HP " << endl;
player1Hp = player1Hp - 15;
}
else if (propertySpaceUpgradeAmount[player1Space] == 2)
{
cout << "Player 1 has lost 20HP " << endl;
player1Hp = player1Hp - 20;
}
else if (propertySpaceUpgradeAmount[player1Space] == 3)
{
cout << "Player 1 has lost 25HP " << endl;
player1Hp = player1Hp - 25;
}
else if (propertySpaceUpgradeAmount[player1Space] == 4)
{
cout << "Player 1 has lost 35HP " << endl;
player1Hp = player1Hp - 35;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player1Space] == 20 && propertySpaceOwnership[player1Space] == 5)
{
cout << "Player 1 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player1Space] == 1)
{
cout << "Player 1 has lost 20HP " << endl;
player1Hp = player1Hp - 20;
}
else if (propertySpaceUpgradeAmount[player1Space] == 2)
{
cout << "Player 1 has lost 25HP " << endl;
player1Hp = player1Hp - 25;
}
else if (propertySpaceUpgradeAmount[player1Space] == 3)
{
cout << "Player 1 has lost 30HP " << endl;
player1Hp = player1Hp - 30;
}
else if (propertySpaceUpgradeAmount[player1Space] == 4)
{
cout << "Player 1 has lost 40HP " << endl;
player1Hp = player1Hp - 40;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player1Space] == 25 && propertySpaceOwnership[player1Space] == 5)
{
cout << "Player 1 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player1Space] == 1)
{
cout << "Player 1 has lost 25HP " << endl;
player1Hp = player1Hp - 25;
}
else if (propertySpaceUpgradeAmount[player1Space] == 2)
{
cout << "Player 1 has lost 30HP " << endl;
player1Hp = player1Hp - 30;
}
else if (propertySpaceUpgradeAmount[player1Space] == 3)
{
cout << "Player 1 has lost 35HP " << endl;
player1Hp = player1Hp - 35;
}
else if (propertySpaceUpgradeAmount[player1Space] == 4)
{
cout << "Player 1 has lost 45HP " << endl;
player1Hp = player1Hp - 45;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player1Space] == 30 && propertySpaceOwnership[player1Space] == 5)
{
cout << "Player 1 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player1Space] == 1)
{
cout << "Player 1 has lost 30HP " << endl;
player1Hp = player1Hp - 30;
}
else if (propertySpaceUpgradeAmount[player1Space] == 2)
{
cout << "Player 1 has lost 35HP " << endl;
player1Hp = player1Hp - 35;
}
else if (propertySpaceUpgradeAmount[player1Space] == 3)
{
cout << "Player 1 has lost 40HP " << endl;
player1Hp = player1Hp - 40;
}
else if (propertySpaceUpgradeAmount[player1Space] == 4)
{
cout << "Player 1 has lost 50HP " << endl;
player1Hp = player1Hp - 50;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
break;
case 2:
if (hpValues[player2Space] == 10 && propertySpaceOwnership[player2Space] == 2)
{
cout << "Player 2 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player2Space] == 1)
{
cout << "Player 2 has lost 10HP " << endl;
player2Hp = player2Hp - 10;
}
else if (propertySpaceUpgradeAmount[player2Space] == 2)
{
cout << "Player 2 has lost 15HP " << endl;
player2Hp = player2Hp - 15;
}
else if (propertySpaceUpgradeAmount[player2Space] == 3)
{
cout << "Player 2 has lost 20HP " << endl;
player2Hp = player2Hp - 20;
}
else if (propertySpaceUpgradeAmount[player2Space] == 4)
{
cout << "Player 2 has lost 30HP " << endl;
player2Hp = player2Hp - 30;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player2Space] == 15 && propertySpaceOwnership[player2Space] == 2)
{
cout << "Player 2 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player2Space] == 1)
{
cout << "Player 2 has lost 15HP " << endl;
player2Hp = player2Hp - 15;
}
else if (propertySpaceUpgradeAmount[player2Space] == 2)
{
cout << "Player 2 has lost 20HP " << endl;
player2Hp = player2Hp - 20;
}
else if (propertySpaceUpgradeAmount[player2Space] == 3)
{
cout << "Player 2 has lost 25HP " << endl;
player2Hp = player2Hp - 25;
}
else if (propertySpaceUpgradeAmount[player2Space] == 4)
{
cout << "Player 2 has lost 35HP " << endl;
player2Hp = player2Hp - 35;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player2Space] == 20 && propertySpaceOwnership[player2Space] == 2)
{
cout << "Player 2 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player2Space] == 1)
{
cout << "Player 2 has lost 20HP " << endl;
player2Hp = player2Hp - 20;
}
else if (propertySpaceUpgradeAmount[player2Space] == 2)
{
cout << "Player 2 has lost 25HP " << endl;
player2Hp = player2Hp - 25;
}
else if (propertySpaceUpgradeAmount[player2Space] == 3)
{
cout << "Player 2 has lost 30HP " << endl;
player2Hp = player2Hp - 30;
}
else if (propertySpaceUpgradeAmount[player2Space] == 4)
{
cout << "Player 2 has lost 40HP " << endl;
player2Hp = player2Hp - 40;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player2Space] == 25 && propertySpaceOwnership[player2Space] == 2)
{
cout << "Player 2 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player2Space] == 1)
{
cout << "Player 2 has lost 25HP " << endl;
player2Hp = player2Hp - 25;
}
else if (propertySpaceUpgradeAmount[player2Space] == 2)
{
cout << "Player 2 has lost 30HP " << endl;
player2Hp = player2Hp - 30;
}
else if (propertySpaceUpgradeAmount[player2Space] == 3)
{
cout << "Player 2 has lost 35HP " << endl;
player2Hp = player2Hp - 35;
}
else if (propertySpaceUpgradeAmount[player2Space] == 4)
{
cout << "Player 2 has lost 45HP " << endl;
player2Hp = player2Hp - 45;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player2Space] == 30 && propertySpaceOwnership[player2Space] == 2)
{
cout << "Player 2 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player2Space] == 1)
{
cout << "Player 2 has lost 30HP " << endl;
player2Hp = player2Hp - 30;
}
else if (propertySpaceUpgradeAmount[player2Space] == 2)
{
cout << "Player 2 has lost 35HP " << endl;
player2Hp = player2Hp - 35;
}
else if (propertySpaceUpgradeAmount[player2Space] == 3)
{
cout << "Player 2 has lost 40HP " << endl;
player2Hp = player2Hp - 40;
}
else if (propertySpaceUpgradeAmount[player2Space] == 4)
{
cout << "Player 2 has lost 50HP " << endl;
player2Hp = player2Hp - 50;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player2Space] == 10 && propertySpaceOwnership[player2Space] == 4)
{
cout << "Player 2 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player2Space] == 1)
{
cout << "Player 2 has lost 10HP " << endl;
player2Hp = player2Hp - 10;
}
else if (propertySpaceUpgradeAmount[player2Space] == 2)
{
cout << "Player 2 has lost 15HP " << endl;
player2Hp = player2Hp - 15;
}
else if (propertySpaceUpgradeAmount[player2Space] == 3)
{
cout << "Player 2 has lost 20HP " << endl;
player2Hp = player2Hp - 20;
}
else if (propertySpaceUpgradeAmount[player2Space] == 4)
{
cout << "Player 2 has lost 30HP " << endl;
player2Hp = player2Hp - 30;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player2Space] == 15 && propertySpaceOwnership[player2Space] == 4)
{
cout << "Player 2 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player2Space] == 1)
{
cout << "Player 2 has lost 15HP " << endl;
player2Hp = player2Hp - 15;
}
else if (propertySpaceUpgradeAmount[player2Space] == 2)
{
cout << "Player 2 has lost 20HP " << endl;
player2Hp = player2Hp - 20;
}
else if (propertySpaceUpgradeAmount[player2Space] == 3)
{
cout << "Player 2 has lost 25HP " << endl;
player2Hp = player2Hp - 25;
}
else if (propertySpaceUpgradeAmount[player2Space] == 4)
{
cout << "Player 2 has lost 35HP " << endl;
player2Hp = player2Hp - 35;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player2Space] == 20 && propertySpaceOwnership[player2Space] == 4)
{
cout << "Player 2 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player2Space] == 1)
{
cout << "Player 2 has lost 20HP " << endl;
player2Hp = player2Hp - 20;
}
else if (propertySpaceUpgradeAmount[player2Space] == 2)
{
cout << "Player 2 has lost 25HP " << endl;
player2Hp = player2Hp - 25;
}
else if (propertySpaceUpgradeAmount[player2Space] == 3)
{
cout << "Player 2 has lost 30HP " << endl;
player2Hp = player2Hp - 30;
}
else if (propertySpaceUpgradeAmount[player2Space] == 4)
{
cout << "Player 2 has lost 40HP " << endl;
player2Hp = player2Hp - 40;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player2Space] == 25 && propertySpaceOwnership[player2Space] == 4)
{
cout << "Player 2 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player2Space] == 1)
{
cout << "Player 2 has lost 25HP " << endl;
player2Hp = player2Hp - 25;
}
else if (propertySpaceUpgradeAmount[player2Space] == 2)
{
cout << "Player 2 has lost 30HP " << endl;
player2Hp = player2Hp - 30;
}
else if (propertySpaceUpgradeAmount[player2Space] == 3)
{
cout << "Player 2 has lost 35HP " << endl;
player2Hp = player2Hp - 35;
}
else if (propertySpaceUpgradeAmount[player2Space] == 4)
{
cout << "Player 2 has lost 45HP " << endl;
player2Hp = player2Hp - 45;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player2Space] == 30 && propertySpaceOwnership[player2Space] == 4)
{
cout << "Player 2 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player2Space] == 1)
{
cout << "Player 2 has lost 30HP " << endl;
player2Hp = player2Hp - 30;
}
else if (propertySpaceUpgradeAmount[player2Space] == 2)
{
cout << "Player 2 has lost 35HP " << endl;
player2Hp = player2Hp - 35;
}
else if (propertySpaceUpgradeAmount[player2Space] == 3)
{
cout << "Player 2 has lost 40HP " << endl;
player2Hp = player2Hp - 40;
}
else if (propertySpaceUpgradeAmount[player2Space] == 4)
{
cout << "Player 2 has lost 50HP " << endl;
player2Hp = player2Hp - 50;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player2Space] == 10 && propertySpaceOwnership[player2Space] == 5)
{
cout << "Player 2 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player2Space] == 1)
{
cout << "Player 2 has lost 10HP " << endl;
player2Hp = player2Hp - 10;
}
else if (propertySpaceUpgradeAmount[player2Space] == 2)
{
cout << "Player 2 has lost 15HP " << endl;
player2Hp = player2Hp - 15;
}
else if (propertySpaceUpgradeAmount[player2Space] == 3)
{
cout << "Player 2 has lost 20HP " << endl;
player2Hp = player2Hp - 20;
}
else if (propertySpaceUpgradeAmount[player2Space] == 4)
{
cout << "Player 2 has lost 30HP " << endl;
player2Hp = player2Hp - 30;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player2Space] == 15 && propertySpaceOwnership[player2Space] == 5)
{
cout << "Player 2 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player2Space] == 1)
{
cout << "Player 2 has lost 15HP " << endl;
player2Hp = player2Hp - 15;
}
else if (propertySpaceUpgradeAmount[player2Space] == 2)
{
cout << "Player 2 has lost 20HP " << endl;
player2Hp = player2Hp - 20;
}
else if (propertySpaceUpgradeAmount[player2Space] == 3)
{
cout << "Player 2 has lost 25HP " << endl;
player2Hp = player2Hp - 25;
}
else if (propertySpaceUpgradeAmount[player2Space] == 4)
{
cout << "Player 2 has lost 35HP " << endl;
player2Hp = player2Hp - 35;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player2Space] == 20 && propertySpaceOwnership[player2Space] == 5)
{
cout << "Player 2 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player2Space] == 1)
{
cout << "Player 2 has lost 20HP " << endl;
player2Hp = player2Hp - 20;
}
else if (propertySpaceUpgradeAmount[player2Space] == 2)
{
cout << "Player 2 has lost 25HP " << endl;
player2Hp = player2Hp - 25;
}
else if (propertySpaceUpgradeAmount[player2Space] == 3)
{
cout << "Player 2 has lost 30HP " << endl;
player2Hp = player2Hp - 30;
}
else if (propertySpaceUpgradeAmount[player2Space] == 4)
{
cout << "Player 2 has lost 40HP " << endl;
player2Hp = player2Hp - 40;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player2Space] == 25 && propertySpaceOwnership[player2Space] == 5)
{
cout << "Player 2 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player2Space] == 1)
{
cout << "Player 2 has lost 25HP " << endl;
player2Hp = player2Hp - 25;
}
else if (propertySpaceUpgradeAmount[player2Space] == 2)
{
cout << "Player 2 has lost 30HP " << endl;
player2Hp = player2Hp - 30;
}
else if (propertySpaceUpgradeAmount[player2Space] == 3)
{
cout << "Player 2 has lost 35HP " << endl;
player2Hp = player2Hp - 35;
}
else if (propertySpaceUpgradeAmount[player2Space] == 4)
{
cout << "Player 2 has lost 45HP " << endl;
player2Hp = player2Hp - 45;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player2Space] == 30 && propertySpaceOwnership[player2Space] == 5)
{
cout << "Player 2 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player2Space] == 1)
{
cout << "Player 2 has lost 30HP " << endl;
player2Hp = player2Hp - 30;
}
else if (propertySpaceUpgradeAmount[player2Space] == 2)
{
cout << "Player 2 has lost 35HP " << endl;
player2Hp = player2Hp - 35;
}
else if (propertySpaceUpgradeAmount[player2Space] == 3)
{
cout << "Player 2 has lost 40HP " << endl;
player2Hp = player2Hp - 40;
}
else if (propertySpaceUpgradeAmount[player2Space] == 4)
{
cout << "Player 2 has lost 50HP " << endl;
player2Hp = player2Hp - 50;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
break;
case 3:
if (hpValues[player3Space] == 10 && propertySpaceOwnership[player3Space] == 2)
{
cout << "Player 3 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player3Space] == 1)
{
cout << "Player 3 has lost 10HP " << endl;
player3Hp = player3Hp - 10;
}
else if (propertySpaceUpgradeAmount[player3Space] == 2)
{
cout << "Player 3 has lost 15HP " << endl;
player3Hp = player3Hp - 15;
}
else if (propertySpaceUpgradeAmount[player3Space] == 3)
{
cout << "Player 3 has lost 20HP " << endl;
player3Hp = player3Hp - 20;
}
else if (propertySpaceUpgradeAmount[player3Space] == 4)
{
cout << "Player 3 has lost 30HP " << endl;
player3Hp = player3Hp - 30;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player3Space] == 15 && propertySpaceOwnership[player3Space] == 2)
{
cout << "Player 3 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player3Space] == 1)
{
cout << "Player 3 has lost 15HP " << endl;
player3Hp = player3Hp - 15;
}
else if (propertySpaceUpgradeAmount[player3Space] == 2)
{
cout << "Player 3 has lost 20HP " << endl;
player3Hp = player3Hp - 20;
}
else if (propertySpaceUpgradeAmount[player3Space] == 3)
{
cout << "Player 3 has lost 25HP " << endl;
player3Hp = player3Hp - 25;
}
else if (propertySpaceUpgradeAmount[player3Space] == 4)
{
cout << "Player 3 has lost 35HP " << endl;
player3Hp = player3Hp - 35;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player3Space] == 20 && propertySpaceOwnership[player3Space] == 2)
{
cout << "Player 3 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player3Space] == 1)
{
cout << "Player 3 has lost 20HP " << endl;
player3Hp = player3Hp - 20;
}
else if (propertySpaceUpgradeAmount[player3Space] == 2)
{
cout << "Player 3 has lost 25HP " << endl;
player3Hp = player3Hp - 25;
}
else if (propertySpaceUpgradeAmount[player3Space] == 3)
{
cout << "Player 3 has lost 30HP " << endl;
player3Hp = player3Hp - 30;
}
else if (propertySpaceUpgradeAmount[player3Space] == 4)
{
cout << "Player 3 has lost 40HP " << endl;
player3Hp = player3Hp - 40;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player3Space] == 25 && propertySpaceOwnership[player3Space] == 2)
{
cout << "Player 3 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player3Space] == 1)
{
cout << "Player 3 has lost 25HP " << endl;
player3Hp = player3Hp - 25;
}
else if (propertySpaceUpgradeAmount[player3Space] == 2)
{
cout << "Player 3 has lost 30HP " << endl;
player3Hp = player3Hp - 30;
}
else if (propertySpaceUpgradeAmount[player3Space] == 3)
{
cout << "Player 3 has lost 35HP " << endl;
player3Hp = player3Hp - 35;
}
else if (propertySpaceUpgradeAmount[player3Space] == 4)
{
cout << "Player 3 has lost 45HP " << endl;
player3Hp = player3Hp - 45;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player3Space] == 30 && propertySpaceOwnership[player3Space] == 2)
{
cout << "Player 3 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player3Space] == 1)
{
cout << "Player 3 has lost 30HP " << endl;
player3Hp = player3Hp - 30;
}
else if (propertySpaceUpgradeAmount[player3Space] == 2)
{
cout << "Player 3 has lost 35HP " << endl;
player3Hp = player3Hp - 35;
}
else if (propertySpaceUpgradeAmount[player3Space] == 3)
{
cout << "Player 3 has lost 40HP " << endl;
player3Hp = player3Hp - 40;
}
else if (propertySpaceUpgradeAmount[player3Space] == 4)
{
cout << "Player 3 has lost 50HP " << endl;
player3Hp = player3Hp - 50;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player3Space] == 10 && propertySpaceOwnership[player3Space] == 3)
{
cout << "Player 3 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player3Space] == 1)
{
cout << "Player 3 has lost 10HP " << endl;
player3Hp = player3Hp - 10;
}
else if (propertySpaceUpgradeAmount[player3Space] == 2)
{
cout << "Player 3 has lost 15HP " << endl;
player3Hp = player3Hp - 15;
}
else if (propertySpaceUpgradeAmount[player3Space] == 3)
{
cout << "Player 3 has lost 20HP " << endl;
player3Hp = player3Hp - 20;
}
else if (propertySpaceUpgradeAmount[player3Space] == 4)
{
cout << "Player 3 has lost 30HP " << endl;
player3Hp = player3Hp - 30;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player3Space] == 15 && propertySpaceOwnership[player3Space] == 3)
{
cout << "Player 3 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player3Space] == 1)
{
cout << "Player 3 has lost 15HP " << endl;
player3Hp = player3Hp - 15;
}
else if (propertySpaceUpgradeAmount[player3Space] == 2)
{
cout << "Player 3 has lost 20HP " << endl;
player3Hp = player3Hp - 20;
}
else if (propertySpaceUpgradeAmount[player3Space] == 3)
{
cout << "Player 3 has lost 25HP " << endl;
player3Hp = player3Hp - 25;
}
else if (propertySpaceUpgradeAmount[player3Space] == 4)
{
cout << "Player 3 has lost 35HP " << endl;
player3Hp = player3Hp - 35;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player3Space] == 20 && propertySpaceOwnership[player3Space] == 3)
{
cout << "Player 3 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player3Space] == 1)
{
cout << "Player 3 has lost 20HP " << endl;
player3Hp = player3Hp - 20;
}
else if (propertySpaceUpgradeAmount[player3Space] == 2)
{
cout << "Player 3 has lost 25HP " << endl;
player3Hp = player3Hp - 25;
}
else if (propertySpaceUpgradeAmount[player3Space] == 3)
{
cout << "Player 3 has lost 30HP " << endl;
player3Hp = player3Hp - 30;
}
else if (propertySpaceUpgradeAmount[player3Space] == 4)
{
cout << "Player 3 has lost 40HP " << endl;
player3Hp = player3Hp - 40;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player3Space] == 25 && propertySpaceOwnership[player3Space] == 3)
{
cout << "Player 3 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player3Space] == 1)
{
cout << "Player 3 has lost 25HP " << endl;
player3Hp = player3Hp - 25;
}
else if (propertySpaceUpgradeAmount[player3Space] == 2)
{
cout << "Player 3 has lost 30HP " << endl;
player3Hp = player3Hp - 30;
}
else if (propertySpaceUpgradeAmount[player3Space] == 3)
{
cout << "Player 3 has lost 35HP " << endl;
player3Hp = player3Hp - 35;
}
else if (propertySpaceUpgradeAmount[player3Space] == 4)
{
cout << "Player 3 has lost 45HP " << endl;
player3Hp = player3Hp - 45;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player3Space] == 30 && propertySpaceOwnership[player3Space] == 3)
{
cout << "Player 3 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player3Space] == 1)
{
cout << "Player 3 has lost 30HP " << endl;
player3Hp = player3Hp - 30;
}
else if (propertySpaceUpgradeAmount[player3Space] == 2)
{
cout << "Player 3 has lost 35HP " << endl;
player3Hp = player3Hp - 35;
}
else if (propertySpaceUpgradeAmount[player3Space] == 3)
{
cout << "Player 3 has lost 40HP " << endl;
player3Hp = player3Hp - 40;
}
else if (propertySpaceUpgradeAmount[player3Space] == 4)
{
cout << "Player 3 has lost 50HP " << endl;
player3Hp = player3Hp - 50;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player3Space] == 10 && propertySpaceOwnership[player3Space] == 5)
{
cout << "Player 3 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player3Space] == 1)
{
cout << "Player 3 has lost 10HP " << endl;
player3Hp = player3Hp - 10;
}
else if (propertySpaceUpgradeAmount[player3Space] == 2)
{
cout << "Player 3 has lost 15HP " << endl;
player3Hp = player3Hp - 15;
}
else if (propertySpaceUpgradeAmount[player3Space] == 3)
{
cout << "Player 3 has lost 20HP " << endl;
player3Hp = player3Hp - 20;
}
else if (propertySpaceUpgradeAmount[player3Space] == 4)
{
cout << "Player 3 has lost 30HP " << endl;
player3Hp = player3Hp - 30;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player3Space] == 15 && propertySpaceOwnership[player3Space] == 5)
{
cout << "Player 3 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player3Space] == 1)
{
cout << "Player 3 has lost 15HP " << endl;
player3Hp = player3Hp - 15;
}
else if (propertySpaceUpgradeAmount[player3Space] == 2)
{
cout << "Player 3 has lost 20HP " << endl;
player3Hp = player3Hp - 20;
}
else if (propertySpaceUpgradeAmount[player3Space] == 3)
{
cout << "Player 3 has lost 25HP " << endl;
player3Hp = player3Hp - 25;
}
else if (propertySpaceUpgradeAmount[player3Space] == 4)
{
cout << "Player 3 has lost 35HP " << endl;
player3Hp = player3Hp - 35;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player3Space] == 20 && propertySpaceOwnership[player3Space] == 5)
{
cout << "Player 3 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player3Space] == 1)
{
cout << "Player 3 has lost 20HP " << endl;
player3Hp = player3Hp - 20;
}
else if (propertySpaceUpgradeAmount[player3Space] == 2)
{
cout << "Player 3 has lost 25HP " << endl;
player3Hp = player3Hp - 25;
}
else if (propertySpaceUpgradeAmount[player3Space] == 3)
{
cout << "Player 3 has lost 30HP " << endl;
player3Hp = player3Hp - 30;
}
else if (propertySpaceUpgradeAmount[player3Space] == 4)
{
cout << "Player 3 has lost 40HP " << endl;
player3Hp = player3Hp - 40;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player3Space] == 25 && propertySpaceOwnership[player3Space] == 5)
{
cout << "Player 3 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player3Space] == 1)
{
cout << "Player 3 has lost 25HP " << endl;
player3Hp = player3Hp - 25;
}
else if (propertySpaceUpgradeAmount[player3Space] == 2)
{
cout << "Player 3 has lost 30HP " << endl;
player3Hp = player3Hp - 30;
}
else if (propertySpaceUpgradeAmount[player3Space] == 3)
{
cout << "Player 3 has lost 35HP " << endl;
player3Hp = player3Hp - 35;
}
else if (propertySpaceUpgradeAmount[player3Space] == 4)
{
cout << "Player 3 has lost 45HP " << endl;
player3Hp = player3Hp - 45;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player3Space] == 30 && propertySpaceOwnership[player3Space] == 5)
{
cout << "Player 3 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player3Space] == 1)
{
cout << "Player 3 has lost 30HP " << endl;
player3Hp = player3Hp - 30;
}
else if (propertySpaceUpgradeAmount[player3Space] == 2)
{
cout << "Player 3 has lost 35HP " << endl;
player3Hp = player3Hp - 35;
}
else if (propertySpaceUpgradeAmount[player3Space] == 3)
{
cout << "Player 3 has lost 40HP " << endl;
player3Hp = player3Hp - 40;
}
else if (propertySpaceUpgradeAmount[player3Space] == 4)
{
cout << "Player 3 has lost 50HP " << endl;
player3Hp = player3Hp - 50;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
break;
case 4:
if (hpValues[player4Space] == 10 && propertySpaceOwnership[player4Space] == 2)
{
cout << "Player 4 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player4Space] == 1)
{
cout << "Player 4 has lost 10HP " << endl;
player4Hp = player4Hp - 10;
}
else if (propertySpaceUpgradeAmount[player4Space] == 2)
{
cout << "Player 4 has lost 15HP " << endl;
player4Hp = player4Hp - 15;
}
else if (propertySpaceUpgradeAmount[player4Space] == 3)
{
cout << "Player 4 has lost 20HP " << endl;
player4Hp = player4Hp - 20;
}
else if (propertySpaceUpgradeAmount[player4Space] == 4)
{
cout << "Player 4 has lost 30HP " << endl;
player4Hp = player4Hp - 30;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player4Space] == 15 && propertySpaceOwnership[player4Space] == 2)
{
cout << "Player 4 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player4Space] == 1)
{
cout << "Player 4 has lost 15HP " << endl;
player4Hp = player4Hp - 15;
}
else if (propertySpaceUpgradeAmount[player4Space] == 2)
{
cout << "Player 4 has lost 20HP " << endl;
player4Hp = player4Hp - 20;
}
else if (propertySpaceUpgradeAmount[player4Space] == 3)
{
cout << "Player 4 has lost 25HP " << endl;
player4Hp = player4Hp - 25;
}
else if (propertySpaceUpgradeAmount[player4Space] == 4)
{
cout << "Player 4 has lost 35HP " << endl;
player4Hp = player4Hp - 35;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player4Space] == 20 && propertySpaceOwnership[player4Space] == 2)
{
cout << "Player 4 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player4Space] == 1)
{
cout << "Player 4 has lost 20HP " << endl;
player4Hp = player4Hp - 20;
}
else if (propertySpaceUpgradeAmount[player4Space] == 2)
{
cout << "Player 4 has lost 25HP " << endl;
player4Hp = player4Hp - 25;
}
else if (propertySpaceUpgradeAmount[player4Space] == 3)
{
cout << "Player 4 has lost 30HP " << endl;
player4Hp = player4Hp - 30;
}
else if (propertySpaceUpgradeAmount[player4Space] == 4)
{
cout << "Player 4 has lost 40HP " << endl;
player4Hp = player4Hp - 40;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player4Space] == 25 && propertySpaceOwnership[player4Space] == 2)
{
cout << "Player 4 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player4Space] == 1)
{
cout << "Player 4 has lost 25HP " << endl;
player4Hp = player4Hp - 25;
}
else if (propertySpaceUpgradeAmount[player4Space] == 2)
{
cout << "Player 4 has lost 30HP " << endl;
player4Hp = player4Hp - 30;
}
else if (propertySpaceUpgradeAmount[player4Space] == 3)
{
cout << "Player 4 has lost 35HP " << endl;
player4Hp = player4Hp - 35;
}
else if (propertySpaceUpgradeAmount[player4Space] == 4)
{
cout << "Player 4 has lost 45HP " << endl;
player4Hp = player4Hp - 45;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player4Space] == 30 && propertySpaceOwnership[player4Space] == 2)
{
cout << "Player 4 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player4Space] == 1)
{
cout << "Player 4 has lost 30HP " << endl;
player4Hp = player4Hp - 30;
}
else if (propertySpaceUpgradeAmount[player4Space] == 2)
{
cout << "Player 4 has lost 35HP " << endl;
player4Hp = player4Hp - 35;
}
else if (propertySpaceUpgradeAmount[player4Space] == 3)
{
cout << "Player 4 has lost 40HP " << endl;
player4Hp = player4Hp - 40;
}
else if (propertySpaceUpgradeAmount[player4Space] == 4)
{
cout << "Player 4 has lost 50HP " << endl;
player4Hp = player4Hp - 50;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player4Space] == 10 && propertySpaceOwnership[player4Space] == 3)
{
cout << "Player 4 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player4Space] == 1)
{
cout << "Player 4 has lost 10HP " << endl;
player4Hp = player4Hp - 10;
}
else if (propertySpaceUpgradeAmount[player4Space] == 2)
{
cout << "Player 4 has lost 15HP " << endl;
player4Hp = player4Hp - 15;
}
else if (propertySpaceUpgradeAmount[player4Space] == 3)
{
cout << "Player 4 has lost 20HP " << endl;
player4Hp = player4Hp - 20;
}
else if (propertySpaceUpgradeAmount[player4Space] == 4)
{
cout << "Player 4 has lost 30HP " << endl;
player4Hp = player4Hp - 30;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player4Space] == 15 && propertySpaceOwnership[player4Space] == 3)
{
cout << "Player 4 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player4Space] == 1)
{
cout << "Player 4 has lost 15HP " << endl;
player4Hp = player4Hp - 15;
}
else if (propertySpaceUpgradeAmount[player4Space] == 2)
{
cout << "Player 4 has lost 20HP " << endl;
player4Hp = player4Hp - 20;
}
else if (propertySpaceUpgradeAmount[player4Space] == 3)
{
cout << "Player 4 has lost 25HP " << endl;
player4Hp = player4Hp - 25;
}
else if (propertySpaceUpgradeAmount[player4Space] == 4)
{
cout << "Player 4 has lost 35HP " << endl;
player4Hp = player4Hp - 35;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player4Space] == 20 && propertySpaceOwnership[player4Space] == 3)
{
cout << "Player 4 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player4Space] == 1)
{
cout << "Player 4 has lost 20HP " << endl;
player4Hp = player4Hp - 20;
}
else if (propertySpaceUpgradeAmount[player4Space] == 2)
{
cout << "Player 4 has lost 25HP " << endl;
player4Hp = player4Hp - 25;
}
else if (propertySpaceUpgradeAmount[player4Space] == 3)
{
cout << "Player 4 has lost 30HP " << endl;
player4Hp = player4Hp - 30;
}
else if (propertySpaceUpgradeAmount[player4Space] == 4)
{
cout << "Player 4 has lost 40HP " << endl;
player4Hp = player4Hp - 40;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player4Space] == 25 && propertySpaceOwnership[player4Space] == 3)
{
cout << "Player 4 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player4Space] == 1)
{
cout << "Player 4 has lost 25HP " << endl;
player4Hp = player4Hp - 25;
}
else if (propertySpaceUpgradeAmount[player4Space] == 2)
{
cout << "Player 4 has lost 30HP " << endl;
player4Hp = player4Hp - 30;
}
else if (propertySpaceUpgradeAmount[player4Space] == 3)
{
cout << "Player 4 has lost 35HP " << endl;
player4Hp = player4Hp - 35;
}
else if (propertySpaceUpgradeAmount[player4Space] == 4)
{
cout << "Player 4 has lost 45HP " << endl;
player4Hp = player4Hp - 45;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player4Space] == 30 && propertySpaceOwnership[player4Space] == 3)
{
cout << "Player 4 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player4Space] == 1)
{
cout << "Player 4 has lost 30HP " << endl;
player4Hp = player4Hp - 30;
}
else if (propertySpaceUpgradeAmount[player4Space] == 2)
{
cout << "Player 4 has lost 35HP " << endl;
player4Hp = player4Hp - 35;
}
else if (propertySpaceUpgradeAmount[player4Space] == 3)
{
cout << "Player 4 has lost 40HP " << endl;
player4Hp = player4Hp - 40;
}
else if (propertySpaceUpgradeAmount[player4Space] == 4)
{
cout << "Player 4 has lost 50HP " << endl;
player4Hp = player4Hp - 50;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player4Space] == 10 && propertySpaceOwnership[player4Space] == 4)
{
cout << "Player 4 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player4Space] == 1)
{
cout << "Player 4 has lost 10HP " << endl;
player4Hp = player4Hp - 10;
}
else if (propertySpaceUpgradeAmount[player4Space] == 2)
{
cout << "Player 4 has lost 15HP " << endl;
player4Hp = player4Hp - 15;
}
else if (propertySpaceUpgradeAmount[player4Space] == 3)
{
cout << "Player 4 has lost 20HP " << endl;
player4Hp = player4Hp - 20;
}
else if (propertySpaceUpgradeAmount[player4Space] == 4)
{
cout << "Player 4 has lost 30HP " << endl;
player4Hp = player4Hp - 30;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player4Space] == 15 && propertySpaceOwnership[player4Space] == 4)
{
cout << "Player 4 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player4Space] == 1)
{
cout << "Player 4 has lost 15HP " << endl;
player4Hp = player4Hp - 15;
}
else if (propertySpaceUpgradeAmount[player4Space] == 2)
{
cout << "Player 4 has lost 20HP " << endl;
player4Hp = player4Hp - 20;
}
else if (propertySpaceUpgradeAmount[player4Space] == 3)
{
cout << "Player 4 has lost 25HP " << endl;
player4Hp = player4Hp - 25;
}
else if (propertySpaceUpgradeAmount[player4Space] == 4)
{
cout << "Player 4 has lost 35HP " << endl;
player4Hp = player4Hp - 35;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player4Space] == 20 && propertySpaceOwnership[player4Space] == 4)
{
cout << "Player 4 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player4Space] == 1)
{
cout << "Player 4 has lost 20HP " << endl;
player4Hp = player4Hp - 20;
}
else if (propertySpaceUpgradeAmount[player4Space] == 2)
{
cout << "Player 4 has lost 25HP " << endl;
player4Hp = player4Hp - 25;
}
else if (propertySpaceUpgradeAmount[player4Space] == 3)
{
cout << "Player 4 has lost 30HP " << endl;
player4Hp = player4Hp - 30;
}
else if (propertySpaceUpgradeAmount[player4Space] == 4)
{
cout << "Player 4 has lost 40HP " << endl;
player4Hp = player4Hp - 40;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player4Space] == 25 && propertySpaceOwnership[player4Space] == 4)
{
cout << "Player 4 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player4Space] == 1)
{
cout << "Player 4 has lost 25HP " << endl;
player4Hp = player4Hp - 25;
}
else if (propertySpaceUpgradeAmount[player4Space] == 2)
{
cout << "Player 4 has lost 30HP " << endl;
player4Hp = player4Hp - 30;
}
else if (propertySpaceUpgradeAmount[player4Space] == 3)
{
cout << "Player 4 has lost 35HP " << endl;
player4Hp = player4Hp - 35;
}
else if (propertySpaceUpgradeAmount[player4Space] == 4)
{
cout << "Player 4 has lost 45HP " << endl;
player4Hp = player4Hp - 45;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else if (hpValues[player4Space] == 30 && propertySpaceOwnership[player4Space] == 4)
{
cout << "Player 4 has landed on an owned property! " << endl;
if (propertySpaceUpgradeAmount[player4Space] == 1)
{
cout << "Player 4 has lost 30HP " << endl;
player4Hp = player4Hp - 30;
}
else if (propertySpaceUpgradeAmount[player4Space] == 2)
{
cout << "Player 4 has lost 35HP " << endl;
player4Hp = player4Hp - 35;
}
else if (propertySpaceUpgradeAmount[player4Space] == 3)
{
cout << "Player 4 has lost 40HP " << endl;
player4Hp = player4Hp - 40;
}
else if (propertySpaceUpgradeAmount[player4Space] == 4)
{
cout << "Player 4 has lost 50HP " << endl;
player4Hp = player4Hp - 50;
}
else
{
cout << "Problem in rivalpropertyLanding function " << endl;
}
}
else
{
cout << "Did not land on rival property space " << endl;
}
break;
default:
break;
}
}
|
06415dda2902aa7db978b93d2bed63ff1f026a3a | 9320d0e01bba4ea3b70b374a26d59703126cf449 | /MayaExporter/CPMMeshExtractor.cpp | 3627ce4d1cd179638725901964b43ce74f03d6fb | [] | no_license | sonmarcho/MayaExporter | 76b1acf35b5aa5b59a410150618aaf5c0a0f9291 | ae4288b0b9dcb418be9d1499a22a60f32a9f4c5e | refs/heads/main | 2023-02-19T14:51:41.076566 | 2021-01-12T22:22:49 | 2021-01-12T22:22:49 | null | 0 | 0 | null | null | null | null | ISO-8859-1 | C++ | false | false | 19,021 | cpp | CPMMeshExtractor.cpp | #include <maya/MGlobal.h>
#include <maya/MPlug.h>
#include <maya/MPlugArray.h>
#include <maya/MFloatArray.h>
#include <maya/MFnSet.h>
#include <maya/MItMeshPolygon.h>
#include <maya/MItDependencyGraph.h>
#include <maya/MFnLambertShader.h>
#include <maya/MFnPhongShader.h>
#include <maya/MFnBlinnShader.h>
#include "CPMMeshExtractor.h"
CPMMeshExtractor::CPMMeshExtractor(const MDagPath &dagPath, bool objectSpace, MStatus &status) : m_dagPath(dagPath), m_mesh(dagPath, &status)
{
m_space = MSpace::kWorld;
if(objectSpace) m_space = MSpace::kObject;
}
CPMMeshExtractor::~CPMMeshExtractor()
{
}
MStatus CPMMeshExtractor::extractMesh(MESH_EXTRACTOR_INFO &mesh)
{
MStatus status;
unsigned int numVertices = 0;
if(!extractGeometry(mesh, numVertices)) {
MGlobal::displayError("CPMMeshExtractor::extractGeometry");
return MS::kFailure;
}
if(!extractMaterials(mesh)) {
MGlobal::displayError("CPMMeshExtractor::extractMaterials");
return MS::kFailure;
}
if(!assembleMesh(mesh, numVertices)) {
MGlobal::displayError("CPMMeshExtractor::assembleMesh");
return MS::kFailure;
}
return MS::kSuccess;
}
MStatus CPMMeshExtractor::extractGeometry(MESH_EXTRACTOR_INFO &mesh, unsigned int &numVertices)
{
MStatus status;
if(mesh.UVs != NULL && mesh.uvSetName == "") {
MDagPath nDagPath(m_dagPath);
nDagPath.extendToShape();
unsigned int instanceNum = 0;
if(nDagPath.isInstanced()) instanceNum = nDagPath.instanceNumber();
status = m_mesh.getCurrentUVSetName(mesh.uvSetName, instanceNum);
if(status == MS::kFailure)
{
MGlobal::displayError("MFnMesh::getCurrentUVSetName");
return MS::kFailure;
}
}
if(mesh.colors != NULL && mesh.colorSetName == "") {
status = m_mesh.getCurrentColorSetName(mesh.colorSetName, kMFnMeshInstanceUnspecified );
if(status == MS::kFailure)
{
MGlobal::displayError("MFnMesh::getCurrentColorSetName");
return MS::kFailure;
}
if(mesh.colorSetName == "")
{
MGlobal::displayError("Le mesh " + m_dagPath.fullPathName() + " n'a pas de set de couleurs");
return MS::kFailure;
}
}
//
// Composition de la liste de vertices désassemblés
//
// Nombre de points (chaque point dans l'espace peut être associé à plusieurs normales et coordonnées uv, donnant lieu à plusieurs vertices)
m_dVertices.resize(m_mesh.numVertices());
// Nombre actuel de vertices comptés, dont la valeur finale donnera le nombre de vertices du mesh à exporter
unsigned int actualNumVertices = 0;
// On récupère les triangles et on redimensionne le vector triangles (sortie)
MIntArray triangleCounts, triangleVertices;
if(m_mesh.getTriangles(triangleCounts, triangleVertices) == MS::kFailure)
{
MGlobal::displayError("MFnMesh::getTriangles");
return MS::kFailure;
}
///////////////////////////////////////////
mesh.triangles.setLength(triangleVertices.length());
///////////////////////////////////////////
// Nombre de polygones
const unsigned int numPolygons = m_mesh.numPolygons();
unsigned int numTris = 0;
// Pour chaque polygone, on récupère les indices de vertices, de normales et de coordonnées UV et on les enregistre dans m_dVertices
// en vue d'assembler les vertices du mesh à exporter
MIntArray vertexList, normalList, uvList, tgtBinormalList, colorList; // indices de vertice, normale, coordonnées UV, et couleur du polygone actuel
MIntArray nFaceVertexList; // indices des vertices finaux du polygone actuel
unsigned int actualTriangleVertId = 0; // début des indices de vertices du polygone actuel dans le tableau triangleVertices
for(unsigned int i = 0; i < numPolygons; i++)
{
// On récupère les indices de vertices, de normales, de coordonnées uv, de tangente et de couleur
if(!m_mesh.getPolygonVertices(i, vertexList)) {
MGlobal::displayError("MFnMesh::getPolygonVertices");
return MS::kFailure;
}
if(!m_mesh.getFaceNormalIds(i, normalList)) {
MGlobal::displayError("MFnMesh::getFaceNormalIds");
return MS::kFailure;
}
if(mesh.UVs) {
uvList.setLength(vertexList.length());
for(unsigned int j = 0; j < uvList.length(); j++) {
if(!m_mesh.getPolygonUVid(i, j, uvList[j], &mesh.uvSetName)) {
MGlobal::displayError("MFnMesh::getPolygonUVid");
return MS::kFailure;
}
}
}
if(mesh.tgtBinormals) {
tgtBinormalList.setLength(vertexList.length());
for(unsigned int j = 0; j < tgtBinormalList.length(); j++) {
tgtBinormalList[j] = m_mesh.getTangentId(i, vertexList[j], &status);
if(!status) {
MGlobal::displayError("MFnMesh::getTangentId");
return MS::kFailure;
}
}
}
if(mesh.colors) {
colorList.setLength(vertexList.length());
for(unsigned int j = 0; j < colorList.length(); j++) {
if(!m_mesh.getColorIndex(i, j, colorList[j], &mesh.colorSetName)) {
MGlobal::displayError("MFnMesh::getPolygonUVid");
return MS::kFailure;
}
}
}
// On récupère le nouvel indice de vertice (assemblé plus tard)
nFaceVertexList.setLength(vertexList.length());
for(unsigned int j = 0; j < nFaceVertexList.length(); j++)
{
ADD_POINT_INFO nPoint(vertexList[j]);
if(mesh.normals) nPoint.normalId = &normalList[j];
if(mesh.tgtBinormals) nPoint.tgtBinormalId = &tgtBinormalList[j];
if(mesh.UVs) nPoint.uvId = &uvList[j];
if(mesh.colors) nPoint.colorId = &colorList[j];
nFaceVertexList[j] = addPoint(nPoint, actualNumVertices);
}
// On entre les valeurs d'indices dans le vector triangles en faisant le lien entre la description de la face (vertexList) et la
// description des triangles composant la face (triangleVertices)
for(unsigned int j = actualTriangleVertId; j < actualTriangleVertId + triangleCounts[i]*3; j++)
{
for(unsigned int k = 0; k < vertexList.length(); k++)
{
if(triangleVertices[j] == vertexList[k])
{
mesh.triangles[j] = nFaceVertexList[k];
break;
}
}
}
actualTriangleVertId += triangleCounts[i]*3;
}
numVertices = actualNumVertices;
return MS::kSuccess;
}
MStatus CPMMeshExtractor::extractMaterials(MESH_EXTRACTOR_INFO &mesh)
{
MStatus status;
if(!mesh.materials) return MS::kSuccess;
//
// On récupère les faces du mesh
//
MIntArray triangleCounts, triangleVertices;
if(!m_mesh.getTriangles(triangleCounts, triangleVertices)) {
MGlobal::displayError("MFnMesh::getTriangles");
return MS::kFailure;
}
MIntArray triIndices;
triIndices.setLength(triangleCounts.length() + 1);
triIndices[0] = 0;
for(unsigned int i = 0; i < triangleCounts.length(); i++)
{
triIndices[i + 1] = triIndices[0] + triangleCounts[i];
}
//
// Polygon sets
//
unsigned int instanceNum = 0;
MDagPath nDagPath(m_dagPath);
nDagPath.extendToShape();
if(nDagPath.isInstanced()) instanceNum = nDagPath.instanceNumber();
if(m_mesh.getConnectedSetsAndMembers(instanceNum, m_polygonSets, m_polygonComponents, true) == MS::kFailure)
{
MGlobal::displayError("MFnMesh::getconnectedSetsAndMembers");
return MS::kFailure;
}
//
// Material sets
//
// Textures
unsigned int setCount = m_polygonSets.length();
if(setCount > 1) // le dernier set représente le mesh entier lorsqu'il y a plusieurs sets
{
setCount--;
}
for(unsigned int i = 0; i < setCount; i++)
{
MATERIAL_INFO material; // est créé en début de boucle pour être réinitialisé à chaque fois
MObject set = m_polygonSets[i];
MObject comp = m_polygonComponents[i];
MFnSet fnSet(set, &status);
if(!status)
{
MGlobal::displayError("MFnSet::MFnSet");
continue;
}
// On récupère les faces composant le set
MItMeshPolygon itMeshPolygon(m_dagPath, comp, &status);
if(!status) // le set n'est pas un set de polygones
{
MGlobal::displayError("MItMeshPolygon::MItMeshPolygon");
continue;
}
std::vector<unsigned int> faceIds;
unsigned int numTris = 0;
unsigned int j = 0;
faceIds.resize(itMeshPolygon.count());
for(itMeshPolygon.reset(); !itMeshPolygon.isDone(); itMeshPolygon.next())
{
faceIds[j] = itMeshPolygon.index();
numTris += triangleCounts[ faceIds[j] ];
j++;
}
unsigned int triId = 0;
material.faceIds.resize(numTris);
for(unsigned int k = 0; k < itMeshPolygon.count(); k++)
{
for(unsigned l = 0; l < (unsigned int) triangleCounts[ faceIds[k] ]; l++)
{
material.faceIds[triId + l] = triIndices[ faceIds[k] ] + l;
}
triId += triangleCounts[ faceIds[k] ];
}
// On récupère le shader
MObject shaderNode = findShader(set);
if(shaderNode == MObject::kNullObj)
{
continue;
}
MFnDependencyNode shaderFnDNode(shaderNode, &status);
if(!status)
{
MGlobal::displayError("MFnDependencyNode::MFnDependencyNode");
continue;
}
// On récupère les informations du shader
MPlugArray plugArray;
MPlug colorPlug, transparencyPlug, ambientColorPlug, bumpPlug;
// Color
colorPlug = shaderFnDNode.findPlug("color", &status);
if(!status) {
MGlobal::displayError("MFnDependencyNode::findPlug : colorPlug");
continue;
}
else
{
MItDependencyGraph itDg(colorPlug, MFn::kFileTexture, MItDependencyGraph::kUpstream, MItDependencyGraph::kBreadthFirst, MItDependencyGraph::kNodeLevel, &status);
if(!status) {
MGlobal::displayError("MItDependencyGraph::MItDependencyGraph");
continue;
}
itDg.disablePruningOnFilter();
if(!itDg.isDone())
{
MObject textureNode = itDg.thisNode();
MPlug fileNamePlug = MFnDependencyNode(textureNode).findPlug("fileTextureName");
fileNamePlug.getValue(material.colorTexName);
}
}
// Transparency
transparencyPlug = shaderFnDNode.findPlug("transparency", &status);
if(!status) {
MGlobal::displayError("MFnDependencyNode::findPlug : transparencyPlug");
continue;
}
else
{
MItDependencyGraph itDg(transparencyPlug, MFn::kFileTexture, MItDependencyGraph::kUpstream, MItDependencyGraph::kBreadthFirst, MItDependencyGraph::kNodeLevel, &status);
if(!status) {
MGlobal::displayError("MItDependencyGraph::MItDependencyGraph");
continue;
}
itDg.disablePruningOnFilter();
if(!itDg.isDone())
{
MObject textureNode = itDg.thisNode();
MPlug fileNamePlug = MFnDependencyNode(textureNode).findPlug("fileTextureName");
fileNamePlug.getValue(material.transparencyTexName);
}
}
// Ambient
ambientColorPlug = shaderFnDNode.findPlug("ambientColor", &status);
if(!status) {
MGlobal::displayError("MFnDependencyNode::findPlug : ambientPlug");
continue;
}
else
{
MItDependencyGraph itDg(ambientColorPlug, MFn::kFileTexture, MItDependencyGraph::kUpstream, MItDependencyGraph::kBreadthFirst, MItDependencyGraph::kNodeLevel, &status);
if(!status) {
MGlobal::displayError("MItDependencyGraph::MItDependencyGraph");
continue;
}
itDg.disablePruningOnFilter();
if(!itDg.isDone())
{
MObject textureNode = itDg.thisNode();
MPlug fileNamePlug = MFnDependencyNode(textureNode).findPlug("fileTextureName");
fileNamePlug.getValue(material.ambientTexName);
}
}
// Bump / normal map
bumpPlug = shaderFnDNode.findPlug("normalCamera", &status);
if(!status) {
MGlobal::displayError("MFnDependencyNode::findPlug : bumpPlug");
continue;
}
else
{
MItDependencyGraph itDg(bumpPlug, MFn::kFileTexture, MItDependencyGraph::kUpstream, MItDependencyGraph::kBreadthFirst, MItDependencyGraph::kNodeLevel, &status);
if(!status) {
MGlobal::displayError("MItDependencyGraph::MItDependencyGraph");
continue;
}
itDg.disablePruningOnFilter();
if(!itDg.isDone())
{
MObject textureNode = itDg.thisNode();
MPlug fileNamePlug = MFnDependencyNode(textureNode).findPlug("fileTextureName");
MString bumpFile;
fileNamePlug.getValue(material.normalTexName);
}
}
//
// Matériau
//
MFnLambertShader lambertShader(shaderNode, &status);
if(status)
{
if(material.colorTexName == "") material.color = lambertShader.color()*lambertShader.diffuseCoeff();
if(material.transparencyTexName == "") material.transparency = lambertShader.transparency();
if(material.ambientTexName == "") material.ambient = lambertShader.ambientColor();
MFnPhongShader phongShader(shaderNode, &status);
if(status)
{
MPlug specularColorPlug, specularPowPlug;
// Specular color
specularColorPlug = shaderFnDNode.findPlug("specularColor", &status);
if(!status) {
MGlobal::displayError("MFnDependencyNode::findPlug : specularColorPlug");
continue;
}
else
{
MItDependencyGraph itDg(specularColorPlug, MFn::kFileTexture, MItDependencyGraph::kUpstream, MItDependencyGraph::kBreadthFirst, MItDependencyGraph::kNodeLevel, &status);
if(!status) {
MGlobal::displayError("MItDependencyGraph::MItDependencyGraph");
continue;
}
itDg.disablePruningOnFilter();
if(!itDg.isDone())
{
MObject textureNode = itDg.thisNode();
MPlug fileNamePlug = MFnDependencyNode(textureNode).findPlug("fileTextureName");
fileNamePlug.getValue(material.specularColorTexName);
}
}
// Specular power
specularPowPlug = shaderFnDNode.findPlug("cosinePower", &status);
if(!status) {
MGlobal::displayError("MFnDependencyNode::findPlug : specularColorPlug");
continue;
}
else
{
MItDependencyGraph itDg(specularPowPlug, MFn::kFileTexture, MItDependencyGraph::kUpstream, MItDependencyGraph::kBreadthFirst, MItDependencyGraph::kNodeLevel, &status);
if(!status) {
MGlobal::displayError("MItDependencyGraph::MItDependencyGraph");
continue;
}
itDg.disablePruningOnFilter();
if(!itDg.isDone())
{
MObject textureNode = itDg.thisNode();
MPlug fileNamePlug = MFnDependencyNode(textureNode).findPlug("fileTextureName");
fileNamePlug.getValue(material.specularPowerTexName);
}
}
if(material.specularColorTexName == "") material.specularColor = phongShader.specularColor();
if(material.specularPowerTexName == "") material.specularPower = phongShader.cosPower();
}
else
{
MFnBlinnShader blinnShader(shaderNode, &status);
if(status)
{
// on ne fait rien pour le moment: il faut une méthode pour récupérer et exporter les informations de spécularité
}
}
}
mesh.materials->push_back(material);
}
return MS::kSuccess;
}
MStatus CPMMeshExtractor::assembleMesh(MESH_EXTRACTOR_INFO &mesh, const unsigned int &numVertices)
{
if(numVertices == 0) {
MGlobal::displayError("CPMMeshExtractor : le mesh n'a aucun vertice");
return MS::kFailure;
}
MPointArray vertexArray;
MFloatVectorArray normalsArray;
MFloatArray uArray;
MFloatArray vArray;
MFloatVectorArray tangentsArray;
MFloatVectorArray binormalsArray;
MColorArray colorsArray;
if(m_mesh.getPoints(vertexArray, MSpace::kObject) == MS::kFailure) {
MGlobal::displayError("MFnMesh::getPoints");
return MS::kFailure;
}
if(mesh.normals) {
if(m_mesh.getNormals(normalsArray, MSpace::kObject) == MS::kFailure) {
MGlobal::displayError("MFnMesh::getNormals");
return MS::kFailure;
}
}
if(mesh.UVs) {
if(m_mesh.getUVs(uArray, vArray, &mesh.uvSetName) == MS::kFailure) {
MGlobal::displayError("MFnMesh::getUVs");
return MS::kFailure;
}
}
if(mesh.tgtBinormals) {
if(m_mesh.getTangents(tangentsArray, MSpace::kObject, &mesh.uvSetName) == MS::kFailure) {
MGlobal::displayError("MFnMesh::getTangents");
return MS::kFailure;
}
if(m_mesh.getBinormals(binormalsArray, MSpace::kObject, &mesh.uvSetName) == MS::kFailure) {
MGlobal::displayError("MFnMesh::getBinormals");
return MS::kFailure;
}
}
if(mesh.colors) {
if(m_mesh.getColors(colorsArray, &mesh.colorSetName, NULL) == MS::kFailure) {
MGlobal::displayError("MFnMesh::getColors");
return MS::kFailure;
}
}
// On redimensionne les vectors contenant les informations de position, normale...
mesh.points.setLength(numVertices);
if(mesh.normals) mesh.normals->setLength(numVertices);
if(mesh.UVs) mesh.UVs->resize(numVertices);
if(mesh.tgtBinormals) mesh.tgtBinormals->resize(numVertices);
if(mesh.colors) mesh.colors->setLength(numVertices);
for(unsigned int i = 0; i < m_dVertices.size(); i++)
{
for(std::list<DVerticeComponent>::iterator it = m_dVertices[i].begin(); it != m_dVertices[i].end(); it++)
{
mesh.points[it->fVertexId] = vertexArray[i];
if(mesh.normals) (*mesh.normals)[it->fVertexId] = normalsArray[it->normalId];
if(mesh.UVs) {
(*mesh.UVs)[it->fVertexId].u = uArray[it->uvId];
(*mesh.UVs)[it->fVertexId].v = uArray[it->uvId];
}
if(mesh.tgtBinormals) {
(*mesh.tgtBinormals)[it->fVertexId].tangent = tangentsArray[it->tgtBinormalId];
(*mesh.tgtBinormals)[it->fVertexId].binormal = binormalsArray[it->tgtBinormalId];
}
if(mesh.colors) (*mesh.colors)[it->fVertexId] = colorsArray[it->colorId];
}
}
return MS::kSuccess;
}
unsigned int CPMMeshExtractor::addPoint(const ADD_POINT_INFO &point, unsigned int &actualNumVertices)
{
for(std::list<DVerticeComponent>::iterator it = m_dVertices[point.pointId].begin(); it != m_dVertices[point.pointId].end(); it++)
{
if(point.normalId) { if(it->normalId != *point.normalId) continue; }
if(point.uvId) { if(it->uvId != *point.uvId) continue; }
if(point.tgtBinormalId) { if(it->tgtBinormalId != *point.tgtBinormalId) continue; }
if(point.colorId) { if(it->colorId != *point.colorId) continue; }
return it->fVertexId;
}
DVerticeComponent nVertice;
if(point.normalId) nVertice.normalId = *(point.normalId);
if(point.uvId) nVertice.uvId = *(point.uvId);
if(point.tgtBinormalId) nVertice.tgtBinormalId = *(point.tgtBinormalId);
if(point.colorId) nVertice.colorId = *(point.colorId);
nVertice.fVertexId = actualNumVertices;
m_dVertices[point.pointId].push_back(nVertice);
actualNumVertices++;
return actualNumVertices - 1;
}
MObject CPMMeshExtractor::findShader(const MObject &setNode)
{
MFnDependencyNode fnNode(setNode);
MPlug shaderPlug = fnNode.findPlug("surfaceShader");
if(!shaderPlug.isNull())
{
MStatus status;
MPlugArray connectedPlugs;
shaderPlug.connectedTo(connectedPlugs, true, false, &status);
if(!status)
{
MGlobal::displayError("MPlug::connectedTo");
return MObject::kNullObj;
}
if(connectedPlugs.length() != 1)
{
MGlobal::displayError("Erreur lors de l'acquisition du shader de " + m_mesh.fullPathName());
}
else
{
return connectedPlugs[0].node();
}
}
return MObject::kNullObj;
} |
6318a86b3895e0756bfd511b85fa21e8086b3d9b | 2203ee20758f34cd9252f473b7630de2781ddac9 | /Test/src/main.cpp | 2bb3c556a1968c50cdf8966a56c09d0811b33c72 | [] | no_license | michaelshanta/ESP32-IoT-3-Sensor-Dashboard | 5e36894578eaf083366c3c520d6d3d830316b4ee | d1116b868ef95cbecd1ce60e92027182361cca0c | refs/heads/master | 2022-04-13T00:57:34.150193 | 2020-01-29T11:10:21 | 2020-01-29T11:10:21 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,389 | cpp | main.cpp | #include <Arduino.h>
#include <WiFi.h>
#include <Wire.h>
#include <Adafruit_BME280.h>
#include <Adafruit_CCS811.h>
#include <Adafruit_Sensor.h>
#include <AWS_IOT.h>
#include <ArduinoJson.h>
#include <Preferences.h>
#include <DNSServer.h>
#include <WiFiManager.h>
#define SEALEVELPRESSURE_HPA (1013.25)
#define uS_TO_S_FACTOR 1000000
#define TIME_TO_SLEEP 5
const size_t capacity = JSON_OBJECT_SIZE(7);
char HOST_ADDRESS[]="al98lr4rrmy3s-ats.iot.us-east-1.amazonaws.com";
char CLIENT_ID[] = "client id";
char TOPIC_NAME[] = "$aws/things/Electronic-Nose/sensor-data";
unsigned long delayTime;
int status = WL_IDLE_STATUS;
int tick=0,msgCount=0,msgReceived = 0;
char payload[512];
char rcvdPayload[512];
Adafruit_BME280 bme;
Adafruit_CCS811 ccs;
AWS_IOT eNose;
WiFiManager manager;
void mySubCallBackHandler (char *topicName, int payloadLen, char *payLoad)
{
strncpy(rcvdPayload,payLoad,payloadLen);
rcvdPayload[payloadLen] = 0;
msgReceived = 1;
}
void setup() {
delayTime = 1000;
Serial.begin(115200);
manager.setAPStaticIPConfig(IPAddress(10,0,1,1), IPAddress(10,0,1,1), IPAddress(255,255,255,0));
// Connect to WiFi using the manager
// Set WiFi to station mode and disconnect from an AP if it was previously connected
WiFi.mode(WIFI_AP_STA);
WiFi.disconnect();
delay(100);
manager.startConfigPortal("Electronic Nose Setup");
delay(delayTime);
if(WiFi.status() == WL_CONNECTED) {
// Connect to AWS IoT and Subscribe to topic
Serial.println("Connected to WiFi succesfully");
if(eNose.connect(HOST_ADDRESS, CLIENT_ID) == 0) {
Serial.println("Connected to AWS");
delay(delayTime);
if(0==eNose.subscribe(TOPIC_NAME, mySubCallBackHandler)) {
Serial.println("subscribed");
} else {
Serial.println("Subscribe failed.");
while(1);
}
} else {
Serial.println("AWS Connection failed");
while(1);
}
}
// Check sensors are working
if(!bme.begin() || !ccs.begin()) {
// bme280 not working or connected wrong
Serial.println("Sensors are not connected properly!");
}
// Wait for the sensor to be ready
while(!ccs.available());
}
void print_wakeup_reason(){
}
void loop() {
if(tick >= 5 && ccs.available()) {
DynamicJsonDocument doc(capacity);
// Every 10 seconds make a publish
tick = 0; // reset the tick
doc["Temperature"] = bme.readTemperature();
doc["Pressure"] = bme.readPressure();
doc["Altitude"] = bme.readAltitude(SEALEVELPRESSURE_HPA);
doc["Humidity"] = bme.readHumidity();
doc["Alcohol"] = analogRead(33);
if(!ccs.readData()) {
doc["CO2"] = ccs.geteCO2();
doc["TVOC"] = ccs.getTVOC();
serializeJson(doc,payload);
if(eNose.publish(TOPIC_NAME, payload) == 0) {
Serial.print("Publishing Message: ");
Serial.println(payload);
} else {
Serial.println("Publish Failed");
}
} else {
Serial.println("ERROR with CCS!");
while(1);
}
delay(500);
}
vTaskDelay(1000/ portTICK_RATE_MS);
tick++;
}
|
12dc80ba2e2e8bd627e09efd51425e5f96c31ea1 | a4de7672f460babe084d08afe08a6453a9d4c64a | /NextPermutation.cpp | 68cf3688ca09012d5f593329d72def3fbe6f1321 | [] | no_license | sulemanrai/leetcode | 3db0dd328ceb44bb43e15b00231c69b1aa437898 | 72ecdee5c6b7326eea90ddac6bb73959fce13020 | refs/heads/master | 2020-03-16T17:29:04.025572 | 2018-09-07T05:43:32 | 2018-09-07T05:43:32 | 132,834,334 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 447 | cpp | NextPermutation.cpp | #include<iostream>
#include <vector>
#include <algorithm>
#include <unordered_map>
#include <map>
#include <functional>
using namespace std;
class Solution {
public:
void nextPermutation(vector<int>& nums) {
std::next_permutation(nums.begin(),nums.end());
}
};
int main()
{
//code
vector<int> nums1 = { 1,1,5 };
int target = 2;
Solution s;
s.nextPermutation(nums1);
for (int i : nums1)
cout << i << ' ';
cout << endl;
return 0;
} |
b4e8b4ed2ae0e3ef5dcb6adc126ce395b8d5ea7c | da113e2f5781ea5d8865366d1c0195858c0bf700 | /os_ass3.cpp | 07a3f77411117c18d38874756a5998e1a7880ed0 | [] | no_license | hg31099/Heap-Memory-management-simulator | c82bd29819f4e9a73d1bed40721c1f5ae9aa8435 | 1d753ba8d9b1aa92d4e727f829f061c9075e4a87 | refs/heads/master | 2022-11-11T14:22:03.673685 | 2020-06-28T17:16:28 | 2020-06-28T17:16:28 | 275,632,377 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,837 | cpp | os_ass3.cpp | #include<bits/stdc++.h>
#define heap_size 100
#define magic 515
using namespace std;
int curr=0;
int domalloc(int size,int arr[],int **headptr)
{
int temp;
int temp1,prev,flag,prevcurr;
if(curr==0)
{
if(size<=heap_size)
{
temp=curr+2;
arr[0]=size;
arr[1]=magic;
curr=curr+size+2;
arr[curr+1]=-1;
arr[curr]=heap_size-(4+size);
*headptr=&arr[curr];
}
}
else
{
temp1=curr;
flag=0;
prevcurr=curr;
while(arr[temp1]<size && arr[temp1+1]!=-1)
{
prev=temp1+1;
temp1=arr[temp1+1];
if(flag==0)
flag=1;
}
if(flag==0)
{
if(arr[temp1]==size)
curr=arr[temp1+1];
else
curr=temp1+2+size;
}
if(arr[temp1+1]==-1 && arr[temp1]<size)
{
cout<<"Allocation not possible";
return -1;
}
else
{
temp=temp1+2;
if(arr[temp1]==size)
{
if(flag==1)
arr[prev]=arr[temp1+1];
}
else
{
curr=temp1+2+size;
if(curr<100)
{
arr[curr]=arr[temp1]-size-2;
arr[curr+1]=arr[temp1+1];
arr[temp1]=size;
if(flag==1)
{
arr[prev]=curr;
curr=prevcurr;
}
*headptr=&arr[curr];
}
arr[temp1+1]=magic;
}
}
}
return temp;
}
void dofree(int top,int arr[],int **headptr)
{
top-=2;
*headptr=&arr[top];
arr[top+1]=curr;
curr=top;
}
void coalesce_memory(int arr[])
{
int sum,f=0,temp1=curr,start,prev,prevprev=-1,s1=0;
while(temp1!=-1 && arr[temp1+1]!=-1)
{
if(arr[temp1+1]!=-1)
{
if(arr[temp1+1]<temp1)
{
if(arr[temp1+1]==temp1-2-arr[temp1])
{
s1+=2;
f=1;
if(temp1==curr)
{
prev=temp1;
curr=arr[temp1+1];
arr[curr]+=(arr[prev]+2);
temp1=curr;
}
else
{
prev=temp1;
temp1=arr[temp1+1];
arr[temp1]+=(arr[prev]+2);
if(prevprev!=-1)
arr[prevprev+1]=temp1;
prevprev=temp1;
}
}
else
temp1=arr[temp1+1];
}
else if(arr[temp1+1]>temp1)
{
if(arr[temp1+1]==temp1+2+arr[temp1])
{
f=1;
s1+=2;
int next=arr[temp1+1];
arr[temp1]+=(arr[next]+2);
arr[temp1+1]=arr[next+1];
}
else
temp1=arr[temp1+1];
}
}
}
if(f==0)
cout<<"No adjacent free chunk available"<<endl;
else
{
cout<<"Memory Coalesced successfully with saving "<<s1<<" units"<<endl;
}
}
int main()
{
int arr[heap_size],temp1;
int *head=&arr[0],*a;
int t=1,totalfree;
string str;
vector<pair<char,int>> v1;
while(t!=0)
{
cout<<"Enter 1 to continue,0 to exit the terminal, -1 to see status of memory and -2 to coalesce memory"<<endl;
cin>>t;
if(t==-1)
{
cout<<"Free memory track:"<<endl;
cout<<"Head: "<<curr<<endl;
temp1=curr;
totalfree=0;
while(temp1!=-1)
{
cout<<temp1<<"("<<arr[temp1]<<")"<<" "<<"->"<<" ";
totalfree+=arr[temp1];
temp1=arr[temp1+1];
}
cout<<"Total free memory: "<<totalfree<<endl;
cout<<"User pointers: "<<endl;
for(auto it=v1.begin();it!=v1.end();it++)
{
cout<<(*it).first<<"="<<(*it).second<<"("<<arr[(*it).second-2]<<")"<<endl;
}
}
if(t==1)
{
cin>>str;
if(str[2]=='m' && str[3]=='a')
{
int x=str[9]-'0';
x*=10;
x+=(str[10]-'0');
v1.push_back({str[0],domalloc(x,arr,&head)});
cout<<curr<<" "<<arr[curr]<<" "<<arr[curr+1]<<endl;
cout<<"*"<<t<<endl;
}
else if(str[0]=='f')
{
int f1=0;
for(auto it=v1.begin();it!=v1.end() && f1==0;it++)
{
if((*it).first==str[5])
{
f1=1;
dofree((*it).second,arr,&head);
v1.erase(it);
cout<<curr<<" "<<arr[curr]<<" "<<arr[curr+1]<<endl;
}
}
}
}
if(t==-2)
{
coalesce_memory(arr);
}
}
return 0;
}
|
e406943f534ee3c94fa11cc8acbd9e722df3b73c | 954f7327fea0c8fa58a08e31fca0580ff543dab8 | /kernel/network.cc | 8cd4cdcc769bbbe7e15e7d88c16e5488d541bf89 | [] | no_license | Vexal/cs439hp12 | b58b603223cf4a1b51814de5d881be9e4f447020 | 21237aab68f76cab0b273437d21481fdae419407 | refs/heads/master | 2016-09-06T11:53:19.613364 | 2014-12-13T17:34:41 | 2014-12-13T17:34:41 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 20,435 | cc | network.cc | #include "network.h"
#include "machine.h"
#include "NetworkProcess.h"
Network* Network::KernelNetwork = nullptr;
unsigned char Network::myMac[6] = {0x52,0x54,0x00,0x12,0x34,0x56};
unsigned char Network::myIP[4] = {192,168,7,2};
int Network::debugLevel = 1;
bool hasBroke = false;
void Network::HandleNetworkInterrupt()
{
++this->netCount;
unsigned short interruptType = inw(ioaddr + 0x3E);
if(!hasBroke)
Debug::printf("Received interrupt of type: %x from the network card.\n", interruptType);
if((interruptType & 1) > 0)
{
this->handlePacketReceiveInterrupt();
}
if((interruptType & 2) > 0)
{
Debug::printf("Network interrupt error: %d\n", interruptType);
}
if((interruptType & 4) > 0)
{
//handle transmission complete
this->endTxOKInterrupt();
}
if((interruptType & 16) > 0)
{
//buffer full.
if(!hasBroke)
Debug::printf("Our network buffer is full.\n");
outw(ioaddr + 0x38, 8192);
this->endRxOKInterrupt();
hasBroke = true;
}
if((interruptType & 64) > 0)
{
Debug::printf("FIFO is full.\n");
this->endRxOKInterrupt();
}
}
bool Network::SendPacket(Packet* packet)
{
switch(packet->type)
{
case PacketType::ARP:
{
if(packet->isReply)
{
if(debugLevel > 0)
Debug::printf("SENDING ARP REPLY\n");
this->sendPacket(packet->data, 42);
}
else
{
this->sendARPRequest(packet->IP);
}
}
break;
case PacketType::IPv4:
{
switch(packet->protocol)
{
case PacketProtocol::ICMP:
{
if(packet->isReply)
{
Debug::printf("sending echo reply\n");
this->sendPacket(packet->data, packet->length);
}
else
{
unsigned char destMac[6];
if(!this->arpCache.GetEntry(packet->IP, destMac))
{
Packet* p = new Packet(42);
memcpy(p->IP, packet->IP, 4);
p->type = PacketType::ARP;
p->isReply = false;
Process::networkProcess->QueueNetworkSend(p);
return false;
}
else
{
this->ping(packet, destMac);
}
}
}
break;
case PacketProtocol::P439:
{
unsigned char destMac[6];
if(!this->arpCache.GetEntry(packet->IP, destMac))
{
Packet* p = new Packet(42);
memcpy(p->IP, packet->IP, 4);
p->type = PacketType::ARP;
p->isReply = false;
Process::networkProcess->QueueNetworkSend(p);
return false;
}
else
{
this->sendP439Packet(packet, destMac);
}
}
break;
}
}
}
return true;
}
void Network::ping(Packet *packet, const unsigned char destMac[6])
{
memcpy(packet->data, destMac, 6);
memcpy(packet->data + 6, myMac, 6);
packet->data[12] = 0x08;
packet->data[13] = 0x00;
IPv4Header ipv4Header;
ipv4Header.protocol = 0x01;
memcpy(ipv4Header.srcIPAddress, myIP, 4);
memcpy(ipv4Header.destIPAddress, packet->IP, 4);
this->calcChecksum((unsigned char *) &ipv4Header, sizeof(IPv4Header), ipv4Header.headerChecksum);
memcpy(packet->data + 14, &ipv4Header, sizeof(IPv4Header));
ICMPHeader icmpHeader;
icmpHeader.type = 0x08;
icmpHeader.code = 0x00;
//don't know if makes sense
icmpHeader.identifier[0] = 0x10;
icmpHeader.identifier[1] = 0x0d;
icmpHeader.seqNum[0] = 0x00;
icmpHeader.seqNum[1] = 0x01;
memcpy(packet->data + 14 + sizeof(IPv4Header), &icmpHeader, sizeof(ICMPHeader));
for (int i = 58; i < 98; ++i)
{
packet->data[i] = i;
}
this->calcChecksum((unsigned char *) packet->data + 34, 64, packet->data + 36 );
if(debugLevel > 1)
Debug::printf("PINGINGINGINGING");
this->sendPacket(packet->data, 98);
}
void Network::sendP439Packet(Packet *packet, const unsigned char destMac[6])
{
unsigned char* buffer = new unsigned char[packet->length + 35];
memcpy(buffer, destMac, 6);
memcpy(buffer + 6, myMac, 6);
buffer[12] = 0x08;
buffer[13] = 0x00;
IPv4Header ipv4Header;
ipv4Header.protocol = 0x02;
ipv4Header.totalLength[1] = packet->length + 21;
memcpy(ipv4Header.srcIPAddress, myIP, 4);
memcpy(ipv4Header.destIPAddress, packet->IP, 4);
this->calcChecksum((unsigned char *) &ipv4Header, sizeof(IPv4Header), ipv4Header.headerChecksum);
memcpy(buffer + 14, &ipv4Header, sizeof(IPv4Header));
memcpy(buffer + 34, &packet->port, 1);
memcpy(buffer + 35, packet->data, packet->length);
this->sendPacket(buffer, packet->length + 35);
delete[] buffer;
}
Network::Network() :
netCount(0),
currentBufferPosition(0),
currentBufferIndex(0)
{
}
void Network::handlePacketReceiveInterrupt()
{
const unsigned char* const rcvBuffer = this->ReceiveBuffer + this->currentBufferPosition;
const unsigned short packetLength = this->getCurrentPacketLength();
const unsigned short realPacketLength = packetLength + 4;
const PacketType etherType = getCurrentPacketType();
if(this->isCurrentPacketForUs())
{
unsigned char sender[6];
this->getCurrentPacketSender(sender);
if(debugLevel > 1)
{
Debug::printf("current packet length is %d\n", packetLength);
Debug::printf("sender is ");
for (int i = 0; i < 5; ++i) {
Debug::printf("%x:", sender[i]);
}
Debug::printf("%x\n", sender[5]);
Debug::printf("type is %x\n", etherType);
}
switch(etherType)
{
case PacketType::ARP:
{
if(debugLevel > 0)
Debug::printf("ARP PACKET");
ARPPacket request;
memcpy(&request, &this->ReceiveBuffer[this->currentBufferPosition + 18], 28);
request.printPacket();
this->arpCache.AddEntry(request.srcIP, request.srcMac);
unsigned char packet[42] = {0};
memcpy(packet, sender, 6);
memcpy(packet+6, myMac, 6);
packet[12] = 0x08;
packet[13] = 0x06;
ARPPacket reply;
memcpy(reply.hardwareType, request.hardwareType, 2);
memcpy(reply.protocolType, request.protocolType, 2);
reply.hardwareLen = request.hardwareLen;
reply.protocolLen = request.protocolLen;
reply.operationCode[0] = 0;
reply.operationCode[1] = 2;
memcpy(reply.srcMac, myMac, 6);
memcpy(reply.srcIP, request.destIP, 4);
memcpy(reply.destMac, request.srcMac, 6);
memcpy(reply.destIP, request.srcIP, 4);
//reply.printPacket();
memcpy(packet+14, &reply, 28);
//this->sendPacket(packet, 42);
Packet* p = new Packet(42);
memcpy(p->data, packet, 42);
p->isReply = true;
p->type = PacketType::ARP;
Process::networkProcess->QueueNetworkSend(p);
break;
}
case PacketType::IPv4:
{
if(debugLevel > 0)
Debug::printf("IPV4 PACKET: ");
IPv4Header ipv4Header;
memcpy(&ipv4Header, rcvBuffer + 18, sizeof(IPv4Header));
/*for(int a = 0; a < packetLength; ++a)
{
Debug::printf("%d: %02x (%03d) \n", a, rcvBuffer[a],
rcvBuffer[a]);
}*/
//ipv4Header.print();
switch(ipv4Header.protocol)
{
case 1: //ICMP
{
if(debugLevel > 0)
Debug::printf(" type ICMP\n");
ICMPHeader icmpHeader;
memcpy(&icmpHeader, rcvBuffer + 18 + sizeof(IPv4Header), sizeof(ICMPHeader));
//icmpHeader.print();
switch(icmpHeader.type)
{
case 0:
{
if(debugLevel > 0)
Debug::printf("Received ICMP echo reply.\n");
ipv4Header.print();
break;
}
case 8:
{
if(debugLevel > 0)
Debug::printf("Received ICMP echo request.\n");
/*unsigned char destMac[6];
this->arpCache.GetEntry(ipv4Header.srcIPAddress, destMac);
for (int i = 0; i<6; ++i)
{
Debug::printf("%02x", destMac[i]);
}
Debug::printf("\n");*/
this->resplondToEchoRequest();
break;
}
default:
Debug::printf("Received unknown ICMP packet type %d.\n", icmpHeader.type);
break;
}
}
break;
case 2: //P439
{
const int len = ipv4Header.totalLength[0] * 256 + ipv4Header.totalLength[1] - 21;
Packet* p = new Packet(len);
memcpy(p->data, rcvBuffer + 18 + sizeof(IPv4Header) + 1, len);
p->port = rcvBuffer[38];
p->protocol = PacketProtocol::P439;
p->type = PacketType::IPv4;
memcpy(p->IP, ipv4Header.srcIPAddress, 4);
Debug::printf(" Type P439\n");
Process::networkProcess->QueueNetworkReceive(p);
}
break;
}
break;
}
case PacketType::IPv6:
{
Debug::printf("IPV6 PACKET");
break;
}
case PacketType::UNKNOWN:
{
Debug::printf("UNKNOWN PACKET TYPE.");
break;
}
}
}
else
{
if(debugLevel > 1)
Debug::printf("Found somebody else's packet: %x %x %x %x %x %x\n",
rcvBuffer[4],
rcvBuffer[5],
rcvBuffer[6],
rcvBuffer[7],
rcvBuffer[8],
rcvBuffer[9]);
}
this->currentBufferPosition+= realPacketLength;
this->currentBufferPosition = (this->currentBufferPosition + 3) & ~0x3;
this->currentBufferPosition %= 8192;
if(debugLevel > 0)
Debug::printf("\nCurrent network receive buffer position: %d\n", this->currentBufferPosition);
outw(ioaddr + 0x38, this->currentBufferPosition - 0x10);
this->endRxOKInterrupt();
}
void Network::sendPacket(const unsigned char* data, int length)
{
//hd((unsigned long)data, (unsigned long)data +100);
//while(1) {}
memcpy((void*)this->TransmitBuffer, data, length); //copy the packet into the buffer
//set addr and size of tx buffer
outl(ioaddr + 0x20 + 4 * currentBufferIndex, (unsigned long)this->TransmitBuffer);
outl(ioaddr + 0x10 + 4 * currentBufferIndex, length);
currentBufferIndex++;
currentBufferIndex %= 4;
}
void Network::resplondToEchoRequest()
{
const int len = this->getCurrentPacketLength() - 4;
Packet* p = new Packet(len);
memcpy(p->data, this->currentBuffer() + 4, len);
//switch dest and src.
memcpy(p->data, this->currentBuffer() + 10, 6);
memcpy(p->data + 6, this->currentBuffer() + 4, 6);
//set type to response.
p->data[14 + sizeof(IPv4Header)] = 0;
//switch ipv4 dest and src.
memcpy(p->data + 26, this->currentBuffer() + 30 + 4, 4);
memcpy(p->data + 30, this->currentBuffer() + 26 + 4, 4);
p->data[24] = 0;
p->data[25] = 0;
this->calcChecksum((unsigned char *) p->data + 14, sizeof(IPv4Header), p->data + 24);
p->data[36] = 0;
p->data[37] = 0;
this->calcChecksum((unsigned char *) p->data + 34, 64, p->data + 36 );
//this->sendPacket(buffer, len);
//delete[] buffer;
p->protocol = PacketProtocol::ICMP;
p->type = PacketType::IPv4;
p->isReply = true;
Process::networkProcess->QueueNetworkSend(p);
}
void Network::sendARPRequest(const unsigned char ip[4])
{
if(debugLevel > 0)
Debug::printf("SENDING ARP REQUEST");
ARPPacket request;
unsigned char packet[42] = {0};
for (int i = 0; i < 6; ++i)
{
packet[i] = 0xFF;
}
memcpy(packet+6, myMac, 6);
packet[12] = 0x08;
packet[13] = 0x06;
request.hardwareType[0] = 0x00;
request.hardwareType[1] = 0x01;
request.protocolType[0] = 0x08;
request.protocolType[1] = 0x00;
request.hardwareLen = 0x06;
request.protocolLen = 0x04;
request.operationCode[0] = 0x00;
request.operationCode[1] = 0x01;
memcpy(request.srcMac, myMac, 6);
memcpy(request.srcIP, myIP, 4);
request.destMac[6] = {0};
memcpy(request.destIP, ip, 4);
memcpy(packet+14, &request, 28);
this->sendPacket(packet, 42);
}
bool Network::isCurrentPacketForUs() const
{
int i = 0;
for (; i < 6; ++i)
{
//Debug::printf("Checking rcv %x vs our %x\n", this->ReceiveBuffer[this->currentBufferPosition + i + 4], myMac[i]);
if(this->ReceiveBuffer[this->currentBufferPosition + i + 4] != myMac[i])
{
break;
}
}
if(i == 6)
return true;
i = 0;
for (; i < 6; ++i)
{
//Debug::printf("Checking rcv %x vs broadcast %x\n", this->ReceiveBuffer[this->currentBufferPosition + i + 4], 0xff);
if(this->ReceiveBuffer[this->currentBufferPosition + i + 4] != 0xFF)
{
break;
}
}
return i == 6;
}
//Retrieves the length of the packet currently
//pointed to by bufferPosition.
unsigned short Network::getCurrentPacketLength() const
{
return *((short *) (this->ReceiveBuffer + this->currentBufferPosition + 2));
}
//Retrieves the sender of the packet currently
//pointed to by bufferPosition.
void Network::getCurrentPacketSender(unsigned char sender[6])
{
for (int i = 0; i < 6; ++i)
{
sender[i] = this->ReceiveBuffer[this->currentBufferPosition + i + 10];
}
}
//Retrieves the sender of the packet currently
//pointed to by bufferPosition.
PacketType Network::getCurrentPacketType() const
{
const unsigned char firstByte = this->ReceiveBuffer[this->currentBufferPosition + 16];
const unsigned char secondByte = this->ReceiveBuffer[this->currentBufferPosition + 17];
const unsigned short type = (firstByte << 8) + secondByte;
switch(type)
{
case 0x0806:
return PacketType::ARP;
case 0x0800:
return PacketType::IPv4;
case 0x86dd:
return PacketType::IPv6;
}
return PacketType::UNKNOWN;
}
void Network::endRxOKInterrupt()
{
// Interrupt Status - Clears the Rx OK bit, acknowledging a packet has been received,
// and is now in rx_buffer
outw(ioaddr + 0x3E, 0x1);
}
void Network::endTxOKInterrupt()
{
// Interrupt Status - Clears the Tx OWN bit, acknowledging a packet has been transmitted
outl(ioaddr + 0x10, 0x0);
outw(ioaddr + 0x3E, 0x4);
}
void Network::Init()
{
const unsigned short vendor = pciCheckVendor(0, 3);
//Debug::printf("The vendor id is %x\n", vendor);
for(int a = 0; a < 64; a+=2)
{
const unsigned short BAR0 = pciConfigReadWord(0, 3, 0, a);
//Debug::printf("The thing at %x is %x\n", a, BAR0);
}
pciConfigWriteWord(0, 3, 0, 0xa, 6);
outb( ioaddr + 0x52, 0x0);
const long mac = inl(ioaddr);
const long mac2 = inw(ioaddr + 4);
//Debug::printf("Found mac0-5 %x %x\n", mac, mac2);
if (mac2 != 0x5634) {
myIP[3] = 4;
myMac[5] = 0x65;
//Debug::printf("Changing address");
}
if(mac == -1)
{
return;
}
outb( ioaddr + 0x37, 0x10);
while( (inb(ioaddr + 0x37) & 0x10) != 0) { }
const long transmitStatus = inl(ioaddr + 0x10);
//Debug::printf("Transmit status: %x\n", transmitStatus);
const long transmitBufferAddress = inl(ioaddr + 0x20);
outl(ioaddr + 0x20, (long)TransmitBuffer);
const long transmitBufferAddress2 = inl(ioaddr + 0x20);
//Debug::printf("Transmit buffer: %x, then after setting: %x\n", transmitBufferAddress, transmitBufferAddress2);
const long receiveBufferAddress = inl(ioaddr + 0x30);
outl(ioaddr + 0x30, (long)ReceiveBuffer);
const long receiveBufferAddress2 = inl(ioaddr + 0x30);
//Debug::printf("Receive buffer: %x, then after setting: %x\n", receiveBufferAddress, receiveBufferAddress2);
const long imrMask = inw(ioaddr + 0x3C);
outw(ioaddr + 0x3C, 0xFFFF);
const long imrMask2 = inw(ioaddr + 0x3C);
//Debug::printf("IMR mask: %x, then after setting: %x\n", imrMask, imrMask2);
const long isrMask = inw(ioaddr + 0x3e);
//outw(ioaddr + 0x3E, 0x0005);
const long isrMask2 = inw(ioaddr + 0x3E);
//Debug::printf("ISR mask: %x, then after setting: %x\n", isrMask, isrMask2);
const long rcvConfig = 0xf | (1 << 7);
const long rcvConfigInitial = inl(ioaddr + 0x44);
outl(ioaddr + 0x44,rcvConfig); // (1 << 7) is the WRAP bit, 0xf is AB+AM+APM+AAP
const long rcvConfigSet = inl(ioaddr + 0x44);
//Debug::printf("Receive Config: %x, then after setting: %x\n", rcvConfigInitial, rcvConfigSet);
const long reAndTe = inb(ioaddr + 0x37);
outb(ioaddr + 0x37, 0x0C);
const long reAndTe2 = inb(ioaddr + 0x37);
//Debug::printf("Receive / Transmit enable: %x, then after setting: %x\n", reAndTe, reAndTe2);
}
void Network::InitNetwork()
{
Network::KernelNetwork = new Network();
Network::KernelNetwork->Init();
Process::networkProcess = new NetworkProcess();
Process::networkProcess->start();
Debug::printf("Initialized network\n");
}
bool Network::CheckIP(const unsigned char ip[4])
{
for (int i = 0; i < 4; ++i)
{
if (ip[i] != myIP[i])
{
return false;
}
}
return true;
}
unsigned int Network::pciConfigReadWord(unsigned char bus, unsigned char slot, unsigned
char func, unsigned char offset)
{
unsigned int address;
unsigned int lbus = (unsigned int)bus;
unsigned int lslot = (unsigned int)slot;
unsigned int lfunc = (unsigned int)func;
unsigned short tmp = 0;
address = (unsigned int)((lbus << 16) | (lslot << 11) | (lfunc << 8) |
(offset & 0xfc) | ((unsigned int)0x80000000));
outl(0xCF8, address);
//tmp = inl(0xfc);
tmp = (unsigned short)((inl(0xcfc) >> ((offset & 2) * 8)) & 0xFFFF);
return tmp;
}
void Network::pciConfigWriteWord(unsigned char bus, unsigned char slot, unsigned
char func, unsigned char offset, unsigned short val)
{
offset = 0x6;
const int sz = 0;
unsigned int address;
unsigned int lbus = (unsigned int)bus;
unsigned int lslot = (unsigned int)slot;
unsigned int lfunc = (unsigned int)func;
unsigned long tmp = 0;
address = (unsigned int)((lbus << 16) | (lslot << 11) | (lfunc << 8) |
(offset & 0xfc) | ((unsigned int)0x80000000));
//address = (lbus << 16) | (lslot << 11) | (lfunc << 8) | offset | 0x80000000;
outl(0xCF8, address);
tmp = inl(0xcfc + sz);
//Debug::printf("Read in %x\n", tmp);
//tmp = (unsigned short)((inl(0xcfc) >> ((offset & 2) * 8)) & 0xFFFF);
//return tmp;
outl(0xcfc + sz, (unsigned int)0xFFFF0107);
tmp = inl(0xcfc + sz);
//Debug::printf("Read in %x\n", tmp);
}
unsigned short Network::pciCheckVendor(unsigned char bus, unsigned char slot)
{
unsigned short vendor;// device;
if((vendor = pciConfigReadWord(bus, slot, 0, 0)) != 0xFFFF)
{
}
return vendor;
}
void ARPCache::AddEntry(const unsigned char ipAddress[4], const unsigned char macAddress[6])
{
memcpy(this->cache[count].ipAddress, ipAddress, 4);
memcpy(this->cache[count].macAddress, macAddress, 6);
count = (count + 1) % 100;
}
bool ARPCache::GetEntry(const unsigned char ipAddress[4], unsigned char macAddress[6]) const
{
for (int i = 0; i < 100; ++i)
{
bool f = true;
for (int j = 0; j < 4; ++j)
{
if (ipAddress[j] != this->cache[i].ipAddress[j])
{
f = false;
break;
}
}
if (f)
{
memcpy(macAddress, this->cache[i].macAddress, 6);
return true;
}
}
return false;
}
void Network::calcChecksum(unsigned char* header, int length, unsigned char checksum[2])
{
unsigned long sum = 0;
while (length > 1)
{
sum += *((unsigned short *) header);
header += 2;
length -=2;
}
if (length > 0)
{
sum += *header;
}
if (sum >> 16) {
sum = (sum & 0xFFFF) + (sum >> 16);
}
sum = ~sum;
checksum[0] = sum & 0xFF;
checksum[1] = sum >> 8;
}
|
46429dc6b6f339d03a5892900f37de45e0e0e3fc | 0f14ddf7c637167f3bf9ae0c490f7e33611d37df | /ObjLoader/source/ObjManager.cpp | ebc726f98da78b366fcaf0ec27695bd1dc82f0dd | [
"MIT"
] | permissive | VytasSamulionis/TomorrowGame | 58ad044139111de868684fe4097ce8c805037316 | 91f17410c82dc69dc4f22e5d88ed3d7d7ee08422 | refs/heads/master | 2020-06-01T21:24:59.289089 | 2017-06-12T10:51:55 | 2017-06-12T10:51:55 | 94,084,784 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,687 | cpp | ObjManager.cpp | #include "..\include\ObjManager.h"
ObjManager::ObjManager (RenderDevice* _device):
m_Device (_device) {
try {
for (UINT i = 0; i < 6; i++) {
std::vector<Buffer> renderingBuffers;
Buffer buffer;
buffer.BufferId = INVALID_ID;
buffer.Num = 0;
renderingBuffers.push_back (buffer);
m_RenderingBuffers.push_back (renderingBuffers);
}
} catch (std::bad_alloc) {
THROW_ERROR (ERRC_OUT_OF_MEM);
}
m_IndexBuffer.BufferId = INVALID_ID;
m_IndexBuffer.Num = 0;
}
ObjManager::~ObjManager () {
UnloadAll ();
/*#ifdef _DEBUG
_CrtDumpMemoryLeaks();
#endif*/
}
UINT ObjManager::Load (const char* _filename) {
UINT numModels = m_Models.size();
ObjModel* model = NULL;
try {
model = new ObjModel (m_Device, this);
m_Models.push_back(model);
m_Models[numModels]->Load (_filename);
} catch (std::bad_alloc) {
THROW_ERROR (ERRC_OUT_OF_MEM);
} catch (ErrorMessage e) {
delete model;
m_Models.pop_back ();
throw e;
}
return numModels;
}
UINT ObjManager::Load (const char* _filename, UINT _skinId) {
UINT modelId = Load (_filename);
m_Models[modelId]->SetSkinId (_skinId);
return modelId;
}
UINT ObjManager::AddModel (ObjModel* _model) {
if (m_Models.size() == INVALID_ID - 1) {
THROW_ERROR (ERRC_OUT_OF_MEM);
}
try {
m_Models.push_back (_model);
} catch (std::bad_alloc) {
THROW_ERROR (ERRC_OUT_OF_MEM);
}
return m_Models.size() - 1;
}
UINT ObjManager::AddModelToRenderingBuffer (void* _modelData, UINT _numVertices, VERTEXFORMATTYPE _vft, UINT& _startVertex) {
UINT i = (UINT)_vft;
if (i >= m_RenderingBuffers.size()) {
THROW_ERROR (ERRC_UNKNOWN_VF);
}
for (UINT j = 0; j < m_RenderingBuffers[i].size(); j++) {
if (m_RenderingBuffers[i][j].BufferId == INVALID_ID) {
m_RenderingBuffers[i][j].BufferId = m_Device->GetVCacheManager()->CreateStaticVertexBuffer(_modelData, _numVertices, _vft);
_startVertex = m_RenderingBuffers[i][j].Num;
m_RenderingBuffers[i][j].Num = _numVertices;
return m_RenderingBuffers[i][j].BufferId;
} else {
try {
m_Device->GetVCacheManager()->AddToStaticVertexBuffer(m_RenderingBuffers[i][j].BufferId, _modelData, _numVertices, _vft);
_startVertex = m_RenderingBuffers[i][j].Num;
m_RenderingBuffers[i][j].Num += _numVertices;
return m_RenderingBuffers[i][j].BufferId;
} catch (ErrorMessage e) {
if (e.GetErrorCode () != ERRC_OUT_OF_MEM) { /* Static vertex buffer was not full. */
throw;
}
}
}
}
Buffer newBuffer;
newBuffer.BufferId = m_Device->GetVCacheManager()->CreateStaticVertexBuffer(_modelData, _numVertices, _vft);
if (newBuffer.BufferId != INVALID_ID) {
_startVertex = 0;
newBuffer.Num = _numVertices;
try {
m_RenderingBuffers[i].push_back (newBuffer);
} catch (std::bad_alloc) {
THROW_ERROR (ERRC_OUT_OF_MEM);
}
}
return newBuffer.BufferId;
}
UINT ObjManager::GetBufferNumVertices (VERTEXFORMATTYPE _vft, UINT _bufferId) {
UINT i = (UINT)_vft;
if (i >= m_RenderingBuffers.size()) {
THROW_ERROR (ERRC_UNKNOWN_VF);
}
for (UINT j = 0; j < m_RenderingBuffers[i].size(); j++) {
if (m_RenderingBuffers[i][j].BufferId == _bufferId) {
return m_RenderingBuffers[i][j].Num;
}
}
return 0;
}
UINT ObjManager::AddToIndexBuffer (WORD* _IndexData, UINT _NumIndices) {
if (m_IndexBuffer.BufferId == INVALID_ID) {
m_IndexBuffer.BufferId = m_Device->GetVCacheManager()->CreateStaticIndexBuffer(_IndexData, _NumIndices);
m_IndexBuffer.Num = _NumIndices;
} else {
m_Device->GetVCacheManager()->AddToStaticIndexBuffer(m_IndexBuffer.BufferId, _IndexData, _NumIndices);
m_IndexBuffer.Num += _NumIndices;
}
return m_IndexBuffer.BufferId;
}
UINT ObjManager::GetIndexBufferNumIndices () {
return m_IndexBuffer.Num;
}
ObjModel* ObjManager::GetModel (UINT _id) {
if (_id >= m_Models.size()) {
THROW_ERROR (ERRC_OUT_OF_RANGE);
}
return m_Models[_id];
}
void ObjManager::UnloadAll () {
for (UINT i = 0; i < m_Models.size(); i++) {
delete m_Models[i];
}
m_Models.clear ();
}
|
84d5397a39bf813a5d2b2eb3ecfc3414f50fe97b | 5e7452fce4f3112b55f72da92993b60998309d96 | /include/dataflow/domains/interval_domain.h | 79a13793f38be54560db2f44fa0857bf6512ff83 | [
"Apache-2.0"
] | permissive | Xazax-hun/domains | 6d227e0c556b590b698f69577b824737d5848b0a | b26d0e29ea2e0907bb595d059726575aee415ed8 | refs/heads/main | 2022-12-19T17:50:34.192110 | 2022-08-15T04:23:54 | 2022-08-15T04:23:54 | 479,840,519 | 0 | 0 | Apache-2.0 | 2022-06-18T21:38:57 | 2022-04-09T20:49:40 | C++ | UTF-8 | C++ | false | false | 2,887 | h | interval_domain.h | #ifndef INTERVAL_DOMAIN_H
#define INTERVAL_DOMAIN_H
#include <algorithm>
#include <cassert>
#include <fmt/format.h>
#include "include/dataflow/domains/domain.h"
struct IntervalDomain;
bool operator==(IntervalDomain lhs, IntervalDomain rhs) noexcept;
struct IntervalDomain
{
int min, max;
explicit IntervalDomain(int num) : min(num), max(num) {}
IntervalDomain(int min, int max) : min(min), max(max) {}
static IntervalDomain bottom() { return {INF, NEG_INF}; }
static IntervalDomain top() { return {NEG_INF, INF}; }
IntervalDomain join(IntervalDomain other) const
{
return {std::min(min, other.min), std::max(max, other.max)};
}
IntervalDomain widen(IntervalDomain transferredState) const
{
if (*this == bottom())
return transferredState;
int resultMin = [this, transferredState] {
if (transferredState.min < min)
return NEG_INF;
return min;
}();
int resultMax = [this, transferredState]{
if (transferredState.max > max)
return INF;
return max;
}();
return {resultMin, resultMax};
}
std::string toString() const
{
const auto toStr = [](int num) -> std::string {
if (num == NEG_INF)
return "-inf";
if (num == INF)
return "inf";
return std::to_string(num);
};
return fmt::format("[{}, {}]", toStr(min), toStr(max));
}
std::vector<Polygon> covers() const
{
return {std::vector{Vec2{min, 0}, Vec2{max, 0}}};
}
};
inline bool operator==(IntervalDomain lhs, IntervalDomain rhs) noexcept
{
return lhs.min == rhs.min && lhs.max == rhs.max;
}
inline bool operator<=(IntervalDomain lhs, IntervalDomain rhs) noexcept
{
return rhs.min <= lhs.min && rhs.max >= lhs.max;
}
static_assert(WidenableDomain<IntervalDomain>);
// TODO: should these handle bottom?
inline IntervalDomain operator-(IntervalDomain o) noexcept
{
int minResult = [o] {
if (o.max == INF)
return NEG_INF;
return -o.max;
}();
int maxResult = [o] {
if (o.min == NEG_INF)
return INF;
return -o.min;
}();
return {minResult, maxResult};
}
inline IntervalDomain operator+(IntervalDomain lhs, IntervalDomain rhs) noexcept
{
int resultMin = [lhs, rhs]{
assert(lhs.min != INF && rhs.min != INF);
if (lhs.min == NEG_INF || rhs.min == NEG_INF)
return NEG_INF;
return lhs.min + rhs.min;
}();
int resultMax = [lhs, rhs]{
assert(lhs.max != NEG_INF && rhs.max != NEG_INF);
if (lhs.max == INF || rhs.max == INF)
return INF;
return lhs.max + rhs.max;
}();
return {resultMin, resultMax};
}
#endif // INTERVAL_DOMAIN_H |
70bbbb5265f3330aa3ea6107e3bff7fe4d712bc9 | 7cc5183d0b36133330b6cd428435e6b64a46e051 | /tensorflow/compiler/xla/service/gpu/gpu_device_info_test.cc | 130c99a9af6da9d4c117519265fd92b9f625fa3a | [
"Apache-2.0",
"LicenseRef-scancode-generic-cla",
"BSD-2-Clause"
] | permissive | shizukanaskytree/tensorflow | cfd0f3c583d362c62111a56eec9da6f9e3e0ddf9 | 7356ce170e2b12961309f0bf163d4f0fcf230b74 | refs/heads/master | 2022-11-19T04:46:43.708649 | 2022-11-12T09:03:54 | 2022-11-12T09:10:12 | 177,024,714 | 2 | 1 | Apache-2.0 | 2021-11-10T19:53:04 | 2019-03-21T21:13:38 | C++ | UTF-8 | C++ | false | false | 2,745 | cc | gpu_device_info_test.cc | /* Copyright 2022 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.
==============================================================================*/
#if GOOGLE_CUDA
#include <memory>
#include <string>
#include <gtest/gtest.h>
#include "third_party/gpus/cuda/include/cuda_runtime_api.h"
#include "tensorflow/compiler/xla/service/gpu/gpu_device_info_for_tests.h"
#include "tensorflow/compiler/xla/stream_executor/cuda/cuda_driver.h"
#include "tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.h"
#include "tensorflow/compiler/xla/stream_executor/device_description.h"
namespace stream_executor {
namespace gpu {
namespace {
TEST(DeviceInfoTest, DeviceInfo) {
ASSERT_FALSE(cuInit(/*Flags=*/0));
std::unique_ptr<DeviceDescription> d =
GpuExecutor::CreateDeviceDescription(/*device_ordinal=*/0).value();
const std::string &name = d->name();
if (name == "NVIDIA RTX A6000") {
auto t = xla::gpu::TestGpuDeviceInfo::RTXA6000DeviceInfo();
EXPECT_EQ(t.threads_per_block_limit, d->threads_per_block_limit());
EXPECT_EQ(t.threads_per_warp, d->threads_per_warp());
EXPECT_EQ(t.shared_memory_per_block, d->shared_memory_per_block());
EXPECT_EQ(t.shared_memory_per_core, d->shared_memory_per_core());
EXPECT_EQ(t.threads_per_core_limit, d->threads_per_core_limit());
EXPECT_EQ(t.core_count, d->core_count());
EXPECT_EQ(t.fpus_per_core, d->fpus_per_core());
EXPECT_EQ(t.block_dim_limit_x, d->block_dim_limit().x);
EXPECT_EQ(t.block_dim_limit_y, d->block_dim_limit().y);
EXPECT_EQ(t.block_dim_limit_z, d->block_dim_limit().z);
EXPECT_EQ(t.memory_bandwidth, d->memory_bandwidth());
EXPECT_EQ(t.l2_cache_size, d->l2_cache_size());
// Clock rate can vary between base and boost values.
EXPECT_LE(t.clock_rate_ghz, d->clock_rate_ghz());
} else if (name == "Quadro P1000") {
EXPECT_EQ(d->fpus_per_core(), 128);
EXPECT_EQ(d->l2_cache_size(), 1024 * 1024);
} else if (name == "Tesla P100-SXM2-16GB") {
EXPECT_EQ(d->fpus_per_core(), 64);
EXPECT_EQ(d->l2_cache_size(), 4 * 1024 * 1024);
} else {
VLOG(1) << "Not tested for " << name;
}
}
} // namespace
} // namespace gpu
} // namespace stream_executor
#endif // GOOGLE_CUDA
|
ef635bb62879801d4a02d4ee7ca2d414dbac1b2a | 09eaf2b22ad39d284eea42bad4756a39b34da8a2 | /ojs/ksp/brazil17/s01e04/br17truck/br17truck.cpp | 058755e0a8ff263e8cc9e8ae03c8047157f30568 | [] | no_license | victorsenam/treinos | 186b70c44b7e06c7c07a86cb6849636210c9fc61 | 72a920ce803a738e25b6fc87efa32b20415de5f5 | refs/heads/master | 2021-01-24T05:58:48.713217 | 2018-10-14T13:51:29 | 2018-10-14T13:51:29 | 41,270,007 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 851 | cpp | br17truck.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pii;
double dist[112];
const int M = 1123;
int a[M], b[M], c[M];
const double eps = 1e-11;
int main () {
int i, n, mm, k;
scanf("%d %d", &n, &mm);
for(i = 0; i < mm; i++)
scanf("%d %d %d", &a[i], &b[i], &c[i]), a[i]--, b[i]--, c[i] = -c[i];
double l = -1.1e6, r = 1.1e6;
for(int bb = 0; bb < 80; bb++) {
double m = (l + r) / 2.;
memset(dist, 0, sizeof dist);
for(k = 0; k < n; k++)
for(i = 0; i < mm; i++)
dist[b[i]] = min(dist[b[i]], dist[a[i]] + c[i] - m);
bool has = false;
for(i = 0; i < mm; i++)
if(dist[b[i]] > dist[a[i]] + c[i] - m + eps)
has = true;
if(has) r = m;
else l = m;
}
printf("%.20f\n", -l);
}
|
655232fb55fa541c47392d4b6195099c08959cea | bca5a1a1ba1f6f33392f38a02f6c84316d45de65 | /New Structure/src/strategy/pathfinding/PairWise/loader.h | b1a5729f59c403d9e9276537a6d4c2d4c0f4caa2 | [] | no_license | StpdFox/HU-TH78-Roborescue | 790a68728b0b4984b5146de7310820d33ebf9062 | 34302ee1f49fe38941fcc8edb3a90d512a8342b6 | refs/heads/master | 2021-05-29T18:50:37.230802 | 2015-04-22T12:46:06 | 2015-04-22T12:46:57 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 282 | h | loader.h | #ifndef LOADER_H
#define LOADER_H
#include <string>
#include <QString>
#include "map.h"
class Loader
{
public:
Loader();
~Loader();
Map getMap(QString);
private:
int lastX =0;
int lastY =0;
void processLine(QString);
Map product;
};
#endif // LOADER_H
|
ed0b55f8acdf29ff6f4cb203718ffd8f47a1c1ad | 2f250c8031394f145aef82556634b4559a63c02a | /oomact/src/test/SimpleModel.cpp | 8a7da2d3a0e844be2a5cd1e51bb20ab090f90909 | [
"BSD-2-Clause",
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | ethz-asl/oomact | 2defc0fec7b0f8dbe4bed2b9cd5a765e88f1d033 | cf8eade334cd6b35c9041b9ba1661e4a6bb85e02 | refs/heads/master | 2023-05-31T13:19:58.347201 | 2019-04-24T15:09:24 | 2019-04-24T15:09:24 | 79,255,946 | 22 | 12 | NOASSERTION | 2019-04-02T16:16:48 | 2017-01-17T18:04:34 | C++ | UTF-8 | C++ | false | false | 584 | cpp | SimpleModel.cpp | #include <aslam/calibration/test/SimpleModel.h>
#include <cmath>
#include <gtest/gtest.h>
#include <aslam/calibration/model/Model.h>
#include <sm/BoostPropertyTree.hpp>
#include <sm/value_store/ValueStore.hpp>
namespace aslam {
namespace calibration {
namespace test {
SimpleModel::SimpleModel(ValueStoreRef config, std::shared_ptr<ConfigPathResolver> configPathResolver)
: Model(config, configPathResolver),
config_(config),
sensorsConfig_(config.getChild("sensors")),
wheelOdometry_(*this, "WheelOdometry", sensorsConfig_)
{
addModule(wheelOdometry_);
}
}
}
}
|
1c93459958995ba6d86ca5c8a78f25201221e988 | c2b929ce308af8144b419d9b3f12a7cbe81e0cf1 | /Source/CommonUtilities/VectorOnStack.h | 41e614386c1d3b45d2e1dde90f7c9d5f975ba66c | [] | no_license | ebithril/AI | 8631b2fb1590251a6a250e14457da94a2c283a64 | 998170c54f501dd1cb26d3351cfe7ef133fd9afb | refs/heads/master | 2021-01-10T12:25:36.954599 | 2016-02-19T18:23:02 | 2016-02-19T18:23:02 | 52,106,954 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,151 | h | VectorOnStack.h | #pragma once
#include <assert.h>
#include <memory.h>
namespace CommonUtilities
{
namespace Containers
{
template <typename Type, int MaxSize, typename CountType = unsigned short, bool UseSafeModeFlag = true>
class VectorOnStack
{
public:
VectorOnStack();
VectorOnStack(const VectorOnStack& aVectorOnStack);
~VectorOnStack();
VectorOnStack& operator=(const VectorOnStack &aVectorOnStack);
inline const Type& operator[](const CountType &aIndex) const;
inline Type& operator[](const CountType &aIndex);
inline void Add(const Type& aObject);
inline void Insert(CountType aIndex, const Type &aObject);
inline void DeleteCyclic(const Type &aObject);
inline void DeleteCyclicAtIndex(CountType aItemNumber);
inline void RemoveCyclic(const Type &aObject);
inline void RemoveCyclicAtIndex(CountType aItemNumber);
inline void Clear();
inline void DeleteAll();
inline CountType Size() const;
private:
Type myArray[MaxSize];
CountType mySize;
};
}
}
namespace CommonUtilities
{
namespace Containers
{
template <typename Type, int MaxSize, typename CountType = unsigned short, bool UseSafeModeFlag = true>
VectorOnStack<Type, MaxSize, CountType, UseSafeModeFlag>::VectorOnStack()
{
mySize = 0;
}
template <typename Type, int MaxSize, typename CountType = unsigned short, bool UseSafeModeFlag = true>
VectorOnStack<Type, MaxSize, CountType, UseSafeModeFlag>::VectorOnStack(const VectorOnStack &aVectorOnStack)
{
*this = aVectorOnStack;
}
template <typename Type, int MaxSize, typename CountType = unsigned short, bool UseSafeModeFlag = true>
VectorOnStack<Type, MaxSize, CountType, UseSafeModeFlag>::~VectorOnStack()
{
}
template <typename Type, int MaxSize, typename CountType = unsigned short, bool UseSafeModeFlag = true>
VectorOnStack<Type, MaxSize, CountType, UseSafeModeFlag>& VectorOnStack<Type, MaxSize, CountType, UseSafeModeFlag>::operator= (const VectorOnStack &aVectorOnStack)
{
if (UseSafeModeFlag == true)
{
mySize = aVectorOnStack.Size();
for (int i = 0; i < aVectorOnStack.Size(); i++)
{
myArray[i] = aVectorOnStack.myArray[i];
}
}
else
{
memcpy(this, &aVectorOnStack, sizeof(aVectorOnStack));
}
return *this;
}
template <typename Type, int MaxSize, typename CountType = unsigned short, bool UseSafeModeFlag = true>
inline const Type& VectorOnStack<Type, MaxSize, CountType, UseSafeModeFlag>::operator[](const CountType &aIndex) const
{
assert(aIndex >= 0 && "Index less than zero");
assert(mySize > aIndex && "Subscript out of range.");
return myArray[aIndex];
}
template <typename Type, int MaxSize, typename CountType = unsigned short, bool UseSafeModeFlag = true>
inline Type& VectorOnStack<Type, MaxSize, CountType, UseSafeModeFlag>::operator[](const CountType &aIndex)
{
assert(aIndex >= 0 && "Index less than zero");
assert(mySize > aIndex && "Subscript out of range.");
return myArray[aIndex];
}
template <typename Type, int MaxSize, typename CountType = unsigned short, bool UseSafeModeFlag = true>
inline void VectorOnStack<Type, MaxSize, CountType, UseSafeModeFlag>::Add(const Type& aObject)
{
assert(MaxSize > mySize && "Vector is full");
myArray[mySize] = aObject;
++mySize;
}
template <typename Type, int MaxSize, typename CountType = unsigned short, bool UseSafeModeFlag = true>
inline void VectorOnStack<Type, MaxSize, CountType, UseSafeModeFlag>::Insert(CountType aIndex, const Type &aObject)
{
assert(MaxSize > mySize && "Vector is full.");
assert(aIndex >= 0 && "Index less than zero");
assert(mySize > aIndex && "Subscript out of range.");
for (CountType i = mySize - 1; i > aIndex; i--)
{
myArray[i] = myArray[i - 1];
}
myArray[aIndex] = aObject;
++mySize;
}
template <typename Type, int MaxSize, typename CountType = unsigned short, bool UseSafeModeFlag = true>
inline void VectorOnStack<Type, MaxSize, CountType, UseSafeModeFlag>::DeleteCyclic(const Type &aObject)
{
for (CountType i = 0; i < mySize; i++)
{
if (aObject == myArray[i])
{
--mySize;
delete[] myArray[i];
myArray[i] = myArray[mySize];
delete[] myArray[mySize];
return;
}
}
}
template <typename Type, int MaxSize, typename CountType = unsigned short, bool UseSafeModeFlag = true>
inline void VectorOnStack<Type, MaxSize, CountType, UseSafeModeFlag>::DeleteCyclicAtIndex(CountType aItemNumber)
{
assert(mySize > aItemNumber && "Index bigger than size.");
--mySize;
delete[] myArray[aItemNumber];
myArray[aItemNumber] = myArray[mySize];
delete[] myArray[mySize];
}
template <typename Type, int MaxSize, typename CountType = unsigned short, bool UseSafeModeFlag = true>
inline void VectorOnStack<Type, MaxSize, CountType, UseSafeModeFlag>::RemoveCyclic(const Type &aObject)
{
for (CountType i = 0; i < mySize; i++)
{
if (myArray[i] == aObject)
{
--mySize;
myArray[i] = myArray[mySize];
return;
}
}
}
template <typename Type, int MaxSize, typename CountType = unsigned short, bool UseSafeModeFlag = true>
inline void VectorOnStack<Type, MaxSize, CountType, UseSafeModeFlag>::RemoveCyclicAtIndex(CountType aItemNumber)
{
assert(mySize > aItemNumber && "Index bigger than size.");
--mySize;
myArray[aItemNumber] = myArray[mySize];
}
template <typename Type, int MaxSize, typename CountType = unsigned short, bool UseSafeModeFlag = true>
inline void VectorOnStack<Type, MaxSize, CountType, UseSafeModeFlag>::Clear()
{
mySize = 0;
}
template <typename Type, int MaxSize, typename CountType = unsigned short, bool UseSafeModeFlag = true>
inline void VectorOnStack<Type, MaxSize, CountType, UseSafeModeFlag>::DeleteAll()
{
for (CountType i = 0; i < mySize; i++)
{
delete[] myArray[i];
}
mySize = 0;
}
template <typename Type, int MaxSize, typename CountType = unsigned short, bool UseSafeModeFlag = true>
inline CountType VectorOnStack<Type, MaxSize, CountType, UseSafeModeFlag>::Size() const
{
return mySize;
}
}
} |
da52f3de6538787fe8e107892502c43bb5a93828 | 2f10f807d3307b83293a521da600c02623cdda82 | /deps/boost/win/debug/include/boost/compute/interop/qt/qpointf.hpp | a0b9da748e904c79e0020e44a3bcc2fb6f7d8d44 | [] | no_license | xpierrohk/dpt-rp1-cpp | 2ca4e377628363c3e9d41f88c8cbccc0fc2f1a1e | 643d053983fce3e6b099e2d3c9ab8387d0ea5a75 | refs/heads/master | 2021-05-23T08:19:48.823198 | 2019-07-26T17:35:28 | 2019-07-26T17:35:28 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 128 | hpp | qpointf.hpp | version https://git-lfs.github.com/spec/v1
oid sha256:09717d757ea57979a883e9d836b60e6442008d00d079a115f8556a7721cf8ea8
size 699
|
5221c18da197c1d8419fd5ac471a84a71bc14489 | b1fb55354f46a21831c8350c9cd66928a6ad9b05 | /八皇后.cpp | 91aa8dffd41734ae6d099a690d1bb386c5756392 | [] | no_license | LemuriaX/luogu | 8e3163b2c6aa6efdc6e8de0ac7665973b6020766 | 580955adb3fa2a698968c9342bbbd3cb83c7aaf7 | refs/heads/master | 2022-09-21T16:57:33.135957 | 2020-04-22T15:19:54 | 2020-04-22T15:19:54 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 717 | cpp | 八皇后.cpp | #include<bits/stdc++.h>
using namespace std;
int n;
bool lie[20] = {false};
bool zuoxie[200] = {false};
bool youxie[200] = {false};
int sum = 0;
int z = 0;
int vis[20];
void dfs(int hang){
if(hang>n){
if(z <3 ){
for(int i = 1;i<=n;i++)
cout << vis[i]<<" ";
cout << endl;
z++;
}
sum++;
return;
}
for(int i = 1;i<=n;i++){
if(!lie[i]&&!zuoxie[hang + i]&&!youxie[hang - i + n]){
lie[i] = true;
zuoxie[hang + i] = true;
youxie[hang - i + n] = true;
vis[hang] = i;
dfs(hang + 1);
vis[hang] = 0;
lie[i] = false;
zuoxie[hang + i] = false;
youxie[hang - i + n] = false;
}
}
}
int main(){
cin >> n;
int qipan[n+1][n+1] = {0};
dfs(1);
cout << sum;
return 0;
}
|
4de9be3e7c0aa7372b6d44e29ddcdd4424abe40c | 5aae14f6949e7178d7b153919b9af853fa740d2e | /Source/MythsAndLegends/Private/Items/BaseConsumable.cpp | e1dc4d26d5158229f94e04b47ad0a7a174b66bc6 | [] | no_license | SynGameDev/MythsAndLegends | cebae13a76298c587e54a61d51bb475cde510214 | 38c79ac2f1138446c42fec56c4c311f5f8ed1080 | refs/heads/master | 2023-02-11T08:17:40.473554 | 2020-12-29T14:24:21 | 2020-12-29T14:24:21 | 311,260,664 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,656 | cpp | BaseConsumable.cpp | // Fill out your copyright notice in the Description page of Project Settings.
#include "MythsAndLegends/Public/Items/BaseConsumable.h"
#include "MythsAndLegends/Public/Characters/SkillComponent.h"
ABaseConsumable::ABaseConsumable()
{
SpawnInWorld = true;
}
void ABaseConsumable::SpawnWeapon()
{
static const FString ContextString = "Consumable Table Context";
FString ConsumableID = "";
TArray<FName> ItemNames = ConsumableDataTable->GetRowNames();
if(SpawnItemID == "")
{
SpawnItemID = ItemNames[FMath::RandRange(0, ItemNames.Num() - 1)];
}
FConsumableDataTable* const ConsumableData = ConsumableDataTable->FindRow<FConsumableDataTable>(SpawnItemID, ContextString, true);
if(ConsumableData)
{
static const FString ItemDataContextString = "item Table Context";
FItemDataTable* ItemData = ItemDataTable->FindRow<FItemDataTable>(SpawnItemID, ItemDataContextString, true);
if(ItemData)
{
// --- BASE DETAILS --- //
ItemName = ItemData->ItemName;
ItemDescription = ItemData->ItemDescription;
ItemTier = ItemData->ItemTier;
ItemMesh->SetStaticMesh(ItemData->ItemMesh);
MeshOutline->SetStaticMesh(ItemData->ItemMesh);
MeshOutline->SetMaterial(0, ItemData->OutlineMaterial);
ItemImage = Cast<UImage>(ItemData->ItemIcon);
// --- CONSUMABLE DETAILS --- //
// General Details
ConsumingAnimation = ConsumableData->ConsumingAnimation;
ConsumableTypes = ConsumableData->ConsumableTypes;
// Health Details
IsHealthConsumable = ConsumableData->IsHealthConsumable;
HealthIncrement = ConsumableData->HealthIncrement;
DefenceIncrement = ConsumableData->DefenceIncrement;
}
}
}
void ABaseConsumable::SpawnWeapon(bool Spawn)
{
SpawnInWorld = Spawn;
SpawnWeapon();
}
void ABaseConsumable::SpawnWeapon(FName WeaponName)
{
SpawnItemID = WeaponName;
SpawnWeapon();
}
void ABaseConsumable::SpawnWeapon(FName WeaponName, bool Spawn)
{
SpawnInWorld = Spawn;
SpawnItemID = WeaponName;
SpawnWeapon();
}
void ABaseConsumable::BeginPlay()
{
Super::BeginPlay();
if(SpawnInWorld)
{
SpawnWeapon();
}
SetupCommonDetails();
}
void ABaseConsumable::UseItem(USkillComponent* const CharacterSkillComponent)
{
auto const ConsumableTypeLength = ConsumableTypes.Num();
for(int i = 0; i < ConsumableTypeLength; i++)
{
switch(ConsumableTypes[i])
{
case Health:
UseHealthPotion(CharacterSkillComponent);
break;
default:
break;
}
}
}
void ABaseConsumable::UseHealthPotion(USkillComponent* const CharacterSkillComponent)
{
if(!ConsumableTypes.Contains(Health))
return;
if(CharacterSkillComponent)
{
CharacterSkillComponent->AddHealth(HealthIncrement);
}
}
|
30558cf629e3ab90038734f199f5087996276dbb | 5a552d420ce16f986769dc36777e24e794438e58 | /reco/src/GlobalStatus.cpp | afb4dcb34e3195460f1b514c6a9d12efb11e8017 | [] | no_license | francisnewson/hnuprocess | 1379ff7f6bd1db0c17ebeb898b16977b43cc37e4 | 6139a1d7d2c6e2dd975eaf7e33f39525b888a4f6 | refs/heads/master | 2020-04-01T19:34:10.863826 | 2016-09-27T19:36:38 | 2016-09-27T19:36:38 | 30,983,514 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 691 | cpp | GlobalStatus.cpp | #include "GlobalStatus.hh"
#include "Event.hh"
namespace fn
{
FNEGStatus::FNEGStatus( const fne::Event * e, bool mc )
:e_( e ), mc_( mc )
{}
Long64_t FNEGStatus::get_run() const
{
return e_->header.run;
}
bool FNEGStatus::is_mc() const
{
return mc_;
}
GlobalStatus*& raw_global_status()
{
static GlobalStatus* gs = 0;
return gs;
}
GlobalStatus& global_status()
{
GlobalStatus * gs = raw_global_status();
if ( gs == 0 )
{ throw std::runtime_error(
"Attempt to access uniitialized global status" ); }
return * raw_global_status();
}
}
|
78e56354fe5e66242b033a0a5dc6417a20da6a26 | 0af4e95619ff9475c417ad0d29e14cb419744e54 | /Source/ProspectEngine/Renderer/Renderers/SunRenderer.h | 8b937b37cf925f7f05cf096b91b95e8a33e7c4d1 | [] | no_license | magnusmaynard/prospect-engine | ee85c8b16b495fa584d9e6c7d93d6a3eee62e98c | eb71eefc62b05705001f674021aeb6324033684f | refs/heads/master | 2023-04-05T03:47:26.425678 | 2018-10-18T18:05:20 | 2018-10-18T18:05:20 | 303,105,320 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,036 | h | SunRenderer.h | #pragma once
#include "Renderer/Pipeline/Shaders/Shader.h"
#include "Renderer/Uniforms/UniformBlocks.h"
#include "Renderer/Uniforms/UniformBuffer.h"
#include "Renderer/Pipeline/Shaders/SunShader.h"
#include "AtmosphereRenderer.h"
#include "RenderDataLibrary.h"
#include "Renderer/Renderers/RenderData.h"
namespace Prospect
{
class ShaderLibrary;
struct GlobalUniformBuffers;
struct SunRenderData : RenderData
{
GLuint PointsBuffer;
GLuint VAO;
glm::mat4 Translation;
std::vector<glm::vec3> Points;
float Radius;
float Distance;
};
class SunRenderer
{
public:
SunRenderer(ShaderLibrary& shaderLibrary, MaterialLibrary_impl& materialLibrary);
~SunRenderer();
void Render(const Atmosphere_impl& atmosphere);
private:
static void Initialise(SunRenderData& renderData);
static void Dispose(SunRenderData& renderData);
Material m_material;
SunShader& m_shader;
RenderDataLibrary<SunRenderData> m_renderDataLibrary;
};
}
|
8d6091b5ffa093b4b598a9342ded7787187c37b0 | 4c48f69e6d44eb413e30a464a6bbcb188f38ec08 | /include/scene.hh | 8d484e20786c4b64059632e8d010f91e54d88025 | [
"MIT"
] | permissive | baptisteesteban/OpenGL-Project-V2 | 983feb2384409dd454e42dfb03234b546bd74544 | e18fca7468c12c0fde77e56e7ce16ebae02833db | refs/heads/master | 2020-09-14T13:42:56.305236 | 2020-02-07T02:02:21 | 2020-02-07T02:02:21 | 223,144,540 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 712 | hh | scene.hh | #ifndef SCENE_HH
#define SCENE_HH
#include <camera.hh>
#include <dialog.hh>
#include <object.hh>
#include <memory>
#include <vector>
class Scene
{
public:
Scene(const Camera& cam, SDL_GLContext context, SDL_Window* window);
void addObject(std::shared_ptr<Object> obj) noexcept;
void draw();
void update(const SDL_Event& e);
private:
void updateCamera(const SDL_Event& e);
std::vector<std::shared_ptr<Object>> objs_;
Camera cam_;
mat4f projection_;
Dialog dialog_;
// For camera rotation
int prev_x_;
int prev_y_;
bool has_prev_;
};
#endif /* !SCENE_HH */
|
8b32ad8a79745c749cd8d5555ea42ac1ef40060f | a69413120ddb0b512fde5ab251e59a55d82101e0 | /sort0and1.cpp | ccde589baccc79e1ba0e3074660edafa40b500e0 | [] | no_license | Nikhil12321/codes | 7b0f62b7410ea78e3480e3414e747d2597e6f82f | 3ee73c3e2626c5d1271cb984b8fa102afeb5ad42 | refs/heads/master | 2021-01-21T04:30:54.378318 | 2017-06-29T18:08:10 | 2017-06-29T18:08:10 | 47,780,683 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 419 | cpp | sort0and1.cpp | #include<iostream>
using namespace std;
int main(){
int a[]={1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0};
int n = sizeof(a)/sizeof(int);
int ptr1=0,ptr2=1, temp;
while(ptr2<n && ptr1<n){
while(a[ptr1]==0 && ptr1<n)
ptr1++;
while(a[ptr2]==1 && ptr1<n)
ptr2++;
if(ptr2<n && ptr1<n){
temp = a[ptr1];
a[ptr1] = a[ptr2];
a[ptr2] = temp;
}
}
for(int i=0;i<n;i++)
cout<<a[i];
} |
9ac63cb6941254d1687bb8bdc0748615722213f3 | e20ebc8bac4ebdf59c6960cb73e5a83bc2e696df | /CS216/project4/term.h | 16a7a68e3700bd1889593cb3ad943773afcfa267 | [] | no_license | darin-ellis7/University-Projects | c6620ddd0da94b6e24040600153ddf94fbaa8d61 | db0958f520d26ab37694f5240a2cd0687fd7cc63 | refs/heads/master | 2020-04-01T21:15:14.313808 | 2018-10-18T15:12:55 | 2018-10-18T15:12:55 | 153,646,062 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 903 | h | term.h | #ifndef TERM_H
#define TERM_H
using namespace std;
class term
{
public:
// default constructor
term();
// initialize with the given query string and weight
term(string q, long w);
// compares two terms in descending order by weight
static int byReverseWeightOrder(term that, term other);
// compares two terms in lexicographic order by query
static int compareTo(term that, term other);
// compares two terms in lexicographic order but using only
// the first r characters of each query
static int byPrefixOrder(term that, int r);
// displays the term in the following format:
// the weight, followed by a tab key, followed by the query
void print();
// other member functions you need…
// accessor method for weight
long getWeight();
// accessor method for word
string getWord();
friend class autocomplete;
private:
string query;
long weight;
};
#endif
|
97be1f7f570821d59c19991b12c06953e9a01d6f | 10af7cddaadb4a222cc8c1ff137205e866e06a41 | /Lecture Notes/L4andL5.cpp | a3ccd7baad8d2ddf751838a7793e95540b53f17c | [] | no_license | nickirichter/CSCI2270 | a6e3e6991bd458870ead7af80290e65219882740 | 8a7bd4535b01ca3dd1dae6a7c28db7655ea1b0d3 | refs/heads/master | 2020-03-24T01:33:29.643733 | 2018-07-25T19:21:20 | 2018-07-25T19:21:20 | 142,341,550 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,916 | cpp | L4andL5.cpp | //Jan. 24 2018
//Number Bases and Pointers
#include <iostream>
using namespace std;
void passByvalue(int a)
{
a++;
}
void passBypointer(int *ptr)
{
cout<<ptr<<" address stored in ptr"<<endl;
*ptr=*ptr+1;
}
void passByReference(int &a)
{
//input is reference/address of a
a++;
}
void passByArray(int *a) //could also define using passByArray(a[])
{
a[0]=10;
a[1]=11;
}
int main()
{
int a=5; //regular variable
//cout<<&a<<endl;
int *b=&a; //b is pointer to memory address of a
//cout<<&b<<", "<<b<<", "<<*b<<endl; //print what is stored in b
//*b=dereference operator- go to b, get address stored in b
//then get value is stored at the address b is pointing to
//* used to declare pointers, also used for dereferencing the pointer
//& means address of
//pointer and address it points to have to be same type
a=10;
//what is value of *b?
//cout<<&b<<", "<<b<<", "<<*b<<endl; //print what is stored in b, by dereferencing b, get new value of a
int c=20;
b=&c; //change address stored in b to the address of c
//b now points to c
//cout<<*b<<", "<<endl; //prints 20
int arrayA[5];
//cout<<arrayA<<endl; //address of first element of array A
//functions
passByvalue(a); //makes copy of variable
//cout<<a<<endl; //prints 10, a unchanged
//cout<<b<<" address stored in b"<<endl;
passBypointer(b); //updates the value at the address stored in b
cout<<*b<<endl;
/*
//pass by reference
passByReference(a); //is regular variable, NOT pointer
cout<<a<<endl;
for(int i=0; i<5; i++)
{
arrayA[i]=0;
}
passByArray(arrayA);
for(int i=0; i<5; i++)
{
cout<<arrayA[i]<<endl;
}
//Stack: finite amount of memory used to control program execution
//local variables are stored here
//Pros:fast, memory management done for you
//Cons: relatively small, allocating large amounts of memory during execution can crash stack
//Heap: large pool of memory (much larger than stack)
//for large data structures that we want to allocate during run time
//use dynamic memory allocation
//dynamically allocate an array
//new used to allocate memory on the heap
//must use pointer to access heap memory
//y is pointer to array of 10 ints (y is stack variable pointing to array on heap)
int *y = new int[10];
double *x= new double[20]; //array of 20 doubles
//for every new we need to have a delete
delete y; //frees memory allocated to y
delete x; //frees memory allocated to x
int *x2= new int;
*x2=5;
y=x2; //y now points to same address as x2
cout<<*y<<endl;
//x=x2; //doesn't work because double can't point to an integer (must be same type)
//program can slow down
int *x3=new int[100]; //x3 points to array of 100 ints
x3[0]=100;
x3[10]=200;
x3=x2;
//how do I get data out of x3?
//I can't get back to x3 because it now points to same address of x2
//array of 100 ints in memory that can't be accessed
//memory leak
*/
}
|
50d849c9cd3757167350f05b8cd0e4b6a50ad51c | feb35ca6518e988edc42e946d361b2bb26703050 | /earth_enterprise/src/third_party/sgl/v0_8_6/src/SkGlobals.cpp | fb1c9482d45187a1e6734f49857061183857446d | [
"Apache-2.0"
] | permissive | tst-ccamp/earthenterprise | ccaadcf23d16aece6f8f8e55f0ca7e43a5b022fe | f7ea83f769485d9c28021b951fec8f15f641b16c | refs/heads/master | 2021-07-11T07:10:57.701571 | 2021-02-03T22:03:13 | 2021-02-03T22:03:13 | 86,094,101 | 2 | 0 | Apache-2.0 | 2021-02-03T22:10:41 | 2017-03-24T17:29:52 | C++ | UTF-8 | C++ | false | false | 2,174 | cpp | SkGlobals.cpp | /* libs/graphics/sgl/SkGlobals.cpp
**
** Copyright 2006, Google Inc.
**
** 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 "SkGlobals.h"
#include "SkThread.h"
SkGlobals::Rec::~Rec()
{
}
SkGlobals::Rec* SkGlobals::Find(uint32_t tag, Rec* (*create_proc)())
{
SkGlobals::BootStrap& bootstrap = SkGlobals::GetBootStrap();
Rec* rec = bootstrap.fHead;
while (rec)
{
if (rec->fTag == tag)
return rec;
rec = rec->fNext;
}
if (create_proc == NULL) // no create proc, just return not found
return NULL;
// if we get here, we may need to create one. First grab the mutex, and
// search again, creating one if its not found the 2nd time.
bootstrap.fMutex.acquire();
// search again, now that we have the mutex. Odds are it won't be there, but we check again
// just in case it was added by another thread before we grabbed the mutex
Rec*& head = bootstrap.fHead;
rec = head;
while (rec)
{
if (rec->fTag == tag)
break;
rec = rec->fNext;
}
if (rec == NULL && (rec = create_proc()) != NULL)
{
rec->fTag = tag;
rec->fNext = head;
bootstrap.fHead = rec;
}
bootstrap.fMutex.release();
return rec;
}
void SkGlobals::Init()
{
}
void SkGlobals::Term()
{
SkGlobals::BootStrap& bootstrap = SkGlobals::GetBootStrap();
bootstrap.fMutex.acquire();
Rec*& head = bootstrap.fHead;
Rec* rec = head;
while (rec)
{
Rec* next = rec->fNext;
SkDELETE(rec);
rec = next;
}
bootstrap.fHead = NULL;
bootstrap.fMutex.release();
}
|
5315a698558f0f31c505f74655370d2b4cdc3451 | 189f52bf5454e724d5acc97a2fa000ea54d0e102 | /ras/floatingObject/2.6/epsilon | b7df405c0b6df08d6bf317949c84fed0123e4336 | [] | no_license | pyotr777/openfoam_samples | 5399721dd2ef57545ffce68215d09c49ebfe749d | 79c70ac5795decff086dd16637d2d063fde6ed0d | refs/heads/master | 2021-01-12T16:52:18.126648 | 2016-11-05T08:30:29 | 2016-11-05T08:30:29 | 71,456,654 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 248,436 | epsilon | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1606+ |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "2.6";
object epsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -3 0 0 0 0];
internalField nonuniform List<scalar>
11640
(
0.000874132810429
0.00106650804108
0.00119501005546
0.00126497758497
0.00129766316899
0.00130750673358
0.00130261830658
0.00129038662001
0.00127690203153
0.00126207318913
0.00124666733115
0.00123290707938
0.001229909329
0.00123306830013
0.00123764590967
0.00123520636792
0.00121104295295
0.00114811676145
0.00102836380152
0.000849642464515
0.00106843108845
0.00212762547368
0.00278691280453
0.00316532686857
0.00336823973068
0.0034526311479
0.00345534902407
0.00341150939207
0.00335928609841
0.00330910609724
0.00326227755444
0.00325931909445
0.00328880415785
0.00331619311413
0.00331020487446
0.00323488487995
0.0030526087498
0.0026959430926
0.0020552171686
0.00102781529655
0.00119846208372
0.0027936461052
0.00384231957948
0.00449850305893
0.00486124291303
0.0049843251135
0.00493700273983
0.00480891855938
0.00467711348864
0.00455903092771
0.00447839035612
0.00452305136109
0.00459958306612
0.00468258849764
0.00471667432037
0.00461940725546
0.00430706933145
0.00370438419651
0.00269843195678
0.00114495389879
0.00127010444789
0.00318541467444
0.00452560855901
0.00539028339877
0.00583094565004
0.00590588270208
0.00572892286489
0.00545104328094
0.00519860406009
0.00498789706186
0.00488995591904
0.00498453248757
0.00513504851133
0.00532219945482
0.00545987787203
0.00541862491053
0.00507629403693
0.0043243944087
0.00306536227919
0.00120656883914
0.00130884950985
0.00341404634788
0.00494721426061
0.00591635844146
0.00632964026343
0.00624480018165
0.00583389847724
0.00534611168446
0.00496534929618
0.00467723829398
0.00459893622256
0.00473865889413
0.00497741083303
0.00532811512471
0.0056517285512
0.00575011250507
0.00546411480613
0.00466842309144
0.00327176539474
0.00123713570947
0.00133062116991
0.00352718805246
0.00514822459611
0.00611776400099
0.00639602788917
0.00603615631609
0.00527841152076
0.00452683454849
0.00404901764957
0.00373035749146
0.00365923912931
0.00381156741499
0.00414325629908
0.0047592654047
0.00539381186823
0.00572703363236
0.00557027786167
0.00481077242872
0.00337152441636
0.00125725795438
0.00133579800465
0.00354747205192
0.00516610058203
0.00605931992312
0.00613216854424
0.00541167167485
0.00417682145404
0.00311622020628
0.00261723465609
0.00236513573494
0.00238395788081
0.00251122447716
0.00287508596055
0.00377900531107
0.0048310683674
0.00547157886388
0.00549378462387
0.00481652795355
0.00339632821047
0.00126923880482
0.00132721376413
0.00351166253091
0.00508904470127
0.00589201516163
0.0057904796377
0.00478579627446
0.00317985091138
0.00207794334041
0.00166835263486
0.00151176568299
0.00148158835675
0.00155583445285
0.00187623377798
0.00286216997031
0.00425221424315
0.00516953906246
0.00535415802935
0.00476073242757
0.00337917673547
0.00127368504306
0.00131439187937
0.00347109702094
0.00501468647162
0.00576068346281
0.00556719800243
0.00444598246411
0.00275589410509
0.00168880747314
0.0013119834232
0.00119174523337
0.00116704644561
0.00122754845821
0.00152567875377
0.00246652375757
0.00395925668124
0.00499386828165
0.00526571712443
0.00471994837491
0.00336332838834
0.00127653729043
0.0013035807733
0.00345246309514
0.00499391384199
0.00573702705699
0.00553669239672
0.00440042819669
0.00269508256017
0.00162447783205
0.00125866139421
0.00114758556971
0.00112497912587
0.00118778013524
0.00149152769666
0.00244396458852
0.00396400769213
0.0050142318931
0.00528660397242
0.00473411461989
0.00336998843232
0.00128103733919
0.00129667676262
0.0034617749196
0.00503709301174
0.00583623097523
0.00571672708744
0.0046687996879
0.00299959192597
0.0018564979556
0.00147208444997
0.00134529499524
0.00132393266971
0.00140430874911
0.00174106405745
0.00277876894043
0.00427652779487
0.00524198927317
0.00543421910882
0.00481797449754
0.00340647349021
0.00128875930017
0.00128999281984
0.00348129820747
0.00510967845752
0.006014182758
0.0060830673035
0.00532319090057
0.00398301195835
0.00285477726453
0.00239589786947
0.00219566244157
0.00209932704906
0.0022795634943
0.00273880930326
0.00380012821122
0.00499223510225
0.0056900893436
0.00569289560099
0.00495321219151
0.00346180040026
0.00129595398838
0.00128014949307
0.00347999929395
0.0051438184801
0.00615675287197
0.00644842452574
0.00605052323992
0.00519055373031
0.00435473573779
0.00388367705157
0.0036303787299
0.00360719291723
0.00388713393407
0.00436342603163
0.00512953384063
0.00587260803605
0.00621122353664
0.00597729158685
0.00508887917308
0.00350987743169
0.0012972983473
0.00126903668736
0.00344823939307
0.00509819520675
0.00618223650679
0.0066758306566
0.00662141234393
0.00619371344987
0.00569351607962
0.00533675151307
0.00511283404709
0.00510608047079
0.00538853553716
0.00576600837134
0.00622728688424
0.00658629987036
0.00662124926765
0.00617807276634
0.00516417948886
0.00353177181846
0.00129366974156
0.0012625865256
0.00339464714771
0.00496112139913
0.00603609049461
0.00664186560828
0.00682086968108
0.0066922306515
0.00644256794305
0.00622645329196
0.00608036322668
0.00610952942231
0.00632469672466
0.00657647503053
0.00682373622796
0.00694062576353
0.0067708816113
0.00619608172326
0.00513327954402
0.00351563286332
0.00128909840088
0.00124893617198
0.00330566092279
0.00473882185161
0.00570775440536
0.00631464939639
0.00660426509809
0.00665336358508
0.00657932161705
0.00648944040285
0.00643163404432
0.00648126638618
0.0066180278373
0.00676260838603
0.00687165909396
0.00684609166638
0.00657680610959
0.00597626520623
0.00496790783601
0.0034361565364
0.00127643874379
0.00121476470159
0.00310786123896
0.00439527409982
0.00519838052905
0.00570489233856
0.00598677881198
0.0061022938951
0.00612259026661
0.00611638324228
0.00611709055736
0.00617195302322
0.00624447038109
0.00631468699108
0.00634717831231
0.00627114226922
0.00600823746156
0.00548618527433
0.00460917559577
0.00323215413338
0.00124211304125
0.00114605992055
0.00272072513203
0.00377157256776
0.00441935192871
0.00479514403636
0.00499670191269
0.00509526763039
0.00513949287364
0.00516307908778
0.00518519963139
0.00521263628669
0.00524845472318
0.00528293939968
0.00529035732708
0.00522597522669
0.00503023913631
0.0046341375778
0.00394109526377
0.00282108463737
0.00116958959193
0.0010242692051
0.00205838585077
0.00272628212998
0.00312666362087
0.00335455630435
0.00347403912022
0.00353214556362
0.00355809512843
0.00356967806921
0.00357961921585
0.00359262546281
0.00361101036857
0.00363012623241
0.00363568564328
0.00360257269007
0.0034934392656
0.0032567315351
0.00282820782206
0.00211835210703
0.00104033480083
0.000845455520374
0.00102589776117
0.00114814055902
0.00121788253692
0.00125509632856
0.00127283914016
0.00128133518061
0.00128683111061
0.00129103918508
0.00129560791803
0.00130047830043
0.00130515877953
0.00130963844689
0.00131065456334
0.00130597514448
0.00128887018014
0.00124932011543
0.00117367875934
0.0010426410784
0.000853446739274
0.00117241327464
0.00170252228965
0.00206779856909
0.0022730000365
0.00236935617653
0.00240157897917
0.0024060256451
0.00240313841765
0.00240235838152
0.00240315743072
0.00240208273971
0.00239550465506
0.00238933885219
0.00238642129591
0.00237634787682
0.00234287886095
0.002250010374
0.00204591808747
0.00168345576393
0.00116436665483
0.00170618926455
0.00219938481627
0.0026507588015
0.00291857295579
0.00305030368986
0.00309541831481
0.00309430176927
0.00307198432925
0.00304762403031
0.00302846259757
0.00301582856539
0.0030158447144
0.00302918132846
0.00304305386732
0.00304010928788
0.00299170563054
0.00286085051398
0.00259919452143
0.00216039958683
0.00169016630148
0.00207709640227
0.00265422301169
0.00322307900916
0.00358369358604
0.003770365985
0.00382893823997
0.00379906414324
0.00373385468314
0.00367099698973
0.00362164216734
0.00359296333659
0.00360631163145
0.0036421978248
0.00368476665215
0.00370540363114
0.00365858877408
0.00349140449498
0.00315174434484
0.00260789605124
0.00205730414609
0.00228195434807
0.0029298848453
0.00360011265199
0.00404036944212
0.00425799210414
0.00428322807318
0.00418798189073
0.00405240568561
0.00393368848527
0.00384667133102
0.00380908628315
0.00384306404328
0.00391739403313
0.00401180360977
0.00408305318332
0.0040660078002
0.00389307502415
0.00350623202053
0.00288131150663
0.0022607442573
0.00237163586674
0.0030735769602
0.00381825603501
0.00430254555306
0.00450132337648
0.00444976610978
0.00424599270366
0.00401354872035
0.00383043977375
0.00371050212483
0.00367524872908
0.00373363582317
0.00386239833312
0.00403964009911
0.00419896776563
0.00424625752729
0.00409988251899
0.00369883869065
0.0030259130527
0.0023488299376
0.00239139368791
0.0031277101946
0.00390951981438
0.00439283536292
0.00452455240309
0.00434104453513
0.00397364667357
0.00361590514727
0.00336710148329
0.00322920133377
0.00320004635609
0.0032797070351
0.00348432604783
0.00379127945791
0.00409477224842
0.00424920957825
0.00416148986481
0.00377597981574
0.00308533995927
0.00237033882721
0.00237802157189
0.00312491826445
0.00390642812026
0.00435140682575
0.00438089978968
0.00401571841757
0.00340367139798
0.00285262801879
0.00253169860908
0.00241901049306
0.00241972105087
0.00251840667701
0.00283872995982
0.00331361611163
0.00383109869888
0.00413299364409
0.00412839851517
0.00377930847547
0.00309385030439
0.00236243886446
0.00235654212666
0.00309628447181
0.00385808695616
0.00425513682898
0.00419178754212
0.00366778682885
0.00280770804719
0.00208848335545
0.00174254096855
0.00166996668028
0.00167416893844
0.0017502522572
0.00212735011108
0.00281291593428
0.0035335844241
0.00397910297715
0.00405722919287
0.00374918934554
0.00307953639243
0.00234784985193
0.00234030795457
0.00306976906308
0.00381446404914
0.00417930565208
0.00405864476512
0.00344093396372
0.0024486512307
0.00166596838074
0.00132209417028
0.00125970168439
0.00125620883351
0.00131068441721
0.00166098409233
0.00243764161276
0.00332579172331
0.00387179400663
0.00400572419559
0.00372516671563
0.0030670771061
0.00233911008666
0.00233532233352
0.00306094477409
0.00380418898342
0.0041668374602
0.00404057492477
0.00341079967721
0.0023996364258
0.00160378079963
0.00126009587674
0.00119701278402
0.00119153506711
0.00123951139205
0.00158927742782
0.00238989607784
0.00330909359919
0.00387260301686
0.00401306854872
0.00373193074657
0.00307008738618
0.00233920931719
0.00234536995503
0.0030736064916
0.00383339995697
0.00422721909398
0.00415049158421
0.00359495109461
0.00268105162356
0.00190682136949
0.00155321107172
0.00148449743467
0.00148434889848
0.00154510265872
0.00192439861185
0.00270427579511
0.00350812234554
0.00399887108701
0.00409197504788
0.00377806035094
0.00309361542026
0.00235170539208
0.00236915763808
0.00310140870574
0.00388781802919
0.00433892861292
0.00436231364892
0.00396443539758
0.00327960616621
0.00264095550926
0.00230434029639
0.00221307584106
0.0022120141356
0.00231629380168
0.00268436410761
0.00328174798732
0.00388406663666
0.00423188171758
0.00423035461982
0.00385546349289
0.00313340469624
0.00237690539083
0.0024034648036
0.00313041233139
0.00393585628744
0.00444744546135
0.00459115163904
0.00438447994315
0.00395591663051
0.00354375441524
0.00328735967174
0.00318590646388
0.00319768085029
0.0033368204304
0.00360829944818
0.00397819075834
0.00433620927806
0.00450445146225
0.00438521681956
0.00393746029635
0.0031756772926
0.00241073942093
0.00243498902333
0.00314672066608
0.00394966686156
0.00450187130776
0.00475471746096
0.00472567752362
0.0045138833155
0.00427286510047
0.00409873883946
0.00401161049402
0.00402553504496
0.00414468796303
0.00432618201654
0.00454021122661
0.00471048364444
0.00472450279214
0.00449911804951
0.00398873737762
0.00320208144411
0.00244272721309
0.00244314175342
0.00313496654129
0.00390982339793
0.00446396368512
0.00478026757281
0.0048758292194
0.00481550995124
0.00469857999586
0.00459871132387
0.00454503166929
0.00456539036806
0.00465099916793
0.00476043573711
0.00486567576578
0.00490940538416
0.00481448698907
0.00451657703236
0.00397644631923
0.00319181677041
0.00245239319919
0.00240175379617
0.00307268354055
0.00380008314411
0.00431566937674
0.00463780872622
0.00479319483722
0.0048248829515
0.00479417830232
0.00475548306722
0.00473731213297
0.00476034510643
0.00481247051698
0.00486852868391
0.00490319575351
0.0048714032976
0.00471968694729
0.0044000790356
0.00387218096409
0.0031201403278
0.00241178068674
0.00228615684407
0.00291968080958
0.00359014740401
0.00404388425117
0.00432692252994
0.00448248340485
0.00454705153016
0.00456074463992
0.00455970919092
0.00456388718654
0.00458420849761
0.00461117831834
0.00463447397923
0.00463396301031
0.00457572797232
0.00441949209413
0.00412365233837
0.0036437591836
0.0029533878866
0.00229181620597
0.0020622854168
0.00263154190625
0.00321666714254
0.00360458003721
0.0038364853877
0.00396234703592
0.00402233941355
0.0040470377521
0.00405802709959
0.0040668970721
0.00407765889075
0.00409015465283
0.0040981777826
0.00408714426865
0.00403238399469
0.00390139601863
0.00365496372748
0.00324808583177
0.00264951387899
0.00205979749662
0.00168845258571
0.00217353869268
0.00264163633527
0.00294266343362
0.00311824623405
0.00321181114546
0.00325665089702
0.00327564788393
0.00328316761066
0.00328750805508
0.0032919243901
0.00329724475529
0.00329947536361
0.00328879705
0.00324812183891
0.00315222152707
0.00296734486864
0.00265341434237
0.00217596316689
0.00167734223839
0.00116267250868
0.00169661846203
0.00207954627815
0.00231423217105
0.00244875056442
0.00252100029095
0.00255664390003
0.00257239093255
0.00257751152502
0.00257809158323
0.00257772087623
0.00257556372708
0.00257120761153
0.00255698154734
0.00252215650508
0.00244761977007
0.00230770496011
0.00206685733848
0.00168094421064
0.00115518080518
0.00141203847344
0.00226412293236
0.00286636774216
0.00321449685597
0.00338555132113
0.0034476086422
0.00345634073822
0.00344667601574
0.00343641660145
0.00343103528528
0.00342877883476
0.00342908712627
0.00343587390178
0.00344142236064
0.0034234385549
0.00335373393264
0.00318389831739
0.00283577153181
0.0022370234574
0.00139596877954
0.0022678933072
0.00257674549937
0.00302548398001
0.00330728326752
0.00344952411964
0.0035006537858
0.00350430510879
0.00348743521016
0.00346876524127
0.0034570483615
0.00345460831442
0.00346128822572
0.00347812016824
0.00349394496419
0.0034887434008
0.00343159864773
0.00328295749556
0.00299880739106
0.00255731996829
0.00224757062933
0.00287740750054
0.00302691694338
0.00348351310883
0.00378607579896
0.00394085344913
0.00399103348338
0.0039743828552
0.00393382120362
0.00389501210605
0.00386969830224
0.00386251946459
0.00387797273513
0.00391277178886
0.00395132593272
0.00396729674175
0.00391983468464
0.0037625355636
0.00345679754147
0.00301059677297
0.00285858991774
0.0032259096935
0.00331208945382
0.00379377519777
0.00411886063857
0.00427682737904
0.00429844917214
0.00424111537125
0.00416034866451
0.0040885025815
0.00404383975127
0.0040332527571
0.0040667139995
0.00413415875476
0.00421317076473
0.00426938512049
0.00424894126836
0.00409657343895
0.00377458243335
0.0033053501807
0.00321120693314
0.00338809001288
0.00345735261953
0.00396096167521
0.00429473934913
0.00442975677139
0.00440106424188
0.00427972740777
0.00414362199139
0.00402300470842
0.00395407883312
0.00394351276535
0.00400043728375
0.00411846349836
0.00425590528506
0.00437651957119
0.00440596535342
0.00427763227862
0.00395315155027
0.00346472382059
0.00337831861366
0.00343291576208
0.00350667942011
0.00401918165465
0.00434084526108
0.00442860769289
0.00431992899689
0.00410719388167
0.00390857179063
0.00370186125483
0.00360234814463
0.00359474572087
0.00368615129068
0.00390026022461
0.00410055750899
0.00431451746627
0.00442064488588
0.00433725898362
0.00402711844247
0.00353041196801
0.00342998721145
0.00341941317922
0.00350108235473
0.00400747739564
0.00429943624042
0.00432259293785
0.0041118974069
0.00378602125131
0.00352921022176
0.00308898384958
0.00300509519893
0.00305881123313
0.00323931532045
0.00378542593209
0.00381181679589
0.00413397450274
0.00433821106938
0.0043156488406
0.00403345402158
0.00354057123327
0.00342465374168
0.00338974043422
0.00347493476944
0.00396729429573
0.00422548741433
0.00418942132022
0.00389880738693
0.00349158695659
0.0036941229715
0.00270809529238
0.00259115383564
0.00258859774568
0.00273190459351
0.00393715284795
0.00374254135845
0.00394254250414
0.00422363950169
0.00426097105954
0.00401010343316
0.00352750332052
0.00340239413965
0.00336609799784
0.00345327625042
0.00393480057701
0.00416886740234
0.00408372190507
0.00368171640735
0.00295748668147
0.00248243853467
0.00156130154384
0.00141096838949
0.00139930805595
0.00151546179868
0.00251705890631
0.00316401730717
0.00373833746677
0.00413272979843
0.00422093634727
0.00399260182217
0.00351716908414
0.00338805928245
0.00336341400436
0.00345017656345
0.00393168494104
0.00416495461529
0.0040759737239
0.00366337288051
0.00291291276493
0.00239162863777
0.0014859253975
0.00133254198583
0.00131044272402
0.00141113830968
0.00239711294102
0.00312027654386
0.00373441566097
0.00414322863071
0.00423567865018
0.004005213856
0.0035246297301
0.00339164241478
0.00338601380138
0.00346977750443
0.00396349593647
0.00422142659283
0.00417781814097
0.00386660494376
0.00339204731884
0.00324521326537
0.00226419402198
0.00213067671305
0.00213617489803
0.00224945534281
0.00337218914638
0.00370522705206
0.00397047645345
0.00427435567877
0.0043171068469
0.00405588375919
0.00355519152595
0.00341812427562
0.00343177437075
0.00350810238437
0.00402162554949
0.0043204740155
0.00434202796691
0.0041176679016
0.00376747137545
0.00342048961175
0.00291395489225
0.00282470865541
0.00286202109745
0.00302349588599
0.00364819260875
0.00392237482871
0.00425634679413
0.0044762417254
0.00444631269754
0.00413500839803
0.00360416380372
0.00346631557817
0.00348983391432
0.00355400193324
0.00408703414727
0.00443279989155
0.0045348206355
0.00442288786924
0.00419575944547
0.00398922224437
0.0037657155037
0.00369771817267
0.00373502405976
0.00388334840557
0.00416340878339
0.00437656842989
0.00460369803275
0.00470516927841
0.00458610864228
0.00421727140413
0.00365612910466
0.00352481648834
0.00353808516127
0.00358877328
0.00413367260925
0.00451838957882
0.00469698882899
0.00469516884526
0.00458644982303
0.00446206890928
0.00435469620434
0.00431861583889
0.00435733119403
0.00446552113914
0.00462589128449
0.00477915833048
0.00489485767491
0.00488662014074
0.00468646353877
0.00426893106655
0.00368925699965
0.00357180031138
0.00354252355995
0.00358646450381
0.00413165975136
0.00453597149203
0.00476710992123
0.0048479784916
0.00483089051002
0.00477940836885
0.00473451384659
0.00472506440858
0.00476325770777
0.00483977214323
0.00493544126257
0.0050183476167
0.00504524842826
0.00495535657075
0.00469898783458
0.00425729399889
0.00367739421323
0.0035718937112
0.00346300287115
0.0035170485255
0.00405094075065
0.00445174102675
0.00470202278389
0.00482806235068
0.00486888491473
0.00486806747689
0.00486062766481
0.00486829695342
0.00490121535533
0.00495060145572
0.0050023503429
0.00503183805455
0.00500125734855
0.00486669356121
0.00459133794798
0.00415466829802
0.00359204899753
0.00348412348983
0.00325908354464
0.00334509571664
0.00385853836492
0.00423947992725
0.00448032114663
0.00461500615956
0.00467769054319
0.0047010911634
0.00471209163127
0.00472710556599
0.0047505745272
0.00477923890796
0.00480335640678
0.0048034909918
0.00474978792684
0.00460774828127
0.00434438427229
0.0039343043671
0.00340017125811
0.00326433535928
0.00287780686887
0.00303506199054
0.00352122353425
0.00387353178631
0.0040940217948
0.00421822565582
0.00428073159434
0.0043095240122
0.00432445442335
0.00433707861353
0.00435166425536
0.00436725508015
0.00437685110796
0.00436558627695
0.00431011101583
0.00418060055005
0.0039438122592
0.00356940875442
0.00306631726995
0.00286343136511
0.00225563422596
0.00257444269232
0.00304941136909
0.00337547529387
0.00357406766761
0.00368450755477
0.00374036313993
0.00376633677541
0.00377859829121
0.00378657788699
0.00379440899114
0.00380193905496
0.00380417656355
0.00378934532559
0.00373835232779
0.00362415341184
0.00341306480022
0.00306930239503
0.00258014194042
0.00222734024776
0.0013978371608
0.00226623814505
0.00290558224014
0.0033067968281
0.00354458768212
0.00367605096713
0.00374252155861
0.00377268113614
0.00378427829801
0.00378783118298
0.00378828171225
0.0037854697971
0.00377562022606
0.00374634364507
0.00367741744911
0.00353781205671
0.00328717510272
0.00287283666016
0.00223180271053
0.00138763475754
0.00154565597084
0.00264860159787
0.0034432276529
0.00391265299767
0.0041509822511
0.00424023999737
0.00425006393413
0.00422911831659
0.00420550973547
0.00419060100135
0.0041865724337
0.0041933146182
0.00421505948946
0.00423246358439
0.00421076542565
0.00410958555377
0.00387090513273
0.00340174169583
0.00261193217246
0.00152177745843
0.00265224722857
0.00290242426461
0.00338155728518
0.00369391795606
0.00385711897491
0.00391857861919
0.00392405739636
0.00390530158323
0.00388377346282
0.003871007415
0.00387081674496
0.00388207733303
0.00390302664071
0.0039214415058
0.00391378001492
0.00384582891065
0.00367542966033
0.00335911299466
0.00288697983804
0.00262635632499
0.00345522416717
0.00338150493984
0.00379991216738
0.00409217751244
0.0042458092218
0.00429857210818
0.00428784524969
0.00425273601796
0.00421716191819
0.00419565853251
0.00419362957926
0.00421075709908
0.00424529630715
0.0042807576375
0.00429188814391
0.00423968352999
0.00408029373271
0.00378184194506
0.00337372489828
0.00343596598183
0.00392540022761
0.00369500431948
0.00409624477021
0.00438350879985
0.00452737407339
0.00455422756714
0.00451289454771
0.00444921395045
0.0043865458386
0.00434977542997
0.00434641450427
0.00437911167815
0.00444274041731
0.00450945149519
0.00455308424423
0.00452690821646
0.00438191516875
0.00409041270736
0.00370095825142
0.003917333677
0.00415446823052
0.00385851871188
0.0042567935416
0.00453736259558
0.00465750964607
0.00464710210022
0.00456538690617
0.00447161646234
0.00436013910151
0.0042988459428
0.00429419927541
0.00435308808603
0.00446816496905
0.00456923571993
0.00465761166779
0.00467134764733
0.00455072104651
0.00426781408767
0.00388164759546
0.00415818479246
0.00422729609147
0.00391681229759
0.00431255513082
0.00457736808542
0.00466129557063
0.00460260426091
0.00449437983389
0.00444987495433
0.00420062861999
0.00409440989552
0.0040901819421
0.00419533704953
0.00444623307972
0.00450304883395
0.00462913213116
0.00469500713586
0.00461059079324
0.00434366921056
0.0039583776536
0.00424299723754
0.00421733846359
0.00391498121433
0.00430336458546
0.0045442590777
0.00458804606332
0.00451030254142
0.0046666618487
0.00680773153418
0.00541174430929
0.00509066179469
0.00505037744944
0.00526422002581
0.00653320945959
0.00448855202082
0.00452462696896
0.00463806418586
0.00459761153103
0.00435410805725
0.00397335731607
0.00424544053108
0.00418115929185
0.0038904004418
0.00426799493805
0.0044828584969
0.00449489959725
0.00450771841122
0.00682802180664
0.00663359481816
0.00447657024869
0.00455666243521
0.00455556834014
0.00433680798503
0.00396324293424
0.00422105393635
0.00415401483665
0.00387042373985
0.00424015474752
0.0044344054885
0.00439751182244
0.00423950663795
0.00522793534831
0.00506628806076
0.00425662353331
0.0044779758563
0.00452536764704
0.00432578411372
0.0039564389533
0.00420612838694
0.00415432709065
0.00387052536866
0.00424087340085
0.00443537748917
0.00439589115185
0.00422327706484
0.00513700137117
0.00501089377535
0.00426949141889
0.0045010063546
0.00454976960098
0.00434616386127
0.00397032908825
0.00421743167709
0.00418891805202
0.00389559070347
0.00427579839487
0.00449273321518
0.00450004990605
0.00447215312666
0.00640515748609
0.00645694394604
0.00456800889935
0.00464604463749
0.00464019970057
0.00440577860116
0.00401075008205
0.0042615526734
0.00425407210602
0.00394141535811
0.00433683931489
0.00458603384807
0.00463254608571
0.00454874676628
0.00466928137452
0.00662673984262
0.00535037156083
0.00519448583354
0.00526718514162
0.00561901200127
0.00734051931898
0.00488534631654
0.00473707038413
0.00483090968101
0.00477155160389
0.00449332668542
0.00407194424368
0.00433465108026
0.00433152630305
0.00399545903654
0.00440761021416
0.00469570683933
0.00479898018718
0.00475658383597
0.00468492489173
0.00475267761101
0.00447751807613
0.00439967997123
0.00444889494737
0.00461731716571
0.00496369498995
0.00489911477754
0.00499225072843
0.00503660795922
0.00491036115457
0.00458317055251
0.00413566724836
0.0044160762369
0.00439075581678
0.00403515732813
0.00446114823612
0.00478492859311
0.00494732799245
0.00497322675436
0.00492734886478
0.00487601151601
0.0047854134908
0.00475842858871
0.00480211609714
0.00490819373892
0.00506176663032
0.00515931543662
0.00523089297837
0.00520207803277
0.00501085665664
0.00464095866014
0.00417592388136
0.00447350937973
0.00438537249342
0.00403010588959
0.00446392446982
0.00481158592998
0.00501912831758
0.00510551968964
0.00511495647044
0.0050948880641
0.00506901300826
0.00507141390668
0.00511333610834
0.00518715016516
0.00527657930412
0.00534382730198
0.00535698381688
0.00526483947368
0.00502576110249
0.00463176708361
0.00416116948865
0.00445891279118
0.00426723871609
0.00394556095128
0.00438304319268
0.00473858480814
0.0049687427022
0.00509217897538
0.00514316628805
0.00515754446928
0.00516282492726
0.00517988327147
0.00521607167575
0.00526627234272
0.00531733203827
0.00534384136457
0.00531161711731
0.00518163020153
0.00492274784327
0.00452597879675
0.0040587766074
0.00432190637631
0.00398290278441
0.00374745931624
0.00418624813378
0.00453990381404
0.00477269539332
0.00490735674168
0.00497585968723
0.00500764305471
0.00502640191526
0.00504671603229
0.00507443317854
0.00510697062825
0.00513388643232
0.00513502149133
0.00508151854969
0.0049410033598
0.00468475013813
0.00429825002495
0.0038341959898
0.00400804758621
0.00346789616461
0.00340244839412
0.00385345031393
0.00420259308411
0.00443011142657
0.00456351399317
0.00463453939098
0.00467039157739
0.00469099526398
0.0047086629768
0.0047283581709
0.00474872350587
0.00476149590563
0.00475037001128
0.004691102789
0.00455386674452
0.00430772435291
0.00393040784689
0.00345481011677
0.00345744816694
0.00264375030345
0.00290965142546
0.0034205734693
0.0037849817383
0.00401425994263
0.00414648247415
0.00421658756368
0.00425161199459
0.00426997138076
0.00428297386377
0.00429548313745
0.00430698779638
0.00431075242343
0.00429251531774
0.00423003324029
0.00409323995038
0.00384685840103
0.00345701794293
0.00292355268048
0.00260760369558
0.00152532736703
0.00265591529161
0.00350578417997
0.00405021604331
0.00437982265685
0.00456674539142
0.00466430370497
0.00471027707439
0.00473026879634
0.00473918727216
0.00474353317678
0.00474310886209
0.00473043013048
0.00468792640656
0.0045866978695
0.00438576347979
0.00403379672619
0.00346672592875
0.00261170566563
0.00151594016865
0.00163531598485
0.00292634659826
0.00387156479804
0.004439213679
0.0047326480356
0.00484324041428
0.00485188112281
0.00481691937915
0.00478004143521
0.00475462075719
0.00474790634451
0.00476053027282
0.00479600886465
0.0048263977101
0.00480421128599
0.00467863482963
0.00438307722476
0.00381674356268
0.00287995397571
0.00160404292604
0.00292894252718
0.00315418078982
0.00366968854445
0.00401366261134
0.00419772784906
0.00426878296451
0.0042746038416
0.00425183629551
0.00422538432692
0.00420963793331
0.00421007475744
0.00422594464597
0.00425189244312
0.00427432467428
0.00426567001784
0.00418821032948
0.00399715179677
0.00364889678468
0.00314073967478
0.00289762668973
0.00388306604744
0.00366843634142
0.00407691378023
0.00437387474361
0.00453430138893
0.00459168835356
0.00458376158521
0.00454821585724
0.00451028715864
0.00448765651445
0.00448721596312
0.0045074153044
0.00454424654053
0.00457950954108
0.00458782398862
0.00453061447896
0.00436489190121
0.00406252492387
0.00366660783845
0.00386318587205
0.00445188796639
0.00401242650448
0.00437629817585
0.00465178922524
0.00479488984894
0.00482790817167
0.00479386339835
0.00473420852827
0.00466977571057
0.00463207465332
0.0046314751522
0.00466663741251
0.00473168885541
0.00479272346895
0.0048285583689
0.00479728240533
0.00465342523207
0.00437509260057
0.00402790678089
0.00445074683846
0.00473603966375
0.00419651623335
0.00454262905264
0.00480330543318
0.00492303093646
0.00492588606154
0.00486383058073
0.00478427063958
0.00466496602198
0.00459865096287
0.00459724948839
0.00466239840338
0.00478412284773
0.00486775080033
0.00493592632093
0.00493829705941
0.00481990905133
0.00455890688647
0.00423170287605
0.00475417148182
0.00483284438009
0.00426623672331
0.00460404668082
0.00484800151662
0.00493855609449
0.0049113447272
0.00485458650575
0.00485207131484
0.00455093558594
0.00441956021441
0.00441675300135
0.00454492264436
0.00484179696032
0.00485727596996
0.00493299582004
0.00497204389901
0.00488442867574
0.00464130441106
0.00432196516388
0.00486909411546
0.0048272918342
0.00426942297755
0.00459995134214
0.00482430365659
0.00488920938071
0.00488061795476
0.00517262413782
0.00734068322945
0.00566099708193
0.00529743213676
0.00527652558372
0.00557803825973
0.00710412749633
0.00495314749399
0.0048765905194
0.0049353664057
0.00488102062397
0.00465845829013
0.00434427414425
0.00488074714417
0.00478581210656
0.00424622846793
0.0045681687735
0.00477111727595
0.00481712262795
0.00493383305837
0.0075509803903
0.00737931827108
0.00489256134559
0.00487824770452
0.00485106850165
0.00464857276074
0.004339155414
0.00485788937946
0.00475519613952
0.00422719710812
0.00454287081505
0.00472699947282
0.00472425836857
0.00465261148256
0.00565188927462
0.00556446519677
0.00467053832928
0.00481207784547
0.00483142918719
0.00464538850776
0.0043378863007
0.0048461979097
0.00475811599333
0.0042299031969
0.00454629325179
0.00473126040815
0.00472721409413
0.00464257789165
0.00555175798711
0.00554622310004
0.00470406692438
0.00484997369487
0.00486756225281
0.00467549068176
0.00436026663315
0.00486870912565
0.00480464771147
0.00426008949556
0.00458444984475
0.00479071299373
0.00483519008784
0.00491520064202
0.00706380954302
0.00732462911377
0.00505270052701
0.00501265342242
0.00497057181892
0.00474678169236
0.0044127944505
0.00493346842973
0.00488758670023
0.00431269781033
0.00464858051887
0.00488196623267
0.00495395305059
0.00495116674786
0.00524325988655
0.00748809832968
0.00588946983153
0.00567865445199
0.00574812798172
0.00620051137333
0.00837286378837
0.00550474886044
0.00518013418076
0.0051945212835
0.00510981726304
0.00484592079434
0.00448816090581
0.00503324492328
0.00498193372865
0.00437285045005
0.00472225324741
0.00498909693042
0.00510431570696
0.00510985660904
0.00512226682636
0.00527467539089
0.00496137401674
0.00486473222687
0.00491378562981
0.00510795753197
0.00550762962763
0.00536733139276
0.00538667630833
0.00538994574958
0.00525307258091
0.00494566050114
0.00456475414312
0.00513912233824
0.00505039526198
0.00441465492385
0.00477693394464
0.00507616236094
0.0052399630288
0.00528989983496
0.00528434013111
0.00527118279929
0.00518575781071
0.00515990549077
0.00520719879503
0.00532011894467
0.00547817542688
0.00555015944582
0.00559327671513
0.00554757608285
0.00535660808253
0.00501005898446
0.00461222690164
0.00520874991117
0.00503509568731
0.00440431222931
0.00477727416057
0.00510096887247
0.00530443110414
0.00540176668342
0.00543106300472
0.00543050304721
0.00541495682968
0.00542382650161
0.00547044865712
0.00554824245888
0.00563896831186
0.00569924710628
0.005703298016
0.00560662037547
0.00537303548003
0.00500183467987
0.0045940124453
0.00518227358935
0.00488165562695
0.00430453582769
0.00468940987495
0.00502633683358
0.00525314017573
0.00538231948768
0.00544412523118
0.00547025207401
0.00548477308812
0.0055094214159
0.0055509748525
0.00560631054507
0.00566099028501
0.00568795396644
0.00565448302912
0.00552427296711
0.00526963669031
0.00488931336831
0.00447376045517
0.00500070162724
0.00452934934605
0.0040805482855
0.00448246263844
0.00482794444687
0.00506375229684
0.00520611232745
0.00528342390703
0.00532402838597
0.00535010452859
0.00537719590839
0.00541165736853
0.00545087633261
0.00548317422944
0.00548697309247
0.00543300037585
0.00528949673715
0.00503012750814
0.00464747627707
0.0042152297499
0.00460259544125
0.00390514157924
0.00369966504897
0.0041425106363
0.00450100259133
0.00474193524176
0.00488822403955
0.00497004832647
0.00501468619528
0.00504266206347
0.00506727427178
0.00509410544355
0.0051213863258
0.005139368909
0.00512980709445
0.00506665690068
0.00491910332737
0.00465706487261
0.00426336195193
0.00378740102616
0.00392155165432
0.00292116760117
0.00316859039422
0.00372173220121
0.00412597774964
0.00438660697848
0.00454140007579
0.00462683117723
0.00467225828213
0.00469831021402
0.00471814324862
0.0047373257095
0.00475492971411
0.00476238755976
0.00474253154889
0.00466965897873
0.00451045917164
0.00422769824093
0.0037887907436
0.00320272735342
0.00289275251516
0.00160781315587
0.00293624886809
0.00395390977313
0.00461778610696
0.00502729637843
0.00526495310566
0.00539214970675
0.00545484328842
0.00548498865784
0.00550194648608
0.00551354098704
0.0055190040658
0.00550739194699
0.00545556715911
0.00532662950718
0.00507089932161
0.00462820762183
0.00392819743501
0.00289518277495
0.00160196375984
0.00170419437083
0.00313429948803
0.00419503527779
0.00483970760099
0.00517584106956
0.00530214065384
0.00530652260666
0.0052582804905
0.00520734617871
0.00517295434702
0.00516414812441
0.00518253960233
0.005231206279
0.00527504797186
0.00525527364776
0.0051121036725
0.0047711686328
0.00412938491954
0.00308053301683
0.00166721947994
0.00313489923598
0.00334544300426
0.00389498401791
0.00426719443112
0.00446927194206
0.00454797773175
0.00455293319436
0.00452536706027
0.00449347398445
0.00447442978768
0.00447524177667
0.00449534263363
0.00452779964314
0.00455582871021
0.00454821016152
0.00446364256735
0.004254654081
0.00387753577
0.003335169936
0.00309975713388
0.00420436381888
0.00389258197429
0.00430374038045
0.00461074206449
0.00477975874554
0.00484136097115
0.00483426507064
0.00479578939629
0.00475358510037
0.00472838258106
0.00472870387306
0.00475306208378
0.00479465201761
0.00483296160031
0.004841408648
0.00478056501053
0.00460708916076
0.00429511321182
0.00389822941898
0.00418691598544
0.00485031671952
0.00426424026875
0.00461240927608
0.00488725971069
0.00503398545908
0.00507224534273
0.00504086220988
0.00497946677057
0.00490952414038
0.00486829254008
0.00486889801849
0.00490938579593
0.00498019439979
0.00504184692175
0.00507544297364
0.00504127280409
0.00489526911773
0.00461919528081
0.00429202882218
0.00486043841778
0.00517772401976
0.00446704122196
0.00478798849973
0.00504321449284
0.00516712202615
0.00517885501799
0.00512556196659
0.00504754171256
0.00491587567961
0.00484195084559
0.00484325454249
0.00491721686268
0.00505154328319
0.005130154537
0.00518938007193
0.00518588610358
0.0050668486575
0.0048143960457
0.00451889580064
0.00521719339095
0.00529205999171
0.00454733287395
0.00485676571015
0.005095094539
0.00519425609891
0.00518593413617
0.00515367143467
0.00516786392135
0.00482264947453
0.00467094887272
0.00467174710527
0.00482034505375
0.00516436727866
0.00515782600594
0.00520608432536
0.00523067555065
0.00513968822131
0.00490676069572
0.00462376917071
0.00535827019533
0.00528862277082
0.00455509302044
0.00485779606827
0.00507953444063
0.00516154247626
0.00518968896255
0.00554732859859
0.00792963375169
0.00599994394679
0.00559969952566
0.00558596587063
0.00593454823212
0.00772010274462
0.00535522222911
0.00518376097788
0.00521066299962
0.00514687107236
0.00493286551107
0.00465513547301
0.00537979600556
0.00524345365305
0.00453312244945
0.00482889444311
0.0050322234526
0.00510242247862
0.0052709522347
0.00826045291936
0.00804686325893
0.00524478926599
0.0051733735616
0.00512913610683
0.00493201344917
0.0046570878593
0.0053615576624
0.00520882013048
0.00451475071581
0.00480527530038
0.00499079868743
0.00501222113207
0.00498274477959
0.00612115212607
0.00603022506346
0.00502069014209
0.00511984053203
0.00512132398751
0.00493856058263
0.00466366584191
0.00535719864804
0.00521511342249
0.0045198733441
0.00481099000211
0.00499763028793
0.00501888242305
0.00497809083753
0.00601390706108
0.00604638572782
0.00507634991438
0.00517507883877
0.00517178084733
0.00498087692145
0.00469702151544
0.0053944617622
0.00527283397941
0.00455503780236
0.00485254169928
0.00505993932909
0.00513210797472
0.00527592299739
0.00776594176091
0.00814114682399
0.00547588392412
0.0053600049451
0.00529135448448
0.00506695038667
0.00476428550183
0.00548267033189
0.0053724757633
0.00461424838693
0.00492046129189
0.005151623452
0.00524545658686
0.0052970875505
0.00569833150204
0.00840641875874
0.00649772769983
0.00623761573403
0.0063174402239
0.00682470330546
0.00934357762424
0.00602586219131
0.00558560514739
0.00554947334728
0.00544397673589
0.00518104218014
0.00485631396662
0.00561172600028
0.00548361619702
0.00468016031311
0.00499714285594
0.00525825161514
0.00538728766665
0.0054277351279
0.00549300589298
0.00569803425394
0.00536142523515
0.00525127794135
0.00530578525104
0.00552661691585
0.00597901107023
0.0057929981044
0.00576948252953
0.00574552670373
0.00559654434138
0.00529317355192
0.00494789246021
0.00574506191633
0.00556070023392
0.00472381387733
0.00505217415025
0.00534368467067
0.00551478945244
0.0055852497031
0.00560830180456
0.00561962844437
0.00553853904461
0.00551494348513
0.00556982962353
0.0056966325788
0.00586867084012
0.00593177767379
0.00595968960787
0.00590172312025
0.00570530788794
0.00536520255888
0.0050041589472
0.00583063614847
0.00553883384061
0.00470871852438
0.0050489576512
0.00536496156617
0.00557254863762
0.00568237785134
0.00572846714856
0.00574327227862
0.00573701334187
0.00575370123941
0.00580928739971
0.00589759506732
0.00599711724997
0.00605882020408
0.00605933465528
0.00595804679044
0.00572239703908
0.00535752281155
0.00498382967252
0.00579735411488
0.0053559144826
0.00459537480794
0.0049529317322
0.0052857632737
0.00551674827005
0.00565537594349
0.00572878960017
0.00576635965011
0.00579064127457
0.00582456276772
0.00587592243776
0.00594160640384
0.00600523993356
0.00603736012992
0.00600493349778
0.00587265662518
0.00561500855928
0.00523666392493
0.00484716389176
0.00557853573827
0.004947359364
0.00434778300136
0.00473397111195
0.00508205919474
0.00532654996282
0.00547966863663
0.00556779881938
0.00561840594852
0.00565385365611
0.00569052238976
0.00573525840016
0.00578500862099
0.0058264906689
0.00583609765994
0.00578306588121
0.00563519386994
0.0053674249146
0.00497750715212
0.00455609842504
0.00510652386628
0.00423358672587
0.00393358176339
0.00438150506858
0.00475542178855
0.00501273943493
0.00517366192329
0.0052677513355
0.00532278543614
0.00536020745124
0.00539434318672
0.00543127504972
0.00546868259866
0.00549514559235
0.00549004278925
0.00542489269481
0.00526722737956
0.00498698068898
0.00457050544432
0.00408047036385
0.0043104911023
0.00312623760212
0.00336603085803
0.00395988370555
0.00440193150174
0.00469266825488
0.00486970816635
0.00497107138712
0.00502827701182
0.0050640284002
0.00509314173179
0.00512188255585
0.00514881210024
0.00516338917327
0.0051452755215
0.00506495177439
0.00488568083114
0.00456819912108
0.00408091898837
0.00344087829301
0.00312680701932
0.00166902828622
0.00314548146702
0.00429619172471
0.00505897433199
0.0055382416207
0.00582164235546
0.0059773117498
0.00605805047742
0.00610118473418
0.00612911302973
0.00615191593049
0.0061680399918
0.00616310102932
0.0061079139923
0.00595718426024
0.00565329265668
0.00512926387454
0.00431147594536
0.00312598933159
0.00167128257508
0.00176331202588
0.00329677561443
0.00444557095062
0.00514959769188
0.00551836739297
0.00565458248198
0.00565237608884
0.005591233176
0.00552719765796
0.00548365609805
0.00547383015329
0.00549954255054
0.0055622801017
0.00561965857165
0.00560514435852
0.00545096576785
0.00507640236025
0.0043756470395
0.00323901417544
0.00172211909545
0.00329429799989
0.00349352877925
0.00407280205533
0.00446898406395
0.00468568213582
0.00476973312953
0.00477260203386
0.00473960111951
0.00470219730337
0.00467995126344
0.00468137337724
0.00470604646161
0.00474617895804
0.00478159102427
0.00477754720678
0.00468892543789
0.00446541485805
0.00406292965041
0.00348941350954
0.00325778100651
0.0044511676449
0.00406921059646
0.0044893448255
0.0048083124785
0.0049856872614
0.00505012911909
0.00504202887402
0.00499902439923
0.00495157224296
0.00492325894462
0.00492420302451
0.00495343970115
0.00500195223622
0.00504662507286
0.00505874011073
0.00499674226409
0.00481577172472
0.00449127449686
0.00408596698148
0.00444069074143
0.00515623163736
0.0044645859756
0.00480974473332
0.00508972525489
0.00524143931262
0.00528332375518
0.00525124067553
0.0051846810025
0.00510759349796
0.00506196258451
0.00506335991975
0.0051105022707
0.00519031427881
0.00525804897119
0.0052950190713
0.00526126337859
0.00511198701794
0.00483124102756
0.00450990308035
0.00518454916578
0.0055162470038
0.00468323654663
0.00499531174087
0.00525279862459
0.00538223143761
0.00539904629924
0.00534765273966
0.00526455016215
0.00511963465943
0.00503789537563
0.00504038837398
0.0051252984535
0.0052756957434
0.00535814086788
0.00541773423324
0.00541414700767
0.0052936546039
0.00504085940418
0.00475899639543
0.00558638706493
0.0056425774315
0.00477232097196
0.00507125743433
0.00531194756126
0.00541931614348
0.00542106809324
0.0053983467861
0.00541828870235
0.00503769712855
0.0048704071875
0.00487319978251
0.00504132702509
0.00542916382477
0.00541352810787
0.00545023158032
0.0054704634028
0.00537729277511
0.00514537943708
0.00487887919854
0.00575125489593
0.00563824568771
0.00478366076438
0.00507668690237
0.00530277313993
0.00539795379109
0.00544470371165
0.00583615489442
0.00842728083727
0.00629588675682
0.0058692654663
0.00586183179552
0.00624145410667
0.00822509006196
0.00569789377396
0.00545643715294
0.00546500806243
0.00539588701014
0.00518212921606
0.00492068166381
0.00578361548363
0.00558954179166
0.00476256918537
0.00504998655553
0.00525962739019
0.00534767559534
0.00554478372938
0.00884319501897
0.00864298123355
0.00556336910746
0.00544670787841
0.00539111580448
0.00519200567752
0.00493176772516
0.00577367307884
0.00555228326774
0.00474471264717
0.0050276223836
0.00521991369951
0.00525893035331
0.00525595192044
0.00655901679166
0.00643808237388
0.00533262873093
0.00540638023938
0.00539688485807
0.00521048228915
0.00494867033906
0.0057803181505
0.00556160974351
0.0047521863392
0.00503574616679
0.00522892459722
0.00526925809164
0.00526082808755
0.00648459067571
0.00648134398907
0.0054115767781
0.00548201828657
0.00546476641227
0.00526791233413
0.00499583270778
0.00583556609351
0.00562988443342
0.00479241792554
0.00508131185674
0.00529473451895
0.0053900756005
0.00558629789415
0.00841434392728
0.00886569212014
0.00586806413908
0.00569461801134
0.0056052312379
0.00537222446357
0.0050808204434
0.00595054290481
0.00574647930018
0.00485854010286
0.00515333800795
0.00538865935609
0.00550208665053
0.0055945064936
0.00607764662438
0.00920782681135
0.00704979903865
0.00674338875857
0.00683272601315
0.0073857025672
0.0101843207497
0.00648691344124
0.00596785580104
0.00589917390325
0.00577629038309
0.00550483121036
0.00519243669004
0.00611170532664
0.0058739705926
0.00493024411967
0.00523359879761
0.00549689327144
0.00564050101909
0.0057081656809
0.00581067437191
0.00605359744232
0.00570763059406
0.00558970205642
0.00565293019114
0.00590285017409
0.0064099003733
0.00619202345891
0.00614506025533
0.0061042767179
0.00594266136999
0.00563221579948
0.00530179121624
0.00627618097433
0.00596018162035
0.00497596183764
0.00528964257662
0.00558240112953
0.0057638405774
0.00585266391529
0.00589765771567
0.00592700881823
0.00585290527407
0.00583494538851
0.00590167574431
0.00604821454098
0.00624178236446
0.00630726192657
0.00633021289671
0.00626438364618
0.00605899484748
0.00571373623931
0.00536951002473
0.00638234920418
0.00593408804725
0.00495713959962
0.00528286471216
0.00560107860509
0.00581706752591
0.00594012615032
0.00600160910138
0.00603043954727
0.00603489375048
0.00606258382093
0.00613167273057
0.00623634635714
0.00635124636146
0.00642159310269
0.00642393545318
0.00631917370259
0.00607689520145
0.00570746781267
0.00534983253436
0.00634891709387
0.0057281309766
0.00483217273099
0.0051785181623
0.00551608403737
0.00575618413507
0.00590636466805
0.00599223483041
0.00604208980519
0.00607820054689
0.00612424180065
0.00618981314553
0.00627087454546
0.0063487430445
0.00639094310044
0.0063627138306
0.00622837730265
0.00596368314109
0.00557834802422
0.00519964845208
0.00610117178338
0.00527229525406
0.00456351826724
0.00494682972183
0.0053043276151
0.00556110219545
0.00572693332281
0.00582726674184
0.00588956641097
0.00593673028063
0.00598610161013
0.00604494309232
0.00610946629975
0.00616447044142
0.00618380666852
0.00613437659739
0.00598270354499
0.00570425334037
0.00530091698152
0.00487887077202
0.0055654309257
0.00448688574846
0.00411945084573
0.0045791509493
0.00497161182189
0.00524687280618
0.00542348238957
0.00553100509213
0.00559805216814
0.00564717841905
0.00569376102362
0.00574427589986
0.00579569887705
0.00583473096329
0.00583799812084
0.00577406315564
0.00560823930013
0.00530989738298
0.00486805060494
0.00435750457832
0.00466624517711
0.00328397149533
0.00351925734116
0.00415002001526
0.0046269469436
0.00494600151471
0.00514474609948
0.00526253373363
0.00533293734437
0.00538060039351
0.00542194765029
0.00546380868567
0.00550415747192
0.00553030364939
0.00551854041162
0.00543515201874
0.00523956226497
0.00489040962827
0.00435680136905
0.00366342358094
0.00334209895631
0.00171929134221
0.00330733529744
0.00456493393111
0.00541075071931
0.00595038432116
0.00627561634791
0.00645939905613
0.00655925622238
0.00661802573656
0.00666118373376
0.00670045881973
0.00673316133058
0.0067417066939
0.00669048987568
0.00652575957276
0.00618100042298
0.00558364398253
0.00465857524062
0.00333562424075
0.00173763550177
0.00181954822619
0.00343206995179
0.00464923028526
0.00539893407748
0.00579242182286
0.00593406973245
0.00592259018975
0.00584871376936
0.00577151619519
0.00572031274624
0.00570979440248
0.00574579543028
0.00582308229343
0.00589582624022
0.00589027821856
0.00573222999041
0.00533282327139
0.00458421578361
0.0033767678501
0.00177653275676
0.00342586420364
0.00361479690304
0.00422008461689
0.00463645707917
0.00486457419578
0.00495160184457
0.004951115573
0.00491176774254
0.00486880409991
0.00484374706173
0.00484636090592
0.00487674360844
0.0049262096917
0.00497170886566
0.00497469809386
0.00488583229306
0.00465108619688
0.00422575577801
0.00362258003916
0.00339115332551
0.00464981039587
0.00421527190265
0.00464824375781
0.00497991908641
0.00516470443878
0.00523008324822
0.00521884644083
0.00516997467292
0.00511652432615
0.00508489791558
0.00508676145926
0.00512191643125
0.00518003406538
0.00523511595229
0.00525541781427
0.00519585713826
0.00500868819134
0.00466960058487
0.00424997316718
0.00465189412329
0.00540030041492
0.00463088825653
0.00498164254865
0.00527035661781
0.00542750872146
0.00547064762301
0.00543482566071
0.00536037200287
0.00527504248992
0.00522463795625
0.00522693374264
0.00528185112476
0.00537403410556
0.00545354833618
0.00550013182282
0.0054712343212
0.00531910931569
0.0050287581622
0.0047025496035
0.00545611288931
0.0057843354602
0.00486269893683
0.00517721721581
0.00544193076137
0.00557671887019
0.00559535571173
0.00554068149186
0.00544799161241
0.0052896949378
0.00520037259676
0.00520383971437
0.00530044049076
0.00547012510828
0.00556433691914
0.00563297139308
0.00563561570288
0.00551444442694
0.00525497432026
0.00497327321828
0.00589709175531
0.00591805303323
0.00495875431993
0.0052596840262
0.00550786545398
0.00562228918763
0.00562726001502
0.00560410409901
0.00562179197514
0.00521324305531
0.00503343526403
0.00503710778575
0.00522437989604
0.00565354596024
0.00564077544447
0.00567868293504
0.00570372848687
0.00561059532946
0.00537315173945
0.00510835159242
0.00608394061161
0.00591162042083
0.00497261098705
0.00526860008443
0.00550336932406
0.00560830880895
0.0056619080169
0.00606346389597
0.00882476309059
0.00654388851662
0.00609972626854
0.00609125614923
0.00651785649428
0.00863416310939
0.00599839737436
0.00570986326569
0.005711587674
0.00564143773864
0.00542188778288
0.00516174804498
0.00612859711205
0.00585784567865
0.00495192220478
0.00524348576844
0.00546302726647
0.00556493015945
0.00578702804871
0.00935197156353
0.00918398040863
0.00586486650224
0.00571311568595
0.00565074518566
0.00544417091791
0.00518390287962
0.00613009644723
0.00581931498426
0.00493453929007
0.00522240564752
0.00542359242306
0.00547591851797
0.00549016464607
0.00695976094915
0.00686377695331
0.00563118728916
0.00568750519003
0.00567206708651
0.00547680626353
0.00521363581359
0.00615143247114
0.00583146804059
0.0049445888476
0.00523258325835
0.00543472521109
0.0054903143766
0.00550156308832
0.00689204684606
0.00692312033512
0.00573619993669
0.0057871067942
0.00576067727235
0.00555229022395
0.00527753155796
0.00622818408635
0.0059110256415
0.00499055780716
0.00528162942605
0.00550519768449
0.00562022032447
0.00585548671256
0.00895613876443
0.00957975786822
0.00626138360659
0.00603358567653
0.00592638468437
0.00567822179823
0.0053832451689
0.00637278315532
0.00604537397162
0.00506366793442
0.00535836950353
0.00560311649914
0.00573455907204
0.00585845225911
0.00640073689837
0.00989934141929
0.00754329202909
0.00720210459831
0.00730366025873
0.00789490078577
0.0109224080092
0.00691670310642
0.00634758014367
0.00625789399021
0.00611997519197
0.00583246496904
0.00551735129266
0.00656904586355
0.00618814833458
0.00514132649148
0.00544304055937
0.00571475618402
0.00587333448179
0.00596329635159
0.00609317269295
0.00636592111316
0.00602029098905
0.00590162867585
0.00597874596214
0.00626037127366
0.00681869126349
0.00658473003832
0.00652780559883
0.00647782502433
0.00630349478676
0.0059776411159
0.00564731765879
0.00676842047577
0.00628463293526
0.00518971903929
0.00550100488822
0.0058018351145
0.00599592668921
0.00610183479067
0.00616479628589
0.00620933598434
0.00614539315397
0.00613774069628
0.00622116296997
0.00639207624769
0.00661269013188
0.00668949360411
0.00671538677078
0.00664556250183
0.00642899140535
0.00607051088991
0.00572945749399
0.00690047005769
0.00625674036571
0.00516790714897
0.00549200343509
0.00581855814395
0.00604640589138
0.00618346015713
0.00625985811581
0.00630273741576
0.00632026137188
0.00636257096085
0.00644968777672
0.00657596266223
0.00671193295548
0.00679702884495
0.00680604610666
0.00669952991033
0.00644809819391
0.00606692496971
0.00571363116285
0.0068741137542
0.00603122429515
0.00503274678909
0.00537897375897
0.0057274762666
0.00598019416434
0.006143535941
0.00624286399498
0.00630626601447
0.00635654293439
0.00641818902979
0.00650222162702
0.00660340352717
0.0067004586918
0.00675747565316
0.00673689894864
0.00660167896329
0.006328071266
0.0059303734001
0.00555336146297
0.00660634372507
0.00553682403891
0.00474515549231
0.00513388082783
0.0055055295895
0.00577725074857
0.00595734854172
0.00607123604927
0.00614693441476
0.00620823035931
0.00627348521085
0.00635029056672
0.00643388327996
0.00650688349339
0.00654018148332
0.00649770987326
0.00634403924004
0.00605459021897
0.00563485550082
0.00520623153632
0.00601675153056
0.00469248779999
0.00427407830345
0.0047491438649
0.00516203080789
0.00545629311862
0.00564942612954
0.00577144048493
0.00585210834832
0.00591525998752
0.0059773353805
0.0060451306889
0.00611478700947
0.00617090326076
0.00618703283745
0.00612833892606
0.00595742670322
0.00564263993885
0.00517510019793
0.0046415854216
0.00502354492143
0.0034121625485
0.00364440019878
0.00430842041693
0.00481758761729
0.00516350722067
0.00538351682951
0.00551814601523
0.00560321603003
0.00566513448029
0.00572186966547
0.00578077243533
0.00583920690383
0.00588209594919
0.00588223637742
0.00580105319623
0.00559391089678
0.00521693950311
0.00463957272395
0.00389392477076
0.00356513520956
0.00176541893991
0.00343969742591
0.00478495568806
0.00570228940879
0.00629540983739
0.00665919349097
0.00686997653789
0.00699084797339
0.00706816263877
0.00713052699006
0.00719162478217
0.00724802425032
0.00727871174486
0.0072408459732
0.00707072980073
0.00669292678141
0.00602979723277
0.0050044526824
0.00355081123811
0.00181161632235
0.00187794411534
0.00355610824641
0.00482989971127
0.00561715709653
0.00602845557177
0.00617123888917
0.00614797993485
0.00605967638687
0.00596937337947
0.00591011999235
0.00590043502484
0.00595136423155
0.00604525410011
0.00613827825082
0.00614836608471
0.00599183543938
0.00557515141281
0.00478454702107
0.00351159447907
0.00183576511468
0.00354537326691
0.00372453248022
0.00435399028035
0.0047880559469
0.00502491676264
0.00511253228117
0.00510690721132
0.00506010170442
0.0050113684384
0.00498402866308
0.00498904274937
0.00502734391099
0.00508935740121
0.00514956928251
0.00516485002103
0.00508033477762
0.00483750473776
0.00438983380352
0.00375472029025
0.00351779322346
0.00482396383485
0.00434797916741
0.00479732952363
0.00514249566492
0.00533364706588
0.00539805348341
0.00538091359874
0.005324350042
0.00526402600004
0.00522907507202
0.00523279940051
0.00527601837887
0.00534792942503
0.00541932561271
0.00545414390914
0.00540211590343
0.00521070173942
0.00485459917697
0.00441372729118
0.00484812799848
0.00561101169623
0.0047818493204
0.00514533779119
0.00544575895303
0.00560813888103
0.00564957358767
0.00560705469361
0.00552176561319
0.00542684872534
0.00537139167553
0.00537529948227
0.00544006155704
0.00554950940068
0.00564823582006
0.0057124015374
0.00569444120705
0.00554109901913
0.00523669415987
0.00489516655544
0.00570623837791
0.00601329601571
0.00502504347455
0.00535130418255
0.00562730734105
0.00576703776982
0.00578377410441
0.00572092453386
0.00561434367156
0.00544187201639
0.0053449317251
0.00534982054645
0.00545968306989
0.00565361069507
0.00576875025542
0.00585627010912
0.0058729066124
0.00575318728374
0.00548165672916
0.00518763936087
0.00618385225172
0.00615106514538
0.0051267165771
0.00543991825247
0.00569971522999
0.00581955610904
0.00582153813832
0.0057898035017
0.00579781951485
0.00536576509948
0.00517472849298
0.00517932395003
0.00538615558547
0.00585828910906
0.00586145107416
0.00591327699413
0.0059528809531
0.00586313104774
0.00561468112329
0.00533818681195
0.00639108239642
0.00614151749567
0.00514220590598
0.0054515507313
0.00569843091531
0.00580940356809
0.00586001058709
0.00625148163621
0.00914711956626
0.00675785895113
0.00629965149008
0.00629060750275
0.00676126644516
0.00899323063731
0.00628048514944
0.00596642812675
0.00597340878237
0.00590654708175
0.00567641141369
0.00540408549939
0.00644922418144
0.00608319832232
0.00512154084475
0.00542770641494
0.0056585607288
0.00577048303756
0.00600924839464
0.00976830209408
0.00969255971315
0.00616714522152
0.00599572720201
0.00593092008956
0.00571251617293
0.00543880955763
0.00646442715557
0.00604280541905
0.00510467658589
0.00540671124165
0.00561877280454
0.00568053597208
0.00569844979406
0.00730060585882
0.00726626601073
0.00593464972058
0.00598743758576
0.00596986733115
0.00576111178008
0.0054834006324
0.00650355778955
0.00605913138446
0.00511786059532
0.00541806768455
0.00563211167165
0.00569928397611
0.00571635523557
0.00723949024673
0.00735159171787
0.0060704360146
0.00611463171309
0.00608205456112
0.00585700649636
0.00556648563504
0.00660483111442
0.00615077865058
0.00516929336578
0.00547103969913
0.0057081015472
0.00583976252602
0.00610162207676
0.00942310606459
0.010280879901
0.00667225532609
0.00639947439476
0.00627624173924
0.00600716644723
0.00569532822076
0.0067812211571
0.00630251885036
0.00524961824103
0.00555310760294
0.00581152590777
0.00595970315537
0.00610806438064
0.00668983084251
0.0105269812214
0.00800717748022
0.00764031711249
0.00776209422709
0.00840002749738
0.0115847200592
0.0073423821307
0.00674984813662
0.0066468178701
0.00649511915958
0.00618486550057
0.0058541378645
0.00701474432518
0.00646128776299
0.00533370793577
0.00564287665103
0.00592801888889
0.00610215187454
0.00621121945759
0.00636159278557
0.00665951675673
0.00632195892983
0.00620934809001
0.00630594485079
0.00662370260462
0.00722864332649
0.00699466328713
0.00693799882295
0.00688440626434
0.00669745556077
0.00634899014081
0.00600674255638
0.00725208788917
0.00656911431781
0.00538566673986
0.00570327238901
0.00601770238986
0.00622658505205
0.006349022111
0.00642797234319
0.00648684062931
0.00643664431526
0.00644421719517
0.00654931089007
0.00674943358724
0.00700101608815
0.00709665097481
0.00713175693498
0.00706134913376
0.00683201619651
0.00645398398438
0.00610547836241
0.0074149430422
0.00654055151812
0.00536131676601
0.00569222087
0.00603266819919
0.00627535786901
0.00642741102262
0.00651885038217
0.0065766717142
0.00660988498644
0.00667038760109
0.00678024094508
0.00693277587689
0.00709485651704
0.00720006130147
0.00722006656595
0.00711373823863
0.0068517148185
0.00645357302488
0.00609602192071
0.00740240597638
0.00629807593151
0.00521644545516
0.00557063108167
0.00593474232377
0.00620330712601
0.00638116102144
0.0064951139318
0.00657368114511
0.00664036434024
0.00672114358753
0.00682771994704
0.00695342181299
0.00707422819909
0.00715045742797
0.00714100229884
0.00700663559463
0.00672343596564
0.00630995118308
0.00592867392602
0.00712365544514
0.00576980757614
0.00491095346173
0.00531077733365
0.00570040783018
0.00598940705873
0.00618523746425
0.00631396762363
0.00640478683102
0.00648257158472
0.00656678006502
0.00666523120525
0.00677200859001
0.00686732918663
0.00691879181805
0.00688684721486
0.00673358953786
0.00643387164216
0.00599643128197
0.0055581044592
0.00648982967279
0.00487428495446
0.00441418244046
0.00490689784458
0.00534177080366
0.00565614857937
0.00586670866594
0.0060042526962
0.00610006949478
0.00617946584858
0.00625998551872
0.00634868319208
0.00644075644144
0.0065185103657
0.00655213077088
0.00650300591103
0.00633060918844
0.00600177343585
0.00550934260521
0.00495223287742
0.00540965658448
0.00352879092463
0.00375650142634
0.00445125193823
0.00499094956786
0.00536275802233
0.00560384159551
0.00575586302686
0.00585693748885
0.0059353376851
0.00601062574142
0.00609053264529
0.0061718002039
0.00623691144286
0.00625470452988
0.0061814355634
0.00596792706105
0.00556727687587
0.00494885531574
0.0041517159244
0.00381755156495
0.00181299895745
0.00355866268851
0.00497853401559
0.00595871113134
0.00660076286038
0.00699978346479
0.00723733634849
0.00738012941546
0.0074780354011
0.00756441538598
0.00765292360245
0.00774034805419
0.00780207269196
0.00778749951612
0.00762193040648
0.00721974648922
0.0064978354996
0.00537704438655
0.00379359215006
0.00190317505497
0.0019439648128
0.00368496350939
0.00501164078166
0.00583227606379
0.00625773180424
0.00639609217821
0.00635859971172
0.0062522018628
0.00614714974151
0.00608168201036
0.00607644671599
0.00614551576201
0.00626311105993
0.0063837248653
0.00641717076963
0.00627032057612
0.00584139012899
0.00500965677834
0.00366631727137
0.00190652507397
0.00366780609461
0.00383755091502
0.00449211533144
0.0049432790281
0.00518713514476
0.00527295134025
0.00525988896488
0.00520410575985
0.00514887776658
0.00512014745434
0.00512983333079
0.00517986283027
0.00526042914365
0.0053428210665
0.00537835922118
0.00530475922737
0.00505679570678
0.00458455637443
0.00391012482857
0.00365666364885
0.00499635083524
0.00448503502108
0.00495567185802
0.00531624019922
0.0055130999707
0.00557426070588
0.00554769169376
0.0054806424252
0.00541227632845
0.00537416373847
0.00538168563042
0.00543698903358
0.00552968599291
0.00562628779753
0.00568494621181
0.00564779395674
0.0054548325798
0.00507811054609
0.00460597937603
0.00505691009249
0.00581658306661
0.00493774841525
0.00532174575679
0.00563748863142
0.00580485066828
0.00584114130857
0.00578801271363
0.00568786706426
0.00558114008214
0.0055202345244
0.00552735251771
0.00560599050852
0.00574057524908
0.0058691309811
0.00596171505832
0.00596319236294
0.00581160485509
0.00548852539263
0.00511960052273
0.00596984268273
0.00623471716696
0.00519234083176
0.00553998150676
0.0058317537756
0.00597591268415
0.00598627626654
0.00590955924296
0.00578356028767
0.00559438392823
0.00548916737671
0.00549668181244
0.00562344119288
0.00584988034888
0.00599820558041
0.00611746691452
0.00615820501512
0.00604350835266
0.00575465918944
0.00543467395891
0.00648255153598
0.00637526581743
0.00529936056623
0.00563536546961
0.00591115078613
0.00603450731612
0.00602687769608
0.00597851257991
0.00596863567581
0.0055127538904
0.00531005495107
0.00531635981152
0.00554630017404
0.00606776328393
0.00610316312889
0.00618408088187
0.00624985845686
0.00616817075364
0.00590331635036
0.00560075959522
0.00670898290502
0.0063624055922
0.0053160691364
0.00564951490024
0.00591160090541
0.00602512456245
0.00606299952824
0.00642947330656
0.00943520436045
0.00695719189371
0.00648442090798
0.00647601423088
0.0069929644091
0.00934014445587
0.00657329899493
0.00625671197134
0.00628266406106
0.00622374071785
0.0059784607473
0.00567914622797
0.00678074237949
0.00629942095245
0.00529507594155
0.00562544374717
0.00587014084503
0.00598743786438
0.00622795051496
0.0101145397155
0.0102161447756
0.00650299052593
0.0063267735764
0.00626381474497
0.0060285563086
0.00572701140231
0.00681105753764
0.00625819743564
0.00527892351371
0.00560300000566
0.00582867286448
0.00589546351697
0.00590270282787
0.00760778745196
0.00768804980111
0.00627566046392
0.00633830536765
0.00632165012071
0.00609369255052
0.00578710927988
0.00686828919004
0.00627885037498
0.00529465058188
0.00561504257125
0.00584369514179
0.0059186985416
0.00592811444304
0.00755501864955
0.007808066206
0.00644721581202
0.00649607437166
0.00645893236739
0.00621072854782
0.00589031144473
0.00699505658345
0.00638511276872
0.00535157015099
0.00567170018234
0.00592547986837
0.00607113432038
0.00634835110884
0.00986082927886
0.0110368891134
0.00713326009123
0.00682185650676
0.00668277261805
0.00638576761177
0.00604317145178
0.00720403538307
0.00655975055241
0.00543984184362
0.00575924343022
0.00603531951676
0.00619942071785
0.00636707347496
0.00697281344365
0.0111428570615
0.00847666692987
0.00809083809192
0.00823835363435
0.00893952481011
0.0122609117785
0.00782302143562
0.00720448560988
0.00709267299643
0.00692684676484
0.00658670273793
0.00622722633794
0.00747571125362
0.00673302534481
0.00553043072687
0.0058541888643
0.00615739539028
0.00634796246897
0.00647418959837
0.00664036155583
0.00696081307199
0.0066377217245
0.0065372615384
0.00665849512268
0.00701760287737
0.00766860324957
0.00744835847346
0.00740007192421
0.00734737016546
0.00714664685311
0.00676881083532
0.00640263059985
0.00775205485326
0.0068473962362
0.00558543253099
0.00591670566854
0.00624975696534
0.00647562728819
0.00661455104834
0.00670892313152
0.00678250048179
0.006749757353
0.00677742956521
0.00690888059515
0.00714280540078
0.00742934644457
0.00755035452024
0.00760000582416
0.00753153851596
0.00728825109853
0.00688444969041
0.00651817838216
0.00794832166762
0.00681785222221
0.00555832711709
0.00590283967065
0.00626207296258
0.00652249234123
0.00669081304534
0.00679792502832
0.00687202408229
0.00692355027505
0.00700569334915
0.00714232213504
0.0073257212916
0.00751863179714
0.00764869344292
0.00768359624026
0.00757942534137
0.00730559315232
0.00688569945549
0.00651587524267
0.0079548942299
0.00656126788255
0.00540335152467
0.00577135794084
0.00615564326677
0.00644278395694
0.00663719055875
0.00676684113465
0.00686223023437
0.00694755381978
0.00705057966866
0.00718336958809
0.00733764971433
0.0074863707093
0.00758582151823
0.00759071670922
0.00745898854749
0.00716581709132
0.00673358082907
0.00634268086525
0.0076730035733
0.00600215820367
0.0050792866563
0.0054944684726
0.0059057908518
0.00621451617918
0.00642764605981
0.00657247192996
0.00667994405099
0.00677638386578
0.00688229347134
0.00700568213046
0.0071393605535
0.00726092762807
0.00733441161613
0.00731634153762
0.00716590496504
0.0068568214608
0.00640064349027
0.00594997039781
0.00700291377125
0.00505694137721
0.00455600445317
0.0050684776803
0.00552730076899
0.0058632158124
0.00609228718227
0.00624640818973
0.00635870046895
0.00645626249181
0.00655782320702
0.00667064393335
0.00678890267104
0.0068924517536
0.00694783890263
0.00691232596674
0.00674186734518
0.00640129455748
0.0058846997294
0.00530346039263
0.00584058664521
0.0036488858223
0.00386958126404
0.00459432727677
0.00516407738491
0.00556151353781
0.00582375620105
0.00599367278698
0.00611183882505
0.00620864056094
0.00630521039648
0.0064096828454
0.00651812464854
0.00661053816122
0.00665128258092
0.00659132681975
0.0063761625181
0.0059557041256
0.00529832084261
0.00444982401206
0.00411285846616
0.00186579973888
0.00367739125377
0.00516580040811
0.00620345748231
0.00689009441813
0.00732251006664
0.00758517000388
0.00774996112976
0.00787097615213
0.00798439088642
0.00810516010144
0.00823023639634
0.00833176373239
0.00835025943856
0.00819835306496
0.00777985223592
0.00700529848684
0.00579286310043
0.00407808893458
0.00202151068911
0.00202242338951
0.00383543222963
0.00521935270055
0.00607409959052
0.00650994923097
0.0066409432226
0.0065864558205
0.00645760165337
0.00633490484696
0.00626305889315
0.00627142257165
0.00636200195132
0.00651313474712
0.00667392898723
0.00674446205768
0.00661913056308
0.0061815915618
0.0052996811
0.00386615639218
0.00199678938058
0.00380751853632
0.00396891405446
0.00465343891166
0.00512391050121
0.00537432138662
0.00545615167889
0.00543253959869
0.00536520887988
0.00530247172894
0.00527360675988
0.00529210910947
0.00536018333657
0.00546937500472
0.0055858018966
0.00565348303912
0.00559986472538
0.0053500761412
0.00484813685317
0.0041204114501
0.00383059143622
0.00518956829023
0.00464584681198
0.00514610049588
0.00552632443245
0.00572900530355
0.00578407222593
0.00574337900553
0.00566152680693
0.0055829444737
0.00554198378519
0.00555673189675
0.00563106159507
0.00575554138735
0.00589045377141
0.00598620065198
0.00597413695991
0.00578359158761
0.00538156898712
0.0048644755449
0.00531383928283
0.00604643015664
0.00512201075053
0.00553743717935
0.00587402731117
0.00604644857234
0.00607370230939
0.00600373639586
0.00588258575776
0.0057602295119
0.00569317919998
0.00570634208769
0.00580581097751
0.00597769917464
0.00615100266016
0.00628668830177
0.0063191262414
0.00617393570012
0.00582763249858
0.00541727539506
0.00628969977495
0.00648198823583
0.00539126400115
0.00577280567952
0.00608629324103
0.00623420062273
0.00623225756862
0.00613447470768
0.00598067322282
0.00576966434422
0.00565461812536
0.00566699133293
0.00581722522699
0.00608888887095
0.00628745999505
0.00645545148226
0.00653317499093
0.00642877779881
0.00611766379502
0.00575658772497
0.00683732800996
0.00662618634895
0.00550536959579
0.00587746066034
0.00617487155847
0.00629941163402
0.00627455071978
0.00620231283374
0.00616112310157
0.00567503583401
0.0054584769601
0.0054683176469
0.00572835907973
0.00631278649482
0.00640100523712
0.00652982231833
0.00663619075172
0.00656842283398
0.00628187387144
0.005937074447
0.0070793320914
0.00661040939708
0.00552376242991
0.00589455056053
0.0061758419242
0.00628861894452
0.00630617832443
0.00667230693833
0.00973905782059
0.00716057778789
0.00667024921337
0.00666598726692
0.00723760258205
0.00971676886285
0.00691417403571
0.00662026462673
0.00668074977196
0.00663544601967
0.00636900016023
0.00602601675525
0.00716232339735
0.0065428731385
0.00550199158792
0.00586819767711
0.00613031401526
0.00624790583845
0.00647378251246
0.0105170340898
0.0108152695311
0.00691480831327
0.00674766895831
0.00669073519858
0.00643145005859
0.00608529039923
0.00720561164012
0.00650093382619
0.00548550544463
0.00584206309682
0.00608443759963
0.00615151097557
0.00613451349563
0.00793994863857
0.0081840322397
0.00669595755331
0.00678070369864
0.00676699552647
0.00651129540826
0.00615895223145
0.0072785946138
0.00652915166148
0.00550267235961
0.00585269085657
0.00609908996822
0.00617808749402
0.00616718933975
0.00787839619325
0.0083527939257
0.00690825427136
0.0069703038404
0.0069283106982
0.00664749634784
0.00628030342245
0.00742741429519
0.00665202848391
0.00556425545983
0.00591134807311
0.00618544143849
0.00634259104471
0.00662464906181
0.0103226652953
0.0119375830443
0.00768525663831
0.00733647645953
0.00717971852114
0.00684500030609
0.00645539284368
0.00766646257932
0.00684758852156
0.00565975851057
0.00600323022775
0.00630117734547
0.00648060991145
0.00666361645707
0.00728115627838
0.0118004281503
0.00898990384003
0.00858745957292
0.00876865590824
0.00953964438561
0.0130688748174
0.00840887150691
0.00774448134168
0.00762698321136
0.00744538077145
0.00706592514972
0.00666238342025
0.00797386830495
0.00703610832666
0.00575606079606
0.00610204569097
0.0064280134911
0.00663598793593
0.00677791698217
0.00695688206509
0.00729837441766
0.00699457178883
0.00691151360067
0.00706254707319
0.00746775014937
0.0081694072668
0.00797533478516
0.00794201934236
0.00789415903341
0.00767716788226
0.00726217159947
0.00685796064818
0.00828735285911
0.00715566088738
0.00581293146441
0.00616456848312
0.00652131767151
0.00676630736813
0.0069220149722
0.00703178689454
0.0071211420693
0.00710892112874
0.0071608283384
0.00732258605604
0.00759511016765
0.00792174267225
0.00807463163717
0.00814379808872
0.0080793675165
0.00782052304648
0.00738387852323
0.00698763080345
0.00851654140975
0.0071223873336
0.0057807379892
0.0061453471856
0.00652836609017
0.00680911213016
0.00699498288419
0.00711860302251
0.00721053443688
0.00728305812491
0.00739023750827
0.00755706584897
0.00777548460734
0.00800377123148
0.00816324905194
0.00821679416413
0.00811647147992
0.00782923600372
0.00738201520403
0.00699013912352
0.00854456976975
0.00684993476482
0.0056130927137
0.0060004592889
0.00640993135651
0.00671851763778
0.00693117912049
0.00707773649679
0.00719118367194
0.00729736687648
0.00742532385873
0.00758748135353
0.00777406806776
0.00795456877356
0.00808096682812
0.00810311821782
0.00797547391477
0.0076715073983
0.00721671977192
0.00680916738146
0.00826347862761
0.00625647703108
0.00526771483139
0.00570257526196
0.00613991402084
0.00647120165246
0.00670327035917
0.00686526456715
0.00699059881056
0.0071074560226
0.00723735926528
0.00738842855685
0.00755221383868
0.00770345648801
0.00780230136824
0.0078008950005
0.00765509667695
0.00733684490358
0.00685981077415
0.00639218016876
0.00756112321301
0.00525940150762
0.00471519077515
0.005250084761
0.00573591589796
0.00609556222163
0.0063443976649
0.00651594228354
0.00664569679955
0.0067628453356
0.00688747101338
0.00702698890316
0.00717451729191
0.0073072878199
0.00738788524335
0.00736910066326
0.00720306723067
0.00685203647975
0.00631063131801
0.00570249350863
0.00631883770755
0.00378371389586
0.00399680186285
0.00475272403646
0.00535378453623
0.00577777705145
0.00606164871941
0.00624982558767
0.00638573524794
0.00650216568137
0.00662206323648
0.00675391144648
0.00689299544991
0.00701666146441
0.00708446740909
0.00704159731821
0.00682833185968
0.00639037365387
0.00569474233527
0.00479312058491
0.00445336620807
0.00192869412178
0.00380685674122
0.00536226579701
0.00645557371804
0.00718554188914
0.00764919539035
0.00793514052124
0.00812123991437
0.00826598336065
0.0084084446495
0.00856498366482
0.00873278304279
0.00888004260623
0.00893870195678
0.00880710087851
0.00837780541565
0.007555509281
0.00625513936275
0.00440836994611
0.00217364033011
0.00211773821816
0.00401725689658
0.00547170719471
0.00636809397271
0.00681786202785
0.00694054254936
0.00686102298607
0.00670518551375
0.00656058047332
0.00648262909117
0.00651305154975
0.00663767586131
0.00683797945669
0.00705964300668
0.0071888607542
0.00709941444116
0.00665598646611
0.00570795445217
0.00414946668641
0.00212022966023
0.00397736827525
0.00413503248697
0.00486111310865
0.00535724650914
0.00561562401414
0.00569128426699
0.00565240831969
0.00556909753131
0.00549702906456
0.00546978095818
0.00550341413177
0.00560078758119
0.00575357979708
0.00592061688638
0.00603686671184
0.00601510435458
0.00576655522787
0.00522710544182
0.00442695148658
0.00407354088087
0.00542826393988
0.00485530186718
0.0053990953722
0.0058061014049
0.00601548201377
0.00606088808455
0.00600002911134
0.00589598358487
0.00580321016574
0.00575959921093
0.00578684009141
0.00589122678499
0.00606330798079
0.00625439282341
0.00640446133835
0.00643032279938
0.00624711290649
0.00581507519675
0.00523844077467
0.00566835246286
0.00633196028381
0.00536552089689
0.00582843202922
0.00619337018967
0.00637079742201
0.00638384061229
0.00628799463367
0.00613708590868
0.00599285344999
0.00591836574139
0.00594195477
0.00607312375049
0.00629946985129
0.00653695900159
0.0067343525178
0.00681193632
0.00667959627858
0.00630652849826
0.00584058941725
0.00671861311481
0.00679267176046
0.00565785810333
0.00609034118529
0.00643250804394
0.00658276991805
0.00656122792122
0.00643299278223
0.00623901008417
0.00599759665257
0.00587001226709
0.00589052250784
0.0060747170329
0.00640968624057
0.00668086862637
0.0069178396502
0.00704789547325
0.00696075924429
0.0066233752091
0.00620584597839
0.0073021590953
0.006944766074
0.00578476273503
0.00621017729274
0.00653509997307
0.00665769500193
0.00660653599208
0.00650430499074
0.00641231970674
0.00588206035191
0.00564726933226
0.00566304456309
0.00596292984991
0.00663278124144
0.00679923288396
0.00699905377679
0.00716239505651
0.0071153186676
0.00680191527842
0.00639766447415
0.0075533082854
0.00692731700964
0.00580679188005
0.00623175550791
0.00653694353044
0.00664479416126
0.00663333131821
0.00702585886776
0.0101674214914
0.00739624599692
0.00688149775592
0.00688738944468
0.00752288038289
0.0101700654043
0.00734682867681
0.0071056605857
0.00721792711659
0.00719236296729
0.00689759565203
0.00649219439772
0.00763873081361
0.0068553212021
0.00578313367364
0.00620069726637
0.00648409030316
0.00659652018314
0.00679300291823
0.0110167670681
0.0115574593324
0.00745522622168
0.00730906306193
0.00726112682036
0.00696813481891
0.00655769356559
0.00768861166794
0.00681005153325
0.00576287133473
0.00616631088292
0.00642860327249
0.00649052597032
0.00643474681716
0.00834581773511
0.00881174879683
0.00724610777344
0.00736374644608
0.00735276675015
0.00705730299337
0.00663862384829
0.00776831100859
0.00684356556018
0.00577735090439
0.00617028320924
0.00643777435474
0.00651632052868
0.00647220554772
0.00826244368359
0.00905205090668
0.00750261899937
0.00758312475274
0.0075331609472
0.00720656347088
0.00677175356846
0.00793001330976
0.00698334009009
0.00584005096991
0.00622609093898
0.0065242921135
0.00668994020272
0.00696803079549
0.0108671402279
0.0130897566344
0.00837318300685
0.00798417126541
0.00780556498467
0.00742014875161
0.00696343232969
0.00819098090185
0.00719580996127
0.00593981223641
0.00631834042255
0.00664233883356
0.00683583574435
0.00703034860724
0.00764927371708
0.0125548732554
0.00958311129889
0.00916525335067
0.00939513294648
0.0102397214878
0.0140089130237
0.00911947774528
0.00840501852807
0.00828529127796
0.00808435940644
0.00765426460796
0.00718762628131
0.00852723951129
0.00739858435695
0.00603861505743
0.00641677176312
0.00677000020321
0.0069955528291
0.00715154931096
0.0073407820047
0.00770169710176
0.00742081230283
0.00736062718346
0.00754943393418
0.0080025216499
0.00876092016799
0.00860544092287
0.0085947721109
0.00855486162623
0.00831867944496
0.00785708621765
0.00739735339324
0.00887225994513
0.00752131424826
0.0060939150364
0.00647391739166
0.00685921001617
0.00712457986343
0.00729688376554
0.007421808924
0.00752824332805
0.00753871510493
0.0076182755244
0.00781418827242
0.00812997919656
0.00850342159436
0.00869489266809
0.0087885900114
0.00873043599417
0.0084536849183
0.00797628857245
0.00753472387786
0.00912958402962
0.00748057470666
0.00605113175686
0.00644342560952
0.00685610025751
0.00715811578408
0.00736220343207
0.00750282304972
0.00761403373486
0.00771012638622
0.00784556042241
0.00804529488035
0.00830277909078
0.00857129984718
0.00876508054215
0.00884081661533
0.00874561268528
0.00844302024619
0.00796198389039
0.00753541661831
0.00917632654429
0.00718711499578
0.0058649493504
0.00627836087941
0.00671833952849
0.00705103979325
0.007283068812
0.00744722830038
0.00757993495376
0.00770889035598
0.00786393619146
0.00805815870936
0.008280410933
0.00849644916991
0.00865340317258
0.00869537328099
0.00857275631232
0.00825652942276
0.00777412524164
0.00733973651547
0.00889407227832
0.00655642991109
0.00549308666005
0.00595326089182
0.00642166279305
0.00677858170466
0.00703104805696
0.00721091864606
0.00735491882697
0.00749352912593
0.00764918936331
0.00783007770703
0.00802667105045
0.00821055312243
0.00833750755502
0.00835475182566
0.00821441356331
0.00788592639126
0.00738408348958
0.00689129052408
0.00815766958988
0.00550295347486
0.0049063322654
0.00546822005011
0.00598548169364
0.00637188260745
0.00664196125227
0.0068314810658
0.00697917417577
0.00711675208817
0.00726583154896
0.00743387866684
0.00761300518699
0.00777747565131
0.00788553898497
0.00788518497457
0.00772439628075
0.00736222529983
0.00679290418249
0.00615146698186
0.00683532141621
0.00395028116483
0.00415076043595
0.00494158650141
0.00557737658195
0.00603025838184
0.00633696078822
0.00654355936553
0.00669722659554
0.00683370598379
0.00697817536868
0.00713926293331
0.00731125147166
0.00746844975127
0.00756536480478
0.00754106073128
0.00733050360155
0.00687499010291
0.00613915741057
0.00517947106395
0.00483157030687
0.0020066604123
0.00395769730095
0.00558446498631
0.00673320763022
0.00750692702785
0.00800121374858
0.00830817658585
0.00851404977773
0.00868149972333
0.00885374439779
0.00904716811314
0.00925933684317
0.00945438002663
0.00955493880968
0.00944501452585
0.00900647616604
0.00813888316146
0.00675363094088
0.00477659894006
0.0023644455561
0.00223833680317
0.00424461219179
0.00579570937327
0.00675092335537
0.00722166084756
0.00732985562587
0.00721795941162
0.00702517213441
0.00685017350915
0.00676726364556
0.00683053154132
0.00701027966491
0.00728882688328
0.00759938707463
0.00781392436039
0.00777795865958
0.00732511538804
0.00628774358023
0.00455699185162
0.00229603167342
0.00419212265679
0.0043702925151
0.00515137586332
0.00568091230591
0.0059490074881
0.00601576199498
0.00595636459038
0.00585044980103
0.00576484028815
0.0057404733064
0.00579737238622
0.00594117028431
0.00615867883208
0.00639696600489
0.00658108045983
0.00660292339327
0.00635565569463
0.00576738178107
0.00487306934206
0.00442694099967
0.00574086860843
0.00515149238576
0.00575237762778
0.00619308432415
0.00641013729848
0.00644302675109
0.00635648595849
0.00622220058577
0.00610943796375
0.00606248426234
0.0061085864271
0.0062584473342
0.00649931239969
0.00676781411789
0.00699160749382
0.00706836868354
0.00689664213303
0.0064296830472
0.00578095497424
0.00617772713346
0.00671775343995
0.00571326572037
0.00623697515481
0.00663539847743
0.00681670859888
0.00681071211729
0.00668212720701
0.00649153979017
0.00631736536248
0.0062334861561
0.00627309784723
0.00645062385487
0.00675340027447
0.00707778800449
0.00735725988614
0.00749460767992
0.00738201639982
0.00698056798695
0.00644861626986
0.00732373750963
0.00721949907438
0.00604335662797
0.00654060989513
0.00691447058495
0.007063834902
0.00701613105609
0.00685055621588
0.00660296915585
0.00631980277255
0.00617599386505
0.00620867003732
0.00644023944265
0.00686209526257
0.00723172504623
0.00755904484395
0.00775706783865
0.00769484536268
0.00732946375633
0.00684304510142
0.00794178073367
0.00738479743487
0.00619594864604
0.00668889711971
0.00704169767892
0.00715745992614
0.00707281199022
0.00693817471467
0.00677359152461
0.00617964573716
0.00592008072305
0.00594402278879
0.00629452324898
0.0070801505278
0.00735432940485
0.0076489530162
0.00788541002841
0.0078658154953
0.00752163325325
0.00704171657965
0.00818898723034
0.00736717793864
0.00622867058503
0.00672301049896
0.00705133486518
0.00714807277977
0.00710085658938
0.00754197687018
0.0107463775681
0.0077163035666
0.00717065943369
0.00719351037356
0.00790024678521
0.0107574951651
0.00792590135248
0.00777137414506
0.00795234979719
0.00795207670608
0.0076206715283
0.00713291801213
0.00826184287812
0.00728659231567
0.00620197108148
0.00668774242796
0.00699173449249
0.0070920451574
0.00724957436322
0.0117123124589
0.0125236660933
0.00818705092304
0.00806966972529
0.00803109893459
0.00769184280922
0.00719421015246
0.00830394929567
0.00723040253785
0.00617025265599
0.00663816841514
0.00691988338293
0.00696885066993
0.00686112452609
0.00890207200848
0.00963316532531
0.0079870798922
0.00814404617072
0.00813131467336
0.00778035940446
0.00727094019839
0.00837421392457
0.00725521849036
0.0061711964131
0.00662507484137
0.00691422681454
0.00698515133406
0.00689556343903
0.00878876856146
0.00997073498077
0.00828662548055
0.00838507620249
0.00831933909474
0.00793055570529
0.00740337538317
0.00853083972469
0.00740302751583
0.00622527979797
0.00666693978292
0.00699090104603
0.00715921417424
0.00742475867856
0.0115534128066
0.0146144402501
0.00924384939308
0.00880723000961
0.00859914331113
0.00814834890601
0.00760150459047
0.00879903285048
0.00762710642001
0.00632183098796
0.00674937366562
0.00710149110539
0.00730489446727
0.00750557595551
0.00811268261606
0.0134662836061
0.0103094659853
0.00990386014766
0.0101981828212
0.0111138136181
0.0151740948476
0.0100011832339
0.00922383565157
0.00910176738839
0.00887540690708
0.00838405626525
0.00783385979122
0.00915161016607
0.00784081061241
0.0064157461056
0.00683705099438
0.0072196736938
0.00746015205084
0.00762681559519
0.00782289690363
0.00820728131013
0.0079490862081
0.00791751644774
0.00815050127988
0.00865491841254
0.00948208626014
0.00937168777809
0.00938661550041
0.00935477611384
0.00909636760005
0.00858091847336
0.00804816265165
0.00951787212987
0.00796112896836
0.00646057331941
0.00687882630368
0.00729358652391
0.00757803682446
0.00776504898967
0.00790373706436
0.00802797606279
0.00806365784671
0.00817499486437
0.00841082990432
0.00877109022986
0.00919839002445
0.00943324972391
0.00955408578546
0.00950284714608
0.00920640630825
0.00868335781119
0.00818220055509
0.00979327379822
0.00790731351515
0.00639479899987
0.00682332405801
0.007268998864
0.00759208688731
0.00781367773791
0.00797081248101
0.00810237103666
0.00822459698732
0.00839153507199
0.00862571559225
0.00892450165484
0.00923702449195
0.0094685932796
0.00956833865385
0.00947882654579
0.00916021403268
0.00864161925939
0.0081690468413
0.00984864264537
0.00758747203978
0.00617888621653
0.00662612977222
0.00710094756489
0.0074593087906
0.00771101796808
0.00789278367882
0.0080455719268
0.00819895314631
0.00838242967873
0.008609989605
0.00886973560298
0.00912361274354
0.00931330407919
0.00937633940643
0.0092592286185
0.00893010847166
0.00841666733189
0.0079457100182
0.00955437272468
0.00691467556818
0.00577148905687
0.00626443178657
0.00676896230524
0.00715408907601
0.00742800545195
0.00762605027604
0.0077891636353
0.00795035404562
0.00813271176134
0.00834425486853
0.00857495063828
0.0087929667957
0.00894922235699
0.00898568013058
0.00885071547342
0.00851060988353
0.0079801514177
0.00745325202879
0.00877580602501
0.00579909114785
0.00514271009574
0.00573926372288
0.00629361368701
0.00671008050385
0.00700316328208
0.0072110984463
0.00737678381793
0.00753507324295
0.00770924087915
0.00790657456986
0.00811837478667
0.00831540610207
0.00845123236682
0.00846899701653
0.00831242555148
0.00793675924906
0.00733495678667
0.00665210334814
0.00737223592277
0.00415823194553
0.00434248078108
0.00517643909535
0.00585315999712
0.0063390525744
0.00667055497089
0.00689605494271
0.00706688374947
0.00722328894993
0.00739277212631
0.00758402420923
0.00778984306004
0.00798085117218
0.00810587885992
0.00809832679255
0.0078884262637
0.0074127905697
0.00663231512089
0.00560731890611
0.00523538285288
0.00210388630402
0.00413989213609
0.00584639423611
0.00705678305796
0.00787634298977
0.00840186180106
0.00872942856395
0.0089517786382
0.0091409081952
0.00934229180459
0.0095703942436
0.00982383594853
0.0100623981797
0.010198212019
0.0101032422175
0.00965185764907
0.00873958015724
0.0072729740111
0.00516891493199
0.00259848635677
0.00240204282915
0.00452228935605
0.00620098640021
0.00724001965884
0.00774236820785
0.00783613248716
0.0076895179222
0.00745417177036
0.00724204544146
0.00716818203578
0.00727247622907
0.00753422580951
0.00792274109129
0.00835243387279
0.00867294980251
0.00869129137641
0.00821146784901
0.00705875868025
0.00511136815743
0.00255217574032
0.0044536811071
0.0046306199513
0.00549538524142
0.00608123819118
0.00637867612727
0.00645521730397
0.00638914564689
0.00626184192358
0.00615799369773
0.00613381869864
0.00621933678016
0.00643170211422
0.00673991854364
0.00706946496516
0.00733723307897
0.00740600686813
0.00715072906326
0.00649595275473
0.00548758594006
0.00492420755572
0.00613647331001
0.00551264095714
0.00619225291138
0.00667885731649
0.00691368869026
0.00694557074182
0.00684625847858
0.00668655207602
0.00655225979528
0.00650089540338
0.00657066123895
0.00678432198261
0.00711728651183
0.0074823868141
0.00779455743696
0.00792886358544
0.00776780402905
0.0072604432554
0.00653445699584
0.00689350870266
0.0072336348086
0.00616697145857
0.00676136768657
0.00719656091789
0.00738486689749
0.00736529758689
0.00721532543558
0.00698968399512
0.00678331476477
0.00669017814109
0.00675126934894
0.00699084859834
0.00739393523088
0.00782557092162
0.00820198183879
0.00840785854233
0.0083199879638
0.00789339088458
0.00729653281752
0.00816792700517
0.00782302332032
0.00657873598291
0.00713845888442
0.00753845988041
0.0076846340797
0.00761342043949
0.00742401539627
0.00712412299077
0.00679179297031
0.00662978008055
0.00667859105934
0.00697086329172
0.007505792826
0.00799793744063
0.00843085425759
0.00870618144299
0.00867542427859
0.00828714688628
0.00773026344675
0.00882045709529
0.0080311719904
0.0068035749288
0.00735199360985
0.00771723998012
0.00781957750208
0.0077066206844
0.00756766667373
0.00731821311724
0.00663919080279
0.00634683202298
0.00637895234089
0.00678951306641
0.00772355734833
0.00813353775852
0.00853923743774
0.00885857262607
0.00887205935655
0.00849926772515
0.00793503123216
0.00905005754218
0.00803037468789
0.00688284368301
0.00743507742207
0.00776556976645
0.00784123383914
0.00776807795638
0.00832194375216
0.0115773700674
0.00822440462261
0.00765125330683
0.00770135017925
0.00847172698645
0.0115729744631
0.00872326010039
0.00868368859053
0.00894350284881
0.00897226145723
0.00860011716537
0.00801360366036
0.0090884252588
0.00793631119428
0.00686493260126
0.00741843776356
0.00772377176706
0.00780046130462
0.00792401596397
0.0127319917748
0.0138372086713
0.00918426713364
0.00909212032274
0.00905947374594
0.00866293492943
0.0080548538309
0.00909628294383
0.00783734184769
0.00681234818767
0.0073528911039
0.00763736045379
0.00765895225738
0.00749204145217
0.00972582876459
0.010749334579
0.00899155117652
0.00917971178835
0.00915412926434
0.00873327325862
0.00810666254177
0.00912775964545
0.00782895593151
0.00677864892541
0.00730848916908
0.00760684815326
0.00765469948818
0.00750819434477
0.00956381554452
0.0112068433798
0.00932322892192
0.00942185309263
0.00932500822225
0.00886022648659
0.00821552348311
0.00925001170244
0.00796539495487
0.00680070167961
0.00731453405337
0.00765623694321
0.0078129632031
0.00805447126871
0.0124583896289
0.0166048503151
0.0103452306523
0.00983638618373
0.00958459008266
0.00905919305873
0.008403651798
0.00950910146746
0.00818918174656
0.00687490821802
0.00736314508639
0.00773775717959
0.00793953689434
0.00813649365593
0.00871101823591
0.0146100601109
0.0112259442193
0.010825136168
0.0111968116306
0.0122454731401
0.0167087041142
0.0111080339728
0.0102303242879
0.0100900254225
0.00982966973347
0.00927431933533
0.00863019888825
0.00986621115808
0.00840581650391
0.00694952766773
0.00741614561119
0.00782292378396
0.0080694454404
0.00823885477912
0.00843452242602
0.00884765966426
0.00861281336953
0.0086139089888
0.00889715772773
0.00946616422922
0.0103806591149
0.0102978784081
0.0103251110143
0.0102918819705
0.0100078226805
0.00944165427413
0.0088332176632
0.0102394750882
0.00850902760764
0.00695890732476
0.00742110032924
0.00785804620931
0.00815554155519
0.00835206495031
0.00850063031118
0.00864231755549
0.00870606125609
0.00885283153838
0.0091332144013
0.00953596382927
0.0100175005041
0.0102905872344
0.0104302690166
0.0103805440692
0.0100655014704
0.00950304582103
0.00894506829759
0.0105168995827
0.00842358264302
0.00684468232237
0.00731257678173
0.00779033919527
0.00813178338822
0.00836776396164
0.00853945332827
0.00869134582449
0.00884162417415
0.00904148949411
0.00930947422662
0.00964442337347
0.00999679597355
0.010260910444
0.0103788458727
0.0102925472505
0.00996081899351
0.00941211492712
0.00889797611774
0.0105611979382
0.0080628144239
0.00657874154178
0.00706320793096
0.00757382858197
0.00795771993918
0.00822861118443
0.00842774824399
0.00860098094378
0.00877955646315
0.00899039849578
0.00924726404566
0.00953943151435
0.00982600750131
0.0100431886818
0.010122853379
0.0100099449453
0.00967092458827
0.00913224228625
0.00862718566889
0.0102338643285
0.0073389382995
0.00612122439524
0.00665168676453
0.00719511851229
0.0076100703676
0.00790636465453
0.00812336328523
0.00830597905112
0.00848954599109
0.0086966585225
0.00893493784802
0.00919498076732
0.0094420020966
0.00962240654127
0.00967424366748
0.00954335858603
0.00919273441686
0.00863618617914
0.00807372909568
0.00939796645977
0.00615200317634
0.00543797018314
0.00607808711606
0.0066748529083
0.00712467161032
0.00744308084333
0.00767103779217
0.00785488095138
0.00803331069108
0.00823088404569
0.00845460071555
0.00869537093791
0.00892021730717
0.00907852117561
0.00911018878957
0.00895496190805
0.00856365117979
0.00792673137869
0.00719667720223
0.00790920729779
0.0044096373889
0.00458159579597
0.00547369291772
0.0062011068555
0.00672500552106
0.00708475010007
0.00733133066744
0.00751909452552
0.00769448189414
0.00788778958494
0.00810816012505
0.00834554755351
0.00856593680932
0.00871253438946
0.00871504006051
0.00849950140393
0.00799779886641
0.0071659761333
0.00606853859569
0.00565397465331
0.00222561398782
0.00435708918001
0.00616209634807
0.00744684827937
0.00832217315538
0.00888436852305
0.00923304989978
0.00947011194688
0.00967829580575
0.00990598943533
0.010164173995
0.0104490855139
0.0107174878173
0.0108702494462
0.0107742777832
0.0103021497486
0.00934539821645
0.00780222617494
0.00557831792532
0.00288109123787
0.00261057641345
0.00487090922597
0.00673163238965
0.00790236862447
0.00846071395788
0.00853966811407
0.00833419309993
0.00801630601848
0.00775288632123
0.00771008586482
0.00786094435762
0.00824542702866
0.00878920454985
0.00935837366823
0.00977891456291
0.00982093456048
0.00927856369784
0.00798286711052
0.00579185401926
0.00292437642704
0.00479207075921
0.00494154797101
0.00590226928503
0.00655681575963
0.00689577482445
0.00700307716724
0.00698008241839
0.00687614295203
0.00677428516875
0.00675136980464
0.00685950999557
0.00715078438691
0.00756621981609
0.00799697426161
0.00833742086264
0.00842813317854
0.00813209200156
0.00738153855965
0.00624879878598
0.00560796787276
0.00667929416596
0.00595319609115
0.00670775731822
0.00724159076441
0.00750110916959
0.00754786135283
0.00748107128671
0.0073379263229
0.00720329119341
0.00716028954831
0.00725691174577
0.00754038769715
0.00797183236098
0.00843542999689
0.00882525790928
0.00900235124005
0.00884003481753
0.00828931402649
0.00749841852639
0.00785433978174
0.00797969140445
0.00673282354575
0.00738244074401
0.0078514368787
0.00804964676074
0.0080245657972
0.00789085108611
0.00766929273476
0.00744710145083
0.00736145308368
0.0074511726303
0.00775949028354
0.00827060667467
0.008811056475
0.00927320421879
0.00953611778819
0.00947282351833
0.00903793778762
0.00840990415244
0.00929553086054
0.0087362312022
0.00727276840987
0.00786917500335
0.0082839123556
0.00842696183901
0.00833823734398
0.00817047807549
0.00785003829219
0.0074729035945
0.00730705880193
0.00737952740474
0.0077385139509
0.00840052455977
0.00902031218825
0.00954757276054
0.00988817525837
0.00989211038351
0.00950590686701
0.00891741814096
0.0100007567301
0.00907098912313
0.00764572962859
0.00820385883843
0.00855072231836
0.00863339938274
0.00851247749084
0.00845587737019
0.00813785595733
0.00735505770483
0.00703233181582
0.00707093692571
0.00754115131999
0.00864717863935
0.00920431126749
0.00970602778724
0.0100946744485
0.0101439123345
0.00976683369381
0.00914920826401
0.0102222270013
0.00913549901612
0.00788180813275
0.00842329773662
0.00869997264802
0.00873904937271
0.00868013383308
0.00948456980325
0.01280784242
0.00913988037008
0.00852610576372
0.00860765258942
0.00941341628975
0.0127945216645
0.00984699149794
0.00990357170245
0.0102246275816
0.0102827999071
0.00989110954659
0.00922188167613
0.0102048927159
0.00902550868445
0.00794616698591
0.00850770273752
0.00875338069517
0.00878392632501
0.00889981708193
0.0141861564656
0.015718789971
0.0105342555858
0.0104243711539
0.0103881865161
0.00994668814536
0.00922572021192
0.0101268734743
0.0088428970479
0.00789320459918
0.00845083219658
0.00867714970208
0.00864071834796
0.00841178939185
0.0109797099649
0.0123899957779
0.0103513461852
0.0105121822172
0.010457158365
0.00997006387639
0.00921236615013
0.0100658951616
0.00873883313333
0.00780209806857
0.00837409079922
0.00862651452869
0.00861420518346
0.00839563352988
0.0107532653428
0.0130378874572
0.0106891071372
0.0107130607504
0.0105629519636
0.0100229855919
0.00924984178588
0.0101118615299
0.00880543547725
0.00774065091199
0.00831263881693
0.00863027029524
0.00873958168945
0.00893831452724
0.0137174108669
0.0192959013763
0.0117303864199
0.0110695432506
0.0107548035134
0.0101601538232
0.00939694478668
0.0103534524482
0.00899656857266
0.00773168090161
0.00827428999421
0.00864329391465
0.00881457101239
0.00898971417727
0.00950971377335
0.0160654793429
0.0123696377892
0.0119741307962
0.0124592594039
0.0136938603259
0.0187503687657
0.0125288591341
0.0114303169708
0.0112287278988
0.0109252297569
0.0103145810787
0.00959077915233
0.0107179922101
0.00919005359816
0.00773198111648
0.00822961184049
0.00864279227106
0.00887569062863
0.00903117415505
0.00921224780314
0.00966050994264
0.00945158453051
0.0094895544377
0.00983059720886
0.0104872877559
0.0114869913523
0.011389825814
0.0113843638799
0.011326358663
0.0110125676381
0.0104071384861
0.00974716131575
0.0110883874908
0.00923316420904
0.00765121224337
0.00814026559967
0.0085861643792
0.00888627080494
0.00908230345607
0.00923260353883
0.00938787196381
0.00947966223856
0.0096620140686
0.00998414180327
0.0104294770672
0.0109489358087
0.0112367400371
0.0113696997078
0.0113065041535
0.0109719284957
0.0103835917683
0.0097966496417
0.0113413471041
0.00906903913198
0.00744580002143
0.00793412222684
0.00843472513828
0.00879129501219
0.00903533526288
0.00921830371088
0.00938775375755
0.0095640585854
0.0097928070513
0.0100911215226
0.0104444496562
0.0108192131963
0.0110950498209
0.0112118108006
0.011117540578
0.010772575022
0.0102077552788
0.00967717505352
0.011339652692
0.00863124964916
0.00709497330615
0.00760123019309
0.00814147350238
0.00854897945586
0.00883888821041
0.00905624187666
0.00925034299111
0.00945278512785
0.0096848801263
0.00995703185146
0.0102640909956
0.0105642250373
0.0107891616834
0.0108685592555
0.0107502011833
0.0104024207578
0.00985093302639
0.00932848715784
0.0109461454404
0.00782665835396
0.00656021193173
0.00712027893073
0.00770041608974
0.00814573042408
0.00846679672803
0.00870628977245
0.00891085704668
0.00911515393124
0.00933884929482
0.0095895859449
0.00986128555273
0.0101179689905
0.0103030565466
0.0103551277703
0.0102209896988
0.00986109852596
0.00928829299846
0.00869753348911
0.0100267873296
0.00654217759288
0.00579989353004
0.00648782458233
0.00713167159251
0.0076186879636
0.00796768493637
0.00822133835401
0.00842687517666
0.00862371245951
0.00883667171867
0.00907382380692
0.0093271690718
0.00956042017437
0.00972195169053
0.00975344412446
0.00959179178124
0.00918288322254
0.00851308354711
0.00772926351398
0.00843517312386
0.00468123139065
0.0048719723823
0.00584323708263
0.0066352296041
0.00720585008381
0.00760159172764
0.00787598049337
0.00808421674664
0.0082759364433
0.00848623217479
0.00872625569539
0.00898152321037
0.00921145557352
0.00935785011678
0.00935184710142
0.00911476418314
0.00857602698434
0.0076867601668
0.00650624001942
0.00607045841751
0.00238010977298
0.00461535417506
0.00654004706773
0.00791949706478
0.00885818326597
0.00947043709036
0.0098580172554
0.0101212553006
0.0103482168555
0.0105952019788
0.0108729190851
0.0111719961763
0.0114449862739
0.0115862668222
0.0114655031669
0.010959701978
0.00995579998737
0.00833778658561
0.00600048661997
0.00321377258446
0.0029394876803
0.00538968196376
0.00745928259961
0.00872277953299
0.00930458527781
0.0093701357986
0.0091823365396
0.00892652127741
0.00870218343535
0.00865552206963
0.00885238026572
0.00940969828257
0.0101565935665
0.0108438860669
0.0112722342467
0.0112127562888
0.0104965374544
0.00898223822686
0.00653216245498
0.00342120367971
0.00531131304546
0.00540676195317
0.00647077560013
0.007223909772
0.00765302683655
0.00787838921602
0.00805087814269
0.00801004106196
0.00793598188121
0.00794583446719
0.00807502330848
0.00839713258265
0.00885910714651
0.00931136942379
0.00961664221069
0.0096455532275
0.00924684965218
0.00835628840122
0.00708660181826
0.00643754289937
0.00746322372059
0.00657356222592
0.00740531267615
0.00801263345103
0.00832691335815
0.0084308534207
0.00849749033227
0.00838503840418
0.00823680975188
0.00824176870926
0.00838612663825
0.00871771446596
0.00919641377996
0.00969907531439
0.0100864701091
0.0102545328324
0.0100646695448
0.0094648754295
0.00862767951029
0.00908907932597
0.00895953517535
0.0075401109058
0.00823739602871
0.0087549404429
0.00897505636411
0.00895771706814
0.00891586179161
0.00871797550107
0.00844041090953
0.00838730605539
0.00852439750957
0.00888829720371
0.00946630254188
0.0100709236447
0.0105530065752
0.0108301107937
0.0107811218185
0.0103622111491
0.00976321084388
0.010827431792
0.00987041724543
0.0083133257958
0.00890439878735
0.0093214711545
0.00946714861895
0.00936816226064
0.00932575141547
0.00899885456866
0.00851136226882
0.00835066992778
0.0084522778618
0.0088616448471
0.00961482828416
0.0103237710681
0.0108848393517
0.0112478272503
0.0112825791812
0.0109411615633
0.0104248930919
0.0117123786852
0.0104289212905
0.00903419472979
0.00946527717839
0.00972529835333
0.009781439466
0.00970402165738
0.00995093007215
0.00952203989315
0.00857072642343
0.00821855517072
0.00824141838833
0.00873449902358
0.00997091470856
0.0106201063554
0.0111386375134
0.0115465088623
0.0116287530189
0.0113032689781
0.0107581866403
0.0119833419739
0.0107739664443
0.00968542495915
0.00998901347007
0.0100778957255
0.0100655149951
0.0101500093978
0.0115098595378
0.014990192154
0.011041931939
0.010329325073
0.0102785483359
0.0109548496897
0.0146077723913
0.0114461468118
0.0114499382411
0.0117646571536
0.0118485471644
0.011504407369
0.0108715377596
0.011868761575
0.01082854024
0.00988431125501
0.010252247935
0.0103250427345
0.0103080970544
0.0105345754395
0.016635267366
0.0185428291407
0.0123169342576
0.0120581919659
0.0120056479385
0.0115832181919
0.0108299234219
0.0115685190156
0.0106959720783
0.00986160498993
0.0101628223343
0.010210446832
0.0101062705496
0.0098568921646
0.0132261154884
0.0149348364357
0.0121760842538
0.0121510326705
0.0120453150896
0.0115419194072
0.0106895876591
0.0112793764868
0.0105322502978
0.00971596582837
0.0100600376111
0.0101209907505
0.0100118401989
0.00975520533883
0.0129608846384
0.0159164121618
0.0124997770937
0.0122731084692
0.0120431085812
0.0114577487469
0.0105737276549
0.011222310859
0.0104418675224
0.00948749757909
0.00989885999417
0.010055411172
0.0100639938237
0.010241771006
0.0159846544537
0.0233054388041
0.013500933686
0.0125191550273
0.0121172767211
0.0114746965391
0.0106230209655
0.0114961727094
0.0104971292912
0.00925124883184
0.00968774702318
0.00993978859992
0.0100186870134
0.0101507643018
0.0106833590723
0.018390863898
0.0141624915805
0.013789150532
0.0144460912605
0.0159360871118
0.021857807578
0.0144123135087
0.0128529598769
0.0125207241662
0.0121702447518
0.011518777453
0.0107368758032
0.011928230936
0.0105328091841
0.00900407427242
0.00942653380834
0.00976590278139
0.00993473075231
0.0100458875632
0.0102042657848
0.0107188697816
0.0105497694981
0.0106408756735
0.0110499027148
0.0117874905793
0.0128778007182
0.0126670125116
0.0125671520524
0.0124605228835
0.0121143613408
0.0114702084975
0.0107694892705
0.0122587595041
0.0103990374137
0.00869070461615
0.0091172086847
0.00952817928572
0.00979552128115
0.00996566182926
0.0101019010447
0.0102662674166
0.0103867005636
0.010606778204
0.0109686151962
0.0114541260069
0.0119876109038
0.0122676352487
0.0123720472588
0.0122800115457
0.0119149653991
0.011290221483
0.0106722591817
0.0123965061418
0.0100645468614
0.00829354867654
0.00872118413437
0.00921355829991
0.00956915417868
0.00980880515464
0.00999094701806
0.0101717306172
0.0103722503377
0.0106269206531
0.0109473832403
0.0113118446156
0.0116947336327
0.0119659638281
0.0120618545915
0.0119412636477
0.0115649846813
0.010965871399
0.010411224836
0.0122564528976
0.0094602507468
0.00778399740785
0.00824740398439
0.00879355483565
0.00921577415352
0.00952213540477
0.00975581995868
0.00997090826671
0.0101976603356
0.0104471597049
0.0107229879265
0.0110296471063
0.0113266965878
0.0115381326989
0.0115945118625
0.0114501982419
0.011074383923
0.0104940207216
0.00995129671128
0.0117349673268
0.00848172800506
0.00711655878087
0.00766858024157
0.00827093068572
0.00874039095931
0.0090868353882
0.00935314132705
0.00958560508406
0.00981302282254
0.0100448325263
0.0102919991905
0.0105559684625
0.0107985497682
0.0109606371724
0.0109881817545
0.0108327439036
0.0104532172556
0.00986200866007
0.00924730306143
0.0106899487352
0.0070169845705
0.00623610042166
0.00696565799155
0.00765614708606
0.00818389836363
0.0085685137336
0.00885563451865
0.00908991325771
0.00930481365213
0.00952072394782
0.00975081051433
0.00999006428108
0.0101979117236
0.0103278739834
0.0103347558844
0.0101550460049
0.00973104920216
0.00904069241211
0.00819757096374
0.00896343830576
0.00499253744991
0.00521079934382
0.00628874680236
0.00716913939503
0.0078051658345
0.00825252054049
0.00856779461519
0.00880126254348
0.00900039169434
0.00920662410171
0.00943821209515
0.00967437549364
0.00986673557961
0.00996968158205
0.00993020835837
0.00965810401918
0.0090879812268
0.00815262340164
0.00687650745962
0.00646892468587
0.00256633616193
0.00493126758543
0.00704850645045
0.00857759365704
0.00960258649047
0.0102759613548
0.0107157668176
0.0110040671027
0.0112223458631
0.011458462786
0.0117403949715
0.0120345992181
0.0122743070279
0.0123611313973
0.0121839137126
0.0116286865967
0.0105760590664
0.00888067137535
0.00642009146062
0.0036043576958
0.00342396545073
0.00602256316896
0.00834241755293
0.00965048261166
0.010227802548
0.010304006817
0.010411123851
0.0104132760447
0.010460041143
0.0107060715826
0.0112497116865
0.0119693858182
0.0128020162617
0.0133565263435
0.0134902805144
0.013061985495
0.0118745256086
0.00998061657218
0.00721908587076
0.00406312442959
0.0060073592231
0.00599764564008
0.00722236234401
0.00814482955138
0.00877212326669
0.00926861050946
0.00983132491879
0.00962819564591
0.00947515457082
0.00970763582225
0.0100563429355
0.0105075309959
0.0109548989598
0.0112571963432
0.0113114003937
0.0111461220711
0.0105726756959
0.0094641843653
0.00801379628873
0.00730200049456
0.00857746088876
0.00741014089917
0.00833824554403
0.00906629101064
0.00949224329047
0.00972879380347
0.0100780115013
0.00988095470804
0.00957164834569
0.00973093547026
0.0100734718454
0.0105492735194
0.0110464031656
0.011485560656
0.011719131278
0.0117854689045
0.0115359262017
0.010851859061
0.00996156317578
0.0105387981472
0.0102801349181
0.00869645084126
0.00939998600551
0.00998168608263
0.0102498891728
0.0102728562359
0.0104429693098
0.0102220041372
0.00970332070177
0.00972385455586
0.0100197582865
0.0105165938387
0.0111543799354
0.0117670869864
0.0121637901362
0.0123798212011
0.0123234557005
0.0119160692427
0.0113802153744
0.0128855152626
0.0114664903184
0.00988354574591
0.01033864479
0.0107340840028
0.0109035403522
0.0108154802537
0.0110592474392
0.010665242374
0.00981534584167
0.00964970372947
0.00985951937526
0.0103834568981
0.0112361797922
0.011996412717
0.0125204993472
0.0128437536053
0.0128864982771
0.0126007226174
0.0122547124813
0.0143383908702
0.0126503052407
0.0113579520584
0.0112897962275
0.0113496692252
0.0113871316059
0.0114442006502
0.0123875168004
0.0115485247815
0.0100916605212
0.00968699581066
0.00977246174632
0.0103928855008
0.0118098905796
0.012425710434
0.0128665052239
0.0132305034986
0.013320479046
0.0130810024648
0.0127984893779
0.0150473579567
0.0137835815767
0.0128677835
0.012389656039
0.0120730797787
0.0120067245693
0.0124806798251
0.0151966013516
0.016957448
0.013799979436
0.0131305548889
0.0128734205172
0.0134306123875
0.0179256929405
0.0137282093273
0.0133374405557
0.0135322360747
0.0136150994993
0.0133930578918
0.0130735622755
0.0151121881765
0.0141841110993
0.0127810065722
0.0127781867479
0.0125917623092
0.0125716452155
0.0130664833397
0.0188940816775
0.0235686376302
0.0145829260437
0.0139403147338
0.0138270547573
0.013530202974
0.0130432882624
0.0146271779267
0.0141287388098
0.0124637812451
0.0123103998194
0.0121811745356
0.0120831165011
0.0117755019545
0.015629741296
0.0194101661155
0.0145395367014
0.014062499689
0.0138682549594
0.0134642742084
0.0127614913504
0.0139651543613
0.0138074949746
0.0122265811336
0.0120973901718
0.0118979805822
0.0117292803479
0.0114437684903
0.015948827818
0.0208002015326
0.0148701625327
0.0141350502192
0.013781648613
0.0132469485135
0.012430452186
0.0136657742624
0.0134094770017
0.0117975023086
0.0118041992205
0.0116974784342
0.0116103960719
0.0118355592997
0.0199275885447
0.029163218055
0.0158410904852
0.0142880369473
0.0137425075898
0.013110432365
0.0122853302602
0.0139110390152
0.0129881849035
0.0112521611152
0.0113750594959
0.0114013721573
0.0113535656002
0.011467466582
0.0122736801639
0.0232621584397
0.0183980291053
0.018060719855
0.0187630075029
0.0204036406272
0.0270613831709
0.016961629925
0.0146767482409
0.0140974776352
0.0136732220043
0.0130227525182
0.0122530934253
0.0144039448204
0.0124160493033
0.0106387588228
0.0108336309204
0.0110071521472
0.0110737159833
0.0111445945802
0.0113326534384
0.0120408191554
0.0119714717096
0.0121460500498
0.0126338329929
0.0134609818578
0.0146731342771
0.0142887494214
0.0140423072702
0.0138548899227
0.0134696796198
0.0127934721722
0.0120692405409
0.0143046111118
0.0119110783953
0.0100251458932
0.0102343686242
0.0105425177416
0.0107394258038
0.0108812726856
0.0110206317286
0.0112198992203
0.0113876079604
0.0116632826882
0.0120889950497
0.012642688193
0.013242713496
0.0135382694858
0.0136203427472
0.0134898138011
0.0130822008505
0.0123994193487
0.0117329599911
0.0139588803417
0.0113474464086
0.00936132188806
0.00958783154938
0.0100183198938
0.0103421002488
0.0105719590648
0.0107639746504
0.0109735227552
0.0112188618803
0.0115237036128
0.0118981737212
0.0123225804159
0.0127484768692
0.0130411323268
0.0131204123532
0.0129628379167
0.0125323232732
0.0118656375869
0.0112532423873
0.0134710321194
0.0104908689131
0.00865315265811
0.00894185449506
0.00944211496569
0.00985563213971
0.0101741794255
0.0104312001056
0.0106849948721
0.0109632886653
0.0112600217778
0.0115776148251
0.011920834589
0.0122439318802
0.0124550796615
0.0124857028315
0.0123031136516
0.0118771012701
0.0112366080261
0.010642264396
0.0127189103343
0.00923709896096
0.0078511711056
0.0082965436454
0.00886043037774
0.00931460938798
0.00967200496398
0.00997051595807
0.0102531979338
0.0105352627255
0.0108057290406
0.0110756596034
0.011356316111
0.0115978315685
0.0117367899251
0.0117337968191
0.0115504981591
0.011145363737
0.0105256236559
0.00986270685417
0.0114944887519
0.00750575386029
0.00683449860565
0.00756017526719
0.00824836224317
0.008769152653
0.00916215789215
0.00948257968625
0.00976650768455
0.0100271433182
0.0102666110414
0.0105000505315
0.0107289737404
0.0109035945803
0.010990641765
0.010970938443
0.0107832452658
0.0103620878724
0.00966054439643
0.0087207690542
0.00960596396707
0.00528546750033
0.00569268811336
0.00688817243001
0.00785017068073
0.00852859210411
0.00900396808919
0.00935574705916
0.00961956961251
0.00982561895144
0.0100170607334
0.0102226607076
0.0104152050451
0.0105378434273
0.0105768291136
0.0105146616627
0.01022340554
0.00964277010398
0.00866124836321
0.00723636106659
0.00690456352326
0.00281003119437
0.00525090262119
0.00760729931433
0.00935143930339
0.0105100844077
0.011292976913
0.0118217072546
0.0121358109023
0.0123060792761
0.0124829027193
0.0127488506454
0.0130218889569
0.0131903863235
0.0131921147187
0.0129514865737
0.0123699974625
0.0112975953498
0.00952741275984
0.00688345131609
0.00408941634886
0.00389852604383
0.00641212308342
0.00916771560957
0.0107931787329
0.0116498489329
0.0119882021716
0.012166731078
0.0122165049204
0.0125388125938
0.0130608851112
0.0139681211425
0.0151809824196
0.0164522961741
0.0169824022174
0.0167297653484
0.0157618968119
0.0137959655679
0.0114071618912
0.00814861865347
0.00500968450368
0.00640853926914
0.00619096330274
0.00777158731287
0.00897788923903
0.00997048046708
0.0110195791374
0.0122877895117
0.0122524981395
0.0124579759005
0.0135469804761
0.0145126919962
0.0148790906007
0.0149377453016
0.014578233023
0.0138340409034
0.0130833131495
0.0121561692091
0.0106236576407
0.00884440801754
0.00856523195266
0.0094537626426
0.00798036768859
0.00917115523038
0.0101431691537
0.0108500842743
0.0114853443882
0.0124423155841
0.0123798441165
0.0120227703571
0.0126859027481
0.0135812439281
0.014122132587
0.0143640814104
0.0143819087249
0.0140839291281
0.0137824493633
0.0133696228265
0.01248398316
0.0114360156396
0.0126172231922
0.0117247933019
0.00962335399805
0.0104957544224
0.0112478997023
0.0117180397407
0.0120030304286
0.0126605303629
0.0125994717929
0.0118767547119
0.0121548806527
0.012874225892
0.0135559513332
0.0140133007641
0.0143704330114
0.0144149033596
0.0143640136579
0.0142174452939
0.0137827912542
0.0132575072109
0.0158638867309
0.0134704778663
0.0112895011269
0.0117617977391
0.012235142397
0.0125689628461
0.0126792924864
0.0134108239718
0.013151473847
0.0119751941601
0.0118953373395
0.0123893293644
0.0131066404765
0.0138079474892
0.0144115160409
0.0147130163102
0.0148347340525
0.0148061612516
0.0145622316978
0.0144246449996
0.0183750638055
0.0150874121903
0.0136404612719
0.0132823140612
0.0132157046758
0.01334395071
0.0136374077057
0.0152539931825
0.0144363056182
0.0125705027046
0.0122378239047
0.012519445275
0.0133205529004
0.0146820526993
0.0149305739453
0.015100278154
0.0152699880809
0.0152774172761
0.015119615917
0.0152921202115
0.0203959110475
0.0165563213759
0.0161189500832
0.0152551711914
0.0145586966086
0.0145006078454
0.0153548276094
0.0199700776254
0.0253146167115
0.0210133589851
0.0206214728666
0.020517386757
0.0218006724674
0.0270719753828
0.0173111109757
0.0158087641566
0.0156095190917
0.0155678907468
0.0154745074737
0.0159072536227
0.0220836336743
0.0176073455395
0.0162264536165
0.0160073409401
0.0155460161123
0.0155707686518
0.0163296045325
0.0285076580352
0.0319337197869
0.0179600441713
0.0161001100049
0.0157201490224
0.0155361935842
0.0159195445723
0.0229463415621
0.0180025321491
0.0159562013025
0.0152006528426
0.0148461732074
0.0148249698297
0.0145821846398
0.0243760953085
0.0270732857869
0.0177594087528
0.0161000507163
0.0156315375915
0.0152957965056
0.0152490860277
0.0227657903013
0.0176652364701
0.0159719818877
0.0149621394778
0.0142723985544
0.0140105539171
0.0138301769061
0.0247803696269
0.0282195489175
0.0179545605771
0.0160673831243
0.015408456811
0.0148791557662
0.014598004066
0.0222200515522
0.0168396667489
0.0155778859883
0.0146833436025
0.013944824764
0.0136018151096
0.0139303846513
0.029060342207
0.036024951087
0.0189146041658
0.0161795441558
0.0152840921468
0.0146249553231
0.0142575077195
0.0216839123806
0.0157592855824
0.0147816648565
0.0141700111094
0.01355493009
0.0131274991281
0.0131170873413
0.0144519876135
0.0304835794281
0.0253174250008
0.0249175350004
0.0255262862243
0.0270115906388
0.0337342643687
0.0204249265839
0.0169777208156
0.015798777516
0.0151313071969
0.0144611413821
0.0140554050971
0.0203320082991
0.0144828635574
0.0135193740472
0.0133327011161
0.0129957595912
0.0126973743192
0.0125899258444
0.0127916123854
0.0137551728985
0.0137947278189
0.0140588773214
0.0146506429038
0.0156154473526
0.0170185848653
0.0164337492564
0.0158232789666
0.0153589316772
0.0148331084026
0.0141352750357
0.013627515392
0.0179140992343
0.0135328934778
0.0122963157943
0.0122127257361
0.0122404269644
0.0121745933677
0.0121468775884
0.0122172171646
0.0124230318914
0.0126282291273
0.0129669701839
0.0134865445163
0.0141605477755
0.0148960188292
0.0151488441869
0.015089920268
0.0148173783834
0.0143166446028
0.0136009549403
0.0130225789451
0.0163600053848
0.0127159999425
0.0109234150871
0.0109748958394
0.0113146279841
0.0115189933021
0.0116511286419
0.0117868667932
0.0119980005025
0.0122813686961
0.0126444341875
0.0130986568437
0.0136211824158
0.0141028102377
0.0143734826645
0.0143700263226
0.0141236111096
0.0136233022276
0.0129106000277
0.0122906398828
0.0153600238448
0.0115074588654
0.00967333922028
0.00983386633062
0.0103252656604
0.0107297985019
0.0110385774459
0.011295088163
0.0115779009502
0.0119149169806
0.0122694727295
0.0126528655098
0.0130614548398
0.013402501094
0.0135869876678
0.0135598647963
0.0133194012667
0.0128322007881
0.0121237203466
0.011472872841
0.0142778580389
0.00992382089666
0.00865530690975
0.00902572041584
0.00954981891238
0.00998597919725
0.0103609262761
0.0106911196687
0.0110328132366
0.0113934492847
0.0117223429488
0.0120355130882
0.0123506645975
0.0125934165567
0.0127019723378
0.012655544557
0.012432242944
0.0119805061033
0.0113218784047
0.0105639903399
0.0128212827696
0.00793164410489
0.00746946920423
0.00822425326589
0.00889995122666
0.0093907987622
0.00976664922681
0.0101251218533
0.0104756340144
0.0108063844571
0.0110922637522
0.0113502016737
0.0115956810244
0.0117520429694
0.0117948188681
0.0117354189412
0.0115270959514
0.0110999444751
0.0103650538778
0.00927649753758
0.0107222914407
0.005512394244
0.0061655409334
0.00749689843704
0.00851937027678
0.00921475974909
0.00968147801069
0.0100713606636
0.0103668059238
0.0105868721889
0.0107928678063
0.011019012846
0.0112090935385
0.0112703475582
0.0112313738235
0.0111420966079
0.0108201246357
0.0101979219712
0.0091652298864
0.00755083091617
0.00763869308996
0.00315250982214
0.00549381460918
0.00805342547982
0.00999441116456
0.0112989127473
0.0121959221686
0.0128300094714
0.0131328718204
0.0132290858749
0.0134784135464
0.0139538055277
0.014363430744
0.014484435958
0.0144112977333
0.0141010368159
0.0135474638075
0.0124401342747
0.0105887899707
0.00761821655079
0.00466492329516
0.00412475976976
0.0064272839566
0.00920447171304
0.0111426568015
0.0122608728808
0.0127546328354
0.012932292103
0.012895299219
0.0131582997068
0.0136336818219
0.0147398400415
0.0163767769854
0.0187829543963
0.0208394465015
0.0206258191286
0.0190008265243
0.016121368969
0.013312442808
0.00950685531157
0.00596758108703
0.00652931980185
0.00639711727736
0.00798756930634
0.00927079499469
0.0103170310789
0.0113987088495
0.0126523636405
0.0125840943822
0.0128065765345
0.0137263315592
0.0143902520243
0.0149101795381
0.0154048673442
0.0156465711379
0.015134722307
0.0140885627597
0.0129843148272
0.0113807713525
0.00945903818089
0.0104951565582
0.00983781179452
0.00821873030653
0.00926579482215
0.0102122140497
0.0109537035632
0.0117165353845
0.0127486410015
0.0127778557412
0.012557295054
0.0132203217116
0.0139448553598
0.0143343811918
0.0146511101236
0.0149141161986
0.0149012487786
0.0145777305197
0.0141293890635
0.0133692672127
0.0123254696503
0.0155080508688
0.0127182863355
0.0099239532237
0.0105378990527
0.0112305778697
0.0117568203321
0.0122266216251
0.0129972328365
0.0130450756556
0.0125686831814
0.0129201500038
0.0135602803336
0.0139839989063
0.0142607419846
0.0146419617088
0.0149249640716
0.0149503208922
0.0148367899437
0.0146147633256
0.0142745266465
0.0197702907774
0.0154070247891
0.0116321521615
0.01178765436
0.0122156853589
0.0126159281283
0.0129483722171
0.0136767801033
0.0134951124701
0.0127168769366
0.0127757815457
0.0132359148528
0.0136925896493
0.0140105602034
0.0145359749231
0.0150521608336
0.0152913996649
0.0153522779078
0.0153576860512
0.0154915586156
0.0234197092681
0.017815158702
0.0139621599565
0.013322629007
0.0132839411557
0.0134888551795
0.0139469472151
0.0150087158603
0.0146965414073
0.0136007338058
0.013309447646
0.013428803953
0.0137815981867
0.0143074621783
0.0148983904232
0.0154046607518
0.0156686712606
0.0157858601592
0.0158598251635
0.0161549594455
0.0257981750276
0.0193852305441
0.016425618966
0.0153898162294
0.0147970382839
0.0147638043534
0.0154995088095
0.0182196317797
0.0201288158651
0.0177570598594
0.0163641360159
0.0154367159164
0.0152736293528
0.0163189712996
0.0163502261041
0.0162374957894
0.0161017748992
0.0161058399024
0.0161432857328
0.0163154986751
0.0261281310082
0.0209805244902
0.0167466111972
0.0162205741026
0.0158959334259
0.0158354992423
0.0164920724178
0.0211278762284
0.047025178125
0.0345965200695
0.0299716380841
0.0282655238274
0.0293991655639
0.0357367517905
0.0236295172005
0.018599921469
0.0167845908234
0.0163220998588
0.0161383020289
0.016085852017
0.0245829977553
0.0212994346397
0.0166288340362
0.0156667826026
0.0154192994173
0.0153066346322
0.0153096607509
0.0185172059501
0.0370694991733
0.0244946772257
0.0206593363687
0.0199229347198
0.0213889031683
0.028542348391
0.0225103602756
0.0183795926384
0.0167439190867
0.0161856853567
0.0158290370869
0.0156066754478
0.0225714870711
0.0205897201893
0.0166557751213
0.0155976575838
0.0149894508232
0.0146125328029
0.0145197549638
0.0177444149798
0.0348000616623
0.022698472483
0.0195830183199
0.0192806621049
0.0207686029514
0.0279974779824
0.022709125026
0.0184609751614
0.0166739731028
0.0159300601105
0.0153673368415
0.0147741123052
0.0205799849048
0.0193318203535
0.0161937885555
0.0154326088221
0.0147494948585
0.0142427520452
0.0144531597685
0.0185076653596
0.0386798589645
0.0276402543047
0.0250337981966
0.0248061711188
0.0259784891089
0.0326623946822
0.0245982994427
0.0190180192835
0.0167128808808
0.0157303156677
0.0150103063793
0.0142842721398
0.0194278474369
0.0182217336199
0.0153266685894
0.0149693538343
0.0144167052084
0.0138798087483
0.0138448205901
0.01475683966
0.0213753936455
0.0201690730567
0.0197008823106
0.0197779668596
0.0203033354247
0.0225607396627
0.019813335195
0.0174930556258
0.0162431705245
0.015463752664
0.0147478833307
0.0141165105343
0.0195555276161
0.0171352145747
0.0142096855992
0.0142526245508
0.013931078573
0.0135202537843
0.0133095505431
0.0134353825193
0.0144390417987
0.0145941371546
0.0148645036052
0.0153740829979
0.0161688881913
0.0172971861487
0.0169891870924
0.0163094260767
0.0157119014985
0.0151009493559
0.0144015408313
0.0138334298888
0.0195980159155
0.0162973823955
0.0135292043962
0.0134046013541
0.013302100791
0.0130761434399
0.0128990628271
0.0128847838319
0.0131541289516
0.0133859444704
0.0137287415484
0.0142204998004
0.0148375998724
0.0154818112081
0.0156645123873
0.0154840481956
0.0151149726098
0.0145662311376
0.0138727764215
0.0132809933223
0.0188162114545
0.0148343923633
0.0125237985852
0.0123660377035
0.0125173670011
0.0125105718891
0.0124369754829
0.0124282621628
0.0126009699158
0.012883079055
0.0132543196878
0.0137006375982
0.0141931718597
0.0146102982449
0.014796748175
0.0147053400223
0.0144046631486
0.013887141804
0.0131880885825
0.0125413742631
0.0175125285725
0.0129919839202
0.0108186299908
0.0109267487841
0.0113853982508
0.0116990881624
0.0118322283858
0.0119072253409
0.0120871638804
0.0124096421834
0.0127805230815
0.0131661280085
0.0135441745059
0.0138259200121
0.0139466892775
0.0138720385341
0.0135994209115
0.0130848885047
0.0123557399146
0.0116769080875
0.0160903636865
0.0111930042
0.00934553799401
0.00971933122655
0.0102756699272
0.0107352484921
0.0110718633022
0.0112736021515
0.0114889671788
0.0118043980975
0.0121482352718
0.0124601369083
0.0127451155079
0.0129538648523
0.0130357924055
0.0129541918567
0.0126798045024
0.0121630821693
0.011452778028
0.0107290117981
0.0143295323873
0.00896046719561
0.00786547416018
0.0086998060712
0.0094211288865
0.00994071539512
0.0103348925869
0.0106104724255
0.0108466020972
0.0111188960211
0.0114106312479
0.0116681318439
0.0119090753941
0.0120714254364
0.0120893023732
0.0119703340332
0.0116922585033
0.0112072934284
0.0104790905533
0.00944234424899
0.0121034756783
0.00616422168164
0.00620816776781
0.00765164759814
0.00875278278362
0.00949760121122
0.00995202499982
0.0102454860171
0.0104881321114
0.0107368522971
0.0109361639048
0.0111469638164
0.0113519337219
0.0114143213098
0.0113391767592
0.0112117349893
0.0108842769502
0.0102395837688
0.00922960387671
0.00766711785129
0.00865882198614
0.00348860056066
0.00605190829201
0.00896386326127
0.0110042373174
0.0121802986278
0.0129715064703
0.0136359780181
0.0141307327623
0.0145081955391
0.0151008234
0.0158016109218
0.0163603856404
0.0163357386656
0.0160138914779
0.0155148726431
0.0149316012211
0.0137596697808
0.0118220819531
0.00859961698108
0.00513094706878
0.00427105581463
0.0067389574018
0.00945909069401
0.0113742534978
0.0125152284197
0.0130065362539
0.0131813400308
0.0131650279887
0.0132128934267
0.013118949253
0.0133405210738
0.0141648777097
0.0158031142375
0.0176845331106
0.0186910427332
0.0185050537587
0.0171529533608
0.0147047018572
0.0107362305046
0.0068291730288
0.00695180521638
0.00661057647984
0.00801309564773
0.00916122533601
0.0099534156903
0.0105655687501
0.0113580861733
0.0112231651653
0.0107535923336
0.0105563392773
0.0107620719696
0.011276502025
0.0120094918187
0.0128388392279
0.0132929425496
0.0132876874196
0.0128651625645
0.0116595480186
0.0102387407986
0.0125472775003
0.0103539177772
0.00826122584015
0.00914659256493
0.0100427762358
0.0105849654731
0.010994426284
0.011609184425
0.0116282221721
0.0111359627349
0.0109102011738
0.0109975219472
0.0114207006627
0.0120737904247
0.0128606241255
0.0134290115517
0.0136628028184
0.013682095151
0.0132787622962
0.0129507691384
0.0179595734248
0.0133715294269
0.00980467005568
0.0103454315591
0.0110101798201
0.0113579695552
0.0115648052376
0.0119908773234
0.0120639373609
0.0115652700371
0.0112857495371
0.0112912142956
0.0115964059896
0.0121835650646
0.0129554778693
0.013597787412
0.0139533898308
0.014109826522
0.0140905920402
0.0143449635662
0.0208028137178
0.0161502280989
0.0111279681701
0.0113439933329
0.0117731465323
0.0120132314694
0.0121325582255
0.0125418262325
0.0125411846043
0.011971115857
0.011598351379
0.0115234023884
0.0117402746129
0.0123158094415
0.0131062235165
0.0138190004843
0.0142596404121
0.0144512246237
0.014505310217
0.0149266518517
0.0218324709297
0.0188053097989
0.0128380876871
0.0123919768134
0.0124573101826
0.0125626987945
0.0127809153851
0.0134632601225
0.0133636612227
0.0125681890579
0.0119354490316
0.0116991073569
0.0118934540606
0.0126299256942
0.0135213339326
0.0142635306418
0.0147148710881
0.0149028557535
0.0149397920699
0.0152464810081
0.0218627474743
0.0206767162713
0.0148739802497
0.0138559385357
0.0134302832699
0.0133332912557
0.0137160608766
0.015186264665
0.0163315366697
0.0148796117933
0.0132070917431
0.0122954168374
0.012314393209
0.0133998106189
0.014423283
0.0150347918144
0.0153147624985
0.0154221794731
0.0154066172053
0.0154755138103
0.0211738388928
0.0216514303905
0.0151684462464
0.0146219913342
0.0142925456571
0.0141549106697
0.0143410718843
0.0162980578032
0.0194375931167
0.0161128492341
0.013795514939
0.0129181031618
0.0134888776669
0.0155277886527
0.0163815293725
0.0162669077156
0.015975232561
0.0158498161151
0.01572064715
0.0154599153436
0.0200563574356
0.0210047380518
0.0142589832782
0.0140068190456
0.0139720154748
0.0139361829727
0.0137616163671
0.0148148337113
0.0162194086005
0.013701209554
0.0122518817492
0.011946158396
0.0127846689026
0.0151156070826
0.0169076424203
0.016630910448
0.0161796109511
0.0159264823029
0.0156608336382
0.0150232364515
0.0183281014333
0.0193837615615
0.0132887902578
0.013315106018
0.0133619156692
0.013344060316
0.0131121094004
0.013833982108
0.0150055535685
0.0131747972716
0.0122408144647
0.0121956436389
0.0130669436583
0.0153606928976
0.0170918025827
0.016646549808
0.0160494107318
0.0156373705259
0.0151815220417
0.0143435064709
0.0164281488143
0.0175634001501
0.012453984535
0.0127225462794
0.0128644038646
0.0128954911641
0.0128860627626
0.0139850351909
0.01628438325
0.0148840734063
0.0141603131988
0.0141303122922
0.014812888272
0.0167051403933
0.01742666559
0.0166355394428
0.0158758996268
0.0152978064768
0.0146872661812
0.0138220503139
0.0154602558671
0.0164391571816
0.0118034207556
0.0121961064903
0.0124558613371
0.0125206064227
0.01261588731
0.0132645065072
0.0156761191367
0.0157256105737
0.0155872081705
0.0156300140404
0.0159007791748
0.0167351659892
0.0166027025718
0.0160590047667
0.0154982014805
0.0149252429715
0.0142464829719
0.0134373000568
0.0152668009856
0.0155774331993
0.0112818938836
0.0117350926494
0.0120951074729
0.0122187796287
0.012302164979
0.0126022782385
0.0133708184708
0.0137099779838
0.0140319184761
0.0144355866879
0.0149212296083
0.0154890418776
0.0155521252677
0.0153532540862
0.0150019114758
0.0144799521321
0.0137585915618
0.0130284876346
0.0157874178139
0.014688931008
0.0108412867841
0.0113361352456
0.0117618024363
0.0119313383569
0.0120333801672
0.0122345557101
0.0126279963529
0.0130061166729
0.0134144901511
0.0138421975115
0.0142489487729
0.0146047419139
0.0147515017234
0.0146975219216
0.0144417092605
0.0139475069784
0.0132086465454
0.012518803746
0.0162707787098
0.014394969288
0.0103098563141
0.0108511344543
0.0113766399694
0.0116112621726
0.0117255206962
0.0119006552036
0.0122257142116
0.0126279114364
0.0130351467536
0.0134025604945
0.0137054515545
0.0139440101825
0.0140762382354
0.0140532963559
0.0138345690183
0.013359390743
0.0126176967341
0.0119408984551
0.0165115914885
0.0134937035073
0.00961533643724
0.0101257935129
0.0107514625601
0.011142774793
0.0113368446521
0.0114966100121
0.0117838127855
0.0121791009566
0.012541882337
0.0128305919231
0.0130717160265
0.0132653045236
0.0133859421447
0.0133817150505
0.0131837039579
0.0127225495858
0.0119802638504
0.0112712922181
0.01606131973
0.0119935559374
0.00883672047854
0.00936827558044
0.00996182788076
0.010425523933
0.0107483522393
0.0109584621873
0.0112190153366
0.0115705790023
0.011881760338
0.0121135686512
0.0123200182797
0.0125053756079
0.0126287318033
0.0126245650992
0.0124275751601
0.0119792567789
0.0112583165614
0.0104288820457
0.0146680841058
0.00977790363435
0.00773268173097
0.00852400702235
0.00916166502036
0.00963738597189
0.0099931594064
0.0102814167436
0.0105632972962
0.0108707389188
0.0111264119159
0.0113117946293
0.01150005551
0.0116670577088
0.0117471222953
0.0117008858685
0.0114876429418
0.0110591489448
0.0103091340847
0.00924897221649
0.0123583559574
0.00676619543913
0.00632236426721
0.00760351240514
0.00847157575153
0.00902736796007
0.00942667813363
0.009759032311
0.0100753777121
0.0103720128843
0.0105939844335
0.0107579983909
0.0109270591883
0.011026367875
0.0110276695947
0.0109201315478
0.0106219325166
0.0100531137346
0.00912919776982
0.00767815678235
0.0088375673775
0.00371876204887
0.00666287176723
0.00969161497159
0.011676026119
0.012659735837
0.0131420790316
0.0133596487104
0.0134240442641
0.0135367544992
0.0141782717139
0.0148928979439
0.0155328615781
0.0158735476813
0.0159197738195
0.0157183636122
0.0151901278841
0.0141253861216
0.0121030149609
0.00887506498262
0.00507597241219
0.00395692411918
0.00642844279612
0.00895188098439
0.0105430364844
0.0115052634573
0.0118942319361
0.012222800367
0.01227430843
0.0121339708278
0.01201492768
0.0122421467687
0.0127905040388
0.0136403746828
0.0148522249541
0.0154952760809
0.0154668560833
0.0145292039882
0.012440594816
0.00911312351874
0.00604075972032
0.00663276332616
0.00627371887794
0.00747344126692
0.00840907437279
0.0090633507056
0.00948940475725
0.0100758414064
0.0100953590994
0.00983773959073
0.00971501849725
0.00985246146108
0.0102161326301
0.0107814641992
0.0114349244448
0.0118634452574
0.0119913429683
0.0116338991446
0.0107695240243
0.00960103792394
0.0110491159033
0.0096022896013
0.00767476663301
0.00839829956571
0.00920104580564
0.00971446601474
0.0100184539937
0.0104273322627
0.0105225854774
0.0102661237327
0.0101114907119
0.0101979019651
0.0105418131135
0.0111072983126
0.0117643965005
0.0122832093768
0.0125703327632
0.0125360193635
0.0121655577317
0.0117865107012
0.0156203428577
0.0119075196051
0.00890548488866
0.0094261438508
0.010116866623
0.0105103329549
0.0106713074969
0.0109175711182
0.0110066015817
0.0107344408445
0.0105357141135
0.0105727990614
0.0108852558939
0.0114494577013
0.0121419333691
0.0127346920356
0.0130945749001
0.0131683227911
0.0130132930125
0.0130009803457
0.0175983793985
0.0137955045822
0.00986279684545
0.0102737412792
0.0108375877548
0.0111526042523
0.0112332256628
0.0114362927153
0.0114777656145
0.0111394295902
0.0108557129897
0.0108280632384
0.0111226626592
0.0117262645581
0.0124818667438
0.0131542283054
0.0135718359742
0.0136771790521
0.0135676266551
0.0136481049221
0.0178262222101
0.0160073658722
0.0109966831323
0.0110563848241
0.0114012419783
0.0116084313348
0.0117145496235
0.0120733721538
0.0120782226187
0.01158000684
0.0111255168375
0.0109937439927
0.011278483722
0.0119749708829
0.0128428401224
0.0135955219817
0.0140476133028
0.0141585602021
0.0140373845531
0.0140629818172
0.0177380960604
0.0177998218714
0.012359257402
0.012021662528
0.0120451422255
0.0120949902714
0.0122935069369
0.0130036507926
0.0134009371197
0.0125190180086
0.0115806787273
0.0111852998179
0.0114340384473
0.0122810151363
0.0132978777849
0.0140922351835
0.0145120374468
0.014586162266
0.0144368976247
0.0143712601358
0.0176444853937
0.0177254469517
0.0124962820233
0.0126087285356
0.0126593227001
0.0126661292256
0.0127716837435
0.0134276646402
0.0137759022555
0.0124846491661
0.0114394965727
0.0111202918816
0.0115901214
0.0127515764803
0.0139053544487
0.0145911925201
0.0148600321472
0.0148415667176
0.014637516425
0.0144709301656
0.0173108451833
0.0161288918934
0.0118113206472
0.0122430993345
0.0125127479194
0.0126055686171
0.0125211914376
0.0127024548129
0.012608309819
0.0115489393551
0.0108863725967
0.0108772458245
0.0115467759015
0.0128694690141
0.0142276774792
0.0148066818674
0.0149542300573
0.0148356201307
0.0145329292588
0.0142194735388
0.0165753203302
0.0143838228155
0.0111607763858
0.011711476302
0.0120673278304
0.0122039910748
0.0120910976246
0.0121219509079
0.0120641600797
0.0113694838669
0.0110301574347
0.0112052333172
0.0119305970098
0.0132353972224
0.0144960516596
0.0149185852593
0.0149214194437
0.0146713322069
0.0142333498579
0.013763399771
0.0157296537349
0.0134845332021
0.0107038302284
0.0112882589845
0.0116925659984
0.0118733294578
0.0118741899854
0.0120942343428
0.0124616892683
0.0121376196295
0.0120084478111
0.0122406086078
0.0128888773559
0.0139903152734
0.0148568974014
0.0150500121208
0.0148945799427
0.0145079746971
0.0139333018551
0.0133183214834
0.0151456319749
0.0131351962463
0.0103718841257
0.0109461167
0.0114155607745
0.0116471299322
0.0117606963617
0.0120625365818
0.0128138496547
0.0130196190471
0.0131340563375
0.0133689568394
0.0138087775115
0.0145153962117
0.0149339022251
0.0149851170481
0.0147681752177
0.0143068255582
0.013621745352
0.0128679836611
0.0148838061961
0.0129269211729
0.0100303913699
0.0106005655668
0.0111509172066
0.0114587085075
0.011649794489
0.0119203738325
0.0123632166208
0.0126718003794
0.0129793710043
0.0133527213165
0.013813000817
0.0143412093008
0.0146494918733
0.0146916598578
0.0144799881046
0.0139917872179
0.0132367688527
0.0124468624922
0.0152503309648
0.0125154289534
0.00966809801395
0.0102256710208
0.0108311758627
0.0112201953397
0.0114855541649
0.0117649382696
0.0121105826763
0.0124548408291
0.0128180725387
0.013200383514
0.0135933212595
0.0139765613201
0.0142165092031
0.0142527206131
0.0140484581296
0.0135597198292
0.0127883707328
0.0120383478172
0.0154292375027
0.0123497275691
0.00931294859506
0.00983806863286
0.0104598397372
0.0109090761012
0.0112274323785
0.0115283044043
0.0118678502309
0.0122304796336
0.0125886812663
0.0129263390899
0.0132378538244
0.0135178599899
0.0136956901348
0.0137142983391
0.0135153929314
0.0130382746951
0.0122802768835
0.0115706063012
0.0154278429154
0.0115884403589
0.00880122472935
0.00933851053792
0.00998349386766
0.0104876040575
0.0108548252914
0.0111696081504
0.0114991906852
0.0118438377063
0.0121636291348
0.0124489982012
0.0127078119982
0.0129297719562
0.0130738731757
0.0130840641002
0.0128908966355
0.012432710949
0.0116911893759
0.0109476966705
0.0147379019933
0.0103674568811
0.00820672171652
0.00878007447243
0.00939046452916
0.00990694455041
0.010319006867
0.0106499266903
0.0109612400395
0.0112728618519
0.0115463071365
0.0117855206646
0.0120061889779
0.0122010461834
0.0123271765771
0.0123239676014
0.0121318633718
0.0116903540902
0.0109466035415
0.0100789147815
0.0132224224821
0.00855192214267
0.00738261342344
0.00812547783899
0.00872628714309
0.00921771212552
0.0096343362771
0.0099812659564
0.0102787632899
0.0105518821826
0.010789670369
0.0109913096582
0.011182695308
0.011345402951
0.0114305314205
0.0113930477904
0.0111843123948
0.0107313780105
0.00994732666066
0.00886709724597
0.010817413506
0.00597624009733
0.00616842714375
0.00729116460922
0.0080495983913
0.00859091227586
0.00901896855237
0.0093693972481
0.00965935814292
0.00991534360067
0.0101547327377
0.0103551086479
0.0105299959349
0.0106490267538
0.0106723774015
0.0105617036061
0.0102584689766
0.00967578885568
0.00870730869576
0.00727478690672
0.007610931102
0.00327076158193
0.00581789570058
0.00829977841291
0.00994595764633
0.0108710630404
0.0114769229529
0.0119027926052
0.0122380585753
0.0125323773385
0.0130316290095
0.0135520474969
0.0140096729157
0.0143344065045
0.0143949366723
0.0141544378684
0.0135397428985
0.0123885907418
0.0104200319829
0.0075573471934
0.00424598707881
0.0033565984642
0.00559161518293
0.00785932759563
0.00924390713214
0.010128562079
0.0105537784509
0.010920850903
0.0110323085012
0.0111006622879
0.0111426075855
0.0113433683706
0.01178299633
0.0124275977403
0.0131414312721
0.0134557693031
0.013137698156
0.0120344638413
0.0099957154763
0.00719602833278
0.00513994135456
0.00569282779853
0.00564888437176
0.00677974675741
0.00763512874373
0.00822938792826
0.00858889048092
0.00901768451881
0.0091698221408
0.00910398018773
0.0090415071825
0.00914815313267
0.00943678320751
0.00989249858442
0.0104349560291
0.010810445682
0.0108103799418
0.0102769295436
0.00927957441247
0.00796766197472
0.00884713195956
0.00811854387394
0.00688541096944
0.00765994198841
0.00843004169217
0.0089526450165
0.00926172367711
0.00959093738845
0.00977777016517
0.00972773940868
0.00964482642846
0.00969778498952
0.00995837885128
0.0104054066069
0.0109534196702
0.0114011016732
0.011575145114
0.0113392310445
0.0107484869444
0.0100563201586
0.0125910410117
0.00979231126101
0.00792003676464
0.008588489335
0.00930853271123
0.00976807412381
0.00999132196082
0.0102091965617
0.0103627500912
0.010298533166
0.0101982860321
0.0102242947375
0.0104680432597
0.0109186816257
0.0114838218142
0.0119788890093
0.0122283475531
0.0121092906081
0.0116798687363
0.0112324596919
0.014398626226
0.0109691425595
0.00867903455627
0.0093406368188
0.0100107546078
0.0104201933141
0.0105776465729
0.0107360798456
0.0108335946195
0.0107087047892
0.0105534865114
0.0105457042754
0.0107915191659
0.0112814727852
0.0118912078587
0.0124345692478
0.012728851148
0.0126467014146
0.0122405174703
0.0118248638682
0.0147964338894
0.0121775490492
0.00938530263753
0.00995858570154
0.0105362561174
0.0108740941749
0.011011924022
0.0112145310872
0.011265544988
0.0110275001679
0.0107667602145
0.0107076084956
0.0109623500305
0.0115126942508
0.0121991821473
0.0128026472947
0.0131265225985
0.0130538674796
0.0126430398035
0.0122655343689
0.0152930336432
0.0131844633325
0.0101299574663
0.0105850213933
0.0110146750971
0.0112544093708
0.0114206952529
0.0117432928789
0.0118328986905
0.0113822205132
0.0109134207011
0.010770865503
0.0110492061117
0.0116907317888
0.0124737189039
0.0131314654561
0.0134613330732
0.0133829589469
0.0129870826812
0.0127215153524
0.0159547723108
0.0129292761195
0.0102784859674
0.0110280884944
0.0114622053581
0.0116595704954
0.0117739449515
0.0119596513974
0.0118414469633
0.0112130166285
0.0107399359201
0.0106945208402
0.0111112539339
0.0119001499573
0.0127714265503
0.0134200131364
0.0137101401141
0.0136054910206
0.0132172829022
0.0130281096182
0.0162951445236
0.0120701990963
0.0100073810294
0.0109467285017
0.0114819275325
0.0117022761889
0.0117091449863
0.0116552196926
0.0113549806506
0.0108232678283
0.0105548706995
0.0106896407749
0.0112318388903
0.0121099007862
0.0130437642925
0.0136415818071
0.0138588090008
0.0137004820151
0.0132727803033
0.0130267587912
0.0161745612325
0.0114396611217
0.00972898014968
0.0106804154155
0.0112593679404
0.0114965516358
0.0114779049934
0.011365004604
0.0111427377154
0.0108291379292
0.0107581432474
0.0110151268993
0.0116062703719
0.0124791096896
0.0133559744444
0.0138537332033
0.013966458725
0.0137177107424
0.0131991060304
0.0127937310689
0.0157906405088
0.0114295761534
0.00955234658981
0.0104279949902
0.0110290456379
0.0113011844993
0.0113409690536
0.0113440433276
0.0113587559828
0.0112883180168
0.0113730243122
0.0116912249006
0.0122578297287
0.0130301456696
0.0137336616585
0.014084939261
0.0140732943953
0.0137149808364
0.0130812596695
0.012508776092
0.015349190854
0.0115689907042
0.00940671069204
0.0102053718894
0.010845816076
0.0111799877839
0.0113171063897
0.0114544729196
0.0117077768175
0.0118904640849
0.0121140551227
0.0124553013067
0.0129384955649
0.0135346758902
0.0140187137609
0.0142249229519
0.0141119456298
0.0136660520036
0.0129329886762
0.0122163556378
0.0151966586596
0.011651262945
0.00921939960153
0.00995920452399
0.0106530851766
0.0110695649047
0.0113112384967
0.0115299576305
0.0118025657799
0.0120697230163
0.0123819552699
0.0127669516818
0.0132207953255
0.0137023644708
0.0140570063244
0.014175845452
0.0140078974535
0.0135162291506
0.0127233853492
0.0119454670639
0.0154120184208
0.011501819242
0.00899046485356
0.00967583492941
0.0103939297312
0.0108848834733
0.0112179228121
0.0115025506868
0.0117946283255
0.0121025211002
0.0124470594348
0.0128274412504
0.0132253018221
0.013608483164
0.0138717737451
0.0139382503534
0.013748834668
0.0132479894935
0.0124428904604
0.0116628028055
0.015367925499
0.0113081459255
0.0087536297477
0.00939374009578
0.010085511773
0.0106150410496
0.010998869277
0.0113264532857
0.0116450721283
0.0119734994014
0.012315056869
0.0126618590922
0.0129989539421
0.0133011924161
0.0135033319596
0.0135435158901
0.0133532048196
0.0128665448505
0.0120775630234
0.0112981996883
0.0150321813466
0.0105765209365
0.00834721107634
0.00900541047641
0.0096958129829
0.0102350408437
0.0106403618688
0.010979520939
0.0112984406147
0.0116189493446
0.0119370286706
0.0122462649652
0.0125364590379
0.0127913689098
0.0129661577234
0.0130000841725
0.0128196039787
0.012356738939
0.0115840666202
0.0107492072507
0.0140606333994
0.00942887606302
0.00770371145546
0.00843039463113
0.00913108856272
0.00968180587402
0.0100972848193
0.0104309133669
0.0107364928203
0.0110376197216
0.0113253404614
0.0115998482948
0.0118590410328
0.0120908755323
0.012252844658
0.0122814327632
0.0121074840927
0.011658026388
0.0108716957385
0.00990026068183
0.0123676039255
0.00778965914676
0.00677249873105
0.00764789577795
0.00838763071698
0.00894808933827
0.00936591653176
0.00969740165397
0.00999120505697
0.0102736656721
0.0105425911497
0.0107911076749
0.0110226841154
0.0112264527104
0.0113592244418
0.0113627641558
0.0111698733328
0.0106916833872
0.00983521802933
0.00864750907016
0.00990622725983
0.00546413368115
0.00554581322022
0.00669257328251
0.00755980725204
0.0081759913345
0.00861874382792
0.00897167802957
0.00928738797079
0.00958564735921
0.00986543298893
0.0101032191869
0.0103020302581
0.0104581294848
0.0105297711731
0.0104574132057
0.0101644650837
0.00954533306389
0.00849235090351
0.00699828105664
0.00685578271697
0.00293540539656
0.00526422488216
0.00741564542252
0.00890327781332
0.00990179351228
0.010593275916
0.0111439117124
0.01163221784
0.0121038515537
0.0126099303702
0.0130516812277
0.0133906110793
0.0136145013636
0.0136379959604
0.0133456511541
0.0126363336415
0.0113994856796
0.00941892081353
0.0067589996188
0.00373669522321
0.00286046478149
0.00491369713123
0.00697829126886
0.00834878561841
0.00927111424547
0.00981501449937
0.0101932804451
0.0103679743686
0.0105410735252
0.0106501350705
0.0107727818334
0.0110017492118
0.0113765899527
0.0117471219852
0.0117866054954
0.0113170633624
0.0101661303582
0.00824906959637
0.00577222852163
0.00416537820931
0.00493391470907
0.00516150196724
0.00631008160383
0.00719372897641
0.00779472372374
0.00814312001794
0.00843967917497
0.00859949255838
0.0086222876351
0.00862377453853
0.00871372173337
0.00892627182829
0.00923950963048
0.00957984359514
0.0097653082043
0.00960603788137
0.00897058659804
0.00789651461946
0.00656623670938
0.00688776576943
0.0069852774905
0.00633314498561
0.00725631711995
0.008079116009
0.0086302140915
0.00894526462981
0.0091944510071
0.00936439138051
0.00938900213103
0.00936484840161
0.00941886022783
0.00961200878033
0.00993076481982
0.0102968819808
0.0105537298928
0.0105305889245
0.0100963345846
0.00928491035618
0.00832472785012
0.00974579248095
0.00837308985721
0.00729366192229
0.00817317832182
0.00897307470774
0.00948386861248
0.00974767687678
0.00993348559074
0.0100730264324
0.0100831464773
0.0100444128801
0.0100832409019
0.0102702896318
0.0106010850752
0.0109902252211
0.0112929982941
0.0113417020633
0.0110001070339
0.0102807957016
0.00941154327252
0.0112455891738
0.00927420008371
0.00797553214058
0.00887758578902
0.00965683191681
0.0101331267039
0.0103519023516
0.0104904522299
0.0105820491665
0.0105471532768
0.0104740582983
0.0104986457261
0.0106972183245
0.0110628483463
0.0114919255588
0.0118353385264
0.0119287842315
0.0116259681006
0.0109176510609
0.0100272890104
0.011783079004
0.00997711310232
0.00848297921282
0.00938893317521
0.0101346856933
0.0105696473312
0.0107613713876
0.0108956490521
0.0109389086101
0.010830067396
0.0107017237794
0.0107107802669
0.010930231936
0.0113411942826
0.0118240855106
0.012217089881
0.0123442715815
0.0120647964032
0.0113728941018
0.0105559461509
0.0126689811957
0.0104941312243
0.00890151757315
0.0098049444202
0.010495980424
0.0108785477949
0.0110671672556
0.0112236168579
0.0112221576646
0.0110004839598
0.0107933396129
0.0107922492435
0.01105011772
0.0115211568421
0.0120666968339
0.0125051532109
0.0126573407289
0.0123992708266
0.0117556262641
0.0111175292703
0.0139119910838
0.0104631509294
0.00906127067287
0.0101099262546
0.0107999863642
0.0111495063153
0.0113010344392
0.0113565115852
0.0112155896291
0.0109157293709
0.0107322232177
0.0108049265889
0.0111479010793
0.011697713994
0.0122992124468
0.0127538038084
0.0129056821917
0.0126553794951
0.0120528841011
0.0115466115813
0.0148690997265
0.0102593042989
0.00903321673249
0.0101567670578
0.0108791831256
0.0112211704799
0.0113121585622
0.0112527470837
0.0110409831958
0.0107960508904
0.0107254737984
0.0109029902894
0.011324226778
0.0119269108826
0.0125594355834
0.0129971424043
0.0131148650347
0.0128430535752
0.0122352732726
0.0117292469161
0.0152498042783
0.0103784770407
0.00899415121945
0.0100677335571
0.0107984335548
0.0111428994767
0.0112192829131
0.0111485840495
0.0110057151797
0.0108897381366
0.0109397629795
0.0112004571924
0.0116634480552
0.0122713923192
0.0128770183479
0.0132591507403
0.0133127592115
0.0129864269312
0.0123265658925
0.011726067674
0.0151074895879
0.0108059677297
0.00899109225134
0.00995740531602
0.0106868869059
0.0110564349104
0.0111741594686
0.0111844184646
0.0111829534934
0.0112156421654
0.0113739175519
0.0116902863155
0.0121558412
0.0127193428323
0.0132412439306
0.0135358503535
0.0135074688384
0.013109611546
0.0123796251151
0.0116714558504
0.0148351555411
0.0111376107107
0.00896852363486
0.00983958274543
0.0105845192913
0.0110072279451
0.0112029764087
0.0113203049897
0.0114634114351
0.0116391469915
0.0118909671426
0.0122397014256
0.0126755278935
0.0131568652247
0.0135653939051
0.013761246118
0.013656007897
0.0131974315406
0.0124102810779
0.0116347479342
0.0149655626588
0.0112712402967
0.00888802473822
0.00967812639097
0.0104515707872
0.0109437146294
0.0112319035137
0.0114412698985
0.011659221922
0.01190948374
0.0122188512386
0.0125893718369
0.0130010343197
0.0134156759718
0.013733616951
0.0138544313123
0.0136998156693
0.0132089496899
0.0123930082322
0.0116002284698
0.015318868814
0.0111453279266
0.00872242486728
0.0094617758692
0.0102433621619
0.010796468024
0.0111673599614
0.0114515636374
0.0117201578238
0.0120124849943
0.0123479276195
0.0127175656385
0.0130981398335
0.013452248681
0.0137049464807
0.0137819313748
0.013608483806
0.013114323013
0.0122976658566
0.0115016680258
0.0153500262496
0.0108329642294
0.00848014002867
0.00919910543377
0.00995885786631
0.0105451077558
0.0109636358199
0.011296734298
0.0116017367619
0.011916009514
0.0122545758709
0.0126079792937
0.0129524568489
0.0132594663535
0.0134758938822
0.0135386080507
0.0133699212429
0.0128925308571
0.0120904318539
0.011273005218
0.0149487576955
0.0101171276004
0.00805931054686
0.00880388800142
0.00956548870408
0.0101550283223
0.0105945426155
0.0109477526505
0.0112643854868
0.0115802925673
0.0119065859355
0.0122363741371
0.0125525646815
0.0128351521308
0.0130418167826
0.0131095133136
0.0129569946012
0.0125035401541
0.011712351098
0.0108255437157
0.0139558504303
0.00899497864263
0.00739648215428
0.00819139557266
0.00896802504805
0.00956743124035
0.0100127925095
0.0103671104023
0.0106838283614
0.0109936487008
0.0113034951299
0.0116116210267
0.0119091925893
0.0121807294498
0.0123853166113
0.0124572939725
0.0123155797768
0.0118728567614
0.0110635278194
0.0100454904899
0.012309802778
0.00738166176308
0.00645410592449
0.00735306134034
0.00815841563449
0.00876934704152
0.00922000224258
0.0095780092748
0.00989622123015
0.0102019869461
0.0105019551109
0.0107917795974
0.0110675630079
0.0113175792041
0.0115014960692
0.0115549361983
0.0113956163099
0.0109229795878
0.0100426114982
0.00882488830891
0.00987807212762
0.00513623031943
0.0052729757777
0.00638660451512
0.00728172296389
0.00793419232298
0.00841220641478
0.00879870179574
0.00914694474181
0.00947469943187
0.00978267346604
0.0100578231383
0.0102978127706
0.010498340291
0.0106203059174
0.0105995627389
0.0103496363441
0.00975935031699
0.00870590123962
0.00717700517837
0.00670332765688
0.00266222878146
0.00494013915207
0.00702051345291
0.00851203824104
0.00955722369963
0.0102953722857
0.010898080356
0.0114559318387
0.0119988432643
0.012532521791
0.0129925129567
0.0133320531446
0.0135577211402
0.0135921930989
0.0133546668185
0.012702265217
0.0115031451436
0.00949085417576
0.00666598715867
0.00345048561146
0.00266732058388
0.00473466439809
0.00676321556989
0.00821917212869
0.0092148859063
0.00983659630314
0.0102146999564
0.0104129436381
0.0105339292707
0.0106220402757
0.0106694291805
0.0107205641679
0.0108127882035
0.0108661085398
0.010681049174
0.0100833831965
0.00892016473956
0.00711589198014
0.0048410212452
0.00327299092052
0.00471120421566
0.00511401256768
0.00635002233917
0.00731131277855
0.00795406115888
0.008319647051
0.00854588387098
0.00867325093354
0.00872080259061
0.00874724612074
0.00880471209631
0.00890333534096
0.00905802594337
0.00919667513905
0.00918870973801
0.0088875116118
0.00817729429499
0.007040529993
0.00563280260795
0.0054186228292
0.00665876801424
0.00632828908518
0.0074274575034
0.00834672655826
0.0089475286899
0.00927807301297
0.0094721090622
0.00959443098354
0.00963948960871
0.00965221457654
0.00969662853194
0.00979601291584
0.00996402340401
0.0101336340225
0.0101853721805
0.00997643359002
0.00938342033008
0.00838980113771
0.0071795144697
0.00767127703011
0.00801736105113
0.00730835974704
0.00839578656751
0.00930524409856
0.00987310483391
0.0101650932207
0.010319545761
0.0104164408938
0.0104458419416
0.0104485217218
0.0104901120668
0.0105964723739
0.0107788463124
0.0109751018168
0.0110723541101
0.0109255994344
0.0103973095212
0.00944636539084
0.00824213178799
0.00899828791987
0.00889746761597
0.00798831141968
0.00909920314821
0.00999527983627
0.0105330565031
0.0107909595672
0.0109117934792
0.0109736813676
0.0109708578428
0.0109522484816
0.010990881497
0.0111158049656
0.011324542892
0.0115544384895
0.0116917001985
0.0115924463346
0.0111051000904
0.0101640779634
0.00892425567937
0.00973075615412
0.00946251617797
0.00842870688022
0.00955963311919
0.0104383768427
0.0109475323665
0.0111813069611
0.0112868899147
0.0113138685515
0.0112673514005
0.0112201758983
0.0112562598943
0.01140271411
0.0116414010517
0.0119085327952
0.0120882216201
0.0120287921795
0.0115765500421
0.0106638589643
0.00948667771421
0.0106444912375
0.00981253317756
0.00871583286794
0.00986335556975
0.0107181613883
0.0111966152803
0.0114182717905
0.0115199231538
0.0115099168448
0.0114093179121
0.0113331340659
0.0113753792389
0.0115526588231
0.0118292319588
0.0121356910975
0.0123518126762
0.012324724653
0.0119061791196
0.0110494332749
0.0100329820037
0.01186593032
0.00996765841691
0.00887032506096
0.0100686116077
0.010913549301
0.0113662147707
0.0115633946865
0.0116147904101
0.0115406340018
0.0114103310562
0.0113533482702
0.011440452415
0.0116707809657
0.0119969102699
0.0123416208473
0.012578810312
0.0125644633192
0.0121651693597
0.0113569788612
0.0104729617187
0.0129256839997
0.010114507249
0.00894540242968
0.0101495257358
0.0109913941463
0.0114268021544
0.0115919247452
0.0115954908584
0.0114998303219
0.0114036223069
0.0114107737067
0.0115631558844
0.0118504804235
0.0122223715094
0.0125976580959
0.0128384674935
0.0128114455476
0.0124038360911
0.0116043961049
0.0107495298189
0.0134932187176
0.0104878348714
0.00901062911079
0.0101498168764
0.0109792292414
0.0114092847026
0.011568762018
0.0115769974252
0.0115270688797
0.0115072767321
0.0115932181369
0.0118100083989
0.0121428517772
0.0125422228581
0.0129248103303
0.0131481867286
0.0130900729159
0.0126544593883
0.0118303851164
0.0109325169204
0.0135997704838
0.0109706819704
0.00907481519377
0.0101160396551
0.0109327317298
0.0113771892584
0.0115650623079
0.0116251282365
0.0116581941507
0.0117321735989
0.0118993929554
0.0121723860543
0.0125325303404
0.0129347093124
0.0132954322201
0.013483950022
0.0133880157091
0.0129199639856
0.0120685441372
0.0111292059181
0.0137536773689
0.0112985934207
0.00909700803571
0.0100466734386
0.0108637779333
0.0113438621884
0.0115850305438
0.0117157109317
0.0118384930543
0.0120075219197
0.0122525120377
0.0125715932215
0.0129418905465
0.0133274794019
0.0136471900556
0.0137932148191
0.0136642053391
0.0131752331981
0.0123128031913
0.0113834714084
0.0144249918757
0.0114071210131
0.0090497078304
0.00991927761327
0.0107467192446
0.0112746282678
0.0115808978003
0.0117809396843
0.0119720609214
0.0122092200069
0.0125133422089
0.0128681834135
0.0132475007143
0.0136147021534
0.0138977496471
0.0140119120195
0.0138669455305
0.0133773851138
0.0125243729636
0.0116301320779
0.0151109890321
0.0112506995226
0.00890525099638
0.00973054453389
0.0105532754581
0.0111261369233
0.0114961651322
0.011757852437
0.0119988144054
0.0122788997702
0.0126194647092
0.0129981214863
0.0133811647819
0.0137310910591
0.0139918911703
0.0140947652262
0.0139550221993
0.0134838836995
0.0126543898443
0.0117833216913
0.0154167218669
0.0108314115946
0.00863799309332
0.00945594054094
0.0102694371788
0.0108751172336
0.0112913091765
0.011599478748
0.0118766555452
0.0121805105351
0.0125351702354
0.0129179792278
0.0132956874644
0.0136366630277
0.0138951235512
0.0140086222592
0.0138918679507
0.0134522407546
0.0126508881105
0.0117700803232
0.0152283022361
0.0100497271473
0.00818315275512
0.00902796617434
0.00985018895962
0.0104687667477
0.0109141094692
0.0112546544556
0.0115523711749
0.0118622647798
0.0122111797667
0.0125860869597
0.0129589495424
0.0133022573753
0.0135739670415
0.0137110828671
0.0136256672757
0.0132213939839
0.0124396478086
0.0115009801032
0.0144528329705
0.00887697567036
0.0074824274921
0.00837746244581
0.00921698330039
0.00984903710726
0.0103088286729
0.0106630578316
0.0109720971919
0.0112832870436
0.0116227004674
0.0119864684411
0.0123554453065
0.0127039987284
0.0129893289549
0.0131464265254
0.0130852319374
0.012701325973
0.0119096982085
0.0108545532445
0.0129902325925
0.00719416725851
0.0064865928528
0.00747819733874
0.00834919978737
0.00899722150882
0.00946844225353
0.00983472077094
0.0101545402306
0.0104683598032
0.0107997003974
0.011149272431
0.0115048520229
0.0118433109618
0.0121222104982
0.0122761786077
0.0122109179158
0.0118090601988
0.0109533522227
0.0096975625457
0.0105948088951
0.00493027487965
0.00524150277634
0.00643208799751
0.00739203196555
0.00808633293668
0.00858872843694
0.00898567818063
0.00933617722623
0.00967309389377
0.0100111740828
0.0103464222992
0.0106717146444
0.0109686781327
0.011198127209
0.0112948497868
0.0111586415642
0.010657102341
0.00962254000009
0.00798955404777
0.00711098316698
0.00245200433471
0.00478110702454
0.00694047150018
0.00852592039795
0.00963993854318
0.0104266521316
0.0110517974964
0.0116092753508
0.0121694254222
0.0127460273722
0.0132688762712
0.0137038857483
0.0140200732497
0.0141663075197
0.0140668994685
0.0135559284445
0.012450542869
0.0103845475073
0.00716990034169
0.00341664807467
0.00296148033373
0.00530302361905
0.0075231471627
0.00911502931487
0.0101532391657
0.0107712562595
0.0110952806971
0.011243629924
0.011289520968
0.0112765518916
0.011236638579
0.011156653238
0.0110367974712
0.0108674875276
0.0104967556377
0.00977412071901
0.00856848297044
0.00677077724502
0.00450064541767
0.00271001650771
0.00525875885804
0.00589624457369
0.00732200443312
0.00838082904207
0.00905624611563
0.0094254870514
0.00960590683375
0.00969143964668
0.00972072737471
0.00971735329442
0.00969719458085
0.00965651900223
0.00961040146276
0.0095543067358
0.00937290115616
0.0089442807461
0.00815775806907
0.0069478583875
0.00540507371713
0.00469148885308
0.00737965406717
0.00728534439729
0.00860105723024
0.00961806498492
0.0102579977532
0.0105983132124
0.0107600803912
0.0108425530144
0.0108764022025
0.0108768397806
0.0108531169525
0.0108071638494
0.010755451393
0.0107086314189
0.0105657754194
0.0102007335333
0.00948837465216
0.00835781299612
0.00691335560746
0.00675396032288
0.00885171712498
0.00834061442951
0.00964576018896
0.0106544048517
0.0112656007687
0.0115735340836
0.0117081937738
0.0117715264191
0.0117938827005
0.0117917443719
0.0117727506299
0.011731361236
0.0116822187818
0.0116471478175
0.0115398813411
0.0112286313727
0.0105683894925
0.00946709269265
0.00802742664128
0.00817526595163
0.00977641146073
0.00903747857467
0.0103592889797
0.0113558103108
0.0119367422684
0.0122146214588
0.0123237766996
0.0123622801519
0.0123624238765
0.0123479223188
0.012332313801
0.0123051694442
0.0122669871518
0.0122450224016
0.0121697532753
0.0119068690177
0.0112926669344
0.0102116814979
0.00876729505247
0.00911017868274
0.0103079441965
0.00944700774041
0.0107901859182
0.0117724450445
0.0123274725705
0.0125828886996
0.012676514312
0.012692830061
0.0126671005804
0.0126354168342
0.0126205251977
0.0126078291606
0.0125824897322
0.0125733293098
0.0125254215505
0.0123036392704
0.0117307757248
0.0106817920708
0.00928214979021
0.00989036085386
0.0105916369366
0.00966885749623
0.0110298795381
0.011996329528
0.012527763622
0.0127686753706
0.012854924718
0.012851289819
0.0127995583992
0.0127542439618
0.01274624458
0.0127566084422
0.0127542923973
0.012760190741
0.0127335031314
0.0125413911396
0.0120001299265
0.010996205086
0.00970477681978
0.0107594627323
0.0107806190488
0.00979440123422
0.0111681526791
0.0121186852585
0.012627057006
0.0128506037391
0.0129161178785
0.0128877197985
0.0128244839643
0.0127903310123
0.0128120124695
0.0128673044446
0.0129132279752
0.0129512498778
0.0129436852661
0.0127608042502
0.0122299468831
0.0112577692474
0.0100673031676
0.0116116468502
0.010997619653
0.00988180410016
0.0112361191518
0.0121682529082
0.0126552702315
0.0128582801964
0.0129038524575
0.012870193178
0.0128280476808
0.0128351064944
0.0129093234358
0.013029290183
0.0131493589193
0.0132493827835
0.013271221006
0.0130815672022
0.0125312183686
0.0115493112036
0.0103739679478
0.0121307180016
0.0113628425239
0.00995632064122
0.0112448026389
0.0121548129211
0.0126301935491
0.0128274340211
0.0128763447064
0.0128684410194
0.0128751595482
0.0129444423946
0.0130857281043
0.013278683874
0.0134804551289
0.0136540604752
0.0137066227891
0.0135151610216
0.0129476568175
0.0119378119471
0.0107172016937
0.0124460780038
0.0117704958378
0.00999891116529
0.0111937599524
0.0120836553617
0.0125621263969
0.0127735493241
0.0128502794947
0.0128924107077
0.0129699382428
0.0131193221695
0.0133377083793
0.0136010940728
0.0138719420108
0.0140976846546
0.0141791676943
0.0140008616248
0.0134389835949
0.0124274242071
0.0111910975591
0.0131330226415
0.0120262490345
0.00997495162668
0.0110720571751
0.0119484700194
0.0124430482232
0.0126816557074
0.0127966658748
0.0128988789298
0.0130616635248
0.0133082271113
0.0136134025598
0.0139429164803
0.014268282944
0.0145273170037
0.0146346073377
0.0144811306622
0.0139465950051
0.0129649423774
0.0117743889525
0.0142379024377
0.0120399509218
0.00986911460029
0.0108893967001
0.0117549207579
0.0122716991905
0.0125419990546
0.0126940038841
0.012848662709
0.0130905175992
0.0134370710851
0.0138317946117
0.0142314826505
0.0145990538363
0.0148869675139
0.0150230649936
0.0149058786249
0.0144175186214
0.0134894441028
0.0123710979215
0.0153084363061
0.0118196487873
0.00969165150047
0.0106626331608
0.0115109233688
0.0120537704123
0.0123626652073
0.0125533987931
0.0127471412164
0.0130433873321
0.013468610323
0.0139397866857
0.0143931855723
0.0148007918438
0.0151234657612
0.0152980814219
0.0152284682932
0.0147977655274
0.0139326397787
0.0128753068104
0.0160195983868
0.0113217640484
0.00938960194084
0.0103537816622
0.0112017733775
0.0117751723678
0.0121301266801
0.0123637397106
0.0125910408561
0.0129149495791
0.0133681090519
0.0138723140106
0.0143655799431
0.0148148486366
0.0151819745063
0.0154070571829
0.0153947582439
0.0150275184608
0.0142216997892
0.0131893373116
0.0162450453729
0.0104802170481
0.00889851009346
0.00989354950765
0.0107592386376
0.0113602047432
0.0117549170401
0.0120307167986
0.0122840490037
0.01261117067
0.0130577538156
0.0135719951216
0.014093800129
0.014583662399
0.0149997046733
0.0152808332981
0.0153292037877
0.0150224872393
0.014259789002
0.0132043080671
0.015870161451
0.00921944739038
0.00814719328197
0.00920339805471
0.0100983110607
0.0107271077432
0.0111522698478
0.0114549508606
0.0117247672751
0.0120480630315
0.0124779963125
0.0129875581926
0.0135267853004
0.0140496352196
0.0145078576345
0.0148369741274
0.0149333034993
0.0146656027001
0.0139110543798
0.0127670002295
0.0147110136217
0.00742449697047
0.00706167728059
0.0082243956469
0.00916750599537
0.00982931350962
0.010279701287
0.0106052733027
0.010889416284
0.0112071093319
0.0116112148526
0.0120992688438
0.0126356613793
0.0131695834954
0.0136484930196
0.014002766169
0.0141195569734
0.0138537196236
0.0130459783659
0.011702010643
0.0124019531524
0.00500289933752
0.00564891545621
0.00701892080383
0.00807163150853
0.00880050500187
0.0092994023822
0.00966672105394
0.00998326493084
0.010313260784
0.0106988315703
0.0111498548628
0.0116521509646
0.012155381061
0.0126090813219
0.0129355211762
0.0130101397052
0.012665883547
0.0116728610919
0.00987687887656
0.008535599151
0.00237325961233
0.00491755790728
0.00728838322735
0.00902831954539
0.01023248009
0.0110566423607
0.0116666304457
0.0121897146845
0.0127296262445
0.0133275927947
0.01394175044
0.0145382473096
0.0150591114491
0.0154501077679
0.0156207920389
0.0153724171236
0.0144447421386
0.0123560099862
0.00865547180463
0.00401866997871
0.00439548988673
0.00742100690634
0.0101040763799
0.0118524287624
0.0128572752489
0.0133568591501
0.0135118656176
0.0134976908272
0.013390852528
0.0132192566265
0.012987647896
0.0126996197457
0.0123656276977
0.0119984043582
0.0114694043495
0.0106346676127
0.00934817459296
0.00744168353789
0.0049516741539
0.00265984077758
0.00736370437873
0.00836777083747
0.0100467073888
0.0111655144461
0.0118176326303
0.0121407086428
0.0122528922503
0.0122674202183
0.0122298474559
0.0121274951047
0.0119234156515
0.0116123063445
0.0112584813343
0.0109531500021
0.0105933990798
0.0100535825895
0.00920647346425
0.00792308611648
0.00619491502838
0.0049318801984
0.00994831234468
0.0100136331114
0.0115031722321
0.0125370004164
0.0131500617258
0.0134616606234
0.0135845739545
0.0136203538369
0.0136048375314
0.0135210015394
0.0133122468928
0.0129700974381
0.0125682128965
0.0122288340405
0.0118839754504
0.0113986773722
0.0106283602429
0.00943275902896
0.00782453522482
0.007192772703
0.0115910937033
0.0111302458687
0.0125638422933
0.0135682861003
0.0141543778156
0.0144417205581
0.0145501088999
0.014578303804
0.0145602753955
0.0144829670597
0.0142854143378
0.0139395854779
0.0135122364446
0.0131510591414
0.0128305746578
0.0123998745749
0.0116893839482
0.0105418248351
0.00899542779275
0.00884558509195
0.0125113565952
0.0118073813965
0.0132432946321
0.014230762614
0.0147852171237
0.0150442177377
0.0151326242286
0.0151444903261
0.0151136812587
0.0150329646477
0.0148485338849
0.0145107058245
0.0140615409123
0.0136745983597
0.0133696527028
0.0129879239558
0.0123319377875
0.0112236524361
0.00972533643748
0.00993484342877
0.0129443405703
0.0121616217863
0.0136249509234
0.0146007136708
0.0151283860515
0.0153641448094
0.0154376563243
0.0154355701902
0.0153902787261
0.0152995787747
0.015123910512
0.0147991815406
0.0143346350166
0.0139133735692
0.0136103365405
0.0132650748453
0.0126466187584
0.0115656702047
0.0101058101073
0.0105547605986
0.0130783715762
0.0123071954991
0.0138038461685
0.0147708950473
0.0152766994178
0.01549493793
0.0155596880837
0.0155467952646
0.0154884473649
0.0153926420549
0.0152335104356
0.0149411402715
0.0144904434788
0.0140486765127
0.0137415328989
0.0134162902097
0.0128008724429
0.0117259462749
0.0103016345119
0.0109523321211
0.0131342312306
0.0123631337975
0.0138758814255
0.0148309941469
0.0153146012381
0.0155145620893
0.0155676187816
0.0155446817323
0.0154824491299
0.0153998003549
0.0152794200532
0.0150605396524
0.0146946274289
0.0142985991437
0.0140163609486
0.013679260594
0.0130285345967
0.0119165155968
0.0104934530858
0.0114058653603
0.0132299786814
0.0123899832432
0.0138876733083
0.0148220992917
0.0152808524266
0.0154590900237
0.015498105911
0.0154732276772
0.0154279543875
0.0153872631758
0.0153399678761
0.0152431181907
0.0150492341196
0.0148190499525
0.0146225822192
0.0142630709953
0.0135413784078
0.0123332776297
0.0108211894757
0.0118830176875
0.0134351640224
0.0123746128874
0.0138123336753
0.0147208383499
0.0151632604496
0.0153321037096
0.0153682145643
0.0153569557665
0.0153549425196
0.0153898332791
0.0154495347112
0.0155070524785
0.0155266634415
0.015519502209
0.0154163924129
0.0150816816467
0.0143443131699
0.0130734161031
0.0114279580424
0.0125205984138
0.0136365567686
0.0122534385537
0.0135988338196
0.0144831982904
0.0149209169211
0.0150934195022
0.0151427878477
0.0151716191441
0.0152531081578
0.0154104800639
0.015616393219
0.0158410825489
0.0160520147925
0.0161965005059
0.0161990637681
0.0159462254321
0.0152723897189
0.0140361903253
0.0123614180847
0.0136125534394
0.0136873576629
0.0120026072839
0.0132422958062
0.0141024921684
0.0145397385327
0.014714459669
0.0147761550636
0.0148603252366
0.0150665273459
0.0154085870306
0.0158097095582
0.0162050639324
0.0165519070462
0.0168092173637
0.0169217063416
0.0167742662046
0.0162021854286
0.0150643969148
0.0134736806514
0.015138913979
0.0135397349031
0.0116926647312
0.0128405180709
0.0136654980257
0.0140954058316
0.0142594485556
0.01431783637
0.0144469655321
0.0147922506774
0.0153637536834
0.0159861382901
0.0165348525812
0.0169896522853
0.0173521172422
0.0175712702685
0.0175335814666
0.0170798440718
0.0160716710636
0.0146231950731
0.0167227818224
0.0131930229352
0.0113755826134
0.0124574407162
0.0132600628035
0.0136937788421
0.0138615722442
0.0139283427442
0.0140928574895
0.0145521045186
0.0153216935517
0.0160936806038
0.0167572276958
0.0173237628133
0.0177933886407
0.0181172859749
0.0181874492997
0.0178521995541
0.0169760207535
0.0156762497533
0.0180758511753
0.0126296739155
0.0110066689974
0.0120808079708
0.0128910306052
0.0133494840065
0.0135663980622
0.0136850854618
0.0138926654728
0.0143946330629
0.0152002817233
0.0160439240518
0.0168108240467
0.0174892672338
0.0180672616396
0.0184969177666
0.0186733896215
0.018448808382
0.017686469978
0.0165016769885
0.0190040230473
0.0117438032187
0.0104820219862
0.0115981163191
0.0124427889993
0.012953047341
0.0132310818519
0.013405959347
0.0136406785773
0.0141248269349
0.0149006101368
0.0157760887393
0.0166245428231
0.0174029489591
0.0180835857832
0.0186162561891
0.0188923376235
0.0187607619
0.0180833201229
0.016961677901
0.0193116583608
0.0104070350193
0.00969015005589
0.0108879993659
0.0117830688639
0.0123477486254
0.0126818682684
0.0128871601267
0.0131309722935
0.0135832047505
0.0143140727433
0.0151946649519
0.0161025052605
0.0169650807072
0.0177359701895
0.0183574279628
0.0187127798252
0.0186473427465
0.0180089100492
0.0168563905413
0.0186810900338
0.00843785561153
0.00850911980051
0.00984982534464
0.0108236603482
0.0114514621465
0.0118197095041
0.0120471140632
0.0122867513806
0.0126896822395
0.0133442281247
0.0141929668972
0.0151335956645
0.0160603232069
0.0169095752429
0.0176102716043
0.0180292963852
0.0179958279267
0.0173175808898
0.0159681852219
0.0165672609699
0.00567773296751
0.00685876681576
0.00846830601852
0.00959597209827
0.0103192351086
0.0107537710035
0.0110289167758
0.0112755690453
0.0116254607781
0.0121688842023
0.0129260972936
0.0138500000176
0.0148007861482
0.0157048738818
0.0164621725725
0.016912578581
0.0168531657263
0.0159858479509
0.0140516675771
0.0121759089437
0.00258771526775
0.00564027012322
0.00839985344048
0.0103289385268
0.0115925550056
0.0123974097082
0.0129370977444
0.0133753333045
0.0138687699632
0.0145077301053
0.0153047256072
0.0162462631355
0.0172192796285
0.0181497204651
0.0189072293684
0.0191988009489
0.0186816934702
0.0166714958256
0.0123073394403
0.00604911578397
0.00863874012833
0.0131115582576
0.0164992142966
0.0183408037005
0.0191737803176
0.0194080689313
0.0192436427601
0.0188982392602
0.0184577877738
0.0179077536972
0.0171800597506
0.0163082136317
0.0154739459049
0.0147712703167
0.0140738094048
0.0131675783089
0.0118227430371
0.00974597682306
0.00681880367266
0.00363486622444
0.0130509636121
0.0140370195491
0.0157487726777
0.0167605101679
0.0172801574667
0.0174943416754
0.0175037096554
0.0174024946934
0.0172270077218
0.0168938739735
0.0162528818103
0.0153300531021
0.0143985220035
0.0136923293429
0.0131614719484
0.0125871727884
0.0117887079973
0.0104933278611
0.00861175245013
0.00673375906027
0.0163584848162
0.0157326618417
0.0169909103563
0.0178022450779
0.0182572919871
0.0184790979375
0.0185416016636
0.0185086132927
0.0183858409125
0.0181025483925
0.017489781435
0.0165622494643
0.0155768466473
0.0148368972912
0.0143532848874
0.0138716874819
0.0131972861652
0.0120437625585
0.010391875626
0.00949619673015
0.0181314920719
0.0167632936083
0.0178477508721
0.0185664474904
0.0189877260532
0.019197649557
0.019261770201
0.0192376007692
0.0191257003573
0.0188686366134
0.0182989284146
0.017383908901
0.0163489442386
0.0155531413292
0.0151325095758
0.0147343441585
0.0141426532339
0.013063412568
0.0115383223131
0.0113620511894
0.018920644327
0.0173351661672
0.0183897238529
0.019072425776
0.019462615289
0.019645033945
0.0196924240377
0.0196607654689
0.0195495943719
0.0193061012697
0.0187792093863
0.0178778388927
0.0167744025811
0.0158972722456
0.0154867859017
0.0151462470077
0.0146124198828
0.013578792446
0.0121284519582
0.012420486106
0.0191168724668
0.0175907341551
0.018683737091
0.0193556716655
0.0197165186934
0.0198717757246
0.0199039083256
0.0198666762548
0.0197568545307
0.0195176537145
0.0190293022225
0.0181583989955
0.0169916578753
0.0159905424479
0.0155651182629
0.0152592265052
0.0147319347157
0.0136944098681
0.0122447638766
0.0127486270674
0.0189373010562
0.0176341499389
0.018790009632
0.019464119779
0.0198022964769
0.0199339577928
0.019953895711
0.0199122759642
0.0198046742757
0.0195825412031
0.0191519691941
0.0183599248284
0.0172048529948
0.0161325893028
0.0156886002979
0.0154022015607
0.0147838730882
0.0136519574507
0.0121138165306
0.0126672052386
0.0186549834732
0.017577689441
0.0187774217806
0.0194552092854
0.0197721923842
0.0198774759058
0.019884171231
0.0198413663595
0.0197455149031
0.0195653476533
0.0192262935614
0.0186023654626
0.0176347581583
0.0166866819182
0.0163270510051
0.0159852021264
0.0152260208456
0.0138946363146
0.0121086271177
0.0126604810921
0.0183960526492
0.0174593577122
0.0186753774956
0.0193416691314
0.0196304482552
0.0197048116583
0.0196960509431
0.0196585123985
0.0195954848284
0.0194967862794
0.0193106629066
0.0189635731355
0.0184142310363
0.0179351644945
0.0177534253826
0.0173276409322
0.0164043677641
0.0148248006138
0.0127009324454
0.0130862044754
0.0181725296115
0.0171817690283
0.0183742285531
0.0190254119725
0.0193010060137
0.0193692275612
0.0193583339344
0.0193370205623
0.0193444363009
0.0193882265118
0.0194249489457
0.0194341600395
0.0194195050036
0.0194867782128
0.0193939871571
0.0189815661774
0.0180742772058
0.0164557101411
0.0141196358468
0.0142006508302
0.0178110377928
0.0165837041341
0.0177433340439
0.0183950818435
0.0186733582228
0.0187494694296
0.0187567924648
0.0187988178425
0.0189610425272
0.0192554187848
0.0196183618787
0.0200337798929
0.0204827749848
0.0207373401358
0.0207707997126
0.0205181928692
0.019789314128
0.0183547423514
0.0161447200363
0.0161104047381
0.0172398204836
0.0157075635033
0.0168232226255
0.0174783441052
0.0177530364158
0.0178119454253
0.0178161127773
0.0179478413192
0.0183643602244
0.0190766261173
0.0199129572235
0.0207381189707
0.021322682369
0.0217032970399
0.0219162772955
0.0218679765025
0.0213611944866
0.0201891472254
0.0183003434963
0.0187055017299
0.0166266269089
0.0148889691749
0.015923484843
0.0165446938637
0.016777096279
0.0167681472451
0.0167189953045
0.0169205907924
0.0176591302711
0.0189423424629
0.0203215668377
0.0213033504576
0.0219935412942
0.0225329178017
0.02293130755
0.0230781535539
0.022788238007
0.0218865589322
0.0203935491894
0.0216086365991
0.0160102386214
0.0142608047441
0.0152473555041
0.0158445241833
0.0160520925449
0.0160037390535
0.0159445899947
0.0162556448527
0.0173343649811
0.0190779141831
0.0205947340745
0.0216934342045
0.0225479623351
0.0232654145817
0.0238369927378
0.0241558851859
0.0240543653664
0.023392980556
0.0222965535204
0.0244394259091
0.015335249587
0.0138219713697
0.0148639656504
0.0155172153322
0.0157378174728
0.0157627008543
0.0158305096524
0.0162404309381
0.017381340545
0.0190917765439
0.0206510885889
0.0219050613593
0.0229476407143
0.0238422757658
0.0245755914567
0.0250455627646
0.0250970764458
0.0246290156459
0.023873041356
0.0268802899032
0.0144261879508
0.0133219360463
0.0144540209455
0.0151899837115
0.0155356232065
0.0156746651728
0.0158227579807
0.0162517687323
0.0172992968926
0.0188851443493
0.0204812039555
0.0218838286348
0.0231000182026
0.0241567908641
0.025035654362
0.0256329823096
0.0258069149185
0.0254844287696
0.0249798705597
0.0286121407452
0.0130660316677
0.0125439159229
0.013785987891
0.0146054273754
0.0150661195999
0.0153121645006
0.0154540755051
0.0158587853101
0.0168229063282
0.0183230878898
0.0199547555274
0.0214927369673
0.022869547778
0.0240774890487
0.025090128905
0.0257986511403
0.0260637358679
0.025813640525
0.0253970869785
0.0291093990955
0.010924418531
0.0113211890335
0.0127552657363
0.0136916416885
0.0142774039976
0.0145236771097
0.0146375712716
0.0149813664438
0.0158316221059
0.0172167313092
0.0188675637954
0.0205562234597
0.0221166493682
0.0235078108553
0.0246837324715
0.0255138547333
0.0258437884801
0.0255563356729
0.0249289785431
0.0275593298243
0.00764792986763
0.00945870760098
0.0112679290109
0.0123991387163
0.0130896990721
0.0133776117958
0.0134989168588
0.0137469133169
0.0144120309312
0.0155803507636
0.0171922202778
0.0190719416526
0.0208935478449
0.0225839992416
0.0240402868542
0.0250783016955
0.0254972452068
0.0249957665834
0.0234198861757
0.0223484321023
0.00364484003655
0.00763981741081
0.0109368705079
0.0130168156962
0.01423350026
0.0148837313533
0.0152446547467
0.015517731252
0.0160444403454
0.0169970536849
0.0184917666
0.0205394475388
0.0227967121802
0.0251531700624
0.0273732528315
0.0289525205311
0.0294614378854
0.02786329385
0.0224222419554
0.0126515412117
0.0184340679724
0.0256463676681
0.0297268661062
0.0314940214482
0.0319834586982
0.0319074569543
0.031422054367
0.0306648199713
0.0296919398691
0.0283685222681
0.0263429833449
0.0237002830616
0.0214777895094
0.0201425276747
0.0195746434347
0.0190687359059
0.0180190134946
0.0160010513318
0.012907236589
0.00814308768587
0.0256204978338
0.0244535394208
0.0254024531019
0.0259899840271
0.0262383672897
0.0263164995521
0.0262330826836
0.0259871236772
0.025576361674
0.0247895934769
0.0232503838171
0.0210852862896
0.0191233674065
0.0181524245101
0.0180720275747
0.0180606507181
0.0178583154823
0.0167889655749
0.0150472249267
0.0129096486078
0.0296753878915
0.0254167057894
0.0253746756942
0.0255410897645
0.0256706856519
0.02575204751
0.0257454385581
0.0256187552273
0.0253080445797
0.0246661518129
0.0233404868543
0.021432255103
0.0196070964785
0.0188846274361
0.0190271743745
0.0191657810858
0.019100242406
0.0182084910831
0.0167995325591
0.0162553830052
0.0314527063484
0.0260699007552
0.0256289475466
0.0255812560009
0.0256548995973
0.0257274557807
0.0257318359193
0.0256313424419
0.0253531163928
0.024786386351
0.0236043708699
0.021804850249
0.0199470052318
0.0191260623337
0.0195899231451
0.0198702072407
0.019874349878
0.0190535870018
0.0177805859202
0.0180857899132
0.032033395312
0.0264556454113
0.0259081973209
0.0257746322049
0.0258127904515
0.0258640570945
0.0258571934771
0.0257613829249
0.0255072866828
0.0249874983341
0.0239159401131
0.0221656531237
0.0201861906679
0.0192369727493
0.0197603350923
0.0201060613926
0.0201305783189
0.0193180252545
0.0180545018171
0.0187089409637
0.0319802572224
0.0266170759499
0.0260888455327
0.025931562378
0.0259409372133
0.0259625629918
0.0259406701128
0.0258548666798
0.0256339078735
0.0251480695613
0.0241800493793
0.0225057455254
0.020379002584
0.0190659466945
0.0197109567018
0.0201225989818
0.0200559365658
0.0191372530214
0.017683885489
0.018057923685
0.0314993528696
0.0265906239993
0.0261248139932
0.0259762697833
0.0259642335249
0.0259536684683
0.0259167460618
0.0258406040618
0.0256555733224
0.0252392282728
0.0244210116982
0.0229279188083
0.0208215785263
0.0193875470455
0.020070000314
0.0205534131775
0.0201760588985
0.0189574316313
0.017115189548
0.0171134414559
0.0308285956312
0.026424055882
0.0260096363372
0.0258881376739
0.0258589582672
0.0258089276151
0.0257567446596
0.0256998099743
0.0255685314265
0.0252696151749
0.0246602907444
0.023529262528
0.0218352999251
0.0207742933092
0.021687633892
0.0220132866873
0.0213347619938
0.0197085296125
0.0171365234541
0.0165091772058
0.0299890056252
0.0260659810786
0.0257218580033
0.0256125237963
0.0255540439817
0.0254598561853
0.0253955720552
0.0253713716399
0.0253255405283
0.0252095885959
0.0249250732018
0.0243856215796
0.0236651541495
0.0239082449986
0.0248228339715
0.0248199926198
0.0238746693349
0.021968265328
0.0190759306524
0.0174719778004
0.0288260569164
0.0252364041254
0.0249962741612
0.0249206161735
0.02486971365
0.0247911852606
0.0247446402394
0.0247636158854
0.0248655834266
0.0250451105501
0.0252299566832
0.0254828517477
0.0260379772848
0.0273989672141
0.0279256200835
0.027729541921
0.0268742582502
0.025199342576
0.0226669105065
0.020825613855
0.0268431811825
0.023565225179
0.0235798107678
0.0236139125466
0.0236040536166
0.0235648137408
0.0235740484323
0.023728279809
0.0241449325287
0.0248467696129
0.0257650750347
0.0270481352816
0.0288458563482
0.0297810884915
0.0301183111408
0.0300676914295
0.029536263828
0.0283759009294
0.0267372845035
0.0261924943987
0.0243133631738
0.0213410076042
0.0216479825859
0.0218140851739
0.0218253935437
0.0217605691193
0.0217688842982
0.0221093215503
0.0230596997201
0.0246885427727
0.0267831536383
0.0291969808355
0.030546685779
0.0312719355476
0.0317268851085
0.0319342392514
0.0317422105965
0.0310912198743
0.0304464958353
0.032737513527
0.0223787331768
0.019518150791
0.0199388041347
0.0201253139552
0.0200648660252
0.0198517348551
0.0197594901123
0.0203019683858
0.0220390428573
0.0250665816563
0.0285234315957
0.0305119318343
0.0316313734747
0.0324395653447
0.0331003230575
0.0335487614195
0.0336420291271
0.0334186743706
0.0337018783924
0.0394264688218
0.021083963582
0.0185574840323
0.0191953913438
0.019336327731
0.0192023277163
0.0188230501017
0.018811838706
0.0199873749497
0.022783452459
0.0266219849319
0.0295404109438
0.0312867781049
0.0324925413924
0.0334919485197
0.0343521285321
0.034992830953
0.0353030359329
0.035417022718
0.0365233560324
0.0457821852092
0.0203939145237
0.0187443690675
0.0197122621183
0.0201329993986
0.0199298393908
0.0198044506257
0.0202022080326
0.0214257190727
0.0240425907417
0.0273741934168
0.0299689289467
0.0317911338905
0.0332038051631
0.0344070665164
0.0354407876864
0.0362319893038
0.0367039940402
0.0370720647671
0.0388666996701
0.0514585440228
0.0197718717877
0.0188027816669
0.0199398513542
0.0205591165571
0.0207157965602
0.0208280762925
0.0212836363757
0.0224148428698
0.0246637217716
0.0275546183209
0.0300794729359
0.0320695910869
0.033693040204
0.0350803954684
0.0362656581874
0.0371823121904
0.0377760507958
0.0383220636333
0.0406440431158
0.0560629092182
0.0188099664194
0.0182956054494
0.0195261391639
0.0202799576449
0.0207210768283
0.0210650120028
0.0213726696539
0.0224092689493
0.0245054424074
0.0272544195993
0.0298458648142
0.0320424252426
0.0338831445519
0.0354539166283
0.0367854152101
0.0378111931468
0.0384871558636
0.0391128027366
0.0416994879612
0.0589087680012
0.0167253049585
0.0171827043978
0.0186155407024
0.0195370209439
0.0202918545076
0.0205019489925
0.0206430773974
0.0215848285353
0.0236175335581
0.0263446950792
0.0291238012383
0.0316627308868
0.0338336169124
0.0356908344617
0.0372520758502
0.038433318598
0.0391810844349
0.0397380147751
0.0420631578741
0.0589147790094
0.012953379296
0.0152636474244
0.017158392693
0.0182644446591
0.0191452765681
0.0192734316725
0.0193373989013
0.0201133484115
0.02211270934
0.0249223635069
0.0281705649267
0.0315027661678
0.0344502296448
0.0370477868008
0.039251866367
0.0409041638305
0.0419015891791
0.04217106779
0.0427794356137
0.0531695855886
0.00754427548923
0.0129950267105
0.0168318331347
0.0189016907707
0.0199317107526
0.0202036115112
0.0204203105352
0.0206407950774
0.0223476681837
0.025395513728
0.0299474103522
0.0357620191083
0.0416646865505
0.0475428323155
0.0529825265449
0.0571915136545
0.0598444491553
0.05951849032
0.0531199158068
0.0366473930725
0.0374432373519
0.0487167957083
0.0529264505862
0.0543704665549
0.0541061255373
0.053924058672
0.0534977544272
0.0525417832466
0.0508001418016
0.0480873955088
0.0430977175905
0.0358525240931
0.0306291303155
0.0362174905323
0.0436130786717
0.0488410907784
0.0508780637385
0.0506870370323
0.0504010006321
0.0414238821514
0.0487644697839
0.0397257438573
0.0384661125103
0.0382435624508
0.0380528242195
0.0380128469967
0.0379019158972
0.037513325256
0.0367296018529
0.0352147057785
0.0322214311255
0.0280498836407
0.0248290659894
0.0284181382307
0.0327756019347
0.0354831240013
0.0371471442146
0.0371507995713
0.0380926158122
0.05112232946
0.053044889377
0.0385230448845
0.0354508764747
0.0344935549996
0.0341523290107
0.0340663779883
0.0339898664182
0.033739714653
0.0331508076896
0.0320072592183
0.0297250517653
0.0265705694678
0.0241352074206
0.0283760463375
0.0322138500405
0.0344617841642
0.035916618359
0.0360827640238
0.0376833329861
0.0547133330941
0.0546766890768
0.0384532775125
0.0346476036436
0.0333091949309
0.032892592126
0.0327941331768
0.0327260091194
0.032518299454
0.0320022370301
0.0310271116726
0.0290821429025
0.0262504668623
0.0238340477618
0.0273757654348
0.0322674515341
0.0346442125434
0.0360481273422
0.0362682731604
0.0380186027654
0.0556109254001
0.0552207666492
0.0386314559449
0.0345717604056
0.0330716663418
0.0326110193093
0.0324951451041
0.0324224635456
0.0322391985025
0.0317857625967
0.0309102553876
0.0291815747425
0.0264711571335
0.0239003966504
0.0271786480496
0.032215043258
0.0346310993354
0.0359734820997
0.0361479166571
0.0377555796307
0.0544573974176
0.0552770229418
0.0387732290129
0.0346379791674
0.0330811075193
0.0325894734167
0.032448479091
0.0323707994601
0.0322263473831
0.0318567796259
0.0310587071415
0.0295263284679
0.0269564888258
0.0240423453516
0.0258575611411
0.0319826777507
0.0346100820481
0.0357369465696
0.0356743348086
0.0366263164419
0.0493159761117
0.0549840106099
0.0387791995634
0.0346127706159
0.033057705609
0.0325501256085
0.0323760437858
0.0322882757003
0.032180926835
0.0319030344445
0.0312549185565
0.0300048180981
0.027762218687
0.0248960342123
0.0264879357189
0.0327350428919
0.0355100865484
0.036052990813
0.035503547351
0.0356826791507
0.0456729118137
0.0543676688952
0.0385619452618
0.0343751059159
0.0328727969922
0.0323605393717
0.0321367461165
0.0320391239751
0.0319901896076
0.0318376131441
0.0314257628335
0.0305538560472
0.0289513481411
0.0268748191477
0.0293211208046
0.0355858880483
0.0379005969173
0.0379692101983
0.036947848904
0.0361436911915
0.0439329253813
0.0526943843038
0.0378351607934
0.0338254711506
0.0323828994246
0.031848954131
0.0315700045584
0.031475164934
0.0315116250251
0.0315341886733
0.0314638544782
0.0311706620152
0.0306414474743
0.0305989643408
0.03631269377
0.0405717993244
0.0418113093908
0.0414712358748
0.040377182711
0.0402582322851
0.0497398838091
0.0496982801898
0.0360825444789
0.0324947546206
0.0311947861695
0.0307138993671
0.0304946519495
0.030459098768
0.0305891745712
0.0308820360478
0.0313404883932
0.0319047296707
0.0329371235337
0.0356439270647
0.0426151537051
0.044837710459
0.0452869799115
0.0449914225733
0.0444485584592
0.0461383880238
0.0638589278463
0.0433257054084
0.0325192362688
0.0299776823362
0.0290248291151
0.0286624502346
0.0285421703022
0.0286322156912
0.0290129373863
0.0298587399726
0.0312616951289
0.033316838533
0.0369659160882
0.0437911739044
0.0464906059346
0.0474186397643
0.047754593467
0.0477682239279
0.0479294456353
0.0515308220783
0.0794981109672
0.0356849565084
0.0280716447303
0.0267120085934
0.0261551186823
0.0258749292063
0.0257330414188
0.0258488667832
0.026588228585
0.0284179933426
0.0316564852324
0.0365492096998
0.0441412809485
0.0471598330768
0.0483875785103
0.0491044057603
0.0496038600134
0.0499255079558
0.0506558486694
0.0558697263017
0.0941482506334
0.0308686381529
0.0249004330647
0.0242585848991
0.0238060085285
0.0234329647757
0.0229863074726
0.0230122453495
0.0244497846229
0.0280634806812
0.0349792799354
0.0434027309436
0.0471283652936
0.048702177377
0.0496852749127
0.0505032441042
0.0511822374942
0.0517377133001
0.0528744120961
0.0593369915555
0.106641013799
0.0285300672978
0.0265611156009
0.0271968751703
0.0260139127022
0.0254041805164
0.0237658411894
0.0243219889524
0.0290666154722
0.0352445737446
0.0417598993572
0.0462550554029
0.0484470850378
0.0497691951515
0.0508380087785
0.0517924720147
0.052607054817
0.0533216988816
0.0547407797959
0.0621943563408
0.1174804542
0.0371808121401
0.0322934808154
0.0325753819662
0.0324457165151
0.0314452270585
0.0311889421704
0.0324937759905
0.0352166815119
0.0396043645182
0.0442237347426
0.0473252956704
0.0492518741845
0.0506715100809
0.0518823114355
0.0529563736739
0.0538687978318
0.0546866781345
0.0562970331646
0.0645420872175
0.126882088355
0.0422410410347
0.0350020962265
0.0349084398881
0.035135984763
0.0349838442753
0.0351865691685
0.0362644619286
0.0382930627089
0.0415596643826
0.0451274570277
0.0478716008419
0.049862131447
0.0514324182034
0.0527732739967
0.0539447481153
0.0549277197894
0.0558091121962
0.057537273074
0.0663781921813
0.134645826586
0.0462553304649
0.0357576654891
0.0353262850052
0.0357254213203
0.0361542965185
0.036759481311
0.0374240855045
0.0391971778957
0.0421568770916
0.045451631499
0.0482026607066
0.0503608432352
0.0521038296046
0.0535776290682
0.0548414382663
0.0558797824631
0.0567898487824
0.0585428733178
0.0676871552
0.140278873696
0.0458825108681
0.0353545770684
0.0350730884805
0.0357329100613
0.0368035248001
0.0371172807911
0.0374888319191
0.039227567556
0.0423043787831
0.0457214526198
0.0487646586392
0.0513110816185
0.0533802269912
0.0551081184619
0.0565547010934
0.0576975043037
0.0586268402848
0.0602352608274
0.0689900768304
0.142796250081
0.0422642840079
0.0349956149167
0.0355261394979
0.0364240887798
0.0378283887371
0.0379605374778
0.0384659662866
0.0403795571934
0.0443976764789
0.0488190649309
0.0530944524424
0.0569754197472
0.0601569828959
0.0628322085512
0.0650455627818
0.0667237668673
0.0679217750809
0.0690984268073
0.0751431581345
0.139055541462
0.034349767153
0.0428172433614
0.0472295186922
0.0489365383507
0.0497587757174
0.0492566712606
0.0513201296315
0.053053398527
0.0623776630866
0.0738318048255
0.0866986339894
0.0997137480028
0.111089269826
0.121296277936
0.130143232551
0.137000971164
0.141951095962
0.14370996001
0.13905482708
0.116748829438
0.065721579802
0.0804646256862
0.0837792155165
0.0846082927973
0.0823254929407
0.0822152753621
0.0822149373109
0.0813379994075
0.0778503822468
0.0726853852996
0.0628791414722
0.0483935514564
0.0424414441534
0.267075172819
0.311330551706
0.324088821753
0.327126160258
0.328461563491
0.332452697429
0.325907916569
0.080553811012
0.0554049732996
0.0507711580736
0.0495826265694
0.0488049397837
0.0486463076651
0.0485297632144
0.047998135973
0.046696139349
0.0443314378288
0.0397713460015
0.0335311037856
0.0309686573462
0.0704107496519
0.0803508355058
0.0840615151734
0.0856375538605
0.0867773263017
0.0973571635544
0.333128015714
0.0840379900785
0.0508667601636
0.043638822794
0.0414682135991
0.0406644595448
0.0404167287134
0.0402589781595
0.0398667299015
0.0389809396438
0.0373648976198
0.0342559588096
0.0301488546411
0.0291426841526
0.0626983164263
0.0695821151114
0.0721594483688
0.0736147643566
0.075088055733
0.0875781509674
0.333653709552
0.0853954935443
0.0499462108571
0.0416859864239
0.0390067544619
0.0381398706324
0.0378844085581
0.0377339338409
0.0374043915016
0.0366530872517
0.0353194147811
0.0327635122035
0.029220151762
0.0280654270675
0.0593055090051
0.0680848547441
0.0709185789628
0.0724247280018
0.0740204578586
0.0868497358099
0.333382400541
0.0861696639543
0.0499442374086
0.0412761244269
0.0383751110646
0.0374653789432
0.0372008783718
0.0370557068513
0.0367734339379
0.0361260861556
0.034943895698
0.0327013254557
0.0293523917209
0.0279887204782
0.0582499762758
0.0675713491011
0.0705402535517
0.072065796006
0.0736788431527
0.0864753451204
0.332252520612
0.0867726228273
0.0501054630059
0.0412351141278
0.038250119634
0.0373118562752
0.0370290180487
0.0368917785329
0.0366793700693
0.0361656215801
0.0351008013015
0.0331328431746
0.0299596289568
0.0277387114505
0.0542024917273
0.0668878099069
0.0703720221302
0.0718227958916
0.0732965227284
0.0854804068243
0.326804517883
0.0872317117319
0.0501829883085
0.0411397046217
0.0381509151579
0.0372055662332
0.0368935313118
0.0367574405373
0.0366127192231
0.0362442543215
0.0354009510424
0.0338262637934
0.0311004017401
0.0289214228668
0.0544767274311
0.0672503160931
0.0708576875322
0.0719517146855
0.073175910243
0.0850024843883
0.324720083169
0.0871698437968
0.0499257796537
0.0407654603223
0.0378585527173
0.0369262356222
0.036562758464
0.0364291922177
0.0363836650251
0.0362078540403
0.0357057929643
0.0346507424241
0.0328021223648
0.0317749578911
0.0574307614412
0.069096860783
0.0721281922828
0.07287198677
0.0738412877825
0.0853567333915
0.324446988545
0.0834359106989
0.048655863338
0.0399358900449
0.0371616370779
0.0362251132552
0.0358047980193
0.0356941554427
0.0357864593516
0.035868427595
0.035846989272
0.035590868491
0.0352840228807
0.037639707608
0.0662309928618
0.0725101682591
0.0740809460195
0.0744532019513
0.0754043144595
0.0877219772106
0.331183132919
0.0771138963125
0.0458003985633
0.0380350815542
0.0355445161174
0.0347136853563
0.0343999583406
0.0343913067682
0.0346251529411
0.0350852579458
0.0357980274055
0.036771653411
0.0389268924318
0.0460622457484
0.0716572189755
0.07497591997
0.0756537448167
0.075930767333
0.0771588761423
0.0906417290609
0.339173986338
0.0625803109511
0.0400240458902
0.0345320184173
0.0326754494755
0.0320459663059
0.0318907812746
0.0320752241281
0.0326637705169
0.0338850484585
0.0359474246668
0.0393583741293
0.0473270524017
0.0709746163062
0.0753744514781
0.076324713181
0.0767047164553
0.0770570194426
0.0785620730248
0.092706614806
0.343544309858
0.0470478076446
0.0332700551726
0.03019895968
0.0290222877996
0.028541002724
0.0283626952762
0.0286140853379
0.029770760755
0.03244221601
0.0376706209499
0.0468531306612
0.0711331242915
0.0755516219493
0.0766279179317
0.0771182074354
0.0774990632465
0.0779480254746
0.0796365401399
0.0941217460599
0.346871879577
0.0386710275138
0.0299854034272
0.0285825543989
0.0273158880142
0.0267072580486
0.0257127222142
0.0259939746025
0.0291274341862
0.0350978913142
0.0569953149596
0.0710903646868
0.0755589799246
0.0767461503513
0.0773158520595
0.0777780859612
0.0782078935269
0.0787261391037
0.0805157380929
0.0951672290359
0.349896185374
0.0444977529025
0.0596062937642
0.0588559729659
0.0541420475047
0.0526840569113
0.0454995053168
0.0468959301209
0.0593922509358
0.06637168113
0.0717252757842
0.0753449200018
0.0766981302181
0.0773757323448
0.077911108515
0.0784075570523
0.0788746453113
0.0794315306369
0.0812690716353
0.096002118623
0.352745490701
0.270947954803
0.0762530946086
0.0688951354896
0.0673860269446
0.065998559441
0.0652470550806
0.0664372718487
0.069176659646
0.0722145350981
0.0747996373296
0.076367974973
0.0772529030713
0.0779002992833
0.0784714778808
0.0790001286693
0.079488743297
0.0800617169876
0.0819140469189
0.0966827285598
0.355390773681
0.300798187028
0.0811829141303
0.0718315294563
0.0708563782928
0.070363048181
0.0703647966203
0.071094751152
0.0723161837192
0.074016393265
0.0756720619977
0.0768582285842
0.0777031050049
0.0783874117888
0.0789938709232
0.0795444586887
0.0800422138952
0.0806151713271
0.0824572816114
0.0972216517154
0.357721877752
0.315889472844
0.083280227948
0.0727593336173
0.0718710298429
0.0718272284644
0.0721067995864
0.0724861554081
0.073404270283
0.0747967061853
0.0762182767771
0.077349277608
0.0782326494389
0.0789637713412
0.079601829595
0.080167036284
0.0806633165016
0.0812183195535
0.0830089549508
0.0976696688861
0.359610255173
0.317610184595
0.084091775463
0.0737890728842
0.0731290987245
0.0734926764128
0.0736355795264
0.0739097632765
0.0747947588473
0.0762748500188
0.0777489332131
0.0789743438815
0.0799710758589
0.080782565035
0.0814700311599
0.0820568142933
0.0825452655277
0.0830512590059
0.0846637465012
0.0987425306856
0.360866000855
0.317161030603
0.0926099049535
0.0842208390615
0.0839511766741
0.0845842055891
0.0847904016686
0.0857846566614
0.0869752557918
0.0894623820929
0.0915381846254
0.0931398919173
0.0944083189083
0.0953835144043
0.0961770602219
0.0968231176179
0.0973166979025
0.0977303543663
0.0987657076458
0.109732207018
0.36129194013
0.312889885683
0.317534758691
0.318653005823
0.318928345709
0.319493806618
0.319596611642
0.326233726144
0.328535938095
0.337215648209
0.342433673249
0.346054625987
0.349100995663
0.351839304184
0.354397425836
0.356725908029
0.358682759149
0.360244015865
0.361197117848
0.361381753055
0.353574174491
)
;
boundaryField
{
stationaryWalls
{
Cmu 0.09;
kappa 0.41;
E 9.8;
type epsilonWallFunction;
value nonuniform List<scalar>
2800
(
0.000874132810429
0.00106843108845
0.00119846208372
0.00127010444789
0.00130884950985
0.00133062116991
0.00133579800465
0.00132721376413
0.00131439187937
0.0013035807733
0.00129667676262
0.00128999281984
0.00128014949307
0.00126903668736
0.0012625865256
0.00124893617198
0.00121476470159
0.00114605992055
0.0010242692051
0.000845455520374
0.00106650804108
0.00212762547368
0.0027936461052
0.00318541467444
0.00341404634788
0.00352718805246
0.00354747205192
0.00351166253091
0.00347109702094
0.00345246309514
0.0034617749196
0.00348129820747
0.00347999929395
0.00344823939307
0.00339464714771
0.00330566092279
0.00310786123896
0.00272072513203
0.00205838585077
0.00102589776117
0.00119501005546
0.00278691280453
0.00384231957948
0.00452560855901
0.00494721426061
0.00514822459611
0.00516610058203
0.00508904470127
0.00501468647162
0.00499391384199
0.00503709301174
0.00510967845752
0.0051438184801
0.00509819520675
0.00496112139913
0.00473882185161
0.00439527409982
0.00377157256776
0.00272628212998
0.00114814055902
0.00126497758497
0.00316532686857
0.00449850305893
0.00539028339877
0.00591635844146
0.00611776400099
0.00605931992312
0.00589201516163
0.00576068346281
0.00573702705699
0.00583623097523
0.006014182758
0.00615675287197
0.00618223650679
0.00603609049461
0.00570775440536
0.00519838052905
0.00441935192871
0.00312666362087
0.00121788253692
0.00129766316899
0.00336823973068
0.00486124291303
0.00583094565004
0.00632964026343
0.00639602788917
0.00613216854424
0.0057904796377
0.00556719800243
0.00553669239672
0.00571672708744
0.0060830673035
0.00644842452574
0.0066758306566
0.00664186560828
0.00631464939639
0.00570489233856
0.00479514403636
0.00335455630435
0.00125509632856
0.00130750673358
0.0034526311479
0.0049843251135
0.00590588270208
0.00624480018165
0.00603615631609
0.00541167167485
0.00478579627446
0.00444598246411
0.00440042819669
0.0046687996879
0.00532319090057
0.00605052323992
0.00662141234393
0.00682086968108
0.00660426509809
0.00598677881198
0.00499670191269
0.00347403912022
0.00127283914016
0.00130261830658
0.00345534902407
0.00493700273983
0.00572892286489
0.00583389847724
0.00527841152076
0.00417682145404
0.00317985091138
0.00275589410509
0.00269508256017
0.00299959192597
0.00398301195835
0.00519055373031
0.00619371344987
0.0066922306515
0.00665336358508
0.0061022938951
0.00509526763039
0.00353214556362
0.00128133518061
0.00129038662001
0.00341150939207
0.00480891855938
0.00545104328094
0.00534611168446
0.00452683454849
0.00311622020628
0.00207794334041
0.00168880747314
0.00162447783205
0.0018564979556
0.00285477726453
0.00435473573779
0.00569351607962
0.00644256794305
0.00657932161705
0.00612259026661
0.00513949287364
0.00355809512843
0.00128683111061
0.00127690203153
0.00335928609841
0.00467711348864
0.00519860406009
0.00496534929618
0.00404901764957
0.00261723465609
0.00166835263486
0.0013119834232
0.00125866139421
0.00147208444997
0.00239589786947
0.00388367705157
0.00533675151307
0.00622645329196
0.00648944040285
0.00611638324228
0.00516307908778
0.00356967806921
0.00129103918508
0.00126207318913
0.00330910609724
0.00455903092771
0.00498789706186
0.00467723829398
0.00373035749146
0.00236513573494
0.00151176568299
0.00119174523337
0.00114758556971
0.00134529499524
0.00219566244157
0.0036303787299
0.00511283404709
0.00608036322668
0.00643163404432
0.00611709055736
0.00518519963139
0.00357961921585
0.00129560791803
0.00124666733115
0.00326227755444
0.00447839035612
0.00488995591904
0.00459893622256
0.00365923912931
0.00238395788081
0.00148158835675
0.00116704644561
0.00112497912587
0.00132393266971
0.00209932704906
0.00360719291723
0.00510608047079
0.00610952942231
0.00648126638618
0.00617195302322
0.00521263628669
0.00359262546281
0.00130047830043
0.00123290707938
0.00325931909445
0.00452305136109
0.00498453248757
0.00473865889413
0.00381156741499
0.00251122447716
0.00155583445285
0.00122754845821
0.00118778013524
0.00140430874911
0.0022795634943
0.00388713393407
0.00538853553716
0.00632469672466
0.0066180278373
0.00624447038109
0.00524845472318
0.00361101036857
0.00130515877953
0.001229909329
0.00328880415785
0.00459958306612
0.00513504851133
0.00497741083303
0.00414325629908
0.00287508596055
0.00187623377798
0.00152567875377
0.00149152769666
0.00174106405745
0.00273880930326
0.00436342603163
0.00576600837134
0.00657647503053
0.00676260838603
0.00631468699108
0.00528293939968
0.00363012623241
0.00130963844689
0.00123306830013
0.00331619311413
0.00468258849764
0.00532219945482
0.00532811512471
0.0047592654047
0.00377900531107
0.00286216997031
0.00246652375757
0.00244396458852
0.00277876894043
0.00380012821122
0.00512953384063
0.00622728688424
0.00682373622796
0.00687165909396
0.00634717831231
0.00529035732708
0.00363568564328
0.00131065456334
0.00123764590967
0.00331020487446
0.00471667432037
0.00545987787203
0.0056517285512
0.00539381186823
0.0048310683674
0.00425221424315
0.00395925668124
0.00396400769213
0.00427652779487
0.00499223510225
0.00587260803605
0.00658629987036
0.00694062576353
0.00684609166638
0.00627114226922
0.00522597522669
0.00360257269007
0.00130597514448
0.00123520636792
0.00323488487995
0.00461940725546
0.00541862491053
0.00575011250507
0.00572703363236
0.00547157886388
0.00516953906246
0.00499386828165
0.0050142318931
0.00524198927317
0.0056900893436
0.00621122353664
0.00662124926765
0.0067708816113
0.00657680610959
0.00600823746156
0.00503023913631
0.0034934392656
0.00128887018014
0.00121104295295
0.0030526087498
0.00430706933145
0.00507629403693
0.00546411480613
0.00557027786167
0.00549378462387
0.00535415802935
0.00526571712443
0.00528660397242
0.00543421910882
0.00569289560099
0.00597729158685
0.00617807276634
0.00619608172326
0.00597626520623
0.00548618527433
0.0046341375778
0.0032567315351
0.00124932011543
0.00114811676145
0.0026959430926
0.00370438419651
0.0043243944087
0.00466842309144
0.00481077242872
0.00481652795355
0.00476073242757
0.00471994837491
0.00473411461989
0.00481797449754
0.00495321219151
0.00508887917308
0.00516417948886
0.00513327954402
0.00496790783601
0.00460917559577
0.00394109526377
0.00282820782206
0.00117367875934
0.00102836380152
0.0020552171686
0.00269843195678
0.00306536227919
0.00327176539474
0.00337152441636
0.00339632821047
0.00337917673547
0.00336332838834
0.00336998843232
0.00340647349021
0.00346180040026
0.00350987743169
0.00353177181846
0.00351563286332
0.0034361565364
0.00323215413338
0.00282108463737
0.00211835210703
0.0010426410784
0.000849642464515
0.00102781529655
0.00114495389879
0.00120656883914
0.00123713570947
0.00125725795438
0.00126923880482
0.00127368504306
0.00127653729043
0.00128103733919
0.00128875930017
0.00129595398838
0.0012972983473
0.00129366974156
0.00128909840088
0.00127643874379
0.00124211304125
0.00116958959193
0.00104033480083
0.000853446739274
0.000849642464515
0.00102781529655
0.00114495389879
0.00120656883914
0.00123713570947
0.00125725795438
0.00126923880482
0.00127368504306
0.00127653729043
0.00128103733919
0.00128875930017
0.00129595398838
0.0012972983473
0.00129366974156
0.00128909840088
0.00127643874379
0.00124211304125
0.00116958959193
0.00104033480083
0.000853446739274
0.00116436665483
0.00169016630148
0.00205730414609
0.0022607442573
0.0023488299376
0.00237033882721
0.00236243886446
0.00234784985193
0.00233911008666
0.00233920931719
0.00235170539208
0.00237690539083
0.00241073942093
0.00244272721309
0.00245239319919
0.00241178068674
0.00229181620597
0.00205979749662
0.00167734223839
0.00115518080518
0.00139596877954
0.00224757062933
0.00285858991774
0.00321120693314
0.00337831861366
0.00342998721145
0.00342465374168
0.00340239413965
0.00338805928245
0.00339164241478
0.00341812427562
0.00346631557817
0.00352481648834
0.00357180031138
0.0035718937112
0.00348412348983
0.00326433535928
0.00286343136511
0.00222734024776
0.00138763475754
0.00152177745843
0.00262635632499
0.00343596598183
0.003917333677
0.00415818479246
0.00424299723754
0.00424544053108
0.00422105393635
0.00420612838694
0.00421743167709
0.0042615526734
0.00433465108026
0.0044160762369
0.00447350937973
0.00445891279118
0.00432190637631
0.00400804758621
0.00345744816694
0.00260760369558
0.00151594016865
0.00160404292604
0.00289762668973
0.00386318587205
0.00445074683846
0.00475417148182
0.00486909411546
0.00488074714417
0.00485788937946
0.0048461979097
0.00486870912565
0.00493346842973
0.00503324492328
0.00513912233824
0.00520874991117
0.00518227358935
0.00500070162724
0.00460259544125
0.00392155165432
0.00289275251516
0.00160196375984
0.00166721947994
0.00309975713388
0.00418691598544
0.00486043841778
0.00521719339095
0.00535827019533
0.00537979600556
0.0053615576624
0.00535719864804
0.0053944617622
0.00548267033189
0.00561172600028
0.00574506191633
0.00583063614847
0.00579735411488
0.00557853573827
0.00510652386628
0.0043104911023
0.00312680701932
0.00167128257508
0.00172211909545
0.00325778100651
0.00444069074143
0.00518454916578
0.00558638706493
0.00575125489593
0.00578361548363
0.00577367307884
0.0057803181505
0.00583556609351
0.00595054290481
0.00611170532664
0.00627618097433
0.00638234920418
0.00634891709387
0.00610117178338
0.0055654309257
0.00466624517711
0.00334209895631
0.00173763550177
0.00177653275676
0.00339115332551
0.00465189412329
0.00545611288931
0.00589709175531
0.00608394061161
0.00612859711205
0.00613009644723
0.00615143247114
0.00622818408635
0.00637278315532
0.00656904586355
0.00676842047577
0.00690047005769
0.0068741137542
0.00660634372507
0.00601675153056
0.00502354492143
0.00356513520956
0.00181161632235
0.00183576511468
0.00351779322346
0.00484812799848
0.00570623837791
0.00618385225172
0.00639108239642
0.00644922418144
0.00646442715557
0.00650355778955
0.00660483111442
0.0067812211571
0.00701474432518
0.00725208788917
0.0074149430422
0.00740240597638
0.00712365544514
0.00648982967279
0.00540965658448
0.00381755156495
0.00190317505497
0.00190652507397
0.00365666364885
0.00505691009249
0.00596984268273
0.00648255153598
0.00670898290502
0.00678074237949
0.00681105753764
0.00686828919004
0.00699505658345
0.00720403538307
0.00747571125362
0.00775205485326
0.00794832166762
0.0079548942299
0.0076730035733
0.00700291377125
0.00584058664521
0.00411285846616
0.00202151068911
0.00199678938058
0.00383059143622
0.00531383928283
0.00628969977495
0.00683732800996
0.0070793320914
0.00716232339735
0.00720561164012
0.0072785946138
0.00742741429519
0.00766646257932
0.00797386830495
0.00828735285911
0.00851654140975
0.00854456976975
0.00826347862761
0.00756112321301
0.00631883770755
0.00445336620807
0.00217364033011
0.00212022966023
0.00407354088087
0.00566835246286
0.00671861311481
0.0073021590953
0.0075533082854
0.00763873081361
0.00768861166794
0.00776831100859
0.00793001330976
0.00819098090185
0.00852723951129
0.00887225994513
0.00912958402962
0.00917632654429
0.00889407227832
0.00815766958988
0.00683532141621
0.00483157030687
0.0023644455561
0.00229603167342
0.00442694099967
0.00617772713346
0.00732373750963
0.00794178073367
0.00818898723034
0.00826184287812
0.00830394929567
0.00837421392457
0.00853083972469
0.00879903285048
0.00915161016607
0.00951787212987
0.00979327379822
0.00984864264537
0.00955437272468
0.00877580602501
0.00737223592277
0.00523538285288
0.00259848635677
0.00255217574032
0.00492420755572
0.00689350870266
0.00816792700517
0.00882045709529
0.00905005754218
0.0090884252588
0.00909628294383
0.00912775964545
0.00925001170244
0.00950910146746
0.00986621115808
0.0102394750882
0.0105168995827
0.0105611979382
0.0102338643285
0.00939796645977
0.00790920729779
0.00565397465331
0.00288109123787
0.00292437642704
0.00560796787276
0.00785433978174
0.00929553086054
0.0100007567301
0.0102222270013
0.0102048927159
0.0101268734743
0.0100658951616
0.0101118615299
0.0103534524482
0.0107179922101
0.0110883874908
0.0113413471041
0.011339652692
0.0109461454404
0.0100267873296
0.00843517312386
0.00607045841751
0.00321377258446
0.00342120367971
0.00643754289937
0.00908907932597
0.010827431792
0.0117123786852
0.0119833419739
0.011868761575
0.0115685190156
0.0112793764868
0.011222310859
0.0114961727094
0.011928230936
0.0122587595041
0.0123965061418
0.0122564528976
0.0117349673268
0.0106899487352
0.00896343830576
0.00646892468587
0.0036043576958
0.00406312442959
0.00730200049456
0.0105387981472
0.0128855152626
0.0143383908702
0.0150473579567
0.0151121881765
0.0146271779267
0.0139651543613
0.0136657742624
0.0139110390152
0.0144039448204
0.0143046111118
0.0139588803417
0.0134710321194
0.0127189103343
0.0114944887519
0.00960596396707
0.00690456352326
0.00408941634886
0.00500968450368
0.00856523195266
0.0126172231922
0.0158638867309
0.0183750638055
0.0203959110475
0.0220836336743
0.0229463415621
0.0227657903013
0.0222200515522
0.0216839123806
0.0203320082991
0.0179140992343
0.0163600053848
0.0153600238448
0.0142778580389
0.0128212827696
0.0107222914407
0.00763869308996
0.00466492329516
0.00596758108703
0.0104951565582
0.0155080508688
0.0197702907774
0.0234197092681
0.0257981750276
0.0261281310082
0.0245829977553
0.0225714870711
0.0205799849048
0.0194278474369
0.0195555276161
0.0195980159155
0.0188162114545
0.0175125285725
0.0160903636865
0.0143295323873
0.0121034756783
0.00865882198614
0.00513094706878
0.0068291730288
0.0125472775003
0.0179595734248
0.0208028137178
0.0218324709297
0.0218627474743
0.0211738388928
0.0200563574356
0.0183281014333
0.0164281488143
0.0154602558671
0.0152668009856
0.0157874178139
0.0162707787098
0.0165115914885
0.01606131973
0.0146680841058
0.0123583559574
0.0088375673775
0.00507597241219
0.00604075972032
0.0110491159033
0.0156203428577
0.0175983793985
0.0178262222101
0.0177380960604
0.0176444853937
0.0173108451833
0.0165753203302
0.0157296537349
0.0151456319749
0.0148838061961
0.0152503309648
0.0154292375027
0.0154278429154
0.0147379019933
0.0132224224821
0.010817413506
0.007610931102
0.00424598707881
0.00513994135456
0.00884713195956
0.0125910410117
0.014398626226
0.0147964338894
0.0152930336432
0.0159547723108
0.0162951445236
0.0161745612325
0.0157906405088
0.015349190854
0.0151966586596
0.0154120184208
0.015367925499
0.0150321813466
0.0140606333994
0.0123676039255
0.00990622725983
0.00685578271697
0.00373669522321
0.00416537820931
0.00688776576943
0.00974579248095
0.0112455891738
0.011783079004
0.0126689811957
0.0139119910838
0.0148690997265
0.0152498042783
0.0151074895879
0.0148351555411
0.0149655626588
0.015318868814
0.0153500262496
0.0149487576955
0.0139558504303
0.012309802778
0.00987807212762
0.00670332765688
0.00345048561146
0.00327299092052
0.0054186228292
0.00767127703011
0.00899828791987
0.00973075615412
0.0106444912375
0.01186593032
0.0129256839997
0.0134932187176
0.0135997704838
0.0137536773689
0.0144249918757
0.0151109890321
0.0154167218669
0.0152283022361
0.0144528329705
0.0129902325925
0.0105948088951
0.00711098316698
0.00341664807467
0.00271001650771
0.00469148885308
0.00675396032288
0.00817526595163
0.00911017868274
0.00989036085386
0.0107594627323
0.0116116468502
0.0121307180016
0.0124460780038
0.0131330226415
0.0142379024377
0.0153084363061
0.0160195983868
0.0162450453729
0.015870161451
0.0147110136217
0.0124019531524
0.008535599151
0.00401866997871
0.00265984077758
0.0049318801984
0.007192772703
0.00884558509195
0.00993484342877
0.0105547605986
0.0109523321211
0.0114058653603
0.0118830176875
0.0125205984138
0.0136125534394
0.015138913979
0.0167227818224
0.0180758511753
0.0190040230473
0.0193116583608
0.0186810900338
0.0165672609699
0.0121759089437
0.00604911578397
0.00363486622444
0.00673375906027
0.00949619673015
0.0113620511894
0.012420486106
0.0127486270674
0.0126672052386
0.0126604810921
0.0130862044754
0.0142006508302
0.0161104047381
0.0187055017299
0.0216086365991
0.0244394259091
0.0268802899032
0.0286121407452
0.0291093990955
0.0275593298243
0.0223484321023
0.0126515412117
0.00814308768587
0.0129096486078
0.0162553830052
0.0180857899132
0.0187089409637
0.018057923685
0.0171134414559
0.0165091772058
0.0174719778004
0.020825613855
0.0261924943987
0.032737513527
0.0394264688218
0.0457821852092
0.0514585440228
0.0560629092182
0.0589087680012
0.0589147790094
0.0531695855886
0.0366473930725
0.0414238821514
0.05112232946
0.0547133330941
0.0556109254001
0.0544573974176
0.0493159761117
0.0456729118137
0.0439329253813
0.0497398838091
0.0638589278463
0.0794981109672
0.0941482506334
0.106641013799
0.1174804542
0.126882088355
0.134645826586
0.140278873696
0.142796250081
0.139055541462
0.116748829438
0.325907916569
0.333128015714
0.333653709552
0.333382400541
0.332252520612
0.326804517883
0.324720083169
0.324446988545
0.331183132919
0.339173986338
0.343544309858
0.346871879577
0.349896185374
0.352745490701
0.355390773681
0.357721877752
0.359610255173
0.360866000855
0.36129194013
0.353574174491
0.000874132810429
0.00117241327464
0.00141203847344
0.00154565597084
0.00163531598485
0.00170419437083
0.00176331202588
0.00181954822619
0.00187794411534
0.0019439648128
0.00202242338951
0.00211773821816
0.00223833680317
0.00240204282915
0.00261057641345
0.0029394876803
0.00342396545073
0.00389852604383
0.00412475976976
0.00427105581463
0.00395692411918
0.0033565984642
0.00286046478149
0.00266732058388
0.00296148033373
0.00439548988673
0.00863874012833
0.0184340679724
0.0374432373519
0.065721579802
0.00106650804108
0.00170252228965
0.00226412293236
0.00264860159787
0.00292634659826
0.00313429948803
0.00329677561443
0.00343206995179
0.00355610824641
0.00368496350939
0.00383543222963
0.00401725689658
0.00424461219179
0.00452228935605
0.00487090922597
0.00538968196376
0.00602256316896
0.00641212308342
0.0064272839566
0.0067389574018
0.00642844279612
0.00559161518293
0.00491369713123
0.00473466439809
0.00530302361905
0.00742100690634
0.0131115582576
0.0256463676681
0.0487167957083
0.0804646256862
0.00119501005546
0.00206779856909
0.00286636774216
0.0034432276529
0.00387156479804
0.00419503527779
0.00444557095062
0.00464923028526
0.00482989971127
0.00501164078166
0.00521935270055
0.00547170719471
0.00579570937327
0.00620098640021
0.00673163238965
0.00745928259961
0.00834241755293
0.00916771560957
0.00920447171304
0.00945909069401
0.00895188098439
0.00785932759563
0.00697829126886
0.00676321556989
0.0075231471627
0.0101040763799
0.0164992142966
0.0297268661062
0.0529264505862
0.0837792155165
0.00126497758497
0.0022730000365
0.00321449685597
0.00391265299767
0.004439213679
0.00483970760099
0.00514959769188
0.00539893407748
0.00561715709653
0.00583227606379
0.00607409959052
0.00636809397271
0.00675092335537
0.00724001965884
0.00790236862447
0.00872277953299
0.00965048261166
0.0107931787329
0.0111426568015
0.0113742534978
0.0105430364844
0.00924390713214
0.00834878561841
0.00821917212869
0.00911502931487
0.0118524287624
0.0183408037005
0.0314940214482
0.0543704665549
0.0846082927973
0.00129766316899
0.00236935617653
0.00338555132113
0.0041509822511
0.0047326480356
0.00517584106956
0.00551836739297
0.00579242182286
0.00602845557177
0.00625773180424
0.00650994923097
0.00681786202785
0.00722166084756
0.00774236820785
0.00846071395788
0.00930458527781
0.010227802548
0.0116498489329
0.0122608728808
0.0125152284197
0.0115052634573
0.010128562079
0.00927111424547
0.0092148859063
0.0101532391657
0.0128572752489
0.0191737803176
0.0319834586982
0.0541061255373
0.0823254929407
0.00130750673358
0.00240157897917
0.0034476086422
0.00424023999737
0.00484324041428
0.00530214065384
0.00565458248198
0.00593406973245
0.00617123888917
0.00639609217821
0.0066409432226
0.00694054254936
0.00732985562587
0.00783613248716
0.00853966811407
0.0093701357986
0.010304006817
0.0119882021716
0.0127546328354
0.0130065362539
0.0118942319361
0.0105537784509
0.00981501449937
0.00983659630314
0.0107712562595
0.0133568591501
0.0194080689313
0.0319074569543
0.053924058672
0.0822152753621
0.00130261830658
0.0024060256451
0.00345634073822
0.00425006393413
0.00485188112281
0.00530652260666
0.00565237608884
0.00592259018975
0.00614797993485
0.00635859971172
0.0065864558205
0.00686102298607
0.00721795941162
0.0076895179222
0.00833419309993
0.0091823365396
0.010411123851
0.012166731078
0.012932292103
0.0131813400308
0.012222800367
0.010920850903
0.0101932804451
0.0102146999564
0.0110952806971
0.0135118656176
0.0192436427601
0.031422054367
0.0534977544272
0.0822149373109
0.00129038662001
0.00240313841765
0.00344667601574
0.00422911831659
0.00481691937915
0.0052582804905
0.005591233176
0.00584871376936
0.00605967638687
0.0062522018628
0.00645760165337
0.00670518551375
0.00702517213441
0.00745417177036
0.00801630601848
0.00892652127741
0.0104132760447
0.0122165049204
0.012895299219
0.0131650279887
0.01227430843
0.0110323085012
0.0103679743686
0.0104129436381
0.011243629924
0.0134976908272
0.0188982392602
0.0306648199713
0.0525417832466
0.0813379994075
0.00127690203153
0.00240235838152
0.00343641660145
0.00420550973547
0.00478004143521
0.00520734617871
0.00552719765796
0.00577151619519
0.00596937337947
0.00614714974151
0.00633490484696
0.00656058047332
0.00685017350915
0.00724204544146
0.00775288632123
0.00870218343535
0.010460041143
0.0125388125938
0.0131582997068
0.0132128934267
0.0121339708278
0.0111006622879
0.0105410735252
0.0105339292707
0.011289520968
0.013390852528
0.0184577877738
0.0296919398691
0.0508001418016
0.0778503822468
0.00126207318913
0.00240315743072
0.00343103528528
0.00419060100135
0.00475462075719
0.00517295434702
0.00548365609805
0.00572031274624
0.00591011999235
0.00608168201036
0.00626305889315
0.00648262909117
0.00676726364556
0.00716818203578
0.00771008586482
0.00865552206963
0.0107060715826
0.0130608851112
0.0136336818219
0.013118949253
0.01201492768
0.0111426075855
0.0106501350705
0.0106220402757
0.0112765518916
0.0132192566265
0.0179077536972
0.0283685222681
0.0480873955088
0.0726853852996
0.00124666733115
0.00240208273971
0.00342877883476
0.0041865724337
0.00474790634451
0.00516414812441
0.00547383015329
0.00570979440248
0.00590043502484
0.00607644671599
0.00627142257165
0.00651305154975
0.00683053154132
0.00727247622907
0.00786094435762
0.00885238026572
0.0112497116865
0.0139681211425
0.0147398400415
0.0133405210738
0.0122421467687
0.0113433683706
0.0107727818334
0.0106694291805
0.011236638579
0.012987647896
0.0171800597506
0.0263429833449
0.0430977175905
0.0628791414722
0.00123290707938
0.00239550465506
0.00342908712627
0.0041933146182
0.00476053027282
0.00518253960233
0.00549954255054
0.00574579543028
0.00595136423155
0.00614551576201
0.00636200195132
0.00663767586131
0.00701027966491
0.00753422580951
0.00824542702866
0.00940969828257
0.0119693858182
0.0151809824196
0.0163767769854
0.0141648777097
0.0127905040388
0.01178299633
0.0110017492118
0.0107205641679
0.011156653238
0.0126996197457
0.0163082136317
0.0237002830616
0.0358525240931
0.0483935514564
0.001229909329
0.00238933885219
0.00343587390178
0.00421505948946
0.00479600886465
0.005231206279
0.0055622801017
0.00582308229343
0.00604525410011
0.00626311105993
0.00651313474712
0.00683797945669
0.00728882688328
0.00792274109129
0.00878920454985
0.0101565935665
0.0128020162617
0.0164522961741
0.0187829543963
0.0158031142375
0.0136403746828
0.0124275977403
0.0113765899527
0.0108127882035
0.0110367974712
0.0123656276977
0.0154739459049
0.0214777895094
0.0306291303155
0.0424414441534
0.00123306830013
0.00238642129591
0.00344142236064
0.00423246358439
0.0048263977101
0.00527504797186
0.00561965857165
0.00589582624022
0.00613827825082
0.0063837248653
0.00667392898723
0.00705964300668
0.00759938707463
0.00835243387279
0.00935837366823
0.0108438860669
0.0133565263435
0.0169824022174
0.0208394465015
0.0176845331106
0.0148522249541
0.0131414312721
0.0117471219852
0.0108661085398
0.0108674875276
0.0119984043582
0.0147712703167
0.0201425276747
0.0362174905323
0.267075172819
0.00123764590967
0.00237634787682
0.0034234385549
0.00421076542565
0.00480421128599
0.00525527364776
0.00560514435852
0.00589027821856
0.00614836608471
0.00641717076963
0.00674446205768
0.0071888607542
0.00781392436039
0.00867294980251
0.00977891456291
0.0112722342467
0.0134902805144
0.0167297653484
0.0206258191286
0.0186910427332
0.0154952760809
0.0134557693031
0.0117866054954
0.010681049174
0.0104967556377
0.0114694043495
0.0140738094048
0.0195746434347
0.0436130786717
0.311330551706
0.00123520636792
0.00234287886095
0.00335373393264
0.00410958555377
0.00467863482963
0.0051121036725
0.00545096576785
0.00573222999041
0.00599183543938
0.00627032057612
0.00661913056308
0.00709941444116
0.00777795865958
0.00869129137641
0.00982093456048
0.0112127562888
0.013061985495
0.0157618968119
0.0190008265243
0.0185050537587
0.0154668560833
0.013137698156
0.0113170633624
0.0100833831965
0.00977412071901
0.0106346676127
0.0131675783089
0.0190687359059
0.0488410907784
0.324088821753
0.00121104295295
0.002250010374
0.00318389831739
0.00387090513273
0.00438307722476
0.0047711686328
0.00507640236025
0.00533282327139
0.00557515141281
0.00584139012899
0.0061815915618
0.00665598646611
0.00732511538804
0.00821146784901
0.00927856369784
0.0104965374544
0.0118745256086
0.0137959655679
0.016121368969
0.0171529533608
0.0145292039882
0.0120344638413
0.0101661303582
0.00892016473956
0.00856848297044
0.00934817459296
0.0118227430371
0.0180190134946
0.0508780637385
0.327126160258
0.00114811676145
0.00204591808747
0.00283577153181
0.00340174169583
0.00381674356268
0.00412938491954
0.0043756470395
0.00458421578361
0.00478454702107
0.00500965677834
0.0052996811
0.00570795445217
0.00628774358023
0.00705875868025
0.00798286711052
0.00898223822686
0.00998061657218
0.0114071618912
0.013312442808
0.0147047018572
0.012440594816
0.0099957154763
0.00824906959637
0.00711589198014
0.00677077724502
0.00744168353789
0.00974597682306
0.0160010513318
0.0506870370323
0.328461563491
0.00102836380152
0.00168345576393
0.0022370234574
0.00261193217246
0.00287995397571
0.00308053301683
0.00323901417544
0.0033767678501
0.00351159447907
0.00366631727137
0.00386615639218
0.00414946668641
0.00455699185162
0.00511136815743
0.00579185401926
0.00653216245498
0.00721908587076
0.00814861865347
0.00950685531157
0.0107362305046
0.00911312351874
0.00719602833278
0.00577222852163
0.0048410212452
0.00450064541767
0.0049516741539
0.00681880367266
0.012907236589
0.0504010006321
0.332452697429
0.000849642464515
0.00116436665483
0.00139596877954
0.00152177745843
0.00160404292604
0.00166721947994
0.00172211909545
0.00177653275676
0.00183576511468
0.00190652507397
0.00199678938058
0.00212022966023
0.00229603167342
0.00255217574032
0.00292437642704
0.00342120367971
0.00406312442959
0.00500968450368
0.00596758108703
0.0068291730288
0.00604075972032
0.00513994135456
0.00416537820931
0.00327299092052
0.00271001650771
0.00265984077758
0.00363486622444
0.00814308768587
0.0414238821514
0.325907916569
0.000845455520374
0.00116267250868
0.0013978371608
0.00152532736703
0.00160781315587
0.00166902828622
0.00171929134221
0.00176541893991
0.00181299895745
0.00186579973888
0.00192869412178
0.0020066604123
0.00210388630402
0.00222561398782
0.00238010977298
0.00256633616193
0.00281003119437
0.00315250982214
0.00348860056066
0.00371876204887
0.00327076158193
0.00293540539656
0.00266222878146
0.00245200433471
0.00237325961233
0.00258771526775
0.00364484003655
0.00754427548923
0.034349767153
0.312889885683
0.00102589776117
0.00169661846203
0.00226623814505
0.00265591529161
0.00293624886809
0.00314548146702
0.00330733529744
0.00343969742591
0.00355866268851
0.00367739125377
0.00380685674122
0.00395769730095
0.00413989213609
0.00435708918001
0.00461535417506
0.00493126758543
0.00525090262119
0.00549381460918
0.00605190829201
0.00666287176723
0.00581789570058
0.00526422488216
0.00494013915207
0.00478110702454
0.00491755790728
0.00564027012322
0.00763981741081
0.0129950267105
0.0428172433614
0.317534758691
0.00114814055902
0.00207954627815
0.00290558224014
0.00350578417997
0.00395390977313
0.00429619172471
0.00456493393111
0.00478495568806
0.00497853401559
0.00516580040811
0.00536226579701
0.00558446498631
0.00584639423611
0.00616209634807
0.00654004706773
0.00704850645045
0.00760729931433
0.00805342547982
0.00896386326127
0.00969161497159
0.00829977841291
0.00741564542252
0.00702051345291
0.00694047150018
0.00728838322735
0.00839985344048
0.0109368705079
0.0168318331347
0.0472295186922
0.318653005823
0.00121788253692
0.00231423217105
0.0033067968281
0.00405021604331
0.00461778610696
0.00505897433199
0.00541075071931
0.00570228940879
0.00595871113134
0.00620345748231
0.00645557371804
0.00673320763022
0.00705678305796
0.00744684827937
0.00791949706478
0.00857759365704
0.00935143930339
0.00999441116456
0.0110042373174
0.011676026119
0.00994595764633
0.00890327781332
0.00851203824104
0.00852592039795
0.00902831954539
0.0103289385268
0.0130168156962
0.0189016907707
0.0489365383507
0.318928345709
0.00125509632856
0.00244875056442
0.00354458768212
0.00437982265685
0.00502729637843
0.0055382416207
0.00595038432116
0.00629540983739
0.00660076286038
0.00689009441813
0.00718554188914
0.00750692702785
0.00787634298977
0.00832217315538
0.00885818326597
0.00960258649047
0.0105100844077
0.0112989127473
0.0121802986278
0.012659735837
0.0108710630404
0.00990179351228
0.00955722369963
0.00963993854318
0.01023248009
0.0115925550056
0.01423350026
0.0199317107526
0.0497587757174
0.319493806618
0.00127283914016
0.00252100029095
0.00367605096713
0.00456674539142
0.00526495310566
0.00582164235546
0.00627561634791
0.00665919349097
0.00699978346479
0.00732251006664
0.00764919539035
0.00800121374858
0.00840186180106
0.00888436852305
0.00947043709036
0.0102759613548
0.011292976913
0.0121959221686
0.0129715064703
0.0131420790316
0.0114769229529
0.010593275916
0.0102953722857
0.0104266521316
0.0110566423607
0.0123974097082
0.0148837313533
0.0202036115112
0.0492566712606
0.319596611642
0.00128133518061
0.00255664390003
0.00374252155861
0.00466430370497
0.00539214970675
0.0059773117498
0.00645939905613
0.00686997653789
0.00723733634849
0.00758517000388
0.00793514052124
0.00830817658585
0.00872942856395
0.00923304989978
0.0098580172554
0.0107157668176
0.0118217072546
0.0128300094714
0.0136359780181
0.0133596487104
0.0119027926052
0.0111439117124
0.010898080356
0.0110517974964
0.0116666304457
0.0129370977444
0.0152446547467
0.0204203105352
0.0513201296315
0.326233726144
0.00128683111061
0.00257239093255
0.00377268113614
0.00471027707439
0.00545484328842
0.00605805047742
0.00655925622238
0.00699084797339
0.00738012941546
0.00774996112976
0.00812123991437
0.00851404977773
0.0089517786382
0.00947011194688
0.0101212553006
0.0110040671027
0.0121358109023
0.0131328718204
0.0141307327623
0.0134240442641
0.0122380585753
0.01163221784
0.0114559318387
0.0116092753508
0.0121897146845
0.0133753333045
0.015517731252
0.0206407950774
0.053053398527
0.328535938095
0.00129103918508
0.00257751152502
0.00378427829801
0.00473026879634
0.00548498865784
0.00610118473418
0.00661802573656
0.00706816263877
0.0074780354011
0.00787097615213
0.00826598336065
0.00868149972333
0.0091409081952
0.00967829580575
0.0103482168555
0.0112223458631
0.0123060792761
0.0132290858749
0.0145081955391
0.0135367544992
0.0125323773385
0.0121038515537
0.0119988432643
0.0121694254222
0.0127296262445
0.0138687699632
0.0160444403454
0.0223476681837
0.0623776630866
0.337215648209
0.00129560791803
0.00257809158323
0.00378783118298
0.00473918727216
0.00550194648608
0.00612911302973
0.00666118373376
0.00713052699006
0.00756441538598
0.00798439088642
0.0084084446495
0.00885374439779
0.00934229180459
0.00990598943533
0.0105952019788
0.011458462786
0.0124829027193
0.0134784135464
0.0151008234
0.0141782717139
0.0130316290095
0.0126099303702
0.012532521791
0.0127460273722
0.0133275927947
0.0145077301053
0.0169970536849
0.025395513728
0.0738318048255
0.342433673249
0.00130047830043
0.00257772087623
0.00378828171225
0.00474353317678
0.00551354098704
0.00615191593049
0.00670045881973
0.00719162478217
0.00765292360245
0.00810516010144
0.00856498366482
0.00904716811314
0.0095703942436
0.010164173995
0.0108729190851
0.0117403949715
0.0127488506454
0.0139538055277
0.0158016109218
0.0148928979439
0.0135520474969
0.0130516812277
0.0129925129567
0.0132688762712
0.01394175044
0.0153047256072
0.0184917666
0.0299474103522
0.0866986339894
0.346054625987
0.00130515877953
0.00257556372708
0.0037854697971
0.00474310886209
0.0055190040658
0.0061680399918
0.00673316133058
0.00724802425032
0.00774034805419
0.00823023639634
0.00873278304279
0.00925933684317
0.00982383594853
0.0104490855139
0.0111719961763
0.0120345992181
0.0130218889569
0.014363430744
0.0163603856404
0.0155328615781
0.0140096729157
0.0133906110793
0.0133320531446
0.0137038857483
0.0145382473096
0.0162462631355
0.0205394475388
0.0357620191083
0.0997137480028
0.349100995663
0.00130963844689
0.00257120761153
0.00377562022606
0.00473043013048
0.00550739194699
0.00616310102932
0.0067417066939
0.00727871174486
0.00780207269196
0.00833176373239
0.00888004260623
0.00945438002663
0.0100623981797
0.0107174878173
0.0114449862739
0.0122743070279
0.0131903863235
0.014484435958
0.0163357386656
0.0158735476813
0.0143344065045
0.0136145013636
0.0135577211402
0.0140200732497
0.0150591114491
0.0172192796285
0.0227967121802
0.0416646865505
0.111089269826
0.351839304184
0.00131065456334
0.00255698154734
0.00374634364507
0.00468792640656
0.00545556715911
0.0061079139923
0.00669048987568
0.0072408459732
0.00778749951612
0.00835025943856
0.00893870195678
0.00955493880968
0.010198212019
0.0108702494462
0.0115862668222
0.0123611313973
0.0131921147187
0.0144112977333
0.0160138914779
0.0159197738195
0.0143949366723
0.0136379959604
0.0135921930989
0.0141663075197
0.0154501077679
0.0181497204651
0.0251531700624
0.0475428323155
0.121296277936
0.354397425836
0.00130597514448
0.00252215650508
0.00367741744911
0.0045866978695
0.00532662950718
0.00595718426024
0.00652575957276
0.00707072980073
0.00762193040648
0.00819835306496
0.00880710087851
0.00944501452585
0.0101032422175
0.0107742777832
0.0114655031669
0.0121839137126
0.0129514865737
0.0141010368159
0.0155148726431
0.0157183636122
0.0141544378684
0.0133456511541
0.0133546668185
0.0140668994685
0.0156207920389
0.0189072293684
0.0273732528315
0.0529825265449
0.130143232551
0.356725908029
0.00128887018014
0.00244761977007
0.00353781205671
0.00438576347979
0.00507089932161
0.00565329265668
0.00618100042298
0.00669292678141
0.00721974648922
0.00777985223592
0.00837780541565
0.00900647616604
0.00965185764907
0.0103021497486
0.010959701978
0.0116286865967
0.0123699974625
0.0135474638075
0.0149316012211
0.0151901278841
0.0135397428985
0.0126363336415
0.012702265217
0.0135559284445
0.0153724171236
0.0191988009489
0.0289525205311
0.0571915136545
0.137000971164
0.358682759149
0.00124932011543
0.00230770496011
0.00328717510272
0.00403379672619
0.00462820762183
0.00512926387454
0.00558364398253
0.00602979723277
0.0064978354996
0.00700529848684
0.007555509281
0.00813888316146
0.00873958015724
0.00934539821645
0.00995579998737
0.0105760590664
0.0112975953498
0.0124401342747
0.0137596697808
0.0141253861216
0.0123885907418
0.0113994856796
0.0115031451436
0.012450542869
0.0144447421386
0.0186816934702
0.0294614378854
0.0598444491553
0.141951095962
0.360244015865
0.00117367875934
0.00206685733848
0.00287283666016
0.00346672592875
0.00392819743501
0.00431147594536
0.00465857524062
0.0050044526824
0.00537704438655
0.00579286310043
0.00625513936275
0.00675363094088
0.0072729740111
0.00780222617494
0.00833778658561
0.00888067137535
0.00952741275984
0.0105887899707
0.0118220819531
0.0121030149609
0.0104200319829
0.00941892081353
0.00949085417576
0.0103845475073
0.0123560099862
0.0166714958256
0.02786329385
0.05951849032
0.14370996001
0.361197117848
0.0010426410784
0.00168094421064
0.00223180271053
0.00261170566563
0.00289518277495
0.00312598933159
0.00333562424075
0.00355081123811
0.00379359215006
0.00407808893458
0.00440836994611
0.00477659894006
0.00516891493199
0.00557831792532
0.00600048661997
0.00642009146062
0.00688345131609
0.00761821655079
0.00859961698108
0.00887506498262
0.0075573471934
0.0067589996188
0.00666598715867
0.00716990034169
0.00865547180463
0.0123073394403
0.0224222419554
0.0531199158068
0.13905482708
0.361381753055
0.000853446739274
0.00115518080518
0.00138763475754
0.00151594016865
0.00160196375984
0.00167128257508
0.00173763550177
0.00181161632235
0.00190317505497
0.00202151068911
0.00217364033011
0.0023644455561
0.00259848635677
0.00288109123787
0.00321377258446
0.0036043576958
0.00408941634886
0.00466492329516
0.00513094706878
0.00507597241219
0.00424598707881
0.00373669522321
0.00345048561146
0.00341664807467
0.00401866997871
0.00604911578397
0.0126515412117
0.0366473930725
0.116748829438
0.353574174491
0.000874132810429
0.00106843108845
0.00119846208372
0.00127010444789
0.00130884950985
0.00133062116991
0.00133579800465
0.00132721376413
0.00131439187937
0.0013035807733
0.00129667676262
0.00128999281984
0.00128014949307
0.00126903668736
0.0012625865256
0.00124893617198
0.00121476470159
0.00114605992055
0.0010242692051
0.000845455520374
0.00117241327464
0.00170618926455
0.00207709640227
0.00228195434807
0.00237163586674
0.00239139368791
0.00237802157189
0.00235654212666
0.00234030795457
0.00233532233352
0.00234536995503
0.00236915763808
0.0024034648036
0.00243498902333
0.00244314175342
0.00240175379617
0.00228615684407
0.0020622854168
0.00168845258571
0.00116267250868
0.00141203847344
0.0022678933072
0.00287740750054
0.0032259096935
0.00338809001288
0.00343291576208
0.00341941317922
0.00338974043422
0.00336609799784
0.00336341400436
0.00338601380138
0.00343177437075
0.00348983391432
0.00353808516127
0.00354252355995
0.00346300287115
0.00325908354464
0.00287780686887
0.00225563422596
0.0013978371608
0.00154565597084
0.00265224722857
0.00345522416717
0.00392540022761
0.00415446823052
0.00422729609147
0.00421733846359
0.00418115929185
0.00415401483665
0.00415432709065
0.00418891805202
0.00425407210602
0.00433152630305
0.00439075581678
0.00438537249342
0.00426723871609
0.00398290278441
0.00346789616461
0.00264375030345
0.00152532736703
0.00163531598485
0.00292894252718
0.00388306604744
0.00445188796639
0.00473603966375
0.00483284438009
0.0048272918342
0.00478581210656
0.00475519613952
0.00475811599333
0.00480464771147
0.00488758670023
0.00498193372865
0.00505039526198
0.00503509568731
0.00488165562695
0.00452934934605
0.00390514157924
0.00292116760117
0.00160781315587
0.00170419437083
0.00313489923598
0.00420436381888
0.00485031671952
0.00517772401976
0.00529205999171
0.00528862277082
0.00524345365305
0.00520882013048
0.00521511342249
0.00527283397941
0.0053724757633
0.00548361619702
0.00556070023392
0.00553883384061
0.0053559144826
0.004947359364
0.00423358672587
0.00312623760212
0.00166902828622
0.00176331202588
0.00329429799989
0.0044511676449
0.00515623163736
0.0055162470038
0.0056425774315
0.00563824568771
0.00558954179166
0.00555228326774
0.00556160974351
0.00562988443342
0.00574647930018
0.0058739705926
0.00596018162035
0.00593408804725
0.0057281309766
0.00527229525406
0.00448688574846
0.00328397149533
0.00171929134221
0.00181954822619
0.00342586420364
0.00464981039587
0.00540030041492
0.0057843354602
0.00591805303323
0.00591162042083
0.00585784567865
0.00581931498426
0.00583146804059
0.0059110256415
0.00604537397162
0.00618814833458
0.00628463293526
0.00625674036571
0.00603122429515
0.00553682403891
0.00469248779999
0.0034121625485
0.00176541893991
0.00187794411534
0.00354537326691
0.00482396383485
0.00561101169623
0.00601329601571
0.00615106514538
0.00614151749567
0.00608319832232
0.00604280541905
0.00605913138446
0.00615077865058
0.00630251885036
0.00646128776299
0.00656911431781
0.00654055151812
0.00629807593151
0.00576980757614
0.00487428495446
0.00352879092463
0.00181299895745
0.0019439648128
0.00366780609461
0.00499635083524
0.00581658306661
0.00623471716696
0.00637526581743
0.0063624055922
0.00629942095245
0.00625819743564
0.00627885037498
0.00638511276872
0.00655975055241
0.00673302534481
0.0068473962362
0.00681785222221
0.00656126788255
0.00600215820367
0.00505694137721
0.0036488858223
0.00186579973888
0.00202242338951
0.00380751853632
0.00518956829023
0.00604643015664
0.00648198823583
0.00662618634895
0.00661040939708
0.0065428731385
0.00650093382619
0.00652915166148
0.00665202848391
0.00684758852156
0.00703610832666
0.00715566088738
0.0071223873336
0.00684993476482
0.00625647703108
0.00525940150762
0.00378371389586
0.00192869412178
0.00211773821816
0.00397736827525
0.00542826393988
0.00633196028381
0.00679267176046
0.006944766074
0.00692731700964
0.0068553212021
0.00681005153325
0.00684356556018
0.00698334009009
0.00719580996127
0.00739858435695
0.00752131424826
0.00748057470666
0.00718711499578
0.00655642991109
0.00550295347486
0.00395028116483
0.0020066604123
0.00223833680317
0.00419212265679
0.00574086860843
0.00671775343995
0.00721949907438
0.00738479743487
0.00736717793864
0.00728659231567
0.00723040253785
0.00725521849036
0.00740302751583
0.00762710642001
0.00784081061241
0.00796112896836
0.00790731351515
0.00758747203978
0.00691467556818
0.00579909114785
0.00415823194553
0.00210388630402
0.00240204282915
0.0044536811071
0.00613647331001
0.0072336348086
0.00782302332032
0.0080311719904
0.00803037468789
0.00793631119428
0.00783734184769
0.00782895593151
0.00796539495487
0.00818918174656
0.00840581650391
0.00850902760764
0.00842358264302
0.0080628144239
0.0073389382995
0.00615200317634
0.0044096373889
0.00222561398782
0.00261057641345
0.00479207075921
0.00667929416596
0.00797969140445
0.0087362312022
0.00907098912313
0.00913549901612
0.00902550868445
0.0088428970479
0.00873883313333
0.00880543547725
0.00899656857266
0.00919005359816
0.00923316420904
0.00906903913198
0.00863124964916
0.00782665835396
0.00654217759288
0.00468123139065
0.00238010977298
0.0029394876803
0.00531131304546
0.00746322372059
0.00895953517535
0.00987041724543
0.0104289212905
0.0107739664443
0.01082854024
0.0106959720783
0.0105322502978
0.0104418675224
0.0104971292912
0.0105328091841
0.0103990374137
0.0100645468614
0.0094602507468
0.00848172800506
0.0070169845705
0.00499253744991
0.00256633616193
0.00342396545073
0.0060073592231
0.00857746088876
0.0102801349181
0.0114664903184
0.0126503052407
0.0137835815767
0.0141841110993
0.0141287388098
0.0138074949746
0.0134094770017
0.0129881849035
0.0124160493033
0.0119110783953
0.0113474464086
0.0104908689131
0.00923709896096
0.00750575386029
0.00528546750033
0.00281003119437
0.00389852604383
0.00640853926914
0.0094537626426
0.0117247933019
0.0134704778663
0.0150874121903
0.0165563213759
0.0176073455395
0.0180025321491
0.0176652364701
0.0168396667489
0.0157592855824
0.0144828635574
0.0135328934778
0.0127159999425
0.0115074588654
0.00992382089666
0.00793164410489
0.005512394244
0.00315250982214
0.00412475976976
0.00652931980185
0.00983781179452
0.0127182863355
0.0154070247891
0.017815158702
0.0193852305441
0.0209805244902
0.0212994346397
0.0205897201893
0.0193318203535
0.0182217336199
0.0171352145747
0.0162973823955
0.0148343923633
0.0129919839202
0.0111930042
0.00896046719561
0.00616422168164
0.00348860056066
0.00427105581463
0.00695180521638
0.0103539177772
0.0133715294269
0.0161502280989
0.0188053097989
0.0206767162713
0.0216514303905
0.0210047380518
0.0193837615615
0.0175634001501
0.0164391571816
0.0155774331993
0.014688931008
0.014394969288
0.0134937035073
0.0119935559374
0.00977790363435
0.00676619543913
0.00371876204887
0.00395692411918
0.00663276332616
0.0096022896013
0.0119075196051
0.0137955045822
0.0160073658722
0.0177998218714
0.0177254469517
0.0161288918934
0.0143838228155
0.0134845332021
0.0131351962463
0.0129269211729
0.0125154289534
0.0123497275691
0.0115884403589
0.0103674568811
0.00855192214267
0.00597624009733
0.00327076158193
0.0033565984642
0.00569282779853
0.00811854387394
0.00979231126101
0.0109691425595
0.0121775490492
0.0131844633325
0.0129292761195
0.0120701990963
0.0114396611217
0.0114295761534
0.0115689907042
0.011651262945
0.011501819242
0.0113081459255
0.0105765209365
0.00942887606302
0.00778965914676
0.00546413368115
0.00293540539656
0.00286046478149
0.00493391470907
0.0069852774905
0.00837308985721
0.00927420008371
0.00997711310232
0.0104941312243
0.0104631509294
0.0102593042989
0.0103784770407
0.0108059677297
0.0111376107107
0.0112712402967
0.0111453279266
0.0108329642294
0.0101171276004
0.00899497864263
0.00738166176308
0.00513623031943
0.00266222878146
0.00266732058388
0.00471120421566
0.00665876801424
0.00801736105113
0.00889746761597
0.00946251617797
0.00981253317756
0.00996765841691
0.010114507249
0.0104878348714
0.0109706819704
0.0112985934207
0.0114071210131
0.0112506995226
0.0108314115946
0.0100497271473
0.00887697567036
0.00719416725851
0.00493027487965
0.00245200433471
0.00296148033373
0.00525875885804
0.00737965406717
0.00885171712498
0.00977641146073
0.0103079441965
0.0105916369366
0.0107806190488
0.010997619653
0.0113628425239
0.0117704958378
0.0120262490345
0.0120399509218
0.0118196487873
0.0113217640484
0.0104802170481
0.00921944739038
0.00742449697047
0.00500289933752
0.00237325961233
0.00439548988673
0.00736370437873
0.00994831234468
0.0115910937033
0.0125113565952
0.0129443405703
0.0130783715762
0.0131342312306
0.0132299786814
0.0134351640224
0.0136365567686
0.0136873576629
0.0135397349031
0.0131930229352
0.0126296739155
0.0117438032187
0.0104070350193
0.00843785561153
0.00567773296751
0.00258771526775
0.00863874012833
0.0130509636121
0.0163584848162
0.0181314920719
0.018920644327
0.0191168724668
0.0189373010562
0.0186549834732
0.0183960526492
0.0181725296115
0.0178110377928
0.0172398204836
0.0166266269089
0.0160102386214
0.015335249587
0.0144261879508
0.0130660316677
0.010924418531
0.00764792986763
0.00364484003655
0.0184340679724
0.0256204978338
0.0296753878915
0.0314527063484
0.032033395312
0.0319802572224
0.0314993528696
0.0308285956312
0.0299890056252
0.0288260569164
0.0268431811825
0.0243133631738
0.0223787331768
0.021083963582
0.0203939145237
0.0197718717877
0.0188099664194
0.0167253049585
0.012953379296
0.00754427548923
0.0374432373519
0.0487644697839
0.053044889377
0.0546766890768
0.0552207666492
0.0552770229418
0.0549840106099
0.0543676688952
0.0526943843038
0.0496982801898
0.0433257054084
0.0356849565084
0.0308686381529
0.0285300672978
0.0371808121401
0.0422410410347
0.0462553304649
0.0458825108681
0.0422642840079
0.034349767153
0.065721579802
0.080553811012
0.0840379900785
0.0853954935443
0.0861696639543
0.0867726228273
0.0872317117319
0.0871698437968
0.0834359106989
0.0771138963125
0.0625803109511
0.0470478076446
0.0386710275138
0.0444977529025
0.270947954803
0.300798187028
0.315889472844
0.317610184595
0.317161030603
0.312889885683
)
;
}
atmosphere
{
type inletOutlet;
inletValue uniform 0.1;
value nonuniform List<scalar>
400
(
0.065721579802
0.080553811012
0.0840379900785
0.0853954935443
0.0861696639543
0.0867726228273
0.0872317117319
0.0871698437968
0.0834359106989
0.0771138963125
0.0625803109511
0.0470478076446
0.0386710275138
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.0804646256862
0.0554049732996
0.0508667601636
0.0499462108571
0.0499442374086
0.0501054630059
0.0501829883085
0.0499257796537
0.048655863338
0.0458003985633
0.0400240458902
0.0332700551726
0.0299854034272
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.0837792155165
0.0507711580736
0.043638822794
0.0416859864239
0.0412761244269
0.0412351141278
0.0411397046217
0.0407654603223
0.0399358900449
0.0380350815542
0.0345320184173
0.03019895968
0.0285825543989
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.0846082927973
0.0495826265694
0.0414682135991
0.0390067544619
0.0383751110646
0.038250119634
0.0381509151579
0.0378585527173
0.0371616370779
0.0355445161174
0.0326754494755
0.0290222877996
0.0273158880142
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.0823254929407
0.0488049397837
0.0406644595448
0.0381398706324
0.0374653789432
0.0373118562752
0.0372055662332
0.0369262356222
0.0362251132552
0.0347136853563
0.0320459663059
0.028541002724
0.0267072580486
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.0822152753621
0.0486463076651
0.0404167287134
0.0378844085581
0.0372008783718
0.0370290180487
0.0368935313118
0.036562758464
0.0358047980193
0.0343999583406
0.0318907812746
0.0283626952762
0.0257127222142
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.0822149373109
0.0485297632144
0.0402589781595
0.0377339338409
0.0370557068513
0.0368917785329
0.0367574405373
0.0364291922177
0.0356941554427
0.0343913067682
0.0320752241281
0.0286140853379
0.0259939746025
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.0813379994075
0.047998135973
0.0398667299015
0.0374043915016
0.0367734339379
0.0366793700693
0.0366127192231
0.0363836650251
0.0357864593516
0.0346251529411
0.0326637705169
0.029770760755
0.0291274341862
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.0778503822468
0.046696139349
0.0389809396438
0.0366530872517
0.0361260861556
0.0361656215801
0.0362442543215
0.0362078540403
0.035868427595
0.0350852579458
0.0338850484585
0.03244221601
0.0350978913142
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.0726853852996
0.0443314378288
0.0373648976198
0.0353194147811
0.034943895698
0.0351008013015
0.0354009510424
0.0357057929643
0.035846989272
0.0357980274055
0.0359474246668
0.0376706209499
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.0628791414722
0.0397713460015
0.0342559588096
0.0327635122035
0.0327013254557
0.0331328431746
0.0338262637934
0.0346507424241
0.035590868491
0.036771653411
0.0393583741293
0.0468531306612
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.0483935514564
0.0335311037856
0.0301488546411
0.029220151762
0.0293523917209
0.0299596289568
0.0311004017401
0.0328021223648
0.0352840228807
0.0389268924318
0.0473270524017
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.0424414441534
0.0309686573462
0.0291426841526
0.0280654270675
0.0279887204782
0.0277387114505
0.0289214228668
0.0317749578911
0.037639707608
0.0460622457484
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
)
;
}
floatingObject
{
Cmu 0.09;
kappa 0.41;
E 9.8;
type epsilonWallFunction;
value nonuniform List<scalar>
348
(
0.0036941229715
0.00270809529238
0.00259115383564
0.00258859774568
0.00273190459351
0.00393715284795
0.00248243853467
0.00156130154384
0.00141096838949
0.00139930805595
0.00151546179868
0.00251705890631
0.00239162863777
0.0014859253975
0.00133254198583
0.00131044272402
0.00141113830968
0.00239711294102
0.00324521326537
0.00226419402198
0.00213067671305
0.00213617489803
0.00224945534281
0.00337218914638
0.00680773153418
0.00541174430929
0.00509066179469
0.00505037744944
0.00526422002581
0.00653320945959
0.00682802180664
0.00663359481816
0.00522793534831
0.00506628806076
0.00513700137117
0.00501089377535
0.00640515748609
0.00662673984262
0.00535037156083
0.00519448583354
0.00526718514162
0.00561901200127
0.00645694394604
0.00734051931898
0.00734068322945
0.00566099708193
0.00529743213676
0.00527652558372
0.00557803825973
0.00710412749633
0.0075509803903
0.00737931827108
0.00565188927462
0.00556446519677
0.00555175798711
0.00554622310004
0.00706380954302
0.00748809832968
0.00588946983153
0.00567865445199
0.00574812798172
0.00620051137333
0.00732462911377
0.00837286378837
0.00792963375169
0.00599994394679
0.00559969952566
0.00558596587063
0.00593454823212
0.00772010274462
0.00826045291936
0.00804686325893
0.00612115212607
0.00603022506346
0.00601390706108
0.00604638572782
0.00776594176091
0.00840641875874
0.00649772769983
0.00623761573403
0.0063174402239
0.00682470330546
0.00814114682399
0.00934357762424
0.00842728083727
0.00629588675682
0.0058692654663
0.00586183179552
0.00624145410667
0.00822509006196
0.00884319501897
0.00864298123355
0.00655901679166
0.00643808237388
0.00648459067571
0.00648134398907
0.00841434392728
0.00920782681135
0.00704979903865
0.00674338875857
0.00683272601315
0.0073857025672
0.00886569212014
0.0101843207497
0.00882476309059
0.00654388851662
0.00609972626854
0.00609125614923
0.00651785649428
0.00863416310939
0.00935197156353
0.00918398040863
0.00695976094915
0.00686377695331
0.00689204684606
0.00692312033512
0.00895613876443
0.00989934141929
0.00754329202909
0.00720210459831
0.00730366025873
0.00789490078577
0.00957975786822
0.0109224080092
0.00914711956626
0.00675785895113
0.00629965149008
0.00629060750275
0.00676126644516
0.00899323063731
0.00976830209408
0.00969255971315
0.00730060585882
0.00726626601073
0.00723949024673
0.00735159171787
0.00942310606459
0.0105269812214
0.00800717748022
0.00764031711249
0.00776209422709
0.00840002749738
0.010280879901
0.0115847200592
0.00943520436045
0.00695719189371
0.00648442090798
0.00647601423088
0.0069929644091
0.00934014445587
0.0101145397155
0.0102161447756
0.00760778745196
0.00768804980111
0.00755501864955
0.007808066206
0.00986082927886
0.0111428570615
0.00847666692987
0.00809083809192
0.00823835363435
0.00893952481011
0.0110368891134
0.0122609117785
0.00973905782059
0.00716057778789
0.00667024921337
0.00666598726692
0.00723760258205
0.00971676886285
0.0105170340898
0.0108152695311
0.00793994863857
0.0081840322397
0.00787839619325
0.0083527939257
0.0103226652953
0.0118004281503
0.00898990384003
0.00858745957292
0.00876865590824
0.00953964438561
0.0119375830443
0.0130688748174
0.0101674214914
0.00739624599692
0.00688149775592
0.00688738944468
0.00752288038289
0.0101700654043
0.0110167670681
0.0115574593324
0.00834581773511
0.00881174879683
0.00826244368359
0.00905205090668
0.0108671402279
0.0125548732554
0.00958311129889
0.00916525335067
0.00939513294648
0.0102397214878
0.0130897566344
0.0140089130237
0.0107463775681
0.0077163035666
0.00717065943369
0.00719351037356
0.00790024678521
0.0107574951651
0.0117123124589
0.0125236660933
0.00890207200848
0.00963316532531
0.00878876856146
0.00997073498077
0.0115534128066
0.0134662836061
0.0103094659853
0.00990386014766
0.0101981828212
0.0111138136181
0.0146144402501
0.0151740948476
0.0115773700674
0.00822440462261
0.00765125330683
0.00770135017925
0.00847172698645
0.0115729744631
0.0127319917748
0.0138372086713
0.00972582876459
0.010749334579
0.00956381554452
0.0112068433798
0.0124583896289
0.0146100601109
0.0112259442193
0.010825136168
0.0111968116306
0.0122454731401
0.0166048503151
0.0167087041142
0.01280784242
0.00913988037008
0.00852610576372
0.00860765258942
0.00941341628975
0.0127945216645
0.0141861564656
0.015718789971
0.0109797099649
0.0123899957779
0.0107532653428
0.0130378874572
0.0137174108669
0.0160654793429
0.0123696377892
0.0119741307962
0.0124592594039
0.0136938603259
0.0192959013763
0.0187503687657
0.014990192154
0.011041931939
0.010329325073
0.0102785483359
0.0109548496897
0.0146077723913
0.016635267366
0.0185428291407
0.0132261154884
0.0149348364357
0.0129608846384
0.0159164121618
0.0159846544537
0.018390863898
0.0141624915805
0.013789150532
0.0144460912605
0.0159360871118
0.0233054388041
0.021857807578
0.016957448
0.013799979436
0.0131305548889
0.0128734205172
0.0134306123875
0.0179256929405
0.0188940816775
0.0235686376302
0.015629741296
0.0194101661155
0.015948827818
0.0208002015326
0.0199275885447
0.0232621584397
0.0183980291053
0.018060719855
0.0187630075029
0.0204036406272
0.029163218055
0.0270613831709
0.0253146167115
0.0210133589851
0.0206214728666
0.020517386757
0.0218006724674
0.0270719753828
0.0285076580352
0.047025178125
0.0345965200695
0.0299716380841
0.0282655238274
0.0293991655639
0.0319337197869
0.0357367517905
0.0243760953085
0.0370694991733
0.0244946772257
0.0206593363687
0.0199229347198
0.0213889031683
0.0270732857869
0.028542348391
0.0247803696269
0.0348000616623
0.022698472483
0.0195830183199
0.0192806621049
0.0207686029514
0.0282195489175
0.0279974779824
0.029060342207
0.0304835794281
0.0386798589645
0.0253174250008
0.0276402543047
0.0249175350004
0.0250337981966
0.0255262862243
0.0248061711188
0.0270115906388
0.0259784891089
0.036024951087
0.0337342643687
0.0326623946822
)
;
}
}
// ************************************************************************* //
| |
118738bc1c53d3e0bc6be2946b62f033d1c14c68 | d9d520fc16006a6e77a3deb940c4af460e2b89a9 | /Progetto/Sim800l.ino | 28ba40933129c227b5b4b21992c2cedfe61131f2 | [] | no_license | EnricoMenegatti/Localizzatore | 8ebe200098616aaed86ec824df9aeb724f1310e8 | c2983ab917383bd4029bd7331f381fb0a91e8fed | refs/heads/master | 2020-05-07T20:34:02.080956 | 2019-04-16T05:56:53 | 2019-04-16T05:56:53 | 180,866,451 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,055 | ino | Sim800l.ino |
void SIM_Setup()
{
gsm.start(9600);
gsm.listen();
Serial.print("Manufacturer:\t\t");
Serial.println(gsm.moduleManufacturer());
delay(250);
Serial.print("Model:\t\t\t");
Serial.println(gsm.moduleModel());
delay(250);
Serial.print("Revision:\t\t");
Serial.println(gsm.moduleRevision());
delay(250);
Serial.print("IMEI:\t\t\t");
Serial.println(gsm.moduleIMEI());
delay(250);
Serial.print("IMSI:\t\t\t");
Serial.println(gsm.moduleIMSI());
delay(250);
Serial.print("ICCID:\t\t\t");
Serial.println(gsm.moduleICCID());
delay(250);
Serial.print("Is Connected?:\t\t");
Serial.println(gsm.isRegistered());
delay(250);
Serial.print("Signal Quality:\t\t");
Serial.println(gsm.signalQuality());
delay(250);
Serial.print("Operator:\t\t");
Serial.println(gsm.operatorName());
delay(250);
Serial.print("Operator From Sim:\t");
Serial.println(gsm.operatorNameFromSim());
delay(250);
}
void Dati_SIM()
{
gsm.listen();
Serial.print("Manufacturer:\t\t");
Serial.println(gsm.moduleManufacturer());
}
|
7d7d248043655a70a2a5f1ae664ce0ebc0f10ad9 | 906e77c7ff16e8a5ffb67995f247ded73a69dd59 | /Cpp/SDK/UI_Crosshair_parameters.h | 9b359b8501b9652d8e0a5501634a6b07dda6a22d | [] | no_license | zH4x-SDK/zPolygon-SDK | d49400829f1d4b7ec63ff6bebd790dd8d96bb8eb | 3ff60c347b015d858779b8fd2308239176f1ed01 | refs/heads/main | 2023-07-25T12:16:54.962926 | 2021-08-27T14:17:29 | 2021-08-27T14:17:29 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,262 | h | UI_Crosshair_parameters.h | #pragma once
// Name: Polygon, Version: 0.3.13.76
/*!!DEFINE!!*/
/*!!HELPER_DEF!!*/
/*!!HELPER_INC!!*/
#ifdef _MSC_VER
#pragma pack(push, 0x01)
#endif
namespace CG
{
//---------------------------------------------------------------------------
// Parameters
//---------------------------------------------------------------------------
// Function UI_Crosshair.UI_Crosshair_C.SetCrosshairPosition
struct UUI_Crosshair_C_SetCrosshairPosition_Params
{
struct FVector2D InPosition; // (BlueprintVisible, BlueprintReadOnly, Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash)
};
// Function UI_Crosshair.UI_Crosshair_C.Construct
struct UUI_Crosshair_C_Construct_Params
{
};
// Function UI_Crosshair.UI_Crosshair_C.Tick
struct UUI_Crosshair_C_Tick_Params
{
struct FGeometry MyGeometry; // (BlueprintVisible, BlueprintReadOnly, Parm, IsPlainOldData, NoDestructor)
float InDeltaTime; // (BlueprintVisible, BlueprintReadOnly, Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash)
};
// Function UI_Crosshair.UI_Crosshair_C.OnSetPawn_Event
struct UUI_Crosshair_C_OnSetPawn_Event_Params
{
};
// Function UI_Crosshair.UI_Crosshair_C.OnSetCurrentWeapon_Event
struct UUI_Crosshair_C_OnSetCurrentWeapon_Event_Params
{
};
// Function UI_Crosshair.UI_Crosshair_C.OnApplyWeaponDamage_Event
struct UUI_Crosshair_C_OnApplyWeaponDamage_Event_Params
{
bool bHeadshot; // (BlueprintVisible, BlueprintReadOnly, Parm, ZeroConstructor, IsPlainOldData, NoDestructor)
};
// Function UI_Crosshair.UI_Crosshair_C.ExecuteUbergraph_UI_Crosshair
struct UUI_Crosshair_C_ExecuteUbergraph_UI_Crosshair_Params
{
int EntryPoint; // (BlueprintVisible, BlueprintReadOnly, Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash)
};
}
#ifdef _MSC_VER
#pragma pack(pop)
#endif
|
18969735dba2b617af3b6acd705ed723bd926822 | 0355822ea6562628d4023ae8b65b2fc3bddd153b | /src/text-analyzer.cpp | eb064144fc2fd5776a44a9178813cfa61008fcf1 | [] | no_license | yakovlev-alexey/cross-reference-red-black-tree | 2ff58529be436152f60938239c25d466c2be0298 | 40b22d48e1af9ada77bec20dc6738d97d8f5177f | refs/heads/master | 2022-07-31T18:27:57.461679 | 2020-05-24T15:25:38 | 2020-05-24T15:25:38 | 256,967,133 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,551 | cpp | text-analyzer.cpp | #include "text-analyzer.hpp"
#include <regex>
#include <string>
#include <fstream>
#include <iostream>
#include <algorithm>
#include <stdexcept>
#include <functional>
#include "list.hpp"
#include "map.hpp"
TextAnalyzer::TextAnalyzer() :
dictionary{ }
{ }
TextAnalyzer::TextAnalyzer(TextAnalyzer && other) noexcept:
dictionary{ std::move(other.dictionary) }
{ }
TextAnalyzer & TextAnalyzer::operator=(TextAnalyzer && other) noexcept
{
dictionary = std::move(other.dictionary);
return *this;
}
const Map<std::string, List<int>> & TextAnalyzer::getDictionary() const
{
return dictionary;
}
void TextAnalyzer::analyze(const std::string & filename)
{
dictionary = Map<std::string, List<int>>{ };
auto is = std::ifstream{ filename };
if (!is) {
throw std::invalid_argument{ "Can't open file " + filename };
}
analyze(is);
is.close();
}
void TextAnalyzer::analyze(std::istream & is)
{
dictionary = Map<std::string, List<int>>{ };
auto word_regex = std::regex{ "[a-zA-Z0-9]+" };
auto line = std::string{ };
for (int i = 1; is; ++i) {
std::getline(is, line, '\n');
auto words_begin = std::sregex_iterator{ line.begin(), line.end(), word_regex };
auto words_end = std::sregex_iterator{ };
for (auto itr = words_begin; itr != words_end; ++itr) {
auto word = itr->str();
std::transform(word.begin(), word.end(), word.begin(),
[ ] (char c) { return std::tolower(c); });
if (dictionary.contains(word)) {
dictionary[word].push_back(i);
} else {
dictionary.insert(word, { i });
}
}
}
}
void TextAnalyzer::enumerateLines(const std::string & inFilename, const std::string & outFileName)
{
if (inFilename == outFileName) {
throw std::invalid_argument{
"Can't output enumerated text to the file with the same name " + inFilename };
}
auto is = std::ifstream{ inFilename };
if (!is) {
throw std::invalid_argument{ "Can't open file " + inFilename };
}
auto os = std::ofstream{ outFileName };
if (!os) {
is.close();
throw std::invalid_argument{ "Can't create output file " + outFileName };
}
enumerateLines(is, os);
is.close();
os.close();
}
void TextAnalyzer::enumerateLines(std::istream & is, std::ostream & os)
{
auto line = std::string{ };
for (int i = 1; is; ++i) {
std::getline(is, line, '\n');
os << i << ") " << line << '\n';
}
}
void TextAnalyzer::printAnalysis(const std::string & filename)
{
auto os = std::ofstream{ filename };
if (!os) {
throw std::invalid_argument{ "Can't create output file " + filename };
}
printAnalysis(os);
os.close();
}
namespace
{
std::string generateSpaces(size_t length);
}
void TextAnalyzer::printAnalysis(std::ostream & os)
{
auto word = std::string{ "Word" };
auto colwidth = word.length();
for (auto itr = dictionary.begin(); itr != dictionary.end(); ++itr) {
colwidth = std::max(itr.key().length(), colwidth);
}
const auto margin = size_t{ 2u };
os << "Word" << generateSpaces(colwidth - word.length() + margin) << "Lines\n";
for (auto itr = dictionary.begin(); itr != dictionary.end(); ++itr) {
os << itr.key() << generateSpaces(colwidth - itr.key().length() + margin);
std::for_each(itr.value().begin(), itr.value().end(),
[&os] (int e) { os << e << ' '; });
os << '\n';
}
}
namespace
{
std::string generateSpaces(size_t length)
{
auto spaces = std::string{ };
for (size_t i = 0u; i < length; ++i) {
spaces += " ";
}
return spaces;
}
}
|
4f03d8360e473fc4706aa97ea02dcdf05c38edaf | d1dc915fd1108b5bf73ed844fa0dcb414bd4825e | /AGame/BarrierBase.cpp | 8a0b930190d46d2e8446973bcc016aa5831e15ed | [] | no_license | WladWD/AndroidGame | 1c359066951ca1d0393b3afc7c84508ef741726d | a145840c1abe0b03ac39da55212b7167afc33cd9 | refs/heads/master | 2021-01-13T03:34:17.980269 | 2019-03-04T22:03:23 | 2019-03-04T22:03:23 | 77,531,014 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,451 | cpp | BarrierBase.cpp | #include "BarrierBase.h"
Barrier::BarrierBase::BarrierBase(Draw::Barrier *mBarrier, Camera::MCamera *cCamera, float fHeight) : fHeight(fHeight), fAngle(0.0f), cCamera(cCamera),
PI(3.1415926f)
{
//mWorld_OOBB = glm::mat4(1.0f);
//Init();
mDeltaConst = std::rand() & 1 ? 1.0f : -1.0f;
fAngle = (static_cast<float>(std::rand()) / static_cast<float>(RAND_MAX)) * PI * 4.0f;
mWorld = glm::mat4(1.0f);
/*Collision::ModelBase *mModelDraw;
Collision::LowPolyModel *mLowpolyModel;
Collision::BoundingAABB *mBounding;*/
/*Collision::ModelBase *mModelDraw;
Collision::LowPolyModelInstance *mLowpolyModel;
Collision::BoundingAABBInstance *mBounding;*/
mModelDraw = mBarrier->GetDrawModel();
mBounding = new Collision::BoundingAABBInstance(mBarrier->GetBoundingAABB(), mWorld);
mLowpolyModel = new Collision::LowPolyModelInstance(mBarrier->GetLowPolyModel(), mWorld);
}
Barrier::BarrierBase::~BarrierBase()
{
//delete mAABB;
//DeleteResources();
delete mBounding;
delete mLowpolyModel;
/*delete mImagesResource;
delete mObjects;
glDeleteBuffers(1, &mVertexBuffer);
glDeleteBuffers(1, &mIndexBuffer);*/
}
float Barrier::BarrierBase::GetCurrentHeight(void)
{
return fHeight;
}
bool Barrier::BarrierBase::Intersect(const Draw::CookieCollisionStruct &mCookieCollision)
{
//MessageBox(nullptr, L"Add Code", L" ", MB_OK);
Draw::BarrierCollisionStruct mBarrierStruct;
mBarrierStruct.mBounding = mBounding;
mBarrierStruct.mLowpolyModel = mLowpolyModel;
return Bounding::AABBSphereIntersection(mBarrierStruct, mCookieCollision);
//return false;
}
/*void Barrier::BarrierBase::DeleteResources(void)
{
delete mAABB;
}
void Barrier::BarrierBase::InitializeResources(Bounding::Object *mObjects)
{
this->mBounding = mObjects;
Init();
}*/
//void Barrier::BarrierBase::Init(void)
//{
// /*Resource::ResourceLoad *mModel = new Resource::ResourceLoad(mResourceName, mResourceLoad);
//
// mImagesResource = mModel->GetImagesResource();
// mIndexBuffer = mModel->GetIndexBuffer(mIndexFormat);
// mVertexBuffer = mModel->GetVertexBuffer();
// mObjects = mModel->GetModelObjects(mDrawObjectCount);
//
// delete mModel;*/
//
// mImagesResource = mBounding->GetImageResource();
// mObjects = mBounding->GetModelObject();
// mBounding->GetDrawData(mIndexFormat, mVertexBuffer, mIndexBuffer, mDrawObjectCount);
//
// mAABB = new Bounding::BoundingObjectStructAABB(mBounding, mBounding->GetVertexBuffer(), mBounding->GetVertexCount());
//}
|
5051b03e2fe6ae9ac77a73357d723e7c156d49e7 | 10e48d2b31ad0cbf1f321dc7bd59d800873ddcad | /examples/qqtserverexample/mainwindow.cpp | ec18cf308926666f757ad3d4d217d5b11b277a89 | [] | no_license | Qt-Widgets/LibQQt-Widgets-Collection | 5393ba76abbf2d152c3c7f0c0ab86d733147d882 | 9db5b678fefd2efa1eb5f2565aad5e48df2bdf18 | refs/heads/master | 2020-11-28T02:57:24.183536 | 2019-11-29T07:30:57 | 2019-11-29T07:30:57 | 229,687,198 | 6 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,123 | cpp | mainwindow.cpp | #include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow ( QWidget* parent ) :
QMainWindow ( parent ),
ui ( new Ui::MainWindow )
{
ui->setupUi ( this );
pm0 = QQtServerInstance ( this );
//pm0 = QQtServer2Instance(this);
connect ( pm0, SIGNAL ( notifyToBusinessLevel ( const QQtProtocol*, const QQtMessage* ) ),
this, SLOT ( recvANotify ( const QQtProtocol*, const QQtMessage* ) ) );
//QQtServer2ConnectionInstance ( this );
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::recvANotify ( const QQtProtocol* protocol, const QQtMessage* message )
{
QQtServerProtocol* p = ( QQtServerProtocol* ) protocol;
QQtServerMessage* m = ( QQtServerMessage* ) message;
pline() << QString ( m->getAData() );
switch ( m->getACmd() )
{
case 0x01:
{
if ( QString ( m->getAData() ).contains ( "hello" ) )
p->sendB1Command();
else
p->sendB10Command();
break;
}
default:
break;
}
}
|
5c12e7b42657924f3ef3ed7c64ed8b1d9ab78ed8 | 344698fe022c42c25074328cea0437945658e554 | /8_LinkedList/Leetcode_206_ReverseLinkedList.cpp | b0762766588eb30d2199f3cd9792783e1c6360bd | [] | no_license | cotecsz/WayOfOffer-Phase2 | 249dd39f7c4ea41cc4266004e317fd6e075d85bf | 75c6cc73fe100f5c48912d64e4609751e01f9625 | refs/heads/master | 2023-02-05T12:15:23.958782 | 2020-12-21T04:08:15 | 2020-12-21T04:08:15 | 313,908,739 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 925 | cpp | Leetcode_206_ReverseLinkedList.cpp | //
// Created by dream on 2020/11/27.
//
/*
* Leetcode 206 反转链表
* 双指针法:cur 指向当前节点,pre指向当前指针的前一个节点,
*
*/
#include "LinkedList.h"
class Solution {
public:
ListNode *reverseList(ListNode *head) {
ListNode* cur = head;
ListNode* pre = nullptr;
while (cur){
ListNode* tmp = cur->next;
cur->next = pre;
pre = cur;
cur = tmp;
}
return pre;
}
};
int main(){
ListNode head = ListNode(1);
ListNode node1 = ListNode(2);
ListNode node2 = ListNode(6);
ListNode node3 = ListNode(3);
ListNode node4 = ListNode(4);
head.next = &node1;
node1.next = &node2;
node2.next = &node3;
node3.next = &node4;
printLinkedList(&head);
Solution sol;
ListNode* headRes = sol.reverseList(&head);
printLinkedList(headRes);
return 0;
} |
5e80534f0ef7d1959d9b92778fa54c06272076f6 | 1d16fdcbd5fbd91d8325170cb74115a045cf24bb | /CSCommon/Source/MQuestMap.cpp | 6d53a314fd17dfb7e4d5608fbc5de83938658871 | [] | no_license | kooksGame/life-marvelous | fc06a3c4e987dc5fbdb5275664e06f2934409b90 | 82b6dcb107346e980d5df31daf4bb14452e3450d | refs/heads/master | 2021-01-10T08:32:53.353758 | 2013-07-28T18:15:09 | 2013-07-28T18:15:09 | 35,994,219 | 1 | 1 | null | null | null | null | UHC | C++ | false | false | 12,385 | cpp | MQuestMap.cpp | #include "stdafx.h"
#include "MQuestMap.h"
#include "MZFileSystem.h"
#include "MDebug.h"
/////////////////////////////////////////////////
MQuestMapCatalogue::MQuestMapCatalogue()
{
}
MQuestMapCatalogue::~MQuestMapCatalogue()
{
Clear();
}
MQuestMapsetInfo* MQuestMapCatalogue::GetMapsetInfo(int nMapset)
{
MQuestMapsetMap::iterator itor = m_MapsetInfo.find(nMapset);
if (itor != m_MapsetInfo.end())
{
return (*itor).second;
}
_ASSERT(0);
return NULL;
}
MQuestMapSectorInfo* MQuestMapCatalogue::GetSectorInfo(int nSector)
{
MQuestMapSectorMap::iterator itor = m_SectorInfo.find(nSector);
if (itor != m_SectorInfo.end())
{
return (*itor).second;
}
_ASSERT(0);
return NULL;
}
MQuestMapSectorInfo* MQuestMapCatalogue::GetSectorInfoFromName(char* szSectorTitle)
{
// sector
for (MQuestMapSectorMap::iterator itor = m_SectorInfo.begin(); itor != m_SectorInfo.end(); ++itor)
{
MQuestMapSectorInfo* pSector = (*itor).second;
if (!stricmp(pSector->szTitle, szSectorTitle))
{
return pSector;
}
}
return NULL;
}
void MQuestMapCatalogue::Clear()
{
// mapset
for (MQuestMapsetMap::iterator itor = m_MapsetInfo.begin(); itor != m_MapsetInfo.end(); ++itor)
{
delete (*itor).second;
}
m_MapsetInfo.clear();
// sector
for (MQuestMapSectorMap::iterator itor = m_SectorInfo.begin(); itor != m_SectorInfo.end(); ++itor)
{
delete (*itor).second;
}
m_SectorInfo.clear();
}
void MQuestMapCatalogue::InsertMapset(MQuestMapsetInfo* pMapset)
{
int nID = pMapset->nID;
MQuestMapsetMap::iterator itor = m_MapsetInfo.find(nID);
if (itor != m_MapsetInfo.end())
{
// 이미 존재한다.
_ASSERT(0);
return;
}
m_MapsetInfo.insert(MQuestMapsetMap::value_type(nID, pMapset));
}
void MQuestMapCatalogue::InsertSector(MQuestMapSectorInfo* pSector)
{
int nID = pSector->nID;
MQuestMapSectorMap::iterator itor = m_SectorInfo.find(nID);
if (itor != m_SectorInfo.end())
{
// 이미 존재한다.
_ASSERT(0);
return;
}
m_SectorInfo.insert(MQuestMapSectorMap::value_type(nID, pSector));
}
///////////////////////////////////////////////////////////////////////////////
#define MTOK_QUESTMAP_TAG_MAPSET "MAPSET"
#define MTOK_QUESTMAP_TAG_SECTOR "SECTOR"
#define MTOK_QUESTMAP_TAG_LINK "LINK"
#define MTOK_QUESTMAP_TAG_TARGET "TARGET"
#define MTOK_QUESTMAP_ATTR_ID "id"
#define MTOK_QUESTMAP_ATTR_TITLE "title"
#define MTOK_QUESTMAP_ATTR_SECTOR "sector"
#define MTOK_QUESTMAP_ATTR_NAME "name"
#define MTOK_QUESTMAP_ATTR_MELEE_SPAWN "melee_spawn"
#define MTOK_QUESTMAP_ATTR_RANGE_SPAWN "range_spawn"
#define MTOK_QUESTMAP_ATTR_BOSS_SPAWN "boss_spawn"
void MQuestMapCatalogue::ParseMapset(MXmlElement& element)
{
char szTemp[256]="";
int n = 0;
char szAttrValue[256];
char szAttrName[64];
char szTagName[128];
MQuestMapsetInfo* pMapsetInfo = new MQuestMapsetInfo();
int nAttrCount = element.GetAttributeCount();
for (int i = 0; i < nAttrCount; i++)
{
element.GetAttribute(i, szAttrName, szAttrValue);
if (!stricmp(szAttrName, MTOK_QUESTMAP_ATTR_ID))
{
pMapsetInfo->nID = atoi(szAttrValue);
}
else if (!stricmp(szAttrName, MTOK_QUESTMAP_ATTR_TITLE))
{
strcpy(pMapsetInfo->szTitle, szAttrValue);
}
}
// sector 목록을 미리 읽는다.
ParseMapsetSector1Pass(element, pMapsetInfo);
int nChildCount = element.GetChildNodeCount();
MXmlElement chrElement;
for (int i = 0; i < nChildCount; i++)
{
chrElement = element.GetChildNode(i);
chrElement.GetTagName(szTagName);
if (szTagName[0] == '#') continue;
if (!stricmp(szTagName, MTOK_QUESTMAP_TAG_SECTOR))
{
int nAttrCount = chrElement.GetAttributeCount();
int nSectorID = -1;
for (int j = 0; j < nAttrCount; j++)
{
chrElement.GetAttribute(j, szAttrName, szAttrValue);
if (!stricmp(szAttrName, MTOK_QUESTMAP_ATTR_ID))
{
nSectorID = atoi(szAttrValue);
break;
}
}
MQuestMapSectorInfo* pSector = GetSectorInfo(nSectorID);
if (pSector)
{
ParseSector(chrElement, pSector);
}
}
}
InsertMapset(pMapsetInfo);
}
void MQuestMapCatalogue::ParseSector(MXmlElement& element, MQuestMapSectorInfo* pSector)
{
char szTemp[256]="";
int n = 0;
char szAttrValue[256];
char szAttrName[64];
char szTagName[128];
int nChildCount = element.GetChildNodeCount();
MXmlElement chrElement;
for (int i = 0; i < nChildCount; i++)
{
chrElement = element.GetChildNode(i);
chrElement.GetTagName(szTagName);
if (szTagName[0] == '#') continue;
if (!stricmp(szTagName, MTOK_QUESTMAP_TAG_LINK))
{
int nLinkIndex = pSector->nLinkCount;
int nLinkAttrCount = chrElement.GetAttributeCount();
for (int j = 0; j < nLinkAttrCount; j++)
{
chrElement.GetAttribute(j, szAttrName, szAttrValue);
if (!stricmp(szAttrName, MTOK_QUESTMAP_ATTR_NAME))
{
strcpy(pSector->Links[nLinkIndex].szName, szAttrValue);
}
}
int nLinkChildCount = chrElement.GetChildNodeCount();
MXmlElement elementTarget;
char szTargetTagName[128];
for (int j = 0; j < nLinkChildCount; j++)
{
elementTarget = chrElement.GetChildNode(j);
elementTarget.GetTagName(szTargetTagName);
if (szTargetTagName[0] == '#') continue;
if (!stricmp(szTargetTagName, MTOK_QUESTMAP_TAG_TARGET))
{
elementTarget.GetAttribute(szAttrValue, MTOK_QUESTMAP_ATTR_SECTOR, "");
MQuestMapSectorInfo* pTargetSector = GetSectorInfoFromName(szAttrValue);
if (pTargetSector)
{
pSector->Links[nLinkIndex].vecTargetSectors.push_back(pTargetSector->nID);
}
}
}
pSector->nLinkCount++;
// 링크수가 10개가 넘으면 안된다.
_ASSERT(pSector->nLinkCount <= MAX_SECTOR_LINK);
}
}
}
void MQuestMapCatalogue::ParseMapsetSector1Pass(MXmlElement& elementMapset, MQuestMapsetInfo* pMapset)
{
char szTemp[256]="";
int n = 0;
char szAttrValue[256];
char szAttrName[64];
char szTagName[128];
int nChildCount = elementMapset.GetChildNodeCount();
MXmlElement chrElement;
for (int i = 0; i < nChildCount; i++)
{
chrElement = elementMapset.GetChildNode(i);
chrElement.GetTagName(szTagName);
if (szTagName[0] == '#') continue;
if (!stricmp(szTagName, MTOK_QUESTMAP_TAG_SECTOR))
{
MQuestMapSectorInfo* pSectorInfo = new MQuestMapSectorInfo();
int nAttrCount = chrElement.GetAttributeCount();
for (int j = 0; j < nAttrCount; j++)
{
chrElement.GetAttribute(j, szAttrName, szAttrValue);
if (!stricmp(szAttrName, MTOK_QUESTMAP_ATTR_ID))
{
pSectorInfo->nID = atoi(szAttrValue);
}
else if (!stricmp(szAttrName, MTOK_QUESTMAP_ATTR_TITLE))
{
strcpy(pSectorInfo->szTitle, szAttrValue);
}
else if (!stricmp(szAttrName, MTOK_QUESTMAP_ATTR_MELEE_SPAWN))
{
pSectorInfo->nSpawnPointCount[MNST_MELEE] = atoi(szAttrValue);
}
else if (!stricmp(szAttrName, MTOK_QUESTMAP_ATTR_RANGE_SPAWN))
{
pSectorInfo->nSpawnPointCount[MNST_RANGE] = atoi(szAttrValue);
}
else if (!stricmp(szAttrName, MTOK_QUESTMAP_ATTR_BOSS_SPAWN))
{
pSectorInfo->nSpawnPointCount[MNST_BOSS] = atoi(szAttrValue);
if (pSectorInfo->nSpawnPointCount[MNST_BOSS] > 0) pSectorInfo->bBoss = true;
}
}
InsertSector(pSectorInfo);
pMapset->vecSectors.push_back(pSectorInfo->nID);
}
}
}
bool MQuestMapCatalogue::ReadXml(const char* szFileName)
{
MXmlDocument xmlIniData;
xmlIniData.Create();
if (!xmlIniData.LoadFromFile(szFileName)) {
xmlIniData.Destroy();
return false;
}
MXmlElement rootElement, chrElement, attrElement;
char szTagName[256];
rootElement = xmlIniData.GetDocumentElement();
int iCount = rootElement.GetChildNodeCount();
for (int i = 0; i < iCount; i++) {
chrElement = rootElement.GetChildNode(i);
chrElement.GetTagName(szTagName);
if (szTagName[0] == '#') continue;
if (!stricmp(szTagName, MTOK_QUESTMAP_TAG_MAPSET))
{
ParseMapset(chrElement);
}
}
xmlIniData.Destroy();
InitBackLinks();
return true;
}
bool MQuestMapCatalogue::ReadXml(MZFileSystem* pFileSystem,const char* szFileName)
{
MXmlDocument xmlIniData;
xmlIniData.Create();
char *buffer;
MZFile mzf;
if(pFileSystem) {
if(!mzf.Open(szFileName,pFileSystem)) {
if(!mzf.Open(szFileName)) {
xmlIniData.Destroy();
return false;
}
}
}
else {
if(!mzf.Open(szFileName)) {
xmlIniData.Destroy();
return false;
}
}
buffer = new char[mzf.GetLength()+1];
buffer[mzf.GetLength()] = 0;
mzf.Read(buffer,mzf.GetLength());
if(!xmlIniData.LoadFromMemory(buffer)) {
xmlIniData.Destroy();
return false;
}
delete[] buffer;
mzf.Close();
MXmlElement rootElement, chrElement, attrElement;
char szTagName[256];
rootElement = xmlIniData.GetDocumentElement();
int iCount = rootElement.GetChildNodeCount();
for (int i = 0; i < iCount; i++) {
chrElement = rootElement.GetChildNode(i);
chrElement.GetTagName(szTagName);
if (szTagName[0] == '#') continue;
if (!stricmp(szTagName, MTOK_QUESTMAP_TAG_MAPSET)) {
ParseMapset(chrElement);
}
}
xmlIniData.Destroy();
InitBackLinks();
return true;
}
void MQuestMapCatalogue::DebugReport()
{
FILE* fp = fopen("report_questmap.txt", "wt");
if (fp == NULL) return;
for (MQuestMapsetMap::iterator itor = m_MapsetInfo.begin(); itor != m_MapsetInfo.end(); ++itor)
{
MQuestMapsetInfo* pMapset = (*itor).second;
fprintf(fp, " + <MAPSET> %s (%d)\n", pMapset->szTitle, pMapset->nID);
for (int i = 0; i < (int)pMapset->vecSectors.size(); i++)
{
MQuestMapSectorInfo* pSector = GetSectorInfo(pMapset->vecSectors[i]);
if (pSector)
{
fprintf(fp, " <SECTOR> %s (%d)\n", pSector->szTitle, pSector->nID);
for (int j = 0; j < pSector->nLinkCount; j++)
{
fprintf(fp, " <LINK> %s\n", pSector->Links[j].szName);
for (int k = 0; k < (int)pSector->Links[j].vecTargetSectors.size(); k++)
{
MQuestMapSectorInfo* pTargetSector =
GetSectorInfo(pSector->Links[j].vecTargetSectors[k]);
if (pTargetSector)
{
fprintf(fp, " <TARGET> %s\n", pTargetSector->szTitle);
}
}
}
}
}
fprintf(fp, "\n\n");
}
fclose(fp);
}
void MQuestMapCatalogue::InitBackLinks()
{
for (MQuestMapSectorMap::iterator itorA = m_SectorInfo.begin(); itorA != m_SectorInfo.end(); ++itorA)
{
MQuestMapSectorInfo* pSectorA = (*itorA).second;
for (MQuestMapSectorMap::iterator itorB = m_SectorInfo.begin(); itorB != m_SectorInfo.end(); ++itorB)
{
MQuestMapSectorInfo* pSectorB = (*itorB).second;
if (pSectorA == pSectorB) continue;
for (int i = 0; i < pSectorB->nLinkCount; i++)
{
int target_count = (int)pSectorB->Links[i].vecTargetSectors.size();
for (int j = 0; j < target_count; j++)
{
if (pSectorB->Links[i].vecTargetSectors[j] == pSectorA->nID)
{
MQuestSectorBacklink backlink;
backlink.nSectorID = pSectorB->nID;
backlink.nLinkIndex = i;
pSectorA->VecBacklinks.push_back(backlink);
}
}
}
}
}
}
bool MQuestMapCatalogue::IsHacked()
{
// 서바이벌에서 샤워룸 등의 특정 쉬운 맵으로 바꿔버리는 경우를 서버 도움없이 방지 (퀘스트는 이렇게 할 수가 없다)
// 같은 맵을 두번 정의하고 있는가? 를 확인하여 탐지하자.. 이정도로만 막아도 거의 맵설정을 변조하는 의미가 없어진다.
// 다만 맵이름은 그대로 두고 맵리소스를 바꿔버리는 식으로 해킹하면 대책이 없다.
set<string> setTitle;
MQuestMapSectorMap::iterator itSector;
for (itSector=m_SectorInfo.begin(); itSector!=m_SectorInfo.end(); ++itSector)
{
const char* szTitle = itSector->second->szTitle;
// 셋에 이름을 찾아보고 없으면 집어넣는다. 만약 있으면 해킹
if (setTitle.end() != setTitle.find(string(szTitle)))
return true;
setTitle.insert(string(szTitle));
}
return false;
}
|
2a62b621da18d532a2589b7cf8c867f2fbd20c89 | e9cf4952514ccb929efdc398ee4692239cfbf5db | /src/chapter1/any_example.cpp | 56aef25d9adab5a640491ed1a6be3c93803ba48a | [] | no_license | Nathaniel100/BoostCookbook | 0949f79e04355467d1053546a4ff8c6bef3922f2 | cb13e0cf5865b4d994eb0099a14b5125014cb5f0 | refs/heads/master | 2023-04-13T03:55:31.393932 | 2017-03-31T01:03:05 | 2017-03-31T01:03:05 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 495 | cpp | any_example.cpp | //
// Created by 吴凡 on 2017/3/5.
//
#include <boost/any.hpp>
#include <vector>
#include <string>
#include <iostream>
int main() {
std::vector<boost::any> some_values;
some_values.push_back(10);
const char *string_value = "Hello World";
some_values.push_back(boost::any(string_value));
some_values.push_back(std::string("Wow!"));
std::string &str = boost::any_cast<std::string&>(some_values.back());
str += "Any";
std::cout << str << "\n";
return 0;
}
|
f2847759124b9a4bcab68494cc9eac6cd4bc201d | 1fb1ba908668d3fe996d8fcdbe584b4afa930fb5 | /practica parte 2.cpp | ca3fcc7487a2b426a42a3f89423bec9b9e0a4513 | [] | no_license | sebpost2/Sebastian-Gonzalo-Postigo-Avalos | 58e6234ecb75bee4ad191bc48dc7c7832e831273 | c189cc2b4f83761566b076504f5400fa869ce366 | refs/heads/main | 2023-05-04T20:30:11.385642 | 2021-05-28T15:45:00 | 2021-05-28T15:45:00 | 351,896,887 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 266 | cpp | practica parte 2.cpp | #include <iostream>
#include <sstream>
int main()
{
std::string A;
int B;
std::cout << "Ingrese un numero\n";
std::cin >> A;
std::stringstream change;
change << A;
change >> B;
std::cout<<"\n";
std::cout << A;
}
|
c9729e742db15c22843c92c7c43345eb6196e6dd | c2c2fa716c3604103ce439b54b18dc2a3bd8371c | /PathFinder/Source/RenderPipeline/RenderPasses/DenoiserForwardProjectionRenderPass.cpp | 0119898b2d3be76ef89ee527a9530108dd662d52 | [] | no_license | fenghuayumo/PathFinder | 56dd00d4767b0cb64c5f80d8b2e46e4363ac3ae4 | df79ea78fa67c7720ac2ce196f8116ead4b84d1e | refs/heads/master | 2023-04-20T00:19:50.271409 | 2021-05-05T10:45:29 | 2021-05-05T10:45:29 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,867 | cpp | DenoiserForwardProjectionRenderPass.cpp | #include "DenoiserForwardProjectionRenderPass.hpp"
#include "UAVClearHelper.hpp"
#include <Foundation/Gaussian.hpp>
namespace PathFinder
{
DenoiserForwardProjectionRenderPass::DenoiserForwardProjectionRenderPass()
: RenderPass("DenoiserForwardProjection") {}
void DenoiserForwardProjectionRenderPass::SetupPipelineStates(PipelineStateCreator* stateCreator)
{
stateCreator->CreateComputeState(PSONames::DenoiserForwardProjection, [](ComputeStateProxy& state)
{
state.ComputeShaderFileName = "DenoiserForwardProjection.hlsl";
});
}
void DenoiserForwardProjectionRenderPass::ScheduleResources(ResourceScheduler<RenderPassContentMediator>* scheduler)
{
if (!scheduler->GetContent()->GetSettings()->IsDenoiserEnabled)
return;
auto currentFrameIndex = scheduler->GetFrameNumber() % 2;
auto previousFrameIndex = (scheduler->GetFrameNumber() - 1) % 2;
Geometry::Dimensions gradientTexturesSize = scheduler->GetDefaultRenderSurfaceDesc().Dimensions().XYMultiplied(1.0 / 3.0);
NewTextureProperties gradientSamplePositionsProps{ HAL::ColorFormat::R8_Unsigned, HAL::TextureKind::Texture2D, gradientTexturesSize };
NewTextureProperties gradientProps{ HAL::ColorFormat::RG16_Float, HAL::TextureKind::Texture2D, gradientTexturesSize };
gradientSamplePositionsProps.Flags = ResourceSchedulingFlags::CrossFrameRead;
scheduler->NewTexture(ResourceNames::DenoiserGradientSamplePositions[currentFrameIndex], gradientSamplePositionsProps);
scheduler->NewTexture(ResourceNames::DenoiserGradientSamplePositions[previousFrameIndex], MipSet::Empty(), gradientSamplePositionsProps);
scheduler->NewTexture(ResourceNames::DenoiserPrimaryGradientInputs, gradientProps);
scheduler->ReadTexture(ResourceNames::GBufferViewDepth[previousFrameIndex], TextureReadContext::NonPixelShader, MipSet::FirstMip());
scheduler->ReadTexture(ResourceNames::StochasticShadowedShadingDenoised[previousFrameIndex]);
scheduler->ReadTexture(ResourceNames::StochasticUnshadowedShadingDenoised[previousFrameIndex]);
scheduler->ReadTexture(ResourceNames::RngSeeds[previousFrameIndex]);
scheduler->ReadTexture(ResourceNames::DenoiserGradientSamplePositions[previousFrameIndex]);
scheduler->AliasAndWriteTexture(ResourceNames::RngSeeds[currentFrameIndex], ResourceNames::RngSeedsCorrelated);
scheduler->ExecuteOnQueue(RenderPassExecutionQueue::AsyncCompute);
}
void DenoiserForwardProjectionRenderPass::Render(RenderContext<RenderPassContentMediator>* context)
{
auto resourceProvider = context->GetResourceProvider();
auto currentFrameIndex = context->GetFrameNumber() % 2;
auto previousFrameIndex = (context->GetFrameNumber() - 1) % 2;
ClearUAVTextureFloat(context, ResourceNames::DenoiserPrimaryGradientInputs, glm::vec4{ -1.0f });
ClearUAVTextureUInt(context, ResourceNames::DenoiserGradientSamplePositions[currentFrameIndex], glm::uvec4{ 0 });
context->GetCommandRecorder()->ApplyPipelineState(PSONames::DenoiserForwardProjection);
auto groupCount = CommandRecorder::DispatchGroupCount(resourceProvider->GetTextureProperties(ResourceNames::DenoiserPrimaryGradientInputs).Dimensions, { 16, 16 });
DenoiserForwardProjectionCBContent cbContent{};
cbContent.DispatchGroupCount = { groupCount.Width, groupCount.Height };
cbContent.GBufferViewDepthPrevTexIdx = resourceProvider->GetSRTextureIndex(ResourceNames::GBufferViewDepth[previousFrameIndex]);
cbContent.StochasticShadowedShadingPrevTexIdx = resourceProvider->GetSRTextureIndex(ResourceNames::StochasticShadowedShadingDenoised[previousFrameIndex]);
cbContent.StochasticUnshadowedShadingPrevTexIdx = resourceProvider->GetSRTextureIndex(ResourceNames::StochasticUnshadowedShadingDenoised[previousFrameIndex]);
cbContent.StochasticRngSeedsPrevTexIdx = resourceProvider->GetSRTextureIndex(ResourceNames::RngSeeds[previousFrameIndex]);
cbContent.GradientSamplePositionsPrevTexIdx = resourceProvider->GetSRTextureIndex(ResourceNames::DenoiserGradientSamplePositions[previousFrameIndex]);
cbContent.StochasticRngSeedsTexIdx = resourceProvider->GetUATextureIndex(ResourceNames::RngSeedsCorrelated);
cbContent.GradientSamplePositionsTexIdx = resourceProvider->GetUATextureIndex(ResourceNames::DenoiserGradientSamplePositions[currentFrameIndex]);
cbContent.GradientTexIdx = resourceProvider->GetUATextureIndex(ResourceNames::DenoiserPrimaryGradientInputs);
cbContent.FrameNumber = context->GetFrameNumber();
context->GetConstantsUpdater()->UpdateRootConstantBuffer(cbContent);
context->GetCommandRecorder()->Dispatch(groupCount.Width, groupCount.Height);
}
}
|
88a3c4a0ddd27f64b347d7cc8545db42205edd22 | ca97444b0a8f8aafb2f97fa332507a5102480f1b | /src/dsao/cdq/2d_lis.cpp | 8552a13fd7745b322e030c37b04a11adf2f9d729 | [
"MIT"
] | permissive | houzaj/ACM-CheatSheet | 5bedf470f93a7f0adeffefbb4b47a75f79f40f17 | d35695acedc9744486257109ce4ec1fd65fcc6f4 | refs/heads/master | 2020-09-01T17:56:07.399740 | 2019-12-04T05:54:06 | 2019-12-04T05:54:06 | 219,021,015 | 1 | 0 | MIT | 2019-11-01T16:18:51 | 2019-11-01T16:18:50 | null | UTF-8 | C++ | false | false | 3,591 | cpp | 2d_lis.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = (int)5e4 + 15;
struct info {
int h, v, idx, dp;
double cnt;
};
struct Tree {
int len;
double sum;
Tree(): len(0), sum(0) {}
Tree(int len, double sum): len(len), sum(sum) {}
};
info a[N], b[N];
int mph[N], mpv[N];
Tree tree[N];
inline bool cmp(const info& a, const info& b) {
return a.idx < b.idx;
}
inline bool cmp1 (const info& a, const info& b) {
return a.h != b.h ? a.h < b.h : a.v < b.v;
}
inline int lowbit(int x) {
return x & -x;
}
inline void update(int x, int len, double sum) {
for(; x < N; x += lowbit(x)) {
if(tree[x].len < len) {
tree[x] = Tree{len, sum};
} else if(tree[x].len == len) {
tree[x].sum += sum;
}
}
}
inline Tree getSum(int x) {
Tree ret;
for(; x > 0; x -= lowbit(x)) {
if(tree[x].len > ret.len) {
ret = tree[x];
} else if(tree[x].len == ret.len) {
ret.sum += tree[x].sum;
}
}
return ret;
}
inline void clearTree(int x) {
for(; x < N; x += lowbit(x)) {
tree[x] = Tree{0, 0};
}
}
inline void cdq(int l, int r, info* a) {
if(r <= l) {
return;
}
int mid = (l + r) >> 1;
cdq(l, mid, a);
sort(a + l, a + mid + 1, cmp1);
sort(a + mid + 1, a + r + 1, cmp1);
int st = l;
for(int i = mid + 1; i <= r; i++) {
while(a[st].h <= a[i].h && st <= mid) {
update(a[st].v, a[st].dp, a[st].cnt);
st++;
}
Tree res = getSum(a[i].v);
if(res.len == 0) {
continue;
}
if(res.len + 1 > a[i].dp) {
a[i].dp = res.len + 1;
a[i].cnt = res.sum;
} else if(res.len + 1 == a[i].dp) {
a[i].cnt += res.sum;
}
}
for(int i = l; i < st; i++) {
clearTree(a[i].v);
}
sort(a + mid + 1, a + r + 1, cmp);
cdq(mid + 1, r, a);
}
int main() {
int n;
while(~scanf("%d", &n)) {
for(int i = 1; i <= n; i++) {
scanf("%d%d", &a[i].h, &a[i].v);
a[i].idx = i, b[i].idx = n - i + 1;
a[i].dp = b[i].dp = 1;
a[i].cnt = b[i].cnt = 1;
mph[i] = a[i].h;
mpv[i] = a[i].v;
}
sort(mph + 1, mph + n + 1);
sort(mpv + 1, mpv + n + 1);
int toth = unique(mph + 1, mph + n + 1) - mph - 1;
int totv = unique(mpv + 1, mpv + n + 1) - mpv - 1;
for(int i = 1; i <= n; i++) {
a[i].h = lower_bound(mph + 1, mph + toth + 1, a[i].h) - mph;
a[i].v = lower_bound(mpv + 1, mpv + totv + 1, a[i].v) - mpv;
}
for(int i = 1; i <= n; i++) {
b[i].h = a[i].h;
b[i].v = a[i].v;
a[i].h = toth - a[i].h + 1;
a[i].v = totv - a[i].v + 1;
}
reverse(b + 1, b + n + 1);
cdq(1, n, a);
sort(a + 1, a + n + 1, cmp);
int maxLen = 0;
for(int i = 1; i <= n; i++) {
maxLen = max(maxLen, a[i].dp);
}
double sumCnt = 0;
for(int i = 1; i <= n; i++) {
if(a[i].dp == maxLen) {
sumCnt += a[i].cnt;
}
}
cdq(1, n, b);
sort(b + 1, b + n + 1, cmp);
printf("%d\n", maxLen);
for(int i = 1; i <= n; i++) {
if(a[i].dp + b[n - i + 1].dp - 1 == maxLen) {
printf("%.5f ", a[i].cnt * b[n - i + 1].cnt / sumCnt);
} else {
printf("0.00000 ");
}
}
puts("");
}
}
|
a0f7dbddcc2e7e9f301622f4c223fb5538f4c573 | d4e36f9d7870f538efbf76507165d47ef60f9474 | /src/utils/utils.h | fd9e5fa3faf026ce95633a45ef1c4e17f48f36dd | [] | no_license | jfellus/pgdb | 6761511831a2692e819ca70ba240daf83147d95c | 21d82c3f30593e3e8c8b4850aea148e720df5916 | refs/heads/master | 2021-01-10T09:08:43.747778 | 2016-04-02T17:36:57 | 2016-04-02T17:36:57 | 55,307,703 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 742 | h | utils.h | /*
* utils.h
*
* Created on: 22 mai 2015
* Author: jfellus
*/
#ifndef UTILS_H_
#define UTILS_H_
#include <vector>
#include <algorithm>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>
#include <string.h>
#include <iostream>
#include <string>
template <typename T> class array {
public:
std::vector<T> v;
public:
array() {}
inline const T& add(const T& e) {v.push_back(e); return e;}
inline bool remove(const T& e) {
typename std::vector<T>::iterator position = std::find(v.begin(), v.end(), e);
if (position != v.end()) {v.erase(position); return true;}
return false;
}
inline size_t size() {return v.size();}
inline T& operator[](int i) {return v[i];}
};
#endif /* UTILS_H_ */
|
2ae4fa3d45fc30868997661a78cea1073b45d03d | 1274004bfb34d61dfcab1f68fcb3847dd46103f5 | /a bperc.cpp | 3660421a8828750d5bedaf026e6cb7f9d308d10b | [] | no_license | Marinska/sederhanakan-bilangan-pecahan | f65685bad3f3ddd7c62ffb81167a9d0cb066f5b9 | 1dbe3098ac1148a22596377f4b061c5fda07d3e6 | refs/heads/master | 2020-04-11T20:55:24.571484 | 2018-12-17T07:06:06 | 2018-12-17T07:06:06 | 162,084,706 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 356 | cpp | a bperc.cpp | #include <iostream> //Nama Umar Ibnu Zainal M
using namespace std; //NIM 311810909
void logika(int a,int b,int c,int ab)
{
a=b/c;
ab=b%c;
cout<<"Nilai dari pecahan "<<b<<"/"<<c<<" adalah "<<a<<" "<<ab<<"/"<<c;
}
int main()
{
int a,b,c,ab;
cout<<"Masukan nilai pembilang : ";
cin>>b;
cout<<"Masukan nilai penyebut : ";
cin>>c;
logika(a,b,c,ab);
}
|
001b31bccd7110e9a1ea684d0b00861e2a7acb5a | 29f7b4b92521b75edaf209affd2c0aae47a9a0e4 | /topics/objective_state/autotuner_configuration/include/autotuner_configurationPlugin.h | 2858e7ca684862d4c89c6fe93980cbdfae9b7db4 | [] | no_license | nyhnpya/edge_data_models | c8b78984c7ddd82871bdc2aa11c418c8f29c7159 | ab8e6cddd9d3bd3b54966fdc3d1974f9a20a7cee | refs/heads/master | 2022-10-21T20:19:51.973699 | 2019-02-25T09:22:39 | 2019-02-25T09:23:50 | 124,416,324 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 74,657 | h | autotuner_configurationPlugin.h |
/*
WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY.
This file was generated from autotuner_configuration.idl using "rtiddsgen".
The rtiddsgen tool is part of the RTI Connext distribution.
For more information, type 'rtiddsgen -help' at a command shell
or consult the RTI Connext manual.
*/
#ifndef autotuner_configurationPlugin_985793370_h
#define autotuner_configurationPlugin_985793370_h
#include "autotuner_configuration.h"
struct RTICdrStream;
#ifndef pres_typePlugin_h
#include "pres/pres_typePlugin.h"
#endif
#if (defined(RTI_WIN32) || defined (RTI_WINCE)) && defined(NDDS_USER_DLL_EXPORT)
/* If the code is building on Windows, start exporting symbols.
*/
#undef NDDSUSERDllExport
#define NDDSUSERDllExport __declspec(dllexport)
#endif
namespace AutoTunerConfiguration {
#define ModelStateRequestPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample
#define ModelStateRequestPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer
#define ModelStateRequestPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer
#define ModelStateRequestPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample
#define ModelStateRequestPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample
/* --------------------------------------------------------------------------------------
Support functions:
* -------------------------------------------------------------------------------------- */
NDDSUSERDllExport extern ModelStateRequest*
ModelStateRequestPluginSupport_create_data_w_params(
const struct DDS_TypeAllocationParams_t * alloc_params);
NDDSUSERDllExport extern ModelStateRequest*
ModelStateRequestPluginSupport_create_data_ex(RTIBool allocate_pointers);
NDDSUSERDllExport extern ModelStateRequest*
ModelStateRequestPluginSupport_create_data(void);
NDDSUSERDllExport extern RTIBool
ModelStateRequestPluginSupport_copy_data(
ModelStateRequest *out,
const ModelStateRequest *in);
NDDSUSERDllExport extern void
ModelStateRequestPluginSupport_destroy_data_w_params(
ModelStateRequest *sample,
const struct DDS_TypeDeallocationParams_t * dealloc_params);
NDDSUSERDllExport extern void
ModelStateRequestPluginSupport_destroy_data_ex(
ModelStateRequest *sample,RTIBool deallocate_pointers);
NDDSUSERDllExport extern void
ModelStateRequestPluginSupport_destroy_data(
ModelStateRequest *sample);
NDDSUSERDllExport extern void
ModelStateRequestPluginSupport_print_data(
const ModelStateRequest *sample,
const char *desc,
unsigned int indent);
/* ----------------------------------------------------------------------------
Callback functions:
* ---------------------------------------------------------------------------- */
NDDSUSERDllExport extern PRESTypePluginParticipantData
ModelStateRequestPlugin_on_participant_attached(
void *registration_data,
const struct PRESTypePluginParticipantInfo *participant_info,
RTIBool top_level_registration,
void *container_plugin_context,
RTICdrTypeCode *typeCode);
NDDSUSERDllExport extern void
ModelStateRequestPlugin_on_participant_detached(
PRESTypePluginParticipantData participant_data);
NDDSUSERDllExport extern PRESTypePluginEndpointData
ModelStateRequestPlugin_on_endpoint_attached(
PRESTypePluginParticipantData participant_data,
const struct PRESTypePluginEndpointInfo *endpoint_info,
RTIBool top_level_registration,
void *container_plugin_context);
NDDSUSERDllExport extern void
ModelStateRequestPlugin_on_endpoint_detached(
PRESTypePluginEndpointData endpoint_data);
NDDSUSERDllExport extern void
ModelStateRequestPlugin_return_sample(
PRESTypePluginEndpointData endpoint_data,
ModelStateRequest *sample,
void *handle);
NDDSUSERDllExport extern RTIBool
ModelStateRequestPlugin_copy_sample(
PRESTypePluginEndpointData endpoint_data,
ModelStateRequest *out,
const ModelStateRequest *in);
/* ----------------------------------------------------------------------------
(De)Serialize functions:
* ------------------------------------------------------------------------- */
NDDSUSERDllExport extern RTIBool
ModelStateRequestPlugin_serialize(
PRESTypePluginEndpointData endpoint_data,
const ModelStateRequest *sample,
struct RTICdrStream *stream,
RTIBool serialize_encapsulation,
RTIEncapsulationId encapsulation_id,
RTIBool serialize_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
ModelStateRequestPlugin_deserialize_sample(
PRESTypePluginEndpointData endpoint_data,
ModelStateRequest *sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
ModelStateRequestPlugin_serialize_to_cdr_buffer(
char * buffer,
unsigned int * length,
const ModelStateRequest *sample);
NDDSUSERDllExport extern RTIBool
ModelStateRequestPlugin_deserialize(
PRESTypePluginEndpointData endpoint_data,
ModelStateRequest **sample,
RTIBool * drop_sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
ModelStateRequestPlugin_deserialize_from_cdr_buffer(
ModelStateRequest *sample,
const char * buffer,
unsigned int length);
NDDSUSERDllExport extern DDS_ReturnCode_t
ModelStateRequestPlugin_data_to_string(
const ModelStateRequest *sample,
char *str,
DDS_UnsignedLong *str_size,
const struct DDS_PrintFormatProperty *property);
NDDSUSERDllExport extern RTIBool
ModelStateRequestPlugin_skip(
PRESTypePluginEndpointData endpoint_data,
struct RTICdrStream *stream,
RTIBool skip_encapsulation,
RTIBool skip_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern unsigned int
ModelStateRequestPlugin_get_serialized_sample_max_size_ex(
PRESTypePluginEndpointData endpoint_data,
RTIBool * overflow,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern unsigned int
ModelStateRequestPlugin_get_serialized_sample_max_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern unsigned int
ModelStateRequestPlugin_get_serialized_sample_min_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern unsigned int
ModelStateRequestPlugin_get_serialized_sample_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment,
const ModelStateRequest * sample);
/* --------------------------------------------------------------------------------------
Key Management functions:
* -------------------------------------------------------------------------------------- */
NDDSUSERDllExport extern PRESTypePluginKeyKind
ModelStateRequestPlugin_get_key_kind(void);
NDDSUSERDllExport extern unsigned int
ModelStateRequestPlugin_get_serialized_key_max_size_ex(
PRESTypePluginEndpointData endpoint_data,
RTIBool * overflow,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern unsigned int
ModelStateRequestPlugin_get_serialized_key_max_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern RTIBool
ModelStateRequestPlugin_serialize_key(
PRESTypePluginEndpointData endpoint_data,
const ModelStateRequest *sample,
struct RTICdrStream *stream,
RTIBool serialize_encapsulation,
RTIEncapsulationId encapsulation_id,
RTIBool serialize_key,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
ModelStateRequestPlugin_deserialize_key_sample(
PRESTypePluginEndpointData endpoint_data,
ModelStateRequest * sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
ModelStateRequestPlugin_deserialize_key(
PRESTypePluginEndpointData endpoint_data,
ModelStateRequest ** sample,
RTIBool * drop_sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
ModelStateRequestPlugin_serialized_sample_to_key(
PRESTypePluginEndpointData endpoint_data,
ModelStateRequest *sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos);
/* Plugin Functions */
NDDSUSERDllExport extern struct PRESTypePlugin*
ModelStateRequestPlugin_new(void);
NDDSUSERDllExport extern void
ModelStateRequestPlugin_delete(struct PRESTypePlugin *);
#define ModelStateStatePlugin_get_sample PRESTypePluginDefaultEndpointData_getSample
#define ModelStateStatePlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer
#define ModelStateStatePlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer
#define ModelStateStatePlugin_create_sample PRESTypePluginDefaultEndpointData_createSample
#define ModelStateStatePlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample
/* --------------------------------------------------------------------------------------
Support functions:
* -------------------------------------------------------------------------------------- */
NDDSUSERDllExport extern ModelStateState*
ModelStateStatePluginSupport_create_data_w_params(
const struct DDS_TypeAllocationParams_t * alloc_params);
NDDSUSERDllExport extern ModelStateState*
ModelStateStatePluginSupport_create_data_ex(RTIBool allocate_pointers);
NDDSUSERDllExport extern ModelStateState*
ModelStateStatePluginSupport_create_data(void);
NDDSUSERDllExport extern RTIBool
ModelStateStatePluginSupport_copy_data(
ModelStateState *out,
const ModelStateState *in);
NDDSUSERDllExport extern void
ModelStateStatePluginSupport_destroy_data_w_params(
ModelStateState *sample,
const struct DDS_TypeDeallocationParams_t * dealloc_params);
NDDSUSERDllExport extern void
ModelStateStatePluginSupport_destroy_data_ex(
ModelStateState *sample,RTIBool deallocate_pointers);
NDDSUSERDllExport extern void
ModelStateStatePluginSupport_destroy_data(
ModelStateState *sample);
NDDSUSERDllExport extern void
ModelStateStatePluginSupport_print_data(
const ModelStateState *sample,
const char *desc,
unsigned int indent);
/* ----------------------------------------------------------------------------
Callback functions:
* ---------------------------------------------------------------------------- */
NDDSUSERDllExport extern PRESTypePluginParticipantData
ModelStateStatePlugin_on_participant_attached(
void *registration_data,
const struct PRESTypePluginParticipantInfo *participant_info,
RTIBool top_level_registration,
void *container_plugin_context,
RTICdrTypeCode *typeCode);
NDDSUSERDllExport extern void
ModelStateStatePlugin_on_participant_detached(
PRESTypePluginParticipantData participant_data);
NDDSUSERDllExport extern PRESTypePluginEndpointData
ModelStateStatePlugin_on_endpoint_attached(
PRESTypePluginParticipantData participant_data,
const struct PRESTypePluginEndpointInfo *endpoint_info,
RTIBool top_level_registration,
void *container_plugin_context);
NDDSUSERDllExport extern void
ModelStateStatePlugin_on_endpoint_detached(
PRESTypePluginEndpointData endpoint_data);
NDDSUSERDllExport extern void
ModelStateStatePlugin_return_sample(
PRESTypePluginEndpointData endpoint_data,
ModelStateState *sample,
void *handle);
NDDSUSERDllExport extern RTIBool
ModelStateStatePlugin_copy_sample(
PRESTypePluginEndpointData endpoint_data,
ModelStateState *out,
const ModelStateState *in);
/* ----------------------------------------------------------------------------
(De)Serialize functions:
* ------------------------------------------------------------------------- */
NDDSUSERDllExport extern RTIBool
ModelStateStatePlugin_serialize(
PRESTypePluginEndpointData endpoint_data,
const ModelStateState *sample,
struct RTICdrStream *stream,
RTIBool serialize_encapsulation,
RTIEncapsulationId encapsulation_id,
RTIBool serialize_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
ModelStateStatePlugin_deserialize_sample(
PRESTypePluginEndpointData endpoint_data,
ModelStateState *sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
ModelStateStatePlugin_serialize_to_cdr_buffer(
char * buffer,
unsigned int * length,
const ModelStateState *sample);
NDDSUSERDllExport extern RTIBool
ModelStateStatePlugin_deserialize(
PRESTypePluginEndpointData endpoint_data,
ModelStateState **sample,
RTIBool * drop_sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
ModelStateStatePlugin_deserialize_from_cdr_buffer(
ModelStateState *sample,
const char * buffer,
unsigned int length);
NDDSUSERDllExport extern DDS_ReturnCode_t
ModelStateStatePlugin_data_to_string(
const ModelStateState *sample,
char *str,
DDS_UnsignedLong *str_size,
const struct DDS_PrintFormatProperty *property);
NDDSUSERDllExport extern RTIBool
ModelStateStatePlugin_skip(
PRESTypePluginEndpointData endpoint_data,
struct RTICdrStream *stream,
RTIBool skip_encapsulation,
RTIBool skip_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern unsigned int
ModelStateStatePlugin_get_serialized_sample_max_size_ex(
PRESTypePluginEndpointData endpoint_data,
RTIBool * overflow,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern unsigned int
ModelStateStatePlugin_get_serialized_sample_max_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern unsigned int
ModelStateStatePlugin_get_serialized_sample_min_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern unsigned int
ModelStateStatePlugin_get_serialized_sample_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment,
const ModelStateState * sample);
/* --------------------------------------------------------------------------------------
Key Management functions:
* -------------------------------------------------------------------------------------- */
NDDSUSERDllExport extern PRESTypePluginKeyKind
ModelStateStatePlugin_get_key_kind(void);
NDDSUSERDllExport extern unsigned int
ModelStateStatePlugin_get_serialized_key_max_size_ex(
PRESTypePluginEndpointData endpoint_data,
RTIBool * overflow,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern unsigned int
ModelStateStatePlugin_get_serialized_key_max_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern RTIBool
ModelStateStatePlugin_serialize_key(
PRESTypePluginEndpointData endpoint_data,
const ModelStateState *sample,
struct RTICdrStream *stream,
RTIBool serialize_encapsulation,
RTIEncapsulationId encapsulation_id,
RTIBool serialize_key,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
ModelStateStatePlugin_deserialize_key_sample(
PRESTypePluginEndpointData endpoint_data,
ModelStateState * sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
ModelStateStatePlugin_deserialize_key(
PRESTypePluginEndpointData endpoint_data,
ModelStateState ** sample,
RTIBool * drop_sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
ModelStateStatePlugin_serialized_sample_to_key(
PRESTypePluginEndpointData endpoint_data,
ModelStateState *sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos);
/* Plugin Functions */
NDDSUSERDllExport extern struct PRESTypePlugin*
ModelStateStatePlugin_new(void);
NDDSUSERDllExport extern void
ModelStateStatePlugin_delete(struct PRESTypePlugin *);
#define DiffpTuningRequestPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample
#define DiffpTuningRequestPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer
#define DiffpTuningRequestPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer
#define DiffpTuningRequestPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample
#define DiffpTuningRequestPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample
/* --------------------------------------------------------------------------------------
Support functions:
* -------------------------------------------------------------------------------------- */
NDDSUSERDllExport extern DiffpTuningRequest*
DiffpTuningRequestPluginSupport_create_data_w_params(
const struct DDS_TypeAllocationParams_t * alloc_params);
NDDSUSERDllExport extern DiffpTuningRequest*
DiffpTuningRequestPluginSupport_create_data_ex(RTIBool allocate_pointers);
NDDSUSERDllExport extern DiffpTuningRequest*
DiffpTuningRequestPluginSupport_create_data(void);
NDDSUSERDllExport extern RTIBool
DiffpTuningRequestPluginSupport_copy_data(
DiffpTuningRequest *out,
const DiffpTuningRequest *in);
NDDSUSERDllExport extern void
DiffpTuningRequestPluginSupport_destroy_data_w_params(
DiffpTuningRequest *sample,
const struct DDS_TypeDeallocationParams_t * dealloc_params);
NDDSUSERDllExport extern void
DiffpTuningRequestPluginSupport_destroy_data_ex(
DiffpTuningRequest *sample,RTIBool deallocate_pointers);
NDDSUSERDllExport extern void
DiffpTuningRequestPluginSupport_destroy_data(
DiffpTuningRequest *sample);
NDDSUSERDllExport extern void
DiffpTuningRequestPluginSupport_print_data(
const DiffpTuningRequest *sample,
const char *desc,
unsigned int indent);
/* ----------------------------------------------------------------------------
Callback functions:
* ---------------------------------------------------------------------------- */
NDDSUSERDllExport extern PRESTypePluginParticipantData
DiffpTuningRequestPlugin_on_participant_attached(
void *registration_data,
const struct PRESTypePluginParticipantInfo *participant_info,
RTIBool top_level_registration,
void *container_plugin_context,
RTICdrTypeCode *typeCode);
NDDSUSERDllExport extern void
DiffpTuningRequestPlugin_on_participant_detached(
PRESTypePluginParticipantData participant_data);
NDDSUSERDllExport extern PRESTypePluginEndpointData
DiffpTuningRequestPlugin_on_endpoint_attached(
PRESTypePluginParticipantData participant_data,
const struct PRESTypePluginEndpointInfo *endpoint_info,
RTIBool top_level_registration,
void *container_plugin_context);
NDDSUSERDllExport extern void
DiffpTuningRequestPlugin_on_endpoint_detached(
PRESTypePluginEndpointData endpoint_data);
NDDSUSERDllExport extern void
DiffpTuningRequestPlugin_return_sample(
PRESTypePluginEndpointData endpoint_data,
DiffpTuningRequest *sample,
void *handle);
NDDSUSERDllExport extern RTIBool
DiffpTuningRequestPlugin_copy_sample(
PRESTypePluginEndpointData endpoint_data,
DiffpTuningRequest *out,
const DiffpTuningRequest *in);
/* ----------------------------------------------------------------------------
(De)Serialize functions:
* ------------------------------------------------------------------------- */
NDDSUSERDllExport extern RTIBool
DiffpTuningRequestPlugin_serialize(
PRESTypePluginEndpointData endpoint_data,
const DiffpTuningRequest *sample,
struct RTICdrStream *stream,
RTIBool serialize_encapsulation,
RTIEncapsulationId encapsulation_id,
RTIBool serialize_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
DiffpTuningRequestPlugin_deserialize_sample(
PRESTypePluginEndpointData endpoint_data,
DiffpTuningRequest *sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
DiffpTuningRequestPlugin_serialize_to_cdr_buffer(
char * buffer,
unsigned int * length,
const DiffpTuningRequest *sample);
NDDSUSERDllExport extern RTIBool
DiffpTuningRequestPlugin_deserialize(
PRESTypePluginEndpointData endpoint_data,
DiffpTuningRequest **sample,
RTIBool * drop_sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
DiffpTuningRequestPlugin_deserialize_from_cdr_buffer(
DiffpTuningRequest *sample,
const char * buffer,
unsigned int length);
NDDSUSERDllExport extern DDS_ReturnCode_t
DiffpTuningRequestPlugin_data_to_string(
const DiffpTuningRequest *sample,
char *str,
DDS_UnsignedLong *str_size,
const struct DDS_PrintFormatProperty *property);
NDDSUSERDllExport extern RTIBool
DiffpTuningRequestPlugin_skip(
PRESTypePluginEndpointData endpoint_data,
struct RTICdrStream *stream,
RTIBool skip_encapsulation,
RTIBool skip_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern unsigned int
DiffpTuningRequestPlugin_get_serialized_sample_max_size_ex(
PRESTypePluginEndpointData endpoint_data,
RTIBool * overflow,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern unsigned int
DiffpTuningRequestPlugin_get_serialized_sample_max_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern unsigned int
DiffpTuningRequestPlugin_get_serialized_sample_min_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern unsigned int
DiffpTuningRequestPlugin_get_serialized_sample_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment,
const DiffpTuningRequest * sample);
/* --------------------------------------------------------------------------------------
Key Management functions:
* -------------------------------------------------------------------------------------- */
NDDSUSERDllExport extern PRESTypePluginKeyKind
DiffpTuningRequestPlugin_get_key_kind(void);
NDDSUSERDllExport extern unsigned int
DiffpTuningRequestPlugin_get_serialized_key_max_size_ex(
PRESTypePluginEndpointData endpoint_data,
RTIBool * overflow,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern unsigned int
DiffpTuningRequestPlugin_get_serialized_key_max_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern RTIBool
DiffpTuningRequestPlugin_serialize_key(
PRESTypePluginEndpointData endpoint_data,
const DiffpTuningRequest *sample,
struct RTICdrStream *stream,
RTIBool serialize_encapsulation,
RTIEncapsulationId encapsulation_id,
RTIBool serialize_key,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
DiffpTuningRequestPlugin_deserialize_key_sample(
PRESTypePluginEndpointData endpoint_data,
DiffpTuningRequest * sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
DiffpTuningRequestPlugin_deserialize_key(
PRESTypePluginEndpointData endpoint_data,
DiffpTuningRequest ** sample,
RTIBool * drop_sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
DiffpTuningRequestPlugin_serialized_sample_to_key(
PRESTypePluginEndpointData endpoint_data,
DiffpTuningRequest *sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos);
/* Plugin Functions */
NDDSUSERDllExport extern struct PRESTypePlugin*
DiffpTuningRequestPlugin_new(void);
NDDSUSERDllExport extern void
DiffpTuningRequestPlugin_delete(struct PRESTypePlugin *);
#define DiffpTuningStatePlugin_get_sample PRESTypePluginDefaultEndpointData_getSample
#define DiffpTuningStatePlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer
#define DiffpTuningStatePlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer
#define DiffpTuningStatePlugin_create_sample PRESTypePluginDefaultEndpointData_createSample
#define DiffpTuningStatePlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample
/* --------------------------------------------------------------------------------------
Support functions:
* -------------------------------------------------------------------------------------- */
NDDSUSERDllExport extern DiffpTuningState*
DiffpTuningStatePluginSupport_create_data_w_params(
const struct DDS_TypeAllocationParams_t * alloc_params);
NDDSUSERDllExport extern DiffpTuningState*
DiffpTuningStatePluginSupport_create_data_ex(RTIBool allocate_pointers);
NDDSUSERDllExport extern DiffpTuningState*
DiffpTuningStatePluginSupport_create_data(void);
NDDSUSERDllExport extern RTIBool
DiffpTuningStatePluginSupport_copy_data(
DiffpTuningState *out,
const DiffpTuningState *in);
NDDSUSERDllExport extern void
DiffpTuningStatePluginSupport_destroy_data_w_params(
DiffpTuningState *sample,
const struct DDS_TypeDeallocationParams_t * dealloc_params);
NDDSUSERDllExport extern void
DiffpTuningStatePluginSupport_destroy_data_ex(
DiffpTuningState *sample,RTIBool deallocate_pointers);
NDDSUSERDllExport extern void
DiffpTuningStatePluginSupport_destroy_data(
DiffpTuningState *sample);
NDDSUSERDllExport extern void
DiffpTuningStatePluginSupport_print_data(
const DiffpTuningState *sample,
const char *desc,
unsigned int indent);
/* ----------------------------------------------------------------------------
Callback functions:
* ---------------------------------------------------------------------------- */
NDDSUSERDllExport extern PRESTypePluginParticipantData
DiffpTuningStatePlugin_on_participant_attached(
void *registration_data,
const struct PRESTypePluginParticipantInfo *participant_info,
RTIBool top_level_registration,
void *container_plugin_context,
RTICdrTypeCode *typeCode);
NDDSUSERDllExport extern void
DiffpTuningStatePlugin_on_participant_detached(
PRESTypePluginParticipantData participant_data);
NDDSUSERDllExport extern PRESTypePluginEndpointData
DiffpTuningStatePlugin_on_endpoint_attached(
PRESTypePluginParticipantData participant_data,
const struct PRESTypePluginEndpointInfo *endpoint_info,
RTIBool top_level_registration,
void *container_plugin_context);
NDDSUSERDllExport extern void
DiffpTuningStatePlugin_on_endpoint_detached(
PRESTypePluginEndpointData endpoint_data);
NDDSUSERDllExport extern void
DiffpTuningStatePlugin_return_sample(
PRESTypePluginEndpointData endpoint_data,
DiffpTuningState *sample,
void *handle);
NDDSUSERDllExport extern RTIBool
DiffpTuningStatePlugin_copy_sample(
PRESTypePluginEndpointData endpoint_data,
DiffpTuningState *out,
const DiffpTuningState *in);
/* ----------------------------------------------------------------------------
(De)Serialize functions:
* ------------------------------------------------------------------------- */
NDDSUSERDllExport extern RTIBool
DiffpTuningStatePlugin_serialize(
PRESTypePluginEndpointData endpoint_data,
const DiffpTuningState *sample,
struct RTICdrStream *stream,
RTIBool serialize_encapsulation,
RTIEncapsulationId encapsulation_id,
RTIBool serialize_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
DiffpTuningStatePlugin_deserialize_sample(
PRESTypePluginEndpointData endpoint_data,
DiffpTuningState *sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
DiffpTuningStatePlugin_serialize_to_cdr_buffer(
char * buffer,
unsigned int * length,
const DiffpTuningState *sample);
NDDSUSERDllExport extern RTIBool
DiffpTuningStatePlugin_deserialize(
PRESTypePluginEndpointData endpoint_data,
DiffpTuningState **sample,
RTIBool * drop_sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
DiffpTuningStatePlugin_deserialize_from_cdr_buffer(
DiffpTuningState *sample,
const char * buffer,
unsigned int length);
NDDSUSERDllExport extern DDS_ReturnCode_t
DiffpTuningStatePlugin_data_to_string(
const DiffpTuningState *sample,
char *str,
DDS_UnsignedLong *str_size,
const struct DDS_PrintFormatProperty *property);
NDDSUSERDllExport extern RTIBool
DiffpTuningStatePlugin_skip(
PRESTypePluginEndpointData endpoint_data,
struct RTICdrStream *stream,
RTIBool skip_encapsulation,
RTIBool skip_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern unsigned int
DiffpTuningStatePlugin_get_serialized_sample_max_size_ex(
PRESTypePluginEndpointData endpoint_data,
RTIBool * overflow,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern unsigned int
DiffpTuningStatePlugin_get_serialized_sample_max_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern unsigned int
DiffpTuningStatePlugin_get_serialized_sample_min_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern unsigned int
DiffpTuningStatePlugin_get_serialized_sample_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment,
const DiffpTuningState * sample);
/* --------------------------------------------------------------------------------------
Key Management functions:
* -------------------------------------------------------------------------------------- */
NDDSUSERDllExport extern PRESTypePluginKeyKind
DiffpTuningStatePlugin_get_key_kind(void);
NDDSUSERDllExport extern unsigned int
DiffpTuningStatePlugin_get_serialized_key_max_size_ex(
PRESTypePluginEndpointData endpoint_data,
RTIBool * overflow,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern unsigned int
DiffpTuningStatePlugin_get_serialized_key_max_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern RTIBool
DiffpTuningStatePlugin_serialize_key(
PRESTypePluginEndpointData endpoint_data,
const DiffpTuningState *sample,
struct RTICdrStream *stream,
RTIBool serialize_encapsulation,
RTIEncapsulationId encapsulation_id,
RTIBool serialize_key,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
DiffpTuningStatePlugin_deserialize_key_sample(
PRESTypePluginEndpointData endpoint_data,
DiffpTuningState * sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
DiffpTuningStatePlugin_deserialize_key(
PRESTypePluginEndpointData endpoint_data,
DiffpTuningState ** sample,
RTIBool * drop_sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
DiffpTuningStatePlugin_serialized_sample_to_key(
PRESTypePluginEndpointData endpoint_data,
DiffpTuningState *sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos);
/* Plugin Functions */
NDDSUSERDllExport extern struct PRESTypePlugin*
DiffpTuningStatePlugin_new(void);
NDDSUSERDllExport extern void
DiffpTuningStatePlugin_delete(struct PRESTypePlugin *);
#define WobTuningRequestPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample
#define WobTuningRequestPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer
#define WobTuningRequestPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer
#define WobTuningRequestPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample
#define WobTuningRequestPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample
/* --------------------------------------------------------------------------------------
Support functions:
* -------------------------------------------------------------------------------------- */
NDDSUSERDllExport extern WobTuningRequest*
WobTuningRequestPluginSupport_create_data_w_params(
const struct DDS_TypeAllocationParams_t * alloc_params);
NDDSUSERDllExport extern WobTuningRequest*
WobTuningRequestPluginSupport_create_data_ex(RTIBool allocate_pointers);
NDDSUSERDllExport extern WobTuningRequest*
WobTuningRequestPluginSupport_create_data(void);
NDDSUSERDllExport extern RTIBool
WobTuningRequestPluginSupport_copy_data(
WobTuningRequest *out,
const WobTuningRequest *in);
NDDSUSERDllExport extern void
WobTuningRequestPluginSupport_destroy_data_w_params(
WobTuningRequest *sample,
const struct DDS_TypeDeallocationParams_t * dealloc_params);
NDDSUSERDllExport extern void
WobTuningRequestPluginSupport_destroy_data_ex(
WobTuningRequest *sample,RTIBool deallocate_pointers);
NDDSUSERDllExport extern void
WobTuningRequestPluginSupport_destroy_data(
WobTuningRequest *sample);
NDDSUSERDllExport extern void
WobTuningRequestPluginSupport_print_data(
const WobTuningRequest *sample,
const char *desc,
unsigned int indent);
/* ----------------------------------------------------------------------------
Callback functions:
* ---------------------------------------------------------------------------- */
NDDSUSERDllExport extern PRESTypePluginParticipantData
WobTuningRequestPlugin_on_participant_attached(
void *registration_data,
const struct PRESTypePluginParticipantInfo *participant_info,
RTIBool top_level_registration,
void *container_plugin_context,
RTICdrTypeCode *typeCode);
NDDSUSERDllExport extern void
WobTuningRequestPlugin_on_participant_detached(
PRESTypePluginParticipantData participant_data);
NDDSUSERDllExport extern PRESTypePluginEndpointData
WobTuningRequestPlugin_on_endpoint_attached(
PRESTypePluginParticipantData participant_data,
const struct PRESTypePluginEndpointInfo *endpoint_info,
RTIBool top_level_registration,
void *container_plugin_context);
NDDSUSERDllExport extern void
WobTuningRequestPlugin_on_endpoint_detached(
PRESTypePluginEndpointData endpoint_data);
NDDSUSERDllExport extern void
WobTuningRequestPlugin_return_sample(
PRESTypePluginEndpointData endpoint_data,
WobTuningRequest *sample,
void *handle);
NDDSUSERDllExport extern RTIBool
WobTuningRequestPlugin_copy_sample(
PRESTypePluginEndpointData endpoint_data,
WobTuningRequest *out,
const WobTuningRequest *in);
/* ----------------------------------------------------------------------------
(De)Serialize functions:
* ------------------------------------------------------------------------- */
NDDSUSERDllExport extern RTIBool
WobTuningRequestPlugin_serialize(
PRESTypePluginEndpointData endpoint_data,
const WobTuningRequest *sample,
struct RTICdrStream *stream,
RTIBool serialize_encapsulation,
RTIEncapsulationId encapsulation_id,
RTIBool serialize_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
WobTuningRequestPlugin_deserialize_sample(
PRESTypePluginEndpointData endpoint_data,
WobTuningRequest *sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
WobTuningRequestPlugin_serialize_to_cdr_buffer(
char * buffer,
unsigned int * length,
const WobTuningRequest *sample);
NDDSUSERDllExport extern RTIBool
WobTuningRequestPlugin_deserialize(
PRESTypePluginEndpointData endpoint_data,
WobTuningRequest **sample,
RTIBool * drop_sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
WobTuningRequestPlugin_deserialize_from_cdr_buffer(
WobTuningRequest *sample,
const char * buffer,
unsigned int length);
NDDSUSERDllExport extern DDS_ReturnCode_t
WobTuningRequestPlugin_data_to_string(
const WobTuningRequest *sample,
char *str,
DDS_UnsignedLong *str_size,
const struct DDS_PrintFormatProperty *property);
NDDSUSERDllExport extern RTIBool
WobTuningRequestPlugin_skip(
PRESTypePluginEndpointData endpoint_data,
struct RTICdrStream *stream,
RTIBool skip_encapsulation,
RTIBool skip_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern unsigned int
WobTuningRequestPlugin_get_serialized_sample_max_size_ex(
PRESTypePluginEndpointData endpoint_data,
RTIBool * overflow,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern unsigned int
WobTuningRequestPlugin_get_serialized_sample_max_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern unsigned int
WobTuningRequestPlugin_get_serialized_sample_min_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern unsigned int
WobTuningRequestPlugin_get_serialized_sample_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment,
const WobTuningRequest * sample);
/* --------------------------------------------------------------------------------------
Key Management functions:
* -------------------------------------------------------------------------------------- */
NDDSUSERDllExport extern PRESTypePluginKeyKind
WobTuningRequestPlugin_get_key_kind(void);
NDDSUSERDllExport extern unsigned int
WobTuningRequestPlugin_get_serialized_key_max_size_ex(
PRESTypePluginEndpointData endpoint_data,
RTIBool * overflow,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern unsigned int
WobTuningRequestPlugin_get_serialized_key_max_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern RTIBool
WobTuningRequestPlugin_serialize_key(
PRESTypePluginEndpointData endpoint_data,
const WobTuningRequest *sample,
struct RTICdrStream *stream,
RTIBool serialize_encapsulation,
RTIEncapsulationId encapsulation_id,
RTIBool serialize_key,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
WobTuningRequestPlugin_deserialize_key_sample(
PRESTypePluginEndpointData endpoint_data,
WobTuningRequest * sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
WobTuningRequestPlugin_deserialize_key(
PRESTypePluginEndpointData endpoint_data,
WobTuningRequest ** sample,
RTIBool * drop_sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
WobTuningRequestPlugin_serialized_sample_to_key(
PRESTypePluginEndpointData endpoint_data,
WobTuningRequest *sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos);
/* Plugin Functions */
NDDSUSERDllExport extern struct PRESTypePlugin*
WobTuningRequestPlugin_new(void);
NDDSUSERDllExport extern void
WobTuningRequestPlugin_delete(struct PRESTypePlugin *);
#define WobTuningStatePlugin_get_sample PRESTypePluginDefaultEndpointData_getSample
#define WobTuningStatePlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer
#define WobTuningStatePlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer
#define WobTuningStatePlugin_create_sample PRESTypePluginDefaultEndpointData_createSample
#define WobTuningStatePlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample
/* --------------------------------------------------------------------------------------
Support functions:
* -------------------------------------------------------------------------------------- */
NDDSUSERDllExport extern WobTuningState*
WobTuningStatePluginSupport_create_data_w_params(
const struct DDS_TypeAllocationParams_t * alloc_params);
NDDSUSERDllExport extern WobTuningState*
WobTuningStatePluginSupport_create_data_ex(RTIBool allocate_pointers);
NDDSUSERDllExport extern WobTuningState*
WobTuningStatePluginSupport_create_data(void);
NDDSUSERDllExport extern RTIBool
WobTuningStatePluginSupport_copy_data(
WobTuningState *out,
const WobTuningState *in);
NDDSUSERDllExport extern void
WobTuningStatePluginSupport_destroy_data_w_params(
WobTuningState *sample,
const struct DDS_TypeDeallocationParams_t * dealloc_params);
NDDSUSERDllExport extern void
WobTuningStatePluginSupport_destroy_data_ex(
WobTuningState *sample,RTIBool deallocate_pointers);
NDDSUSERDllExport extern void
WobTuningStatePluginSupport_destroy_data(
WobTuningState *sample);
NDDSUSERDllExport extern void
WobTuningStatePluginSupport_print_data(
const WobTuningState *sample,
const char *desc,
unsigned int indent);
/* ----------------------------------------------------------------------------
Callback functions:
* ---------------------------------------------------------------------------- */
NDDSUSERDllExport extern PRESTypePluginParticipantData
WobTuningStatePlugin_on_participant_attached(
void *registration_data,
const struct PRESTypePluginParticipantInfo *participant_info,
RTIBool top_level_registration,
void *container_plugin_context,
RTICdrTypeCode *typeCode);
NDDSUSERDllExport extern void
WobTuningStatePlugin_on_participant_detached(
PRESTypePluginParticipantData participant_data);
NDDSUSERDllExport extern PRESTypePluginEndpointData
WobTuningStatePlugin_on_endpoint_attached(
PRESTypePluginParticipantData participant_data,
const struct PRESTypePluginEndpointInfo *endpoint_info,
RTIBool top_level_registration,
void *container_plugin_context);
NDDSUSERDllExport extern void
WobTuningStatePlugin_on_endpoint_detached(
PRESTypePluginEndpointData endpoint_data);
NDDSUSERDllExport extern void
WobTuningStatePlugin_return_sample(
PRESTypePluginEndpointData endpoint_data,
WobTuningState *sample,
void *handle);
NDDSUSERDllExport extern RTIBool
WobTuningStatePlugin_copy_sample(
PRESTypePluginEndpointData endpoint_data,
WobTuningState *out,
const WobTuningState *in);
/* ----------------------------------------------------------------------------
(De)Serialize functions:
* ------------------------------------------------------------------------- */
NDDSUSERDllExport extern RTIBool
WobTuningStatePlugin_serialize(
PRESTypePluginEndpointData endpoint_data,
const WobTuningState *sample,
struct RTICdrStream *stream,
RTIBool serialize_encapsulation,
RTIEncapsulationId encapsulation_id,
RTIBool serialize_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
WobTuningStatePlugin_deserialize_sample(
PRESTypePluginEndpointData endpoint_data,
WobTuningState *sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
WobTuningStatePlugin_serialize_to_cdr_buffer(
char * buffer,
unsigned int * length,
const WobTuningState *sample);
NDDSUSERDllExport extern RTIBool
WobTuningStatePlugin_deserialize(
PRESTypePluginEndpointData endpoint_data,
WobTuningState **sample,
RTIBool * drop_sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
WobTuningStatePlugin_deserialize_from_cdr_buffer(
WobTuningState *sample,
const char * buffer,
unsigned int length);
NDDSUSERDllExport extern DDS_ReturnCode_t
WobTuningStatePlugin_data_to_string(
const WobTuningState *sample,
char *str,
DDS_UnsignedLong *str_size,
const struct DDS_PrintFormatProperty *property);
NDDSUSERDllExport extern RTIBool
WobTuningStatePlugin_skip(
PRESTypePluginEndpointData endpoint_data,
struct RTICdrStream *stream,
RTIBool skip_encapsulation,
RTIBool skip_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern unsigned int
WobTuningStatePlugin_get_serialized_sample_max_size_ex(
PRESTypePluginEndpointData endpoint_data,
RTIBool * overflow,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern unsigned int
WobTuningStatePlugin_get_serialized_sample_max_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern unsigned int
WobTuningStatePlugin_get_serialized_sample_min_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern unsigned int
WobTuningStatePlugin_get_serialized_sample_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment,
const WobTuningState * sample);
/* --------------------------------------------------------------------------------------
Key Management functions:
* -------------------------------------------------------------------------------------- */
NDDSUSERDllExport extern PRESTypePluginKeyKind
WobTuningStatePlugin_get_key_kind(void);
NDDSUSERDllExport extern unsigned int
WobTuningStatePlugin_get_serialized_key_max_size_ex(
PRESTypePluginEndpointData endpoint_data,
RTIBool * overflow,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern unsigned int
WobTuningStatePlugin_get_serialized_key_max_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern RTIBool
WobTuningStatePlugin_serialize_key(
PRESTypePluginEndpointData endpoint_data,
const WobTuningState *sample,
struct RTICdrStream *stream,
RTIBool serialize_encapsulation,
RTIEncapsulationId encapsulation_id,
RTIBool serialize_key,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
WobTuningStatePlugin_deserialize_key_sample(
PRESTypePluginEndpointData endpoint_data,
WobTuningState * sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
WobTuningStatePlugin_deserialize_key(
PRESTypePluginEndpointData endpoint_data,
WobTuningState ** sample,
RTIBool * drop_sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
WobTuningStatePlugin_serialized_sample_to_key(
PRESTypePluginEndpointData endpoint_data,
WobTuningState *sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos);
/* Plugin Functions */
NDDSUSERDllExport extern struct PRESTypePlugin*
WobTuningStatePlugin_new(void);
NDDSUSERDllExport extern void
WobTuningStatePlugin_delete(struct PRESTypePlugin *);
#define TorqueTuningRequestPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample
#define TorqueTuningRequestPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer
#define TorqueTuningRequestPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer
#define TorqueTuningRequestPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample
#define TorqueTuningRequestPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample
/* --------------------------------------------------------------------------------------
Support functions:
* -------------------------------------------------------------------------------------- */
NDDSUSERDllExport extern TorqueTuningRequest*
TorqueTuningRequestPluginSupport_create_data_w_params(
const struct DDS_TypeAllocationParams_t * alloc_params);
NDDSUSERDllExport extern TorqueTuningRequest*
TorqueTuningRequestPluginSupport_create_data_ex(RTIBool allocate_pointers);
NDDSUSERDllExport extern TorqueTuningRequest*
TorqueTuningRequestPluginSupport_create_data(void);
NDDSUSERDllExport extern RTIBool
TorqueTuningRequestPluginSupport_copy_data(
TorqueTuningRequest *out,
const TorqueTuningRequest *in);
NDDSUSERDllExport extern void
TorqueTuningRequestPluginSupport_destroy_data_w_params(
TorqueTuningRequest *sample,
const struct DDS_TypeDeallocationParams_t * dealloc_params);
NDDSUSERDllExport extern void
TorqueTuningRequestPluginSupport_destroy_data_ex(
TorqueTuningRequest *sample,RTIBool deallocate_pointers);
NDDSUSERDllExport extern void
TorqueTuningRequestPluginSupport_destroy_data(
TorqueTuningRequest *sample);
NDDSUSERDllExport extern void
TorqueTuningRequestPluginSupport_print_data(
const TorqueTuningRequest *sample,
const char *desc,
unsigned int indent);
/* ----------------------------------------------------------------------------
Callback functions:
* ---------------------------------------------------------------------------- */
NDDSUSERDllExport extern PRESTypePluginParticipantData
TorqueTuningRequestPlugin_on_participant_attached(
void *registration_data,
const struct PRESTypePluginParticipantInfo *participant_info,
RTIBool top_level_registration,
void *container_plugin_context,
RTICdrTypeCode *typeCode);
NDDSUSERDllExport extern void
TorqueTuningRequestPlugin_on_participant_detached(
PRESTypePluginParticipantData participant_data);
NDDSUSERDllExport extern PRESTypePluginEndpointData
TorqueTuningRequestPlugin_on_endpoint_attached(
PRESTypePluginParticipantData participant_data,
const struct PRESTypePluginEndpointInfo *endpoint_info,
RTIBool top_level_registration,
void *container_plugin_context);
NDDSUSERDllExport extern void
TorqueTuningRequestPlugin_on_endpoint_detached(
PRESTypePluginEndpointData endpoint_data);
NDDSUSERDllExport extern void
TorqueTuningRequestPlugin_return_sample(
PRESTypePluginEndpointData endpoint_data,
TorqueTuningRequest *sample,
void *handle);
NDDSUSERDllExport extern RTIBool
TorqueTuningRequestPlugin_copy_sample(
PRESTypePluginEndpointData endpoint_data,
TorqueTuningRequest *out,
const TorqueTuningRequest *in);
/* ----------------------------------------------------------------------------
(De)Serialize functions:
* ------------------------------------------------------------------------- */
NDDSUSERDllExport extern RTIBool
TorqueTuningRequestPlugin_serialize(
PRESTypePluginEndpointData endpoint_data,
const TorqueTuningRequest *sample,
struct RTICdrStream *stream,
RTIBool serialize_encapsulation,
RTIEncapsulationId encapsulation_id,
RTIBool serialize_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
TorqueTuningRequestPlugin_deserialize_sample(
PRESTypePluginEndpointData endpoint_data,
TorqueTuningRequest *sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
TorqueTuningRequestPlugin_serialize_to_cdr_buffer(
char * buffer,
unsigned int * length,
const TorqueTuningRequest *sample);
NDDSUSERDllExport extern RTIBool
TorqueTuningRequestPlugin_deserialize(
PRESTypePluginEndpointData endpoint_data,
TorqueTuningRequest **sample,
RTIBool * drop_sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
TorqueTuningRequestPlugin_deserialize_from_cdr_buffer(
TorqueTuningRequest *sample,
const char * buffer,
unsigned int length);
NDDSUSERDllExport extern DDS_ReturnCode_t
TorqueTuningRequestPlugin_data_to_string(
const TorqueTuningRequest *sample,
char *str,
DDS_UnsignedLong *str_size,
const struct DDS_PrintFormatProperty *property);
NDDSUSERDllExport extern RTIBool
TorqueTuningRequestPlugin_skip(
PRESTypePluginEndpointData endpoint_data,
struct RTICdrStream *stream,
RTIBool skip_encapsulation,
RTIBool skip_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern unsigned int
TorqueTuningRequestPlugin_get_serialized_sample_max_size_ex(
PRESTypePluginEndpointData endpoint_data,
RTIBool * overflow,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern unsigned int
TorqueTuningRequestPlugin_get_serialized_sample_max_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern unsigned int
TorqueTuningRequestPlugin_get_serialized_sample_min_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern unsigned int
TorqueTuningRequestPlugin_get_serialized_sample_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment,
const TorqueTuningRequest * sample);
/* --------------------------------------------------------------------------------------
Key Management functions:
* -------------------------------------------------------------------------------------- */
NDDSUSERDllExport extern PRESTypePluginKeyKind
TorqueTuningRequestPlugin_get_key_kind(void);
NDDSUSERDllExport extern unsigned int
TorqueTuningRequestPlugin_get_serialized_key_max_size_ex(
PRESTypePluginEndpointData endpoint_data,
RTIBool * overflow,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern unsigned int
TorqueTuningRequestPlugin_get_serialized_key_max_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern RTIBool
TorqueTuningRequestPlugin_serialize_key(
PRESTypePluginEndpointData endpoint_data,
const TorqueTuningRequest *sample,
struct RTICdrStream *stream,
RTIBool serialize_encapsulation,
RTIEncapsulationId encapsulation_id,
RTIBool serialize_key,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
TorqueTuningRequestPlugin_deserialize_key_sample(
PRESTypePluginEndpointData endpoint_data,
TorqueTuningRequest * sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
TorqueTuningRequestPlugin_deserialize_key(
PRESTypePluginEndpointData endpoint_data,
TorqueTuningRequest ** sample,
RTIBool * drop_sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
TorqueTuningRequestPlugin_serialized_sample_to_key(
PRESTypePluginEndpointData endpoint_data,
TorqueTuningRequest *sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos);
/* Plugin Functions */
NDDSUSERDllExport extern struct PRESTypePlugin*
TorqueTuningRequestPlugin_new(void);
NDDSUSERDllExport extern void
TorqueTuningRequestPlugin_delete(struct PRESTypePlugin *);
#define TorqueTuningStatePlugin_get_sample PRESTypePluginDefaultEndpointData_getSample
#define TorqueTuningStatePlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer
#define TorqueTuningStatePlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer
#define TorqueTuningStatePlugin_create_sample PRESTypePluginDefaultEndpointData_createSample
#define TorqueTuningStatePlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample
/* --------------------------------------------------------------------------------------
Support functions:
* -------------------------------------------------------------------------------------- */
NDDSUSERDllExport extern TorqueTuningState*
TorqueTuningStatePluginSupport_create_data_w_params(
const struct DDS_TypeAllocationParams_t * alloc_params);
NDDSUSERDllExport extern TorqueTuningState*
TorqueTuningStatePluginSupport_create_data_ex(RTIBool allocate_pointers);
NDDSUSERDllExport extern TorqueTuningState*
TorqueTuningStatePluginSupport_create_data(void);
NDDSUSERDllExport extern RTIBool
TorqueTuningStatePluginSupport_copy_data(
TorqueTuningState *out,
const TorqueTuningState *in);
NDDSUSERDllExport extern void
TorqueTuningStatePluginSupport_destroy_data_w_params(
TorqueTuningState *sample,
const struct DDS_TypeDeallocationParams_t * dealloc_params);
NDDSUSERDllExport extern void
TorqueTuningStatePluginSupport_destroy_data_ex(
TorqueTuningState *sample,RTIBool deallocate_pointers);
NDDSUSERDllExport extern void
TorqueTuningStatePluginSupport_destroy_data(
TorqueTuningState *sample);
NDDSUSERDllExport extern void
TorqueTuningStatePluginSupport_print_data(
const TorqueTuningState *sample,
const char *desc,
unsigned int indent);
/* ----------------------------------------------------------------------------
Callback functions:
* ---------------------------------------------------------------------------- */
NDDSUSERDllExport extern PRESTypePluginParticipantData
TorqueTuningStatePlugin_on_participant_attached(
void *registration_data,
const struct PRESTypePluginParticipantInfo *participant_info,
RTIBool top_level_registration,
void *container_plugin_context,
RTICdrTypeCode *typeCode);
NDDSUSERDllExport extern void
TorqueTuningStatePlugin_on_participant_detached(
PRESTypePluginParticipantData participant_data);
NDDSUSERDllExport extern PRESTypePluginEndpointData
TorqueTuningStatePlugin_on_endpoint_attached(
PRESTypePluginParticipantData participant_data,
const struct PRESTypePluginEndpointInfo *endpoint_info,
RTIBool top_level_registration,
void *container_plugin_context);
NDDSUSERDllExport extern void
TorqueTuningStatePlugin_on_endpoint_detached(
PRESTypePluginEndpointData endpoint_data);
NDDSUSERDllExport extern void
TorqueTuningStatePlugin_return_sample(
PRESTypePluginEndpointData endpoint_data,
TorqueTuningState *sample,
void *handle);
NDDSUSERDllExport extern RTIBool
TorqueTuningStatePlugin_copy_sample(
PRESTypePluginEndpointData endpoint_data,
TorqueTuningState *out,
const TorqueTuningState *in);
/* ----------------------------------------------------------------------------
(De)Serialize functions:
* ------------------------------------------------------------------------- */
NDDSUSERDllExport extern RTIBool
TorqueTuningStatePlugin_serialize(
PRESTypePluginEndpointData endpoint_data,
const TorqueTuningState *sample,
struct RTICdrStream *stream,
RTIBool serialize_encapsulation,
RTIEncapsulationId encapsulation_id,
RTIBool serialize_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
TorqueTuningStatePlugin_deserialize_sample(
PRESTypePluginEndpointData endpoint_data,
TorqueTuningState *sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
TorqueTuningStatePlugin_serialize_to_cdr_buffer(
char * buffer,
unsigned int * length,
const TorqueTuningState *sample);
NDDSUSERDllExport extern RTIBool
TorqueTuningStatePlugin_deserialize(
PRESTypePluginEndpointData endpoint_data,
TorqueTuningState **sample,
RTIBool * drop_sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
TorqueTuningStatePlugin_deserialize_from_cdr_buffer(
TorqueTuningState *sample,
const char * buffer,
unsigned int length);
NDDSUSERDllExport extern DDS_ReturnCode_t
TorqueTuningStatePlugin_data_to_string(
const TorqueTuningState *sample,
char *str,
DDS_UnsignedLong *str_size,
const struct DDS_PrintFormatProperty *property);
NDDSUSERDllExport extern RTIBool
TorqueTuningStatePlugin_skip(
PRESTypePluginEndpointData endpoint_data,
struct RTICdrStream *stream,
RTIBool skip_encapsulation,
RTIBool skip_sample,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern unsigned int
TorqueTuningStatePlugin_get_serialized_sample_max_size_ex(
PRESTypePluginEndpointData endpoint_data,
RTIBool * overflow,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern unsigned int
TorqueTuningStatePlugin_get_serialized_sample_max_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern unsigned int
TorqueTuningStatePlugin_get_serialized_sample_min_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern unsigned int
TorqueTuningStatePlugin_get_serialized_sample_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment,
const TorqueTuningState * sample);
/* --------------------------------------------------------------------------------------
Key Management functions:
* -------------------------------------------------------------------------------------- */
NDDSUSERDllExport extern PRESTypePluginKeyKind
TorqueTuningStatePlugin_get_key_kind(void);
NDDSUSERDllExport extern unsigned int
TorqueTuningStatePlugin_get_serialized_key_max_size_ex(
PRESTypePluginEndpointData endpoint_data,
RTIBool * overflow,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern unsigned int
TorqueTuningStatePlugin_get_serialized_key_max_size(
PRESTypePluginEndpointData endpoint_data,
RTIBool include_encapsulation,
RTIEncapsulationId encapsulation_id,
unsigned int current_alignment);
NDDSUSERDllExport extern RTIBool
TorqueTuningStatePlugin_serialize_key(
PRESTypePluginEndpointData endpoint_data,
const TorqueTuningState *sample,
struct RTICdrStream *stream,
RTIBool serialize_encapsulation,
RTIEncapsulationId encapsulation_id,
RTIBool serialize_key,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
TorqueTuningStatePlugin_deserialize_key_sample(
PRESTypePluginEndpointData endpoint_data,
TorqueTuningState * sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
TorqueTuningStatePlugin_deserialize_key(
PRESTypePluginEndpointData endpoint_data,
TorqueTuningState ** sample,
RTIBool * drop_sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos);
NDDSUSERDllExport extern RTIBool
TorqueTuningStatePlugin_serialized_sample_to_key(
PRESTypePluginEndpointData endpoint_data,
TorqueTuningState *sample,
struct RTICdrStream *stream,
RTIBool deserialize_encapsulation,
RTIBool deserialize_key,
void *endpoint_plugin_qos);
/* Plugin Functions */
NDDSUSERDllExport extern struct PRESTypePlugin*
TorqueTuningStatePlugin_new(void);
NDDSUSERDllExport extern void
TorqueTuningStatePlugin_delete(struct PRESTypePlugin *);
} /* namespace AutoTunerConfiguration */
#if (defined(RTI_WIN32) || defined (RTI_WINCE)) && defined(NDDS_USER_DLL_EXPORT)
/* If the code is building on Windows, stop exporting symbols.
*/
#undef NDDSUSERDllExport
#define NDDSUSERDllExport
#endif
#endif /* autotuner_configurationPlugin_985793370_h */
|
0571ee125243f655cf0e030138518928ae2757eb | 8a5d84a7ef3b6ce37505b7d154878dfb55841ed0 | /field.cpp | 279d1ec713909661eeda018534dcc1d33e24cad9 | [] | no_license | llislex/life_game | a262a65334fda3d883847069cd83852238d8ff81 | 3e2e9082174ed51c5a7f33e2cbfbe3dfd6d0102f | refs/heads/master | 2021-05-20T18:58:55.901014 | 2020-04-02T07:14:00 | 2020-04-02T07:14:00 | 252,381,557 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 333 | cpp | field.cpp | #include "field.h"
#include <QtGui/QPainter>
LifeField::LifeField(QWidget *parent) :
QWidget(parent), m_life(0)
{
}
void LifeField::paintEvent(QPaintEvent*)
{
if(m_life)
{
QPainter painter(this);
QImage img = m_life->field();
painter.drawImage(rect(), img, img.rect());
}
}
|
d96b995a430e6e7f8ad7e341b55429ef62c5c998 | 6f50cc6d20ca8ee6664ddff005a595732eab88f4 | /src/node/network_tables.h | 9785592a6c231b212c96fbbae8aa9cb363cebdca | [
"Apache-2.0"
] | permissive | Saiprasad16/CCF | 032fccd9270f8aa0327f2a229185fe71ca822db3 | 9db09d03d77b3e006307f516df07d056e9a462f5 | refs/heads/main | 2023-04-26T23:38:27.109892 | 2021-05-07T17:06:12 | 2021-05-07T17:06:12 | 365,998,998 | 1 | 0 | Apache-2.0 | 2021-05-10T10:16:24 | 2021-05-10T10:10:20 | null | UTF-8 | C++ | false | false | 4,163 | h | network_tables.h | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the Apache 2.0 License.
#pragma once
#include "backup_signatures.h"
#include "certs.h"
#include "client_signatures.h"
#include "code_id.h"
#include "config.h"
#include "consensus/aft/raft_tables.h"
#include "consensus/aft/request.h"
#include "consensus/aft/revealed_nonces.h"
#include "constitution.h"
#include "entities.h"
#include "governance_history.h"
#include "jwt.h"
#include "kv/store.h"
#include "members.h"
#include "modules.h"
#include "nodes.h"
#include "proposals.h"
#include "scripts.h"
#include "secrets.h"
#include "service.h"
#include "service_map.h"
#include "shares.h"
#include "signatures.h"
#include "snapshot_evidence.h"
#include "submitted_shares.h"
#include "users.h"
#include "values.h"
#include <memory>
#include <tuple>
namespace ccf
{
inline std::shared_ptr<kv::Store> make_store(
const ConsensusType& consensus_type)
{
if (consensus_type == ConsensusType::CFT)
{
return std::make_shared<kv::Store>(
aft::replicate_type_raft, aft::replicated_tables_raft);
}
else
{
return std::make_shared<kv::Store>(
aft::replicate_type_bft, aft::replicated_tables_bft);
}
}
struct NetworkTables
{
std::shared_ptr<kv::Store> tables;
//
// Governance tables
//
MemberCerts member_certs;
MmeberPublicEncryptionKeys member_encryption_public_keys;
MemberInfo member_info;
Modules modules;
CodeIDs node_code_ids;
MemberAcks member_acks;
GovernanceHistory governance_history;
RecoveryShares shares;
EncryptedLedgerSecretsInfo encrypted_ledger_secrets;
SubmittedShares submitted_shares;
Configuration config;
CACertBundlePEMs ca_cert_bundles;
JwtIssuers jwt_issuers;
JwtPublicSigningKeys jwt_public_signing_keys;
JwtPublicSigningKeyIssuer jwt_public_signing_key_issuer;
//
// User tables
//
UserCerts user_certs;
UserInfo user_info;
//
// Node table
//
Nodes nodes;
//
// Internal CCF tables
//
Service service;
Values values;
Secrets secrets;
SnapshotEvidence snapshot_evidence;
// The signatures and serialised_tree tables should always be written to at
// the same time so that the root of the tree in the signatures table
// matches the serialised Merkle tree.
Signatures signatures;
SerialisedMerkleTree serialise_tree;
//
// bft related tables
//
aft::RequestsMap bft_requests_map;
BackupSignaturesMap backup_signatures_map;
aft::RevealedNoncesMap revealed_nonces_map;
NewViewsMap new_views_map;
// JS Constitution
Constitution constitution;
NetworkTables(const ConsensusType& consensus_type = ConsensusType::CFT) :
tables(make_store(consensus_type)),
member_certs(Tables::MEMBER_CERTS),
member_encryption_public_keys(Tables::MEMBER_ENCRYPTION_PUBLIC_KEYS),
member_info(Tables::MEMBER_INFO),
modules(Tables::MODULES),
node_code_ids(Tables::NODE_CODE_IDS),
member_acks(Tables::MEMBER_ACKS),
governance_history(Tables::GOV_HISTORY),
shares(Tables::SHARES),
encrypted_ledger_secrets(Tables::ENCRYPTED_PAST_LEDGER_SECRET),
submitted_shares(Tables::SUBMITTED_SHARES),
config(Tables::CONFIGURATION),
ca_cert_bundles(Tables::CA_CERT_BUNDLE_PEMS),
jwt_issuers(Tables::JWT_ISSUERS),
jwt_public_signing_keys(Tables::JWT_PUBLIC_SIGNING_KEYS),
jwt_public_signing_key_issuer(Tables::JWT_PUBLIC_SIGNING_KEY_ISSUER),
user_certs(Tables::USER_CERTS),
user_info(Tables::USER_INFO),
nodes(Tables::NODES),
service(Tables::SERVICE),
values(Tables::VALUES),
secrets(Tables::ENCRYPTED_LEDGER_SECRETS),
snapshot_evidence(Tables::SNAPSHOT_EVIDENCE),
signatures(Tables::SIGNATURES),
serialise_tree(Tables::SERIALISED_MERKLE_TREE),
bft_requests_map(Tables::AFT_REQUESTS),
backup_signatures_map(Tables::BACKUP_SIGNATURES),
revealed_nonces_map(Tables::NONCES),
new_views_map(Tables::NEW_VIEWS),
constitution(Tables::CONSTITUTION)
{}
};
} |
855cb12e829384ffd5e3ceaf377ddd9d4ec0017f | 2f3bdbb4ec4e382a320a460aab6275bb61b3b31b | /Source/Shared/Source/AI/AIHordelingTypeComponent.cpp | eff93834b6d0f8d94c628b683e2d301b495d6330 | [] | no_license | jjzhang166/Ursine3D | b23e88e87f6513d41968638c17412d2aab59484e | c5a806a7623bcd3c7a16dcd6b40033c2f912aad6 | refs/heads/master | 2023-03-22T18:25:51.138505 | 2018-05-17T01:21:47 | 2018-05-17T01:21:47 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 736 | cpp | AIHordelingTypeComponent.cpp | #include "Precompiled.h"
//#include "Entity.h"
#include "AIHordelingTypeComponent.h"
namespace ursine
{
namespace ecs
{
NATIVE_COMPONENT_DEFINITION(AIHordelingType);
AIHordelingType::AIHordelingType(void)
: BaseComponent()
, m_type(HordelingTypeID::INVALID_TYPE)
{
}
AIHordelingType::AIHordelingType(HordelingTypeID type)
: BaseComponent()
, m_type(type)
{
}
AIHordelingType::HordelingTypeID AIHordelingType::GetHordelingID() const
{
return m_type;
}
void AIHordelingType::SetHordelingID(HordelingTypeID type)
{
m_type = type;
}
}
}
|
01d9020907c984a826b83b238dcc2ff0252c2f15 | 1e0f12cd4c682f5f50e34e827bbe2cded0c725d5 | /10829.cpp | fb0160fdc3c6bc36a846d2bd7482b7c788e6fa7e | [] | no_license | kyun2024/ProgramSolve | 4f11d5ff67c799e867b6462c4da35edcca9a9d9d | ba2f8fdbe8342dd99de49cd00fd538075849dc53 | refs/heads/master | 2023-08-21T18:11:27.161772 | 2023-08-09T11:23:43 | 2023-08-09T11:23:43 | 209,213,217 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 280 | cpp | 10829.cpp | #include <iostream>
#include <stack>
using namespace std;
stack<int> s;
int main(){
long long n;
cin >> n;
while(n){
s.push((n&1));
n>>=1;
}
while(!s.empty()){
cout << s.top();
s.pop();
}
cout << endl;
return 0;
} |
b1d2f2a4316570bedd9ab11afc313ee3819b564b | 3c1bf8adcfa75f62cec3ced9c8a4bdf108526d78 | /Graph/7. Bipartite Checking using BFS.cpp | 7774ecb25170834542a85373175fd6d862970a20 | [] | no_license | shrayansh95/Data-Strunctures-And-Algorithms | dad330c172d3d02bf6d830048228c6f28cd7290b | 3044f1e0babde2182cdc1c0162b58b0cf55ec51a | refs/heads/master | 2023-06-19T00:30:56.497679 | 2021-07-21T11:44:08 | 2021-07-21T11:44:08 | 371,878,208 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 868 | cpp | 7. Bipartite Checking using BFS.cpp | #include<bits/stdc++.h>
using namespace std;
bool bfs(int i, vector<int> adj[], vector<int>& color) {
color[i] = 0;
queue<int> q;
q.push(i);
while (!q.empty()) {
int node = q.front();
q.pop();
for (int it : adj[node]) {
if (color[it] == -1) {
color[it] = color[node] ^ 1;
q.push(it);
} else if (color[it] == color[node]) {
return false;
}
}
}
return true;
}
bool isBipartite(int n, vector<int> adj[]) {
vector<int> color(n + 1, -1);
for (int i = 1; i <= n; i++) {
if (color[i] == -1) {
bool ok = bfs(i, adj, color);
if (!ok)
return false;
}
}
return true;
}
int main() {
int n, m;
cin >> n >> m;
vector<int> adj[n + 1];
int u, v;
for (int i = 0; i < m; i++) {
cin >> u >> v;
adj[u].push_back(v);
adj[v].push_back(u);
}
if (isBipartite(n, adj))
cout << "YES\n";
else
cout << "NO\n";
return 0;
} |
4be499833c38331c54565deb6979fedae781676b | 7c07918c82e76d86268fd873de723b3773f847b7 | /letterGrade.cpp | 0c4d05e6c5481d3769271b538bdfe8c52cb8e320 | [] | no_license | jonmancia/C-plus-plus | 2e5dd61c80d3bf9cbf7b6dd651d75de94b1fb85d | 4e57550b1615c87349c9d0fab020dba4b8b1876f | refs/heads/master | 2021-01-21T11:37:48.614597 | 2017-07-08T00:39:36 | 2017-07-08T00:39:36 | 91,749,411 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 508 | cpp | letterGrade.cpp | #include <iostream>
using namespace std;
char getGrade();
int main()
{
char grade = getGrade();
cout << "You grade is " << grade;
return 0;
}
char getGrade()
{
char grade;
cout << "Please enter your letter grade: ";
cin >> grade;
grade = toupper(grade);
while (grade != 'A' && grade != 'B' && grade != 'C' && grade != 'D' && grade != 'F')
{
cout << "Invalid grade. Please enter a letter grade {A,B,C,D,F}";
cin >> grade;
grade = toupper(grade);
}
return grade;
} |
d8d6620000e88a7a60d3d55a04053d2d8093356a | 6b40e9dccf2edc767c44df3acd9b626fcd586b4d | /NT/inetcore/outlookexpress/inetcomm/dll/factory.cpp | e090faa4993b869fde85b88298dfa94753f33576 | [] | no_license | jjzhang166/WinNT5_src_20201004 | 712894fcf94fb82c49e5cd09d719da00740e0436 | b2db264153b80fbb91ef5fc9f57b387e223dbfc2 | refs/heads/Win2K3 | 2023-08-12T01:31:59.670176 | 2021-10-14T15:14:37 | 2021-10-14T15:14:37 | 586,134,273 | 1 | 0 | null | 2023-01-07T03:47:45 | 2023-01-07T03:47:44 | null | UTF-8 | C++ | false | false | 23,901 | cpp | factory.cpp | // --------------------------------------------------------------------------------
// Factory.cpp
// Copyright (c)1993-1995 Microsoft Corporation, All Rights Reserved
// Steven J. Bailey
// --------------------------------------------------------------------------------
#include "pch.hxx"
#include "dllmain.h"
#include "factory.h"
#include "ixppop3.h"
#include "ixpsmtp.h"
#include "ixpnntp.h"
#include "ixphttpm.h"
#include "ixpras.h"
#include "imap4.h"
#include "range.h"
#include "olealloc.h"
#include "smime.h"
#include "vstream.h"
#include "icoint.h"
#include "internat.h"
#include "partial.h"
#include "docobj.h"
#include "doc.h"
#include "hash.h"
#include "fontcash.h"
#include "propfind.h"
// --------------------------------------------------------------------------------
// Pretty
// --------------------------------------------------------------------------------
#define OBJTYPE0 0
#define OBJTYPE1 OIF_ALLOWAGGREGATION
// --------------------------------------------------------------------------------
// Global Object Info Table
// --------------------------------------------------------------------------------
static CClassFactory g_rgFactory[] = {
CClassFactory(&CLSID_IMimePropertySet, OBJTYPE1, (PFCREATEINSTANCE)WebBookContentBody_CreateInstance),
CClassFactory(&CLSID_IMimeBody, OBJTYPE1, (PFCREATEINSTANCE)WebBookContentBody_CreateInstance),
CClassFactory(&CLSID_IMimeBodyW, OBJTYPE1, (PFCREATEINSTANCE)WebBookContentBody_CreateInstance),
CClassFactory(&CLSID_IMimeMessageTree, OBJTYPE1, (PFCREATEINSTANCE)WebBookContentTree_CreateInstance),
CClassFactory(&CLSID_IMimeMessage, OBJTYPE1, (PFCREATEINSTANCE)WebBookContentTree_CreateInstance),
CClassFactory(&CLSID_IMimeMessageW, OBJTYPE1, (PFCREATEINSTANCE)WebBookContentTree_CreateInstance),
CClassFactory(&CLSID_IMimeAllocator, OBJTYPE0, (PFCREATEINSTANCE)IMimeAllocator_CreateInstance),
CClassFactory(&CLSID_IMimeSecurity, OBJTYPE0, (PFCREATEINSTANCE)IMimeSecurity_CreateInstance),
CClassFactory(&CLSID_IMimeMessageParts, OBJTYPE0, (PFCREATEINSTANCE)IMimeMessageParts_CreateInstance),
CClassFactory(&CLSID_IMimeInternational, OBJTYPE0, (PFCREATEINSTANCE)IMimeInternational_CreateInstance),
CClassFactory(&CLSID_IMimeHeaderTable, OBJTYPE0, (PFCREATEINSTANCE)IMimeHeaderTable_CreateInstance),
CClassFactory(&CLSID_IMimePropertySchema, OBJTYPE0, (PFCREATEINSTANCE)IMimePropertySchema_CreateInstance),
CClassFactory(&CLSID_IVirtualStream, OBJTYPE0, (PFCREATEINSTANCE)IVirtualStream_CreateInstance),
CClassFactory(&CLSID_IMimeHtmlProtocol, OBJTYPE1, (PFCREATEINSTANCE)IMimeHtmlProtocol_CreateInstance),
CClassFactory(&CLSID_ISMTPTransport, OBJTYPE0, (PFCREATEINSTANCE)ISMTPTransport_CreateInstance),
CClassFactory(&CLSID_IPOP3Transport, OBJTYPE0, (PFCREATEINSTANCE)IPOP3Transport_CreateInstance),
CClassFactory(&CLSID_INNTPTransport, OBJTYPE0, (PFCREATEINSTANCE)INNTPTransport_CreateInstance),
CClassFactory(&CLSID_IRASTransport, OBJTYPE0, (PFCREATEINSTANCE)IRASTransport_CreateInstance),
CClassFactory(&CLSID_IIMAPTransport, OBJTYPE0, (PFCREATEINSTANCE)IIMAPTransport_CreateInstance),
CClassFactory(&CLSID_IRangeList, OBJTYPE0, (PFCREATEINSTANCE)IRangeList_CreateInstance),
CClassFactory(&CLSID_MimeEdit, OBJTYPE1, (PFCREATEINSTANCE)MimeEdit_CreateInstance),
CClassFactory(&CLSID_IHashTable, OBJTYPE0, (PFCREATEINSTANCE)IHashTable_CreateInstance),
CClassFactory(&CLSID_IFontCache, OBJTYPE1, (PFCREATEINSTANCE)CFontCache::CreateInstance),
#ifndef NOHTTPMAIL
CClassFactory(&CLSID_IHTTPMailTransport, OBJTYPE0, (PFCREATEINSTANCE)IHTTPMailTransport_CreateInstance),
CClassFactory(&CLSID_IPropFindRequest, OBJTYPE0, (PFCREATEINSTANCE)IPropFindRequest_CreateInstance),
CClassFactory(&CLSID_IPropPatchRequest, OBJTYPE0, (PFCREATEINSTANCE)IPropPatchRequest_CreateInstance),
#endif
};
// --------------------------------------------------------------------------------
// DllGetClassObject
// --------------------------------------------------------------------------------
STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
{
// Locals
HRESULT hr=S_OK;
ULONG i;
// Bad param
if (ppv == NULL)
{
hr = TrapError(E_INVALIDARG);
goto exit;
}
// No memory allocator
if (NULL == g_pMalloc)
{
hr = TrapError(E_OUTOFMEMORY);
goto exit;
}
// Find Object Class
for (i=0; i<ARRAYSIZE(g_rgFactory); i++)
{
// Compare for clsids
if (IsEqualCLSID(rclsid, *g_rgFactory[i].m_pclsid))
{
// Delegate to the factory
CHECKHR(hr = g_rgFactory[i].QueryInterface(riid, ppv));
// Done
goto exit;
}
}
// Otherwise, no class
hr = TrapError(CLASS_E_CLASSNOTAVAILABLE);
exit:
// Done
return hr;
}
// --------------------------------------------------------------------------------
// CClassFactory::CClassFactory
// --------------------------------------------------------------------------------
CClassFactory::CClassFactory(CLSID const *pclsid, DWORD dwFlags, PFCREATEINSTANCE pfCreateInstance)
: m_pclsid(pclsid), m_dwFlags(dwFlags), m_pfCreateInstance(pfCreateInstance)
{
}
// --------------------------------------------------------------------------------
// CClassFactory::QueryInterface
// --------------------------------------------------------------------------------
STDMETHODIMP CClassFactory::QueryInterface(REFIID riid, void **ppvObj)
{
// Invalid Arg
if (NULL == ppvObj)
return TrapError(E_INVALIDARG);
// IClassFactory or IUnknown
if (!IsEqualIID(riid, IID_IClassFactory) && !IsEqualIID(riid, IID_IUnknown))
return TrapError(E_NOINTERFACE);
// Return the Class Facotry
*ppvObj = (LPVOID)this;
// Add Ref the dll
DllAddRef();
// Done
return S_OK;
}
// --------------------------------------------------------------------------------
// CClassFactory::AddRef
// --------------------------------------------------------------------------------
STDMETHODIMP_(ULONG) CClassFactory::AddRef(void)
{
DllAddRef();
return 2;
}
// --------------------------------------------------------------------------------
// CClassFactory::Release
// --------------------------------------------------------------------------------
STDMETHODIMP_(ULONG) CClassFactory::Release(void)
{
DllRelease();
return 1;
}
// --------------------------------------------------------------------------------
// CClassFactory::CreateInstance
// --------------------------------------------------------------------------------
STDMETHODIMP CClassFactory::CreateInstance(IUnknown *pUnkOuter, REFIID riid, void **ppvObj)
{
// Locals
HRESULT hr=S_OK;
IUnknown *pObject=NULL;
// Bad param
if (ppvObj == NULL)
return TrapError(E_INVALIDARG);
// Init
*ppvObj = NULL;
// Verify that a controlling unknown asks for IUnknown
if (NULL != pUnkOuter && IID_IUnknown != riid)
return TrapError(CLASS_E_NOAGGREGATION);
// No memory allocator
if (NULL == g_pMalloc)
return TrapError(E_OUTOFMEMORY);
// Can I do aggregaton
if (pUnkOuter !=NULL && !(m_dwFlags & OIF_ALLOWAGGREGATION))
return TrapError(CLASS_E_NOAGGREGATION);
// Create the object...
CHECKHR(hr = CreateObjectInstance(pUnkOuter, &pObject));
// Aggregated, then we know we're looking for an IUnknown, return pObject, otherwise, QI
if (pUnkOuter)
{
// Matches Release after Exit
pObject->AddRef();
// Return pObject::IUnknown
*ppvObj = (LPVOID)pObject;
}
// Otherwise
else
{
// Get the interface requested from pObj
CHECKHR(hr = pObject->QueryInterface(riid, ppvObj));
}
exit:
// Cleanup
SafeRelease(pObject);
// Done
Assert(FAILED(hr) ? NULL == *ppvObj : TRUE);
return hr;
}
// --------------------------------------------------------------------------------
// CClassFactory::LockServer
// --------------------------------------------------------------------------------
STDMETHODIMP CClassFactory::LockServer(BOOL fLock)
{
if (fLock) InterlockedIncrement(&g_cLock);
else InterlockedDecrement(&g_cLock);
return NOERROR;
}
// --------------------------------------------------------------------------------
// CreateRASTransport
// --------------------------------------------------------------------------------
IMNXPORTAPI CreateRASTransport(
/* out */ IRASTransport **ppTransport)
{
// check params
if (NULL == ppTransport)
return TrapError(E_INVALIDARG);
// Create the object
*ppTransport = new CRASTransport();
if (NULL == *ppTransport)
return TrapError(E_OUTOFMEMORY);
// Done
return S_OK;
}
// --------------------------------------------------------------------------------
// CreateNNTPTransport
// --------------------------------------------------------------------------------
IMNXPORTAPI CreateNNTPTransport(
/* out */ INNTPTransport **ppTransport)
{
// check params
if (NULL == ppTransport)
return TrapError(E_INVALIDARG);
// Create the object
*ppTransport = new CNNTPTransport();
if (NULL == *ppTransport)
return TrapError(E_OUTOFMEMORY);
// Done
return S_OK;
}
// --------------------------------------------------------------------------------
// CreateSMTPTransport
// --------------------------------------------------------------------------------
IMNXPORTAPI CreateSMTPTransport(
/* out */ ISMTPTransport **ppTransport)
{
// check params
if (NULL == ppTransport)
return TrapError(E_INVALIDARG);
// Create the object
*ppTransport = new CSMTPTransport();
if (NULL == *ppTransport)
return TrapError(E_OUTOFMEMORY);
// Done
return S_OK;
}
// --------------------------------------------------------------------------------
// CreatePOP3Transport
// --------------------------------------------------------------------------------
IMNXPORTAPI CreatePOP3Transport(
/* out */ IPOP3Transport **ppTransport)
{
// check params
if (NULL == ppTransport)
return TrapError(E_INVALIDARG);
// Create the object
*ppTransport = new CPOP3Transport();
if (NULL == *ppTransport)
return TrapError(E_OUTOFMEMORY);
// Done
return S_OK;
}
// --------------------------------------------------------------------------------
// CreateIMAPTransport
// --------------------------------------------------------------------------------
IMNXPORTAPI CreateIMAPTransport(
/* out */ IIMAPTransport **ppTransport)
{
// check params
if (NULL == ppTransport)
return TrapError(E_INVALIDARG);
// Create the object
*ppTransport = (IIMAPTransport *) new CImap4Agent();
if (NULL == *ppTransport)
return TrapError(E_OUTOFMEMORY);
// Done
return S_OK;
}
// --------------------------------------------------------------------------------
// CreateIMAPTransport2
// --------------------------------------------------------------------------------
IMNXPORTAPI CreateIMAPTransport2(
/* out */ IIMAPTransport2 **ppTransport)
{
// check params
if (NULL == ppTransport)
return TrapError(E_INVALIDARG);
// Create the object
*ppTransport = (IIMAPTransport2 *) new CImap4Agent();
if (NULL == *ppTransport)
return TrapError(E_OUTOFMEMORY);
// Done
return S_OK;
}
// --------------------------------------------------------------------------------
// CreateRangeList
// --------------------------------------------------------------------------------
IMNXPORTAPI CreateRangeList(
/* out */ IRangeList **ppRangeList)
{
// check params
if (NULL == ppRangeList)
return TrapError(E_INVALIDARG);
// Create the object
*ppRangeList = (IRangeList *) new CRangeList();
if (NULL == *ppRangeList)
return TrapError(E_OUTOFMEMORY);
// Done
return S_OK;
}
// --------------------------------------------------------------------------------
// IMimeAllocator_CreateInstance
// --------------------------------------------------------------------------------
HRESULT IMimeAllocator_CreateInstance(IUnknown* pUnkOuter, IUnknown** ppUnknown)
{
// Invalid Arg
Assert(ppUnknown);
// Initialize
*ppUnknown = NULL;
// Create me
CMimeAllocator *pNew = new CMimeAllocator();
if (NULL == pNew)
return TrapError(E_OUTOFMEMORY);
// Cast to unknown
*ppUnknown = SAFECAST(pNew, IMimeAllocator *);
// Done
return S_OK;
}
// --------------------------------------------------------------------------------
// IMimeSecurity_CreateInstance
// --------------------------------------------------------------------------------
HRESULT IMimeSecurity_CreateInstance(IUnknown* pUnkOuter, IUnknown** ppUnknown)
{
// Invalid Arg
Assert(ppUnknown);
// Initialize
*ppUnknown = NULL;
// Create me
CSMime *pNew = new CSMime();
if (NULL == pNew)
return TrapError(E_OUTOFMEMORY);
// Cast to unknown
*ppUnknown = SAFECAST(pNew, IMimeSecurity *);
// Done
return S_OK;
}
// --------------------------------------------------------------------------------
// IMimePropertySchema_CreateInstance
// --------------------------------------------------------------------------------
HRESULT IMimePropertySchema_CreateInstance(IUnknown* pUnkOuter, IUnknown** ppUnknown)
{
// Invalid Arg
Assert(ppUnknown);
// Initialize
*ppUnknown = NULL;
// Out of memory
if (NULL == g_pSymCache)
return TrapError(E_OUTOFMEMORY);
// Create me
*ppUnknown = ((IUnknown *)((IMimePropertySchema *)g_pSymCache));
// Increase RefCount
(*ppUnknown)->AddRef();
// Done
return S_OK;
}
// --------------------------------------------------------------------------------
// IMimeInternational_CreateInstance
// --------------------------------------------------------------------------------
HRESULT IMimeInternational_CreateInstance(IUnknown* pUnkOuter, IUnknown** ppUnknown)
{
// Invalid Arg
Assert(ppUnknown);
// Initialize
*ppUnknown = NULL;
// Outof memory
if (NULL == g_pInternat)
return TrapError(E_OUTOFMEMORY);
// Assign It
*ppUnknown = ((IUnknown *)((IMimeInternational *)g_pInternat));
// Increase RefCount
(*ppUnknown)->AddRef();
// Done
return S_OK;
}
// --------------------------------------------------------------------------------
// ISMTPTransport_CreateInstance
// --------------------------------------------------------------------------------
HRESULT ISMTPTransport_CreateInstance(IUnknown* pUnkOuter, IUnknown** ppUnknown)
{
// Invalid Arg
Assert(ppUnknown);
// Initialize
*ppUnknown = NULL;
// Create me
CSMTPTransport *pNew = new CSMTPTransport();
if (NULL == pNew)
return TrapError(E_OUTOFMEMORY);
// Cast to unknown
*ppUnknown = SAFECAST(pNew, ISMTPTransport *);
// Done
return S_OK;
}
// --------------------------------------------------------------------------------
// IPOP3Transport_CreateInstance
// --------------------------------------------------------------------------------
HRESULT IPOP3Transport_CreateInstance(IUnknown* pUnkOuter, IUnknown** ppUnknown)
{
// Invalid Arg
Assert(ppUnknown);
// Initialize
*ppUnknown = NULL;
// Create me
CPOP3Transport *pNew = new CPOP3Transport();
if (NULL == pNew)
return TrapError(E_OUTOFMEMORY);
// Cast to unknown
*ppUnknown = SAFECAST(pNew, IPOP3Transport *);
// Done
return S_OK;
}
#ifndef NOHTTPMAIL
// --------------------------------------------------------------------------------
// IHTTPMailTransport_CreateInstance
// --------------------------------------------------------------------------------
HRESULT IHTTPMailTransport_CreateInstance(IUnknown* pUnkOuter, IUnknown** ppUnknown)
{
// Invalid Arg
Assert(ppUnknown);
// Initialize
*ppUnknown = NULL;
// Create me
CHTTPMailTransport *pNew = new CHTTPMailTransport();
if (NULL == pNew)
return TrapError(E_OUTOFMEMORY);
// Cast to unknown
*ppUnknown = SAFECAST(pNew, IHTTPMailTransport *);
// Done
return S_OK;
}
// --------------------------------------------------------------------------------
// IPropFindRequest_CreateInstance
// --------------------------------------------------------------------------------
HRESULT IPropFindRequest_CreateInstance(IUnknown* pUnkOuter, IUnknown** ppUnknown)
{
// Invalid Arg
Assert(ppUnknown);
// Initialize
*ppUnknown = NULL;
// Create me
CPropFindRequest *pNew = new CPropFindRequest();
if (NULL == pNew)
return TrapError(E_OUTOFMEMORY);
// Cast to unknown
*ppUnknown = SAFECAST(pNew, IPropFindRequest *);
// Done
return S_OK;
}
// --------------------------------------------------------------------------------
// IPropPatchRequest_CreateInstance
// --------------------------------------------------------------------------------
HRESULT IPropPatchRequest_CreateInstance(IUnknown* pUnkOuter, IUnknown** ppUnknown)
{
// Invalid Arg
Assert(ppUnknown);
// Initialize
*ppUnknown = NULL;
// Create me
CPropPatchRequest *pNew = new CPropPatchRequest();
if (NULL == pNew)
return TrapError(E_OUTOFMEMORY);
// Cast to unknown
*ppUnknown = SAFECAST(pNew, IPropPatchRequest *);
// Done
return S_OK;
}
#endif
// --------------------------------------------------------------------------------
// INNTPTransport_CreateInstance
// --------------------------------------------------------------------------------
HRESULT INNTPTransport_CreateInstance(IUnknown* pUnkOuter, IUnknown** ppUnknown)
{
// Invalid Arg
Assert(ppUnknown);
// Initialize
*ppUnknown = NULL;
// Create me
CNNTPTransport *pNew = new CNNTPTransport();
if (NULL == pNew)
return TrapError(E_OUTOFMEMORY);
// Cast to unknown
*ppUnknown = SAFECAST(pNew, INNTPTransport *);
// Done
return S_OK;
}
// --------------------------------------------------------------------------------
// IRASTransport_CreateInstance
// --------------------------------------------------------------------------------
HRESULT IRASTransport_CreateInstance(IUnknown* pUnkOuter, IUnknown** ppUnknown)
{
// Invalid Arg
Assert(ppUnknown);
// Initialize
*ppUnknown = NULL;
// Create me
CRASTransport *pNew = new CRASTransport();
if (NULL == pNew)
return TrapError(E_OUTOFMEMORY);
// Cast to unknown
*ppUnknown = SAFECAST(pNew, IRASTransport *);
// Done
return S_OK;
}
// --------------------------------------------------------------------------------
// IIMAPTransport_CreateInstance
// --------------------------------------------------------------------------------
HRESULT IIMAPTransport_CreateInstance(IUnknown* pUnkOuter, IUnknown** ppUnknown)
{
// Invalid Arg
Assert(ppUnknown);
// Initialize
*ppUnknown = NULL;
// Create me
CImap4Agent *pNew = new CImap4Agent();
if (NULL == pNew)
return TrapError(E_OUTOFMEMORY);
// Cast to unknown
*ppUnknown = SAFECAST(pNew, IIMAPTransport *);
// Done
return S_OK;
}
// --------------------------------------------------------------------------------
// IRangeList_CreateInstance
// --------------------------------------------------------------------------------
HRESULT IRangeList_CreateInstance(IUnknown* pUnkOuter, IUnknown** ppUnknown)
{
// Invalid Arg
Assert(ppUnknown);
// Initialize
*ppUnknown = NULL;
// Create me
CRangeList *pNew = new CRangeList();
if (NULL == pNew)
return TrapError(E_OUTOFMEMORY);
// Cast to unknown
*ppUnknown = SAFECAST(pNew, IRangeList *);
// Done
return S_OK;
}
// --------------------------------------------------------------------------------
// IVirtualStream_CreateInstance
// --------------------------------------------------------------------------------
HRESULT IVirtualStream_CreateInstance(IUnknown* pUnkOuter, IUnknown** ppUnknown)
{
// Invalid Arg
Assert(ppUnknown);
// Initialize
*ppUnknown = NULL;
// Create me
CVirtualStream *pNew = new CVirtualStream();
if (NULL == pNew)
return TrapError(E_OUTOFMEMORY);
// Cast to unknown
*ppUnknown = SAFECAST(pNew, IStream *);
// Done
return S_OK;
}
// --------------------------------------------------------------------------------
// IMimeMessageParts_CreateInstance
// --------------------------------------------------------------------------------
HRESULT IMimeMessageParts_CreateInstance(IUnknown* pUnkOuter, IUnknown** ppUnknown)
{
// Invalid Arg
Assert(ppUnknown);
// Initialize
*ppUnknown = NULL;
// Create me
CMimeMessageParts *pNew = new CMimeMessageParts();
if (NULL == pNew)
return TrapError(E_OUTOFMEMORY);
// Cast to unknown
*ppUnknown = SAFECAST(pNew, IMimeMessageParts *);
// Done
return S_OK;
}
// --------------------------------------------------------------------------------
// IMimeHeaderTable_CreateInstance
// --------------------------------------------------------------------------------
HRESULT IMimeHeaderTable_CreateInstance(IUnknown* pUnkOuter, IUnknown** ppUnknown)
{
// Invalid Arg
Assert(ppUnknown);
// Initialize
*ppUnknown = NULL;
// Create me
return TrapError(MimeOleCreateHeaderTable((IMimeHeaderTable **)ppUnknown));
}
// --------------------------------------------------------------------------------
// MimeEdit_CreateInstance
// --------------------------------------------------------------------------------
HRESULT MimeEdit_CreateInstance(IUnknown* pUnkOuter, IUnknown** ppUnknown)
{
// Invalid Arg
Assert(ppUnknown);
// Initialize
*ppUnknown = NULL;
// Create me
CDoc *pNew = new CDoc(pUnkOuter);
if (NULL == pNew)
return (E_OUTOFMEMORY);
// Return the Innter
*ppUnknown = pNew->GetInner();
// Done
return S_OK;
}
// --------------------------------------------------------------------------------
// IHashTable_CreateInstance
// --------------------------------------------------------------------------------
HRESULT IHashTable_CreateInstance(IUnknown* pUnkOuter, IUnknown** ppUnknown)
{
// Invalid Arg
Assert(ppUnknown);
// Initialize
*ppUnknown = NULL;
// Create me
CHash *pNew= new CHash(pUnkOuter);
if (NULL == pNew)
return (E_OUTOFMEMORY);
// Return the Innter
*ppUnknown = pNew->GetInner();
// Done
return S_OK;
}
|
d1a2b5153842e0b8299e241191b9330dde036103 | 9a13ae4313e5fc26a2c78b90b9cd3adbc7c23608 | /2_13.cpp | 07f52b6f91a85740552c71a06d64f4fb287b4d23 | [] | no_license | Greenka2016/Practice | 24bbbd29a2ae333a618f34b01ca89a891145e0b9 | d1acf98f255410c27fac452439e5c572cf5eedb9 | refs/heads/main | 2023-02-04T06:38:18.811505 | 2020-12-23T12:28:36 | 2020-12-23T12:28:36 | 312,704,550 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 483 | cpp | 2_13.cpp | #include <iostream>
using namespace std;
#include <cmath>
int main()
{
float a, b, c;
cout << "a*x^2 + b*x + c = 0 \n";
cout << "a: ";
cin >> a;
cout << "b: ";
cin >> b;
cout << "c: ";
cin >> c;
float d = pow(b, 2) - 4 * a * c;
if (d < 0)
{
cout << "Net reshenia";
}
else if (d == 0)
{
cout << "X = " << -b / (2 * c);
}
else
{
cout << "X1 = " << (-b - sqrt(d)) / (2 * a) << ", X2 = " << (-b + sqrt(d)) / (2 * a);
}
return 0;
}
|
c3796fccccad57abefc603333ca5cdcbc3ae25fa | 1c7e660ca61e4377675ca3be7c327a42d007d75f | /g/ARIGEOM.cpp | 89f232e06ab2e0cfe205a86fee83e6831c2ba22f | [] | no_license | pankaj4u4m/Algorithms | 5590bdcdf691a81777f8b0ba3462f8788323f0ec | fddf1188cc2ced818f5e923dc81891218260b547 | refs/heads/master | 2021-01-20T12:13:00.625878 | 2013-12-30T17:03:36 | 2013-12-30T17:03:36 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,969 | cpp | ARIGEOM.cpp | // Author: pankaj kumar, pankaj4u4m@gmail.com
#include <cassert>//c headers in c++
#include <cctype>
#include <cfloat>
#include <cmath>
#include <cstdarg>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <algorithm>//c++ headers
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <iomanip>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <valarray>
#include <vector>
using namespace std;
/*START OF TEMPLATE:CODEGAMBLER*/
#define VAR(x,a) __typeof(a) x=(a)//::VAR(
#define FE(it,c) for(VAR(it,(c).begin());it!=(c).end();++it)//::FE(
#define FOR(i,a,b) for(int i=(int)(a),_b=(int)(b) ; i < _b;++i)//::FOR(
#define FORR(i,a,b) for(int i=(a),_b=(b);i>=_b;--i)//::FORR(
#define REP(i,n) FOR(i,0,n)//::REP(
#define ALL(c) (c).begin(),(c).end()//::ALL(
#define SZ(c) (int)(c).size()//::SZ(
#define PB push_back//::PB
#define V(x) vector< x >//::V(
#define VI V(int)//::VI
#define VVI V(VI)//::VII
#define VS V(string)//::VS
#define PI pair< int,int >//::PI
#define MP make_pair//::MP
#define pi 3.1415926535897932384626433832795//::pi
#define INF 2000000000//::INF
const double eps=1e-5;//::eps
typedef long long LL;//::LL
typedef unsigned long long ULL;//::ULL
typedef long double LD;//::LD
/* Only for Debugging */
#define out(__debug) cout << #__debug<< "=" <<__debug << endl;//::out(
#define outC(A) cout<<"{"; FE(it,A)cout << *it << " " ;cout<<"}"<<endl;//::outContainer
template<class T>inline void outA(T A[], int n) {cout<<"{"; REP (i, n)cout<<A[i]<<" "; cout<<"}"<<endl;}//:outArray
/* Input Output Function */
#define BUFSIZE (1<<26)
char DIP[20];
//#define GET
#ifdef GET//::GET
char IBUF[BUFSIZE+1], *inputptr=IBUF;
#define INPUT fread(IBUF, 1, BUFSIZE, stdin);//::INPUT
#define DIG(a) (((a)>='0')&&((a)<='9'))//::DIG(
#define getChar(t) {t=*inputptr++;}//::getChar(
template<class T>inline bool getInt(T &j) {j=0;int _t;getChar(_t);if(_t==0)return false;char sign;while(!DIG(_t)&&_t!=0){sign=_t;getChar(_t);}while(DIG(_t)){j=10*j+(_t-'0');getChar(_t);}if(sign == '-') j = -j;*inputptr--;return j==0&&_t==0?false:true;}//::getInt(
inline bool getString(char *s) {char _c;getChar(_c);if(_c==0)return false;while(_c==10||_c==32)getChar(_c);while(_c != 10&&_c != 32&&_c!=0){*s++=_c;getChar(_c)}*s=0;inputptr--;return s[0]==0&&_c==0?false:true;}//::getString(
#endif
//#define PUT
#ifdef PUT//::PUT
char OBUF[BUFSIZE+1], *outputptr=OBUF;
template<class T> inline void putInt(T x, char n=0) {int y, dig=0;if(x<0){*outputptr++='-';x=-x;}while(x||!dig){y=x%10;DIP[dig++]=y+'0';x/=10;}while (dig--) *outputptr++=DIP[dig];n?*outputptr++=n:0;}//::putInt(
template<class T> inline void putString(T *s, char n=0){while(*s)*outputptr++=*s++;n?*outputptr++=n:0;}//::putString(
#define putChar(c) {*outputptr++=c;}//::putChar(
#define putLine *outputptr++=10;//::putLine(
#define OUTPUT fputs(OBUF, stdout);//::OUTPUT
#endif
/**************** Main program *******************/
int n;
int F[10005];
int A[10005];
int G[10005];
int maxA;
int maxG;
map<pair<int, pair<int, double> >, int> dp;
bool fun(int i, int a, int g, int d, double r){
if(i >= n){
return true;
}
bool solved = false;
if(dp[MP(i, MP(d, r))] > 1){
solved =dp[MP(i, MP(d, r))] == 3;
if(solved){
while(F[n-1] <= A[a]+d){
A[a+1] = A[a] + d;
a+=1;
}
while(F[n-1] <= G[g]*r){
G[g+1] = G[g]*r;
g+=1;
}
}
maxA = max(maxA, a-1);
maxG = max(maxG, g-1);
return solved;
}
if(!solved && (a<=1 || F[i] == A[a-1] + d) && (g<=1 || abs(F[i] - G[g-1] * r)< eps)){
A[a] = F[i];
G[g] = F[i];
maxA = max(maxA, a);
maxG = max(maxG, g);
d = a == 0 ? INF : A[a] - A[a-1];
r = g == 0 ? INF : G[g]/double(G[g-1]);
// outA(G, maxG);
solved = fun(i+1, a+1, g+1, d, r);
}
if(!solved && (g<=1 || abs(F[i] - G[g-1] * r) <eps)){
G[g] = F[i];
maxG = max(maxG, g);
r = g == 0 ? INF : G[g]/double(G[g-1]);
//outA(G, maxG);
solved = fun(i+1, a, g+1, d, r);
}
if(!solved && (a<=1 || F[i] == A[a-1] + d)){
A[a] = F[i];
maxA = max(maxA, a);
d = a == 0 ? INF : A[a] - A[a-1];
solved = fun(i+1, a+1, g, d, r);
}
dp[MP(i, MP(d, r))] = solved?3:2;
return solved;
}
int main ( int argc, char *argv[] ) {
// freopen("ARIGEOM.cppin","r",stdin);
// INPUT;
int T;scanf("%d", &T);
// getInt(T);
while(T-->0){
scanf("%d", &n);
//getInt(n);
for(int i = 0; i< n; ++i){
scanf("%d", &F[i]);
//getInt(F[i]);
}
dp.clear();
maxA = 0; maxG = 0;
int d = INF;
double r = INF;
fun(0, 0, 0, d, r);
for(int i = 0; i<= maxA; ++i){
printf("%d ", A[i]);
}puts("");
for(int i = 0; i<= maxG; ++i){
printf("%d ", G[i]);
}puts("");
}
return EXIT_SUCCESS;
} /* ---------- end of function main ---------- */
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.