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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5dc6799b7b7e903a075a1787db185b59dff6b1ba | 52386b60a23c6187b15efbc0fc5de1e15e4279ff | /capa.h | 72da353be044be537572c2596f0ad727126fc4f4 | [] | no_license | fvictorio/inteligencia_computacional | 6395d4f479173f83bf0cc534116f0a4351a0345e | b327141bbce7d0e0597853f9f57e2185e1d495b0 | refs/heads/master | 2020-12-25T09:17:58.513173 | 2011-09-05T00:02:19 | 2011-09-05T00:02:19 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 671 | h | capa.h | #ifndef CAPA_H
#define CAPA_H
#include <valarray>
#include <vector>
#include "math_vector.h"
#include "neurona.h"
#include <iostream>
class capa{
public:
typedef neurona::value_type value_type;
typedef neurona::vector vector;
typedef std::valarray<vector> matrix;
typedef std::vector<neurona> container;
void update();
vector test(const vector &input);
vector error(const vector &delta);
capa(size_t n, size_t in, value_type alpha);
size_t size();
void print(){
for(size_t K=0; K<layer.size(); ++K) {
std::cout << "neurona " << K << ": ";
layer[K].print(std::cout);
}
}
//private:
container layer;
vector delta, salida, input;
};
#endif
|
c2a92743a607c4bf89a795ff3fa35f6374a54c7f | 8a05b316fba073010c0ab0170d723ff95666a6ad | /Mock/SystemControllerMock.hpp | 32aa8e7ed24d229a602eca20458f204a097ae0a1 | [] | no_license | winek353/GamepadController | 3688090dffda16fcc621d993832e3103f74a15fa | e478e389863573b0a7e512f0fbf3fcdfd9589694 | refs/heads/master | 2021-03-12T19:35:47.596703 | 2015-11-11T11:10:08 | 2015-11-11T11:10:08 | 30,724,364 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 446 | hpp | SystemControllerMock.hpp | #pragma once
#include "ISystemController.hpp"
#include <gmock/gmock.h>
class SystemControllerMock : public ISystemController
{
public:
MOCK_METHOD1(pressKey, void(int));
MOCK_METHOD1(releaseKey, void(int));
MOCK_METHOD2(moveMouse, void(int, int));
MOCK_METHOD1(clickMouse, void(int));
MOCK_METHOD1(unclickMouse, void(int));
MOCK_METHOD1(runCommand, void(std::string command));
MOCK_METHOD0(getApplicationOnTop, std::string());
};
|
45bbcbbf563af9faf78bf3fe2dac425cc56d424e | 91df74c2f8b95163112ffb2fac8fedd04efc4a3e | /work2.cpp | 0ba4a5fcb077d6b91937b47006032f730a206e93 | [] | no_license | Tatae1199/Homework2. | 75117a903c8c33014c20d5ef2840f474baf39f2a | e7b94575bffabc03517e31ddce0926ed628f41b5 | refs/heads/master | 2022-11-17T06:45:22.115291 | 2020-07-20T14:25:57 | 2020-07-20T14:25:57 | 281,138,081 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 715 | cpp | work2.cpp | #include <iostream>
#include <string>
using namespace std;
void main()
{
string Firstname,Lastname ;
int Salary,Sale,Commision,Total;
cout<<"****Homework 2************"<<endl;
cout<<"Enter Name :";
cin >> Firstname >> Lastname;
cout<<"Enter Salary :";
cin >> Salary ;
cout<<"Enter Sale :";
cin >> Sale ;
cout<<"Enter Commision Percent :";
cin >> Commision ;
Total =(Sale*Commision/100)+Salary;
cout<<"--------output-----------------"<<endl;
cout<<"Your name ="<<Firstname<<" "<<Lastname<<endl;
cout<<"Total Revenue ="<<Total<<endl;
cout<<"-------------------------------"<<endl;
//Jitkawee Ruamrattanasin Sec B Num.1
}
|
15ac1b4fca0e95dd9280245292f3624f4ee6bbe0 | 95ec6b661af2f9ee689a69e769a7cc8e28fad94f | /src/Hash.cpp | f46f5b8e5e5d8b9db9c59eb7960a4ed2f257b165 | [
"MIT"
] | permissive | duhone/core | 5964eb219f09b72941c51e2710892da7586631d1 | 16b1880a79ce53f8e132a9d576d5c0b64788d865 | refs/heads/master | 2021-07-07T07:51:52.343441 | 2021-05-17T02:39:17 | 2021-05-17T02:39:17 | 16,809,549 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,060 | cpp | Hash.cpp | #include "core/Hash.h"
using namespace CR;
using namespace std;
namespace {
uint32_t Get16(byte* a_data) { return ((uint32_t)a_data[0]) | (((uint32_t)a_data[1]) << 8); }
} // namespace
uint32_t Core::HashFast(Span<std::byte> a_data) {
byte* data = a_data.begin();
auto hash = (uint32_t)a_data.size();
auto left = (uint32_t)a_data.size();
if(left == 0) { return 0; }
for(; left > 3; left -= 4) {
uint32_t value;
hash += Get16(data);
value = (Get16(data + 2) << 11);
hash = (hash << 16) ^ hash ^ value;
data += 4;
hash += hash >> 11;
}
switch(left) {
case 3:
hash += Get16(data);
hash ^= hash << 16;
hash ^= ((uint32_t)data[2]) << 18;
hash += hash >> 11;
break;
case 2:
hash += Get16(data);
hash ^= hash << 11;
hash += hash >> 17;
break;
case 1:
hash += (uint32_t)data[0];
hash ^= hash << 10;
hash += hash >> 1;
break;
case 0:
break;
}
hash ^= hash << 3;
hash += hash >> 5;
hash ^= hash << 4;
hash += hash >> 17;
hash ^= hash << 25;
hash += hash >> 6;
return hash;
}
|
9de58e8110df38228afc9fbdef61b637126ab7e9 | 5a97be73f3c6e2987480194a791675259f8d7edf | /BZOJ/3526/make.cpp | 1a805e7c854253b0c5c03187466183969f946f9f | [
"MIT"
] | permissive | sjj118/OI-Code | 1d33d2a7a6eeba2ed16692d663e1b81cdc1341fd | 964ea6e799d14010f305c7e4aee269d860a781f7 | refs/heads/master | 2022-02-21T17:54:14.764880 | 2019-09-05T07:16:27 | 2019-09-05T07:16:27 | 65,370,460 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 336 | cpp | make.cpp | #include<iostream>
#define rep(i,x,y) for(int i=(x);i<=(y);++i)
#define per(i,x,y) for(int i=(x);i>=(y);--i)
int main(){
freopen("code.in","w",stdout);
int n=2e5,m=1e6;
printf("%d\n",n);
rep(i,1,n)printf("%d %d\n",rand()%10000000,rand()%10000000);
printf("%d\n",m);
rep(i,1,m)printf("%d %d\n",rand()%n+1,rand()%n+1);
return 0;
}
|
ecb7bdd041ea801e6fdc8145011391fb7cae6e2a | 739edc9db772e2d160bdd00e39d73a9f542ce470 | /include/flexui/Nodes/Style.hpp | f56fbe839748526df5c88bab0ce3ee9daffde7e5 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | stlcours/flexui | bf83b002ec57ab1a41237af55831740382765f34 | a26a5598b5ebcdc22969ad67157ae5a38b0adca9 | refs/heads/master | 2023-08-13T20:29:09.630241 | 2021-09-22T22:16:50 | 2021-09-22T22:16:50 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 583 | hpp | Style.hpp | #pragma once
#include <string>
#include <memory>
#include "flexui/Nodes/Node.hpp"
namespace flexui {
class StyleSheet;
// Style node
class Style : public Node {
public:
Style(const std::string& css = "");
~Style() override;
std::shared_ptr<StyleSheet> getStyleSheet() const { return m_StyleSheet; }
std::string getNodeName() const override { return "#style"; }
std::string getDebugInfo() const override;
NodeType getNodeType() const override { return NodeType::STYLE; };
private:
std::string m_CSSSource;
std::shared_ptr<StyleSheet> m_StyleSheet;
};
}
|
aaf621312c5b5262f7bcc799318b8af5686375b9 | b2773b26091468ca05bef1507ebb9d7f9dc64eaf | /src/DicedChipAnalysisGUI.h | d1cd0071521f19a7e4bbbba51794f11600f300e3 | [] | no_license | kkrizka/chister | c8f4eac519b567fd760a68c8dad13ef0086040ba | 910d98ae5f5255a2bc281ad7c936603873f7f598 | refs/heads/master | 2021-01-20T18:33:00.452273 | 2018-08-17T22:44:47 | 2018-08-17T22:44:47 | 90,922,600 | 0 | 1 | null | 2017-09-29T20:20:39 | 2017-05-11T01:12:05 | Jupyter Notebook | UTF-8 | C++ | false | false | 1,863 | h | DicedChipAnalysisGUI.h | #ifndef DICEDCHIPANALYSISGUI_H
#define DICEDCHIPANALYSISGUI_H
#include "AnalysisProgramGUI.h"
#include "PreferencesDialog.h"
#include "DicedChipAnalysis.h"
#include "DicedChipTemplateManager.h"
#include "DicedChip_InfoForm.h"
#include "DicedChip_ConfigureForm.h"
#include "DicedChip_LoadChipsForm.h"
#include "DicedChip_CrossAlignForm.h"
#include "DicedChip_ChipTestForm.h"
#include "DicedChip_SummaryForm.h"
class DicedChipAnalysisGUI : public AnalysisProgramGUI
{
Q_OBJECT
public:
DicedChipAnalysisGUI(DicedChipAnalysis *program, QObject *parent=0);
virtual void createPreferencesForm(PreferencesDialog *prefDialog);
virtual QDockWidget* createControlDock(QWidget *parent);
public slots:
void displayMessage(const QString &text);
void showConfigure();
void showSlotSelection();
void showProbeCheck();
void showCrossAlign();
void showChipTest();
void showSummary();
void configure(const QString& chipTemplate, bool loadChips, bool findProbes, bool calibratePosition, const QString& logDirectory);
void slotSelection(const QList<DicedChipSlot*>& validSlots);
void done();
signals:
void startLoadChips();
void startFindProbes();
void startCalibratePosition();
void startFindChips();
void startTestChips();
private:
DicedChipTemplateManager m_templates;
DicedChip_InfoForm *m_infoWidget;
DicedChip_ConfigureForm *m_configureForm;
DicedChip_LoadChipsForm *m_loadChipsForm;
DicedChip_CrossAlignForm *m_crossAlignForm;
DicedChip_ChipTestForm *m_chipTestForm;
DicedChip_SummaryForm *m_summaryForm;
bool m_loadChips;
bool m_findProbes;
bool m_calibratePosition;
void createConfigure();
void createSlotSelection();
void createCrossAlign();
void createChipTest();
void createSummary();
};
#endif // DICEDCHIPANALYSISGUI_H
|
af336de057bf209cd34991d5e52a7b4c43361eb7 | 2fbd927e1959e1ceca070c6700b31169d33a3620 | /HippoWntCrosstalk/src/Modifiers/WntTrackingModifier.hpp | ac1b9a90ab0cda5e7c55b6966dfe661b6bfde25e | [] | no_license | CompBioDan/HippoWntCrosstalkProject | 4d3bf537c2babadeb84b180a7c82bb46bfd14d7d | bccd2981e8344548c52c5a8260e6aa49e5535a3e | refs/heads/master | 2020-03-27T06:35:01.280514 | 2018-08-25T17:46:37 | 2018-08-25T17:46:37 | 146,116,874 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,779 | hpp | WntTrackingModifier.hpp | /*
* ODE TrackingModifier.hpp
*
* Created on: 14 Dec 2016
* Author: daniel
*/
#ifndef WntTrackingModifier_HPP_
#define WntTrackingModifier_HPP_
#include "ChasteSerialization.hpp"
#include <boost/serialization/base_object.hpp>
#include "AbstractCellBasedSimulationModifier.hpp"
/**
* A modifier class in which the levels of Nanog within each cell
* is fetched from the cell cycle (Godwin2016NanogOdeSystem) and stored in CellData.
* To be used in conjunction with the NanogInheritedCellCycleModel cell cycle model.
*/
template<unsigned DIM>
class WntTrackingModifier : public AbstractCellBasedSimulationModifier<DIM,DIM>
{
/** Needed for serialization. */
friend class boost::serialization::access;
/**
* Boost Serialization method for archiving/checkpointing.
* Archives the object and its member variables.
*
* @param archive The boost archive.
* @param version The current version of this class.
*/
template<class Archive>
void serialize(Archive & archive, const unsigned int version)
{
archive & boost::serialization::base_object<AbstractCellBasedSimulationModifier<DIM,DIM> >(*this);
}
public:
/**
* Default constructor.
*/
WntTrackingModifier();
/**
* Destructor.
*/
virtual ~WntTrackingModifier();
/**
* Overridden UpdateAtEndOfTimeStep() method.
*
* Specifies what to do in the simulation at the end of each time step.
*
* @param rCellPopulation reference to the cell population
*/
virtual void UpdateAtEndOfTimeStep(AbstractCellPopulation<DIM,DIM>& rCellPopulation);
/**
* Overridden SetupSolve() method.
*
* Specifies what to do in the simulation before the start of the time loop.
*
* @param rCellPopulation reference to the cell population
* @param outputDirectory the output directory, relative to where Chaste output is stored
*/
virtual void SetupSolve(AbstractCellPopulation<DIM,DIM>& rCellPopulation, std::string outputDirectory);
/**
* Helper method to take the Nanog concentrations for each cell in their cell cycle model and
* store these in the CellData.
*
* @param rCellPopulation reference to the cell population
*/
void UpdateCellData(AbstractCellPopulation<DIM,DIM>& rCellPopulation);
/**
* Overridden OutputSimulationModifierParameters() method.
* Output any simulation modifier parameters to file.
*
* @param rParamsFile the file stream to which the parameters are output
*/
void OutputSimulationModifierParameters(out_stream& rParamsFile);
};
#include "SerializationExportWrapper.hpp"
EXPORT_TEMPLATE_CLASS_SAME_DIMS(WntTrackingModifier)
#endif /*WntTrackingModifier_HPP_*/
|
03c3f3604ed4a2576c5462013823ba85ea5685f1 | 2dd293a6ab2189f4269181c99abe2406b7f7349d | /chapter4/Sort/A1095.cpp | 8bc3ba32cbb91c0c4bbc3e9032e34e4bcd6a2cbd | [] | no_license | leetsura/algorithm | e02aeb5ef7b55ff408ee3292c5b385e30ffede4a | 4290fc2bda8dfc2b928fc30050a435e1182284da | refs/heads/master | 2020-03-10T05:48:02.017448 | 2018-09-07T12:27:37 | 2018-09-07T12:27:37 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,767 | cpp | A1095.cpp | /**
* @Author: lee
* @Date: 2018-06-01T18:30:26+08:00
* @Last modified by: lee
* @Last modified time: 2018-06-05T17:03:01+08:00
*/
// 排序
// 思路及要点
//(1)利用map<string, int>来存储对应车牌号停留的总时间;
//(2)时间全部转化为秒,有利于简化操作;
//(3)定义两个结构体数组,record[10000]和valid[10000],record数组存储所有记录;
// valid数组存储匹配正确的记录,这样就可以分段循环;因为查询时间是按时间的升序排序,
// 利用这点可以进行分段排序,valid内的数据同样按时间顺序排序,所以只要在每一个时间段内
// 累加累减停车数量即可求出每个时间段内的停车总数。
//(4)要求最长停车时间和对应的车牌号,停车时间最长的车辆不止一辆时,所有停车时间最长的
// 车牌号都需要输出;方法如下:先求出最长停车时间,然后遍历map,找出时间等于改最长停车
// 时间的车牌号,一次输出;题目还要求按车牌号的字母表顺序输出,所以一开始需要将record按
// 字母表排序,此时得出的map,自然就是按车牌的字母表排序的。
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
using namespace std;
int n, k;
// map: 车牌号 => 总停车时间
map<string, int> parkTime;
// 车辆记录
// valid记录配对的停车记录,将无效停车记录排除
struct Record {
// 车牌号
char plateNumber[8];
// 时间,单位s(秒)
int time;
// 状态,1表示in,0表示out
bool status;
} record[10000], valid[10000];
// 有效记录总数
int num = 0;
// 按车牌号字母表顺序排序;按时间降序排序
bool cmpNumberParkTime(Record a, Record b)
{
if (strcmp(a.plateNumber, b.plateNumber) != 0) {
return strcmp(a.plateNumber, b.plateNumber) < 0;
} else {
return a.time < b.time;
}
}
// 按时间降序排序
bool cmpParkTime(Record a, Record b)
{
return a.time < b.time;
}
// 将时间转化为秒
int convertTimeToSecond(int hh, int mm, int ss)
{
return hh * 3600 + mm * 60 + ss;
}
int main()
{
scanf("%d%d", &n, &k);
// 录入车辆记录
for (int i = 0; i < n; i ++) {
int hh, mm, ss;
char charStatus[4];
scanf("%s %d:%d:%d %s",record[i].plateNumber, &hh, &mm, &ss, charStatus);
// 将时间转化为秒
record[i].time = convertTimeToSecond(hh, mm, ss);
if (strcmp(charStatus, "in") == 0) {
record[i].status = 1;
} else {
record[i].status = 0;
}
}
// 最长停留时间
int maxTime = -1;
// 按车牌号字母表顺序排序;按时间降序排序
sort(record, record + n, cmpNumberParkTime);
for (int i = 0; i < n - 1; i ++) {
// 车牌号相等;in out匹配,则记录停车时间
if (
strcmp(record[i].plateNumber, record[i + 1].plateNumber) == 0 &&
record[i].status == 1 && record[i + 1].status == 0
) {
// 若map中没有该车牌号的记录,则初始化停车时间
if (parkTime.count(record[i].plateNumber) == 0) {
// 初始化停车时间
parkTime[record[i].plateNumber] = 0;
}
// 计算总停车时间
parkTime[record[i].plateNumber] += record[i + 1].time - record[i].time;
// 更新最长停车时间
maxTime = max(maxTime, parkTime[record[i].plateNumber]);
// 记录配对正确的停车记录
valid[num ++] = record[i];
valid[num ++] = record[i + 1];
}
}
// 按停车记录时间排序
sort(valid, valid + num, cmpParkTime);
// amount:停车数量;now表示不超过当前查询时间的记录。
int amount = 0, now = 0;
// 录入查询信息
for (int i = 0; i < k; i ++) {
int hh, mm, ss;
int seconds;
scanf("%d:%d:%d", &hh, &mm, &ss);
seconds = convertTimeToSecond(hh, mm, ss);
// 计算停车数量
while (now < num && valid[now].time <= seconds) {
if (valid[now].status == 1) {
amount ++;
} else {
amount --;
}
now ++;
}
printf("%d\n", amount);
}
// 输出停车时间最长的车牌号
map<string, int>::iterator it;
for (it = parkTime.begin(); it != parkTime.end(); it ++) {
if (it->second == maxTime) {
printf("%s ", it->first.c_str());
}
}
// 输出停车最长时间
printf("%02d:%02d:%02d", maxTime / 3600, maxTime % 3600 / 60, maxTime % 60);
return 0;
}
|
4c5f947a75434cb1ba735fa671ca2c7188a81d8d | 068f60dc82a92e9ec6baff6d52d759a283f731d7 | /GameObjects/Obstacles/Collectable.h | 0018fa8c0b0440bd0632ac5220cc51327a5da144 | [] | no_license | Valzur/Pinball | 59aeec23e8ba96df2acad9a551f86a74a9c0f191 | c979267685ad5aa9b819411c97c0377f2e639a93 | refs/heads/master | 2022-08-06T02:35:28.468198 | 2022-07-22T16:01:21 | 2022-07-22T16:01:21 | 243,079,463 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 490 | h | Collectable.h | #pragma once
#include "Obstacle.h"
#include "../../Defs.h"
#include "../../Utility/CollisionDetection.h"
class Collectable:public Obstacle
{
private:
double radius,Timer=FlashTimer;
string L;
Vector2D Center;
bool Active=true,Used=false;
public:
Collectable(double radius,string L,Vector2D Center);
void draw(Interface & interface) override;
Vector2D collideWith(Ball& ball, double collision_time, Manager & manager) override;
};
|
b0e0a6cd99eb9acc131d6932ef50e49290357dca | a822fcae19f786a02c3db40872b861edfb8866d4 | /過去問B問題/B - I miss you....cpp | 5d2c4c91d1d3c64d0c3f7de4467bcaf1c39cea51 | [] | no_license | shoutagit/AtCoder | d43f4446b343e60b757676835f1dec8e085bee58 | 96e21f76778a15d1974f9e6d191bd8349245ed7e | refs/heads/master | 2022-11-24T05:01:25.446076 | 2020-08-02T16:02:22 | 2020-08-02T16:02:22 | 272,147,149 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 323 | cpp | B - I miss you....cpp |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
const ll INF = 1LL << 60;
int main(){
string s;
cin >> s;
string ans;
rep(i,s.size()){
ans.push_back('x');
}
cout << ans << endl;
} |
55290ccfa133d5baa5b2af74f20527f9869a8653 | 8188e0742ec3e8b9a75519359a8676602944b023 | /Basic/1034/1034.cpp | 9eb12b73fd49c8dc3927ec497bf4bd4929e1f450 | [] | no_license | wujinggrt/PAT | 0718e01195cbc755ccac1f10b29e15d7d42cbe02 | d7d49ac4c798dd0f2c676774f8842cdc6de24e56 | refs/heads/master | 2021-07-15T22:11:39.109637 | 2019-06-10T13:48:34 | 2019-06-10T13:48:34 | 152,895,826 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,437 | cpp | 1034.cpp | /*
分母为1,输出分子
*/
#include <cstdio>
using namespace std;
long gcd(long x, long y);
void print_fraction(long numerator, long denomitor);
int main()
{
char ops[] = {'+', '-', '*', '/'};
long numerator_l;
long denomitor_l;
long numerator_r;
long denomitor_r;
scanf("%ld/%ld %ld/%ld", &numerator_l, &denomitor_l, &numerator_r, &denomitor_r);
for (int i = 0; i < 4; ++i)
{
print_fraction(numerator_l, denomitor_l);
printf(" %c ", ops[i]);
print_fraction(numerator_r, denomitor_r);
printf(" = ");
switch (ops[i])
{
case '+':
print_fraction(numerator_l * denomitor_r + numerator_r * denomitor_l, denomitor_l * denomitor_r);
break;
case '-':
print_fraction(numerator_l * denomitor_r - numerator_r * denomitor_l, denomitor_l * denomitor_r);
break;
case '*':
print_fraction(numerator_l * numerator_r, denomitor_l * denomitor_r);
break;
case '/':
print_fraction(numerator_l * denomitor_r, numerator_r * denomitor_l);
break;
}
printf("\n");
}
return 0;
}
void print_fraction(long numerator, long denomitor)
{
if (denomitor == 0)
{
printf("Inf");
return;
}
// normalize the sign.
int sign = 1;
if (numerator < 0)
{
sign *= -1;
numerator *= -1;
}
if (denomitor < 0)
{
sign *= -1;
denomitor *= -1;
}
auto common_divisor = gcd(numerator, denomitor);
numerator /= common_divisor;
denomitor /= common_divisor;
if (sign == -1)
{
printf("(-");
}
if (denomitor == 1)
{
printf("%ld", numerator);
}
else if (numerator > denomitor)
{
printf("%ld %ld/%ld", numerator / denomitor, numerator % denomitor, denomitor);
}
else
{
printf("%ld/%ld", numerator, denomitor);
}
if (sign == -1)
{
printf(")");
}
}
long gcd(long x, long y)
{
if (y == 0)
{
return 0;
}
if (x == 0)
{
return y;
}
long ret = x;
while(ret != 0)
{
ret = x % y;
x = y;
y = ret;
}
return x;
} |
68874272dc1d7604f8712328dd2ab705fc464ec5 | 5d341bcd1e8a54c960f2d01acc174dd3fe40d2e6 | /tests/TestsBuilding.cpp | 08b8fa816c0bf6eb3165437ebbf81861517f9a25 | [] | no_license | Feawel/CPP_ProjetReseau | 7e02fd3ed1056d22cae3547ed3e118b5deaee667 | 7fde216c25645bd4ed5e66cdfac157354d7e8953 | refs/heads/master | 2020-05-31T10:42:08.292565 | 2013-12-01T22:32:39 | 2013-12-01T22:32:39 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 986 | cpp | TestsBuilding.cpp | #include "TestsBuilding.h"
using namespace std;
bool TestsBuilding::testGetFloors() {
bool result = false, testPart1 = false, testPart2 = false;
Building building1("Building 1");
vector<Floor*> floors = building1.getFloors();
if(floors.empty())
testPart1 = true;
Floor* newFloor = new Floor("Floor Test", 0);
building1.addSpecialSection(newFloor);
vector<Floor*> floors2 = building1.getFloors();
if(floors2[0] == newFloor)
testPart2 = true;
if (testPart1 && testPart2)
result = true;
return result;
}
bool TestsBuilding::testIsAdmin() {
bool result = false, testPart1 = false, testPart2 = false;
Building building1("Building 1");
bool isAdmin = building1.isAdmin();
if(!isAdmin)
testPart1 = true;
building1.setAdmin(true);
bool isAdmin2 = building1.isAdmin();
if(isAdmin2)
testPart2 = true;
if(testPart1 && testPart2)
result = true;
return result;
}
|
3a7379522944c49a0676bacf0508bd3064ea5c6d | 5565c0480a54b69c0f41469096aa35e6f4edd1f3 | /Prac_1/practica1Base/src/mon.h | 2cac0b27affe3e3081bdd48d6283be223e1d47de | [] | no_license | EnLaLuna91/Grafics | 49ecb8a45673fc59a19eb35e13c42916d3941c7d | 26785bc3cbd085e6eb21d4339ae2c04d59525a99 | refs/heads/master | 2021-06-08T11:26:15.002467 | 2016-05-30T14:32:55 | 2016-05-30T14:32:55 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,262 | h | mon.h | #ifndef ESCENA_H
#define ESCENA_H
#include <cmath>
#include <iostream>
#include <stdlib.h>
#include <list>
#include <vector>
#include <string>
#include <stdio.h>
#include <Common.h>
#include <objecte.h>
#include <llum.h>
#include <llumdireccional.h>
#include <llumpuntual.h>
#include <llumspotlight.h>
using namespace std;
// Virtual World: contains all objects, lights to visualize the scene
// the viewer is placed in the z+ axis and the visible frustum is enclosed to (-1,-1,-1) to (1,1,1)
class Mon {
private:
// Llum luz;
llumPuntual *LuzPunt;
llumDireccional *LuzDirec;
llumSpotlight *LuzSpot;
vec3 AmbientLight;
bool PhongTex;
bool GouraudTex;
public:
Mon();
~Mon();
void addObjecte(Objecte *obj);
void draw();
void addLlum(Llum *l);
Llum *getLlumActual();
void llumsToGPU(QGLShaderProgram *program);
//Intensitat global que es passarà a la GPU per a
//ser utilitzada pels shaders
void setAmbientToGPU(QGLShaderProgram *program);
vector <Objecte*> elements;
vector<Llum*> llums;
void phongTexOnOff();
void phongTexToGPU(QGLShaderProgram *program);
void gouraudTexOnOff();
void gouraudTexToGPU(QGLShaderProgram *program);
};
#endif // ESCENA_H
|
058f9c11aa28741a7d2a5dfd2fc4b9e22631030d | 2f719c415293289b5d23df59b32bcf6eb5f29057 | /app/src/main/cpp/act/GLHelper.cpp | 41e71dd78194dbfdd039f086856caffda49fbeba | [] | no_license | yannyesteban/Rinconada | 474435ebd745a9b725b368ad502231c1a3f025f1 | 10e9abf73b98bf43b733fc77877006b833b0c013 | refs/heads/master | 2020-06-03T15:28:40.454630 | 2019-12-14T18:20:29 | 2019-12-14T18:20:29 | 191,629,412 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,222 | cpp | GLHelper.cpp | //
// Created by yanny on 26/7/2019.
//
#include <list>
#include "GLHelper.h"
#include "Log.h"
void GLHelper::setVertices(GLfloat *pVertices, GLint numVertices, GLint vtxStride) {
_vertices = pVertices;
_numVertices = numVertices;
_vtxStride = vtxStride;
}
void GLHelper::setVertices(std::vector<glm::vec3> pVertices, GLint numVertices, GLint vtxStride) {
_vertices2 = pVertices;
_numVertices = numVertices;
_vtxStride = vtxStride;
}
void GLHelper::setVertices(std::vector<GMv8> pVertices, GLint numVertices, GLint vtxStride) {
_vertices3 = pVertices;
_numVertices = numVertices;
_vtxStride = vtxStride;
}
void GLHelper::setIndices(GLushort *pIndices, GLint numIndices) {
_indices = pIndices;
_numIndices = numIndices;
}
void GLHelper::setIndices(std::vector<GLushort> pIndices2, GLint numIndices) {
_indices2 = pIndices2;
_numIndices = numIndices;
}
void GLHelper::draw() {
GLint numIndices=_numIndices;
GLint numVertices = _numVertices;
GLint vtxStride = (_vtxStride)*sizeof(GLfloat);
//GLuint vboIds[2];
// vboIds[0] – used to store vertex attribute data
// vboIds[1] – used to store element indices
glGenBuffers(2, vboIds);
glBindBuffer(GL_ARRAY_BUFFER, vboIds[0]);
glBufferData(GL_ARRAY_BUFFER, vtxStride * numVertices, _vertices, GL_STATIC_DRAW);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vboIds[1]);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(GLushort) * numIndices, _indices, GL_STATIC_DRAW);
std::unordered_map<GLushort, GLushort>::iterator it;
GLuint offset = 0;
_LOGE("compiling __, __, compiling: __");
for (it = _attrib.begin(); it != _attrib.end(); ++it) {
_LOGE("compiling %d, %d, compiling: %d", it->first, it->second, offset);
glEnableVertexAttribArray(it->first);
glVertexAttribPointer(it->first, it->second, GL_FLOAT, GL_FALSE, vtxStride, (const void*)offset);
offset += it->second * sizeof(GLfloat);
}
//glBindAttribLocation(programObject, VERTEX_POS_INDX, "vPosition");
//glBindAttribLocation(programObject, VERTEX_NORMAL_INDX, "v_color");
//glBindAttribLocation(program, VERTEX_TEXCOORD0_INDX, "v_texcoord");
//glBindTexture(GL_TEXTURE_2D, texture);
glDrawElements(GL_TRIANGLES, numIndices, GL_UNSIGNED_SHORT, 0);
for (it = _attrib.begin(); it != _attrib.end(); ++it) {
glDisableVertexAttribArray(it->first);
}
}
void GLHelper::draw2() {
GLint numIndices=_numIndices;
GLint numVertices = _numVertices;
GLint vtxStride = (_vtxStride)*sizeof(GLfloat);
//GLuint vboIds[2];
// vboIds[0] – used to store vertex attribute data
// vboIds[1] – used to store element indices
glGenBuffers(2, vboIds);
glBindBuffer(GL_ARRAY_BUFFER, vboIds[0]);
glBufferData(GL_ARRAY_BUFFER, vtxStride * numVertices, _vertices, GL_STATIC_DRAW);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vboIds[1]);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(GLushort) * numIndices, _indices, GL_STATIC_DRAW);
std::list<GLAttrib>::iterator it;
GLuint offset = 0;
_LOGE("compiling __, __, compiling: __");
for (it = _attrib2.begin(); it != _attrib2.end(); ++it) {
_LOGE("compiling %d, %d, compiling: %d", it->index, it->size, offset);
glEnableVertexAttribArray(it->index);
glVertexAttribPointer(it->index, it->size, GL_FLOAT, GL_FALSE, vtxStride, (const void*)offset);
offset += it->size * sizeof(GLfloat);
}
//glBindAttribLocation(programObject, VERTEX_POS_INDX, "vPosition");
//glBindAttribLocation(programObject, VERTEX_NORMAL_INDX, "v_color");
//glBindAttribLocation(program, VERTEX_TEXCOORD0_INDX, "v_texcoord");
//glBindTexture(GL_TEXTURE_2D, texture);
glDrawElements(GL_TRIANGLES, numIndices, GL_UNSIGNED_SHORT, 0);
for (it = _attrib2.begin(); it != _attrib2.end(); ++it) {
glDisableVertexAttribArray(it->index);
}
}
void GLHelper::draw3() {
GLint numIndices=_numIndices;
GLint numVertices = _numVertices;
GLint vtxStride = (_vtxStride)*sizeof(GLfloat);
//GLuint vboIds[2];
// vboIds[0] – used to store vertex attribute data
// vboIds[1] – used to store element indices
glGenBuffers(2, vboIds);
glBindBuffer(GL_ARRAY_BUFFER, vboIds[0]);
numVertices = 3;
GLfloat vv[] = {
0.0,0.0,0.0,
0.5,0.0,0.0,
0.5,0.5,0.0,
};
std::vector<glm::vec3> q;
q.push_back(glm::vec3(0.0, 0.0,0.0));
q.push_back(glm::vec3(0.5, 0.0,0.0));
q.push_back(glm::vec3(0.5, 0.9,0.0));
vtxStride = 3 *sizeof(GLfloat);
glBufferData(GL_ARRAY_BUFFER, vtxStride * numVertices, &q[0], GL_STATIC_DRAW);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vboIds[1]);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(GLushort) * numIndices, _indices, GL_STATIC_DRAW);
std::list<GLAttrib>::iterator it;
GLuint offset = 0;
_LOGE("compiling __, __, compiling: __");
for (it = _attrib2.begin(); it != _attrib2.end(); ++it) {
_LOGE("compiling %d, %d, compiling: %d", it->index, it->size, offset);
glEnableVertexAttribArray(it->index);
glVertexAttribPointer(it->index, it->size, GL_FLOAT, GL_FALSE, vtxStride, (const void*)offset);
offset += it->size * sizeof(GLfloat);
}
//glBindAttribLocation(programObject, VERTEX_POS_INDX, "vPosition");
//glBindAttribLocation(programObject, VERTEX_NORMAL_INDX, "v_color");
//glBindAttribLocation(program, VERTEX_TEXCOORD0_INDX, "v_texcoord");
//glBindTexture(GL_TEXTURE_2D, texture);
glDrawArrays(GL_TRIANGLES, 0, 3);
//glDrawElements(GL_TRIANGLES, numIndices, GL_UNSIGNED_SHORT, 0);
for (it = _attrib2.begin(); it != _attrib2.end(); ++it) {
glDisableVertexAttribArray(it->index);
}
}
void GLHelper::draw4() {
GLint numIndices = _numIndices;
GLint numVertices = _numVertices;
GLint vtxStride = (_vtxStride)*sizeof(GLfloat);
/*
numIndices = 6;
numVertices = 4;
vtxStride = (6)*sizeof(GLfloat);
*/
GLfloat v[] ={
0.0, 0.0, 0.0,1.0,0.0,0.0,
0.5, 0.0, 0.0,1.0,0.0,0.0,
0.5, 0.5, 0.0,1.0,0.0,1.0,
0.0, 0.5, 0.0,1.0,1.0,0.0,
};
GLushort i[] ={
0,1,2,0,2,3
};
std::vector<GMv6> q;
q.push_back({glm::vec3(0.0,0.0,0.0), glm::vec3(1.0,0.0,1.0)});
q.push_back({glm::vec3(1.5,0.0,0.0), glm::vec3(0.0,1.0,1.0)});
q.push_back({glm::vec3(1.5,0.5,0.0), glm::vec3(0.0,0.0,1.0)});
q.push_back({glm::vec3(0.0,0.5,0.0), glm::vec3(1.0,0.5,1.0)});
//GLuint vboIds[2];
// vboIds[0] – used to store vertex attribute data
// vboIds[1] – used to store element indices
glGenBuffers(2, vboIds);
glBindBuffer(GL_ARRAY_BUFFER, vboIds[0]);
//glBufferData(GL_ARRAY_BUFFER, vtxStride * numVertices, &q[0], GL_STATIC_DRAW);
glBufferData(GL_ARRAY_BUFFER, vtxStride * numVertices, &_vertices3[0], GL_STATIC_DRAW);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vboIds[1]);
//glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(GLushort) * numIndices, i, GL_STATIC_DRAW);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(GLushort) * numIndices, &_indices2[0], GL_STATIC_DRAW);
std::list<GLAttrib>::iterator it;
GLuint offset = 0;
for (it = _attrib2.begin(); it != _attrib2.end(); ++it) {
_LOGE("compiling %d, %d, compiling: %d", it->index, it->size, offset);
glEnableVertexAttribArray(it->index);
glVertexAttribPointer(it->index, it->size, GL_FLOAT, GL_FALSE, vtxStride, (const void*)offset);
offset += it->size * sizeof(GLfloat);
}
//glDrawArrays(GL_TRIANGLES, 0, numVertices);
glDrawElements(GL_TRIANGLES, numIndices, GL_UNSIGNED_SHORT, 0);
_LOGE("numIndices.. %d", numIndices);
for (it = _attrib2.begin(); it != _attrib2.end(); ++it) {
glDisableVertexAttribArray(it->index);
}
glDeleteBuffers(2,vboIds);
}
void GLHelper::defAttrib(std::unordered_map<GLushort, GLushort> pAttrib) {
_attrib = pAttrib;
}
void GLHelper::defAttrib2(std::list<GLAttrib> pAttrib) {
_attrib2 = pAttrib;
}
GLHelper::~GLHelper() {
_LOGI("borrando");
glDeleteBuffers(2, vboIds);
}
|
73b6afc301ebe1afd15c30d6ce0d9a42190d66c3 | aad8c879dee2ce9d651d829d01c098db98f274a3 | /skel/dot.cpp | 40442f5db582d33b081d6ecbce8b4e400fafb32e | [] | no_license | antontest/anton-vim | 9cb5594cdb00424169b9356b6e56fc63caf32587 | b6ed45174d7042d516f23422573d81665195106a | refs/heads/master | 2020-04-06T07:01:06.243134 | 2016-09-11T12:38:52 | 2016-09-11T12:38:52 | 43,556,435 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 218 | cpp | dot.cpp | /*-
* Copyright (C), 1988-2012, mymtom
*
* vi:set ts=4 sw=4:
*/
#ifndef lint
static const char rcsid[] = "$Id$";
#endif /* not lint */
/**
* @file <FILE>
* @brief
*/
#include <iostream>
using namespace std;
|
e28955f84c26c79339cf2ec3c99189c2a231d421 | 0aeba1677a42e85a12318b1af46704d36eaac8a2 | /src/Basic_Components/MoveableComponent.cpp | 13cb9b5de7c8809d426cb752fdfe741d2c005e46 | [] | no_license | wynnliam/an_engine_of_ice_and_fire | ea29634c75884dbb278e7fc4ab69272a5accaf94 | 9dca29a1d23c60821b654aece330cb65272f9d48 | refs/heads/master | 2020-03-08T16:54:45.515244 | 2018-04-05T19:39:07 | 2018-04-05T19:39:07 | 128,254,210 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,049 | cpp | MoveableComponent.cpp | //Liam "AFishyFez" Wynn, 4/11/2015, AEOIAF: Movable Component
#include "MoveableComponent.h"
using namespace AEOIAF_Utilities;
MovableComponent::MovableComponent()
{
magnitude = 0.0f;
}
MovableComponent::MovableComponent(float newX, float newY) : position(newX, newY)
{
magnitude = 0.0f;
}
MovableComponent::MovableComponent(const MovableComponent& toCopy)
{
Copy(toCopy);
}
MovableComponent::~MovableComponent()
{
}
MovableComponent& MovableComponent::operator = (const MovableComponent& toCopy)
{
Copy(toCopy);
return *this;
}
void MovableComponent::Copy(const MovableComponent& toCopy)
{
position = toCopy.position;
direction = toCopy.direction;
magnitude = toCopy.magnitude;
}
MovableComponent* MovableComponent::GetCopy()
{
MovableComponent* result = new MovableComponent(*this);
return result;
}
void MovableComponent::Update(float deltaTime)
{
//Use this to modify position
Vector velocity = direction * magnitude * deltaTime;
position += velocity;
}
|
349f6de21444ee618f6f67777743750e01824b5e | 102e36904c4d0f5bfd4f82b7e2f62043e84ec491 | /dka/donkey-kong-arcade/Barrel.h | 0f4647cd68ecbf04693bd60f0f332e9f79666151 | [] | no_license | FelipeBrizola/entretenimento-digital | 05686fbf00b8bec1a70b8d6497e2bbcb62cbd1e4 | 3f8ffea1f53c92205baf645cfa57e05494eb2575 | refs/heads/master | 2020-03-30T08:26:41.511372 | 2018-11-30T22:19:41 | 2018-11-30T22:19:41 | 151,015,657 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 262 | h | Barrel.h | #ifndef BARREL_H
#define BARREL_H
#include "Sprite.h"
class Barrel
{
public:
void moving();
cgf::Sprite getSprite();
Barrel(int x, int y);
virtual ~Barrel();
protected:
private:
cgf::Sprite sprite;
};
#endif // BARREL_H
|
8144e754b4fa490401f2773c0fabd4a1b25a1a91 | 8d82f844648ad98d554b3b82cdbff954e14bae3a | /Common/CmnLib/Profile.cpp | 93c51af3211e4d8bb3e8491b0df89576ea5e3115 | [] | no_license | angelinana0408/financial-transaction | 519151f05bb6c92b9b35bcf4eb1ac68ee0edc522 | e8f4696d7108dc7ff25719269f7106b8430708aa | refs/heads/master | 2021-04-27T16:43:52.282331 | 2018-02-21T08:14:21 | 2018-02-21T08:14:21 | 122,308,506 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 3,613 | cpp | Profile.cpp | #include "stdafx.h"
#include "io.h"
#include "direct.h"
#include "stdio.h"
#include "stdlib.h"
#include "CmnLibEx.h"
//////////////////////////////////////////////////////////////////////
// Ini Define
//////////////////////////////////////////////////////////////////////
#define _REGKEY_DEFAULT _T("SOFTWARE\\ATM\\APP\\DEFAULTSETTING")
#define _DEFVAL_INIDIR _T("D:\\INI")
CString m_strIniDir(""); // INI颇老DIR
//////////////////////////////////////////////////////////////////////
int WINAPI GetIniName(LPTSTR IniName, LPCTSTR strIniFileName)
{
if(strlen(strIniFileName)==0) return FALSE;
// if (m_strIniDir.IsEmpty()) // 烹钦包府
// {
// m_strIniDir = RegGetStr(_REGKEY_DEFAULT, "INIDIR", _DEFVAL_INIDIR);
// if (m_strIniDir.IsEmpty())
// m_strIniDir = _DEFVAL_INIDIR;
// _mkdir(m_strIniDir);
// }
// sprintf(IniName, "%s\\%s", m_strIniDir, strIniFileName);
sprintf(IniName, "%s", strIniFileName); // 俺喊包府
return TRUE;
}
///////////////////////////////////////////////////////////////////////////////
int WINAPI IniGetInt(LPCTSTR szFileName, LPCTSTR szSectionName, LPCTSTR szEntryName, int nDefault)
{
char IniName[MAX_PATH];
CString strResult("");
char szStrValue[256] = {0};
memset(szStrValue, 0, sizeof(szStrValue));
::itoa(nDefault, szStrValue, 10);
if (GetIniName(IniName, szFileName))
{
strResult = IniGetStr(szFileName, szSectionName, szEntryName, szStrValue);
return ::atoi(strResult.GetBuffer(0));
}
else
return NULL;
}
///////////////////////////////////////////////////////////////////////////////
CString WINAPI IniGetStr(LPCTSTR szFileName, LPCTSTR szSectionName, LPCTSTR szEntryName, LPCTSTR szDefault)
{
char IniName[MAX_PATH];
CString strResult("");
char szValue[STRBUFFSIZE] = {0};
char szDefValue[STRBUFFSIZE] = {0};
UINT lResult;
memset(szValue, 0, sizeof(szValue));
if (GetIniName(IniName, szFileName))
{
lResult = ::GetPrivateProfileString(szSectionName, szEntryName, "",
szValue, sizeof(szValue), IniName);
strResult = szValue;
if (!lResult)
{
memset(szDefValue, 0, sizeof(szDefValue));
if (szDefault)
sprintf(szDefValue, "%s", szDefault);
lResult = IniSetStr(szFileName, szSectionName, szEntryName, szDefValue);
strResult = szDefValue;
}
return strResult;
}
return strResult;
}
///////////////////////////////////////////////////////////////////////////////
int WINAPI IniSetInt(LPCTSTR szFileName, LPCTSTR szSectionName, LPCTSTR szEntryName, int nValue)
{
char IniName[MAX_PATH];
char szStrValue[256] = {0};
int nRet = NULL;
memset(szStrValue, 0, sizeof(szStrValue));
::itoa(nValue, szStrValue, 10);
if (GetIniName(IniName, szFileName))
{
nRet = ::WritePrivateProfileString(szSectionName, szEntryName, szStrValue, IniName);
IniFlush(IniName);
}
return nRet;
}
///////////////////////////////////////////////////////////////////////////////
int WINAPI IniSetStr(LPCTSTR szFileName, LPCTSTR szSectionName, LPCTSTR szEntryName, LPCTSTR szValue)
{
char IniName[MAX_PATH];
int nRet = NULL;
if (GetIniName(IniName, szFileName))
{
nRet = ::WritePrivateProfileString(szSectionName, szEntryName, szValue, IniName);
IniFlush(IniName);
}
return nRet;
}
///////////////////////////////////////////////////////////////////////////////
int WINAPI IniFlush(LPCTSTR szFileName)
{
FILE* TempFp;
TempFp = fopen(szFileName, "ac");
if (TempFp)
{
fflush(TempFp);
fclose(TempFp);
}
return TRUE;
}
|
1f19927e04b5dfdaf5dd2791ab952a25c685bcbd | 169be0ecfe3108d74741a047773142490441ff13 | /src/path.cpp | 409fc4463772c33e14993b590b9a0b838bfb48da | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | ExternalRepositories/winapi-common | 2bd710220fdb8d53805091f197b39745fce1b926 | 0691ab3e886fcac63a6ed13a346ad16ae90ee5cb | refs/heads/master | 2023-08-23T23:42:24.871313 | 2021-09-26T16:16:16 | 2021-09-26T16:16:16 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,528 | cpp | path.cpp | // Copyright (c) 2020 Egor Tensin <Egor.Tensin@gmail.com>
// This file is part of the "winapi-common" project.
// For details, see https://github.com/egor-tensin/winapi-common.
// Distributed under the MIT License.
#include <winapi/error.hpp>
#include <winapi/path.hpp>
#include <winapi/utf8.hpp>
#include <windows.h>
#include <cstddef>
#include <limits>
#include <stdexcept>
#include <string>
#include <vector>
namespace winapi {
namespace {
std::wstring do_canonicalize(const std::wstring& path) {
static constexpr std::size_t init_buffer_size = MAX_PATH;
static_assert(init_buffer_size > 0, "init_buffer_size must be positive");
std::vector<wchar_t> buffer;
buffer.resize(init_buffer_size);
while (true) {
if (buffer.size() > std::numeric_limits<DWORD>::max())
throw std::range_error{"Path buffer is too large"};
const auto nch = ::GetFullPathNameW(
path.c_str(), static_cast<DWORD>(buffer.size()), buffer.data(), NULL);
if (nch == 0) {
throw error::windows(GetLastError(), "GetFullPathNameW");
}
if (nch < buffer.size()) {
return {buffer.data(), nch};
}
if (nch > buffer.size()) {
buffer.resize(2 * buffer.size());
}
}
}
} // namespace
CanonicalPath::CanonicalPath(const std::string& path) : m_path(canonicalize(path)) {}
std::string CanonicalPath::canonicalize(const std::string& path) {
return narrow(do_canonicalize(widen(path)));
}
} // namespace winapi
|
3aacdf863de6ca0df05abcb2332dd5b7fc5aa931 | cfeac52f970e8901871bd02d9acb7de66b9fb6b4 | /generated/src/aws-cpp-sdk-machinelearning/include/aws/machinelearning/model/DescribeDataSourcesRequest.h | b62fe61656f7325efc8b4df20b591a3e7a54b7f6 | [
"Apache-2.0",
"MIT",
"JSON"
] | permissive | aws/aws-sdk-cpp | aff116ddf9ca2b41e45c47dba1c2b7754935c585 | 9a7606a6c98e13c759032c2e920c7c64a6a35264 | refs/heads/main | 2023-08-25T11:16:55.982089 | 2023-08-24T18:14:53 | 2023-08-24T18:14:53 | 35,440,404 | 1,681 | 1,133 | Apache-2.0 | 2023-09-12T15:59:33 | 2015-05-11T17:57:32 | null | UTF-8 | C++ | false | false | 33,653 | h | DescribeDataSourcesRequest.h | /**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/machinelearning/MachineLearning_EXPORTS.h>
#include <aws/machinelearning/MachineLearningRequest.h>
#include <aws/machinelearning/model/DataSourceFilterVariable.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/machinelearning/model/SortOrder.h>
#include <utility>
namespace Aws
{
namespace MachineLearning
{
namespace Model
{
/**
*/
class DescribeDataSourcesRequest : public MachineLearningRequest
{
public:
AWS_MACHINELEARNING_API DescribeDataSourcesRequest();
// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "DescribeDataSources"; }
AWS_MACHINELEARNING_API Aws::String SerializePayload() const override;
AWS_MACHINELEARNING_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
/**
* <p>Use one of the following variables to filter a list of
* <code>DataSource</code>:</p> <ul> <li> <p> <code>CreatedAt</code> - Sets the
* search criteria to <code>DataSource</code> creation dates.</p> </li> <li> <p>
* <code>Status</code> - Sets the search criteria to <code>DataSource</code>
* statuses.</p> </li> <li> <p> <code>Name</code> - Sets the search criteria to the
* contents of <code>DataSource</code> <code>Name</code>.</p> </li> <li> <p>
* <code>DataUri</code> - Sets the search criteria to the URI of data files used to
* create the <code>DataSource</code>. The URI can identify either a file or an
* Amazon Simple Storage Service (Amazon S3) bucket or directory.</p> </li> <li>
* <p> <code>IAMUser</code> - Sets the search criteria to the user account that
* invoked the <code>DataSource</code> creation.</p> </li> </ul>
*/
inline const DataSourceFilterVariable& GetFilterVariable() const{ return m_filterVariable; }
/**
* <p>Use one of the following variables to filter a list of
* <code>DataSource</code>:</p> <ul> <li> <p> <code>CreatedAt</code> - Sets the
* search criteria to <code>DataSource</code> creation dates.</p> </li> <li> <p>
* <code>Status</code> - Sets the search criteria to <code>DataSource</code>
* statuses.</p> </li> <li> <p> <code>Name</code> - Sets the search criteria to the
* contents of <code>DataSource</code> <code>Name</code>.</p> </li> <li> <p>
* <code>DataUri</code> - Sets the search criteria to the URI of data files used to
* create the <code>DataSource</code>. The URI can identify either a file or an
* Amazon Simple Storage Service (Amazon S3) bucket or directory.</p> </li> <li>
* <p> <code>IAMUser</code> - Sets the search criteria to the user account that
* invoked the <code>DataSource</code> creation.</p> </li> </ul>
*/
inline bool FilterVariableHasBeenSet() const { return m_filterVariableHasBeenSet; }
/**
* <p>Use one of the following variables to filter a list of
* <code>DataSource</code>:</p> <ul> <li> <p> <code>CreatedAt</code> - Sets the
* search criteria to <code>DataSource</code> creation dates.</p> </li> <li> <p>
* <code>Status</code> - Sets the search criteria to <code>DataSource</code>
* statuses.</p> </li> <li> <p> <code>Name</code> - Sets the search criteria to the
* contents of <code>DataSource</code> <code>Name</code>.</p> </li> <li> <p>
* <code>DataUri</code> - Sets the search criteria to the URI of data files used to
* create the <code>DataSource</code>. The URI can identify either a file or an
* Amazon Simple Storage Service (Amazon S3) bucket or directory.</p> </li> <li>
* <p> <code>IAMUser</code> - Sets the search criteria to the user account that
* invoked the <code>DataSource</code> creation.</p> </li> </ul>
*/
inline void SetFilterVariable(const DataSourceFilterVariable& value) { m_filterVariableHasBeenSet = true; m_filterVariable = value; }
/**
* <p>Use one of the following variables to filter a list of
* <code>DataSource</code>:</p> <ul> <li> <p> <code>CreatedAt</code> - Sets the
* search criteria to <code>DataSource</code> creation dates.</p> </li> <li> <p>
* <code>Status</code> - Sets the search criteria to <code>DataSource</code>
* statuses.</p> </li> <li> <p> <code>Name</code> - Sets the search criteria to the
* contents of <code>DataSource</code> <code>Name</code>.</p> </li> <li> <p>
* <code>DataUri</code> - Sets the search criteria to the URI of data files used to
* create the <code>DataSource</code>. The URI can identify either a file or an
* Amazon Simple Storage Service (Amazon S3) bucket or directory.</p> </li> <li>
* <p> <code>IAMUser</code> - Sets the search criteria to the user account that
* invoked the <code>DataSource</code> creation.</p> </li> </ul>
*/
inline void SetFilterVariable(DataSourceFilterVariable&& value) { m_filterVariableHasBeenSet = true; m_filterVariable = std::move(value); }
/**
* <p>Use one of the following variables to filter a list of
* <code>DataSource</code>:</p> <ul> <li> <p> <code>CreatedAt</code> - Sets the
* search criteria to <code>DataSource</code> creation dates.</p> </li> <li> <p>
* <code>Status</code> - Sets the search criteria to <code>DataSource</code>
* statuses.</p> </li> <li> <p> <code>Name</code> - Sets the search criteria to the
* contents of <code>DataSource</code> <code>Name</code>.</p> </li> <li> <p>
* <code>DataUri</code> - Sets the search criteria to the URI of data files used to
* create the <code>DataSource</code>. The URI can identify either a file or an
* Amazon Simple Storage Service (Amazon S3) bucket or directory.</p> </li> <li>
* <p> <code>IAMUser</code> - Sets the search criteria to the user account that
* invoked the <code>DataSource</code> creation.</p> </li> </ul>
*/
inline DescribeDataSourcesRequest& WithFilterVariable(const DataSourceFilterVariable& value) { SetFilterVariable(value); return *this;}
/**
* <p>Use one of the following variables to filter a list of
* <code>DataSource</code>:</p> <ul> <li> <p> <code>CreatedAt</code> - Sets the
* search criteria to <code>DataSource</code> creation dates.</p> </li> <li> <p>
* <code>Status</code> - Sets the search criteria to <code>DataSource</code>
* statuses.</p> </li> <li> <p> <code>Name</code> - Sets the search criteria to the
* contents of <code>DataSource</code> <code>Name</code>.</p> </li> <li> <p>
* <code>DataUri</code> - Sets the search criteria to the URI of data files used to
* create the <code>DataSource</code>. The URI can identify either a file or an
* Amazon Simple Storage Service (Amazon S3) bucket or directory.</p> </li> <li>
* <p> <code>IAMUser</code> - Sets the search criteria to the user account that
* invoked the <code>DataSource</code> creation.</p> </li> </ul>
*/
inline DescribeDataSourcesRequest& WithFilterVariable(DataSourceFilterVariable&& value) { SetFilterVariable(std::move(value)); return *this;}
/**
* <p>The equal to operator. The <code>DataSource</code> results will have
* <code>FilterVariable</code> values that exactly match the value specified with
* <code>EQ</code>.</p>
*/
inline const Aws::String& GetEQ() const{ return m_eQ; }
/**
* <p>The equal to operator. The <code>DataSource</code> results will have
* <code>FilterVariable</code> values that exactly match the value specified with
* <code>EQ</code>.</p>
*/
inline bool EQHasBeenSet() const { return m_eQHasBeenSet; }
/**
* <p>The equal to operator. The <code>DataSource</code> results will have
* <code>FilterVariable</code> values that exactly match the value specified with
* <code>EQ</code>.</p>
*/
inline void SetEQ(const Aws::String& value) { m_eQHasBeenSet = true; m_eQ = value; }
/**
* <p>The equal to operator. The <code>DataSource</code> results will have
* <code>FilterVariable</code> values that exactly match the value specified with
* <code>EQ</code>.</p>
*/
inline void SetEQ(Aws::String&& value) { m_eQHasBeenSet = true; m_eQ = std::move(value); }
/**
* <p>The equal to operator. The <code>DataSource</code> results will have
* <code>FilterVariable</code> values that exactly match the value specified with
* <code>EQ</code>.</p>
*/
inline void SetEQ(const char* value) { m_eQHasBeenSet = true; m_eQ.assign(value); }
/**
* <p>The equal to operator. The <code>DataSource</code> results will have
* <code>FilterVariable</code> values that exactly match the value specified with
* <code>EQ</code>.</p>
*/
inline DescribeDataSourcesRequest& WithEQ(const Aws::String& value) { SetEQ(value); return *this;}
/**
* <p>The equal to operator. The <code>DataSource</code> results will have
* <code>FilterVariable</code> values that exactly match the value specified with
* <code>EQ</code>.</p>
*/
inline DescribeDataSourcesRequest& WithEQ(Aws::String&& value) { SetEQ(std::move(value)); return *this;}
/**
* <p>The equal to operator. The <code>DataSource</code> results will have
* <code>FilterVariable</code> values that exactly match the value specified with
* <code>EQ</code>.</p>
*/
inline DescribeDataSourcesRequest& WithEQ(const char* value) { SetEQ(value); return *this;}
/**
* <p>The greater than operator. The <code>DataSource</code> results will have
* <code>FilterVariable</code> values that are greater than the value specified
* with <code>GT</code>.</p>
*/
inline const Aws::String& GetGT() const{ return m_gT; }
/**
* <p>The greater than operator. The <code>DataSource</code> results will have
* <code>FilterVariable</code> values that are greater than the value specified
* with <code>GT</code>.</p>
*/
inline bool GTHasBeenSet() const { return m_gTHasBeenSet; }
/**
* <p>The greater than operator. The <code>DataSource</code> results will have
* <code>FilterVariable</code> values that are greater than the value specified
* with <code>GT</code>.</p>
*/
inline void SetGT(const Aws::String& value) { m_gTHasBeenSet = true; m_gT = value; }
/**
* <p>The greater than operator. The <code>DataSource</code> results will have
* <code>FilterVariable</code> values that are greater than the value specified
* with <code>GT</code>.</p>
*/
inline void SetGT(Aws::String&& value) { m_gTHasBeenSet = true; m_gT = std::move(value); }
/**
* <p>The greater than operator. The <code>DataSource</code> results will have
* <code>FilterVariable</code> values that are greater than the value specified
* with <code>GT</code>.</p>
*/
inline void SetGT(const char* value) { m_gTHasBeenSet = true; m_gT.assign(value); }
/**
* <p>The greater than operator. The <code>DataSource</code> results will have
* <code>FilterVariable</code> values that are greater than the value specified
* with <code>GT</code>.</p>
*/
inline DescribeDataSourcesRequest& WithGT(const Aws::String& value) { SetGT(value); return *this;}
/**
* <p>The greater than operator. The <code>DataSource</code> results will have
* <code>FilterVariable</code> values that are greater than the value specified
* with <code>GT</code>.</p>
*/
inline DescribeDataSourcesRequest& WithGT(Aws::String&& value) { SetGT(std::move(value)); return *this;}
/**
* <p>The greater than operator. The <code>DataSource</code> results will have
* <code>FilterVariable</code> values that are greater than the value specified
* with <code>GT</code>.</p>
*/
inline DescribeDataSourcesRequest& WithGT(const char* value) { SetGT(value); return *this;}
/**
* <p>The less than operator. The <code>DataSource</code> results will have
* <code>FilterVariable</code> values that are less than the value specified with
* <code>LT</code>.</p>
*/
inline const Aws::String& GetLT() const{ return m_lT; }
/**
* <p>The less than operator. The <code>DataSource</code> results will have
* <code>FilterVariable</code> values that are less than the value specified with
* <code>LT</code>.</p>
*/
inline bool LTHasBeenSet() const { return m_lTHasBeenSet; }
/**
* <p>The less than operator. The <code>DataSource</code> results will have
* <code>FilterVariable</code> values that are less than the value specified with
* <code>LT</code>.</p>
*/
inline void SetLT(const Aws::String& value) { m_lTHasBeenSet = true; m_lT = value; }
/**
* <p>The less than operator. The <code>DataSource</code> results will have
* <code>FilterVariable</code> values that are less than the value specified with
* <code>LT</code>.</p>
*/
inline void SetLT(Aws::String&& value) { m_lTHasBeenSet = true; m_lT = std::move(value); }
/**
* <p>The less than operator. The <code>DataSource</code> results will have
* <code>FilterVariable</code> values that are less than the value specified with
* <code>LT</code>.</p>
*/
inline void SetLT(const char* value) { m_lTHasBeenSet = true; m_lT.assign(value); }
/**
* <p>The less than operator. The <code>DataSource</code> results will have
* <code>FilterVariable</code> values that are less than the value specified with
* <code>LT</code>.</p>
*/
inline DescribeDataSourcesRequest& WithLT(const Aws::String& value) { SetLT(value); return *this;}
/**
* <p>The less than operator. The <code>DataSource</code> results will have
* <code>FilterVariable</code> values that are less than the value specified with
* <code>LT</code>.</p>
*/
inline DescribeDataSourcesRequest& WithLT(Aws::String&& value) { SetLT(std::move(value)); return *this;}
/**
* <p>The less than operator. The <code>DataSource</code> results will have
* <code>FilterVariable</code> values that are less than the value specified with
* <code>LT</code>.</p>
*/
inline DescribeDataSourcesRequest& WithLT(const char* value) { SetLT(value); return *this;}
/**
* <p>The greater than or equal to operator. The <code>DataSource</code> results
* will have <code>FilterVariable</code> values that are greater than or equal to
* the value specified with <code>GE</code>. </p>
*/
inline const Aws::String& GetGE() const{ return m_gE; }
/**
* <p>The greater than or equal to operator. The <code>DataSource</code> results
* will have <code>FilterVariable</code> values that are greater than or equal to
* the value specified with <code>GE</code>. </p>
*/
inline bool GEHasBeenSet() const { return m_gEHasBeenSet; }
/**
* <p>The greater than or equal to operator. The <code>DataSource</code> results
* will have <code>FilterVariable</code> values that are greater than or equal to
* the value specified with <code>GE</code>. </p>
*/
inline void SetGE(const Aws::String& value) { m_gEHasBeenSet = true; m_gE = value; }
/**
* <p>The greater than or equal to operator. The <code>DataSource</code> results
* will have <code>FilterVariable</code> values that are greater than or equal to
* the value specified with <code>GE</code>. </p>
*/
inline void SetGE(Aws::String&& value) { m_gEHasBeenSet = true; m_gE = std::move(value); }
/**
* <p>The greater than or equal to operator. The <code>DataSource</code> results
* will have <code>FilterVariable</code> values that are greater than or equal to
* the value specified with <code>GE</code>. </p>
*/
inline void SetGE(const char* value) { m_gEHasBeenSet = true; m_gE.assign(value); }
/**
* <p>The greater than or equal to operator. The <code>DataSource</code> results
* will have <code>FilterVariable</code> values that are greater than or equal to
* the value specified with <code>GE</code>. </p>
*/
inline DescribeDataSourcesRequest& WithGE(const Aws::String& value) { SetGE(value); return *this;}
/**
* <p>The greater than or equal to operator. The <code>DataSource</code> results
* will have <code>FilterVariable</code> values that are greater than or equal to
* the value specified with <code>GE</code>. </p>
*/
inline DescribeDataSourcesRequest& WithGE(Aws::String&& value) { SetGE(std::move(value)); return *this;}
/**
* <p>The greater than or equal to operator. The <code>DataSource</code> results
* will have <code>FilterVariable</code> values that are greater than or equal to
* the value specified with <code>GE</code>. </p>
*/
inline DescribeDataSourcesRequest& WithGE(const char* value) { SetGE(value); return *this;}
/**
* <p>The less than or equal to operator. The <code>DataSource</code> results will
* have <code>FilterVariable</code> values that are less than or equal to the value
* specified with <code>LE</code>.</p>
*/
inline const Aws::String& GetLE() const{ return m_lE; }
/**
* <p>The less than or equal to operator. The <code>DataSource</code> results will
* have <code>FilterVariable</code> values that are less than or equal to the value
* specified with <code>LE</code>.</p>
*/
inline bool LEHasBeenSet() const { return m_lEHasBeenSet; }
/**
* <p>The less than or equal to operator. The <code>DataSource</code> results will
* have <code>FilterVariable</code> values that are less than or equal to the value
* specified with <code>LE</code>.</p>
*/
inline void SetLE(const Aws::String& value) { m_lEHasBeenSet = true; m_lE = value; }
/**
* <p>The less than or equal to operator. The <code>DataSource</code> results will
* have <code>FilterVariable</code> values that are less than or equal to the value
* specified with <code>LE</code>.</p>
*/
inline void SetLE(Aws::String&& value) { m_lEHasBeenSet = true; m_lE = std::move(value); }
/**
* <p>The less than or equal to operator. The <code>DataSource</code> results will
* have <code>FilterVariable</code> values that are less than or equal to the value
* specified with <code>LE</code>.</p>
*/
inline void SetLE(const char* value) { m_lEHasBeenSet = true; m_lE.assign(value); }
/**
* <p>The less than or equal to operator. The <code>DataSource</code> results will
* have <code>FilterVariable</code> values that are less than or equal to the value
* specified with <code>LE</code>.</p>
*/
inline DescribeDataSourcesRequest& WithLE(const Aws::String& value) { SetLE(value); return *this;}
/**
* <p>The less than or equal to operator. The <code>DataSource</code> results will
* have <code>FilterVariable</code> values that are less than or equal to the value
* specified with <code>LE</code>.</p>
*/
inline DescribeDataSourcesRequest& WithLE(Aws::String&& value) { SetLE(std::move(value)); return *this;}
/**
* <p>The less than or equal to operator. The <code>DataSource</code> results will
* have <code>FilterVariable</code> values that are less than or equal to the value
* specified with <code>LE</code>.</p>
*/
inline DescribeDataSourcesRequest& WithLE(const char* value) { SetLE(value); return *this;}
/**
* <p>The not equal to operator. The <code>DataSource</code> results will have
* <code>FilterVariable</code> values not equal to the value specified with
* <code>NE</code>.</p>
*/
inline const Aws::String& GetNE() const{ return m_nE; }
/**
* <p>The not equal to operator. The <code>DataSource</code> results will have
* <code>FilterVariable</code> values not equal to the value specified with
* <code>NE</code>.</p>
*/
inline bool NEHasBeenSet() const { return m_nEHasBeenSet; }
/**
* <p>The not equal to operator. The <code>DataSource</code> results will have
* <code>FilterVariable</code> values not equal to the value specified with
* <code>NE</code>.</p>
*/
inline void SetNE(const Aws::String& value) { m_nEHasBeenSet = true; m_nE = value; }
/**
* <p>The not equal to operator. The <code>DataSource</code> results will have
* <code>FilterVariable</code> values not equal to the value specified with
* <code>NE</code>.</p>
*/
inline void SetNE(Aws::String&& value) { m_nEHasBeenSet = true; m_nE = std::move(value); }
/**
* <p>The not equal to operator. The <code>DataSource</code> results will have
* <code>FilterVariable</code> values not equal to the value specified with
* <code>NE</code>.</p>
*/
inline void SetNE(const char* value) { m_nEHasBeenSet = true; m_nE.assign(value); }
/**
* <p>The not equal to operator. The <code>DataSource</code> results will have
* <code>FilterVariable</code> values not equal to the value specified with
* <code>NE</code>.</p>
*/
inline DescribeDataSourcesRequest& WithNE(const Aws::String& value) { SetNE(value); return *this;}
/**
* <p>The not equal to operator. The <code>DataSource</code> results will have
* <code>FilterVariable</code> values not equal to the value specified with
* <code>NE</code>.</p>
*/
inline DescribeDataSourcesRequest& WithNE(Aws::String&& value) { SetNE(std::move(value)); return *this;}
/**
* <p>The not equal to operator. The <code>DataSource</code> results will have
* <code>FilterVariable</code> values not equal to the value specified with
* <code>NE</code>.</p>
*/
inline DescribeDataSourcesRequest& WithNE(const char* value) { SetNE(value); return *this;}
/**
* <p>A string that is found at the beginning of a variable, such as
* <code>Name</code> or <code>Id</code>.</p> <p>For example, a
* <code>DataSource</code> could have the <code>Name</code>
* <code>2014-09-09-HolidayGiftMailer</code>. To search for this
* <code>DataSource</code>, select <code>Name</code> for the
* <code>FilterVariable</code> and any of the following strings for the
* <code>Prefix</code>: </p> <ul> <li> <p>2014-09</p> </li> <li> <p>2014-09-09</p>
* </li> <li> <p>2014-09-09-Holiday</p> </li> </ul>
*/
inline const Aws::String& GetPrefix() const{ return m_prefix; }
/**
* <p>A string that is found at the beginning of a variable, such as
* <code>Name</code> or <code>Id</code>.</p> <p>For example, a
* <code>DataSource</code> could have the <code>Name</code>
* <code>2014-09-09-HolidayGiftMailer</code>. To search for this
* <code>DataSource</code>, select <code>Name</code> for the
* <code>FilterVariable</code> and any of the following strings for the
* <code>Prefix</code>: </p> <ul> <li> <p>2014-09</p> </li> <li> <p>2014-09-09</p>
* </li> <li> <p>2014-09-09-Holiday</p> </li> </ul>
*/
inline bool PrefixHasBeenSet() const { return m_prefixHasBeenSet; }
/**
* <p>A string that is found at the beginning of a variable, such as
* <code>Name</code> or <code>Id</code>.</p> <p>For example, a
* <code>DataSource</code> could have the <code>Name</code>
* <code>2014-09-09-HolidayGiftMailer</code>. To search for this
* <code>DataSource</code>, select <code>Name</code> for the
* <code>FilterVariable</code> and any of the following strings for the
* <code>Prefix</code>: </p> <ul> <li> <p>2014-09</p> </li> <li> <p>2014-09-09</p>
* </li> <li> <p>2014-09-09-Holiday</p> </li> </ul>
*/
inline void SetPrefix(const Aws::String& value) { m_prefixHasBeenSet = true; m_prefix = value; }
/**
* <p>A string that is found at the beginning of a variable, such as
* <code>Name</code> or <code>Id</code>.</p> <p>For example, a
* <code>DataSource</code> could have the <code>Name</code>
* <code>2014-09-09-HolidayGiftMailer</code>. To search for this
* <code>DataSource</code>, select <code>Name</code> for the
* <code>FilterVariable</code> and any of the following strings for the
* <code>Prefix</code>: </p> <ul> <li> <p>2014-09</p> </li> <li> <p>2014-09-09</p>
* </li> <li> <p>2014-09-09-Holiday</p> </li> </ul>
*/
inline void SetPrefix(Aws::String&& value) { m_prefixHasBeenSet = true; m_prefix = std::move(value); }
/**
* <p>A string that is found at the beginning of a variable, such as
* <code>Name</code> or <code>Id</code>.</p> <p>For example, a
* <code>DataSource</code> could have the <code>Name</code>
* <code>2014-09-09-HolidayGiftMailer</code>. To search for this
* <code>DataSource</code>, select <code>Name</code> for the
* <code>FilterVariable</code> and any of the following strings for the
* <code>Prefix</code>: </p> <ul> <li> <p>2014-09</p> </li> <li> <p>2014-09-09</p>
* </li> <li> <p>2014-09-09-Holiday</p> </li> </ul>
*/
inline void SetPrefix(const char* value) { m_prefixHasBeenSet = true; m_prefix.assign(value); }
/**
* <p>A string that is found at the beginning of a variable, such as
* <code>Name</code> or <code>Id</code>.</p> <p>For example, a
* <code>DataSource</code> could have the <code>Name</code>
* <code>2014-09-09-HolidayGiftMailer</code>. To search for this
* <code>DataSource</code>, select <code>Name</code> for the
* <code>FilterVariable</code> and any of the following strings for the
* <code>Prefix</code>: </p> <ul> <li> <p>2014-09</p> </li> <li> <p>2014-09-09</p>
* </li> <li> <p>2014-09-09-Holiday</p> </li> </ul>
*/
inline DescribeDataSourcesRequest& WithPrefix(const Aws::String& value) { SetPrefix(value); return *this;}
/**
* <p>A string that is found at the beginning of a variable, such as
* <code>Name</code> or <code>Id</code>.</p> <p>For example, a
* <code>DataSource</code> could have the <code>Name</code>
* <code>2014-09-09-HolidayGiftMailer</code>. To search for this
* <code>DataSource</code>, select <code>Name</code> for the
* <code>FilterVariable</code> and any of the following strings for the
* <code>Prefix</code>: </p> <ul> <li> <p>2014-09</p> </li> <li> <p>2014-09-09</p>
* </li> <li> <p>2014-09-09-Holiday</p> </li> </ul>
*/
inline DescribeDataSourcesRequest& WithPrefix(Aws::String&& value) { SetPrefix(std::move(value)); return *this;}
/**
* <p>A string that is found at the beginning of a variable, such as
* <code>Name</code> or <code>Id</code>.</p> <p>For example, a
* <code>DataSource</code> could have the <code>Name</code>
* <code>2014-09-09-HolidayGiftMailer</code>. To search for this
* <code>DataSource</code>, select <code>Name</code> for the
* <code>FilterVariable</code> and any of the following strings for the
* <code>Prefix</code>: </p> <ul> <li> <p>2014-09</p> </li> <li> <p>2014-09-09</p>
* </li> <li> <p>2014-09-09-Holiday</p> </li> </ul>
*/
inline DescribeDataSourcesRequest& WithPrefix(const char* value) { SetPrefix(value); return *this;}
/**
* <p>A two-value parameter that determines the sequence of the resulting list of
* <code>DataSource</code>.</p> <ul> <li> <p> <code>asc</code> - Arranges the list
* in ascending order (A-Z, 0-9).</p> </li> <li> <p> <code>dsc</code> - Arranges
* the list in descending order (Z-A, 9-0).</p> </li> </ul> <p>Results are sorted
* by <code>FilterVariable</code>.</p>
*/
inline const SortOrder& GetSortOrder() const{ return m_sortOrder; }
/**
* <p>A two-value parameter that determines the sequence of the resulting list of
* <code>DataSource</code>.</p> <ul> <li> <p> <code>asc</code> - Arranges the list
* in ascending order (A-Z, 0-9).</p> </li> <li> <p> <code>dsc</code> - Arranges
* the list in descending order (Z-A, 9-0).</p> </li> </ul> <p>Results are sorted
* by <code>FilterVariable</code>.</p>
*/
inline bool SortOrderHasBeenSet() const { return m_sortOrderHasBeenSet; }
/**
* <p>A two-value parameter that determines the sequence of the resulting list of
* <code>DataSource</code>.</p> <ul> <li> <p> <code>asc</code> - Arranges the list
* in ascending order (A-Z, 0-9).</p> </li> <li> <p> <code>dsc</code> - Arranges
* the list in descending order (Z-A, 9-0).</p> </li> </ul> <p>Results are sorted
* by <code>FilterVariable</code>.</p>
*/
inline void SetSortOrder(const SortOrder& value) { m_sortOrderHasBeenSet = true; m_sortOrder = value; }
/**
* <p>A two-value parameter that determines the sequence of the resulting list of
* <code>DataSource</code>.</p> <ul> <li> <p> <code>asc</code> - Arranges the list
* in ascending order (A-Z, 0-9).</p> </li> <li> <p> <code>dsc</code> - Arranges
* the list in descending order (Z-A, 9-0).</p> </li> </ul> <p>Results are sorted
* by <code>FilterVariable</code>.</p>
*/
inline void SetSortOrder(SortOrder&& value) { m_sortOrderHasBeenSet = true; m_sortOrder = std::move(value); }
/**
* <p>A two-value parameter that determines the sequence of the resulting list of
* <code>DataSource</code>.</p> <ul> <li> <p> <code>asc</code> - Arranges the list
* in ascending order (A-Z, 0-9).</p> </li> <li> <p> <code>dsc</code> - Arranges
* the list in descending order (Z-A, 9-0).</p> </li> </ul> <p>Results are sorted
* by <code>FilterVariable</code>.</p>
*/
inline DescribeDataSourcesRequest& WithSortOrder(const SortOrder& value) { SetSortOrder(value); return *this;}
/**
* <p>A two-value parameter that determines the sequence of the resulting list of
* <code>DataSource</code>.</p> <ul> <li> <p> <code>asc</code> - Arranges the list
* in ascending order (A-Z, 0-9).</p> </li> <li> <p> <code>dsc</code> - Arranges
* the list in descending order (Z-A, 9-0).</p> </li> </ul> <p>Results are sorted
* by <code>FilterVariable</code>.</p>
*/
inline DescribeDataSourcesRequest& WithSortOrder(SortOrder&& value) { SetSortOrder(std::move(value)); return *this;}
/**
* <p>The ID of the page in the paginated results.</p>
*/
inline const Aws::String& GetNextToken() const{ return m_nextToken; }
/**
* <p>The ID of the page in the paginated results.</p>
*/
inline bool NextTokenHasBeenSet() const { return m_nextTokenHasBeenSet; }
/**
* <p>The ID of the page in the paginated results.</p>
*/
inline void SetNextToken(const Aws::String& value) { m_nextTokenHasBeenSet = true; m_nextToken = value; }
/**
* <p>The ID of the page in the paginated results.</p>
*/
inline void SetNextToken(Aws::String&& value) { m_nextTokenHasBeenSet = true; m_nextToken = std::move(value); }
/**
* <p>The ID of the page in the paginated results.</p>
*/
inline void SetNextToken(const char* value) { m_nextTokenHasBeenSet = true; m_nextToken.assign(value); }
/**
* <p>The ID of the page in the paginated results.</p>
*/
inline DescribeDataSourcesRequest& WithNextToken(const Aws::String& value) { SetNextToken(value); return *this;}
/**
* <p>The ID of the page in the paginated results.</p>
*/
inline DescribeDataSourcesRequest& WithNextToken(Aws::String&& value) { SetNextToken(std::move(value)); return *this;}
/**
* <p>The ID of the page in the paginated results.</p>
*/
inline DescribeDataSourcesRequest& WithNextToken(const char* value) { SetNextToken(value); return *this;}
/**
* <p> The maximum number of <code>DataSource</code> to include in the result.</p>
*/
inline int GetLimit() const{ return m_limit; }
/**
* <p> The maximum number of <code>DataSource</code> to include in the result.</p>
*/
inline bool LimitHasBeenSet() const { return m_limitHasBeenSet; }
/**
* <p> The maximum number of <code>DataSource</code> to include in the result.</p>
*/
inline void SetLimit(int value) { m_limitHasBeenSet = true; m_limit = value; }
/**
* <p> The maximum number of <code>DataSource</code> to include in the result.</p>
*/
inline DescribeDataSourcesRequest& WithLimit(int value) { SetLimit(value); return *this;}
private:
DataSourceFilterVariable m_filterVariable;
bool m_filterVariableHasBeenSet = false;
Aws::String m_eQ;
bool m_eQHasBeenSet = false;
Aws::String m_gT;
bool m_gTHasBeenSet = false;
Aws::String m_lT;
bool m_lTHasBeenSet = false;
Aws::String m_gE;
bool m_gEHasBeenSet = false;
Aws::String m_lE;
bool m_lEHasBeenSet = false;
Aws::String m_nE;
bool m_nEHasBeenSet = false;
Aws::String m_prefix;
bool m_prefixHasBeenSet = false;
SortOrder m_sortOrder;
bool m_sortOrderHasBeenSet = false;
Aws::String m_nextToken;
bool m_nextTokenHasBeenSet = false;
int m_limit;
bool m_limitHasBeenSet = false;
};
} // namespace Model
} // namespace MachineLearning
} // namespace Aws
|
4577d68fc66afbca7aac39fa9a35565f598f9956 | 5ab424891c2f9b5efa85c0177571fc70d94836d3 | /Matrix3/Matrix3/Matrix.h | 136d3400f3cf609b8fdcb3a42fee1e8c8619b714 | [] | no_license | OnlyDeniko/lab2 | e45178fecddd317a7221b802924cc31467eaf90d | 9eef47b4da0af027d6afb163022aa16941110819 | refs/heads/master | 2020-08-04T10:43:48.500195 | 2019-10-31T19:44:48 | 2019-10-31T19:44:48 | 212,109,528 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 673 | h | Matrix.h | #include<istream>
#include<ostream>
class Matrix {
private:
int **mem;
int size;
public:
Matrix(int _size = 0);
Matrix(const Matrix & tmp);
Matrix &operator=(const Matrix &tmp);
friend std::istream & operator >> (std::istream & in, Matrix & tmp) {
for (int i = 0; i < tmp.size; i++) {
for (int j = 0; j < tmp.size - i; j++) {
in >> tmp.mem[i][j];
}
}
return in;
}
friend std::ostream & operator << (std::ostream & out, const Matrix & tmp) {
for (int i = 0; i < tmp.size; i++) {
for (int j = 0; j < tmp.size; j++) {
if (j < i) out << "0 ";
else out << tmp.mem[i][j - i] << ' ';
}
out << '\n';
}
return out;
}
~Matrix();
};
|
301a29b90b40191a74e39df338d06f996a4b0f01 | 6d715e321fb9574fb3ca329a46d1f1774df4ed53 | /Nodo.cpp | a2bfd0cf6ba0eed256fd3044327aff5f0028c83d | [] | no_license | ksummers91/visualS | bcf25d6dd866e3e4734ac81be7c5f0e98a066b09 | 52b9e9c3f129f9549cdde1b71c7ba7837628d36f | refs/heads/master | 2021-01-18T10:15:35.791573 | 2014-02-17T22:52:08 | 2014-02-17T22:52:08 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 153 | cpp | Nodo.cpp | #include "Nodo.h"
#include "Lista.h"
Nodo::Nodo()
{
this->carta = new Card();
this->siguiente=NULL;
//ctor
}
Nodo::~Nodo()
{
//dtor
}
|
e1fff396bc217902fe8452ab3a191574e065f927 | c6e38de8e3883ff1e262f9583b61283ae757c4ac | /neural_net_lib/inc/neural_net.h | 2ce1c9f6294ac84d7fd4209304f5cd52d04896a8 | [] | no_license | NikolaDucak/neuralnet | 26bab04c2531736ffe9848dc2b49b8997deec364 | ba4192c3d019e5f2b5e54927f7462a4706eec116 | refs/heads/master | 2021-07-13T14:30:03.465335 | 2021-03-19T23:25:01 | 2021-03-19T23:25:01 | 230,954,263 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,685 | h | neural_net.h |
#ifndef __NEURAL_NETWORK_H__
#define __NEURAL_NETWORK_H__
#include <tuple>
#include <vector>
#include <boost/serialization/array.hpp>
#include <boost/serialization/vector.hpp>
#define EIGEN_DENSEBASE_PLUGIN "eigen_serialization.h"
#include <Eigen/Core>
#include <boost/archive/binary_iarchive.hpp>
#include <boost/archive/binary_oarchive.hpp>
// shortening used eigen class' names
using matrix = Eigen::MatrixXf;
using vector = Eigen::VectorXf;
// input and corresponding correct output vector
struct instance {
vector input, output;
};
using data_set = std::vector<instance>;
class neural_net {
public:
explicit neural_net(const std::vector<unsigned> &topology);
~neural_net() = default;
[[nodiscard]] vector feed_forward(const vector &input) const;
// splits training_set into batches of batch_size and for each calls
// propagate_batch
void train(const data_set &training_set, unsigned epochs, unsigned batch_size,
float learning_rate);
[[nodiscard]] float mean_squared_error(const data_set &test_set) const;
[[nodiscard]] std::vector<matrix> get_weights() const { return m_weights; }
[[nodiscard]] std::vector<vector> get_biases() const { return m_biases; }
[[nodiscard]] std::vector<unsigned> get_topology() const { return m_topology; }
template <class Archive>
friend Archive &operator<<(Archive &a, const neural_net &n) {
a << n.m_biases << n.m_weights << n.m_topology;
return a;
}
template <class Archive>
friend Archive &operator>>(Archive &a, neural_net &n) {
a >> n.m_biases >> n.m_weights >> n.m_topology;
return a;
}
static neural_net deserialize(const std::string &file_path);
static void serialize(const neural_net &nn, const std::string &file_path);
private:
neural_net() = default;
// starting from start_index in training_set, for each InOutPair calls
// propagate_back and averages delta values
void propagate_batch(const data_set &training_set, unsigned start_index,
unsigned batch_size, float learning_rate);
// returns changes for each weight matrix and change for each bias matrix
[[nodiscard]] std::tuple<std::vector<matrix>, std::vector<vector>>
get_delta_weights_and_biases(const vector &input,
const vector &desired_output,
float learning_rate) const;
// activation functions and their derivatives
static float sigmoid(float x);
static float d_sigmoid(float x);
std::vector<matrix> m_weights;
std::vector<vector> m_biases;
std::vector<unsigned> m_topology;
};
#endif
|
7c93d3696f56286cb068a56e2b1fe24a3f263511 | f7c21624103462928c9816df4d2b0b97f28fb439 | /mohe-sx-game-server/MJShanxi2/LogicServer/malgo_can_zheng.cpp | 3b13f5f1cb3f630190794c767821ad14ed34e1b1 | [] | no_license | Pircs/lipengServer | 17e1fc7595e8e55e5b2b7e5f582be062e7713f40 | 1e7c13338eee6398e5ada73d31845aecd9d920d8 | refs/heads/master | 2020-09-18T10:33:08.268173 | 2019-10-07T11:13:00 | 2019-10-07T11:13:00 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 8,854 | cpp | malgo_can_zheng.cpp |
#include "malgo.h"
// 检测边缘一张牌能不能和后面的牌成为顺子,行的话就剔除这个顺子
static bool malgo_can_zheng__remove_shunzi(TILE_COLOR tc, unsigned *a, HuBranch &branch, unsigned i) {
if (i + 2 >= TILE_NUMBER_COUNT) return false;
if (a[i + 1] == 0 || a[i + 2] == 0) return false;
a[i] -= 1;
a[i + 1] -= 1;
a[i + 2] -= 1;
branch.add(HunItem(HUN0_SHUN, tile_make(tc, i + 1)));
return true;
}
// 已经知道边缘3张牌是刻子,剔除它们
static void malgo_can_zheng__remove_kezi(TILE_COLOR tc, unsigned *a, HuBranch &branch, unsigned i) {
a[i] -= 3;
branch.add(HunItem(HUN0_KE, tile_make(tc, i + 1)));
}
static bool malgo_can_zheng__shupai(TILE_COLOR tc, unsigned *a, HuBranch &branch, FANXING conf, unsigned i);
// 走到这里,是说边缘是1张相同的牌
static bool malgo_can_zheng__on_1(TILE_COLOR tc, unsigned *a, HuBranch &branch, FANXING conf, unsigned i) {
if (!malgo_can_zheng__remove_shunzi(tc, a, branch, i)) return false;
return malgo_can_zheng__shupai(tc, a, branch, conf, i);
}
// 走到这里,是说边缘是2张相同的牌
static bool malgo_can_zheng__on_2(TILE_COLOR tc, unsigned *a, HuBranch &branch, FANXING conf, unsigned i) {
if (!malgo_can_zheng__remove_shunzi(tc, a, branch, i)) return false;
if (!malgo_can_zheng__remove_shunzi(tc, a, branch, i)) return false;
return malgo_can_zheng__shupai(tc, a, branch, conf, i);
}
static bool malgo_can_zheng__on_3__try_shunzi(TILE_COLOR tc, unsigned *a, HuBranch &branch, FANXING conf, unsigned i) {
if (!malgo_can_zheng__remove_shunzi(tc, a, branch, i)) return false;
if (!malgo_can_zheng__remove_shunzi(tc, a, branch, i)) return false;
if (!malgo_can_zheng__remove_shunzi(tc, a, branch, i)) return false;
return malgo_can_zheng__shupai(tc, a, branch, conf, i);
}
// 走到这里,是说边缘是3张相同的牌
static bool malgo_can_zheng__on_3(TILE_COLOR tc, unsigned *a, HuBranch &branch, FANXING conf, unsigned i) {
// 在需要分支的时候才做副本
unsigned saved_a[TILE_NUMBER_COUNT];
memcpy(saved_a, a, sizeof(saved_a));
malgo_can_zheng__remove_kezi(tc, a, branch, i);
// 把边缘3张做为刻子用,剩下的牌胡不了的话,那边缘9张当3个顺子用肯定也胡不了
// 因此只需要检测一种就行了
// 立四优先用顺子,这样能搜到最优解
bool kezi_checked = false;
bool shunzi_checked = false;
if (conf & FAN_BianKanDiao) goto check_shunzi;
check_kezi:
if (malgo_can_zheng__shupai(tc, a, branch, conf, i + 1)) return true;
kezi_checked = true;
if (shunzi_checked) return false;
check_shunzi:
if (malgo_can_zheng__on_3__try_shunzi(tc, saved_a, branch, conf, i)) return true;
shunzi_checked = true;
if (!kezi_checked) goto check_kezi;
return false;
}
// 走到这里,是说边缘是4张相同的牌
static bool malgo_can_zheng__on_4(TILE_COLOR tc, unsigned *a, HuBranch &branch, FANXING conf, unsigned i) {
if (!malgo_can_zheng__remove_shunzi(tc, a, branch, i)) return false;
return malgo_can_zheng__on_3(tc, a, branch, conf, i);
}
// 能不能按面子(刻子、顺子)完整拆分
// 并按conf指定的搜索顺序选定一个路径输出
// 整体架构是在有序牌向量上,从起始端开始判断,不可能胡就提前返回了,有可能胡就继续深入判断
// 用递归实现的深度优先搜索
static bool malgo_can_zheng__shupai(TILE_COLOR tc, unsigned *a, HuBranch &branch, FANXING conf, unsigned i) {
// 如果是空的,说明能按面子完整拆分
while (i < TILE_NUMBER_COUNT && 0 == a[i]) ++i;
if (i >= TILE_NUMBER_COUNT) return true;
unsigned count = a[i];
// 判断3n张牌是否能组成顺子或者是暗刻,是通过判断边缘牌的数量:
// (1) 如果是1张或2张,要胡牌的话,它必须和后面的牌组成顺子,否自不能胡。
// (3) 如果是3张,要胡牌有两种可能,一种是把3张当做是暗刻,另一种是这3张都与后面的牌组成顺子。
// 如果只是判断胡不胡牌,这两种任意一种都是一样的,如果要计算分数,就要自己分开算了。
// (4) 如果是4张,要胡牌的话,有1张要和后面的牌组成顺子,剩下的3张牌又可以继续(3)的操作。
switch (count) {
case 1: return malgo_can_zheng__on_1(tc, a, branch, conf, i);
case 2: return malgo_can_zheng__on_2(tc, a, branch, conf, i);
case 3: return malgo_can_zheng__on_3(tc, a, branch, conf, i);
case 4: return malgo_can_zheng__on_4(tc, a, branch, conf, i);
}
return false;
}
static bool malgo_can_zheng__FengPai(tile_t last_tile, unsigned *a, HuBranch &branch) {
for (unsigned i = 0; i < 4; ++i) {
if (a[i] % 3 != 0) return false;
if (a[i]) branch.add(HunItem(HUN0_KE, tile_make(TILE_COLOR_ZI, i + 1)));
}
return true;
}
static bool malgo_can_zheng__JianPai(tile_t last_tile, unsigned *a, HuBranch &branch) {
for (unsigned i = 4; i < 7; ++i) {
if (a[i] % 3 != 0) return false;
if (a[i]) branch.add(HunItem(HUN0_KE, tile_make(TILE_COLOR_ZI, i + 1)));
}
return true;
}
static bool all_have(unsigned *a, unsigned n, unsigned count) {
for (unsigned i = 0; i < n; ++i) {
if (a[i] < count) return false;
}
return true;
}
static void all_decrease(unsigned *a, unsigned n, unsigned count) {
for (unsigned i = 0; i < n; ++i) a[i] -= count;
}
static int malgo_can_zheng__SanFeng__select_maximized_branch(tile_t last_tile, unsigned *a, HuBranch &branch, unsigned i, unsigned max_left);
static int malgo_can_zheng__SanFeng__go_this_branch(tile_t const last_tile, unsigned *a, HuBranch &branch, unsigned const i, unsigned const n, unsigned const max_left) {
// 具体到某个位置的某种三风数,检测是否存在,如果不存在,说明这个分支无效,可以立即返回 -999
if (n) {
// 在目标位置上虚拟n个风,检测四风是否有n个
a[i] += n;
if (all_have(a, 4, n)) {
all_decrease(a, 4, n);
} else {
a[i] -= n;
return -999;
}
}
// 看下一个位置上的5种三风数可能性
// 如果没有下一个位置了,就看剩余的牌能不能整切
// 如果没有剩余的三风数可去测试了,也要看剩余的牌能不能整切
unsigned total = n;
if (i + 1 >= 4 || n == max_left) {
// 剩余的能整切就好,不然就返回一个大负数,表示这个分支无效
if (!malgo_can_zheng__FengPai(last_tile, a, branch)) return -999;
} else {
// 根据上面的判断,到这里肯定还有剩余的三风数可供测试,那就继续看下一个位置
total += malgo_can_zheng__SanFeng__select_maximized_branch(last_tile, a, branch, i + 1, max_left - n);
}
// 确定这个分支是有效的,并且有三风,才填充 HuBranch
if (total > 0) {
branch.add_n(n, HunItem(HUN0_SHUN_SanFeng, tile_make(TILE_COLOR_ZI, i + 1)));
}
return total;
}
static int malgo_can_zheng__SanFeng__select_maximized_branch(tile_t last_tile, unsigned *a, HuBranch &branch, unsigned i, unsigned max_left) {
int counts[5];
HuBranch branches[5];
for (unsigned n = 0; n <= max_left; ++n) {
unsigned a_copy[4];
memcpy(a_copy, a, sizeof(a[0]) * 4);
counts[n] = malgo_can_zheng__SanFeng__go_this_branch(last_tile, a_copy, branches[n], i, n, max_left);
}
size_t n = std::max_element(counts, counts + max_left + 1) - counts;
int count = counts[n];
if (count >= 0) branch.extend(branches[n]);
return count;
}
static bool malgo_can_zheng__SanFeng(tile_t last_tile, unsigned *a, HuBranch &branch) {
// 任意不一样的3个风就为一嘴,当成一个顺子,能胡牌用的
// 4个位置,每个位置有01234个三风这5种可能性,总的三风数最多是4个,搜索目标是三风数目最大化
int count = malgo_can_zheng__SanFeng__select_maximized_branch(last_tile, a, branch, 0, 4);
// 负值表示不能整切,正值表示这个分支上有几个三风
return count >= 0;
}
static bool malgo_can_zheng__SanYuan(tile_t last_tile, unsigned *a, HuBranch &branch) {
while (all_have(a + 4, 3, 1)) {
all_decrease(a + 4, 3, 1);
branch.add(HunItem(HUN0_SHUN_SanYuan, 45));
}
return malgo_can_zheng__JianPai(last_tile, a, branch);
}
typedef bool(*ZiPaiHandler)(tile_t last_tile, unsigned *a, HuBranch &branch);
static ZiPaiHandler GetFengPaiHandler(FANXING conf) {
if (conf & FAN_JUDGE_SanFeng) return malgo_can_zheng__SanFeng;
return malgo_can_zheng__FengPai;
}
static ZiPaiHandler GetJianPaiHandler(FANXING conf) {
if (conf & FAN_JUDGE_SanYuan) return malgo_can_zheng__SanYuan;
return malgo_can_zheng__JianPai;
}
bool malgo_can_zheng(TILE_COLOR tc, tile_t last_tile, unsigned *a, HuBranch &branch, FANXING conf) {
if (tc == TILE_COLOR_ZI) {
// 字牌风部和箭部对于整切来说,是无关的,所以分开计算也是没问题的
return GetFengPaiHandler(conf)(last_tile, a, branch) && GetJianPaiHandler(conf)(last_tile, a, branch);
}
return malgo_can_zheng__shupai(tc, a, branch, conf, 0);
}
|
08016018db11de1c9267de6d156fc90ed51169a5 | 9ed99d6623620ccc9bcf0e01624ea47f87360da8 | /OmnibotGame/src/Leaf.cpp | 068a3d699e9cb046e2a8001d583417fd38b6e025 | [
"MIT"
] | permissive | arigus/omniBotProto | c468410f3d5d77ce9336f510f8c5a5011a41424e | 5abf1b5a9846ba093325af7a86ee2d7b8cbe12e6 | refs/heads/master | 2020-03-10T04:01:06.181987 | 2018-04-04T12:13:30 | 2018-04-04T12:13:30 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 522 | cpp | Leaf.cpp | #include "Leaf.h"
using namespace std;
using namespace ci;
Leaf::Leaf(){}
LeafRef Leaf::create()
{
return make_shared<Leaf>();
}
void Leaf::updateMatrix()
{
//if (length2(speed)<0.01)return;
glm::mat4 t = glm::translate(vec3(position.x, position.y, position.z));
glm::mat4 s = glm::scale(vec3(scale, scale, scale));
glm::mat4 rx = glm::rotate(rotation.x, vec3(1, 0, 0));
glm::mat4 ry = glm::rotate(rotation.y, vec3(0, 1, 0));
glm::mat4 rz = glm::rotate(rotation.z, vec3(0, 0, 1));
matrix = t*rx*ry*rz *s;
} |
9351cd1396dd3a1e61158c677f4ad0e50f62adee | b920e8e33d1ba49fbf04c619608f230f2ea6a23f | /CGdraw.h | 7f6a27fcc5dfda00fb0446ebc39f7f4d791de6a3 | [] | no_license | qiuyingyue/project | 1ae349d70bf77edd0a20fdafb3d74419c70dbfe8 | 909d8498cf4e4fe2a3ef26b275180858a7fe5b67 | refs/heads/master | 2020-12-25T17:03:41.467017 | 2016-01-11T15:05:25 | 2016-01-11T15:05:25 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 361 | h | CGdraw.h | #include "CGdrive.h"
extern GLint snowman_display_list; //一个雪人的显示列表索引
extern class ObjectWall wall[NUM_WALL];
GLuint createDL();
void drawSnowMan();
void drawMonitor();
class ObjectWall{
public:
float width;
float height;
float length;
float x;
float y;
float h;
void draw();
void glTexCubic();
ObjectWall(){};
};
void test(); |
ebf5c0186f37314998032559f5a4233d09a020cf | f0749232d54f17e3c321b0b90daaeb23b9faec82 | /Online Judge Code/[Other] Online-Judge-Solutions-master_from github/SPOJ/Classical/2815 - Increasing Subsequences.cpp | 6ca7ed576846182fd9ca10fde5b6b138641f2038 | [] | no_license | tmuttaqueen/MyCodes | c9024a5b901e68e7c7466885eddbfcd31a5c9780 | 80ec40b26649029ad546ce8ce5bfec0b314b1f61 | refs/heads/master | 2020-04-18T22:20:51.845309 | 2019-05-16T18:11:02 | 2019-05-16T18:11:02 | 167,791,029 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 770 | cpp | 2815 - Increasing Subsequences.cpp | #include <cstdio>
using namespace std;
#define MOD 5000000
int dp[51][100001];
void update(int bit[], int idx, int val){
for(int x = idx;x <= 100000;x += x & -x){
bit[x] += val;
if(bit[x] >= MOD) bit[x] -= MOD;
}
}
int query(int bit[], int idx){
int ret = 0;
for(int x = idx;x > 0;x -= x & -x){
ret += bit[x];
if(ret >= MOD) ret -= MOD;
}
return ret;
}
int main(){
int N,K;
scanf("%d %d",&N,&K);
int ans = 0;
for(int i = 0,x;i < N;++i){
scanf("%d",&x);
for(int k = K;k > 1;--k)
update(dp[k],x + 1,query(dp[k - 1],x));
update(dp[1],x + 1,1);
}
printf("%d\n",query(dp[K],100000));
return 0;
}
|
99c6a1f5231a44ae77af660395df58dd2724a51a | 7556139eba33cbbbf0e0262c69e9c8b56e08a399 | /include/RED4ext/Scripting/Natives/Generated/ent/ColliderComponentBox.hpp | 7dd81b0110dcde1cd28f4e0d2af2c85c00d4de72 | [
"MIT"
] | permissive | vandermerwewaj/RED4ext.SDK | 3ef7563a1855e6206097fdf6c5b44ae1c1c2c20d | 9dd544a221a39f27c8d38aa23a607b31aba1715a | refs/heads/master | 2023-09-05T06:32:39.278419 | 2021-11-22T15:01:18 | 2021-11-22T15:01:18 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 634 | hpp | ColliderComponentBox.hpp | #pragma once
// This file is generated from the Game's Reflection data
#include <cstdint>
#include <RED4ext/Common.hpp>
#include <RED4ext/Scripting/Natives/Generated/Vector3.hpp>
#include <RED4ext/Scripting/Natives/Generated/ent/ColliderComponentShape.hpp>
namespace RED4ext
{
namespace ent {
struct ColliderComponentBox : ent::ColliderComponentShape
{
static constexpr const char* NAME = "entColliderComponentBox";
static constexpr const char* ALIAS = NAME;
Vector3 dimensions; // 50
uint8_t unk5C[0x60 - 0x5C]; // 5C
};
RED4EXT_ASSERT_SIZE(ColliderComponentBox, 0x60);
} // namespace ent
} // namespace RED4ext
|
6f445c3ad10e491cd26b04ccba5ce39e399e1291 | 6f77485702ea6975b3d01c9adcddd5fd84867ad8 | /unendingLoop.CPP | 03ea56d052812bcebd8c3b54d3b07d393c565f7d | [] | no_license | G-Nikita/C-Programs | 85ee302defe00c8391142592611ecfc7365b9d8d | da552945cece2ea8fd96abaeea668dbc68207a63 | refs/heads/main | 2023-05-04T05:12:44.852834 | 2021-05-23T10:17:11 | 2021-05-23T10:17:11 | 370,019,229 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 191 | cpp | unendingLoop.CPP | //loop that never ends
#include<stdio.h>
#include<conio.h>
viod main()
{
int a;
clrscr();
printf("enter any number");
scanf("%d",&a);
while(a!=10)
{
printf("%d",a);
}
getch();
} |
0d529d61a993ce7171ab74759e62b4bd07b35d31 | fc30dbc3a456aa4c309eb80a13fc2c1b998f4f42 | /Binary search tree/Добавление ключей.cpp | e206d4ca33bdfe90b6fe86fc1f44b01a2434889f | [] | no_license | Konstantin343/Algorithms-ITMO | 3121887d60d7fc937e645aa35f33b8d0b32c6f20 | 883a4a725d35edbe6c50cba9cceda5a934a09576 | refs/heads/master | 2020-05-17T20:26:17.950991 | 2019-05-31T20:42:14 | 2019-05-31T20:42:14 | 183,945,261 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,782 | cpp | Добавление ключей.cpp | #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <math.h>
using namespace std;
vector<int> res;
struct node {
int x;
int y;
node* left;
node* right;
int size;
int cnt0;
node(int newX, int newY) {
size = 1;
left = NULL;
right = NULL;
x = newX;
y = newY;
if (newX == 0) {
cnt0 = 1;
}
else {
cnt0 = 0;
}
}
};
void printTree(node* cur) {
if (cur == NULL) {
return;
}
printTree(cur->left);
res.push_back(cur->x);
printTree(cur->right);
}
pair<int, node*> getZero(node* cur) {
if (cur == NULL) {
return pair<int, node*>(-1, NULL);
}
int ans = 0;
while (true) {
if (cur->left == NULL && cur->x == 0) {
break;
}
if (cur->left != NULL && cur->left->cnt0 == 0 && cur->x == 0) {
ans += cur->left->size;
break;
}
if (cur->left != NULL && cur->left->cnt0 > 0) {
cur = cur->left;
}
if (cur->left == NULL && cur->x != 0) {
cur = cur->right;
ans++;
}
if (cur->left != NULL && cur->left->cnt0 == 0 && cur->x != 0) {
ans += (cur->left->size + 1);
cur = cur->right;
}
}
return make_pair(ans, cur);
}
void update(node* cur) {
if (cur == NULL) {
return;
}
if (cur->left != NULL && cur->right != NULL) {
cur->size = 1 + cur->left->size + cur->right->size;
cur->cnt0 = cur->left->cnt0 + cur->right->cnt0;
if (cur->x == 0) { cur->cnt0++; }
}
else if (cur->left != NULL) {
cur->size = 1 + cur->left->size;
cur->cnt0 = cur->left->cnt0;
if (cur->x == 0) { cur->cnt0++; }
}
else if (cur->right != NULL) {
cur->size = 1 + cur->right->size;
cur->cnt0 = cur->right->cnt0;
if (cur->x == 0) { cur->cnt0++; }
}
else {
cur->size = 1;
if (cur->x == 0) {
cur->cnt0 = 1;
} else {
cur->cnt0 = 0;
}
}
}
pair<node*, node*> split(node* cur, int k) {
if (cur == NULL) {
return pair<node*, node*>(NULL, NULL);
}
int l = 0;
if (cur->left != NULL) {
l = cur->left->size;
}
if (k > l) {
pair<node*, node*> ans = split(cur->right, k - l - 1);
cur->right = ans.first;
update(cur->right);
update(cur);
update(ans.second);
return make_pair(cur, ans.second);
}
else {
pair<node*, node*> ans = split(cur->left, k);
cur->left = ans.second;
update(cur->left);
update(cur);
update(ans.first);
return make_pair(ans.first, cur);
}
}
node* merge(node* t1, node* t2) {
if (t2 == NULL) {
return t1;
}
if (t1 == NULL) {
return t2;
}
if (t1->y > t2->y) {
t1->right = merge(t1->right, t2);
update(t1->right);
update(t1);
return t1;
}
else {
t2->left = merge(t1, t2->left);
update(t2->left);
update(t2);
return t2;
}
}
node* insert(node* cur, node* v, int k) {
pair<node*, node*> p = split(cur, k);
p.first = merge(p.first, v);
return merge(p.first, p.second);
}
node* remove(node* cur, int x) {
pair<node*, node*> p = split(cur, x);
pair<node*, node*> p2 = split(p.second, x + 1);
return merge(p.first, p2.second);
}
node* replace(node* cur, node* v, int k) {
pair<node*, node*> p = split(cur, k);
pair<int, node*> zero = getZero(p.second);
pair<node*, node*> p2 = split(p.second, zero.first);
pair<node*, node*> p3 = split(p2.second, 1);
return merge(merge(p.first, v), merge(p2.first, p3.second));
}
int main() {
ios_base::sync_with_stdio(false);
node* treap = NULL;
int n, m;
cin >> n >> m;
for (int i = 1; i <= n + m; i++) {
treap = insert(treap, new node(0, rand() * RAND_MAX + rand()), 0);
}
for (int i = 0; i < n; i++) {
int pos;
cin >> pos;
treap = replace(treap, new node(i + 1, rand() * RAND_MAX + rand()), pos - 1);
}
printTree(treap);
int t = res.size() - 1;
for (int i = res.size() - 1; i >= 0; i--) {
if (res[i] != 0) {
t = i;
break;
}
}
cout << t + 1 << endl;
for (int i = 0; i <= t; i++) {
cout << res[i] << " ";
}
return 0;
} |
67afa6772819ca2dfa1c5b00d34b54ad0a9090b0 | e1700081b3e9fa1c74e6dd903da767a3fdeca7f5 | /libs/migui/project/private/model_projectloader.h | 4a2f371f46466db74ede9e4504629be75743a481 | [
"MIT"
] | permissive | i-RIC/prepost-gui | 2fdd727625751e624245c3b9c88ca5aa496674c0 | 8de8a3ef8366adc7d489edcd500a691a44d6fdad | refs/heads/develop_v4 | 2023-08-31T09:10:21.010343 | 2023-08-31T06:54:26 | 2023-08-31T06:54:26 | 67,224,522 | 8 | 12 | MIT | 2023-08-29T23:04:45 | 2016-09-02T13:24:00 | C++ | UTF-8 | C++ | false | false | 604 | h | model_projectloader.h | #ifndef MODEL_PROJECTLOADER_H
#define MODEL_PROJECTLOADER_H
#include "../model.h"
#include <QFile>
#include <QDomDocument>
class QDomNode;
class Model::ProjectLoader
{
public:
ProjectLoader(Model* model);
QDomNode projectPreProcessorNode() const;
bool load();
private:
enum class Mode {
SingleFile,
SeparateFile
};
bool loadRecursive(const QDomNode& node);
Mode m_mode;
QFile m_projectFile;
QDomDocument m_projectDocument;
QFile m_preProcessorFile;
QDomDocument m_preProcessorDocument;
QDomNode m_projectPreProcessorNode;
Model* m_model;
};
#endif // MODEL_PROJECTLOADER_H
|
1f24311414631d7a4090920f5e5bac704120a501 | 0225eb892d23d19469c166391a000d52d40dfcb9 | /Algorithm/AlgorithmPractises/dynamic_programming/market.cpp | 282b80eb1053b76b7a1a8e52b39b1ca1389cb86e | [] | no_license | Evanyc/CSLearning | 4bd59a9588fc7f2c9e2f590c111723389a08568d | f603c8b5b0d0c58adb3f85623c303b6a9d20bec6 | refs/heads/main | 2023-06-16T15:04:48.696384 | 2021-07-16T08:31:48 | 2021-07-16T08:31:48 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 503 | cpp | market.cpp | //
// Created by anarion on 6/13/19.
//
#include <limits>
#include "dynamic.h"
long max_profit(const std::vector<long>& price){
const size_t size = price.size();
std::vector<long> min_price(size, 0);
long res = 0;
min_price[0] = std::numeric_limits<long>::max();
for (size_t i = 1; i < size; ++i){
min_price[i] = min(min_price[i - 1], price[i - 1]);
}
for (size_t i = 1; i < size; ++i){
res = max(res, (price[i] - min_price[i]));
}
return res;
} |
8fd9b59e08ee0ef8bb9007e38ae7b452edd1ef75 | 9f9ac37f22333569ae3bec78075d0918c3ad2742 | /include/jobs/reaper.hxx | 8460999189e05823cc0a175ff8e9e5c4dac17a97 | [
"MIT"
] | permissive | credativ/pg_backup_ctl-plus | 602bcd0ce2bcce1653dd340e7b134c3b8f92973d | d1655f9791be9227e17b60731829bbd8572e850b | refs/heads/master | 2023-03-20T22:15:21.159701 | 2021-03-16T18:08:53 | 2021-03-16T18:08:53 | 348,447,804 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 515 | hxx | reaper.hxx | #ifndef __HAVE_REAPER_HXX__
#define __HAVE_REAPER_HXX__
#include <BackupCatalog.hxx>
#include <shm.hxx>
namespace pgbckctl {
class background_reaper {
public:
std::stack<pid_t> dead_pids;
virtual void reap() = 0;
};
class background_worker_shm_reaper : public background_reaper {
protected:
WorkerSHM *shm;
public:
background_worker_shm_reaper();
virtual ~background_worker_shm_reaper();
virtual void set_shm_handle(WorkerSHM *shm);
virtual void reap();
};
}
#endif
|
0c1788416e558048be76c10350da01e239ad51d6 | 304c4d7cb7c22f46a8ddba5e303e7f47dd916c61 | /utils/fbow_dump_features.cpp | e51e9c3969635571adbee143c0a02384768f2b6b | [
"MIT"
] | permissive | manhtoanbkhn/FBoW | 1ad6ba80cd7faea2008e4674536337345a322fe0 | 681460c9fae0bd60d224a522568d947feb6b53ed | refs/heads/master | 2023-04-29T21:37:38.295165 | 2021-05-14T14:36:15 | 2021-05-14T14:36:15 | 367,388,436 | 0 | 0 | MIT | 2021-05-14T14:30:19 | 2021-05-14T14:30:18 | null | UTF-8 | C++ | false | false | 5,108 | cpp | fbow_dump_features.cpp | /**
The MIT License
Copyright (c) 2017 Rafael Muñoz-Salinas
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#include "cmd_line_parser.h"
#include "dir_reader.h"
#include <iostream>
#include <fstream>
#include <vector>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/features2d/features2d.hpp>
#ifdef USE_CONTRIB
#include <opencv2/xfeatures2d/nonfree.hpp>
#include <opencv2/xfeatures2d.hpp>
#endif
std::vector<cv::Mat> loadFeatures(const std::vector<std::string>& path_to_images, const std::string& descriptor = "orb") {
cv::Ptr<cv::Feature2D> feat_detector;
if (descriptor == "orb") feat_detector = cv::ORB::create(2000);
else if (descriptor == "brisk") feat_detector = cv::BRISK::create();
else if (descriptor == "akaze") feat_detector = cv::AKAZE::create(cv::AKAZE::DESCRIPTOR_MLDB, 0, 3, 1e-4);
#ifdef USE_CONTRIB
else if (descriptor == "surf") feat_detector = cv::xfeatures2d::SURF::create(15, 4, 2);
#endif
else throw std::runtime_error("invalid descriptor: " + descriptor);
assert(!descriptor.empty());
std::vector<cv::Mat> features;
std::cout << "extracting features ..." << std::endl;
for (const auto& path_to_image : path_to_images) {
std::vector<cv::KeyPoint> keypoints;
cv::Mat descriptors;
std::cout << "reading image: " << path_to_image << std::endl;
cv::Mat image = cv::imread(path_to_image, 0);
if (image.empty()) {
std::cerr << "could not open image: " << path_to_image << std::endl;
continue;
}
feat_detector->detectAndCompute(image, cv::Mat(), keypoints, descriptors);
std::cout << "extracted features: total = " << keypoints.size() << std::endl;
features.push_back(descriptors);
std::cout << "done detecting features" << std::endl;
}
return features;
}
void saveToFile(const std::string& filename, const std::vector<cv::Mat>& features, std::string desc_name, bool rewrite = true) {
if (!rewrite) {
std::fstream ifile(filename, std::ios::binary);
if (ifile.is_open()) {
std::runtime_error("output file " + filename + " already exists");
}
}
std::ofstream ofile(filename, std::ios::binary);
if (!ofile.is_open()) {
std::cerr << "could not create an output file: " << filename << std::endl;
exit(1);
}
char _desc_name[20];
desc_name.resize(std::min(size_t(19), desc_name.size()));
strcpy(_desc_name, desc_name.c_str());
ofile.write(_desc_name, 20);
uint32_t size = features.size();
ofile.write((char*) &size, sizeof(size));
for (const auto& f : features) {
if (!f.isContinuous()) {
std::cerr << "matrices should be continuous" << std::endl;
exit(0);
}
uint32_t aux = f.cols;
ofile.write((char*)&aux, sizeof(aux));
aux = f.rows;
ofile.write((char*)&aux, sizeof(aux));
aux = f.type();
ofile.write((char*)&aux, sizeof(aux));
ofile.write((char*)f.ptr<uchar>(0), f.total() * f.elemSize());
}
}
int main(int argc, char** argv) {
try {
CmdLineParser cml(argc, argv);
if (cml["-h"] || argc < 4) {
std::cerr << "Usage: DESCRIPTOR_NAME (= orb, brisk, akaze, surf(contrib)) FEATURE_OUTPUT IMAGES_DIR" << std::endl;
std::cerr << std::endl;
std::cerr << "First step of creating a vocabulary is extracting features from a set of images." << std::endl;
std::cerr << "We save them to a file for next step." << std::endl;
std::cerr << std::endl;
return EXIT_FAILURE;
}
const std::string descriptor = argv[1];
const std::string output = argv[2];
auto images = DirReader::read(argv[3]);
std::vector<cv::Mat> features = loadFeatures(images, descriptor);
std::cout << "saving the features: " << argv[2] << std::endl;
saveToFile(argv[2], features, descriptor);
} catch (std::exception& ex) {
std::cerr << ex.what() << std::endl;
}
return EXIT_SUCCESS;
}
|
300564e42e16f6e23279495f89d332e08cb075c7 | 0ec02e8f43725fab9d03680a56474dcecbab2711 | /JuicyCheckers/JuicyCheckers/main.cpp | 437717365f24c03a3938aad904eeb25a176a64ba | [] | no_license | Sisky/Game-Programming-Assignment-3 | 48dcf629ff786be5786383124601907d5dc0b9c3 | 832053fb40dc99cf1283d5a9f98f58e2f8e3aa43 | refs/heads/master | 2016-08-12T12:38:26.781896 | 2015-10-15T04:09:53 | 2015-10-15T04:09:53 | 43,788,321 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 13,255 | cpp | main.cpp | /*
-----------------------------------------------------------------------------
Filename: TutorialApplication.cpp
-----------------------------------------------------------------------------
This source file is part of the
___ __ __ _ _ _
/___\__ _ _ __ ___ / / /\ \ (_) | _(_)
// // _` | '__/ _ \ \ \/ \/ / | |/ / |
/ \_// (_| | | | __/ \ /\ /| | <| |
\___/ \__, |_| \___| \/ \/ |_|_|\_\_|
|___/
Tutorial Framework (for Ogre 1.9)
http://www.ogre3d.org/wiki/
-----------------------------------------------------------------------------
*/
#include "main.h"
#include <OgreConfigFile.h>
#include <OgreSceneManager.h>
#include <OgreRenderWindow.h>
#include <OgreCamera.h>
#include "OgreViewport.h"
#include <OgreEntity.h>
#include <OgreWindowEventUtilities.h>
#include <OgreMeshManager.h>
#include <OgreStringConverter.h>
//---------------------------------------------------------------------------
TutorialApplication::TutorialApplication()
: mRoot(0),
mResourcesCfg(Ogre::StringUtil::BLANK),
mPluginsCfg(Ogre::StringUtil::BLANK),
mSceneMgr(0),
mCamera(0),
mWindow(0),
currentDegree(0.0f),
maxDegree(180.0f),
minDegree(-180.0f),
mMovableFound(false),
mRayScnQuery(0)
{
}
TutorialApplication::~TutorialApplication()
{
mSceneMgr->destroyQuery(mRayScnQuery);
//Remove ourself as a Window listener
Ogre::WindowEventUtilities::removeWindowEventListener(mWindow, this);
windowClosed(mWindow);
delete mRoot;
}
//Adjust mouse clipping area
void TutorialApplication::windowResized(Ogre::RenderWindow* rw)
{
unsigned int width, height, depth;
int left, top;
rw->getMetrics(width, height, depth, left, top);
const OIS::MouseState &ms = mMouse->getMouseState();
ms.width = width;
ms.height = height;
}
//Unattach OIS before window shutdown (very important under Linux)
void TutorialApplication::windowClosed(Ogre::RenderWindow* rw)
{
//Only close for window that created OIS (the main window in these demos)
if(rw == mWindow)
{
if(mInputManager)
{
mInputManager->destroyInputObject( mMouse );
mInputManager->destroyInputObject( mKeyboard );
OIS::InputManager::destroyInputSystem(mInputManager);
mInputManager = 0;
}
}
}
bool TutorialApplication::frameRenderingQueued(const Ogre::FrameEvent& evt)
{
if(mWindow->isClosed())
return false;
//Need to capture/update each device
mKeyboard->capture();
mMouse->capture();
//processInput(evt);
if(mKeyboard->isKeyDown(OIS::KC_ESCAPE))
return false;
return true;
}
// Input Processing Methods
bool TutorialApplication::keyPressed(const OIS::KeyEvent& ke)
{
return true;
}
bool TutorialApplication::keyReleased(const OIS::KeyEvent& ke)
{
return true;
}
bool TutorialApplication::mouseMoved(const OIS::MouseEvent& me)
{
// Move the camera around an origin point if the user is holding the right mouse button
if(me.state.buttonDown(OIS::MB_Right))
{
int relativeX = me.state.X.rel;
int relativeY = me.state.Y.rel;
int relativeZ = me.state.Z.rel;
Ogre::SceneNode* positionNode = mSceneMgr->getSceneNode("CAMERA_POSITION");
Ogre::Vector3 pos = positionNode->getPosition();
Ogre::Vector3 origin = Ogre::Vector3(0,0,0);
Ogre::Vector3 scale = origin - pos;
scale.normalise();
//if(pos.z > 50.0f)
//{
positionNode->setPosition(pos+(scale*relativeZ));
//}
//currentDegree += ;
if(currentDegree > maxDegree){ currentDegree = maxDegree; }
if(currentDegree < minDegree){ currentDegree = minDegree; }
Ogre::SceneNode* rotationNode = mSceneMgr->getSceneNode("CAMERA_ROTATION");
rotationNode->rotate(Ogre::Quaternion(Ogre::Degree(relativeX*0.1f), Ogre::Vector3(0,1,0)) , Ogre::Node::TransformSpace::TS_WORLD);
rotationNode->rotate(Ogre::Quaternion(Ogre::Degree(relativeY*0.1f), Ogre::Vector3(1,0,0)) , Ogre::Node::TransformSpace::TS_LOCAL);
}
return true;
}
bool TutorialApplication::mousePressed(
const OIS::MouseEvent& me, OIS::MouseButtonID id)
{
Ogre::Vector2 mousePos =
Ogre::Vector2(static_cast<Ogre::Real>(me.state.X.abs),static_cast<Ogre::Real>(me.state.Y.abs));
Ogre::Ray mouseRay =
mCamera->getCameraToViewportRay(
mousePos.x / float(me.state.width),
mousePos.y / float(me.state.height));
mRayScnQuery = mSceneMgr->createRayQuery(Ogre::Ray());
mRayScnQuery->setRay(mouseRay);
mRayScnQuery->setSortByDistance(true);
Ogre::RaySceneQueryResult& result = mRayScnQuery->execute();
Ogre::RaySceneQueryResult::iterator it = result.begin();
Ogre::SceneNode* mCurObject;
mMovableFound = false;
for ( ; it != result.end(); it++)
{
mMovableFound =
it->movable &&
it->movable->getName() != "" &&
it->movable->getName() != "MainCam" &&
it->movable->getName() != "Ground" &&
it->movable->getName() != "ground";
if (mMovableFound)
{
//Ogre::Vector3 intersect = it->worldFragment->singleIntersection;
mCurObject = it->movable->getParentSceneNode();
Ogre::LogManager::getSingletonPtr()->logMessage("Moveable object found: "+mCurObject->getName());
//Ogre::LogManager::getSingletonPtr()->logMessage("Position: "+Ogre::StringConverter::toString(intersect));
break;
}
}
if(mMovableFound)
{
// We have selected an entity
std::cout << "Moveable object found" << std::endl;
Ogre::LogManager::getSingletonPtr()->logMessage("Moveable object found");
}
return true;
}
bool TutorialApplication::mouseReleased(
const OIS::MouseEvent& me, OIS::MouseButtonID id)
{
return true;
}
void
TutorialApplication::createScene()
{
mSceneMgr = mRoot->createSceneManager(Ogre::ST_GENERIC);
mCamera = mSceneMgr->createCamera("MainCam");
//mCamera->setPosition(Ogre::Vector3(0, 300, -500));
// We want to create a scene node that we can rotate the camera around at the origin
Ogre::SceneNode* cameraParent = mSceneMgr->getRootSceneNode()->createChildSceneNode("CAMERA_ROTATION");;
Ogre::SceneNode* cameraChild = cameraParent->createChildSceneNode("CAMERA_POSITION");
cameraChild->attachObject(mCamera);
cameraChild->translate(10, 300,-500);
mCamera->lookAt(Ogre::Vector3(0, 0, 0));
mCamera->setNearClipDistance(5);
Ogre::Viewport* vp = mWindow->addViewport(mCamera);
vp->setBackgroundColour(Ogre::ColourValue(0,0,0));
mCamera->setAspectRatio(
Ogre::Real(vp->getActualWidth()) /
Ogre::Real(vp->getActualHeight()));
// create your scene here :)
mSceneMgr->setAmbientLight(Ogre::ColourValue(0.5, 0.5, 0.5));
Ogre::Entity* ninjaEntity[12];
Ogre::SceneNode* ninjaNode[12];
for (int i = 0; i < sizeof(ninjaEntity) / sizeof(ninjaEntity[0]); i++) {
Ogre::String number= Ogre::StringConverter::toString(i + 1);
ninjaEntity[i] = mSceneMgr->createEntity("ninja " + number, "ninja.mesh");
ninjaNode[i] = mSceneMgr->getRootSceneNode()->createChildSceneNode("Node " + number);
}
ninjaNode[0]->setPosition(700, 0, 500);
ninjaNode[1]->setPosition(500, 0, 700);
ninjaNode[2]->setPosition(300, 0, 500);
ninjaNode[3]->setPosition(100, 0, 700);
ninjaNode[4]->setPosition(-100, 0, 500);
ninjaNode[5]->setPosition(-300, 0, 700);
ninjaNode[6]->setPosition(-500, 0, 500);
ninjaNode[7]->setPosition(-700, 0, 700);
ninjaNode[8]->setPosition(100, 0, 300);
ninjaNode[9]->setPosition(500, 0, 300);
ninjaNode[10]->setPosition(-300, 0, 300);
ninjaNode[11]->setPosition(-700, 0, 300);
ninjaNode[0]->attachObject(ninjaEntity[0]);
ninjaNode[1]->attachObject(ninjaEntity[1]);
ninjaNode[2]->attachObject(ninjaEntity[2]);
ninjaNode[3]->attachObject(ninjaEntity[3]);
ninjaNode[4]->attachObject(ninjaEntity[4]);
ninjaNode[5]->attachObject(ninjaEntity[5]);
ninjaNode[6]->attachObject(ninjaEntity[6]);
ninjaNode[7]->attachObject(ninjaEntity[7]);
ninjaNode[8]->attachObject(ninjaEntity[8]);
ninjaNode[9]->attachObject(ninjaEntity[9]);
ninjaNode[10]->attachObject(ninjaEntity[10]);
ninjaNode[11]->attachObject(ninjaEntity[11]);
Ogre::Plane plane(Ogre::Vector3::UNIT_Y, 0);
Ogre::MeshManager::getSingleton().createPlane(
"ground",
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
plane,
1600, 1600, 1, 1,
true,
1, 2, 2,
Ogre::Vector3::UNIT_Z);
Ogre::Entity* groundEntity = mSceneMgr->createEntity("ground");
mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(groundEntity);
groundEntity->setCastShadows(false);
groundEntity->setMaterialName("Examples/Checkers");
mSceneMgr->setAmbientLight(Ogre::ColourValue(0, 0, 0));
mSceneMgr->setShadowTechnique(Ogre::SHADOWTYPE_STENCIL_ADDITIVE);
Ogre::Light* spotLight = mSceneMgr->createLight("SpotLight");
spotLight->setDiffuseColour(0, 0, 1.0);
spotLight->setSpecularColour(0, 0, 1.0);
spotLight->setType(Ogre::Light::LT_SPOTLIGHT);
spotLight->setDirection(-1, -1, 0);
spotLight->setPosition(Ogre::Vector3(200, 200, 0));
spotLight->setSpotlightRange(Ogre::Degree(35), Ogre::Degree(50));
Ogre::Light* directionalLight = mSceneMgr->createLight("DirectionalLight");
directionalLight->setType(Ogre::Light::LT_DIRECTIONAL);
directionalLight->setDiffuseColour(Ogre::ColourValue(256, 256, 256));
directionalLight->setSpecularColour(Ogre::ColourValue(256, 256, 256));
directionalLight->setDirection(Ogre::Vector3(0, -1, 0));
Ogre::Light* pointLight = mSceneMgr->createLight("PointLight");
pointLight->setType(Ogre::Light::LT_POINT);
pointLight->setDiffuseColour(.3, .3, .3);
pointLight->setSpecularColour(.3, .3, .3);
pointLight->setPosition(Ogre::Vector3(0, 150, 250));
}
void
TutorialApplication::initInput()
{
Ogre::LogManager::getSingletonPtr()->logMessage("*** Initializing OIS ***");
OIS::ParamList pl;
size_t windowHnd = 0;
std::ostringstream windowHndStr;
mWindow->getCustomAttribute("WINDOW", &windowHnd);
windowHndStr << windowHnd;
pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
pl.insert(std::make_pair(std::string("w32_mouse"), std::string("DISCL_FOREGROUND" )));
pl.insert(std::make_pair(std::string("w32_mouse"), std::string("DISCL_NONEXCLUSIVE")));
pl.insert(std::make_pair(std::string("w32_keyboard"), std::string("DISCL_FOREGROUND")));
pl.insert(std::make_pair(std::string("w32_keyboard"), std::string("DISCL_NONEXCLUSIVE")));
mInputManager = OIS::InputManager::createInputSystem( pl );
mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject( OIS::OISKeyboard, true ));
mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject( OIS::OISMouse, true ));
mMouse->setEventCallback(this);
mKeyboard->setEventCallback(this);
//Set initial mouse clipping size
windowResized(mWindow);
}
// Initialise the Ogre3D rendering system
bool TutorialApplication::go()
{
#ifdef _DEBUG
mResourcesCfg = "resources_d.cfg";
mPluginsCfg = "plugins_d.cfg";
#else
mResourcesCfg = "resources.cfg";
mPluginsCfg = "plugins.cfg";
#endif
mRoot = new Ogre::Root(mPluginsCfg);
Ogre::ConfigFile cf;
cf.load(mResourcesCfg);
Ogre::String name, locType;
Ogre::ConfigFile::SectionIterator secIt = cf.getSectionIterator();
while (secIt.hasMoreElements())
{
Ogre::ConfigFile::SettingsMultiMap* settings = secIt.getNext();
Ogre::ConfigFile::SettingsMultiMap::iterator it;
for (it = settings->begin(); it != settings->end(); ++it)
{
locType = it->first;
name = it->second;
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(name, locType);
}
}
///if(!(mRoot->restoreConfig() || mRoot->showConfigDialog()))
// return false;
mRoot->showConfigDialog();
mWindow = mRoot->initialise(true, "TutorialApplication Render Window");
Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);
Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
// Create and Initialise the scene
createScene();
// Initialise OIS
initInput();
//Register as a Window listener
Ogre::WindowEventUtilities::addWindowEventListener(mWindow, this);
mRoot->addFrameListener(this);
mRoot->startRendering();
return true;
}
//---------------------------------------------------------------------------
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
#define WIN32_LEAN_AND_MEAN
#include "windows.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT)
#else
int main(int argc, char *argv[])
#endif
{
// Create application object
TutorialApplication app;
try {
app.go();
} catch(Ogre::Exception& e) {
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
MessageBox(NULL, e.getFullDescription().c_str(), "An exception has occurred!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
#else
std::cerr << "An exception has occurred: " <<
e.getFullDescription().c_str() << std::endl;
#endif
}
return 0;
}
#ifdef __cplusplus
}
#endif
//---------------------------------------------------------------------------
|
526d6ee82646f170dee9f5094588ebf666e6f84e | c93cb97d96350ae782c94cedf397a33486b71305 | /Tregua/Input/JoystickMapping.hpp | c2d68222c58debba67003310fe4d72cb604bb77e | [] | no_license | Streq/Tregua | ac138e1af340d6b25c2dbcc7afb1ac23adef3d51 | c3ab0acf1a3e7e8fc3555ea6938b467c71796d8a | refs/heads/master | 2021-01-19T16:43:22.259120 | 2017-08-22T05:03:25 | 2017-08-22T05:03:25 | 101,022,544 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,720 | hpp | JoystickMapping.hpp | /*
* JoystickMapping.h
*
* Created on: Jul 31, 2017
* Author: santiago
*/
#pragma once
#include <Tregua/Input/Controller.hpp>
namespace trg{
namespace Input{
struct JoystickMapping : Controller::Mapping{
struct Input{
enum Type{
Axis,
Button
};
Type type;
union Data{
struct AxisInput{
unsigned char id;
bool positive;
} axis;
struct ButtonInput
{
unsigned short id;
} button;
} data;
};
unsigned char id;
float deadzone;//from 0.f to 100.f;
Input mappings[Button::size];
Controller::Event handle_input(const sf::Event& e) const override{
Controller::Event ret;
switch (e.type){
case sf::Event::EventType::JoystickMoved:{
if(e.joystickMove.joystickId==id){
for(int i=0; i<Button::size; i++){
const auto& map = mappings[i];
if (map.type==Input::Type::Axis && map.data.axis.id == e.joystickMove.axis){
ret.button = i;
ret.pressed = !signbit(e.joystickMove.position) == map.data.axis.positive && std::abs(e.joystickMove.position)>deadzone;
}
}
}
}break;
case sf::Event::JoystickButtonPressed:
case sf::Event::JoystickButtonReleased:{
if(e.joystickButton.joystickId==id){
for(int i=0; i<Button::size; i++){
const auto& map = mappings[i];
if (!map.type==Input::Type::Button && map.data.button.id == e.joystickButton.button){
ret.button = i;
ret.pressed = e.type==sf::Event::JoystickButtonPressed;
break;
}
}
}
}break;
default:{
ret.button=Button::size;
}break;
}
return ret;
}
};//JoystickMapping end
}
}
|
a41ebf0572dab76e7c7f1368bf0a59fbc18a4a24 | 9498fd8b4ffba66dd1765701efe2c44490b936c1 | /carcassonev2/Controller/datacontroller.h | 14475da77f3edc4f1f198bf13f3c1ad504782703 | [] | no_license | semppa/MyCarcassone | d4adb1d0732d052bd551ba40129b07540d0a3f59 | 520e05743cc35aa8f30484e02ad9feb6b8b95bb0 | refs/heads/master | 2023-02-19T14:23:14.977312 | 2021-01-19T12:14:00 | 2021-01-19T12:14:00 | 327,353,681 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,235 | h | datacontroller.h | #ifndef DATACONTROLLER_H
#define DATACONTROLLER_H
#include <Misc/player.h>
#include <Game/tile.h>
#include <QObject>
#include <QDebug>
#include "Graphics/figuregraphicsitem.h"
class FigureGraphicsItem;
class DataController : public QObject
{
Q_OBJECT
public:
static DataController& getInstance() {
static DataController instance;
return instance;
}
std::shared_ptr<Player> getPlayerPTR() {return player_;}
void setPlayerPTR(std::shared_ptr<Player> p) {player_ = p;}
void addPeer(std::shared_ptr<Player> player);
void removePeer(std::shared_ptr<Player> player);
std::vector<std::shared_ptr<Player>> getPeers() {return peers_;};
std::shared_ptr<Player> getPlayerPTR(PlayerID id);
void setInTurn(PlayerID id) {inTurn_ = id;}
bool myTurn() {return inTurn_ == player_->getID();}
void setCurTile(GameTile tile);
GameTile getCurTile() {return curTile_;}
void clear();
private:
DataController() {};
void operator=(DataController const &t);
std::shared_ptr<Player> player_;
std::vector<std::shared_ptr<Player>> peers_;
PlayerID inTurn_;
GameTile curTile_;
};
#endif // DATACONTROLLER_H
|
62d5a453dfe23db972c9493a7e4a05a27d396e3e | c1c09ce44c1cec4aeb1ad97ae28ce92612776e03 | /Z Udemy Code Files/007_basic_sorting.cpp | 1a6175c35345bae67571c5bdefd58238a291d00e | [] | no_license | IamRaviTejaG/DSA | 664e2d7ad11719107f605c6faf7d62e1abcd50c7 | f33048d86b8b8ae47c2d362d5026f02762dd26e8 | refs/heads/master | 2020-04-09T19:51:29.180911 | 2019-04-14T14:58:19 | 2019-04-14T14:58:19 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 772 | cpp | 007_basic_sorting.cpp | // BASIC SORTING
// Date: 06 December 2018
// Author: Ravi Teja Gannavarapu
// Implementation learnt from the Udemy Course on Data Structures & Algorithms in C++.
// Find the course at: https://www.udemy.com/introduction-to-algorithms-and-data-structures-in-c/
// Time Complexity: O(n^2)
#include<bits/stdc++.h>
using namespace std;
ifstream f("data.in");
ofstream g("data.out");
int main()
{
int n;
cin>>n;
int a[n];
for(int i=0; i<n; i++)
cin>>a[i];
for (int i=0; i<n; i++)
for (int j=i+1; j<n; j++)
if (a[i] > a[j])
swap(a[i], a[j]);
// To print all the steps involved, uncomment and include curly braces appropriately
// for (int k=0; k<n; k++)
// cout<<a[k]<<" ";
// cout<<'\n';
for (int i=0; i<n; i++)
cout<<a[i]<<" ";
return 0;
}
|
ede9bb97bb2b79e8c37c34e668bbc0f46fb3692a | 4146ad4f9661b7ee5dc34a111f94f802a22b181a | /Member.cpp | 7d7c7746562217a9c5a0ed46be8534c3422896b0 | [] | no_license | eduardo-jesus/RVAU_T1 | ec44771e3ed2580c0491e2158c5db7600b312f74 | a2a2bd462c1b7b3982a946c3d0e1d97a1e91b304 | refs/heads/master | 2020-05-18T19:43:44.414674 | 2013-11-11T00:22:20 | 2013-11-11T00:22:20 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,275 | cpp | Member.cpp | #include "Member.h"
Member::Member(void) {}
Member::~Member(void) {}
void Member::setXAngle(double angle) {
x_angle_ = angle;
}
double Member::getXAngle() {
return x_angle_;
}
void Member::setYAngle(double angle) {
y_angle_ = angle;
}
double Member::getYAngle() {
return y_angle_;
}
void Member::setRotateFront(bool rotate_front) {
rotate_front_ = rotate_front;
}
bool Member::getRotateFront() {
return rotate_front_;
}
void Member::instantiate(Vector3 position, double x_angle, double y_angle, bool rotate_front) {
setPosition(position);
setXAngle(x_angle);
setYAngle(y_angle);
setRotateFront(rotate_front);
}
void Member::draw() {
glPushMatrix();
glTranslated(position_.x, position_.y, position_.z);
glPushMatrix();
glRotated(x_angle_, 1, 0, 0);
glRotated(y_angle_, 0, 1, 0);
render();
glPopMatrix();
glPopMatrix();
}
void Member::update(double elapsed_time) {
double delta_ang = elapsed_time * ROT_SPEED;
if(rotate_front_) {
y_angle_ -= delta_ang;
if(y_angle_ < - MAX_ROT) {
rotate_front_ = false;
}
} else {
y_angle_ += delta_ang;
if(y_angle_ > MAX_ROT) {
rotate_front_ = true;
}
}
} |
5ae589717064f0fdf1de01a89f689737f61f29db | 53267d1fe9f5f697a606c68d9781442a84f482a7 | /src/scene/SceneManager.cpp | fbc6fe42fc5e6138668d4570c6c007b2d53f7b1c | [] | no_license | WingSou/FutureSteps3 | f46bf46ade9272c830661208b4f5272da408b6ac | 31b4950500e1c20407bdf7c002a90f5638efaf79 | refs/heads/master | 2020-12-11T05:45:48.741260 | 2015-11-11T07:52:01 | 2015-11-11T07:52:01 | 45,907,084 | 0 | 0 | null | 2015-11-10T11:17:51 | 2015-11-10T11:17:51 | null | UTF-8 | C++ | false | false | 978 | cpp | SceneManager.cpp | #include "SceneManager.h"
SceneManager::SceneManager()
{
SetUp();
}
SceneManager::~SceneManager()
{
delete c_title;
delete c_game;
delete c_result;
}
void SceneManager::SetUp()
{
scene_switch = TITLE;
c_title = new Title;
c_game = new Game;
c_result = new Result;
}
void SceneManager::UpDate()
{
switch (scene_switch)
{
case TITLE:
c_title->UpDate();
if (c_title->title_end == true){
scene_switch = GAME_MAIN;
c_title->SetUp();
}
break;
case GAME_MAIN:
c_game->UpDate();
if (c_game->game_end == true){
scene_switch = RESULT;
c_game->SetUP();
}
break;
case RESULT:
c_result->UpDate();
if (c_result->result_end == true){
scene_switch = TITLE;
c_result->SetUp();
}
break;
default:
break;
}
}
void SceneManager::Draw()
{
switch (scene_switch)
{
case TITLE:
c_title->Draw();
break;
case GAME_MAIN:
c_game->Draw();
break;
case RESULT:
c_result->Draw();
break;
default:
break;
}
} |
13f045b9a32f0adfa5e791e8d66454ffccd674c3 | 4f8debe17bf1d0dd88187fb46d0872b96bdb42e8 | /GravitationalForce.h | 6079c3292f5b31b66a0e80d814dcd27f4991dd58 | [
"BSD-3-Clause"
] | permissive | AU-PSL/demon_simulation_code | 0dafc5c6f8640c8d4713a2549c7b6d06758bbff2 | 631739360dae79423635fb3c0a62747a05fa2088 | refs/heads/master | 2021-09-14T23:06:03.120338 | 2016-06-09T19:34:50 | 2016-06-09T19:34:50 | 36,888,970 | 8 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 1,032 | h | GravitationalForce.h | /**
* @file GravitationalForce.h
* @brief Defines the data and methods of the GravitationalForce class
*
* @license This file is distributed under the BSD Open Source License.
* See LICENSE.TXT for details.
**/
#ifndef GRAVITATIONALFORCE_H
#define GRAVITATIONALFORCE_H
#include "Force.h"
class GravitationalForce : public Force {
public:
GravitationalForce(Cloud * const C, const double gravitationalField)
: Force(C), gravitational(gravitationalField) {}
~GravitationalForce() {}
void force1(const double currentTime); // rk substep 1
void force2(const double currentTime); // rk substep 2
void force3(const double currentTime); // rk substep 3
void force4(const double currentTime); // rk substep 4
void writeForce(fitsfile * const file, int * const error) const;
void readForce(fitsfile * const file, int * const error);
protected:
double gravitational; //!< The strength of the gravitational force [m/s^2]
private:
void force(const cloud_index currentParticle);
};
#endif // GRAVITATIONALFORCE_H
|
3526c5beb671cc58d8129f5209373bceb974b9ad | ec23541ba0baf564b404372b8ff629b9bb1e6ce4 | /HHTProblems/面试题4.cpp | 3591b0b43c5f98c2399c8104a6d21673c370cf43 | [] | no_license | biaobiaoqi/CPractice | 46c304b9d3ed8283f3ed7466b29dcd580331fee3 | 9592a6264dfaf8c86a2f7c9b6d39be7c964407c7 | refs/heads/master | 2021-01-01T15:17:50.651525 | 2014-05-18T08:04:44 | 2014-05-18T08:04:44 | 13,086,284 | 2 | 3 | null | null | null | null | UTF-8 | C++ | false | false | 773 | cpp | 面试题4.cpp | #include <stdio.h>
#include <vector>
using namespace std;
vector<char> v;
int main()
{
freopen("G:\in.txt", "r", stdin);
char ch;
int length = 0;
int whiteSpaceLength = 0;
while(scanf("%c", &ch)!= EOF){
v.push_back(ch);
++ length;
if (ch == ' ') {
++ whiteSpaceLength;
}
}
v.push_back('\0');
++length;
v.resize(length + whiteSpaceLength*2);
int originalIndex = length - 1;
int newIndex = length + whiteSpaceLength*2 - 1;
while (originalIndex >= 0 && originalIndex < newIndex) {
if (v[originalIndex] == ' ') {
v[newIndex --] = '0';
v[newIndex --] = '2';
v[newIndex --] = '%';
}else {
v[newIndex --] = v[originalIndex];
}
-- originalIndex;
}
newIndex = 0;
while(v[newIndex]){
printf("%c",v[newIndex++]);
}
return 0;
}
|
59bd6f398c52211a72c06e2b41489853d35b465d | a4e6f923c336f89108fa50bcc565a1ceb14cb6a3 | /proj4/Soldier.h | e00142071b454502e7eae5f6bf5a2e06bd5615b0 | [] | no_license | spencerghkim/eecs381 | d7af404d94931bd4ed2d05dc8bfbc6ce30e0f758 | 14cbb12da15188f262bbbb69dcbef317c7bd9962 | refs/heads/master | 2021-05-27T16:46:50.699176 | 2013-12-10T20:36:45 | 2013-12-10T20:36:45 | 47,818,240 | 0 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 1,228 | h | Soldier.h | #ifndef SOLDIER_H_
#define SOLDIER_H_
/*
A Soldier is an Agent that has attack and defense behaviors. It can be commanded
to start attacking another Agent and will continue the attack as long as
it is alive and the target is alive and in range. If attacked, the Soldier will
start attacking its attacker.
*/
#include "Agent.h"
struct Point;
class Soldier : public Agent {
public:
// *** define as specified
Soldier(const std::string& name_, Point location_);
~Soldier();
// update implements Soldier behavior
void update() override;
// Make this Soldier start attacking the target Agent.
// Throws an exception if the target is the same as this Agent,
// is out of range, or is not alive.
void start_attacking(Agent* target_ptr) override;
// Overrides Agent's take_hit to counterattack when attacked.
void take_hit(int attack_strength, Agent* attacker_ptr) override;
// Overrides Agent's stop to print a message
void stop() override;
// output information about the current state
void describe() const override;
private:
typedef enum {
ATTACKING,
NOT_ATTACKING
} Soldier_state_e;
int attack_strength;
double attack_range;
Agent* target;
Soldier_state_e state;
};
#endif
|
01f273dd873d1c8d5b2a8a3a8197faf42607d258 | f6f6d13ecabee843ad4b41aae301e1bad1a07bdb | /proto/tests/test_proto_fe_watch_port_enforcer.cpp | 042048e4d9fd15dbb899352551085d37a81cf17e | [
"Apache-2.0"
] | permissive | p4lang/PI | ec6a912f77f3ed73516a844ea5ca9fdb74c0e774 | 6d0f3d6c08d595f65c7d96fd852d9e0c308a6f30 | refs/heads/main | 2023-08-30T02:44:12.127320 | 2023-08-21T16:45:07 | 2023-08-21T16:45:07 | 51,870,280 | 170 | 128 | Apache-2.0 | 2023-09-11T09:52:09 | 2016-02-16T21:07:15 | C++ | UTF-8 | C++ | false | false | 10,846 | cpp | test_proto_fe_watch_port_enforcer.cpp | /* Copyright 2019-present Barefoot Networks, 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.
*/
/*
* Antonin Bas (antonin@barefootnetworks.com)
*
*/
#include <gmock/gmock.h>
#include <algorithm>
#include <chrono>
#include <condition_variable>
#include <mutex>
#include <thread>
#include <tuple>
#include <vector>
#include "PI/frontends/cpp/tables.h"
#include "PI/frontends/proto/device_mgr.h"
#include "PI/int/pi_int.h"
#include "src/access_arbitration.h"
#include "src/common.h"
#include "src/watch_port_enforcer.h"
#include "test_proto_fe_base.h"
namespace pi {
namespace proto {
namespace testing {
using pi::fe::proto::AccessArbitration;
using pi::fe::proto::WatchPortEnforcer;
using ::testing::_;
using ::testing::DoAll;
using ::testing::InvokeWithoutArgs;
using ::testing::Return;
class WatchPortEnforcerTest : public ProtoFrontendBaseTest {
public:
WatchPortEnforcerTest()
: watch_port_enforcer(device_tgt, &access_arbitration) {
act_prof_id = pi_p4info_act_prof_id_from_name(p4info, "ActProfWS");
}
static void SetUpTestCase() {
DeviceMgr::init();
std::ifstream istream(input_path);
google::protobuf::io::IstreamInputStream istream_(&istream);
google::protobuf::TextFormat::Parse(&istream_, &p4info_proto);
pi::p4info::p4info_proto_reader(p4info_proto, &p4info);
}
static void TearDownTestCase() {
DeviceMgr::destroy();
}
void SetUp() override {
for (size_t i = 0; i < numPorts; i++) {
auto port = static_cast<pi_port_t>(i);
EXPECT_EQ(mock->port_status_set(port, PI_PORT_STATUS_UP),
PI_STATUS_SUCCESS);
}
ASSERT_OK(watch_port_enforcer.p4_change(p4info));
}
void process_all_port_events() {
// the call to p4_change will block until the async task queue is empty (all
// events have been processed)
ASSERT_OK(watch_port_enforcer.p4_change(p4info));
}
mutable std::condition_variable cv;
mutable std::mutex mutex;
static constexpr size_t numPorts = 16;
static constexpr const char *input_path =
TESTDATADIR "/" "unittest.p4info.txt";
static constexpr std::chrono::milliseconds timeout{200};
static pi_p4info_t *p4info;
static p4configv1::P4Info p4info_proto;
AccessArbitration access_arbitration;
WatchPortEnforcer watch_port_enforcer;
pi_p4_id_t act_prof_id;
pi_indirect_handle_t grp_h{10};
pi_indirect_handle_t mbr_h{20};
pi_port_t watch_1{1};
pi_port_t watch_2{2};
};
/* static */ constexpr std::chrono::milliseconds WatchPortEnforcerTest::timeout;
/* static */ pi_p4info_t *WatchPortEnforcerTest::p4info = nullptr;
/* static */ p4configv1::P4Info WatchPortEnforcerTest::p4info_proto;
TEST_F(WatchPortEnforcerTest, DontUpdateHw) {
EXPECT_CALL(*mock, action_prof_group_activate_member(act_prof_id, _, _))
.Times(0);
EXPECT_CALL(*mock, action_prof_group_deactivate_member(act_prof_id, _, _))
.Times(0);
watch_port_enforcer.handle_port_status_event_sync(
watch_1, PI_PORT_STATUS_DOWN);
EXPECT_OK(watch_port_enforcer.add_member(
act_prof_id, grp_h, mbr_h, watch_1));
// down -> up
EXPECT_OK(watch_port_enforcer.modify_member(
act_prof_id, grp_h, mbr_h, watch_1, watch_2));
// up -> down
EXPECT_OK(watch_port_enforcer.modify_member(
act_prof_id, grp_h, mbr_h, watch_2, watch_1));
EXPECT_OK(watch_port_enforcer.delete_member(
act_prof_id, grp_h, mbr_h, watch_1));
watch_port_enforcer.handle_port_status_event_sync(
watch_1, PI_PORT_STATUS_UP);
EXPECT_OK(watch_port_enforcer.add_member(
act_prof_id, grp_h, mbr_h, watch_1));
}
TEST_F(WatchPortEnforcerTest, UpdateHw) {
::pi::fe::proto::common::SessionTemp session;
::pi::ActProf ap(session.get(), device_tgt, p4info, act_prof_id);
watch_port_enforcer.handle_port_status_event_sync(
watch_1, PI_PORT_STATUS_DOWN);
EXPECT_CALL(
*mock, action_prof_group_deactivate_member(act_prof_id, grp_h, mbr_h));
EXPECT_OK(watch_port_enforcer.add_member_and_update_hw(
&ap, grp_h, mbr_h, watch_1));
// down -> up
EXPECT_CALL(
*mock, action_prof_group_activate_member(act_prof_id, grp_h, mbr_h));
EXPECT_OK(watch_port_enforcer.modify_member_and_update_hw(
&ap, grp_h, mbr_h, watch_1, watch_2));
// up -> down
EXPECT_CALL(
*mock, action_prof_group_deactivate_member(act_prof_id, grp_h, mbr_h));
EXPECT_OK(watch_port_enforcer.modify_member_and_update_hw(
&ap, grp_h, mbr_h, watch_2, watch_1));
EXPECT_OK(watch_port_enforcer.delete_member(
act_prof_id, grp_h, mbr_h, watch_1));
watch_port_enforcer.handle_port_status_event_sync(
watch_1, PI_PORT_STATUS_UP);
EXPECT_OK(watch_port_enforcer.add_member_and_update_hw(
&ap, grp_h, mbr_h, watch_1));
}
TEST_F(WatchPortEnforcerTest, PortStatusEvents) {
std::vector<pi_indirect_handle_t> mbrs(numPorts);
pi_indirect_handle_t mbr_h = 0;
std::generate(mbrs.begin(), mbrs.end(), [&mbr_h] { return mbr_h++; });
for (size_t i = 0; i < numPorts; i++) {
auto port = static_cast<pi_port_t>(i);
EXPECT_OK(watch_port_enforcer.add_member(
act_prof_id, grp_h, mbrs[i], port));
}
EXPECT_CALL(*mock, action_prof_group_deactivate_member(act_prof_id, grp_h, _))
.Times(numPorts);
for (size_t i = 0; i < numPorts; i++) {
auto port = static_cast<pi_port_t>(i);
watch_port_enforcer.handle_port_status_event_sync(
port, PI_PORT_STATUS_DOWN);
}
EXPECT_CALL(*mock, action_prof_group_activate_member(act_prof_id, grp_h, _))
.Times(numPorts);
for (size_t i = 0; i < numPorts; i++) {
auto port = static_cast<pi_port_t>(i);
watch_port_enforcer.handle_port_status_event_sync(
port, PI_PORT_STATUS_UP);
}
for (size_t i = 0; i < numPorts; i++) {
auto port = static_cast<pi_port_t>(i);
EXPECT_OK(watch_port_enforcer.delete_member(
act_prof_id, grp_h, mbrs[i], port));
}
}
TEST_F(WatchPortEnforcerTest, ConcurrentRead) {
int x = 0;
auto action = [this, &x] {
std::unique_lock<std::mutex> lock(mutex);
if (x == 0) {
x = 1;
EXPECT_TRUE(cv.wait_for(lock, timeout, [&x] { return x == 0; }));
} else {
x = 0;
cv.notify_one();
}
};
EXPECT_CALL(*mock, action_prof_group_deactivate_member(
act_prof_id, grp_h, mbr_h))
.WillOnce(DoAll(InvokeWithoutArgs(action), Return(PI_STATUS_SUCCESS)));
std::thread thread1([this, &action] {
AccessArbitration::ReadAccess access(&access_arbitration);
action();
});
EXPECT_OK(watch_port_enforcer.add_member(act_prof_id, grp_h, mbr_h, watch_1));
EXPECT_EQ(mock->port_status_set(watch_1, PI_PORT_STATUS_DOWN),
PI_STATUS_SUCCESS);
thread1.join();
// we need to call this, otherwise the call to action() triggered by the call
// to action_prof_group_deactivate_member may not have completed yet
process_all_port_events();
}
TEST_F(WatchPortEnforcerTest, ExclusiveWrite) {
int x = 0;
auto action = [this, &x] {
std::unique_lock<std::mutex> lock(mutex);
if (x == 0) {
x = 1;
EXPECT_FALSE(cv.wait_for(lock, timeout, [&x] { return x == 0; }));
} else {
x = 0;
cv.notify_one();
}
};
EXPECT_CALL(*mock, action_prof_group_deactivate_member(
act_prof_id, grp_h, mbr_h))
.WillOnce(DoAll(InvokeWithoutArgs(action), Return(PI_STATUS_SUCCESS)));
std::thread thread1([this, &action] {
AccessArbitration::WriteAccess access(&access_arbitration, act_prof_id);
action();
});
EXPECT_OK(watch_port_enforcer.add_member(act_prof_id, grp_h, mbr_h, watch_1));
EXPECT_EQ(mock->port_status_set(watch_1, PI_PORT_STATUS_DOWN),
PI_STATUS_SUCCESS);
thread1.join();
process_all_port_events();
}
// make sure that there is no deadlock when updating pipeline config
TEST_F(WatchPortEnforcerTest, UpdateConfig) {
EXPECT_OK(watch_port_enforcer.add_member(act_prof_id, grp_h, mbr_h, watch_1));
AccessArbitration::UpdateAccess access(&access_arbitration);
EXPECT_EQ(mock->port_status_set(watch_1, PI_PORT_STATUS_DOWN),
PI_STATUS_SUCCESS);
EXPECT_OK(watch_port_enforcer.p4_change(p4info));
}
using ::testing::WithParamInterface;
using ::testing::Values;
class WatchPortEnforcerNoWriteAccessOneOfTest
: public WatchPortEnforcerTest,
public WithParamInterface<std::tuple<const char *, const char *> > { };
// We test that when there is an ongoing WriteRequest for one action profile,
// port status events can still be processed concurrently for other action
// profiles.
TEST_P(WatchPortEnforcerNoWriteAccessOneOfTest, ConcurrentAccess) {
pi_p4_id_t act_prof_1_id = pi_p4info_act_prof_id_from_name(
p4info, std::get<0>(GetParam()));
pi_p4_id_t act_prof_2_id = pi_p4info_act_prof_id_from_name(
p4info, std::get<1>(GetParam()));
int x = 0;
auto action = [this, &x] {
std::unique_lock<std::mutex> lock(mutex);
if (x == 0) {
x = 1;
cv.notify_one();
EXPECT_TRUE(cv.wait_for(lock, timeout, [&x] { return x == 0; }));
} else {
x = 0;
cv.notify_one();
}
};
EXPECT_CALL(*mock, action_prof_group_deactivate_member(_, grp_h, mbr_h))
.WillOnce(DoAll(InvokeWithoutArgs(action), Return(PI_STATUS_SUCCESS)))
.WillOnce(Return(PI_STATUS_SUCCESS));
std::thread thread1([this, act_prof_1_id, &action] {
AccessArbitration::WriteAccess access(&access_arbitration, act_prof_1_id);
action();
});
{
std::unique_lock<std::mutex> lock(mutex);
cv.wait(lock, [&x] { return x == 1; });
}
EXPECT_OK(watch_port_enforcer.add_member(
act_prof_1_id, grp_h, mbr_h, watch_1));
EXPECT_OK(watch_port_enforcer.add_member(
act_prof_2_id, grp_h, mbr_h, watch_1));
// Make sure that thread1 has grabbed WriteAccess before we bring the port
// down. Otherwise the WatchPortEnforcer may grab access to act_prof_1 first
// and block thread1. The wait_for would then timeout in thread1 and the test
// would fail.
EXPECT_EQ(mock->port_status_set(watch_1, PI_PORT_STATUS_DOWN),
PI_STATUS_SUCCESS);
thread1.join();
process_all_port_events();
}
INSTANTIATE_TEST_SUITE_P(
ConcurrentAccess, WatchPortEnforcerNoWriteAccessOneOfTest,
Values(std::make_tuple("ActProfWS", "ActProfWS2"),
std::make_tuple("ActProfWS2", "ActProfWS")));
} // namespace testing
} // namespace proto
} // namespace pi
|
e435ace8c7fd224e059b6b5aa5e240b7079845ff | 62b440a501eab0cd4e7cc750df0d9e9a863b40d7 | /Source/Core/Numeric/SVSolver.h | 86247e0e87eb4ef627a467fc48d8a1b878d5a016 | [
"BSD-3-Clause",
"MIT",
"Zlib",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause"
] | permissive | naohisas/KVS | b67d8adca623d1970e4cc4ab9c317d34d04800ff | 4d652aadc9db816674b1dda57dd14f8e56ce0a42 | refs/heads/develop | 2023-07-06T05:00:41.766940 | 2023-06-27T07:26:21 | 2023-06-27T07:26:21 | 28,217,308 | 47 | 32 | BSD-3-Clause | 2021-04-28T15:16:03 | 2014-12-19T06:25:52 | C++ | UTF-8 | C++ | false | false | 1,069 | h | SVSolver.h | /*****************************************************************************/
/**
* @file SVSolver.h
* @author Naohisa Sakamoto
*/
/*****************************************************************************/
#pragma once
#include "SVDecomposition.h"
#include <kvs/Vector>
namespace kvs
{
/*===========================================================================*/
/**
* @brief Singular value decomposition solver.
*/
/*===========================================================================*/
template <typename T>
class SVSolver : public kvs::Vector<T>
{
private:
kvs::SVDecomposition<T> m_decomp; ///< Singular value decomposition
public:
SVSolver();
SVSolver( const kvs::SVDecomposition<T>& decomp );
SVSolver( const kvs::Matrix<T>& A, const kvs::Vector<T>& b );
virtual ~SVSolver();
SVSolver<T>& operator = ( const kvs::Vector<T>& v );
const kvs::Vector<T>& solve( const kvs::Vector<T>& b );
const kvs::Vector<T>& solve( const kvs::Matrix<T>& A, const kvs::Vector<T>& b );
};
} // end of namespace kvs
|
fe9a2be3999319e0a93c769ea72ef5c3da1dcffe | da25366da4c49802ee1077d0da53adfa7b3f49fd | /Lab4 - BinaryTree/lab4/lab4/Tree.h | 9d4a93d583bb1c7e423dd6a31e92491554cf5259 | [] | no_license | bobby5892/260-DataStructures | fac50a97669ea8225ee7259dd5f9d910bd4d7c20 | 10bce0a4da1fcbcd288489c49b11cb7a07e7d1f4 | refs/heads/master | 2020-03-14T03:22:42.272411 | 2018-06-06T17:00:17 | 2018-06-06T17:00:17 | 131,418,387 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,132 | h | Tree.h | // Robert Moore 4-28-2018
#pragma once
#include <string>
#include <sstream>
template <typename T> class Node {
/// Class Variables
private:
T value;
Node<T>* left;
Node<T>* right;
public:
/// Default Constructor
Node() {
this->right = this->left = nullptr;
}
/// Overloaded Constructor
Node(Node<T>* left, Node<T>* right, T value) {
this->left = left;
this->right = right;
this->value = value;
}
/// Getter Methods
Node<T>* getLeft() { return this->left; }
Node<T>* getRight() { return this->right; }
T getValue() { return this->value; }
/// Setter Methods
void setLeft(Node<T>* ptr) { this->left = ptr; }
void setRight(Node<T>* ptr) { this->right = ptr; }
void setValue(T value) { this->value = value; }
};
template <typename T> class Tree
{
public:
Tree() {
// Plant a root
this->root = nullptr;
}
bool isPresent(T n) {
Node<T>*ptr = recFindHome( n, this->root);
if (ptr != nullptr) { return true; }
return false;
}
void insertItem(T n) {
if(this->root == nullptr)
root = new Node<T>(nullptr, nullptr, n);
else {
Node<T>* ptr = recInsert(n, this->root);
ptr = new Node<T>(nullptr, nullptr, n);
}
}
Node<T>* recFindHome(T n) {
return recFindHome(n, this->root);
}
Node<T>* recInsert(T n, Node<T>* ptr) {
// If the node we are looking at is empty - the number obviously goes there
if (ptr == nullptr) {
//ptr = new Node(nullptr, nullptr, T n);
return ptr;
}
// We are in a node that has a value
else {
if (ptr->getValue() > n) {
Node<T>*possible = recInsert( n, ptr->getLeft());
if (ptr->getLeft() == nullptr) {
Node<T>* newPtr = new Node<T>(nullptr, nullptr, n);
ptr->setLeft(newPtr);
}
}
else {
Node<T>*possible = recInsert( n, ptr->getRight());
if (ptr->getRight() == nullptr) {
Node<T>* newPtr = new Node<T>(nullptr, nullptr, n);
ptr->setRight(newPtr);
}
}
}
}
Node<T>* recFindHome(T n, Node<T>* ptr) {
// If the node we are looking at is empty - the number obviously goes there
if (ptr == nullptr) {
//ptr = new Node(nullptr, nullptr, T n);
return ptr;
}
// We are in a node that has a value
else {
if (ptr->getValue() > n) {
recFindHome(n, ptr->getLeft());
}
else if (ptr->getValue() == n) {
return ptr;
}
else {
recFindHome(n, ptr->getRight());
}
}
}
Node<T>* getFarthestLeft(T n, Node<T>* temp) {
while (temp->getLeft() != nullptr) {
temp = temp->getLeft();
}
return temp;
}
Node<T>* removeItem(T n, Node<T>* temp) {
// Rare base case
if (temp == nullptr) {
return nullptr;
}
if (n < temp->getValue()) {
// Left of tree
temp->setLeft( removeItem(n, temp->getLeft()) );
}
else if (n > temp->getValue()) {
// Right of tree
temp->setRight( removeItem(n, temp->getRight()) );
}
else {
//two cases - node with only one child node or node child nodes
// DELETE THIS ONE!! THIS ONE!!!
if (temp->getLeft() == nullptr) {
temp = temp->getRight();
return temp;
}
else if (temp->getRight() == nullptr) {
temp = temp->getLeft();
return temp;
}
// node with two child
// Lets get smallest in the current set
Node<T>* smallTemp = getFarthestLeft(n, temp->getRight());
// move into successor
temp->setValue(smallTemp->getValue());
// delete successor
temp->setRight(removeItem(n, smallTemp->getRight()));
}
return temp;
}
T removeItem(T n) {
Node<T>* temp;
temp = removeItem(n, this->root);
return n;
}
Node<T>* recFindHomePrev(T what) {
return recFindHome(n, this->root,true);
}
std::string preOrder() {
std::string output = recPrefixTraversal(this->root);
return output;
}
std::string inOrder() {
std::string output = recInfixTraversal(this->root);
return output;
}
std::string postOrder() {
std::string output = recPostfixTraversal(this->root);
return output;
}
std::string recPostfixTraversal(Node<T>* tempRoot) {
std::stringstream output;
if (tempRoot->getLeft() != nullptr) {
output << recPostfixTraversal(tempRoot->getLeft()) << " ";
}
if (tempRoot->getRight() != nullptr) {
output << recPostfixTraversal(tempRoot->getRight()) << " ";
}
output << tempRoot->getValue() << " ";
//(c) Postorder (Left, Right, Root) : 4 5 2 3 1
return output.str();
}
std::string recPrefixTraversal(Node<T>* tempRoot) {
std::stringstream output;
output << tempRoot->getValue() << " ";
if (tempRoot->getLeft() != nullptr ) {
output << recPrefixTraversal(tempRoot->getLeft()) ;
}
if (tempRoot->getRight() != nullptr) {
output << recPrefixTraversal(tempRoot->getRight());
} //(b)Preorder(Root, Left, Right) : 1 2 4 5 3
return output.str();
}
std::string recInfixTraversal(Node<T>* tempRoot) {
std::stringstream output;
if (tempRoot->getLeft() != nullptr) {
output << recInfixTraversal(tempRoot->getLeft());
}
output << tempRoot->getValue() << " ";
//(a) Inorder (Left, Root, Right) : 4 2 5 1 3
if (tempRoot->getRight() != nullptr) {
output << recInfixTraversal(tempRoot->getRight());
}
return output.str();
}
~Tree() {
}
private:
Node<T>* root;
};
|
3e5e71fdaab45a69b06cfec684bdf80be9c30d7f | bac97cf460461054d4dd9a0c9c111d705da7ec95 | /lab5.cpp | 9888a62db1db007cb811cb4156304def201885cc | [] | no_license | vanek01ivanovich/lab5_Vanek_AK | f8a805fcee3a36ef2b5cd32b7749ea251b5f8cf2 | cb718fb9d033834b2643a45f790305e30d4e8e5f | refs/heads/master | 2020-09-08T05:55:27.206178 | 2019-11-11T17:47:58 | 2019-11-11T17:47:58 | 221,036,574 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,440 | cpp | lab5.cpp | #include <stdio.h>
#include <stdlib.h>
#include <getopt.h>
int main (int argc, char **argv)
{
int b;
int h = 0, v = 0, l = 0, f = 0, i = 0;
while (true)
{
static struct option long_options[] =
{
{"help", no_argument, 0, 'h'},
{"version", no_argument,0, 'v'},
{"list", no_argument, 0, 'l'},
{"file", no_argument, 0, 'f'},
{"information",no_argument,0,'i'}
};
int option_index = 0;
b = getopt_long (argc, argv, "ihvlf",
long_options, &option_index);
if (b == -1)
break;
switch (b)
{
case 'h':
if (h == 0) {
puts ("Args: Help");
h = 1;
}
break;
case 'i':
if(i == 0){
puts("Args: Information");
i = 1;
}
break;
case 'v':
if (v == 0) {
puts ("Args: Version");
v = 1;
}
break;
case 'l':
if (l == 0) {
puts("Args: List");
l = 1;
}
break;
case 'f':
if (f == 0) {
puts("Args: File");
f = 1;
}
break;
case '?':
break;
default:
break;
}
}
if (optind < argc)
{
printf ("non-option ARGV-elements: ");
while (optind < argc)
printf ("%s ", argv[optind++]);
putchar ('\n');
}
exit (0);
}
|
d15789a9bd52994fe0a1bccfa54bb6614812a7ee | cb1c94caaa01718625c0ce197d6b061ac6c53e56 | /SPLl0714(a)/cyclomatic.cpp | bde2d17421232667217dfedf16753457c3c3b17e | [] | no_license | sajedjalil/C-Static-Analyzer | ffd4f677bb2f5808a921b5a60fe12ff3ff46396f | cbc5e5bcba74a94f935c45ea209ee0aad26288f7 | refs/heads/1 | 2023-04-05T13:05:05.216094 | 2017-04-10T10:13:11 | 2017-04-10T10:13:11 | 87,796,765 | 5 | 3 | null | 2023-04-01T09:40:39 | 2017-04-10T10:07:31 | C++ | UTF-8 | C++ | false | false | 4,955 | cpp | cyclomatic.cpp | #include <iostream>
#include <string>
#include <vector>
#include <fstream>
#include <queue>
#include <stack>
#include <algorithm>
#include <cstring>
#include <map>
#include <functional>
#include <cstdio>
using namespace std;
/****************************** Global variables ***************************************/
// Keywords we need to consider during creation of node
char commentFreeFile[] = "cleanFile.txt";
char fileForHalstead[] = "halstead.txt";
bool multipleCommentLineFlag = false;
/******************************* Other file methods *************************************/
extern void findComplexity(void);
string commentFreeFileInput(string line) {
if(line[0]=='#') {
return ""; // Ignores lines starting with '#' like #include <iostream>
}
if(line.length() == 0 ) {
return ""; // Ignores empty Lines
}
bool doubleQuote = false; //Keeps the track of first occurrence of a letter in a line
int lineSize = line.size();
for(int i=0; i < lineSize ; i++) {
if(line[i] == '"' && doubleQuote == false) doubleQuote = true;/*Start of the double quote.
We will not consider anything inside double quote */
else if(doubleQuote == true) {
if(line[i] == '"') doubleQuote = false; //If the closing double quote is reached
else continue; // else we ignore the character because it is inside the double quote
}
else if(multipleCommentLineFlag == true) { //If the current character is inside of multiple line comment character
if(line[i]=='*' && line[i+1] =='/') {
multipleCommentLineFlag = false;
line[i] = ' ';
line[i+1]= ' ';
}
else line[i]=' ';
}
else if(line[i]=='/' && line[i+1] =='*') { //If the closing of multiple line comment character
multipleCommentLineFlag = true;
line[i] = ' ';
line[i+1] = ' ';
}
else if(line[i] == '/' && line[i+1] == '/') { //if single line comment character is reached, then we ignore the next characters in that line
for(int j=i ; j<lineSize; j++) line[j] = ' ';
break;
}
}
for(int i=0; i<lineSize; i++) {
if(line[i] != ' ' && line[i] != 13) return line+"\n"; // carriage return may be present in line
}
return ""; //This is the case when the whole line is comprised of space or carriage return character
}
string buildContentFreeLine(string line) {
int lineSize = line.size();
bool flagDoubleQoute = false;
bool flagSingleQoute = false;
for(int i=0; i<lineSize; i++) { /** removes the contents between single quote and double quote*/
if( (line[i] == 39 || line[i] == '"') && flagDoubleQoute==false && flagSingleQoute == false ) {
if(line[i] == 39) flagSingleQoute = true;
else if(line[i] == '"') flagDoubleQoute = true;
line[i] = ' ';
continue;
}
else if( flagDoubleQoute == true ) {
if(line[i] == '"') flagDoubleQoute = false;
line[i] = ' ';
}
else if( flagSingleQoute == true ) {
if(line[i] == 39) flagSingleQoute = false;
line[i] = ' ';
}
}
return line;
}
/***************************************************************************************************************/
void buildCommentAndContentFreeFile(char* fileName) { //Input file as parameter
ifstream iFile(fileName); //input file
ofstream oFile(commentFreeFile); //opening of temporary comment and space free lines
ofstream oFile2(fileForHalstead); //Opening the file to save comment free file for halstead calculation
if(iFile.is_open()) {
string line;
getline(iFile,line);
while(!iFile.eof()){
string tempLine = commentFreeFileInput(line); /* Start of function that removes comments and blank lines
Receives the string part that are not comment or blank line*/
oFile2<<tempLine; /** clean file for halstead*/
tempLine = buildContentFreeLine(tempLine); //Erases the contents between first Braces()
oFile<<tempLine;
getline(iFile, line);
}
oFile2.close(); //Closes the file for halstead
oFile.close(); //closing of temporary comment and space free lines
iFile.close(); //closing of input file
}
}
void cyclomatic(char* fileName) { //Receives the file for which we want to calculate cyclomatic complexity
/******************* *************/
multipleCommentLineFlag = false;
buildCommentAndContentFreeFile(fileName); // Makes a file so that I can take clear and comment free input
findComplexity(); // Create node for the call graph
//remove(commentFreeFile);
}
|
9f9f87491051676d13e99b314b118bde10332681 | b4a9635c506260d105a7d371ba86031629d2b92a | /selfe.cpp | eb31ae962dff3655a7664f67547e34e4d2d8c468 | [] | no_license | potel/selfe | 2559597e2c391af722fc7ca03fced7cb858b94db | 2d722ff7f0cce0e06971b685c2cf9772362853a8 | refs/heads/master | 2022-11-15T23:29:14.163882 | 2020-07-03T00:54:34 | 2020-07-03T00:54:34 | 276,777,790 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 20,745 | cpp | selfe.cpp | #include <fstream>
#include <iostream>
#include <armadillo>
#include <ctime>
using namespace arma;
using namespace std;
#include "selfe.h"
#include "structs.h"
#include "declarations.h"
ofstream misc1("misc1.txt");
ofstream misc2("misc2.txt");
ofstream misc3("misc3.txt");
ofstream misc4("misc4.txt");
ofstream misc5("misc5.txt");
ofstream misc6("misc6.txt");
ofstream misc7("misc7.txt");
ofstream misc8("misc8.txt");
ofstream output("output.txt");
ofstream phase("phase-shifts.txt");
ofstream cx("absorption.txt");
int main(int argc,char* argv[]){
parameters *parm=new parameters;
cout<<" Reading parameters from "<<argv[1]<<endl;
const char* input=argv[1];
ReadParameters(input,parm);
TestBuild(parm);
}
void TestBuild(parameters *parm)
{
cx_vec poles,c;
int n,indx_mean_field,indx_coupling;
double k,sigma_r,absorption,energy,energy_end,de;
complejo phase_shift;
cx_mat funpot=zeros<cx_mat>(parm->lagpoints,parm->lagpoints);
nlpotential *V=new nlpotential(parm->points,parm->radius,parm->lagpoints);
poles.zeros(parm->numpoles);
c.zeros(parm->lagpoints);
lagrange lag(parm->points,parm->lagpoints,parm->lag_box);
lag.LagrangeBasis();
vector <state> overlaps(parm->numpoles,state(parm->points,&lag));
state *st=new state(parm->points,&lag);
energy_end=parm->delta_e*parm->numpoles+5.*parm->gamma;
cout<<"Upper energy limit: "<<energy_end<<"\n";
de=parm->gamma/10;
cout<<"Energy resolution: "<<de<<"\n";
for (n=0;n<2;n++)
{
if(parm->mean_field==parm->potentials[n].id) indx_mean_field=n;
if(parm->coupling==parm->potentials[n].id) indx_coupling=n;
parm->potentials[n].Fill(&lag);
}
V->type="locnloc";
V->pot_reduced=parm->potentials[indx_mean_field].pot_reduced;
V->r_reduced=parm->potentials[indx_mean_field].r_reduced;
lag.LagrangeBasis();
for(n=0;n<parm->numpoles;n++)
{
poles(n)=parm->delta_e*(n+1)+parm->gamma*I;
overlaps[n].energy=real(poles(n));
overlaps[n].l=0;
overlaps[n].j=0.5;
overlaps[n].GenScatt(1.,0.,&parm->potentials[indx_mean_field],&lag,c);
overlaps[n].wf_reduced=overlaps[n].wf_reduced%parm->potentials[indx_coupling].pot_reduced;
}
V->poles=poles;
V->overlaps=overlaps;
st->l=0;
st->j=0.5;
phase_shift=0.;
st->energy=0.5;
for(energy=de;energy<energy_end;energy+=de)
{
st->energy=energy;
phase_shift=st->GenScatt(1.,0.,V,&lag,c);
absorption=Absorption(st,V,1.,&lag);
phase<<energy<<" "<<(real(phase_shift))<<" "<<(imag(phase_shift))<<" "<<abs(phase_shift)<<"\n";
cx<<energy<<" "<<absorption<<"\n";
}
}
///////////////////////////////////////////////////////////////////////
// Generate scattering wavefunction, Numerov numerical integration //
// (only valid for local potential) //
///////////////////////////////////////////////////////////////////////
complejo state::GenScatt(double q1q2,double mass,optical* pot){
int i, i_1, i_2,status1,status2,points;
double hbarx, dd, radio_1, radio_2, q, x, y, ex1, ex2, etac,delta_r,
spinorbit,radio_match;
complejo delta, derivada_log, fu1, fu2, factor;
points=pot->r.n_elem;
complejo *potential=new complejo[points];
gsl_complex deltagsl;
gsl_sf_result F1, G1, F2, G2, Fp, Gp;
if(energy<0.) Error("Negative energy while trying to compute a scattering state\n");
r=pot->r;
radius=r(points-1);
delta_r=r(points-1)-r(points-2);
radio_match=radius-10.*delta_r;
hbarx=HC*HC/(2.*AMU*mass);
dd=delta_r*delta_r/hbarx;
q=sqrt(energy/hbarx);
etac=q1q2*mass*E2HC*AMU/(HC*q);
for (i=0;i<points-1;i++) {
potential[i]=pot->pot(i)+(l*(l+1.))*hbarx /(r(i)*r(i));
//cout<<potential[i]<<" "<<pot->pot[i]<<"\n";
//exit(0);
}
wf(0)=1.e-10;
wf(1)=(2.*(1.-0.416666667*dd*(-potential[0]+energy))*wf(0))/
(1.+0.083333333*dd*(-potential[1]+energy));
for (i=1;i<points-1;i++) {
wf(i+1)=(2.*(1.-0.416666667*dd*(-potential[i]+energy))
*wf(i)-(1.+0.083333333*dd*(-potential[i-1]+ energy))*wf(i-1))
/(1.+0.083333333*dd*(-potential[i+1]+energy));
}
// Computing the phase shift delta
radio_1=radio_match;
i_1=int(ceil(radio_1/delta_r))-1;
radio_1=delta_r*(i_1 + 1.);
fu1=wf(i_1);
radio_2=radio_1+2.*delta_r;
i_2=int(ceil(radio_2/delta_r))-1;
radio_2=delta_r*(i_2+1.);
fu2=wf(i_2);
derivada_log=fu1/fu2;
status1=gsl_sf_coulomb_wave_FG_e(etac,q*radio_1,l,0,&F1,&Fp,&G1,&Gp,&ex1,&ex2);
status2=gsl_sf_coulomb_wave_FG_e(etac,q*radio_2,l,0,&F2,&Fp,&G2,&Gp,&ex1,&ex2);
x=real((F1.val-F2.val*derivada_log)/(-G1.val+G2.val*derivada_log));
y=imag((F1.val-F2.val*derivada_log)/(-G1.val+G2.val*derivada_log));
GSL_SET_COMPLEX(&deltagsl,x,y);
//cout<<fu1<<" "<<fu2<<"\n";
//exit(0);
delta=(gsl_complex_arctan(deltagsl).dat[0]+I*gsl_complex_arctan(deltagsl).dat[1]); // desfase
factor=exp(I*(delta))*(cos(delta)*F1.val+sin(delta)*G1.val)/fu1;
for (i=0;i<points;i++) {
wf(i)=factor*wf(i);
//misc1<<r(i)<<" "<<real(wf(i))<<"\n";
if(status1 || status2) wf(i)=0.;
}
//exit(0);
delete[] potential;
return delta;
}
void Error(const string message)
{
cout<<message<<"\n";
output<<message<<"\n";
}
/*
Generate scattering wavefunction computed with the Lagrange mesh method,
and returns the phase shift. The resulting wavefunction is defined only in
the mesh points. Valid for local and non local potentials.
Potentials have to be defined at the mesh points, defined in lag.
c returns the coefficients of the Lagrange expansion of the wavefunction.
*/
complejo state::GenScatt(double mass,double q1q2, nlpotential *potential, lagrange *lag,cx_vec &c)
{
double hbarx,central,part3,part4,ri,rj,q,etac,
exp_F,exp_G,delta_a;
complejo pot,Rmatrix,Hp,Hm,Hmp,Hpp,S,phase_shift,factor,vloc;
int i,j;
gsl_sf_result F,G,Fp,Gp;
if(energy==0.) energy=0.000001;
hbarx=HC*HC/(2.*AMU*mass);
q=sqrt(energy/hbarx);
etac=q1q2*mass*E2HC*AMU/(HC*q);
cx_mat TLmatrix=zeros<cx_mat>(lag->N,lag->N);
cx_mat Vmatrix=zeros<cx_mat>(lag->N,lag->N);
cx_mat Gmatrix=zeros<cx_mat>(lag->N,lag->N);
vec basis_a(lag->N);
int numpoles,n;
if(potential->type=="nloc" || potential->type=="locnloc") numpoles=potential->poles.n_elem;
//cout<<"num poles: "<<numpoles<<"\n";
basis_a=lag->basis.row(lag->basis.n_rows-1).t(); // vector of length N with the value of each Lagrange function at a
// Initialization of Coulomb functions at a
gsl_sf_coulomb_wave_FG_e(etac,q*lag->a,l,0,&F,&Fp,&G,&Gp,&exp_F,&exp_G);
Hp=(G.val+I*F.val);
Hm=(G.val-I*F.val);
Hpp=q*(Gp.val+I*Fp.val);
Hmp=q*(Gp.val-I*Fp.val);
// Kinetic energy, Bloch term and energy eigenvalue
for(i=0;i<lag->N;i++)
{
TLmatrix(i,i)=hbarx*((4.*lag->N*lag->N+4.*lag->N+3.0)*lag->x[i]*(1.-lag->x[i])-6.*lag->x[i]+1.)/
(3.*lag->a*lag->a*(lag->x[i]*lag->x[i])*((1.-lag->x[i])*(1.-lag->x[i])))-energy;
for(j=i+1;j<lag->N;j++)
{
part3=pow(-1.,i+j)/(lag->a*lag->a*sqrt(lag->x[i]*lag->x[j]*(1.-lag->x[i])*(1.-lag->x[j])));
part4=(lag->N*lag->N*1.+lag->N*1.0+1.0+(lag->x[i]+lag->x[j]-2.*lag->x[i]*lag->x[j])/
((lag->x[i]-lag->x[j])*(lag->x[i]-lag->x[j]))-1./(1.-lag->x[i])-1./(1.-lag->x[j]));
TLmatrix(i,j)=hbarx*part3*part4;
TLmatrix(j,i)=TLmatrix(i,j);
}
}
// Potential (multiplied by rj*rj), including central potential and energy
for(i=0;i<lag->N;i++)
{
ri=lag->a*lag->x[i];
Vmatrix(i,i)=potential->pot_reduced(i)+hbarx*l*(l+1.)/(ri*ri); // central potential and energy
if(potential->type=="nloc" || potential->type=="locnloc")
{
for(j=0;j<lag->N;j++)
{
rj=lag->a*lag->x[j];
potential->nlpot_reduced(i,j)=0.;
for(n=0;n<numpoles;n++)
{
potential->nlpot_reduced(i,j)-=1./(energy-potential->poles(n))*
conj(potential->overlaps[n].wf_reduced(i))*potential->overlaps[n].wf_reduced(j);
}
Vmatrix(i,j)+=lag->a*sqrt(lag->w[i]*lag->w[j]/4.)*potential->nlpot_reduced(i,j);
}
}
}
Gmatrix=inv(TLmatrix+Vmatrix);
Rmatrix=hbarx*dot(basis_a.t(),Gmatrix*basis_a)/lag->a;
S=(Hm-lag->a*Rmatrix*Hmp)/(Hp-lag->a*Rmatrix*Hpp);
phase_shift=-I*log(S)/2.;
c=I*hbarx*(Hmp-S*Hpp)*Gmatrix*basis_a/2.; // c coefficients (see eq. (3.13))
for(i=0;i<lag->N;i++)
{
r_reduced(i)=lag->a*lag->x[i];
wf_reduced(i)=c(i)/sqrt(lag->a*lag->w[i]/2.);
}
return phase_shift;
}
// Lagrange basis initializer, from 0 to a
void lagrange::LagrangeBasis()
{
const double EPS=1.0e-10;
int m,j,i;
double z1,z,pp,p3,p2,p1,value,val,val_i;
double F[N],dF[N];
a1=0.;
m=(N+1)/2;
for (i=0;i<m;i++) {
z=cos(PI*(i+0.75)/(N+0.5));
do {
p1=1.0;
p2=0.0;
for (j=0;j<N;j++) {
p3=p2;
p2=p1;
p1=((2.0*j+1.0)*z*p2-j*p3)/(j+1);
}
pp=N*(z*p1-p2)/(z*z-1.0);
z1=z;
z=z1-p1/pp;
} while (fabs(z-z1) > EPS);
x[i]=(-z+1.0)/2.0;
x[N-1-i]=(z+1.0)/2.0;
w[i]=2./((1.0-z*z)*pp*pp);
w[N-1-i]=w[i];
}
for(m=0;m<r.size();m++)
{
for(i=1;i<=N;i++)
{
for(m=0;m<r.size();m++)
{
value=2.*r[m]/a-1.;
if (value>1.) value=1.;
if (value<-1.) value=-1.;
gsl_sf_legendre_Pl_deriv_array(N,value,F,dF);
for(i=1;i<=N;i++)
{
val=(2.*r[m]/a)*dF[N]-a*x[i-1]*F[N]/(r[m]-a*x[i-1]);
val_i=(2./a)*dF[N]-F[N]/(r[m]-a*x[i-1]);
basis(m,i-1)= pow(-1.0,N+i)*(r[m]/(a*x[i-1]))*sqrt(a*x[i-1]*(1.-x[i-1]))*F[N]/(r[m]-a*x[i-1]);
basis_i(m,i-1)= pow(-1.0,N+i)*sqrt(a*x[i-1]*(1.-x[i-1]))*F[N]/(r[m]-a*x[i-1]);
del_basis(m,i-1)= pow(-1.0,N+i)*sqrt(a*x[i-1]*(1.-x[i-1]))*val/(a*x[i-1]*(r[m]-a*x[i-1]));
del_basis_i(m,i-1)= pow(-1.0,N+i)*sqrt(a*x[i-1]*(1.-x[i-1]))*val_i/(r[m]-a*x[i-1]);
}
}
}
}
}
// Lagrange basis initializer from initial to initial+a
void lagrange::LagrangeBasis(double initial)
{
const double EPS=1.0e-10;
int m,j,i;
double z1,z,pp,p3,p2,p1,value,value_i,val,val_i;
double F[N],dF[N];
double F_i[N],dF_i[N];
a1=initial;
a2=initial+a;
m=(N+1)/2;
for (i=0;i<m;i++) {
z=cos(PI*(i+0.75)/(N+0.5));
do {
p1=1.0;
p2=0.0;
for (j=0;j<N;j++) {
p3=p2;
p2=p1;
p1=((2.0*j+1.0)*z*p2-j*p3)/(j+1);
}
pp=N*(z*p1-p2)/(z*z-1.0);
z1=z;
z=z1-p1/pp;
} while (fabs(z-z1) > EPS);
x[i]=(-z+1.0)/2.0;
x[N-1-i]=(z+1.0)/2.0;
w[i]=2./((1.0-z*z)*pp*pp);
w[N-1-i]=w[i];
}
for(m=0;m<r.size();m++)
{
value=2.*r[m]/a-1.;
value_i=(2.*(r[m]-a1)-a)/a;
if (value>1.) value=1.;
if (value<-1.) value=-1.;
if (value_i>1.) value_i=1.;
if (value_i<-1.) value_i=-1.;
gsl_sf_legendre_Pl_deriv_array(N,value,F,dF);
gsl_sf_legendre_Pl_deriv_array(N,value_i,F_i,dF_i);
for(i=1;i<=N;i++)
{
val=(2.*r[m]/a)*dF[N]-a*x[i-1]*F[N]/(r[m]-a*x[i-1]);
val_i=(2./a)*dF_i[N]-F_i[N]/(r[m]-a*x[i-1]-a1);
basis(m,i-1)= pow(-1.0,N+i)*(r[m]/(a*x[i-1]))*sqrt(a*x[i-1]*(1.-x[i-1]))*F[N]/(r[m]-a*x[i-1]);
basis_i(m,i-1)= pow(-1.0,N+i)*sqrt(a*x[i-1]*(1.-x[i-1]))*F_i[N]/(r[m]-a*x[i-1]-a1);
del_basis(m,i-1)= pow(-1.0,N+i)*sqrt(a*x[i-1]*(1.-x[i-1]))*val/(a*x[i-1]*(r[m]-a*x[i-1]));
del_basis_i(m,i-1)= pow(-1.0,N+i)*sqrt(a*x[i-1]*(1.-x[i-1]))*val_i/(r[m]-a*x[i-1]-a1);
}
}
}
void PolarPotential(double energy,lagrange *lag,nlpotential *v)
{
int numpoles,n,i,j;
numpoles=v->poles.n_elem;
for(i=0;i<lag->N;i++)
{
v->nlpot_reduced(i,i)=v->pot_reduced(i);
for(j=0;j<lag->N;j++)
{
if(i!=j) v->nlpot_reduced(i,j)=0.;
for(n=0;n<numpoles;n++)
{
v->nlpot_reduced(i,j)-=1./(energy-v->poles(n))*
conj(v->overlaps[n].wf_reduced(i))*v->overlaps[n].wf_reduced(j);
}
}
}
}
void Expand(state *st,lagrange *lag,cx_vec c)
{
int i,j;
double r;
st->radius=lag->a;
for(i=0;i<lag->r.size();i++)
{
r=lag->r[i];
st->wf(i)=0.;
st->r(i)=r;
for(j=0;j<lag->N;j++)
{
st->wf(i)+=c(j)*lag->basis(i,j);
}
}
}
void Write(vec r,vec f,ofstream *file)
{
int n;
for(n=0;n<r.n_elem;n++)
{
*file<<r(n)<<" "<<f(n)<<"\n";
}
}
void Write(vec r,cx_mat f,ofstream *file)
{
int n;
for(n=0;n<r.n_elem;n++)
{
*file<<r(n)<<" "<<real(f(n,n))<<" "<<imag(f(n,n))<<" "<<abs(f(n,n))<<"\n";
}
}
void Write(vec r,cx_vec f,ofstream *file)
{
int n;
for(n=0;n<r.n_elem;n++)
{
*file<<r(n)<<" "<<real(f(n))<<" "<<imag(f(n))
<<" "<<abs(f(n))<<"\n";
}
}
double Absorption(state *st,nlpotential *v,double mass,lagrange *lag)
{
int i,j,dim;
static int e;
e++;
double k,a;
complejo sum;
k=sqrt(2.*mass*AMU*st->energy)/HC;
a=2.*mass*AMU/(HC*HC*k);
dim=st->r_reduced.n_elem;
sum=0.;
for(i=0;i<dim;i++)
{
for(j=0;j<dim;j++)
{
sum+=a*conj(st->wf_reduced(i))*imag(v->nlpot_reduced(i,j))*
st->wf_reduced(j)*lag->w[i]*lag->w[j];
// sum+=a*conj(st->wf_reduced(i))*imag(v->nlpot_reduced(i,j))*
// st->wf_reduced(j)*lag->w[i]*lag->w[j];
}
}
// misc5<<e<<" "<<real(sum)<<" "<<imag(v->nlpot_reduced(1,1))<<"\n";
return abs(sum);
}
void Converge(nlpotential *v,int iter,lagrange *lag)
{
int numpoles,n,m;
optical Uopt(v->r.n_elem,v->radius);
numpoles=v->poles.n_elem;
complejo phase_shift;
cx_vec c;
Uopt.r_reduced=v->r_reduced;
Uopt.pot_reduced=v->pot_reduced;
c.zeros(lag->N);
for(n=0;n<numpoles;n++)
{
v->overlaps[n].energy=real(v->poles[n]);
v->overlaps[n].l=0;
v->overlaps[n].j=0.5;
v->overlaps[n].GenScatt(1.,0.,&Uopt,lag,c);
v->overlaps[n].wf_reduced=v->overlaps[n].wf_reduced%v->pot_reduced;
}
for(n=0;n<iter;n++)
{
misc1<<n;
for(m=0;m<numpoles;m++)
{
phase_shift=v->overlaps[m].GenScatt(1.,0.,v,lag,c);
v->overlaps[m].wf_reduced=v->overlaps[m].wf_reduced%v->pot_reduced;
misc1<<" "<<real(phase_shift);
}
misc1<<"\n";
}
}
void ReadParameters(const char *fname,parameters *x)
{
char aux[500];
int n,pots;
ifstream fp;
fp.open(fname);
if (!fp) Error("Couldn't open parameter file");
x->points=0; // number of points for the representation of functions
x->lagpoints=0; // number of points of the Lagrange mesh
x->radius=0; // radius for the representation of functions (fm)
x->lag_box=0; // size of the Lagrange mesh (fm)
// Parameters for the definition of resonances
x->numpoles=0; // number of resonances g
x->gamma=0; // width of the resonances (imaginary part of the poles) (fm)
x->delta_e=0; // distance between resonances (MeV)
// Index to mean field potential and neutron-nucleus coupling
x->mean_field=0;
x->coupling=0;
pots=0;
while(fp.getline(aux,500))
{
ReadParD(aux,"points",&(x->points));
ReadParD(aux,"lagpoints",&(x->lagpoints));
ReadParD(aux,"numpoles",&(x->numpoles));
ReadParD(aux,"mean_field",&(x->mean_field));
ReadParD(aux,"coupling",&(x->coupling));
ReadParF(aux,"radius",&(x->radius));
ReadParF(aux,"lag_box",&(x->lag_box));
ReadParF(aux,"gamma",&(x->gamma));
ReadParF(aux,"delta_e",&(x->delta_e));
ReadParF(aux,"radius",&(x->radius));
}
fp.clear();
fp.seekg(0, std::ios_base::beg );
while(fp.getline(aux,500))
{
if (!pots) pots=ReadPotentials(aux,"Potentials-Start",x->potentials,&fp,
x->points,x->lagpoints,x->radius);
}
for(n=0;n<2;n++)
{
x->potentials[n].Fill(x->points,x->radius);
}
fp.close();
}
int ReadPotentials(char *s,const char key[100],vector <optical> &pot,
ifstream *fp,int points,int lagpoints,double radius)
{
int l,r,i,l2,l3,id;
const char fin[]="Potentials-End";
const char flag[]="***************";
char aux[500]="\0";
l = strlen(key);
l2 = strlen(fin);
l3 = strlen(flag);
double V,W,Vso,Wso,Wr,Wd,radV,radW,radcoul,
aV,aW,radso,aso,radWd,aWd;
i=0;
if (!strncmp(s,key,l))
{
while(strncmp(aux,fin,l2))
{
fp->getline(aux,500);
ReadParD(aux,"id",&(id));
ReadParF(aux,"RealVolume",&(V));
ReadParF(aux,"ImaginaryVolume",&(W));
ReadParF(aux,"RealSpinOrbit",&(Vso));
ReadParF(aux,"ImaginarySpinOrbit",&(Wso));
ReadParF(aux,"RealSurface",&(Wr));
ReadParF(aux,"ImaginarySurface",&(Wd));
ReadParF(aux,"RadiusRealVolume",&(radV));
ReadParF(aux,"RadiusImaginaryVolume",&(radW));
ReadParF(aux,"RadiusCoulomb",&(radcoul));
ReadParF(aux,"DifusivityRealVolume",&(aV));
ReadParF(aux,"DifusivityImaginaryVolume",&(aW));
ReadParF(aux,"RadiusSpinOrbit",&(radso));
ReadParF(aux,"DifusivitySpinOrbit",&(aso));
ReadParF(aux,"RadiusImaginarySurface",&(radWd));
ReadParF(aux,"DifusivityImaginarySurface",&(aWd));
if(!strncmp(aux,flag,3))
{
pot.push_back(optical(points,radius,lagpoints));
pot[i].id=id;
pot[i].V=V;
pot[i].W=W;
pot[i].Vso=Vso;
pot[i].Wso=Wso;
pot[i].Wr=Wr;
pot[i].Wd=Wd;
pot[i].radV=radV;
pot[i].radW=radW;
pot[i].radcoul=radcoul;
pot[i].aV=aV;
pot[i].aW=aW;
pot[i].radso=radso;
pot[i].aso=aso;
pot[i].radWd=radWd;
pot[i].aWd=aWd;
i++;
}
}
cout<<i<<" Potentials have been read"<<endl;
fflush(stdout);
return i;
}
return 0;
}
/*****************************************************************************
Reads decimal number
*****************************************************************************/
void ReadParD(char *s,const char key[20], int *par)
{
int l,r;
l = strlen(key);
if (!strncmp(s,key,l))
{
r = sscanf(s,"%*s %d",par);
if (r<1) { fprintf(stderr,"ERROR: No puede leerse %s en el fichero de parametros (r=%d)\n",key,r); exit(1); }
}
fflush(stderr);
}
/*****************************************************************************
Reads float
*****************************************************************************/
void ReadParF(char *s,const char key[20],double *par)
{
int l,r;
l = strlen(key);
if (!strncmp(s,key,l))
{
r = sscanf(s,"%*s %lf",par);
if (r<1) { fprintf(stderr,"ERROR: No puede leerse %s en el fichero de parametros\n",key); exit(1); }
}
fflush(stderr);
}
/*****************************************************************************
Reads char
*****************************************************************************/
void ReadParS(char *s,const char key[20], char *par)
{
int l,r;
l = strlen(key);
if (!strncmp(s,key,l))
{
r = sscanf(s,"%*s %s",par);
if (r<1) { fprintf(stderr,"%s ",key); *par='\0'; }
}
fflush(stderr);
}
/*****************************************************************************
Reads string
*****************************************************************************/
void ReadParStr(string s,const char key[20], string par)
{
int l,r;
string str=key;
l = strlen(key);
if (s==key)
{
par=s;
cout<<str<<" = "<<par<<endl;
}
}
void optical::Fill(int points,double radius)
{
int n;
double delta_r;
delta_r=radius/double(points);
for(n=0;n<points;n++)
{
r(n)=delta_r*(n+1.);
Nuclear(n)=-V/(1.+exp((r(n)-radV)/aV))-I*W/
(1.+exp((r(n)-radW)/aW))-4.*I*Wd*
exp((r(n)-radWd)/aWd)/((1.+exp((r(n)-radWd)/aWd))
*(1.+exp((r(n)-radWd)/aWd)))
-Wr*exp((r(n)-radV)/aV)/((1.+exp((r(n)-radV)/aV))
*(1.+exp((r(n)-radV)/aV)));
}
pot=Nuclear;
}
void optical::Fill(lagrange *lag)
{
int n;
for(n=0;n<lag->N;n++)
{
r_reduced(n)=lag->x[n]*lag->a;
pot_reduced(n)=-V/(1.+exp((r_reduced(n)-radV)/aV))-I*W/
(1.+exp((r_reduced(n)-radW)/aW))-4.*I*Wd*
exp((r_reduced(n)-radWd)/aWd)/((1.+exp((r_reduced(n)-radWd)/aWd))
*(1.+exp((r_reduced(n)-radWd)/aWd)))
-Wr*exp((r_reduced(n)-radV)/aV)/((1.+exp((r_reduced(n)-radV)/aV))
*(1.+exp((r_reduced(n)-radV)/aV)));
}
}
|
24746ec4997af57e8e3b8286864a56cfb7cd203b | b45068a00a7f86e694700d89431e200aabe9a1d3 | /JZ67-剪绳子/JZ67.cpp | a42776d8bf1415b3b586c69e8c72260171e0db53 | [] | no_license | iamchisheng/JianzhiOffer | c95d69836274d6889e0f357651a0fde5bbb7311a | 1b4ceba20e7a1adfcdfab5576572c1fa68c04cb5 | refs/heads/master | 2023-06-27T18:47:19.712270 | 2021-07-31T15:02:32 | 2021-07-31T15:02:32 | 384,926,009 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 544 | cpp | JZ67.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int cutRope(int number) {
if(number <= 4){
return number;
}
vector<int> dp(number + 1, -1);
dp[0] = 0;
dp[1] = 1;
dp[2] = 2;
dp[3] = 3;
dp[4] = 4;
for(int i = 5; i <= number; i++){
for(int j = 1; j <= i; j++){
if(dp[i - j] * j > dp[i]){
dp[i] = dp[i - j] * j;
}
}
}
return dp[number];
}
}; |
a9c272723b7f00d3d1a4bc75f63502c2447121ef | b0d773eaef44d905a34e1d0588757688f996bb83 | /Projet_modeling/meshquad.cpp | b31d2b536c4bab0d0805e3585692f69dcf48ce69 | [] | no_license | Hymlia/Geo3D | fd886ca640bc5b707ee9b1056fe0a36e9de8e80a | d5a95cda253d09f0b736e1377960805d50ba9d75 | refs/heads/master | 2020-03-16T15:25:21.819267 | 2018-05-17T08:07:49 | 2018-05-17T08:07:49 | 132,743,146 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 13,987 | cpp | meshquad.cpp | #include "meshquad.h"
#include "matrices.h"
void MeshQuad::clear()
{
m_points.clear();
m_quad_indices.clear();
}
int MeshQuad::add_vertex(const Vec3& P)
{
m_points.push_back(P);
return m_points.size()-1;
}
void MeshQuad::add_quad(int i1, int i2, int i3, int i4)
{
m_quad_indices.push_back(i1);
m_quad_indices.push_back(i2);
m_quad_indices.push_back(i3);
m_quad_indices.push_back(i4);
}
void MeshQuad::convert_quads_to_tris(const std::vector<int>& quads, std::vector<int>& tris)
{
tris.clear();
tris.reserve(3*quads.size()/2);
// Pour chaque quad on genere 2 triangles
// Attention a repecter l'orientation des triangles
for(unsigned int i=0; i<quads.size(); i=i+4) {
tris.push_back(quads[i]);
tris.push_back(quads[i+1]);
tris.push_back(quads[i+3]);
tris.push_back(quads[i+1]);
tris.push_back(quads[i+2]);
tris.push_back(quads[i+3]);
}
}
void MeshQuad::convert_quads_to_edges(const std::vector<int>& quads, std::vector<int>& edges)
{
edges.clear();
edges.reserve(quads.size()*2); // ( *2 /2 !)
// Pour chaque quad on genere 4 aretes, 1 arete = 2 indices.
// Mais chaque arete est commune a 2 quads voisins !
// Comment n'avoir qu'une seule fois chaque arete ?
for(unsigned int i =0 ; i<quads.size() ; i = i+4) {
edges.push_back(quads[i]);
edges.push_back(quads[i+1]);
edges.push_back(quads[i+1]);
edges.push_back(quads[i+2]);
edges.push_back(quads[i+2]);
edges.push_back(quads[i+3]);
edges.push_back(quads[i+3]);
edges.push_back(quads[i]);
}
}
void MeshQuad::bounding_sphere(Vec3& C, float& R)
{
// C = Moyenne de tous les vertex
// R = Maximum du parcours de tout les vertex -> calcule de la distance entre centre et chaque vertex
float x = 0.0;
float y = 0.0;
float z = 0.0;
//on fait la moyenne
for(unsigned int i = 0; i <m_points.size(); i++)
{
x += m_points[i].x;
y += m_points[i].y;
z += m_points[i].z;
}
x = x/m_points.size();
y = y/m_points.size();
z = z/m_points.size();
C.x = x;
C.y = y;
C.z = z;
float max = 0.0;
for(unsigned int i = 0; i <m_points.size(); i++)
{
float comparaison = m_points[i].x*m_points[i].x + m_points[i].y*m_points[i].y + m_points[i].z*m_points[i].z;
if( comparaison > max)
{
max = comparaison;
}
}
R = sqrt(max);
}
void MeshQuad::create_cube()
{
clear();
// ajouter 8 sommets (-1 +1)
int pt0 = add_vertex(Vec3(1,1,0));
int pt1 = add_vertex(Vec3(0,1,0));
int pt2 = add_vertex(Vec3(0,0,0));
int pt3 = add_vertex(Vec3(1,0,0));
int pt4 = add_vertex(Vec3(1,1,-1));
int pt5 = add_vertex(Vec3(0,1,-1));
int pt6 = add_vertex(Vec3(0,0,-1));
int pt7 = add_vertex(Vec3(1,0,-1));
// ajouter 6 faces (sens trigo)
add_quad(pt0,pt1,pt2,pt3);
add_quad(pt4,pt5,pt1,pt0);
add_quad(pt7,pt6,pt5,pt4);
add_quad(pt3,pt2,pt6,pt7);
add_quad(pt4,pt0,pt3,pt7);
add_quad(pt1,pt5,pt6,pt2);
gl_update();
}
Vec3 MeshQuad::normal_of(const Vec3& A, const Vec3& B, const Vec3& C)
{
// Attention a l'ordre des points !
// le produit vectoriel n'est pas commutatif U ^ V = - V ^ U
// ne pas oublier de normaliser le resultat.
Vec3 AB = Vec3(B.x-A.x, B.y-A.y , B.z-A.z);
Vec3 AC = Vec3(C.x-A.x , C.y-A.y , C.z-A.z);
Vec3 ABAC = glm::cross(AB,AC);
Vec3 res = glm::normalize(ABAC);
return res;
}
bool MeshQuad::is_points_in_quad(const Vec3& P, const Vec3& A, const Vec3& B, const Vec3& C, const Vec3& D)
{
// On sait que P est dans le plan du quad.
// P est-il au dessus des 4 plans contenant chacun la normale au quad et une arete AB/BC/CD/DA ?
// si oui il est dans le quad
float res = -1;
float d = 0;
Vec3 n = normal_of(A,B,C);
Vec3 AB = Vec3(B.x-A.x, B.y-A.y , B.z-A.z);
Vec3 BC = Vec3(C.x-B.x , C.y-B.y , C.z-B.z);
Vec3 CD = Vec3(D.x-C.x , D.y-C.y , D.z - C.z);
Vec3 DA = Vec3(A.x-D.x, A.y-D.y, A.z-D.z);
//normale et AB
Vec3 n1 = vec_cross(n,AB);
d = vec_dot(n1,A);
res = vec_dot(n1,P) - d;
if(res < 0) {
return false;
}
//normale et BC
Vec3 n2 = vec_cross(n,BC);
d= vec_dot(n2,B);
res = vec_dot(n2,P) -d;
if(res < 0) {
return false;
}
//normale et CD
Vec3 n3 = vec_cross(n,CD);
d= vec_dot(n3,C);
res = vec_dot(n3,P) -d;
if(res < 0) {
return false;
}
//normale et DA
Vec3 n4 = vec_cross(n,DA);
d= vec_dot(n4,D);
res = vec_dot(n4,P) -d;
if(res < 0) {
return false;
}
return true;
}
bool MeshQuad::intersect_ray_quad(const Vec3& P, const Vec3& Dir, int q, Vec3& inter)
{
// recuperation des indices de points
int i1 = m_quad_indices[q];
int i2 = m_quad_indices[q+1];
int i3 = m_quad_indices[q+2];
int i4 = m_quad_indices[q+3];
// recuperation des points
Vec3 pt1 = m_points[i1];
Vec3 pt2 = m_points[i2];
Vec3 pt3 = m_points[i3];
Vec3 pt4 = m_points[i4];
// calcul de l'equation du plan (N+d)
Vec3 n = normal_of(pt1,pt2,pt3);
int d = vec_dot(pt1,n);
// calcul de l'intersection rayon plan
float t = (d-vec_dot(P,n))/(vec_dot(Dir,n));
if( t == INFINITY) {
return false;
}
// alpha => calcul de I
Vec3 I = P+t*Dir;
// I dans le quad ?
if(is_points_in_quad(I,pt1,pt2,pt3,pt4)) {
inter = I;
return true;
}
return false;
}
int MeshQuad::intersected_closest(const Vec3& P, const Vec3& Dir)
{
// on parcours tous les quads
// on teste si il y a intersection avec le rayon
// on garde le plus proche (de P)
int inter = -1;
Vec3 intercourante;
float min = 0;
for(int i =0 ; i<m_quad_indices.size(); i=i+4) {
if(intersect_ray_quad(P, Dir, i,intercourante)) {
if(inter ==-1) {
min = (intercourante.x-P.x)*(intercourante.x-P.x)+(intercourante.y-P.y)*(intercourante.y-P.y)+(intercourante.z-P.z)*(intercourante.z-P.z);
inter = i;
}
else {
float compare = (intercourante.x-P.x)*(intercourante.x-P.x)+(intercourante.y-P.y)*(intercourante.y-P.y)+(intercourante.z-P.z)*(intercourante.z-P.z);
if(compare<min) {
min = compare;
inter = i;
}
}
}
}
return inter;
}
Mat4 MeshQuad::local_frame(int q)
{
/*
Repere locale = Matrice de transfo avec
les trois premieres colones: X,Y,Z locaux
la derniere colonne l'origine du repere
-> Mat4 = Vec4 X + Vec4 Y + Vec4 Z + Vec4 O
ici Z = N et X = AB
Origine le centre de la face
longueur des axes : [AB]/2
*/
// recuperation des indices de points
int i1 = m_quad_indices[q];
int i2 = m_quad_indices[q+1];
int i3 = m_quad_indices[q+2];
int i4 = m_quad_indices[q+3];
// recuperation des points
Vec3 pt1 = m_points[i1];
Vec3 pt2 = m_points[i2];
Vec3 pt3 = m_points[i3];
Vec3 pt4 = m_points[i4];
// calcul de Z:N / X:AB -> Y
Vec3 Z = glm::normalize(normal_of(pt1, pt2, pt3));
Vec3 X = glm::normalize(pt2 - pt1);
Vec3 Y = glm::normalize(glm::cross(X, Z));
// calcul du centre
float Ox = (pt1.x+pt2.x+pt3.x+pt4.x) / 4 ;
float Oy = (pt1.y+pt2.y+pt3.y+pt4.y) / 4;
float Oz = (pt1.z+pt2.z+pt3.z+pt4.z) / 4 ;
Vec3 O = Vec3(Ox,Oy,Oz);
// calcul de la taille
float taille = glm::length(pt2-pt1) /2 ;
// calcul de la matrice
Vec4 X4 = Vec4(X.x,X.y,X.z,0);
Vec4 Y4 = Vec4(Y.x,Y.y,Y.z,0);
Vec4 Z4 = Vec4(Z.x,Z.y,Z.z,0);
Vec4 O4 = Vec4(O.x,O.y,O.z,1);
Mat4 res = Mat4(X4,Y4,Z4,O4);
res = res*scale(taille);
return res;
}
float MeshQuad::area_of_quad(int q) {
// recuperation des indices de points
int i1 = m_quad_indices[q];
int i2 = m_quad_indices[q+1];
int i3 = m_quad_indices[q+2];
int i4 = m_quad_indices[q+3];
// recuperation des points
Vec3 pt1 = m_points[i1];
Vec3 pt2 = m_points[i2];
Vec3 pt3 = m_points[i3];
Vec3 pt4 = m_points[i4];
//aire triangle 1 2 4
float aire1 = vec_length(vec_cross(pt2-pt1,pt1-pt4))/2.0f;
//aire triangle 2 3 4
float aire2 = vec_length(vec_cross(pt3-pt2,pt4-pt3))/2.0f;
return aire1 + aire2 ;
}
void MeshQuad::extrude_quad(int q)
{
// recuperation des indices de points
int i1 = m_quad_indices[q];
int i2 = m_quad_indices[q+1];
int i3 = m_quad_indices[q+2];
int i4 = m_quad_indices[q+3];
// recuperation des points
Vec3 pt1 = m_points[i1];
Vec3 pt2 = m_points[i2];
Vec3 pt3 = m_points[i3];
Vec3 pt4 = m_points[i4];
// calcul de la normale
Vec3 n = normal_of(pt1,pt2,pt3);
// calcul de la hauteur
float hauteur = sqrt(area_of_quad(q));
// calcul et ajout des 4 nouveaux points
Vec3 npt1 = pt1 + n*hauteur;
Vec3 npt2 = pt2 + n*hauteur;
Vec3 npt3 = pt3 + n*hauteur;
Vec3 npt4 = pt4 + n*hauteur;
int ni1 = add_vertex(npt1);
int ni2 = add_vertex(npt2);
int ni3 = add_vertex(npt3);
int ni4 = add_vertex(npt4);
// on remplace le quad initial par le quad du dessus
m_quad_indices[q] = ni1;
m_quad_indices[q+1] = ni2;
m_quad_indices[q+2] = ni3;
m_quad_indices[q+3] = ni4;
// on ajoute les 4 quads des cotes
add_quad(ni2,i2,i3,ni3);
add_quad(ni4,i4,i1,ni1);
add_quad(ni3,i3,i4,ni4);
add_quad(ni1,i1,i2,ni2);
gl_update();
}
void MeshQuad::transfo_quad(int q, const glm::mat4& tr)
{
// recuperation des indices de points
int i1 = m_quad_indices[q];
int i2 = m_quad_indices[q+1];
int i3 = m_quad_indices[q+2];
int i4 = m_quad_indices[q+3];
// recuperation des (references de) points
Vec3& pt1 = m_points[i1];
Vec3& pt2 = m_points[i2];
Vec3& pt3 = m_points[i3];
Vec3& pt4 = m_points[i4];
// generation de la matrice de transfo globale:
// indice utilisation de glm::inverse() et de local_frame
Mat4 local = local_frame(q);
//une matrice est inversible si son déterminant est différent de 0
float determinant = glm::determinant(local);
if(determinant == 0) return;
Mat4 transfo =local*tr*glm::inverse(local);
// Application au 4 points du quad
pt1 = Vec3(transfo * Vec4(pt1.x,pt1.y,pt1.z,1));
pt2 = Vec3(transfo * Vec4(pt2.x,pt2.y,pt2.z,1));
pt3 = Vec3(transfo * Vec4(pt3.x,pt3.y,pt3.z,1));
pt4 = Vec3(transfo * Vec4(pt4.x,pt4.y,pt4.z,1));
}
void MeshQuad::decale_quad(int q, float d)
{
Mat4 transfo = translate(0,0,d);
transfo_quad(q,transfo);
gl_update();
}
void MeshQuad::shrink_quad(int q, float s)
{
Mat4 hom = scale(s);
transfo_quad(q,hom);
gl_update();
}
void MeshQuad::tourne_quad(int q, float a)
{
Mat4 rot = rotateZ(a);
transfo_quad(q,rot);
gl_update();
}
MeshQuad::MeshQuad():
m_nb_ind_edges(0)
{}
void MeshQuad::gl_init()
{
m_shader_flat = new ShaderProgramFlat();
m_shader_color = new ShaderProgramColor();
//VBO
glGenBuffers(1, &m_vbo);
//VAO
glGenVertexArrays(1, &m_vao);
glBindVertexArray(m_vao);
glBindBuffer(GL_ARRAY_BUFFER, m_vbo);
glEnableVertexAttribArray(m_shader_flat->idOfVertexAttribute);
glVertexAttribPointer(m_shader_flat->idOfVertexAttribute, 3, GL_FLOAT, GL_FALSE, 0, 0);
glBindVertexArray(0);
glGenVertexArrays(1, &m_vao2);
glBindVertexArray(m_vao2);
glBindBuffer(GL_ARRAY_BUFFER, m_vbo);
glEnableVertexAttribArray(m_shader_color->idOfVertexAttribute);
glVertexAttribPointer(m_shader_color->idOfVertexAttribute, 3, GL_FLOAT, GL_FALSE, 0, 0);
glBindVertexArray(0);
//EBO indices
glGenBuffers(1, &m_ebo);
glGenBuffers(1, &m_ebo2);
}
void MeshQuad::gl_update()
{
//VBO
glBindBuffer(GL_ARRAY_BUFFER, m_vbo);
glBufferData(GL_ARRAY_BUFFER, 3 * m_points.size() * sizeof(GLfloat), &(m_points[0][0]), GL_STATIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, 0);
std::vector<int> tri_indices;
convert_quads_to_tris(m_quad_indices,tri_indices);
//EBO indices
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_ebo);
glBufferData(GL_ELEMENT_ARRAY_BUFFER,tri_indices.size() * sizeof(int), &(tri_indices[0]), GL_STATIC_DRAW);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
std::vector<int> edge_indices;
convert_quads_to_edges(m_quad_indices,edge_indices);
m_nb_ind_edges = edge_indices.size();
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_ebo2);
glBufferData(GL_ELEMENT_ARRAY_BUFFER,m_nb_ind_edges * sizeof(int), &(edge_indices[0]), GL_STATIC_DRAW);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
}
void MeshQuad::set_matrices(const Mat4& view, const Mat4& projection)
{
viewMatrix = view;
projectionMatrix = projection;
}
void MeshQuad::draw(const Vec3& color)
{
glEnable(GL_CULL_FACE);
glEnable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(1.0f, 1.0f);
m_shader_flat->startUseProgram();
m_shader_flat->sendViewMatrix(viewMatrix);
m_shader_flat->sendProjectionMatrix(projectionMatrix);
glUniform3fv(m_shader_flat->idOfColorUniform, 1, glm::value_ptr(color));
glBindVertexArray(m_vao);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,m_ebo);
glDrawElements(GL_TRIANGLES, 3*m_quad_indices.size()/2,GL_UNSIGNED_INT,0);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,0);
glBindVertexArray(0);
m_shader_flat->stopUseProgram();
glDisable(GL_POLYGON_OFFSET_FILL);
m_shader_color->startUseProgram();
m_shader_color->sendViewMatrix(viewMatrix);
m_shader_color->sendProjectionMatrix(projectionMatrix);
glUniform3f(m_shader_color->idOfColorUniform, 0.0f,0.0f,0.0f);
glBindVertexArray(m_vao2);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,m_ebo2);
glDrawElements(GL_LINES, m_nb_ind_edges,GL_UNSIGNED_INT,0);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,0);
glBindVertexArray(0);
m_shader_color->stopUseProgram();
glDisable(GL_CULL_FACE);
}
|
43a5c66f9c695cf723e05df537d3fd81428eadaf | 6b2a8dd202fdce77c971c412717e305e1caaac51 | /solutions_5670465267826688_0/C++/sugim48/main.cpp | 7573eee8a29f6a43e2b874bceebe84857b975de1 | [] | no_license | alexandraback/datacollection | 0bc67a9ace00abbc843f4912562f3a064992e0e9 | 076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf | refs/heads/master | 2021-01-24T18:27:24.417992 | 2017-05-23T09:23:38 | 2017-05-23T09:23:38 | 84,313,442 | 2 | 4 | null | null | null | null | UTF-8 | C++ | false | false | 1,590 | cpp | main.cpp | #define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstring>
#include <cmath>
#include <fstream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int u, v; ll w; };
ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;
int a[4][4] = {
{0, 1, 2, 3},
{1, 4, 3, 6},
{2, 7, 4, 1},
{3, 2, 5, 4}
};
int f(int x, int y) {
return (x & 4) ^ (y & 4) ^ a[x % 4][y % 4];
}
int main () {
int T; cin >> T;
for (int t = 1; t <= T; t++) {
int L; ll X; cin >> L >> X;
string s; cin >> s;
bool yes = false;
int x = 0;
for (int i = 0; i < L; i++)
x = f(x, s[i] - 'h');
int y = 0;
for (int j = 0; j < X % 4; j++)
y = f(y, x);
if (y == 4) {
x = 0; ll l = LLONG_MAX;
for (int i = 0; i < L * 4; i++) {
if (x == 1) {
l = i;
break;
}
x = f(x, s[i % L] - 'h');
}
reverse(s.begin(), s.end());
x = 0; ll r = LLONG_MIN;
for (int i = 0; i < L * 4; i++) {
if (x == 3) {
r = X * L - i;
break;
}
x = f(s[i % L] - 'h', x);
}
if (l < r) yes = true;
}
printf("Case #%d: %s\n", t, yes ? "YES" : "NO");
}
} |
801345c3ac7e0f38307b6835f7069186214b08dd | b9da9d7bb7177a2d83f4e9d755a73ee76c2eadc6 | /service.cpp | ba3ca35083d43641cb074c361efad0b165933512 | [] | no_license | hermanno16/verk16-vika2 | 3bf37f565263e32b53c54a379f4933b51c92fda2 | c264b744cf6edcbad9a8f110ae86325ebd9fef0d | refs/heads/master | 2020-06-10T22:33:55.339794 | 2016-12-09T23:45:59 | 2016-12-09T23:45:59 | 75,856,682 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 14,151 | cpp | service.cpp | #include "service.h"
#include <cctype>
Service::Service()
{
}
//--Scientists functions--//
vector<Scientist> Service::getAllScientistsAtoZ()
{
vector<Scientist> allScientists;
allScientists = _dAccess.getAllScientistsAtoZ();
return allScientists;
}
vector<Scientist> Service::getAllScientistsZtoA()
{
vector<Scientist> allScientists;
allScientists = _dAccess.getAllScientistsZtoA();
return allScientists;
}
vector<Scientist> Service::getAllScientistsByYearOfBirthAsc()
{
vector<Scientist> allScientists;
allScientists = _dAccess.getAllScientistsByYearOfBirthAsc();
return allScientists;
}
vector<Scientist> Service::getAllScientistsByYearOfBirthDes()
{
vector<Scientist> allScientists;
allScientists = _dAccess.getAllScientistsByYearOfBirthDes();
return allScientists;
}
vector<Scientist> Service::getAllDeadOrAliveScientistsAtoZ(char input)
{
vector<Scientist> deadOrAliveScientists;
if(input == '1')
{
deadOrAliveScientists = _dAccess.getAllAliveScientistsAtoZ();
}
else if(input == '2')
{
deadOrAliveScientists = _dAccess.getAllDeceasedScientistsAtoZ();
}
else
{
deadOrAliveScientists = _dAccess.getAllAliveScientistsAtoZ();
for(unsigned int i = 0; i < _dAccess.getAllDeceasedScientistsAtoZ().size(); i++)
{
deadOrAliveScientists.push_back(_dAccess.getAllDeceasedScientistsAtoZ()[i]);
}
}
return deadOrAliveScientists;
}
vector<Scientist> Service::getAllDeceasedScientistsAtoZ()
{
vector<Scientist> allScientists;
allScientists = _dAccess.getAllDeceasedScientistsAtoZ();
return allScientists;
}
//Scientist - search functions.
vector<Scientist> Service::searchForScientistsByName(string searchString)
{
vector<Scientist> allScientists;
allScientists = _dAccess.searchForScientistsByName(searchString);
return allScientists;
}
vector<Scientist> Service::searchForScientistsByYearOfBirthAtoZ(string yearToFind)
{
vector<Scientist> allScientists;
allScientists = _dAccess.searchForScientistsByYearOfBirthAtoZ(yearToFind);
return allScientists;
}
vector<Scientist> Service::searchForScientistsByYearOfDeathAtoZ(string yearToFind)
{
vector<Scientist> allScientists;
allScientists = _dAccess.searchForScientistsByYearOfDeathAtoZ(yearToFind);
return allScientists;
}
vector<Scientist> Service::getScientistsByGenderAtoZ(char gender)
{
vector<Scientist> genderScientists;
if(gender == '1')
{
genderScientists = _dAccess.getAllFemaleScientistsAtoZ();
}
else if(gender == '2')
{
genderScientists = _dAccess.getAllMaleScientistsAtoZ();
}
else
{
genderScientists = _dAccess.getAllFemaleScientistsAtoZ();
for(unsigned int i = 0; i < _dAccess.getAllMaleScientistsAtoZ().size(); i++)
{
genderScientists.push_back(_dAccess.getAllMaleScientistsAtoZ()[i]);
}
}
return genderScientists;
}
void Service::removeScientistFromDataBase(int idOfScientist)
{
_dAccess.removeScientistFromDatabase(idOfScientist);
}
string Service::getScientistName(int idNumber)
{
string aScientist;
aScientist = _dAccess.getScientistName(idNumber);
return aScientist;
}
//--Computer and Scientist functions--//
vector<Scientist> Service::connectComputerToScientist(int idNumber)
{
vector<Scientist> allScientists;
allScientists = _dAccess.connectComputerToScientist(idNumber);
return allScientists;
}
vector<Computer> Service::connectScientistToComputer(int idNumber)
{
vector<Computer> allComputers;
allComputers = _dAccess.connectScientistToComputer(idNumber);
return allComputers;
}
bool Service::addRelation(int inputID,int inputCid)
{
bool relation = _dAccess.addScientistToComputer(inputID,inputCid);
return relation;
}
void Service::removeRelationFromDatabase(int inputID, int inputCid)
{
_dAccess.removeRelationFromDatabase(inputID,inputCid);
}
//--Computer functions--//
vector<Computer> Service::getAllComputersAtoZ()
{
vector<Computer> allComputers;
allComputers = _dAccess.getAllComputersAtoZ();
return allComputers;
}
vector<Computer> Service::getAllComputersZtoA()
{
vector<Computer> allComputers;
allComputers = _dAccess.getAllComputersZtoA();
return allComputers;
}
vector<Computer> Service::getAllTypesComputersAtoZ(char type)
{
vector<Computer> typeComputer;
vector<Computer> tempVectorComputer;
if(type > '0' && type < '8')
{
if(type == '1')
{
typeComputer = _dAccess.getAllComputersTypeAtoZ();
}
else if(type == '2')
{
typeComputer = _dAccess.getAllComputersTypeElectronic();
}
else if(type == '3')
{
typeComputer = _dAccess.getAllComputersTypeMechanical();
}
else if(type == '4')
{
typeComputer = _dAccess.getAllComputersTypeElectronicMechanical();
}
else if(type == '5')
{
typeComputer = _dAccess.getAllComputersTransistor();
}
else if(type == '6')
{
typeComputer = _dAccess.getAllComputersTypeMicrocomputer();
}
else if (type == '7')
{
typeComputer = _dAccess.getAllComputersTypeTernary();
}
return typeComputer;
}
else
{
cout << " > invalid input!" << endl;
return tempVectorComputer;
}
}
vector<Computer> Service::getAllBuildYearComputers(string yearBuilt)
{
vector<Computer> yearBuiltComputer;
if(yearBuilt == "1")
{
yearBuiltComputer = _dAccess.getAllComputersYearBuiltAtoZ();
}
else if(yearBuilt == "2")
{
yearBuiltComputer = _dAccess.getAllComputersYearBuiltZtoA();
}
return yearBuiltComputer;
}
vector<Computer> Service::getAllDevelopmentAndOriginalComputers(string development)
{
vector<Computer> developmentComputer;
if (development == "1")
{
developmentComputer = _dAccess.getAllComputersOriginal();
}
else if (development == "2")
{
developmentComputer = _dAccess.getAllComputersDeveloped();
}
else if (development == "3")
{
developmentComputer =_dAccess.getAllComputersDevelopedAndOriginal();
}
return developmentComputer;
}
//--Computer Search Functions
vector<Computer> Service::searchForComputersByName(string inputName)
{
vector<Computer> allComputers;
allComputers = _dAccess.searchForComputersByName(inputName);
return allComputers;
}
vector<Computer> Service::searchForComputersByYearBuilt(string yearBuiltToFind)
{
vector<Computer> allComputers;
allComputers = _dAccess.searchForComputersByYearBuilt(yearBuiltToFind);
return allComputers;
}
vector<Computer> Service::searchForComputersByType(string typeToFind)
{
vector<Computer> allComputers;
allComputers = _dAccess.searchForComputersByType(typeToFind);
return allComputers;
}
string Service::getComputerName(int idNumber)
{
string aComputer;
aComputer = _dAccess.getComputerName(idNumber);
return aComputer;
}
//-- Valid functions --//
void Service::addScientistToData(string inputName, string inputGender, string inputYearOfBirth, string inputYearOfDeath)
{
_dAccess.addScientistToDataBase(inputName, inputGender, inputYearOfBirth, inputYearOfDeath);
}
void Service::addComputerToData(string inputName, string inputYearBuilt, string inputType, string inputDevelopment)
{
_dAccess.addComputerToDataBase(inputName, inputYearBuilt, inputType, inputDevelopment);
}
void Service::removeComputerFromDataBase(int idOfComputer)
{
_dAccess.removeComputerFromDatabase(idOfComputer);
}
bool Service::inputNameValid(string input)
{
if(atoi(input.c_str()) && input.length() < 40)
{
return false;
}
return true;
}
/*
* Functions to check if information about scientist who is about to be added is valid.
* */
bool Service::isAddScientistValid(string name, string gender, string yearOfBirth, string yearOfDeath)
{
bool checkIfNameIsAlreadyInDataBase = true;
bool checkName = false;
bool checkGender = false;
bool checkYearOfBirth = false;
bool checkYearOfDeath = false;
if(_dAccess.isScientistAlreadyInDatabase(name) == true)
{
checkIfNameIsAlreadyInDataBase = false;
}
if(name.length() > 0)
{
checkName = true;
}
if(gender.length() > 3)
{
for(unsigned int i = 0; i < gender.size(); i++)
{
gender.at(i) = tolower(gender.at(i));
}
if(gender == "male" || gender == "female")
{
checkGender = true;
}
}
if(atoi(yearOfBirth.c_str()) <= YEARTODAY && atoi(yearOfBirth.c_str()) > 0)
{
checkYearOfBirth = true;
}
if(yearOfDeath == "N/A" || (atoi(yearOfDeath.c_str()) > atoi(yearOfBirth.c_str())) || (atoi(yearOfDeath.c_str())) <= YEARTODAY)
{
checkYearOfDeath = true;
}
return (checkIfNameIsAlreadyInDataBase && checkName && checkGender && checkYearOfBirth && checkYearOfDeath);
}
void Service::fixInputNameScientist(string& inputName)
{
inputName = inputName.substr(0,40);
inputName.at(0) = toupper(inputName.at(0));
for(unsigned int i = 1; i < inputName.size(); i++)
{
if (inputName.at(i - 1) == ' ')
{
inputName.at(i) = toupper(inputName.at(i));
}
else
{
inputName.at(i) = tolower(inputName.at(i));
}
}
}
void Service::fixInputGenderScientist(string& inputGender)
{
//Max size of input is 6, if string is longer,the rest will be cut off.
inputGender = inputGender.substr(0,6);
//First letter to upper case.
inputGender.at(0) = toupper(inputGender.at(0));
//Rest of the letters to lower case.
for(unsigned int i = 1; i < inputGender.size(); i++)
{
inputGender.at(i) = tolower(inputGender.at(i));
}
}
void Service::fixInputTypeComputer(string& inputType)
{
inputType = inputType.substr(0,21);
inputType.at(0) = toupper(inputType.at(0));
for(unsigned int i = 1; i < inputType.size(); i++)
{
inputType.at(i) = tolower(inputType.at(i));
}
}
void Service::fixInputDevelopmentComputer(string& inputDevelopment)
{
inputDevelopment = inputDevelopment.substr(0,9);
inputDevelopment.at(0) = toupper(inputDevelopment.at(0));
for(unsigned int i = 1; i < inputDevelopment.size(); i++)
{
inputDevelopment.at(i) = tolower(inputDevelopment.at(i));
}
}
bool Service::isAddComputerValid(string name, string yearBuilt, string type, string development)
{
bool checkIfNameIsAlreadyInDataBase = true;
bool checkName = false;
bool checkYearBuilt = false;
bool checkType = false;
bool checkDevelopment = false;
if(_dAccess.isComputerNameAlreadyInDatabase(name) == true)
{
checkIfNameIsAlreadyInDataBase = false;
}
if(name.length() > 0)
{
checkName = true;
}
if(atoi(yearBuilt.c_str()) <= YEARTODAY && atoi(yearBuilt.c_str()) > 0)
{
checkYearBuilt = true;
}
if(type.length() > 6)
{
//Switch to lower case to check if input matches the correct string.
for(unsigned int i = 0; i < type.size(); i++)
{
type.at(i) = tolower(type.at(i));
}
if(type == "electronic" || type == "mechanical" || type == "electronic/mechanical" || type == "transistor" || type == "microcomputer" || type == "ternary")
{
checkType = true;
}
}
if(development.length() > 7)
{
for(unsigned int i = 0; i < development.size(); i++)
{
development.at(i) = tolower(development.at(i));
}
if(development == "developed" || development == "original")
{
checkDevelopment = true;
}
}
return (checkIfNameIsAlreadyInDataBase && checkName && checkYearBuilt && checkType && checkDevelopment);
}
//--Operators overload--//
ostream& operator <<(ostream& os , Scientist& TempClass) // Operator Overloader fyrir cout << Scientist.
{
if(TempClass.getYearOfDeath()==0)
{
os << " | ";os.width(5); os << left << TempClass.getID();
os.width(30); os << left << TempClass.getName();
os << " " ;os.width(13); os << left << TempClass.getGender();
os << " " ;os.width(15); os << left << TempClass.getYearOfBirth();
os << " " ;os.width(17); os << left << "N/A" << "|";
os << endl;
}
else
{
os << " | ";os.width(5); os << left << TempClass.getID();
os.width(30); os << left << TempClass.getName();
os << " " ;os.width(13); os << left << TempClass.getGender();
os << " " ;os.width(15); os << left << TempClass.getYearOfBirth();
os << " " ;os.width(17); os << left << TempClass.getYearOfDeath() << "|";
os << endl;
}
return os;
}
ostream& operator <<(ostream& os, Computer& TempClass) // Operator Overloader fyrir cout << Computer.
{
os << " | ";os.width(5); os << left << TempClass.getId();
os.width(24); os << left << TempClass.getName();
os << " " ;os.width(21); os << left << TempClass.getType();
os << " " ;os.width(13); os << left << TempClass.getYearBuilt();
os << " " ;os.width(17); os << left << TempClass.getDevelopment() << "|";
os << endl;
return os;
}
|
53a98300df50785021d0a7501221b0aa36be52d7 | 46d895f81782788bf645b6033972e402dc6a3b87 | /ADNS2610/ADNS2610.h | 177cbc5f5793c5c7e4fbee223e038bb9b76840b4 | [] | no_license | goddade/adns2610 | 50fd3c4106d713aa4a97acca05ddd2ee2af17aa2 | c45351ad830de09eb5b6a3a750dcc16b8d1693ac | refs/heads/master | 2023-03-16T14:30:58.273415 | 2021-02-08T19:44:07 | 2021-02-08T19:44:07 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,739 | h | ADNS2610.h | /*
ADNS2610.h - ADNS2610 Arduino Library - by Leoneq ;3, April 2020
(insert github here)
Based on code by Conor Peterson (robotrobot@gmail.com): https://conorpeterson.wordpress.com/2010/06/04/optical-mouse-hacking-part-1/
*/
#ifndef ADNS2610_h
#define ADNS2610_h
#include "Arduino.h"
class ADNS2610
{
public:
ADNS2610(int dataPin, int clockPin, int ledPin);
ADNS2610(int dataPin, int clockPin, int rLedPin, int gLedPin, int bLedPin);
int8_t getDeltaX();
int8_t getDeltaY();
int getAvgPixel(char kolor);
int getMinPixel(char kolor);
int getMaxPixel(char kolor);
int getAvgPixel();
int getMinPixel();
int getMaxPixel();
void readFrame(byte* frame);
void readFrame(byte* frame, char color);
void begin(boolean mode);
void blinkLED();
void debug();
void backlight(boolean state);
private:
byte dataPin_;
byte clockPin_;
byte ledPin_;
byte rLedPin_;
byte gLedPin_;
byte bLedPin_;
byte deltaX_;
byte deltaY_;
boolean mode_;
void writeRegister(byte addr, byte data);
byte readRegister(byte addr);
const byte regConfig_ = 0x00; //change to your mouse chip, according to your datasheet
const byte regStatus_ = 0x01;
const byte regMinPixel_ = 0x06;
const byte regDeltaX_ = 0x03;
const byte regDeltaY_ = 0x02;
const byte regMaxPixel_ = 0x05;
const byte regAvgPixel_ = 0x07;
const byte regPixelData_ = 0x08;
const byte maskNoSleep_ = 0x01;
const byte maskPID_ = 0xE0;
};
#endif |
75e77e7e5c2a8f60e9eb7558aaa1c45d9323c614 | a486ba7780119c4f202d6975f66ffc50dac55fe7 | /symbolTable/redBlackTree/redBlackTree.h | 24cb37322dae28a3ab8bebce37e778b74c7c0f1a | [] | no_license | maple-ysd/data_structure_and_algorithm | 5b543900bb1f831e11963262667bd50e93c616f2 | a68426c3794314ac5c81b967b7ce006d7843b984 | refs/heads/master | 2023-04-21T06:53:30.594972 | 2021-05-12T06:30:06 | 2021-05-12T06:30:06 | 366,573,140 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 18,129 | h | redBlackTree.h | #ifndef REDBLACKTREE_H_
#define REDBLACKTREE_H_
/***************************************************
red black tree
红黑树性质:
1、每个结点或是红色的,或是黑色的
2、根节点是黑色的
3、每个叶结点(NIL)是黑色的(默认空链接为黑色)
4、如果一个节点是红色的,则它的两个儿子都是黑色的。
5、对于每个结点,从该结点到其叶子结点的所有路径上包含相同数目的黑色结点。
这里的实现采用左倾红黑树(参照算法第四版),即在前面的基础上加上一条限制
所有的(稳定)红节点只能出现在左孩子上
因此该二三树的实现基于2-3树(与之相对的经典红黑树的实现依赖于2-3-4树)
****************************************************/
#include <iostream>
#include <string>
#include <queue> // 用于层序遍历析构红黑树
template <typename Key, typename Value>
class redBlackTree
{
public:
static const bool RED = true;
static const bool BLACK = false;
struct Node
{
Key key;
Value value;
Node *left = nullptr;
Node *right = nullptr;
int Size; // 主要用于rank和select,代表以该节点为根节点的子树的节点数
bool color;
Node(Key k, Value v, int sz, bool c): key(k), value(v), Size(sz), color(c) {}
};
redBlackTree(): root(nullptr) {}
~redBlackTree()
{
if (root)
{
std::queue<Node*> que;
que.push(root);
Node *temp = nullptr;
while (!que.empty())
{
temp = que.front();
que.pop();
if (temp->left) que.push(temp->left);
if (temp->right) que.push(temp->right);
delete temp;
}
}
}
void preOrderTraversal()
{
preOrderTraversal(root);
}
void preOrderTraversal(Node *proot)
{
if (proot)
{
if (proot->color) std::cout << "R";
else std::cout << "B";
std::cout << proot->key << " ";
preOrderTraversal(proot->left);
preOrderTraversal(proot->right);
}
}
void inOrderTraversal()
{
inOrderTraversal(root);
}
void inOrderTraversal(Node *proot)
{
if (proot)
{
inOrderTraversal(proot->left);
if (proot->color) std::cout << "R";
else std::cout << "B";
std::cout << proot->key << " ";
inOrderTraversal(proot->right);
}
}
void postOrderTraversal()
{
postOrderTraversal(root);
}
void postOrderTraversal(Node *proot)
{
if (proot)
{
postOrderTraversal(proot->left);
postOrderTraversal(proot->right);
if (proot->color) std::cout << "R";
else std::cout << "B";
std::cout << proot->key << " ";
}
}
int size() { return size(root); }
int size(Node *node)
{
if (node == nullptr) return 0;
return node->Size;
}
bool empty() { return size() == 0; }
bool isRed(Node *node)
{
if (node == nullptr) return false;
return node->color == RED;
}
Node *find(Key k) { return find(root, k); }
Node *find(Node *proot, Key k)
{
if (!proot) return nullptr;
if (k < proot->key) return find(proot->left, k);
else if (k > proot->key) return find(proot->right, k);
else return proot;
}
/** 插入
* 树为空:直接创建一个节点,让root指向它即可
* 树不空:(R表示红色,B表和示黑色,X表示待插入节点,黑上红下, -表示一个2-3树节点包含多个键)
* >> 插在2节点上
* B3 B3
* 红黑树 / \
* XR1 XR5
*
* 2-3树 XR1-B3 B3-XR5
* 这种情况下直接插入即可,无需处理
*
*
* >> 插在3节点上
* (1) (2) (3) (结果)
* B5 B5
* 红黑树 / /
* R3 ---> R3 ---> B3 ---> R3
* \ / / \ / \
* XR4 XR1 XR1 R5 XB1 B5
*
* 插入在三节点上共以上三种情况(1)(2)(3)
* 情况(3)直接变色即可
* 情况(2)转化为情况(3)变色处理
* 情况(1)先变为情况(2)再变为情况(3)变色处理
*
* 变色处理以后红节点上移,在上层中该节点位置类似于插入了一个红节点,继续重复该过程
*/
void insert(Key k, Value v)
{
root = insert(root, k, v);
root->color = BLACK;
}
Node *insert(Node *proot, Key k, Value v)
{
if (proot == nullptr) return new Node(k, v, 1, RED);
if (k < proot->key)
{
proot->left = insert(proot->left, k, v);
}
else if (k > proot->key)
{
proot->right = insert(proot->right, k, v);
}
else proot->value = v;
if (isRed(proot->right) && !isRed(proot->left)) proot = rotateLeft(proot);
if (isRed(proot->left) && isRed(proot->left->left)) proot = rotateRight(proot);
if (isRed(proot->left) && isRed(proot->right)) flipColors(proot); // 此处颜色翻转把红色节点上移,类似于插入节点为上面那个节点,然后递归向上
proot->Size = size(proot->left) + 1 + size(proot->right);
return proot;
}
Node *Min()
{
return Min(root);
}
Node *Min(Node *node)
{
if (!node) return nullptr;
if (node->left == nullptr) return node;
return Min(node->left);
// // 或者采用非递归形式实现
// while (node->left)
// node = node->left;
// return node;
}
Node *Max()
{
return Max(root);
}
Node *Max(Node *node)
{
if (node == nullptr) return nullptr;
while (node->right)
node = node->right;
return node;
}
Node *lowerBound(Key k)
{
return lowerBound(root, k);
}
Node *lowerBound(Node *node, Key k) // 找第一个不小于k的节点
{
if (node == nullptr) return nullptr;
if (k < node->key)
{
Node *temp = lowerBound(node->left, k);
if (temp != nullptr)
return temp;
else
return node;
}
else if (k > node->key) return (lowerBound(node->right, k));
else return node;
}
Node *upperBound(Key k)
{
return upperBound(root, k);
}
Node *upperBound(Node *node, Key k) // 找第一个大于k的节点
{
if (node == nullptr) return nullptr;
if (k < node->key) return upperBound(node->right, k);
else if (k > node->key)
{
Node *temp = upperBound(node->left, k);
if (temp != nullptr)
return temp;
else
return node;
}
}
Node *select(int index)
{
if (index >= size())
throw std::out_of_range("index out of range in select operation.\n");
return select(root, index);
}
Node *select(Node *node, int index)
{
int leftSubTreeSize = size(node->left);
if (index < leftSubTreeSize) return select(node->left, index);
else if (index > leftSubTreeSize) return select(node->right, index - leftSubTreeSize - 1);
else return node;
}
int rank(Key k) // 表示小于该键值的节点个数
{
return rank(root, k);
}
int rank(Node *node, Key k)
{
if (node == nullptr) return 0;
if (k < node->key) return rank(node->left, k);
else if (k > node->key) return size(node->left) + 1 + rank(node->right, k);
else return size(node->left);
}
/** 删除最小节点
* (被删除节点一定为红色)
* 树为空,不予处理
* 树不空:(继续向下传递之前,确保当前节点的左孩子一定为红节点或当前节点的左孩子的左孩子一定为红节点)
*
* 自顶向下查找过程中,在验证每一个节点是否为最小节点之前,(可能需要向其兄弟 "借")确保其能对应2-3树中一个3节点或者临时4节点,
* (即红黑树中当前节点或其左子节点为红节点)。然后删除该节点,不影响2-3树的平衡,然后自底向上,配平
*
* >>>> 以下两种情况不做处理,继续向下查询
* (1) (2)
* B5 B5
* / / \
* 红黑树 XR1 B3 B7 当前节点的左孩子为红节点 或 当前节点的左孩子的左孩子为红节点
* /
* XR1
*
* 2-3树 XR1-B5 B5 红黑树里当前节点的左孩子
* / \ 对应的:当前节点为3节点时,该3节点的左键
* XR1-B3 B7 当前节点不为3节点但当前节点的左孩子为3节点,该3节点的右键
*
* >>>> 以下两种情况,需要向其兄弟节点“借”一下
* (1)
* R5 B5 B5 B6 R6 红黑树
* / \ / \ / \ / \ / \
* B3 B7 ---> R3 R7 ---> R3 R6 ---> R5 R7 ---> B5 B7
* / / \ / /
* R6 R6 R7 R3 R3
*
* R5 R6 2-3树
* / \ ------------------------------------> / \
* B3 R6-B7 R3-B5 B7 “借”完成
*
* (2)
* R5 B5 红黑树
* / \ ---> / \
* B3 B7 R3 R7
*
* R5
* / \ ---> R3-B5-R7 2-3树 借不了,就合成临时4节点来处理
* B3 B7
*/
void deleteMin()
{
if (root == nullptr) return;
if (!isRed(root->left && !isRed(root->right))) // 确保根节点或根节点的左孩子为红色
root->color = RED;
root = deleteMin(root);
if (!empty())
root->color = BLACK;
}
/** 若该节点为最小节点,即左孩子为空,直接删除
* 反之:
* 判断左孩子是否为黑二节点,若是,调整(向右孩子借,左孩子为黑的情况下,右孩子一定存在)
* 调整后,在其左孩子上继续递归(向下)删除最小节点
* 最后记得(迭代向上)平衡
*/
Node *deleteMin(Node *node)
{
if (node->left == nullptr)
{
delete node;
return nullptr;
}
if (!isRed(node->left) && !isRed(node->left->left)) // 判断若左孩子为黑2节点, 则向其兄弟“借”一下
{
node = moveRedLeft(node);
}
node->left = deleteMin(node->left);
return balance(node);
}
/**< 与删除最小节点不同的一点是最大节点为黑节点,因此需要右旋一次是最大节点为红色,其他过程类似 */
void deleteMax()
{
if (empty()) return;
if (!isRed(root->left) && !isRed(root->right))
root->color = RED;
root = deleteMax(root);
if (!empty())
root->color = BLACK;
}
Node *deleteMax(Node *node)
{
if (isRed(node->left))
node = rotateRight(node);
if (node->right == nullptr)
{
delete node;
return nullptr;
}
if (!isRed(node->right) && !isRed(node->right->left)) // 判断是否为黑二节点
{
node = moveRedRight(node);
}
node->right = deleteMax(node->right);
return balance(node);
}
void remove(Key k)
{
if (find(k) == nullptr) return;
if (!isRed(root->left) && !isRed(root->right))
root->color = RED;
root = remove(root, k);
if (!empty())
root->color = BLACK;
}
/**<
若k < node->key, 往左边走,照着之前删除最小的情况,类似的处理一下,确保当前节点的左孩子为红节点,或者当前节点的左孩子的左孩子为红节点
若k > node->key, 往右边走,照着之前删除最大的情况,类似的处理一下,确保当前节点的右孩子为红节点, 或当前节点的右孩子的右孩子为红节点
若k == node->key, 若左侧为红节点先右旋一下, 然后判断右孩子是否为空,是的话删除(这里右旋一下是为了避免删除该节点后左孩子失去了链接)
若是中间节点,则先按类似 > 情况处理,确保右孩子为红节点或右孩子的右孩子为红节点,
然后复制Min(node->right)到当前节点,删除node->right 的最小节点
*/
Node *remove(Node *node, Key k)
{
if (node == nullptr) return nullptr;
if (k < node->key)
{
if (!isRed(node->left) && node->left != nullptr && !isRed(node->left->left))
node = moveRedLeft(node);
node->left = remove(node->left, k);
}
else
{
if (isRed(node->left)) node = rotateRight(node); // 确保左侧节点不会断开,并且确保右侧节点为红节点或该节点的孩子为红节点
if (k == node->key && node->right == nullptr)
{
delete node;
return nullptr;
}
if (!isRed(node->right) && node->right != nullptr && !isRed(node->right->left))
node = moveRedRight(node);
if (k == node->key)
{
Node *aux = Min(node->right);
node->key = aux->key;
node->value = aux->value;
node->right = deleteMin(node->right);
}
else
node->right = remove(node->right, k);
}
return balance(node);
}
private:
Node *root = nullptr;
Node *rotateLeft(Node *node)
{
// 这里已假设该节点的右孩子为红节点
// std::assert(node != nullptr && isRed(node->right));
if (node == nullptr || !isRed(node->right)) return nullptr;
Node *newRoot = node->right;
node->right = newRoot->left;
newRoot->left = node;
newRoot->Size = node->Size;
node->Size = size(node->left) + 1 + size(node->right);
newRoot->color = node->color;
node->color = RED; // 这里已假设该节点的右孩子为红节点,该假设在这里体现
return newRoot;
}
Node *rotateRight(Node *node)
{
// 这里假设该节点的左孩子为红节点
// std::assert(node != nullptr && isRed(node->left));
if (node == nullptr || !isRed(node->left)) return nullptr;
Node *newRoot = node->left;
node->left = newRoot->right;
newRoot->right = node;
newRoot->Size = node->Size;
node->Size = size(node->left) + 1 + size(node->right);
newRoot->color = node->color;
node->color = RED; // 这里已假设该节点的右孩子为红节点,该假设在这里体现
return newRoot;
}
void flipColors(Node *node)
{
// 保证该节点与其左右子节点一定存在
if (!node || !node->left || !node->right) return;
// 该节点与其两个子节点具有相反的颜色
if ((isRed(node) && !isRed(node->left) && !isRed(node->right)) || (!isRed(node) && isRed(node->left) && isRed(node->right)))
{
node->color = !node->color;
node->left->color = !node->left->color;
node->right->color = !node->right->color;
}
}
// 当前节点的左孩子为黑2节点,找右孩子借一下
Node *moveRedLeft(Node *node)
{
// 假设node节点为红色,他的左孩子,以及左孩子的左孩子均为黑色
// 想方设法使其左孩子变红,或者左孩子的左孩子变红
flipColors(node);
if (node->right != nullptr && isRed(node->right->left))
{
node->right = rotateRight(node->right);
node = rotateLeft(node);
flipColors(node);
}
return node;
}
// 当前节点的右孩子为黑2节点,找左孩子借一下
Node *moveRedRight(Node *node)
{
// 若左孩子没得借
flipColors(node);
// 左孩子有的借
if (node->left != nullptr && isRed(node->left->left))
{
node = rotateRight(node);
flipColors(node);
}
return node;
}
Node *balance(Node *node)
{
if (node == nullptr) return nullptr;
if (isRed(node->right) && !isRed(node->left))
node = rotateLeft(node);
if (isRed(node->left) && isRed(node->left->left))
node = rotateRight(node);
if (isRed(node->left) && isRed(node->right))
flipColors(node);
node->Size = size(node->left) + 1 + size(node->right);
return node;
}
};
#endif // REDBLACKTREE_H_
|
d9e3c967bd8b9a1d951d777729a2c62bd72fb6e6 | c8438f31721efd2fed3ce0c5752ff033b1e71d72 | /c64/vice-2.4/src/arch/beos/ui.cc | cecf43d001935606ddfd9d6814d0731c52e9811c | [
"GPL-2.0-only",
"MIT",
"GPL-2.0-or-later",
"GPL-1.0-or-later"
] | permissive | century-arcade/src | 8c9151d9847dd0f6d6b92f662444c70064b6845d | b6abba2679f5eaa5a71871b916459aab7ae50d1c | refs/heads/master | 2022-06-21T09:50:06.176276 | 2022-06-15T23:00:41 | 2022-06-15T23:00:47 | 13,259,218 | 4 | 1 | MIT | 2022-06-16T14:24:17 | 2013-10-02T00:18:36 | C | UTF-8 | C++ | false | false | 47,120 | cc | ui.cc | /*
* ui.cc - BeOS user interface.
*
* Written by
* Andreas Matthies <andreas.matthies@gmx.net>
*
* This file is part of VICE, the Versatile Commodore Emulator.
* See README for copyright notice.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA.
*
*/
#include "vice.h"
#include <Alert.h>
#include <Application.h>
#include <Clipboard.h>
#include <FilePanel.h>
#include <Menu.h>
#include <MenuBar.h>
#include <MenuItem.h>
#include <ScrollView.h>
#include <TextView.h>
#include <View.h>
#include <Window.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
extern "C" {
#include "attach.h"
#include "autostart.h"
#include "autostart-prg.h"
#include "archdep.h"
#include "charset.h"
#include "cmdline.h"
#include "clipboard.h"
#include "constants.h"
#include "datasette.h"
#include "drive.h"
#include "fliplist.h"
#include "imagecontents.h"
#include "info.h"
#include "interrupt.h"
#include "joy.h"
#include "kbd.h"
#include "kbdbuf.h"
#include "keyboard.h"
#include "lib.h"
#include "log.h"
#include "machine.h"
#include "main.h"
#include "maincpu.h"
#include "mem.h"
#include "monitor.h"
#include "mos6510.h"
#include "mouse.h"
#include "network.h"
#include "platform.h"
#include "platform_discovery.h"
#include "printer.h"
#include "resources.h"
#include "sound.h"
#include "statusbar.h"
#include "tape.h"
#include "types.h"
#include "ui.h"
#include "ui_datasette.h"
#include "ui_device.h"
#include "ui_drive.h"
#include "ui_file.h"
#include "ui_joystick.h"
#include "ui_netplay.h"
#include "ui_ram.h"
#include "ui_sound.h"
#include "ui_video.h"
#include "uicmdline.h"
#include "userport_joystick.h"
#include "util.h"
#include "version.h"
#include "vice-event.h"
#include "viceapp.h"
#include "vicewindow.h"
#include "videoarch.h"
#include "vsync.h"
}
/* sometimes we may need pointers to the ViceWindows */
#define MAX_WINDOWS 10
ViceWindow *windowlist[MAX_WINDOWS];
int window_count = 0;
/* List of resources that can be switched on and off from the menus. */
ui_menu_toggle toggle_list[] = {
{ "Sound", MENU_TOGGLE_SOUND },
{ "DriveTrueEmulation", MENU_TOGGLE_DRIVE_TRUE_EMULATION },
{ "DriveSoundEmulation", MENU_TOGGLE_DRIVE_SOUND_EMULATION },
{ "AutostartHandleTrueDriveEmulation", MENU_TOGGLE_HANDLE_TDE_AUTOSTART },
{ "DirectWindow", MENU_TOGGLE_DIRECTWINDOW },
{ "WarpMode", MENU_TOGGLE_WARP_MODE },
{ "VirtualDevices", MENU_TOGGLE_VIRTUAL_DEVICES },
{ "SaveResourcesOnExit", MENU_TOGGLE_SAVE_SETTINGS_ON_EXIT },
{ "ConfirmOnExit", MENU_TOGGLE_CONFIRM_ON_EXIT },
{ "ExtraJoy", MENU_TOGGLE_USERPORT_JOY },
{ "AutostartWarp", MENU_AUTOSTART_WARP },
{ "AutostartRunWithColon", MENU_USE_COLON_WITH_RUN },
{ "AutostartBasicLoad", MENU_LOAD_TO_BASIC_START },
{ "AutostartDelayRandom", MENU_AUTOSTART_DELAY_RANDOM },
{ "JoyOpposite", MENU_ALLOW_OPPOSITE_JOY },
{ "IECDevice4", MENU_PRINTER_4_IEC },
{ "IECDevice5", MENU_PRINTER_5_IEC },
{ "PrinterUserport", MENU_TOGGLE_USERPORT_PRINTER },
{ NULL, 0 }
};
/* List of resources which can have multiple mutual exclusive menu entries. */
ui_res_possible_values RefreshRateValues[] = {
{ 0, MENU_REFRESH_RATE_AUTO },
{ 1, MENU_REFRESH_RATE_1 },
{ 2, MENU_REFRESH_RATE_2 },
{ 3, MENU_REFRESH_RATE_3 },
{ 4, MENU_REFRESH_RATE_4 },
{ 5, MENU_REFRESH_RATE_5 },
{ 6, MENU_REFRESH_RATE_6 },
{ 7, MENU_REFRESH_RATE_7 },
{ 8, MENU_REFRESH_RATE_8 },
{ 9, MENU_REFRESH_RATE_9 },
{ 10, MENU_REFRESH_RATE_10 },
{ -1, 0 }
};
ui_res_possible_values SpeedValues[] = {
{ 0, MENU_MAXIMUM_SPEED_NO_LIMIT },
{ 10, MENU_MAXIMUM_SPEED_10 },
{ 20, MENU_MAXIMUM_SPEED_20 },
{ 50, MENU_MAXIMUM_SPEED_50 },
{ 100, MENU_MAXIMUM_SPEED_100 },
{ 200, MENU_MAXIMUM_SPEED_200 },
{ -1, 0 }
};
ui_res_possible_values RecordingOptions[] = {
{ EVENT_START_MODE_FILE_SAVE, MENU_EVENT_START_MODE_SAVE },
{ EVENT_START_MODE_FILE_LOAD, MENU_EVENT_START_MODE_LOAD },
{ EVENT_START_MODE_RESET, MENU_EVENT_START_MODE_RESET },
{ EVENT_START_MODE_PLAYBACK, MENU_EVENT_START_MODE_PLAYBACK },
{ -1, 0 }
};
ui_res_possible_values SyncFactor[] = {
{ MACHINE_SYNC_PAL, MENU_SYNC_FACTOR_PAL },
{ MACHINE_SYNC_NTSC, MENU_SYNC_FACTOR_NTSC },
{ MACHINE_SYNC_NTSCOLD, MENU_SYNC_FACTOR_NTSCOLD },
{ MACHINE_SYNC_PALN, MENU_SYNC_FACTOR_PALN },
{ -1, 0 }
};
ui_res_possible_values UserportJoyType[] = {
{ USERPORT_JOYSTICK_CGA, MENU_USERPORT_JOY_CGA },
{ USERPORT_JOYSTICK_PET, MENU_USERPORT_JOY_PET },
{ USERPORT_JOYSTICK_HUMMER, MENU_USERPORT_JOY_HUMMER },
{ USERPORT_JOYSTICK_OEM, MENU_USERPORT_JOY_OEM },
{ USERPORT_JOYSTICK_HIT, MENU_USERPORT_JOY_HIT },
{ USERPORT_JOYSTICK_KINGSOFT, MENU_USERPORT_JOY_KINGSOFT },
{ USERPORT_JOYSTICK_STARBYTE, MENU_USERPORT_JOY_STARBYTE },
{ -1, 0 }
};
ui_res_possible_values AutostartPrgMode[] = {
{ AUTOSTART_PRG_MODE_VFS, MENU_AUTOSTART_PRG_VIRTUAL_FS },
{ AUTOSTART_PRG_MODE_INJECT, MENU_AUTOSTART_PRG_INJECT },
{ AUTOSTART_PRG_MODE_DISK, MENU_AUTOSTART_PRG_DISK_IMAGE },
{ -1, 0 }
};
ui_res_possible_values Printer4Emulation[] = {
{ PRINTER_DEVICE_NONE, MENU_PRINTER_4_EMULATION_NONE },
{ PRINTER_DEVICE_FS, MENU_PRINTER_4_EMULATION_FS },
{ -1, 0 }
};
ui_res_possible_values Printer5Emulation[] = {
{ PRINTER_DEVICE_NONE, MENU_PRINTER_5_EMULATION_NONE },
{ PRINTER_DEVICE_FS, MENU_PRINTER_5_EMULATION_FS },
{ -1, 0 }
};
ui_res_possible_strings Printer4Driver[] = {
{ "ascii", MENU_PRINTER_4_DRIVER_ASCII },
{ "mps803", MENU_PRINTER_4_DRIVER_MPS803 },
{ "nl10", MENU_PRINTER_4_DRIVER_NL10 },
{ "raw", MENU_PRINTER_4_DRIVER_RAW },
{ NULL, 0 }
};
ui_res_possible_strings Printer5Driver[] = {
{ "ascii", MENU_PRINTER_5_DRIVER_ASCII },
{ "mps803", MENU_PRINTER_5_DRIVER_MPS803 },
{ "nl10", MENU_PRINTER_5_DRIVER_NL10 },
{ "raw", MENU_PRINTER_5_DRIVER_RAW },
{ NULL, 0 }
};
ui_res_possible_strings UserportPrinterDriver[] = {
{ "ascii", MENU_USERPORT_PRINTER_DRIVER_ASCII },
{ "mps803", MENU_USERPORT_PRINTER_DRIVER_MPS803 },
{ "nl10", MENU_USERPORT_PRINTER_DRIVER_NL10 },
{ "raw", MENU_USERPORT_PRINTER_DRIVER_RAW },
{ NULL, 0 }
};
ui_res_possible_strings Printer4OutputType[] = {
{ "text", MENU_PRINTER_4_TYPE_TEXT },
{ "graphics", MENU_PRINTER_4_TYPE_GFX },
{ NULL, 0 }
};
ui_res_possible_strings Printer5OutputType[] = {
{ "text", MENU_PRINTER_5_TYPE_TEXT },
{ "graphics", MENU_PRINTER_5_TYPE_GFX },
{ NULL, 0 }
};
ui_res_possible_strings UserportPrinterOutputType[] = {
{ "text", MENU_USERPORT_PRINTER_TYPE_TEXT },
{ "graphics", MENU_USERPORT_PRINTER_TYPE_GFX },
{ NULL, 0 }
};
ui_res_possible_values Printer4OutputDevice[] = {
{ 0, MENU_PRINTER_4_DEV_1 },
{ 1, MENU_PRINTER_4_DEV_2 },
{ 2, MENU_PRINTER_4_DEV_3 },
{ -1, 0 }
};
ui_res_possible_values Printer5OutputDevice[] = {
{ 0, MENU_PRINTER_5_DEV_1 },
{ 1, MENU_PRINTER_5_DEV_2 },
{ 2, MENU_PRINTER_5_DEV_3 },
{ -1, 0 }
};
ui_res_possible_values UserportPrinterOutputDevice[] = {
{ 0, MENU_USERPORT_PRINTER_DEV_1 },
{ 1, MENU_USERPORT_PRINTER_DEV_2 },
{ 2, MENU_USERPORT_PRINTER_DEV_3 },
{ -1, 0 }
};
ui_res_value_list value_list[] = {
{ "RefreshRate", RefreshRateValues },
{ "Speed", SpeedValues },
{ "MachineVideoStandard", SyncFactor },
{ "EventStartMode", RecordingOptions },
{ "ExtraJoyType", UserportJoyType },
{ "AutostartPrgMode", AutostartPrgMode },
{ "Printer4", Printer4Emulation },
{ "Printer5", Printer5Emulation },
{ "Printer4TextDevice", Printer4OutputDevice },
{ "Printer5TextDevice", Printer5OutputDevice },
{ "PrinterUserportTextDevice", UserportPrinterOutputDevice },
{ NULL, NULL }
};
ui_res_string_list string_list[] = {
{ "Printer4Driver", Printer4Driver },
{ "Printer4Driver", Printer5Driver },
{ "PrinterUserportDriver", UserportPrinterDriver },
{ "Printer4Output", Printer4OutputType },
{ "Printer5Output", Printer5OutputType },
{ "PrinterUserportOutput", UserportPrinterOutputType },
{ NULL, NULL }
};
ui_menu_toggle *machine_specific_toggles = NULL;
ui_res_value_list *machine_specific_values = NULL;
void ui_register_menu_toggles(ui_menu_toggle *toggles)
{
machine_specific_toggles = toggles;
}
void ui_register_res_values(ui_res_value_list *valuelist)
{
machine_specific_values = valuelist;
}
ui_machine_specific_t ui_machine_specific = NULL;
void ui_register_machine_specific(ui_machine_specific_t func)
{
ui_machine_specific = func;
}
/* ------------------------------------------------------------------------ */
/* UI-related resources. */
static int joystickdisplay;
static int save_resources_on_exit;
static int confirm_on_exit;
static int set_joystickdisplay(int val, void *param)
{
joystickdisplay = val;
ui_enable_joyport();
return 0;
}
static int set_save_resources_on_exit(int val, void *param)
{
save_resources_on_exit = val;
return 0;
}
static int set_confirm_on_exit(int val, void *param)
{
confirm_on_exit = val;
return 0;
}
static const resource_int_t resources_int[] = {
{ "JoystickDisplay", 0, RES_EVENT_NO, NULL,
&joystickdisplay, set_joystickdisplay, NULL },
{ "SaveResourcesOnExit", 0, RES_EVENT_NO, NULL,
&save_resources_on_exit, set_save_resources_on_exit, NULL },
{ "ConfirmOnExit", 1, RES_EVENT_NO, NULL,
&confirm_on_exit, set_confirm_on_exit, NULL },
{ NULL }
};
int ui_resources_init(void)
{
return resources_register_int(resources_int);
}
void ui_resources_shutdown(void)
{
}
/* ------------------------------------------------------------------------ */
/* UI-related command-line options. */
static const cmdline_option_t cmdline_options[] = {
{ NULL }
};
int ui_cmdline_options_init(void)
{
return 0;
}
/* Exit. */
void ui_exit(void)
{
}
static void ui_exit_early(void)
{
/* Disable SIGINT. This is done to prevent the user from keeping C-c
pressed and thus breaking the cleanup process, which might be
dangerous. */
signal(SIGINT, SIG_IGN);
log_message(LOG_DEFAULT, "\nExiting...");
machine_shutdown();
putchar ('\n');
}
/* ------------------------------------------------------------------------ */
typedef struct {
char name[256];
int valid;
} snapfiles;
static snapfiles files[10];
static int lastindex;
static int snapcounter;
static void save_quicksnapshot_trap(WORD unused_addr, void *unused_data)
{
int i, j;
char *fullname;
char *fullname2;
if (lastindex == -1) {
lastindex = 0;
strcpy(files[lastindex].name, "quicksnap0.vsf");
} else {
if (lastindex == 9) {
if (snapcounter == 10) {
fullname = util_concat(archdep_boot_path(), "/", machine_name, "/", files[0].name, NULL);
remove(fullname);
free(fullname);
for (i = 1; i < 10; i++) {
fullname = util_concat(archdep_boot_path(), "/", machine_name, "/", files[i].name, NULL);
fullname2 = util_concat(archdep_boot_path(), "/", machine_name, "/", files[i - 1].name, NULL);
rename(fullname, fullname2);
free(fullname);
free(fullname2);
}
} else {
for (i = 0; i < 10; i++) {
if (files[i].valid == 0) {
break;
}
}
for (j = i + 1; j < 10; j++) {
if (files[j].valid) {
strcpy(files[i].name,files[j].name);
files[i].name[strlen(files[i].name) - 5] = '0' + i;
fullname = util_concat(archdep_boot_path(), "/", machine_name, "/", files[j].name, NULL);
fullname2 = util_concat(archdep_boot_path(), "/", machine_name, "/", files[i].name, NULL);
rename(fullname, fullname2);
free(fullname);
free(fullname2);
i++;
}
}
strcpy(files[i].name, files[0].name);
files[i].name[strlen(files[i].name) - 5] = '0' + i;
lastindex = i;
}
} else {
strcpy(files[lastindex + 1].name, files[lastindex].name);
lastindex++;
files[lastindex].name[strlen(files[lastindex].name) - 5] = '0' + lastindex;
}
}
fullname = util_concat(archdep_boot_path(), "/", machine_name, "/", files[lastindex].name, NULL);
if (machine_write_snapshot(fullname, 0, 0, 0) < 0) {
ui_error("Can't write snapshot file %s.", fullname);
}
free(fullname);
}
static void load_quicksnapshot_trap(WORD unused_addr, void *unused_data)
{
char *fullname;
fullname = util_concat(archdep_boot_path(), "/", machine_name, "/", files[lastindex].name, NULL);
if (machine_read_snapshot(fullname, 0) < 0) {
ui_error("Cannot read snapshot image");
}
free(fullname);
}
static void scan_files(void)
{
int i;
char *filename;
char *fullname;
BEntry entry;
snapcounter = 0;
lastindex = -1;
for (i = 0; i < 10; i++) {
files[i].valid = 0;
filename = lib_stralloc("quicksnap?.vsf");
filename[strlen(filename) - 5] = '0' + i;
fullname = util_concat(archdep_boot_path(), "/", machine_name, "/", filename, NULL);
entry.SetTo(fullname);
if (entry.Exists()) {
strcpy(files[i].name, filename);
files[i].valid = 1;
if (i > lastindex) {
lastindex = i;
}
snapcounter++;
}
free(filename);
free(fullname);
}
}
/* ------------------------------------------------------------------------- */
static int is_paused = 0;
/* Toggle displaying of paused state. */
void ui_display_paused(int flag)
{
/* use ui_display_speed() and warp flag to encode pause mode */
if (flag) {
ui_display_speed(0, 0, -1);
} else {
ui_display_speed(0, 0, -2);
}
}
static void pause_trap(WORD addr, void *data)
{
ui_display_paused(1);
vsync_suspend_speed_eval();
while (is_paused) {
snooze(1000);
ui_dispatch_events();
}
}
void ui_pause_emulation(void)
{
is_paused = is_paused ? 0 : 1;
if (is_paused) {
interrupt_maincpu_trigger_trap(pause_trap, 0);
} else {
ui_display_paused(0);
}
}
int ui_emulation_is_paused(void)
{
return is_paused;
}
static void ui_copy_clipboard(void)
{
BMessage *clippy = (BMessage *)NULL;
char *text = NULL;
text = clipboard_read_screen_output("\n");
if (text != NULL) {
if (be_clipboard->Lock()) {
be_clipboard->Clear();
if (clippy = be_clipboard->Data()) {
clippy->AddData("text/plain", B_MIME_TYPE, text, strlen(text));
be_clipboard->Commit();
}
be_clipboard->Unlock();
}
lib_free(text);
}
}
static void ui_paste_clipboard_text(void)
{
const char *text;
char *text_in_petscii = NULL;
int32 textlen = 0;
BMessage *clippy = (BMessage *)NULL;
if (be_clipboard->Lock()) {
if (clippy = be_clipboard->Data()) {
clippy->FindData("text/plain", B_MIME_TYPE, (const void **)&text, &textlen);
if (textlen != 0) {
text_in_petscii = (char *)lib_malloc(textlen + 1);
memcpy(text_in_petscii, text, textlen);
text_in_petscii[textlen] = 0;
charset_petconvstring((unsigned char *)text_in_petscii, 0);
kbdbuf_feed(text_in_petscii);
lib_free(text_in_petscii);
}
}
be_clipboard->Unlock();
}
}
/* here the stuff for queueing and dispatching ui commands */
/*---------------------------------------------------------*/
#define MAX_MESSAGE_QUEUE_SIZE 256
static BMessage message_queue[MAX_MESSAGE_QUEUE_SIZE];
static int num_queued_messages;
void ui_add_event(void *msg)
{
if (num_queued_messages < MAX_MESSAGE_QUEUE_SIZE) {
message_queue[num_queued_messages++] = *(BMessage*)msg;
}
}
void ui_dispatch_events(void)
{
int i;
int m;
int attachdrive;
int key;
for (i = 0; i < num_queued_messages; i++) {
/* Handle machine specific commands first. */
if (ui_machine_specific) {
ui_machine_specific(&message_queue[i], windowlist[0]);
}
switch (message_queue[i].what) {
case B_KEY_DOWN:
case B_UNMAPPED_KEY_DOWN:
message_queue[i].FindInt32("key", (int32*)&key);
if (machine_class != VICE_MACHINE_VSID) {
kbd_handle_keydown(key);
}
break;
case B_KEY_UP:
case B_UNMAPPED_KEY_UP:
message_queue[i].FindInt32("key", (int32*)&key);
if (machine_class != VICE_MACHINE_VSID) {
kbd_handle_keyup(key);
}
break;
case B_SAVE_REQUESTED:
case B_REFS_RECEIVED:
/* the file- or save-panel was closed */
/* now we can use the selected file */
ui_select_file_action(&message_queue[i]);
break;
case MENU_EXIT_REQUESTED:
{
int32 button = 0;
BAlert *alert;
if (confirm_on_exit) {
alert = new BAlert("Quit BeVICE", "Do you really want to exit BeVICE??", "Yes", "No", NULL, B_WIDTH_AS_USUAL, B_INFO_ALERT);
vsync_suspend_speed_eval();
button = alert->Go();
}
if (button == 0) {
if (save_resources_on_exit) {
if (resources_save(NULL) < 0) {
ui_error("Cannot save settings.");
}
}
/* send message to quit the application */
/* and exit the emulation thread */
ui_exit_early();
BMessenger messenger(APP_SIGNATURE);
BMessage message(WINDOW_CLOSED);
messenger.SendMessage(&message, be_app);
exit_thread(0);
}
break;
}
case MENU_RESET_SOFT:
machine_trigger_reset(MACHINE_RESET_MODE_SOFT);
break;
case MENU_RESET_HARD:
machine_trigger_reset(MACHINE_RESET_MODE_HARD);
break;
case MENU_AUTOSTART_PRG_DISK_IMAGE_SELECT:
ui_select_file(B_OPEN_PANEL, AUTOSTART_DISK_IMAGE_FILE, (void*)0);
break;
case MENU_AUTOSTART:
ui_select_file(B_OPEN_PANEL, AUTOSTART_FILE, (void*)0);
break;
case MENU_ATTACH_DISK8:
attachdrive = 8;
ui_select_file(B_OPEN_PANEL, DISK_FILE, (void*)&attachdrive);
break;
case MENU_ATTACH_DISK9:
attachdrive = 9;
ui_select_file(B_OPEN_PANEL, DISK_FILE, (void*)&attachdrive);
break;
case MENU_ATTACH_DISK10:
attachdrive = 10;
ui_select_file(B_OPEN_PANEL, DISK_FILE, (void*)&attachdrive);
break;
case MENU_ATTACH_DISK11:
attachdrive = 11;
ui_select_file(B_OPEN_PANEL, DISK_FILE, (void*)&attachdrive);
break;
case MENU_DETACH_DISK8:
file_system_detach_disk(8);
break;
case MENU_DETACH_DISK9:
file_system_detach_disk(9);
break;
case MENU_DETACH_DISK10:
file_system_detach_disk(10);
break;
case MENU_DETACH_DISK11:
file_system_detach_disk(11);
break;
case MENU_ATTACH_TAPE:
attachdrive = 1;
ui_select_file(B_OPEN_PANEL, TAPE_FILE, (void*)1);
break;
case MENU_DETACH_TAPE:
tape_image_detach(1);
break;
case MENU_FLIP_ADD:
fliplist_add_image(8);
break;
case MENU_FLIP_REMOVE:
fliplist_remove(8, NULL);
break;
case MENU_FLIP_NEXT:
fliplist_attach_head(8, 1);
break;
case MENU_FLIP_PREVIOUS:
fliplist_attach_head(8, 0);
break;
case MENU_DATASETTE_START:
datasette_control(DATASETTE_CONTROL_START);
break;
case MENU_DATASETTE_STOP:
datasette_control(DATASETTE_CONTROL_STOP);
break;
case MENU_DATASETTE_FORWARD:
datasette_control(DATASETTE_CONTROL_FORWARD);
break;
case MENU_DATASETTE_REWIND:
datasette_control(DATASETTE_CONTROL_REWIND);
break;
case MENU_DATASETTE_RECORD:
datasette_control(DATASETTE_CONTROL_RECORD);
break;
case MENU_DATASETTE_RESET:
datasette_control(DATASETTE_CONTROL_RESET);
break;
case MENU_DATASETTE_COUNTER:
datasette_control(DATASETTE_CONTROL_RESET_COUNTER);
break;
case MENU_SNAPSHOT_LOAD:
ui_select_file(B_OPEN_PANEL, SNAPSHOTLOAD_FILE, (void*)0);
break;
case MENU_SNAPSHOT_SAVE:
ui_select_file(B_SAVE_PANEL, SNAPSHOTSAVE_FILE, (void*)0);
break;
case MENU_LOADQUICK:
scan_files();
if (snapcounter > 0) {
interrupt_maincpu_trigger_trap(load_quicksnapshot_trap, (void *)0);
}
break;
case MENU_SAVEQUICK:
scan_files();
interrupt_maincpu_trigger_trap(save_quicksnapshot_trap, (void *)0);
break;
case MENU_NETPLAY_SERVER:
network_start_server();
break;
case MENU_NETPLAY_CLIENT:
network_connect_client();
break;
case MENU_NETPLAY_DISCONNECT:
network_disconnect();
break;
case MENU_NETPLAY_SETTINGS:
ui_netplay();
break;
case MENU_EVENT_TOGGLE_RECORD:
if (event_record_active()) {
event_record_stop();
} else {
event_record_start();
}
break;
case MENU_EVENT_TOGGLE_PLAYBACK:
if (event_playback_active()) {
event_playback_stop();
} else {
event_playback_start();
}
break;
case MENU_EVENT_SETMILESTONE:
event_record_set_milestone();
break;
case MENU_EVENT_RESETMILESTONE:
event_record_reset_milestone();
break;
case MENU_EVENT_SNAPSHOT_START:
ui_select_file(B_SAVE_PANEL, SNAPSHOT_HISTORY_START, NULL);
break;
case MENU_EVENT_SNAPSHOT_END:
ui_select_file(B_SAVE_PANEL, SNAPSHOT_HISTORY_END, NULL);
break;
case MENU_MONITOR:
monitor_startup_trap();
break;
case MENU_PAUSE:
ui_pause_emulation();
break;
case MENU_COPY:
ui_copy_clipboard();
break;
case MENU_PASTE:
ui_paste_clipboard_text();
break;
case MENU_SOUND_RECORD_AIFF:
resources_set_string("SoundRecordDeviceName", "");
ui_select_file(B_SAVE_PANEL, AIFF_FILE, (void*)0);
break;
case MENU_SOUND_RECORD_IFF:
resources_set_string("SoundRecordDeviceName", "");
ui_select_file(B_SAVE_PANEL, IFF_FILE, (void*)0);
break;
#ifdef USE_LAMEMP3
case MENU_SOUND_RECORD_MP3:
resources_set_string("SoundRecordDeviceName", "");
ui_select_file(B_SAVE_PANEL, MP3_FILE, (void*)0);
break;
#endif
case MENU_SOUND_RECORD_VOC:
resources_set_string("SoundRecordDeviceName", "");
ui_select_file(B_SAVE_PANEL, VOC_FILE, (void*)0);
break;
case MENU_SOUND_RECORD_WAV:
resources_set_string("SoundRecordDeviceName", "");
ui_select_file(B_SAVE_PANEL, WAV_FILE, (void*)0);
break;
case MENU_SOUND_RECORD_STOP:
resources_set_string("SoundRecordDeviceName", "");
ui_display_statustext("Sound Recording Stopped...", 1);
break;
case MENU_DRIVE_SETTINGS:
ui_drive();
break;
case MENU_DEVICE_SETTINGS:
ui_device();
break;
case MENU_DATASETTE_SETTINGS:
ui_datasette();
break;
case MENU_JOYSTICK_SETTINGS:
ui_joystick();
break;
case MENU_EXTRA_JOYSTICK_SETTINGS:
ui_extra_joystick();
break;
case MENU_SOUND_SETTINGS:
ui_sound();
break;
case MENU_VIDEO_SETTINGS:
ui_video(0);
break;
case MENU_RAM_SETTINGS:
ui_ram();
break;
case MENU_SETTINGS_LOAD:
if (resources_load(NULL) < 0) {
ui_error("Cannot load settings.");
}
ui_update_menus();
break;
case MENU_SETTINGS_SAVE:
if (resources_save(NULL) < 0) {
ui_error("Cannot save settings.");
}
fliplist_save_list((unsigned int)-1, archdep_default_fliplist_file_name());
break;
case MENU_SETTINGS_DEFAULT:
resources_set_defaults();
ui_update_menus();
break;
case MENU_PRINTER_4_SEND_FF:
printer_formfeed(0);
break;
case MENU_PRINTER_5_SEND_FF:
printer_formfeed(1);
break;
case MENU_USERPORT_PRINTER_SEND_FF:
printer_formfeed(2);
break;
case MENU_OUTPUT_DEVICE_1:
ui_select_file(B_SAVE_PANEL, PRINTER_OUTPUT_FILE1, (void*)0);
break;
case MENU_OUTPUT_DEVICE_2:
ui_select_file(B_SAVE_PANEL, PRINTER_OUTPUT_FILE2, (void*)0);
break;
case MENU_OUTPUT_DEVICE_3:
ui_select_file(B_SAVE_PANEL, PRINTER_OUTPUT_FILE3, (void*)0);
break;
case MENU_ABOUT:
char *abouttext;
abouttext = util_concat("BeVICE Version ", VERSION, " (", PLATFORM_CPU, " ", PLATFORM_OS, " ", PLATFORM_COMPILER, ")\n",
"(c) 1998-2012 Dag Lem\n",
"(c) 1999-2012 Andreas Matthies\n",
"(c) 1999-2012 Martin Pottendorfer\n",
"(c) 2005-2012 Marco van den Heuvel\n",
"(c) 2006-2012 Christian Vogelgsang\n",
"(c) 2007-2012 Fabrizio Gennari\n",
"(c) 2007-2012 Daniel Kahlin\n",
"(c) 2008-2012 Antti S. Lankila\n",
"(c) 2009-2012 Groepaz\n",
"(c) 2009-2012 Ingo Korb\n",
"(c) 2009-2012 Errol Smith\n",
"(c) 2010-2012 Olaf Seibert\n",
"(c) 2011-2012 Marcus Sutton\n",
"(c) 2011-2012 Ulrich Schulz\n",
"(c) 2011-2012 Stefan Haubenthal\n",
"(c) 2011-2012 Thomas Giesel\n",
"(c) 2011-2012 Kajtar Zsolt\n",
"(c) 2012-2012 Benjamin 'BeRo' Rosseaux\n",
"\nOfficial VICE homepage:\n",
"http://vice-emu.sourceforge.net/",
NULL);
ui_message(abouttext);
free(abouttext);
break;
case MENU_CONTRIBUTORS:
ui_show_text("Contributors", "Who made what?", info_contrib_text);
break;
case MENU_LICENSE:
ui_show_text("License", "VICE license (GNU General Public License)", info_license_text);
break;
case MENU_WARRANTY:
ui_show_text("No warranty!", "VICE is distributed WITHOUT ANY WARRANTY!", info_warranty_text);
break;
case MENU_CMDLINE:
{
char *options;
options = cmdline_options_string();
ui_show_text("Command line options", "Which command line options are available?", options);
free(options);
break;
}
case MESSAGE_ATTACH_READONLY:
{
int res_val;
message_queue[i].FindInt32("device",(int32*)&attachdrive);
resources_get_int_sprintf("AttachDevice%dReadonly", &res_val, attachdrive);
resources_set_int_sprintf("AttachDevice%dReadonly", !res_val, attachdrive);
break;
}
case MESSAGE_SET_RESOURCE:
{
const char *res_name;
int32 res_val;
const char *res_val_str;
if (message_queue[i].FindString("resname", &res_name) == B_OK) {
if (message_queue[i].FindInt32("resval", &res_val) == B_OK) {
resources_set_int(res_name, res_val);
}
if (message_queue[i].FindString("resvalstr", &res_val_str) == B_OK) {
resources_set_string(res_name, res_val_str);
}
}
break;
}
default:
if (message_queue[i].what >= 'M000' && message_queue[i].what <= 'M999') {
/* Handle the TOGGLE-Menuitems */
for (m = 0; toggle_list[m].name != NULL; m++) {
if (toggle_list[m].item_id == message_queue[i].what) {
resources_toggle(toggle_list[m].name, NULL);
break;
}
}
if (machine_specific_toggles) {
for (m = 0; machine_specific_toggles[m].name != NULL; m++) {
if (machine_specific_toggles[m].item_id == message_queue[i].what) {
resources_toggle(machine_specific_toggles[m].name,NULL);
break;
}
}
}
/* Handle VALUE-Menuitems */
for (m = 0; value_list[m].name != NULL; m++) {
ui_res_possible_values *vl = value_list[m].vals;
for (; vl->item_id > 0; vl++) {
if (vl->item_id == message_queue[i].what) {
resources_set_value(value_list[m].name, (resource_value_t) vl->value);
break;
}
}
}
/* Handle STRING-Menuitems */
for (m = 0; string_list[m].name != NULL; m++) {
ui_res_possible_strings *vl = string_list[m].strings;
for (; vl->item_id > 0; vl++) {
if (vl->item_id == message_queue[i].what) {
resources_set_string(string_list[m].name, vl->string);
break;
}
}
}
if (machine_specific_values) {
for (m = 0; machine_specific_values[m].name != NULL; m++) {
ui_res_possible_values *vl = machine_specific_values[m].vals;
for (; vl->item_id > 0; vl++) {
if (vl->item_id == message_queue[i].what) {
resources_set_value(machine_specific_values[m].name, (resource_value_t) vl->value);
break;
}
}
}
}
ui_update_menus();
}
break;
}
}
num_queued_messages = 0;
}
void ui_dispatch_next_event(void)
{
}
/* -----------------------------------------------------------*/
/* Initialize the UI before setting all the resource values. */
int ui_init(int *argc, char **argv)
{
num_queued_messages = 0;
return 0;
}
void ui_shutdown(void)
{
}
/* Initialize the UI after setting all the resource values. */
int ui_init_finish(void)
{
atexit(ui_exit);
return 0;
}
int ui_init_finalize(void)
{
return 0;
}
/* ------------------------------------------------------------------------- */
/* this displays text in a seperate window with scroller */
class TextWindow : public BWindow {
public:
TextWindow(const char *, const char*, const char*);
~TextWindow();
private:
BTextView *textview;
BScrollView *scrollview;
};
TextWindow::TextWindow(
const char *caption,
const char *header,
const char *text) : BWindow(BRect(0,0,400,300), caption, B_DOCUMENT_WINDOW, B_NOT_ZOOMABLE|B_NOT_RESIZABLE) {
textview = new BTextView(BRect(0, 0, 400 - B_V_SCROLL_BAR_WIDTH, 300), "VICE textview", BRect(10, 10, 390 - B_V_SCROLL_BAR_WIDTH, 290), B_FOLLOW_NONE, B_WILL_DRAW);
textview->MakeEditable(false);
textview->MakeSelectable(false);
textview->SetViewColor(230, 240, 230, 0);
scrollview = new BScrollView("vice scroller", textview, B_FOLLOW_NONE, 0, false, true);
textview->SetText(text);
textview->Insert("\n\n");
textview->Insert(0, header, strlen(header));
AddChild(scrollview);
MoveTo(50, 50);
Show();
}
TextWindow::~TextWindow() {
RemoveChild(scrollview);
delete textview;
delete scrollview;
}
void ui_show_text(const char *caption, const char *header, const char *text)
{
new TextWindow(caption, header, text);
}
/* Report an error to the user (`printf()' style). */
void ui_error(const char *format, ...)
{
char tmp[1024];
va_list args;
va_start(args, format);
vsprintf(tmp, format, args);
va_end(args);
ui_error_string(tmp);
}
/* Report an error to the user (one string). */
void ui_error_string(const char *text)
{
BAlert *messagebox;
messagebox = new BAlert("error", text, "OK", NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
vsync_suspend_speed_eval();
messagebox->Go();
}
/* Report a message to the user (`printf()' style). */
void ui_message(const char *format,...)
{
BAlert *messagebox;
char tmp[1024];
va_list args;
va_start(args, format);
vsprintf(tmp, format, args);
va_end(args);
messagebox = new BAlert("info", tmp, "OK", NULL, NULL, B_WIDTH_AS_USUAL, B_INFO_ALERT);
vsync_suspend_speed_eval();
messagebox->Go();
}
/* Handle the "CPU JAM" case. */
ui_jam_action_t ui_jam_dialog(const char *format,...)
{
ui_error("Jam %s - Resetting the machine...", format);
return UI_JAM_HARD_RESET;
}
/* Handle the "Do you want to extend the disk image to 40-track format"?
dialog. */
int ui_extend_image_dialog(void)
{
int ret;
BAlert *mb;
mb = new BAlert("VICE question", "Extend image to 40-track format?", "Yes", "No", NULL, B_WIDTH_AS_USUAL, B_IDEA_ALERT);
ret = mb->Go();
return ret == 0;
}
void ui_update_menus(void)
{
int i;
for (i = 0; i < window_count; i++) {
windowlist[i]->Update_Menu_Toggles(toggle_list);
windowlist[i]->Update_Menu_Toggles(machine_specific_toggles);
windowlist[i]->Update_Menu_Value_Lists(value_list);
windowlist[i]->Update_Menu_Value_Lists(machine_specific_values);
windowlist[i]->Update_Menu_String_Lists(string_list);
}
}
static int statustext_display_time = 0;
void ui_display_statustext(const char *text, int fade_out)
{
int i;
for (i = 0; i < window_count; i++) {
if (windowlist[i]->Lock()) {
if (windowlist[i]->statusbar) {
windowlist[i]->statusbar->DisplayMessage(text);
}
windowlist[i]->Unlock();
}
}
if (fade_out > 0) {
statustext_display_time = 5;
} else {
statustext_display_time = 0;
}
}
/* ------------------------------------------------------------------------- */
/* Dispay the current emulation speed. */
void ui_display_speed(float percent, float framerate, int warp_flag)
{
int i;
for (i = 0; i < window_count; i++) {
if (windowlist[i]->Lock()) {
if (windowlist[i]->statusbar) {
windowlist[i]->statusbar->DisplaySpeed(percent, framerate, warp_flag);
}
windowlist[i]->Unlock();
}
}
if (statustext_display_time > 0) {
statustext_display_time--;
if (statustext_display_time == 0) {
ui_display_statustext("", 0);
}
}
}
static ui_drive_enable_t ui_drive_enabled;
static int ui_status_led[DRIVE_NUM];
static double ui_status_track[DRIVE_NUM];
static int *ui_drive_active_led;
static char *ui_drive_image_name[DRIVE_NUM];
static char *ui_tape_image_name;
static void ui_display_drive_status(int drive_num)
{
int i;
int drive_num_active;
int drive_led_index;
for (i = 0; i < window_count; i++) {
while (!windowlist[i]->Lock());
if (windowlist[i]->statusbar) {
int this_drive = 1 << drive_num;
if (ui_drive_enabled & this_drive) {
drive_num_active = drive_num;
} else {
drive_num_active = -1 - drive_num; /* this codes erasing the statusbar */
}
if (!ui_status_led[drive_num]) {
drive_led_index = -1;
} else {
drive_led_index = ui_drive_active_led[drive_num];
}
windowlist[i]->statusbar->DisplayDriveStatus(drive_num_active, drive_led_index, ui_status_track[drive_num]);
}
windowlist[i]->Unlock();
}
}
void ui_enable_drive_status(ui_drive_enable_t enable, int *drive_led_color)
{
ui_drive_enabled = enable;
ui_drive_active_led = drive_led_color;
ui_display_drive_status(0);
ui_display_drive_status(1);
ui_display_drive_status(2);
ui_display_drive_status(3);
}
/* Toggle displaying of the drive track. */
/* drive_base is either 8 or 0 depending on unit or drive display.
Dual drives display drive 0: and 1: instead of unit 8: and 9: */
void ui_display_drive_track(unsigned int drive_number, unsigned int drive_base, unsigned int half_track_number)
{
double track_number = (double)half_track_number / 2.0;
ui_status_track[drive_number] = track_number;
ui_display_drive_status(drive_number);
}
/* Toggle displaying of the drive LED. */
void ui_display_drive_led(int drivenum, unsigned int led_pwm1, unsigned int led_pwm2)
{
int status = 0;
if (led_pwm1 > 100) {
status |= 1;
}
if (led_pwm2 > 100) {
status |= 2;
}
ui_status_led[drivenum] = status;
ui_display_drive_status(drivenum);
}
static void ui_display_image(int drivenum)
{
int i;
char *image;
if (drivenum < 0) {
image = ui_tape_image_name;
} else {
image = ui_drive_image_name[drivenum];
}
for (i = 0; i < window_count; i++) {
while (!windowlist[i]->Lock());
if (windowlist[i]->statusbar) {
windowlist[i]->statusbar->DisplayImage(drivenum, image);
}
windowlist[i]->Unlock();
}
}
/* display current image */
void ui_display_drive_current_image(unsigned int drivenum, const char *image)
{
char *directory_name;
if (drivenum >= 4) {
return;
}
if (ui_drive_image_name[drivenum]) {
free(ui_drive_image_name[drivenum]);
}
util_fname_split(image, &directory_name, &ui_drive_image_name[drivenum]);
free(directory_name);
ui_display_image(drivenum);
}
void ui_display_tape_current_image(const char *image)
{
char *directory_name;
if (ui_tape_image_name) {
free(ui_tape_image_name);
}
util_fname_split(image, &directory_name, &ui_tape_image_name);
free(directory_name);
ui_display_image(-1);
}
static int ui_tape_enabled = 0;
static int ui_tape_counter = -1;
static int ui_tape_motor = -1;
static int ui_tape_control = -1;
static void ui_draw_tape_status()
{
int i;
for (i = 0; i < window_count; i++) {
while (!windowlist[i]->Lock());
if (windowlist[i]->statusbar) {
windowlist[i]->statusbar->DisplayTapeStatus(ui_tape_enabled, ui_tape_counter, ui_tape_motor, ui_tape_control);
}
windowlist[i]->Unlock();
}
}
/* tape-status on*/
void ui_set_tape_status(int tape_status)
{
if (ui_tape_enabled != tape_status) {
ui_tape_enabled = tape_status;
ui_draw_tape_status();
}
}
void ui_display_tape_motor_status(int motor)
{
if (ui_tape_motor != motor) {
ui_tape_motor = motor;
ui_draw_tape_status();
}
}
void ui_display_tape_control_status(int control)
{
if (ui_tape_control != control) {
ui_tape_control = control;
ui_draw_tape_status();
}
}
void ui_display_tape_counter(int counter)
{
if (ui_tape_counter != counter) {
ui_tape_counter = counter;
ui_draw_tape_status();
}
}
void ui_display_recording(int recording_status)
{
if (recording_status) {
ui_display_statustext("Recoring history...", 1);
} else {
ui_display_statustext("", 0);
}
}
void ui_display_playback(int playback_status, char *version)
{
if (playback_status) {
ui_display_statustext("History playback...", 1);
} else {
ui_display_statustext("", 0);
}
}
void ui_display_event_time(unsigned int current, unsigned int total)
{
char text[256];
if (statustext_display_time > 0) {
return;
}
if (total == 0) {
sprintf(text, "Recording %02d:%02d", current / 60, current % 60);
} else {
sprintf(text, "Playback %02d:%02d (%02d:%02d)", current / 60, current % 60, total / 60, total % 60);
}
ui_display_statustext(text, 0);
}
static BYTE ui_joystick_status[3] = { 255, 255, 255 };
static void ui_display_joyport(int port_num)
{
int i;
if (!joystickdisplay) {
return;
}
for (i = 0; i < window_count; i++) {
while (!windowlist[i]->Lock());
if (windowlist[i]->statusbar) {
windowlist[i]->statusbar->DisplayJoyport(port_num, ui_joystick_status[port_num]);
}
windowlist[i]->Unlock();
}
}
void ui_enable_joyport(void)
{
int i;
for (i = 0; i < window_count; i++) {
while (!windowlist[i]->Lock());
if (windowlist[i]->statusbar) {
windowlist[i]->statusbar->EnableJoyport(joystickdisplay);
windowlist[i]->Unlock();
}
}
ui_joystick_status[1]=ui_joystick_status[2]=0;
ui_display_joyport(1);
ui_display_joyport(2);
}
void ui_display_joyport(BYTE *joyport)
{
int i;
for (i = 1; i <= 2; i++) {
if (ui_joystick_status[i] != joyport[i]) {
ui_joystick_status[i] = joyport[i];
ui_display_joyport(i);
}
}
}
void ui_statusbar_update()
{
ui_display_drive_status(0);
ui_display_image(0);
ui_display_drive_status(1);
ui_display_image(1);
ui_display_image(-1);
ui_draw_tape_status();
ui_enable_joyport();
}
int ui_set_window_mode(int use_direct_window)
{
int i;
ViceWindow *w;
struct video_canvas_s *c;
for (i = 0; i < window_count; i++) {
w = windowlist[i];
if (w != NULL) {
w->Lock();
/* only use DirectWindow if Window Mode is supported */
if (!w->SupportsWindowMode() || CheckForHaiku()) {
use_direct_window = 0;
}
w->use_direct_window = use_direct_window;
if (use_direct_window) {
w->view->SetViewColor(B_TRANSPARENT_32_BIT);
} else {
w->view->SetViewColor(255, 255, 255);
}
w->Unlock();
c = (struct video_canvas_s*) (w->canvas);
if (c != NULL) {
video_canvas_refresh_all(c);
}
}
}
return use_direct_window;
}
void ui_display_volume(int vol)
{
}
char* ui_get_file(const char *format,...)
{
return NULL;
}
|
ed513a5f939c8a20b3261b68d2d4c6f6da923d8b | 95d8806bbd272396bb44166a543ac8d33ef85ac8 | /plugins/tray/tray.cpp | e0b0a9fdc0a06c4f4149b714fb412a7ef34688bb | [] | no_license | tmud/tortilla | 522e351e091865b835c1382c5513e4143ef74a97 | cdea0f3409e9053763aad79fa01c719bce4dc579 | refs/heads/master | 2022-05-01T14:50:15.337163 | 2022-04-16T20:09:27 | 2022-04-16T20:09:27 | 23,519,550 | 29 | 9 | null | 2019-03-27T15:51:42 | 2014-08-31T17:56:22 | C++ | UTF-8 | C++ | false | false | 7,273 | cpp | tray.cpp | #include "stdafx.h"
#include "traymain.h"
#include "traySettings.h"
TrayMainObject g_tray;
int get_name(lua_State *L)
{
luaT_pushwstring(L, L"Плагин оповещения в трее");
return 1;
}
int get_description(lua_State *L)
{
luaT_Props p(L);
std::wstring prefix;
p.cmdPrefix(&prefix);
std::wstring text(L"Плагин добавляет в клиент команду ");
text.append(prefix);
text.append(L"tray. Данная команда выводит текстовое сообщение\r\n"
L"(параметры команды) в правый нижний угол рабочего стола в виде всплывающей подсказки.\r\n"
L"Если были получены новые сообщения, а клиент работал в фоновом режиме, то иконка\r\n"
L"клиента в панели задач будет переодически мигать. См. настройки в меню клиента.");
luaT_pushwstring(L, text.c_str());
return 1;
}
int get_version(lua_State *L)
{
luaT_pushwstring(L, L"1.20");
return 1;
}
void check_minmax(int *val, int min, int setmin, int max, int setmax)
{
if (*val < min) *val = setmin;
else if (*val > max) *val = setmax;
}
bool check_color(int color, unsigned char *c)
{
if (color < 0 || color > 255) return false;
*c = (unsigned char)color;
return true;
}
void parse_color(const std::wstring& text, COLORREF *color)
{
int r = 0; int g = 0; int b = 0;
swscanf(text.c_str(), L"%d,%d,%d", &r, &g, &b);
unsigned char rb = 0; unsigned char gb = 0; unsigned char bb = 0;
if (check_color(r, &rb) && check_color(g, &gb) && check_color(b, &bb))
{
*color = RGB(rb, gb, bb);
}
}
int init(lua_State *L)
{
if (!g_tray.create())
{
base::log(L, L"Критическая ошибка.");
base::terminate(L);
return 0;
}
base::addCommand(L, L"tray");
base::addMenu(L, L"Плагины/Оповещения (tray)...", 1);
luaT_Props p(L);
g_tray.setFont(p.currentFont());
g_tray.setAlarmWnd(base::getParent(L));
g_tray.setActivated(p.activated());
std::wstring path;
base::getPath(L, L"config.xml", &path);
TraySettings &s = g_tray.traySettings();
s.timeout = 5;
s.interval = 15;
s.showactive = 1;
s.text = GetSysColor(COLOR_INFOTEXT);
s.background = GetSysColor(COLOR_INFOBK);
std::wstring error;
xml::node ld;
if (ld.load(path.c_str(), &error) && ld.move(L"params"))
{
if (ld.get(L"timeout", &s.timeout))
check_minmax(&s.timeout, 1, 5, MAX_TIMEOUT, MAX_TIMEOUT);
if (ld.get(L"interval", &s.interval))
check_minmax(&s.interval, 5, 5, MAX_INTERVAL, MAX_INTERVAL);
int showactive = 1;
if (ld.get(L"showactive", &showactive))
check_minmax(&showactive, 0, 0, 1, 0);
s.showactive = showactive ? true : false;
std::wstring text, bkgnd;
if (ld.get(L"textcolor", &text))
parse_color(text, &s.text);
if (ld.get(L"bkgndcolor", &bkgnd))
parse_color(bkgnd, &s.background);
ld.move(L"/");
} else {
if (!error.empty())
base::log(L, error.c_str());
}
ld.deletenode();
return 0;
}
int release(lua_State *L)
{
TraySettings &s = g_tray.traySettings();
xml::node sv(L"tray");
sv.create(L"params");
sv.set(L"timeout", s.timeout);
sv.set(L"interval", s.interval);
sv.set(L"showactive", s.showactive ? 1 : 0);
wchar_t buffer[16];
swprintf(buffer, L"%d,%d,%d", GetRValue(s.text), GetGValue(s.text), GetBValue(s.text));
sv.set(L"textcolor", buffer);
swprintf(buffer, L"%d,%d,%d", GetRValue(s.background), GetGValue(s.background), GetBValue(s.background));
sv.set(L"bkgndcolor", buffer);
sv.move(L"/");
std::wstring path;
base::getPath(L, L"config.xml", &path);
if (!sv.save(path.c_str()))
{
sv.deletenode();
std::wstring error(L"Ошибка записи файла с настройками плагина : ");
error.append(path);
return luaT_error(L, error.c_str());
}
sv.deletenode();
if (g_tray.IsWindow())
g_tray.DestroyWindow();
return 0;
}
int menucmd(lua_State *L)
{
TraySettingsDlg dlg;
dlg.settings = g_tray.traySettings();
if (dlg.DoModal() == IDOK)
g_tray.traySettings() = dlg.settings;
return 0;
}
int syscmd(lua_State *L)
{
if (luaT_check(L, 1, LUA_TTABLE))
{
lua_pushinteger(L, 1);
lua_gettable(L, -2);
std::wstring cmd(luaT_towstring(L, -1));
lua_pop(L, 1);
if (cmd == L"tray")
{
int n = luaL_len(L, -1);
std::deque<std::wstring> text;
for (int i=2; i<=n; ++i)
{
lua_pushinteger(L, i);
lua_gettable(L, -2);
if (lua_isstring(L, -1))
{
std::wstring tmp(luaT_towstring(L, -1));
text.push_back(tmp);
}
lua_pop(L, 1);
}
lua_pop(L, 1);
if (!text.empty())
{
Msg m;
COLORREF text_color = 0; COLORREF bgnd_color = 0;
if (base::translateColors(L, text[0].c_str(), &text_color, &bgnd_color))
{
m.textcolor = text_color;
m.bkgndcolor = bgnd_color;
text.pop_front();
}
else
{
m.textcolor = g_tray.traySettings().text;
m.bkgndcolor = g_tray.traySettings().background;
}
for (int i=0,e=text.size();i<e;++i) {
if (i != 0) m.text.append(L" ");
m.text.append(text[i]);
}
g_tray.addMessage(m);
}
lua_pushnil(L);
return 1;
}
}
return 1;
}
int activated(lua_State *L)
{
g_tray.setActivated(true);
return 0;
}
int deactivated(lua_State *L)
{
g_tray.setActivated(false);
return 0;
}
static const luaL_Reg tray_methods[] =
{
{ "name", get_name },
{ "description", get_description },
{ "version", get_version },
{ "init", init },
{ "release", release },
{ "menucmd", menucmd },
{ "syscmd", syscmd },
{ "activated", activated },
{ "deactivated", deactivated },
{ NULL, NULL }
};
int WINAPI plugin_open(lua_State *L)
{
luaL_newlib(L, tray_methods);
return 1;
}
CAppModule _Module;
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
_Module.Init(NULL, hModule);
break;
case DLL_PROCESS_DETACH:
_Module.Term();
break;
}
return TRUE;
}
|
c579f22f3ed59e07ffd5961a05e4c481fe00c61e | ec2cfba77d188d129371e671cabbcd76e0761c73 | /matog/util/Random.h | 992ff1e8429900ea9cb7cde03f62c602ce5db22e | [
"BSD-3-Clause"
] | permissive | mergian/matog | 1c12a033e175ac17912d4e74b317cd769c21c39e | d03de27b92a0772ceac1c556293217ff91d405eb | refs/heads/master | 2020-04-01T04:00:18.346850 | 2018-10-13T07:55:56 | 2018-10-13T07:55:56 | 152,845,545 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 964 | h | Random.h | // Copyright (c) 2015 Nicolas Weber / GCC / TU-Darmstadt. All rights reserved.
// Use of this source code is governed by the BSD 3-Clause license that can be
// found in the LICENSE file.
#pragma once
#ifndef __MATOG_UTIL_RANDOM_H
#define __MATOG_UTIL_RANDOM_H
#include <cstdint>
#include "dll.h"
namespace matog {
namespace util {
//-------------------------------------------------------------------
/// Helper class for random numbers
class MATOG_UTIL_DLL Random {
public:
/// creates U32 random number between min and max
static uint32_t u32 (const uint32_t min, const uint32_t max);
/// creates S32 random number between min and max
static int32_t s32 (const int32_t min, const int32_t max);
/// creates float random number between min and max
static float f32 (const float min, const float max);
/// creates binary random decision
static bool bin (void);
};
//-------------------------------------------------------------------
}
}
#endif |
714d04b4edce0fd48fd6b6dac37482318a0cf72e | e84a130c1d74f6d094987d3b28ea9b6ccb1c2d83 | /Sodaq_Universal_Tracker/Sodaq_LSM303.h | 1d72c00bd1264763d1e451ccba90e7a102fc8df6 | [
"BSD-3-Clause"
] | permissive | SodaqMoja/Sodaq_Universal_Tracker | fc7d4195850614c3eab1aa761b516a87038f3ded | 769e1344b256842e8294d53e84bab52b13120bfe | refs/heads/master | 2022-10-20T04:38:21.646450 | 2021-08-11T13:08:13 | 2021-08-11T13:08:13 | 162,763,062 | 9 | 13 | null | 2023-09-11T10:56:24 | 2018-12-21T22:28:34 | C++ | UTF-8 | C++ | false | false | 3,688 | h | Sodaq_LSM303.h | /*
Copyright (c) 2018, SODAQ
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef SODAQ_LSM303_H_
#define SODAQ_LSM303_H_
#include <stdint.h>
#include <Wire.h>
#include "Sodaq_LSM303AGR.h"
#include "Sodaq_LSM303C.h"
#define Sodaq_LSM303C_ACCEL_ADDRESS 0b0011101
#define SODAQ_LSM303C_MAG_ADDRESS 0b0011110
#define Sodaq_LSM303AGR_ACCEL_ADDRESS 0b0011001
#define SODAQ_LSM303AGR_MAG_ADDRESS 0b0011110
#define WHOAMI_ID_A_LSM303C 0b01000001
#define WHOAMI_ID_M_LSM303C 0b00111101
class Sodaq_LSM303 {
public:
enum AxesEvents
{
ZHigh = 0b00100000,
ZLow = 0b00010000,
YHigh = 0b00001000,
YLow = 0b00000100,
XHigh = 0b00000010,
XLow = 0b00000001
};
enum InterruptMode
{
OrCombination = 0b00000000,
MovementRecognition = 0b01000000,
AndCombination = 0b10000000,
PositionRecognition = 0b11000000
};
enum LSM303Variant
{
LSM303_Undefined,
LSM303AGR,
LSM303C
};
Sodaq_LSM303AGR lsm303agr;
Sodaq_LSM303C lsm303c;
void Init(Stream& stream);
// Sets the optional "Diagnostics and Debug" stream.
Sodaq_LSM303(TwoWire& wire = Wire);
void setDiag(Stream& stream) { _diagStream = &stream; }
void setDiag(Stream* stream) { _diagStream = stream; }
int8_t getTemperature();
void enableAccelerometer();
void disableAccelerometer();
void rebootAccelerometer();
void enableMagnetometer();
void disableMagnetometer();
void rebootMagnetometer();
void enableInterrupt1(uint8_t axesEvents, double threshold, uint8_t duration, InterruptMode interruptMode);
void disableInterrupt1();
void enableInterrupt2(uint8_t axesEvents, double threshold, uint8_t duration, InterruptMode interruptMode);
void disableInterrupt2();
void enableMagnetometerInterrupt(uint8_t axesEvents, double threshold, bool highOnInterrupt = true);
void disableMagnetometerInterrupt();
double getX();
double getY();
double getZ();
double getMagX();
double getMagY();
double getMagZ();
protected:
TwoWire &_wire;
LSM303Variant _lsm303Variant = LSM303_Undefined;
// The (optional) stream to show debug information.
Stream* _diagStream;
};
#endif
|
9682dde52e4e6f70d8784f3564efbaaeb7b39e41 | 2e8809d24934bc114b8ee494c35bcd95c67daada | /loriFucker/lorifuck/piecegluer/AreaShiftCalculator.h | 87a3afaaab0239336febf568ed9854e3716c54b1 | [] | no_license | Artmozaec/LoriFucker | 89b6fa32fc778e707274c3be6a69915520ec1079 | cc301bd147e9794137bbef6ab8411ab4f27e6ed6 | refs/heads/master | 2022-09-30T18:52:20.222704 | 2020-06-06T14:54:04 | 2020-06-06T14:54:04 | 269,995,640 | 0 | 0 | null | null | null | null | WINDOWS-1251 | C++ | false | false | 1,159 | h | AreaShiftCalculator.h | #ifndef AreaShiftCalculatorH
#define AreaShiftCalculatorH
#include "Area.h"
#include "BitmapIterator.h"
#include "..\mytypes\BitmapContainer.h"
class AreaShiftCalculator{
public:
static AreaShiftCalculator* getInstance();
void shiftCalculate(Area *upArea, Area *downArea);
//Инициализация итераторов сторон
void setUpAreaBitmap(BitmapContainer *upBitmap);
void setDownAreaBitmap(BitmapContainer *downBitmap);
private:
AreaShiftCalculator();
static AreaShiftCalculator* instance;
//Находит дистанцию ниболее точного совмещения верхней области и нижней
int getDistance(Area *upArea, Area *downArea);
//Возвращает среднюю разность, совпадающих пикселей из upArea и downArea
// смещение 1 - совпадение последнего пикселя нижней стороны и первого пикселя верхней
int getAverageDifference(Area *upArea, Area *downArea, int shift);
BitmapIterator *upSideIterator;
BitmapIterator *downSideIterator;
};
#endif |
75d2bc93d9a7351ab8fae9f4914a22fa6cea7989 | c7114fd0d134c6a2a26ea6824f9df74ff87c7a22 | /WizapplyGameLibrary/GameLibrary/Base/CTime.cpp | f1130eba8d91c0857c1386aa4e874e03985f9498 | [] | no_license | ttoApps/wizapply_library_by_cpp_study | 1a420d858c40a45c739c09560091eead681a1ac7 | 33e557429411f19b81700069820b0a5838989837 | refs/heads/master | 2021-03-12T19:55:07.866819 | 2013-02-22T09:45:26 | 2013-02-22T09:45:26 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 931 | cpp | CTime.cpp | //
// CTime.cpp
// WizapplyGameSDK
//
// Created by on 13/01/31.
// Copyright (c) 2013 __MyCompanyName__. All rights reserved.
//
#include "CTime.h"
CTime::CTime()
{
m_counterStartTime = 0;
m_counterTime = 0;
}
CTime::~CTime()
{
}
unsigned int CTime::GetCurrentTime()
{
return wzGetTime();
}
void CTime::Sleep(unsigned long time)
{
wzSleep(time);
}
void CTime::StartCounter()
{
m_counterStartTime = GetCurrentTime();
}
void CTime::StopCounter()
{
m_counterTime += GetCurrentTime() - m_counterStartTime;
}
void CTime::ResetCounter()
{
m_counterTime = 0;
}
unsigned int CTime::GetCounterTime()
{
return m_counterTime + (GetCurrentTime() - m_counterStartTime);
}
float CTime::GetCounterRatio(float targetCounter)
{
if (0.0f == targetCounter) {
return 0.0f;
}
float counterTime = ((float)GetCounterTime()) / 1000.0f;
return counterTime / targetCounter;
} |
7f2c0c45109e72120fb7f45e7dd7c759da2a55cf | 2124ebc6478fb88fc1c67ab334afc7c949571a05 | /Process.h | 0acb51f0e7ba8a3805492b0958311707679c6b2a | [] | no_license | shubhamjha97/des_scheduler | 4b5e173d8a9e8269ec7e0d1fa4d38fd6dda16841 | 34f46785897cf96679c4b43937b0a39b6b57c8f5 | refs/heads/master | 2023-08-29T16:34:17.925091 | 2021-10-30T01:58:30 | 2021-10-30T01:58:30 | 419,971,237 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 550 | h | Process.h | #ifndef SCHEDULER_PROCESS_H
#define SCHEDULER_PROCESS_H
class Process {
public:
int arrivalTime, totalCpuTime, cpuBurst, ioBurst;
int cpuTimeRemaining, previousRemainingCpuBurst;
int pid;
int staticPriority, dynamicPriority;
int cpuWaitTime, finishTimestamp, ioTime;
int lastStateTimestamp;
int orderIdx; // Used to keep the priority queues stable
Process(int pid, int arrivalTime, int totalCpuTime, int cpuBurst, int ioBurst, int staticPriority, int dynamicPriority, int orderIdx);
};
#endif //SCHEDULER_PROCESS_H
|
fecb29c5bb33b6f979f087b85c10c5e810f69053 | d3b45ab23e049b552bbb57984af97f443f5b19fa | /PointXY.cpp | 50cfee97ccc96375c3f7d271154f4e6d0070da44 | [] | no_license | VB6Hobbyst7/PenRobotArduino | 2cd98cf25362b9a396a7dac6c620eaf580e13ce2 | e840f9ffd5fdbcba7af1c4d3036b48fde6510ea8 | refs/heads/master | 2023-03-27T05:13:33.693713 | 2019-07-12T04:15:21 | 2019-07-12T04:15:21 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,721 | cpp | PointXY.cpp | #include <Arduino.h>
#include "PointXY.h"
//#define DEBUG //デバッグモード
PointXY::PointXY(float x, float y)
{
this->x = x;
this->y = y;
}
/*PointXY* PointXY::clone()
{
return new PointXY(x, y);
}*/
String PointXY::toString()
{
String s = "(";
s += String(x);
s += ",";
s += String(y);
s += ")";
return s;
}
void PointXY::set(float nx, float ny)
{
x = nx;
y = ny;
}
/*void PointXY::set(PointXY *p)
{
x = p->x;
y = p->y;
}*/
void PointXY::add(float dx, float dy)
{
x += dx;
y += dy;
}
void PointXY::mul(float sx, float sy)
{
x *= sx;
y *= sy;
}
void PointXY::mul(float scale)
{
x *= scale;
y *= scale;
}
float PointXY::length() const
{
return (float)sqrt( x * x + y * y);
}
void PointXY::normalize()
{
float l = length();
#ifdef DEBUG
if (l < 0.000001) {
Serial.println("PointXY::Normalize() Divide by zero");
x = y = 0.0F;
return;
}
#endif
x /= l;
y /= l;
}
/**
* 原点中心の回転
*/
/*PointXY* PointXY::rotate(float deg, bool clockwise)
{
float rad = deg / 180.0F * (float)PI;
if (!clockwise) rad = -rad;
float sin_t = (float)sin(rad);
float cos_t = (float)cos(rad);
return new PointXY(
x * cos_t - y * sin_t,
x * sin_t + y * cos_t
);
}*/
void PointXY::rotate(float deg, bool clockwise)
{
float rad = deg / 180.0F * (float)PI;
if (!clockwise) rad = -rad;
float sin_t = (float)sin(rad);
float cos_t = (float)cos(rad);
float xx = x * cos_t - y * sin_t;
float yy = x * sin_t + y * cos_t;
x = xx;
y = yy;
}
/**
* 指定座標中心の回転
*/
/*PointXY* PointXY::rotate(float center_x, float center_y, float deg, bool clockwise)
{
float rad = deg / 180.0F * (float)PI;
if (!clockwise) rad = -rad;
float sin_t = (float)sin(rad);
float cos_t = (float)cos(rad);
return new PointXY(
(x - center_x) * cos_t - (y - center_y) * sin_t + center_x,
(x - center_x) * sin_t + (y - center_y) * cos_t + center_y
);
}*/
void PointXY::rotate(float center_x, float center_y, float deg, bool clockwise)
{
float rad = deg / 180.0F * (float)PI;
if (!clockwise) rad = -rad;
float sin_t = (float)sin(rad);
float cos_t = (float)cos(rad);
float xx = (x - center_x) * cos_t - (y - center_y) * sin_t + center_x;
float yy = (x - center_x) * sin_t + (y - center_y) * cos_t + center_y;
x = xx;
y = yy;
}
/**
* 内積。クラスのベクトルとベクトルbのなす角が90で0、90を超えると負の数を返します
*/
float PointXY::innerProduct(const PointXY* b)
{
return x * b->x + y * b->y;
}
/**
* 外積。ベクトルbがこのクラスのベクトルの時計回り側にあると返り値はプラスになります
*/
float PointXY::outerProduct(const PointXY* b)
{
return x * b->y - y * b->x;
}
/**
* 0.0 <= angle <= 180.0の値を返します
*/
/*float PointXY::angle(const PointXY* b)
{
float rad = (float)acos(innerProduct(b) / (length() * b->length()));
return rad * 180.0F / (float)PI;
}*/
float PointXY::angle(float ax, float ay, float bx, float by)
{
float rad = (float)acos((ax * bx + ay * by) / ((float)sqrt( ax * ax + ay * ay) * (float)sqrt( bx * bx + by * by)));
return rad * 180.0F / (float)PI;
}
/**
* -180.0 < angle <= 180.0の値を返します
* ベクトルbが反時計周りにあるとき、値は負の数を返します
*/
/*float PointXY::signedAngle(const PointXY* b)
{
float rad = (float)acos(innerProduct(b) / (length() * b->length()));
if (outerProduct(b) < 0.0F) rad = -rad;
return rad * 180.0F / (float)PI;
}*/
float PointXY::signedAngle(float ax, float ay, float bx, float by)
{
float rad = (float)acos((ax * bx + ay * by) / ((float)sqrt( ax * ax + ay * ay) * (float)sqrt( bx * bx + by * by)));
if ((ax * by - ay * bx) < 0.0F) rad = -rad;
return rad * 180.0F / (float)PI;
}
/**
* 円と円の交点を計算する
* 成功した場合はtrueを返し、p1,p2に結果をセットする
*/
bool PointXY::circleCrossPoints(float ax, float ay, float ar, float bx, float by, float br, PointXY *p1, PointXY *p2)
{
//b座標を原点として計算
float xx = ax - bx;
float yy = ay - by;
float w = xx * xx + yy * yy;
if (w < 0.00001F) {
#ifdef DEBUG
Serial.println("PointXY::circleCrossPoints() - devide by zero");
#endif
return false;
}
float a = (w + br * br - ar * ar) / 2.0F;
float v = w * br * br - a * a;
if (v < 0.0F) {
#ifdef DEBUG
Serial.println("PointXY::circleCrossPoints() - sqrt error");
#endif
return false;
}
v = (float)sqrt(v);
p1->x = (a * xx + yy * v) / w + bx;
p1->y = (a * yy - xx * v) / w + by;
p2->x = (a * xx - yy * v) / w + bx;
p2->y = (a * yy + xx * v) / w + by;
return true;
}
|
b4e0cd50739c7c83be9699309d7f1fa37b27f67b | 73c8a3179b944b63b2a798542896e4cdf0937b6e | /Codeforces/LuckyDivisionA.cpp | d3da1058685e48257a0a267301503ef653737b85 | [
"Apache-2.0"
] | permissive | aajjbb/contest-files | c151f1ab9b562ca91d2f8f4070cb0aac126a188d | 71de602a798b598b0365c570dd5db539fecf5b8c | refs/heads/master | 2023-07-23T19:34:12.565296 | 2023-07-16T00:57:55 | 2023-07-16T00:57:59 | 52,963,297 | 2 | 4 | null | 2017-08-03T20:12:19 | 2016-03-02T13:05:25 | C++ | UTF-8 | C++ | false | false | 629 | cpp | LuckyDivisionA.cpp | #include <iostream>
#include <cstdlib>
#include <cstdio>
using namespace std;
bool isLucky(int n) {
while(n > 0) {
if(n % 10 != 4 && n % 10 != 7) {
return false;
}
n = n / 10;
}
return true;
}
int main() {
int n;
bool valid = false;
scanf("%d", &n);
for(int i = 4; i <= n; i++) {
if(isLucky(i) == true) {
if(n % i == 0) {
valid = true;
break;
}
}
}
if(valid) {
printf("YES");
} else {
printf("NO");
}
return 0;
}
|
39550167b5570d7bfa3cd36da3a6e83140bd1a60 | f0d2bcc08c074464963843302d1e92e2bf03d3b1 | /chapter15/todes.cpp | c07a3237ed9f484de036803e09a7c380e3d169e1 | [] | no_license | zzzzhuque/TCP-IP | 4164649dbc5f1ac0d3d66d2a11c57af7c8c97707 | 26be7e5aa0c460ed19199e91c9772425a0e929f1 | refs/heads/master | 2023-03-12T03:11:00.898403 | 2021-02-25T09:04:04 | 2021-02-25T09:04:04 | 342,182,121 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 431 | cpp | todes.cpp | //
// Created by zhuque on 2021/2/18.
//
#include <cstdio>
#include <fcntl.h>
int main() {
FILE *fp;
int fd = open("data.dat", O_WRONLY|O_CREAT|O_TRUNC);
if (fd == -1) {
fputs("file open error", stdout);
return -1;
}
printf("First file descriptor: %d\n", fd);
fp = fdopen(fd, "w");
fputs("TCP/IP SOCKET PROGRAMMING\n", fp);
printf("Second file descriptor: %d \n", fileno(fp));
fclose(fp);
return 0;
}
|
7baf9b085fa87a038cbeaa723431f0bce159353a | 8f50c262f89d3dc4f15f2f67eb76e686b8f808f5 | /DetectorDescription/GeoModel/GeoModelUtilities/src/GeoGetIds.cxx | 53b24f305966cd3f5572f74aa91c68464bf4c9c9 | [
"Apache-2.0"
] | permissive | strigazi/athena | 2d099e6aab4a94ab8b636ae681736da4e13ac5c9 | 354f92551294f7be678aebcd7b9d67d2c4448176 | refs/heads/master | 2022-12-09T02:05:30.632208 | 2020-09-03T14:03:18 | 2020-09-03T14:03:18 | 292,587,480 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 950 | cxx | GeoGetIds.cxx | /*
* Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration.
*/
/**
* @file GeoModelUtilities/src/GeoGetIds.cxx
* @author scott snyder <snyder@bnl.gov>
* @date Jun, 2019
* @brief Visitor to collect all IDs under a GeoModel node.
*/
#include "GeoModelUtilities/GeoGetIds.h"
GeoGetIds::GeoGetIds (IGeoGetIdsAction& action,
int depthLimit /*= 1*/)
: m_action (action)
{
setDepthLimit (depthLimit);
}
void GeoGetIds::handleSerialTransformer (const GeoSerialTransformer *sT)
{
if (m_serialIdentifier) {
int idbase = m_serialIdentifier->getBaseId();
for (unsigned int i=0; i < sT->getNCopies(); i++) {
m_action (idbase + i);
}
}
}
void GeoGetIds::handleIdentifierTag (const GeoIdentifierTag *idTag)
{
m_serialIdentifier = nullptr;
m_action (idTag->getIdentifier());
}
void GeoGetIds::handleSerialIdentifier(const GeoSerialIdentifier *sI)
{
m_serialIdentifier = sI;
}
|
fcc7d07e0777c119aa3b363085fa122ba8de9c6a | e7e6e28a89de0e8ffe69b5a6ca335c48748979bd | /FCS/Vo/VoLaser.cpp | 5b4eebc746e3e4d40fb09d0a8780edcabb32217a | [] | no_license | qimo601/FCS | 614b8c5b5cb15a481372238c2bcb7bc1b79c526a | 6e6f2e03f23b9409d46978ee378c3572b38c4f8e | refs/heads/master | 2021-01-25T10:28:57.541607 | 2015-02-12T18:43:56 | 2015-02-12T18:43:56 | 20,087,478 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 772 | cpp | VoLaser.cpp | #include "VoLaser.h"
VoLaser::VoLaser(QObject *parent)
: VoCmd(parent)
{
}
VoLaser::~VoLaser()
{
}
VoLaser& VoLaser::operator = (const VoLaser& vo)
{
m_cmd = vo.getCmd();
m_length = vo.getLength();
m_passage = vo.getPassage();
m_strength = vo.getStrength();
return *this;
}
QDataStream& operator>>(QDataStream& in, VoLaser& vo)
{
//命令
int mCmd;
//参数长度
int mLength;
//通道参数
int mPassage;
//强度参数
int mStrength;
in >> mCmd >> mLength >> mPassage >> mStrength;
vo.setCmd(mCmd);
vo.setLength(mLength);
vo.setPassage(mPassage);
vo.setStrength(mStrength);
return in;
}
QDataStream& operator<<(QDataStream& out, const VoLaser& vo)
{
out << vo.getCmd() << vo.getLength() << vo.getPassage() << vo.getStrength();
return out;
}
|
19ba5dfd21e53c29d265f45d8f05c854e04537a6 | e38804d7a1ece64e30bbfccf714cfe30a6c708a7 | /3rd semester/mois/lab1/3 variant/collections.cpp | e8b00bb4feb96d92c6425d930f9968481fedb489 | [] | no_license | bobrik/bsuir | 8e0914677ec7264696ba85559a72a13cadcaa6d5 | 716f65c86a2f726db4725e8e2ae5bde315655fcb | refs/heads/master | 2021-01-18T21:15:52.920975 | 2010-05-30T14:13:09 | 2010-05-30T14:13:09 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 11,072 | cpp | collections.cpp | /*
Calculates symmetric difference of any sets.
Input from file "collections.in".
Copyright 2009 Ivan Babroŭ (email : ibobrik@gmail.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the license, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <stack>
#include <algorithm>
using namespace std;
// Brace types
enum brace_type {ORIENTED_OPEN = '<', ORIENTED_CLOSE = '>', REGULAR_OPEN = '{', REGULAR_CLOSE = '}'};
// Collection type: oriented or regular
enum collection_type {ORIENTED, REGULAR};
// Element type: single or collection
enum element_type {SINGLE, COLLECTION};
class Collection;
class Element;
class Operations;
class Element
{
private:
// element type
element_type _type;
public:
// single element value
string value;
// collection element value
Collection * collection;
Element(element_type);
~Element();
const element_type type() const;
void setValue(string &);
void setValue(Collection *);
string toString() const;
bool operator<(const Element &) const;
};
class Collection
{
private:
// vector for collection elements
vector<Element> elements;
// collection type
collection_type _type;
Element * _getElementPtr(string &, unsigned int &, unsigned int);
bool _checkBalance(string &);
public:
bool isSorted;
bool isCorrect;
Collection(collection_type);
Collection(string &);
~Collection();
const collection_type type() const;
void pushElement(Element *);
void show(int);
int size();
void sort();
string toString();
bool hasElement(string &);
friend class Operations;
};
class Operations
{
public:
Collection * symDifference(Collection *, Collection *);
};
Collection::Collection(collection_type t)
{
// Collection constructor
// t - collection type
_type = t;
isSorted = true;
}
Collection::Collection(string & line)
{
// Collection constructor
// line - collection line, type determined automatically
_type = REGULAR;
isSorted = true;
isCorrect = true;
if (!_checkBalance(line))
{
cerr << "Incorrect line (check braces balance): " << line << endl;
isCorrect = false;
} else
{
unsigned int start = 1;
while (start < line.length()-1)
{
Element * el = _getElementPtr(line, start, line.length()-1);
if (el != NULL)
pushElement(el);
else
break;
}
if (line != toString())
{
cerr << "What the hell did you enered, dude?" << endl;
cerr << " Got: " << line << endl;
cerr << " But parsed as: " << toString() << endl;
isCorrect = false;
}
}
}
Collection::~Collection()
{
// TODO: fix memleaks
// vector<Element>::iterator i;
// for (i = elements.begin(); i < elements.end(); ++i)
// elements.erase(i);
}
const collection_type Collection::type() const
{
// returns collection type
return _type;
}
bool Collection::_checkBalance(string & line)
{
stack<char> braces;
for (unsigned int i = 1; i < line.length()-1; ++i)
{
if (line[i] == REGULAR_OPEN)
{
braces.push(REGULAR_OPEN);
} else if (line[i] == REGULAR_CLOSE)
{
if (braces.empty() || (!braces.empty() && braces.top() != REGULAR_OPEN))
return false;
else
braces.pop();
} else if (line[i] == ORIENTED_OPEN)
{
braces.push(ORIENTED_OPEN);
} else if (line[i] == ORIENTED_CLOSE)
{
if (braces.empty() || (!braces.empty() && braces.top() != ORIENTED_OPEN))
return false;
else
braces.pop();
}
}
return braces.empty();
}
Element * Collection::_getElementPtr(string & line, unsigned int & start, unsigned int end)
{
// Gets element pointer
// start & end - line positons to get next element
Collection * collection;
if (line[start] == REGULAR_OPEN)
{
collection = new Collection(REGULAR);
} else if (line[start] == ORIENTED_OPEN)
{
collection = new Collection(ORIENTED);
}
Element * element = NULL;
if ((line[start] >= '0' && line[start] <= '9') || (line[start] >= 'A' && line[start] <= 'z'))
{
string child;
while (line[start] != ',' && start < end)
{
child = child+line[start];
++start;
}
++start; // finish element to comma after it
element = new Element(SINGLE);
element->setValue(child);
} else if (line[start] == ORIENTED_OPEN)
{
unsigned int i = start;
int braces = 0;
while (line[i] != ORIENTED_CLOSE || braces != 1)
{
if (line[i] == ORIENTED_OPEN)
++braces;
else if (line[i] == ORIENTED_CLOSE)
--braces;
++i;
}
element = new Element(COLLECTION);
Collection * collection;
collection = new Collection(ORIENTED);
++start;
while (start < i)
collection->pushElement(_getElementPtr(line, start, i));
element->setValue(collection);
start = i+2; // finish element to comma after it
} else if (line[start] == REGULAR_OPEN)
{
unsigned int i = start;
int braces = 0;
while (line[i] != REGULAR_CLOSE || braces != 1)
{
if (line[i] == REGULAR_OPEN)
++braces;
else if (line[i] == REGULAR_CLOSE)
--braces;
++i;
}
element = new Element(COLLECTION);
Collection * collection;
collection = new Collection(REGULAR);
++start;
while (start < i)
collection->pushElement(_getElementPtr(line, start, i));
element->setValue(collection);
start = i+2; // finish element to comma after it
} else
{
start = end; // go away with your stupid input
}
return element;
}
void Collection::pushElement(Element * element)
{
// Adds new element to collection
// element - pointer to new element
elements.push_back(*element);
isSorted = false;
}
void Collection::show(int deep = 0)
{
// Prints collection with deep level
// deep - deep of subcollection
vector<Element>::const_iterator i;
for (i = elements.begin(); i != elements.end(); ++i)
{
for (int d = 0; d <= deep; ++d)
cout << " ";
if (i->type() == SINGLE)
{
cout << "Single: " << i->value << endl;
} else
{
cout << "Collection (" <<
(i->collection->type() == REGULAR ? "regular" : "oriented") <<
", " << (i->collection->isSorted ? "sorted" : "unsorted") <<
"): " << endl;
i->collection->show(deep+1);
}
}
}
int Collection::size()
{
// Returns collection size
return elements.size();
}
void Collection::sort()
{
// Sorts collection lexicographically
if (isSorted)
return;
if (type() == REGULAR)
{
std::sort(elements.begin(), elements.end());
} else
{
// sort recursively if oriented collection
vector<Element>::iterator i;
for (i = elements.begin(); i < elements.end(); ++i)
if (i->type() == COLLECTION)
i->collection->sort();
}
isSorted = true;
}
string Collection::toString()
{
// Returns collection representation as string
string collection = "";
vector<Element>::iterator i;
for (i = elements.begin(); i != elements.end(); ++i)
{
collection += i->toString();
if (i+1 != elements.end())
collection += ',';
}
if (type() == REGULAR)
collection = (char) REGULAR_OPEN + collection + (char) REGULAR_CLOSE;
else
collection = (char) ORIENTED_OPEN + collection + (char) ORIENTED_CLOSE;
return collection;
}
bool Collection::hasElement(string & element)
{
// Checks element presence in collection
// element - string representation to search for
vector<Element>::iterator i;
for (i = elements.begin(); i < elements.end(); ++i)
if (i->toString() == element)
return true;
return false;
}
Element::Element(element_type t)
{
// Element constructor
// t - element type
_type = t;
value = "";
collection = NULL;
}
Element::~Element()
{
// if (_type == COLLECTION)
// delete collection;;
}
void Element::setValue(string & val)
{
// Sets element value for single element
// val - string value
value = val;
}
void Element::setValue(Collection * col)
{
// Sets element value for collection
// col - pointer to target collection
collection = new Collection(col->type());
*collection = *col;
}
const element_type Element::type() const
{
// returns element type
return _type;
}
string Element::toString() const
{
// Returns element representation as string
if (type() == SINGLE)
return value;
else
return collection->toString();
}
bool Element::operator<(const Element & el) const
{
// Operator to check is element less than another
// el - link to rvalue
if (type() == COLLECTION)
collection->sort();
if (el.type() == COLLECTION)
el.collection->sort();
if (type() == SINGLE && el.type() == SINGLE)
return value < el.value;
else if (type() == COLLECTION && el.type() == COLLECTION)
return toString() < el.toString();
else if (type() == SINGLE && el.type() == COLLECTION)
return true;
else
return false;
}
Collection * Operations::symDifference(Collection * left, Collection * right)
{
// Calculates symmetric difference of collections
// left & right - pointers to two collections
// in A but not in B plus not in A but in B
// may be realized as two operations like A/B plus B/A
// but who freakin' cares?
left->sort();
right->sort();
vector<string> elements;
vector<string>::iterator j;
string result;
vector<Element>::iterator i;
string t = ""; // temp for toString resolving
for(i = left->elements.begin(); i < left->elements.end(); ++i)
{
t = i->toString();
if (!right->hasElement(t))
elements.push_back(t);
}
bool already = false;
for(i = right->elements.begin(); i < right->elements.end(); ++i)
{
t = i->toString();
if (!left->hasElement(t))
{
for (j = elements.begin(); j < elements.end(); ++j)
if (*j == t)
{
already = true;
break;
}
if (!already)
elements.push_back(t);
}
}
result = (char) REGULAR_OPEN;
for (j = elements.begin(); j < elements.end(); ++j)
result += *j + ',';
if (result.length() != 1) // if not {}
result = result.substr(0, result.length()-1);
result += REGULAR_CLOSE;
Collection * collection = new Collection(result);
return collection;
}
int main()
{
ifstream in("collections.in");
string collectionExpression;
Operations * psycho = new Operations;
Collection * result = new Collection(REGULAR);
while (getline(in, collectionExpression))
{
unsigned int pos = collectionExpression.find("=");
if (pos != string::npos)
{
collectionExpression = collectionExpression.substr(pos+1);
Collection * collection = new Collection(collectionExpression);
if (!collection->isCorrect)
{
cout << "Incorrect input, so terminating" << endl;
return 0;
}
result = psycho->symDifference(result, collection);
delete collection;
}
}
cout << "Result: " << result->toString() << endl;
return 0;
}
|
58192795d4767d2f43b093d71a77d5579e59764a | b9575b7d4299110e663a7432381ce7534c234b40 | /4_ExtLib/4.4_GuiFrameworks/4.4.2_HaxeUI/4.4.2.1_SimpleGui/4.4.2.1.1_HaxeuiBackends/4.4.2.1.1.2_haxeui-hxwidgets/4.4.2.1.1.2.3_Dialogs/SimpleMessageDialog/Export/cpp/debug/src/wx/widgets/styles/DirDialogStyle.cpp | 670ae00425452dd043db3a2f4a49c4cb53b68fa4 | [] | no_license | R3D9477/haxe-basics | dc912670731ac891f359c73db68f1a683af03f6a | cd12a1cb250447afa877fc30cf671f00e62717ef | refs/heads/master | 2021-09-02T12:22:55.398965 | 2018-01-02T15:29:40 | 2018-01-02T15:29:40 | 72,667,406 | 4 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,621 | cpp | DirDialogStyle.cpp | // GeneratedByHaxe
#include <hxcpp.h>
#ifndef INCLUDED_wx_widgets_styles_DirDialogStyle
#include <wx/widgets/styles/DirDialogStyle.h>
#endif
HX_LOCAL_STACK_FRAME(_hx_pos_ef5a6c2f275b7b90_10_boot,"wx.widgets.styles.DirDialogStyle","boot",0xc3bfd884,"wx.widgets.styles.DirDialogStyle.boot","wx/widgets/styles/DirDialogStyle.hx",10,0xfed764c3)
HX_LOCAL_STACK_FRAME(_hx_pos_ef5a6c2f275b7b90_14_boot,"wx.widgets.styles.DirDialogStyle","boot",0xc3bfd884,"wx.widgets.styles.DirDialogStyle.boot","wx/widgets/styles/DirDialogStyle.hx",14,0xfed764c3)
HX_LOCAL_STACK_FRAME(_hx_pos_ef5a6c2f275b7b90_16_boot,"wx.widgets.styles.DirDialogStyle","boot",0xc3bfd884,"wx.widgets.styles.DirDialogStyle.boot","wx/widgets/styles/DirDialogStyle.hx",16,0xfed764c3)
namespace wx{
namespace widgets{
namespace styles{
void DirDialogStyle_obj::__construct() { }
Dynamic DirDialogStyle_obj::__CreateEmpty() { return new DirDialogStyle_obj; }
void *DirDialogStyle_obj::_hx_vtable = 0;
Dynamic DirDialogStyle_obj::__Create(hx::DynamicArray inArgs)
{
hx::ObjectPtr< DirDialogStyle_obj > _hx_result = new DirDialogStyle_obj();
_hx_result->__construct();
return _hx_result;
}
bool DirDialogStyle_obj::_hx_isInstanceOf(int inClassId) {
return inClassId==(int)0x00000001 || inClassId==(int)0x09de4624;
}
int DirDialogStyle_obj::DEFAULT_STYLE;
int DirDialogStyle_obj::DIR_MUST_EXIST;
int DirDialogStyle_obj::CHANGE_DIR;
DirDialogStyle_obj::DirDialogStyle_obj()
{
}
bool DirDialogStyle_obj::__GetStatic(const ::String &inName, Dynamic &outValue, hx::PropertyAccess inCallProp)
{
switch(inName.length) {
case 10:
if (HX_FIELD_EQ(inName,"CHANGE_DIR") ) { outValue = ( CHANGE_DIR ); return true; }
break;
case 13:
if (HX_FIELD_EQ(inName,"DEFAULT_STYLE") ) { outValue = ( DEFAULT_STYLE ); return true; }
break;
case 14:
if (HX_FIELD_EQ(inName,"DIR_MUST_EXIST") ) { outValue = ( DIR_MUST_EXIST ); return true; }
}
return false;
}
bool DirDialogStyle_obj::__SetStatic(const ::String &inName,Dynamic &ioValue,hx::PropertyAccess inCallProp)
{
switch(inName.length) {
case 10:
if (HX_FIELD_EQ(inName,"CHANGE_DIR") ) { CHANGE_DIR=ioValue.Cast< int >(); return true; }
break;
case 13:
if (HX_FIELD_EQ(inName,"DEFAULT_STYLE") ) { DEFAULT_STYLE=ioValue.Cast< int >(); return true; }
break;
case 14:
if (HX_FIELD_EQ(inName,"DIR_MUST_EXIST") ) { DIR_MUST_EXIST=ioValue.Cast< int >(); return true; }
}
return false;
}
#if HXCPP_SCRIPTABLE
static hx::StorageInfo *DirDialogStyle_obj_sMemberStorageInfo = 0;
static hx::StaticInfo DirDialogStyle_obj_sStaticStorageInfo[] = {
{hx::fsInt,(void *) &DirDialogStyle_obj::DEFAULT_STYLE,HX_HCSTRING("DEFAULT_STYLE","\xb3","\x7f","\x93","\xf7")},
{hx::fsInt,(void *) &DirDialogStyle_obj::DIR_MUST_EXIST,HX_HCSTRING("DIR_MUST_EXIST","\xb3","\x7d","\xac","\x7d")},
{hx::fsInt,(void *) &DirDialogStyle_obj::CHANGE_DIR,HX_HCSTRING("CHANGE_DIR","\x9e","\xd3","\xb7","\x35")},
{ hx::fsUnknown, 0, null()}
};
#endif
static void DirDialogStyle_obj_sMarkStatics(HX_MARK_PARAMS) {
HX_MARK_MEMBER_NAME(DirDialogStyle_obj::__mClass,"__mClass");
HX_MARK_MEMBER_NAME(DirDialogStyle_obj::DEFAULT_STYLE,"DEFAULT_STYLE");
HX_MARK_MEMBER_NAME(DirDialogStyle_obj::DIR_MUST_EXIST,"DIR_MUST_EXIST");
HX_MARK_MEMBER_NAME(DirDialogStyle_obj::CHANGE_DIR,"CHANGE_DIR");
};
#ifdef HXCPP_VISIT_ALLOCS
static void DirDialogStyle_obj_sVisitStatics(HX_VISIT_PARAMS) {
HX_VISIT_MEMBER_NAME(DirDialogStyle_obj::__mClass,"__mClass");
HX_VISIT_MEMBER_NAME(DirDialogStyle_obj::DEFAULT_STYLE,"DEFAULT_STYLE");
HX_VISIT_MEMBER_NAME(DirDialogStyle_obj::DIR_MUST_EXIST,"DIR_MUST_EXIST");
HX_VISIT_MEMBER_NAME(DirDialogStyle_obj::CHANGE_DIR,"CHANGE_DIR");
};
#endif
hx::Class DirDialogStyle_obj::__mClass;
static ::String DirDialogStyle_obj_sStaticFields[] = {
HX_HCSTRING("DEFAULT_STYLE","\xb3","\x7f","\x93","\xf7"),
HX_HCSTRING("DIR_MUST_EXIST","\xb3","\x7d","\xac","\x7d"),
HX_HCSTRING("CHANGE_DIR","\x9e","\xd3","\xb7","\x35"),
::String(null())
};
void DirDialogStyle_obj::__register()
{
hx::Object *dummy = new DirDialogStyle_obj;
DirDialogStyle_obj::_hx_vtable = *(void **)dummy;
hx::Static(__mClass) = new hx::Class_obj();
__mClass->mName = HX_HCSTRING("wx.widgets.styles.DirDialogStyle","\x5c","\x6d","\x74","\x04");
__mClass->mSuper = &super::__SGetClass();
__mClass->mConstructEmpty = &__CreateEmpty;
__mClass->mConstructArgs = &__Create;
__mClass->mGetStaticField = &DirDialogStyle_obj::__GetStatic;
__mClass->mSetStaticField = &DirDialogStyle_obj::__SetStatic;
__mClass->mMarkFunc = DirDialogStyle_obj_sMarkStatics;
__mClass->mStatics = hx::Class_obj::dupFunctions(DirDialogStyle_obj_sStaticFields);
__mClass->mMembers = hx::Class_obj::dupFunctions(0 /* sMemberFields */);
__mClass->mCanCast = hx::TCanCast< DirDialogStyle_obj >;
#ifdef HXCPP_VISIT_ALLOCS
__mClass->mVisitFunc = DirDialogStyle_obj_sVisitStatics;
#endif
#ifdef HXCPP_SCRIPTABLE
__mClass->mMemberStorageInfo = DirDialogStyle_obj_sMemberStorageInfo;
#endif
#ifdef HXCPP_SCRIPTABLE
__mClass->mStaticStorageInfo = DirDialogStyle_obj_sStaticStorageInfo;
#endif
hx::_hx_RegisterClass(__mClass->mName, __mClass);
}
void DirDialogStyle_obj::__boot()
{
{
HX_STACKFRAME(&_hx_pos_ef5a6c2f275b7b90_10_boot)
HXDLIN( 10) DEFAULT_STYLE = wxDD_DEFAULT_STYLE;
}
{
HX_STACKFRAME(&_hx_pos_ef5a6c2f275b7b90_14_boot)
HXDLIN( 14) DIR_MUST_EXIST = wxDD_DIR_MUST_EXIST;
}
{
HX_STACKFRAME(&_hx_pos_ef5a6c2f275b7b90_16_boot)
HXDLIN( 16) CHANGE_DIR = wxDD_CHANGE_DIR;
}
}
} // end namespace wx
} // end namespace widgets
} // end namespace styles
|
479ba4ebe62a50411231b83ede3953ffc00fde97 | b1e9874c9665ba3ab271dde111e4a8b2591537eb | /include/vimba.ddl.h | 5ccff6c8544e06ec662a6ac7da359d30a9589ad4 | [] | no_license | lcls-psana/psddl_pds2psana | 528640e07b8004e0fbce89a101da48f5c25389d8 | 314c012c6115da22dd7be54662d2a0db5576c7cb | refs/heads/master | 2021-12-13T18:09:51.277458 | 2021-12-07T10:31:10 | 2021-12-07T10:31:10 | 82,350,112 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,009 | h | vimba.ddl.h | #ifndef PSDDL_PDS2PSANA_VIMBA_DDL_H
#define PSDDL_PDS2PSANA_VIMBA_DDL_H 1
// *** Do not edit this file, it is auto-generated ***
#include <vector>
#include <boost/shared_ptr.hpp>
#include "psddl_psana/vimba.ddl.h"
#include "pdsdata/psddl/vimba.ddl.h"
namespace psddl_pds2psana {
namespace Vimba {
class AlviumConfigV1 : public Psana::Vimba::AlviumConfigV1 {
public:
typedef Pds::Vimba::AlviumConfigV1 XtcType;
typedef Psana::Vimba::AlviumConfigV1 PsanaType;
AlviumConfigV1(const boost::shared_ptr<const XtcType>& xtcPtr);
virtual ~AlviumConfigV1();
virtual Psana::Vimba::AlviumConfigV1::VmbBool reverseX() const;
virtual Psana::Vimba::AlviumConfigV1::VmbBool reverseY() const;
virtual Psana::Vimba::AlviumConfigV1::VmbBool contrastEnable() const;
virtual Psana::Vimba::AlviumConfigV1::VmbBool correctionEnable() const;
virtual Psana::Vimba::AlviumConfigV1::RoiMode roiEnable() const;
virtual Psana::Vimba::AlviumConfigV1::ImgCorrectionType correctionType() const;
virtual Psana::Vimba::AlviumConfigV1::ImgCorrectionSet correctionSet() const;
virtual Psana::Vimba::AlviumConfigV1::PixelMode pixelMode() const;
virtual Psana::Vimba::AlviumConfigV1::TriggerMode triggerMode() const;
virtual uint32_t width() const;
virtual uint32_t height() const;
virtual uint32_t offsetX() const;
virtual uint32_t offsetY() const;
virtual uint32_t sensorWidth() const;
virtual uint32_t sensorHeight() const;
virtual uint32_t contrastDarkLimit() const;
virtual uint32_t contrastBrightLimit() const;
virtual uint32_t contrastShape() const;
virtual double exposureTime() const;
virtual double blackLevel() const;
virtual double gain() const;
virtual double gamma() const;
virtual const char* manufacturer() const;
virtual const char* family() const;
virtual const char* model() const;
virtual const char* manufacturerId() const;
virtual const char* version() const;
virtual const char* serialNumber() const;
virtual const char* firmwareId() const;
virtual const char* firmwareVersion() const;
virtual uint32_t depth() const;
virtual uint32_t frameSize() const;
virtual uint32_t numPixelsX() const;
virtual uint32_t numPixelsY() const;
virtual uint32_t numPixels() const;
const XtcType& _xtcObj() const { return *m_xtcObj; }
private:
boost::shared_ptr<const XtcType> m_xtcObj;
};
template <typename Config>
class FrameV1 : public Psana::Vimba::FrameV1 {
public:
typedef Pds::Vimba::FrameV1 XtcType;
typedef Psana::Vimba::FrameV1 PsanaType;
FrameV1(const boost::shared_ptr<const XtcType>& xtcPtr, const boost::shared_ptr<const Config>& cfgPtr);
virtual ~FrameV1();
virtual uint64_t frameid() const;
virtual uint64_t timestamp() const;
virtual ndarray<const uint16_t, 2> data() const;
const XtcType& _xtcObj() const { return *m_xtcObj; }
private:
boost::shared_ptr<const XtcType> m_xtcObj;
boost::shared_ptr<const Config> m_cfgPtr;
};
} // namespace Vimba
} // namespace psddl_pds2psana
#endif // PSDDL_PDS2PSANA_VIMBA_DDL_H
|
c58b93bde5858a6f0930105b4e6f737631a1beae | 5f02d1b5ce3b8d04a1eb98915645bac9631dab3b | /OpenFrameworks/SubtitlesSyphonApp/src/Visuals/TextManager.cpp | e71e4584e01412d6e1bf8e4cfdaccf5b6c091cb0 | [] | no_license | ImanolGo/SubtitlesSyphon | 6492da5e80f5e435e450182fde102614d079d351 | b16be92d19fe1c66a9afd6897fd7adc0e6581f7e | refs/heads/master | 2020-12-13T13:51:05.926802 | 2017-11-23T14:37:44 | 2017-11-23T14:37:44 | 95,588,870 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 10,962 | cpp | TextManager.cpp | /*
* TextManager.cpp
* Subtitles Syphon
*
* Created by Imanol Gomez on 27/06/17.
*
*/
#include "ofMain.h"
#include "TextManager.h"
#include "AppManager.h"
#include "EngineFont.h"
const string TextManager::UNICODE_FONT_PATH = "fonts/Arial Unicode.ttf";
TextManager::TextManager(): Manager(), m_transitionTime(0.5)
{
//Intentionally left empty
}
TextManager::~TextManager()
{
ofLogNotice() <<"TextManager::Destructor" ;
}
void TextManager::setup()
{
if(m_initialized)
return;
Manager::setup();
this->setupFonts();
this->setupVisuals();
this->setupFbos();
ofLogNotice() <<"TextManager::initialized" ;
}
void TextManager::setupVisuals()
{
int margin = LayoutManager::MARGIN;
float width = AppManager::getInstance().getSettingsManager().getAppWidth();
float height = AppManager::getInstance().getSettingsManager().getAppHeight();
ofPoint pos = ofPoint(width/2, height/2);
float w = width - 2*margin;
float h = height - 2*margin;
string text = " ";
string fontName = OF_TTF_SANS;
float size = 30;
auto textVisual = shared_ptr<TextVisual>(new TextVisual(pos,w,h,true));
textVisual->setText(text, fontName, size, ofColor::white);
m_textVisuals["CurrentText"] = textVisual;
textVisual = shared_ptr<TextVisual>(new TextVisual(pos,w,h,true));
textVisual->setText(text, fontName, size, ofColor::white);
m_textVisuals["PreviousText"] = textVisual;
textVisual = shared_ptr<TextVisual>(new TextVisual(pos,w,h,true));
textVisual->setText(text, fontName, size, ofColor::white);
m_textVisuals["CurrentTextPreview"] = textVisual;
textVisual = shared_ptr<TextVisual>(new TextVisual(pos,w,h,true));
textVisual->setText(text, fontName, size, ofColor::white);
m_textVisuals["PreviousTextPreview"] = textVisual;
}
void TextManager::setupFbos()
{
float width = AppManager::getInstance().getSettingsManager().getAppWidth();
float height = AppManager::getInstance().getSettingsManager().getAppHeight();
m_currentFbo.allocate(width, height, GL_RGBA);
m_currentFbo.begin(); ofClear(0,0,0,0); m_currentFbo.end();
m_previusFbo.allocate(width, height, GL_RGBA);
m_previusFbo.begin(); ofClear(0,0,0,0); m_previusFbo.end();
}
void TextManager::setupFonts()
{
this->setupFontNames();
}
void TextManager::setupFontNames()
{
string systemFontsPath = getRootPath(EngineFont::getFontFilePathByName("Helvetica"));
ofLogNotice() <<"TextManager::setupFontNames -> " << systemFontsPath;
ofDirectory dir(systemFontsPath);
//only show font files
dir.allowExt("dfont");
dir.allowExt("otf");
dir.allowExt("ttf");
dir.allowExt("ttc");
//populate the directory object
dir.listDir();
for(int i = 0; i < dir.size(); i++){
m_fontNames.push_back(this->getNameFromExtenstion(dir.getName(i)));
m_fontPaths[m_fontNames.back()] = dir.getPath(i);
}
systemFontsPath = getRootPath(EngineFont::getFontFilePathByName("Arial"));
dir.open(systemFontsPath);
dir.listDir();
for(int i = 0; i < dir.size(); i++){
m_fontNames.push_back(this->getNameFromExtenstion(dir.getName(i)));
m_fontPaths[m_fontNames.back()] = dir.getPath(i);
}
systemFontsPath = ofFilePath::getUserHomeDir() + "/Library/Fonts/";
dir.open(systemFontsPath);
dir.listDir();
for(int i = 0; i < dir.size(); i++){
m_fontNames.push_back(this->getNameFromExtenstion(dir.getName(i)));
m_fontPaths[m_fontNames.back()] = dir.getPath(i);
}
std::sort(std::begin(m_fontNames), std::end(m_fontNames));
}
string TextManager::getFontAbsolutePath(string name)
{
if(m_fontPaths.find(name)==m_fontPaths.end()){
return "";
}
else{
return m_fontPaths.at(name);
}
}
string TextManager::getRootPath(string path)
{
auto vectorPath = ofSplitString(path, "/");
string rootPath = "";
for(int i=1; i<vectorPath.size()-1;i++){
rootPath += ("/" + vectorPath[i]);
}
return rootPath;
}
string TextManager::getNameFromExtenstion(string path)
{
return ofSplitString(path, ".").front();
}
void TextManager::update()
{
}
void TextManager::draw()
{
this->drawCurrentVisuals();
}
void TextManager::drawCurrentVisuals()
{
//ofSetColor(255, 0, 0);
//ofDrawRectangle(0, 0, 1920, 1080);
m_textVisuals["CurrentText"]->draw();
m_textVisuals["PreviousText"]->draw();
}
void TextManager::drawPreviousVisuals()
{
m_textVisuals["CurrentTextPreview"]->draw();
m_textVisuals["PreviousTextPreview"]->draw();
}
void TextManager::onChangeShowBox(bool value)
{
for(auto visual: m_textVisuals){
visual.second->drawBoundingBox(value);
}
}
void TextManager::onChangeSize(int& value)
{
float height = AppManager::getInstance().getSettingsManager().getAppHeight();
int size = (int) ofMap(value, 0, 100, height/100, height/8, true);
for(auto visual: m_textVisuals){
visual.second->setFontSize(size);
}
}
void TextManager::onChangeTransitionTime(float& value)
{
m_transitionTime = value;
}
void TextManager::onChangeWidth(float& value)
{
float width = AppManager::getInstance().getSettingsManager().getAppWidth();
int text_width = (int) ofMap(value, 0.0, 1.0, 0, width, true);
for(auto visual: m_textVisuals){
visual.second->setWidth(text_width);
}
}
void TextManager::onChangeLineHeight(float& value)
{
for(auto visual: m_textVisuals){
visual.second->setLineHeight(value);
}
}
void TextManager::onChangePos(ofVec2f& value)
{
for(auto visual: m_textVisuals){
visual.second->setPosition(value);
}
}
void TextManager::onChangePosX(float& value)
{
float width = AppManager::getInstance().getSettingsManager().getAppWidth();
for(auto visual: m_textVisuals){
auto pos = visual.second->getPosition();
float posX = (int) ofMap(value, 0.0, 1.0, 0, width, true);
pos.x = posX;
visual.second->setPosition(pos);
}
}
void TextManager::onChangePosY(float& value)
{
float height = AppManager::getInstance().getSettingsManager().getAppHeight();
for(auto visual: m_textVisuals){
auto pos = visual.second->getPosition();
float posY = (int) ofMap(value, 0.0, 1.0, 0, height, true);
pos.y = posY;
visual.second->setPosition(pos);
}
}
void TextManager::onChangePosZ(float& value)
{
for(auto visual: m_textVisuals){
auto pos = visual.second->getPosition();
float posZ = (int) ofMap(value, -1.0, 1.0, -100, 100, true);
pos.z = posZ;
visual.second->setPosition(pos);
}
}
void TextManager::onChangeRotX(float& value)
{
for(auto visual: m_textVisuals){
auto rot = visual.second->getRotation();
rot.x = value;
visual.second->setRotation(rot);
}
}
void TextManager::onChangeRotY(float& value)
{
for(auto visual: m_textVisuals){
auto rot = visual.second->getRotation();
rot.y = value;
visual.second->setRotation(rot);
}
}
void TextManager::onChangeRotZ(float& value)
{
for(auto visual: m_textVisuals){
auto rot = visual.second->getRotation();
rot.z = value;
visual.second->setRotation(rot);
}
}
void TextManager::setColor(ofColor& color)
{
for(auto visual: m_textVisuals){
int alpha = visual.second->getAlpha();
color.a = alpha;
visual.second->setColor(color);
}
}
void TextManager::setCurrentText(const string& text)
{
ofLogNotice() <<"TextManager::PreviousText -> " << m_textVisuals["CurrentText"]->getText();
ofLogNotice() <<"TextManager::CurrentText -> " << text;
m_textVisuals["PreviousText"]->setText(m_textVisuals["CurrentText"]->getText());
m_textVisuals["CurrentText"]->setText(text);
this->addCurrentCrossFadeAnimations();
}
void TextManager::setNextText(const string& text)
{
m_textVisuals["PreviousTextPreview"]->setText(m_textVisuals["CurrentTextPreview"]->getText());
m_textVisuals["CurrentTextPreview"]->setText(text);
this->addPreviewCrossFadeAnimations();
}
void TextManager::setFontType(const string& name)
{
string fontPath = this->getFontAbsolutePath(name);
if(fontPath == ""){
ofLogNotice() <<"TextManager::setFontType -> No font found with name " << name ;
return;
}
for(auto visual: m_textVisuals){
visual.second->setFontName(fontPath);
}
AppManager::getInstance().getGuiManager().setFontLabel(name);
ofLogNotice() <<"TextManager::setFontType -> " << name ;
// m_systemFont = name;
}
void TextManager::addCurrentCrossFadeAnimations()
{
AppManager::getInstance().getVisualEffectsManager().removeAllVisualEffects(m_textVisuals["CurrentText"]);
AppManager::getInstance().getVisualEffectsManager().removeAllVisualEffects(m_textVisuals["PreviousText"]);
EffectSettings settings;
settings.function = LINEAR; settings.type = EASE_OUT;
settings.startAnimation = 0; settings.animationTime = m_transitionTime;
auto previousAlpha = m_textVisuals["CurrentText"]->getAlpha();
m_textVisuals["PreviousText"]->setAlpha(previousAlpha);
m_textVisuals["CurrentText"]->setAlpha(0);
AppManager::getInstance().getVisualEffectsManager().createFadeEffect(m_textVisuals["CurrentText"], 0,255, settings);
AppManager::getInstance().getVisualEffectsManager().createFadeEffect(m_textVisuals["PreviousText"], previousAlpha, 0, settings);
}
void TextManager::addPreviewCrossFadeAnimations()
{
AppManager::getInstance().getVisualEffectsManager().removeAllVisualEffects(m_textVisuals["CurrentTextPreview"]);
AppManager::getInstance().getVisualEffectsManager().removeAllVisualEffects(m_textVisuals["PreviousTextPreview"]);
EffectSettings settings;
settings.function = LINEAR; settings.type = EASE_OUT;
settings.startAnimation = 0; settings.animationTime = m_transitionTime;
auto previousAlpha = m_textVisuals["CurrentTextPreview"]->getAlpha();
m_textVisuals["PreviousTextPreview"]->setAlpha(previousAlpha);
m_textVisuals["CurrentTextPreview"]->setAlpha(0);
AppManager::getInstance().getVisualEffectsManager().createFadeEffect(m_textVisuals["CurrentTextPreview"], 0,255, settings);
AppManager::getInstance().getVisualEffectsManager().createFadeEffect(m_textVisuals["PreviousTextPreview"], previousAlpha, 0, settings);
}
|
11919447bec99af4515983ae3985ba815064d24a | 5e80cd98c1ed72ddc5405ef7d0ba3412dc413528 | /hformula.h | c39afabf3aff5df7d95bd1f931e0c9d003a5b0c6 | [] | no_license | Arturgo/Crazy_sums | 3c950178c2ca65c5410a65d5440250dc39b426b5 | a773dd5002ee8c2b4338794894bf946bf99007fe | refs/heads/main | 2023-04-12T10:56:38.872458 | 2021-05-22T10:08:26 | 2021-05-22T10:08:26 | 340,370,165 | 1 | 2 | null | 2021-03-26T15:44:06 | 2021-02-19T12:59:34 | C++ | UTF-8 | C++ | false | false | 19,774 | h | hformula.h | #pragma once
#include <cassert>
#include <memory>
#include <regex>
class HFormula {
public:
class Node;
protected:
std::shared_ptr<const Node> formula;
HFormula() {}
public:
const Node* get() const {
return formula.get();
}
};
class HFormula::Node {
public:
class Symbolic {
public:
std::string str;
Symbolic() {
/* Nothing to do */
}
Symbolic(std::string value) {
str = value;
}
friend std::ostream& operator << (std::ostream& out, const Symbolic &s) {
out << s.str;
return out;
}
};
class MaybeSymbolic {
private:
bool _is_symbolic;
int value;
Symbolic symbolic;
public:
MaybeSymbolic() {
_is_symbolic = false;
value = 0;
}
MaybeSymbolic(int init_value) {
_is_symbolic = false;
value = init_value;
}
MaybeSymbolic(Symbolic init_value) {
_is_symbolic = true;
symbolic = init_value;
}
bool is_symbolic(void) const {
return _is_symbolic;
}
int extract_value(void) const {
assert(!is_symbolic());
return value;
}
Symbolic extract_symbol(void) const {
assert(is_symbolic());
return symbolic;
}
friend std::ostream& operator << (std::ostream& out, const MaybeSymbolic &s) {
if (s.is_symbolic()) {
out << s.extract_symbol();
} else {
out << s.extract_value();
}
return out;
}
};
enum LeafType { LEAF_THETA, LEAF_ZETAK, LEAF_MU, LEAF_NU, LEAF_RHO,
LEAF_SIGMA, LEAF_XI, LEAF_SIGMA_PRIME, LEAF_TAUK, LEAF_PSI,
LEAF_JORDAN_T, LEAF_LIOUVILLE,
LEAF_UNKNOWN
};
typedef struct LeafExtraArg {
MaybeSymbolic k;
MaybeSymbolic l;
} LeafExtraArg;
protected:
enum FormulaType { FORM_ONE, FORM_LEAF, FORM_LFUNC, FORM_POWER, FORM_PRODUCT };
FormulaType formula_type = FORM_ONE;
LeafType leaf_type;
LeafExtraArg leaf_extra;
MaybeSymbolic power = MaybeSymbolic(0);
MaybeSymbolic exponent = MaybeSymbolic(0);
std::vector<HFormula> sub_formula;
std::string textify(LeafType in, bool latex) const {
std::string ret;
switch(in) {
case LEAF_THETA:
ret = (latex ? "\\theta{}" : "θ");
break;
case LEAF_LIOUVILLE:
ret = (latex ? "\\lambda{}" : "λ");
break;
case LEAF_MU:
ret = (latex ? "\\mu{}" : "µ");
if (leaf_extra.k.is_symbolic()) {
ret += (latex ? "_{" : "_{") + leaf_extra.k.extract_symbol().str + (latex ? "}" : "}");
} else {
auto value = leaf_extra.k.extract_value();
if (value != 1) {
ret += "_" + std::to_string(value);
}
}
break;
case LEAF_SIGMA:
ret = (latex ? "\\sigma{}" : "σ");
if (leaf_extra.k.is_symbolic()) {
ret += (latex ? "_{" : "_{") + leaf_extra.k.extract_symbol().str + (latex ? "}" : "}");
} else {
auto value = leaf_extra.k.extract_value();
if (value != 1) {
ret += "_" + std::to_string(value);
}
}
break;
case LEAF_SIGMA_PRIME:
ret = (latex ? "\\sigma{}'" : "σ'");
if (leaf_extra.k.is_symbolic()) {
ret += (latex ? "_{" : "_{") + leaf_extra.k.extract_symbol().str + (latex ? "}" : "}");
} else {
auto value = leaf_extra.k.extract_value();
if (value != 1) {
ret += "_" + std::to_string(value);
}
}
break;
case LEAF_ZETAK:
ret = (latex ? "\\zeta{}" : "ζ");
if (leaf_extra.k.is_symbolic()) {
ret += (latex ? "_{" : "_{") + leaf_extra.k.extract_symbol().str + (latex ? "}" : "}");
} else {
auto value = leaf_extra.k.extract_value();
ret += "_" + std::to_string(value);
}
break;
case LEAF_JORDAN_T:
if (leaf_extra.k.is_symbolic()) {
ret = (latex ? "J" : "J");
ret += (latex ? "_{" : "_{") + leaf_extra.k.extract_symbol().str + (latex ? "}" : "}");
} else {
auto value = leaf_extra.k.extract_value();
if (value == 1) {
ret = (latex ? "\\phi{}" : "φ");
} else {
ret = (latex ? "J" : "J");
ret += "_" + std::to_string(value);
}
}
break;
case LEAF_TAUK:
ret = (latex ? "\\tau" : "τ");
if (leaf_extra.k.is_symbolic()) {
ret += (latex ? "_{" : "_{") + leaf_extra.k.extract_symbol().str + (latex ? "}" : "}");
} else {
auto value = leaf_extra.k.extract_value();
if (value != 2) {
ret += "_" + std::to_string(value);
}
}
break;
case LEAF_XI:
ret = (latex ? "\\xi" : "ξ");
if (leaf_extra.k.is_symbolic()) {
ret += (latex ? "_{" : "_{") + leaf_extra.k.extract_symbol().str + (latex ? "}" : "}");
} else {
auto value = leaf_extra.k.extract_value();
if (value != 1) {
ret += "_" + std::to_string(value);
}
}
break;
case LEAF_PSI:
ret = (latex ? "\\psi" : "ψ");
if (leaf_extra.k.is_symbolic()) {
ret += (latex ? "_{" : "_{") + leaf_extra.k.extract_symbol().str + (latex ? "}" : "}");
} else {
auto value = leaf_extra.k.extract_value();
if (value != 1) {
ret += "_" + std::to_string(value);
}
}
break;
case LEAF_NU:
ret = (latex ? "\\nu" : "ν");
if (leaf_extra.k.is_symbolic()) {
ret += (latex ? "_{" : "_{") + leaf_extra.k.extract_symbol().str + (latex ? "}" : "}");
} else {
auto value = leaf_extra.k.extract_value();
if (value != 1) {
ret += "_" + std::to_string(value);
}
}
break;
case LEAF_RHO:
ret = (latex ? "\\rho_{" : "ρ_{");
if (leaf_extra.k.is_symbolic()) {
ret += leaf_extra.k.extract_symbol().str;
} else {
auto value = leaf_extra.k.extract_value();
ret += std::to_string(value);
}
ret += ",";
if (leaf_extra.l.is_symbolic()) {
ret += leaf_extra.l.extract_symbol().str;
} else {
auto value = leaf_extra.l.extract_value();
ret += std::to_string(value);
}
ret += (latex ? "}" : "}");
break;
default:
ret = (latex ? "?" : "?");
}
return ret;
}
std::ostream& print_inner(std::ostream& out, bool latex) const {
switch (formula_type) {
case FORM_ONE:
out << "1";
break;
case FORM_LEAF:
out << textify(leaf_type, latex);
break;
case FORM_LFUNC: {
const Node* sub_func = sub_formula[0].get();
if (sub_func->isOne()) {
out << (latex ? "\\zeta" : "ζ");
} else {
out << (latex ? "L" : "L");
}
out << (latex ? "\\left(" : "(");
if (!sub_func->isOne()) {
sub_func->print_inner(out, latex);
out << ", ";
}
if (exponent.is_symbolic()) {
out << exponent.extract_symbol();
} else {
out << std::to_string(exponent.extract_value());
}
out << (latex ? "\\right)" : ")");
break;
}
case FORM_POWER: {
bool inner_is_mu = sub_formula[0].get()->isMu();
int power_value = power.extract_value();
if (power_value != 0) {
if (inner_is_mu && (power_value == 2)) {
out << (latex ? "\\abs{" : "|");
}
sub_formula[0].get()->print_inner(out, latex);
if (inner_is_mu && (power_value == 2)) {
out << (latex ? "}" : "|");
} else if (power_value != 1) {
out << (latex ? "^{" : "^") << std::to_string(power_value) << (latex ? "}" : "");
}
}
break;
}
case FORM_PRODUCT: {
bool first = true;
for (auto sub : sub_formula) {
if (!first) {
out << " ";
}
sub.get()->print_inner(out, latex);
first = false;
}
break;
}
default:
out << "TODO";
}
return out;
}
bool isLeafOfType(LeafType requested_type) const {
assert(isPower() || isLeaf());
if (isPower()) {
assert(sub_formula[0].get()->isLeaf());
return sub_formula[0].get()->isLeafOfType(requested_type);
}
return leaf_type == requested_type;
}
int getLeafK(void) const {
if (isPower()) {
assert(sub_formula[0].get()->isLeaf());
return sub_formula[0].get()->getLeafK();
}
return leaf_extra.k.extract_value();
}
int getLeafK(LeafType requested_type) const {
assert(isLeafOfType(requested_type));
return getLeafK();
}
Node() { }
public:
std::ostream& print_inside(std::ostream& out, bool latex) const {
print_inner(out, latex);
return out;
}
std::ostream& print_full(std::ostream& out, bool latex) const {
if (latex) {
out << "$";
}
print_inside(out, latex);
if (latex) {
out << "$" << std::endl << std::endl;
}
out.flush(); /* Better for debug purposes */
return out;
}
void debug_print_type(std::ostream& out) const {
switch (formula_type) {
case FORM_ONE:
out << "FORM_ONE";
break;
case FORM_LEAF:
out << "FORM_LEAF";
break;
case FORM_LFUNC:
out << "FORM_LFUNC";
break;
case FORM_POWER:
out << "FORM_POWER";
break;
case FORM_PRODUCT:
out << "FORM_PRODUCT";
break;
default:
out << "FORM_???";
}
}
friend std::ostream& operator << (std::ostream& out, const Node &r) {
return r.print_full(out, false);
}
bool isOne() const {
return formula_type == FORM_ONE;
}
bool isLeaf() const {
return formula_type == FORM_LEAF;
}
bool isProduct() const {
return formula_type == FORM_PRODUCT;
}
bool isPower() const {
return formula_type == FORM_POWER;
}
int getPower() const {
if (isOne() || isLeaf()) {
return 1;
}
assert(isPower());
return power.extract_value();
}
MaybeSymbolic getPowerS() const {
assert(isPower());
return power;
}
HFormula getPowerInner() const {
assert(isPower());
return sub_formula[0];
}
size_t getProductSize() const {
assert(isProduct());
return sub_formula.size();
}
HFormula getProductElem(size_t idx) const {
assert(isProduct() && (idx < sub_formula.size()));
return sub_formula[idx];
}
bool isLFunc() const {
return formula_type == FORM_LFUNC;
}
HFormula getLFuncProduct() const {
assert(isLFunc() && sub_formula[0].get()->isProduct());
return sub_formula[0];
}
MaybeSymbolic getLFuncExponentS() const {
assert(isLFunc());
return exponent;
}
int getLFuncExponent() const {
return getLFuncExponentS().extract_value();
}
bool isZeta() const {
return isLFunc() && sub_formula[0].get()->isOne();
}
bool isLFuncNonZeta() const {
return isLFunc() && !isZeta();
}
MaybeSymbolic getZetaExponentS() const {
assert(isZeta());
return getLFuncExponentS();
}
int getZetaExponent() const {
return getZetaExponentS().extract_value();
}
bool isLeafSameAs(const Node* other) const {
assert(isLeaf());
assert(other->isLeaf());
return leaf_type == other->leaf_type;
}
bool isMu() const {
return isLeafOfType(LEAF_MU);
}
bool isNu() const {
return isLeafOfType(LEAF_NU);
}
bool isSigma() const {
return isLeafOfType(LEAF_SIGMA);
}
bool isSigmaPrime() const {
return isLeafOfType(LEAF_SIGMA_PRIME);
}
bool isTheta() const {
return isLeafOfType(LEAF_THETA);
}
bool isJordanT() const {
return isLeafOfType(LEAF_JORDAN_T);
}
bool isLiouville() const {
return isLeafOfType(LEAF_LIOUVILLE);
}
bool isTauK() const {
return isLeafOfType(LEAF_TAUK);
}
int getLeafK_dangerous() const {
assert(isLeaf());
return leaf_extra.k.extract_value();
}
int getLeafL_dangerous() const {
assert(isLeaf());
return leaf_extra.l.extract_value();
}
MaybeSymbolic getLeafKS_dangerous() const {
assert(isLeaf());
return leaf_extra.k;
}
MaybeSymbolic getLeafLS_dangerous() const {
assert(isLeaf());
return leaf_extra.l;
}
std::vector<HFormula> getSubFormula() const {
return sub_formula;
}
};
class NodeOne : public HFormula::Node
{
public:
NodeOne() {
formula_type = FORM_ONE;
}
};
class HFormulaOne : public HFormula
{
public:
HFormulaOne() {
formula = std::make_shared<const Node>(NodeOne());
}
};
class NodeLeaf : public HFormula::Node
{
public:
NodeLeaf(LeafType type) {
assert(type==LEAF_THETA || type==LEAF_LIOUVILLE);
formula_type = FORM_LEAF;
leaf_type = type;
leaf_extra = (Node::LeafExtraArg){.k = 0, .l = 0}; /* Force init to zero, helps comparison */
}
NodeLeaf(LeafType type, LeafExtraArg extra) {
assert( ( (!extra.k.is_symbolic() && (extra.k.extract_value()== 0))
&& (!extra.l.is_symbolic() && (extra.l.extract_value()== 0)))
|| type==LEAF_MU || type==LEAF_NU || type==LEAF_SIGMA || type==LEAF_SIGMA_PRIME
|| type==LEAF_ZETAK|| type==LEAF_JORDAN_T || type==LEAF_PSI || type==LEAF_TAUK || type==LEAF_XI
|| type==LEAF_RHO
);
formula_type = FORM_LEAF;
leaf_type = type;
leaf_extra = extra;
}
};
class HFormulaLeaf : public HFormula
{
public:
HFormulaLeaf(Node::LeafType type) {
formula = std::make_shared<const Node>(NodeLeaf(type));
}
HFormulaLeaf(Node::LeafType type, Node::LeafExtraArg extra) {
formula = std::make_shared<const Node>(NodeLeaf(type, extra));
}
};
class NodeLFunction : public HFormula::Node
{
public:
NodeLFunction(const HFormula& sub_func, int sub_exponent) {
formula_type = FORM_LFUNC;
sub_formula.push_back(sub_func);
exponent = sub_exponent;
}
NodeLFunction(const HFormula& sub_func, Symbolic sub_exponent) {
formula_type = FORM_LFUNC;
sub_formula.push_back(sub_func);
exponent = sub_exponent;
}
};
class HFormulaLFunction : public HFormula
{
public:
HFormulaLFunction(const HFormula& sub_func, int sub_exponent) {
formula = std::make_shared<const Node>(NodeLFunction(sub_func, sub_exponent));
}
HFormulaLFunction(const HFormula& sub_func, Node::Symbolic sub_exponent) {
formula = std::make_shared<const Node>(NodeLFunction(sub_func, sub_exponent));
}
};
class NodePower : public HFormula::Node
{
public:
NodePower(const HFormula& part, int new_power) {
if (part.get()->isOne() || (new_power == 0)) {
formula_type = FORM_ONE;
} else {
formula_type = FORM_POWER;
power = new_power;
sub_formula.push_back(part);
}
}
};
class HFormulaPower : public HFormula
{
public:
HFormulaPower(const HFormula& part, int power) {
formula = std::make_shared<const Node>(NodePower(part, power));
}
};
class NodeProduct : public HFormula::Node
{
private:
void add_subformula(const HFormula& form) {
if (form.get()->isOne()) {
return;
}
if (form.get()->isProduct()) {
for (auto sub : form.get()->getSubFormula()) {
assert(!sub.get()->isProduct());
sub_formula.push_back(sub);
}
} else {
sub_formula.push_back(form);
}
}
public:
NodeProduct(const HFormula& unique) {
if (unique.get()->isOne()) {
formula_type = FORM_ONE;
} else {
formula_type = FORM_PRODUCT;
add_subformula(unique);
}
}
NodeProduct(const HFormula& left, const HFormula& right) {
if (left.get()->isOne() && right.get()->isOne()) {
formula_type = FORM_ONE;
} else {
formula_type = FORM_PRODUCT;
add_subformula(left);
add_subformula(right);
}
}
NodeProduct(const HFormula& a, const HFormula& b, const HFormula& c) {
if (a.get()->isOne() && b.get()->isOne() && c.get()->isOne()) {
formula_type = FORM_ONE;
} else {
formula_type = FORM_PRODUCT;
add_subformula(a);
add_subformula(b);
add_subformula(c);
}
}
};
class HFormulaProduct : public HFormula
{
public:
HFormulaProduct(const HFormula& unique) {
formula = std::make_shared<const Node>(NodeProduct(unique));
}
HFormulaProduct(const HFormula& left, const HFormula& right) {
formula = std::make_shared<const Node>(NodeProduct(left, right));
}
HFormulaProduct(const HFormula& a, const HFormula& b, const HFormula& c) {
formula = std::make_shared<const Node>(NodeProduct(a, b, c));
}
};
std::ostream& operator << (std::ostream& out, const HFormula &h) {
return h.get()->print_full(out, false);
}
using FormulaNode = HFormula::Node; |
2e4d3b43ec05239ffc5740cf9c3fb7d3328100c5 | 30bdd8ab897e056f0fb2f9937dcf2f608c1fd06a | /CodesNew/3757.cpp | d39affc3a66cb3c10ec84a3de6efb4e3ff084e06 | [] | no_license | thegamer1907/Code_Analysis | 0a2bb97a9fb5faf01d983c223d9715eb419b7519 | 48079e399321b585efc8a2c6a84c25e2e7a22a61 | refs/heads/master | 2020-05-27T01:20:55.921937 | 2019-11-20T11:15:11 | 2019-11-20T11:15:11 | 188,403,594 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 682 | cpp | 3757.cpp | #include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>
using namespace std;
int main()
{
int N;
cin>>N;
int M;
cin>>M;
long long int sum=0;
int min1;
int max1;
vector<int> ith;
for(int i=0;i<N;i++)
{
int temp;
cin>>temp;
ith.push_back(temp);
sum=(sum+temp);
}
sort(ith.begin(),ith.end());
int optimum;
if((sum+M)%N==0)
{
optimum=((sum+M)/N);
}
else
{
optimum=(((sum+M)/N)+1);
}
//cout<<"optimum"<<optimum<<endl;
if(ith[N-1]<=optimum)
{
min1=optimum;
}
else
{
min1=ith[N-1];
}
max1=(ith[N-1]+M);
cout<<min1<<" ";
cout<<max1;
} |
ac98358d29b80fb9d2b9b365c26ae847bfdeaed3 | ca347b17b9ab6153bed51989b9dbba866990ad8a | /atcoder/abc024_c.cpp | 76bd001aa4c30f24f00178d3df9b487d5fa672ff | [] | no_license | wataruiwabuchi/competitive_programming | 319074cb8bca8dcfe4fd0eba8854be82ff3e8965 | b4b03cf62e6c13f3a3b478982ae32a1aacfe70bf | refs/heads/master | 2021-03-20T06:48:41.998037 | 2020-05-27T14:07:06 | 2020-05-27T14:07:06 | 247,187,106 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,108 | cpp | abc024_c.cpp | #define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <climits>
using namespace std;
#define MOD int(1e9 + 7)
#define INF (long long)(1e18)
int main()
{
cout.precision(18);
long long N, D, K;
vector<vector<long long>> LR, ST;
cin >> N >> D >> K;
for (long long i = 0; i < D; i++)
{
long long l, r;
cin >> l >> r;
LR.push_back(vector<long long>{l, r});
}
for (long long i = 0; i < K; i++)
{
long long s, t;
cin >> s >> t;
long long c = s;
for (long long j = 0; j < D; j++)
{
if (LR[j][0] <= c && LR[j][1] >= c)
{
if (LR[j][0] <= t && LR[j][1] >= t)
{
cout << j + 1 << endl;
break;
}
else if (c > t)
c = LR[j][0];
else
c = LR[j][1];
}
}
}
} |
6cd9a99e044dd70551e9991580909966c5c5f6fc | 77a08ec51aa16191986a739267fd9d4379bbb208 | /vj/kb19G.cpp | c4e24834546e0d653b99985e5a1afaa4bee70d9e | [] | no_license | cenariusxz/ACM-Coding | 8f698203db802f79578921b311b38346950ef0ca | dc09ac9adfb4b80d463bdc93f52b479a957154e6 | refs/heads/master | 2023-06-24T13:12:13.279255 | 2021-07-26T01:24:36 | 2021-07-26T01:24:36 | 185,567,471 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,160 | cpp | kb19G.cpp | #include<stdio.h>
#include<string.h>
typedef long long ll;
int mod;
struct mat{
int r,c;
ll m[3][3];
};
mat MatMul(mat m1,mat m2){
mat tmp;
tmp.r=m1.r;
tmp.c=m2.c;
int i,j,k;
for(i=1;i<=tmp.r;i++){
for(j=1;j<=tmp.c;j++){
ll t=0;
for(k=1;k<=m1.c;k++){
t=(t+(m1.m[i][k]*m2.m[k][j])%mod)%mod;
}
tmp.m[i][j]=t;
}
}
return tmp;
}
mat MatQP(mat a,int n){
mat ans,tmp=a;
ans.r=ans.c=a.r;
memset(ans.m,0,sizeof(ans.m));
for(int i=1;i<=ans.r;i++){
ans.m[i][i]=1;
}
while(n){
if(n&1)ans=MatMul(ans,tmp);
n>>=1;
tmp=MatMul(tmp,tmp);
}
return ans;
}
int main(){
int T;
scanf("%d",&T);
int x,y,n,m;
mat t;
t.r=2;t.c=2;
t.m[1][1]=t.m[2][1]=1;
t.m[1][2]=1;
t.m[2][2]=0;
while(T--){
scanf("%d%d%d%d",&x,&y,&n,&m);
int i;
mod=1;
for(i=1;i<=m;i++)mod*=10;
if(n==0)printf("%d\n",((x%mod)+mod)%mod);
else{
mat a;
a.r=2;a.c=1;
a.m[1][1]=y;
a.m[2][1]=x;
mat tmp=MatQP(t,n-1);
a=MatMul(tmp,a);
printf("%lld\n",((a.m[1][1]%mod)+mod)%mod);
}
}
return 0;
}
|
e0766968bdd807792334f1f01d0577d677930f51 | 584bd76da1b155cda8220450f6118b22d22775e0 | /main.cpp | 97ed1ed998ca75ffa72f21d710b2ce998113c3ad | [] | no_license | nikolaevaaa/tsisa05 | 1b82ae1439273bf0e84b54a1efbbace190aa964c | dd8b5674056c5af4552a66daad4fcd4ee5fc430e | refs/heads/main | 2023-02-04T17:46:31.335694 | 2020-12-22T15:54:52 | 2020-12-22T15:54:52 | 321,752,574 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,716 | cpp | main.cpp | #include <iostream>
#include <random>
#include <ctime>
#include <vector>
#include <algorithm>
const double a = 0.0;
const double b = 3.0;
const double c = -1.0;
const double d = 3.0;
const size_t N = 10;
const double A = 3.0;
const double step = (double)((b - a) / (N - 1));
struct Point {
double x;
double y;
};
double func (const double &x) {
return c * x + d;
}
std::vector<Point> random(const size_t N, const double noise) {
std::vector<Point> points (N);
std::random_device rd;
std::mt19937 gen(rd());
std::uniform_real_distribution<double> error(-0.5, 0.5);
for (size_t i = 0; i < N; ++i) {
points[i].x = a + i * step;
points[i].y = func( a + i * step) + noise * error(gen);
}
return points;
}
std::vector<Point> edge(const double lower, const double upper,
const size_t num, const double noise) {
std::vector<Point> points(num);
const double step = (upper - lower) / static_cast<double>(num - 1);
for (size_t i = 0; i < num; ++i) {
points[i].x = lower + i * step;
points[i].y = func(points[i].x) -noise/2 + rand() * 1./RAND_MAX * (noise);
}
return points;
}
double error(const std::vector<Point>& right, const double c, const double d) {
double sum = 0.;
for (auto point : right) {
sum += pow(point.y - (c * func(point.x)), 2);
}
return sum;
}
double golden_ratio(std::vector<Point>& p, double Cmin, double Cmax) {
double l = std::abs(Cmax - Cmin);
std::swap(Cmin, Cmax);
Cmin = std::fabs(Cmin);
Cmax = std::fabs(Cmax);
const double e = 0.1;
const double t = (std::sqrt(5) + 1) / 2;
double c_k1 = Cmin + (1 - 1/t)*Cmax;
double c_k2 = Cmin + Cmax / t;
double f_k1 = func(-c_k1);
double f_k2 = func(-c_k2);
while (l > e){
if (f_k1 < f_k2){
Cmax = c_k2;
c_k2 = Cmin + Cmax - c_k1;
f_k2 = func(-c_k2);
} else {
Cmin = c_k1;
c_k1 = Cmin + Cmax - c_k2;
f_k1 = func(-c_k1);
}
if (c_k1 > c_k2){
std::swap(c_k1, c_k2);
std::swap(f_k1, f_k2);
}
l = std::abs(Cmax - Cmin);
}
return -((Cmax + Cmin) / 2);
}
int F(int f)
{
if (f==1) return 1;
else if (f==2) return 1;
else if (f>2)
return (F(f-1)+F(f-2));
}
double Fibonacci( std::vector<Point>& p, double Dmin, double Dmax) {
double ak = Dmin, bk = Dmax, x1, x2, y1, y2;
int G = 10;
x1 = ak + (double)F(G - 2) / F(G) * (bk - ak);
x2 = ak + (double)F(G - 1) / F(G) * (bk - ak);
y1 = error(p, x1, 0);
y2 = error(p, x2, 0);
for (int i=G; i >= 1; --i) {
if (y1 > y2) {
ak = x1;
x1 = x2;
x2 = bk - (x2 - ak);
y1 = y2;
y2 = error(p, x2, 0);
}
else {
bk = x2;
x2 = x1;
x1 = ak + (bk - x2);
y2 = y1;
y1 = error(p, x1, 0);
}
}
return (x1 + x2) / 2;
}
void print(const double noise)
{
std::vector<Point> p = random(N, noise);
double Cmin, Cmax, Dmin, Dmax;
edge( Cmin, Cmax, Dmin, Dmax);
std::cout << "Cmin = " << Cmin << "\nCmax = " << Cmax << "\nDmin = "
<< Dmin << "\nDmax = " << Dmax << std::endl;
double w1 = golden_ratio(p, Cmin, Cmax);
double w0 = Fibonacci(p, Dmin, Dmax);
std::cout << "w1 = " << w1 <<std::endl;
std::cout<< "w0 = " << w0 << std::endl;
}
int main() {
std::cout << "Function y = -x + 3"<<std::endl;
std::cout << "Without noise"<<std::endl;
print(0.0);
std::cout << "With noise A = " << A <<std::endl;
print(A);
return 0;
}
|
d9baa0fdcb15868fc117b5faff3d4a6510ac1679 | 1d5ca9a09426ce61703133ff8cc40711a0ce0f5b | /Source.cpp | 868063939b450a6a38cec3d913be6b00de377973 | [] | no_license | nzwoodturner/EVE-bot | 79ff5346955fdae034037f38c344ce195a0ad91e | a803fe08e9e0dd6efcc82bb08f51a89786fe0b4f | refs/heads/master | 2023-04-20T14:21:31.124610 | 2021-05-03T01:36:17 | 2021-05-03T01:36:17 | 278,063,381 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 12,442 | cpp | Source.cpp | #include <stdio.h>
#include <windows.h>
#include <iostream>
#include <time.h>
#include <string>
using namespace std;
#include <cstdlib>
//window size must be 1016*1008
int permY = 0;
HWND eveWindow;
void pressKey(WORD key, int x);
void ClickMouse(int x, int y);
void DoubleClickMouse(int x, int y);
void RightClickMouse(int x, int y);
void ClickUp(int x, int y);
void ClickDown(int x, int y);
void MoveMouse(int x, int y, int rmouse);
bool IsBlack(int x, int y);
bool IsYellow(int x, int y);
void undock();
void dock();
int warp();
void recallDrones();
void launchDrones();
int checkInvetory();
int checkDamage();
void unload();
int mine();
void target();
void KeyUp(WORD key, int x);
void KeyDown(WORD key, int x);
int belt = 0;
bool IsWhite(int x, int y);
void shutdown();
int colour;
int check = 0;
int main(int argc, CHAR *argv[])
{
srand(time(NULL));
POINT ptMouse;
RECT windowPosition;
eveWindow = FindWindow(NULL, TEXT("EVE - Miner Esubria"));
COLORREF color1;
COLORREF color2;
COLORREF color3;
HDC hDC;
if (eveWindow == NULL)
{
cout << "Could not find EVE window, closing. make sure EVE is open \n" ;
system("pause");
return 0;
}
SetForegroundWindow(eveWindow);
Sleep(2000);
GetWindowRect(eveWindow, &windowPosition);
GetCursorPos(&ptMouse);
cout << "everything Checks out\n" ;
cout << "------------------------------------\n" ;
while (true) {
check = 0;
undock();
cout << "undocked\n";
warp();
cout << "warped\n";
launchDrones();
cout << "drones launched\n";
hDC = GetDC(NULL);
color3 = GetPixel(hDC, 776 + windowPosition.left, 249 + windowPosition.top);
ReleaseDC(GetDesktopWindow(), hDC);
if (GetRValue(color3) > 120)
{
check = 1;
belt++;
cout << "belt empty\n";
}
else {
target();
cout << "targeted\n";
mine();
cout << "mining\n";
}
while (check ==0)
{
shutdown();
if (checkInvetory() == 1)
{
check = 1;
cout << "inventory full\n";
}
else if (checkDamage() == 1)
{
check = 1;
cout << "taking damage\n";
belt++;
}
Sleep(1000);
hDC = GetDC(NULL);
color3 = GetPixel(hDC, 644+windowPosition.left, 114+windowPosition.top);
ReleaseDC(GetDesktopWindow(), hDC);
colour = GetRValue(color3);
//cout << to_string(colour)+"\n";
if (GetRValue(color3) < 170)
{
target();
cout << "targeted\n";
mine();
cout << "mining\n";
}
hDC = GetDC(NULL);
color3 = GetPixel(hDC, 780+windowPosition.left, 238+windowPosition.top);
ReleaseDC(GetDesktopWindow(), hDC);
if (GetRValue(color3)>120)
{
check = 1;
belt++;
cout << "belt empty\n";
}
}
if (belt >= 16)
{
belt = 0;
}
recallDrones();
cout << "drones recalled\n";
dock();
cout << "docked\n";
unload();
cout << "unloaded\n";
}
return 0;
}
void recallDrones()
{
KeyDown(VK_SHIFT, 1);
Sleep(100);
pressKey(0x52, 1);
KeyUp(VK_SHIFT, 1);
//Sleep(7000);
}
void launchDrones()
{
KeyDown(VK_SHIFT, 1);
Sleep(100);
pressKey(0x46, 1);
KeyUp(VK_SHIFT, 1);
}
int checkInvetory()
{
if (IsBlack(367, 646) == false)
return 1;
else
return 0;
}
int checkDamage()
{
if (IsBlack(502, 871) == false)
return 1;
else
return 0;
}
void unload()
{
MoveMouse(300, 800, 2);
POINT ptMouse;
GetCursorPos(&ptMouse);
int mX = ptMouse.x;
int mY = ptMouse.y;
Sleep(100);
MoveMouse(335, 810, 1);
MoveMouse(240, 700, 4);
MoveMouse(132, 735, 5);
Sleep(2000);
}
int mine()
{
int check = 0;
COLORREF color;
HDC hDC;
/*while (check == 0)
{
hDC = GetDC(NULL);
if (hDC == NULL)
return 1;
color = GetPixel(hDC, 523, 978);
if (color == CLR_INVALID)
return 1;
ReleaseDC(GetDesktopWindow(), hDC);
if (GetRValue(color) > 110)
check = 1;
}*/
pressKey(VK_F1, 1);
pressKey(VK_F2,1);
Sleep(200);
KeyDown(VK_CONTROL, 1);
Sleep(200);
pressKey(VK_SPACE, 1);
Sleep(150);
KeyUp(VK_CONTROL, 1);
//MoveMouse(701, 114, 1);
return 0;
}
void target()
{
int check = 0;
MoveMouse(627, 220, 6);
ClickMouse(627, 220 );
MoveMouse(644, 114, 1);
KeyDown(VK_MENU, 1);
pressKey(VK_F1, 1);
pressKey(VK_F2, 1);
KeyUp(VK_MENU, 1);
Sleep(25000);
check = 0;
while (check == 0)
{
shutdown();
if (IsBlack(508, 985) == true)
check = 1;
}
MoveMouse(765, 114, 1);
KeyDown(VK_MENU, 1);
pressKey(VK_F1, 1);
KeyUp(VK_MENU, 1);
Sleep(5000);
}
int warp()
{
MoveMouse(85, 154, 1);
Sleep(100 + rand() % 100);
POINT ptMouse;
GetCursorPos(&ptMouse);
int mX = ptMouse.x;
int mY = ptMouse.y;
MoveMouse(125, 190, 6);
Sleep(100 + rand() % 100);
MoveMouse(271, 190, 6);
MoveMouse(271, 190+(20*belt), 6);
Sleep(100 + rand() % 100);
MoveMouse(463, 190+ (20 * belt), 1);
Sleep(20000);
int check = 0;
while (check == 0)
{
shutdown();
if (IsBlack(508,985)==true)
check = 1;
}
Sleep(10000);
KeyDown(VK_CONTROL, 1);
Sleep(200);
pressKey(VK_SPACE, 1);
Sleep(150);
KeyUp(VK_CONTROL, 1);
return 0;
}
void undock()
{
MoveMouse(900, 211, 1);
int check = 0;
while (check == 0)
{
shutdown();
if (IsBlack(27,88) == true)
{
check = 1;
}
}
while (check == 1)
{
shutdown();
if (IsBlack(27, 88) == false)
{
check = 2;
}
}
Sleep(5000);
KeyDown(VK_CONTROL, 1);
Sleep(200);
pressKey(VK_SPACE, 1);
Sleep(150);
KeyUp(VK_CONTROL, 1);
}
void dock()
{
POINT ptMouse;
GetCursorPos(&ptMouse);
int mX = ptMouse.x;
int mY = ptMouse.y;
MoveMouse(85, 154, 1);
Sleep(100 + rand() % 100);
MoveMouse(122, 250, 6);
Sleep(100 + rand() % 100);
MoveMouse(339, 250, 6);
Sleep(100 + rand() % 100);
MoveMouse(576, 250, 6);
MoveMouse(576, 310, 1);
Sleep(100 + rand() % 100);
int check = 0;
int check2 = 0;
while (check == 0)
{
cout << to_string(check)+"\n";
shutdown();
if (IsBlack(508, 985) == false)
check = 1;
if (check2 > 30000)
{
shutdown();
if (IsBlack(508, 985) == true)
{
GetCursorPos(&ptMouse);
mX = ptMouse.x;
mY = ptMouse.y;
MoveMouse(85, 154, 1);
Sleep(100);
MoveMouse(122, 250, 6);
Sleep(100);
MoveMouse(339, 250, 6);
Sleep(100);
MoveMouse(576, 250, 6);
MoveMouse(576, 310, 1);
Sleep(100);
check2 = 0;
}
}
Sleep(1);
check2++;
}
while (check == 1)
{
cout << to_string(check) + "\n";
shutdown();
if (IsBlack(27, 88) == true)
{
check = 2;
}
}
while (check == 2)
{
cout << to_string(check) + "\n";
shutdown();
if (IsBlack(27, 88) == false)
{
check = 3;
}
}
Sleep(5000);
}
void pressKey(WORD key, int x)
{
int y = 0;
while (y <= x)
{
SetForegroundWindow(eveWindow);
Sleep(200 + rand() % 250);
INPUT* keyClick;
keyClick = new INPUT;
keyClick->ki.wVk = key;
keyClick->type = INPUT_KEYBOARD;
keyClick->ki.dwFlags = 0;
keyClick->ki.time = 0;
keyClick->ki.wScan = 0;
keyClick->ki.dwExtraInfo = 0;
SendInput(1, keyClick, sizeof(INPUT));
Sleep(100);
keyClick->ki.dwFlags = KEYEVENTF_KEYUP;
SendInput(1, keyClick, sizeof(INPUT));
y++;
}
}
void KeyUp(WORD key, int x)
{
SetForegroundWindow(eveWindow);
Sleep(200 + rand() % 250);
INPUT* keyClick;
keyClick = new INPUT;
keyClick->ki.wVk = key;
keyClick->type = INPUT_KEYBOARD;
keyClick->ki.dwFlags = 0;
keyClick->ki.time = 0;
keyClick->ki.wScan = 0;
keyClick->ki.dwExtraInfo = 0;
keyClick->ki.dwFlags = KEYEVENTF_KEYUP;
SendInput(1, keyClick, sizeof(INPUT));
}
void KeyDown(WORD key, int x)
{
SetForegroundWindow(eveWindow);
Sleep(200 + rand() % 250);
INPUT* keyClick;
keyClick = new INPUT;
keyClick->ki.wVk = key;
keyClick->type = INPUT_KEYBOARD;
keyClick->ki.dwFlags = 0;
keyClick->ki.time = 0;
keyClick->ki.wScan = 0;
keyClick->ki.dwExtraInfo = 0;
SendInput(1, keyClick, sizeof(INPUT));
}
void ClickMouse(int x, int y)
{
SetForegroundWindow(eveWindow);
Sleep(200 + rand() % 250);
mouse_event(MOUSEEVENTF_LEFTDOWN, x, y, 0, 0);
Sleep(100);
mouse_event(MOUSEEVENTF_LEFTUP, x, y, 0, 0);
}
void DoubleClickMouse(int x, int y)
{
SetForegroundWindow(eveWindow);
Sleep(200 + rand() % 250);
mouse_event(MOUSEEVENTF_LEFTDOWN, x, y, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, x, y, 0, 0);
Sleep(100);
mouse_event(MOUSEEVENTF_LEFTDOWN, x, y, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, x, y, 0, 0);
}
void RightClickMouse(int x, int y)
{
SetForegroundWindow(eveWindow);
Sleep(200 + rand() % 250);
mouse_event(MOUSEEVENTF_RIGHTDOWN, x, y, 0, 0);
Sleep(100);
mouse_event(MOUSEEVENTF_RIGHTUP, x, y, 0, 0);
}
void ClickDown(int x, int y)
{
SetForegroundWindow(eveWindow);
Sleep(200 + rand() % 250);
mouse_event(MOUSEEVENTF_LEFTDOWN, x, y, 0, 0);
Sleep(100);
}
void ClickUp(int x, int y)
{
SetForegroundWindow(eveWindow);
Sleep(200 + rand() % 250);
mouse_event(MOUSEEVENTF_LEFTUP, x, y, 0, 0);
Sleep(100);
}
void MoveMouse(int x, int y, int rmouse)
{
SetForegroundWindow(eveWindow);
Sleep(200 + rand() % 250);
POINT ptMouse;
RECT windowPosition;
GetWindowRect(eveWindow,&windowPosition);
int finalX =( windowPosition.left + x);
int finalY = (windowPosition.top + y);
GetCursorPos(&ptMouse);
int mX = ptMouse.x;
int mY = ptMouse.y;
while (mX != finalX || mY != finalY)
{
shutdown();
GetCursorPos(&ptMouse);
mX = ptMouse.x;
mY = ptMouse.y;
int dy = 0;
int dx = 0;
if (finalX > mX)
{
if (mX != finalX)
{
dx = 2 + rand() % 2;
}
}
else
{
if (mX != finalX)
{
dx = -2 - rand() % 2;
}
}
if (finalY > mY)
{
if (mY != finalY)
{
dy = 2 + rand() % 2;
}
}
else
{
if (mY != finalY)
{
dy = -2 - rand() % 2;
}
}
SetCursorPos(mX + (dx), mY + (dy));
SetForegroundWindow(eveWindow);
Sleep(1);
}
if (rmouse == 1)
ClickMouse(finalX, finalY);
else if (rmouse == 2)
RightClickMouse(finalX, finalY);
else if (rmouse == 3)
DoubleClickMouse(finalX, finalY);
else if (rmouse == 4)
ClickDown(finalX, finalY);
else if (rmouse == 5)
ClickUp(finalX, finalY);
}
bool IsYellow(int x, int y)
{
SetForegroundWindow(eveWindow);
RECT windowPosition;
GetWindowRect(eveWindow, &windowPosition);
int finalX = windowPosition.left + x;
int finalY = windowPosition.right + y;
bool result;
COLORREF color;
HDC hDC;
hDC = GetDC(NULL);
if (hDC == NULL)
return 3;
color = GetPixel(hDC, finalX, finalY);
if (color == CLR_INVALID)
return 1;
ReleaseDC(GetDesktopWindow(), hDC);
if ((GetRValue(color) ==25) && (GetGValue(color) ==25) && (GetBValue(color) ==25))
{
result = true;
}
else
{
result = false;
}
Sleep(10);
return result;
}
bool IsWhite(int x, int y)
{
SetForegroundWindow(eveWindow);
RECT windowPosition;
GetWindowRect(eveWindow, &windowPosition);
int finalX = windowPosition.left + x;
int finalY = windowPosition.right + y;
bool result;
COLORREF color;
HDC hDC;
hDC = GetDC(NULL);
if (hDC == NULL)
return 3;
color = GetPixel(hDC, finalX, finalY);
if (color == CLR_INVALID)
return 1;
ReleaseDC(GetDesktopWindow(), hDC);
if ((GetRValue(color) >200) && (GetGValue(color) >200) && (GetBValue(color) >200))
{
result = true;
}
else
{
result = false;
}
Sleep(10);
return result;
}
bool IsBlack(int x, int y)
{
SetForegroundWindow(eveWindow);
RECT windowPosition;
GetWindowRect(eveWindow, &windowPosition);
int finalX = windowPosition.left + x;
int finalY = windowPosition.top + y;
bool result;
COLORREF color;
HDC hDC;
hDC = GetDC(NULL);
if (hDC == NULL)
return 3;
color = GetPixel(hDC, finalX, finalY);
if (color == CLR_INVALID)
return 1;
ReleaseDC(GetDesktopWindow(), hDC);
if ((GetRValue(color) <GetGValue(color)+5) && (GetRValue(color) >(GetGValue(color)-5) )&&(GetRValue(color) < GetBValue(color) + 5) && (GetRValue(color) > (GetBValue(color) - 5)))
{
result = true;
}
else
{
result = false;
}
Sleep(10);
return result;
}
void shutdown()
{
if (GetAsyncKeyState(0x58) & 0x8000)
{
abort();
}
} |
f19b1b4339d84e5dbf351f35432d63fc4429ca9d | 6cb134160f41e20f72ef665beca92c88fed90acc | /Effort/Engine/Source/Pch.h | 4603226f6f8914fd653bb4d05175c23b9cf11ef4 | [] | no_license | negimaru1219/Effort | b875f2db87d20bb7b4ccba5a265b490353344049 | 2b8adad8bbc0303107171c288eb1746ac2e69621 | refs/heads/main | 2023-03-15T10:15:51.260481 | 2021-03-21T12:33:02 | 2021-03-21T12:33:02 | 347,937,808 | 0 | 0 | null | null | null | null | SHIFT_JIS | C++ | false | false | 1,192 | h | Pch.h | #pragma once
#define NOMINMAX
// ComPtr
#include <wrl/client.h>
// メモリリークの感知
#include <crtdbg.h>
// コンテナ
#include <vector>
#include <list>
#include <array>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <stack>
#include <queue>
// 一般
#include <memory>
#include <functional>
#include <algorithm>
#include <utility>
#include <type_traits>
#include <chrono>
#include <optional>
#include <ctime>
#include <cstdlib>
#include <cstdint>
#include <iterator>
#include <execution>
// マルチスレッド
#include <thread>
#include <atomic>
#include <mutex>
#include <future>
// 文字列
#include <string>
#include <string_view>
// 数値処理
#include <numeric>
#include <random>
// 入出力ストリーム
#include <fstream>
#include <filesystem>
#include <sstream>
#include <iomanip>
#include <iostream>
// Windows
#include <windowsx.h>
#pragma comment(lib, "winmm.lib")
#include <DirectXMath.h>
// DirectX12
#pragma comment(lib, "d3d12.lib")
#pragma comment(lib, "d3dcompiler.lib")
#pragma comment(lib, "dxgi.lib")
#pragma comment(lib, "dxguid.lib")
// Engine
#include "Core/Platform.h"
#include "Math/Math.h" |
02e33d4c56aa30b23ffa5ca63a3e5ca61264d313 | ac227cc22d5f5364e5d029a2cef83816a6954590 | /applications/physbam/physbam-lib/Public_Library/PhysBAM_Tools/Grids_Uniform_Arrays/ARRAYS_UTILITIES.h | 9077d6ca86cbda3a54bf40803d31c812fffd3457 | [
"BSD-3-Clause"
] | permissive | schinmayee/nimbus | 597185bc8bac91a2480466cebc8b337f5d96bd2e | 170cd15e24a7a88243a6ea80aabadc0fc0e6e177 | refs/heads/master | 2020-03-11T11:42:39.262834 | 2018-04-18T01:28:23 | 2018-04-18T01:28:23 | 129,976,755 | 0 | 0 | BSD-3-Clause | 2018-04-17T23:33:23 | 2018-04-17T23:33:23 | null | UTF-8 | C++ | false | false | 2,751 | h | ARRAYS_UTILITIES.h | //#####################################################################
// Copyright 2006-2007, Geoffrey Irving, Nipun Kwatra, Frank Losasso, Jerry Talton.
// This file is part of PhysBAM whose distribution is governed by the license contained in the accompanying file PHYSBAM_COPYRIGHT.txt.
//#####################################################################
#ifndef __ARRAYS_UTILITIES__
#define __ARRAYS_UTILITIES__
#include <PhysBAM_Tools/Arrays/ARRAYS_FORWARD.h>
#include <PhysBAM_Tools/Grids_Uniform_Arrays/GRID_ARRAYS_POLICY_UNIFORM.h>
#include <PhysBAM_Tools/Vectors/VECTOR_FORWARD.h>
namespace PhysBAM{
template<class T_GRID,class T2>
class ARRAYS_UTILITIES
{
typedef typename T_GRID::SCALAR T;typedef typename T_GRID::VECTOR_INT TV_INT;typedef typename T_GRID::VECTOR_T TV;typedef typename TV::template REBIND<T2>::TYPE TV_T2;
typedef typename GRID_ARRAYS_POLICY<T_GRID>::ARRAYS_SCALAR T_ARRAYS_SCALAR;typedef typename T_ARRAYS_SCALAR::template REBIND<T2>::TYPE T_ARRAYS_DIMENSION_T2;
typedef typename T_ARRAYS_DIMENSION_T2::template REBIND<TV_T2>::TYPE T_ARRAYS_DIMENSION_VECTOR_T2;
typedef typename GRID_ARRAYS_POLICY<T_GRID>::FACE_ARRAYS T_FACE_ARRAYS_SCALAR;
typedef typename REBIND<T_FACE_ARRAYS_SCALAR,T2>::TYPE T_FACE_ARRAYS_T2;
typedef typename REBIND<typename GRID_ARRAYS_POLICY<T_GRID>::ARRAYS_SCALAR,int>::TYPE T_ARRAYS_INT;typedef typename REBIND<typename GRID_ARRAYS_POLICY<T_GRID>::ARRAYS_SCALAR,bool>::TYPE T_ARRAYS_BOOL;
typedef typename T_GRID::NODE_ITERATOR NODE_ITERATOR;typedef typename T_GRID::CELL_ITERATOR CELL_ITERATOR;typedef typename T_GRID::FACE_ITERATOR FACE_ITERATOR;
public:
//#####################################################################
static void Make_Ghost_Mask_From_Active_Mask(const T_GRID& grid,const T_ARRAYS_BOOL& input_mask,T_ARRAYS_BOOL& output_mask,const int stencil_width,const int number_of_ghost_cells=0);
static void Compute_Face_Data_From_Cell_Data(const T_GRID& face_grid,T_FACE_ARRAYS_T2& face_array,const T_ARRAYS_DIMENSION_T2& cell_array,const int number_of_ghost_cells=0);
static void Compute_Gradient_At_Faces_From_Cell_Data(const T_GRID& face_grid,T_FACE_ARRAYS_T2& grad_face_array,const T_ARRAYS_DIMENSION_T2& cell_array,const int number_of_ghost_cells=0);
static void Compute_Gradient_At_Cells_From_Face_Data(const T_GRID& face_grid,T_ARRAYS_DIMENSION_VECTOR_T2& grad_cell_array,const T_FACE_ARRAYS_T2& face_array,const int number_of_ghost_cells=0);
static void Compute_Divergence_At_Cells_From_Face_Data(const T_GRID& face_grid,T_ARRAYS_DIMENSION_T2& div_cell_array,const T_FACE_ARRAYS_T2& face_array,const int number_of_ghost_cells=0);
//#####################################################################
};
}
#endif
|
a04c50d79ddd4e9d246bb16c1f0a6759b7bd68d5 | 077ba712c73feb4d1bbe66518338e98d5c1e040d | /projects/project_euler/15.cpp | 1852e12cb068618dae81bccc09e7ac2282d51105 | [] | no_license | devmanner/devmanner | eec4a83b1c35bbf67aecbb4860358cab7c823822 | 37f6bd1d0f7301045284cc94e37b8cb4b9005142 | refs/heads/master | 2021-01-10T19:09:19.251055 | 2019-09-20T18:46:22 | 2019-09-20T18:46:22 | 32,351,152 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 478 | cpp | 15.cpp | #include <iostream>
#define SIZE 20
unsigned long long int table[SIZE+1][SIZE+1];
using namespace std;
int main() {
for (int i = 0; i <= SIZE; ++i)
for (int j = 0; j <= SIZE; ++j)
table[i][j] = 1;
for (int i = SIZE-1; i >= 0; --i)
for (int j = SIZE-1; j >= 0; --j) {
//cout << i << " " << j << endl;
table[i][j] = table[i+1][j] + table[i][j+1];
}
cout << table[0][0] << endl;
system("PAUSE");
return 0;
}
|
cd0b30c2bc06033913e32622c536907316e446af | 44d5f40308ce067331777c9a3ff620ae87d3891e | /118. Pascal-s Triangle/src.cpp | 249f8c53cd46442047e5b9b4311c703f4403895c | [] | no_license | moaiweishui/leetcode | 7542e919a3082aed3257393d760d220dd69f025b | 748f6ccfc34aed162f4ee64a1df67c9666602779 | refs/heads/master | 2021-07-15T10:28:26.983900 | 2019-03-13T08:56:33 | 2019-03-13T08:56:33 | 97,549,732 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 928 | cpp | src.cpp | class Solution {
public:
vector<vector<int>> generate(int numRows) {
vector<vector<int>> res;
for(int i = 1; i <= numRows; i++)
{
vector<int> tmpv;
if(i == 1)
{
tmpv.push_back(1);
res.push_back(tmpv);
}
else if(i == 2)
{
tmpv.push_back(1);
tmpv.push_back(1);
res.push_back(tmpv);
}
else
{
tmpv.push_back(1);
for(int j = 1; j < i; j++)
{
if(j <= (i-1)/2)
tmpv.push_back(res[i-2][j-1] + res[i-2][j]);
else
tmpv.push_back(tmpv[i - 1 - j]);
}
res.push_back(tmpv);
}
}
return res;
}
};
|
05982ed775bc5b24f05c3627b56ec616fbc9d815 | cfeac52f970e8901871bd02d9acb7de66b9fb6b4 | /generated/src/aws-cpp-sdk-acm-pca/include/aws/acm-pca/model/CertificateAuthorityType.h | 30ad5fe1573342d62e9c305d7c40b4b1873696db | [
"Apache-2.0",
"MIT",
"JSON"
] | permissive | aws/aws-sdk-cpp | aff116ddf9ca2b41e45c47dba1c2b7754935c585 | 9a7606a6c98e13c759032c2e920c7c64a6a35264 | refs/heads/main | 2023-08-25T11:16:55.982089 | 2023-08-24T18:14:53 | 2023-08-24T18:14:53 | 35,440,404 | 1,681 | 1,133 | Apache-2.0 | 2023-09-12T15:59:33 | 2015-05-11T17:57:32 | null | UTF-8 | C++ | false | false | 713 | h | CertificateAuthorityType.h | /**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/acm-pca/ACMPCA_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace ACMPCA
{
namespace Model
{
enum class CertificateAuthorityType
{
NOT_SET,
ROOT,
SUBORDINATE
};
namespace CertificateAuthorityTypeMapper
{
AWS_ACMPCA_API CertificateAuthorityType GetCertificateAuthorityTypeForName(const Aws::String& name);
AWS_ACMPCA_API Aws::String GetNameForCertificateAuthorityType(CertificateAuthorityType value);
} // namespace CertificateAuthorityTypeMapper
} // namespace Model
} // namespace ACMPCA
} // namespace Aws
|
62c1eb3c1df4b60423561fb053ac8dc2e6579cc2 | 51500de0cd550e88a639529e4a12c02ae5506cee | /include/khutils/memoryhandler.hpp | 3b78b493e6f15a2e87798291e4ce2121e039a9d8 | [] | no_license | KageKirin/khutils | 01bdb57cc3e8a0701794e9ea64cab62012eb9c91 | 8b0e6c565acfe2b7700d494f641a76ee1c6c584c | refs/heads/master | 2020-06-14T16:27:52.125522 | 2017-07-28T14:49:26 | 2017-07-28T14:49:26 | 75,159,963 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 190 | hpp | memoryhandler.hpp | #ifndef KHUTILS_MEMORYHANDLER_HPP_INC
#define KHUTILS_MEMORYHANDLER_HPP_INC
#include "khutils/memoryreader.hpp"
#include "khutils/memorywriter.hpp"
#endif // KHUTILS_MEMORYHANDLER_HPP_INC
|
53570ee6ba928a779349d6a9fbd12f1b93a47f23 | 65cf3bce7910098405627e08b372553e48abad7d | /UVA/Volume CXVII/11709 Trust groups.cpp | 2850401765ddebc2a18c2a3b81c45fd022c6c3d6 | [] | no_license | bluemix/Online-Judge | 77275c1a3e94272a07ba10de16f1d068217b64de | 11f6c0bf1e8adf5b0136670bcebef975b7e0f3a1 | refs/heads/master | 2021-01-12T00:48:32.642462 | 2015-09-15T13:18:47 | 2015-09-15T13:18:47 | 78,298,357 | 0 | 0 | null | 2017-01-07T19:13:15 | 2017-01-07T19:13:14 | null | UTF-8 | C++ | false | false | 4,556 | cpp | 11709 Trust groups.cpp | /* 14058813 11709 Trust groups Accepted C++ 0.402 2014-08-18 07:37:57 */
// C++
#include<iostream>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<bitset>
#include<algorithm>
#include<functional>
#include<deque>
// C
#include<cstdio>
#include<cstring>
#include<ctime>
#include<cctype>
#include<cmath>
// namespace
using namespace std;
// typedef
typedef long long lli;
typedef unsigned long long ull;
// template
template<class T> T max(T a, T b, T c){ return max(a, max(b, c)); }
template<class T> T min(T a, T b, T c){ return min(a, min(b, c)); }
// const variable
#define MAX_N 1005
#define MAX_M 1000
#define INF 1e9
#define NONE -1
#define EPS 1e-6
#define NORTH 0
#define EAST 1
#define SOUTH 2
#define WEST 3
const double PI = 2.0 * acos(0.0);
const int mx[] = { 0, 1, 0, -1 };
const int my[] = { -1, 0, 1, 0 };
// main
int V[MAX_N], low[MAX_N], t;
int stack[MAX_N], top;
bool instack[MAX_N];
map<string, int> S;
vector<int> E[MAX_N];
int sccCount;
void DFS(int i){
V[i] = low[i] = t++;
stack[top++] = i;
instack[i] = true;
for (int j = 0; j < E[i].size(); j++){
int target = E[i][j];
if (V[target] == NONE)
DFS(target);
if (instack[target])
low[i] = min(low[i], low[target]);
}
if (V[i] == low[i]){
int j;
do{
j = stack[--top];
instack[j] = false;
} while (j != i);
sccCount++;
}
}
int main(){
int n, m;
while (scanf("%d%d", &n, &m) == 2){
if (n == 0 && m == 0)
break;
(void)getchar();
S.clear();
for (int i = 0; i < n; i++)
E[i].clear();
for (int i = 0; i < n; i++){
char str[1000];
gets(str);
S[str] = i;
}
for (int i = 0; i < m; i++){
char A[1000], B[1000];
gets(A);
gets(B);
int a = S[A], b = S[B];
E[a].push_back(b);
}
memset(V, NONE, sizeof(V));
memset(instack, false, sizeof(instack));
t = top = sccCount = 0;
for (int i = 0; i < n; i++)
if (V[i] == NONE)
DFS(i);
printf("%d\n", sccCount);
}
return 0;
}
/*
Trust groups
The personnel department of Association of Cookie Monsters (ACM) has noticed that the productivity of various work groups in the company is not as good as it could be. They have interviewed the employees in the affected groups and they have detected the root of the problem: trust (or, rather, the lack thereof). Some employees do not trust the rest of the group, and this is decreasing their motivation and happiness. The personnel department wants to solve this problem, and has decided to reorganize the groups so that they are stable, i.e., they are formed by people who trust each other. They have asked the employees, and they know the people each employee trusts directly. Moreover, if employee A trusts employee B and employee B trusts employee C, then employee A will trust employee C. And obviously, each employee trusts himself. They want to create as few groups as possible to reduce administration overhead (they also do not want to work too hard).
With this information they have contacted you, and asked you to write a program that finds the minimum number of stable groups that can be created.
Input
The input consists of several test cases. Each test case begins with a line containing two positive integers P and T ( 1$ \le$P$ \le$1000, 0$ \le$T$ \le$999000) separated by a single space. P lines come next, each containing the name of one person. The names will have the following format: surname, a comma, a space and first name (for example McBride, John or Smith, Peter). Both the surname and the first name will be strings of uppercase or lowercase characters (with no blanks or punctuation marks), with a maximum length of 10 characters. There will not be repetitions in the complete names of the people. After the names there will appear T blocks of 2 lines representing the trust relations between people. Each line of the block will contain the name of a person in the same format as before, and the block will mean that the person in the first line trusts the person in the second line. All people appearing in the confidence relations will have appeared in the previous list of P people.
The input will end with the ``phantom'' test case `0 0', which must not be processed.
Output
For each test case, the output will be a line containing a positive integer representing the minimum number of stable groups of people that can be formed.
Sample Input
3 2
McBride, John
Smith, Peter
Brown, Anna
Brown, Anna
Smith, Peter
Smith, Peter
Brown, Anna
3 2
McBride, John
Smith, Peter
Brown, Anna
Brown, Anna
Smith, Peter
McBride, John
Smith, Peter
0 0
Sample Output
2
3
*/ |
7a170482257b1410e740f4e2cc02f8c0e5989124 | 63f0d5f64da652073e021f6924ee8ae7badf1a02 | /Question_13/RuleOfBig5/Rule.cpp | 9a8e02b9dfa573c6976fdec72f9831840b96e4e9 | [] | no_license | Anmol-tech/OOPS | 8c5cb212af730b97e42055c861fb71a84fdb9a1b | 0fdbc9919d119bc2db95c9ac1bce05be296d07ac | refs/heads/master | 2022-06-20T19:29:20.990899 | 2020-05-04T13:17:56 | 2020-05-04T13:17:56 | 254,735,695 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,708 | cpp | Rule.cpp | #include <iostream>
#include <cstring>
using namespace std;
/*Rule of Big 5, if any of the following functions are implemented in a class
then each and everyone of them should be implemented
1. Copy Constructor
2. Copy Assignment Operator
3. Destructor
4. Move Constructor
5. Move Assignment Operator
*/
class String {
private:
char *s;
int size;
public:
String() {
s = nullptr;
}
String(char *arr) {
size = strlen(arr);
s = new char[size + 1];
strcpy(s, arr);
}
//Copy Constructor
String(String &str) {
s = str.s;
}
// Move Constructor
String(String &&st) : size(5) {
s = st.s;
size = st.size;
st.s = nullptr;
st.size = 0;
}
//Copy Assignment Operator
String operator=(String const &obj) {
String str_1;
str_1.s = obj.s;
return str_1;
}
//Move Assignment Operator
String operator=(String const &&obj) {
if (this != &obj) {
delete[] s;
String str_1;
str_1.s = obj.s;
return str_1;
}
return *this;
}
void show() {
cout << s << "\n";
}
~String();
};
//Destructor
String::~String() {
delete[]s;
}
class Console {
public:
static void details() {
cout << "\nName : Anmol Sharma\t Roll.No.14\n";
}
void input(string abc) {
String strng("abc");
String("abc");
String s("xyz");
String string1(s);
}
};
int main() {
Console con;
con.details();
String str("String Class Implementing the Rule Of Big 5");
str.show();
} |
57741dec5e2ff3e83ff1b98ceead875bd5226fa3 | 82d91363464816ef7f55778fec7971315946a648 | /Programmings/Ex 3 no 1.cpp | ad7d2118074b35eed85b8ff29bca37e701a82acd | [] | no_license | hekambk201/Practice | 737bce936aac31c217f1ee8d1011d68c30486403 | c7504baeffc181fef1a5ef442e290f7a8e9f7d3f | refs/heads/main | 2023-03-30T08:54:35.597773 | 2021-04-06T16:22:18 | 2021-04-06T16:22:18 | 355,254,479 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 731 | cpp | Ex 3 no 1.cpp | /********************************
* Name:Sheikh Mesba Ul Hekam *
* Matric:A17CS4035 *
* Section:3 *
* Date:16/03/18 *
* *
********************************/
#include<iostream>
using namespace std;
int main()
{
int length;
int width;
int area;
cout << " Please enter the length of the rectangle ";
cin >> length;
cout << " Please enter the width of the rectangle ";
cin >> width;
area=length*width;
cout << " The area of the rectangle is " << area << endl;
if (area<=10)
cout << " The size is accepted ";
else
cout << " The size is not accepted ";
return 0;
}
|
110d9721408284792813897a6e9fb330e316d333 | f9a0ca7253c4ee9f077c29d7577cacf1acb58173 | /processor/top.cpp | c806310c87bce95a4d29c3a8e331cdfe6f0ef4d3 | [] | no_license | 12000/systemC | 50fc68d31b75c8a0941f3592e7ecfe170c5f4e43 | 056ae9543152215494d38f84a0479901346313aa | refs/heads/master | 2021-01-18T22:15:01.443878 | 2017-06-23T01:21:32 | 2017-06-23T01:21:32 | 84,374,902 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 191 | cpp | top.cpp | #include "top.h"
void top::GPIO_process(){
GPI_reg = 0;
GPO = 0;
wait();
while(true){
GPI_reg = GPI.read();
GPO = data_ron_in.read();
wait();
}
}
|
ef2e86a6b23afb19e794249e6c326e8ca5f2e263 | 6c6c161183b2538d1fc3851ada93a9468ea7a3cb | /source/environment.cpp | 509ab973b62a5a0532f4a380c340033ff4d2831d | [] | no_license | ivanhkingman/MDP | 53e1a0d64651a76836dee632fa3275a8e2d549e9 | 56e9fe858d4b904093a83e47c05063f907ceaf0c | refs/heads/master | 2023-01-06T10:22:24.501064 | 2020-11-03T12:01:51 | 2020-11-03T12:01:51 | 301,673,512 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 895 | cpp | environment.cpp | #include "environment.hpp"
Environment::Environment() {
}
Environment::~Environment() {
}
void Environment::reactToAction(action action) {
cout << "Environment reacting to action" << endl;
}
double Environment::giveReward() {
return m_R.at(m_state);
}
state Environment::getState() {
return m_state;
}
void Environment::generateRandomRewardMap(int from, int to) {
// cout << "Random rewardmap being generated... " << endl;
rewardMap R;
for (auto it = m_S.begin(); it != m_S.end(); it++) {
int reward = rand() % to + from;
R.insert(pair<state, double>(*it, reward));
}
m_R = R;
}
void Environment::display() {
cout << "Using base implementation of display" << endl;
}
//! Creates a perfect MDP model by copying the inner workings of the environment
MDP Environment::stealMdp(){
MDP mdp(m_S, m_T, m_A, m_R);
return mdp;
}
|
69058d82368bf04fefd750b8e2e42f3d76b4acfa | fc6c056053937c2c6ca23d0a49e00f436891aced | /Wk7/symArrays.cpp | 649d682731047544e7cdb3812f4319f45aa5e0cd | [] | no_license | jasoncearley/CS161 | 2accb88e5de30f2d7900ba884917dd953ac17442 | 5904af0d4fade479c89c9536628a8235d1333072 | refs/heads/master | 2020-12-24T18:33:06.490440 | 2016-04-23T16:21:37 | 2016-04-23T16:21:37 | 56,928,957 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 4,393 | cpp | symArrays.cpp | /**********************************************************************
* Program: symArrays.cpp
* Author: Jason Cearley
* Class: CS161
* Date: 11/14/14
* Modified: 11/14/14
* Description: This program allows the user to use command line
* arguments to specify the sizes of 3 1D int arrays. It
* will then dynamically allocate the arrays using new.
* The user will enter the integers for each element in
* each array on a single line with whitespace separated
* values. The program will print out whether each array
* is symmetric or not.
* Output: Whether each array is symmetric.
* *******************************************************************/
#include <iostream> // cin/cout
#include <limits> // limits
#include <string> // strings
#include <cstdlib> // atoi
#include <iomanip> // setw
using namespace std;
// Prototype Function(s)
int *create_array(int);
void fill_array(int*, int);
bool check_array(int*, int);
int main(int argc, char *argv[])
{
// End program if user did not supply correct # of arguments
if (argv[4])
{
cout << "You didn't enter the correct number of arguments."
<< endl;
return 0;
}
int array1_size = 0, *array1, // Est array 1 size and ptr
array2_size = 0, *array2, // Est array 2 size and ptr
array3_size = 0, *array3; // Est array 3 size and ptr
array1_size = atoi(argv[1]); // Convert argument 1 to an int
array2_size = atoi(argv[2]); // Convert argument 2 to an int
array3_size = atoi(argv[3]); // Convert argument 3 to an int
// Call func to make array of correct size and return its addy
array1 = create_array(array1_size);
array2 = create_array(array2_size);
array3 = create_array(array3_size);
// Call func to get user's input for each array
fill_array (array1, array1_size);
fill_array (array2, array2_size);
fill_array (array3, array3_size);
cout << endl;
cout << "Array 1 is ";
if (check_array(array1, array1_size))
{
cout << "Symmetric." << endl;
}
else
{
cout << "Not Symmetric." << endl;
}
delete [] array1;
array1 = 0;
cout << "Array 2 is ";
if (check_array(array2, array2_size))
{
cout << "Symmetric." << endl;
}
else
{
cout << "Not Symmetric." << endl;
}
delete [] array2;
cout << "Array 3 is ";
if (check_array(array3, array3_size))
{
cout << "Symmetric." << endl;
}
else
{
cout << "Not Symmetric." << endl;
}
delete [] array3;
return 0;
}
/***********************************************************************
* This function will create a dynamic 1D array on the heap and returns
* its address for use.
**********************************************************************/
int *create_array(int size)
{
return new int[size];
}
/***********************************************************************
* This function will fill the array with the user's input and validate
* it.
**********************************************************************/
void fill_array (int array[], int size)
{
static int count = 1;
bad:
cout << "Please enter your numbers for array " << count
<< " with a space separating each value." << endl;
// For loop to fill 1D array
for (int col = 0; col < size; col++)
{
cin >> array[col];
// Ensure user didn't supply wrong data type
if (!cin)
{
cin.clear();
cin.ignore(numeric_limits<streamsize>::max(), '\n');
cout << "That was not a valid entry. Please try again. ";
goto bad;
}
}
// Ensure user did not supply too many #'s for their array
if (cin.peek() != 10)
{
cout << "You entered too many numbers for this array. " << endl;
cin.ignore(numeric_limits<streamsize>::max(), '\n');
goto bad;
}
// Increment count to display array #
count++;
}
/***********************************************************************
* This function checks the dynamic array to see if it is symmetric.
**********************************************************************/
bool check_array(int array[], int size)
{
// Check for symmetry in an odd # array
if (size % 2 != 0)
{
for (int a = 0, b = (size - 1); a != b; a++, b--)
{
if (array[a] != array[b])
{
return false;
}
}
}
// Check for symmetry in an even # array
else
{
for (int a = 0, b = (size - 1); a < (size / 2); a++, b--)
{
if (array[a] != array[b])
{
return false;
}
}
}
return true;
}
|
bbcd93e0c67402f2c5536c6919a2e73289181fe0 | ef4f900663ad3afd74d71fa09bdb92fba9c8f6ad | /zzz-test/TestCppAllInOne/TestCppAllInOne/TestWTS.h | 1f892e51f1d2299c901359894923b75621169a42 | [] | no_license | smartmaster/-MyCommonLibs | 1ef67544950268c30fd88afe60317d01bd8e23f7 | 72d9fed8ecbeaffd59959d79600c50a330e5d3b8 | refs/heads/master | 2020-12-15T01:08:22.488903 | 2020-08-02T08:50:41 | 2020-08-02T08:50:41 | 234,933,939 | 5 | 4 | null | null | null | null | UTF-8 | C++ | false | false | 15,504 | h | TestWTS.h | #pragma once
#include <tchar.h>
#include <windows.h>
#include <atlbase.h>
#include <atlstr.h>
#include <atlsecurity.h>
#include <Wtsapi32.h>
#include <aclapi.h>
#include <vector>
#include "CodeBlock.h"
#include "log.h"
namespace Smartlib
{
class CTestWTS
{
public:
static HRESULT Case7_WinSec()
{
DWORD dwRes, dwDisposition;
PSID pEveryoneSID = NULL, pAdminSID = NULL;
PACL pACL = NULL;
PSECURITY_DESCRIPTOR pSD = NULL;
EXPLICIT_ACCESS ea[2];
SID_IDENTIFIER_AUTHORITY SIDAuthWorld =
SECURITY_WORLD_SID_AUTHORITY;
SID_IDENTIFIER_AUTHORITY SIDAuthNT = SECURITY_NT_AUTHORITY;
SECURITY_ATTRIBUTES sa;
LONG lRes;
HKEY hkSub = NULL;
// Create a well-known SID for the Everyone group.
if (!AllocateAndInitializeSid(&SIDAuthWorld, 1,
SECURITY_WORLD_RID,
0, 0, 0, 0, 0, 0, 0,
&pEveryoneSID))
{
_tprintf(_T("AllocateAndInitializeSid Error %u\n"), GetLastError());
goto Cleanup;
}
// Initialize an EXPLICIT_ACCESS structure for an ACE.
// The ACE will allow Everyone read access to the key.
ZeroMemory(&ea, 2 * sizeof(EXPLICIT_ACCESS));
ea[0].grfAccessPermissions = KEY_READ;
ea[0].grfAccessMode = SET_ACCESS;
ea[0].grfInheritance = NO_INHERITANCE;
ea[0].Trustee.TrusteeForm = TRUSTEE_IS_SID;
ea[0].Trustee.TrusteeType = TRUSTEE_IS_WELL_KNOWN_GROUP;
ea[0].Trustee.ptstrName = (LPTSTR)pEveryoneSID;
// Create a SID for the BUILTIN\Administrators group.
if (!AllocateAndInitializeSid(&SIDAuthNT, 2,
SECURITY_BUILTIN_DOMAIN_RID,
DOMAIN_ALIAS_RID_ADMINS,
0, 0, 0, 0, 0, 0,
&pAdminSID))
{
_tprintf(_T("AllocateAndInitializeSid Error %u\n"), GetLastError());
goto Cleanup;
}
// Initialize an EXPLICIT_ACCESS structure for an ACE.
// The ACE will allow the Administrators group full access to
// the key.
ea[1].grfAccessPermissions = KEY_ALL_ACCESS;
ea[1].grfAccessMode = SET_ACCESS;
ea[1].grfInheritance = NO_INHERITANCE;
ea[1].Trustee.TrusteeForm = TRUSTEE_IS_SID;
ea[1].Trustee.TrusteeType = TRUSTEE_IS_GROUP;
ea[1].Trustee.ptstrName = (LPTSTR)pAdminSID;
// Create a new ACL that contains the new ACEs.
dwRes = SetEntriesInAcl(2, ea, NULL, &pACL);
if (ERROR_SUCCESS != dwRes)
{
_tprintf(_T("SetEntriesInAcl Error %u\n"), GetLastError());
goto Cleanup;
}
// Initialize a security descriptor.
pSD = (PSECURITY_DESCRIPTOR)LocalAlloc(LPTR,
SECURITY_DESCRIPTOR_MIN_LENGTH);
if (NULL == pSD)
{
_tprintf(_T("LocalAlloc Error %u\n"), GetLastError());
goto Cleanup;
}
if (!InitializeSecurityDescriptor(pSD,
SECURITY_DESCRIPTOR_REVISION))
{
_tprintf(_T("InitializeSecurityDescriptor Error %u\n"),
GetLastError());
goto Cleanup;
}
// Add the ACL to the security descriptor.
if (!SetSecurityDescriptorDacl(pSD,
TRUE, // bDaclPresent flag
pACL,
FALSE)) // not a default DACL
{
_tprintf(_T("SetSecurityDescriptorDacl Error %u\n"),
GetLastError());
goto Cleanup;
}
// Initialize a security attributes structure.
sa.nLength = sizeof(SECURITY_ATTRIBUTES);
sa.lpSecurityDescriptor = pSD;
sa.bInheritHandle = FALSE;
// Use the security attributes to set the security descriptor
// when you create a key.
//lRes = RegCreateKeyEx(HKEY_CURRENT_USER, _T("mykey"), 0, _T(""), 0,
// KEY_READ | KEY_WRITE, &sa, &hkSub, &dwDisposition);
//_tprintf(_T("RegCreateKeyEx result %u\n"), lRes);
Cleanup:
if (pEveryoneSID)
FreeSid(pEveryoneSID);
if (pAdminSID)
FreeSid(pAdminSID);
if (pACL)
LocalFree(pACL);
if (pSD)
LocalFree(pSD);
if (hkSub)
RegCloseKey(hkSub);
return S_OK;
}
static HRESULT Case6_WTSGetters()
{
HRESULT hr = S_OK;
DWORD LastError = 0;
BEGIN_BLOCK(0);
//////////////////////////////////////////////////////////////////////////
DWORD acid = ::WTSGetActiveConsoleSessionId();
SML_LOG_LINE(TEXT("WTSGetActiveConsoleSessionId=[%d]"), acid);
//////////////////////////////////////////////////////////////////////////
ULONG SessionId = -1;
BOOL ok = ::WTSGetChildSessionId(
&SessionId//_Out_ ULONG * pSessionId
);
if (!ok)
{
LastError = ::GetLastError();
hr = HRESULT_FROM_WIN32(LastError);
SML_LOG_LINE(TEXT("[%s] failed with LastError=[%d], hr=[0x%08x]"), TEXT("WTSGetChildSessionId"), LastError, hr);
}
SML_LOG_LINE(TEXT("WTSGetChildSessionId=[%d]"), SessionId);
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
END_BLOCK(0);
return hr;
}
static HRESULT Case5_WTSEnumerateSessionsEx()
{
using namespace std;
HRESULT hr = S_OK;
DWORD LastError = 0;
BEGIN_BLOCK(0);
//////////////////////////////////////////////////////////////////////////
PWTS_SESSION_INFO_1 pResult = nullptr;
DWORD Level = 1;
DWORD Count = 0;
BOOL ok = ::WTSEnumerateSessionsEx(
WTS_CURRENT_SERVER_HANDLE,//_In_ HANDLE hServer,
&Level,//_Inout_ DWORD * pLevel,
0,//_In_ DWORD Filter,
&pResult,//_Out_ PWTS_SESSION_INFO_1 * ppSessionInfo,
&Count//,//_Out_ DWORD * pCount
);
if (!ok)
{
LastError = ::GetLastError();
hr = HRESULT_FROM_WIN32(LastError);
SML_LOG_LINE(TEXT("[%s] failed with LastError=[%d], hr=[0x%08x]"), TEXT("WTSEnumerateSessionsEx"), LastError, hr);
LEAVE_BLOCK(0);
}
for (int ii = 0; ii < Count; ++ii)
{
SML_LOG_LINE(TEXT("ExecEnvId=[%d]\t SessionId=[%d]\t State=[%d]\t pSessionName=[%s]\t pHostName=[%s]\t pUserName=[%s]\t pDomainName=[%s]\t pFarmName=[%s]\t"),
pResult[ii].ExecEnvId,
pResult[ii].SessionId,
pResult[ii].State,
pResult[ii].pSessionName,
pResult[ii].pHostName,
pResult[ii].pUserName,
pResult[ii].pDomainName,
pResult[ii].pFarmName
);
}
::WTSFreeMemoryEx(WTSTypeSessionInfoLevel1, pResult, Count);
pResult = nullptr;
//////////////////////////////////////////////////////////////////////////
END_BLOCK(0);
return hr;
}
static HRESULT Case4_WTSEnumerateSessions()
{
using namespace std;
HRESULT hr = S_OK;
DWORD LastError = 0;
BEGIN_BLOCK(0);
//////////////////////////////////////////////////////////////////////////
PWTS_SESSION_INFO pResult = nullptr;
DWORD Level = 1;
DWORD Count = 0;
BOOL ok = ::WTSEnumerateSessions(
WTS_CURRENT_SERVER_HANDLE,//_In_ LPTSTR pDomainName,
0,//_In_ DWORD Reserved,
1,//_In_ DWORD Version,
&pResult,//PWTS_SERVER_INFO * ppServerInfo,
&Count//DWORD * pCount
);
if (!ok)
{
LastError = ::GetLastError();
hr = HRESULT_FROM_WIN32(LastError);
SML_LOG_LINE(TEXT("[%s] failed with LastError=[%d], hr=[0x%08x]"), TEXT("WTSEnumerateSessions"), LastError, hr);
LEAVE_BLOCK(0);
}
for (int ii = 0; ii < Count; ++ii)
{
SML_LOG_LINE(TEXT("SessionId=[%d]\t State=[%d]\t WinStationName=[%s]\t"), pResult[ii].SessionId, pResult[ii].State, pResult[ii].pWinStationName);
}
::WTSFreeMemory(pResult);
pResult = nullptr;
//////////////////////////////////////////////////////////////////////////
END_BLOCK(0);
return hr;
}
static HRESULT Case3_WTSEnumerateServers()
{
using namespace std;
HRESULT hr = S_OK;
DWORD LastError = 0;
BEGIN_BLOCK(0);
//////////////////////////////////////////////////////////////////////////
PWTS_SERVER_INFO pResult = nullptr;
DWORD Level = 1;
DWORD Count = 0;
TCHAR domain[] = TEXT("arcserve.com");
BOOL ok = ::WTSEnumerateServers(
domain,//_In_ LPTSTR pDomainName,
0,//_In_ DWORD Reserved,
1,//_In_ DWORD Version,
&pResult,//PWTS_SERVER_INFO * ppServerInfo,
&Count//DWORD * pCount
);
if (!ok)
{
LastError = ::GetLastError();
hr = HRESULT_FROM_WIN32(LastError);
SML_LOG_LINE(TEXT("[%s] failed with LastError=[%d], hr=[0x%08x]"), TEXT("WTSEnumerateServers"), LastError, hr);
LEAVE_BLOCK(0);
}
for (int ii = 0; ii < Count; ++ii)
{
SML_LOG_LINE(TEXT("ServerName=[%s]"), pResult[ii].pServerName);
}
::WTSFreeMemory(pResult);
pResult = nullptr;
//////////////////////////////////////////////////////////////////////////
END_BLOCK(0);
return hr;
}
static HRESULT Case2_WTSEnumerateProcessesEx()
{
using namespace std;
HRESULT hr = S_OK;
DWORD LastError = 0;
BEGIN_BLOCK(0);
//////////////////////////////////////////////////////////////////////////
PWTS_PROCESS_INFO_EX pProcessInfo = nullptr;
DWORD Level = 1;
DWORD Count = 0;
BOOL ok = ::WTSEnumerateProcessesEx(
WTS_CURRENT_SERVER_HANDLE,//_In_ HANDLE hServer,
&Level,//_Inout_ DWORD * pLevel,
WTS_ANY_SESSION,//_In_ DWORD SessionID,
(LPTSTR*)&pProcessInfo,//_Out_ LPTSTR * ppProcessInfo,
&Count//,//_Out_ DWORD * pCount
);
if (!ok)
{
LastError = ::GetLastError();
hr = HRESULT_FROM_WIN32(LastError);
SML_LOG_LINE(TEXT("[%s] failed with LastError=[%d], hr=[0x%08x]"), TEXT("WTSEnumerateProcesses"), LastError, hr);
LEAVE_BLOCK(0);
}
for (int ii = 0; ii < Count; ++ii)
{
if (pProcessInfo[ii].pUserSid)
{
CSid sid; //(pProcessInfo[ii].pUserSid);
sid.LoadAccount((const SID*)pProcessInfo[ii].pUserSid);
SML_LOG_LINE(TEXT("[%d]\t\t[%d]\t\t[%s]\t\t\t\t[%s\\%s]"), pProcessInfo[ii].ProcessId, pProcessInfo[ii].SessionId, pProcessInfo[ii].pProcessName, sid.Domain(), sid.AccountName());
}
else
{
SML_LOG_LINE(TEXT("[%d]\t\t[%d]\t\t[%s]"), pProcessInfo[ii].ProcessId, pProcessInfo[ii].SessionId, pProcessInfo[ii].pProcessName);
}
}
WTSFreeMemoryEx(WTSTypeProcessInfoLevel1, pProcessInfo, Count);
pProcessInfo = nullptr;
//////////////////////////////////////////////////////////////////////////
END_BLOCK(0);
return hr;
}
static HRESULT Case1_WTSEnumerateProcesses()
{
using namespace std;
HRESULT hr = S_OK;
DWORD LastError = 0;
BEGIN_BLOCK(0);
//////////////////////////////////////////////////////////////////////////
PWTS_PROCESS_INFO pProcessInfo = nullptr;
DWORD Count = 0;
BOOL ok = ::WTSEnumerateProcesses(
WTS_CURRENT_SERVER_HANDLE,//_In_ HANDLE hServer,
0,//_In_ DWORD Reserved,
1,//_In_ DWORD Version,
&pProcessInfo,//_Out_ PWTS_PROCESS_INFO * ppProcessInfo,
&Count//_Out_ DWORD * pCount
);
if (!ok)
{
LastError = ::GetLastError();
hr = HRESULT_FROM_WIN32(LastError);
SML_LOG_LINE(TEXT("[%s] failed with LastError=[%d], hr=[0x%08x]"), TEXT("WTSEnumerateProcesses"), LastError, hr);
LEAVE_BLOCK(0);
}
for (int ii = 0; ii < Count; ++ ii)
{
if (pProcessInfo[ii].pUserSid)
{
CSid sid; //(pProcessInfo[ii].pUserSid);
sid.LoadAccount((const SID*)pProcessInfo[ii].pUserSid);
SML_LOG_LINE(TEXT("[%d]\t\t[%d]\t\t[%s]\t\t[%s\\%s]"), pProcessInfo[ii].ProcessId, pProcessInfo[ii].SessionId, pProcessInfo[ii].pProcessName, sid.Domain(), sid.AccountName());
}
else
{
SML_LOG_LINE(TEXT("[%d]\t\t[%d]\t\t[%s]"), pProcessInfo[ii].ProcessId, pProcessInfo[ii].SessionId, pProcessInfo[ii].pProcessName);
}
}
WTSFreeMemory(pProcessInfo);
pProcessInfo = nullptr;
//////////////////////////////////////////////////////////////////////////
END_BLOCK(0);
return hr;
}
static HRESULT Case0_WTSEnumerateListeners()
{
using namespace std;
HRESULT hr = S_OK;
DWORD LastError = 0;
BEGIN_BLOCK(0);
//////////////////////////////////////////////////////////////////////////
DWORD count = 0;
BOOL ok = ::WTSEnumerateListeners(
WTS_CURRENT_SERVER_HANDLE,//_In_ HANDLE hServer,
nullptr,//_In_ PVOID pReserved,
0,//_In_ DWORD Reserved,
nullptr,//_Out_opt_ PWTSLISTENERNAME pListeners,
&count//_Inout_ DWORD * pCount
);
if (!ok)
{
LastError = ::GetLastError();
hr = HRESULT_FROM_WIN32(LastError);
if (ERROR_INSUFFICIENT_BUFFER != LastError)
{
SML_LOG_LINE(TEXT("[%s] failed with LastError=[%d], hr=[0x%08x]"), TEXT("WTSEnumerateListeners"), LastError, hr);
LEAVE_BLOCK(0);
}
}
vector<WTSLISTENERNAME> names{ count };
ok = ::WTSEnumerateListeners(
WTS_CURRENT_SERVER_HANDLE,//_In_ HANDLE hServer,
nullptr,//_In_ PVOID pReserved,
0,//_In_ DWORD Reserved,
&names[0],//_Out_opt_ PWTSLISTENERNAME pListeners,
&count//_Inout_ DWORD * pCount
);
if (!ok)
{
LastError = ::GetLastError();
hr = HRESULT_FROM_WIN32(LastError);
SML_LOG_LINE(TEXT("[%s] failed with LastError=[%d], hr=[0x%08x]"), TEXT("WTSEnumerateListeners"), LastError, hr);
LEAVE_BLOCK(0);
}
for (const auto& item : names)
{
SML_LOG_LINE(TEXT("Listeners: %s"), item);
}
for (const auto& item : names)
{
DWORD nLengthNeeded = 0;
ok = ::WTSGetListenerSecurity(
WTS_CURRENT_SERVER_HANDLE,//_In_ HANDLE hServer,
nullptr,//_In_ PVOID pReserved,
0,//_In_ DWORD Reserved,
(LPTSTR)item,//_In_ LPTSTR pListenerName,
DACL_SECURITY_INFORMATION | SACL_SECURITY_INFORMATION,//_In_ SECURITY_INFORMATION SecurityInformation,
nullptr,//_Out_opt_ PSECURITY_DESCRIPTOR pSecurityDescriptor,
0,//_In_ DWORD nLength,
&nLengthNeeded//,//_Out_ LPDWORD lpnLengthNeeded
);
if (!ok)
{
LastError = ::GetLastError();
hr = HRESULT_FROM_WIN32(LastError);
if (ERROR_INSUFFICIENT_BUFFER != LastError)
{
SML_LOG_LINE(TEXT("[%s] failed with LastError=[%d], hr=[0x%08x]"), TEXT("WTSGetListenerSecurity"), LastError, hr);
continue;
}
}
vector<BYTE> sdbuffer;
sdbuffer.resize(nLengthNeeded);
ok = ::WTSGetListenerSecurity(
WTS_CURRENT_SERVER_HANDLE,//_In_ HANDLE hServer,
nullptr,//_In_ PVOID pReserved,
0,//_In_ DWORD Reserved,
(LPTSTR)item,//_In_ LPTSTR pListenerName,
DACL_SECURITY_INFORMATION | SACL_SECURITY_INFORMATION,//_In_ SECURITY_INFORMATION SecurityInformation,
&sdbuffer[0],//_Out_opt_ PSECURITY_DESCRIPTOR pSecurityDescriptor,
sdbuffer.size(),//_In_ DWORD nLength,
&nLengthNeeded//,//_Out_ LPDWORD lpnLengthNeeded
);
if (!ok)
{
LastError = ::GetLastError();
hr = HRESULT_FROM_WIN32(LastError);
SML_LOG_LINE(TEXT("[%s] failed with LastError=[%d], hr=[0x%08x]"), TEXT("WTSGetListenerSecurity"), LastError, hr);
continue;
}
SECURITY_DESCRIPTOR* psd = (SECURITY_DESCRIPTOR*)&sdbuffer[0];
CSecurityDesc sd(*psd);
CString sdstr;
sd.ToString(&sdstr);
SML_LOG_LINE(TEXT("WTSListener=[%s]\t SECURITY_DESCRIPTOR=[%s]\t "), item, sdstr.GetString());
}
//////////////////////////////////////////////////////////////////////////
END_BLOCK(0);
return hr;
}
};
} |
1a80d0f8ecbbc62656dffaa674f7ad17150aae01 | db63089c4f1b55dde3fd1685bcfea978168257b6 | /test/cuBERT/op/DenseTest.cpp | 5ccb88eed090bf21009fed1b80cc68efd1cdfcba | [
"MIT"
] | permissive | loretoparisi/cuBERT | 49d233125f0709556212bfcbf8c0fbb2847af78b | 8ab038415bda11c1cd715db2bc618a430d6093c1 | refs/heads/master | 2020-05-03T02:47:51.545302 | 2019-03-26T06:00:46 | 2019-03-26T06:00:46 | 178,380,180 | 1 | 0 | MIT | 2019-03-29T09:59:44 | 2019-03-29T09:59:44 | null | UTF-8 | C++ | false | false | 1,059 | cpp | DenseTest.cpp | #include "gtest/gtest.h"
#include "../common_test.h"
#include "cuBERT/op/Dense.h"
using namespace cuBERT;
TEST_F(CommonTest, dense) {
float kernel[6] = {1, 2, 3, 4, 5, 6};
float bias[3] = {-3, -2, -1};
Dense<float> dense(handle, 2, 3, kernel, bias, 16);
float input[6] = {1, 2, 3, 4, 5, 6};
float *input_gpu = (float*) cuBERT::malloc(6 * sizeof(float));
cuBERT::memcpy(input_gpu, input, 6 * sizeof(float), 1);
float *output_gpu = (float*) cuBERT::malloc(9 * sizeof(float));
dense.compute(3, input_gpu, output_gpu);
float output[9];
cuBERT::memcpy(output, output_gpu, sizeof(float) * 9, 2);
cuBERT::free(output_gpu);
cuBERT::free(input_gpu);
EXPECT_FLOAT_EQ(output[0], 9 - 3);
EXPECT_FLOAT_EQ(output[1], 12 - 2);
EXPECT_FLOAT_EQ(output[2], 15 - 1);
EXPECT_FLOAT_EQ(output[3], 19 - 3);
EXPECT_FLOAT_EQ(output[4], 26 - 2);
EXPECT_FLOAT_EQ(output[5], 33 - 1);
EXPECT_FLOAT_EQ(output[6], 29 - 3);
EXPECT_FLOAT_EQ(output[7], 40 - 2);
EXPECT_FLOAT_EQ(output[8], 51 - 1);
}
|
1fe5aa9e46055001e0cfb417f05908a5cf8c114c | 7d432736032684a71e75cbd22280b38ad437a245 | /wave.hpp | ea03de3ac9de1e45b9918f73b95b5d48428f9a5d | [] | no_license | jaymzee/dsp | 21744bb09dd987753eeb0abd81b1887bd4a5da50 | e9a82111e3532efda34cc3d4841039efde6d41d5 | refs/heads/master | 2023-06-23T10:46:47.486144 | 2021-07-28T18:41:40 | 2021-07-28T18:41:40 | 288,207,808 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 793 | hpp | wave.hpp | #ifndef DSP_WAVE_HPP_INCLUDED
#define DSP_WAVE_HPP_INCLUDED
extern "C" {
#include "wave.h"
}
#include "filter.hpp"
namespace dsp {
/* callback for wave_filter()
*/
inline double FilterWavProcessSample(Filter *f, double x) {
return f->ProcessSample(x);
}
/* FilterWav() C++ wrapper for wave_filter()
* infile: filename of input wav file
* outfile: filename of output wav file
* format: output wav file format type
* duration: length of time to use input wav file as the source
*/
inline int FilterWav(const char *infile, const char *outfile,
Filter* f, int format, double duration) {
return wave_filter(infile, outfile,
(filter_func)FilterWavProcessSample, f,
format, duration);
}
} // namespace dsp
#endif
|
24ed9fd57a5e3be6c8dd76e21a02dcea74ea7df9 | 74d6dee020b42d76dc7137748c0c0d7cabb93469 | /FileDescription.cpp | 36720d30f0b5338443c3579f1e9875bd447a8fc1 | [
"Apache-2.0"
] | permissive | chrisjiang666/imzMLParser | 8837723eae2abff4db81ff41cf5d693c5a71db08 | 1b9bc7f0b09bdeca9c8427448baed53483ce64e7 | refs/heads/master | 2020-03-19T13:48:03.929903 | 2014-07-28T14:49:00 | 2014-07-28T14:49:00 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,828 | cpp | FileDescription.cpp | /*
*
* Copyright 2013 Alan Race
*
* 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.
*
*
*/
/*
* FileDescription.cpp
*
* Created on: 2 Nov 2012
* Author: alan
*/
#include "FileDescription.h"
namespace ImzML {
FileDescription::FileDescription() {
}
void FileDescription::setFileContent(boost::shared_ptr<ImzML::FileContent> fileContent) {
this->fileContent = fileContent;
}
void FileDescription::setSourceFileList(boost::shared_ptr<ImzML::SourceFileList> sourceFileList) {
this->sourceFileList = sourceFileList;
}
std::ostream& operator<<(std::ostream& os, const ImzML::FileDescription& fileDescription) {
for(int j = 0; j < fileDescription.indent; j++)
os << fileDescription.indentString;
os << "<fileDescription>" << std::endl;
fileDescription.indent++;
if(fileDescription.fileContent)
os << *fileDescription.fileContent << std::endl;
if(fileDescription.sourceFileList)
os << *fileDescription.sourceFileList << std::endl;
for(ImzML::FileDescription::contacts_type::size_type i = 0; i < fileDescription.contacts.size(); i++)
os << fileDescription.contacts[i] << std::endl;
fileDescription.indent--;
for(int j = 0; j < fileDescription.indent; j++)
os << fileDescription.indentString;
os << "</fileDescription>";
return os;
}
}
|
4ceb8c4c2a301bfd8c32dd778fc24e7d8102558a | fffee27b0b19264e8d83dfd727c87488921fdd0c | /Assignment1a - cplusplus/Assignment1aHelloWorld/twoDArray.cpp | c99d0513607849f274e3274bb60a67df27bf4745 | [] | no_license | teslagosu/D0037D | fc690272cf1f18d52c5051faa805c4864e882157 | 182bd530c2706822425e185645300cba83f358c7 | refs/heads/master | 2020-09-08T06:57:13.530136 | 2019-11-11T19:15:09 | 2019-11-11T19:15:09 | 221,051,912 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,915 | cpp | twoDArray.cpp | #include "pch.h"
#include <iostream>
#include <string>
using namespace std;
void createArray() {
//local variabels row and col
int row;
int col;
//ask user for number of rows
cout << "Number of rows: " << endl;
//get input and declare row
cin >> row;
//ask user for number of columns
cout << "Number of columns: " << endl;
//get input and declare columns
cin >> col;
//pointer of a pointer to an int
int ** array2D = new int*[row];
// make the array to an 2d array at each index.
for (int i = 0; i < row; i++) {
array2D[i] = new int[col];
}
//fill the array with random numbers and modulo 10 on them so we get 1-9.
for (int i = 0; i < row; i++) {
for (int j = 0; j < col; j++) {
array2D[i][j] = rand() % 10;
if (array2D[i][j] == 0) {
array2D[i][j] = rand() % 10;
}
}
}
//call the printOutRows and columns function and pass array2d,row and col as arguments.
printOutRowsAndColumns(array2D, row, col);
//delete the 2darray
delete[] array2D;
}
//function that prints out rows and columns.
void printOutRowsAndColumns(int **array, int row, int col) {
//local variables
int sum = 0;
int total = 0;
int x = 0;
//calculate the sum of each row, col and print out the elements in each index.
for (int i = 0; i < row; i++) {
for (int j = 0; j < col; j++) {
sum += array[i][j];
cout << array[i][j] << "\t";
}
//add the sums to total
total += sum;
//print out the sum
cout << sum << endl;
//set sum to 0 so we can get a new sum when it starts to iterate again
sum = 0;
}
// print out columns and the calculated sums(x)
for (int i = 0; i < col; i++) {
for (int j = 0; j < row; j++) {
x += array[j][i];
}
//add the sums(x) to total
total += x;
//print out the sum
cout << x << "\t";
//set x to 0 so we can get a new sum(x) when it starts to iterate again
x = 0;
}
//print out the total of all elements.
cout << total << endl;
} |
87b01186ec5c31f8ae26aff7ef05afb2c9b7b375 | dd170e479ada188343d574c9df4c8a36cf1ff025 | /ArduinoVS/VS_Stepper_Promicro/VS_Stepper_Promicro/stepper_uln.h | b723563f67edd4b037ea883efa868d2e6a4b13f8 | [] | no_license | kimphg/arduinoIMU | a4673e694eb37a4680e9864dfda8e31d33007581 | d69c75ab86696f2e41bd08d0170452b24b1ce1c4 | refs/heads/master | 2021-09-08T01:01:45.106799 | 2018-03-04T23:04:49 | 2018-03-04T23:04:49 | 104,658,998 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 696 | h | stepper_uln.h | // stepper_uln.h
#ifndef _STEPPER_ULN_h
#define _STEPPER_ULN_h
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
/*
BYJ48 Stepper motor code
Connect :
IN1 >> D8
IN2 >> D9
IN3 >> D10
IN4 >> D11
VCC ... 5V Prefer to use external 5V Source
Gnd
written By :Mohannad Rawashdeh
https://www.instructables.com/member/Mohannad+Rawashdeh/
28/9/2013
*/
class StepperMicro
{
public:
StepperMicro(int i1, int i2, int i3, int i4);
~StepperMicro();
void UpdateDirection();
void Step(int xw);
void Step();
void Update();
float acc , speed ;
private:
unsigned long last_time;
unsigned long currentMillis;
int IN1, IN2, IN3, IN4;
int Steps;
};
#endif
|
25c9b128a6e879af4ebf032a6115900f7a12a0cf | b93bd9183ce0064735651b8bca1f700ef02826e7 | /1至n中取r个数的所有组合/1至n中取r个数的所有组合/1至n中取r个数的所有组合.cpp | ee60e57e99103c3053f3d2f3572f6a5946825cb6 | [] | no_license | qianguangyuan/PAT- | 4d404fa7fa887b6658da37ff3a63482bb34379cc | 1eda7de7c039a5eb17d9e6e082d022e5e8ced1df | refs/heads/master | 2023-01-12T06:51:16.755672 | 2020-11-08T13:10:00 | 2020-11-08T13:10:00 | 311,057,689 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,079 | cpp | 1至n中取r个数的所有组合.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
int n;//自然数的个数
int r;
int* com;//存放一个生成的组合用于输出
void backtrack(int k);
void output();
int main(int argc, char** argv)
{
printf("请输入自然数的个数n和组合个数r\n");
scanf("%d%d", &n, &r);
if (r > n)
{
printf("输入数据错误!");
return 0;
}
com = (int*)malloc(r * sizeof(int));
com[0] = 1;//组合数是从1开始的
backtrack(0);
return 1;
}
void backtrack(int k)
{
int i = 0;
int j = 0;
if (k >= r)
{
output();//到达叶节点输出结果
return;
}
else {
for (j = 1; j < n - com[k] + 2; j++)//遍历一个节点下的所有节点
{
com[k + 1] = com[k] + j;
backtrack(k + 1);//前进 ,递归
com[k]++;
backtrack(k);//回溯
}
}
}
void output()
{
int i = 0;
for (i = 0; i < r; i++)
{
printf("%d ", com[i]);
}
printf("\n");
} |
b0eed368da6b06a214e1ccda9bba37c9d0cfb132 | 189f52bf5454e724d5acc97a2fa000ea54d0e102 | /ras/fluidisedBed/0.76/phi | 04726f04007fb23b9a7ea1fb1688d75b0253cdd6 | [] | 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 | 145,714 | phi | /*--------------------------------*- 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 surfaceScalarField;
location "0.76";
object phi;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 3 -1 0 0 0 0];
internalField nonuniform List<scalar>
11770
(
-1.90473e-06
4.93391e-05
4.5506e-07
4.50769e-05
1.68006e-06
4.63061e-05
1.45264e-06
4.77955e-05
4.89647e-08
4.89541e-05
-9.57028e-07
4.84537e-05
-1.34343e-06
4.76977e-05
-3.78477e-06
4.97707e-05
-5.98769e-06
4.95646e-05
-7.37355e-06
4.84518e-05
-7.94921e-06
4.73801e-05
-6.84056e-06
4.54965e-05
-5.00916e-06
4.47207e-05
-2.85432e-06
4.43649e-05
-6.0471e-07
4.42374e-05
1.64632e-06
4.41929e-05
3.68435e-06
4.43891e-05
5.56818e-06
4.46067e-05
6.89861e-06
4.52245e-05
6.40888e-06
4.72473e-05
5.33103e-06
4.80647e-05
3.52825e-06
4.9087e-05
1.68628e-06
4.91301e-05
1.58105e-06
4.73995e-05
6.5034e-07
4.83652e-05
-8.93934e-07
4.90961e-05
-1.27878e-06
4.79465e-05
-2.34072e-07
4.64748e-05
1.93135e-06
4.5265e-05
4.93566e-05
-4.37422e-07
5.26626e-05
4.1001e-06
4.30575e-05
6.35862e-06
4.6565e-05
6.76395e-06
4.99458e-05
5.12067e-06
5.32038e-05
1.73564e-06
5.44451e-05
-4.52862e-06
5.65555e-05
-1.08648e-05
5.88065e-05
-1.33512e-05
5.4764e-05
-1.22988e-05
5.01363e-05
-9.95017e-06
4.77801e-05
-8.03298e-06
4.62544e-05
-5.72716e-06
4.50765e-05
-3.27802e-06
4.45781e-05
-3.61498e-07
4.39946e-05
2.06288e-06
4.44308e-05
4.32104e-06
4.47891e-05
6.74274e-06
4.48506e-05
8.67999e-06
4.59582e-05
1.14225e-05
4.7243e-05
1.26456e-05
4.95421e-05
1.03168e-05
5.40759e-05
4.611e-06
5.7486e-05
-1.16291e-06
5.57365e-05
-4.23395e-06
5.40189e-05
-6.04053e-06
5.34956e-05
-5.8016e-06
5.02511e-05
-3.82135e-06
4.70042e-05
6.04305e-07
4.33488e-05
5.28324e-05
1.45026e-06
5.14233e-05
7.15756e-06
3.75242e-05
9.84339e-06
4.4075e-05
9.39888e-06
5.06057e-05
6.13957e-06
5.67033e-05
-2.54868e-07
6.11203e-05
-8.15685e-06
6.48202e-05
-1.22275e-05
6.33071e-05
-1.26238e-05
5.55654e-05
-1.0943e-05
4.88401e-05
-8.09308e-06
4.53168e-05
-5.45574e-06
4.40028e-05
-3.81815e-06
4.38216e-05
-2.0081e-06
4.31434e-05
2.63018e-07
4.20899e-05
1.85329e-06
4.32175e-05
3.00253e-06
4.40324e-05
4.65471e-06
4.35951e-05
7.51132e-06
4.35007e-05
1.05485e-05
4.45981e-05
1.25683e-05
4.79065e-05
1.25242e-05
5.45269e-05
8.93571e-06
6.1496e-05
1.28678e-06
6.37375e-05
-5.39997e-06
6.09826e-05
-8.85138e-06
5.71852e-05
-9.42774e-06
5.10397e-05
-6.85848e-06
4.46297e-05
-1.30195e-06
3.79641e-05
5.17382e-05
9.70887e-06
4.17949e-05
1.39972e-05
3.33036e-05
1.88967e-05
3.92474e-05
2.03083e-05
4.9272e-05
1.60015e-05
6.10958e-05
7.25045e-06
6.99659e-05
-2.00411e-06
7.4193e-05
-1.02705e-05
7.17245e-05
-1.35091e-05
5.89521e-05
-1.05873e-05
4.60653e-05
-5.88281e-06
4.07556e-05
-2.35199e-06
4.06073e-05
-1.17849e-06
4.27718e-05
-4.27369e-07
4.25022e-05
2.65095e-07
4.15e-05
7.2543e-07
4.28659e-05
5.7089e-07
4.43082e-05
1.67449e-06
4.26239e-05
5.71767e-06
3.96012e-05
1.08163e-05
3.96462e-05
1.38218e-05
4.50462e-05
1.12571e-05
5.72411e-05
3.05499e-06
6.98457e-05
-6.53173e-06
7.34397e-05
-1.58182e-05
7.03633e-05
-2.01604e-05
6.16121e-05
-1.89546e-05
4.99109e-05
-1.40023e-05
3.97482e-05
-9.53004e-06
3.35585e-05
4.22877e-05
1.52408e-05
2.66153e-05
2.3584e-05
2.502e-05
3.40856e-05
2.8808e-05
4.18712e-05
4.15541e-05
4.11039e-05
6.19373e-05
3.1254e-05
7.98956e-05
1.70861e-05
8.84465e-05
4.66636e-07
8.84384e-05
-1.216e-05
7.16725e-05
-1.11972e-05
4.51908e-05
-4.50652e-06
3.41502e-05
3.28622e-07
3.58545e-05
2.32019e-06
4.08583e-05
2.85567e-06
4.20391e-05
-6.79852e-07
4.51065e-05
-3.11195e-06
4.53707e-05
-2.75139e-06
4.4025e-05
-5.59877e-07
4.05142e-05
4.58206e-06
3.4544e-05
1.16524e-05
3.26606e-05
1.29006e-05
4.38854e-05
6.19493e-07
6.96147e-05
-1.66705e-05
8.72282e-05
-3.17099e-05
8.85632e-05
-4.17865e-05
8.05184e-05
-4.25539e-05
6.24526e-05
-3.47522e-05
4.2176e-05
-2.39368e-05
2.8994e-05
-1.50132e-05
2.46935e-05
2.73348e-05
1.21049e-05
1.45648e-05
2.11247e-05
1.60552e-05
3.32046e-05
1.67853e-05
4.65736e-05
2.82484e-05
5.60033e-05
5.25792e-05
5.60774e-05
7.98995e-05
4.68186e-05
9.77878e-05
2.79419e-05
0.0001074
1.84112e-06
9.78558e-05
-8.06205e-06
5.51653e-05
-7.00418e-07
2.6853e-05
5.82557e-06
2.93936e-05
8.48446e-06
3.82662e-05
3.30643e-06
4.72864e-05
-1.13336e-06
4.96189e-05
-6.7423e-06
5.10522e-05
-8.95625e-06
4.63074e-05
-4.74085e-06
3.63664e-05
1.33172e-06
2.85365e-05
9.11415e-06
2.4941e-05
4.25207e-07
5.26446e-05
-2.68196e-05
9.69406e-05
-4.70762e-05
0.000107569
-5.69817e-05
9.855e-05
-5.68553e-05
8.04694e-05
-4.72418e-05
5.29095e-05
-3.3544e-05
2.85404e-05
-2.11792e-05
1.66852e-05
-1.20621e-05
1.56302e-05
1.53264e-05
6.0216e-06
8.59083e-06
1.15847e-05
1.05415e-05
2.00987e-05
8.32166e-06
3.34535e-05
1.495e-05
5.075e-05
3.53491e-05
6.20277e-05
6.86988e-05
5.85175e-05
0.000101382
4.88649e-05
0.000117139
2.66493e-05
0.000120156
5.05516e-06
7.68304e-05
5.80155e-06
2.61608e-05
9.36735e-06
2.58834e-05
7.59136e-07
4.69397e-05
-4.10639e-06
5.22252e-05
-1.92917e-06
4.75151e-05
-1.64202e-06
5.08391e-05
-5.16061e-06
4.98963e-05
-1.04284e-05
4.1697e-05
-4.82529e-06
2.29892e-05
-1.04614e-06
2.12135e-05
-2.21646e-05
7.38313e-05
-4.70463e-05
0.000121905
-5.85324e-05
0.00011914
-6.23061e-05
0.000102407
-5.07619e-05
6.90012e-05
-3.32246e-05
3.54372e-05
-1.97242e-05
1.50953e-05
-1.1299e-05
8.3092e-06
-6.07738e-06
1.04569e-05
9.29617e-06
1.05002e-06
7.58156e-06
4.32168e-06
7.31384e-06
8.29792e-06
4.38931e-06
1.66408e-05
6.65521e-06
3.39056e-05
1.81417e-05
5.5107e-05
4.75694e-05
6.09874e-05
9.55879e-05
5.45637e-05
0.000123654
4.48403e-05
0.000129968
2.68814e-05
9.48678e-05
1.13395e-05
4.17605e-05
-2.59513e-06
3.98742e-05
-2.07135e-05
6.51304e-05
-1.83514e-05
4.99346e-05
-5.13152e-06
3.4363e-05
8.40652e-06
3.73692e-05
8.18819e-06
5.01844e-05
-3.88021e-06
5.38331e-05
-9.84376e-06
2.9005e-05
-1.9386e-05
3.08061e-05
-3.7943e-05
9.24616e-05
-5.16009e-05
0.000135651
-6.05018e-05
0.000128131
-5.44898e-05
9.64795e-05
-3.31671e-05
4.7749e-05
-1.6052e-05
1.83784e-05
-7.92691e-06
7.01729e-06
-4.18402e-06
4.60925e-06
-1.24889e-06
7.5649e-06
8.0878e-06
-7.54778e-07
8.3727e-06
8.11373e-07
5.78648e-06
2.34528e-06
2.89449e-06
6.27903e-06
2.76311e-06
1.70237e-05
7.44497e-06
3.8022e-05
2.66328e-05
5.4079e-05
7.96137e-05
5.55992e-05
0.000122227
5.5916e-05
0.000129743
4.55008e-05
0.000105371
1.94596e-05
6.78734e-05
-1.79451e-05
7.73491e-05
-3.15575e-05
7.88191e-05
-2.39392e-05
4.23854e-05
-8.83042e-06
1.93157e-05
9.01966e-06
1.95804e-05
1.95303e-05
3.97398e-05
1.03477e-05
6.30842e-05
-1.64091e-05
5.5824e-05
-3.60138e-05
5.04718e-05
-4.77792e-05
0.000104309
-5.29017e-05
0.000140866
-5.40324e-05
0.000129355
-3.73629e-05
7.98914e-05
-1.64406e-05
2.68871e-05
-5.97955e-06
7.9642e-06
-2.12526e-06
3.20396e-06
-6.82888e-07
3.20541e-06
7.54485e-07
6.1659e-06
8.87847e-06
-6.47866e-07
9.05544e-06
-1.32345e-07
5.3063e-06
4.39396e-07
2.35892e-06
2.14957e-06
1.09076e-06
7.09966e-06
2.53594e-06
2.06286e-05
1.31549e-05
3.91915e-05
6.11256e-05
5.14851e-05
0.000110024
5.89831e-05
0.000122338
5.17514e-05
0.000112694
2.32373e-05
9.64693e-05
-1.95852e-05
0.000120256
-3.01541e-05
8.94683e-05
-2.06149e-05
3.29114e-05
-1.01732e-05
8.92957e-06
2.67652e-06
6.7851e-06
1.88747e-05
2.36026e-05
1.70007e-05
6.50273e-05
-1.41352e-05
8.70317e-05
-4.08808e-05
7.72881e-05
-5.19703e-05
0.000115487
-5.0806e-05
0.000139798
-4.04007e-05
0.000119042
-2.02355e-05
5.97994e-05
-6.704e-06
1.34054e-05
-1.83786e-06
3.13854e-06
-1.54654e-07
1.5582e-06
2.8379e-07
2.80286e-06
6.74825e-07
5.81002e-06
9.5881e-06
-6.50461e-07
9.74083e-06
-6.70829e-07
5.36075e-06
-1.46468e-07
1.86881e-06
1.02506e-06
-4.5218e-08
3.20187e-06
3.9673e-07
9.22197e-06
7.17867e-06
2.3812e-05
4.66019e-05
4.31132e-05
9.08082e-05
5.51531e-05
0.000110389
4.88614e-05
0.000119081
2.15135e-05
0.000123909
-1.5811e-05
0.00015768
-2.42832e-05
9.80259e-05
-1.57575e-05
2.44461e-05
-9.82005e-06
3.04268e-06
-2.6041e-06
-3.81889e-07
1.28987e-05
8.15311e-06
2.06883e-05
5.73065e-05
-3.36014e-06
0.00011116
-3.58175e-05
0.000109826
-5.01168e-05
0.000129879
-4.52063e-05
0.000134983
-2.55737e-05
9.94958e-05
-8.41366e-06
4.2703e-05
-2.52234e-06
7.55697e-06
-3.89725e-07
1.04325e-06
6.69683e-07
5.34281e-07
9.96004e-07
2.51093e-06
7.70876e-07
6.06945e-06
1.03938e-05
-9.11512e-07
1.06877e-05
-1.23744e-06
5.72029e-06
-7.72661e-07
1.43692e-06
3.63904e-07
-1.14816e-06
1.72635e-06
-9.30086e-07
3.38546e-06
5.56055e-06
1.40379e-05
3.60093e-05
3.50468e-05
6.98767e-05
4.98068e-05
9.57169e-05
4.48814e-05
0.000124105
1.77855e-05
0.000151109
-1.0153e-05
0.000185735
-1.81728e-05
0.000106136
-1.209e-05
1.84187e-05
-8.33061e-06
-6.70297e-07
-3.51602e-06
-5.15179e-06
6.81697e-06
-2.13415e-06
2.30636e-05
4.11244e-05
4.88491e-06
0.000129429
-2.9647e-05
0.000144451
-4.64559e-05
0.000146788
-3.8955e-05
0.000127579
-1.48928e-05
7.55117e-05
-1.75155e-06
2.96176e-05
-6.22943e-07
6.46918e-06
6.47069e-07
-1.90867e-07
1.57192e-06
-3.56199e-07
1.70463e-06
2.41221e-06
9.95502e-07
6.81304e-06
1.14244e-05
-2.0258e-06
1.27499e-05
-2.53919e-06
6.26619e-06
-1.78843e-06
7.17447e-07
-4.29451e-07
-2.47559e-06
1.01547e-06
-2.34124e-06
1.7323e-06
4.88375e-06
1.08072e-05
2.69884e-05
2.95944e-05
5.11576e-05
4.40197e-05
8.13749e-05
3.94732e-05
0.000128753
1.4262e-05
0.000176435
-1.2079e-06
0.000201331
-1.05327e-05
0.000115556
-7.69737e-06
1.56338e-05
-6.4721e-06
-1.85369e-06
-3.04309e-06
-8.54064e-06
2.5772e-06
-7.71447e-06
1.95888e-05
2.41699e-05
5.77492e-06
0.000143341
-2.04926e-05
0.000170824
-3.90754e-05
0.000165479
-3.2933e-05
0.000121534
-1.04519e-05
5.3099e-05
-2.92755e-09
1.92182e-05
4.17814e-07
6.0898e-06
1.68864e-06
-1.4265e-06
2.69877e-06
-1.33252e-06
2.99061e-06
2.15442e-06
1.76583e-06
8.07253e-06
1.32259e-05
-4.81746e-06
1.76035e-05
-5.25281e-06
6.73062e-06
-3.64012e-06
-8.66522e-07
-1.62686e-06
-4.45942e-06
2.36887e-07
-4.17337e-06
2.78758e-06
2.37151e-06
1.11563e-05
1.86673e-05
2.55355e-05
3.68363e-05
3.53432e-05
7.16421e-05
3.14403e-05
0.000132752
1.68237e-05
0.000191168
1.39655e-05
0.000204315
3.36357e-06
0.000126256
-1.40084e-06
2.04459e-05
-4.0405e-06
8.25214e-07
-3.92329e-06
-8.62125e-06
-1.78759e-06
-9.81424e-06
1.142e-05
1.10111e-05
4.13976e-06
0.000150726
-8.9405e-06
0.000184018
-2.53943e-05
0.000182046
-2.5225e-05
0.000121461
-8.94497e-06
3.68767e-05
-1.62192e-06
1.19393e-05
1.10702e-06
3.40212e-06
2.81477e-06
-3.09949e-06
4.51317e-06
-2.99752e-06
5.90203e-06
7.99147e-07
3.73128e-06
1.02765e-05
1.69973e-05
-7.772e-06
2.54174e-05
-8.3552e-06
7.34624e-06
-6.33583e-06
-2.85927e-06
-3.13686e-06
-7.63071e-06
-7.1624e-07
-6.56427e-06
2.8423e-06
-1.15222e-06
8.18916e-06
1.33612e-05
1.77234e-05
2.73497e-05
2.17037e-05
6.77271e-05
2.33932e-05
0.00013115
2.86521e-05
0.000186017
4.15298e-05
0.000191553
3.39188e-05
0.000133965
1.27257e-05
4.16941e-05
-2.38529e-06
1.59769e-05
-6.40552e-06
-4.56329e-06
-6.67831e-06
-9.50578e-06
-6.10587e-07
4.98687e-06
3.53633e-06
0.000146682
-1.84675e-06
0.000189516
-9.62274e-06
0.000189937
-1.49579e-05
0.000126888
-7.07509e-06
2.90426e-05
-3.33688e-06
8.24054e-06
7.66642e-07
-6.62568e-07
3.53984e-06
-5.83876e-06
6.85563e-06
-6.28105e-06
8.74139e-06
-1.05465e-06
8.34901e-06
1.0708e-05
2.53962e-05
-3.43415e-06
2.89027e-05
-9.92651e-06
1.38842e-05
-8.02877e-06
-4.72556e-06
-4.34421e-06
-1.12874e-05
-2.90863e-06
-7.97109e-06
-1.35028e-06
-2.68028e-06
-2.04059e-06
1.40865e-05
1.73593e-06
2.36116e-05
4.77862e-06
6.47415e-05
1.78049e-05
0.000118201
4.29264e-05
0.000160991
6.96952e-05
0.000164888
7.22102e-05
0.000131549
4.06794e-05
7.32962e-05
9.47688e-06
4.72349e-05
-7.4271e-06
1.23815e-05
-1.244e-05
-4.45558e-06
-1.7541e-05
1.01359e-05
-3.22383e-06
0.000132463
-2.58362e-07
0.000186663
3.42909e-06
0.000186361
9.67197e-07
0.000129437
-3.68529e-06
3.37416e-05
-3.15616e-06
7.74754e-06
-1.10699e-07
-3.6729e-06
3.00455e-06
-8.92067e-06
7.2347e-06
-1.04797e-05
7.9422e-06
-1.72542e-06
3.93952e-06
1.47614e-05
2.93914e-05
4.34349e-06
2.46117e-05
-3.37597e-06
2.16541e-05
-5.84056e-06
-2.22223e-06
-4.10589e-06
-1.29915e-05
-2.81519e-06
-9.23316e-06
-4.49172e-06
-9.72995e-07
-1.20446e-05
2.16767e-05
-1.48608e-05
2.6464e-05
-8.37532e-06
5.83066e-05
1.34289e-05
9.64636e-05
4.75762e-05
0.000126928
7.72765e-05
0.000135281
8.64098e-05
0.000122507
6.03356e-05
9.94467e-05
2.86134e-05
7.9024e-05
-2.33149e-06
4.3384e-05
-2.11672e-05
1.44284e-05
-3.37623e-05
2.27864e-05
-1.57531e-05
0.000114543
-1.59868e-06
0.000172614
1.38272e-05
0.000171041
1.93827e-05
0.000123968
5.17565e-06
4.79998e-05
-1.63457e-06
1.45929e-05
-1.43706e-06
-3.8365e-06
6.62162e-07
-1.09864e-05
2.36264e-06
-1.21474e-05
3.14098e-08
6.49144e-07
-5.00946e-06
1.98566e-05
2.44385e-05
7.94587e-06
1.67151e-05
1.14249e-05
1.82246e-05
7.46201e-06
1.7834e-06
5.62004e-06
-1.11167e-05
1.05592e-05
-1.41374e-05
5.74071e-06
3.88925e-06
-4.98676e-06
3.24549e-05
-1.77628e-05
3.92934e-05
-9.17079e-06
4.97584e-05
1.21105e-05
7.52401e-05
4.26471e-05
9.6464e-05
6.78559e-05
0.000110152
7.51102e-05
0.000115331
5.87839e-05
0.000115846
4.06187e-05
9.72575e-05
1.84558e-05
6.56098e-05
-1.2078e-05
4.50203e-05
-3.44456e-05
4.52129e-05
-1.8215e-05
9.83914e-05
7.10319e-07
0.00015379
2.29561e-05
0.000148896
3.20781e-05
0.000114931
1.71113e-05
6.3023e-05
-3.34551e-06
3.50925e-05
-6.81178e-06
-3.39296e-07
-5.90273e-06
-1.18624e-05
-8.10359e-06
-9.91213e-06
-1.08088e-05
3.40013e-06
-6.7589e-06
1.58593e-05
1.77325e-05
8.11245e-06
8.64759e-06
1.44377e-05
1.19458e-05
1.50842e-05
1.17988e-06
1.35929e-05
-9.58713e-06
1.41118e-05
-1.46166e-05
1.46047e-05
3.44543e-06
1.66926e-05
3.04216e-05
8.85205e-06
4.71777e-05
9.98786e-06
4.86703e-05
2.31075e-05
6.21757e-05
4.21109e-05
7.75256e-05
5.67603e-05
9.55725e-05
5.99906e-05
0.000112174
5.81145e-05
0.000117794
5.42934e-05
0.000101148
4.38015e-05
7.61679e-05
2.13957e-05
6.74893e-05
-1.07907e-05
7.74629e-05
-7.10069e-06
9.47718e-05
5.49191e-06
0.000141292
2.24764e-05
0.000132005
3.29321e-05
0.000104552
1.19748e-05
8.40449e-05
-1.20058e-05
5.91334e-05
-1.51167e-05
2.8115e-06
-1.37846e-05
-1.31615e-05
-1.44592e-05
-9.20023e-06
-1.21566e-05
1.14198e-06
-6.54226e-06
1.02933e-05
1.12387e-05
4.49124e-06
4.19577e-06
9.85746e-06
6.62204e-06
1.14058e-05
-3.28412e-07
8.04266e-06
-6.18556e-06
3.47848e-06
-1.00123e-05
1.08328e-05
-3.86293e-06
2.70335e-05
1.42748e-05
4.24616e-05
3.18082e-05
4.68796e-05
4.43155e-05
5.1838e-05
5.72812e-05
5.62808e-05
7.31494e-05
5.99065e-05
9.20158e-05
6.38465e-05
0.000108304
7.04837e-05
0.000111228
7.58226e-05
9.58818e-05
7.39817e-05
7.80794e-05
6.14834e-05
8.00586e-05
3.54828e-05
0.000103539
1.37684e-05
0.00011656
1.1147e-05
0.000144003
1.11502e-05
0.000132088
8.57499e-06
0.000107197
-1.26091e-05
0.000105305
-1.58743e-05
6.24667e-05
-1.58823e-05
2.86814e-06
-1.4945e-05
-1.40622e-05
-1.34603e-05
-1.06469e-05
-9.87773e-06
-2.39896e-06
-5.70629e-06
6.16751e-06
5.57698e-06
-2.1083e-06
6.33547e-06
-3.47559e-07
4.89755e-06
-1.66747e-07
-4.74524e-07
-2.29111e-06
-4.02549e-06
-4.99885e-06
-7.2674e-06
-1.43992e-06
-7.38045e-06
1.50238e-05
-2.1407e-06
3.70236e-05
9.86582e-06
5.52384e-05
2.61637e-05
6.54643e-05
4.71219e-05
6.93678e-05
6.93143e-05
7.20354e-05
8.94175e-05
7.83198e-05
0.000102091
8.75145e-05
0.000102108
9.57811e-05
8.76901e-05
9.83505e-05
7.55859e-05
9.35218e-05
8.49666e-05
7.70212e-05
0.000120125
4.17745e-05
0.000151892
1.98138e-05
0.00016605
-2.19073e-07
0.000152203
-2.31035e-05
0.000130159
-2.5467e-05
0.000107747
-1.44126e-05
5.148e-05
-1.00996e-05
-1.39568e-06
-9.74805e-06
-1.43754e-05
-9.24319e-06
-1.11145e-05
-7.61134e-06
-3.99062e-06
-4.07921e-06
2.67677e-06
1.53673e-06
-2.14553e-06
8.50969e-06
-3.08665e-06
5.86846e-06
-5.27611e-06
1.74403e-06
-7.43628e-06
-1.83498e-06
-9.52704e-06
-5.1445e-06
-1.01378e-05
-6.73336e-06
-4.28992e-06
-7.9474e-06
9.85651e-06
-4.23208e-06
2.92791e-05
6.79744e-06
4.78781e-05
2.85857e-05
6.2989e-05
5.42708e-05
7.39577e-05
7.85197e-05
8.47411e-05
9.13817e-05
9.54394e-05
9.14862e-05
0.000102745
8.0462e-05
0.000105344
7.30666e-05
0.000101785
8.86078e-05
8.70397e-05
0.000134957
5.62538e-05
0.000182764
2.54102e-05
0.000196975
-4.82811e-06
0.000182521
-2.55019e-05
0.000150912
-1.93258e-05
0.000101646
-7.20648e-06
3.94242e-05
-3.12282e-06
-5.43246e-06
-4.043e-06
-1.34163e-05
-5.15854e-06
-9.96105e-06
-4.89901e-06
-4.20949e-06
-2.19952e-06
2.93612e-08
-6.22561e-07
-1.89311e-06
1.04319e-05
-3.21802e-06
7.22208e-06
-4.99512e-06
3.54882e-06
-6.84955e-06
4.69349e-08
-9.01076e-06
-2.95503e-06
-1.05917e-05
-5.12192e-06
-1.17732e-05
-6.73157e-06
-8.5644e-06
-7.40059e-06
2.40023e-06
-4.1193e-06
2.09926e-05
1.00493e-05
4.21467e-05
3.31801e-05
6.1048e-05
5.96876e-05
7.75015e-05
7.5002e-05
8.97234e-05
7.93414e-05
9.57329e-05
7.45301e-05
9.63186e-05
7.25602e-05
8.89328e-05
9.60744e-05
7.06722e-05
0.000153301
4.68135e-05
0.000206705
2.34798e-05
0.000220392
7.50471e-07
0.000205331
-1.09683e-05
0.00016271
-6.22931e-06
9.69803e-05
1.96322e-06
3.12915e-05
2.77122e-06
-6.19527e-06
5.9472e-07
-1.12009e-05
-1.31027e-06
-8.01731e-06
-1.65726e-06
-3.82083e-06
-5.46459e-07
-1.04636e-06
-1.12804e-06
-1.37005e-06
1.18312e-05
-2.88121e-06
8.76179e-06
-4.63406e-06
5.32923e-06
-6.56567e-06
2.0056e-06
-8.57439e-06
-9.19125e-07
-1.03022e-05
-3.36584e-06
-1.18561e-05
-5.14727e-06
-1.31926e-05
-6.03042e-06
-1.15743e-05
-5.69785e-06
2.01583e-07
-1.67876e-06
2.06695e-05
1.27685e-05
4.3666e-05
3.67559e-05
6.24911e-05
5.6248e-05
7.4854e-05
6.70534e-05
8.00093e-05
6.94515e-05
7.92215e-05
7.34254e-05
6.62957e-05
0.000109078
4.73291e-05
0.000172348
3.15816e-05
0.000222535
1.86127e-05
0.000233445
6.45998e-06
0.000217567
6.2698e-07
0.000168622
3.42181e-06
9.42568e-05
8.74914e-06
2.6022e-05
7.91982e-06
-5.3215e-06
4.77749e-06
-8.01943e-06
2.33375e-06
-5.53446e-06
1.08131e-06
-2.5313e-06
4.04921e-07
-3.28456e-07
-6.84134e-07
-8.08027e-07
1.2668e-05
-2.07698e-06
1.00586e-05
-3.71897e-06
6.9983e-06
-6.11576e-06
4.4291e-06
-8.64575e-06
1.63772e-06
-1.0903e-05
-1.08113e-06
-1.28873e-05
-3.13407e-06
-1.43664e-05
-4.5201e-06
-1.48088e-05
-5.22121e-06
-1.20102e-05
-4.4376e-06
5.61928e-07
2.44332e-07
2.36819e-05
1.36933e-05
4.63696e-05
3.36261e-05
6.04523e-05
5.30418e-05
6.33539e-05
6.66236e-05
5.87647e-05
7.80873e-05
4.3707e-05
0.000124211
2.88347e-05
0.000187299
2.11437e-05
0.000230309
1.49746e-05
0.000239699
9.23783e-06
0.000223387
5.72362e-06
0.000172215
7.65785e-06
9.23926e-05
1.44411e-05
1.92947e-05
1.31841e-05
-4.02048e-06
8.45507e-06
-3.25089e-06
5.15569e-06
-2.19621e-06
2.93709e-06
-2.7293e-07
1.27165e-06
1.3698e-06
6.24438e-07
3.79012e-07
1.23162e-05
-2.47066e-07
1.07114e-05
-1.82129e-06
8.59875e-06
-4.95048e-06
7.58471e-06
-8.93715e-06
5.6506e-06
-1.21665e-05
2.17517e-06
-1.48592e-05
-4.13043e-07
-1.67928e-05
-2.55624e-06
-1.76453e-05
-4.33617e-06
-1.67808e-05
-5.26709e-06
-1.19876e-05
-4.50897e-06
2.06621e-06
-3.12696e-07
2.39815e-05
1.17676e-05
4.05567e-05
3.65304e-05
4.37031e-05
6.35447e-05
3.78595e-05
8.39998e-05
2.64231e-05
0.000135721
1.91748e-05
0.000194626
1.77658e-05
0.000231802
1.55059e-05
0.000242043
1.17895e-05
0.000227188
6.4159e-06
0.000177668
7.55074e-06
9.1327e-05
1.75893e-05
9.3091e-06
1.4931e-05
-1.32122e-06
9.81982e-06
1.89896e-06
5.80633e-06
1.85422e-06
3.15804e-06
2.41204e-06
1.74657e-06
2.81793e-06
2.40593e-06
1.90085e-06
1.04409e-05
2.93684e-06
9.70116e-06
2.12564e-06
9.43573e-06
-1.19566e-06
1.09328e-05
-7.82507e-06
1.23079e-05
-1.44135e-05
8.79099e-06
-1.81724e-05
3.37357e-06
-2.02156e-05
-4.82699e-07
-2.12524e-05
-3.26717e-06
-2.10156e-05
-5.4704e-06
-1.87859e-05
-6.70347e-06
-1.2683e-05
-6.37579e-06
9.62511e-07
-1.83027e-06
1.80304e-05
1.95187e-05
2.44421e-05
5.71965e-05
2.12489e-05
8.72603e-05
1.73279e-05
0.000139715
1.89792e-05
0.000193054
2.26282e-05
0.000228236
2.27711e-05
0.000241985
1.80646e-05
0.000231979
8.05488e-06
0.000187759
5.70146e-06
9.37493e-05
1.11041e-05
3.95146e-06
7.69775e-06
2.12186e-06
5.65892e-06
3.97367e-06
3.61939e-06
3.92847e-06
2.29557e-06
3.77015e-06
1.54363e-06
3.60376e-06
3.98228e-06
5.37605e-07
9.92668e-06
5.8854e-07
9.67418e-06
-1.45901e-06
1.15078e-05
-4.95629e-06
1.44557e-05
-7.54076e-06
1.49213e-05
-1.33969e-05
1.46778e-05
-2.18546e-05
1.18617e-05
-2.48017e-05
2.49582e-06
-2.55831e-05
-2.45274e-06
-2.55663e-05
-5.45341e-06
-2.43645e-05
-7.87123e-06
-2.14581e-05
-9.24696e-06
-1.50134e-05
-8.23378e-06
-1.90667e-06
6.46288e-06
6.37568e-06
4.89756e-05
9.55204e-06
8.41506e-05
1.60021e-05
0.000133338
2.72499e-05
0.000181884
3.70259e-05
0.000218543
3.96696e-05
0.000239427
3.30041e-05
0.000238733
1.77369e-05
0.000203111
9.197e-06
0.000102359
6.59156e-06
6.59435e-06
4.23076e-06
4.5198e-06
3.4698e-06
4.76897e-06
2.61557e-06
4.81568e-06
1.80792e-06
4.6101e-06
1.08746e-06
4.35587e-06
5.10053e-06
-1.26141e-06
1.12111e-05
-3.34824e-06
1.17844e-05
-6.50559e-06
1.46892e-05
-9.90513e-06
1.78805e-05
-1.37094e-05
1.87519e-05
-2.0165e-05
2.11648e-05
-2.79582e-05
1.96904e-05
-2.98413e-05
4.41186e-06
-3.05321e-05
-1.72762e-06
-3.03336e-05
-5.61656e-06
-2.99445e-05
-8.22472e-06
-2.8606e-05
-1.05502e-05
-2.6196e-05
-1.06049e-05
-1.80191e-05
-1.66509e-06
-7.75396e-06
3.87703e-05
3.39727e-06
7.3065e-05
2.15882e-05
0.000115218
4.34584e-05
0.00016009
6.04651e-05
0.000201618
6.59893e-05
0.000233992
5.80567e-05
0.000246758
3.82488e-05
0.000223011
1.94384e-05
0.000121244
7.91386e-06
1.81592e-05
4.62615e-06
7.84587e-06
3.10495e-06
6.32418e-06
2.24992e-06
5.7027e-06
1.55366e-06
5.33701e-06
8.11424e-07
5.12796e-06
5.94098e-06
-2.34513e-06
1.35791e-05
-5.41082e-06
1.48742e-05
-8.78812e-06
1.80918e-05
-1.25888e-05
2.17083e-05
-2.06652e-05
2.68572e-05
-2.92681e-05
2.98041e-05
-3.39404e-05
2.44011e-05
-3.62414e-05
6.74695e-06
-3.55611e-05
-2.37307e-06
-3.4954e-05
-6.1865e-06
-3.47653e-05
-8.375e-06
-3.50197e-05
-1.02567e-05
-3.47943e-05
-1.07906e-05
-3.01287e-05
-6.28424e-06
-1.52112e-05
2.39093e-05
2.34195e-06
5.55754e-05
3.05509e-05
8.70779e-05
6.22226e-05
0.000128493
8.68165e-05
0.000177108
9.64695e-05
0.000224433
8.95882e-05
0.000253743
6.77514e-05
0.000244952
3.45985e-05
0.000154484
1.05885e-05
4.22183e-05
6.02668e-06
1.24474e-05
3.79337e-06
8.59206e-06
2.48356e-06
7.04371e-06
1.56321e-06
6.28658e-06
7.38662e-07
5.98045e-06
6.70676e-06
-3.9656e-06
1.75662e-05
-7.39916e-06
1.83325e-05
-1.08441e-05
2.15632e-05
-1.64388e-05
2.73312e-05
-2.84787e-05
3.89317e-05
-3.61228e-05
3.74904e-05
-3.81613e-05
2.64802e-05
-4.01877e-05
8.80815e-06
-3.97451e-05
-2.78117e-06
-3.88395e-05
-7.05489e-06
-3.82784e-05
-8.89613e-06
-3.83718e-05
-1.01209e-05
-3.81645e-05
-1.09545e-05
-3.57919e-05
-8.61244e-06
-1.81325e-05
6.29906e-06
1.61073e-06
3.58906e-05
3.26082e-05
5.61443e-05
7.00286e-05
9.11456e-05
0.000103469
0.000143754
0.000120518
0.000207487
0.000119254
0.000255124
0.000101999
0.000262331
6.02989e-05
0.000196293
1.79672e-05
8.46166e-05
7.8794e-06
2.25769e-05
4.95441e-06
1.15521e-05
3.09817e-06
8.93047e-06
1.82582e-06
7.58643e-06
7.83824e-07
7.04808e-06
7.51527e-06
-5.5435e-06
2.31352e-05
-8.90625e-06
2.17205e-05
-1.43559e-05
2.70396e-05
-2.77024e-05
4.07091e-05
-3.85494e-05
4.98213e-05
-4.07133e-05
3.96971e-05
-4.11212e-05
2.69288e-05
-4.19589e-05
9.6811e-06
-4.20573e-05
-2.64951e-06
-4.12724e-05
-7.80366e-06
-4.04003e-05
-9.72812e-06
-3.96183e-05
-1.08601e-05
-3.85648e-05
-1.19634e-05
-3.54961e-05
-1.16363e-05
-2.36419e-05
-5.5111e-06
-5.87884e-06
1.81783e-05
1.94535e-05
3.08676e-05
5.70332e-05
5.36313e-05
9.79669e-05
0.000102904
0.000127359
0.000178205
0.000136705
0.00024591
0.000131367
0.000267813
9.84507e-05
0.000229342
4.30068e-05
0.000140152
1.35477e-05
5.20868e-05
6.85523e-06
1.82809e-05
4.1373e-06
1.16783e-05
2.47408e-06
9.27522e-06
1.06388e-06
8.48117e-06
8.601e-06
-1.99669e-06
2.51572e-05
-8.60021e-06
2.8351e-05
-1.85717e-05
3.70405e-05
-3.12165e-05
5.3391e-05
-3.89233e-05
5.75728e-05
-4.14895e-05
4.23061e-05
-4.0219e-05
2.56978e-05
-4.0166e-05
9.66258e-06
-4.13961e-05
-1.38758e-06
-4.14069e-05
-7.75886e-06
-4.09547e-05
-1.01421e-05
-3.99203e-05
-1.18535e-05
-3.8434e-05
-1.34073e-05
-3.55475e-05
-1.44817e-05
-3.12907e-05
-9.72597e-06
-1.817e-05
5.10474e-06
-5.94674e-07
1.33412e-05
2.94328e-05
2.3658e-05
7.24253e-05
5.99854e-05
0.000112081
0.000138656
0.000133733
0.000224398
0.000140271
0.000261428
0.000126266
0.000243493
8.30582e-05
0.000183475
3.54933e-05
9.97239e-05
1.22183e-05
4.15978e-05
6.43518e-06
1.74914e-05
3.84262e-06
1.18912e-05
1.79701e-06
1.05469e-05
1.04161e-05
-5.80108e-07
2.57636e-05
-7.1787e-06
3.49781e-05
-1.636e-05
4.62542e-05
-2.57936e-05
6.28653e-05
-3.36644e-05
6.54898e-05
-3.60668e-05
4.47504e-05
-3.55999e-05
2.5268e-05
-3.67507e-05
1.08456e-05
-3.85214e-05
4.13308e-07
-3.98084e-05
-6.44034e-06
-4.02193e-05
-9.69551e-06
-3.96216e-05
-1.24118e-05
-3.81974e-05
-1.47916e-05
-3.56671e-05
-1.69737e-05
-3.04702e-05
-1.4886e-05
-2.05768e-05
-4.74793e-06
-1.09306e-05
3.73843e-06
6.23867e-06
6.53383e-06
4.21002e-05
2.41811e-05
8.6434e-05
9.44151e-05
0.000114275
0.000196692
0.00012928
0.000246576
0.000132135
0.000240785
0.000114144
0.000201594
7.3328e-05
0.000140634
3.63449e-05
7.86378e-05
1.39054e-05
3.99646e-05
6.24893e-06
1.95694e-05
2.76961e-06
1.40422e-05
1.31996e-05
-2.90304e-06
2.86923e-05
-9.62937e-06
4.17346e-05
-1.5526e-05
5.21855e-05
-1.90901e-05
6.64739e-05
-2.24147e-05
6.8863e-05
-2.55775e-05
4.79543e-05
-2.90737e-05
2.87999e-05
-3.29099e-05
1.47128e-05
-3.51611e-05
2.69281e-06
-3.70274e-05
-4.54437e-06
-3.82764e-05
-8.4132e-06
-3.82356e-05
-1.24156e-05
-3.69585e-05
-1.60307e-05
-3.45902e-05
-1.93053e-05
-2.85979e-05
-2.08449e-05
-1.88172e-05
-1.4494e-05
-1.10007e-05
-4.04038e-06
-1.47246e-06
-2.95542e-06
1.5497e-05
7.25611e-06
5.70407e-05
5.2944e-05
8.83139e-05
0.000165541
0.00010612
0.000228913
0.000119795
0.000227249
0.000118526
0.000202991
9.87914e-05
0.000160471
6.91854e-05
0.000108316
3.79365e-05
7.12572e-05
1.41039e-05
4.34257e-05
4.49521e-06
2.36638e-05
1.77041e-05
-6.33363e-06
3.50518e-05
-1.2893e-05
4.83248e-05
-1.69811e-05
5.63087e-05
-1.45474e-05
6.40844e-05
-9.80233e-06
6.41646e-05
-1.13299e-05
4.95207e-05
-2.06226e-05
3.81286e-05
-2.9652e-05
2.37704e-05
-3.22448e-05
5.31237e-06
-3.41834e-05
-2.57726e-06
-3.55593e-05
-7.00593e-06
-3.58742e-05
-1.20664e-05
-3.4631e-05
-1.72384e-05
-3.2185e-05
-2.17168e-05
-2.73938e-05
-2.56048e-05
-1.94018e-05
-2.24533e-05
-9.79639e-06
-1.36106e-05
-2.44742e-06
-1.02696e-05
4.24719e-06
6.00783e-07
2.67477e-05
3.04999e-05
5.62284e-05
0.000136168
7.76267e-05
0.000207647
9.82282e-05
0.000206775
0.000107563
0.000193775
0.000101072
0.000167068
8.16394e-05
0.00012783
5.77506e-05
9.51993e-05
2.88327e-05
7.2373e-05
8.23619e-06
4.42724e-05
2.59444e-05
-1.12329e-05
4.63107e-05
-1.50924e-05
5.22158e-05
-1.64969e-05
5.77486e-05
-1.21279e-05
5.97558e-05
-5.12354e-06
5.72023e-05
-6.51554e-06
5.09518e-05
-1.72599e-05
4.89053e-05
-2.74353e-05
3.398e-05
-3.07619e-05
8.66665e-06
-3.36084e-05
2.97148e-07
-3.27891e-05
-7.79539e-06
-3.27944e-05
-1.20296e-05
-3.14321e-05
-1.85683e-05
-2.8644e-05
-2.44737e-05
-2.42031e-05
-3.00173e-05
-1.69331e-05
-2.96943e-05
-8.64405e-06
-2.18673e-05
-3.75749e-06
-1.51213e-05
-1.28517e-06
-1.83133e-06
-1.94952e-06
3.12201e-05
1.61887e-05
0.00011814
4.08452e-05
0.000183123
6.52619e-05
0.000182482
8.31018e-05
0.000176052
8.78279e-05
0.00016245
7.83096e-05
0.000137438
6.15193e-05
0.000112054
4.05651e-05
9.33686e-05
1.70826e-05
6.77749e-05
4.30306e-05
-6.33623e-06
5.26813e-05
-1.26155e-05
5.8532e-05
-1.89857e-05
6.41569e-05
-2.25223e-05
6.33319e-05
-2.74272e-05
6.21478e-05
-3.66149e-05
6.0181e-05
-4.13188e-05
5.36514e-05
-4.36423e-05
3.63449e-05
-4.63788e-05
1.1442e-05
-3.96471e-05
-6.40116e-06
-3.07733e-05
-1.66419e-05
-2.90129e-05
-1.37619e-05
-2.75533e-05
-1.99993e-05
-2.45533e-05
-2.7447e-05
-2.03005e-05
-3.42467e-05
-1.35633e-05
-3.641e-05
-7.94939e-06
-2.7455e-05
-3.8475e-06
-1.91935e-05
-3.1656e-06
-2.47705e-06
-2.24069e-05
5.05282e-05
-1.56275e-05
0.000111493
1.11489e-05
0.0001565
3.3672e-05
0.000160094
5.1659e-05
0.000158192
6.31418e-05
0.000151085
6.57101e-05
0.00013497
6.09919e-05
0.00011685
5.29497e-05
0.000101469
3.603e-05
8.47294e-05
7.90726e-05
-1.15294e-05
6.42478e-05
-2.65753e-05
7.3616e-05
-4.03418e-05
7.79625e-05
-5.24078e-05
7.54367e-05
-6.03283e-05
7.01079e-05
-6.24665e-05
6.23593e-05
-5.97794e-05
5.10048e-05
-5.67729e-05
3.33785e-05
-5.65318e-05
1.12404e-05
-5.36972e-05
-9.19689e-06
-4.38213e-05
-2.64824e-05
-2.77097e-05
-2.98463e-05
-2.32889e-05
-2.43958e-05
-1.98713e-05
-3.08426e-05
-1.54232e-05
-3.8677e-05
-8.36705e-06
-4.34545e-05
-3.11058e-07
-3.55023e-05
7.63556e-06
-2.71309e-05
1.32822e-06
3.84455e-06
-3.14171e-05
8.33425e-05
-2.7223e-05
0.000107415
-8.95597e-07
0.000130319
1.81006e-05
0.00014125
3.23867e-05
0.000144037
4.42263e-05
0.000139365
5.25659e-05
0.000126727
5.72294e-05
0.000112262
5.87988e-05
9.99592e-05
4.44238e-05
9.91577e-05
0.000123537
-1.94728e-05
8.37592e-05
-3.56829e-05
8.98648e-05
-4.84657e-05
9.07827e-05
-5.82282e-05
8.52382e-05
-6.34073e-05
7.5326e-05
-6.41652e-05
6.31566e-05
-6.21544e-05
4.90336e-05
-5.98218e-05
3.10855e-05
-5.83732e-05
9.8308e-06
-5.67444e-05
-1.07871e-05
-5.4447e-05
-2.87418e-05
-4.25281e-05
-4.17304e-05
-2.09828e-05
-4.59172e-05
-1.4875e-05
-3.69335e-05
-8.77358e-06
-4.47647e-05
-1.97428e-06
-5.02471e-05
1.00331e-05
-4.75051e-05
2.14231e-05
-3.85141e-05
1.4864e-05
1.04284e-05
-4.07132e-06
0.000102337
-1.4076e-05
0.000117495
-2.01591e-06
0.000118344
1.19303e-05
0.000127386
2.44072e-05
0.00013166
3.56148e-05
0.000128247
4.42822e-05
0.000118133
5.18136e-05
0.000104789
5.62101e-05
9.5611e-05
3.9731e-05
0.00011568
0.000163314
-2.01248e-05
0.000103923
-3.5152e-05
0.000104932
-4.59138e-05
0.000101585
-5.32228e-05
9.25864e-05
-5.6871e-05
7.90133e-05
-5.7837e-05
6.41617e-05
-5.74285e-05
4.86643e-05
-5.67021e-05
3.03981e-05
-5.56132e-05
8.78068e-06
-5.31184e-05
-1.32435e-05
-4.96109e-05
-3.22117e-05
-4.3404e-05
-4.79006e-05
-2.49508e-05
-6.43414e-05
-1.14357e-05
-5.04314e-05
-3.80311e-06
-5.23848e-05
2.75431e-06
-5.67963e-05
1.3405e-05
-5.81454e-05
2.19073e-05
-4.69992e-05
2.55216e-05
6.84735e-06
4.66176e-05
8.12888e-05
4.92125e-05
0.000114955
4.10644e-05
0.000126549
3.6829e-05
0.000131687
3.80095e-05
0.000130539
4.18953e-05
0.000124416
4.45291e-05
0.000115548
4.15565e-05
0.000107804
2.6343e-05
0.000110863
5.83408e-06
0.000136224
0.000169184
-1.64491e-05
0.000120412
-2.90254e-05
0.000117547
-3.79109e-05
0.000110509
-4.37038e-05
9.84186e-05
-4.69442e-05
8.22926e-05
-4.87639e-05
6.602e-05
-4.97758e-05
4.97148e-05
-5.01025e-05
3.07633e-05
-4.92173e-05
7.93375e-06
-4.62887e-05
-1.61343e-05
-4.13284e-05
-3.71351e-05
-3.45104e-05
-5.46827e-05
-2.59562e-05
-7.28634e-05
-9.8728e-06
-6.64938e-05
-1.65476e-06
-6.05908e-05
3.80137e-06
-6.2242e-05
1.00068e-05
-6.43389e-05
1.34698e-05
-5.04415e-05
2.50435e-05
-4.69426e-06
5.85293e-05
4.78434e-05
8.65285e-05
8.70008e-05
9.76888e-05
0.000115435
9.63594e-05
0.000133061
8.80578e-05
0.000138884
7.58617e-05
0.000136653
5.98275e-05
0.000131621
3.85149e-05
0.000129153
1.41288e-05
0.000135285
-1.73609e-06
0.000152126
0.000167488
-1.28475e-05
0.000133299
-2.25478e-05
0.000127287
-2.94516e-05
0.000117452
-3.39803e-05
0.000102986
-3.70583e-05
8.54092e-05
-3.95741e-05
6.85743e-05
-4.14772e-05
5.16561e-05
-4.2457e-05
3.17812e-05
-4.2074e-05
7.58863e-06
-3.96749e-05
-1.84961e-05
-3.53617e-05
-4.14119e-05
-3.03628e-05
-5.96463e-05
-2.61829e-05
-7.70102e-05
-1.13347e-05
-8.13194e-05
-1.71688e-06
-7.01938e-05
3.47351e-06
-6.74194e-05
6.79532e-06
-6.76464e-05
8.96219e-06
-5.25843e-05
2.10171e-05
-1.67177e-05
4.97804e-05
1.91162e-05
7.94413e-05
5.73802e-05
9.99639e-05
9.49544e-05
0.000108562
0.000124504
0.000106036
0.00014145
9.46672e-05
0.000148061
7.63202e-05
0.000150005
5.2915e-05
0.000152595
2.85254e-05
0.000159713
9.09591e-06
0.000171596
0.000176625
-9.60995e-06
0.000142948
-1.67593e-05
0.000134476
-2.19952e-05
0.000122726
-2.54667e-05
0.000106497
-2.84415e-05
8.84226e-05
-3.13653e-05
7.15364e-05
-3.37009e-05
5.40298e-05
-3.50289e-05
3.31471e-05
-3.51152e-05
7.7125e-06
-3.36781e-05
-1.98962e-05
-3.07398e-05
-4.43142e-05
-2.73809e-05
-6.29701e-05
-2.52997e-05
-7.90578e-05
-1.56865e-05
-9.09077e-05
-4.67601e-06
-8.11874e-05
1.01262e-06
-7.30926e-05
3.92347e-06
-7.05405e-05
5.30376e-06
-5.39375e-05
1.6602e-05
-2.79847e-05
3.81237e-05
-2.37138e-06
6.27534e-05
3.27879e-05
8.37244e-05
7.40231e-05
9.662e-05
0.000111649
9.94216e-05
0.000138689
9.2692e-05
0.00015483
7.84282e-05
0.000164309
5.88922e-05
0.000172171
3.73627e-05
0.000181283
1.70909e-05
0.000191908
0.000193757
-6.95194e-06
0.000149939
-1.20786e-05
0.000139642
-1.58656e-05
0.000126553
-1.84826e-05
0.000109153
-2.1389e-05
9.13676e-05
-2.44738e-05
7.46595e-05
-2.6904e-05
5.6498e-05
-2.83253e-05
3.46062e-05
-2.88228e-05
8.24736e-06
-2.8369e-05
-2.03133e-05
-2.69324e-05
-4.5715e-05
-2.5265e-05
-6.46027e-05
-2.42356e-05
-8.00541e-05
-2.12692e-05
-9.38464e-05
-1.03923e-05
-9.20455e-05
-3.68595e-06
-7.97824e-05
2.3365e-07
-7.44403e-05
7.73348e-07
-5.44491e-05
9.98363e-06
-3.71642e-05
2.56063e-05
-1.79611e-05
4.47983e-05
1.36316e-05
6.34742e-05
5.53853e-05
7.71853e-05
9.79774e-05
8.28973e-05
0.000133017
8.00435e-05
0.000157725
7.00364e-05
0.000174357
5.51976e-05
0.000187051
3.78229e-05
0.000198699
1.96468e-05
0.000210126
0.000213444
-4.8848e-06
0.000154864
-8.46924e-06
0.000143266
-1.09292e-05
0.000129053
-1.30125e-05
0.000111275
-1.59154e-05
9.43091e-05
-1.89696e-05
7.7752e-05
-2.12822e-05
5.88486e-05
-2.26703e-05
3.6032e-05
-2.34316e-05
9.0459e-06
-2.37271e-05
-1.99813e-05
-2.33728e-05
-4.60336e-05
-2.26379e-05
-6.53029e-05
-2.25553e-05
-8.01031e-05
-2.37129e-05
-9.26595e-05
-1.85594e-05
-9.71776e-05
-1.15872e-05
-8.67374e-05
-9.2886e-06
-7.67166e-05
-6.15449e-06
-5.7555e-05
1.31142e-06
-4.45997e-05
1.28504e-05
-2.94678e-05
2.7801e-05
-1.2842e-06
4.38603e-05
3.9363e-05
5.71756e-05
8.47007e-05
6.43633e-05
0.000125869
6.42944e-05
0.000157834
5.79837e-05
0.000180708
4.73235e-05
0.000197752
3.39247e-05
0.000212139
1.87431e-05
0.000225348
0.000232228
-3.51747e-06
0.000158421
-5.78823e-06
0.000145576
-7.0584e-06
0.000130362
-8.97777e-06
0.000113233
-1.19067e-05
9.72767e-05
-1.47793e-05
8.0663e-05
-1.68412e-05
6.09485e-05
-1.80805e-05
3.7309e-05
-1.88909e-05
9.89342e-06
-1.95428e-05
-1.9293e-05
-1.98848e-05
-4.56561e-05
-1.99234e-05
-6.52299e-05
-2.03711e-05
-7.96223e-05
-2.1689e-05
-9.1312e-05
-2.29207e-05
-9.59226e-05
-1.87564e-05
-9.08827e-05
-1.74005e-05
-7.80487e-05
-1.34967e-05
-6.14306e-05
-7.28543e-06
-5.07807e-05
1.44627e-06
-3.81677e-05
1.31903e-05
-1.29942e-05
2.68652e-05
2.57243e-05
3.93674e-05
7.22366e-05
4.73327e-05
0.000117943
4.91858e-05
0.000156021
4.55625e-05
0.000184371
3.81458e-05
0.000205209
2.82417e-05
0.000222084
1.62268e-05
0.000237404
0.000248496
-2.5871e-06
0.000161048
-3.70743e-06
0.000146736
-4.26102e-06
0.000130956
-6.31329e-06
0.000115325
-9.22987e-06
0.000100232
-1.18207e-05
8.32923e-05
-1.35411e-05
6.2707e-05
-1.45077e-05
3.83133e-05
-1.51818e-05
1.06045e-05
-1.59201e-05
-1.85184e-05
-1.66175e-05
-4.49233e-05
-1.70263e-05
-6.47868e-05
-1.7515e-05
-7.91006e-05
-1.89864e-05
-8.98112e-05
-2.13634e-05
-9.35216e-05
-2.20826e-05
-9.01428e-05
-2.07211e-05
-7.93857e-05
-1.86577e-05
-6.34658e-05
-1.40717e-05
-5.53367e-05
-7.59103e-06
-4.46168e-05
1.61381e-06
-2.21655e-05
1.31851e-05
1.41888e-05
2.47607e-05
6.06985e-05
3.31082e-05
0.000109634
3.62767e-05
0.000152892
3.45018e-05
0.000186187
2.93667e-05
0.000210385
2.22532e-05
0.000229238
1.32286e-05
0.00024647
0.000261766
-1.45901e-06
0.000162546
-1.87188e-06
0.000147189
-2.51376e-06
0.000131637
-4.79412e-06
0.000117643
-7.66514e-06
0.000103142
-9.95049e-06
8.56161e-05
-1.12443e-05
6.40389e-05
-1.17593e-05
3.88659e-05
-1.20747e-05
1.0957e-05
-1.27275e-05
-1.78292e-05
-1.36625e-05
-4.3953e-05
-1.45365e-05
-6.38786e-05
-1.55285e-05
-7.80758e-05
-1.72397e-05
-8.80707e-05
-1.93187e-05
-9.14186e-05
-2.15748e-05
-8.78651e-05
-2.19041e-05
-7.90315e-05
-2.13037e-05
-6.40379e-05
-1.8612e-05
-5.79984e-05
-1.408e-05
-4.91175e-05
-7.00421e-06
-2.92081e-05
2.72334e-06
4.4966e-06
1.33809e-05
5.00782e-05
2.19304e-05
0.000101123
2.60696e-05
0.000148792
2.55801e-05
0.000186716
2.19324e-05
0.000214073
1.67188e-05
0.000234493
1.03004e-05
0.00025293
0.000272107
-1.6515e-07
0.000162752
-4.17788e-07
0.000147481
-1.69101e-06
0.000132949
-4.20916e-06
0.0001202
-6.98777e-06
0.000105959
-8.93145e-06
8.75982e-05
-9.69038e-06
6.48359e-05
-9.601e-06
3.88141e-05
-9.41567e-06
1.08086e-05
-9.79981e-06
-1.7409e-05
-1.08801e-05
-4.28376e-05
-1.2187e-05
-6.25378e-05
-1.34603e-05
-7.677e-05
-1.50769e-05
-8.64249e-05
-1.77578e-05
-8.87134e-05
-2.05932e-05
-8.50078e-05
-2.23251e-05
-7.72746e-05
-2.23176e-05
-6.40171e-05
-2.11797e-05
-5.91065e-05
-1.83886e-05
-5.18775e-05
-1.30903e-05
-3.44735e-05
-5.01874e-06
-3.54003e-06
4.7197e-06
4.03767e-05
1.34062e-05
9.24754e-05
1.84037e-05
0.000143835
1.8945e-05
0.000186215
1.62743e-05
0.000216785
1.22003e-05
0.000238608
7.67831e-06
0.000257494
0.000279827
9.42953e-07
0.000161849
3.05251e-07
0.000148159
-1.67714e-06
0.000134971
-4.43099e-06
0.000122994
-7.01606e-06
0.000108583
-8.45624e-06
8.90769e-05
-8.50472e-06
6.49225e-05
-7.67242e-06
3.80193e-05
-6.89483e-06
1.00679e-05
-7.03902e-06
-1.72287e-05
-8.25803e-06
-4.15835e-05
-9.85711e-06
-6.09048e-05
-1.13581e-05
-7.52368e-05
-1.34479e-05
-8.43063e-05
-1.63278e-05
-8.58093e-05
-1.87839e-05
-8.25295e-05
-2.119e-05
-7.48436e-05
-2.24782e-05
-6.27007e-05
-2.26389e-05
-5.89163e-05
-2.11707e-05
-5.33149e-05
-1.73085e-05
-3.83032e-05
-1.06994e-05
-1.01145e-05
-1.9094e-06
3.16232e-05
6.83469e-06
8.37696e-05
1.27061e-05
0.000138003
1.4289e-05
0.000184673
1.23766e-05
0.000218738
8.88296e-06
0.000242143
5.50048e-06
0.000260918
0.00028537
1.17726e-06
0.000160712
-6.90979e-09
0.000149383
-2.49983e-06
0.000137503
-5.34755e-06
0.000125881
-7.57163e-06
0.000110846
-8.27558e-06
8.98194e-05
-7.40716e-06
6.40922e-05
-5.76477e-06
3.64145e-05
-4.49281e-06
8.83273e-06
-4.46425e-06
-1.72213e-05
-5.79342e-06
-4.02194e-05
-7.72226e-06
-5.89423e-05
-9.62152e-06
-7.33056e-05
-1.21647e-05
-8.17348e-05
-1.54681e-05
-8.24819e-05
-1.8868e-05
-7.91072e-05
-2.14653e-05
-7.22213e-05
-2.27054e-05
-6.14324e-05
-2.33959e-05
-5.81963e-05
-2.29194e-05
-5.37609e-05
-2.02604e-05
-4.093e-05
-1.49294e-05
-1.54113e-05
-7.13121e-06
2.38613e-05
1.49696e-06
7.51794e-05
8.23221e-06
0.000131307
1.10195e-05
0.000181926
9.94823e-06
0.00021985
6.76069e-06
0.000245371
3.87047e-06
0.000263849
0.000289282
2.09862e-07
0.000160542
-1.34533e-06
0.000150978
-4.14471e-06
0.000140342
-6.88989e-06
0.000128665
-8.45398e-06
0.000112449
-8.12136e-06
8.95253e-05
-6.19461e-06
6.22035e-05
-3.81376e-06
3.4071e-05
-2.18868e-06
7.24431e-06
-2.13205e-06
-1.72421e-05
-3.57389e-06
-3.87428e-05
-5.64482e-06
-5.68378e-05
-7.80962e-06
-7.11092e-05
-1.07028e-05
-7.88137e-05
-1.41078e-05
-7.90531e-05
-1.7702e-05
-7.54907e-05
-2.04833e-05
-6.9415e-05
-2.2032e-05
-5.98559e-05
-2.35459e-05
-5.66532e-05
-2.39087e-05
-5.33678e-05
-2.23134e-05
-4.24935e-05
-1.82072e-05
-1.94837e-05
-1.14532e-05
1.71432e-05
-3.15792e-06
6.69219e-05
4.30706e-06
0.000123881
8.45371e-06
0.000177819
8.53055e-06
0.000219814
5.88053e-06
0.000248062
2.93798e-06
0.000266833
0.000292262
-1.03771e-06
0.000161619
-3.26388e-06
0.000153243
-6.39905e-06
0.000143517
-8.84894e-06
0.000131154
-9.3422e-06
0.000112981
-7.67408e-06
8.78958e-05
-4.75059e-06
5.9318e-05
-1.83313e-06
3.11909e-05
-3.13158e-08
5.47902e-06
8.45533e-08
-1.73224e-05
-1.32144e-06
-3.73022e-05
-3.42716e-06
-5.46988e-05
-6.09952e-06
-6.84056e-05
-9.31601e-06
-7.55698e-05
-1.31946e-05
-7.51507e-05
-1.69357e-05
-7.17272e-05
-1.97068e-05
-6.66192e-05
-2.11814e-05
-5.83535e-05
-2.36276e-05
-5.41779e-05
-2.4579e-05
-5.23865e-05
-2.38822e-05
-4.31588e-05
-2.09101e-05
-2.24223e-05
-1.52545e-05
1.15231e-05
-7.48184e-06
5.91865e-05
4.88333e-07
0.00011595
6.04762e-06
0.0001723
7.61127e-06
0.000218291
5.88531e-06
0.000249829
2.66987e-06
0.00027009
0.000294973
-2.43679e-06
0.000164096
-5.59331e-06
0.00015644
-9.01637e-06
0.00014698
-1.08121e-05
0.000132989
-9.86453e-06
0.000112073
-6.79869e-06
8.48686e-05
-3.09814e-06
5.56554e-05
1.17818e-07
2.80121e-05
2.00176e-06
3.63141e-06
2.15904e-06
-1.74442e-05
8.29856e-07
-3.59385e-05
-1.06047e-06
-5.27753e-05
-4.28975e-06
-6.51456e-05
-7.74307e-06
-7.20899e-05
-1.13492e-05
-7.15211e-05
-1.50068e-05
-6.80472e-05
-1.85516e-05
-6.30498e-05
-2.08766e-05
-5.60011e-05
-2.34873e-05
-5.15384e-05
-2.49037e-05
-5.09404e-05
-2.50669e-05
-4.29644e-05
-2.32593e-05
-2.41968e-05
-1.87703e-05
7.06927e-06
-1.16889e-05
5.21421e-05
-3.502e-06
0.000107802
3.32587e-06
0.000165512
6.54373e-06
0.000215113
6.02802e-06
0.000250385
2.84126e-06
0.000273317
0.000297855
-4.42392e-06
0.00016856
-8.52228e-06
0.000160578
-1.16749e-05
0.000150172
-1.22172e-05
0.000133571
-9.63645e-06
0.000109531
-5.45015e-06
8.07209e-05
-1.2634e-06
5.15065e-05
2.04656e-06
2.47391e-05
3.83493e-06
1.87917e-06
3.84052e-06
-1.74145e-05
2.21069e-06
-3.42744e-05
-5.09104e-07
-5.00226e-05
-3.63373e-06
-6.19906e-05
-6.86063e-06
-6.88373e-05
-1.09635e-05
-6.73947e-05
-1.48637e-05
-6.41246e-05
-1.84842e-05
-5.94049e-05
-2.08908e-05
-5.35675e-05
-2.28879e-05
-4.95129e-05
-2.50735e-05
-4.87255e-05
-2.61546e-05
-4.18524e-05
-2.54894e-05
-2.48291e-05
-2.21778e-05
3.79254e-06
-1.59177e-05
4.59187e-05
-7.75662e-06
9.96787e-05
5.11712e-08
0.000157744
4.95249e-06
0.000210252
5.88479e-06
0.000249493
3.23306e-06
0.000276009
0.000301129
-6.97222e-06
0.000175572
-1.15687e-05
0.000165214
-1.3716e-05
0.000152359
-1.25919e-05
0.000132487
-8.56426e-06
0.000105543
-3.63879e-06
7.58339e-05
8.09157e-07
4.70962e-05
4.11025e-06
2.14748e-05
5.79536e-06
2.29968e-07
5.69699e-06
-1.72811e-05
3.97074e-06
-3.25142e-05
1.26141e-06
-4.72808e-05
-1.70172e-06
-5.89976e-05
-5.31684e-06
-6.51972e-05
-9.77003e-06
-6.2918e-05
-1.44478e-05
-5.94247e-05
-1.80686e-05
-5.57599e-05
-2.05112e-05
-5.10985e-05
-2.25055e-05
-4.74906e-05
-2.58112e-05
-4.53907e-05
-2.76181e-05
-4.00148e-05
-2.79171e-05
-2.44975e-05
-2.56376e-05
1.5476e-06
-2.0159e-05
4.04763e-05
-1.21587e-05
9.17164e-05
-3.66473e-06
0.000149289
2.70384e-06
0.000203923
5.0138e-06
0.000247224
3.24529e-06
0.000277818
0.000304414
-9.07852e-06
0.000184691
-1.36973e-05
0.000169873
-1.45147e-05
0.000153216
-1.16619e-05
0.000129674
-6.67288e-06
0.000100593
-1.37722e-06
7.05766e-05
3.14221e-06
4.26142e-05
6.33803e-06
1.83155e-05
7.90162e-06
-1.29799e-06
7.68283e-06
-1.70276e-05
5.90459e-06
-3.07023e-05
3.123e-06
-4.4467e-05
-8.93313e-08
-5.5756e-05
-4.37934e-06
-6.08824e-05
-8.94348e-06
-5.8331e-05
-1.29889e-05
-5.53571e-05
-1.71292e-05
-5.15957e-05
-2.04381e-05
-4.77638e-05
-2.30499e-05
-4.48513e-05
-2.68711e-05
-4.15407e-05
-2.94222e-05
-3.74332e-05
-3.06049e-05
-2.32823e-05
-2.91691e-05
1.46027e-07
-2.43255e-05
3.56688e-05
-1.65045e-05
8.3933e-05
-7.52332e-06
0.000140347
-3.08177e-08
0.000196471
3.44373e-06
0.000243789
2.63104e-06
0.00027867
0.000307086
-9.79885e-06
0.00019453
-1.41362e-05
0.00017425
-1.36756e-05
0.000152796
-9.63665e-06
0.000125674
-4.1594e-06
9.51547e-05
1.25512e-06
6.52002e-05
5.71786e-06
3.81887e-05
8.73071e-06
1.53389e-05
1.01276e-05
-2.65956e-06
9.77544e-06
-1.66411e-05
7.93377e-06
-2.88273e-05
4.99671e-06
-4.14981e-05
1.44888e-06
-5.21794e-05
-2.85919e-06
-5.65493e-05
-7.57286e-06
-5.35957e-05
-1.27814e-05
-5.01268e-05
-1.74195e-05
-4.69341e-05
-2.0938e-05
-4.42199e-05
-2.4089e-05
-4.16734e-05
-2.79364e-05
-3.76648e-05
-3.14559e-05
-3.38834e-05
-3.35243e-05
-2.11818e-05
-3.28066e-05
-5.37703e-07
-2.83868e-05
3.12847e-05
-2.06336e-05
7.62171e-05
-1.12929e-05
0.000131045
-2.85481e-06
0.000188072
1.89222e-06
0.000239083
1.99194e-06
0.000278611
0.000309119
-9.54473e-06
0.000204115
-1.32678e-05
0.000178013
-1.15488e-05
0.000151117
-6.87786e-06
0.000121043
-1.20988e-06
8.95255e-05
4.1732e-06
5.9855e-05
8.48932e-06
3.39095e-05
1.13148e-05
1.25493e-05
1.25233e-05
-3.83302e-06
1.20087e-05
-1.60925e-05
1.00184e-05
-2.68041e-05
6.74299e-06
-3.81913e-05
2.7253e-06
-4.81335e-05
-2.32911e-06
-5.14706e-05
-7.74859e-06
-4.81548e-05
-1.27798e-05
-4.50737e-05
-1.74683e-05
-4.22225e-05
-2.15799e-05
-4.00835e-05
-2.53353e-05
-3.78917e-05
-2.95568e-05
-3.34151e-05
-3.38137e-05
-2.95965e-05
-3.66298e-05
-1.83337e-05
-3.65171e-05
-6.16686e-07
-3.23876e-05
2.71906e-05
-2.45982e-05
6.84649e-05
-1.50161e-05
0.000121501
-5.84525e-06
0.000178941
4.57764e-07
0.00023282
1.74285e-06
0.000277367
0.000310902
-8.83817e-06
0.000212993
-1.13874e-05
0.000180603
-8.71913e-06
0.000148489
-3.6805e-06
0.000116044
2.08077e-06
8.38028e-05
7.35702e-06
5.46164e-05
1.14849e-05
2.98181e-05
1.41516e-05
9.91824e-06
1.51659e-05
-4.81277e-06
1.44675e-05
-1.53606e-05
1.23086e-05
-2.46127e-05
8.5378e-06
-3.43899e-05
3.93534e-06
-4.35036e-05
-1.35889e-06
-4.61532e-05
-6.81483e-06
-4.26768e-05
-1.26031e-05
-3.92639e-05
-1.80666e-05
-3.67363e-05
-2.26539e-05
-3.5472e-05
-2.67812e-05
-3.37384e-05
-3.12367e-05
-2.89317e-05
-3.60455e-05
-2.47579e-05
-3.94401e-05
-1.49075e-05
-3.99308e-05
-9.25187e-08
-3.63007e-05
2.35957e-05
-2.86876e-05
6.08887e-05
-1.90131e-05
0.000111866
-9.34422e-06
0.000169313
-1.40122e-06
0.000224918
1.5971e-06
0.000274409
0.000312539
-8.01439e-06
0.000221047
-9.19628e-06
0.000181825
-5.68435e-06
0.000145017
-1.92705e-07
0.000110592
5.66213e-06
7.79863e-05
1.08251e-05
4.94907e-05
1.47956e-05
2.58838e-05
1.7286e-05
7.46296e-06
1.80359e-05
-5.52864e-06
1.71134e-05
-1.4405e-05
1.48585e-05
-2.23259e-05
1.00536e-05
-2.95549e-05
4.88916e-06
-3.83126e-05
-1.09885e-06
-4.01429e-05
-7.25817e-06
-3.64955e-05
-1.35282e-05
-3.29723e-05
-1.92641e-05
-3.0978e-05
-2.41451e-05
-3.05673e-05
-2.84301e-05
-2.9428e-05
-3.27011e-05
-2.46331e-05
-3.7747e-05
-1.96826e-05
-4.14117e-05
-1.12114e-05
-4.25117e-05
1.0406e-06
-3.98664e-05
2.09851e-05
-3.30708e-05
5.41299e-05
-2.36861e-05
0.00010252
-1.37957e-05
0.000159463
-4.19401e-06
0.000215358
1.66228e-06
0.000268594
0.000314242
-7.24986e-06
0.000228338
-7.00254e-06
0.000181619
-2.40775e-06
0.000140462
3.57591e-06
0.000104647
9.49983e-06
7.21004e-05
1.45843e-05
4.44432e-05
1.84021e-05
2.21018e-05
2.05871e-05
5.31258e-06
2.08233e-05
-5.73126e-06
1.92205e-05
-1.27697e-05
1.5967e-05
-1.90412e-05
1.1036e-05
-2.45946e-05
5.69466e-06
-3.29455e-05
-8.72596e-07
-3.35535e-05
-7.55042e-06
-2.97961e-05
-1.4424e-05
-2.60772e-05
-2.06025e-05
-2.47772e-05
-2.58049e-05
-2.53417e-05
-3.00924e-05
-2.51156e-05
-3.35777e-05
-2.11206e-05
-3.88527e-05
-1.43783e-05
-4.22801e-05
-7.75298e-06
-4.3939e-05
2.7323e-06
-4.27657e-05
1.98463e-05
-3.76916e-05
4.90923e-05
-2.93595e-05
9.42262e-05
-1.98228e-05
0.000149967
-9.28417e-06
0.000204861
-4.63073e-07
0.000259816
0.000313821
-6.52428e-06
0.000234904
-4.66004e-06
0.000179795
1.07611e-06
0.000134765
7.56075e-06
9.82012e-05
1.36051e-05
6.60936e-05
1.86925e-05
3.93924e-05
2.23712e-05
1.84584e-05
2.41543e-05
3.56356e-06
2.37958e-05
-5.33979e-06
2.14416e-05
-1.03837e-05
1.74665e-05
-1.50357e-05
1.28029e-05
-1.99027e-05
6.42753e-06
-2.65454e-05
-8.21418e-07
-2.62825e-05
-8.2664e-06
-2.23302e-05
-1.54836e-05
-1.8838e-05
-2.18112e-05
-1.84272e-05
-2.72559e-05
-1.9874e-05
-3.17315e-05
-2.06157e-05
-3.51507e-05
-1.76749e-05
-3.92785e-05
-1.02216e-05
-4.23526e-05
-4.64823e-06
-4.45248e-05
4.93692e-06
-4.4918e-05
2.02736e-05
-4.21397e-05
4.63501e-05
-3.57568e-05
8.78819e-05
-2.73645e-05
0.000141615
-1.75357e-05
0.000195075
-6.265e-06
0.00024859
0.0003076
-5.5746e-06
0.00024052
-1.88296e-06
0.000176144
4.81546e-06
0.000128107
1.16793e-05
9.13759e-05
1.78972e-05
5.99131e-05
2.30456e-05
3.42801e-05
2.65377e-05
1.5001e-05
2.78114e-05
2.3234e-06
2.6776e-05
-4.2721e-06
2.37718e-05
-7.34847e-06
1.86249e-05
-9.85932e-06
1.37285e-05
-1.49791e-05
6.71765e-06
-1.95106e-05
-1.13922e-06
-1.84037e-05
-8.98446e-06
-1.44631e-05
-1.59741e-05
-1.1826e-05
-2.22722e-05
-1.21068e-05
-2.80086e-05
-1.41149e-05
-3.28754e-05
-1.57252e-05
-3.64016e-05
-1.4123e-05
-3.87073e-05
-7.88769e-06
-4.29882e-05
-3.37092e-07
-4.5153e-05
7.13371e-06
-4.62964e-05
2.14507e-05
-4.53005e-05
4.539e-05
-4.12833e-05
8.39031e-05
-3.52632e-05
0.000135636
-2.80274e-05
0.000187884
-1.61064e-05
0.000236715
0.000291542
-4.11186e-06
0.000244673
1.53313e-06
0.00017054
8.76083e-06
0.000120919
1.58835e-05
8.42915e-05
2.232e-05
5.35136e-05
2.74748e-05
2.91609e-05
3.05585e-05
1.19514e-05
3.10871e-05
1.82761e-06
2.90974e-05
-2.25095e-06
2.44761e-05
-2.69691e-06
1.96068e-05
-4.96147e-06
1.43284e-05
-9.6747e-06
6.91642e-06
-1.20753e-05
-1.28588e-06
-1.01793e-05
-8.99558e-06
-6.7323e-06
-1.57739e-05
-5.02686e-06
-2.21994e-05
-5.65876e-06
-2.82773e-05
-8.01431e-06
-3.37251e-05
-1.02541e-05
-3.79563e-05
-9.86676e-06
-4.07653e-05
-5.05131e-06
-4.45195e-05
3.4468e-06
-4.57522e-05
8.39802e-06
-4.6616e-05
2.23478e-05
-4.61217e-05
4.49311e-05
-4.3731e-05
8.15505e-05
-4.05221e-05
0.000132469
-3.69795e-05
0.000184386
-2.67326e-05
0.000226516
0.000264862
-8.38976e-07
0.000245554
5.71238e-06
0.00016403
1.28484e-05
0.000113822
2.01266e-05
7.70512e-05
2.67072e-05
4.69694e-05
3.1605e-05
2.4298e-05
3.38941e-05
9.69576e-06
3.33015e-05
2.45211e-06
2.94213e-05
1.65987e-06
2.51231e-05
1.63055e-06
2.09637e-05
-7.74583e-07
1.49471e-05
-3.63294e-06
7.18597e-06
-4.29115e-06
-1.02834e-06
-1.9426e-06
-8.37109e-06
6.32605e-07
-1.511e-05
1.73575e-06
-2.16986e-05
9.51667e-07
-2.80192e-05
-1.67119e-06
-3.40461e-05
-4.20429e-06
-3.90319e-05
-4.85647e-06
-4.22121e-05
-1.84431e-06
-4.38883e-05
5.15202e-06
-4.5211e-05
9.75158e-06
-4.56973e-05
2.2867e-05
-4.47809e-05
4.40498e-05
-4.22751e-05
7.90824e-05
-3.97912e-05
0.000130026
-3.86348e-05
0.000183274
-2.97947e-05
0.000217725
0.000235121
3.94188e-06
0.000241655
1.02825e-05
0.00015773
1.69584e-05
0.000107185
2.43008e-05
6.97463e-05
3.07631e-05
4.05431e-05
3.50419e-05
2.00533e-05
3.61051e-05
8.66505e-06
3.34041e-05
5.18421e-06
2.9689e-05
5.40458e-06
2.62584e-05
5.08927e-06
2.15049e-05
4.00531e-06
1.49454e-05
2.95096e-06
7.1545e-06
3.52259e-06
-6.09623e-07
5.84408e-06
-7.65287e-06
7.70018e-06
-1.43529e-05
8.45834e-06
-2.07328e-05
7.3537e-06
-2.7151e-05
4.76951e-06
-3.36359e-05
2.30347e-06
-3.92768e-05
8.08438e-07
-4.29679e-05
1.8729e-06
-4.38443e-05
6.05668e-06
-4.57094e-05
1.16469e-05
-4.50927e-05
2.22827e-05
-4.26477e-05
4.16392e-05
-3.83667e-05
7.48387e-05
-3.4406e-05
0.000126106
-3.33505e-05
0.000182264
-2.6079e-05
0.000210502
0.000209093
8.35542e-06
0.000233345
1.42787e-05
0.000151848
2.07766e-05
0.000100726
2.80535e-05
6.25064e-05
3.40672e-05
3.45644e-05
3.73622e-05
1.67916e-05
3.61188e-05
9.93997e-06
3.30927e-05
8.24019e-06
2.99873e-05
8.53838e-06
2.59202e-05
9.18334e-06
2.05475e-05
9.40325e-06
1.38878e-05
9.63433e-06
6.55553e-06
1.08775e-05
-4.13339e-07
1.28355e-05
-6.92412e-06
1.42349e-05
-1.29709e-05
1.45292e-05
-1.87969e-05
1.32017e-05
-2.50546e-05
1.10495e-05
-3.15999e-05
8.87136e-06
-3.767e-05
6.902e-06
-4.2265e-05
6.4931e-06
-4.43008e-05
8.1197e-06
-4.51406e-05
1.2516e-05
-4.45817e-05
2.17554e-05
-4.03896e-05
3.74808e-05
-3.36789e-05
6.81646e-05
-2.59644e-05
0.000118432
-2.25837e-05
0.000178928
-1.83503e-05
0.000206316
0.000190791
1.03287e-05
0.000223062
1.66136e-05
0.000145604
2.3663e-05
9.37155e-05
3.07723e-05
5.54333e-05
3.57116e-05
2.96593e-05
3.7673e-05
1.48623e-05
3.52972e-05
1.2346e-05
3.22795e-05
1.12866e-05
2.83791e-05
1.24658e-05
2.36712e-05
1.39168e-05
1.81362e-05
1.49622e-05
1.18821e-05
1.59111e-05
5.48615e-06
1.72957e-05
-3.67878e-07
1.87116e-05
-5.70326e-06
1.95924e-05
-1.0672e-05
1.95199e-05
-1.58943e-05
1.84458e-05
-2.16614e-05
1.68384e-05
-2.77679e-05
1.49998e-05
-3.37865e-05
1.29434e-05
-3.89236e-05
1.16544e-05
-4.22094e-05
1.14315e-05
-4.29612e-05
1.32957e-05
-4.21521e-05
2.09765e-05
-3.74582e-05
3.28187e-05
-2.93128e-05
6.00548e-05
-1.847e-05
0.000107629
-1.16721e-05
0.000172174
-9.54511e-06
0.000204236
0.000181292
9.94188e-06
0.000213167
1.73995e-05
0.000138188
2.54909e-05
8.56621e-05
3.22502e-05
4.87094e-05
3.56785e-05
2.6264e-05
3.47835e-05
1.5788e-05
3.30697e-05
1.40886e-05
2.93219e-05
1.50614e-05
2.47736e-05
1.70395e-05
1.98375e-05
1.88768e-05
1.4602e-05
2.02202e-05
9.21793e-06
2.13168e-05
4.14102e-06
2.23937e-05
-3.3548e-07
2.3209e-05
-4.31066e-06
2.35885e-05
-8.2061e-06
2.34362e-05
-1.25335e-05
2.2794e-05
-1.74275e-05
2.17531e-05
-2.27562e-05
2.03495e-05
-2.83517e-05
1.85604e-05
-3.35471e-05
1.68727e-05
-3.75987e-05
1.55077e-05
-3.94098e-05
1.51334e-05
-3.71178e-05
1.87135e-05
-3.39201e-05
2.96523e-05
-2.57073e-05
5.18761e-05
-1.36127e-05
9.55733e-05
-3.56263e-06
0.000162168
-2.97483e-06
0.000203695
0.000178363
9.23497e-06
0.000203978
1.80296e-05
0.000129434
2.6968e-05
7.67608e-05
3.30944e-05
4.26171e-05
3.46248e-05
2.4765e-05
3.28577e-05
1.75839e-05
2.9373e-05
1.76001e-05
2.46762e-05
1.97832e-05
1.97098e-05
2.20292e-05
1.49053e-05
2.37031e-05
1.03748e-05
2.47713e-05
6.2159e-06
2.54956e-05
2.60831e-06
2.60208e-05
-4.86257e-07
2.63228e-05
-3.2847e-06
2.6406e-05
-6.12901e-06
2.62995e-05
-9.3314e-06
2.60153e-05
-1.3066e-05
2.55068e-05
-1.73812e-05
2.46842e-05
-2.22693e-05
2.34685e-05
-2.72845e-05
2.19089e-05
-3.18201e-05
2.00661e-05
-3.50057e-05
1.83437e-05
-3.47556e-05
1.84904e-05
-3.11104e-05
2.60375e-05
-2.506e-05
4.58587e-05
-1.19166e-05
8.24674e-05
2.55114e-06
0.000147744
3.30466e-06
0.000202989
0.000181713
9.40076e-06
0.000194623
1.93329e-05
0.000119542
2.82458e-05
6.78838e-05
3.20517e-05
3.88436e-05
3.24646e-05
2.43814e-05
2.93139e-05
2.07616e-05
2.421e-05
2.27286e-05
1.87797e-05
2.52361e-05
1.38954e-05
2.69344e-05
9.81526e-06
2.78028e-05
6.42844e-06
2.81767e-05
3.60839e-06
2.83336e-05
1.24998e-06
2.83967e-05
-8.11752e-07
2.84018e-05
-2.75512e-06
2.83664e-05
-4.74881e-06
2.83101e-05
-6.95232e-06
2.82358e-05
-9.53654e-06
2.81082e-05
-1.26801e-05
2.78454e-05
-1.65335e-05
2.734e-05
-2.10386e-05
2.64331e-05
-2.58838e-05
2.49318e-05
-3.03062e-05
2.27886e-05
-3.27759e-05
2.0985e-05
-3.04918e-05
2.37811e-05
-2.51993e-05
4.05971e-05
-1.269e-05
6.99938e-05
4.52542e-06
0.000130571
7.84435e-06
0.000199718
0.000189604
1.07416e-05
0.000183927
2.15417e-05
0.000108781
2.77007e-05
6.1759e-05
3.07052e-05
3.58694e-05
2.94241e-05
2.56897e-05
2.41216e-05
2.60887e-05
1.82713e-05
2.86014e-05
1.34305e-05
3.00973e-05
9.79228e-06
3.05916e-05
6.97825e-06
3.06346e-05
4.63539e-06
3.05364e-05
2.58694e-06
3.03983e-05
7.34412e-07
3.02649e-05
-1.00247e-06
3.0154e-05
-2.69099e-06
3.00701e-05
-4.38463e-06
3.00188e-05
-6.13956e-06
3.00059e-05
-8.04093e-06
3.0025e-05
-1.0226e-05
3.00463e-05
-1.28863e-05
3.00167e-05
-1.626e-05
2.98242e-05
-2.05366e-05
2.9227e-05
-2.54986e-05
2.77709e-05
-2.99601e-05
2.54691e-05
-3.08123e-05
2.46588e-05
-2.44306e-05
3.42443e-05
-1.58455e-05
6.14422e-05
1.35218e-06
0.000113413
1.00511e-05
0.000191067
0.000199703
1.16631e-05
0.00017231
2.2246e-05
9.8236e-05
2.76481e-05
5.63891e-05
2.93768e-05
3.41687e-05
2.49289e-05
3.01628e-05
1.90839e-05
3.19566e-05
1.46208e-05
3.30852e-05
1.14576e-05
3.32797e-05
8.90876e-06
3.31583e-05
6.64333e-06
3.29169e-05
4.5465e-06
3.26491e-05
2.55975e-06
3.24002e-05
6.54032e-07
3.21854e-05
-1.19079e-06
3.20132e-05
-2.993e-06
3.18864e-05
-4.7642e-06
3.18041e-05
-6.51691e-06
3.17727e-05
-8.28443e-06
3.18068e-05
-1.01368e-05
3.19134e-05
-1.21806e-05
3.20758e-05
-1.45705e-05
3.22302e-05
-1.75665e-05
3.22403e-05
-2.1613e-05
3.18361e-05
-2.66372e-05
3.0514e-05
-3.03918e-05
2.84368e-05
-2.75522e-05
3.14314e-05
-1.98372e-05
5.37586e-05
-3.7963e-06
9.74106e-05
1.0343e-05
0.000176974
0.000210095
1.35724e-05
0.000158784
2.13267e-05
9.05183e-05
2.81097e-05
4.96364e-05
2.63777e-05
3.59271e-05
2.13269e-05
3.52375e-05
1.74033e-05
3.5902e-05
1.44846e-05
3.60245e-05
1.18789e-05
3.59044e-05
9.43984e-06
3.56151e-05
7.11068e-06
3.52625e-05
4.86833e-06
3.4907e-05
2.69762e-06
3.45856e-05
5.85037e-07
3.43121e-05
-1.46617e-06
3.40782e-05
-3.46555e-06
3.38993e-05
-5.41267e-06
3.37646e-05
-7.3114e-06
3.36849e-05
-9.17947e-06
3.36884e-05
-1.10554e-05
3.38032e-05
-1.30035e-05
3.40384e-05
-1.51025e-05
3.43446e-05
-1.74594e-05
3.46137e-05
-2.03198e-05
3.47142e-05
-2.41997e-05
3.44134e-05
-2.89942e-05
3.3253e-05
-3.03679e-05
3.283e-05
-2.23063e-05
4.57261e-05
-1.03608e-05
8.5501e-05
7.34329e-06
0.000159316
0.000217488
1.45612e-05
0.00014427
2.39878e-05
8.11275e-05
2.73471e-05
4.6306e-05
2.43241e-05
3.89755e-05
2.11439e-05
3.84416e-05
1.84678e-05
3.86008e-05
1.57982e-05
3.87153e-05
1.31142e-05
3.86079e-05
1.04069e-05
3.83402e-05
7.73509e-06
3.79505e-05
5.15466e-06
3.75025e-05
2.72065e-06
3.70338e-05
3.90294e-07
3.6656e-05
-1.82921e-06
3.63115e-05
-3.98612e-06
3.60689e-05
-6.10493e-06
3.5896e-05
-8.20938e-06
3.58019e-05
-1.02929e-05
3.57848e-05
-1.23521e-05
3.58756e-05
-1.4432e-05
3.61324e-05
-1.65917e-05
3.65192e-05
-1.88737e-05
3.69118e-05
-2.13503e-05
3.72084e-05
-2.41834e-05
3.72656e-05
-2.79341e-05
3.70245e-05
-3.15219e-05
3.64411e-05
-2.78632e-05
4.20946e-05
-1.70826e-05
7.47538e-05
1.11937e-06
0.000141157
0.00021866
1.63205e-05
0.000127999
2.62285e-05
7.12557e-05
2.68965e-05
4.56666e-05
2.49696e-05
4.09285e-05
2.28642e-05
4.05723e-05
2.04549e-05
4.1034e-05
1.77634e-05
4.14287e-05
1.47979e-05
4.15932e-05
1.16629e-05
4.14931e-05
8.56418e-06
4.10652e-05
5.58915e-06
4.0492e-05
2.8167e-06
3.98198e-05
1.80757e-07
3.93048e-05
-2.27182e-06
3.87757e-05
-4.62838e-06
3.84375e-05
-6.94292e-06
3.82224e-05
-9.26832e-06
3.81392e-05
-1.1596e-05
3.81245e-05
-1.39154e-05
3.82075e-05
-1.62635e-05
3.84938e-05
-1.86784e-05
3.89486e-05
-2.11103e-05
3.93595e-05
-2.35942e-05
3.97099e-05
-2.61708e-05
3.98617e-05
-2.8846e-05
3.97207e-05
-3.20677e-05
3.96857e-05
-3.22912e-05
4.23437e-05
-2.17395e-05
6.42335e-05
-8.84921e-06
0.000128309
0.000209864
1.91127e-05
0.000108943
2.66519e-05
6.3754e-05
2.7297e-05
4.50505e-05
2.64071e-05
4.18458e-05
2.48173e-05
4.21884e-05
2.28104e-05
4.30653e-05
2.02944e-05
4.39667e-05
1.69837e-05
4.49235e-05
1.31863e-05
4.53078e-05
9.51785e-06
4.4749e-05
6.13803e-06
4.38857e-05
3.02769e-06
4.2943e-05
1.94691e-07
4.215e-05
-2.48469e-06
4.14668e-05
-5.07502e-06
4.10393e-05
-7.69172e-06
4.08504e-05
-1.0396e-05
4.08547e-05
-1.31363e-05
4.08765e-05
-1.58892e-05
4.09722e-05
-1.8647e-05
4.12643e-05
-2.13992e-05
4.17146e-05
-2.39841e-05
4.19599e-05
-2.65477e-05
4.22912e-05
-2.90797e-05
4.24136e-05
-3.15313e-05
4.21945e-05
-3.37022e-05
4.188e-05
-3.51192e-05
4.3786e-05
-2.92484e-05
5.83928e-05
-1.60271e-05
0.000115128
0.000193891
1.82072e-05
9.07955e-05
2.52058e-05
5.67917e-05
2.68229e-05
4.34617e-05
2.67929e-05
4.19026e-05
2.62163e-05
4.27905e-05
2.4983e-05
4.4322e-05
2.31501e-05
4.58205e-05
2.04402e-05
4.76519e-05
1.71199e-05
4.86447e-05
1.31978e-05
4.8686e-05
9.29049e-06
4.78065e-05
5.63279e-06
4.66131e-05
2.45817e-06
4.53365e-05
-7.38944e-07
4.46754e-05
-4.0326e-06
4.43441e-05
-7.49478e-06
4.43236e-05
-1.12051e-05
4.4576e-05
-1.50504e-05
4.47326e-05
-1.87274e-05
4.46607e-05
-2.19697e-05
4.45184e-05
-2.47417e-05
4.44992e-05
-2.74155e-05
4.46485e-05
-2.99388e-05
4.48318e-05
-3.22546e-05
4.47496e-05
-3.44237e-05
4.43865e-05
-3.64314e-05
4.39126e-05
-3.773e-05
4.51108e-05
-3.54815e-05
5.61749e-05
-2.13871e-05
0.000101075
0.000172561
1.53017e-05
7.55471e-05
2.24236e-05
4.9701e-05
2.49275e-05
4.09825e-05
2.59238e-05
4.09301e-05
2.61432e-05
4.25939e-05
2.55003e-05
4.49859e-05
2.37467e-05
4.75929e-05
2.10861e-05
5.03299e-05
1.82996e-05
5.14475e-05
1.48306e-05
5.21702e-05
1.11814e-05
5.14697e-05
7.62134e-06
5.0186e-05
4.36657e-06
4.86032e-05
8.92675e-07
4.81608e-05
-2.85752e-06
4.81056e-05
-6.68316e-06
4.81603e-05
-1.06415e-05
4.85456e-05
-1.50423e-05
4.91448e-05
-1.97981e-05
4.9428e-05
-2.4427e-05
4.91591e-05
-2.81302e-05
4.82147e-05
-3.08948e-05
4.74268e-05
-3.30965e-05
4.70496e-05
-3.49249e-05
4.65971e-05
-3.64943e-05
4.59783e-05
-3.79643e-05
4.54083e-05
-3.88243e-05
4.59981e-05
-3.74333e-05
5.48155e-05
-2.58986e-05
8.95852e-05
0.000146727
1.2648e-05
6.2941e-05
1.95248e-05
4.28489e-05
2.22236e-05
3.8304e-05
2.37027e-05
3.94711e-05
2.4226e-05
4.20899e-05
2.39263e-05
4.53037e-05
2.21224e-05
4.94143e-05
1.97014e-05
5.2768e-05
1.72608e-05
5.39048e-05
1.44872e-05
5.49601e-05
1.14351e-05
5.45369e-05
8.10239e-06
5.35325e-05
4.80183e-06
5.19165e-05
1.25715e-06
5.17179e-05
-2.50765e-06
5.18823e-05
-6.27707e-06
5.19422e-05
-9.95992e-06
5.22405e-05
-1.38877e-05
5.30848e-05
-1.83365e-05
5.38892e-05
-2.32315e-05
5.40667e-05
-2.77245e-05
5.27205e-05
-3.10977e-05
5.08132e-05
-3.35526e-05
4.9519e-05
-3.5359e-05
4.84208e-05
-3.64975e-05
4.71371e-05
-3.70958e-05
4.60298e-05
-3.71934e-05
4.61215e-05
-3.51244e-05
5.2777e-05
-2.46025e-05
7.91093e-05
0.000122197
1.13755e-05
5.15968e-05
1.69963e-05
3.7247e-05
1.92225e-05
3.60943e-05
2.05982e-05
3.81118e-05
2.13597e-05
4.13445e-05
2.153e-05
4.51494e-05
2.01665e-05
5.07948e-05
1.83235e-05
5.46284e-05
1.59493e-05
5.62962e-05
1.33902e-05
5.75362e-05
1.06711e-05
5.72723e-05
7.34765e-06
5.68712e-05
3.92162e-06
5.53564e-05
7.13715e-07
5.49391e-05
-2.51665e-06
5.51267e-05
-5.8871e-06
5.53256e-05
-9.29907e-06
5.56657e-05
-1.26315e-05
5.64304e-05
-1.6278e-05
5.75493e-05
-2.05896e-05
5.83921e-05
-2.54022e-05
5.7547e-05
-2.95173e-05
5.49422e-05
-3.19469e-05
5.19629e-05
-3.34633e-05
4.99526e-05
-3.42716e-05
4.79633e-05
-3.42339e-05
4.60124e-05
-3.3423e-05
4.5333e-05
-3.01129e-05
4.94931e-05
-2.02475e-05
6.92846e-05
0.000102018
1.03592e-05
4.12608e-05
1.42021e-05
3.34188e-05
1.59152e-05
3.43947e-05
1.69068e-05
3.71337e-05
1.76076e-05
4.06572e-05
1.7075e-05
4.56965e-05
1.60431e-05
5.18432e-05
1.51368e-05
5.55518e-05
1.33585e-05
5.80918e-05
1.12184e-05
5.96936e-05
8.50994e-06
5.99977e-05
5.29206e-06
6.01055e-05
2.14387e-06
5.85196e-05
-1.7485e-07
5.72731e-05
-2.41388e-06
5.73799e-05
-4.93552e-06
5.78617e-05
-7.78755e-06
5.85317e-05
-1.06701e-05
5.93273e-05
-1.36472e-05
6.0541e-05
-1.69002e-05
6.166e-05
-2.12155e-05
6.18773e-05
-2.60481e-05
5.97896e-05
-2.93933e-05
5.53227e-05
-3.03232e-05
5.08968e-05
-3.06352e-05
4.82906e-05
-3.02697e-05
4.56638e-05
-2.88947e-05
4.3976e-05
-2.48457e-05
4.54646e-05
-1.55827e-05
6.00539e-05
8.6491e-05
8.37083e-06
3.29063e-05
1.08929e-05
3.09082e-05
1.22147e-05
3.3084e-05
1.2708e-05
3.66517e-05
1.22049e-05
4.11721e-05
9.98642e-06
4.79287e-05
8.64511e-06
5.31999e-05
7.85774e-06
5.63553e-05
6.58186e-06
5.93846e-05
5.24819e-06
6.10445e-05
3.36571e-06
6.18977e-05
1.71153e-06
6.17769e-05
3.66413e-07
5.98807e-05
-7.46593e-07
5.84005e-05
-1.98698e-06
5.86347e-05
-3.30285e-06
5.91917e-05
-4.95403e-06
6.01981e-05
-6.98145e-06
6.13693e-05
-9.29831e-06
6.28731e-05
-1.17062e-05
6.40835e-05
-1.50529e-05
6.52398e-05
-2.01577e-05
6.491e-05
-2.54947e-05
6.06746e-05
-2.66021e-05
5.20175e-05
-2.65485e-05
4.82503e-05
-2.62042e-05
4.53339e-05
-2.46821e-05
4.24664e-05
-2.09e-05
4.1698e-05
-1.22662e-05
5.1444e-05
7.42671e-05
5.53642e-06
2.73808e-05
7.39159e-06
2.90623e-05
8.19491e-06
3.22904e-05
7.94389e-06
3.69129e-05
6.03111e-06
4.30965e-05
3.85845e-06
5.01152e-05
2.68798e-06
5.43853e-05
1.48392e-06
5.7575e-05
3.51064e-07
6.05342e-05
-6.83824e-07
6.20969e-05
-1.32014e-06
6.25518e-05
-1.26153e-06
6.17358e-05
-9.70577e-07
5.96062e-05
-9.4261e-07
5.83878e-05
-1.24234e-06
5.89496e-05
-1.29472e-06
5.92591e-05
-1.42157e-06
6.03395e-05
-2.03798e-06
6.20013e-05
-3.35203e-06
6.42031e-05
-5.16301e-06
6.59106e-05
-7.85838e-06
6.79516e-05
-1.24112e-05
6.94793e-05
-1.92414e-05
6.75206e-05
-2.2702e-05
5.54904e-05
-2.26498e-05
4.82096e-05
-2.2435e-05
4.51307e-05
-2.09995e-05
4.10436e-05
-1.81601e-05
3.88702e-05
-1.07178e-05
4.40187e-05
6.35818e-05
3.038e-06
2.43503e-05
4.25541e-06
2.78524e-05
4.25992e-06
3.22939e-05
3.17362e-06
3.80094e-05
1.4647e-06
4.4818e-05
5.84504e-07
5.10101e-05
-1.29216e-07
5.51149e-05
-1.64609e-06
5.91083e-05
-3.20489e-06
6.21107e-05
-3.85356e-06
6.27638e-05
-3.7134e-06
6.24299e-05
-2.77281e-06
6.08128e-05
-1.89751e-06
5.87473e-05
-1.13162e-06
5.76375e-05
-3.01752e-07
5.81353e-05
6.46648e-07
5.83259e-05
1.68425e-06
5.93172e-05
2.48205e-06
6.12192e-05
2.46342e-06
6.42381e-05
1.39871e-06
6.69921e-05
-8.73298e-07
7.02411e-05
-4.63429e-06
7.32583e-05
-1.13323e-05
7.42361e-05
-1.72956e-05
6.14663e-05
-1.85984e-05
4.95225e-05
-1.86708e-05
4.52131e-05
-1.77178e-05
4.00997e-05
-1.58867e-05
3.7048e-05
-1.04816e-05
3.86256e-05
5.31245e-05
1.25965e-06
2.30964e-05
1.51767e-06
2.7601e-05
7.40489e-07
3.30798e-05
-3.95305e-07
3.91563e-05
-9.32722e-07
4.5369e-05
-1.10475e-06
5.11978e-05
-1.85469e-06
5.5882e-05
-3.68014e-06
6.09526e-05
-5.76542e-06
6.42159e-05
-5.46304e-06
6.24804e-05
-4.37378e-06
6.13591e-05
-2.94586e-06
5.94024e-05
-1.89072e-06
5.77086e-05
-9.27689e-07
5.66901e-05
5.64064e-07
5.6659e-05
2.02823e-06
5.6877e-05
3.62722e-06
5.77335e-05
5.31442e-06
5.95478e-05
6.47781e-06
6.30915e-05
6.46571e-06
6.70219e-05
4.9155e-06
7.18104e-05
1.83373e-06
7.63605e-05
-4.57654e-06
8.06676e-05
-1.07163e-05
6.7621e-05
-1.37461e-05
5.25628e-05
-1.46783e-05
4.61546e-05
-1.45304e-05
3.99596e-05
-1.33696e-05
3.58943e-05
-9.82942e-06
3.50936e-05
4.33123e-05
-2.90511e-07
2.33923e-05
-1.35629e-06
2.86736e-05
-2.45674e-06
3.41896e-05
-2.96897e-06
3.96804e-05
-2.79887e-06
4.5213e-05
-2.87317e-06
5.12886e-05
-3.56482e-06
5.6592e-05
-5.76894e-06
6.31779e-05
-7.80943e-06
6.62789e-05
-6.34235e-06
6.10329e-05
-4.10198e-06
5.91369e-05
-2.44114e-06
5.77586e-05
-1.28614e-06
5.65699e-05
-3.01809e-07
5.57214e-05
1.09921e-06
5.52732e-05
2.59282e-06
5.53985e-05
4.29707e-06
5.60444e-05
6.27322e-06
5.75872e-05
8.27878e-06
6.11029e-05
9.62522e-06
6.56938e-05
8.85091e-06
7.26055e-05
6.42124e-06
7.88134e-05
5.89497e-07
8.65265e-05
-5.30215e-06
7.35329e-05
-9.69347e-06
5.69679e-05
-1.11838e-05
4.7655e-05
-1.13748e-05
4.01576e-05
-1.05426e-05
3.50677e-05
-7.99684e-06
3.25536e-05
3.53261e-05
-2.84541e-06
2.62434e-05
-4.82282e-06
3.06587e-05
-5.67338e-06
3.50501e-05
-5.5621e-06
3.95809e-05
-5.24707e-06
4.49119e-05
-5.11779e-06
5.11757e-05
-5.01438e-06
5.65074e-05
-5.99171e-06
6.41775e-05
-6.83659e-06
6.71479e-05
-5.33041e-06
5.95466e-05
-3.09347e-06
5.69178e-05
-1.69796e-06
5.63798e-05
-6.62834e-07
5.55507e-05
2.34102e-07
5.48398e-05
1.24582e-06
5.42765e-05
2.41263e-06
5.42465e-05
3.83094e-06
5.4641e-05
5.66548e-06
5.5768e-05
8.14244e-06
5.86425e-05
1.05818e-05
6.3273e-05
1.07808e-05
7.24285e-05
9.54123e-06
8.00789e-05
6.27951e-06
8.98207e-05
1.68709e-07
7.96693e-05
-6.02187e-06
6.31758e-05
-7.45495e-06
4.90993e-05
-7.93325e-06
4.06433e-05
-7.50434e-06
3.46441e-05
-5.66188e-06
3.07156e-05
2.96707e-05
-8.56077e-06
3.48117e-05
-9.1818e-06
3.12881e-05
-8.81628e-06
3.46942e-05
-8.4985e-06
3.92746e-05
-7.49492e-06
4.39218e-05
-5.81219e-06
4.95086e-05
-5.06625e-06
5.57798e-05
-3.77088e-06
6.29042e-05
-2.34258e-06
6.57429e-05
-3.15409e-06
6.03777e-05
-2.02975e-06
5.58103e-05
-9.40026e-07
5.53064e-05
-1.16687e-07
5.47429e-05
5.43921e-07
5.41944e-05
1.11505e-06
5.37201e-05
1.76398e-06
5.36121e-05
2.59762e-06
5.38219e-05
3.90214e-06
5.44784e-05
6.21698e-06
5.63436e-05
9.11453e-06
6.03931e-05
1.11099e-05
7.04551e-05
1.13992e-05
7.98161e-05
1.20994e-05
8.91527e-05
7.23966e-06
8.4557e-05
-5.158e-07
7.09514e-05
-3.64921e-06
5.22454e-05
-4.45125e-06
4.14539e-05
-4.46271e-06
3.46614e-05
-3.42473e-06
2.96819e-05
2.62503e-05
-8.50432e-06
4.33443e-05
-1.01597e-05
3.29542e-05
-9.82871e-06
3.43738e-05
-8.7527e-06
3.82099e-05
-6.44715e-06
4.1629e-05
-4.29893e-06
4.73754e-05
-3.67795e-06
5.51766e-05
-1.18131e-06
6.04285e-05
1.7019e-06
6.28817e-05
2.47008e-07
6.18526e-05
-4.59248e-07
5.65334e-05
-2.02136e-08
5.48834e-05
5.40628e-07
5.41985e-05
8.22776e-07
5.39276e-05
9.43955e-07
5.36141e-05
1.04684e-06
5.35244e-05
1.19906e-06
5.36844e-05
1.63193e-06
5.40604e-05
2.88576e-06
5.51052e-05
5.28874e-06
5.80072e-05
8.76472e-06
6.70005e-05
1.0964e-05
7.76431e-05
1.32873e-05
8.6858e-05
1.27635e-05
8.51087e-05
8.287e-06
7.54503e-05
2.07225e-06
5.84749e-05
-4.28137e-07
4.39645e-05
-1.38058e-06
3.5621e-05
-1.35337e-06
2.966e-05
2.49009e-05
7.9071e-07
4.25583e-05
-3.50406e-06
3.72611e-05
-5.49807e-06
3.63791e-05
-5.41434e-06
3.81381e-05
-4.34628e-06
4.05729e-05
-3.03378e-06
4.60766e-05
-1.45108e-06
5.36108e-05
7.1551e-07
5.8281e-05
3.24361e-06
6.03736e-05
4.02091e-06
6.10956e-05
2.45912e-06
5.8113e-05
1.56899e-06
5.57901e-05
1.42168e-06
5.4362e-05
1.26459e-06
5.41011e-05
9.47843e-07
5.39467e-05
5.65468e-07
5.39216e-05
1.27699e-07
5.41375e-05
-2.63414e-07
5.44667e-05
-3.55587e-07
5.52138e-05
8.38121e-08
5.75852e-05
1.58124e-06
6.55253e-05
4.88253e-06
7.4368e-05
9.67403e-06
8.2096e-05
1.4943e-05
7.98672e-05
1.68026e-05
7.3614e-05
1.21339e-05
6.31617e-05
5.42878e-06
5.06828e-05
2.12115e-06
3.89381e-05
3.53674e-07
3.14346e-05
2.52597e-05
2.53188e-06
4.00397e-05
-2.72314e-07
4.00772e-05
-2.33022e-06
3.84478e-05
-2.56816e-06
3.83869e-05
-2.33488e-06
4.03508e-05
-1.78309e-06
4.55376e-05
8.36217e-08
5.17596e-05
1.95253e-06
5.64297e-05
4.08834e-06
5.82566e-05
6.22466e-06
5.89786e-05
6.25242e-06
5.81039e-05
4.91869e-06
5.71413e-05
3.16691e-06
5.61292e-05
1.88118e-06
5.54031e-05
1.18522e-06
5.46582e-05
4.76768e-07
5.46464e-05
-3.7161e-07
5.50018e-05
-1.18149e-06
5.52931e-05
-1.92869e-06
5.59777e-05
-3.93612e-06
5.96117e-05
-6.87979e-06
6.84934e-05
-5.09648e-06
7.26128e-05
2.73635e-06
7.42924e-05
1.29644e-05
6.96658e-05
1.98676e-05
6.67349e-05
2.02984e-05
6.27524e-05
1.3758e-05
5.7242e-05
7.23358e-06
4.54767e-05
1.52835e-06
3.71515e-05
2.67947e-05
3.32357e-07
3.97176e-05
1.99568e-06
3.84251e-05
2.19199e-06
3.82618e-05
1.66096e-06
3.89281e-05
5.07462e-07
4.15148e-05
-5.9726e-07
4.66546e-05
3.41507e-07
5.08354e-05
2.32806e-06
5.44599e-05
4.63156e-06
5.59708e-05
7.10111e-06
5.65275e-05
8.52023e-06
5.67032e-05
8.47294e-06
5.7207e-05
6.47415e-06
5.8146e-05
4.04165e-06
5.78515e-05
2.21785e-06
5.64984e-05
8.60944e-07
5.60185e-05
-3.18038e-07
5.61972e-05
-1.25944e-06
5.62505e-05
-2.44264e-06
5.7178e-05
-6.77763e-06
6.39665e-05
-1.07816e-05
7.25248e-05
-9.89636e-06
7.17576e-05
-2.35211e-06
6.67769e-05
7.3005e-06
6.0038e-05
1.61622e-05
5.78971e-05
2.06566e-05
5.82817e-05
1.97601e-05
5.81628e-05
1.41452e-05
5.11121e-05
3.2667e-06
4.80489e-05
3.0071e-05
1.10602e-06
3.86233e-05
4.63981e-06
3.49013e-05
5.56075e-06
3.73513e-05
4.42521e-06
4.00738e-05
2.12615e-06
4.38245e-05
4.96085e-09
4.87882e-05
-4.88255e-09
5.08591e-05
1.82662e-06
5.26438e-05
4.2927e-06
5.35213e-05
6.7647e-06
5.40725e-05
8.52844e-06
5.49568e-05
9.38096e-06
5.63723e-05
9.06821e-06
5.84768e-05
7.47578e-06
5.94624e-05
5.05575e-06
5.8936e-05
2.71884e-06
5.83732e-05
5.128e-07
5.84208e-05
-1.73681e-06
5.85181e-05
-4.88577e-06
6.03455e-05
-8.03536e-06
6.71404e-05
-8.0417e-06
7.25598e-05
-7.91735e-06
7.16626e-05
-3.44778e-06
6.23339e-05
3.02977e-06
5.3583e-05
9.83423e-06
5.11153e-05
1.55314e-05
5.26087e-05
1.80117e-05
5.57083e-05
1.58554e-05
5.32916e-05
1.018e-05
5.37463e-05
4.02656e-05
4.09594e-06
3.45376e-05
5.75706e-06
3.32496e-05
5.75327e-06
3.73651e-05
4.21816e-06
4.16196e-05
1.53909e-06
4.65153e-05
-2.79987e-07
5.06203e-05
-1.3719e-07
5.07299e-05
1.67812e-06
5.08429e-05
3.91179e-06
5.13024e-05
5.73633e-06
5.22632e-05
7.07792e-06
5.36309e-05
7.85604e-06
5.56108e-05
8.45486e-06
5.78957e-05
8.35308e-06
5.95825e-05
7.06413e-06
6.02431e-05
4.95761e-06
6.04975e-05
2.11962e-06
6.12769e-05
-1.5089e-06
6.21655e-05
-5.08922e-06
6.39457e-05
-5.33501e-06
6.74102e-05
-2.59949e-06
6.98515e-05
-1.44788e-06
7.05388e-05
-9.33995e-07
6.18445e-05
1.85618e-06
5.08133e-05
5.99525e-06
4.6996e-05
8.29328e-06
5.0333e-05
8.57e-06
5.54549e-05
6.23401e-06
5.56486e-05
6.82135e-06
5.31798e-05
4.71041e-05
4.11474e-06
3.0433e-05
3.91019e-06
3.34631e-05
3.30389e-06
3.79816e-05
1.33839e-06
4.35967e-05
-7.11278e-07
4.85778e-05
-7.98519e-07
5.07213e-05
7.44659e-07
4.92e-05
2.6576e-06
4.89433e-05
4.07753e-06
4.98961e-05
4.83344e-06
5.15213e-05
5.15949e-06
5.33195e-05
5.3831e-06
5.54027e-05
5.72e-06
5.75753e-05
5.83025e-06
5.94894e-05
5.34535e-06
6.07456e-05
4.15339e-06
6.17075e-05
2.33128e-06
6.31177e-05
-1.09613e-07
6.46257e-05
-1.75898e-06
6.56154e-05
-1.4855e-06
6.71585e-05
6.76375e-07
6.77131e-05
3.99427e-06
6.72466e-05
3.99163e-06
6.18705e-05
3.59475e-06
5.12295e-05
3.84885e-06
4.676e-05
1.93955e-06
5.22623e-05
1.99119e-06
5.54243e-05
1.80322e-06
5.58567e-05
2.53888e-06
5.24635e-05
4.96601e-05
1.03677e-06
2.94058e-05
5.89502e-07
3.39199e-05
-2.81678e-07
3.88635e-05
-2.3558e-06
4.5683e-05
-2.43354e-06
4.86687e-05
1.14988e-07
4.8186e-05
2.38405e-06
4.69434e-05
3.65506e-06
4.76848e-05
4.12857e-06
4.94354e-05
4.06353e-06
5.15997e-05
3.65487e-06
5.37421e-05
3.19717e-06
5.58751e-05
2.84498e-06
5.79431e-05
2.53241e-06
5.98185e-05
2.02134e-06
6.12738e-05
1.23321e-06
6.25132e-05
5.57991e-07
6.3811e-05
1.33467e-07
6.50688e-05
-6.08263e-08
6.5829e-05
6.22111e-07
6.6496e-05
2.21923e-06
6.61372e-05
5.17614e-06
6.43116e-05
6.9695e-06
6.00985e-05
5.7313e-06
5.24863e-05
1.8094e-06
5.06989e-05
-1.46659e-06
5.55563e-05
-7.40944e-07
5.4718e-05
1.45209e-06
5.36828e-05
1.73062e-06
5.22026e-05
5.14074e-05
-3.1041e-06
3.25197e-05
-3.20742e-06
3.40325e-05
-4.03983e-06
3.97079e-05
-3.51463e-06
4.51705e-05
-9.77309e-07
4.61439e-05
2.18344e-06
4.50371e-05
3.69134e-06
4.5447e-05
4.13383e-06
4.72541e-05
3.92429e-06
4.96573e-05
3.35699e-06
5.218e-05
2.54919e-06
5.45636e-05
1.62667e-06
5.6812e-05
7.02199e-07
5.88827e-05
-1.77283e-07
6.07138e-05
-1.10099e-06
6.2214e-05
-1.98917e-06
6.34186e-05
-2.52738e-06
6.43671e-05
-2.46582e-06
6.50257e-05
-1.93538e-06
6.53174e-05
-6.71836e-07
6.52518e-05
9.52791e-07
6.45319e-05
2.87538e-06
6.24084e-05
4.62406e-06
5.83685e-05
3.61666e-06
5.35104e-05
-3.87275e-07
5.47189e-05
-1.92631e-06
5.71131e-05
-1.60095e-06
5.44094e-05
-1.07783e-07
5.22063e-05
9.97958e-07
5.11132e-05
5.24215e-05
-4.11878e-06
3.66482e-05
-4.37917e-06
3.43017e-05
-4.30362e-06
3.96414e-05
-1.42134e-06
4.23003e-05
1.93796e-06
4.27958e-05
3.86483e-06
4.3121e-05
4.37592e-06
4.49468e-05
4.11827e-06
4.75231e-05
3.44624e-06
5.03414e-05
2.55817e-06
5.3081e-05
1.49308e-06
5.56423e-05
3.15803e-07
5.80036e-05
-8.90245e-07
6.01037e-05
-2.06574e-06
6.1905e-05
-3.20051e-06
6.3365e-05
-4.22828e-06
6.4463e-05
-5.04856e-06
6.52045e-05
-5.49785e-06
6.54926e-05
-5.48501e-06
6.53226e-05
-4.77844e-06
6.45634e-05
-3.47748e-06
6.32491e-05
-1.94285e-06
6.08914e-05
-8.43668e-07
5.72858e-05
-1.46124e-06
5.41429e-05
-2.03971e-06
5.53129e-05
-2.14141e-06
5.72311e-05
-2.32698e-06
5.46108e-05
-1.67114e-06
5.15658e-05
2.05142e-07
4.9252e-05
5.26421e-05
-2.76382e-07
3.69338e-05
-2.38147e-06
3.64152e-05
-1.43178e-06
3.87001e-05
1.61176e-06
3.92664e-05
4.11288e-06
4.03048e-05
4.72404e-06
4.252e-05
4.38695e-06
4.52944e-05
3.60693e-06
4.83143e-05
2.60527e-06
5.1355e-05
1.48337e-06
5.42156e-05
2.82023e-07
5.68572e-05
-9.46556e-07
5.92464e-05
-2.15714e-06
6.13292e-05
-3.32408e-06
6.30875e-05
-4.44118e-06
6.44982e-05
-5.47801e-06
6.55164e-05
-6.41936e-06
6.61628e-05
-7.17519e-06
6.62656e-05
-7.70987e-06
6.58744e-05
-7.88669e-06
6.47572e-05
-7.63714e-06
6.30164e-05
-7.10278e-06
6.03732e-05
-6.84479e-06
5.70428e-05
-7.14861e-06
5.44609e-05
-6.07944e-06
5.42586e-05
-4.14091e-06
5.53078e-05
-3.29922e-06
5.37841e-05
-2.06903e-06
5.03497e-05
3.74784e-07
4.68219e-05
5.30321e-05
2.53609e-07
3.66889e-05
-1.12368e-07
3.67898e-05
2.37563e-06
3.62216e-05
4.57655e-06
3.70741e-05
5.15025e-06
3.97403e-05
4.6731e-06
4.30065e-05
3.7625e-06
4.6215e-05
2.60999e-06
4.94777e-05
1.39144e-06
5.25853e-05
1.56912e-07
5.54627e-05
-1.06106e-06
5.80884e-05
-2.21911e-06
6.04185e-05
-3.29099e-06
6.24159e-05
-4.26772e-06
6.40796e-05
-5.16403e-06
6.54104e-05
-5.99202e-06
6.63608e-05
-6.79053e-06
6.6978e-05
-7.55095e-06
6.70429e-05
-8.2961e-06
6.66364e-05
-8.92671e-06
6.54044e-05
-9.41223e-06
6.35179e-05
-9.82359e-06
6.07997e-05
-1.0495e-05
5.77284e-05
-1.11345e-05
5.51142e-05
-1.05306e-05
5.36689e-05
-8.34734e-06
5.31396e-05
-6.0084e-06
5.14595e-05
-3.06945e-06
4.7424e-05
-1.6308e-07
4.39278e-05
5.28837e-05
6.22879e-07
3.60751e-05
3.48221e-06
3.39389e-05
5.50314e-06
3.42092e-05
5.65403e-06
3.6932e-05
4.88523e-06
4.05142e-05
3.88813e-06
4.40111e-05
2.62042e-06
4.74929e-05
1.23605e-06
5.08728e-05
-9.65818e-08
5.39295e-05
-1.31777e-06
5.66962e-05
-2.4141e-06
5.91979e-05
-3.36683e-06
6.13851e-05
-4.1832e-06
6.32468e-05
-4.87736e-06
6.47889e-05
-5.48123e-06
6.60299e-05
-6.04353e-06
6.69392e-05
-6.61198e-06
6.75629e-05
-7.23104e-06
6.76785e-05
-7.92989e-06
6.73519e-05
-8.64982e-06
6.61407e-05
-9.38767e-06
6.42715e-05
-1.01706e-05
6.15975e-05
-1.11048e-05
5.86767e-05
-1.1945e-05
5.59679e-05
-1.20621e-05
5.37996e-05
-1.08936e-05
5.1985e-05
-8.78492e-06
4.93645e-05
-6.02231e-06
4.46735e-05
-3.10996e-06
4.10261e-05
4.97878e-05
3.08e-06
3.30049e-05
5.66158e-06
3.13659e-05
5.80853e-06
3.40706e-05
4.75612e-06
3.79927e-05
3.58855e-06
4.16939e-05
2.27054e-06
4.53405e-05
9.01528e-07
4.88718e-05
-4.28454e-07
5.22135e-05
-1.61169e-06
5.51241e-05
-2.64004e-06
5.77368e-05
-3.46966e-06
6.00405e-05
-4.11441e-06
6.20436e-05
-4.60513e-06
6.37519e-05
-4.95979e-06
6.51585e-05
-5.23231e-06
6.63179e-05
-5.5083e-06
6.7231e-05
-5.81712e-06
6.78878e-05
-6.2792e-06
6.81569e-05
-6.87246e-06
6.79615e-05
-7.55119e-06
6.68354e-05
-8.23584e-06
6.49716e-05
-8.91304e-06
6.22894e-05
-9.62161e-06
5.93992e-05
-1.02359e-05
5.65956e-05
-1.04117e-05
5.39884e-05
-9.92613e-06
5.15125e-05
-8.99107e-06
4.84419e-05
-8.14993e-06
4.38434e-05
-6.29328e-06
3.91793e-05
4.35078e-05
4.42903e-06
2.85852e-05
4.72268e-06
3.1081e-05
3.738e-06
3.5064e-05
2.40871e-06
3.93304e-05
9.75723e-07
4.3136e-05
-2.6843e-07
4.65939e-05
-1.26247e-06
4.98757e-05
-2.23143e-06
5.3193e-05
-3.09075e-06
5.59949e-05
-3.79137e-06
5.84496e-05
-4.25625e-06
6.05183e-05
-4.53174e-06
6.23326e-05
-4.65722e-06
6.38915e-05
-4.67508e-06
6.51911e-05
-4.60374e-06
6.62617e-05
-4.52374e-06
6.71666e-05
-4.51763e-06
6.78977e-05
-4.7066e-06
6.83621e-05
-5.00489e-06
6.8276e-05
-5.4659e-06
6.73123e-05
-6.01507e-06
6.55362e-05
-6.54551e-06
6.28344e-05
-6.96375e-06
5.98311e-05
-7.14457e-06
5.67895e-05
-6.99821e-06
5.38546e-05
-6.62452e-06
5.11509e-05
-6.4101e-06
4.8239e-05
-6.8283e-06
4.4272e-05
-6.58518e-06
3.89455e-05
3.69339e-05
2.36107e-06
2.6232e-05
1.32727e-06
3.21227e-05
2.39457e-07
3.61602e-05
-1.40957e-06
4.09884e-05
-2.45174e-06
4.41871e-05
-2.97091e-06
4.71224e-05
-3.40964e-06
5.03242e-05
-4.00271e-06
5.37967e-05
-4.51566e-06
5.65192e-05
-4.79395e-06
5.87399e-05
-4.84809e-06
6.05852e-05
-4.72282e-06
6.22208e-05
-4.4853e-06
6.3668e-05
-4.15081e-06
6.48711e-05
-3.74397e-06
6.58699e-05
-3.34896e-06
6.6787e-05
-3.04356e-06
6.76082e-05
-2.87593e-06
6.82105e-05
-2.83116e-06
6.82475e-05
-3.04781e-06
6.7545e-05
-3.49719e-06
6.60012e-05
-3.95711e-06
6.33091e-05
-4.16204e-06
6.00498e-05
-4.01003e-06
5.66503e-05
-3.51441e-06
5.33711e-05
-2.85782e-06
5.05058e-05
-2.5533e-06
4.79454e-05
-3.06667e-06
4.47953e-05
-4.02222e-06
3.99127e-05
3.29206e-05
-6.52109e-07
2.68907e-05
-3.25364e-06
3.47318e-05
-4.25057e-06
3.71648e-05
-5.18477e-06
4.19314e-05
-5.2169e-06
4.42281e-05
-5.00514e-06
4.69197e-05
-5.06299e-06
5.03918e-05
-5.25256e-06
5.39969e-05
-5.32849e-06
5.66064e-05
-5.20501e-06
5.86284e-05
-4.95624e-06
6.03491e-05
-4.57174e-06
6.18495e-05
-4.06536e-06
6.31755e-05
-3.47484e-06
6.4295e-05
-2.87815e-06
6.52881e-05
-2.29654e-06
6.62207e-05
-1.7487e-06
6.7076e-05
-1.25678e-06
6.77347e-05
-8.87332e-07
6.78943e-05
-8.50293e-07
6.75243e-05
-1.23892e-06
6.64059e-05
-1.75454e-06
6.38399e-05
-1.86218e-06
6.01715e-05
-1.51961e-06
5.63207e-05
-8.2033e-07
5.26837e-05
1.3033e-07
4.95662e-05
9.50202e-07
4.7136e-05
9.77048e-07
4.47785e-05
-5.17419e-07
4.14141e-05
3.24082e-05
-5.15215e-06
3.20485e-05
-7.68524e-06
3.72731e-05
-7.22423e-06
3.67105e-05
-6.80744e-06
4.15229e-05
-6.14746e-06
4.35765e-05
-5.68131e-06
4.64623e-05
-5.62536e-06
5.03453e-05
-5.46593e-06
5.38481e-05
-5.2338e-06
5.63854e-05
-4.91224e-06
5.83187e-05
-4.4894e-06
5.99387e-05
-3.96432e-06
6.13375e-05
-3.37327e-06
6.25981e-05
-2.76793e-06
6.37039e-05
-2.16991e-06
6.47048e-05
-1.55387e-06
6.56199e-05
-9.03954e-07
6.64417e-05
-2.22304e-07
6.70691e-05
4.54407e-07
6.72339e-05
8.8758e-07
6.71075e-05
6.98751e-07
6.66111e-05
5.7161e-08
6.44972e-05
-7.07016e-08
6.03138e-05
3.00607e-07
5.59624e-05
1.04144e-06
5.19545e-05
2.09737e-06
4.85209e-05
3.38283e-06
4.58605e-05
4.30985e-06
4.38612e-05
3.26725e-06
4.24652e-05
3.56813e-05
-5.34783e-06
3.74004e-05
-6.92902e-06
3.88616e-05
-6.63012e-06
3.64172e-05
-5.95373e-06
4.08538e-05
-5.24925e-06
4.28796e-05
-5.05419e-06
4.62757e-05
-4.9394e-06
5.024e-05
-4.55702e-06
5.34759e-05
-4.11226e-06
5.59518e-05
-3.6733e-06
5.78916e-05
-3.2617e-06
5.95396e-05
-2.88491e-06
6.09739e-05
-2.50804e-06
6.22349e-05
-2.10813e-06
6.33181e-05
-1.67103e-06
6.42823e-05
-1.18454e-06
6.51484e-05
-6.26002e-07
6.58987e-05
2.8082e-08
6.64309e-05
8.39915e-07
6.64381e-05
1.68127e-06
6.62823e-05
1.76562e-06
6.65433e-05
1.12673e-06
6.51525e-05
8.74767e-07
6.05804e-05
1.31195e-06
5.55378e-05
2.0788e-06
5.11989e-05
3.13842e-06
4.74715e-05
4.55041e-06
4.44579e-05
6.38769e-06
4.20327e-05
8.0603e-06
4.08019e-05
4.37542e-05
-5.74043e-07
3.79797e-05
-1.92694e-06
4.0221e-05
-3.0776e-06
3.75729e-05
-2.37691e-06
4.01596e-05
-1.92081e-06
4.24303e-05
-2.1485e-06
4.65117e-05
-2.13076e-06
5.0232e-05
-2.0215e-06
5.33774e-05
-1.92621e-06
5.58681e-05
-1.88795e-06
5.78657e-05
-1.86995e-06
5.95346e-05
-1.84136e-06
6.09588e-05
-1.75696e-06
6.21645e-05
-1.62007e-06
6.31956e-05
-1.40686e-06
6.40838e-05
-1.13565e-06
6.48923e-05
-8.02247e-07
6.55807e-05
-3.75755e-07
6.60201e-05
3.2524e-07
6.57529e-05
1.03708e-06
6.55863e-05
5.78844e-07
6.70184e-05
5.62917e-08
6.56919e-05
3.26489e-07
6.03246e-05
1.20156e-06
5.4675e-05
1.77666e-06
5.0635e-05
3.00342e-06
4.62542e-05
4.45304e-06
4.30169e-05
6.59195e-06
3.99024e-05
8.31885e-06
3.90853e-05
5.20854e-05
3.87684e-07
3.75981e-05
1.55648e-06
3.90593e-05
1.17017e-06
3.79646e-05
1.82586e-06
3.95097e-05
1.50728e-06
4.27559e-05
7.22612e-07
4.73055e-05
1.69245e-07
5.07961e-05
-2.88175e-07
5.38468e-05
-6.3661e-07
5.62293e-05
-9.2022e-07
5.81626e-05
-1.13418e-06
5.97623e-05
-1.28208e-06
6.11208e-05
-1.35781e-06
6.22545e-05
-1.39217e-06
6.32445e-05
-1.34497e-06
6.40514e-05
-1.28781e-06
6.48502e-05
-1.23686e-06
6.55451e-05
-1.08828e-06
6.58872e-05
-8.47145e-07
6.55274e-05
-1.37902e-06
6.61342e-05
-2.36671e-06
6.80235e-05
-2.49349e-06
6.58347e-05
-2.27241e-06
6.01184e-05
-1.48834e-06
5.39034e-05
-5.42588e-07
4.96998e-05
1.09853e-06
4.46216e-05
2.65611e-06
4.14672e-05
3.90538e-06
3.86605e-05
1.23812e-06
4.17619e-05
5.33222e-05
4.89085e-07
3.71156e-05
3.21686e-06
3.63379e-05
4.12363e-06
3.70637e-05
3.78761e-06
3.98525e-05
2.57347e-06
4.39786e-05
1.46431e-06
4.84254e-05
5.16909e-07
5.17556e-05
-1.78996e-07
5.45559e-05
-6.54467e-07
5.67186e-05
-9.65332e-07
5.84876e-05
-1.15676e-06
5.99681e-05
-1.27096e-06
6.12495e-05
-1.32991e-06
6.23281e-05
-1.38764e-06
6.3317e-05
-1.42986e-06
6.41085e-05
-1.60827e-06
6.50439e-05
-1.89e-06
6.58424e-05
-2.12289e-06
6.61359e-05
-2.65166e-06
6.60721e-05
-3.86288e-06
6.73621e-05
-3.95418e-06
6.81334e-05
-3.46895e-06
6.53677e-05
-3.55793e-06
6.02223e-05
-3.96972e-06
5.43274e-05
-3.91384e-06
4.96545e-05
-3.30956e-06
4.40257e-05
-2.1423e-06
4.03075e-05
-1.98281e-06
3.85076e-05
-4.59416e-06
4.43823e-05
4.87426e-05
1.96614e-06
3.51562e-05
4.62844e-06
3.36819e-05
4.78703e-06
3.69118e-05
3.60866e-06
4.10393e-05
1.93372e-06
4.5664e-05
5.81468e-07
4.97898e-05
-5.07101e-07
5.28574e-05
-1.15868e-06
5.52214e-05
-1.48132e-06
5.70555e-05
-1.59459e-06
5.86154e-05
-1.60861e-06
5.99967e-05
-1.58225e-06
6.12379e-05
-1.53622e-06
6.2297e-05
-1.52567e-06
6.33215e-05
-1.62695e-06
6.42249e-05
-2.18042e-06
6.56128e-05
-2.9217e-06
6.65996e-05
-3.55057e-06
6.67809e-05
-4.35558e-06
6.68936e-05
-4.76861e-06
6.77928e-05
-3.99782e-06
6.73803e-05
-3.24871e-06
6.46355e-05
-3.27733e-06
6.02658e-05
-4.28572e-06
5.53483e-05
-5.1617e-06
5.05413e-05
-5.954e-06
4.48264e-05
-6.00966e-06
4.03702e-05
-5.63105e-06
3.8135e-05
-3.22154e-06
4.19814e-05
4.55303e-05
3.66607e-06
3.14972e-05
4.09739e-06
3.32569e-05
3.30508e-06
3.77121e-05
1.66133e-06
4.26929e-05
-2.77561e-07
4.76147e-05
-1.66206e-06
5.11874e-05
-2.45763e-06
5.36668e-05
-2.74103e-06
5.5519e-05
-2.71175e-06
5.70406e-05
-2.53345e-06
5.84516e-05
-2.31843e-06
5.97964e-05
-2.0999e-06
6.10343e-05
-1.88816e-06
6.21002e-05
-1.74638e-06
6.31947e-05
-1.98627e-06
6.448e-05
-3.06865e-06
6.67114e-05
-4.03528e-06
6.75828e-05
-4.43802e-06
6.72003e-05
-4.50072e-06
6.69734e-05
-3.5841e-06
6.68939e-05
-2.11935e-06
6.59336e-05
-1.11128e-06
6.36442e-05
-1.33737e-06
6.05068e-05
-2.82924e-06
5.68533e-05
-4.79646e-06
5.25199e-05
-7.04437e-06
4.70839e-05
-8.56442e-06
4.1898e-05
-7.73417e-06
3.73111e-05
-2.63618e-06
3.68893e-05
4.29271e-05
2.60919e-06
2.88945e-05
1.88407e-06
3.3989e-05
5.76129e-07
3.90289e-05
-1.46854e-06
4.47487e-05
-3.37634e-06
4.95352e-05
-4.32671e-06
5.21512e-05
-4.50432e-06
5.38582e-05
-4.26573e-06
5.52944e-05
-3.85578e-06
5.66448e-05
-3.43109e-06
5.80413e-05
-3.06091e-06
5.94408e-05
-2.71556e-06
6.07037e-05
-2.36391e-06
6.17635e-05
-2.1282e-06
6.29741e-05
-2.75804e-06
6.51255e-05
-3.88738e-06
6.78579e-05
-4.05656e-06
6.77686e-05
-3.5864e-06
6.67474e-05
-2.67057e-06
6.60748e-05
-1.14591e-06
6.53867e-05
5.12328e-07
6.42922e-05
1.53438e-06
6.26381e-05
1.40871e-06
6.06471e-05
1.03455e-08
5.8265e-05
-2.47503e-06
5.50172e-05
-5.50949e-06
5.01285e-05
-7.77691e-06
4.41745e-05
-8.31469e-06
3.78573e-05
-5.10521e-06
3.36867e-05
3.78299e-05
2.46989e-07
2.86532e-05
-7.53817e-07
3.49973e-05
-3.0176e-06
4.13032e-05
-5.26931e-06
4.70128e-05
-6.53518e-06
5.08144e-05
-6.5957e-06
5.22251e-05
-6.05202e-06
5.33279e-05
-5.35206e-06
5.46079e-05
-4.67204e-06
5.59785e-05
-4.11941e-06
5.75027e-05
-3.70264e-06
5.90385e-05
-3.32886e-06
6.03447e-05
-2.9362e-06
6.13857e-05
-2.76616e-06
6.28193e-05
-3.52151e-06
6.58972e-05
-3.70906e-06
6.80624e-05
-2.89651e-06
6.69736e-05
-1.81997e-06
6.56879e-05
-4.84239e-07
6.47559e-05
1.02397e-06
6.38949e-05
2.4143e-06
6.29179e-05
3.38472e-06
6.16828e-05
3.73713e-06
6.03091e-05
3.22414e-06
5.87915e-05
1.50864e-06
5.67453e-05
-1.56059e-06
5.32085e-05
-4.6794e-06
4.73028e-05
-6.42302e-06
3.96073e-05
-5.97036e-06
3.32403e-05
3.18677e-05
-1.63008e-06
3.02889e-05
-3.84565e-06
3.72206e-05
-7.46975e-06
4.49393e-05
-9.03782e-06
4.85943e-05
-8.90988e-06
5.07e-05
-7.96001e-06
5.12882e-05
-6.86322e-06
5.22438e-05
-5.88646e-06
5.36441e-05
-5.09353e-06
5.51987e-05
-4.53637e-06
5.69592e-05
-4.16145e-06
5.86778e-05
-3.83317e-06
6.00311e-05
-3.48798e-06
6.10555e-05
-3.42175e-06
6.27686e-05
-3.58215e-06
6.60747e-05
-2.76285e-06
6.72608e-05
-1.45838e-06
6.56867e-05
-9.44723e-08
6.43407e-05
1.16405e-06
6.35136e-05
2.30532e-06
6.27693e-05
3.35643e-06
6.1882e-05
4.26157e-06
6.07923e-05
4.99101e-06
5.95935e-05
5.41019e-06
5.83855e-05
5.09842e-06
5.70696e-05
3.38814e-06
5.49304e-05
1.54709e-07
5.05463e-05
-2.91759e-06
4.26866e-05
-3.62881e-06
3.39567e-05
2.82449e-05
-5.00727e-06
3.53034e-05
-9.41024e-06
4.16328e-05
-1.18163e-05
4.73567e-05
-1.17479e-05
4.85394e-05
-1.01857e-05
4.91506e-05
-8.45622e-06
4.95708e-05
-7.04025e-06
5.08398e-05
-5.9553e-06
5.25713e-05
-5.16354e-06
5.44196e-05
-4.67545e-06
5.64845e-05
-4.37441e-06
5.83909e-05
-4.11247e-06
5.97838e-05
-3.85842e-06
6.08164e-05
-3.70306e-06
6.26291e-05
-3.05573e-06
6.54451e-05
-1.61515e-06
6.58384e-05
-8.4912e-08
6.41735e-05
1.10902e-06
6.3163e-05
2.06652e-06
6.25717e-05
2.92747e-06
6.19236e-05
3.7671e-06
6.1057e-05
4.58243e-06
5.9991e-05
5.39963e-06
5.87898e-05
6.24456e-06
5.75535e-05
6.94457e-06
5.63819e-05
6.78185e-06
5.5105e-05
4.73968e-06
5.25996e-05
1.46173e-06
4.59744e-05
-7.81324e-07
3.62064e-05
2.74678e-05
-1.59592e-05
5.1283e-05
-1.82427e-05
4.39292e-05
-1.56626e-05
4.47904e-05
-1.2995e-05
4.58844e-05
-1.03293e-05
4.64965e-05
-8.25521e-06
4.75076e-05
-6.74199e-06
4.93375e-05
-5.62705e-06
5.14677e-05
-4.89892e-06
5.37035e-05
-4.51195e-06
5.61105e-05
-4.28662e-06
5.81794e-05
-4.07015e-06
5.95818e-05
-3.85482e-06
6.06161e-05
-3.46061e-06
6.22511e-05
-2.26042e-06
6.42625e-05
-5.03107e-07
6.40987e-05
8.2864e-07
6.28582e-05
1.7397e-06
6.22675e-05
2.49793e-06
6.18286e-05
3.20963e-06
6.12266e-05
3.92842e-06
6.03524e-05
4.66944e-06
5.92637e-05
5.464e-06
5.80083e-05
6.38474e-06
5.66452e-05
7.49521e-06
5.52835e-05
8.55716e-06
5.4055e-05
8.47214e-06
5.26963e-05
6.13099e-06
4.83255e-05
1.30317e-06
4.1041e-05
2.87765e-05
-2.06028e-05
7.19107e-05
-2.10739e-05
4.44188e-05
-1.64421e-05
4.01703e-05
-1.26672e-05
4.21201e-05
-9.69559e-06
4.35348e-05
-7.53312e-06
4.53546e-05
-5.95397e-06
4.77683e-05
-4.84298e-06
5.03672e-05
-4.26568e-06
5.31376e-05
-4.01723e-06
5.58747e-05
-3.85392e-06
5.80298e-05
-3.63938e-06
5.93817e-05
-3.36206e-06
6.03538e-05
-2.75834e-06
6.16634e-05
-1.30726e-06
6.28286e-05
2.81819e-07
6.25263e-05
1.2811e-06
6.18746e-05
2.01798e-06
6.15459e-05
2.66675e-06
6.11947e-05
3.28217e-06
6.06256e-05
3.92465e-06
5.97238e-05
4.63361e-06
5.8568e-05
5.44521e-06
5.72094e-05
6.41598e-06
5.56866e-05
7.62982e-06
5.40814e-05
9.16233e-06
5.25339e-05
1.0439e-05
5.14311e-05
9.34083e-06
4.94343e-05
4.30638e-06
4.60846e-05
3.30855e-05
-7.18997e-06
7.91141e-05
-1.76553e-05
5.48991e-05
-1.50263e-05
3.75507e-05
-1.15533e-05
3.86541e-05
-8.3856e-06
4.03741e-05
-6.05354e-06
4.303e-05
-4.48456e-06
4.62084e-05
-3.54798e-06
4.94408e-05
-3.25809e-06
5.28587e-05
-3.12153e-06
5.57505e-05
-3.00843e-06
5.79302e-05
-2.81212e-06
5.91996e-05
-2.4928e-06
6.00493e-05
-1.77415e-06
6.09605e-05
-4.6302e-07
6.15337e-05
6.99908e-07
6.13793e-05
1.46896e-06
6.11208e-05
2.09684e-06
6.09328e-05
2.65938e-06
6.06466e-05
3.18456e-06
6.01144e-05
3.74755e-06
5.91743e-05
4.4227e-06
5.79057e-05
5.26875e-06
5.63755e-05
6.35999e-06
5.46069e-05
7.75203e-06
5.27003e-05
9.55194e-06
5.07446e-05
1.20038e-05
4.899e-05
1.36644e-05
4.77848e-05
1.24104e-05
4.7351e-05
4.55088e-05
5.45646e-06
7.36719e-05
-4.50889e-06
6.48736e-05
-9.9582e-06
4.30087e-05
-8.21689e-06
3.69178e-05
-5.3826e-06
3.75444e-05
-3.24589e-06
4.08987e-05
-1.95362e-06
4.49237e-05
-1.71174e-06
4.92082e-05
-1.78852e-06
5.29473e-05
-1.86299e-06
5.5838e-05
-1.88695e-06
5.79678e-05
-1.76124e-06
5.90881e-05
-1.48114e-06
5.9784e-05
-7.98073e-07
6.02927e-05
1.45354e-07
6.06058e-05
9.21209e-07
6.06187e-05
1.51869e-06
6.05382e-05
2.04649e-06
6.04195e-05
2.52113e-06
6.01861e-05
2.9412e-06
5.97081e-05
3.38349e-06
5.87453e-05
3.9594e-06
5.73424e-05
4.76698e-06
5.55797e-05
5.91829e-06
5.34665e-05
7.5096e-06
5.11189e-05
9.53702e-06
4.87265e-05
1.22463e-05
4.62905e-05
1.6087e-05
4.39551e-05
1.99561e-05
4.34961e-05
6.54823e-05
3.83094e-06
6.98538e-05
7.37269e-06
6.13418e-05
2.83963e-06
4.75471e-05
2.07166e-06
3.76905e-05
1.7975e-06
3.78218e-05
2.89972e-06
3.98008e-05
4.09083e-06
4.37381e-05
4.12761e-06
4.91805e-05
3.05991e-06
5.40266e-05
1.22058e-06
5.76915e-05
-2.60199e-09
5.9205e-05
-6.14084e-07
5.97138e-05
-5.20113e-07
5.97045e-05
-1.18949e-09
5.97884e-05
5.67973e-07
6.00516e-05
1.03537e-06
6.01661e-05
1.46758e-06
6.01205e-05
1.89766e-06
6.00037e-05
2.29026e-06
5.98074e-05
2.58929e-06
5.94227e-05
2.84249e-06
5.85052e-05
3.19633e-06
5.70009e-05
3.84302e-06
5.4944e-05
4.88283e-06
5.24368e-05
6.55508e-06
4.94554e-05
8.9729e-06
4.6316e-05
1.19223e-05
4.33484e-05
1.49667e-05
4.09193e-05
1.33593e-05
4.51131e-05
7.88583e-05
1.79877e-06
6.80666e-05
1.05398e-05
5.26096e-05
1.59957e-05
4.2098e-05
1.49457e-05
3.87462e-05
1.37546e-05
3.90174e-05
1.30866e-05
4.04743e-05
1.25331e-05
4.42985e-05
1.185e-05
4.9873e-05
1.03961e-05
5.54925e-05
8.10069e-06
5.9998e-05
4.58091e-06
6.27392e-05
1.59474e-06
6.2714e-05
6.59342e-07
6.06544e-05
7.15626e-07
5.97466e-05
9.14831e-07
5.9867e-05
1.05728e-06
6.00383e-05
1.30028e-06
5.98921e-05
1.65495e-06
5.96632e-05
2.00405e-06
5.94721e-05
2.21256e-06
5.92276e-05
2.17879e-06
5.85518e-05
2.17158e-06
5.70201e-05
2.5402e-06
5.45862e-05
3.2099e-06
5.17765e-05
4.52205e-06
4.8151e-05
6.66971e-06
4.41743e-05
9.42174e-06
4.06028e-05
8.09285e-06
4.22539e-05
-3.45214e-06
5.66682e-05
7.54229e-05
4.191e-06
6.38868e-05
1.24515e-05
4.43578e-05
1.76039e-05
3.69529e-05
1.87066e-05
3.76506e-05
1.74785e-05
4.02531e-05
1.52933e-05
4.26682e-05
1.375e-05
4.58514e-05
1.35797e-05
5.00545e-05
1.37663e-05
5.53185e-05
1.32628e-05
6.05159e-05
1.1266e-05
6.47518e-05
7.98777e-06
6.60088e-05
4.32517e-06
6.43331e-05
2.47145e-06
6.16154e-05
1.65465e-06
6.0699e-05
1.08728e-06
6.06208e-05
9.38498e-07
6.00552e-05
1.28025e-06
5.93352e-05
1.48067e-06
5.92853e-05
1.27788e-06
5.94442e-05
5.98109e-07
5.92451e-05
-1.69043e-07
5.77997e-05
-6.37266e-07
5.50655e-05
-9.53467e-07
5.21032e-05
-1.02596e-06
4.82308e-05
-1.36077e-06
4.45149e-05
-2.37412e-06
4.16203e-05
-4.70459e-06
4.45893e-05
-7.70474e-06
5.96773e-05
6.7733e-05
8.23841e-06
5.56616e-05
1.35562e-05
3.90484e-05
1.53482e-05
3.51679e-05
1.53315e-05
3.76749e-05
1.42625e-05
4.13309e-05
1.2424e-05
4.45158e-05
1.09132e-05
4.7372e-05
1.06392e-05
5.03394e-05
1.1823e-05
5.41474e-05
1.32644e-05
5.90899e-05
1.432e-05
6.37133e-05
1.37935e-05
6.65539e-05
1.06121e-05
6.75324e-05
6.86559e-06
6.53786e-05
3.88785e-06
6.36923e-05
1.7268e-06
6.27965e-05
5.62189e-07
6.12335e-05
2.86715e-07
5.96234e-05
-4.18307e-07
6.00032e-05
-2.15473e-06
6.11941e-05
-4.39502e-06
6.14994e-05
-6.46135e-06
5.98791e-05
-8.61091e-06
5.72282e-05
-1.08196e-05
5.43042e-05
-1.26167e-05
5.00368e-05
-1.38407e-05
4.57452e-05
-1.48938e-05
4.26783e-05
-1.26028e-05
4.23046e-05
-4.02559e-06
5.11089e-05
6.37196e-05
9.6548e-06
4.6021e-05
1.28741e-05
3.58376e-05
1.24131e-05
3.5636e-05
1.09883e-05
3.91072e-05
9.48412e-06
4.28433e-05
7.86629e-06
4.61428e-05
6.38726e-06
4.88609e-05
5.60805e-06
5.11295e-05
6.26432e-06
5.35033e-05
8.59087e-06
5.67783e-05
1.1288e-05
6.10323e-05
1.31353e-05
6.47242e-05
1.32109e-05
6.74745e-05
1.03243e-05
6.82823e-05
6.75891e-06
6.72734e-05
3.62411e-06
6.59465e-05
9.24069e-07
6.39485e-05
-1.59521e-06
6.21582e-05
-3.94726e-06
6.23714e-05
-6.11562e-06
6.33768e-05
-8.00508e-06
6.34024e-05
-1.01002e-05
6.19852e-05
-1.24354e-05
5.95731e-05
-1.46399e-05
5.65426e-05
-1.65019e-05
5.19038e-05
-1.7638e-05
4.68905e-05
-1.7389e-05
4.24366e-05
-1.34609e-05
3.83829e-05
-4.46263e-06
4.21181e-05
5.92674e-05
8.58916e-06
3.74448e-05
1.01061e-05
3.4329e-05
8.87151e-06
3.68781e-05
7.1172e-06
4.08696e-05
5.31641e-06
4.46529e-05
3.62431e-06
4.78443e-05
2.12716e-06
5.0368e-05
9.84802e-07
5.22824e-05
6.15792e-07
5.38838e-05
1.75493e-06
5.5652e-05
4.50271e-06
5.82993e-05
7.48097e-06
6.17621e-05
9.47118e-06
6.55017e-05
8.88733e-06
6.8884e-05
6.61265e-06
6.95655e-05
4.11156e-06
6.84645e-05
1.14698e-06
6.69291e-05
-2.28887e-06
6.56081e-05
-5.1086e-06
6.52041e-05
-6.67747e-06
6.49609e-05
-7.52862e-06
6.42683e-05
-8.54609e-06
6.302e-05
-9.69637e-06
6.07369e-05
-1.0665e-05
5.75228e-05
-1.17959e-05
5.30452e-05
-1.30024e-05
4.81063e-05
-1.37366e-05
4.3179e-05
-1.30791e-05
3.77321e-05
-8.34966e-06
3.73955e-05
5.09288e-05
5.82181e-06
3.16333e-05
6.16425e-06
3.39946e-05
4.84128e-06
3.82094e-05
3.07493e-06
4.2645e-05
1.20424e-06
4.65335e-05
-4.64385e-07
4.95234e-05
-1.86786e-06
5.17824e-05
-2.95016e-06
5.33759e-05
-3.61231e-06
5.45575e-05
-3.52753e-06
5.55793e-05
-2.1666e-06
5.69516e-05
4.43567e-07
5.91667e-05
3.56221e-06
6.23994e-05
5.3174e-06
6.71462e-05
4.33831e-06
7.05624e-05
2.46422e-06
7.03558e-05
4.41279e-07
6.89683e-05
-1.53077e-06
6.75955e-05
-2.95609e-06
6.66444e-05
-3.51926e-06
6.5539e-05
-3.46292e-06
6.42265e-05
-3.16298e-06
6.27343e-05
-3.2389e-06
6.08257e-05
-3.75187e-06
5.80492e-05
-5.02331e-06
5.43278e-05
-6.92156e-06
5.00141e-05
-8.94667e-06
4.5212e-05
-1.09531e-05
3.9745e-05
-9.74683e-06
3.61962e-05
4.11936e-05
2.36313e-06
2.92779e-05
1.90492e-06
3.44609e-05
4.26482e-07
3.96971e-05
-1.34865e-06
4.44303e-05
-3.11873e-06
4.83145e-05
-4.541e-06
5.09572e-05
-5.61536e-06
5.28686e-05
-6.35956e-06
5.41322e-05
-6.80564e-06
5.50157e-05
-6.90969e-06
5.56956e-05
-6.41937e-06
5.64739e-05
-5.01669e-06
5.77775e-05
-2.722e-06
6.01197e-05
1.04082e-07
6.43372e-05
1.44666e-06
6.92377e-05
1.13087e-06
7.06893e-05
5.61324e-07
6.95549e-05
3.34456e-07
6.78386e-05
7.85286e-07
6.62092e-05
1.6599e-06
6.46799e-05
2.51087e-06
6.33906e-05
3.03637e-06
6.22232e-05
2.97968e-06
6.08962e-05
2.21547e-06
5.88262e-05
6.85799e-07
5.58691e-05
-1.59708e-06
5.23073e-05
-4.08374e-06
4.77078e-05
-6.62354e-06
4.22925e-05
-7.21442e-06
3.67939e-05
3.39889e-05
-6.0562e-07
2.98905e-05
-2.11995e-06
3.59841e-05
-4.26893e-06
4.18567e-05
-6.08304e-06
4.62558e-05
-7.58656e-06
4.98302e-05
-8.55122e-06
5.19343e-05
-9.10073e-06
5.34307e-05
-9.34847e-06
5.43925e-05
-9.35973e-06
5.50396e-05
-9.17868e-06
5.55273e-05
-8.76605e-06
5.60741e-05
-7.98618e-06
5.70109e-05
-6.68077e-06
5.88285e-05
-4.48638e-06
6.21589e-05
-1.70287e-06
6.64725e-05
2.96949e-07
6.8708e-05
1.85814e-06
6.80116e-05
3.48192e-06
6.62319e-05
5.12784e-06
6.45798e-05
6.42005e-06
6.34032e-05
7.19443e-06
6.26311e-05
7.48095e-06
6.1951e-05
7.37178e-06
6.10193e-05
6.73162e-06
5.948e-05
5.41113e-06
5.72026e-05
3.41568e-06
5.43149e-05
1.07058e-06
5.00637e-05
-1.49889e-06
4.48712e-05
-2.73373e-06
3.80363e-05
3.12624e-05
-3.61555e-06
3.35141e-05
-6.45185e-06
3.8831e-05
-9.50513e-06
4.49227e-05
-1.11596e-05
4.79232e-05
-1.20107e-05
5.06945e-05
-1.22668e-05
5.22035e-05
-1.21529e-05
5.33299e-05
-1.18342e-05
5.4087e-05
-1.13646e-05
5.4583e-05
-1.0775e-05
5.49506e-05
-1.00672e-05
5.53794e-05
-9.22165e-06
5.61787e-05
-8.12178e-06
5.77427e-05
-6.28759e-06
6.03402e-05
-3.19005e-06
6.33922e-05
3.22562e-07
6.52135e-05
3.42142e-06
6.49303e-05
5.9678e-06
6.37022e-05
7.87757e-06
6.26857e-05
9.13272e-06
6.21632e-05
9.86403e-06
6.19147e-05
1.02279e-05
6.1602e-05
1.03209e-05
6.09411e-05
1.00894e-05
5.97261e-05
9.42028e-06
5.78857e-05
8.17997e-06
5.55687e-05
6.24442e-06
5.20115e-05
3.34225e-06
4.77842e-05
1.19792e-06
4.01889e-05
3.24675e-05
-9.50525e-06
4.3028e-05
-1.33722e-05
4.27112e-05
-1.54365e-05
4.7002e-05
-1.62222e-05
4.87231e-05
-1.5885e-05
5.03712e-05
-1.52612e-05
5.15933e-05
-1.45124e-05
5.25945e-05
-1.36843e-05
5.32721e-05
-1.27839e-05
5.36957e-05
-1.18074e-05
5.39872e-05
-1.07334e-05
5.43185e-05
-9.52905e-06
5.49877e-05
-8.08972e-06
5.63173e-05
-6.03879e-06
5.83043e-05
-2.95411e-06
6.03237e-05
8.29842e-07
6.14463e-05
4.33753e-06
6.1439e-05
7.06066e-06
6.09948e-05
9.00392e-06
6.07577e-05
1.03431e-05
6.08392e-05
1.12704e-05
6.10025e-05
1.19253e-05
6.09623e-05
1.23842e-05
6.04975e-05
1.26842e-05
5.94412e-05
1.28033e-05
5.77813e-05
1.26115e-05
5.57748e-05
1.14346e-05
5.32017e-05
8.76381e-06
5.04679e-05
5.21853e-06
4.37446e-05
3.7697e-05
-2.31303e-05
6.61762e-05
-2.45229e-05
4.41201e-05
-2.17704e-05
4.42648e-05
-1.9867e-05
4.68345e-05
-1.83184e-05
4.88364e-05
-1.71035e-05
5.03918e-05
-1.59931e-05
5.14974e-05
-1.48447e-05
5.21369e-05
-1.36251e-05
5.24892e-05
-1.23359e-05
5.27109e-05
-1.09405e-05
5.2936e-05
-9.37428e-06
5.34347e-05
-7.51234e-06
5.44692e-05
-5.13357e-06
5.59401e-05
-2.09673e-06
5.73022e-05
1.37532e-06
5.79897e-05
4.64351e-06
5.81861e-05
7.29732e-06
5.83559e-05
9.32725e-06
5.87426e-05
1.08871e-05
5.92942e-05
1.21004e-05
5.98043e-05
1.30525e-05
6.00255e-05
1.38097e-05
5.97557e-05
1.44807e-05
5.87854e-05
1.52264e-05
5.70503e-05
1.62319e-05
5.47835e-05
1.69415e-05
5.25059e-05
1.67583e-05
5.06658e-05
1.31175e-05
4.74007e-05
5.08286e-05
-1.80224e-05
8.42207e-05
-2.5139e-05
5.12524e-05
-2.27872e-05
4.1928e-05
-2.03743e-05
4.44354e-05
-1.88655e-05
4.73402e-05
-1.77669e-05
4.93062e-05
-1.66542e-05
5.03977e-05
-1.53827e-05
5.08784e-05
-1.39598e-05
5.1079e-05
-1.24362e-05
5.12001e-05
-1.07997e-05
5.13123e-05
-8.9826e-06
5.16305e-05
-6.87761e-06
5.23777e-05
-4.367e-06
5.34436e-05
-1.45851e-06
5.44083e-05
1.65083e-06
5.48951e-05
4.60873e-06
5.52426e-05
7.19422e-06
5.57847e-05
9.35208e-06
5.65989e-05
1.11441e-05
5.75165e-05
1.26067e-05
5.83564e-05
1.37544e-05
5.88928e-05
1.46395e-05
5.88859e-05
1.53686e-05
5.80715e-05
1.621e-05
5.62236e-05
1.77838e-05
5.32232e-05
2.03747e-05
4.99278e-05
2.45915e-05
4.64636e-05
2.40511e-05
4.79614e-05
7.49036e-05
2.68925e-06
8.15471e-05
-1.16019e-05
6.55561e-05
-1.79967e-05
4.83336e-05
-1.79967e-05
4.44471e-05
-1.7765e-05
4.71202e-05
-1.7579e-05
4.91332e-05
-1.67155e-05
4.9547e-05
-1.54413e-05
4.96168e-05
-1.38733e-05
4.95233e-05
-1.21693e-05
4.95084e-05
-1.03566e-05
4.9512e-05
-8.41019e-06
4.9697e-05
-6.26074e-06
5.02417e-05
-3.82552e-06
5.10225e-05
-1.13496e-06
5.17321e-05
1.65037e-06
5.2124e-05
4.35597e-06
5.25509e-05
6.88665e-06
5.32676e-05
9.16856e-06
5.43305e-05
1.11821e-05
5.55166e-05
1.28859e-05
5.66665e-05
1.41394e-05
5.76538e-05
1.49782e-05
5.80622e-05
1.54848e-05
5.758e-05
1.57422e-05
5.59807e-05
1.65753e-05
5.24028e-05
1.85501e-05
4.79635e-05
1.85926e-05
4.64336e-05
8.438e-06
5.81316e-05
8.33552e-05
1.40213e-05
6.75389e-05
1.26287e-05
6.6958e-05
2.21887e-06
5.87518e-05
-6.93567e-06
5.36114e-05
-1.31117e-05
5.33081e-05
-1.60669e-05
5.21012e-05
-1.62319e-05
4.9725e-05
-1.51177e-05
4.85147e-05
-1.33944e-05
4.78117e-05
-1.15202e-05
4.7646e-05
-9.57252e-06
4.75765e-05
-7.62318e-06
4.77607e-05
-5.61136e-06
4.82436e-05
-3.43546e-06
4.8861e-05
-1.09371e-06
4.94051e-05
1.31411e-06
4.97306e-05
3.76145e-06
5.01174e-05
6.2578e-06
5.07844e-05
8.70259e-06
5.18985e-05
1.09239e-05
5.33082e-05
1.29223e-05
5.46812e-05
1.43032e-05
5.6286e-05
1.47866e-05
5.75937e-05
1.41672e-05
5.8215e-05
1.26198e-05
5.75424e-05
1.0116e-05
5.49188e-05
5.78777e-06
5.23024e-05
-1.98817e-06
5.42199e-05
-1.05015e-05
6.66534e-05
7.28668e-05
1.61438e-05
5.14045e-05
2.76757e-05
5.54363e-05
2.37366e-05
6.2703e-05
1.11368e-05
6.62261e-05
-1.09445e-06
6.55519e-05
-1.01535e-05
6.11736e-05
-1.4191e-05
5.37748e-05
-1.41366e-05
4.84716e-05
-1.23868e-05
4.60729e-05
-1.03617e-05
4.56322e-05
-8.34534e-06
4.55723e-05
-6.58544e-06
4.60142e-05
-4.90858e-06
4.65812e-05
-3.16699e-06
4.71346e-05
-1.31914e-06
4.75726e-05
6.05457e-07
4.78211e-05
2.7175e-06
4.80196e-05
5.17063e-06
4.83446e-05
7.83931e-06
4.9242e-05
1.02544e-05
5.09051e-05
1.23734e-05
5.25752e-05
1.38367e-05
5.48369e-05
1.30849e-05
5.83597e-05
8.72633e-06
6.25884e-05
1.58398e-06
6.46995e-05
-7.73654e-06
6.42532e-05
-1.8585e-05
6.31617e-05
-2.642e-05
6.20646e-05
-1.79568e-05
5.82011e-05
5.49197e-05
1.35014e-05
3.79118e-05
2.23072e-05
4.66416e-05
2.49818e-05
6.00449e-05
1.91854e-05
7.20329e-05
9.19006e-06
7.55634e-05
-1.23237e-06
7.16102e-05
-7.63584e-06
6.01904e-05
-1.00641e-05
5.09108e-05
-1.00985e-05
4.61177e-05
-8.49331e-06
4.40382e-05
-6.69292e-06
4.37844e-05
-5.37128e-06
4.47067e-05
-4.19882e-06
4.54243e-05
-3.00218e-06
4.59542e-05
-1.73648e-06
4.63233e-05
-4.04715e-07
4.65053e-05
1.25125e-06
4.63785e-05
3.56137e-06
4.60476e-05
6.48456e-06
4.63298e-05
9.13582e-06
4.82648e-05
1.02888e-05
5.14337e-05
9.74857e-06
5.53903e-05
6.4966e-06
6.16257e-05
-5.03102e-07
6.96021e-05
-1.06466e-05
7.4857e-05
-2.18254e-05
7.54466e-05
-3.00505e-05
7.14047e-05
-2.80841e-05
6.0112e-05
-1.68453e-05
4.69724e-05
3.80819e-05
6.69904e-06
3.12213e-05
7.92473e-06
4.54277e-05
1.10629e-05
5.69225e-05
1.06441e-05
7.24714e-05
7.20548e-06
7.90236e-05
3.38707e-06
7.54484e-05
-4.02364e-07
6.39971e-05
-3.97968e-06
5.45028e-05
-5.86475e-06
4.8015e-05
-5.6023e-06
4.37878e-05
-4.81904e-06
4.30149e-05
-4.22093e-06
4.41239e-05
-3.63436e-06
4.4854e-05
-2.91197e-06
4.52482e-05
-2.12248e-06
4.55502e-05
-1.40051e-06
4.57995e-05
-4.81132e-07
4.54747e-05
1.15864e-06
4.44212e-05
3.67979e-06
4.382e-05
5.18087e-06
4.67746e-05
4.65492e-06
5.19717e-05
2.10774e-06
5.7951e-05
-1.87124e-06
6.56203e-05
-5.89802e-06
7.3646e-05
-1.10278e-05
8.00051e-05
-1.63151e-05
8.07525e-05
-1.77039e-05
7.28112e-05
-1.33053e-05
5.57282e-05
-8.9006e-06
4.25794e-05
2.91896e-05
2.21673e-08
3.12071e-05
-3.7965e-06
4.92599e-05
-3.25032e-06
5.63925e-05
-1.58606e-07
6.9403e-05
2.148e-06
7.67433e-05
2.38926e-06
7.52338e-05
1.18017e-06
6.52295e-05
-5.59146e-07
5.62603e-05
-1.92046e-06
4.93911e-05
-2.69965e-06
4.45794e-05
-3.41649e-06
4.37444e-05
-3.77084e-06
4.44911e-05
-3.55249e-06
4.46481e-05
-3.00556e-06
4.47135e-05
-2.35213e-06
4.49089e-05
-1.79955e-06
4.52589e-05
-1.64545e-06
4.53325e-05
-1.51252e-06
4.43e-05
-6.28852e-07
4.29484e-05
-2.59426e-07
4.64181e-05
-1.09568e-06
5.28234e-05
-2.50353e-06
5.9376e-05
-4.1299e-06
6.72658e-05
-4.39351e-06
7.39306e-05
-4.65974e-06
8.02938e-05
-3.7086e-06
7.98245e-05
-7.28871e-07
6.98517e-05
9.13689e-07
5.41004e-05
-1.32675e-06
4.4831e-05
2.78696e-05
-4.20547e-06
3.54186e-05
-1.16165e-05
5.66841e-05
-1.05081e-05
5.52974e-05
-5.4994e-06
6.44132e-05
-3.4911e-08
7.13013e-05
2.48287e-06
7.27404e-05
1.13744e-06
6.6593e-05
5.77554e-07
5.68343e-05
-7.02202e-07
5.0682e-05
-2.55664e-06
4.64427e-05
-3.78229e-06
4.49772e-05
-3.95639e-06
4.46727e-05
-3.58416e-06
4.42833e-05
-3.00438e-06
4.41411e-05
-2.31788e-06
4.42297e-05
-1.57091e-06
4.45195e-05
-1.04583e-06
4.48151e-05
-1.16821e-06
4.44302e-05
-2.19225e-06
4.39812e-05
-2.29051e-06
4.65269e-05
-3.79573e-06
5.43414e-05
-4.35263e-06
5.99482e-05
-3.74799e-06
6.66794e-05
-1.86467e-06
7.2069e-05
9.90884e-07
7.74633e-05
5.35042e-06
7.54899e-05
9.74854e-06
6.54747e-05
1.00704e-05
5.37928e-05
3.34003e-06
5.1573e-05
3.12147e-05
-9.89067e-06
4.53151e-05
-1.3371e-05
6.01738e-05
-1.25739e-05
5.45096e-05
-7.92816e-06
5.97787e-05
-1.51235e-06
6.48977e-05
3.44845e-06
6.77882e-05
4.1682e-06
6.58816e-05
3.55689e-06
5.7452e-05
2.0274e-06
5.22167e-05
-6.96828e-07
4.9171e-05
-2.86893e-06
4.71515e-05
-3.61347e-06
4.54192e-05
-3.61941e-06
4.42919e-05
-3.34448e-06
4.38695e-05
-2.79175e-06
4.36811e-05
-1.95036e-06
4.36829e-05
-1.32744e-06
4.41973e-05
-2.19232e-06
4.52983e-05
-4.38321e-06
4.61758e-05
-5.76061e-06
4.79095e-05
-6.61887e-06
5.52061e-05
-5.96623e-06
5.93037e-05
-3.89961e-06
6.46238e-05
-1.13139e-06
6.93142e-05
3.61325e-06
7.27347e-05
9.71761e-06
6.94021e-05
1.43e-05
6.09063e-05
1.32725e-05
5.48335e-05
9.89993e-06
5.49555e-05
4.11193e-05
-8.35754e-06
5.36765e-05
-1.05247e-05
6.23446e-05
-1.07095e-05
5.46999e-05
-7.68652e-06
5.67617e-05
-3.62451e-06
6.08413e-05
-4.15652e-07
6.45835e-05
9.94924e-07
6.44741e-05
-3.65187e-07
5.88149e-05
-1.70646e-06
5.35619e-05
-2.28375e-06
4.9752e-05
-2.31148e-06
4.71815e-05
-2.16711e-06
4.52755e-05
-1.88344e-06
4.40086e-05
-1.42748e-06
4.34137e-05
-9.60172e-07
4.32138e-05
-6.55854e-07
4.33784e-05
-5.86437e-07
4.41274e-05
-8.21159e-07
4.55341e-05
-1.74563e-06
4.7103e-05
-3.70362e-06
4.98708e-05
-4.05798e-06
5.55641e-05
-4.33316e-06
5.95829e-05
-3.2824e-06
6.35782e-05
-7.20219e-07
6.67583e-05
4.37573e-06
6.76455e-05
1.00776e-05
6.37067e-05
1.33908e-05
5.75992e-05
1.24226e-05
5.58057e-05
9.09732e-06
5.82841e-05
5.02191e-05
-7.14681e-06
6.0817e-05
-7.0946e-06
6.22885e-05
-9.03054e-06
5.66324e-05
-9.39703e-06
5.71277e-05
-8.15988e-06
5.96063e-05
-4.85223e-06
6.12802e-05
-1.99903e-06
6.16276e-05
-1.08501e-06
5.79084e-05
-1.0198e-06
5.35045e-05
-1.16592e-06
4.99055e-05
-1.2572e-06
4.7279e-05
-1.31636e-06
4.53398e-05
-1.31692e-06
4.40137e-05
-1.194e-06
4.3295e-05
-1.04378e-06
4.30677e-05
-9.71853e-07
4.33106e-05
-9.5734e-07
4.41173e-05
-8.85488e-07
4.54674e-05
-1.08097e-06
4.73048e-05
-1.50505e-06
5.03016e-05
-5.58014e-07
5.46241e-05
6.76538e-07
5.83551e-05
3.34509e-06
6.09149e-05
5.3386e-06
6.47689e-05
7.97232e-06
6.50141e-05
9.66957e-06
6.20106e-05
9.2042e-06
5.80644e-05
8.23946e-06
5.6767e-05
6.59811e-06
5.99226e-05
5.6818e-05
-3.16401e-06
6.39879e-05
-3.87184e-06
6.30042e-05
-6.1692e-06
5.89366e-05
-7.25998e-06
5.82253e-05
-6.76231e-06
5.91157e-05
-5.27872e-06
5.9805e-05
-2.75819e-06
5.91163e-05
-1.16751e-06
5.63271e-05
-5.77943e-07
5.29237e-05
-5.1234e-07
4.98479e-05
-6.06836e-07
4.73806e-05
-7.42123e-07
4.54814e-05
-8.6822e-07
4.41456e-05
-9.46206e-07
4.33786e-05
-1.00534e-06
4.31323e-05
-1.08102e-06
4.33918e-05
-1.14489e-06
4.41871e-05
-1.1844e-06
4.55134e-05
-1.26075e-06
4.73884e-05
-1.04173e-06
5.00908e-05
-4.45962e-08
5.36359e-05
1.31373e-06
5.70061e-05
2.35414e-06
5.98837e-05
4.81636e-06
6.23155e-05
7.05743e-06
6.27812e-05
7.99091e-06
6.10838e-05
7.0327e-06
5.90283e-05
5.25705e-06
5.85482e-05
3.95675e-06
6.12295e-05
6.07796e-05
-2.35911e-06
6.6358e-05
-3.62289e-06
6.42792e-05
-5.17363e-06
6.04968e-05
-5.93843e-06
5.89986e-05
-5.52836e-06
5.87139e-05
-4.15679e-06
5.8442e-05
-2.31425e-06
5.72824e-05
-9.80837e-07
5.5002e-05
-3.10098e-07
5.22607e-05
-9.92309e-08
4.96441e-05
-1.115e-07
4.73993e-05
-2.4167e-07
4.56176e-05
-4.31958e-07
4.43415e-05
-6.37811e-07
4.35898e-05
-8.47713e-07
4.33475e-05
-1.05714e-06
4.36067e-05
-1.23894e-06
4.43746e-05
-1.36796e-06
4.56486e-05
-1.41832e-06
4.74455e-05
-1.16751e-06
4.98473e-05
-3.24299e-07
5.28007e-05
9.43237e-07
5.57471e-05
2.45172e-06
5.83843e-05
4.49956e-06
6.02771e-05
6.32813e-06
6.09622e-05
7.03067e-06
6.03907e-05
6.40593e-06
5.96621e-05
4.87231e-06
6.00907e-05
3.45003e-06
6.26615e-05
6.42383e-05
-1.69608e-06
6.80665e-05
-2.69633e-06
6.52902e-05
-3.80856e-06
6.1618e-05
-4.3324e-06
5.95305e-05
-3.99694e-06
5.83861e-05
-2.95695e-06
5.74095e-05
-1.65481e-06
5.59875e-05
-6.15072e-07
5.39691e-05
-5.62396e-09
5.16576e-05
2.57409e-07
4.93869e-05
2.7837e-07
4.73838e-05
1.33052e-07
4.57681e-05
-1.14868e-07
4.45944e-05
-4.12715e-07
4.38924e-05
-7.26999e-07
4.36665e-05
-1.03042e-06
4.39149e-05
-1.28729e-06
4.46364e-05
-1.4574e-06
4.5824e-05
-1.48349e-06
4.74772e-05
-1.22596e-06
4.95959e-05
-5.01647e-07
5.20831e-05
6.44452e-07
5.46082e-05
2.13868e-06
5.68978e-05
3.78337e-06
5.86405e-05
5.14315e-06
5.96108e-05
5.64677e-06
5.98954e-05
5.12692e-06
6.01905e-05
3.84629e-06
6.13805e-05
2.31219e-06
6.42063e-05
6.6563e-05
-8.94718e-07
6.89724e-05
-1.55728e-06
6.59626e-05
-2.28449e-06
6.23533e-05
-2.63249e-06
5.98856e-05
-2.41247e-06
5.81726e-05
-1.70951e-06
5.67128e-05
-8.15373e-07
5.50994e-05
-4.80585e-08
5.32074e-05
4.44607e-07
5.11702e-05
6.52886e-07
4.91835e-05
6.27784e-07
4.74135e-05
4.32839e-07
4.59673e-05
1.24084e-07
4.49073e-05
-2.46915e-07
4.42675e-05
-6.37585e-07
4.40613e-05
-1.00934e-06
4.42908e-05
-1.32061e-06
4.49519e-05
-1.52496e-06
4.60327e-05
-1.55936e-06
4.75163e-05
-1.32632e-06
4.93678e-05
-7.28337e-07
5.14905e-05
2.12661e-07
5.3673e-05
1.4104e-06
5.57063e-05
2.65871e-06
5.73988e-05
3.63693e-06
5.86394e-05
3.98805e-06
5.95514e-05
3.59267e-06
6.05933e-05
2.62348e-06
6.2358e-05
1.49769e-06
6.53419e-05
6.80722e-05
-6.80167e-08
6.90507e-05
-4.16817e-07
6.63203e-05
-8.30884e-07
6.27748e-05
-1.03735e-06
6.00985e-05
-9.0093e-07
5.8042e-05
-4.58241e-07
5.62754e-05
1.15e-07
5.45311e-05
6.19655e-07
5.27074e-05
9.38544e-07
5.08556e-05
1.03824e-06
4.90879e-05
9.38887e-07
4.75167e-05
6.8244e-07
4.62274e-05
3.16075e-07
4.52772e-05
-1.13047e-07
4.47001e-05
-5.60867e-07
4.45125e-05
-9.85186e-07
4.47186e-05
-1.34275e-06
4.53131e-05
-1.5873e-06
4.6281e-05
-1.66438e-06
4.75973e-05
-1.50999e-06
4.92175e-05
-1.07288e-06
5.10577e-05
-3.73467e-07
5.29783e-05
5.02867e-07
5.48349e-05
1.3961e-06
5.65109e-05
2.07644e-06
5.79647e-05
2.32208e-06
5.93117e-05
2.05951e-06
6.08624e-05
1.40738e-06
6.30176e-05
6.45137e-07
6.61131e-05
6.87278e-05
5.97304e-07
6.84627e-05
6.22289e-07
6.63035e-05
4.72346e-07
6.29315e-05
3.81066e-07
6.01955e-05
4.62185e-07
5.79659e-05
7.11174e-07
5.60309e-05
1.03091e-06
5.42155e-05
1.30114e-06
5.2441e-05
1.43878e-06
5.07215e-05
1.41028e-06
4.91197e-05
1.22072e-06
4.77094e-05
8.97017e-07
4.65542e-05
4.76144e-07
4.5701e-05
-1.24655e-09
4.51804e-05
-4.94201e-07
4.50084e-05
-9.6215e-07
4.51895e-05
-1.3643e-06
4.57182e-05
-1.65925e-06
4.6579e-05
-1.80372e-06
4.77449e-05
-1.75626e-06
4.91734e-05
-1.49168e-06
5.07967e-05
-1.03055e-06
5.2521e-05
-4.43056e-07
5.42515e-05
1.51904e-07
5.59203e-05
6.00808e-07
5.75205e-05
7.69393e-07
5.91483e-05
6.21941e-07
6.10157e-05
2.55662e-07
6.33907e-05
-9.78698e-08
6.64749e-05
6.86394e-05
1.15152e-06
6.73195e-05
1.53372e-06
6.59287e-05
1.59766e-06
6.28737e-05
1.59433e-06
6.02039e-05
1.63412e-06
5.79304e-05
1.73774e-06
5.59312e-05
1.86054e-06
5.40961e-05
1.93522e-06
5.23695e-05
1.90841e-06
5.07513e-05
1.75432e-06
4.92766e-05
1.473e-06
4.79934e-05
1.08238e-06
4.69474e-05
6.10816e-07
4.61751e-05
9.19409e-08
4.57018e-05
-4.38639e-07
4.55414e-05
-9.44868e-07
4.56982e-05
-1.39089e-06
4.61667e-05
-1.74178e-06
4.69324e-05
-1.96472e-06
4.79705e-05
-2.03249e-06
4.9244e-05
-1.93386e-06
5.0701e-05
-1.68754e-06
5.22778e-05
-1.34624e-06
5.39136e-05
-9.9272e-07
5.55704e-05
-7.23757e-07
5.72556e-05
-6.13748e-07
5.90428e-05
-6.66637e-07
6.10738e-05
-7.85406e-07
6.35156e-05
-7.27862e-07
6.64248e-05
6.792e-05
1.61797e-06
6.57089e-05
2.29128e-06
6.5262e-05
2.51707e-06
6.26533e-05
2.57818e-06
6.01473e-05
2.5871e-06
5.79253e-05
2.58384e-06
5.59378e-05
2.55846e-06
5.41245e-05
2.47906e-06
5.24516e-05
2.3156e-06
5.09173e-05
2.05197e-06
4.95426e-05
1.68816e-06
4.83595e-05
1.23726e-06
4.74005e-05
7.21267e-07
4.66933e-05
1.67371e-07
4.62578e-05
-3.94692e-07
4.61056e-05
-9.34415e-07
4.624e-05
-1.42174e-06
4.66562e-05
-1.82833e-06
4.73412e-05
-2.12942e-06
4.82738e-05
-2.30704e-06
4.94239e-05
-2.35627e-06
5.07527e-05
-2.29217e-06
5.22163e-05
-2.15138e-06
5.37756e-05
-1.98717e-06
5.54093e-05
-1.85525e-06
5.71271e-05
-1.78855e-06
5.898e-05
-1.76571e-06
6.10555e-05
-1.68445e-06
6.34398e-05
-1.27303e-06
6.60201e-05
6.66546e-05
1.96112e-06
6.37542e-05
2.84923e-06
6.43797e-05
3.20036e-06
6.23069e-05
3.31215e-06
6.00395e-05
3.30336e-06
5.79375e-05
3.22757e-06
5.60165e-05
3.09758e-06
5.42571e-05
2.90506e-06
5.26465e-05
2.63733e-06
5.11872e-05
2.28729e-06
4.98947e-05
1.85703e-06
4.87917e-05
1.35738e-06
4.79021e-05
8.05925e-07
4.72466e-05
2.2462e-07
4.6841e-05
-3.6219e-07
4.66943e-05
-9.29387e-07
4.68091e-05
-1.45243e-06
4.71811e-05
-1.90875e-06
4.77994e-05
-2.27953e-06
4.86465e-05
-2.55223e-06
4.96986e-05
-2.72415e-06
5.09267e-05
-2.80557e-06
5.22999e-05
-2.81957e-06
5.3792e-05
-2.79672e-06
5.5389e-05
-2.76356e-06
5.70969e-05
-2.72432e-06
5.89442e-05
-2.63882e-06
6.0974e-05
-2.39608e-06
6.3202e-05
-1.70385e-06
6.53338e-05
6.49574e-05
2.15371e-06
6.16059e-05
3.17017e-06
6.33683e-05
3.62706e-06
6.18542e-05
3.78685e-06
5.9883e-05
3.77737e-06
5.79498e-05
3.66135e-06
5.6135e-05
3.46628e-06
5.44544e-05
3.19938e-06
5.29154e-05
2.86041e-06
5.15281e-05
2.44982e-06
5.03071e-05
1.97249e-06
4.92708e-05
1.43857e-06
4.84377e-05
8.62811e-07
4.78241e-05
2.63237e-07
4.74423e-05
-3.40222e-07
4.72995e-05
-9.2704e-07
4.73976e-05
-1.47731e-06
4.77331e-05
-1.973e-06
4.82968e-05
-2.39941e-06
4.90746e-05
-2.74687e-06
5.00478e-05
-3.01265e-06
5.11942e-05
-3.20205e-06
5.24912e-05
-3.32708e-06
5.3919e-05
-3.40159e-06
5.54658e-05
-3.43171e-06
5.71295e-05
-3.40176e-06
5.89172e-05
-3.25861e-06
6.08344e-05
-2.88025e-06
6.28279e-05
-1.99299e-06
6.44518e-05
6.29701e-05
2.18384e-06
5.94264e-05
3.26856e-06
6.22877e-05
3.80436e-06
6.13218e-05
4.0118e-06
5.96785e-05
4.01874e-06
5.79453e-05
3.89183e-06
5.6264e-05
3.66679e-06
5.46813e-05
3.36026e-06
5.32237e-05
2.98096e-06
5.19091e-05
2.53535e-06
5.07544e-05
2.03113e-06
4.97766e-05
1.47864e-06
4.89917e-05
8.91006e-07
4.84133e-05
2.83533e-07
4.80513e-05
-3.27168e-07
4.79117e-05
-9.24126e-07
4.79961e-05
-1.49097e-06
4.83014e-05
-2.01294e-06
4.88203e-05
-2.47792e-06
4.95411e-05
-2.87748e-06
5.04489e-05
-3.20769e-06
5.1526e-05
-3.46915e-06
5.27543e-05
-3.66513e-06
5.41168e-05
-3.79739e-06
5.56e-05
-3.85828e-06
5.71926e-05
-3.81904e-06
5.88804e-05
-3.61978e-06
6.06381e-05
-3.13347e-06
6.23452e-05
-2.12303e-06
6.34458e-05
6.08518e-05
2.07263e-06
5.73572e-05
3.17634e-06
6.11874e-05
3.76731e-06
6.07337e-05
4.01884e-06
5.94293e-05
4.05245e-06
5.79137e-05
3.94054e-06
5.63778e-05
3.71397e-06
5.49096e-05
3.3964e-06
5.35429e-05
3.00332e-06
5.23036e-05
2.5457e-06
5.12134e-05
2.03364e-06
5.02901e-05
1.47805e-06
4.95487e-05
8.91266e-07
4.90014e-05
2.86832e-07
4.86571e-05
-3.20931e-07
4.85208e-05
-9.17577e-07
4.85941e-05
-1.48922e-06
4.88744e-05
-2.02324e-06
4.93556e-05
-2.50894e-06
5.00282e-05
-2.93812e-06
5.08794e-05
-3.3052e-06
5.18945e-05
-3.60658e-06
5.30571e-05
-3.83867e-06
5.43504e-05
-3.99431e-06
5.57573e-05
-4.05708e-06
5.72572e-05
-3.99517e-06
5.88206e-05
-3.74311e-06
6.03885e-05
-3.1775e-06
6.17826e-05
-2.10211e-06
6.23741e-05
5.87534e-05
1.85721e-06
5.55024e-05
2.93963e-06
6.01076e-05
3.5643e-06
6.01113e-05
3.86357e-06
5.9132e-05
3.93712e-06
5.78419e-05
3.84511e-06
5.64713e-05
3.63149e-06
5.51246e-05
3.32359e-06
5.38521e-05
2.93796e-06
5.26906e-05
2.48767e-06
5.1665e-05
1.98446e-06
5.07946e-05
1.43991e-06
5.00945e-05
8.66032e-07
4.95766e-05
2.75364e-07
4.9249e-05
-3.19243e-07
4.91167e-05
-9.0499e-07
4.91811e-05
-1.46958e-06
4.94402e-05
-2.00164e-06
4.9889e-05
-2.49113e-06
5.05189e-05
-2.92949e-06
5.1319e-05
-3.30947e-06
5.22757e-05
-3.6242e-06
5.33731e-05
-3.86507e-06
5.45926e-05
-4.01786e-06
5.59115e-05
-4.06351e-06
5.73044e-05
-3.97155e-06
5.87304e-05
-3.67009e-06
6.00891e-05
-3.049e-06
6.1164e-05
-1.95598e-06
6.1284e-05
5.68002e-05
1.59503e-06
5.3909e-05
2.61411e-06
5.90904e-05
3.23566e-06
5.94915e-05
3.5618e-06
5.88074e-05
3.67376e-06
5.77313e-05
3.62027e-06
5.65261e-05
3.44085e-06
5.53053e-05
3.1607e-06
5.41334e-05
2.79921e-06
5.30532e-05
2.37158e-06
5.20938e-05
1.89091e-06
5.12764e-05
1.36942e-06
5.06172e-05
8.19107e-07
5.01281e-05
2.51988e-07
4.98173e-05
-3.19937e-07
4.96898e-05
-8.84857e-07
4.97472e-05
-1.43138e-06
4.99879e-05
-1.94878e-06
5.04075e-05
-2.42712e-06
5.09984e-05
-2.85726e-06
5.17503e-05
-3.23049e-06
5.26501e-05
-3.53778e-06
5.36815e-05
-3.76853e-06
5.48245e-05
-3.90845e-06
5.60526e-05
-3.92911e-06
5.73264e-05
-3.79168e-06
5.85945e-05
-3.4448e-06
5.97439e-05
-2.7984e-06
6.05195e-05
-1.73196e-06
6.02197e-05
5.50701e-05
1.32512e-06
5.2585e-05
2.24739e-06
5.81695e-05
2.84247e-06
5.88977e-05
3.18621e-06
5.84649e-05
3.33029e-06
5.75884e-05
3.31598e-06
5.65415e-05
3.17505e-06
5.54472e-05
2.9315e-06
5.4378e-05
2.60461e-06
5.33811e-05
2.21028e-06
5.24891e-05
1.76227e-06
5.17254e-05
1.27322e-06
5.11073e-05
7.55173e-07
5.06472e-05
2.19873e-07
5.03536e-05
-3.2115e-07
5.02319e-05
-8.56621e-07
5.02837e-05
-1.37562e-06
5.05079e-05
-1.86764e-06
5.09005e-05
-2.32261e-06
5.14544e-05
-2.73073e-06
5.21594e-05
-3.08205e-06
5.30024e-05
-3.36569e-06
5.39661e-05
-3.56855e-06
5.50284e-05
-3.67342e-06
5.61585e-05
-3.65754e-06
5.73116e-05
-3.48491e-06
5.8423e-05
-3.11184e-06
5.93721e-05
-2.47405e-06
5.98831e-05
-1.47778e-06
5.9225e-05
5.35937e-05
1.06994e-06
5.15161e-05
1.87713e-06
5.73633e-05
2.43072e-06
5.8345e-05
2.77734e-06
5.81192e-05
2.94497e-06
5.74216e-05
2.96491e-06
5.65224e-05
2.86248e-06
5.55505e-05
2.65883e-06
5.45825e-05
2.37192e-06
5.36689e-05
2.01724e-06
5.28447e-05
1.60857e-06
5.2135e-05
1.15859e-06
5.15582e-05
6.7927e-07
5.11274e-05
1.82184e-07
5.08517e-05
-3.21421e-07
5.07364e-05
-8.20569e-07
5.07838e-05
-1.30456e-06
5.09929e-05
-1.76294e-06
5.13599e-05
-2.18545e-06
5.18778e-05
-2.56176e-06
5.25366e-05
-2.88113e-06
5.33226e-05
-3.13172e-06
5.42176e-05
-3.29965e-06
5.51972e-05
-3.36802e-06
5.62278e-05
-3.31611e-06
5.72606e-05
-3.11491e-06
5.82227e-05
-2.72849e-06
5.89867e-05
-2.11864e-06
5.92742e-05
-1.22156e-06
5.83289e-05
5.23731e-05
8.42705e-07
5.0674e-05
1.52914e-06
5.66776e-05
2.03147e-06
5.78435e-05
2.36706e-06
5.77844e-05
2.54739e-06
5.72421e-05
2.59449e-06
5.64761e-05
2.5272e-06
5.56186e-05
2.36293e-06
5.47476e-05
2.11752e-06
5.39152e-05
1.80534e-06
5.31577e-05
1.43962e-06
5.25016e-05
1.03269e-06
5.1966e-05
5.96327e-07
5.15647e-05
1.41847e-07
5.13071e-05
-3.19731e-07
5.11989e-05
-7.77639e-07
5.12426e-05
-1.22132e-06
5.14375e-05
-1.64036e-06
5.17798e-05
-2.02437e-06
5.22627e-05
-2.36279e-06
5.28759e-05
-2.64458e-06
5.36052e-05
-2.85774e-06
5.44315e-05
-2.98878e-06
5.5329e-05
-3.02212e-06
5.62618e-05
-2.93978e-06
5.71789e-05
-2.7197e-06
5.80034e-05
-2.33494e-06
5.86027e-05
-1.76625e-06
5.87063e-05
-9.82915e-07
5.75465e-05
5.1391e-05
6.50094e-07
5.00243e-05
1.22029e-06
5.61078e-05
1.66377e-06
5.74004e-05
1.97617e-06
5.74724e-05
2.15967e-06
5.70591e-05
2.22622e-06
5.64101e-05
2.18876e-06
5.56566e-05
2.0608e-06
5.48762e-05
1.85562e-06
5.4121e-05
1.58605e-06
5.3428e-05
1.26432e-06
5.28241e-05
9.02137e-07
5.23289e-05
5.1083e-07
5.19567e-05
1.01381e-07
5.17173e-05
-3.15474e-07
5.16165e-05
-7.29201e-07
5.16571e-05
-1.12942e-06
5.18384e-05
-1.50581e-06
5.21569e-05
-1.84807e-06
5.26056e-05
-2.14567e-06
5.31742e-05
-2.38775e-06
5.38479e-05
-2.56274e-06
5.46071e-05
-2.65816e-06
5.5425e-05
-2.66047e-06
5.62648e-05
-2.5551e-06
5.70742e-05
-2.32639e-06
5.77752e-05
-1.95771e-06
5.82346e-05
-1.44146e-06
5.81906e-05
-7.73826e-07
5.68793e-05
5.06175e-05
4.92633e-07
4.95323e-05
9.55884e-07
5.56448e-05
1.3371e-06
5.70195e-05
1.6192e-06
5.71907e-05
1.79753e-06
5.68812e-05
1.87593e-06
5.63321e-05
1.86214e-06
5.56709e-05
1.76589e-06
5.4973e-05
1.59784e-06
5.42896e-05
1.36898e-06
5.36575e-05
1.09027e-06
5.31034e-05
7.72588e-07
5.26473e-05
4.266e-07
5.23034e-05
6.28195e-08
5.20818e-05
-3.08403e-07
5.19885e-05
-6.76852e-07
5.20263e-05
-1.03241e-06
5.21947e-05
-1.36502e-06
5.24902e-05
-1.66462e-06
5.29059e-05
-1.92103e-06
5.34312e-05
-2.12388e-06
5.40514e-05
-2.26249e-06
5.47463e-05
-2.32588e-06
5.54889e-05
-2.30285e-06
5.62422e-05
-2.18244e-06
5.69542e-05
-1.95464e-06
5.75478e-05
-1.61197e-06
5.78922e-05
-1.15551e-06
5.77345e-05
-5.98584e-07
5.63226e-05
5.00194e-05
3.67716e-07
4.91652e-05
7.3616e-07
5.52767e-05
1.05595e-06
5.67001e-05
1.30392e-06
5.69431e-05
1.47074e-06
5.67147e-05
1.55429e-06
5.6249e-05
1.558e-06
5.56676e-05
1.48823e-06
5.50432e-05
1.35311e-06
5.44252e-05
1.1617e-06
5.38494e-05
9.23608e-07
5.33421e-05
6.48641e-07
5.29228e-05
3.46702e-07
5.2606e-05
2.76851e-08
5.24014e-05
-2.9856e-07
5.23154e-05
-6.22248e-07
5.23506e-05
-9.33663e-07
5.25067e-05
-1.22314e-06
5.27803e-05
-1.48107e-06
5.31644e-05
-1.69783e-06
5.36485e-05
-1.86385e-06
5.42179e-05
-1.9696e-06
5.48526e-05
-2.0058e-06
5.55256e-05
-1.9637e-06
5.62005e-05
-1.83582e-06
5.68267e-05
-1.61691e-06
5.73293e-05
-1.30654e-06
5.75822e-05
-9.12255e-07
5.73405e-05
-4.56703e-07
5.58675e-05
4.95636e-05
2.71697e-07
4.8894e-05
5.58551e-07
5.499e-05
8.20711e-07
5.6438e-05
1.03343e-06
5.67305e-05
1.18448e-06
5.65639e-05
1.26771e-06
5.6166e-05
1.28329e-06
5.56524e-05
1.23473e-06
5.50921e-05
1.12783e-06
5.45325e-05
9.69841e-07
5.40078e-05
7.68925e-07
5.35435e-05
5.3378e-07
5.31585e-05
2.73419e-07
5.28669e-05
-2.98588e-09
5.26784e-05
-2.86199e-07
5.25991e-05
-5.66984e-07
5.26319e-05
-8.36145e-07
5.27764e-05
-1.08456e-06
5.30292e-05
-1.30322e-06
5.33835e-05
-1.48326e-06
5.3829e-05
-1.61606e-06
5.43512e-05
-1.69341e-06
5.49303e-05
-1.70776e-06
5.55403e-05
-1.65273e-06
5.61458e-05
-1.52387e-06
5.66981e-05
-1.31983e-06
5.71254e-05
-1.04506e-06
5.73076e-05
-7.11421e-07
5.7007e-05
-3.45377e-07
5.55016e-05
4.92187e-05
2.00548e-07
4.86939e-05
4.19246e-07
5.47713e-05
6.29409e-07
5.62279e-05
8.07726e-07
5.65523e-05
9.4049e-07
5.64313e-05
1.01931e-06
5.60874e-05
1.04195e-06
5.563e-05
1.00965e-06
5.51247e-05
9.26201e-07
5.46163e-05
7.97199e-07
5.41372e-05
6.2942e-07
5.37117e-05
4.30432e-07
5.33579e-05
2.08304e-07
5.30895e-05
-2.85907e-08
5.29157e-05
-2.71721e-07
5.28427e-05
-5.12496e-07
5.28732e-05
-7.42349e-07
5.30068e-05
-9.52815e-07
5.32401e-05
-1.13561e-06
5.35668e-05
-1.28273e-06
5.39766e-05
-1.38662e-06
5.44554e-05
-1.4404e-06
5.49844e-05
-1.4382e-06
5.55384e-05
-1.37576e-06
5.60836e-05
-1.25114e-06
5.65737e-05
-1.06589e-06
5.69403e-05
-8.27619e-07
5.70694e-05
-5.50535e-07
5.673e-05
-2.61082e-07
5.52122e-05
4.89582e-05
1.50438e-07
4.85439e-05
3.1387e-07
5.46079e-05
4.7861e-07
5.60632e-05
6.24677e-07
5.64062e-05
7.38168e-07
5.63178e-05
8.09779e-07
5.60159e-05
8.35595e-07
5.56043e-05
8.15128e-07
5.51454e-05
7.50563e-07
5.46811e-05
6.4603e-07
5.4242e-05
5.07045e-07
5.3851e-05
3.40082e-07
5.35252e-05
1.5226e-07
5.32777e-05
-4.88919e-08
5.31173e-05
-2.55604e-07
5.30498e-05
-4.60007e-07
5.3078e-05
-6.54244e-07
5.32014e-05
-8.30586e-07
5.34169e-05
-9.8155e-07
5.37181e-05
-1.10006e-06
5.40954e-05
-1.17962e-06
5.45353e-05
-1.21464e-06
5.50197e-05
-1.20079e-06
5.55247e-05
-1.13558e-06
5.60185e-05
-1.01907e-06
5.64573e-05
-8.54791e-07
5.67761e-05
-6.52085e-07
5.68668e-05
-4.25894e-07
5.65038e-05
-2.00056e-07
5.49864e-05
4.87586e-05
1.17919e-07
4.84264e-05
2.37975e-07
5.44878e-05
3.64146e-07
5.59369e-05
4.80962e-07
5.62894e-05
5.75387e-07
5.62234e-05
6.38071e-07
5.59533e-05
6.64061e-07
5.55784e-05
6.51645e-07
5.5158e-05
6.01746e-07
5.47312e-05
5.17293e-07
5.43267e-05
4.02694e-07
5.39658e-05
2.6341e-07
5.36648e-05
1.05637e-07
5.34358e-05
-6.3945e-08
5.32872e-05
-2.38361e-07
5.32246e-05
-4.10505e-07
5.32505e-05
-5.73279e-07
5.33645e-05
-7.19734e-07
5.35637e-05
-8.43226e-07
5.38419e-05
-9.37594e-07
5.419e-05
-9.97393e-07
5.45953e-05
-1.0182e-06
5.50407e-05
-9.9701e-07
5.55037e-05
-9.32749e-07
5.59544e-05
-8.26941e-07
5.63515e-05
-6.84405e-07
5.66336e-05
-5.1504e-07
5.66974e-05
-3.3329e-07
5.6322e-05
-1.58715e-07
5.48118e-05
4.86003e-05
9.9962e-08
4.83267e-05
1.87276e-07
5.44004e-05
2.81579e-07
5.58425e-05
3.72629e-07
5.61982e-05
4.49032e-07
5.61469e-05
5.01952e-07
5.59003e-05
5.25924e-07
5.55545e-05
5.18408e-07
5.51656e-05
4.79404e-07
5.47704e-05
4.10909e-07
5.43954e-05
3.16399e-07
5.40606e-05
2.00433e-07
5.3781e-05
6.83399e-08
5.35681e-05
-7.40282e-08
5.34299e-05
-2.20494e-07
5.33714e-05
-3.64729e-07
5.3395e-05
-5.00412e-07
5.35005e-05
-6.21387e-07
5.36849e-05
-7.21839e-07
5.39426e-05
-7.96492e-07
5.42649e-05
-8.4086e-07
5.46399e-05
-8.51551e-07
5.50515e-05
-8.26651e-07
5.54789e-05
-7.66178e-07
5.5894e-05
-6.72619e-07
5.6258e-05
-5.51479e-07
5.65124e-05
-4.12399e-07
5.65582e-05
-2.68408e-07
5.6178e-05
-1.33762e-07
5.46772e-05
4.8467e-05
9.39143e-08
4.8233e-05
1.57754e-07
5.43365e-05
2.26458e-07
5.57736e-05
2.95408e-07
5.61291e-05
3.55373e-07
5.60869e-05
3.98399e-07
5.58573e-05
4.18878e-07
5.5534e-05
4.1371e-07
5.51708e-05
3.823e-07
5.48019e-05
3.25983e-07
5.44518e-05
2.47503e-07
5.41392e-05
1.50638e-07
5.38781e-05
3.99219e-08
5.36791e-05
-7.95795e-08
5.35496e-05
-2.02466e-07
5.34945e-05
-3.23176e-07
5.35159e-05
-4.36156e-07
5.36137e-05
-5.36023e-07
5.3785e-05
-6.17755e-07
5.40245e-05
-6.76895e-07
5.43242e-05
-7.098e-07
5.46729e-05
-7.13944e-07
5.50558e-05
-6.88276e-07
5.54533e-05
-6.33608e-07
5.58393e-05
-5.52992e-07
5.61773e-05
-4.52107e-07
5.64115e-05
-3.39789e-07
5.64458e-05
-2.27013e-07
5.6065e-05
-1.22181e-07
5.45722e-05
4.83451e-05
9.74205e-08
4.81358e-05
1.45679e-07
5.4288e-05
1.94475e-07
5.57246e-05
2.44921e-07
5.60785e-05
2.90324e-07
5.60413e-05
3.23892e-07
5.58236e-05
3.40049e-07
5.55178e-05
3.35199e-07
5.51756e-05
3.0852e-07
5.48286e-05
2.60993e-07
5.44994e-05
1.94815e-07
5.42055e-05
1.13102e-07
5.396e-05
1.96735e-08
5.37727e-05
-8.11411e-08
5.36506e-05
-1.8468e-07
5.35982e-05
-2.86117e-07
5.36176e-05
-3.80632e-07
5.37084e-05
-4.63576e-07
5.38681e-05
-5.30657e-07
5.40917e-05
-5.78145e-07
5.43718e-05
-6.03111e-07
5.46979e-05
-6.03716e-07
5.50564e-05
-5.79557e-07
5.54291e-05
-5.31992e-07
5.57917e-05
-4.64333e-07
5.61096e-05
-3.82027e-07
5.6329e-05
-2.92755e-07
5.63563e-05
-2.05024e-07
5.59771e-05
-1.21192e-07
5.44882e-05
4.82241e-05
1.0839e-07
4.80275e-05
1.47709e-07
5.42484e-05
1.81652e-07
5.56904e-05
2.16968e-07
5.60429e-05
2.49657e-07
5.60084e-05
2.74641e-07
5.57984e-05
2.86262e-07
5.55061e-05
2.80056e-07
5.51818e-05
2.55626e-07
5.4853e-05
2.1392e-07
5.45412e-05
1.5673e-07
5.42628e-05
8.66005e-08
5.40302e-05
6.70251e-09
5.38527e-05
-7.93103e-08
5.37367e-05
-1.67461e-07
5.36865e-05
-2.53612e-07
5.37039e-05
-3.33623e-07
5.37885e-05
-4.03521e-07
5.39381e-05
-4.5967e-07
5.4148e-05
-4.98961e-07
5.44112e-05
-5.19034e-07
5.47181e-05
-5.1855e-07
5.50559e-05
-4.97547e-07
5.54081e-05
-4.57768e-07
5.57518e-05
-4.0256e-07
5.60542e-05
-3.36837e-07
5.62631e-05
-2.66889e-07
5.62861e-05
-1.98549e-07
5.59085e-05
-1.28206e-07
5.44177e-05
4.8096e-05
1.24957e-07
4.79026e-05
1.61181e-07
5.42119e-05
1.84702e-07
5.56665e-05
2.07862e-07
5.60194e-05
2.29391e-07
5.59866e-05
2.46652e-07
5.5781e-05
2.54191e-07
5.54984e-05
2.45011e-07
5.51909e-05
2.20707e-07
5.48773e-05
1.82354e-07
5.45795e-05
1.31351e-07
5.43138e-05
6.97087e-08
5.40919e-05
1.16327e-11
5.39224e-05
-7.46935e-08
5.38115e-05
-1.51047e-07
5.3763e-05
-2.25532e-07
5.37784e-05
-2.94627e-07
5.38577e-05
-3.54964e-07
5.39985e-05
-4.03483e-07
5.41966e-05
-4.37592e-07
5.44453e-05
-4.55348e-07
5.47358e-05
-4.55699e-07
5.50562e-05
-4.3891e-07
5.53912e-05
-4.07074e-07
5.57198e-05
-3.63444e-07
5.60104e-05
-3.12155e-07
5.62116e-05
-2.57946e-07
5.62316e-05
-2.03919e-07
5.58542e-05
-1.40811e-07
5.43543e-05
4.79553e-05
1.45102e-07
4.77574e-05
1.83626e-07
5.4173e-05
2.01307e-07
5.56485e-05
2.15518e-07
5.60049e-05
2.27578e-07
5.59743e-05
2.368e-07
5.57715e-05
2.38915e-07
5.54961e-05
2.25615e-07
5.5204e-05
2.00224e-07
5.49026e-05
1.63568e-07
5.46161e-05
1.16618e-07
5.43607e-05
6.09219e-08
5.41476e-05
-1.41826e-09
5.39848e-05
-6.78627e-08
5.3878e-05
-1.35579e-07
5.38308e-05
-2.01588e-07
5.38445e-05
-2.62914e-07
5.39191e-05
-3.16721e-07
5.40524e-05
-3.60448e-07
5.42403e-05
-3.91933e-07
5.44768e-05
-4.09517e-07
5.47534e-05
-4.12184e-07
5.50588e-05
-4.0009e-07
5.5379e-05
-3.75942e-07
5.56955e-05
-3.42819e-07
5.59771e-05
-3.03798e-07
5.61723e-05
-2.61962e-07
5.61895e-05
-2.17759e-07
5.58096e-05
-1.56795e-07
5.4293e-05
4.77985e-05
1.66277e-07
4.75911e-05
2.1138e-07
5.41274e-05
2.27684e-07
5.56317e-05
2.36351e-07
5.59958e-05
2.40957e-07
5.59693e-05
2.41132e-07
5.57711e-05
2.3442e-07
5.55026e-05
2.17298e-07
5.5221e-05
1.90833e-07
5.49289e-05
1.55051e-07
5.46518e-05
1.10624e-07
5.44051e-05
5.88345e-08
5.41994e-05
1.4665e-09
5.40422e-05
-5.93169e-08
5.39389e-05
-1.21104e-07
5.38926e-05
-1.81364e-07
5.39048e-05
-2.37583e-07
5.39754e-05
-2.87385e-07
5.41022e-05
-3.28647e-07
5.42816e-05
-3.59583e-07
5.45077e-05
-3.78761e-07
5.47725e-05
-3.84976e-07
5.50649e-05
-3.77472e-07
5.53713e-05
-3.60592e-07
5.56784e-05
-3.36866e-07
5.59531e-05
-3.07996e-07
5.61431e-05
-2.75403e-07
5.61565e-05
-2.37068e-07
5.57708e-05
-1.7419e-07
5.42297e-05
4.76243e-05
1.8594e-07
4.74052e-05
2.39994e-07
5.40729e-05
2.58109e-07
5.56131e-05
2.64386e-07
5.59891e-05
2.63423e-07
5.59699e-05
2.54434e-07
5.57797e-05
2.38313e-07
5.55184e-05
2.18588e-07
5.52405e-05
1.9099e-07
5.49564e-05
1.5522e-07
5.46875e-05
1.11924e-07
5.44483e-05
6.22727e-08
5.4249e-05
7.8453e-09
5.40966e-05
-4.94737e-08
5.39962e-05
-1.07603e-07
5.39507e-05
-1.64375e-07
5.39616e-05
-2.17649e-07
5.40286e-05
-2.65422e-07
5.415e-05
-3.05938e-07
5.43221e-05
-3.37751e-07
5.45394e-05
-3.59716e-07
5.47943e-05
-3.70679e-07
5.50757e-05
-3.67948e-07
5.53684e-05
-3.57954e-07
5.56682e-05
-3.42613e-07
5.59374e-05
-3.21688e-07
5.61218e-05
-2.95249e-07
5.61296e-05
-2.59219e-07
5.57343e-05
-1.91268e-07
5.41613e-05
4.74331e-05
2.02386e-07
4.72028e-05
2.66135e-07
5.40086e-05
2.87689e-07
5.5591e-05
2.93519e-07
5.59828e-05
2.89735e-07
5.59733e-05
2.75921e-07
5.57932e-05
2.54098e-07
5.554e-05
2.30149e-07
5.52642e-05
1.99967e-07
5.49864e-05
1.62862e-07
5.47245e-05
1.19262e-07
5.44919e-05
7.01662e-08
5.4298e-05
1.69572e-08
5.41498e-05
-3.87187e-08
5.40518e-05
-9.50494e-08
5.4007e-05
-1.50153e-07
5.40167e-05
-2.02173e-07
5.40806e-05
-2.49381e-07
5.41971e-05
-2.90265e-07
5.43629e-05
-3.2362e-07
5.45727e-05
-3.48601e-07
5.48192e-05
-3.64631e-07
5.50916e-05
-3.69188e-07
5.53727e-05
-3.6641e-07
5.56651e-05
-3.57513e-07
5.59282e-05
-3.41889e-07
5.61058e-05
-3.18551e-07
5.61058e-05
-2.81737e-07
5.5697e-05
-2.06531e-07
5.40856e-05
4.72266e-05
2.14873e-07
4.6988e-05
2.88229e-07
5.39348e-05
3.14297e-07
5.55644e-05
3.20869e-07
5.59757e-05
3.15489e-07
5.59782e-05
2.99898e-07
5.58084e-05
2.7654e-07
5.5563e-05
2.48763e-07
5.52918e-05
2.15428e-07
5.50195e-05
1.76099e-07
5.47637e-05
1.3112e-07
5.45367e-05
8.13531e-08
5.43477e-05
2.80096e-08
5.42031e-05
-2.74595e-08
5.41073e-05
-8.34567e-08
5.4063e-05
-1.38321e-07
5.40715e-05
-1.90408e-07
5.41327e-05
-2.38172e-07
5.42449e-05
-2.80238e-07
5.44049e-05
-3.15485e-07
5.46079e-05
-3.4313e-07
5.48467e-05
-3.62934e-07
5.51112e-05
-3.76504e-07
5.53861e-05
-3.81336e-07
5.56697e-05
-3.77248e-07
5.59237e-05
-3.64643e-07
5.60927e-05
-3.41982e-07
5.60827e-05
-3.02222e-07
5.56567e-05
-2.18756e-07
5.40016e-05
4.70079e-05
2.23248e-07
4.67649e-05
3.05683e-07
5.38518e-05
3.37142e-07
5.55324e-05
3.45965e-07
5.59664e-05
3.40854e-07
5.59829e-05
3.24987e-07
5.58239e-05
3.00813e-07
5.55869e-05
2.70569e-07
5.53217e-05
2.345e-07
5.50554e-05
1.92759e-07
5.48052e-05
1.45849e-07
5.45835e-05
9.46195e-08
5.43989e-05
4.01912e-08
5.42575e-05
-1.61197e-08
5.41635e-05
-7.28744e-08
5.41197e-05
-1.2858e-07
5.41272e-05
-1.81757e-07
5.41858e-05
-2.31002e-07
5.4294e-05
-2.75054e-07
5.44488e-05
-3.12877e-07
5.46456e-05
-3.43788e-07
5.48775e-05
-3.67844e-07
5.51351e-05
-3.87978e-07
5.54059e-05
-3.98046e-07
5.56794e-05
-3.97144e-07
5.59225e-05
-3.86095e-07
5.60813e-05
-3.62668e-07
5.60588e-05
-3.18826e-07
5.56123e-05
-2.27187e-07
5.39095e-05
4.67809e-05
2.27643e-07
4.65374e-05
3.18256e-07
5.37607e-05
3.55618e-07
5.54945e-05
3.67907e-07
5.59536e-05
3.64495e-07
5.59858e-05
3.49334e-07
5.58387e-05
3.24902e-07
5.5611e-05
2.93135e-07
5.53532e-05
2.54931e-07
5.50934e-05
2.10946e-07
5.48491e-05
1.61935e-07
5.46324e-05
1.08831e-07
5.44519e-05
5.27401e-08
5.43135e-05
-5.09466e-09
5.42213e-05
-6.33409e-08
5.41779e-05
-1.20628e-07
5.41845e-05
-1.75601e-07
5.42407e-05
-2.26975e-07
5.43453e-05
-2.73596e-07
5.44954e-05
-3.14518e-07
5.46864e-05
-3.49131e-07
5.49119e-05
-3.77384e-07
5.51631e-05
-3.9994e-07
5.54282e-05
-4.12752e-07
5.56919e-05
-4.14304e-07
5.59236e-05
-4.04017e-07
5.60705e-05
-3.79e-07
5.60332e-05
-3.30628e-07
5.55634e-05
-2.31624e-07
5.381e-05
4.65495e-05
2.28416e-07
4.63093e-05
3.25991e-07
5.36626e-05
3.69318e-07
5.54506e-05
3.85779e-07
5.59366e-05
3.85042e-07
5.59861e-05
3.7144e-07
5.58519e-05
3.47399e-07
5.56347e-05
3.14828e-07
5.53856e-05
2.75053e-07
5.51329e-05
2.29141e-07
5.48948e-05
1.78105e-07
5.46833e-05
1.23009e-07
5.45069e-05
6.49954e-08
5.43714e-05
5.28239e-09
5.4281e-05
-5.48577e-08
5.4238e-05
-1.14133e-07
5.42437e-05
-1.71272e-07
5.42978e-05
-2.25067e-07
5.43991e-05
-2.7442e-07
5.45446e-05
-3.18398e-07
5.47302e-05
-3.56286e-07
5.49496e-05
-3.87588e-07
5.51942e-05
-4.11656e-07
5.5452e-05
-4.25883e-07
5.57058e-05
-4.28371e-07
5.59257e-05
-4.17763e-07
5.60595e-05
-3.90487e-07
5.60055e-05
-3.37523e-07
5.55099e-05
-2.32341e-07
5.37043e-05
4.63175e-05
2.2607e-07
4.60836e-05
3.29155e-07
5.35591e-05
3.78089e-07
5.54011e-05
3.98976e-07
5.59152e-05
4.01548e-07
5.59831e-05
3.90297e-07
5.58628e-05
3.67265e-07
5.56574e-05
3.34468e-07
5.54181e-05
2.93627e-07
5.51735e-05
2.46165e-07
5.49421e-05
1.93341e-07
5.4736e-05
1.36358e-07
5.45638e-05
7.6419e-08
5.44313e-05
1.47523e-08
5.43426e-05
-4.7394e-08
5.43001e-05
-1.08768e-07
5.4305e-05
-1.68141e-07
5.43571e-05
-2.24336e-07
5.44552e-05
-2.76258e-07
5.45965e-05
-3.2292e-07
5.47768e-05
-3.63431e-07
5.499e-05
-3.96912e-07
5.52275e-05
-4.22163e-07
5.5477e-05
-4.36922e-07
5.57203e-05
-4.38956e-07
5.59274e-05
-4.27102e-07
5.60472e-05
-3.97151e-07
5.5975e-05
-3.3983e-07
5.54521e-05
-2.29848e-07
5.35939e-05
4.6088e-05
2.21276e-07
4.58628e-05
3.28307e-07
5.34517e-05
3.82124e-07
5.53468e-05
4.07246e-07
5.58896e-05
4.13414e-07
5.59765e-05
4.05402e-07
5.58704e-05
3.83848e-07
5.56787e-05
3.51224e-07
5.54504e-05
3.09735e-07
5.52148e-05
2.61126e-07
5.49905e-05
2.0686e-07
5.47901e-05
1.48262e-07
5.46223e-05
8.66005e-08
5.44929e-05
2.31299e-08
5.4406e-05
-4.08986e-08
5.43641e-05
-1.04241e-07
5.43683e-05
-1.65675e-07
5.44185e-05
-2.24019e-07
5.45135e-05
-2.78144e-07
5.46505e-05
-3.26979e-07
5.48255e-05
-3.69476e-07
5.50323e-05
-4.04505e-07
5.52623e-05
-4.30588e-07
5.55029e-05
-4.45376e-07
5.57348e-05
-4.45557e-07
5.59272e-05
-4.32046e-07
5.60332e-05
-3.99383e-07
5.59419e-05
-3.3821e-07
5.53904e-05
-2.24836e-07
5.34802e-05
4.58636e-05
2.14798e-07
4.56485e-05
3.24335e-07
5.33418e-05
3.82125e-07
5.52885e-05
4.10879e-07
5.58604e-05
4.20284e-07
5.59667e-05
4.16874e-07
5.58734e-05
3.96792e-07
5.56984e-05
3.64487e-07
5.54825e-05
3.22691e-07
5.52564e-05
2.73363e-07
5.50397e-05
2.1809e-07
5.48453e-05
1.5828e-07
5.4682e-05
9.52536e-08
5.45558e-05
3.03001e-08
5.44709e-05
-3.53073e-08
5.44297e-05
-1.00307e-07
5.44333e-05
-1.63458e-07
5.44816e-05
-2.23542e-07
5.45735e-05
-2.79375e-07
5.47062e-05
-3.29794e-07
5.48758e-05
-3.73624e-07
5.5076e-05
-4.09583e-07
5.52981e-05
-4.36072e-07
5.55291e-05
-4.50603e-07
5.5749e-05
-4.48595e-07
5.59249e-05
-4.33335e-07
5.60176e-05
-3.98052e-07
5.59061e-05
-3.3355e-07
5.53254e-05
-2.18018e-07
5.33643e-05
4.56461e-05
2.07504e-07
4.54415e-05
3.18608e-07
5.32304e-05
3.79646e-07
5.5227e-05
4.11436e-07
5.58282e-05
4.23365e-07
5.59544e-05
4.24336e-07
5.58721e-05
4.05368e-07
5.57171e-05
3.73566e-07
5.55141e-05
3.31906e-07
5.52979e-05
2.82393e-07
5.50891e-05
2.26654e-07
5.49009e-05
1.66138e-07
5.47424e-05
1.02215e-07
5.46197e-05
3.62162e-08
5.45369e-05
-3.05467e-08
5.44964e-05
-9.67766e-08
5.44995e-05
-1.6119e-07
5.4546e-05
-2.22517e-07
5.46348e-05
-2.79498e-07
5.47632e-05
-3.3087e-07
5.4927e-05
-3.75334e-07
5.51203e-05
-4.11489e-07
5.53341e-05
-4.37682e-07
5.55551e-05
-4.51644e-07
5.57627e-05
-4.49271e-07
5.59222e-05
-4.32259e-07
5.60002e-05
-3.94254e-07
5.58677e-05
-3.26795e-07
5.52576e-05
-2.10072e-07
5.32473e-05
4.54366e-05
1.9992e-07
4.52422e-05
3.12209e-07
5.31179e-05
3.76364e-07
5.51625e-05
4.11192e-07
5.57929e-05
4.2522e-07
5.594e-05
4.26063e-07
5.5871e-05
4.08397e-07
5.57345e-05
3.77806e-07
5.55445e-05
3.37018e-07
5.53385e-05
2.88e-07
5.5138e-05
2.32407e-07
5.49564e-05
1.71746e-07
5.4803e-05
1.07448e-07
5.4684e-05
4.09006e-08
5.46034e-05
-2.65325e-08
5.45638e-05
-9.35059e-08
5.45664e-05
-1.58684e-07
5.46111e-05
-2.20735e-07
5.46968e-05
-2.78319e-07
5.48207e-05
-3.30071e-07
5.49787e-05
-3.7457e-07
5.51647e-05
-4.10299e-07
5.53696e-05
-4.35603e-07
5.55802e-05
-4.48748e-07
5.57756e-05
-4.48027e-07
5.59211e-05
-4.29129e-07
5.59809e-05
-3.8831e-07
5.58265e-05
-3.18308e-07
5.51872e-05
-2.01346e-07
5.31301e-05
4.52359e-05
1.92091e-07
4.50508e-05
3.05169e-07
5.30046e-05
3.7233e-07
5.5095e-05
4.10384e-07
5.57545e-05
4.26461e-07
5.59236e-05
4.22876e-07
5.58743e-05
4.06467e-07
5.57507e-05
3.77662e-07
5.55731e-05
3.38366e-07
5.53777e-05
2.90418e-07
5.51858e-05
2.35507e-07
5.50113e-05
1.75214e-07
5.48633e-05
1.11041e-07
5.47481e-05
4.44417e-08
5.467e-05
-2.31675e-08
5.46314e-05
-9.03895e-08
5.46336e-05
-1.55837e-07
5.46766e-05
-2.18119e-07
5.4759e-05
-2.75831e-07
5.48783e-05
-3.27527e-07
5.50303e-05
-3.71701e-07
5.52088e-05
-4.06767e-07
5.54046e-05
-4.31082e-07
5.56043e-05
-4.4327e-07
5.57875e-05
-4.43367e-07
5.5921e-05
-4.22699e-07
5.596e-05
-3.7977e-07
5.57832e-05
-3.08206e-07
5.51153e-05
-1.92116e-07
5.30138e-05
4.50444e-05
1.83625e-07
4.48678e-05
2.96338e-07
5.28917e-05
3.65563e-07
5.50255e-05
4.05977e-07
5.57138e-05
4.23434e-07
5.59059e-05
4.1743e-07
5.58801e-05
4.01887e-07
5.57661e-05
3.74677e-07
5.56001e-05
3.36922e-07
5.54153e-05
2.90253e-07
5.52324e-05
2.3634e-07
5.50651e-05
1.76797e-07
5.49228e-05
1.13176e-07
5.48117e-05
4.69748e-08
5.47362e-05
-2.03451e-08
5.46987e-05
-8.73453e-08
5.47006e-05
-1.52596e-07
5.47418e-05
-2.14664e-07
5.48211e-05
-2.72098e-07
5.49357e-05
-3.23407e-07
5.50816e-05
-3.67051e-07
5.52523e-05
-4.01428e-07
5.54388e-05
-4.24913e-07
5.56277e-05
-4.36056e-07
5.57985e-05
-4.34403e-07
5.59191e-05
-4.12693e-07
5.5938e-05
-3.68722e-07
5.5739e-05
-2.96696e-07
5.5043e-05
-1.82592e-07
5.28996e-05
4.48625e-05
1.7459e-07
4.46939e-05
2.85522e-07
5.27807e-05
3.55217e-07
5.49556e-05
3.96518e-07
5.56723e-05
4.14535e-07
5.58876e-05
4.10725e-07
5.58837e-05
3.96074e-07
5.57806e-05
3.69998e-07
5.56261e-05
3.33509e-07
5.54517e-05
2.88083e-07
5.52778e-05
2.35311e-07
5.51179e-05
1.76784e-07
5.49813e-05
1.14059e-07
5.48745e-05
4.86493e-08
5.48016e-05
-1.79607e-08
5.47654e-05
-8.4308e-08
5.4767e-05
-1.48937e-07
5.48065e-05
-2.10389e-07
5.48825e-05
-2.67186e-07
5.49925e-05
-3.17818e-07
5.51322e-05
-3.60736e-07
5.52952e-05
-3.94344e-07
5.54724e-05
-4.17022e-07
5.56502e-05
-4.27185e-07
5.58085e-05
-4.2317e-07
5.59149e-05
-4.00615e-07
5.59152e-05
-3.56234e-07
5.56943e-05
-2.84612e-07
5.49711e-05
-1.73185e-07
5.27881e-05
4.469e-05
1.65329e-07
4.45293e-05
2.73268e-07
5.26728e-05
3.42398e-07
5.48863e-05
3.83928e-07
5.56305e-05
4.02796e-07
5.58685e-05
4.02316e-07
5.5884e-05
3.88821e-07
5.57939e-05
3.6377e-07
5.5651e-05
3.28427e-07
5.5487e-05
2.8423e-07
5.5322e-05
2.3271e-07
5.51694e-05
1.75413e-07
5.50386e-05
1.13874e-07
5.4936e-05
4.96006e-08
5.48659e-05
-1.59238e-08
5.48309e-05
-8.12299e-08
5.48324e-05
-1.44855e-07
5.48702e-05
-2.05331e-07
5.49431e-05
-2.61171e-07
5.50484e-05
-3.10864e-07
5.51819e-05
-3.52856e-07
5.53372e-05
-3.85553e-07
5.5505e-05
-4.07309e-07
5.56719e-05
-4.16402e-07
5.58175e-05
-4.10891e-07
5.59092e-05
-3.87566e-07
5.58917e-05
-3.43071e-07
5.56496e-05
-2.72281e-07
5.49002e-05
-1.6408e-07
5.26799e-05
4.45266e-05
1.56339e-07
4.43736e-05
2.60921e-07
5.25682e-05
3.28805e-07
5.48182e-05
3.70244e-07
5.55889e-05
3.90084e-07
5.58486e-05
3.9185e-07
5.58821e-05
3.79787e-07
5.58059e-05
3.55903e-07
5.56749e-05
3.21762e-07
5.55211e-05
2.78865e-07
5.53648e-05
2.28725e-07
5.52196e-05
1.72858e-07
5.50945e-05
1.12767e-07
5.49962e-05
4.99373e-08
5.49288e-05
-1.41634e-08
5.48951e-05
-7.80792e-08
5.48963e-05
-1.40357e-07
5.49325e-05
-1.99538e-07
5.50023e-05
-2.54144e-07
5.5103e-05
-3.02671e-07
5.52304e-05
-3.43576e-07
5.53781e-05
-3.75266e-07
5.55367e-05
-3.96084e-07
5.56926e-05
-4.04255e-07
5.58255e-05
-3.97836e-07
5.59027e-05
-3.74091e-07
5.58678e-05
-3.29887e-07
5.56053e-05
-2.60411e-07
5.48306e-05
-1.55469e-07
5.25749e-05
4.43719e-05
1.47978e-07
4.42263e-05
2.4869e-07
5.24676e-05
3.15133e-07
5.47517e-05
3.5629e-07
5.55477e-05
3.76788e-07
5.58279e-05
3.79986e-07
5.58788e-05
3.69203e-07
5.58166e-05
3.46509e-07
5.56975e-05
3.13624e-07
5.5554e-05
2.72113e-07
5.54064e-05
2.23489e-07
5.52682e-05
1.69243e-07
5.51488e-05
1.10843e-07
5.50546e-05
4.97407e-08
5.499e-05
-1.26277e-08
5.49576e-05
-7.48358e-08
5.49586e-05
-1.35458e-07
5.49932e-05
-1.93061e-07
5.506e-05
-2.46191e-07
5.51562e-05
-2.93369e-07
5.52777e-05
-3.33073e-07
5.54178e-05
-3.63726e-07
5.55673e-05
-3.83677e-07
5.57126e-05
-3.91143e-07
5.5833e-05
-3.8423e-07
5.58957e-05
-3.60434e-07
5.58439e-05
-3.16783e-07
5.55615e-05
-2.48778e-07
5.47625e-05
-1.47512e-07
5.24737e-05
4.42251e-05
1.40208e-07
4.40868e-05
2.37677e-07
5.23702e-05
3.02268e-07
5.46871e-05
3.42637e-07
5.55072e-05
3.63243e-07
5.58073e-05
3.67216e-07
5.58748e-05
3.57394e-07
5.58264e-05
3.35775e-07
5.57192e-05
3.04139e-07
5.55857e-05
2.64078e-07
5.54465e-05
2.17095e-07
5.53153e-05
1.64652e-07
5.52014e-05
1.08174e-07
5.51112e-05
4.90665e-08
5.50492e-05
-1.12802e-08
5.5018e-05
-7.14854e-08
5.5019e-05
-1.30168e-07
5.5052e-05
-1.85937e-07
5.51158e-05
-2.37382e-07
5.52078e-05
-2.83063e-07
5.53234e-05
-3.21495e-07
5.54563e-05
-3.51132e-07
5.5597e-05
-3.70349e-07
5.57318e-05
-3.77376e-07
5.584e-05
-3.70387e-07
5.58886e-05
-3.47013e-07
5.58205e-05
-3.04422e-07
5.55189e-05
-2.38299e-07
5.46963e-05
-1.4008e-07
5.23756e-05
4.40856e-05
1.33801e-07
4.39537e-05
2.27249e-07
5.22769e-05
2.89955e-07
5.46244e-05
3.29327e-07
5.54678e-05
3.49592e-07
5.5787e-05
3.53797e-07
5.58706e-05
3.44566e-07
5.58357e-05
3.23836e-07
5.57399e-05
2.93393e-07
5.56162e-05
2.54819e-07
5.54852e-05
2.09594e-07
5.53606e-05
1.5913e-07
5.5252e-05
1.04799e-07
5.51657e-05
4.79484e-08
5.51062e-05
-1.00958e-08
5.50762e-05
-6.8014e-08
5.5077e-05
-1.24486e-07
5.51086e-05
-1.78182e-07
5.51697e-05
-2.2775e-07
5.52575e-05
-2.71808e-07
5.53676e-05
-3.08925e-07
5.54935e-05
-3.37603e-07
5.56257e-05
-3.56254e-07
5.57505e-05
-3.63131e-07
5.58469e-05
-3.5644e-07
5.58819e-05
-3.33833e-07
5.57978e-05
-2.92478e-07
5.54775e-05
-2.28281e-07
5.46321e-05
-1.33942e-07
5.22814e-05
4.39524e-05
1.27823e-07
4.38265e-05
2.19244e-07
5.21856e-05
2.79614e-07
5.45641e-05
3.17075e-07
5.54304e-05
3.36177e-07
5.57679e-05
3.39939e-07
5.58669e-05
3.30841e-07
5.58448e-05
3.10752e-07
5.57601e-05
2.81408e-07
5.56456e-05
2.44346e-07
5.55224e-05
2.0099e-07
5.54041e-05
1.52686e-07
5.53005e-05
1.00734e-07
5.52179e-05
4.64021e-08
5.51608e-05
-9.05893e-09
5.51319e-05
-6.44072e-08
5.51326e-05
-1.184e-07
5.51628e-05
-1.69785e-07
5.52213e-05
-2.17288e-07
5.53052e-05
-2.59603e-07
5.54101e-05
-2.95375e-07
5.55294e-05
-3.23176e-07
5.56536e-05
-3.41477e-07
5.57689e-05
-3.48587e-07
5.5854e-05
-3.42746e-07
5.58761e-05
-3.21641e-07
5.57767e-05
-2.82403e-07
5.54383e-05
-2.20586e-07
5.45704e-05
-1.28156e-07
5.21891e-05
4.38249e-05
1.24484e-07
4.37027e-05
2.12216e-07
5.20982e-05
2.69548e-07
5.45069e-05
3.04994e-07
5.5395e-05
3.22607e-07
5.57504e-05
3.25465e-07
5.58641e-05
3.16107e-07
5.58543e-05
2.96428e-07
5.578e-05
2.68103e-07
5.56742e-05
2.32596e-07
5.55582e-05
1.91244e-07
5.54458e-05
1.453e-07
5.53468e-05
9.59692e-08
5.52676e-05
4.44281e-08
5.52127e-05
-8.16398e-09
5.51849e-05
-6.06553e-08
5.51855e-05
-1.11893e-07
5.52145e-05
-1.60717e-07
5.52705e-05
-2.05949e-07
5.53508e-05
-2.46381e-07
5.54509e-05
-2.80755e-07
5.55641e-05
-3.0774e-07
5.56809e-05
-3.25886e-07
5.57872e-05
-3.33558e-07
5.58618e-05
-3.28936e-07
5.58716e-05
-3.09586e-07
5.57575e-05
-2.72534e-07
5.54013e-05
-2.13821e-07
5.45118e-05
-1.25014e-07
5.21007e-05
4.37006e-05
1.21641e-07
4.35815e-05
2.10046e-07
5.20097e-05
2.64651e-07
5.44522e-05
2.95924e-07
5.53637e-05
3.10039e-07
5.57364e-05
3.10667e-07
5.58638e-05
3.00311e-07
5.58652e-05
2.80736e-07
5.58002e-05
2.53385e-07
5.57023e-05
2.19539e-07
5.55928e-05
1.80375e-07
5.54859e-05
1.37015e-07
5.5391e-05
9.05475e-08
5.5315e-05
4.20451e-08
5.52622e-05
-7.42766e-09
5.52354e-05
-5.68099e-08
5.52359e-05
-1.05041e-07
5.52637e-05
-1.51056e-07
5.53175e-05
-1.93783e-07
5.53944e-05
-2.32134e-07
5.54901e-05
-2.64992e-07
5.55977e-05
-2.91185e-07
5.57078e-05
-3.09451e-07
5.58061e-05
-3.18377e-07
5.58713e-05
-3.16248e-07
5.58698e-05
-3.00619e-07
5.5742e-05
-2.67873e-07
5.53686e-05
-2.11895e-07
5.44557e-05
-1.22323e-07
5.2011e-05
4.35787e-05
1.26866e-07
2.09251e-07
2.57603e-07
2.83679e-07
2.94676e-07
2.93955e-07
2.8352e-07
2.6479e-07
2.38929e-07
2.07034e-07
1.70148e-07
1.29296e-07
8.54906e-08
3.97459e-08
-6.92658e-09
-5.3515e-08
-9.90081e-08
-1.42395e-07
-1.82667e-07
-2.18814e-07
-2.49819e-07
-2.74653e-07
-2.92237e-07
-3.01438e-07
-3.00869e-07
-2.88561e-07
-2.61177e-07
-2.11509e-07
-1.27875e-07
)
;
boundaryField
{
inlet
{
type calculated;
value nonuniform List<scalar>
30
(
-2.5e-05
-2.5e-05
-2.5e-05
-2.5e-05
-2.5e-05
-2.5e-05
-2.5e-05
-2.5e-05
-2.5e-05
-2.5e-05
-2.5e-05
-2.5e-05
-2.5e-05
-2.5e-05
-2.5e-05
-2.5e-05
-2.5e-05
-2.5e-05
-2.5e-05
-2.5e-05
-2.5e-05
-2.5e-05
-2.5e-05
-2.5e-05
-2.5e-05
-2.5e-05
-2.5e-05
-2.5e-05
-2.5e-05
-2.5e-05
)
;
}
outlet
{
type calculated;
value nonuniform List<scalar>
30
(
4.34555e-05
5.19282e-05
5.44051e-05
5.53394e-05
5.57273e-05
5.58666e-05
5.58778e-05
5.58212e-05
5.57305e-05
5.56272e-05
5.55252e-05
5.54344e-05
5.53613e-05
5.53105e-05
5.52846e-05
5.5285e-05
5.53117e-05
5.53634e-05
5.54372e-05
5.55287e-05
5.56312e-05
5.5735e-05
5.5826e-05
5.58827e-05
5.58713e-05
5.57316e-05
5.53428e-05
5.44074e-05
5.19283e-05
4.34516e-05
)
;
}
walls
{
type calculated;
value uniform 0;
}
frontAndBackPlanes
{
type empty;
value nonuniform 0();
}
}
// ************************************************************************* //
| |
c368800c4141e83ee77ec8dd6e2c9a1fb505bdca | 4c044f479494eb07528bb011000b59742009bd74 | /base/base/main.cpp | 1c66a3f8b453370ad5629328025ba4760a2540f4 | [] | no_license | Step2Victory/lab4 | fcf4ba853feb42dfc90a3fe1e75366bb7e8a5d12 | e17499ec04e70ce1687eabc1138c502914cd62d6 | refs/heads/master | 2020-09-11T17:29:35.135581 | 2019-11-23T18:45:24 | 2019-11-23T18:45:24 | 222,138,148 | 0 | 0 | null | 2019-11-23T18:45:25 | 2019-11-16T17:54:51 | null | UTF-8 | C++ | false | false | 5,542 | cpp | main.cpp | // main.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы.
//
#include "pch.h"
#include "Cluster.h"
#include "windows.h"
#include <ctime>
#include <iostream>
using namespace std;
void keyboard_input()
{
cout << "Выводить статистику по загрузке каждого процессора? Y/N ";
char a;
bool flag = false;
cin >> a;
if (a == 'Y' || a == 'y')
flag = true;
int n;
cout << "Введите кол-во процессоров: ";
cin >> n;
vector<int>pr(n);
for (int i = 0; i < n; ++i)
{
cout << "Введите кол-во ядер для " << i << "-го процессора: ";
cin >> pr[i];
}
cout << endl;
Cluster cl(pr);
int nClock;
cout << "Введите кол-во тактов: ";
cin >> nClock;
int k = 0;
for (int i = 0; i < nClock; ++i)
{
int nTasks;
cout << "Введите кол-во задач на " << i << "-ом такте: ";
cin >> nTasks;
vector<Task> b;
for (int j = 0; j < nTasks; ++j)
{
int time, req;
string name = "task" + to_string(k++);
cout << "Введите длительность и кол-во ядер для задачи " << name << ": ";
cin >> time >> req;
Task a(time, req, name);
b.push_back(a);
}
cl.addTasks(b);
cl.nextClock();
cl.printStatistics(flag);
}
}
int random(int a, int b, int l)
{
if (a == b)
return a;
srand(time(NULL) + 1000000 * l);
return a + rand() % (b - a);
}
int main()
{
setlocale(LC_ALL, "Russian");
int minProcNumber, maxProcNumber, minCoresNumber, maxCoresNumber, minTasksPerClock, maxTasksPerClock, nClock,
minTimePerTask, maxTimePerTask, minCoresPerTask, maxCoresPerTask;
cout << "Введите диапозон значений количества процессоров на кластере (два числа через пробел): ";
cin >> minProcNumber >> maxProcNumber;
cout << "Введите диапозон значений количества ядер в процессоре (два числа через пробел): ";
cin >> minCoresNumber >> maxCoresNumber;
cout << "Введите диапозон количества задач на одном такте (два числа через пробел): ";
cin >> minTasksPerClock >> maxTasksPerClock;
cout << "Введите кол-во тактов: ";
cin >> nClock;
cout << "Введите диапозон количества тактов, необходимых для выполнения одной задачи (два числа через пробел): ";
cin >> minTimePerTask >> maxTimePerTask;
cout << "Введите диапозон количества ядер, необходимых для выполнения одной задачи (два числа через пробел): ";
cin >> minCoresPerTask >> maxCoresPerTask;
cout << "Выводить статистику по загрузке каждого процессора? Y/N ";
char a;
bool flag = false;
cin >> a;
if (a == 'Y' || a == 'y')
flag = true;
int k = 0, l = 0;
int nProc = random(minProcNumber, maxProcNumber, l++);
vector<int> proc(nProc);
for (int i = 0; i < nProc; ++i)
proc[i] = random(minCoresNumber, maxCoresNumber, l++);
Cluster cl(proc);
for (int i = 0; i < nClock; ++i)
{
int nTasks = random(minTasksPerClock, maxTasksPerClock, l++);
vector<Task> tasks(nTasks);
for (int j = 0; j < nTasks; ++j)
{
string name = "task" + to_string(k++);
int t = random(minTimePerTask, maxTimePerTask, l++), r = random(minCoresPerTask, maxCoresPerTask, l++);
Task tsk(t, r, name);
tasks[j] = tsk;
}
cout << endl << "Сгенерированные задачи:" << endl;
for (int j = 0; j < nTasks; ++j)
{
cout << "\t" << tasks[j].getTaskName() << ": clocks to run " << tasks[j].getTime() << ", required cores: " << tasks[j].getCores() << endl;
}
cl.addTasks(tasks);
cl.nextClock();
cl.printStatistics(flag);
Sleep(1000);
}
cout << "Общая загрузка кластера по всем тактам: " << cl.stat() * 100 << "%";
}
// Запуск программы: CTRL+F5 или меню "Отладка" > "Запуск без отладки"
// Отладка программы: F5 или меню "Отладка" > "Запустить отладку"
// Советы по началу работы
// 1. В окне обозревателя решений можно добавлять файлы и управлять ими.
// 2. В окне Team Explorer можно подключиться к системе управления версиями.
// 3. В окне "Выходные данные" можно просматривать выходные данные сборки и другие сообщения.
// 4. В окне "Список ошибок" можно просматривать ошибки.
// 5. Последовательно выберите пункты меню "Проект" > "Добавить новый элемент", чтобы создать файлы кода, или "Проект" > "Добавить существующий элемент", чтобы добавить в проект существующие файлы кода.
// 6. Чтобы снова открыть этот проект позже, выберите пункты меню "Файл" > "Открыть" > "Проект" и выберите SLN-файл.
|
1d4d990e14e26e17085ba2ce109ebc293037cb59 | 4566b94639d92f96bbe1ce2e96646e19afa9d6a8 | /EffectiveModernCpp/chapter04.h | 02a95299e82039890ad916ebaa9eabc027bb56dc | [] | no_license | jejeongmin/EffectiveModernCpp | e66d1c2c9da378629f987b8ea6916ad28fc9da97 | a2002cceedb21e249d6c3a7603b50be4bebc8f13 | refs/heads/master | 2021-09-11T15:30:36.120946 | 2018-04-09T07:47:48 | 2018-04-09T07:47:48 | 113,852,816 | 1 | 0 | null | null | null | null | UHC | C++ | false | false | 2,016 | h | chapter04.h | #pragma once
template<typename T>
class TD;
/*********************************************************
아래의 모든 수단들을 표준에서 유용한 정보를 출력하도록 권고할 뿐,
정확한 정보를 반드시 출력할 것을 강제하고 있지는 않다.
따라서 아래 정보를 100% 신뢰할 순 없으므로, 형식 연역에 대한 규칙은 여전히
프로그래머가 정확히 알아야 할 지식이다.
runtime 타입 정보 확인시 표준에 포함된 typeid 이외에도
비표준이긴 하나 boost::typeindex::type_id_with_cvr 도 사용할 수 있다.
**********************************************************/
class chapter04 : public chapter
{
class Widget
{
};
template<typename T>
void f(const T& param)
{
std::cout << "T = " << typeid(T).name() << std::endl;
std::cout << "param = " << typeid(param).name() << std::endl;
}
std::vector<Widget> createVec()
{
std::vector<Widget> vw;
vw.push_back(Widget());
vw.push_back(Widget());
return vw;
}
virtual int chapterMain()
{
const int theAnswer = 42;
// 바로 아래 2줄과 같이 컴파일 되는 코드이면 intellisense 를 이용해 형식 정보가 보여진다.
auto x = theAnswer;
auto y = &theAnswer;
// 바로 아래 코드와 같이 일부러 컴파일 오류를 일시 발생시켜, 컴파일러의 진단 메시지를 활용.
//TD<decltype(x)> xType;
// 런타임시, typeid 를 이용해 형식 정보를 확인할 수 있다.
std::cout << " type x is " << typeid(x).name() << std::endl;
const auto vw = createVec();
if (!vw.empty())
{
f(&vw[0]);
}
return 0;
}
};
/*
컴파일러가 연역하는 형식을 IDE 편집기나 컴파일러 오류 메시지, Boost TypeIndex 라이브러리를
이용해서 파악할 수 있는 경우가 많다.
일부 도구의 결과는 유용하지도 않고 정확하지도 않을 수 있으므로,
C++ 형식 연역 규칙들을 제대로 이해하는 것은 여전히 필요한 일이다.
*/ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.