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
e8aa70a50ec27882c34ed46c0b44f3de2a754c73
3c8f5bd175d71bf46926f47955630cc8f7ec8e1c
/PFD_VisualC/make_dataset.cpp
b4f3a325a2d91104b385de25744c66ea3045b1a0
[]
no_license
Suke-H/PFD_withC
b462d913815bf628ef36b40ae15c55b5c6efe60e
3840ab69913deeab26730f2f9c82aa3f1d987b88
refs/heads/master
2022-04-09T18:35:36.040062
2020-03-11T07:04:47
2020-03-11T07:04:47
240,707,499
2
1
null
null
null
null
SHIFT_JIS
C++
false
false
5,711
cpp
make_dataset.cpp
#include <iostream> #include <opencv2/opencv.hpp> using namespace std; using namespace cv; typedef Point3f point_t; typedef vector<point_t> points_t; #include "make_dataset.h" #include "tools.h" #include "figure.h" #include "projection.h" //sign_type: 標識 // 0: 半径0.3mの円 // 1: 1辺0.8mの正三角形 // 2: 1辺0.9mの正方形 // 3. 1辺0.45mのひし形(正方形) // 倍率(scale)が2/3, 1, 1.5, 2の4種類ある // いろんな種類の標識のf-rep関数をセット std::tuple<int, std::vector<double>, cv::Mat_<double>> set_sign2d(int sign_type, int scale) { int fig_type; std::vector<double> fig_p; cv::Mat_<double> aabb; // 0: 半径0.3mの円 if (sign_type == 0) { // 円 fig_type = 0; // p = [0, 0, 0.3*scale] fig_p.push_back(0); fig_p.push_back(0); fig_p.push_back(0.3*scale); // 描画用のAABB aabb = cv::Mat_<double>{ -0.35, 0.35, -0.35, 0.35 }*scale; } // 1: 1辺0.8mの正三角形 if (sign_type == 1) { // 正三角形 fig_type = 1; // p = [0, 0, 0.8/√3*scale, 0〜pi*3/2] fig_p.push_back(0); fig_p.push_back(0); fig_p.push_back(0.8/sqrt(3)*scale); fig_p.push_back(random_value(0, CV_PI*3/2)); // 描画用のAABB aabb = cv::Mat_<double>{ -0.45, 0.45, -0.45, 0.45 }*scale; } // 2: 1辺0.9mの正方形 if (sign_type == 2) { // 長方形 fig_type = 2; // p = [0, 0, 0.9*scale, 0.9*scale, 0〜pi/2] fig_p.push_back(0); fig_p.push_back(0); fig_p.push_back(0.9*scale); fig_p.push_back(0.9*scale); fig_p.push_back(random_value(0, CV_PI / 2)); // 描画用のAABB double l = 0.9*sqrt(2) / 2; aabb = cv::Mat_<double>{ -l * 1.1, l*1.1, -l * 1.1, l*1.1 }*scale; } // 3. 1辺0.45mのひし形(正方形) if (sign_type == 3) { // 長方形 fig_type = 2; // p = [0, 0, 0.45*scale, 0.45*scale, 0〜pi/2] fig_p.push_back(0); fig_p.push_back(0); fig_p.push_back(0.45*scale); fig_p.push_back(0.45*scale); fig_p.push_back(random_value(0, CV_PI / 2)); // 描画用のAABB double l = 0.45*sqrt(2) / 2; aabb = cv::Mat_<double>{ -l * 1.1, l*1.1, -l * 1.1, l*1.1 }*scale; } return std::forward_as_tuple(fig_type, fig_p, aabb); } // 1. 図形の点群数は点群密度density(/m^2)に基づく(図形点群数=density*図形の面積), // 2. noise_rateは全点群数に対するノイズ点群の割合。ノイズは図形点群のAABBを1~1.5倍したAABB内に一様乱数に基づいて作成 // 図形点群+ノイズを合わせた点群、平面パラメータ、その他正解図形パラメータ等を出力 std::tuple<cv::Mat_<double>, std::vector<double>, std::vector<double>, cv::Mat_<double>, cv::Mat_<double>, cv::Mat_<double>, cv::Mat_<double>, cv::Mat_<double>> make_sign3d(int sign_type, int scale, double density, double low, double high, int grid_num) { ///// 図形点群作成 ///// // 平面図形設定 int fig_type; std::vector<double> fig_p; cv::Mat_<double> aabb2d; std::tie(fig_type, fig_p, aabb2d) = set_sign2d(sign_type, scale); // 図形点群数 int fig_size; // 図形点群作成 cv::Mat_<double> fig_points; // 円 if (fig_type == 0) { Circle figure(fig_p[0], fig_p[1], fig_p[2]); std::function<cv::Mat_<double>(cv::Mat_<double>, cv::Mat_<double>)> f = std::bind(&Circle::f_rep_list, &figure, std::placeholders::_1, std::placeholders::_2); fig_size = (int)density * figure.area; fig_points = make_inside(f, aabb2d, fig_size, 1, grid_num); } // 正三角形 else if (fig_type == 1) { Triangle figure(fig_p[0], fig_p[1], fig_p[2], fig_p[3]); std::function<cv::Mat_<double>(cv::Mat_<double>, cv::Mat_<double>)> f = std::bind(&Triangle::f_rep_list, &figure, std::placeholders::_1, std::placeholders::_2); fig_size = (int)density * figure.area; fig_points = make_inside(f, aabb2d, fig_size, 1, grid_num); } // 長方形 else { Rectangle figure(fig_p[0], fig_p[1], fig_p[2], fig_p[3], fig_p[4]); std::function<cv::Mat_<double>(cv::Mat_<double>, cv::Mat_<double>)> f = std::bind(&Rectangle::f_rep_list, &figure, std::placeholders::_1, std::placeholders::_2); fig_size = (int)density * figure.area; fig_points = make_inside(f, aabb2d, fig_size, 1, grid_num); } ///// 平面に2D点群を射影 ///// // 平面ランダム作成 std::vector<double> plane_p = random_plane(); // 平面上の2点o, pをランダムに定める double a = plane_p[0], b = plane_p[1], c = plane_p[2], d = plane_p[3]; double ox = random_value(low, high), oy = random_value(low, high), px = random_value(low, high), py = random_value(low, high); double oz = (d - a * ox - b * oy) / c, pz = (d - a * px - b * py) / c; cv::Mat_<double> o = (cv::Mat_<double>(1, 3) << ox, oy, oz); cv::Mat_<double> p = (cv::Mat_<double>(1, 3) << px, py, pz); // 平面の法線n, 二次元座標軸u, vを定義 cv::Mat_<double> n, u, v; n = (cv::Mat_<double>(1, 3) << a, b, c); cv::normalize(p - o, u); cv::normalize(u.cross(n), v); // 図形点群と図形の中心座標を平面に3D射影 cv::Mat_<double> points3d, center3d; std::tie(points3d, center3d) = projection3d(fig_points, fig_p, u, v, o); return std::forward_as_tuple(points3d, plane_p, fig_p, center3d, u, v, o, aabb2d); } // ランダムに平面作成 std::vector<double> random_plane(int high) { // 法線作成 cv::Mat_<double> n = cv::Mat_<double>{ 0, 0, 0 }; while (cv::norm(n) == 0) { n(0, 0) = random_value(-high, high); n(0, 1) = random_value(-high, high); n(0, 2) = random_value(-high, high); } // 正規化 cv::normalize(n, n); // d作成 double d = random_value(-high, high); // 平面パラメータ std::vector<double> plane_p{ n(0, 0), n(0, 1), n(0, 2), d }; return plane_p; }
49dc2c59f6bac12853fce24cb0e4060db29ef9e3
eaf5c173ec669b26c95f7babad40306f2c7ea459
/tdpc/tdpc_game.cpp
543b75164a1a7e92719aff7e0d09f422aab11c46
[]
no_license
rikuTanide/atcoder_endeavor
657cc3ba7fbf361355376a014e3e49317fe96def
6b5dc43474d5183d8eecb8cb13bf45087c7ed195
refs/heads/master
2023-02-02T11:49:06.679743
2020-12-21T04:51:10
2020-12-21T04:51:10
318,676,396
0
0
null
null
null
null
UTF-8
C++
false
false
2,900
cpp
tdpc_game.cpp
#include <bits/stdc++.h> //#include "atcoder/all" //#include <boost/multiprecision/cpp_int.hpp> //namespace mp = boost::multiprecision; using namespace std; const double PI = 3.14159265358979323846; typedef long long ll; const double EPS = 1e-9; #define rep(i, n) for (int i = 0; i < (n); ++i) typedef pair<ll, ll> P; const ll INF = 10e17; #define cmin(x, y) x = min(x, y) #define cmax(x, y) x = max(x, y) #define ret() return 0; double equal(double a, double b) { return fabs(a - b) < DBL_EPSILON; } std::istream &operator>>(std::istream &in, set<int> &o) { int a; in >> a; o.insert(a); return in; } std::istream &operator>>(std::istream &in, queue<int> &o) { ll a; in >> a; o.push(a); return in; } template<class T> bool contain(set<T> &s, T a) { return s.find(a) != s.end(); } template<class T, class U> bool contain(map<T, U> &s, T a) { return s.find(a) != s.end(); } typedef priority_queue<ll, vector<ll>, greater<ll> > PQ_ASK; map<P, ll> rec(vector<ll> &as, vector<ll> &bs, int n) { if (n == as.size() + bs.size()) { map<P, ll> memo; memo[P(0, 0)] = 0; return memo; } auto prev = rec(as, bs, n + 1); // 偶数・奇数から最大化したいか最小化したいか割り出す auto superior = [&](ll x, ll y) -> ll { if (n % 2 == 0) return max(x, y); return min(x, y); }; auto choose = [&](P p, char t) -> ll { assert(t == 'a' || t == 'b'); if (t == 'a') { P next(p.first - 1, p.second); assert(contain(prev, next)); int target = p.first - 1; return prev[next] + (n % 2 == 0 ? as[target] : 0); } else { P next(p.first, p.second - 1); assert(contain(prev, next)); int target = p.second - 1; return prev[next] + (n % 2 == 0 ? bs[target] : 0); } }; // 取れる選択肢を列挙 vector<P> methods; for (int a = 0; a <= (as.size() + bs.size()) - n; a++) { int b = as.size() + bs.size() - n - a; if (a > as.size()) continue; if (b > bs.size())continue; if (b < 0)continue; methods.push_back(P(a, b)); } // 各選択肢でどっちがお得か判定 map<P, ll> next; for (P p : methods) { if (p.first != 0 && p.second != 0) { ll x = choose(p, 'a'); ll y = choose(p, 'b'); next[p] = superior(x, y); } else if (p.first > 0) { next[p] = choose(p, 'a'); } else { next[p] = choose(p, 'b'); } } return next; } int main() { int a, b; cin >> a >> b; vector<ll> as(a), bs(b); rep(i, a)cin >> as[i]; rep(i, b)cin >> bs[i]; reverse(as.begin(), as.end()); reverse(bs.begin(), bs.end()); ll res = rec(as, bs, 0)[P(a, b)]; cout << res << endl; }
fb9ba4349fa2a830c33888ef2b9a30eefd403ef1
5d2d04c255a45c615b223c84640a0256aa4ba91f
/Assignments/Assignment_03/Gaddis_8thEd_Chap12_Prob06_StringSearch/main.cpp
8ddf4472ebf5f9df5a3fd156b2e65971fe363c0b
[]
no_license
javierborja95/JB_CSC17a
dee213063855177fb4f855f8032b707af055a9b9
a86a56a300d2f98ebef0c7b5742d82d7f2be5532
refs/heads/master
2021-07-11T10:45:38.415640
2016-12-10T07:14:35
2016-12-10T07:14:35
66,890,870
0
0
null
null
null
null
UTF-8
C++
false
false
2,557
cpp
main.cpp
/* * File: main.cpp * Author: Javier Borja * Created on October 9, 2016, 8:00 PM * Purpose: Displays first 10 lines of a file, or all if less than 10 lines */ //System Libraries #include <iostream> //Input/ Output Stream Library #include <fstream> //Input I/O #include <string> //STrings #include <vector> //Vectors using namespace std; //Namespace of the System Libraries //User Libraries //Global Constants //Function Prototypes void read5(fstream&); void find(fstream&,string); //Execution int main(int argc, char** argv) { //Variables string text; //Name of file fstream file; //Input Data cout<<"Input 'text1.txt' to open a file of the same name: \n"; cin>>text; //Process Data file.open(text.c_str(),ios::in); if(file.fail()){ cout<<text<<" does not exist."<<endl; return 0; } else cout<<text<<" opening success."<<endl; //Output Data read5(file); //Search Data cout<<"Input a string to search for: "; cin>>text; find(file,text); //Close File file.close(); return 0; } void read5(fstream &file){ //Variables string line; string temp; int count=0; //Output Data while(!file.eof()){ count++; cout<<count<<":"; getline(file,line); cout<<line<<endl; } cout<<endl<<endl<<endl; } void find(fstream &file,string a){ //Variables vector<int> vArray; //Array of lines where string is found string line; int *count, //Array of occurences n=0; //Number of occurences //Input Data file.clear(); //Clear eof flag file.seekg(0L,ios::beg);//Go back to beginning cout<<"Searching for '"<<a<<"'..."<<endl<<endl; //Process Data for(int i=0;(!file.eof());i++){ bool found=false; getline(file,line); if(line.find(a)!=string::npos){ //Check if line string is in a string found=true; n++; } if(found==true){ vArray.push_back(i); } } //Output Data cout<<"'"<<a<<"' found in "<<n<<" lines"<<endl; if(vArray.size()==0) return; else{ int temp=0, //temp index counter i=0; //index file.clear(); //Clear eof flag file.seekg(0L,ios::beg);//Go back to beginning while(!file.eof()){ getline(file,line); if(vArray[temp]==i){ cout<<i<<":"<<line<<endl; temp++; } i++; } } }
94d920a55bb67e0c925a3f57e95c5cbc3366867c
0d23dd48cc744e258b473c346e8e7dc67c1e96c4
/convert sorted list to BST/iterative.cpp
5f7d49f32a25620be0c84f80bd065087c6c68478
[]
no_license
axadn/leetcode-problems
2fa64dc4f8a2f5212b8589831e52472603f2e70e
27a042644a07bbd00281880156969e763a7dc0c5
refs/heads/master
2021-03-24T13:01:36.153184
2018-05-03T22:15:42
2018-05-03T22:15:42
114,813,162
0
0
null
null
null
null
UTF-8
C++
false
false
2,835
cpp
iterative.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ /** Basic approach: set pointer to beginning Continually split range of indices into two leftwise, pushing onto a stack stop when our range length is 0 split the right range in the same fashion (leftwise) to get the right child We are treating the list like an inorder traversal Time complexity of this algorithm is O(n). Storage space is O(log n) **/ struct stackFrame{ bool leftVisited, rightVisited; int rangeStart, rangeEnd; TreeNode* node; stackFrame(int rangeStart, int rangeEnd): rangeStart(rangeStart), rangeEnd(rangeEnd){ leftVisited = false; rightVisited = false; node = NULL; } stackFrame(){} }; class Solution { public: TreeNode* sortedListToBST(ListNode* head) { if(head == NULL) return NULL; ListNode* current = head; stack<stackFrame *> stack; int length = getListLength(head); stack.push(new stackFrame(0,length - 1)); TreeNode* tempNode; TreeNode* root; stackFrame* top; int mid; while(!stack.empty()){ top = stack.top(); mid = (top->rangeStart + top->rangeEnd + 1)/ 2; if(!top->leftVisited){ top->leftVisited = true; if(top->rangeStart == mid){ root = new TreeNode(current->val); current = current->next; delete top; stack.pop(); } else{ stack.push(new stackFrame(top->rangeStart, mid - 1)); } }else if(!top->rightVisited){ top->rightVisited = true; top->node = new TreeNode(current->val); current = current->next; top->node->left = root; if(mid >= top->rangeEnd){ root = NULL; }else{ stack.push(new stackFrame(mid + 1, top->rangeEnd)); } } else{ top->node->right = root; root = top->node; delete top; stack.pop(); } } return root; } int getListLength(ListNode* head){ if(head == NULL) return 0; ListNode* current = head; int count = 1; while(current->next != NULL){ current = current->next; ++count;} return count; } };
914c5027c2de14bb178cedb0ebfc25f45e367c5b
e1700081b3e9fa1c74e6dd903da767a3fdeca7f5
/libs/post/post3d/datamodel/post3dwindowparticlestopdataitem.cpp
fc64a3ff0dcc6c4581a5955b72d5bf9a920c6614
[ "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
651
cpp
post3dwindowparticlestopdataitem.cpp
#include "post3dwindowparticlestopdataitem.h" #include "post3dwindowzonedataitem.h" #include <guicore/postcontainer/postzonedatacontainer.h> Post3dWindowParticlesTopDataItem::Post3dWindowParticlesTopDataItem(Post3dWindowDataItem* p) : Post3dWindowParticlesBaseTopDataItem {tr("Particles"), p} {} vtkPolyData* Post3dWindowParticlesTopDataItem::particleData() const { auto zone = zoneDataItem()->dataContainer(); if (zone == nullptr) {return nullptr;} return zone->particleData()->concreteData(); } Post3dWindowZoneDataItem* Post3dWindowParticlesTopDataItem::zoneDataItem() const { return dynamic_cast<Post3dWindowZoneDataItem*> (parent()); }
5fca6662d6b32444d95ff1ead04fdf1d8c001142
ffa918217f01aa44350fee8176c717eef3983579
/CDCL/CDCLAlgorithm/CDCLAlgorithm/ImplicationGraphNode.h
9ca2137b447839f46b5c2724738e8df8b2864f58
[]
no_license
vinaydt/CDCLSolver
b811b7f2fa4c4e16a7e981154bed46d7ca420d46
80db02e77f8f6341c2db6c48949e1f5db5680028
refs/heads/master
2021-08-27T21:22:30.266758
2017-12-10T11:03:59
2017-12-10T11:03:59
113,740,354
0
0
null
null
null
null
UTF-8
C++
false
false
381
h
ImplicationGraphNode.h
#ifndef IMPLICATIONGRAPHNODE_H #define IMPLICATIONGRAPHNODE_H #include<iostream> #include<unordered_set> using namespace std; class ImplicationGraphNode { public: bool value; int d; unordered_set<int> childrenOfThisNode; unordered_set<int> parentsOfThisNode; ImplicationGraphNode(); ImplicationGraphNode(bool, int); }; #endif
e02e5b6e505b958b420ef78be009515432cefc5c
01c8e12363180b56c9aff1aa2534f7e88373ffed
/CS2420/CS2420-Project3(StackQueue)/stack.h
c555c4a5ef9550a97adb8770077462d80228f2a9
[]
no_license
stahura/school-projects
94b8f02d34f963f7ecd3a96b8b8e91299ec7c2bb
c731c8555b2dbe3c08bae6d74dcccbcaffac0ada
refs/heads/master
2021-03-16T02:45:06.241234
2020-03-12T18:21:12
2020-03-12T18:21:12
246,901,775
1
0
null
null
null
null
UTF-8
C++
false
false
1,465
h
stack.h
#pragma once #include "node.h" #include "dynarray.h" enum Error_code { overflow, underflow, success }; typedef int stack_entry; class Stack { public: Stack(); Error_code push(const stack_entry &item);//FIXME: ERROR_CODE, return OVERFLOW. Ask Professor? Error_code pop(); //FIXME: ERROR_CODE, return UNDERFLOW. Ask Professor? void traversePrint(void(*visit)(Node *)); //FIXME, don't know if it works yet. Node *top_node; protected: private: }; Stack::Stack() { top_node = nullptr; } Error_code Stack::push(const stack_entry &item) { Node *new_top = new Node(item, top_node); if (new_top == nullptr) return overflow; top_node = new_top; cout << " success" << endl; return success; } Error_code Stack::pop() { Node *old_top = top_node; //if (old_top != nullptr) //FIXME. Crashes when ->next is NULL if (top_node == nullptr) { cout << " underflow" << endl; return underflow; } top_node = old_top->next; delete old_top; cout << " success" << endl; return success; } void Stack::traversePrint(void(*visit)(Node *)) { Node *p; p = top_node; DynArray<int> dynamicArray; while (p != nullptr) { dynamicArray.push_back(p->data); // cout << "i is: " << i << endl; //(*visit)(p); p = p->next; } p = top_node; //cout << endl; for (int i = dynamicArray.size() - 1; i >= 0; i--) { //cout << dynamicArray.at(i) << endl; p->data = dynamicArray.at(i); (*visit)(p); p = p->next; } }//END
aee041029a089bdab7df1e975a30722bf666b847
3520c41928f530e8766dbb7bd8e2503f7383900d
/examples/step-34.h
80dd265beb2ee6918ae0dcbdf453cbd9d8aa5b98
[ "MIT" ]
permissive
Jackie-Wu520/deal.II-translator
d5b2a83a63a33d9f128c1a2eec48fa7c50697393
9fa2aa1351a7522aefd0b8f2dd57ddd40b40b051
refs/heads/main
2023-04-17T20:41:23.558368
2021-05-09T16:27:11
2021-05-09T16:27:11
null
0
0
null
null
null
null
UTF-8
C++
false
false
87,906
h
step-34.h
/** @page step_34 The step-34 tutorial program This tutorial depends on step-4. @htmlonly <table class="tutorial" width="50%"> <tr><th colspan="2"><b><small>Table of contents</small></b></th></tr> <tr><td width="50%" valign="top"> <ol> <li> <a href="#Intro" class=bold>Introduction</a> <ul> <li><a href="#Irrotationalflow"> Irrotational flow </a> <li><a href="#Thenumericalapproximation">The numerical approximation</a> <li><a href="#Collocationboundaryelementmethod"> Collocation boundary element method </a> <li><a href="#Treatingthesingularintegrals"> Treating the singular integrals. </a> <li><a href="#Implementation">Implementation</a> <li><a href="#Testcase">Testcase</a> </ul> <li> <a href="#CommProg" class=bold>The commented program</a> <ul> <li><a href="#Includefiles">Include files</a> <li><a href="#Singleanddoublelayeroperatorkernels">Single and double layer operator kernels</a> <li><a href="#TheBEMProblemclass">The BEMProblem class</a> <ul> <li><a href="#BEMProblemBEMProblemandBEMProblemread_parameters">BEMProblem::BEMProblem and BEMProblem::read_parameters</a> <li><a href="#BEMProblemread_domain">BEMProblem::read_domain</a> <li><a href="#BEMProblemrefine_and_resize">BEMProblem::refine_and_resize</a> <li><a href="#BEMProblemassemble_system">BEMProblem::assemble_system</a> <li><a href="#BEMProblemsolve_system">BEMProblem::solve_system</a> <li><a href="#BEMProblemcompute_errors">BEMProblem::compute_errors</a> <li><a href="#BEMProblemcompute_exterior_solution">BEMProblem::compute_exterior_solution</a> <li><a href="#BEMProblemoutput_results">BEMProblem::output_results</a> <li><a href="#BEMProblemrun">BEMProblem::run</a> </ul> <li><a href="#Themainfunction">The main() function</a> </ul> </ol></td><td width="50%" valign="top"><ol> <li value="3"> <a href="#Results" class=bold>Results</a> <ul> <li><a href="#Possibilitiesforextensions">Possibilities for extensions</a> </ul> <li> <a href="#PlainProg" class=bold>The plain program</a> </ol> </td> </tr> </table> @endhtmlonly <br> <i>This program was contributed by Luca Heltai (thanks to Michael Gratton for pointing out what the exact solution should have been in the three dimensional case). </i> @dealiiTutorialDOI{10.5281/zenodo.495473,https://zenodo.org/badge/DOI/10.5281/zenodo.495473.svg} <a name="Intro"></a> <a name="Introduction"></a><h1>Introduction</h1> <a name="Irrotationalflow"></a><h3> Irrotational flow </h3> The incompressible motion of an inviscid fluid past a body (for example air past an airplane wing, or air or water past a propeller) is usually modeled by the Euler equations of fluid dynamics: \f{align*} \frac{\partial }{\partial t}\mathbf{v} + (\mathbf{v}\cdot\nabla)\mathbf{v} &= -\frac{1}{\rho}\nabla p + \mathbf{g} \qquad &\text{in } \mathbb{R}^n \backslash \Omega \\ \nabla \cdot \mathbf{v}&=0 &\text{in } \mathbb{R}^n\backslash\Omega \f} where the fluid density $\rho$ and the acceleration $\mathbf{g}$ due to external forces are given and the velocity $\mathbf{v}$ and the pressure $p$ are the unknowns. Here $\Omega$ is a closed bounded region representing the body around which the fluid moves. The above equations can be derived from Navier-Stokes equations assuming that the effects due to viscosity are negligible compared to those due to the pressure gradient, inertial forces and the external forces. This is the opposite case of the Stokes equations discussed in step-22 which are the limit case of dominant viscosity, i.e. where the velocity is so small that inertia forces can be neglected. On the other hand, owing to the assumed incompressibility, the equations are not suited for very high speed gas flows where compressibility and the equation of state of the gas have to be taken into account, leading to the Euler equations of gas dynamics, a hyperbolic system. For the purpose of this tutorial program, we will consider only stationary flow without external forces: \f{align*} (\mathbf{v}\cdot\nabla)\mathbf{v} &= -\frac{1}{\rho}\nabla p \qquad &\text{in } \mathbb{R}^n \backslash \Omega \\ \nabla \cdot \mathbf{v}&=0 &\text{in } \mathbb{R}^n\backslash\Omega \f} Uniqueness of the solution of the Euler equations is ensured by adding the boundary conditions \f[ \label{eq:boundary-conditions} \begin{aligned} \mathbf{n}\cdot\mathbf{v}& = 0 \qquad && \text{ on } \partial\Omega \\ \mathbf{v}& = \mathbf{v}_\infty && \text{ when } |\mathbf{x}| \to \infty, \end{aligned} \f] which is to say that the body is at rest in our coordinate systems and is not permeable, and that the fluid has (constant) velocity $\mathbf{v}_\infty$ at infinity. An alternative viewpoint is that our coordinate system moves along with the body whereas the background fluid is at rest at infinity. Notice that we define the normal $\mathbf{n}$ as the <i>outer</i> normal to the domain $\Omega$, which is the opposite of the outer normal to the integration domain. For both stationary and non stationary flow, the solution process starts by solving for the velocity in the second equation and substituting in the first equation in order to find the pressure. The solution of the stationary Euler equations is typically performed in order to understand the behavior of the given (possibly complex) geometry when a prescribed motion is enforced on the system. The first step in this process is to change the frame of reference from a coordinate system moving along with the body to one in which the body moves through a fluid that is at rest at infinity. This can be expressed by introducing a new velocity $\mathbf{\tilde{v}}=\mathbf{v}-\mathbf{v}_\infty$ for which we find that the same equations hold (because $\nabla\cdot \mathbf{v}_\infty=0$) and we have boundary conditions \f[ \label{eq:boundary-conditions-tilde} \begin{aligned} \mathbf{n}\cdot\mathbf{\tilde{v}}& = -\mathbf{n}\cdot\mathbf{v}_\infty \qquad && \text{ on } \partial\Omega \\ \mathbf{\tilde{v}}& = 0 && \text{ when } |\mathbf{x}| \to \infty, \end{aligned} \f] If we assume that the fluid is irrotational, i.e., $\nabla \times \mathbf{v}=0$ in $\mathbb{R}^n\backslash\Omega$, we can represent the velocity, and consequently also the perturbation velocity, as the gradient of a scalar function: \f[ \mathbf{\tilde{v}}=\nabla\phi, \f] and so the second part of Euler equations above can be rewritten as the homogeneous Laplace equation for the unknown $\phi$: \f{align*} \label{laplace} \Delta\phi &= 0 \qquad &&\text{in}\ \mathbb{R}^n\backslash\Omega, \\ \mathbf{n}\cdot\nabla\phi &= -\mathbf{n}\cdot\mathbf{v}_\infty && \text{on}\ \partial\Omega \f} while the momentum equation reduces to Bernoulli's equation that expresses the pressure $p$ as a function of the potential $\phi$: \f[ \frac{p}{\rho} +\frac{1}{2} | \nabla \phi |^2 = 0 \in \Omega. \f] So we can solve the problem by solving the Laplace equation for the potential. We recall that the following functions, called fundamental solutions of the Laplace equation, \f[ \begin{aligned} \label{eq:3} G(\mathbf{y}-\mathbf{x}) = & -\frac{1}{2\pi}\ln|\mathbf{y}-\mathbf{x}| \qquad && \text{for } n=2 \\ G(\mathbf{y}-\mathbf{x}) = & \frac{1}{4\pi}\frac{1}{|\mathbf{y}-\mathbf{x}|}&& \text{for } n=3, \end{aligned} \f] satisfy in a distributional sense the equation: \f[ -\Delta_y G(\mathbf{y}-\mathbf{x}) = \delta(\mathbf{y}-\mathbf{x}), \f] where the derivative is done in the variable $\mathbf{y}$. By using the usual Green identities, our problem can be written on the boundary $\partial\Omega = \Gamma$ only. We recall the general definition of the second Green %identity: \f[\label{green} \int_{\omega} (-\Delta u)v\,dx + \int_{\partial\omega} \frac{\partial u}{\partial \tilde{\mathbf{n}} }v \,ds = \int_{\omega} (-\Delta v)u\,dx + \int_{\partial\omega} u\frac{\partial v}{\partial \tilde{\mathbf{n}}} \,ds, \f] where $\tilde{\mathbf{n}}$ is the normal to the surface of $\omega$ pointing outwards from the domain of integration $\omega$. In our case the domain of integration is the domain $\mathbb{R}^n\backslash\Omega$, whose boundary is $ \Gamma_\infty \cup \Gamma$, where the "boundary" at infinity is defined as \f[ \Gamma_\infty \dealcoloneq \lim_{r\to\infty} \partial B_r(0). \f] In our program the normals are defined as <i>outer</i> to the domain $\Omega$, that is, they are in fact <i>inner</i> to the integration domain, and some care is required in defining the various integrals with the correct signs for the normals, i.e. replacing $\tilde{\mathbf{n}}$ by $-\mathbf{n}$. If we substitute $u$ and $v$ in the Green %identity with the solution $\phi$ and with the fundamental solution of the Laplace equation respectively, as long as $\mathbf{x}$ is chosen in the region $\mathbb{R}^n\backslash\Omega$, we obtain: \f[ \phi(\mathbf{x}) - \int_{\Gamma\cup\Gamma_\infty}\frac{\partial G(\mathbf{y}-\mathbf{x})}{\partial \mathbf{n}_y}\phi(\mathbf{y})\,ds_y = -\int_{\Gamma\cup\Gamma_\infty}G(\mathbf{y}-\mathbf{x})\frac{\partial \phi}{\partial \mathbf{n}_y}(\mathbf{y})\,ds_y \qquad \forall\mathbf{x}\in \mathbb{R}^n\backslash\Omega \f] where the normals are now pointing <i>inward</i> the domain of integration. Notice that in the above equation, we also have the integrals on the portion of the boundary at $\Gamma_\infty$. Using the boundary conditions of our problem, we have that $\nabla \phi$ is zero at infinity (which simplifies the integral on $\Gamma_\infty$ on the right hand side). The integral on $\Gamma_\infty$ that appears on the left hand side can be treated by observing that $\nabla\phi=0$ implies that $\phi$ at infinity is necessarily constant. We define its value to be $\phi_\infty$. It is an easy exercise to prove that \f[ -\int_{\Gamma_\infty} \frac{\partial G(\mathbf{y}-\mathbf{x})} {\partial \mathbf{n}_y}\phi_\infty \,ds_y = \lim_{r\to\infty} \int_{\partial B_r(0)} \frac{\mathbf{r}}{r} \cdot \nabla G(\mathbf{y}-\mathbf{x}) \phi_\infty \,ds_y = -\phi_\infty. \f] Using this result, we can reduce the above equation only on the boundary $\Gamma$ using the so-called Single and Double Layer Potential operators: \f[\label{integral} \phi(\mathbf{x}) - (D\phi)(\mathbf{x}) = \phi_\infty -\left(S \frac{\partial \phi}{\partial n_y}\right)(\mathbf{x}) \qquad \forall\mathbf{x}\in \mathbb{R}^n\backslash\Omega. \f] (The name of these operators comes from the fact that they describe the electric potential in $\mathbb{R}^n$ due to a single thin sheet of charges along a surface, and due to a double sheet of charges and anti-charges along the surface, respectively.) In our case, we know the Neumann values of $\phi$ on the boundary: $\mathbf{n}\cdot\nabla\phi = -\mathbf{n}\cdot\mathbf{v}_\infty$. Consequently, \f[ \phi(\mathbf{x}) - (D\phi)(\mathbf{x}) = \phi_\infty + \left(S[\mathbf{n}\cdot\mathbf{v}_\infty]\right)(\mathbf{x}) \qquad \forall\mathbf{x} \in \mathbb{R}^n\backslash\Omega. \f] If we take the limit for $\mathbf{x}$ tending to $\Gamma$ of the above equation, using well known properties of the single and double layer operators, we obtain an equation for $\phi$ just on the boundary $\Gamma$ of $\Omega$: \f[\label{SD} \alpha(\mathbf{x})\phi(\mathbf{x}) - (D\phi)(\mathbf{x}) = \phi_\infty + \left(S [\mathbf{n}\cdot\mathbf{v}_\infty]\right)(\mathbf{x}) \quad \mathbf{x}\in \partial\Omega, \f] which is the Boundary Integral Equation (BIE) we were looking for, where the quantity $\alpha(\mathbf{x})$ is the fraction of angle or solid angle by which the point $\mathbf{x}$ sees the domain of integration $\mathbb{R}^n\backslash\Omega$. In particular, at points $\mathbf{x}$ where the boundary $\partial\Omega$ is differentiable (i.e. smooth) we have $\alpha(\mathbf{x})=\frac 12$, but the value may be smaller or larger at points where the boundary has a corner or an edge. Substituting the single and double layer operators we get: \f[ \alpha(\mathbf{x}) \phi(\mathbf{x}) + \frac{1}{2\pi}\int_{\partial \Omega} \frac{ (\mathbf{y}-\mathbf{x})\cdot\mathbf{n}_y }{ |\mathbf{y}-\mathbf{x}|^2 } \phi(\mathbf{y}) \,ds_y = \phi_\infty -\frac{1}{2\pi}\int_{\partial \Omega} \ln|\mathbf{y}-\mathbf{x}| \, \mathbf{n}\cdot\mathbf{v_\infty}\,ds_y \f] for two dimensional flows and \f[ \alpha(\mathbf{x}) \phi(\mathbf{x}) + \frac{1}{4\pi}\int_{\partial \Omega} \frac{ (\mathbf{y}-\mathbf{x})\cdot\mathbf{n}_y }{ |\mathbf{y}-\mathbf{x}|^3 }\phi(\mathbf{y})\,ds_y = \phi_\infty + \frac{1}{4\pi}\int_{\partial \Omega} \frac{1}{|\mathbf{y}-\mathbf{x}|} \, \mathbf{n}\cdot\mathbf{v_\infty}\,ds_y \f] for three dimensional flows, where the normal derivatives of the fundamental solutions have been written in a form that makes computation easier. In either case, $\phi$ is the solution of an integral equation posed entirely on the boundary since both $\mathbf{x},\mathbf{y}\in\partial\Omega$. Notice that the fraction of angle (in 2d) or solid angle (in 3d) $\alpha(\mathbf{x})$ by which the point $\mathbf{x}$ sees the domain $\Omega$ can be defined using the double layer potential itself: \f[ \alpha(\mathbf{x}) \dealcoloneq 1 - \frac{1}{2(n-1)\pi}\int_{\partial \Omega} \frac{ (\mathbf{y}-\mathbf{x})\cdot\mathbf{n}_y } { |\mathbf{y}-\mathbf{x}|^{n} }\phi(\mathbf{y})\,ds_y = 1+ \int_{\partial \Omega} \frac{ \partial G(\mathbf{y}-\mathbf{x}) }{\partial \mathbf{n}_y} \, ds_y. \f] The reason why this is possible can be understood if we consider the fact that the solution of a pure Neumann problem is known up to an arbitrary constant $c$, which means that, if we set the Neumann data to be zero, then any constant $\phi = \phi_\infty$ will be a solution. Inserting the constant solution and the Neumann boundary condition in the boundary integral equation, we have @f{align*} \alpha\left(\mathbf{x}\right)\phi\left(\mathbf{x}\right) &=\int_{\Omega}\phi\left(\mathbf{y}\right)\delta\left(\mathbf{y}-\mathbf{x}\right)\, dy\\ \Rightarrow \alpha\left(\mathbf{x}\right)\phi_\infty &=\phi_\infty\int_{\Gamma\cup\Gamma_\infty}\frac{ \partial G(\mathbf{y}-\mathbf{x}) }{\partial \mathbf{n}_y} \, ds_y =\phi_\infty\left[\int_{\Gamma_\infty}\frac{ \partial G(\mathbf{y}-\mathbf{x}) }{\partial \mathbf{n}_y} \, ds_y +\int_{\Gamma}\frac{ \partial G(\mathbf{y}-\mathbf{x}) }{\partial \mathbf{n}_y} \, ds_y \right] @f} The integral on $\Gamma_\infty$ is unity, see above, so division by the constant $\phi_\infty$ gives us the explicit expression above for $\alpha(\mathbf{x})$. While this example program is really only focused on the solution of the boundary integral equation, in a realistic setup one would still need to solve for the velocities. To this end, note that we have just computed $\phi(\mathbf{x})$ for all $\mathbf{x}\in\partial\Omega$. In the next step, we can compute (analytically, if we want) the solution $\phi(\mathbf{x})$ in all of $\mathbb{R}^n\backslash\Omega$. To this end, recall that we had \f[ \phi(\mathbf{x}) = \phi_\infty + (D\phi)(\mathbf{x}) + \left(S[\mathbf{n}\cdot\mathbf{v}_\infty]\right)(\mathbf{x}) \qquad \forall\mathbf{x}\in \mathbb{R}^n\backslash\Omega. \f] where now we have everything that is on the right hand side ($S$ and $D$ are integrals we can evaluate, the normal velocity on the boundary is given, and $\phi$ on the boundary we have just computed). Finally, we can then recover the velocity as $\mathbf{\tilde v}=\nabla \phi$. Notice that the evaluation of the above formula for $\mathbf{x} \in \Omega$ should yield zero as a result, since the integration of the Dirac delta $\delta(\mathbf{x})$ in the domain $\mathbb{R}^n\backslash\Omega$ is always zero by definition. As a final test, let us verify that this velocity indeed satisfies the momentum balance equation for a stationary flow field, i.e., whether $\mathbf{v}\cdot\nabla\mathbf{v} = -\frac 1\rho \nabla p$ where $\mathbf{v}=\mathbf{\tilde v}+\mathbf{v}_\infty=\nabla\phi+\mathbf{v}_\infty$ for some (unknown) pressure $p$ and a given constant $\rho$. In other words, we would like to verify that Bernoulli's law as stated above indeed holds. To show this, we use that the left hand side of this equation equates to @f{align*} \mathbf{v}\cdot\nabla\mathbf{v} &= [(\nabla\phi+\mathbf{v}_\infty)\cdot\nabla] (\nabla\phi+\mathbf{v}_\infty) \\ &= [(\nabla\phi+\mathbf{v}_\infty)\cdot\nabla] (\nabla\phi) @f} where we have used that $\mathbf{v}_\infty$ is constant. We would like to write this expression as the gradient of something (remember that $\rho$ is a constant). The next step is more convenient if we consider the components of the equation individually (summation over indices that appear twice is implied): @f{align*} [\mathbf{v}\cdot\nabla\mathbf{v}]_i &= (\partial_j\phi+v_{\infty,j}) \partial_j \partial_i\phi \\ &= \partial_j [(\partial_j\phi+v_{\infty,j}) \partial_i\phi] - \partial_j [(\partial_j\phi+v_{\infty,j})] \partial_i\phi \\ &= \partial_j [(\partial_j\phi+v_{\infty,j}) \partial_i\phi] @f} because $\partial_j \partial_j\phi = \Delta \phi = 0$ and $\textrm{div} \ \mathbf{v}_\infty=0$. Next, @f{align*} [\mathbf{v}\cdot\nabla\mathbf{v}]_i &= \partial_j [(\partial_j\phi+v_{\infty,j}) \partial_i\phi] \\ &= \partial_j [(\partial_j\phi) (\partial_i\phi)] + \partial_j [v_{\infty,j} \partial_i\phi] \\ &= \partial_j [(\partial_j\phi) (\partial_i\phi)] + \partial_j [v_{\infty,j}] \partial_i\phi + v_{\infty,j} \partial_j \partial_i\phi \\ &= \partial_j [(\partial_j\phi) (\partial_i\phi)] + v_{\infty,j} \partial_j \partial_i\phi \\ &= \partial_i \partial_j [(\partial_j\phi) \phi] - \partial_j [\partial_i (\partial_j\phi) \phi] + \partial_i [v_{\infty,j} \partial_j \phi] - \partial_i [v_{\infty,j}] \partial_j \phi @f} Again, the last term disappears because $\mathbf{v}_\infty$ is constant and we can merge the first and third term into one: @f{align*} [\mathbf{v}\cdot\nabla\mathbf{v}]_i &= \partial_i (\partial_j [(\partial_j\phi) \phi + v_{\infty,j} \partial_j \phi]) - \partial_j [\partial_i (\partial_j\phi) \phi] \\ &= \partial_i [(\partial_j\phi)(\partial_j \phi) + v_{\infty,j} \partial_j \phi] - \partial_j [\partial_i (\partial_j\phi) \phi] @f} We now only need to massage that last term a bit more. Using the product rule, we get @f{align*} \partial_j [\partial_i (\partial_j\phi) \phi] &= \partial_i [\partial_j \partial_j\phi] \phi + \partial_i [\partial_j \phi] (\partial_j \phi). @f} The first of these terms is zero (because, again, the summation over $j$ gives $\Delta\phi$, which is zero). The last term can be written as $\frac 12 \partial_i [(\partial_j\phi)(\partial_j\phi)]$ which is in the desired gradient form. As a consequence, we can now finally state that @f{align*} [\mathbf{v}\cdot\nabla\mathbf{v}]_i &= \partial_i (\partial_j [(\partial_j\phi) \phi + v_{\infty,j} \partial_j \phi]) - \partial_j [\partial_i (\partial_j\phi) \phi] \\ &= \partial_i \left[ (\partial_j\phi)(\partial_j \phi) + v_{\infty,j} \partial_j \phi - \frac 12 (\partial_j\phi)(\partial_j\phi) \right], \\ &= \partial_i \left[ \frac 12 (\partial_j\phi)(\partial_j \phi) + v_{\infty,j} \partial_j \phi \right], @f} or in vector form: @f[ \mathbf{v}\cdot\nabla\mathbf{v} = \nabla \left[ \frac 12 \mathbf{\tilde v}^2 + \mathbf{v}_{\infty} \cdot \mathbf{\tilde v} \right], @f] or in other words: @f[ p = -\rho \left[ \frac 12 \mathbf{\tilde v}^2 + \mathbf{v}_{\infty} \cdot \mathbf{\tilde v} \right] = -\rho \left[ \frac 12 \mathbf{v}^2 - \frac 12 \mathbf{v}_{\infty}^2 \right] . @f] Because the pressure is only determined up to a constant (it appears only with a gradient in the equations), an equally valid definition is @f[ p = -\frac 12 \rho \mathbf{v}^2 . @f] This is exactly Bernoulli's law mentioned above. <a name="Thenumericalapproximation"></a><h3>The numerical approximation</h3> Numerical approximations of Boundary Integral Equations (BIE) are commonly referred to as the boundary element method or panel method (the latter expression being used mostly in the computational fluid dynamics community). The goal of the following test problem is to solve the integral formulation of the Laplace equation with Neumann boundary conditions, using a circle and a sphere respectively in two and three space dimensions, illustrating along the way the features that allow one to treat boundary element problems almost as easily as finite element problems using the deal.II library. To this end, let $\mathcal{T}_h = \bigcup_i K_i$ be a subdivision of the manifold $\Gamma = \partial \Omega$ into $M$ line segments if $n=2$, or $M$ quadrilaterals if $n=3$. We will call each individual segment or quadrilateral an <i>element</i> or <i>cell</i>, independently of the dimension $n$ of the surrounding space $\mathbb{R}^n$. We define the finite dimensional space $V_h$ as \f[ \label{eq:definition-Vh} V_h \dealcoloneq \{ v \in C^0(\Gamma) \text{ s.t. } v|_{K_i} \in \mathcal{Q}^1(K_i), \forall i\}, \f] with basis functions $\psi_i(\mathbf{x})$ for which we will use the usual FE_Q finite element, with the catch that this time it is defined on a manifold of codimension one (which we do by using the second template argument that is usually defaulted to equal the first; here, we will create objects <code>FE_Q@<dim-1,dim@></code> to indicate that we have <code>dim-1</code> dimensional cells in a <code>dim</code> dimensional space). An element $\phi_h$ of $V_h$ is uniquely identified by the vector $\boldsymbol{\phi}$ of its coefficients $\phi_i$, that is: \f[ \label{eq:definition-of-element} \phi_h(\mathbf{x}) \dealcoloneq \phi_i \psi_i(\mathbf{x}), \qquad \boldsymbol{\phi} \dealcoloneq \{ \phi_i \}, \f] where summation is implied over repeated indexes. Note that we could use discontinuous elements here &mdash; in fact, there is no real reason to use continuous ones since the integral formulation does not imply any derivatives on our trial functions so continuity is unnecessary, and often in the literature only piecewise constant elements are used. <a name="Collocationboundaryelementmethod"></a><h3> Collocation boundary element method </h3> By far, the most common approximation of boundary integral equations is by use of the collocation based boundary element method. This method requires the evaluation of the boundary integral equation at a number of collocation points which is equal to the number of unknowns of the system. The choice of these points is a delicate matter, that requires a careful study. Assume that these points are known for the moment, and call them $\mathbf x_i$ with $i=0...n\_dofs$. The problem then becomes: Given the datum $\mathbf{v}_\infty$, find a function $\phi_h$ in $V_h$ such that the following $n\_dofs$ equations are satisfied: \f{align*} \alpha(\mathbf{x}_i) \phi_h(\mathbf{x}_i) - \int_{\Gamma_y} \frac{ \partial G(\mathbf{y}-\mathbf{x}_i)}{\partial\mathbf{n}_y } \phi_h(\mathbf{y}) \,ds_y = \int_{\Gamma_y} G(\mathbf{y}-\mathbf{x}_i) \, \mathbf{n}_y\cdot\mathbf{v_\infty} \,ds_y , \f} where the quantity $\alpha(\mathbf{x}_i)$ is the fraction of (solid) angle by which the point $\mathbf{x}_i$ sees the domain $\Omega$, as explained above, and we set $\phi_\infty$ to be zero. If the support points $\mathbf{x}_i$ are chosen appropriately, then the problem can be written as the following linear system: \f[ \label{eq:linear-system} (\mathbf{A}+\mathbf{N})\boldsymbol\phi = \mathbf{b}, \f] where \f[ \begin{aligned} \mathbf{A}_{ij}&= \alpha(\mathbf{x}_i) \psi_j(\mathbf{x}_i) = 1+\int_\Gamma \frac{\partial G(\mathbf{y}-\mathbf{x}_i)}{\partial \mathbf{n}_y}\,ds_y \psi_j(\mathbf{x}_i) \\ \mathbf{N}_{ij}&= - \int_\Gamma \frac{\partial G(\mathbf{y}-\mathbf{x}_i)}{\partial \mathbf{n}_y} \psi_j(\mathbf{y}) \,ds_y \\ \mathbf{b}_i&= \int_\Gamma G(\mathbf{y}-\mathbf{x}_i) \, \mathbf{n}_y\cdot\mathbf{v_\infty} ds_y. \end{aligned} \f] From a linear algebra point of view, the best possible choice of the collocation points is the one that renders the matrix $\mathbf{A}+\mathbf{N}$ the most diagonally dominant. A natural choice is then to select the $\mathbf{x}_i$ collocation points to be the support points of the nodal basis functions $\psi_i(\mathbf{x})$. In that case, $\psi_j(\mathbf{x}_i)=\delta_{ij}$, and as a consequence the matrix $\mathbf{A}$ is diagonal with entries \f[ \mathbf{A}_{ii} = 1+\int_\Gamma \frac{\partial G(\mathbf{y}-\mathbf{x}_i)}{\partial \mathbf{n}_y}\,ds_y = 1-\sum_j N_{ij}, \f] where we have used that $\sum_j \psi_j(\mathbf{y})=1$ for the usual Lagrange elements. With this choice of collocation points, the computation of the entries of the matrices $\mathbf{A}$, $\mathbf{N}$ and of the right hand side $\mathbf{b}$ requires the evaluation of singular integrals on the elements $K_i$ of the triangulation $\mathcal{T}_h$. As usual in these cases, all integrations are performed on a reference simple domain, i.e., we assume that each element $K_i$ of $\mathcal{T}_h$ can be expressed as a linear (in two dimensions) or bi-linear (in three dimensions) transformation of the reference boundary element $\hat K \dealcoloneq [0,1]^{n-1}$, and we perform the integrations after a change of variables from the real element $K_i$ to the reference element $\hat K$. <a name="Treatingthesingularintegrals"></a><h3> Treating the singular integrals. </h3> In two dimensions it is not necessary to compute the diagonal elements $\mathbf{N}_{ii}$ of the system matrix, since, even if the denominator goes to zero when $\mathbf{x}=\mathbf{y}$, the numerator is always zero because $\mathbf{n}_y$ and $(\mathbf{y}-\mathbf{x})$ are orthogonal (on our polygonal approximation of the boundary of $\Omega$), and the only singular integral arises in the computation of $\mathbf{b}_i$ on the i-th element of $\mathcal{T}_h$: \f[ \frac{1}{\pi} \int_{K_i} \ln|\mathbf{y}-\mathbf{x}_i| \, \mathbf{n}_y\cdot\mathbf{v_\infty} \,ds_y. \f] This can be easily treated by the QGaussLogR quadrature formula. Similarly, it is possible to use the QGaussOneOverR quadrature formula to perform the singular integrations in three dimensions. The interested reader will find detailed explanations on how these quadrature rules work in their documentation. The resulting matrix $\mathbf{A}+\mathbf{N}$ is full. Depending on its size, it might be convenient to use a direct solver or an iterative one. For the purpose of this example code, we chose to use only an iterative solver, without providing any preconditioner. If this were a production code rather than a demonstration of principles, there are techniques that are available to not store full matrices but instead store only those entries that are large and/or relevant. In the literature on boundary element methods, a plethora of methods is available that allows to determine which elements are important and which are not, leading to a significantly sparser representation of these matrices that also facilitates rapid evaluations of the scalar product between vectors and matrices. This not being the goal of this program, we leave this for more sophisticated implementations. <a name="Implementation"></a><h3>Implementation</h3> The implementation is rather straight forward. The main point that hasn't been used in any of the previous tutorial programs is that most classes in deal.II are not only templated on the dimension, but in fact on the dimension of the manifold on which we pose the differential equation as well as the dimension of the space into which this manifold is embedded. By default, the second template argument equals the first, meaning for example that we want to solve on a two-dimensional region of two-dimensional space. The triangulation class to use in this case would be <code>Triangulation@<2@></code>, which is an equivalent way of writing <code>Triangulation@<2,2@></code>. However, this doesn't have to be so: in the current example, we will for example want to solve on the surface of a sphere, which is a two-dimensional manifold embedded in a three-dimensional space. Consequently, the right class will be <code>Triangulation@<2,3@></code>, and correspondingly we will use <code>DoFHandler@<2,3@></code> as the DoF handler class and <code>FE_Q@<2,3@></code> for finite elements. Some further details on what one can do with things that live on curved manifolds can be found in the report <a target="_top" href="http://www.dealii.org/reports/codimension-one/desimone-heltai-manigrasso.pdf"><i>Tools for the Solution of PDEs Defined on Curved Manifolds with the deal.II Library</i> by A. DeSimone, L. Heltai, C. Manigrasso</a>. In addition, the step-38 tutorial program extends what we show here to cases where the equation posed on the manifold is not an integral operator but in fact involves derivatives. <a name="Testcase"></a><h3>Testcase</h3> The testcase we will be solving is for a circular (in 2d) or spherical (in 3d) obstacle. Meshes for these geometries will be read in from files in the current directory and an object of type SphericalManifold will then be attached to the triangulation to allow mesh refinement that respects the continuous geometry behind the discrete initial mesh. For a sphere of radius $a$ translating at a velocity of $U$ in the $x$ direction, the potential reads @f{align*} \phi = -\frac{1}{2}U \left(\frac{a}{r}\right)3 r \cos\theta @f} see, e.g. J. N. Newman, <i>Marine Hydrodynamics</i>, 1977, pp. 127. For unit speed and radius, and restricting $(x,y,z)$ to lie on the surface of the sphere, $\phi = -x/2$. In the test problem, the flow is $(1,1,1)$, so the appropriate exact solution on the surface of the sphere is the superposition of the above solution with the analogous solution along the $y$ and $z$ axes, or $\phi = \frac{1}{2}(x + y + z)$. * * * <a name="CommProg"></a> * <h1> The commented program</h1> * * * <a name="Includefiles"></a> * <h3>Include files</h3> * * * The program starts with including a bunch of include files that we will use * in the various parts of the program. Most of them have been discussed in * previous tutorials already: * * @code * #include <deal.II/base/smartpointer.h> * #include <deal.II/base/convergence_table.h> * #include <deal.II/base/quadrature_lib.h> * #include <deal.II/base/quadrature_selector.h> * #include <deal.II/base/parsed_function.h> * #include <deal.II/base/utilities.h> * * #include <deal.II/lac/full_matrix.h> * #include <deal.II/lac/vector.h> * #include <deal.II/lac/solver_control.h> * #include <deal.II/lac/solver_gmres.h> * #include <deal.II/lac/precondition.h> * * #include <deal.II/grid/tria.h> * #include <deal.II/grid/grid_generator.h> * #include <deal.II/grid/grid_in.h> * #include <deal.II/grid/grid_out.h> * #include <deal.II/grid/manifold_lib.h> * * #include <deal.II/dofs/dof_handler.h> * #include <deal.II/dofs/dof_tools.h> * * #include <deal.II/fe/fe_q.h> * #include <deal.II/fe/fe_values.h> * #include <deal.II/fe/mapping_q.h> * * #include <deal.II/numerics/data_out.h> * #include <deal.II/numerics/vector_tools.h> * * @endcode * * And here are a few C++ standard header files that we will need: * * @code * #include <cmath> * #include <iostream> * #include <fstream> * #include <string> * * @endcode * * The last part of this preamble is to import everything in the dealii * namespace into the one into which everything in this program will go: * * @code * namespace Step34 * { * using namespace dealii; * * * @endcode * * * <a name="Singleanddoublelayeroperatorkernels"></a> * <h3>Single and double layer operator kernels</h3> * * * First, let us define a bit of the boundary integral equation machinery. * * * The following two functions are the actual calculations of the single and * double layer potential kernels, that is $G$ and $\nabla G$. They are well * defined only if the vector $R = \mathbf{y}-\mathbf{x}$ is different from * zero. * * @code * namespace LaplaceKernel * { * template <int dim> * double single_layer(const Tensor<1, dim> &R) * { * switch (dim) * { * case 2: * return (-std::log(R.norm()) / (2 * numbers::PI)); * * case 3: * return (1. / (R.norm() * 4 * numbers::PI)); * * default: * Assert(false, ExcInternalError()); * return 0.; * } * } * * * * template <int dim> * Tensor<1, dim> double_layer(const Tensor<1, dim> &R) * { * switch (dim) * { * case 2: * return R / (-2 * numbers::PI * R.norm_square()); * case 3: * return R / (-4 * numbers::PI * R.norm_square() * R.norm()); * * default: * Assert(false, ExcInternalError()); * return Tensor<1, dim>(); * } * } * } // namespace LaplaceKernel * * * @endcode * * * <a name="TheBEMProblemclass"></a> * <h3>The BEMProblem class</h3> * * * The structure of a boundary element method code is very similar to the * structure of a finite element code, and so the member functions of this * class are like those of most of the other tutorial programs. In * particular, by now you should be familiar with reading parameters from an * external file, and with the splitting of the different tasks into * different modules. The same applies to boundary element methods, and we * won't comment too much on them, except on the differences. * * @code * template <int dim> * class BEMProblem * { * public: * BEMProblem(const unsigned int fe_degree = 1, * const unsigned int mapping_degree = 1); * * void run(); * * private: * void read_parameters(const std::string &filename); * * void read_domain(); * * void refine_and_resize(); * * @endcode * * The only really different function that we find here is the assembly * routine. We wrote this function in the most possible general way, in * order to allow for easy generalization to higher order methods and to * different fundamental solutions (e.g., Stokes or Maxwell). * * * The most noticeable difference is the fact that the final matrix is * full, and that we have a nested loop inside the usual loop on cells * that visits all support points of the degrees of freedom. Moreover, * when the support point lies inside the cell which we are visiting, then * the integral we perform becomes singular. * * * The practical consequence is that we have two sets of quadrature * formulas, finite element values and temporary storage, one for standard * integration and one for the singular integration, which are used where * necessary. * * @code * void assemble_system(); * * @endcode * * There are two options for the solution of this problem. The first is to * use a direct solver, and the second is to use an iterative solver. We * opt for the second option. * * * The matrix that we assemble is not symmetric, and we opt to use the * GMRES method; however the construction of an efficient preconditioner * for boundary element methods is not a trivial issue. Here we use a non * preconditioned GMRES solver. The options for the iterative solver, such * as the tolerance, the maximum number of iterations, are selected * through the parameter file. * * @code * void solve_system(); * * @endcode * * Once we obtained the solution, we compute the $L^2$ error of the * computed potential as well as the $L^\infty$ error of the approximation * of the solid angle. The mesh we are using is an approximation of a * smooth curve, therefore the computed diagonal matrix of fraction of * angles or solid angles $\alpha(\mathbf{x})$ should be constantly equal * to $\frac 12$. In this routine we output the error on the potential and * the error in the approximation of the computed angle. Notice that the * latter error is actually not the error in the computation of the angle, * but a measure of how well we are approximating the sphere and the * circle. * * * Experimenting a little with the computation of the angles gives very * accurate results for simpler geometries. To verify this you can comment * out, in the read_domain() method, the tria.set_manifold(1, manifold) * line, and check the alpha that is generated by the program. By removing * this call, whenever the mesh is refined new nodes will be placed along * the straight lines that made up the coarse mesh, rather than be pulled * onto the surface that we really want to approximate. In the three * dimensional case, the coarse grid of the sphere is obtained starting * from a cube, and the obtained values of alphas are exactly $\frac 12$ * on the nodes of the faces, $\frac 34$ on the nodes of the edges and * $\frac 78$ on the 8 nodes of the vertices. * * @code * void compute_errors(const unsigned int cycle); * * @endcode * * Once we obtained a solution on the codimension one domain, we want to * interpolate it to the rest of the space. This is done by performing * again the convolution of the solution with the kernel in the * compute_exterior_solution() function. * * * We would like to plot the velocity variable which is the gradient of * the potential solution. The potential solution is only known on the * boundary, but we use the convolution with the fundamental solution to * interpolate it on a standard dim dimensional continuous finite element * space. The plot of the gradient of the extrapolated solution will give * us the velocity we want. * * * In addition to the solution on the exterior domain, we also output the * solution on the domain's boundary in the output_results() function, of * course. * * @code * void compute_exterior_solution(); * * void output_results(const unsigned int cycle); * * @endcode * * To allow for dimension independent programming, we specialize this * single function to extract the singular quadrature formula needed to * integrate the singular kernels in the interior of the cells. * * @code * const Quadrature<dim - 1> &get_singular_quadrature( * const typename DoFHandler<dim - 1, dim>::active_cell_iterator &cell, * const unsigned int index) const; * * * @endcode * * The usual deal.II classes can be used for boundary element methods by * specifying the "codimension" of the problem. This is done by setting * the optional second template arguments to Triangulation, FiniteElement * and DoFHandler to the dimension of the embedding space. In our case we * generate either 1 or 2 dimensional meshes embedded in 2 or 3 * dimensional spaces. * * * The optional argument by default is equal to the first argument, and * produces the usual finite element classes that we saw in all previous * examples. * * * The class is constructed in a way to allow for arbitrary order of * approximation of both the domain (through high order mapping) and the * finite element space. The order of the finite element space and of the * mapping can be selected in the constructor of the class. * * * * @code * Triangulation<dim - 1, dim> tria; * FE_Q<dim - 1, dim> fe; * DoFHandler<dim - 1, dim> dof_handler; * MappingQ<dim - 1, dim> mapping; * * @endcode * * In BEM methods, the matrix that is generated is dense. Depending on the * size of the problem, the final system might be solved by direct LU * decomposition, or by iterative methods. In this example we use an * unpreconditioned GMRES method. Building a preconditioner for BEM method * is non trivial, and we don't treat this subject here. * * * * @code * FullMatrix<double> system_matrix; * Vector<double> system_rhs; * * @endcode * * The next two variables will denote the solution $\phi$ as well as a * vector that will hold the values of $\alpha(\mathbf x)$ (the fraction * of $\Omega$ visible from a point $\mathbf x$) at the support points of * our shape functions. * * * * @code * Vector<double> phi; * Vector<double> alpha; * * @endcode * * The convergence table is used to output errors in the exact solution * and in the computed alphas. * * * * @code * ConvergenceTable convergence_table; * * @endcode * * The following variables are the ones that we fill through a parameter * file. The new objects that we use in this example are the * Functions::ParsedFunction object and the QuadratureSelector object. * * * The Functions::ParsedFunction class allows us to easily and quickly * define new function objects via parameter files, with custom * definitions which can be very complex (see the documentation of that * class for all the available options). * * * We will allocate the quadrature object using the QuadratureSelector * class that allows us to generate quadrature formulas based on an * identifying string and on the possible degree of the formula itself. We * used this to allow custom selection of the quadrature formulas for the * standard integration, and to define the order of the singular * quadrature rule. * * * We also define a couple of parameters which are used in case we wanted * to extend the solution to the entire domain. * * * * @code * Functions::ParsedFunction<dim> wind; * Functions::ParsedFunction<dim> exact_solution; * * unsigned int singular_quadrature_order; * std::shared_ptr<Quadrature<dim - 1>> quadrature; * * SolverControl solver_control; * * unsigned int n_cycles; * unsigned int external_refinement; * * bool run_in_this_dimension; * bool extend_solution; * }; * * * @endcode * * * <a name="BEMProblemBEMProblemandBEMProblemread_parameters"></a> * <h4>BEMProblem::BEMProblem and BEMProblem::read_parameters</h4> * * * The constructor initializes the various object in much the same way as * done in the finite element programs such as step-4 or step-6. The only * new ingredient here is the ParsedFunction object, which needs, at * construction time, the specification of the number of components. * * * For the exact solution the number of vector components is one, and no * action is required since one is the default value for a ParsedFunction * object. The wind, however, requires dim components to be * specified. Notice that when declaring entries in a parameter file for the * expression of the Functions::ParsedFunction, we need to specify the * number of components explicitly, since the function * Functions::ParsedFunction::declare_parameters is static, and has no * knowledge of the number of components. * * @code * template <int dim> * BEMProblem<dim>::BEMProblem(const unsigned int fe_degree, * const unsigned int mapping_degree) * : fe(fe_degree) * , dof_handler(tria) * , mapping(mapping_degree, true) * , wind(dim) * , singular_quadrature_order(5) * , n_cycles(4) * , external_refinement(5) * , run_in_this_dimension(true) * , extend_solution(true) * {} * * * template <int dim> * void BEMProblem<dim>::read_parameters(const std::string &filename) * { * deallog << std::endl * << "Parsing parameter file " << filename << std::endl * << "for a " << dim << " dimensional simulation. " << std::endl; * * ParameterHandler prm; * * prm.declare_entry("Number of cycles", "4", Patterns::Integer()); * prm.declare_entry("External refinement", "5", Patterns::Integer()); * prm.declare_entry("Extend solution on the -2,2 box", * "true", * Patterns::Bool()); * prm.declare_entry("Run 2d simulation", "true", Patterns::Bool()); * prm.declare_entry("Run 3d simulation", "true", Patterns::Bool()); * * prm.enter_subsection("Quadrature rules"); * { * prm.declare_entry( * "Quadrature type", * "gauss", * Patterns::Selection( * QuadratureSelector<(dim - 1)>::get_quadrature_names())); * prm.declare_entry("Quadrature order", "4", Patterns::Integer()); * prm.declare_entry("Singular quadrature order", "5", Patterns::Integer()); * } * prm.leave_subsection(); * * @endcode * * For both two and three dimensions, we set the default input data to be * such that the solution is $x+y$ or $x+y+z$. The actually computed * solution will have value zero at infinity. In this case, this coincide * with the exact solution, and no additional corrections are needed, but * you should be aware of the fact that we arbitrarily set $\phi_\infty$, * and the exact solution we pass to the program needs to have the same * value at infinity for the error to be computed correctly. * * * The use of the Functions::ParsedFunction object is pretty straight * forward. The Functions::ParsedFunction::declare_parameters function * takes an additional integer argument that specifies the number of * components of the given function. Its default value is one. When the * corresponding Functions::ParsedFunction::parse_parameters method is * called, the calling object has to have the same number of components * defined here, otherwise an exception is thrown. * * * When declaring entries, we declare both 2 and three dimensional * functions. However only the dim-dimensional one is ultimately * parsed. This allows us to have only one parameter file for both 2 and 3 * dimensional problems. * * * Notice that from a mathematical point of view, the wind function on the * boundary should satisfy the condition $\int_{\partial\Omega} * \mathbf{v}\cdot \mathbf{n} d \Gamma = 0$, for the problem to have a * solution. If this condition is not satisfied, then no solution can be * found, and the solver will not converge. * * @code * prm.enter_subsection("Wind function 2d"); * { * Functions::ParsedFunction<2>::declare_parameters(prm, 2); * prm.set("Function expression", "1; 1"); * } * prm.leave_subsection(); * * prm.enter_subsection("Wind function 3d"); * { * Functions::ParsedFunction<3>::declare_parameters(prm, 3); * prm.set("Function expression", "1; 1; 1"); * } * prm.leave_subsection(); * * prm.enter_subsection("Exact solution 2d"); * { * Functions::ParsedFunction<2>::declare_parameters(prm); * prm.set("Function expression", "x+y"); * } * prm.leave_subsection(); * * prm.enter_subsection("Exact solution 3d"); * { * Functions::ParsedFunction<3>::declare_parameters(prm); * prm.set("Function expression", "x+y+z"); * } * prm.leave_subsection(); * * * @endcode * * In the solver section, we set all SolverControl parameters. The object * will then be fed to the GMRES solver in the solve_system() function. * * @code * prm.enter_subsection("Solver"); * SolverControl::declare_parameters(prm); * prm.leave_subsection(); * * @endcode * * After declaring all these parameters to the ParameterHandler object, * let's read an input file that will give the parameters their values. We * then proceed to extract these values from the ParameterHandler object: * * @code * prm.parse_input(filename); * * n_cycles = prm.get_integer("Number of cycles"); * external_refinement = prm.get_integer("External refinement"); * extend_solution = prm.get_bool("Extend solution on the -2,2 box"); * * prm.enter_subsection("Quadrature rules"); * { * quadrature = std::shared_ptr<Quadrature<dim - 1>>( * new QuadratureSelector<dim - 1>(prm.get("Quadrature type"), * prm.get_integer("Quadrature order"))); * singular_quadrature_order = prm.get_integer("Singular quadrature order"); * } * prm.leave_subsection(); * * prm.enter_subsection("Wind function " + std::to_string(dim) + "d"); * { * wind.parse_parameters(prm); * } * prm.leave_subsection(); * * prm.enter_subsection("Exact solution " + std::to_string(dim) + "d"); * { * exact_solution.parse_parameters(prm); * } * prm.leave_subsection(); * * prm.enter_subsection("Solver"); * solver_control.parse_parameters(prm); * prm.leave_subsection(); * * * @endcode * * Finally, here's another example of how to use parameter files in * dimension independent programming. If we wanted to switch off one of * the two simulations, we could do this by setting the corresponding "Run * 2d simulation" or "Run 3d simulation" flag to false: * * @code * run_in_this_dimension = * prm.get_bool("Run " + std::to_string(dim) + "d simulation"); * } * * * @endcode * * * <a name="BEMProblemread_domain"></a> * <h4>BEMProblem::read_domain</h4> * * * A boundary element method triangulation is basically the same as a * (dim-1) dimensional triangulation, with the difference that the vertices * belong to a (dim) dimensional space. * * * Some of the mesh formats supported in deal.II use by default three * dimensional points to describe meshes. These are the formats which are * compatible with the boundary element method capabilities of deal.II. In * particular we can use either UCD or GMSH formats. In both cases, we have * to be particularly careful with the orientation of the mesh, because, * unlike in the standard finite element case, no reordering or * compatibility check is performed here. All meshes are considered as * oriented, because they are embedded in a higher dimensional space. (See * the documentation of the GridIn and of the Triangulation for further * details on orientation of cells in a triangulation.) In our case, the * normals to the mesh are external to both the circle in 2d or the sphere * in 3d. * * * The other detail that is required for appropriate refinement of * the boundary element mesh is an accurate description of the * manifold that the mesh approximates. We already saw this * several times for the boundary of standard finite element meshes * (for example in step-5 and step-6), and here the principle and * usage is the same, except that the SphericalManifold class takes * an additional template parameter that specifies the embedding * space dimension. * * * * @code * template <int dim> * void BEMProblem<dim>::read_domain() * { * const Point<dim> center = Point<dim>(); * const SphericalManifold<dim - 1, dim> manifold(center); * * std::ifstream in; * switch (dim) * { * case 2: * in.open("coarse_circle.inp"); * break; * * case 3: * in.open("coarse_sphere.inp"); * break; * * default: * Assert(false, ExcNotImplemented()); * } * * GridIn<dim - 1, dim> gi; * gi.attach_triangulation(tria); * gi.read_ucd(in); * * tria.set_all_manifold_ids(1); * @endcode * * The call to Triangulation::set_manifold copies the manifold (via * Manifold::clone()), so we do not need to worry about invalid pointers * to <code>manifold</code>: * * @code * tria.set_manifold(1, manifold); * } * * * @endcode * * * <a name="BEMProblemrefine_and_resize"></a> * <h4>BEMProblem::refine_and_resize</h4> * * * This function globally refines the mesh, distributes degrees of freedom, * and resizes matrices and vectors. * * * * @code * template <int dim> * void BEMProblem<dim>::refine_and_resize() * { * tria.refine_global(1); * * dof_handler.distribute_dofs(fe); * * const unsigned int n_dofs = dof_handler.n_dofs(); * * system_matrix.reinit(n_dofs, n_dofs); * * system_rhs.reinit(n_dofs); * phi.reinit(n_dofs); * alpha.reinit(n_dofs); * } * * * @endcode * * * <a name="BEMProblemassemble_system"></a> * <h4>BEMProblem::assemble_system</h4> * * * The following is the main function of this program, assembling the matrix * that corresponds to the boundary integral equation. * * @code * template <int dim> * void BEMProblem<dim>::assemble_system() * { * @endcode * * First we initialize an FEValues object with the quadrature formula for * the integration of the kernel in non singular cells. This quadrature is * selected with the parameter file, and needs to be quite precise, since * the functions we are integrating are not polynomial functions. * * @code * FEValues<dim - 1, dim> fe_v(mapping, * fe, * *quadrature, * update_values | update_normal_vectors | * update_quadrature_points | update_JxW_values); * * const unsigned int n_q_points = fe_v.n_quadrature_points; * * std::vector<types::global_dof_index> local_dof_indices( * fe.n_dofs_per_cell()); * * std::vector<Vector<double>> cell_wind(n_q_points, Vector<double>(dim)); * double normal_wind; * * @endcode * * Unlike in finite element methods, if we use a collocation boundary * element method, then in each assembly loop we only assemble the * information that refers to the coupling between one degree of freedom * (the degree associated with support point $i$) and the current * cell. This is done using a vector of fe.dofs_per_cell elements, which * will then be distributed to the matrix in the global row $i$. The * following object will hold this information: * * @code * Vector<double> local_matrix_row_i(fe.n_dofs_per_cell()); * * @endcode * * The index $i$ runs on the collocation points, which are the support * points of the $i$th basis function, while $j$ runs on inner integration * points. * * * We construct a vector of support points which will be used in the local * integrations: * * @code * std::vector<Point<dim>> support_points(dof_handler.n_dofs()); * DoFTools::map_dofs_to_support_points<dim - 1, dim>(mapping, * dof_handler, * support_points); * * * @endcode * * After doing so, we can start the integration loop over all cells, where * we first initialize the FEValues object and get the values of * $\mathbf{\tilde v}$ at the quadrature points (this vector field should * be constant, but it doesn't hurt to be more general): * * @code * for (const auto &cell : dof_handler.active_cell_iterators()) * { * fe_v.reinit(cell); * cell->get_dof_indices(local_dof_indices); * * const std::vector<Point<dim>> &q_points = fe_v.get_quadrature_points(); * const std::vector<Tensor<1, dim>> &normals = fe_v.get_normal_vectors(); * wind.vector_value_list(q_points, cell_wind); * * @endcode * * We then form the integral over the current cell for all degrees of * freedom (note that this includes degrees of freedom not located on * the current cell, a deviation from the usual finite element * integrals). The integral that we need to perform is singular if one * of the local degrees of freedom is the same as the support point * $i$. A the beginning of the loop we therefore check whether this is * the case, and we store which one is the singular index: * * @code * for (unsigned int i = 0; i < dof_handler.n_dofs(); ++i) * { * local_matrix_row_i = 0; * * bool is_singular = false; * unsigned int singular_index = numbers::invalid_unsigned_int; * * for (unsigned int j = 0; j < fe.n_dofs_per_cell(); ++j) * if (local_dof_indices[j] == i) * { * singular_index = j; * is_singular = true; * break; * } * * @endcode * * We then perform the integral. If the index $i$ is not one of * the local degrees of freedom, we simply have to add the single * layer terms to the right hand side, and the double layer terms * to the matrix: * * @code * if (is_singular == false) * { * for (unsigned int q = 0; q < n_q_points; ++q) * { * normal_wind = 0; * for (unsigned int d = 0; d < dim; ++d) * normal_wind += normals[q][d] * cell_wind[q](d); * * const Tensor<1, dim> R = q_points[q] - support_points[i]; * * system_rhs(i) += (LaplaceKernel::single_layer(R) * * normal_wind * fe_v.JxW(q)); * * for (unsigned int j = 0; j < fe.n_dofs_per_cell(); ++j) * * local_matrix_row_i(j) -= * ((LaplaceKernel::double_layer(R) * normals[q]) * * fe_v.shape_value(j, q) * fe_v.JxW(q)); * } * } * else * { * @endcode * * Now we treat the more delicate case. If we are here, this * means that the cell that runs on the $j$ index contains * support_point[i]. In this case both the single and the * double layer potential are singular, and they require * special treatment. * * * Whenever the integration is performed with the singularity * inside the given cell, then a special quadrature formula is * used that allows one to integrate arbitrary functions * against a singular weight on the reference cell. * * * The correct quadrature formula is selected by the * get_singular_quadrature function, which is explained in * detail below. * * @code * Assert(singular_index != numbers::invalid_unsigned_int, * ExcInternalError()); * * const Quadrature<dim - 1> &singular_quadrature = * get_singular_quadrature(cell, singular_index); * * FEValues<dim - 1, dim> fe_v_singular( * mapping, * fe, * singular_quadrature, * update_jacobians | update_values | update_normal_vectors | * update_quadrature_points); * * fe_v_singular.reinit(cell); * * std::vector<Vector<double>> singular_cell_wind( * singular_quadrature.size(), Vector<double>(dim)); * * const std::vector<Tensor<1, dim>> &singular_normals = * fe_v_singular.get_normal_vectors(); * const std::vector<Point<dim>> &singular_q_points = * fe_v_singular.get_quadrature_points(); * * wind.vector_value_list(singular_q_points, singular_cell_wind); * * for (unsigned int q = 0; q < singular_quadrature.size(); ++q) * { * const Tensor<1, dim> R = * singular_q_points[q] - support_points[i]; * double normal_wind = 0; * for (unsigned int d = 0; d < dim; ++d) * normal_wind += * (singular_cell_wind[q](d) * singular_normals[q][d]); * * system_rhs(i) += (LaplaceKernel::single_layer(R) * * normal_wind * fe_v_singular.JxW(q)); * * for (unsigned int j = 0; j < fe.n_dofs_per_cell(); ++j) * { * local_matrix_row_i(j) -= * ((LaplaceKernel::double_layer(R) * * singular_normals[q]) * * fe_v_singular.shape_value(j, q) * * fe_v_singular.JxW(q)); * } * } * } * * @endcode * * Finally, we need to add the contributions of the current cell * to the global matrix. * * @code * for (unsigned int j = 0; j < fe.n_dofs_per_cell(); ++j) * system_matrix(i, local_dof_indices[j]) += local_matrix_row_i(j); * } * } * * @endcode * * The second part of the integral operator is the term * $\alpha(\mathbf{x}_i) \phi_j(\mathbf{x}_i)$. Since we use a collocation * scheme, $\phi_j(\mathbf{x}_i)=\delta_{ij}$ and the corresponding matrix * is a diagonal one with entries equal to $\alpha(\mathbf{x}_i)$. * * * One quick way to compute this diagonal matrix of the solid angles, is * to use the Neumann matrix itself. It is enough to multiply the matrix * with a vector of elements all equal to -1, to get the diagonal matrix * of the alpha angles, or solid angles (see the formula in the * introduction for this). The result is then added back onto the system * matrix object to yield the final form of the matrix: * * @code * Vector<double> ones(dof_handler.n_dofs()); * ones.add(-1.); * * system_matrix.vmult(alpha, ones); * alpha.add(1); * for (unsigned int i = 0; i < dof_handler.n_dofs(); ++i) * system_matrix(i, i) += alpha(i); * } * * * @endcode * * * <a name="BEMProblemsolve_system"></a> * <h4>BEMProblem::solve_system</h4> * * * The next function simply solves the linear system. * * @code * template <int dim> * void BEMProblem<dim>::solve_system() * { * SolverGMRES<Vector<double>> solver(solver_control); * solver.solve(system_matrix, phi, system_rhs, PreconditionIdentity()); * } * * * @endcode * * * <a name="BEMProblemcompute_errors"></a> * <h4>BEMProblem::compute_errors</h4> * * * The computation of the errors is exactly the same in all other example * programs, and we won't comment too much. Notice how the same methods that * are used in the finite element methods can be used here. * * @code * template <int dim> * void BEMProblem<dim>::compute_errors(const unsigned int cycle) * { * Vector<float> difference_per_cell(tria.n_active_cells()); * VectorTools::integrate_difference(mapping, * dof_handler, * phi, * exact_solution, * difference_per_cell, * QGauss<(dim - 1)>(2 * fe.degree + 1), * VectorTools::L2_norm); * const double L2_error = * VectorTools::compute_global_error(tria, * difference_per_cell, * VectorTools::L2_norm); * * @endcode * * The error in the alpha vector can be computed directly using the * Vector::linfty_norm() function, since on each node, the value should be * $\frac 12$. All errors are then output and appended to our * ConvergenceTable object for later computation of convergence rates: * * @code * Vector<double> difference_per_node(alpha); * difference_per_node.add(-.5); * * const double alpha_error = difference_per_node.linfty_norm(); * const unsigned int n_active_cells = tria.n_active_cells(); * const unsigned int n_dofs = dof_handler.n_dofs(); * * deallog << "Cycle " << cycle << ':' << std::endl * << " Number of active cells: " << n_active_cells * << std::endl * << " Number of degrees of freedom: " << n_dofs << std::endl; * * convergence_table.add_value("cycle", cycle); * convergence_table.add_value("cells", n_active_cells); * convergence_table.add_value("dofs", n_dofs); * convergence_table.add_value("L2(phi)", L2_error); * convergence_table.add_value("Linfty(alpha)", alpha_error); * } * * * @endcode * * Singular integration requires a careful selection of the quadrature * rules. In particular the deal.II library provides quadrature rules which * are tailored for logarithmic singularities (QGaussLog, QGaussLogR), as * well as for 1/R singularities (QGaussOneOverR). * * * Singular integration is typically obtained by constructing weighted * quadrature formulas with singular weights, so that it is possible to * write * * * \f[ \int_K f(x) s(x) dx = \sum_{i=1}^N w_i f(q_i) \f] * * * where $s(x)$ is a given singularity, and the weights and quadrature * points $w_i,q_i$ are carefully selected to make the formula above an * equality for a certain class of functions $f(x)$. * * * In all the finite element examples we have seen so far, the weight of the * quadrature itself (namely, the function $s(x)$), was always constantly * equal to 1. For singular integration, we have two choices: we can use * the definition above, factoring out the singularity from the integrand * (i.e., integrating $f(x)$ with the special quadrature rule), or we can * ask the quadrature rule to "normalize" the weights $w_i$ with $s(q_i)$: * * * \f[ \int_K f(x) s(x) dx = \int_K g(x) dx = \sum_{i=1}^N * \frac{w_i}{s(q_i)} g(q_i) \f] * * * We use this second option, through the @p factor_out_singularity * parameter of both QGaussLogR and QGaussOneOverR. * * * These integrals are somewhat delicate, especially in two dimensions, due * to the transformation from the real to the reference cell, where the * variable of integration is scaled with the determinant of the * transformation. * * * In two dimensions this process does not result only in a factor appearing * as a constant factor on the entire integral, but also on an additional * integral altogether that needs to be evaluated: * * * \f[ \int_0^1 f(x)\ln(x/\alpha) dx = \int_0^1 f(x)\ln(x) dx - \int_0^1 * f(x) \ln(\alpha) dx. \f] * * * This process is taken care of by the constructor of the QGaussLogR class, * which adds additional quadrature points and weights to take into * consideration also the second part of the integral. * * * A similar reasoning should be done in the three dimensional case, since * the singular quadrature is tailored on the inverse of the radius $r$ in * the reference cell, while our singular function lives in real space, * however in the three dimensional case everything is simpler because the * singularity scales linearly with the determinant of the * transformation. This allows us to build the singular two dimensional * quadrature rules only once and, reuse them over all cells. * * * In the one dimensional singular integration this is not possible, since * we need to know the scaling parameter for the quadrature, which is not * known a priori. Here, the quadrature rule itself depends also on the size * of the current cell. For this reason, it is necessary to create a new * quadrature for each singular integration. * * * The different quadrature rules are built inside the * get_singular_quadrature, which is specialized for dim=2 and dim=3, and * they are retrieved inside the assemble_system function. The index given * as an argument is the index of the unit support point where the * singularity is located. * * * * @code * template <> * const Quadrature<2> &BEMProblem<3>::get_singular_quadrature( * const DoFHandler<2, 3>::active_cell_iterator &, * const unsigned int index) const * { * Assert(index < fe.n_dofs_per_cell(), * ExcIndexRange(0, fe.n_dofs_per_cell(), index)); * * static std::vector<QGaussOneOverR<2>> quadratures; * if (quadratures.size() == 0) * for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) * quadratures.emplace_back(singular_quadrature_order, * fe.get_unit_support_points()[i], * true); * return quadratures[index]; * } * * * template <> * const Quadrature<1> &BEMProblem<2>::get_singular_quadrature( * const DoFHandler<1, 2>::active_cell_iterator &cell, * const unsigned int index) const * { * Assert(index < fe.n_dofs_per_cell(), * ExcIndexRange(0, fe.n_dofs_per_cell(), index)); * * static Quadrature<1> *q_pointer = nullptr; * if (q_pointer) * delete q_pointer; * * q_pointer = new QGaussLogR<1>(singular_quadrature_order, * fe.get_unit_support_points()[index], * 1. / cell->measure(), * true); * return (*q_pointer); * } * * * * @endcode * * * <a name="BEMProblemcompute_exterior_solution"></a> * <h4>BEMProblem::compute_exterior_solution</h4> * * * We'd like to also know something about the value of the potential $\phi$ * in the exterior domain: after all our motivation to consider the boundary * integral problem was that we wanted to know the velocity in the exterior * domain! * * * To this end, let us assume here that the boundary element domain is * contained in the box $[-2,2]^{\text{dim}}$, and we extrapolate the actual * solution inside this box using the convolution with the fundamental * solution. The formula for this is given in the introduction. * * * The reconstruction of the solution in the entire space is done on a * continuous finite element grid of dimension dim. These are the usual * ones, and we don't comment any further on them. At the end of the * function, we output this exterior solution in, again, much the usual way. * * @code * template <int dim> * void BEMProblem<dim>::compute_exterior_solution() * { * Triangulation<dim> external_tria; * GridGenerator::hyper_cube(external_tria, -2, 2); * * FE_Q<dim> external_fe(1); * DoFHandler<dim> external_dh(external_tria); * Vector<double> external_phi; * * external_tria.refine_global(external_refinement); * external_dh.distribute_dofs(external_fe); * external_phi.reinit(external_dh.n_dofs()); * * FEValues<dim - 1, dim> fe_v(mapping, * fe, * *quadrature, * update_values | update_normal_vectors | * update_quadrature_points | update_JxW_values); * * const unsigned int n_q_points = fe_v.n_quadrature_points; * * std::vector<types::global_dof_index> dofs(fe.n_dofs_per_cell()); * * std::vector<double> local_phi(n_q_points); * std::vector<double> normal_wind(n_q_points); * std::vector<Vector<double>> local_wind(n_q_points, Vector<double>(dim)); * * std::vector<Point<dim>> external_support_points(external_dh.n_dofs()); * DoFTools::map_dofs_to_support_points<dim>(StaticMappingQ1<dim>::mapping, * external_dh, * external_support_points); * * for (const auto &cell : dof_handler.active_cell_iterators()) * { * fe_v.reinit(cell); * * const std::vector<Point<dim>> &q_points = fe_v.get_quadrature_points(); * const std::vector<Tensor<1, dim>> &normals = fe_v.get_normal_vectors(); * * cell->get_dof_indices(dofs); * fe_v.get_function_values(phi, local_phi); * * wind.vector_value_list(q_points, local_wind); * * for (unsigned int q = 0; q < n_q_points; ++q) * { * normal_wind[q] = 0; * for (unsigned int d = 0; d < dim; ++d) * normal_wind[q] += normals[q][d] * local_wind[q](d); * } * * for (unsigned int i = 0; i < external_dh.n_dofs(); ++i) * for (unsigned int q = 0; q < n_q_points; ++q) * { * const Tensor<1, dim> R = q_points[q] - external_support_points[i]; * * external_phi(i) += * ((LaplaceKernel::single_layer(R) * normal_wind[q] + * (LaplaceKernel::double_layer(R) * normals[q]) * * local_phi[q]) * * fe_v.JxW(q)); * } * } * * DataOut<dim> data_out; * * data_out.attach_dof_handler(external_dh); * data_out.add_data_vector(external_phi, "external_phi"); * data_out.build_patches(); * * const std::string filename = std::to_string(dim) + "d_external.vtk"; * std::ofstream file(filename); * * data_out.write_vtk(file); * } * * * @endcode * * * <a name="BEMProblemoutput_results"></a> * <h4>BEMProblem::output_results</h4> * * * Outputting the results of our computations is a rather mechanical * tasks. All the components of this function have been discussed before. * * @code * template <int dim> * void BEMProblem<dim>::output_results(const unsigned int cycle) * { * DataOut<dim - 1, DoFHandler<dim - 1, dim>> dataout; * * dataout.attach_dof_handler(dof_handler); * dataout.add_data_vector( * phi, "phi", DataOut<dim - 1, DoFHandler<dim - 1, dim>>::type_dof_data); * dataout.add_data_vector( * alpha, * "alpha", * DataOut<dim - 1, DoFHandler<dim - 1, dim>>::type_dof_data); * dataout.build_patches( * mapping, * mapping.get_degree(), * DataOut<dim - 1, DoFHandler<dim - 1, dim>>::curved_inner_cells); * * const std::string filename = std::to_string(dim) + "d_boundary_solution_" + * std::to_string(cycle) + ".vtk"; * std::ofstream file(filename); * * dataout.write_vtk(file); * * if (cycle == n_cycles - 1) * { * convergence_table.set_precision("L2(phi)", 3); * convergence_table.set_precision("Linfty(alpha)", 3); * * convergence_table.set_scientific("L2(phi)", true); * convergence_table.set_scientific("Linfty(alpha)", true); * * convergence_table.evaluate_convergence_rates( * "L2(phi)", ConvergenceTable::reduction_rate_log2); * convergence_table.evaluate_convergence_rates( * "Linfty(alpha)", ConvergenceTable::reduction_rate_log2); * deallog << std::endl; * convergence_table.write_text(std::cout); * } * } * * * @endcode * * * <a name="BEMProblemrun"></a> * <h4>BEMProblem::run</h4> * * * This is the main function. It should be self explanatory in its * briefness: * * @code * template <int dim> * void BEMProblem<dim>::run() * { * read_parameters("parameters.prm"); * * if (run_in_this_dimension == false) * { * deallog << "Run in dimension " << dim * << " explicitly disabled in parameter file. " << std::endl; * return; * } * * read_domain(); * * for (unsigned int cycle = 0; cycle < n_cycles; ++cycle) * { * refine_and_resize(); * assemble_system(); * solve_system(); * compute_errors(cycle); * output_results(cycle); * } * * if (extend_solution == true) * compute_exterior_solution(); * } * } // namespace Step34 * * * @endcode * * * <a name="Themainfunction"></a> * <h3>The main() function</h3> * * * This is the main function of this program. It is exactly like all previous * tutorial programs: * * @code * int main() * { * try * { * using namespace Step34; * * const unsigned int degree = 1; * const unsigned int mapping_degree = 1; * * deallog.depth_console(3); * BEMProblem<2> laplace_problem_2d(degree, mapping_degree); * laplace_problem_2d.run(); * * BEMProblem<3> laplace_problem_3d(degree, mapping_degree); * laplace_problem_3d.run(); * } * catch (std::exception &exc) * { * std::cerr << std::endl * << std::endl * << "----------------------------------------------------" * << std::endl; * std::cerr << "Exception on processing: " << std::endl * << exc.what() << std::endl * << "Aborting!" << std::endl * << "----------------------------------------------------" * << std::endl; * * return 1; * } * catch (...) * { * std::cerr << std::endl * << std::endl * << "----------------------------------------------------" * << std::endl; * std::cerr << "Unknown exception!" << std::endl * << "Aborting!" << std::endl * << "----------------------------------------------------" * << std::endl; * return 1; * } * * return 0; * } * @endcode <a name="Results"></a><h1>Results</h1> We ran the program using the following <code>parameters.prm</code> file (which can also be found in the directory in which all the other source files are): @verbatim # Listing of Parameters # --------------------- set Extend solution on the -2,2 box = true set External refinement = 5 set Number of cycles = 4 set Run 2d simulation = true set Run 3d simulation = true subsection Exact solution 2d # Any constant used inside the function which is not a variable name. set Function constants = # Separate vector valued expressions by ';' as ',' is used internally by the # function parser. set Function expression = x+y # default: 0 # The name of the variables as they will be used in the function, separated # by ','. set Variable names = x,y,t end subsection Exact solution 3d # Any constant used inside the function which is not a variable name. set Function constants = # Separate vector valued expressions by ';' as ',' is used internally by the # function parser. set Function expression = .5*(x+y+z) # default: 0 # The name of the variables as they will be used in the function, separated # by ','. set Variable names = x,y,z,t end subsection Quadrature rules set Quadrature order = 4 set Quadrature type = gauss set Singular quadrature order = 5 end subsection Solver set Log frequency = 1 set Log history = false set Log result = true set Max steps = 100 set Tolerance = 1.e-10 end subsection Wind function 2d # Any constant used inside the function which is not a variable name. set Function constants = # Separate vector valued expressions by ';' as ',' is used internally by the # function parser. set Function expression = 1; 1 # default: 0; 0 # The name of the variables as they will be used in the function, separated # by ','. set Variable names = x,y,t end subsection Wind function 3d # Any constant used inside the function which is not a variable name. set Function constants = # Separate vector valued expressions by ';' as ',' is used internally by the # function parser. set Function expression = 1; 1; 1 # default: 0; 0; 0 # The name of the variables as they will be used in the function, separated # by ','. set Variable names = x,y,z,t end @endverbatim When we run the program, the following is printed on screen: @verbatim DEAL:: DEAL::Parsing parameter file parameters.prm DEAL::for a 2 dimensional simulation. DEAL:GMRES::Starting value 2.21576 DEAL:GMRES::Convergence step 1 value 2.37635e-13 DEAL::Cycle 0: DEAL:: Number of active cells: 20 DEAL:: Number of degrees of freedom: 20 DEAL:GMRES::Starting value 3.15543 DEAL:GMRES::Convergence step 1 value 2.89310e-13 DEAL::Cycle 1: DEAL:: Number of active cells: 40 DEAL:: Number of degrees of freedom: 40 DEAL:GMRES::Starting value 4.46977 DEAL:GMRES::Convergence step 1 value 3.11815e-13 DEAL::Cycle 2: DEAL:: Number of active cells: 80 DEAL:: Number of degrees of freedom: 80 DEAL:GMRES::Starting value 6.32373 DEAL:GMRES::Convergence step 1 value 3.22474e-13 DEAL::Cycle 3: DEAL:: Number of active cells: 160 DEAL:: Number of degrees of freedom: 160 DEAL:: cycle cells dofs L2(phi) Linfty(alpha) 0 20 20 4.465e-02 - 5.000e-02 - 1 40 40 1.081e-02 2.05 2.500e-02 1.00 2 80 80 2.644e-03 2.03 1.250e-02 1.00 3 160 160 6.529e-04 2.02 6.250e-03 1.00 DEAL:: DEAL::Parsing parameter file parameters.prm DEAL::for a 3 dimensional simulation. DEAL:GMRES::Starting value 2.84666 DEAL:GMRES::Convergence step 3 value 8.68638e-18 DEAL::Cycle 0: DEAL:: Number of active cells: 24 DEAL:: Number of degrees of freedom: 26 DEAL:GMRES::Starting value 6.34288 DEAL:GMRES::Convergence step 5 value 1.38740e-11 DEAL::Cycle 1: DEAL:: Number of active cells: 96 DEAL:: Number of degrees of freedom: 98 DEAL:GMRES::Starting value 12.9780 DEAL:GMRES::Convergence step 5 value 3.29225e-11 DEAL::Cycle 2: DEAL:: Number of active cells: 384 DEAL:: Number of degrees of freedom: 386 DEAL:GMRES::Starting value 26.0874 DEAL:GMRES::Convergence step 6 value 1.47271e-12 DEAL::Cycle 3: DEAL:: Number of active cells: 1536 DEAL:: Number of degrees of freedom: 1538 DEAL:: cycle cells dofs L2(phi) Linfty(alpha) 0 24 26 3.437e-01 - 2.327e-01 - 1 96 98 9.794e-02 1.81 1.239e-01 0.91 2 384 386 2.417e-02 2.02 6.319e-02 0.97 3 1536 1538 5.876e-03 2.04 3.176e-02 0.99 @endverbatim As we can see from the convergence table in 2d, if we choose quadrature formulas which are accurate enough, then the error we obtain for $\alpha(\mathbf{x})$ should be exactly the inverse of the number of elements. The approximation of the circle with N segments of equal size generates a regular polygon with N faces, whose angles are exactly $\pi-\frac {2\pi}{N}$, therefore the error we commit should be exactly $\frac 12 - (\frac 12 -\frac 1N) = \frac 1N$. In fact this is a very good indicator that we are performing the singular integrals in an appropriate manner. The error in the approximation of the potential $\phi$ is largely due to approximation of the domain. A much better approximation could be obtained by using higher order mappings. If we modify the main() function, setting fe_degree and mapping_degree to two, and raise the order of the quadrature formulas in the parameter file, we obtain the following convergence table for the two dimensional simulation @verbatim cycle cells dofs L2(phi) Linfty(alpha) 0 20 40 5.414e-05 - 2.306e-04 - 1 40 80 3.623e-06 3.90 1.737e-05 3.73 2 80 160 2.690e-07 3.75 1.253e-05 0.47 3 160 320 2.916e-08 3.21 7.670e-06 0.71 @endverbatim and @verbatim cycle cells dofs L2(phi) Linfty(alpha) 0 24 98 3.770e-03 - 8.956e-03 - 1 96 386 1.804e-04 4.39 1.182e-03 2.92 2 384 1538 9.557e-06 4.24 1.499e-04 2.98 3 1536 6146 6.617e-07 3.85 1.892e-05 2.99 @endverbatim for the three dimensional case. As we can see, convergence results are much better with higher order mapping, mainly due to a better resolution of the curved geometry. Notice that, given the same number of degrees of freedom, for example in step 3 of the Q1 case and step 2 of Q2 case in the three dimensional simulation, the error is roughly three orders of magnitude lower. The result of running these computations is a bunch of output files that we can pass to our visualization program of choice. The output files are of two kind: the potential on the boundary element surface, and the potential extended to the outer and inner domain. The combination of the two for the two dimensional case looks like <img src="https://www.dealii.org/images/steps/developer/step-34_2d.png" alt=""> while in three dimensions we show first the potential on the surface, together with a contour plot, <img src="https://www.dealii.org/images/steps/developer/step-34_3d.png" alt=""> and then the external contour plot of the potential, with opacity set to 25%: <img src="https://www.dealii.org/images/steps/developer/step-34_3d-2.png" alt=""> <a name="extensions"></a> <a name="Possibilitiesforextensions"></a><h3>Possibilities for extensions</h3> This is the first tutorial program that considers solving equations defined on surfaces embedded in higher dimensional spaces. But the equation discussed here was relatively simple because it only involved an integral operator, not derivatives which are more difficult to define on the surface. The step-38 tutorial program considers such problems and provides the necessary tools. From a practical perspective, the Boundary Element Method (BEM) used here suffers from two bottlenecks. The first is that assembling the matrix has a cost that is *quadratic* in the number of unknowns, that is ${\cal O}(N^2)$ where $N$ is the total number of unknowns. This can be seen by looking at the `assemble_system()` function, which has this structure: @code for (const auto &cell : dof_handler.active_cell_iterators()) { ... for (unsigned int i = 0; i < dof_handler.n_dofs(); ++i) ... @endcode Here, the first loop walks over all cells (one factor of $N$) whereas the inner loop contributes another factor of $N$. This has to be contrasted with the finite element method for *local* differential operators: There, we loop over all cells (one factor of $N$) and on each cell do an amount of work that is independent of how many cells or unknowns there are. This clearly presents a bottleneck. The second bottleneck is that the system matrix is dense (i.e., is of type FullMatrix) because every degree of freedom couples with every other degree of freedom. As pointed out above, just *computing* this matrix with its $N^2$ nonzero entries necessarily requires at least ${\cal O}(N^2)$ operations, but it's worth pointing out that it also costs this many operations to just do one matrix-vector product. If the GMRES method used to solve the linear system requires a number of iterations that grows with the size of the problem, as is typically the case, then solving the linear system will require a number of operations that grows even faster than just ${\cal O}(N^2)$. "Real" boundary element methods address these issues by strategies that determine which entries of the matrix will be small and can consequently be neglected (at the cost of introducing an additional error, of course). This is possible by recognizing that the matrix entries decay with the (physical) distance between the locations where degrees of freedom $i$ and $j$ are defined. This can be exploited in methods such as the Fast Multipole Method (FMM) that control which matrix entries must be stored and computed to achieve a certain accuracy, and -- if done right -- result in methods in which both assembly and solution of the linear system requires less than ${\cal O}(N^2)$ operations. Implementing these methods clearly presents opportunities to extend the current program. * * <a name="PlainProg"></a> <h1> The plain program</h1> @include "step-34.cc" */
9cdb819b8b586835153fea125cc5345da36a1848
80cbd6e2279da099071ca33701bb43f58f02599b
/src/network/kClient.cpp
46b8c0c17894c8e76fcb51de4a9914f1cc277010
[]
no_license
pasnox/kiess
1bab7be378a49ba689c7fcdc2e012503c2ea704e
ef1f671aa513cb6a1e425bfd468d35d836c5631d
refs/heads/master
2016-09-05T15:44:35.114830
2009-04-04T08:28:53
2009-04-04T08:28:53
33,011,423
1
0
null
null
null
null
UTF-8
C++
false
false
2,279
cpp
kClient.cpp
#include "kClient.h" kClient::kClient() : JabberClient() { DiscoItem::Identity identity; identity.category = "client"; identity.type = ARCH_NAME; identity.name = APP_NAME; setClientName( APP_NAME ); setClientVersion( APP_VERSION ); setOSName( OS_NAME ); setDiscoIdentity( identity ); QObject::connect( this, SIGNAL( connected() ), this, SLOT( _q_connected() ) ); QObject::connect( this, SIGNAL( csAuthenticated() ), this, SLOT( _q_csAuthenticated() ) ); QObject::connect( this, SIGNAL( csError( int ) ), this, SLOT( _q_csError( int ) ) ); QObject::connect( this, SIGNAL( csDisconnected() ), this, SLOT( _q_csDisconnected() ) ); QObject::connect( this, SIGNAL( tlsWarning( QCA::TLS::IdentityResult, QCA::Validity ) ), this, SLOT( _q_tlsWarning( QCA::TLS::IdentityResult, QCA::Validity ) ) ); QObject::connect( this, SIGNAL( error( JabberClient::ErrorCode ) ), this, SLOT( _q_error( JabberClient::ErrorCode ) ) ); QObject::connect( this, SIGNAL( debugMessage( const QString& ) ), this, SLOT( _q_debugMessage( const QString& ) ) ); QObject::connect( this, SIGNAL( incomingXML( const QString& ) ), this, SLOT( _q_incomingXML( const QString& ) ) ); QObject::connect( this, SIGNAL( outgoingXML( const QString& ) ), this, SLOT( _q_outgoingXML( const QString& ) ) ); } kClient::~kClient() { } void kClient::setPresence( const Status& status ) { client()->setPresence( status ); } void kClient::_q_connected() { qWarning() << "connected"; emit connected( true ); } void kClient::_q_csAuthenticated() { qWarning() << "csAuthenticated"; } void kClient::_q_csError( int error ) { qWarning() << "csError" << error; emit connected( false ); } void kClient::_q_csDisconnected() { qWarning() << "csDisconnected"; emit connected( false ); } void kClient::_q_tlsWarning( QCA::TLS::IdentityResult, QCA::Validity ) { qWarning() << "tlsWarning"; } void kClient::_q_error( JabberClient::ErrorCode code ) { qWarning() << "error" << code; emit connected( false ); } void kClient::_q_debugMessage( const QString& message ) { //qWarning() << "debugMessage" << message; } void kClient::_q_incomingXML( const QString& msg ) { //qWarning() << "incomingXML" << msg; } void kClient::_q_outgoingXML( const QString& msg ) { //qWarning() << "outgoingXML" << msg; }
2757617692438bb7bac05dd38401a834a465161b
94a1ae89fa4fac16b3d2a6c56ca678d6c8af668a
/include/ircd/m/vm/fault.h
cdde4442330c88a5f1a3ac0cb9f65fba21a3dc87
[ "BSD-3-Clause", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
matrix-construct/construct
99d677d0c2254cac2176d80690bbfd02b18a8658
0624b69246878da592d3f5c2c3737ad0b5ff6277
refs/heads/master
2023-05-28T12:16:23.661446
2023-04-28T05:33:46
2023-05-01T19:45:37
147,328,703
356
41
NOASSERTION
2022-07-22T03:45:21
2018-09-04T10:26:23
C++
UTF-8
C++
false
false
1,931
h
fault.h
// The Construct // // Copyright (C) The Construct Developers, Authors & Contributors // Copyright (C) 2016-2020 Jason Volk <jason@zemos.net> // // Permission to use, copy, modify, and/or distribute this software for any // purpose with or without fee is hereby granted, provided that the above // copyright notice and this permission notice is present in all copies. The // full license for this software is available in the LICENSE file. #pragma once #define HAVE_IRCD_M_VM_FAULT_H namespace ircd::m::vm { enum fault :uint; using fault_t = std::underlying_type<fault>::type; string_view reflect(const fault &); http::code http_code(const fault &); } /// Evaluation faults. These are reasons which evaluation has halted but may /// continue after the user defaults the fault. They are basically types of /// interrupts and traps, which are supposed to be recoverable. Only the /// GENERAL protection fault (#gp) is an abort and is not supposed to be /// recoverable. The fault codes have the form of bitflags so they can be /// used in masks; outside of that case only one fault is dealt with at /// a time so they can be switched as they appear in the enum. /// enum ircd::m::vm::fault :uint { ACCEPT = 0x0000, ///< No fault. EXISTS = 0x0001, ///< Replaying existing event. (#ex) GENERAL = 0x0002, ///< General protection fault. (#gp) INVALID = 0x0004, ///< Non-conforming event format. (#ud) AUTH = 0x0008, ///< Auth rules violation. (#av) STATE = 0x0010, ///< Required state is missing. (#st) EVENT = 0x0020, ///< Eval requires addl events in the ef register. (#ef) BOUNCE = 0x0040, ///< The event is not needed at this time. (#bo) DONOTWANT = 0x0080, ///< The event will never be needed (cache this). (#dw) DENIED = 0x0100, ///< Access of evaluator insufficient. (#ad) IDENT = 0x0200, ///< Identity of evaluator missing. (#id) };
d852d859b20278cab16211783355b696ae6ffbcc
a9fd3023ecc012bdd1e731344b88a650ac69d71e
/baekjoon/2473.cpp
37dd54b2ec7921d159df2e11d7bd8adbee2bc311
[]
no_license
didrlgus/algorithm-practice
7e549a2285584c46f6000fb9deb1a69e0484916f
819434cb7cb78afbf4d4c220c5280b447b9e2912
refs/heads/master
2021-12-09T16:57:30.576819
2021-11-08T14:36:41
2021-11-08T14:36:41
229,232,659
5
2
null
null
null
null
UTF-8
C++
false
false
675
cpp
2473.cpp
// 세 용액 #include<bits/stdc++.h> using namespace std; typedef long long ll; const ll INF=1e10; int n,first,lo,hi,second,third; ll arr[5010],ret=INF; int main() { scanf("%d",&n); for(int i=0;i<n;i++) scanf("%lld",&arr[i]); sort(arr,arr+n); for(int i=0;i<n;i++) { lo=i+1,hi=n-1; while(lo<hi) { ll sum=arr[i]+arr[lo]+arr[hi]; if(abs(sum)<ret) { ret=abs(sum); first=i; second=lo; third=hi; } if(sum<0) lo++; else hi--; } } printf("%lld %lld %lld\n",arr[first],arr[second],arr[third]); return 0; }
b156a36e2d3711c6a7537db6f6eec143876cad7a
d8ae2f3cc0c16b52dbb440f70e961cd342f188b1
/codeforces/Practice/A. Cupboards.cpp
3d24a313fa6729158f72735fa29ce0c64a9fc6bc
[]
no_license
syntaxhacker/competitive-programming
2de89d7245ad0de7d4f9fc23d1f2fb58869c3ce2
6781a7015427db100bc07da9327552bd8ea69120
refs/heads/master
2020-06-21T02:16:34.601671
2019-10-20T19:33:31
2019-10-20T19:33:31
197,320,561
0
0
null
null
null
null
UTF-8
C++
false
false
164
cpp
A. Cupboards.cpp
#include<iostream> using namespace std; int main(){ int n,a=0,b=0,c,d; cin>>n; for(int i=0;i<n;i++){ cin>>c>>d;a+=c;b+=d;} cout<<min(a,n-a)+ min(b,n-b); return 0; }
3bfbac8ad4d1bbd0dc1b7dcbe6101afb3e58235b
5965b5bfb8a89ef066159c227facd965292edb98
/Other Projects/Noises Generators/noise generator - cpp/Noise/main.cpp
9d6278131a0186d056f9bc7fc825604f1d2b7773
[]
no_license
shichangsheng/LEI-RealTime_PhotoRealistic_Clouds
765b09a149c977fa8e188ef81413c147b735846d
1ec25827095407cd9c0e2f18eff1fc02ba4c24c7
refs/heads/master
2022-01-15T23:11:49.383823
2018-07-02T11:02:39
2018-07-02T11:02:39
null
0
0
null
null
null
null
UTF-8
C++
false
false
839
cpp
main.cpp
#include "stdafx.h" #pragma once #include <stdio.h> /* printf, scanf, NULL */ #include <stdlib.h> /* malloc, free, rand */ #include <iostream> #include "ReadTGA.h" #include "Noise.h" using namespace std; int main() { char* filename[] = { "noiseerosion.tga", "noiseerosionpacked.tga", "noiseshape.tga", "noiseshapepacked.tga" }; struct ReadTGA::TGAFILE* tga_file = (struct ReadTGA::TGAFILE*) malloc(sizeof(struct ReadTGA::TGAFILE)); ReadTGA::LoadTGAFile(filename[1], tga_file); std::cout << filename[1] << ": " << std::endl; std::cout << " altura " << tga_file->imageHeight << std::endl; std::cout << " largura " << tga_file->imageWidth << std::endl; //vector<ReadTGA::Pixel> p = tga_file->pixels; ////Noise::Create_vtk(p); std::cout << "fim \n"; free(tga_file); Noise::lerFicheiro("vtk_values"); return 0; }
791bb152c00cde2b17603ea4b09431c0cc2b5d61
53f3bb9b851a33b669322a946506b0db6f6ca0e4
/IntrotoOpenGL/src/Application2.h
4f43712d695994d781c42dc67b63083754255cd7
[]
no_license
Richard-Murray/IntrotoOpenGL
5f39bd2a8c4fb6ddc431ab13571451416559899f
0bf17ab6bfb9abfbb16b6ec33bb8c1b54676b0ff
refs/heads/master
2020-05-30T11:54:31.183756
2015-06-11T12:07:26
2015-06-11T12:07:26
33,277,250
0
0
null
null
null
null
UTF-8
C++
false
false
1,112
h
Application2.h
#ifndef APPLICATION2_H #define APPLICATION2_H #include "gl_core_4_4.h" #include <GLFW/glfw3.h> #include <glm/glm.hpp> #include <glm/ext.hpp> #include "MeshArray.h" #include "tiny_obj_loader.h" class MeshArray; class FlyCamera; struct OpenGLInfo; class Application2 { public: Application2(); ~Application2(); int Run(); void CreateSimpleShader(); void CreateTextureShader(); void CreateSimpleObjShader(); void Load(); void Update(float deltaTime); void Draw(); private: void GenerateGrid(unsigned int rows, unsigned int cols); void GenerateCube(); void GenerateSimpleTexturePlane(); void createOpenGLBuffers(std::vector<tinyobj::shape_t>& shapes); unsigned int m_VAO; unsigned int m_VBO; unsigned int m_IBO; unsigned int m_programID; unsigned int m_textureProgramID; unsigned int m_simpleObjProgramID; unsigned int m_texture; MeshArray* m_meshArray; FlyCamera* m_camera; GLFWwindow* m_window; std::vector<OpenGLInfo> m_gl_info; }; //struct OpenGLInfo //{ // unsigned int m_VAO; // unsigned int m_VBO; // unsigned int m_IBO; // unsigned int m_index_count; //}; #endif
d8b07d5f9898e3e5e88b2199079fcb82af8d9973
9eb6447e31c29697b11910e704883bcdc649314e
/bpkg/version.hxx.in
22da97370866813abb8d4ee684b5420eb023d131
[ "MIT" ]
permissive
build2/bpkg
fce1aade1f92e4874d628af14d7cf7ac0aa618ec
fbaa48b8ebf22d97bb224444603523ed03b98854
refs/heads/master
2023-08-19T06:56:36.976920
2023-07-31T19:01:32
2023-08-04T10:01:50
135,181,472
21
1
null
null
null
null
UTF-8
C++
false
false
2,579
in
version.hxx.in
// file : bpkg/version.hxx.in -*- C++ -*- // license : MIT; see accompanying LICENSE file #ifndef BPKG_VERSION // Note: using the version macro itself. // The numeric version format is AAAAABBBBBCCCCCDDDE where: // // AAAAA - major version number // BBBBB - minor version number // CCCCC - bugfix version number // DDD - alpha / beta (DDD + 500) version number // E - final (0) / snapshot (1) // // When DDDE is not 0, 1 is subtracted from AAAAABBBBBCCCCC. For example: // // Version AAAAABBBBBCCCCCDDDE // // 0.1.0 0000000001000000000 // 0.1.2 0000000001000020000 // 1.2.3 0000100002000030000 // 2.2.0-a.1 0000200001999990010 // 3.0.0-b.2 0000299999999995020 // 2.2.0-a.1.z 0000200001999990011 // #define BPKG_VERSION $bpkg.version.project_number$ULL #define BPKG_VERSION_STR "$bpkg.version.project$" #define BPKG_VERSION_ID "$bpkg.version.project_id$" #define BPKG_VERSION_MAJOR $bpkg.version.major$ #define BPKG_VERSION_MINOR $bpkg.version.minor$ #define BPKG_VERSION_PATCH $bpkg.version.patch$ #define BPKG_PRE_RELEASE $bpkg.version.pre_release$ #define BPKG_SNAPSHOT $bpkg.version.snapshot_sn$ULL #define BPKG_SNAPSHOT_ID "$bpkg.version.snapshot_id$" #include <libbutl/version.hxx> $libbutl.check(LIBBUTL_VERSION, LIBBUTL_SNAPSHOT)$ #include <libbpkg/version.hxx> $libbpkg.check(LIBBPKG_VERSION, LIBBPKG_SNAPSHOT)$ #include <odb/version.hxx> $libodb.check(LIBODB_VERSION, LIBODB_SNAPSHOT)$ #include <odb/sqlite/version.hxx> $libodb_sqlite.check(LIBODB_SQLITE_VERSION, LIBODB_SQLITE_SNAPSHOT)$ // User agent. // #if defined(_WIN32) # if defined(__MINGW32__) # define BPKG_OS "MinGW" # else # define BPKG_OS "Windows" # endif #elif defined(__linux__) # define BPKG_OS "GNU/Linux" #elif defined(__APPLE__) # define BPKG_OS "MacOS" #elif defined(__CYGWIN__) # define BPKG_OS "Cygwin" #elif defined(__FreeBSD__) # define BPKG_OS "FreeBSD" #elif defined(__OpenBSD__) # define BPKG_OS "OpenBSD" #elif defined(__NetBSD__) # define BPKG_OS "NetBSD" #elif defined(__sun) # define BPKG_OS "Solaris" #elif defined(__hpux) # define BPKG_OS "HP-UX" #elif defined(_AIX) # define BPKG_OS "AIX" #elif defined(__unix) # define BPKG_OS "Unix" #elif defined(__posix) # define BPKG_OS "Posix" #else # define BPKG_OS "Other" #endif #define BPKG_USER_AGENT \ "bpkg/" BPKG_VERSION_ID " (" BPKG_OS "; +https://build2.org)" \ " libbpkg/" LIBBPKG_VERSION_ID \ " libbutl/" LIBBUTL_VERSION_ID #endif // BPKG_VERSION
b8a585a173ed3310f121f8ff6c72ae256b1fc35f
76a98f9e84e8934f639caf44dd30487160147a28
/string.cpp
de3125f897f82518ee7e72e5f866c4994e9640c8
[]
no_license
kfirbendic/hw9
0dc54023c898bd146fbd0680149105bb8f7e2004
07d5a2c13f6a020a43b607ba0492788f4759989b
refs/heads/main
2023-02-27T04:31:11.593990
2021-01-30T01:25:42
2021-01-30T01:25:42
334,270,867
0
0
null
null
null
null
UTF-8
C++
false
false
4,766
cpp
string.cpp
#include <cstring> #include "string.h" #include <iostream> #include "ip.h" using namespace std; #define NUMBER_OF_BYTES 4 #define NUMBER_OF_BITS_EACH_DIVIDE 8 #define NUMBER_OF_ALL_IP_BITS 32 String::String (){ data = NULL; length = 0; } String::String (const char* str) { if (str == NULL) { data = NULL; length = 0; return; } length = strlen(str); data = new char[length + 1]; data = strncpy (data , str , length); } String::String (const String &str) { length = str.length; // if the length is zero we don't have data if (length == 0 ) { data = NULL; return; } else { data = new char[length + 1]; data = strncpy (data , str.data , str.length); } } String::~String(){ if (data != NULL){ delete[] data; } } String& String::operator=(const String &rhs){ if (this == &rhs){ return *this; } if (data != NULL){ delete[] data; } length = rhs.length; // if the length is zero we don't have data if (length == 0){ data = NULL; return *this; } else { data = new char[length + 1]; data = strncpy (data , rhs.data , rhs.length); } return *this; } String& String::operator=(const char *str){ if (str == NULL){ data = NULL; length = 0; } if (data != NULL){ delete[] data; } length = strlen(str); data = new char[length + 1]; data = strncpy (data , str , length); return *this; } bool String::equals(const String &rhs) const { if ((length == rhs.length) && (strcmp(data , rhs.data) == 0)) { return true; } return false; } bool String::equals(const char *rhs) const{ if ((length == strlen(rhs)) && (strcmp(data , rhs) ==0 )){ return true; } return false; } void String::split(const char *delimiters, String **output, size_t *size) const { int new_length = 0; char new_data[length + 1] = {0}; strncpy(new_data, data, length); int num_of_delimiter = 0; if (delimiters == NULL) { *size = 1; } else{ new_length = strlen(delimiters); new_data[length] = '\0'; for (size_t i = 0; i < length; i++) { for (int j = 0; j < new_length; j++) { if (new_data[i] == delimiters[j]) { num_of_delimiter++; continue; } } } *size = (num_of_delimiter + 1); } if (output != NULL) { *output = new String[*size]; for (int i = 0; i < (int)length; i++) { for (int j = 0; j < new_length; j++) { if (new_data[i] == delimiters[j]) { new_data[i] = '\0'; } } } int string_num = 0; int string_ctr = 0; int counter = 0; for (counter = 0; counter < (int)(*size); counter++) { for(;(counter == 0) && (new_data[string_num] == '\0') && (string_num < (int)length + 1);){ string_num++; string_ctr++; } for (;(counter == 0) && (new_data[string_num] == '\0') && (string_num < (int)length + 1);) { string_num++; string_ctr++; } for (;(new_data[string_num] != '\0') && (string_num < (int)length + 1);) { string_num++; } (*output)[counter] = String(&new_data[string_ctr]); string_ctr = string_num; for (;((new_data[string_num]) == '\0') && (string_num < (int)length + 1);) { string_num++; string_ctr++; } } } } String String::trim() const { int num_of_spaces_begin = 0 ; int num_of_spaces_end = length - 1; if (data == NULL) { return String(); } while (data[num_of_spaces_begin] == ' ') { num_of_spaces_begin++; } while( (data[num_of_spaces_end] == ' ') && (num_of_spaces_begin != num_of_spaces_end) ) { num_of_spaces_end--; } num_of_spaces_end++; if (num_of_spaces_begin >= num_of_spaces_end) { return String(); } char newData[num_of_spaces_end - num_of_spaces_begin + 1]; strncpy(newData, &data[num_of_spaces_begin], num_of_spaces_end - num_of_spaces_begin); newData[num_of_spaces_end - num_of_spaces_begin] = '\0'; return String(newData); } int String::to_integer() const{ int new_integer = 0; unsigned number_of_IP_bytes = NUMBER_OF_BYTES; size_t size_of_divided_data = 0; String* divided_data = NULL; int part_of_integer = 0; //If "divided_data" is set to NULL, do not allocated memory, only compute "size". split("." , &divided_data , &size_of_divided_data); if (size_of_divided_data != number_of_IP_bytes){ new_integer = atoi(data); delete [] divided_data; return new_integer; } else { // we want to make the new integer from the IP for (int i = 0; i < NUMBER_OF_BYTES; i++){ part_of_integer = divided_data[i].trim().to_integer(); if (part_of_integer >=0 && part_of_integer <= 255){ int num_of_bytes_to_shift = NUMBER_OF_ALL_IP_BITS - (i + 1)*NUMBER_OF_BITS_EACH_DIVIDE; part_of_integer = part_of_integer << num_of_bytes_to_shift; new_integer = new_integer | part_of_integer; } else { delete [] divided_data; return 0; } } delete [] divided_data; return new_integer; } }
710dd6b98dbf9b10bb081ea7b6299cde99d6c8a2
fb66ea499ebae3422b205a3bf4191910c180b24d
/src/Desk.cpp
73def910e779be97c6eef3b32c155aa87b4346d7
[]
no_license
dkarakas/BlackJack
b8d1fbea57ec4724ff5f57700a2663daab831c95
6981c984c1c2b3f951aa576104fbaf3d42a9de15
refs/heads/master
2021-04-23T03:14:20.802944
2020-03-25T05:46:17
2020-03-25T05:46:17
249,893,204
0
0
null
null
null
null
UTF-8
C++
false
false
47
cpp
Desk.cpp
#include "Desk.h" Desk::Desk() { //ctor }
d8645d2bc3823590d176803c5902f851cd1fbc5f
9847f632e55a230768eb6dbed04358b15c77ba79
/atom.cpp
b94021ccebbf7c937901af07815f9f69f0ba5167
[ "BSD-3-Clause" ]
permissive
q10/fiddle
17f02cf8941f9674637b51cc57bcf719594610c3
1222302ab6e1fb543ac04f68a41c5d21958903fe
refs/heads/master
2021-01-23T03:48:55.451767
2011-07-28T03:50:10
2011-07-28T03:50:10
1,476,478
0
1
null
null
null
null
UTF-8
C++
false
false
1,896
cpp
atom.cpp
#include "common.h" ostream & operator<<(ostream & out, Atom atom) { return out << "<Atom " << atom.name << ">"; } ostream & operator<<(ostream & out, Atom * atom) { return out << "<Atom " << atom->name << ">"; } Atom::Atom(int tmp_id, string & tmp_name, double * tmp_coords, string & tmp_element) { id = tmp_id; name = tmp_name; element = tmp_element; residue = NULL; coords = new double[3]; for (int i = 0; i < 3; i++) coords[i] = tmp_coords[i]; } Atom::~Atom() { delete [] coords; } void Atom::set_coords(double * new_coords) { for (int i = 0; i < 3; i++) coords[i] = new_coords[i]; return; } double Atom::distance_from(Atom * other_atom) { double * other_coords = other_atom->coords; double dx = coords[0] - other_coords[0]; double dy = coords[1] - other_coords[1]; double dz = coords[2] - other_coords[2]; return sqrt(dx * dx + dy * dy + dz * dz); } Chain * Atom::chain() { return residue->chain; } void test_atom() { string s = "CA", t = "C"; double * coords = new double [3]; coords[0] = 1.34; coords[1] = 2.0; coords[2] = 3.2; Atom atom(1, s, coords, t); // bad way of making new classes, b/c not in heap, so data can be overwritten (see cout atom.coords[0]) Atom * btom = new Atom(1, s, coords, t); // correct/safe way of creating new objects cout << btom << " " << atom << endl; cout << atom.id << " " << btom->id << endl; cout << atom.coords[0] << ", " << atom.coords[1] << ", " << atom.coords[2] << endl; cout << btom->coords[0] << ", " << btom->coords[1] << ", " << btom->coords[2] << endl; return; } Atom * sample_atom() { string name = "CA", element = "C"; double * coords = new double [3]; coords[0] = 1.34; coords[1] = 2.0; coords[2] = 3.2; Atom * atom = new Atom(1, name, coords, element); return atom; }
e3df79f718630ad7237c19f3c3d9941b43e5633f
242e399bc0a308a84580306b09b0a43ee6504988
/GameComponents/ScriptComponent/ScriptGraphic/LuaGraphicModel.h
3ec4847529185b3fd5e413c3938790bafe6fd16b
[]
no_license
randydom/Caesar-Game-Engine-2
499de5f6d0d0b35ad738af2511c2c80a3f625400
ea297697dcf09a47ac5d6e5ebb1bb1e32c03f089
refs/heads/master
2020-04-24T22:52:22.975241
2015-05-09T17:58:53
2015-05-09T17:58:53
null
0
0
null
null
null
null
UTF-8
C++
false
false
510
h
LuaGraphicModel.h
#ifndef __GraphicModel__ #define __GraphicModel__ #include "Linker.h" #include <lua.hpp> #include <luabind\luabind.hpp> #include <GenericLuaObject.h> #include <LuaModel.h> namespace LuaGraphicModel { class ScriptGraphicDLL_API GraphicModel : public GenericLuaObject { public: GraphicModel(const LuaModel::Model& model); GraphicModel(const GenericLuaObject& v); void Release(); static void Register(lua_State *lua); }; void RegisterAllLuaFunction(lua_State *lua); } #endif //__GraphicModel__
f116c52adec2cd12185e571350d02741ed79aea1
532e70076f9dbb5f70cdb1474e57a6d00f101abf
/11728 - Alternate Task.cpp
821c642dd67f5b333c86bdc96e643003fed06b73
[]
no_license
SakhawatCoU/Code
9e0f46b76fd2cd626fc5aeb08046dad50a4ddc37
da8384fcf2d779101acc2b6d34d8f47b6bafc8de
refs/heads/master
2020-04-05T03:21:26.190649
2016-06-28T19:49:15
2016-06-28T19:49:15
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,656
cpp
11728 - Alternate Task.cpp
#include <cstdio> #include <sstream> #include <cstdlib> #include <cctype> #include <cmath> #include <algorithm> #include <set> #include <queue> #include <stack> #include <list> #include <iostream> #include <fstream> #include <numeric> #include <string> #include <vector> #include <cstring> #include <map> #include <iterator> #include <climits> using namespace std; bool primes[1020]; int num[1020]; void set_num(); int main() { int a , cas = 0 ; set_num(); while(scanf("%d",&a) != EOF && a) { if(a==1) { printf("Case %d: 1\n",++cas); continue; } if(primes[a-1]) { printf("Case %d: %d\n",++cas,a-1); continue; } if(num[a]) { printf("Case %d: %d\n",++cas,num[a]); continue; } printf("Case %d: -1\n",++cas); } return 0 ; } void set_num() { num[1] = 1 ; int sum , l , x ; bool check ; for(int i=0 ; i<=1010 ; i++) { primes[i] = true; num[i] = 0 ; } primes[1] = false; primes[0] = false; for(int i = 4 ; i<=1010 ; i++) { x = sqrt(i); sum=0 ; check = false; for(int j =1 ; j<=x ; j++) { if(i%j == 0) { check = true; l = i/j ; if(l == j) { sum += l ; continue; } sum = sum + j + l ; } } if(check) primes[i] = false; if(sum<=1010) num[sum] = i ; } }
94d9a5019164a82724eeaf5260117ef15ba0e450
9600857c28c417a1e847d4f8aec9da9b8f2d8eb3
/MetaheuristicsCPP/BinaryKnapsackSelections.h
6eb8757d25337e54a3b878bd663dfd5b275b85b0
[ "MIT" ]
permissive
kommar/metaheuristics-lab
3b86c62df3a0728a0544e9e1ff630a020882e9be
6fce305b1f347eae44ac615a474d96b497264141
refs/heads/main
2023-06-03T21:24:26.436973
2021-06-25T06:44:30
2021-06-25T06:44:30
380,146,617
0
0
null
null
null
null
UTF-8
C++
false
false
1,558
h
BinaryKnapsackSelections.h
#pragma once #include "BinaryKnapsackSelection.h" #include "Individual.h" #include <numeric> #include <random> #include <vector> using namespace Optimizers; using namespace std; namespace Selections { class CBinaryKnapsackTournamentSelection : public CBinaryKnapsackSelection { public: CBinaryKnapsackTournamentSelection(int iTournamentSize, mt19937 &cRandomEngine); protected: virtual void v_add_to_new_population(vector<CBinaryKnapsackIndividual*> &vPopulation, vector<CBinaryKnapsackIndividual*> &vNewPopulation); private: CBinaryKnapsackIndividual *pc_get_tournament_winner(vector<CBinaryKnapsackIndividual*> &vPopulation, vector<size_t> &vIndexes); int i_tournament_size; };//class CTournamentSelection : public CSelection<TElement> class CBinaryKnapsackRouletteWheelSelection : public CBinaryKnapsackSelection { public: CBinaryKnapsackRouletteWheelSelection(mt19937 &cRandomEngine); protected: virtual void v_add_to_new_population(vector<CBinaryKnapsackIndividual*> &vPopulation, vector<CBinaryKnapsackIndividual*> &vNewPopulation); private: static double d_calculate_fitness_sum(vector<CBinaryKnapsackIndividual*> &vPopulation); static void v_fill_cumulative_probabilities(vector<CBinaryKnapsackIndividual*> &vPopulation, vector<double> &vCumulativeProbabilites); CBinaryKnapsackIndividual *pc_single_roulette_wheel(vector<CBinaryKnapsackIndividual*> &vPopulation, vector<double> &vCumulativeProbabilites); };//class CRouletteWheelSelection : public CSelection<TElement> }//namespace Selections#pragma once
58194c87a3c264c228ca53e070624604414e5736
0d86675d6f69836db9a7cd5244ebc7307d7f997a
/open_spiel/higc/utils.cc
860b0e49f5d98f3c7c255b0f1c82b68706fb46be
[ "LicenseRef-scancode-generic-cla", "Apache-2.0" ]
permissive
sarahperrin/open_spiel
a7a4ecde1156b458d144989d3d7ef1814577741b
6f3551fd990053cf2287b380fb9ad0b2a2607c18
refs/heads/master
2021-12-25T04:12:19.270095
2021-12-09T16:17:43
2021-12-09T16:17:43
235,547,820
3
0
Apache-2.0
2020-01-22T10:17:41
2020-01-22T10:17:40
null
UTF-8
C++
false
false
1,121
cc
utils.cc
// Copyright 2019 DeepMind Technologies Ltd. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include "open_spiel/higc/utils.h" #include <thread> // NOLINT (Used only externally.) namespace open_spiel { namespace higc { void sleep_ms(int ms) { std::this_thread::sleep_for(std::chrono::milliseconds(ms)); } int time_elapsed( const std::chrono::time_point<std::chrono::system_clock>& start) { return std::chrono::duration_cast<std::chrono::milliseconds>( std::chrono::system_clock::now() - start) .count(); } } // namespace higc } // namespace open_spiel
d5747be9d9dc316a58ee1ec5e9ae8b0e085d8d02
f79ed1ac9a1e3458527ff7bb11f5c148f0a671aa
/code/core/Assets/TextureManager.hpp
38664a7b5df61cc2af7b127da476ddc50c5ba3b3
[]
no_license
qikcik/LD44-youNeedBelievers
029062dc25b135b45081bd1891a31065027caf89
9de0262f57252cbc5ca0fa8248c0f0762c00b6b7
refs/heads/master
2020-05-26T03:14:58.390649
2019-05-22T18:10:14
2019-05-22T18:10:14
188,088,209
0
0
null
null
null
null
UTF-8
C++
false
false
492
hpp
TextureManager.hpp
#pragma once #include <SFML/Graphics.hpp> #include <map> #include <string> #define TexturePrefix "data/graphics/" #define TextureSubfix ".png" class TextureManager { public: TextureManager(); ~TextureManager(); sf::Texture* load(std::string name); sf::Texture* get(std::string name); void unload(std::string name); void unloadAll(); private: std::map <std::string , sf::Texture*> textures; };
bb89551de4a5866fcbb5e0d7b4bc0bfa9c77a6e6
ab65c9c44b21d427471e73676066c56d2d465363
/firmware/hybris/battery.cpp
3f2112781c3ab627bfc455b28e0547bd68ec4673
[ "MIT" ]
permissive
boykhocnhe/hybris
9c3b15673289ed092a61b3f0b7b99457de1a40ff
988c8a0be16184a5fe34de9a45f6b8d51be8c2dd
refs/heads/master
2020-07-14T04:20:52.200805
2019-02-21T04:34:48
2019-02-21T04:34:48
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,643
cpp
battery.cpp
#include <Arduino.h> #include <stdint.h> #include "battery.h" #include "bluetooth.h" uint8_t counter = 0; uint8_t raw = 0; uint8_t percent = 0; uint8_t mvToPercent(float mvolts) { uint8_t battery_level; // Adding a constant since the full charge on lipo is 4.2V mvolts = mvolts - 900; if (mvolts >= 3000) { battery_level = 100; } else if (mvolts > 2900) { battery_level = 100 - ((3000 - mvolts) * 58) / 100; } else if (mvolts > 2740) { battery_level = 42 - ((2900 - mvolts) * 24) / 160; } else if (mvolts > 2440) { battery_level = 18 - ((2740 - mvolts) * 12) / 300; } else if (mvolts > 2100) { battery_level = 6 - ((2440 - mvolts) * 6) / 340; } else { battery_level = 0; } return battery_level; } void battery_tick() { if (counter >= 255) { counter = 0; } else { counter++; } } void battery_task() { if(counter == 0) { raw = analogRead(VBAT_PIN); percent = mvToPercent(raw); delay(1); Serial.print("Battery Update: "); Serial.print(raw); Serial.print(" "); Serial.print(mvToPercent(raw)); Serial.print("\r\n"); update_battery(percent); counter++; } } uint8_t battery_get_percentage() { return percent; } void battery_init() { // Set the analog reference to 3.0V (default = 3.6V) analogReference(AR_INTERNAL_3_0); // Set the resolution to 12-bit (0..4095) analogReadResolution(12); // Can be 8, 10, 12 or 14 // pinMode is already set by the framework }
b7c6fb449b5753617d9d6c778853da578212c025
dfd5fa620635c52b58f65cfaa3ca2ce37620de5c
/Builder.h
fe88fef2b081018a5011e348ac1ec758bb11db6a
[]
no_license
Adrian-Rae/ProjectButterFingers
0db4e9b2d0609460933f0ec9d96331fa4a0b964c
48e3d3e3e28a267ecc6068aa2aaa07a6a58dfa26
refs/heads/main
2023-01-11T20:58:05.433268
2020-11-09T12:18:03
2020-11-09T12:18:03
311,403,307
0
0
null
null
null
null
UTF-8
C++
false
false
130
h
Builder.h
#ifndef BUILDER_H #define BUILDER_H class Builder{ public: Builder() {}; virtual bool build(int n, int teams) = 0; }; #endif
18b5df9238c317ae37eade87c442f944fc073518
dae6d556da61e025fbe94feb677c93cc8e374e2f
/morethread/ch6/61.cpp
aa031ba9bdddaa4486f3904a8c9101b0e66f2630
[]
no_license
yaoxiaokui/linux_ever
bb72344a36efeb4fb42d88d06eeeb1a7a43d651d
a654e5fb8d14a2bf7049c16d41c5b13b5bfd9285
refs/heads/master
2020-05-22T04:10:15.091175
2018-01-07T03:09:23
2018-01-07T03:09:23
49,123,522
3
0
null
null
null
null
UTF-8
C++
false
false
1,126
cpp
61.cpp
/************************************************************************* > File Name: 61.cpp > Author: > Mail: > Created Time: 2015年11月14日 星期六 21时41分55秒 ************************************************************************/ #include<iostream> #include <pthread.h> #include <stdlib.h> using namespace std; pthread_mutex_t MyLock; void *thread(void *x) { for (int i = 0; i < 10; i++){ pthread_mutex_lock(&MyLock); cout << pthread_self() << " I am alive in thread 1." << " ** " << i << endl; pthread_mutex_unlock(&MyLock); } } void *thread2(void *x) { for (int i = 0; i < 10; i++){ pthread_mutex_lock(&MyLock); cout << pthread_self() << " I am alive in thread 2." << " ** " << i << endl; pthread_mutex_unlock(&MyLock); } } int main() { pthread_t threadId1; pthread_t threadId2; pthread_mutex_init(&MyLock, NULL); pthread_create(&threadId1, NULL, thread, NULL); pthread_create(&threadId2, NULL, thread2, NULL); pthread_join(threadId1, NULL); pthread_join(threadId2, NULL); return 0; }
0adaea4bf8be1006db393494a1008116ad537329
98c148cd57704ebcd480e2f3acfc1bab4025b985
/EsTool/UITreeView.cpp
1b05523c6191a754d3739eee65defd6516734864
[]
no_license
tomas0716/Square
40c1306603a5b3b56eab1ba3cc3db0409438e50d
f9751f4e6c2f1478c03855115f417cb7a9bf01d3
refs/heads/main
2023-04-13T06:29:57.747244
2021-05-03T04:18:12
2021-05-03T04:18:12
363,809,360
0
0
null
null
null
null
UTF-8
C++
false
false
12,855
cpp
UITreeView.cpp
#include "StdAfx.h" #include "UITreeView.h" UINT CUITreeView::ms_TreeViewIndex = 0; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // CButtonCallback_Empty class CUITreeView::CButtonCallback_Empty : public IGwUIButton_Callback { public: CButtonCallback_Empty(CUITreeView * pUITreeView) : m_pUITreeView(pUITreeView) { } virtual void OnButton_OK(class IGwUIButton* pControl) { m_pUITreeView->OnButtonClick_Empty(); } private: CUITreeView * m_pUITreeView; }; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // CScrollCallback class CUITreeView::CScrollCallback : public IGwUISlider_Callback { public: CScrollCallback(CUITreeView* pUITreeView) :m_pUITreeView(pUITreeView) { } virtual void OnChangeValue(class IGwUISliderBase* pMyControl,bool bFromInput) { m_pUITreeView->UpdateScroll(); } private: CUITreeView * m_pUITreeView; }; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // CUITreeView CUITreeView::CUITreeView(IGwUIDummyCtrl * pDummyCtrl, GwVector2 vPos, GwVector2 vSize) : m_strUniqueName("CUITreeView"), m_pDummyCtrl(pDummyCtrl), m_vPos(vPos), m_vSize(vSize), m_eDragObjectSender(eDragObjectSender_None), m_eDragObjectReceiver(eDragObjectReceiver_None), m_pScroll_V(NULL), m_dwTreeViewItemIndex(0), m_IsDragSendUse(false), m_IsNameChange(false), m_IsDoubleClickTreeOpen(true), m_vMargin(GwVector2(0,0)), m_pTreeViewItem_Selected(NULL) { IGwBillboardTex * pEmptyTex = Gw::GetBillboardMgr()->GetBillboardTex_Null(); IGwUIElement_MultiTex ElemTex; ElemTex.SetSpriteTex( GWUICONTROLSTATE_NORMAL, pEmptyTex ); ElemTex.SetSpriteTex( GWUICONTROLSTATE_MOUSEOVER, pEmptyTex ); ElemTex.SetSpriteTex( GWUICONTROLSTATE_FOCUS, pEmptyTex ); ElemTex.SetSpriteTex( GWUICONTROLSTATE_PRESSED, pEmptyTex ); ElemTex.SetSpriteTex( GWUICONTROLSTATE_DISABLED, pEmptyTex ); IGwUIImageInfo_Tex * pButtonImageInfo = NULL; pButtonImageInfo = Gw::GetUIControlMgr()->CreateImageInfo_Tex( ElemTex ); IGwUIButton * pButton_EmptyBack = Gw::GetUIControlMgr()->CreateUIButton( pButtonImageInfo ); pButtonImageInfo->Release(); pButton_EmptyBack->SetForceCollisSize(vSize); CButtonCallback_Empty * pCallback = new CButtonCallback_Empty(this); pButton_EmptyBack->SetCallback(pCallback); pCallback->Release(); m_pDummyCtrl->AddControl(pButton_EmptyBack); pButton_EmptyBack->Release(); m_pTreeViewItem_Root = new CUITreeViewItem(this); m_pTreeViewItem_Root->SetRoot(); m_pTreeViewItem_Root->SetLocalPos(vPos); m_pDummyCtrl->AddControl(m_pTreeViewItem_Root->GetBaseControl()); m_pDelegate_TreeView = new IDelegate(); m_pDelegate_DragReceive = new IDelegate(); m_TreeViewIndex = ms_TreeViewIndex++; CAppEvent::OnPostUpdate()->AddEventHandler(m_strUniqueName.GetUniqueName(), this , &CUITreeView::PostUpdate); } CUITreeView::~CUITreeView(void) { m_pDummyCtrl->RemoveControl(m_pTreeViewItem_Root->GetBaseControl()); m_pTreeViewItem_Root->Release(); if( m_pScroll_V != NULL ) { m_pDummyCtrl->RemoveControl(m_pScroll_V); m_pScroll_V->Release(); } m_pDelegate_TreeView->Release(); m_pDelegate_DragReceive->Release(); if( CAppEvent::OnPostUpdate() != NULL ) CAppEvent::OnPostUpdate()->ClearEventOUT(m_strUniqueName.GetUniqueName()); m_strUniqueName.DeclareDisposeThisUniqueName(); } void CUITreeView::Update(float fDeltaTime) { if( Gw::GetKeyMapper()->GetWheelRotationCount() != 0 && m_pDummyCtrl->GetMyDialog()->IsDialogActive() == true ) { GwVector vDialogPos = *m_pDummyCtrl->GetWorldPos(); GwVector2 vPos = GwVector2(vDialogPos.x, vDialogPos.y) + m_vPos; POINT Point = *Gw::GetKeyMapper()->GetCursorPos(); if( Point.x >= vPos.x && Point.x <= vPos.x + m_vSize.x && Point.y >= vPos.y && Point.y <= vPos.y + m_vSize.y ) { OnMouseWheelMove(Gw::GetKeyMapper()->GetWheelRotationCount()); } } int nNumChild = m_pTreeViewItem_Root->GetNumChild(); for( int i = 0; i < nNumChild; ++i ) { CUITreeViewItem * pTreeViewItem = dynamic_cast<CUITreeViewItem*>(m_pTreeViewItem_Root->GetChild_byIndex(i)); if( pTreeViewItem != NULL ) { pTreeViewItem->Update(fDeltaTime); } } if( Gw::GetKeyMapper()->IsKeyUp(VK_LBUTTON) == TRUE && CUIDragObject::GetInstance()->IsDraging() == true ) { GwVector vPos; vPos.x = Gw::GetKeyMapper()->GetCursorPos()->x; vPos.y = Gw::GetKeyMapper()->GetCursorPos()->y; GwVector vTreeViewPos = *m_pDummyCtrl->GetWorldPos() + GwVector(m_vPos.x, m_vPos.y, 0); if( vTreeViewPos.x <= vPos.x && vTreeViewPos.y <= vPos.y && vTreeViewPos.x + m_vSize.x >= vPos.x && vTreeViewPos.y + m_vSize.y >= vPos.y ) { if( m_pTreeViewItem_Root->OnCheckDrag(GwVector2(vPos.x, vPos.y)) == false ) { CUIDragItemBase * pSrcDragItem = CUIDragObject::GetInstance()->GetDragItemBase(); (*m_pDelegate_DragReceive)(pSrcDragItem, NULL, pSrcDragItem->GetDragObjectSender()); IDelegate * pDelegate_Send = pSrcDragItem->GetDelegate_Drag(eDelegate_Drag_Send); (*pDelegate_Send)(pSrcDragItem, NULL, m_eDragObjectReceiver); } } } } void CUITreeView::PostUpdate(const EventArg_ElapsedTime& Arg) { } void CUITreeView::SetAttribute(eDragObjectSender eDragSender, eDragObjectReceiver eDragReceiver, bool IsDragSendUse, bool IsNameChanged, GwVector2 vMargin) { m_eDragObjectSender = eDragSender; m_eDragObjectReceiver = eDragReceiver; m_IsDragSendUse = IsDragSendUse; m_IsNameChange = IsNameChanged; m_vMargin = vMargin; } void CUITreeView::SetAttribute_TreeViewItem(int nItemHeightInterval, int nFontSize, const char * pszFontName, GwFontWeightType eWeightType, GwColor fontColor, GwColor selColor, const char * pszEmpty, const char * pszPlus, const char * pszMinus, const char * pszSelect, const char * pszEdit) { m_nItemHeightInterval = nItemHeightInterval; m_nFontSize = nFontSize; m_strFontName = pszFontName; m_eWeightType = eWeightType; m_FontColor = fontColor; m_SelFondColor = selColor; m_strEmptyButtonFileName = pszEmpty; m_strPlusFileName = pszPlus; m_strMinusFileName = pszMinus; m_strSelectFileName = pszSelect; m_strEditboxFileName = pszEdit; } void CUITreeView::SetAttribute_Scroll(GwVector2 vPos, const char* pszTrack, const char* pszThumb, const char* pszPrev, const char* pszNext, int nThumbSensitive) { m_pScroll_V = CUIHelper::CreateUIScroll_V(pszTrack, pszThumb, pszPrev, pszNext); m_pScroll_V->SetLocalPos(vPos); CScrollCallback* pCallback = new CScrollCallback(this); m_pScroll_V->SetCallback(pCallback); pCallback->Release(); m_pDummyCtrl->AddControl(m_pScroll_V); m_nThumbSensitive = nThumbSensitive; } UINT CUITreeView::GetTreeViewIndex() { return m_TreeViewIndex; } CUITreeViewItem * CUITreeView::AddItem(CUITreeViewItem * pTreeViewItem, const char * pszItemName, IGwRefObject * pParameta) { if( pTreeViewItem == NULL ) pTreeViewItem = m_pTreeViewItem_Root; CUITreeViewItem * pNewTreeViewItem = new CUITreeViewItem(this, ++m_dwTreeViewItemIndex, m_eDragObjectSender, m_eDragObjectReceiver, m_IsDragSendUse, m_IsNameChange, m_IsDoubleClickTreeOpen, m_vSize.x, m_nItemHeightInterval, m_nFontSize, m_strFontName.c_str(), m_eWeightType, m_FontColor, m_SelFondColor, pszItemName, m_strEmptyButtonFileName.c_str(), m_strPlusFileName.c_str(), m_strMinusFileName.c_str(), m_strSelectFileName.c_str(), m_strEditboxFileName.c_str(), pParameta); pTreeViewItem->AddChild(pNewTreeViewItem); pNewTreeViewItem->Release(); if( pTreeViewItem == m_pTreeViewItem_Root ) pNewTreeViewItem->SetVisible(true); OnSort(); UpdateItemPos(); UpdateScroll(); return pNewTreeViewItem; } void CUITreeView::Remove(CUITreeViewItem * pTreeViewItem) { CUITreeViewItem * pParent = dynamic_cast<CUITreeViewItem*>(pTreeViewItem->GetParent()); if( pParent == NULL ) pParent = m_pTreeViewItem_Root; if( pParent != NULL ) { pParent->RemoveChild(pTreeViewItem); if( pParent->GetNumChild() == 0 ) { pParent->SetChildOpenFlag(false); } } OnSort(); UpdateItemPos(); UpdateScroll(); } void CUITreeView::RemoveAll() { int nNumChild = m_pTreeViewItem_Root->GetNumChild(); for( int i = nNumChild - 1; i >= 0; --i ) { CUITreeViewItem * pTreeViewItem = dynamic_cast<CUITreeViewItem*>(m_pTreeViewItem_Root->GetChild_byIndex(i)); if( pTreeViewItem != NULL ) { m_pTreeViewItem_Root->RemoveChild(pTreeViewItem); } } OnSort(); UpdateItemPos(); UpdateScroll(); } CUITreeViewItem * CUITreeView::FindTreeViewItem_byParameta(IGwRefObject * pParameta) { if( pParameta == NULL ) return NULL; return FindTreeViewItem_byParameta(m_pTreeViewItem_Root, pParameta); } CUITreeViewItem * CUITreeView::FindTreeViewItem_byItemName(CUITreeViewItem * pTreeViewItem, string strItemName) { if( pTreeViewItem == NULL ) pTreeViewItem = m_pTreeViewItem_Root; return pTreeViewItem->FindTreeViewItem_byItemName(strItemName); } CUITreeViewItem * CUITreeView::FindTreeViewItem_byParameta(CUITreeViewItem * pTreeViewItem, IGwRefObject * pParameta) { if( pTreeViewItem->GetParameta() == pParameta ) { return pTreeViewItem; } int nNumChild = pTreeViewItem->GetNumChild(); for( int i = 0; i < nNumChild; ++i ) { CUITreeViewItem * pChildTreeViewItem = dynamic_cast<CUITreeViewItem*>(pTreeViewItem->GetChild_byIndex(i)); if( pChildTreeViewItem ) { CUITreeViewItem * pFindTreeViewItem = FindTreeViewItem_byParameta(pChildTreeViewItem, pParameta); if( pFindTreeViewItem != NULL ) { return pFindTreeViewItem; } } } return NULL; } void CUITreeView::UpdateItemPos() { GwVector2 vPos = m_vMargin; int nNumChild = m_pTreeViewItem_Root->GetNumChild(); for( int i = 0; i < nNumChild; ++i ) { CUITreeViewItem * pTreeViewItem = dynamic_cast<CUITreeViewItem*>(m_pTreeViewItem_Root->GetChild_byIndex(i)); if( pTreeViewItem != NULL ) { pTreeViewItem->SetLocalPos(vPos); float fHeight = pTreeViewItem->GetHeight_IncludeChild(); vPos.y += fHeight; } } m_nTotalItemHeight = vPos.y; m_nTotalItemHeight += 100; } void CUITreeView::UpdateScroll() { int nThumbSensitive = (m_nFontSize + m_nItemHeightInterval * 2) * m_nThumbSensitive; int nFirst = CUIHelper::CalcFirstItemIndexScroll_V(m_pScroll_V, m_nTotalItemHeight, nThumbSensitive, m_vSize.y); m_pTreeViewItem_Root->SetLocalPos(m_vPos + GwVector2(0,-nFirst)); Gw::GetUIControlMgr()->UpdateDialog(0); GwVector vDialogPos = *m_pDummyCtrl->GetWorldPos(); m_pTreeViewItem_Root->UpdateVisible(m_vPos + m_vMargin + GwVector2(vDialogPos.x, vDialogPos.y), m_vSize - m_vMargin * 2); } void CUITreeView::SetDoubleClickTreeOpen(bool IsOpen) { m_IsDoubleClickTreeOpen = IsOpen; int nNumChild = m_pTreeViewItem_Root->GetNumChild(); for( int i = 0; i < nNumChild; ++i ) { CUITreeViewItem * pTreeViewItem = dynamic_cast<CUITreeViewItem*>(m_pTreeViewItem_Root->GetChild_byIndex(i)); if( pTreeViewItem != NULL ) { pTreeViewItem->SetDoubleClickTreeOpen(m_IsDoubleClickTreeOpen); } } } bool CUITreeView::IsDoubleClickTreeOpen() { return m_IsDoubleClickTreeOpen; } void CUITreeView::SetSelectedItem(CUITreeViewItem * pTreeViewItem) { m_pTreeViewItem_Selected = pTreeViewItem; NotificationArg_TreeView Arg; Arg.m_pTreeView = this; CNotificationCenter::GetInstance()->PostNotification(Notification_TreeViewItem_HideSelImage, &Arg); if( pTreeViewItem != NULL ) pTreeViewItem->SetSelected(); } CUITreeViewItem * CUITreeView::GetSelectedItem() { return m_pTreeViewItem_Selected; } void CUITreeView::OnSort() { m_pTreeViewItem_Root->OnSort(); } void CUITreeView::OnButtonClick_Empty() { (*m_pDelegate_TreeView)(this); } void CUITreeView::OnMouseWheelMove(int iMoveWheelCount) { RECT rc; rc.left = m_pDummyCtrl->GetWorldPos()->x + m_vPos.x; rc.right = m_pDummyCtrl->GetWorldPos()->x + m_vPos.x + m_vSize.x; rc.top = m_pDummyCtrl->GetWorldPos()->y + m_vPos.y; rc.bottom = m_pDummyCtrl->GetWorldPos()->y + m_vPos.y + m_vSize.y; GwVector2 vCurPos; vCurPos.x = Gw::GetKeyMapper()->GetCursorPos()->x; vCurPos.y = Gw::GetKeyMapper()->GetCursorPos()->y; if( rc.left <= vCurPos.x && rc.right >= vCurPos.x && rc.top <= vCurPos.y && rc.bottom >= vCurPos.y ) { float fScrollValue = m_pScroll_V->GetCurrValue(); fScrollValue -= iMoveWheelCount; fScrollValue = Clamp(fScrollValue, 0.f, (float)m_pScroll_V->GetRange_Max()); m_pScroll_V->SetCurrValue(fScrollValue); } } IDelegate * CUITreeView::GetDelegate_TreeView() { return m_pDelegate_TreeView; } IDelegate * CUITreeView::GetDelegate_DragReceive() { return m_pDelegate_DragReceive; } CUITreeViewItem * CUITreeView::GetTreeViewItem_Root() { return m_pTreeViewItem_Root; }
3b78a729cc03046f668f51fce80f78c644770fa8
9b618216408e47caed68a963ea6975126315ee1e
/lab6/z21.cpp
e1add51fa68acf56db113c74151a5a4ff5036dcd
[]
no_license
pkoneva/cpp18march
611cc0cff95e647cfb0a4e718254d0d385f9ded3
ab20c93db16e0970a3a759258caa4e323771c01d
refs/heads/master
2020-03-06T23:33:26.971347
2018-05-22T23:06:13
2018-05-22T23:06:13
127,134,982
0
1
null
null
null
null
UTF-8
C++
false
false
181
cpp
z21.cpp
#include "stdio.h" int main() { int X, i=10, n=21; scanf("%d", &X); while(i<n){ if(X==i){ printf("\n%d+", X); } else{ printf("\n%d", i); } i=i+1; } }
bf092ddf820ff590206748c738555b485d244051
3ea35a9d2a32a11f2c6e0fa21860f73c042ca1b3
/I курс/Trim 1/vuvedenie v komp nauki/vkn_t05_zd04.cpp
b02ea50e5a8b44dce3e5693c73ee739669033eff
[]
no_license
angelzbg/Informatika
35be4926c16fb1eb2fd8e9459318c5ea9f5b1fd8
6c9e16087a30253e1a6d5cd9e9346a7cdd4b3e17
refs/heads/master
2021-02-08T14:50:46.438583
2020-03-01T14:18:26
2020-03-01T14:18:26
244,162,465
7
2
null
null
null
null
UTF-8
C++
false
false
746
cpp
vkn_t05_zd04.cpp
/* Програмата създава масив с брой на елементите, избран чрез диалог, въвежда го и извежда всички двойки елементи, разположени симетрично спрямо средата на масива. */ #include <iostream> using namespace std; int main(){ short len; do { cout << "Number of the elements (from 1 to 10): "; cin >> len; } while (len < 1 || 10 < len); int *ar = new int[len]; for (short i = 0; i < len; ++i) { cout << "Element " << i + 1 << ": "; cin >> ar[i]; } for (int L = 0, R = len-1; L <= R; ++L, --R) cout << ar[L] << " <--> " << ar[R] << endl; delete[] ar; system("pause"); return 0; }
d2d72a1395aee88f2ebcec33b169cb6124888c1d
5289b5a61a5c17a4371204214724cf3b8c49b2cf
/server/commands/ShotCommand.hpp
987bf840f77bc560edc5aa3891e2fdf7345371ec
[]
no_license
ishigo974/rtype
7e4daf50ca16f46d67c79c293dbd35d3a7641810
f45397e4240365e83f64479ccd1efcb98898303a
refs/heads/master
2021-01-10T10:23:51.626559
2015-12-27T22:23:33
2015-12-27T22:23:33
51,431,731
0
0
null
null
null
null
UTF-8
C++
false
false
871
hpp
ShotCommand.hpp
#ifndef SHOTCOMMAND_HPP_ # define SHOTCOMMAND_HPP_ # include "EventCommand.hpp" # include "ShotComponent.hpp" # include "GameConfig.hpp" namespace RType { namespace Command { class Shot : public Command::Event { public: Shot(); virtual ~Shot(); public: Shot(Shot const& other); Shot& operator=(Shot const& other); public: virtual void initFromEvent(InGameEvent const& request); virtual Event* clone() const; virtual void execute(); virtual void undo(); virtual std::string getName() const; protected: RType::Shot::Type _type; uint32_t _time; }; } } #endif /* !SHOTCOMMAND_HPP_ */
b4c33cf76d19f223b06b36db7d53f40c98758cc8
b1e6d5fb3a3dda4044ca860d2ccaaed7021b7f36
/data structures/primitive_calculator.cpp
d6cbe94a06c02c1c5df53e5c83ad7d6fb9eb92cb
[]
no_license
adig1999/ds-algo1
4fe02055a93f57a8a7bcb7095fac8ac468d6ce4c
d624295eddee3e95e237f54cddc8311739929ee7
refs/heads/master
2022-12-23T11:50:52.966111
2020-09-24T08:10:18
2020-09-24T08:10:18
298,210,913
0
0
null
null
null
null
UTF-8
C++
false
false
1,994
cpp
primitive_calculator.cpp
#include <iostream> #include <vector> #include <algorithm> using std::vector; int minof2(int a, int b, int t) { if(a<b) return t/2; else return t-1; } int minof(int a, int b, int t) { if(a<b) return t/3; else return t-1; } int min(int a,int b,int c,int t) { if(a<b) { if(a<c) return t/2; else return t-1; } else { if(b<c) return t/3; else return t-1; } } vector <int> optimal_sequence(int n) { std::vector<int> sequence; vector<int>minseq(n+1); minseq[0]=0; minseq[1]=1; int count=0; for(int i=2;i<n+1;i++) { int t=i; if(t%3==0 && t%2==0) { int prev=min(minseq[t/2],minseq[t/3],minseq[t-1],t); minseq[i]=minseq[prev]+1; } else if(t%3==0) { int prev2=minof(minseq[t/3],minseq[t-1],t); minseq[i]=minseq[prev2]+1; } else if(t%2==0) { int prev3=minof2(minseq[t/2],minseq[t-1],t); minseq[i]=minseq[prev3]+1; } else { minseq[i]=minseq[t-1]+1; } } int k=n; int curr; sequence.push_back(k); while(k!=1) { if(k%3==0 && k%2==0) { curr=min(minseq[k/2],minseq[k/3],minseq[k-1],k); } else if(k%3==0) { curr=minof(minseq[k/3],minseq[k-1],k); } else if(k%2==0) { curr=minof2(minseq[k/2],minseq[k-1],k); } else { curr=k-1; } sequence.push_back(curr); k=curr; } reverse(sequence.begin(), sequence.end()); return sequence; } int main() { int n; std::cin >> n; vector<int> sequence = optimal_sequence(n); std::cout << sequence.size() - 1 << std::endl; for (size_t i = 0; i < sequence.size(); ++i) { std::cout << sequence[i] << " "; } }
5a779555f059f031e4b0fbba98f753a5f78b6a7d
cfa66f24a54a71f3279823caf4dc50fe6040d415
/header/Floor.hpp
6cbf2498b7fa9752f05955d245deb4baa63b0f1b
[]
no_license
MehdiChouag/Tronberman
8312face97896988cd0a4c8367bbbda62bf9f0c9
7a646ff304bfd7d651b3168a25d2c38fbc36c9fc
refs/heads/master
2021-01-15T09:36:54.808852
2014-06-25T15:21:33
2014-06-25T15:21:33
null
0
0
null
null
null
null
UTF-8
C++
false
false
714
hpp
Floor.hpp
/* ** Floor.hpp for Floor in /home/apollo/rendu/bestbomberman/header ** ** Made by Antonin Ribeaud ** Login <ribeau_a@epitech.net> ** ** Started on Tue Apr 29 18:53:14 2014 Antonin Ribeaud ** Last update Tue Apr 29 18:53:14 2014 Antonin Ribeaud */ #ifndef _FLOOR_HPP_ # define _FLOOR_HPP_ #include "AObject.hpp" class Floor : public AObject { public: Floor(const float width, const float height, const float speed); ~Floor(); bool initialize(); void update(gdl::Clock const &clock, gdl::Input &input); void draw(gdl::AShader &shader, gdl::Clock const &clock); private: gdl::Geometry _geometry; gdl::Texture _texture; float _speed; float _width; float _height; }; #endif /*!_FLOOR_HPP_*/
6cfd9a3d0348b895a4870d63594a227837481169
db24dd046e389e03c8fe41f9385990534abcb3c0
/lib/steap.h
33ad34dfba869bcb222e139411d87fe330b9f635
[]
no_license
Kohit/DSA
7656fe90ae64094d2d305e0ca24cb4f6ed93d979
f3aaad87622fbd9f0e8d3365552cb2d694dd8fb7
refs/heads/master
2021-01-15T18:50:44.541666
2017-08-22T06:32:37
2017-08-22T06:32:37
33,430,968
0
0
null
null
null
null
UTF-8
C++
false
false
425
h
steap.h
/* * steap.h * * Created on: 2014年11月9日 * Author: kohit */ #include "Stack.h" template< typename T > class Steap{ private: Stack<T> S, P; public: void push( T const & e ){ S.push( e ); P.push( max( e, P.top() ) ); //P.top < e ? P.push( e ), P.top().counter = 1 : P.top().counter++; } T & top(){ return S.top(); } T pop(){ P.pop(); return S.pop(); } T getMax(){ return P.top(); } };
734d08d69d692aed9698218c0104a7813e170d4f
75452de12ec9eea346e3b9c7789ac0abf3eb1d73
/src/lib/fidl_codec/semantic.cc
c30a978835b4ae45b44400ffaad1cff824d587bf
[ "BSD-3-Clause" ]
permissive
oshunter/fuchsia
c9285cc8c14be067b80246e701434bbef4d606d1
2196fc8c176d01969466b97bba3f31ec55f7767b
refs/heads/master
2022-12-22T11:30:15.486382
2020-08-16T03:41:23
2020-08-16T03:41:23
287,920,017
2
2
BSD-3-Clause
2022-12-16T03:30:27
2020-08-16T10:18:30
C++
UTF-8
C++
false
false
8,972
cc
semantic.cc
// Copyright 2020 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "src/lib/fidl_codec/semantic.h" #include <zircon/system/public/zircon/processargs.h> #include <zircon/system/public/zircon/types.h> #include <string> #include "src/lib/fidl_codec/printer.h" #include "src/lib/fidl_codec/wire_object.h" namespace fidl_codec { namespace semantic { void ExpressionStringLiteral::Dump(std::ostream& os) const { os << '\'' << value_ << '\''; } bool ExpressionStringLiteral::Execute(SemanticContext* context, ExpressionValue* result) const { result->set(value_); return true; } void ExpressionRequest::Dump(std::ostream& os) const { os << "request"; } bool ExpressionRequest::Execute(SemanticContext* context, ExpressionValue* result) const { if (context->request() == nullptr) { return false; } result->set(context->request()); return true; } void ExpressionHandle::Dump(std::ostream& os) const { os << "handle"; } bool ExpressionHandle::Execute(SemanticContext* context, ExpressionValue* result) const { result->set(context->handle()); return true; } void ExpressionHandleDescription::Dump(std::ostream& os) const { os << "HandleDescription(" << *type_ << ", " << *path_ << ')'; } bool ExpressionHandleDescription::Execute(SemanticContext* context, ExpressionValue* result) const { ExpressionValue type; ExpressionValue path; if (!type_->Execute(context, &type) || !path_->Execute(context, &path)) { return false; } if (!type.string() || !path.string()) { return false; } result->set(*type.string(), -1, *path.string(), ""); return true; } void ExpressionFieldAccess::Dump(std::ostream& os) const { os << *expression_ << '.' << field_; } bool ExpressionFieldAccess::Execute(SemanticContext* context, ExpressionValue* result) const { ExpressionValue value; if (!expression_->Execute(context, &value)) { return false; } if (value.value() != nullptr) { const StructValue* struct_value = value.value()->AsStructValue(); if (struct_value != nullptr) { const Value* field_value = struct_value->GetFieldValue(field_); if (field_value == nullptr) { return false; } const StringValue* string = field_value->AsStringValue(); if (string == nullptr) { result->set(field_value); } else { result->set(string->string()); } return true; } } return false; } void ExpressionSlash::Dump(std::ostream& os) const { os << *left_ << " / " << *right_; } bool ExpressionSlash::Execute(SemanticContext* context, ExpressionValue* result) const { ExpressionValue left_value; ExpressionValue right_value; if (!left_->Execute(context, &left_value) || !right_->Execute(context, &right_value)) { return false; } const InferredHandleInfo* inferred_handle_info = left_value.inferred_handle_info(); if ((inferred_handle_info == nullptr) && (left_value.handle() != ZX_HANDLE_INVALID)) { inferred_handle_info = context->handle_semantic()->GetInferredHandleInfo(context->pid(), left_value.handle()); } if (inferred_handle_info == nullptr) { return false; } if (right_value.string()) { if (inferred_handle_info->path().empty()) { result->set(inferred_handle_info->type(), inferred_handle_info->fd(), *right_value.string(), inferred_handle_info->attributes()); return true; } if (*right_value.string() == ".") { result->set(inferred_handle_info->type(), inferred_handle_info->fd(), inferred_handle_info->path(), inferred_handle_info->attributes()); return true; } std::string path(*right_value.string()); if (path.find("./") == 0) { path.erase(0, 2); } if (inferred_handle_info->path() == "/") { result->set(inferred_handle_info->type(), inferred_handle_info->fd(), "/" + path, inferred_handle_info->attributes()); return true; } result->set(inferred_handle_info->type(), inferred_handle_info->fd(), inferred_handle_info->path() + "/" + path, inferred_handle_info->attributes()); return true; } return false; } void ExpressionColon::Dump(std::ostream& os) const { os << *left_ << " : " << *right_; } bool ExpressionColon::Execute(SemanticContext* context, ExpressionValue* result) const { ExpressionValue left_value; ExpressionValue right_value; if (!left_->Execute(context, &left_value) || !right_->Execute(context, &right_value)) { return false; } const InferredHandleInfo* inferred_handle_info = left_value.inferred_handle_info(); if ((inferred_handle_info == nullptr) && (left_value.handle() != ZX_HANDLE_INVALID)) { inferred_handle_info = context->handle_semantic()->GetInferredHandleInfo(context->pid(), left_value.handle()); } if (inferred_handle_info == nullptr) { return false; } if (right_value.string()) { if (inferred_handle_info->attributes().empty()) { result->set(inferred_handle_info->type(), inferred_handle_info->fd(), inferred_handle_info->path(), *right_value.string()); return true; } result->set(inferred_handle_info->type(), inferred_handle_info->fd(), inferred_handle_info->path(), inferred_handle_info->attributes() + ", " + std::string(*right_value.string())); return true; } return false; } void Assignment::Dump(std::ostream& os) const { os << *destination_ << " = " << *source_ << '\n'; } void Assignment::Execute(SemanticContext* context) const { ExpressionValue destination_value; ExpressionValue source_value; if (!destination_->Execute(context, &destination_value) || !source_->Execute(context, &source_value)) { return; } if (destination_value.value() == nullptr) { return; } auto handle_value = destination_value.value()->AsHandleValue(); if (handle_value == nullptr) { return; } zx_handle_t destination_handle = handle_value->handle().handle; if (destination_handle == ZX_HANDLE_INVALID) { return; } // Currently we only work on requests. If we also work on response, this would need to be // modified. switch (context->type()) { case ContextType::kRead: break; case ContextType::kWrite: case ContextType::kCall: destination_handle = context->handle_semantic()->GetLinkedHandle(context->pid(), destination_handle); if (destination_handle == ZX_HANDLE_INVALID) { return; } break; } const InferredHandleInfo* inferred_handle_info = source_value.inferred_handle_info(); if ((inferred_handle_info == nullptr) && (source_value.handle() != ZX_HANDLE_INVALID)) { inferred_handle_info = context->handle_semantic()->GetInferredHandleInfo(context->pid(), source_value.handle()); } context->handle_semantic()->CreateHandleInfo(context->tid(), destination_handle); context->handle_semantic()->AddInferredHandleInfo(context->pid(), destination_handle, inferred_handle_info); } void MethodSemantic::Dump(std::ostream& os) const { for (const auto& assignment : assignments_) { assignment->Dump(os); } } void MethodSemantic::ExecuteAssignments(SemanticContext* context) const { for (const auto& assignment : assignments_) { assignment->Execute(context); } } std::string_view InferredHandleInfo::Convert(uint32_t type) { switch (type) { case PA_PROC_SELF: return "proc-self"; case PA_THREAD_SELF: return "thread-self"; case PA_JOB_DEFAULT: return "job-default"; case PA_VMAR_ROOT: return "vmar-root"; case PA_VMAR_LOADED: return "initial-program-image-vmar"; case PA_LDSVC_LOADER: return "ldsvc-loader"; case PA_VMO_VDSO: return "vdso-vmo"; case PA_VMO_STACK: return "stack-vmo"; case PA_VMO_EXECUTABLE: return "executable-vmo"; case PA_VMO_BOOTDATA: return "bootdata-vmo"; case PA_VMO_BOOTFS: return "bootfs-vmo"; case PA_VMO_KERNEL_FILE: return "kernel-file-vmo"; case PA_NS_DIR: return "dir"; case PA_FD: return "fd"; case PA_DIRECTORY_REQUEST: return "directory-request"; case PA_RESOURCE: return "resource"; case PA_USER0: return "user0"; case PA_USER1: return "user1"; case PA_USER2: return "user2"; default: return ""; } } void InferredHandleInfo::Display(PrettyPrinter& printer) const { if (!type_.empty()) { printer << Green << type_ << ResetColor; if (fd_ != -1) { printer << ':' << Blue << fd_ << ResetColor; } if (!path_.empty()) { printer << ':' << Blue << path_ << ResetColor; } if (!attributes_.empty()) { printer << " [" << Blue << attributes_ << ResetColor << ']'; } } } } // namespace semantic } // namespace fidl_codec
9c65a3c42ea91377b5395623953dca60306c97fc
00418d6d9c19abbd9cc4482e3c7232fddcce78f0
/src/util/IntegrateDimension.cpp
57e7d3eea4a9f7bf11e7f367948c26e1d99bef91
[ "BSD-2-Clause" ]
permissive
ClimateGlobalChange/tempestextremes
79f6bcf390a7e568cbfdd5a4786f33f144313bcc
24397efa6456db2d634a41bb08fe071b7d6ad037
refs/heads/master
2023-08-18T07:32:18.301687
2023-08-14T16:45:30
2023-08-14T16:45:30
24,765,749
65
22
null
2022-05-11T05:33:11
2014-10-03T16:36:59
HTML
UTF-8
C++
false
false
30,661
cpp
IntegrateDimension.cpp
/////////////////////////////////////////////////////////////////////////////// /// /// \file IntegrateDimension.cpp /// \author Paul Ullrich /// \version December 26th, 2020 /// /// <remarks> /// Copyright 2020 Paul Ullrich /// /// This file is distributed as part of the Tempest source code package. /// Permission is granted to use, copy, modify and distribute this /// source code and its documentation under the terms of the GNU General /// Public License. This software is provided "as is" without express /// or implied warranty. /// </remarks> #include "CommandLine.h" #include "Exception.h" #include "Announce.h" #include "Constants.h" #include "STLStringHelper.h" #include "NetCDFUtilities.h" #include "DataArray1D.h" #include "DataArray2D.h" #include "NcFileVector.h" #include "MathExpression.h" #include "netcdfcpp.h" #include <vector> #include <set> #include <map> #if defined(TEMPEST_MPIOMP) #include <mpi.h> #endif /////////////////////////////////////////////////////////////////////////////// template <typename T> class FieldUnion { public: /// <summary> /// Type stored in this FieldUnion. /// </summary> enum class Type { Unknown, Scalar, Vector, BoundsVector, Field2D, Field3D }; public: /// <summary> /// Default constructor. /// </summary> FieldUnion() : type(Type::Unknown), fieldvar(NULL) { } public: /// <summary> /// Type being stored. /// </summary> Type type; /// <summary> /// Scalar value. /// </summary> T scalar; /// <summary> /// Vector levels. /// </summary> DataArray1D<T> vector; /// <summary> /// Interfacial bounds. /// </summary> DataArray2D<T> bounds; /// <summary> /// Field. /// </summary> NcVar * fieldvar; /// <summary> /// Field data. /// </summary> DataArray1D<T> fielddata; }; /////////////////////////////////////////////////////////////////////////////// int main(int argc, char** argv) { #if defined(TEMPEST_MPIOMP) // Initialize MPI MPI_Init(&argc, &argv); #endif // Turn off fatal errors in NetCDF NcError error(NcError::silent_nonfatal); // Enable output only on rank zero AnnounceOnlyOutputOnRankZero(); try { #if defined(TEMPEST_MPIOMP) int nMPISize; MPI_Comm_size(MPI_COMM_WORLD, &nMPISize); if (nMPISize > 1) { _EXCEPTIONT("At present IntegrateDimension only supports serial execution."); } #endif // Input data file std::string strInputFiles; // Output data file std::string strOutputFile; // Variable to integrate std::string strVarName; // Names for output variables after integration std::string strVarOutName; // Variables to preserve std::string strPreserveVarName; // Dimension along which to perform integration std::string strDimName; // Variable name for surface pressure std::string strPSVariableName; // Variable name for reference pressure std::string strHybridExpr; // Type of hybrid coordinate std::string strHybridCoordType; // Interpolation level std::string strInterpolateLev; // Parse the command line BeginCommandLine() CommandLineString(strInputFiles, "in_data", ""); CommandLineString(strOutputFile, "out_data", ""); CommandLineString(strVarName, "var", ""); CommandLineString(strVarOutName, "varout", ""); CommandLineString(strPreserveVarName, "preserve", ""); CommandLineString(strDimName, "dim", "lev"); CommandLineString(strHybridExpr, "hybridexpr", "a*p0+b*ps"); CommandLineStringD(strHybridCoordType, "hybridtype", "p", "[p|z]"); CommandLineString(strInterpolateLev, "interplev", ""); ParseCommandLine(argc, argv); EndCommandLine(argv) AnnounceBanner(); // Validate arguments if (strInputFiles.length() == 0) { _EXCEPTIONT("No input data file(s) (--in_data) specified"); } if (strOutputFile.length() == 0) { _EXCEPTIONT("No output data file (--out_data) specified"); } if (strVarName.length() == 0) { _EXCEPTIONT("No variables (--var) specified"); } if (strDimName.length() == 0) { _EXCEPTIONT("No dimension name (--dim) specified"); } if ((strHybridCoordType != "p") && (strHybridCoordType != "z")) { _EXCEPTIONT("Hybrid coordinate type (--hytype) must be either \"p\" or \"z\""); } // Parse input file list (--in_data) NcFileVector vecInputFileList; vecInputFileList.ParseFromString(strInputFiles); _ASSERT(vecInputFileList.size() != 0); // Parse variable list (--var) std::vector<std::string> vecVariableStrings; STLStringHelper::ParseVariableList(strVarName, vecVariableStrings); // Parse output variable list (--outvar) std::vector<std::string> vecOutputVariableStrings; if (strVarOutName.length() == 0) { vecOutputVariableStrings = vecVariableStrings; } else { STLStringHelper::ParseVariableList(strVarOutName, vecOutputVariableStrings); if (vecVariableStrings.size() != vecOutputVariableStrings.size()) { _EXCEPTION2("Inconsistent number of variables in --var (%lu) and --varout (%lu)", vecVariableStrings.size(), vecOutputVariableStrings.size()); } } // Parse preserve list (--preserve) std::vector<std::string> vecPreserveVariableStrings; vecPreserveVariableStrings.push_back("time"); vecPreserveVariableStrings.push_back("lon"); vecPreserveVariableStrings.push_back("lat"); STLStringHelper::ParseVariableList(strPreserveVarName, vecPreserveVariableStrings); // Parse variable list (--interplev) std::vector<std::string> vecInterpLevelsStr; STLStringHelper::ParseVariableList(strInterpolateLev, vecInterpLevelsStr); std::vector<double> vecInterpLevels(vecInterpLevelsStr.size()); for (int i = 0; i < vecInterpLevelsStr.size(); i++) { if (!STLStringHelper::IsFloat(vecInterpLevelsStr[i])) { _EXCEPTION1("Invalid value in --interplev \"%s\", expected float", vecInterpLevelsStr[i].c_str()); } vecInterpLevels[i] = std::stod(vecInterpLevelsStr[i]); } // Parse the hybrid expression enum class HybridExprType { ValuePlusDoubleProduct, DoubleProductPlusDoubleProduct, }; MathExpression exprHybridExpr(strHybridExpr); // Begin processing AnnounceStartBlock("Initializing output file"); // Open the output file NcFile ncoutfile(strOutputFile.c_str(), NcFile::Replace); if (!ncoutfile.is_valid()) { _EXCEPTION1("Unable to open NetCDF file \"%s\"", strOutputFile.c_str()); } AnnounceEndBlock("Done"); // Copy preserve variables if (vecPreserveVariableStrings.size() != 0) { AnnounceStartBlock("Preserving variables"); for (int v = 0; v < vecPreserveVariableStrings.size(); v++) { Announce("Variable %s", vecPreserveVariableStrings[v].c_str()); NcVar * var; size_t sFileIx = vecInputFileList.FindContainingVariable(vecPreserveVariableStrings[v], &var); if (var == NULL) { _EXCEPTION1("Unable to find variable \"%s\" in specified files", vecPreserveVariableStrings[v].c_str()); } NcFile * ncinfile = vecInputFileList[sFileIx]; _ASSERT(ncinfile != NULL); CopyNcVarIfExists( (*ncinfile), ncoutfile, vecPreserveVariableStrings[v]); } AnnounceEndBlock("Done"); } // Build another array that stores the values of the hybrid coordinate array AnnounceStartBlock("Loading vertical coordinate variables"); std::vector< FieldUnion<double> > vecExprContents(exprHybridExpr.size()); for(size_t t = 0; t < exprHybridExpr.size(); t++) { const MathExpression::Token & token = exprHybridExpr[t]; if (token.type == MathExpression::Token::Type::Variable) { NcVar * var; // Search for possible variables containing model level or interface information std::vector<std::string> strCoordVariableNames; if (vecInterpLevels.size() != 0) { strCoordVariableNames.push_back(token.str); strCoordVariableNames.push_back(std::string("hy") + token.str + "m"); } else { strCoordVariableNames.push_back(token.str); strCoordVariableNames.push_back(token.str + "_bnds"); strCoordVariableNames.push_back(std::string("hy") + token.str + "i"); } size_t sFileIx = NcFileVector::InvalidIndex; for (int i = 0; i < strCoordVariableNames.size(); i++) { sFileIx = vecInputFileList.FindContainingVariable(strCoordVariableNames[i], &var); // Interfacial variables need to be of the form $_bnds or hy$i if ((vecInterpLevels.size() == 0) && (i == 0)) { if (sFileIx != NcFileVector::InvalidIndex) { if (var->num_dims() == 1) { sFileIx = NcFileVector::InvalidIndex; } if ((var->num_dims() == 2) && (var->get_dim(1)->size() == 2)) { sFileIx = NcFileVector::InvalidIndex; } } } if (sFileIx != NcFileVector::InvalidIndex) { break; } } if (sFileIx == NcFileVector::InvalidIndex) { std::string strConcat = STLStringHelper::ConcatenateStringVector(strCoordVariableNames, ","); _EXCEPTION1("Cannot file variables \"%s\" in input files (or missing corresponding interfacial variables)", strConcat.c_str()); } _ASSERT(var != NULL); // Constants if (var->num_dims() == 0) { Announce("%s (constant)", var->name()); double dValue; var->get(&dValue, 1); vecExprContents[t].type = FieldUnion<double>::Type::Scalar; vecExprContents[t].scalar = dValue; // Vertical vector values (single array) } else if ((var->num_dims() == 1) && (vecInterpLevels.size() != 0)) { Announce("%s (1D vector)", var->name()); long lDimSize = var->get_dim(0)->size(); vecExprContents[t].type = FieldUnion<double>::Type::Vector; vecExprContents[t].vector.Allocate(lDimSize); var->get(&(vecExprContents[t].vector[0]), lDimSize); // Vertical coordinate values (single array) } else if ((var->num_dims() == 1) && (vecInterpLevels.size() == 0)) { Announce("%s (1D bounds)", var->name()); long lDimSize = var->get_dim(0)->size(); if (lDimSize < 2) { _EXCEPTION2("Variable \"%s\" dimension \"%s\" must have size >= 2", var->name(), var->get_dim(0)->name()); } vecExprContents[t].type = FieldUnion<double>::Type::BoundsVector; vecExprContents[t].bounds.Allocate(lDimSize-1, 2); DataArray1D<double> data(lDimSize); var->get(&(data[0]), lDimSize); for (long l = 0; l < lDimSize-1; l++) { vecExprContents[t].bounds(l,0) = data(l); vecExprContents[t].bounds(l,1) = data(l+1); } // Vertical coordinate values (bounds) } else if ((var->num_dims() == 2) && (var->get_dim(1)->size() == 2)) { if (vecInterpLevels.size() != 0) { _EXCEPTION1("2D bounds array variables \"%s\" can only be specified for vertical integration operations", var->name()); } Announce("%s (2D bounds)", var->name()); long lDimSize = var->get_dim(0)->size(); if (lDimSize < 1) { _EXCEPTION2("Variable \"%s\" dimension \"%s\" must have size >= 1", var->name(), var->get_dim(0)->name()); } vecExprContents[t].type = FieldUnion<double>::Type::BoundsVector; vecExprContents[t].bounds.Allocate(lDimSize, 2); var->get(&(vecExprContents[t].bounds(0,0)), lDimSize, 2); // Vertical coordinate values (bounds) in reverse order (why?) } else if ((var->num_dims() == 2) && (var->get_dim(0)->size() == 2)) { if (vecInterpLevels.size() != 0) { _EXCEPTION1("2D bounds array variables \"%s\" can only be specified for vertical integration operations", var->name()); } Announce("%s (2D bounds)", var->name()); Announce("WARNING: \"bnds\" dimension appears first. This may indicate something is incorrect with your vertical level array ordering"); long lDimSize = var->get_dim(1)->size(); if (lDimSize < 1) { _EXCEPTION2("Variable \"%s\" dimension \"%s\" must have size >= 1", var->name(), var->get_dim(0)->name()); } vecExprContents[t].type = FieldUnion<double>::Type::BoundsVector; vecExprContents[t].bounds.Allocate(lDimSize, 2); DataArray2D<double> dBounds(lDimSize, 2); var->get(&(dBounds(0,0)), 2, lDimSize); for (int i = 0; i < lDimSize; i++) { vecExprContents[t].bounds(i,0) = dBounds(i,0); vecExprContents[t].bounds(i,1) = dBounds(i,1); } // Fields } else { bool f3DField = false; for (int d = 0; d < var->num_dims(); d++) { if (strDimName == std::string(var->get_dim(d)->name())) { f3DField = true; } } if (f3DField) { Announce("%s (3D field)", token.str.c_str()); vecExprContents[t].type = FieldUnion<double>::Type::Field3D; } else { Announce("%s (2D field)", token.str.c_str()); vecExprContents[t].type = FieldUnion<double>::Type::Field2D; } vecExprContents[t].fieldvar = var; } } } AnnounceEndBlock("Done"); // Begin processing AnnounceStartBlock("Processing"); _ASSERT(vecVariableStrings.size() == vecOutputVariableStrings.size()); for (int v = 0; v < vecVariableStrings.size(); v++) { if (vecVariableStrings[v] == vecOutputVariableStrings[v]) { AnnounceStartBlock("Variable \"%s\"", vecVariableStrings[v].c_str()); } else { AnnounceStartBlock("Variable \"%s\" -> \"%s\"", vecVariableStrings[v].c_str(), vecOutputVariableStrings[v].c_str()); } // Find the file containing this variable NcVar * varIn; size_t sFileIx = vecInputFileList.FindContainingVariable(vecVariableStrings[v], &varIn); if (varIn == NULL) { _EXCEPTION1("Unable to find variable \"%s\" among input files", vecVariableStrings[v].c_str()); } // Find the integral dimension long lIntegralDimSize = 0; long lIntegralDimIx = (-1); for (long d = 0; d < varIn->num_dims(); d++) { if (strDimName == std::string(varIn->get_dim(d)->name())) { lIntegralDimIx = d; break; } } if (lIntegralDimIx == (-1)) { _EXCEPTION3("Variable \"%s\" in file \"%s\" does not contain dimension \"%s\"", vecVariableStrings[v].c_str(), vecInputFileList.GetFilename(sFileIx).c_str(), strDimName.c_str()); } lIntegralDimSize = varIn->get_dim(lIntegralDimIx)->size(); // Get the number of auxiliary dimensions (dimensions preceding the integral dimension) long lAuxSize = 1; std::vector<long> vecAuxDimSize; if (lIntegralDimIx != 0) { vecAuxDimSize.resize(lIntegralDimIx); for (long d = 0; d < lIntegralDimIx; d++) { vecAuxDimSize[d] = varIn->get_dim(d)->size(); lAuxSize *= vecAuxDimSize[d]; } } // Get the number of grid dimensions (dimensions after the integral dimension) long lGridSize = 1; std::vector<long> vecGridDimSize; if (lIntegralDimIx != varIn->num_dims()-1) { vecGridDimSize.resize(varIn->num_dims() - lIntegralDimIx - 1); for (long d = lIntegralDimIx+1; d < varIn->num_dims(); d++) { vecGridDimSize[d-lIntegralDimIx-1] = varIn->get_dim(d)->size(); lGridSize *= vecGridDimSize[d-lIntegralDimIx-1]; } } // Verify auxiliary dimension count matches field variables _ASSERT(exprHybridExpr.size() == vecExprContents.size()); for (int t = 0; t < vecExprContents.size(); t++) { if (vecExprContents[t].type == FieldUnion<double>::Type::BoundsVector) { if (vecExprContents[t].bounds.GetRows() != lIntegralDimSize) { _EXCEPTION3("Mismatch in vertical bounds for variable \"%s\" (%lu != %lu)", exprHybridExpr[t].str.c_str(), vecExprContents[t].bounds.GetRows(), lIntegralDimSize); } } if (vecExprContents[t].type != FieldUnion<double>::Type::Field2D) { continue; } std::string strF = exprHybridExpr[t].str; NcVar * varF = vecExprContents[t].fieldvar; if (varF->num_dims() != varIn->num_dims()-1) { _EXCEPTION4("Dimension mismatch: Variable \"%s\" has %li dimensions, but \"%s\" has %li dimensions (should be 1 less)", vecVariableStrings[v].c_str(), varIn->num_dims(), strF.c_str(), varF->num_dims()); } for (long d = 0; d < vecAuxDimSize.size(); d++) { if (varF->get_dim(d)->size() != varIn->get_dim(d)->size()) { _EXCEPTION6("Dimension mismatch: Variable \"%s\" dimension %li has size %li, but \"%s\" dimension %li has size %li", vecVariableStrings[v].c_str(), d, varIn->get_dim(d)->size(), strF.c_str(), d, varF->get_dim(d)->size()); } } for (long d = 0; d < vecGridDimSize.size(); d++) { long dPS = d + vecAuxDimSize.size(); long dIn = d + vecAuxDimSize.size() + 1; if (varF->get_dim(dPS)->size() != varIn->get_dim(dIn)->size()) { _EXCEPTION6("Dimension mismatch: Variable \"%s\" dimension %li has size %li, but \"%s\" dimension %li has size %li", vecVariableStrings[v].c_str(), dIn, varIn->get_dim(dIn)->size(), strF.c_str(), dPS, varF->get_dim(dPS)->size()); } } } // Copy dimensions std::vector<NcDim *> vecDimOut; for (long d = 0; d < varIn->num_dims(); d++) { NcDim * dimIn = varIn->get_dim(d); // Integral / interpolated dimension if (d == lIntegralDimIx) { if (vecInterpLevels.size() != 0) { std::string strInterpDimName; if (strHybridCoordType == "p") { strInterpDimName = "plev"; } else if (strHybridCoordType == "z") { strInterpDimName = "zlev"; } else { _EXCEPTION(); } NcDim * dimOut = ncoutfile.get_dim(strInterpDimName.c_str()); if (dimOut == NULL) { dimOut = ncoutfile.add_dim(strInterpDimName.c_str(), vecInterpLevels.size()); if (dimOut == NULL) { _EXCEPTION1("Error creating dimension \"%s\" in output file", strInterpDimName.c_str()); } NcVar * varOut = ncoutfile.add_var(strInterpDimName.c_str(), ncDouble, dimOut); if (varOut == NULL) { _EXCEPTION1("Error creating dimension variable \"%s\" in output file", strInterpDimName.c_str()); } varOut->set_cur((long)0); varOut->put(&(vecInterpLevels[0]), vecInterpLevels.size()); if (strHybridCoordType == "p") { varOut->add_att("axis","Z"); varOut->add_att("standard_name","pressure"); varOut->add_att("long_name","pressure"); } else if (strHybridCoordType == "z") { varOut->add_att("axis","Z"); varOut->add_att("standard_name","altitude"); varOut->add_att("long_name","altitude"); } else { _EXCEPTION(); } } else if (dimOut->size() != vecInterpLevels.size()) { _EXCEPTION3("Dimension \"%s\" already in output has size (%li), but size (%lu) expected", dimIn->name(), dimOut->size(), vecInterpLevels.size()); } vecDimOut.push_back(dimOut); } // Non-integral / non-interpolated dimension } else { NcDim * dimOut = ncoutfile.get_dim(dimIn->name()); if (dimOut != NULL) { if (dimOut->size() != dimIn->size()) { _EXCEPTION3("Dimension \"%s\" has incompatible size in input (%li) and output (%li)", dimIn->name(), dimIn->size(), dimOut->size()); } } else { dimOut = ncoutfile.add_dim(dimIn->name(), dimIn->size()); if (dimOut == NULL) { _EXCEPTION1("Unable to create dimension \"%s\" in output file", dimIn->name()); } } vecDimOut.push_back(dimOut); } } // Create output variable NcVar * varOut = ncoutfile.add_var( vecOutputVariableStrings[v].c_str(), ncFloat, vecDimOut.size(), const_cast<const NcDim**>(&(vecDimOut[0]))); if (varOut == NULL) { _EXCEPTION1("Unable to create variable \"%s\" in output file", varIn->name()); } // Allocate data DataArray1D<double> dDataVar(lGridSize); long lDataOutputSize = lGridSize; if (vecInterpLevels.size() != 0) { lDataOutputSize *= static_cast<long>(vecInterpLevels.size()); } DataArray1D<double> dDataOut(lDataOutputSize); for (int t = 0; t < vecExprContents.size(); t++) { if (vecExprContents[t].type != FieldUnion<double>::Type::Field2D) { continue; } vecExprContents[t].fielddata.Allocate(lGridSize); } // Handle FillValue // TODO: Handle float and double output data double dFillValue = 1.0e20; float flFillValue = 1.0e20f; NcAtt * attFillValueIn = varIn->get_att("_FillValue"); if (attFillValueIn != NULL) { flFillValue = attFillValueIn->as_float(0); dFillValue = static_cast<double>(flFillValue); } NcBool fFillVallueAttSuccess = varOut->add_att("_FillValue", flFillValue); if (!fFillVallueAttSuccess) { _EXCEPTION1("Error creating attribute \"_FillValue\" for variable \"%s\"", varOut->name()); } // Loop through auxiliary dimensions for (long lAux = 0; lAux < lAuxSize; lAux++) { if (vecInterpLevels.size() != 0) { for (long lGrid = 0; lGrid < dDataOut.GetRows(); lGrid++) { dDataOut[lGrid] = dFillValue; } } else { dDataOut.Zero(); } // Get the data index std::vector<long> lPos(varIn->num_dims(), 0); std::vector<long> lSize(varIn->num_dims(), 1); long lAuxTemp = lAux; for (long d = vecAuxDimSize.size()-1; d >= 0; d--) { lPos[d] = lAuxTemp % vecAuxDimSize[d]; lAuxTemp /= vecAuxDimSize[d]; } for (long d = 0; d < vecGridDimSize.size(); d++) { lSize[lIntegralDimIx+d+1] = vecGridDimSize[d]; } if (lAuxSize != 1) { char szPos[100]; std::string strPos; for (long d = 0; d < vecAuxDimSize.size(); d++) { snprintf(szPos, 100, "%s=%li", varIn->get_dim(d)->name(), lPos[d]); strPos += szPos; if (d != vecAuxDimSize.size()-1) { strPos += ","; } } Announce("Processing %s(%s)", vecVariableStrings[v].c_str(), strPos.c_str()); } // Load 2D field data std::vector<long> lPosF = lPos; std::vector<long> lSizeF = lSize; lPosF.erase(lPosF.begin() + lIntegralDimIx); lSizeF.erase(lSizeF.begin() + lIntegralDimIx); for (int t = 0; t < vecExprContents.size(); t++) { if (vecExprContents[t].type != FieldUnion<double>::Type::Field2D) { continue; } _ASSERT(lPosF.size() == vecExprContents[t].fieldvar->num_dims()); _ASSERT(lSizeF.size() == vecExprContents[t].fieldvar->num_dims()); vecExprContents[t].fieldvar->set_cur(&(lPosF[0])); vecExprContents[t].fieldvar->get(&(vecExprContents[t].fielddata[0]), &(lSizeF[0])); } // Loop through integral / interpolated dimension _ASSERT(lPos.size() > lIntegralDimIx); _ASSERT(varIn->get_dim(lIntegralDimIx)->size() == lIntegralDimSize); // "a*p0+b*ps" style hybrid expression (integration) if ((vecInterpLevels.size() == 0) && (exprHybridExpr.size() == 7) && (vecExprContents[0].type == FieldUnion<double>::Type::BoundsVector) && (exprHybridExpr[1].str == "*") && (vecExprContents[2].type == FieldUnion<double>::Type::Scalar) && (exprHybridExpr[3].str == "+") && (vecExprContents[4].type == FieldUnion<double>::Type::BoundsVector) && (exprHybridExpr[5].str == "*") && (vecExprContents[6].type == FieldUnion<double>::Type::Field2D) ) { double dRefValue = vecExprContents[2].scalar; for (long lLev = 0; lLev < lIntegralDimSize; lLev++) { lPos[lIntegralDimIx] = lLev; varIn->set_cur(&(lPos[0])); varIn->get(&(dDataVar[0]), &(lSize[0])); for (long lGrid = 0; lGrid < lGridSize; lGrid++) { double dPl = vecExprContents[0].bounds(lLev,0) * dRefValue + vecExprContents[4].bounds(lLev,0) * vecExprContents[6].fielddata(lGrid); double dPu = vecExprContents[0].bounds(lLev,1) * dRefValue + vecExprContents[4].bounds(lLev,1) * vecExprContents[6].fielddata(lGrid); dDataOut[lGrid] += fabs(dPu - dPl) * dDataVar[lGrid]; } } // "a*p0+b*ps" style hybrid expression (interpolation) } else if ((vecInterpLevels.size() != 0) && (exprHybridExpr.size() == 7) && (vecExprContents[0].type == FieldUnion<double>::Type::Vector) && (exprHybridExpr[1].str == "*") && (vecExprContents[2].type == FieldUnion<double>::Type::Scalar) && (exprHybridExpr[3].str == "+") && (vecExprContents[4].type == FieldUnion<double>::Type::Vector) && (exprHybridExpr[5].str == "*") && (vecExprContents[6].type == FieldUnion<double>::Type::Field2D) ) { double dRefValue = vecExprContents[2].scalar; _ASSERT(vecExprContents[0].vector.GetRows() == lIntegralDimSize); _ASSERT(vecExprContents[4].vector.GetRows() == lIntegralDimSize); // TODO: Different treatments of level out of range if (lIntegralDimSize == 1) { //lPos[lIntegralDimIx] = 0; //varIn->set_cur(&(lPos[0])); //varIn->get(&(dDataOut[0]), &(lSize[0])); } // Loop through all levels of the input data array for (long lLev = 0; lLev < lIntegralDimSize; lLev++) { bool fDataLoaded = false; // Loop through all grid points for (long lGrid = 0; lGrid < lGridSize; lGrid++) { double dPC = vecExprContents[0].vector(lLev) * dRefValue + vecExprContents[4].vector(lLev) * vecExprContents[6].fielddata(lGrid); double dPP = dPC; if (lLev != 0) { dPP = vecExprContents[0].vector(lLev-1) * dRefValue + vecExprContents[4].vector(lLev-1) * vecExprContents[6].fielddata(lGrid); } double dPN = dPC; if (lLev != lIntegralDimSize-1) { dPN = vecExprContents[0].vector(lLev+1) * dRefValue + vecExprContents[4].vector(lLev+1) * vecExprContents[6].fielddata(lGrid); } // Loop through all interpolated values for (size_t sInterpLev = 0; sInterpLev < vecInterpLevels.size(); sInterpLev++) { double dAlpha = -1.0; double dPi = vecInterpLevels[sInterpLev]; if ((dPC > dPP) && (dPi >= dPP) && (dPi <= dPC)) { dAlpha = (dPi - dPP) / (dPC - dPP); } else if ((dPC < dPP) && (dPi >= dPC) && (dPi <= dPP)) { dAlpha = (dPi - dPP) / (dPC - dPP); } else if ((dPN > dPC) && (dPi >= dPC) && (dPi <= dPN)) { dAlpha = (dPi - dPN) / (dPC - dPN); } else if ((dPN < dPC) && (dPi >= dPN) && (dPi <= dPC)) { dAlpha = (dPi - dPN) / (dPC - dPN); } if ((dAlpha != -1.0) && ((dAlpha < 0.0) || (dAlpha > 1.0))) { _EXCEPTION(); } //if ((lGrid == 0) && (dAlpha != -1.0)) { // printf("%li %1.15f\n", lLev, dAlpha); //} if (dAlpha >= 0.0) { size_t sDataOutIx = sInterpLev * static_cast<size_t>(lGridSize) + static_cast<size_t>(lGrid); if (!fDataLoaded) { lPos[lIntegralDimIx] = lLev; varIn->set_cur(&(lPos[0])); varIn->get(&(dDataVar[0]), &(lSize[0])); fDataLoaded = true; } if (dDataOut[sDataOutIx] == dFillValue) { dDataOut[sDataOutIx] = 0.0; } dDataOut[sDataOutIx] += dAlpha * dDataVar[lGrid]; } } } } // "ap+b*ps" style hybrid expression (integration) } else if ((vecInterpLevels.size() != 0) && (exprHybridExpr.size() == 5) && (vecExprContents[0].type == FieldUnion<double>::Type::BoundsVector) && (exprHybridExpr[1].str == "+") && (vecExprContents[2].type == FieldUnion<double>::Type::BoundsVector) && (exprHybridExpr[3].str == "*") && (vecExprContents[4].type == FieldUnion<double>::Type::Field2D) ) { for (long lLev = 0; lLev < lIntegralDimSize; lLev++) { lPos[lIntegralDimIx] = lLev; varIn->set_cur(&(lPos[0])); varIn->get(&(dDataVar[0]), &(lSize[0])); for (long lGrid = 0; lGrid < lGridSize; lGrid++) { double dPl = vecExprContents[0].bounds(lLev,0) + vecExprContents[2].bounds(lLev,0) * vecExprContents[4].fielddata(lGrid); double dPu = vecExprContents[0].bounds(lLev,1) + vecExprContents[2].bounds(lLev,1) * vecExprContents[4].fielddata(lGrid); //if (lGrid == 0) { // printf("%1.8f %1.8f : %1.8f\n", dPu, dPl, vecExprContents[4].fielddata(lGrid)); //} dDataOut[lGrid] += fabs(dPu - dPl) * dDataVar[lGrid]; } } // "p3" style hybrid expression } else if ((vecInterpLevels.size() != 0) && (exprHybridExpr.size() == 1) && (vecExprContents[0].type == FieldUnion<double>::Type::Field3D) ) { NcVar * varF = vecExprContents[0].fieldvar; if (varF->num_dims() != varIn->num_dims()) { _EXCEPTION4("Dimension count of field variable \"%s\" (%li) must match input variable \"%s\" (%li)", varF->name(), varF->num_dims(), varIn->name(), varIn->num_dims()); } for (long d = 0; d < varIn->num_dims(); d++) { if (d != lIntegralDimIx) { if (varIn->get_dim(d)->size() != varF->get_dim(d)->size()) { _EXCEPTION5("Dimension %i of field variable \"%s\" has size %li, " "which must match input variable \"%s\" size %li", d, varF->name(), varF->get_dim(d)->size(), varIn->name(), varIn->get_dim(d)->size()); } } else { if (varIn->get_dim(d)->size()+1 != varF->get_dim(d)->size()) { _EXCEPTION5("Dimension %i of field variable \"%s\" has size %li, " "which must be one larger than input variable \"%s\" size %li", d, varF->name(), varF->get_dim(d)->size(), varIn->name(), varIn->get_dim(d)->size()); } } } // Storage for 3D field data DataArray1D<double> dFl(lGridSize); DataArray1D<double> dFu(lGridSize); lPos[lIntegralDimIx] = 0; varF->set_cur(&(lPos[0])); varF->get(&(dFl[0]), &(lSize[0])); for (long lLev = 0; lLev < lIntegralDimSize; lLev++) { if (lLev % 2 == 0) { lPos[lIntegralDimIx] = lLev+1; varF->set_cur(&(lPos[0])); varF->get(&(dFu[0]), &(lSize[0])); } else { lPos[lIntegralDimIx] = lLev+1; varF->set_cur(&(lPos[0])); varF->get(&(dFl[0]), &(lSize[0])); } lPos[lIntegralDimIx] = lLev; varIn->set_cur(&(lPos[0])); varIn->get(&(dDataVar[0]), &(lSize[0])); for (long lGrid = 0; lGrid < lGridSize; lGrid++) { dDataOut[lGrid] += fabs(dFu(lGrid) - dFl(lGrid)) * dDataVar[lGrid]; } } // Unknown expression } else { _EXCEPTION1("Unimplemented --hybridexpr \"%s\"", strHybridExpr.c_str()); } // Write output data (integrated) if (vecInterpLevels.size() == 0) { // Rescale by -1/g if (strHybridCoordType == "p") { for (long lGrid = 0; lGrid < lGridSize; lGrid++) { dDataOut[lGrid] *= 1.0 / EarthGravity; } } varOut->set_cur(&(lPosF[0])); varOut->put(&(dDataOut[0]), &(lSizeF[0])); // Write output data (interpolated) } else { std::vector<long> lPosI = lPos; std::vector<long> lSizeI = lSize; lPosI[lIntegralDimIx] = 0; lSizeI[lIntegralDimIx] = vecInterpLevels.size(); varOut->set_cur(&(lPosI[0])); varOut->put(&(dDataOut[0]), &(lSizeI[0])); } } AnnounceEndBlock("Done"); } AnnounceEndBlock("Done"); AnnounceBanner(); } catch(Exception & e) { Announce(e.ToString().c_str()); } #if defined(TEMPEST_MPIOMP) // Deinitialize MPI MPI_Finalize(); #endif } ///////////////////////////////////////////////////////////////////////////////
9e0913c2a4c3664e5750561bcab4179bd89dbec0
9f520bcbde8a70e14d5870fd9a88c0989a8fcd61
/pitzDaily/943/p
db262afcc1ab76150fba04d5780002a3d573bb41
[]
no_license
asAmrita/adjoinShapOptimization
6d47c89fb14d090941da706bd7c39004f515cfea
079cbec87529be37f81cca3ea8b28c50b9ceb8c5
refs/heads/master
2020-08-06T21:32:45.429939
2019-10-06T09:58:20
2019-10-06T09:58:20
213,144,901
1
0
null
null
null
null
UTF-8
C++
false
false
98,019
p
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v1806 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "943"; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField nonuniform List<scalar> 6400 ( 0.142804969153 0.142808305608 0.142817890415 0.142836794933 0.142865270435 0.142903401091 0.142951152817 0.143009595617 0.143080071797 0.143164739895 0.143269845566 0.143398782843 0.143549314403 0.143721382843 0.143916911281 0.144138604096 0.144388515054 0.144666952038 0.144971853705 0.145298057881 0.145640701773 0.146001872272 0.146389353909 0.146811034189 0.147271648212 0.147771137262 0.148306301602 0.1488745989 0.149475466202 0.150109320327 0.15077634118 0.151474459429 0.15219794999 0.152940922528 0.153700420147 0.154474087614 0.155262382484 0.156069860648 0.15689480276 0.157729261105 0.158573365052 0.159436605357 0.160323296504 0.16122556485 0.162132324026 0.163035185156 0.163927590924 0.164804127227 0.16565976379 0.166489947873 0.1672906035 0.168055761786 0.168776190316 0.169441441636 0.170048229806 0.170598248268 0.171086807676 0.17150559033 0.171852600783 0.172133745674 0.172355207222 0.172521327558 0.172638103823 0.172721559201 0.172793295302 0.172869866394 0.172951194151 0.173021308409 0.173071034023 0.173103017966 0.173122418365 0.173133397997 0.173138506998 0.173139271619 0.17313681373 0.173132453467 0.17312710316 0.17312276697 0.173119517945 0.173118069575 0.142800200769 0.142803770636 0.142812562819 0.142831010825 0.142860886087 0.142900380783 0.142948571465 0.143005316641 0.143073805814 0.14315818241 0.143262937475 0.143390951607 0.143541756818 0.14371468015 0.143910305414 0.144130687107 0.14437981211 0.144658809054 0.144964805069 0.145291334353 0.14563219723 0.145991538335 0.14637859921 0.146800458468 0.147261585915 0.14776178109 0.148297339343 0.14886626442 0.149468040363 0.150102628137 0.150769887114 0.151468519303 0.15219293429 0.152936134818 0.15369581264 0.154469864559 0.155258371048 0.156066541503 0.156892782223 0.157728489401 0.158572942059 0.159437264058 0.160326753907 0.161231233841 0.162139357594 0.16304371091 0.163937740048 0.16481616591 0.16567365174 0.16650475443 0.16730534792 0.168071685499 0.168795558539 0.169462745315 0.170071058275 0.170623037151 0.171110541277 0.171527109012 0.171873354386 0.172153305366 0.172372262934 0.172536992957 0.172653617696 0.172737953411 0.17281074715 0.172887583811 0.17296864219 0.17303626653 0.173083064873 0.17311276205 0.173130282987 0.173139688526 0.173143282764 0.173142381199 0.173138543239 0.173133057179 0.173127158456 0.173122156471 0.173118570354 0.173117264448 0.14278664595 0.142792465386 0.142800591507 0.14281763641 0.142846519253 0.142890079124 0.142941718921 0.142996879365 0.143062350034 0.143145023826 0.143248940266 0.143376447189 0.143527552408 0.143701256337 0.143896886374 0.144114119111 0.144360902361 0.14464371786 0.144952254994 0.14527734648 0.145614472942 0.145969490718 0.146355941172 0.146779935914 0.147242082899 0.147742425645 0.148279179729 0.148849831188 0.149453171095 0.150089073275 0.150757269902 0.151457074418 0.152183412192 0.152926711195 0.15368575222 0.154461347759 0.155250698575 0.156059094344 0.156887083012 0.157726255501 0.158576345936 0.15944522772 0.160336010249 0.16124153607 0.162151807286 0.163058872742 0.163956212388 0.164838156413 0.165699279119 0.166534434096 0.167339041804 0.168107633135 0.168831547774 0.16950195523 0.170115988618 0.170669688424 0.171155724872 0.171570541192 0.171914918442 0.172192454324 0.172408780282 0.172570228222 0.172685753763 0.17277295641 0.17285094348 0.172929446477 0.173004589616 0.173065338477 0.17310748098 0.173133316367 0.17314736437 0.173153111985 0.173152776885 0.173148358667 0.173141891471 0.173134441657 0.173127077629 0.173120866761 0.17311670129 0.173115027151 0.142766839708 0.142772896095 0.142780129141 0.142795951895 0.142821547426 0.142865091415 0.142928996086 0.142984465583 0.143045363048 0.143125079241 0.143227572578 0.143354789781 0.143506579459 0.143680417553 0.14387583893 0.144096374048 0.144346381718 0.144626404299 0.144927156539 0.145242472187 0.145576337602 0.14593474514 0.146323656903 0.146748574132 0.14721194177 0.147713764756 0.148252356147 0.148825175581 0.149430772068 0.15006857135 0.150738770044 0.151440256963 0.152168349681 0.152914258311 0.153671963094 0.154446139462 0.155238840907 0.15604898458 0.156877451635 0.157721317978 0.158579192838 0.159454631329 0.16034916728 0.161257561568 0.162171352755 0.16308268374 0.163984836127 0.164871891366 0.165738329613 0.166578907936 0.167388475047 0.168160955797 0.168888642967 0.169564231089 0.170182617408 0.170737858134 0.17122358478 0.171636894534 0.17197874509 0.172252851719 0.172465141627 0.172623766735 0.172741589117 0.172835534423 0.172917230803 0.172991534495 0.173059822301 0.173113067417 0.173147561358 0.173166346458 0.173173657238 0.173172637909 0.173166246541 0.17315708645 0.17314657386 0.173136161768 0.173126685312 0.17311807363 0.173111840251 0.173109173403 0.14273559256 0.142737352905 0.142746205891 0.142762592943 0.142791021796 0.142832438094 0.142891774428 0.14295174595 0.143016172229 0.143096369229 0.143197727467 0.143324857757 0.143477903879 0.143656704892 0.143858715268 0.144079535903 0.144322696921 0.144590523034 0.144881474505 0.145194305257 0.145529491161 0.145889569943 0.146280301307 0.146707032519 0.147172107049 0.147675822227 0.148216499987 0.148792053824 0.149400601746 0.150041382481 0.150713804447 0.151418548768 0.152150245399 0.152895255464 0.153652699828 0.15442685088 0.155219618436 0.156033077444 0.156866302714 0.157716588176 0.158582608427 0.159465674583 0.160365941203 0.16127915486 0.162198108639 0.163115274508 0.164023810018 0.164917589078 0.165790961104 0.166638511918 0.167454696278 0.168233207235 0.168966843867 0.16964854008 0.17027173311 0.170829401332 0.171315545001 0.171727695252 0.172067035805 0.172337750557 0.172547001992 0.172705510244 0.172828001778 0.172927320385 0.173007868697 0.173077681739 0.173138310962 0.173181553934 0.173204790814 0.173212088655 0.173208417531 0.173197829585 0.173183888415 0.173168264647 0.173152388805 0.173137711669 0.173124026614 0.173110703156 0.173101548081 0.17309788868 0.142679516965 0.142680241059 0.142694150555 0.142711496556 0.142743219603 0.142787168005 0.142843313344 0.142904204501 0.142973749286 0.143056417869 0.143156573137 0.143284275938 0.14344566549 0.143632771099 0.143833999186 0.144048789451 0.144282553747 0.144541818139 0.144828025767 0.145138788819 0.145472620057 0.145833313769 0.146226098781 0.146655237264 0.147122632406 0.147628236242 0.148171653347 0.148750231011 0.149362754093 0.150007363247 0.150683939227 0.151390949822 0.152123249218 0.152871663512 0.153627767571 0.154400142629 0.155195459729 0.156014068147 0.156853694748 0.157711679308 0.158586563821 0.159478350359 0.160386191572 0.161306252887 0.162232198816 0.163156891155 0.164073463706 0.164975636847 0.165857623787 0.166713841753 0.167538497829 0.168325168241 0.169066747392 0.169755823527 0.170384775179 0.170946037358 0.171433904397 0.171846247157 0.17218460602 0.172454013084 0.172663170412 0.172824536161 0.172952274105 0.173051786926 0.17312911869 0.173193108159 0.173245018126 0.173275458352 0.173282580731 0.173272380005 0.173252979193 0.173229921735 0.173205711186 0.17318135916 0.173158636654 0.173137759088 0.173117299676 0.173097609121 0.173084671159 0.173078820296 0.142594448417 0.142601385446 0.142623365498 0.142648475035 0.142676917765 0.142721925807 0.142780053516 0.142843816121 0.142917346239 0.143003204398 0.143107633652 0.143239455846 0.143408382304 0.143594723565 0.143791563937 0.143998824766 0.144226676906 0.144483376179 0.144767357882 0.145073608136 0.145405147769 0.145766748072 0.14616143611 0.146592674215 0.14706281182 0.147572242009 0.148117403299 0.148699487831 0.149316840382 0.149968091137 0.15064884723 0.151356766699 0.152090347828 0.15283651358 0.153593389874 0.154367938811 0.155167641778 0.155992532462 0.156839725807 0.157706449416 0.158591063473 0.159492744829 0.160409913874 0.161338840586 0.162273727041 0.163207775522 0.164134163365 0.165046520441 0.165938948326 0.166805725357 0.167640885017 0.168437858361 0.169189344777 0.16988740756 0.170523749268 0.171090667064 0.171582833228 0.171998490073 0.172339528562 0.172611588573 0.172824237114 0.172989977988 0.173119199522 0.17321641039 0.17329316278 0.173350021674 0.173386184734 0.173397032117 0.173381964505 0.173348617256 0.173308396173 0.173268301899 0.173229864469 0.173195225353 0.173164369847 0.173134728184 0.173104560267 0.173077198065 0.173059228444 0.173050491133 0.142493276826 0.14250619477 0.142531155244 0.142566232969 0.142597813192 0.142645252726 0.142702272614 0.142769536929 0.142848118044 0.142932648985 0.143045867653 0.143190440268 0.143358036275 0.143541093317 0.143731718689 0.143932472276 0.14415940098 0.144416327446 0.144695870034 0.144997653857 0.145327422649 0.145689467016 0.146085867321 0.14652015717 0.146993915263 0.14750670546 0.148055920962 0.148639046392 0.149263232641 0.149923385911 0.150606809667 0.151313532269 0.152046360776 0.152792192763 0.153550164666 0.15433029902 0.155136554478 0.155968701825 0.156824330379 0.157700759872 0.15859610321 0.159508948148 0.160437169163 0.161376967509 0.162322827348 0.163268203325 0.164206351367 0.165130866584 0.166035767572 0.166915213027 0.167763081212 0.16857260509 0.169336169569 0.17004539695 0.17069174452 0.17126781729 0.171768844772 0.172193200553 0.172542255193 0.172821087499 0.173038804602 0.173206894504 0.173334663383 0.173430332205 0.173501713951 0.173552201875 0.173566870896 0.173551316274 0.173508334045 0.173444541737 0.173374569732 0.173309255022 0.173253186841 0.173207918061 0.173168371432 0.173127698728 0.17308506033 0.173047872771 0.173023424303 0.17301180057 0.14238105752 0.142397409599 0.142422930553 0.142454210358 0.142493442134 0.142549604473 0.142607844014 0.142677527119 0.14276477922 0.142855374962 0.142967473941 0.143121008987 0.143291732081 0.143469770826 0.143655001356 0.143855735364 0.144082292516 0.144336497119 0.144611931969 0.144911241194 0.145239855872 0.145601661047 0.145998427533 0.146434981618 0.146915899197 0.147431238944 0.147984983092 0.148575505139 0.149202174128 0.149864783201 0.150554203386 0.151266471649 0.151992544744 0.152736372542 0.153500093767 0.154287818293 0.155101954174 0.155942413706 0.156807392308 0.157694498383 0.158601673555 0.159527043191 0.160468044605 0.161420726511 0.162379675947 0.163338508029 0.164290571718 0.165229465789 0.166149137985 0.167043623915 0.16790664315 0.168731219324 0.169509478206 0.17023289133 0.170893224869 0.171483880272 0.172000657379 0.172441025677 0.172803775046 0.173092561081 0.173316025409 0.173486007324 0.173611309159 0.173698927195 0.173754630642 0.17379050043 0.173793381321 0.173748423418 0.173671934057 0.173565486937 0.173447862879 0.173345532725 0.173269938588 0.17321665641 0.173171039484 0.173118108864 0.173058098311 0.173007375466 0.172973616482 0.172958323508 0.142255860177 0.142274288247 0.142303933989 0.142334424469 0.142376940627 0.142433867392 0.142495105782 0.142565623164 0.142654269189 0.14276209687 0.142879946963 0.143034391274 0.14320655067 0.143381762497 0.143562085876 0.143765765429 0.143995537073 0.144245357127 0.144515872967 0.144813099619 0.14514167089 0.145504426001 0.145902032973 0.146338116246 0.146825406389 0.1473491527 0.147901660163 0.148498715677 0.149131081417 0.149798454052 0.150492028677 0.151204216579 0.151931024292 0.152674728034 0.153444013121 0.154240291795 0.155063536851 0.155913451754 0.156788782436 0.157687564736 0.158607736646 0.159547077754 0.1605026314 0.161470239423 0.162444489764 0.16341909329 0.164387488345 0.165343293473 0.166280375838 0.167192623221 0.168073594119 0.168916170517 0.169712434878 0.170454186083 0.171134125873 0.171746883316 0.172288405345 0.172753124108 0.173134948072 0.17343867994 0.173672334603 0.173847257213 0.173967049579 0.174035318284 0.174059938084 0.174056445823 0.174036849749 0.174000258764 0.173891327356 0.17371777869 0.173518402961 0.173362954872 0.173268664831 0.173217737792 0.173177451208 0.173111861502 0.173021440783 0.172949260874 0.172899944811 0.172878701294 0.142112233238 0.142129789303 0.14216221372 0.142198004222 0.142249227454 0.142301689324 0.14236435576 0.1424380033 0.142520127487 0.142637922762 0.142770570808 0.142926478357 0.143099631369 0.143276362397 0.143456679733 0.143661671895 0.143893278733 0.14414067275 0.144407667428 0.144702045989 0.145029955298 0.145395127142 0.145798189908 0.146234983242 0.146719110538 0.147254827442 0.147815961932 0.148413986813 0.149049066078 0.149714100177 0.150414703639 0.151131317121 0.15185868643 0.152606284157 0.15338257663 0.154187874683 0.155021090217 0.155881586978 0.156768372082 0.157679886236 0.158614251982 0.159569064453 0.160541000742 0.161525641703 0.162517518554 0.16351042091 0.164497883642 0.165473530522 0.166431104044 0.167364304648 0.168266554075 0.169130744763 0.169949289273 0.170714888054 0.17142174025 0.172065680932 0.172641907821 0.173140282812 0.173548867056 0.173882470637 0.174138511373 0.174325053332 0.174433837057 0.174466212388 0.174433923005 0.174360283771 0.174276723426 0.174268566684 0.174192735703 0.173925036942 0.173565712989 0.173329856934 0.173226154483 0.173206572865 0.173204228444 0.173125003803 0.172966681517 0.172859490003 0.172784844175 0.172758317886 0.141945929869 0.141960087399 0.141986744618 0.142031793461 0.142093867228 0.14214777609 0.142212534785 0.142293387502 0.142374844133 0.142490331413 0.142634584014 0.142794957181 0.142968739092 0.14314871781 0.143336793997 0.14354528078 0.143776421284 0.144021701749 0.144286925721 0.14457877331 0.144903506097 0.145267492975 0.145680187003 0.146128620632 0.146609086667 0.14714576751 0.147715882052 0.148313975489 0.148958056901 0.149629248879 0.150325375789 0.151041192582 0.151773127343 0.15252997136 0.153315395112 0.154130403967 0.15497438319 0.155846558917 0.156746005514 0.157671411751 0.158621190376 0.159592993549 0.160583203454 0.161587065486 0.162599025497 0.163612995195 0.164622640318 0.165621555323 0.166603273009 0.167561250669 0.16848882675 0.169379170886 0.170225545824 0.171022065118 0.171764301982 0.172447943737 0.173068545487 0.173615323267 0.174063122767 0.174464431017 0.174774353798 0.174986754122 0.175080514082 0.175057020007 0.174933681943 0.174742470151 0.17450907472 0.17458006887 0.174665973534 0.174229396895 0.173539630705 0.173182262328 0.173099981036 0.17318230366 0.173302758536 0.173207273458 0.172862168769 0.172714924462 0.172604221401 0.172588744403 0.141756545358 0.141767888511 0.141785885894 0.141836039645 0.141899888954 0.141962383502 0.142031992272 0.14212099343 0.142210922771 0.142326467901 0.142476301929 0.142640217977 0.142814520802 0.142994217314 0.143192615597 0.143411905678 0.143643665419 0.143887588759 0.144152469466 0.144443510014 0.14476508559 0.145123561162 0.145538272747 0.146007140413 0.146495171791 0.147023248943 0.147604504945 0.148209891609 0.148848786941 0.149524888727 0.150224988785 0.150941907249 0.151678913291 0.152445173412 0.153241288697 0.154067326607 0.154923073106 0.155807978619 0.156721366243 0.157662059434 0.158628606568 0.159618895277 0.160629257863 0.16165461122 0.162689261483 0.163727324795 0.164762697238 0.165788907282 0.166799138074 0.167786510141 0.168744386646 0.169666665263 0.170548118504 0.171384295859 0.172170110887 0.172897198212 0.173573915734 0.174209764174 0.174712752153 0.175357323208 0.175740642197 0.17595867735 0.1759865155 0.175838852943 0.175531417683 0.175101163152 0.174418089561 0.174571278868 0.17474067867 0.174742533413 0.173182879847 0.172679864463 0.172738804069 0.173074486093 0.17359054384 0.173450201614 0.172622199211 0.172493816585 0.172310984509 0.17237030154 0.141545219727 0.141558252804 0.141581454296 0.141621177387 0.141679917631 0.141748266361 0.14182403748 0.141917973842 0.14202117446 0.142140713825 0.142295357595 0.142462724423 0.142639138505 0.142819383547 0.14302195206 0.143251615303 0.1434887532 0.143735491488 0.144002091699 0.144294174457 0.144614971681 0.144968718667 0.145379880779 0.145861674729 0.146366426366 0.146893933299 0.147479308342 0.148094495812 0.148731994106 0.149406932094 0.150105720069 0.150826041903 0.151574268332 0.15235196057 0.153159715245 0.153997942924 0.154866761212 0.155765625231 0.156694086659 0.157651466374 0.158636425988 0.159646882795 0.160679265839 0.161728365479 0.16278841417 0.163853854243 0.164918972606 0.165977197559 0.16702114375 0.168043446836 0.169037672637 0.169999212775 0.170925266207 0.171812022267 0.172648252066 0.173414009616 0.174186016453 0.174999644382 0.175260563394 0.175351707297 0.175542087758 0.175718168356 0.175745506527 0.17561748238 0.175372602626 0.175058156689 0.174731801993 0.174591228267 0.174517856641 0.173903481434 0.173144577233 0.172871053562 0.173040877275 0.173566087921 0.174463392983 0.174725509184 0.171445866467 0.172086209918 0.171798384816 0.172154022283 0.141307132343 0.141321946784 0.141355509721 0.141385824412 0.141438401514 0.141508734225 0.141589625041 0.141689889683 0.141808896803 0.141932202579 0.142090760068 0.142262092233 0.142442344545 0.142626567635 0.142832632231 0.143068099061 0.143311228313 0.143563526177 0.143834043349 0.144128593025 0.144450855395 0.144803771195 0.145207648684 0.145689523164 0.146219413154 0.146756996155 0.14733360847 0.147963677522 0.148612059347 0.149276606755 0.149972369906 0.150699692681 0.151458754242 0.152248936107 0.1530698238 0.15392163771 0.154804703107 0.155718966318 0.156664009908 0.157639407065 0.158644368711 0.159676906857 0.160733371031 0.161808486149 0.16289662674 0.163992872983 0.165092201559 0.166187947298 0.16727176455 0.168335422102 0.169373008443 0.170382743175 0.171365561376 0.172315797979 0.173206487452 0.173979505418 0.174664534116 0.174873104697 0.175091626271 0.175286289455 0.175444681545 0.175582418336 0.175602155748 0.175477715647 0.17523569816 0.174914621621 0.174560415217 0.174253865477 0.173977405603 0.173535455756 0.173042584025 0.172729335839 0.172727991637 0.172969458534 0.173236884601 0.172648382519 0.17282194414 0.173111458369 0.17041534606 0.172078164512 0.141037692415 0.141052254387 0.141085558959 0.141118355668 0.141169094622 0.141241577105 0.141325717635 0.141427751165 0.141562026507 0.141697787559 0.141860248475 0.142036570934 0.142222597717 0.142413798515 0.142625259881 0.142864658041 0.14311292611 0.143371716361 0.143647568535 0.143945813651 0.144270539922 0.14462522646 0.145024639975 0.145501074664 0.146048802757 0.146606676844 0.147179097333 0.147805120429 0.148465137289 0.149137431432 0.14983223617 0.150563996996 0.151332968315 0.152136072373 0.152971142169 0.153837726517 0.154736392287 0.155667369127 0.156630575381 0.157625675901 0.158652265789 0.159708815904 0.160791644556 0.161895184549 0.163013980904 0.164144384787 0.165282856651 0.166422557098 0.167553188508 0.168665229084 0.169753847665 0.170821770485 0.171876242146 0.172914751807 0.173907674708 0.174231295293 0.174473845942 0.174726034779 0.1749413615 0.175113328998 0.175229539335 0.175292242539 0.175254298262 0.175093086976 0.174824534557 0.174480353199 0.174097323079 0.173714432675 0.173326820992 0.172875685243 0.172377208859 0.17196910992 0.171779260017 0.171760051146 0.171779032241 0.171634718411 0.171754346397 0.17131292083 0.172262350268 0.173909745669 0.140738703459 0.140752703669 0.140787871372 0.140821960925 0.140874052784 0.140947923948 0.141034963148 0.141135595786 0.141274410334 0.141427777152 0.141599201728 0.141782387978 0.141976274713 0.142178682633 0.142396853727 0.14264052421 0.142894051173 0.143160072274 0.143442241386 0.143745345645 0.144073456463 0.144430555269 0.144828130523 0.145297297539 0.145849180171 0.146436707594 0.147022219564 0.147638652481 0.148296729555 0.148974570716 0.149675946382 0.150416647044 0.151196532577 0.1520128028 0.152862941524 0.153745739734 0.154661306182 0.155610411137 0.156593287254 0.157609871346 0.15865992922 0.159742402338 0.160853980628 0.161988698293 0.163140844638 0.1643084909 0.165490818994 0.166681196783 0.167866536721 0.1690351773 0.170182134724 0.171315295035 0.172451213521 0.17351460956 0.173748966194 0.173999667293 0.174281023968 0.174518421963 0.17470037029 0.174826483422 0.174887261259 0.174873942495 0.174764496984 0.17454504649 0.17422400371 0.173823549268 0.173369750756 0.172886031397 0.172378267838 0.171837410108 0.171263535369 0.170724173031 0.170313449526 0.170036211908 0.169851493191 0.169719270852 0.169839678553 0.170497614951 0.172496064795 0.174859143029 0.140413078335 0.140425541184 0.140456661105 0.140495409527 0.140553636483 0.140629401082 0.140721104369 0.140822286122 0.140962011222 0.141126857231 0.141306779119 0.141496621963 0.141697227863 0.141914511924 0.142143415083 0.142392056398 0.142651872304 0.142926876334 0.143216901435 0.143526211494 0.143858864671 0.144219011338 0.144616574894 0.145080072347 0.14562935536 0.146238028354 0.14684845773 0.147465599244 0.14811674498 0.148794929884 0.149504611222 0.150255527629 0.151047424512 0.151877409384 0.15274368903 0.153644428925 0.154578747801 0.15554744095 0.156551693343 0.15759150311 0.158666950213 0.15977763706 0.160920652478 0.162089496297 0.163277150167 0.164484058547 0.165715879597 0.166966240162 0.168214674999 0.16944942735 0.170661461655 0.17187197389 0.172999787357 0.173279254946 0.173536306922 0.173780944136 0.17402418351 0.174218207241 0.174347063663 0.174405522043 0.174385368764 0.174278050648 0.17407256162 0.173762005405 0.173351697003 0.17285684219 0.172296036208 0.171685747799 0.171034438229 0.170343510604 0.169622409025 0.168880041123 0.168163407657 0.16751740254 0.166943936577 0.166473423789 0.166349140669 0.166976709665 0.169091290143 0.171090328918 0.140064814111 0.140075976492 0.140101416099 0.140145354836 0.140208942496 0.140286453242 0.140382144991 0.140488212631 0.140626499455 0.140798237699 0.140984468248 0.141179782471 0.141384370755 0.141612151811 0.141857675124 0.142114509266 0.142381948936 0.142667392309 0.142968338527 0.143286290273 0.14362551754 0.143989635532 0.144388938958 0.144848988955 0.145390855432 0.146003447484 0.146640635678 0.147275764739 0.147928694319 0.148607971905 0.149321306653 0.150081001219 0.150885129466 0.151728533573 0.152612316045 0.15353275824 0.154487033321 0.155477224453 0.156504833251 0.157570212808 0.158673317797 0.15981416836 0.160990754087 0.162197305052 0.16342727174 0.164681449282 0.165965206011 0.167271691389 0.168589653337 0.169911722399 0.171198914672 0.172412629209 0.172731313521 0.17301299849 0.173270436294 0.173493651155 0.173679278418 0.173805115752 0.173854814902 0.173820566884 0.173695965026 0.173474794262 0.173151082 0.172721798101 0.172190628609 0.171567413011 0.170864355354 0.170092126841 0.169256832213 0.168359769038 0.167405514956 0.166354994042 0.165213527756 0.164021841727 0.162766443058 0.161429864357 0.160070161795 0.158667707669 0.156854712704 0.153513182608 0.139695861898 0.139706888241 0.139730891714 0.139779442667 0.139843749185 0.139920595357 0.140015536561 0.140128096095 0.140264747891 0.140441017016 0.140632687439 0.140833348922 0.141042846683 0.141275697785 0.1415359392 0.141804998807 0.142082495928 0.142378466313 0.142691754247 0.143021691065 0.143371044129 0.143740985381 0.144143682117 0.144603431137 0.145139067392 0.145749032755 0.146401954949 0.147058775826 0.147718434375 0.148401617746 0.1491245558 0.149892108608 0.150706787338 0.151565237908 0.152467552901 0.15340878765 0.154384979367 0.155398563996 0.156451423202 0.157544468508 0.158677901329 0.159852054548 0.16106674205 0.16231867941 0.163598769917 0.164899562873 0.166227067263 0.167587371229 0.168989164603 0.170446912606 0.171767628883 0.172116710984 0.172412692535 0.172694580506 0.172928639746 0.17310400567 0.173215486964 0.173250509401 0.17319680491 0.173047105584 0.172796429873 0.172440509264 0.171975882874 0.171401095049 0.170718208896 0.169932479829 0.169050079639 0.16807534432 0.167008561443 0.165844810989 0.164579055864 0.163137209987 0.161448477416 0.159504010865 0.157226144758 0.154450477854 0.150951517055 0.146453126594 0.140916013093 0.139206197921 0.139303194119 0.139314736691 0.139339866223 0.139393184345 0.139457530953 0.139532762577 0.139624262447 0.139741138237 0.139874260551 0.140053311112 0.140250457337 0.140456633044 0.14067217276 0.140911263538 0.141181648763 0.141463326271 0.141752940528 0.14206032285 0.142385406136 0.142728735232 0.143091946284 0.143470722496 0.143878288998 0.144340502752 0.144872675833 0.145478092453 0.146137516826 0.146811619952 0.14748933341 0.148181694897 0.148913927935 0.149691847846 0.150515701556 0.151385072478 0.152303956617 0.15326890344 0.154270672832 0.155310313858 0.156390307309 0.157512923649 0.158679681809 0.159891739031 0.161152246084 0.162457089 0.163785801685 0.165127600929 0.166497524298 0.167920048032 0.169447724478 0.171098921838 0.171472830696 0.171763215373 0.172057562281 0.172308927228 0.172489967885 0.172591937155 0.172608671248 0.172531736358 0.172353089649 0.172067317651 0.171670760372 0.171160473558 0.170534065909 0.169790078887 0.168928383449 0.167949672261 0.166853770802 0.165637300192 0.164291124391 0.162797469757 0.161125471052 0.159222328237 0.156912783381 0.154046498361 0.150455584081 0.145721048981 0.139009890667 0.128536399048 0.109170302235 0.0627434797099 0.138879201182 0.138891176065 0.138919551166 0.138978295713 0.139043486597 0.139117639369 0.139207795224 0.139326082969 0.139454842401 0.13963403996 0.139836238986 0.140047833158 0.140269449179 0.140514952801 0.140793573302 0.141087319293 0.14139147355 0.141711664151 0.142048247434 0.142404824939 0.142784587625 0.1431762549 0.143589849599 0.144056415241 0.144588943276 0.145190001362 0.145849539711 0.146531282171 0.147231067117 0.147946649514 0.148689187965 0.149473888103 0.150309899838 0.151195236239 0.152126643692 0.153110856313 0.154140067747 0.155208911663 0.156319798809 0.157474769956 0.158677359532 0.159934154024 0.161251264849 0.162612469056 0.163986992617 0.165371510138 0.166797763884 0.168306287106 0.169766625822 0.170906092879 0.171170505978 0.17140565982 0.171650584908 0.17183838929 0.171937846847 0.171940547357 0.171840569388 0.171631930106 0.171309618085 0.170870100168 0.170310809975 0.169629447981 0.168823630107 0.1678907762 0.166827904405 0.165630867339 0.164292783812 0.162801767138 0.161138033818 0.159270159337 0.157149161109 0.154707002782 0.151726273246 0.14789324682 0.142916727213 0.13619347921 0.126491471087 0.111404971355 0.0860673088914 0.0440375512157 0.138413053277 0.138425356772 0.1384568883 0.138521503222 0.138587348992 0.138663965991 0.138754730026 0.138872761531 0.139000563616 0.139180920195 0.139388161346 0.139604949374 0.139832327417 0.140083640272 0.140368751986 0.140672232755 0.140993229986 0.141328670033 0.14167765756 0.142047393685 0.142444538456 0.142854589154 0.143276634203 0.143747293559 0.144283815497 0.144883576373 0.14554232993 0.146227048766 0.146939052859 0.147682398312 0.148450555487 0.149247160594 0.150084988381 0.150982244721 0.151934345388 0.152938101074 0.153992482977 0.155091698623 0.156235657502 0.157426953656 0.158671647581 0.15998393841 0.161364113144 0.162780824706 0.164208549933 0.16566029573 0.167197396381 0.168786335713 0.170070430733 0.170511282938 0.170761150811 0.170976120573 0.171156753202 0.171255835246 0.171250432161 0.171132390611 0.170896809072 0.170539900887 0.170058913683 0.169451841661 0.16871686064 0.167851718739 0.166853258525 0.165717004753 0.164436598478 0.163002793809 0.161401795695 0.159612827687 0.157604750501 0.155331226888 0.152723297258 0.149677070168 0.146039378898 0.141405238825 0.135249970839 0.126992379668 0.115521683387 0.0989514608347 0.0739664880662 0.039530205732 0.137896236866 0.137910797219 0.137943766449 0.138008481105 0.138078662684 0.138163635394 0.138259538547 0.138380846211 0.138515136529 0.138692481583 0.138904004818 0.139125875637 0.139358909289 0.139615659779 0.139906033347 0.140215362604 0.14054974175 0.140904352527 0.141269058591 0.141654135527 0.142067988776 0.142500982199 0.142940517308 0.143413598753 0.143954352987 0.144556453564 0.145216113424 0.145904516269 0.146622530715 0.147385469681 0.148183248226 0.149005438065 0.149854595121 0.150755993576 0.151720011475 0.152745723388 0.153827102109 0.154957971768 0.156136253866 0.157367058487 0.158664822251 0.160043216742 0.161487842958 0.162966670711 0.16447298059 0.166033388873 0.167650134059 0.169005605035 0.169618447709 0.169960897375 0.170245467917 0.170441745534 0.170543163334 0.170537065786 0.170409745721 0.170154505866 0.169768681202 0.169250944643 0.168600462918 0.167816380878 0.166897220945 0.165840278078 0.164641060598 0.16329269953 0.161785162876 0.160104067988 0.158228888249 0.156130357514 0.153766790439 0.151078792301 0.147981421915 0.14435217269 0.140014641879 0.134677431472 0.12774435954 0.118474459418 0.106025224384 0.0890373176199 0.0650682693277 0.0347466113251 0.137334760008 0.137353139989 0.137386321263 0.137444550214 0.137522217333 0.137616194332 0.137720262735 0.137849235418 0.137996421017 0.138170047339 0.138382706268 0.138608750351 0.138847436166 0.139109791708 0.139405740649 0.139721403095 0.140063551351 0.1404354872 0.140819386714 0.141223842411 0.141655096322 0.142111136307 0.142579926622 0.143067641873 0.143607111813 0.144210933635 0.144872185517 0.145565863666 0.146288839687 0.147063218135 0.147883096337 0.148738284127 0.149612901434 0.150523001395 0.151493714316 0.152533142467 0.153638748078 0.154803003293 0.156019163034 0.157297495614 0.158660168576 0.160110667919 0.16162422893 0.163182068456 0.164807664307 0.166457423732 0.167775282092 0.168906311009 0.169155536177 0.169436974718 0.169676758675 0.169801452553 0.169801617464 0.169672905324 0.169407337314 0.169001128741 0.168454068493 0.167766966298 0.16694046939 0.165974428121 0.164867281454 0.163615447664 0.162212718243 0.160649568722 0.158912246882 0.156981469859 0.154830542177 0.152422678977 0.149707235175 0.146614370498 0.143047417273 0.138871890955 0.133899801679 0.127869552531 0.120369775268 0.11066484832 0.0978315569144 0.0808426655011 0.0580276849244 0.0305074806679 0.136746424703 0.136765267309 0.136797190553 0.136847142054 0.136928915741 0.13702683394 0.137136456352 0.137269764425 0.137426656846 0.137605278751 0.137820909784 0.138051256122 0.138295852013 0.138563923431 0.138865768414 0.139189402139 0.139540190053 0.139926407856 0.140329821903 0.140757837893 0.141209708825 0.14168657152 0.142183166633 0.142701883871 0.143257992059 0.143862887783 0.144520052415 0.145217261579 0.145944516224 0.146725807122 0.147560076228 0.148439756943 0.149347657708 0.150280597175 0.151262840133 0.152309977447 0.153429934685 0.154623068086 0.155882357892 0.157219922771 0.158655972623 0.160181735892 0.16177159203 0.163430109139 0.165153616247 0.166627399565 0.167793205364 0.168401975584 0.168645595871 0.16885532557 0.169011565134 0.16903864461 0.168920142409 0.168653991083 0.168237649974 0.167670952425 0.16695603294 0.166095428283 0.165090832441 0.163942378369 0.162648036142 0.161203026103 0.159599205445 0.157824339899 0.155861138338 0.153685905255 0.151266644573 0.148560413039 0.145509655392 0.142037139418 0.138038950772 0.133374823902 0.127854943003 0.121222054092 0.113129091452 0.103104570741 0.0903672323311 0.0739935960357 0.0526943214859 0.027396403478 0.136139227616 0.136156234258 0.136185506396 0.136232622563 0.136309280804 0.136405066814 0.136515950132 0.136648969087 0.136810110801 0.136995596368 0.137216750653 0.137451683068 0.1377022237 0.137975632356 0.138282833032 0.13861421586 0.138973762598 0.139372986415 0.139794167154 0.140244668476 0.14072323173 0.141224274972 0.141748875213 0.142291462455 0.142874478039 0.143504916685 0.144172575473 0.144867591213 0.1455957451 0.146382181667 0.147229109651 0.148123744506 0.149057356727 0.150017908083 0.151019876192 0.152080615687 0.153209759958 0.154422683228 0.155725906513 0.157131051671 0.15864436713 0.160245371033 0.16190553551 0.163591871951 0.165316707356 0.166956637897 0.167388446908 0.167671753077 0.167990009862 0.168177992722 0.168233652335 0.168142155929 0.167890161516 0.167475548207 0.166900274523 0.166167892508 0.165282753465 0.164248729777 0.163068124786 0.161740957509 0.160264407 0.158632279758 0.156834426005 0.154856019916 0.152676596781 0.150268724466 0.147596167348 0.144611373104 0.141252066288 0.137436665319 0.133058156204 0.127975977313 0.122005429399 0.114904143943 0.106355240206 0.0959471066224 0.0831862148489 0.0673797485004 0.0474945111544 0.0243253351201 0.135507168148 0.135526326042 0.135551095993 0.135601286679 0.135669040059 0.135758841008 0.135867284676 0.135997818487 0.136159332942 0.136345562861 0.13657156236 0.136810157729 0.137065172611 0.137343236127 0.137655333848 0.137992521786 0.138358329427 0.138769521448 0.139207189951 0.139675828906 0.140179530177 0.140705819638 0.14126510839 0.141841546096 0.142446014741 0.143103670513 0.143805219107 0.144514829378 0.145243700775 0.146033166219 0.146895125515 0.147808414179 0.148761394064 0.14974496978 0.150765806582 0.151840174349 0.152978820279 0.154206317882 0.155549694922 0.157023988353 0.158614261602 0.160280421929 0.161987860592 0.163714206545 0.165143283585 0.1662467235 0.166852305411 0.167064860144 0.167277785845 0.167386967092 0.167332468762 0.167107832042 0.166709244432 0.166137992595 0.165399488106 0.164500271247 0.163446525117 0.162243015802 0.160892209612 0.159393647318 0.157743468279 0.155933954291 0.153953004328 0.151783458166 0.14940217858 0.146778790877 0.143873966465 0.140637118143 0.137003348694 0.132889461896 0.128188816176 0.12276479657 0.116442730341 0.10900023208 0.10015627213 0.089560111338 0.0767816135067 0.0613091600953 0.0424384384019 0.0212674018776 0.134839324226 0.134859554893 0.134886183718 0.1349373285 0.135002548795 0.135088221024 0.135192897596 0.135319833414 0.135478289469 0.135659910738 0.135887886301 0.136129141955 0.13638530224 0.136667142705 0.136984729549 0.137326877049 0.137695763697 0.138113978301 0.138567038658 0.139050429328 0.139576429843 0.14013059986 0.140717500021 0.141338712748 0.141982119961 0.142668227071 0.143409793626 0.144154283936 0.144890756398 0.145681845054 0.146552239819 0.147488496587 0.148470874417 0.14948201647 0.150519236917 0.151602670293 0.152744618474 0.153977398754 0.155351985456 0.15688968993 0.158552826552 0.160261970254 0.16196767927 0.163662472034 0.16538053529 0.165793015755 0.166028307673 0.166321220117 0.166485066508 0.166482414579 0.166299312481 0.165930662007 0.165377354883 0.164645315378 0.16374319649 0.162679825419 0.161462682615 0.160096958836 0.158584869629 0.15692517415 0.155112808766 0.153138524101 0.150988436174 0.148643416991 0.146078249605 0.143260468933 0.140148802268 0.136691114231 0.13282174955 0.128458159816 0.123496708063 0.117807587902 0.111228904209 0.103560203464 0.0945561077603 0.0839220039186 0.0713114408032 0.0563566830281 0.0384859744159 0.0190426148085 0.134135981884 0.134153203343 0.134186905577 0.134238145025 0.134305277759 0.134390285253 0.134491748046 0.134614957469 0.13476881654 0.134942341576 0.135168568258 0.135412520663 0.135667022779 0.135948388753 0.136272476847 0.136620512438 0.136992431556 0.137410840741 0.137873067858 0.138370057506 0.138912662138 0.139496698567 0.140118159203 0.140774636604 0.141464007001 0.142190612932 0.142978421173 0.143780649662 0.144547349407 0.145340904674 0.146211852518 0.147164568654 0.148179032957 0.149230777502 0.150298332557 0.151390801627 0.152526176595 0.153745471715 0.155129629182 0.156713929516 0.158428655223 0.160199900434 0.162014825222 0.163397458206 0.164325733386 0.165142153799 0.165345224658 0.165513749853 0.165578770308 0.165455185115 0.165131548347 0.164610241821 0.163897965855 0.16300487724 0.161942349323 0.16072083546 0.159348521742 0.157830543219 0.156168499238 0.154360140382 0.152399129433 0.150274779587 0.147971690587 0.145469217792 0.14274071563 0.139752496647 0.136462445096 0.132818220092 0.12875498203 0.124192583549 0.119032194363 0.113152399105 0.106404942519 0.098610570418 0.0895557374596 0.0789924226633 0.0666389095345 0.0522224015282 0.0352688286642 0.0172546348805 0.133406684088 0.133422628876 0.133457998551 0.133509140455 0.133578260862 0.133663964004 0.133762582453 0.133882342432 0.134032828813 0.134197669216 0.134417420614 0.134663625234 0.134917103081 0.135192104354 0.135518937794 0.135872832326 0.136248826052 0.136665937073 0.137129406655 0.137633753415 0.138189766563 0.138787798301 0.139443574268 0.14014059589 0.140880416719 0.141656455426 0.142493560499 0.143372343636 0.144202942013 0.145019353996 0.145895353064 0.146851700169 0.147889798046 0.148988318419 0.150112795673 0.151234295545 0.152358092719 0.1535331889 0.154883097971 0.156473460321 0.158184473117 0.159960935818 0.161893233867 0.163696986449 0.16394939355 0.164148931995 0.164489276286 0.16462802697 0.164565551378 0.164301278863 0.163827565926 0.163148942547 0.162277263064 0.16122644084 0.160009913795 0.158639067111 0.157122195174 0.155463930261 0.15366496278 0.151721900885 0.149627161931 0.14736881194 0.144930286331 0.142289940561 0.13942038702 0.136287577347 0.132849587926 0.129055064695 0.124841285252 0.120131809354 0.114833725582 0.108834580114 0.101999217272 0.0941670399524 0.0851504636344 0.0747369671902 0.0626911576504 0.048803752121 0.0326611832538 0.0157778496516 0.1326564271 0.132671235566 0.132704450319 0.132756454281 0.132825379244 0.13291014625 0.133005193997 0.133119710003 0.133270637067 0.133433730223 0.133638248592 0.133883602144 0.134137660663 0.134408382881 0.134727076394 0.135082254417 0.135461511432 0.135878421131 0.13634237721 0.136845734415 0.137413270928 0.138021214428 0.138687396454 0.139414439278 0.140196092557 0.141030797753 0.141926639506 0.142890184243 0.143833189545 0.144710927087 0.145611354054 0.146580777479 0.147636174568 0.148769905217 0.149958741084 0.151152820541 0.152292838943 0.153392478353 0.15461436571 0.156152781584 0.157871390041 0.159593745092 0.161104301823 0.162636484398 0.163389839273 0.163428936079 0.16358035367 0.163624371471 0.163434446395 0.163019481459 0.162388349495 0.161551170514 0.160523352018 0.159321386694 0.157960002691 0.15645084174 0.154801760278 0.153016515958 0.151094694358 0.149031731636 0.146818928721 0.144443384055 0.141887793427 0.1391300794 0.136142821464 0.132892459454 0.129338240004 0.125430870982 0.12111084777 0.116306426186 0.110931250701 0.104881724511 0.0980343455729 0.0902435176036 0.0813405591488 0.0711364813967 0.0594237655569 0.046029411816 0.0305716940093 0.0145444618401 0.131888094805 0.131902070007 0.131933583168 0.131986921447 0.132051999674 0.132131700511 0.132222698032 0.132329128407 0.132475905223 0.132641459999 0.132828642902 0.133069193014 0.133321912601 0.133592073544 0.133896996523 0.134246377271 0.134625276735 0.135041063825 0.135508520821 0.136011222152 0.136577346514 0.137199011437 0.137870317798 0.138609484236 0.139415905501 0.140288061525 0.141236410047 0.142269068569 0.143356938529 0.144371329433 0.145333931483 0.146341286374 0.147428827206 0.148610792533 0.149865486408 0.151158587537 0.152379747807 0.153424686348 0.154356735109 0.1556304593 0.157442472216 0.159599442706 0.160812435792 0.161660730948 0.16241383918 0.162594321008 0.162625019072 0.162512439612 0.162175373242 0.161605296119 0.160815519451 0.159822744446 0.158645555664 0.157301936012 0.155807064256 0.154172224306 0.152404396245 0.150506207152 0.148476057871 0.146308293097 0.143993322648 0.141517635776 0.138863671861 0.136009525246 0.132928467767 0.129588270956 0.12595030072 0.121968344683 0.117587122243 0.112740428007 0.107348883324 0.10131733655 0.0945320806682 0.086858348826 0.0781387561677 0.0681954760732 0.0568307088091 0.0438826942368 0.028976350802 0.0135437090298 0.131105388323 0.131118543906 0.131154881319 0.131206899498 0.131262990491 0.13133456165 0.131420723886 0.131519537761 0.131650666791 0.131811706021 0.131985313171 0.132217112288 0.132464925147 0.132729651793 0.133021749806 0.13336220068 0.133733788305 0.134145175307 0.134614350986 0.135121637323 0.135680595581 0.136305801292 0.136983460324 0.1377309987 0.138547445184 0.139435783254 0.14040970507 0.141479457208 0.142654695179 0.14387029575 0.144989855274 0.146088750977 0.147237468935 0.148474375819 0.149831619348 0.151264823281 0.152631937798 0.153635385791 0.154294157544 0.154691551908 0.156421223034 0.158753680126 0.160949460051 0.161230578874 0.161313109994 0.161547037378 0.161534622487 0.161272694744 0.160779346025 0.160054305241 0.159110958255 0.157970385692 0.156653984901 0.155180625531 0.153565289554 0.151818426825 0.149945851976 0.147948946519 0.145824971463 0.143567365838 0.141165957959 0.138607048469 0.135873345668 0.132943745364 0.129792950196 0.126390914397 0.122702080573 0.118684349355 0.114287697599 0.109452345606 0.104106377674 0.0981627653407 0.0915158422149 0.0840375758456 0.0755741952341 0.0659461549977 0.0549461691837 0.0423963989749 0.027900325161 0.0127940447583 0.130310969433 0.130324758332 0.130365532115 0.13040983005 0.130456882454 0.130521064811 0.130601409875 0.130692930153 0.130806383135 0.130955535746 0.131113831637 0.131329933962 0.131570576853 0.131822395232 0.132100287926 0.132433228244 0.132792863464 0.133190792453 0.133656395064 0.134163238501 0.134717779208 0.135342201076 0.136017328962 0.136773117321 0.137596514941 0.138492873415 0.139468024052 0.140544319686 0.141730944624 0.143044168954 0.144396994854 0.145673695051 0.146954234444 0.148302642996 0.149777720929 0.151461201408 0.152884437721 0.154035148905 0.15429435596 0.154538555301 0.155009805746 0.157023647069 0.15971322715 0.160473357907 0.160335130113 0.160367461061 0.160265796445 0.159880697344 0.159240199875 0.158366412555 0.157279068327 0.156002327169 0.154559548366 0.152970062495 0.151248250028 0.149403429166 0.147440114889 0.145358465737 0.143154761219 0.140821808463 0.138349226461 0.135723587954 0.132928417358 0.129944052604 0.126747375122 0.123311392821 0.119604626384 0.115590205707 0.111224539587 0.106455384602 0.101219115805 0.0954370077855 0.0890103791909 0.0818147186608 0.0736930395489 0.0644513366474 0.0538517824285 0.0416644954263 0.0274312642544 0.0123471754031 0.129504396062 0.129517651169 0.129545395933 0.129586452183 0.129631942742 0.12969105245 0.12976443352 0.129846097879 0.129945576413 0.1300804127 0.130226610316 0.130415246809 0.130647990639 0.130885784891 0.131145279378 0.131466733558 0.13181840765 0.132200286473 0.132647182343 0.133146284683 0.133690240673 0.134315430814 0.134987386059 0.135731997584 0.136555218081 0.137457443646 0.138432335605 0.139498478548 0.140668704658 0.141960718195 0.143383436492 0.144856713159 0.14629761621 0.147735265831 0.149205755474 0.150732764346 0.15220965762 0.153443957373 0.154145726741 0.154932844009 0.155358371983 0.155752762211 0.157376176765 0.158930046587 0.159106168036 0.159036883466 0.158821037752 0.158326532695 0.157556444805 0.156546575119 0.155327939638 0.153928805944 0.152373945507 0.150682723255 0.148868646281 0.146939753258 0.14489925608 0.142746222534 0.140476194424 0.138081679572 0.135552493926 0.13287595598 0.130036952003 0.127017896088 0.123798597287 0.120356011633 0.116663802943 0.112691572894 0.108403556803 0.103756520783 0.0986965334469 0.0931542289873 0.087038120479 0.0802257115539 0.0725520339621 0.0637981996894 0.0536760549992 0.0418591695238 0.0277714019523 0.0123374641219 0.128690254333 0.128701274976 0.128717042378 0.128755405644 0.128799828008 0.128851129813 0.128913029272 0.128981829305 0.129065109339 0.129184685389 0.129323323502 0.129480678943 0.129700710587 0.129929746248 0.130174545115 0.130467674814 0.130809081068 0.131178899551 0.131598287946 0.132086581892 0.132616213306 0.133222998561 0.133896640132 0.134625278473 0.135438893221 0.136328545697 0.137302004623 0.138356487674 0.139502875231 0.140756703295 0.142120752939 0.14360455294 0.145142810809 0.146676440303 0.148180179909 0.149656206693 0.151041498541 0.152269749037 0.153351114026 0.154364663138 0.15577655704 0.156012682575 0.156451785543 0.156927071682 0.157546367974 0.157566665312 0.157243366379 0.156631926163 0.155740467542 0.154606505273 0.153269542722 0.151761976904 0.15010941024 0.148330666069 0.146438079596 0.144438328 0.14233339841 0.140121469584 0.137797637487 0.135354467749 0.132782381546 0.130069900619 0.127203791215 0.124169148669 0.12094944084 0.117526474426 0.113880172591 0.1099879707 0.1058235594 0.101354621031 0.0965390934956 0.0913193245661 0.0856132113061 0.0793013323304 0.0722083894012 0.0640815310871 0.0545606085228 0.0431780370192 0.0292105876668 0.0129983653176 0.127877337118 0.127887701684 0.127908498704 0.127937315543 0.127970775078 0.128008519785 0.12805482337 0.128109739329 0.128175131775 0.128273941123 0.128400313154 0.12852995017 0.128724385792 0.128946912869 0.129176659217 0.129434498054 0.129759016819 0.130111125318 0.13050230571 0.130975131649 0.13149496494 0.132075065989 0.132738227015 0.133451933084 0.134255830376 0.135129013888 0.136092292149 0.137132067744 0.138254884539 0.13947234859 0.140780777684 0.142180833112 0.143667666777 0.145196986579 0.146710427591 0.148160776822 0.149511592468 0.150734761367 0.151849341329 0.152959871102 0.154321217044 0.155662656393 0.155906269013 0.155737447356 0.156033913728 0.155998429043 0.155564971034 0.154824263452 0.15381001764 0.152560407571 0.151117150243 0.149514491854 0.147777911371 0.145925062662 0.14396680426 0.141908409649 0.139750770047 0.137491412888 0.135125294271 0.132645386496 0.130043095947 0.12730856051 0.12443088981 0.121398408932 0.118198926056 0.114819965621 0.11124881198 0.10747212081 0.103474782322 0.0992376380628 0.0947334999294 0.0899206047465 0.0847320095151 0.0790585323198 0.0727203249614 0.0654259146295 0.0567007797791 0.0458405046976 0.0318870741148 0.0141817061746 0.127067951253 0.12707661289 0.127099226133 0.12711954852 0.12713846187 0.127164482138 0.127197475593 0.127239449297 0.127288623767 0.127361598264 0.127468777378 0.127582749886 0.127730105225 0.127939101686 0.128148366825 0.12837602676 0.128672062586 0.129006595265 0.129373626225 0.129814550238 0.130318963965 0.130874698865 0.131525111397 0.132230265519 0.133013046119 0.133877273958 0.134820330078 0.13584670045 0.136948172415 0.138131607837 0.139403208077 0.140747052651 0.142163459468 0.143630855286 0.145118124171 0.146565182004 0.147924887336 0.149162356981 0.150245323109 0.151266602447 0.15217758044 0.153763372379 0.154649389426 0.154459735077 0.154486878168 0.154321939979 0.153776235115 0.15291052906 0.151777707679 0.150421294682 0.148883436371 0.147198342493 0.14539047217 0.143475825146 0.14146356987 0.139357587597 0.137157834725 0.134861434186 0.13246349372 0.129957705656 0.127336787698 0.124592837583 0.12171769145 0.11870336562 0.115542596672 0.112229384916 0.108759336005 0.1051295219 0.101337551088 0.0973795028193 0.0932462605893 0.0889174273021 0.0843511957246 0.0794668359814 0.074111565553 0.0680007811075 0.0605709568021 0.0507902448007 0.0367954386768 0.0155344551715 0.126264177599 0.126267930367 0.126278787014 0.126287207303 0.126302798242 0.126323450252 0.126347007968 0.126376307966 0.126407178696 0.126451714085 0.126531717925 0.126633374231 0.12673447764 0.12690740946 0.127103750789 0.127305855529 0.127554302188 0.127870530868 0.128217164624 0.128615696589 0.129102262056 0.129636980947 0.130258714376 0.130961819664 0.131720340356 0.132579223035 0.13350764334 0.134520855214 0.135606604625 0.136767802448 0.138011782151 0.139327322096 0.14070953374 0.142147143297 0.14362195385 0.145101705642 0.14653596762 0.147880125455 0.148975962712 0.149986077963 0.149932123216 0.150685401616 0.152622983343 0.152876060655 0.152820329177 0.152536159281 0.151883560898 0.150901577152 0.149657020831 0.148202320378 0.146580487714 0.144824461413 0.142956792613 0.14099138645 0.13893556658 0.136791867166 0.134559479148 0.132235353089 0.129815003537 0.127293101194 0.124663929415 0.121921802701 0.119061567023 0.116079278117 0.112973050566 0.109743924631 0.106396484051 0.102938929319 0.0993823581349 0.0957390715723 0.0920197231554 0.0882289503197 0.0843586674266 0.0803769634791 0.0762070751806 0.0716876754988 0.0664470205091 0.059715775884 0.0488575713669 0.0251968071169 0.1254732396 0.125472476856 0.125471288157 0.125461769674 0.125480411809 0.125497349063 0.125511233606 0.125525735576 0.125536232131 0.125553144325 0.12560028275 0.125677048507 0.125757350718 0.125868242965 0.126042995507 0.126223468947 0.126425111833 0.126704675689 0.127030368317 0.127391664484 0.127844753071 0.128366691914 0.128952055065 0.129644504408 0.130398234074 0.131236222233 0.132162115612 0.133164897807 0.134242475126 0.135389938678 0.136614644367 0.137915841182 0.13928573983 0.140721774156 0.142214455347 0.143755768703 0.145333323613 0.146969763756 0.148309403806 0.149940786893 0.149866365539 0.150113530311 0.150503194387 0.151164871398 0.151145822597 0.150714809863 0.149923545059 0.148816824483 0.147462167634 0.145915464035 0.144218730767 0.142402002055 0.140484830781 0.138478527822 0.136388436855 0.134215810232 0.131959240576 0.12961571217 0.127181354935 0.124652012361 0.122023708123 0.119293135931 0.116458326942 0.113519598096 0.110480724789 0.10735009328 0.104141491209 0.100874239228 0.0975725205301 0.0942639433839 0.090977500664 0.0877411211699 0.0845790646539 0.0815090992652 0.0785397549962 0.0756707108015 0.0728795945021 0.0702471136818 0.0675417802973 0.0675136935458 0.124701168279 0.124699779142 0.124700242514 0.124690302819 0.124692305539 0.124698309886 0.124699584408 0.124696567479 0.124688342595 0.124679301299 0.124686651912 0.124726467166 0.124789335764 0.124848595662 0.124964754651 0.125126711286 0.125293974323 0.125508344864 0.125814581669 0.126149247268 0.126548491664 0.127058942776 0.127626017956 0.128293245297 0.129051165709 0.129875193892 0.130792937804 0.131786537973 0.132855206165 0.133992576017 0.135203009199 0.136490731678 0.137850111778 0.139282738359 0.140790012623 0.142366657652 0.144017547211 0.145764972037 0.147493742066 0.149678007899 0.149667030274 0.149695092752 0.149608243849 0.149775368182 0.149519364096 0.148879868608 0.147911531311 0.146664848422 0.145200114187 0.143567847455 0.141805229658 0.139937586632 0.137980515047 0.135942345258 0.133826392974 0.131632744479 0.129359571362 0.127004076525 0.124563169027 0.122033997627 0.119414423578 0.116703591771 0.113902792474 0.111016707231 0.108054890134 0.10503310823 0.101974112212 0.098907559893 0.0958690789689 0.09289871922 0.0900392190853 0.087334623347 0.0848300142019 0.0825728287885 0.0806181778979 0.079039720923 0.0779401140278 0.0775464419011 0.0779014014231 0.0806840593955 0.123951169483 0.123949555268 0.123951025266 0.123956558422 0.123936527784 0.123931412923 0.12392005166 0.123900057291 0.123874111805 0.123836532494 0.123802349668 0.123794169414 0.123814696163 0.123845045115 0.123889154795 0.12401104769 0.124160185796 0.124324552069 0.124578981256 0.124894709331 0.125253224038 0.125725395253 0.126287368811 0.126932439256 0.127681315724 0.128507881646 0.129412545231 0.130401302414 0.131455417642 0.132576952097 0.133769127677 0.135033508427 0.136371441713 0.137783088057 0.139274228339 0.140844751167 0.142491665065 0.14419900049 0.145968056174 0.147831174386 0.149375837982 0.149031046101 0.14861397666 0.148390377509 0.147833415154 0.146967512079 0.145819268629 0.144435250485 0.142868430292 0.141161099681 0.139343515761 0.137435362837 0.135447917085 0.133386484099 0.131252487524 0.129045053335 0.126762139098 0.124401341458 0.121960476969 0.119438079543 0.116833878612 0.114149466103 0.111389385899 0.108562698874 0.105684726409 0.102778421829 0.0998748590696 0.0970126151543 0.0942361916371 0.0915939141539 0.0891358789922 0.0869125949502 0.0849750897143 0.0833765584047 0.0821787283357 0.0814584655378 0.0813171152412 0.0819237586691 0.083303068986 0.0860882577141 0.123234508847 0.12322958505 0.123220418314 0.123235198155 0.123216033453 0.123201907076 0.123178771351 0.123142347642 0.12309565409 0.123030743866 0.12296046938 0.122895796034 0.122862405769 0.122852957996 0.122849840323 0.12288530902 0.12301077745 0.123160392929 0.123343714732 0.123628106756 0.123968076833 0.124385157057 0.124928167267 0.125563403778 0.126302384526 0.127133172653 0.128037417886 0.129015530537 0.130058429184 0.131158108581 0.132317430868 0.133544098036 0.134837871146 0.136204282175 0.13765091136 0.139183599077 0.140797343882 0.14247179702 0.144150607055 0.145738570324 0.145858228768 0.147409629319 0.147109105821 0.146726719373 0.145961469002 0.144912833852 0.143613255354 0.142112526511 0.140461020934 0.138694098618 0.136835014457 0.134897861568 0.132889854771 0.13081361261 0.1286690115 0.126454526192 0.124168145561 0.121808034912 0.119373021516 0.116863064778 0.114279741605 0.111627033063 0.108912685199 0.106150111024 0.103360317058 0.100573099455 0.0978269509243 0.0951675728991 0.0926453344409 0.0903122865845 0.0882193398467 0.0864142424271 0.0849408340228 0.0838392762112 0.0831513372526 0.0829183220466 0.0831917168263 0.0840468699369 0.0854587176055 0.0874549387649 0.122562753771 0.122554628573 0.122541611509 0.122550193246 0.122548076289 0.122516998948 0.122478464161 0.122423857081 0.122353573022 0.12226715007 0.122163161058 0.122054717287 0.121957277886 0.121885817606 0.121844547777 0.121812930681 0.121868673141 0.121999259662 0.122145106458 0.122357353701 0.122671474799 0.123050885673 0.123553125524 0.124188759499 0.124929549495 0.125762162476 0.126672707505 0.12764294422 0.12867118452 0.129743453647 0.130859542423 0.132029037061 0.133251975951 0.134540467672 0.135903104609 0.1373585693 0.138918781373 0.140592042001 0.142478438345 0.144999650618 0.145094102622 0.145408769098 0.145249098162 0.144840899929 0.14389401512 0.142688901032 0.141271562101 0.139684140324 0.137972306946 0.136165467032 0.134280653766 0.132327090548 0.130308677651 0.128226010913 0.126077952515 0.123862728163 0.121578639072 0.11922459691 0.11680052586 0.114307824014 0.111749860675 0.109132920085 0.10646789301 0.103772528223 0.101073428805 0.0984068271281 0.0958176111484 0.0933567044849 0.0910773927778 0.0890313574647 0.0872649841821 0.0858165013717 0.0847138509215 0.0839730768699 0.0836020115379 0.0835900317748 0.0839404020196 0.0846545505105 0.0856661151387 0.0868006271256 0.121928891833 0.121917013214 0.121905613386 0.121891211073 0.121890900545 0.121859442396 0.121814345279 0.121744409993 0.121653418007 0.121546906159 0.121412957052 0.121267696683 0.121106031662 0.120965254179 0.120859653358 0.120798716221 0.120784889705 0.120873578914 0.121002170862 0.121152493637 0.121380076445 0.121731632567 0.122200663163 0.122826218378 0.123582976309 0.124433543561 0.125345115031 0.126307904874 0.127305219837 0.12833437312 0.129388826522 0.13048069937 0.131610507281 0.13278512751 0.13401784179 0.13532976391 0.136736619512 0.138281367059 0.140057642598 0.142413303208 0.144290566435 0.143855114998 0.143149459285 0.14263985741 0.141578582183 0.140265852921 0.138775435929 0.137140653094 0.135399176649 0.133575551061 0.131682435853 0.129725688947 0.127707101326 0.125626178782 0.123481445162 0.121271344137 0.118994789635 0.116651615275 0.114242913347 0.111771516442 0.109242511282 0.106664397305 0.104051186193 0.101425005595 0.0988180099211 0.0962724576867 0.0938385866834 0.0915707108817 0.0895224435934 0.0877419537214 0.0862677500299 0.0851254990342 0.0843248759242 0.0838563964927 0.0836895004025 0.0837517046234 0.0840039219927 0.0843673845652 0.0848761036091 0.0858345623668 0.121319327318 0.121299416157 0.121279285537 0.121240451443 0.121227755318 0.12121864883 0.121181348588 0.121102637774 0.120997022683 0.120869622449 0.120716403383 0.120528887483 0.120329025914 0.120107446204 0.119923020756 0.119810261942 0.119783705057 0.119816045065 0.119927617522 0.12003502727 0.120195025662 0.120431104477 0.120883805206 0.121514267393 0.122294619144 0.12316557343 0.124080297304 0.125019237361 0.125974173549 0.126940147097 0.127918699166 0.128911839875 0.129926397351 0.130961839227 0.132029719084 0.133158300898 0.13432226684 0.1356145366 0.137112134222 0.139082876568 0.140881199228 0.141499682614 0.140532096886 0.139986501134 0.138944041981 0.137617920055 0.136117139056 0.134481743603 0.132744864699 0.13092892587 0.129045092914 0.127098033422 0.125088957797 0.123017354865 0.120882138967 0.118682447692 0.116418095798 0.114089997028 0.111700463816 0.109253746541 0.106756565489 0.104219568665 0.101659934812 0.099104309493 0.0965904217218 0.0941661584295 0.0918860611947 0.0898060987668 0.0879779847634 0.0864440708611 0.0852332954348 0.084358888575 0.0838160023669 0.083580305285 0.0836013609802 0.0837765475031 0.0840044212316 0.0839217795537 0.0842007439628 0.084763703824 0.120738696161 0.120706714164 0.120667524768 0.120623780483 0.120595691937 0.120590955548 0.120564289756 0.120490478674 0.120383507062 0.120246248452 0.120080289751 0.119873343719 0.119639700613 0.119371062274 0.119108233536 0.118839230419 0.118888161256 0.118932510029 0.118990903874 0.119034117279 0.119145152469 0.11927950087 0.119604798305 0.120298634885 0.121112999057 0.121993369605 0.122900321153 0.123804018322 0.124707114637 0.125601446851 0.126492904212 0.127374692443 0.128254247441 0.129130940266 0.130010636047 0.130904425669 0.131799107266 0.132732283436 0.13376730147 0.135122129125 0.137061829744 0.138312675811 0.137370451327 0.136878903211 0.135989010669 0.13475809788 0.133314438394 0.131723395359 0.130022628384 0.128236348569 0.126377214308 0.124450935678 0.122459646932 0.120403819072 0.118283406326 0.116098649042 0.11385049539 0.11154105888 0.109173895233 0.106754645175 0.10429157604 0.101797460422 0.0992927910227 0.0968089896771 0.0943894530753 0.0920872964838 0.0899602947753 0.088064373072 0.0864472840939 0.085143520859 0.0841710340537 0.0835308002137 0.0832063610286 0.0831683404613 0.0833804031709 0.0838281356869 0.0844217783988 0.0839047619178 0.0841651949242 0.08417969819 0.120202712417 0.120160187208 0.120109641994 0.120065166353 0.120024349668 0.119997005472 0.119967774885 0.11991688203 0.119821899341 0.119689240116 0.11951864444 0.119313179495 0.119047469452 0.118773124777 0.118452235131 0.118319203815 0.118080113064 0.118290931562 0.118313820857 0.118149477817 0.118360207733 0.118350718036 0.118609500296 0.119250570942 0.120103910983 0.120985487158 0.121858145644 0.122713795969 0.123545872917 0.124357713149 0.125141192425 0.125901053213 0.126635045695 0.12734480958 0.128023763457 0.128653845461 0.129231087087 0.129724427786 0.130073522277 0.130549908931 0.129608159023 0.133751892388 0.133833632578 0.133498534759 0.132814565825 0.131751476976 0.130414747904 0.128899302333 0.12725616656 0.125514789266 0.123691194107 0.121793603106 0.119826118413 0.117790886483 0.115689341345 0.113523095106 0.111294366391 0.109006529418 0.106664367563 0.104274873708 0.101847775888 0.0993980085146 0.0969496507117 0.0945392862765 0.0922161264251 0.090038090967 0.0880650927476 0.0863513734488 0.0849388255559 0.0838521047002 0.0830962408274 0.082657703429 0.0825047730723 0.0825992910829 0.0829065908821 0.0834210710813 0.0840088603046 0.0852296426554 0.084002394817 0.0837163231958 0.119716398782 0.119671491827 0.11961904679 0.119568920146 0.119523277974 0.119477527315 0.119438346137 0.119403091247 0.119324112797 0.119204189552 0.119043555297 0.118838186126 0.118590610068 0.118294032556 0.118111119343 0.117922908248 0.117920585185 0.117871237677 0.117957103225 0.117904925649 0.11793215799 0.118039902099 0.11822433106 0.118538135148 0.119349197416 0.120186095967 0.120993809672 0.121765200607 0.122506737123 0.123209218449 0.12387303794 0.124504055098 0.125095287448 0.125639350123 0.126117298667 0.126492335449 0.126751849998 0.126838595227 0.126433127212 0.12723063134 0.127948253091 0.128508795049 0.12995284721 0.130102554225 0.129611870532 0.128706095219 0.127484716948 0.126053714081 0.124475512975 0.122785088398 0.121001862133 0.119136827129 0.117196379218 0.115184597521 0.113104555653 0.110959328263 0.108752423479 0.106488468882 0.104173414591 0.101815558778 0.0994260030428 0.0970219585594 0.0946315017149 0.092296874934 0.0900732589955 0.0880228940036 0.0862067320927 0.0846758913161 0.0834650518717 0.0825879838168 0.0820358910423 0.0817775237463 0.081758381132 0.0819282420483 0.0822523075062 0.0827301259115 0.0833061627356 0.0834330074274 0.0830997398069 0.0829566874183 0.119272330958 0.11923744238 0.119185759892 0.119135998239 0.119086936785 0.119034440865 0.118978278468 0.118947279024 0.118891512931 0.118791907155 0.118652882915 0.118471637714 0.118244480832 0.118044962489 0.117885252683 0.117799330935 0.117819656707 0.117793317201 0.11779726747 0.117854169414 0.117870690643 0.117914405282 0.118023976519 0.118310345088 0.118912870981 0.119606828363 0.120292283846 0.120947956991 0.12157092312 0.122152347926 0.122697774401 0.123196922843 0.12364299526 0.124019734182 0.124306584405 0.124465493977 0.124464520702 0.124280405985 0.122639819767 0.124339372189 0.126000475711 0.125664600448 0.126602970145 0.126909420556 0.126527946623 0.125720005758 0.124587136646 0.123229266203 0.121710512259 0.12006839946 0.118324437359 0.116491743826 0.114578712776 0.112591207259 0.110533831405 0.10841104025 0.106227534453 0.10398912325 0.101702817942 0.099378172354 0.0970275715994 0.0946707120885 0.0923402143932 0.0900845321824 0.0879648741659 0.0860471367719 0.0843921190971 0.0830465619774 0.0820373140904 0.0813679207756 0.0810186886839 0.0809449570235 0.081074568825 0.0813262799634 0.0815876085299 0.08204662549 0.0822402373995 0.0822978886335 0.0822000803594 0.0821413799756 0.11887554981 0.118853680709 0.118805958196 0.118762507734 0.118718572677 0.118663248517 0.118609661239 0.118552786902 0.118516301516 0.118445829941 0.118338991579 0.118195752603 0.118021857468 0.11788836759 0.117713247898 0.117745195863 0.117761899423 0.117777839922 0.117782076732 0.117830140307 0.117863739826 0.117893014113 0.117902972292 0.11823310008 0.11865932394 0.119181730676 0.11971443639 0.120237879506 0.12073192175 0.121194290649 0.121613049227 0.121976490101 0.122273544952 0.122489135761 0.122605508483 0.122609329003 0.122479672128 0.122399690252 0.120736594143 0.121349521294 0.123131379561 0.123199669099 0.123684618075 0.12394704268 0.12360366178 0.122844985506 0.121766318628 0.120459870539 0.118986453272 0.117383383163 0.115672695127 0.113868609877 0.111980846194 0.11001660886 0.107981712377 0.105881772688 0.103722489893 0.101510735891 0.0992544397152 0.0969643711449 0.0946541048631 0.092346149467 0.0900783455815 0.0879058908774 0.0858958317146 0.084116647082 0.0826273606843 0.0814687760541 0.08065921552 0.0801927344461 0.0800427600783 0.0801642019065 0.0805095164889 0.0809726365526 0.0810539301239 0.0812665740504 0.081310934893 0.0813322822814 0.0813110505143 0.0812951987151 0.11853598754 0.118512886921 0.118470788694 0.118436016103 0.118407974283 0.118361628034 0.118299357735 0.118238868598 0.118193324577 0.118157893744 0.118087545371 0.117980291753 0.117846829805 0.11772929341 0.117688207962 0.117727517362 0.117748049732 0.117770184267 0.117785120826 0.117813708405 0.117842632155 0.117882168488 0.117950895787 0.118154700779 0.118461435866 0.118829122657 0.119222529065 0.119610158507 0.11998103782 0.120318194778 0.120605926477 0.120834098854 0.120990109997 0.121057451727 0.12101774595 0.120866144052 0.120561805682 0.120298805096 0.118926908744 0.11848772268 0.119558805939 0.120512945921 0.120993909451 0.121217714123 0.12086807697 0.120115472599 0.119053491354 0.117770449079 0.1163224459 0.114744524525 0.113057606325 0.11127578578 0.109409208851 0.107465793904 0.105452105865 0.10337461458 0.101239761715 0.0990553414853 0.0968300308853 0.094575804015 0.0923073278403 0.0900504085396 0.0878489174368 0.085765270823 0.0838718538119 0.0822381409593 0.0809190141856 0.0799466047324 0.0793283169021 0.0790476701391 0.0790727184158 0.0793513705728 0.0798251685412 0.080369208966 0.0811643410486 0.0805552038382 0.0804419660057 0.0804185863199 0.0804118215796 0.0804090489003 0.118248468582 0.118211698996 0.118169391807 0.118148423703 0.11814464305 0.118115238007 0.118051354579 0.117974810809 0.117949981115 0.117917936774 0.11788988578 0.117817446895 0.117722840947 0.117648275481 0.117674444829 0.11771088349 0.117728775225 0.117744234582 0.117765096704 0.117789438819 0.117811352417 0.117847835163 0.117913664091 0.118055108954 0.118257693749 0.118503182203 0.118770952764 0.119038348398 0.119286905797 0.119498517669 0.119662947038 0.119768592748 0.119800636491 0.119741909158 0.119568646241 0.119247214975 0.118683080922 0.117780981977 0.117391810475 0.116763377362 0.116816261948 0.118178082714 0.118684854577 0.118802380907 0.118363207689 0.117556391298 0.116467037385 0.115175416355 0.113729873156 0.112160838326 0.110486329892 0.108718977649 0.106868366019 0.104942426342 0.10294795541 0.100891941931 0.0987812836004 0.0966245676531 0.0944310352625 0.0922139026974 0.0899888218274 0.0877855823044 0.0856550188532 0.0836671634988 0.0818990449328 0.0804194546049 0.0792767215692 0.0784907405811 0.0780529088145 0.0779312872712 0.0780883274282 0.0784617722145 0.0790003610821 0.0796733355994 0.0796481381509 0.0794997480959 0.0794553325444 0.0794548114817 0.079463090648 0.079465703703 0.118006231583 0.11795476921 0.117891901664 0.117904076038 0.11792807458 0.117921213019 0.117869624841 0.117787537707 0.117785536186 0.117749621513 0.117735654054 0.117705520422 0.117622716112 0.117625310601 0.117651869194 0.117681287504 0.117698247286 0.117716419009 0.11773931575 0.117760511091 0.117765753778 0.117787787092 0.117830505721 0.11791391563 0.118033017241 0.118178884902 0.118336750676 0.118491377654 0.118623489099 0.118722218712 0.118777458481 0.118778088174 0.118712227791 0.118565195629 0.118308617795 0.117878145092 0.117065079466 0.116314950643 0.116660357894 0.116496709715 0.115937257021 0.116715984554 0.116862086049 0.116717217097 0.116090295747 0.1151662478 0.114006924098 0.112676436593 0.11121129282 0.109635186591 0.107961711766 0.106200846993 0.104360708819 0.102448591154 0.100471030678 0.0984352339264 0.096348279775 0.0942194655031 0.0920584101599 0.0898796838627 0.0876997896618 0.0855534188962 0.083499328978 0.0816153101181 0.0799820283692 0.0786661157554 0.0777083108899 0.0771158796246 0.0768640164707 0.0768991479764 0.0771494534394 0.0775202392436 0.0781911238156 0.0783602179229 0.0784133670523 0.0784018274525 0.0784135286421 0.0784371525484 0.0784575121113 0.0784659134032 0.117816098939 0.117762656288 0.117694573843 0.117700322605 0.117763066603 0.117778538352 0.117738828797 0.117708751151 0.11767023306 0.117619290359 0.117622732483 0.117652676819 0.117614538805 0.117621838308 0.117637961895 0.117655024039 0.117665577792 0.117688653279 0.117708079925 0.117701679787 0.117698926009 0.117694923012 0.117705641936 0.117735990372 0.117783352053 0.11784189529 0.117902780185 0.117953364327 0.117981762444 0.11797949189 0.117939002247 0.117854151378 0.117719987501 0.117530213747 0.117264171251 0.116886356516 0.11630482619 0.116295350457 0.116266164015 0.116538230555 0.115491341543 0.115681003306 0.11532958804 0.114858390765 0.113997098376 0.112916521624 0.111656333072 0.110263612074 0.108761089041 0.107164602095 0.105482422492 0.103721048492 0.10188643888 0.099984747805 0.0980218587399 0.0960049852196 0.0939411568835 0.0918403802049 0.0897124717329 0.0875735731882 0.0854408651905 0.083355151396 0.0813839827395 0.0796125318682 0.0781232036057 0.0769778008746 0.0762075029147 0.075810114985 0.0757605930579 0.076001410031 0.0764076552005 0.0767016799768 0.0770699336992 0.0771630580498 0.0772321200932 0.0772762651209 0.0773231576641 0.077366116787 0.0773956699242 0.0774126949408 0.117698470464 0.117643401311 0.117650270316 0.117655600508 0.117670252647 0.117692540842 0.117671753427 0.117658804599 0.117615647709 0.117601786204 0.117580193154 0.117570181103 0.117605860811 0.117612360032 0.117623109094 0.117631523733 0.117625677062 0.11765459844 0.117638234677 0.117628798528 0.117601851004 0.117573690732 0.117548089405 0.117526662428 0.117508618811 0.117489705155 0.117462548332 0.117419554938 0.11735308027 0.117258525766 0.117133385187 0.116978230391 0.116797868188 0.11659523427 0.116371594792 0.116157968033 0.116015077184 0.116266569828 0.115688588668 0.11384560201 0.114276267695 0.114633523073 0.113929558334 0.113137438077 0.112027110898 0.110769612114 0.109389095308 0.107918889182 0.106367207344 0.104741287685 0.10304358114 0.10127663138 0.0994438237173 0.0975498820927 0.0955997980563 0.0936007182044 0.0915594632295 0.0894868632431 0.0873927588849 0.0852952245025 0.0832118917075 0.0811912929898 0.0793105484883 0.0776614613267 0.0763255961508 0.0753553788604 0.074765553664 0.0745384685574 0.0746475625112 0.0750289161501 0.0755728547902 0.0763989036927 0.0760345432026 0.076016593844 0.0760572057767 0.0761125561038 0.0761720658142 0.0762267414992 0.0762593773745 0.0762807704439 0.117645845052 0.117638189909 0.117644029629 0.117649479441 0.11764512749 0.117651077176 0.117635560413 0.117617263427 0.117591905919 0.117584063312 0.117566964475 0.117557077494 0.117577575155 0.11758900844 0.117606285432 0.117624422265 0.117625568861 0.117574059526 0.117570308568 0.117535240657 0.117487556238 0.117430116604 0.117365971678 0.117294212607 0.117214829323 0.117123964606 0.117015850229 0.116885097408 0.116728827138 0.116546413596 0.116340866264 0.116119186565 0.115895022262 0.115678809281 0.115498884266 0.115373108619 0.115267892992 0.114845242638 0.115610128575 0.114111575622 0.113522600655 0.113794657906 0.11270017214 0.111522986952 0.110131613566 0.108682600989 0.107171957564 0.105617941212 0.104012695309 0.102353839174 0.100637694036 0.0988627321117 0.0970296877022 0.0951418366639 0.0932032434003 0.0912210890358 0.0892019135661 0.0871576285005 0.0850979193557 0.0830433290589 0.0810116142682 0.0790611486468 0.0772792189263 0.0757633573376 0.0745920944036 0.0738059926332 0.0734019029359 0.0733366536793 0.0735214714318 0.0738672380529 0.0747015444958 0.074812421775 0.0747672180628 0.074782694506 0.0748278982502 0.0748829640481 0.074936886938 0.0749882706119 0.0750201370807 0.0750344710301 0.117643083494 0.11763743539 0.117640831838 0.117649344668 0.117638534881 0.1176280134 0.117608611769 0.117579044333 0.117575334882 0.117569325413 0.117568163781 0.117563628856 0.117562059347 0.117566727809 0.117592728122 0.117623210895 0.117633132282 0.117551268029 0.117500729872 0.11743622283 0.117360839328 0.117272194978 0.117167082505 0.117045857403 0.116907875667 0.116748371488 0.116562546135 0.116347020877 0.116101673309 0.115830248421 0.115538513193 0.115238436078 0.114953273512 0.114720068384 0.114595930309 0.114611430995 0.114787495905 0.114880396962 0.116155999284 0.11489409777 0.113376213452 0.113150299963 0.111554914611 0.109932716815 0.108236695679 0.106597624654 0.104962968391 0.103331281166 0.101677427067 0.0999888561348 0.0982559586481 0.0964735568841 0.094640117025 0.0927577942414 0.0908299386959 0.088864070538 0.0868664712491 0.0848505562953 0.0828256415884 0.0808154745391 0.0788374216612 0.0769623552199 0.0752878130779 0.0739154078973 0.0729175955626 0.0723226458373 0.0721209335255 0.0722654331886 0.0726092064693 0.0728534464699 0.0733439505014 0.0734568329892 0.0734736438125 0.0735014668702 0.0735417219159 0.0735853972341 0.0736243511916 0.0736577134481 0.0736846516876 0.0736893294821 0.117634945252 0.11763168952 0.117631765272 0.117635717331 0.11762423782 0.117609857098 0.117591712456 0.11757063452 0.11757455027 0.117567134688 0.117565196855 0.11755448665 0.117538444943 0.117532477753 0.117571109942 0.117598936458 0.117545418715 0.117481365118 0.117409180293 0.117323946542 0.117224018727 0.117101510502 0.116956974051 0.11678829939 0.116593688599 0.116368131494 0.116105891013 0.115805029281 0.115468051181 0.115098712531 0.114699432451 0.114287976208 0.113910798891 0.113636083825 0.113547631033 0.113749180754 0.114342981721 0.115649381392 0.116936350199 0.115893000172 0.11355733338 0.112396412255 0.110249515905 0.108206313676 0.106233788355 0.104441340381 0.102714108007 0.101027669635 0.099341192418 0.0976333743398 0.0958900592058 0.094103658303 0.0922713419353 0.0903948686153 0.0884773575264 0.0865271799403 0.084550465505 0.0825627356597 0.0805726439992 0.0786081061197 0.0766852830114 0.0748908524538 0.0733318514207 0.0721112186752 0.0712912204195 0.0708859248916 0.0708670276421 0.0711249212061 0.0715563744405 0.07259017221 0.0721988230853 0.0721619333885 0.0721551473606 0.0721740221635 0.0722040338911 0.0722359569555 0.0722637171893 0.072283958311 0.0723020536241 0.0723086528883 0.117609333772 0.117622422376 0.117624301534 0.117616418 0.117607914833 0.11759296594 0.11757710932 0.117564834955 0.117572299053 0.117551586071 0.117547152052 0.117528192289 0.117496542972 0.11745929671 0.117520319942 0.117491688569 0.117456849161 0.11739271516 0.117308614763 0.117205550409 0.117078534433 0.116925139804 0.116743465744 0.116529312117 0.116279932377 0.115988529221 0.115649653574 0.115261150883 0.114824348204 0.114333473519 0.11378649484 0.113225342406 0.1127022695 0.112300347958 0.1121544901 0.112466310259 0.113463726397 0.116332683539 0.117632714321 0.116645917535 0.11345817863 0.110956403622 0.108378308369 0.106116836433 0.103996549923 0.102139257308 0.100381570142 0.0986813290179 0.096988672192 0.0952782100936 0.0935343799588 0.0917493904903 0.0899206871865 0.088050716046 0.0861430853411 0.0842077016631 0.0822507035851 0.0802905076778 0.078334681496 0.0764165513512 0.0745498582565 0.0728411836252 0.0714049293317 0.0703416865799 0.0697020612464 0.0694889769503 0.0696393327839 0.0699800876814 0.0704883038436 0.0708427161459 0.0707994459694 0.07078441528 0.0707830584576 0.0707977971756 0.0708208787973 0.0708458395738 0.070868123911 0.0708840769772 0.070897033703 0.0709067788156 0.117609933088 0.117616160547 0.117625127239 0.117614160217 0.117594080203 0.117575438812 0.117557778782 0.11754292364 0.117536949647 0.117522703144 0.117519180491 0.117496602913 0.117463890439 0.117415591105 0.117376085654 0.117407964238 0.117376399267 0.117306058938 0.117209203184 0.117085672755 0.116933944679 0.116751083088 0.116533232026 0.116275499882 0.115972347312 0.115616185173 0.115198665989 0.114717346345 0.114162077421 0.113514025823 0.11279203449 0.112029481347 0.111260836985 0.110562842906 0.110078664164 0.109980940617 0.11057240195 0.11248260319 0.117993692068 0.111920188312 0.111348906706 0.108294743197 0.105599802318 0.103467747669 0.101431344913 0.0996463499085 0.097943745541 0.0962823053448 0.0946154892688 0.0929215422204 0.0911881522284 0.0894102163556 0.0875873786664 0.0857240313819 0.0838251175404 0.0819028491208 0.0799635377504 0.078029466592 0.0761064914954 0.0742349570861 0.0724245427821 0.0708068583348 0.0694993818048 0.0685960943718 0.0681368505526 0.0681043389885 0.0683653570052 0.0688150485481 0.0697457655895 0.0695006389358 0.0694099289669 0.0693741488551 0.0693666106669 0.0693770359787 0.0693961878535 0.0694181004073 0.0694384996027 0.0694526064435 0.0694652673885 0.0694763123139 0.11760795379 0.117606037993 0.117623243118 0.117599029951 0.117578169958 0.117557047738 0.117536172974 0.117517028967 0.117500678252 0.117492857996 0.117490792425 0.117470935141 0.117448505507 0.117422661278 0.1173847551 0.11737853291 0.117316511816 0.117230277009 0.117114986159 0.116970392889 0.11679466844 0.116584086737 0.116333048212 0.116033228378 0.115678210447 0.115255743756 0.114757733616 0.114172998972 0.113476464787 0.112662537904 0.111741329257 0.110711636001 0.109590468776 0.108456877857 0.107376008017 0.106393142238 0.105597824617 0.10512991235 0.105369880002 0.102993946475 0.106220121422 0.104167636506 0.101850652603 0.100228969863 0.0985455731952 0.0969823128719 0.0954192470129 0.0938453496362 0.0922326094643 0.0905711789366 0.088856675132 0.0870893956234 0.0852729455816 0.083414783576 0.0815219914773 0.079609822183 0.0776848738945 0.0757744338461 0.0738817102648 0.0720561212239 0.0703011115424 0.0687796545103 0.0676059588364 0.0668657489474 0.0665873849999 0.0667023609719 0.0670393420144 0.067684401387 0.0679270828445 0.0679239105639 0.0679064592964 0.0678990429282 0.0679027405717 0.0679174181367 0.0679379499046 0.0679604829729 0.0679822606774 0.0679980977279 0.0680121513085 0.0680233836494 0.117598919136 0.117592196377 0.117575368143 0.117579771982 0.117562142158 0.117539021932 0.117514686773 0.117491872076 0.117470547706 0.117467003244 0.117466580592 0.117452809289 0.117444208326 0.11744757698 0.117411027608 0.117350757315 0.117268177978 0.117162504109 0.117025883718 0.116862110728 0.116665750164 0.116430309865 0.116147150536 0.115808125607 0.115401466129 0.114912869321 0.114332322938 0.113636408996 0.11280248124 0.111818870618 0.110670849886 0.109329436631 0.1078432231 0.106257696748 0.104531987419 0.102598922413 0.100337376429 0.0975781935346 0.0931861844397 0.095081434138 0.0968369371358 0.0982579701552 0.0974504155217 0.0966655476256 0.0955004563189 0.0942466887945 0.0928703641367 0.0914100444463 0.0898656903791 0.0882439295213 0.0865508738945 0.0847937068338 0.0829810510123 0.0811241046091 0.0792327030585 0.0773257271516 0.0754101075601 0.0735194355384 0.0716529392488 0.069871758263 0.0681699368476 0.0667485613765 0.0657102723066 0.0651381738843 0.0650396037577 0.065243314351 0.0656860473597 0.0666692369717 0.066433930345 0.0663971952215 0.0663912611605 0.0664002840567 0.0664177418659 0.0664418511451 0.0664689161187 0.0664958962361 0.0665206302131 0.0665422971268 0.066560236917 0.0665726911663 0.117591135444 0.117587303714 0.117580465265 0.117582050323 0.117553237274 0.117523717449 0.117494609799 0.117468240788 0.117445635113 0.117444749669 0.117445119418 0.11743546962 0.117433133929 0.117459312961 0.11742355578 0.11733199637 0.117228305385 0.117098301243 0.116946442304 0.116767196076 0.116549217093 0.116290691124 0.1159810769 0.115605234047 0.11514718684 0.114597897056 0.113937694562 0.113136344681 0.11217031346 0.11101771496 0.109628839313 0.108001722682 0.10620822639 0.104206169499 0.101905535286 0.0991378669087 0.0956299634388 0.0901101854961 0.0882801403882 0.0886320122157 0.0894382956928 0.0927063157572 0.0932991605643 0.093256492338 0.0925513202021 0.091582387722 0.090382079418 0.0890292388938 0.0875486935711 0.0859620296871 0.0842852770687 0.0825322896843 0.0807168139869 0.0788538695733 0.0769564149247 0.0750473269747 0.0731338979926 0.0712575162477 0.0694117552045 0.0676732299336 0.0660221835878 0.0647045275617 0.0637993924264 0.0633896515189 0.0634402482646 0.0637336417505 0.0643904576171 0.0647738873085 0.0648034911095 0.0648302828505 0.0648604184273 0.0648964245278 0.0649350899918 0.0649764654257 0.0650178293108 0.0650564108119 0.0650897154884 0.0651186141747 0.0651390756315 0.0651498535158 0.117588028335 0.117587571717 0.117584658041 0.117586592042 0.117546240887 0.117509680329 0.117475506712 0.117445609503 0.117423435096 0.117424860263 0.117423922828 0.117413420918 0.117403999933 0.117433438598 0.117385458856 0.117294119326 0.117181182093 0.117041283585 0.11687662562 0.11667992327 0.116448284789 0.116175136138 0.115838472948 0.115424672252 0.114927199971 0.114324991892 0.113586808025 0.112691623614 0.111609516214 0.110289414443 0.108681688403 0.106837297578 0.104788141129 0.102465372634 0.0997680720574 0.0965242809293 0.092511788996 0.0865660787003 0.0857351596358 0.0854789655135 0.0859509738065 0.0889570699837 0.09002768042 0.0903411601888 0.0898970068666 0.0891101576876 0.0880309671897 0.0867532467146 0.0853154498303 0.083748461926 0.0820753532153 0.0803151047051 0.0784859002813 0.0766061297421 0.0746920464856 0.0727706373347 0.0708496733654 0.0689800432671 0.0671478229556 0.0654505966894 0.0638492712595 0.0626460072218 0.0618895562586 0.0616401489052 0.0617170387272 0.0620517780022 0.0633072913267 0.0631713510447 0.0632076554447 0.0632649829201 0.0633302877883 0.0634000798295 0.0634695000886 0.0635370978365 0.0636006658741 0.0636576542692 0.0637059561321 0.0637432819355 0.0637658077353 0.0637729671826 0.117586175712 0.117587614739 0.117585020762 0.117586615816 0.117538727136 0.11749611434 0.117457093111 0.117422482722 0.117393764035 0.117407516303 0.117404198118 0.117390410756 0.117371043057 0.117366936304 0.117330982268 0.117246356897 0.117130280996 0.116987001997 0.116813568752 0.116608084833 0.11636843587 0.116077731312 0.115717446072 0.115281830992 0.11475321999 0.114096992364 0.113296692454 0.112327478417 0.111137946151 0.109668570472 0.107896403485 0.105887460191 0.103647298871 0.101109866639 0.0981903981211 0.0947654097171 0.0907332300807 0.085298088009 0.0852801304825 0.0852834156201 0.0849918006722 0.0868567868277 0.0876802898304 0.0880005146289 0.0876192230467 0.0868966798399 0.0858676364478 0.0846196578927 0.0831935767226 0.0816232716967 0.0799352739795 0.0781515880462 0.0762937204989 0.0743826293637 0.0724379381693 0.0704905580925 0.0685490298968 0.0666755422445 0.0648468398557 0.0631888092017 0.0616346637142 0.0605615991682 0.0599932745894 0.0599679969868 0.0601593864902 0.0604006538826 0.0612177005349 0.0613936174545 0.0615452236234 0.0616747018631 0.0617962633629 0.0619127647744 0.0620250876928 0.0621280258355 0.0622203498085 0.0623000693322 0.0623656656716 0.0624137777602 0.0624441268958 0.0624557478051 0.117584210975 0.117589034908 0.117582619864 0.117584128217 0.11753091566 0.117483510231 0.117441362318 0.117403709314 0.117398147344 0.117399902463 0.117391238488 0.117374672795 0.117354520366 0.117333302296 0.117294789438 0.117204018031 0.117081379024 0.116933370353 0.116758644199 0.116551011786 0.116303979788 0.116003022308 0.11563405881 0.115184726308 0.114624287901 0.113927026579 0.113082534464 0.112054233085 0.110781904711 0.109196225302 0.107300847914 0.105175382975 0.102806916488 0.100141723545 0.0971189343424 0.0936648942552 0.0897657117693 0.0848650612681 0.0851464817564 0.0841276366983 0.0844185467845 0.0856522962029 0.0860249758801 0.0861662310237 0.0857148058716 0.0849611405576 0.0839159712285 0.0826509212576 0.0812021525047 0.0796017714114 0.0778766690738 0.0760498619558 0.0741449782227 0.072184596099 0.0701918031014 0.0682008950014 0.0662216982186 0.0643291817549 0.0624887055885 0.0608632132619 0.0593476986406 0.0584220972071 0.0580451125804 0.058116689006 0.0584371842777 0.0599756373137 0.0596339698425 0.0597088130414 0.0598822733956 0.0600723962428 0.0602616183608 0.0604385427772 0.0606033020073 0.060749686002 0.0608768952201 0.0609840939413 0.0610703986366 0.0611316131464 0.061173304654 0.0611945281106 0.117577858411 0.11758532088 0.117572038404 0.117574419625 0.117521117593 0.117472657958 0.117433510277 0.117404026598 0.117394125025 0.117394431565 0.117384714291 0.117366782818 0.117349927078 0.117327014007 0.117274955353 0.117172692986 0.117039853541 0.116883716441 0.116705983102 0.116503192066 0.116261177171 0.115960622902 0.115589492238 0.115128483255 0.114547311336 0.113827971947 0.112955734424 0.111885324622 0.110550486001 0.108885475316 0.106913004422 0.104710297091 0.102264458781 0.0995323983415 0.096472826933 0.0930443660304 0.0892726376107 0.0846374869921 0.0852231282422 0.08420831432 0.084012274549 0.0849094227281 0.0848598375271 0.0847444405787 0.0841458063586 0.0832946462863 0.0821803756048 0.080856746219 0.0793522493319 0.0776944444898 0.0759084080254 0.0740165887721 0.0720436454791 0.0700128504312 0.0679509692248 0.0658948146738 0.0638565403215 0.0619247355234 0.0600502015111 0.0584397081829 0.0569366912197 0.0561755579803 0.0560110559419 0.0561841414572 0.0567005282008 0.0575124723477 0.0576099273275 0.0578417974661 0.0581384862733 0.0584364181171 0.0587176429336 0.0589753559965 0.0592039878653 0.0594019374869 0.0595696598922 0.0597081072978 0.0598171709623 0.0598962950033 0.059951151689 0.0599817070059 0.117565549135 0.117555462106 0.117556590818 0.117559807924 0.117507130717 0.117460243154 0.117422352483 0.117393994163 0.1173879512 0.117391537596 0.117382095033 0.117362429732 0.117346496399 0.11732415047 0.117272639006 0.117149983871 0.117001173561 0.116837773875 0.116662422536 0.116466613393 0.116232960946 0.115943952317 0.11558068497 0.115117217454 0.114528254248 0.113799181234 0.112912883845 0.111823814412 0.110463068275 0.108755707609 0.106733765465 0.104490976609 0.102008006333 0.0992500305766 0.0961891320582 0.0928051972818 0.0891494810302 0.0847573318482 0.0854441146267 0.0845126944136 0.0839264864202 0.0844791296304 0.0840465745953 0.0836500534164 0.0828651010147 0.0818751950129 0.0806537429671 0.0792381622984 0.0776489441087 0.0759079524417 0.0740371654947 0.0720573747674 0.0699933241036 0.0678681656488 0.0657126826991 0.0635650640616 0.0614420639071 0.0594468690023 0.0575132003004 0.0558959303741 0.0543609316004 0.0537269295844 0.0536535145478 0.0539365437529 0.0551534438178 0.0553998859277 0.0555826951166 0.0559173152155 0.0563370843237 0.0567740388702 0.0571699825278 0.057525174442 0.0578318352274 0.0580907465104 0.0583047721597 0.0584777211911 0.0586110433734 0.0587111951055 0.0587790294849 0.0588176139861 0.117558923924 0.117543754029 0.117546324234 0.117545923374 0.117497068106 0.117456180838 0.117422935792 0.117395912156 0.117392413387 0.117394798719 0.11738273615 0.117359523222 0.117339543853 0.117281421074 0.117262064841 0.117131000838 0.116967657217 0.116795749486 0.116623824851 0.116441634493 0.116225507315 0.115951743578 0.115598104038 0.11514137021 0.114560253872 0.113842459121 0.112966514549 0.111879912145 0.110515627071 0.108796615077 0.106761902734 0.104512922868 0.102025443752 0.0992688667682 0.0962212028308 0.0928736444357 0.0892937266411 0.0850787861542 0.0857235213265 0.0849139082527 0.0840414642629 0.0842479612241 0.0834827592082 0.0828122664302 0.0818279242623 0.0806774230407 0.0793240048067 0.0777915698664 0.0760937599283 0.0742466549797 0.0722684663626 0.0701775900442 0.0679979507828 0.065751881426 0.0634744644038 0.0612037176713 0.0589647677609 0.056876483854 0.0548579594824 0.0532302106241 0.051673203499 0.0511815806794 0.0509825307157 0.0512626609528 0.0529204545857 0.0530302350808 0.0534129372085 0.053904861263 0.0544789048921 0.0550835210383 0.0556283441846 0.0561005292887 0.0565012339025 0.056832753478 0.0571001175512 0.0573113402649 0.0574723747303 0.0575922955792 0.0576717382998 0.0577149332629 0.117551601069 0.117536930889 0.117539900442 0.117538823599 0.117493697068 0.117456163264 0.117425270864 0.117399532223 0.117397894291 0.117398562579 0.117385339846 0.117360384284 0.117335930986 0.117310961653 0.11732498547 0.117134969664 0.116935850977 0.116744933577 0.116575130846 0.116418840003 0.116236654789 0.115987930867 0.115650315213 0.11520640308 0.1146426903 0.113949270389 0.113097405948 0.11203511777 0.110698077925 0.109010495641 0.107001985034 0.104773937535 0.102310577416 0.0995763126937 0.0965450358757 0.0932061316954 0.0896314932986 0.0854657774401 0.0859849420717 0.0853320841501 0.0842717557665 0.0841400813127 0.0830985760144 0.0821794919416 0.0809985843964 0.0796785608016 0.0781785850323 0.0765118756819 0.0746868575772 0.0727142220077 0.0706080090178 0.0683835818406 0.0660629824773 0.0636670291083 0.0612349503828 0.0588025833332 0.0564084991654 0.0541848764942 0.0520383598626 0.0503869594963 0.0488695080831 0.048763741566 0.0487408022148 0.048673677397 0.0500173559421 0.0505267363925 0.0511221829398 0.0518122077877 0.0525803900311 0.0533834207828 0.0541080610221 0.0547222294501 0.0552337202721 0.0556499175417 0.0559780107241 0.0562321498208 0.0564242805352 0.0565639585653 0.0566556810408 0.0567020431663 0.117530117151 0.117531847209 0.117533772175 0.117522311777 0.11749675268 0.11746140041 0.117431141038 0.117404463584 0.117403393129 0.117400533046 0.117389248866 0.117369319551 0.117352713359 0.117345450304 0.117362321574 0.117136511911 0.116893048838 0.116676797452 0.11651286402 0.116398845891 0.116264094559 0.116047759375 0.115733547718 0.115311313261 0.114773322719 0.114111421967 0.113296655803 0.112275591548 0.110994699314 0.109388102888 0.107448583135 0.10527190506 0.102865166988 0.100177927991 0.0971672433838 0.0938016751176 0.0901361188943 0.0858279086178 0.0861826857995 0.0857027083995 0.0845607817205 0.0841178079647 0.0828545481621 0.0817185412216 0.0803512054218 0.0788601274301 0.0772063909113 0.0753944272615 0.0734287515889 0.0713151674669 0.0690631709847 0.0666843368903 0.0641973897219 0.061620648429 0.0589961192648 0.0563550861539 0.0537566590752 0.051339992235 0.0489999031455 0.0472608684951 0.045660846695 0.0457277262872 0.0460529435286 0.04848556914 0.0476947663088 0.0480532286896 0.0487517010643 0.049646371291 0.0506396112084 0.0516737367973 0.0526259069163 0.0534114230102 0.0540507862575 0.0545633482043 0.0549630630164 0.0552663154595 0.0554900320839 0.0556480333374 0.0557526445636 0.0558017335711 0.117527419368 0.117531350406 0.117528841548 0.117522508176 0.11752015718 0.117475497692 0.117441573797 0.117416375688 0.117404948125 0.117397860999 0.11739166761 0.117374953676 0.117358805301 0.11735332313 0.117357106242 0.117131837322 0.116834205522 0.116585062209 0.116455844539 0.116381517174 0.116310147512 0.116133988858 0.115845297174 0.115443472896 0.114936408203 0.114318720571 0.113556804781 0.112598975059 0.111396289549 0.109903677028 0.108084894385 0.106004157334 0.103699188505 0.101100528422 0.0981341255613 0.0947198011574 0.0908538223608 0.0861152610785 0.0863035221187 0.0859861038272 0.0848924515545 0.0841749632216 0.0827239602148 0.0814014513967 0.0798643281341 0.0782073090983 0.0763989963899 0.074436601789 0.07232181593 0.0700562215943 0.0676444138545 0.065093193314 0.0624161184693 0.0596274529336 0.0567683524964 0.053862091492 0.0509948828445 0.0483026672677 0.0456952810674 0.0438469711999 0.0420645274761 0.0420037438705 0.0424262320628 0.0442999480586 0.0444146429297 0.0451454862927 0.0461693363414 0.0473749222622 0.0486611779883 0.0499632400281 0.0511867941262 0.0521851064827 0.0529730021928 0.0535908394598 0.0540671654861 0.0544241771655 0.054682680263 0.0548579808964 0.054974343135 0.0550285599911 0.117524732401 0.117530514587 0.117524556211 0.117523833781 0.117526071134 0.117484216421 0.117447537468 0.117417061062 0.117388544961 0.117402669789 0.117394908316 0.117374837888 0.117351154856 0.117336841247 0.117277838856 0.117131064048 0.116766927448 0.116497449011 0.116394237367 0.116379043746 0.116366152906 0.116238212929 0.115981526332 0.115596844914 0.115116914555 0.114553095523 0.11386259694 0.112985568438 0.111875139507 0.110519567016 0.108889579239 0.106970492626 0.104828042521 0.102390845518 0.0995395486075 0.0961095467935 0.0919546690114 0.0862306064331 0.0863348365072 0.086091014423 0.0851993591717 0.0842579845946 0.0826565030906 0.0811970354881 0.0795240503895 0.0777141608851 0.0757543183294 0.0736398117249 0.0713713086983 0.0689469252531 0.0663657637255 0.0636283804126 0.0607409143399 0.0577114935206 0.0545749774419 0.0513431645298 0.0481274506932 0.0450267796348 0.042007951361 0.0400084706931 0.0381925998173 0.0385512211626 0.0389104540508 0.0400543019564 0.0407589552685 0.0419366912251 0.0434038789505 0.0450181104243 0.0466675101821 0.0482847397335 0.0498073227293 0.0510572141035 0.0520169425517 0.0527514827083 0.0533054663916 0.0537135922676 0.0540068516625 0.0542028060825 0.0543285983886 0.0543934008568 0.117518289265 0.117516095656 0.117519999429 0.117521877275 0.117523239528 0.117484759278 0.117451409529 0.117423693115 0.117398796227 0.117414991312 0.117396861014 0.11737223166 0.117341231757 0.11731830486 0.117308881578 0.117271958444 0.116648690711 0.116384806472 0.116378680565 0.116373917556 0.116359614847 0.11632743149 0.116152319211 0.115754841346 0.115283148099 0.114788318819 0.11419630581 0.11342349355 0.112402845713 0.111170704298 0.10978612346 0.10814883919 0.106255897375 0.104100455323 0.101522068974 0.0982613360062 0.0939388915883 0.0866128126215 0.0863546615336 0.0858482828866 0.0850721629463 0.0842284108735 0.0826512163612 0.0811313221151 0.0793546314846 0.0773957580359 0.0752797479643 0.0730090366302 0.0705839660507 0.0679983096184 0.0652438213241 0.0623122046836 0.0591989203857 0.0559025549146 0.0524456778642 0.0488307560306 0.0451877746902 0.0415261553149 0.0378807420715 0.0353420201592 0.0328131766543 0.0338995354474 0.0376076587976 0.0359069034342 0.0367644775329 0.0384453312681 0.0404883145194 0.0426199664796 0.044703047364 0.0466718164287 0.0485061897743 0.0500377088883 0.0511886186656 0.052049857625 0.0526884052348 0.0531486267239 0.0534713427694 0.053686393396 0.0538213503211 0.0538950706916 0.11751516406 0.117512769414 0.117517667345 0.11751878912 0.117518361186 0.117481618358 0.117451988178 0.117427503881 0.117408876699 0.117412663443 0.117394845492 0.117368189126 0.117335293315 0.117313013813 0.117254496766 0.116894734967 0.116298081622 0.116338845144 0.116365071017 0.116340766596 0.116308704487 0.116291302723 0.116227782844 0.115873181796 0.115381956865 0.114990970684 0.114542904636 0.11391829485 0.112959100446 0.111765870622 0.110627151508 0.109413751373 0.107981084435 0.106254946101 0.104219801774 0.101653198267 0.098200428327 0.0932428323221 0.0866695000067 0.0816565274119 0.0839620392008 0.08440905416 0.0830292516801 0.0813767362599 0.0794297608246 0.0772783080565 0.0749812207185 0.0725451199775 0.0699634803694 0.0672208005987 0.0642977499377 0.0611733422862 0.0578274425645 0.0542417251825 0.0504156073216 0.0463417298867 0.0421573357575 0.0377987048042 0.0335455874044 0.0303775017166 0.0261232822481 0.0267631241572 0.0299518105215 0.0296720197616 0.0317877625595 0.0345518489872 0.0374612733739 0.0402583889976 0.0428461188958 0.0451987745107 0.0473349119879 0.0491405154526 0.0504934252095 0.0514825325508 0.0522053451463 0.0527222820265 0.0530769703233 0.0533071103448 0.0534454148133 0.0535095635015 0.117515231175 0.117514752201 0.117516470893 0.117516626924 0.11751574822 0.117474529563 0.117447499325 0.117424588862 0.117401910619 0.117364845521 0.117385311711 0.117353014069 0.117311931396 0.117209699317 0.117020963766 0.116540861275 0.116326242777 0.116369344767 0.116343962929 0.116214944895 0.11618795506 0.116193998558 0.116137744556 0.115956690432 0.115264831391 0.115056904517 0.114832648173 0.114572093631 0.113597793985 0.112182952527 0.111231343884 0.110449251048 0.109677547656 0.108690416971 0.107446662493 0.105914035573 0.103835810044 0.100693261886 0.095970640614 0.0853040508005 0.0854283853636 0.0858979839644 0.0842434361586 0.0820880675898 0.0797681317395 0.077341716279 0.074836635741 0.0722350459489 0.0695092372331 0.0666275539892 0.0635562692126 0.0602589977131 0.0566958098716 0.0528216871576 0.0485932962027 0.043960369516 0.038987971831 0.0335822468186 0.0286627414986 0.0252778908456 0.0199750674786 0.0189059380479 0.0186871525668 0.0215726549021 0.0260334928416 0.0304695036377 0.034520538122 0.0380938559073 0.0412177516851 0.0439510412797 0.0463670301641 0.0484068785974 0.0499437373063 0.0510516162218 0.0518476498906 0.0524121798958 0.0527977082434 0.0530428909677 0.0531829029075 0.0532359080313 0.117515731205 0.117515882326 0.117516332813 0.117514276046 0.117500353196 0.117451033971 0.11743492304 0.117421976431 0.117408162826 0.11739179406 0.117363619627 0.117357840684 0.117327749418 0.117211701795 0.116984485539 0.116664850797 0.116529718653 0.116648565713 0.11665137963 0.115989211661 0.116074485564 0.116110501044 0.116006250056 0.11569026508 0.115363060452 0.115285920349 0.115043776325 0.114747180642 0.114549524693 0.112169345941 0.111400185897 0.1111765945 0.111165347064 0.111208673104 0.111210874068 0.111200569108 0.11120793654 0.111132000704 0.110614794267 0.0952022191494 0.0915057206984 0.0890784968159 0.0860494311268 0.08300615526 0.0801852901228 0.077473874986 0.0747874131422 0.072056237584 0.0692246014808 0.0662440082187 0.0630678883248 0.0596467217473 0.0559229555718 0.0518241484396 0.0472557211529 0.0420819092902 0.0361564328294 0.0291671903404 0.0219806099807 0.0142427457026 0.00462384001823 0.00908785678334 0.00224319730585 0.0118479621501 0.0201239595757 0.0267183075737 0.0320351191471 0.0363719126625 0.0399777584048 0.0430305930123 0.0456688598234 0.0478809507148 0.0495550242376 0.0507559574971 0.0516107571568 0.0522109924055 0.0526199768475 0.0528803327024 0.0530289524684 0.053085879263 0.117515591337 0.117515306843 0.117515328821 0.117508811494 0.117484362009 0.117457116381 0.117438806316 0.117424185286 0.117409898172 0.117395324991 0.117381338079 0.117384362223 0.117365221869 0.117283172408 0.117101628872 0.116839678015 0.116652738358 0.116583313423 0.116456049735 0.116220394228 0.116154906879 0.116151906996 0.116024115427 0.115745728513 0.115452635461 0.11521084857 0.11486788821 0.114468863452 0.113604024544 0.112453434219 0.111821389001 0.111589686417 0.111499390657 0.11145180266 0.111432871743 0.111458970914 0.111550831192 0.111722093755 0.112103306305 0.111865289645 0.100637062427 0.0920960738705 0.0871750520241 0.0834956446607 0.0803939656552 0.0775432296891 0.0747751069725 0.0719881806234 0.0691121588409 0.066090591296 0.0628711649141 0.0593985867971 0.0556073968819 0.0514121591008 0.0466919082425 0.0412576501761 0.0347980961363 0.0266599680445 0.0157716339541 -0.00368808043157 -0.02212459002 -0.00321155574275 0.000359616703328 0.00131491398423 0.0157282671542 0.0242233973035 0.03053129423 0.0353890677462 0.0392967864032 0.0425386424021 0.0453064572293 0.0476112923989 0.0493540468612 0.0506057308289 0.0514952440577 0.0521157441031 0.0525362782593 0.0528056448048 0.0529652493084 0.0530282343137 ) ; boundaryField { frontAndBack { type empty; } upperWall { type zeroGradient; } lowerWall { type zeroGradient; } inlet { type zeroGradient; } outlet { type fixedValue; value uniform 0; } } // ************************************************************************* //
a6bacb3858406f566d521a8f2b882ca6a71e076b
def39f068050b234df9f6909d4277f96b740f11c
/E-olimp/543. Money Matters .cpp
bca870a2617550ab064a681c0a920bab1fa61695
[]
no_license
azecoder/Problem-Solving
41a9a4302c48c8de59412ab9175b253df99f1f28
a920b7bac59830c7b798127f6eed0e2ab31a5fa2
refs/heads/master
2023-02-10T09:47:48.322849
2021-01-05T14:14:09
2021-01-05T14:14:09
157,236,604
5
1
null
null
null
null
UTF-8
C++
false
false
2,294
cpp
543. Money Matters .cpp
#include <iostream> #include <cstdio> #include <cstdlib> #include <algorithm> #include <cstring> #include <string> #include <cctype> #include <stack> #include <queue> #include <list> #include <vector> #include <map> #include <sstream> #include <math.h> #include <bitset> #include <utility> #include <set> #define LL __int64 #define MAXN 10005 #define clr(a, b) memset(a, b, sizeof(a)) #define pb push_back #define mp make_pair using namespace std; class UFDS { private: vector<int> p, rank, setSize; int numSets; public: UFDS(int N) { numSets = N; rank.assign(N, 0); p.assign(N, 0); for (int i = 0; i < N; i++) p[i] = i; setSize.assign(N, 1); } int findSet(int i) { return (p[i] == i) ? i : p[i] = findSet(p[i]); } bool isSameSet(int i, int j) { return findSet(i) == findSet(j); } void unionSet(int i, int j) { if (!isSameSet(i, j)) { int x = findSet(i), y = findSet(j); if (rank[x] > rank[y]) { p[y] = x; setSize[findSet(x)] += setSize[findSet(y)]; } else { p[x] = y; if (rank[x] == rank[y]) rank[y]++; setSize[findSet(y)] += setSize[findSet(x)]; } numSets--; } } int numDisjointSets() { return numSets; } }; int money[MAXN]; map<int,int> calc; int main() { ios_base::sync_with_stdio(false); int n, m, tc; int u, v; cin >> n >> m; UFDS uf(n); for(int i=0; i<n; i++) cin >> money[i]; for (int i = 0; i < m; i++) { cin >> u >> v; uf.unionSet(u, v); } for(int i=0; i<n; i++) { if(calc.count(uf.findSet(i))==0) { calc[uf.findSet(i)] = money[i]; } else { calc[uf.findSet(i)] += money[i]; } } bool can = true; map<int,int>::iterator it; for(it = calc.begin(); it != calc.end(); it++) { if(it->second != 0) can = false; } if(can) printf("POSSIBLE\n"); else printf("IMPOSSIBLE\n"); return 0; }
74ca01bceac79d3409908b8a6a84f48e43c9b92e
e6ed1a784f989a2d2929249e675c0e077e172761
/代码练习/剑指offer/重建二叉树.cpp
6705abce6662f7c6e39a798078d82ead1c1ee3e7
[]
no_license
lovelybigduck/note
ae19d71dcb4121040d7c99c0ecde92bd09bf9f89
abdb53f644096e401ea18d94f0ecb30ee89da1e1
refs/heads/master
2023-03-18T03:31:07.614653
2019-10-09T00:34:51
2019-10-09T00:34:51
null
0
0
null
null
null
null
GB18030
C++
false
false
988
cpp
重建二叉树.cpp
//重建二叉树 #include <vector> #include <iostream> #include <algorithm> using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) {} }; class Solution { public: TreeNode* reConstructBinaryTree(vector<int> pre,vector<int> vin) { if(pre.empty()||vin.empty()) return nullptr; //前序遍历的第一个节点是根 int rootValue=pre[0]; TreeNode *root=new TreeNode(pre[0]); root->left=root->right=nullptr; vector<int>::iterator index=find(vin.begin(),vin.end(),root->val); //该迭代器不可以跨容器使用 vector<int>::iterator index1=pre.begin()+1+distance(vin.begin(),index); vector<int> pL(pre.begin()+1,index1); //全部都是左闭右开 vector<int> pR(index1,pre.end()); vector<int> iL(vin.begin(),index); vector<int> iR(index+1,vin.end()); root->left=reConstructBinaryTree(pL,iL); root->right=reConstructBinaryTree(pR,iR); return root; } };
c410bc247899c9a8c836d164e059e94cf1804cb3
3af87498fd11b1f3c72411e987552fb5062ee335
/test/generated/ObjectIdentifierTest.cpp
1d2142646df302ebe449ecc62b466ee4725884c2
[ "BSL-1.0" ]
permissive
ibiscum/fast_ber
9443c0736a371dd471bea0a6ce9bfbabb2c72fa6
d3e790f86ff91df8b6d6a0f308803606f59452af
refs/heads/master
2023-07-07T06:09:15.684227
2021-08-08T11:27:49
2021-08-08T11:27:49
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,225
cpp
ObjectIdentifierTest.cpp
#include "autogen/object_identifier.hpp" #include "fast_ber/ber_types/Enumerated.hpp" #include "fast_ber/util/BerView.hpp" #include "catch2/catch.hpp" #include <vector> void test_encoding(const fast_ber::ObjectIdentifier<>& oid, const std::vector<uint8_t>& expected) { std::vector<uint8_t> buffer(200, 0x0); const fast_ber::EncodeResult& result = fast_ber::encode(absl::Span<uint8_t>(buffer), oid); REQUIRE(result.success); REQUIRE(absl::Span<const uint8_t>(buffer.data(), result.length) == expected); } void test_decoding(const fast_ber::ObjectIdentifier<>& expected_oid, const std::vector<uint8_t>& data) { fast_ber::ObjectIdentifier<> decoded_oid; const fast_ber::DecodeResult& result = fast_ber::decode(absl::Span<const uint8_t>(data), decoded_oid); REQUIRE(result.success); REQUIRE(decoded_oid == expected_oid); } TEST_CASE("ObjectIdentifier (Compiled): Test encoding") { test_encoding(fast_ber::ObjectIds::rsa_oid, {0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01}); } TEST_CASE("ObjectIdentifier (Compiled): Test decoding") { test_decoding(fast_ber::ObjectIds::rsa_oid, {0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01}); }
24c8f6425363b87c91dc719aafd15842e8fe73cc
b6e0d28db832109be8aa9172086aa168355db965
/mainwindow.cpp
06a790d8f9a8acd7bb5bb6f0272935faf0c95c68
[]
no_license
maddaw/video_editing
a51568220dc08dd9ff8c1dec9f8088f0c81343a6
41b191f90ffc41b71b646c4acc651b47f16e9880
refs/heads/master
2021-05-04T20:59:04.839176
2018-03-19T15:02:22
2018-03-19T15:02:22
119,853,639
0
0
null
2018-02-07T16:46:30
2018-02-01T15:22:18
QMake
UTF-8
C++
false
false
2,809
cpp
mainwindow.cpp
#include "MainWindow.h" #include "ui_mainwindow.h" /* PRZERZUCIC AUDIO SLIDER DO CONTROLEK */ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); setWindowTitle("MyEditor"); mediaFolder = "Temp"; QDir().mkdir(mediaFolder); mediaFolder = QDir().absoluteFilePath(mediaFolder); mainLayout = new QVBoxLayout(this); topLayout = new QHBoxLayout(this); middleLayout = new QHBoxLayout(this); bottomLayout = new QHBoxLayout(this); mediaContainer = new MediaContainer(this); mediaControls = new MediaControls(this, mediaFolder); mediaPlayer = new MediaPlayer(this); mediaPlayer->setPlaylist(mediaContainer->getPlaylist()); editControls = new EditorControls(this, mediaFolder); topLayout->addWidget(mediaPlayer); topLayout->addWidget(mediaControls); middleLayout->addWidget(editControls); mainLayout->addLayout(topLayout); mainLayout->addLayout(middleLayout); mainLayout->addLayout(bottomLayout); connect(mediaControls, &MediaControls::addMediaSignal, mediaContainer, &MediaContainer::addMedia); connect(mediaControls, &MediaControls::removeMediaSignal, mediaContainer, &MediaContainer::removeMedia); connect(mediaControls, &MediaControls::selectMediaSignal, mediaContainer, &MediaContainer::selectMedia); connect(mediaPlayer->getPlayer(), &QMediaPlayer::positionChanged, editControls->getSlider(), &QSlider::setValue); connect(mediaPlayer->getPlayer(), &QMediaPlayer::positionChanged, mediaPlayer, &MediaPlayer::updateTimeStamp); connect(mediaPlayer->getPlayer(), &QMediaPlayer::durationChanged, editControls->getSlider(), &QSlider::setMaximum); connect(mediaPlayer->getPlayer(), &QMediaPlayer::durationChanged, mediaPlayer, &MediaPlayer::updateTimeStamp); connect(mediaPlayer->getSlider(), &QSlider::sliderMoved, mediaPlayer->getPlayer(), &QMediaPlayer::setVolume); connect(editControls->getSlider(), &QSlider::sliderMoved, mediaPlayer->getPlayer(), &QMediaPlayer::setPosition); connect(editControls, SIGNAL(cutMediaSignal(qint64, QString)), mediaContainer, SLOT(cutCurrent(qint64, QString)) ); connect(editControls, SIGNAL(changeSpeedSignal(float,QString)), mediaContainer, SLOT(changeSpeed(float,QString)) ); connect(editControls, &EditorControls::removeAudioSignal, mediaContainer, &MediaContainer::cutAudio); connect(mediaContainer, &MediaContainer::mediaOperationSuccess, mediaControls, &MediaControls::addMediaPublic); connect(mediaContainer, &MediaContainer::mediaRemoved, mediaControls, &MediaControls::removeMediaPublic); this->centralWidget()->setLayout(mainLayout); } MainWindow::~MainWindow() { delete ui; }
bed41eea371d4c4bb9a5085d880601f813fe9581
b67f2b9ecfd2fac7fc3791489b05963252ecb97e
/webots_ros/src/robot/robot.hpp
497ed14bf6a8483bcf54c5152b99858ae18c5ff3
[]
no_license
shaaker-ma/Mechatronics
f74bb7d0c896c584732c262c8ddc829c4d94bab6
6241faa1bb70f0682b5b4544ceca33a3bcd8b65e
refs/heads/main
2023-08-20T12:21:53.085360
2021-09-17T22:24:59
2021-09-17T22:24:59
407,645,783
1
0
null
null
null
null
UTF-8
C++
false
false
1,212
hpp
robot.hpp
#include "../arm/arm.hpp" #include "../base/base.hpp" class Robot{ public: Robot(ros::NodeHandle& n, std::string name, std::vector<std::string> devices); void initGPS(ros::NodeHandle* n); void initCompass(ros::NodeHandle* n); void initCamera(ros::NodeHandle* n); void initArm(ros::NodeHandle* n, std::string controllerName, std::vector<std::string> devices); void compassCallback(const sensor_msgs::MagneticField::ConstPtr &values); void GPSCallback(const sensor_msgs::NavSatFix::ConstPtr &values); void GPSSpeedCallback(const webots_ros::Float64Stamped::ConstPtr &value); void cameraCallback(const sensor_msgs::Image::ConstPtr &values); bool checkTimeStep(); void resetTimeStep(); void passive_wait(double sec); void gotoPos(double x, double z, double a); void gripBox(double x, int level, int column, bool grip); void stock(Orientation o, bool stock); void run(); private: Arm* arm; Base* base; ros::ServiceClient timeStepClient; webots_ros::set_int timeStepSrv; std::string controller_name; ros::Subscriber sub_GPS_speed; ros::Subscriber sub_GPS_32; ros::Subscriber sub_compass_32; };
0db415189fd66ffe343a0a2580596e8c60f7a1aa
5fba83cd647b49a5bc5fbe05cddec953c90f4d7b
/Network/Src/HTTP/HTTPClientAsync.cpp
8a732ba2fcd3cb2fe055b953067d83759c584cc2
[ "MIT" ]
permissive
wangscript007/public
889e408b8369df0a9d35400f79d6dc47299b15fa
5834fac5ba982ff45ea810c5e4de9fe08833cf53
refs/heads/master
2023-03-19T08:00:27.757081
2020-03-08T12:20:53
2020-03-08T12:20:53
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,420
cpp
HTTPClientAsync.cpp
#include "Network/HTTP/Client.h" #include "HTTPCommunication.h" namespace Public { namespace Network{ namespace HTTP { struct AsyncClient::AsyncClientInternal { Mutex mutex; std::map<Client*, weak_ptr<Client> > clientlist; shared_ptr<Timer> poolTimer; AsyncClientInternal() { poolTimer = make_shared<Timer>("HTTPClientAsyncInternal"); poolTimer->start(Timer::Proc(&AsyncClientInternal::onPoolTimerProc, this), 0, 1000); } ~AsyncClientInternal() { poolTimer = NULL; } void onPoolTimerProc(unsigned long) { std::map<Client*, weak_ptr<Client> > clientlisttmp; { Guard locker(mutex); clientlisttmp = clientlist; } for (std::map<Client*, weak_ptr<Client> >::iterator iter = clientlisttmp.begin(); iter != clientlisttmp.end(); iter++) { shared_ptr<Client> client = iter->second.lock(); if (client) { bool ret = client->onPoolTimerProc(); if (ret) { Guard locker(mutex); clientlist.erase(iter->first); } } else { Guard locker(mutex); clientlist.erase(iter->first); } } } }; AsyncClient::AsyncClient() { internal = new AsyncClientInternal; } AsyncClient::~AsyncClient() { { Guard locker(internal->mutex); internal->clientlist.clear(); } SAFE_DELETE(internal); } void AsyncClient::addClient(const shared_ptr<Client>& client) { Guard locker(internal->mutex); internal->clientlist[client.get()] = client; } } } }
ddfcbc5f98853d070c5543da8e6607bb46bc9bfe
432b09a08bd7bf02ebd8db59862246c66235c6a9
/Foundation/UnionFind.h
44b197a5f685cf28a78f3690b8be7c6ea505c924
[]
no_license
KingJoySaiy/Makaveli
1f0ac7c631e78ea6f6e172939b9b88433de658da
bb2062499b7a84aee20aec8c3123ff84480ac6e6
refs/heads/master
2022-12-22T00:58:52.344817
2020-09-23T09:42:13
2020-09-23T09:42:13
99,668,421
0
0
null
null
null
null
UTF-8
C++
false
false
759
h
UnionFind.h
#ifndef INC_233_UNIONFIND_H #define INC_233_UNIONFIND_H class UnionFind { //union-find-set private: int *fa, *rank; public: UnionFind(int n) { //constructor fa = new int[n]; rank = new int[n]; for (int i = 0; i <= n; i++) { fa[i] = i; rank[i] = 1; } } ~UnionFind() { //destructor delete fa; delete rank; } int find(int x) { //find father-node of x if (fa[x] == x) return x; return fa[x] = find(fa[x]); } bool same(int x, int y) { //check whether x & y located in the same set return find(x) == find(y); } void Union(int x, int y) { //union x-node & y-node x = find(x); y = find(y); if (rank[x] < rank[y]) fa[x] = y; else { fa[y] = x; if (rank[x] == rank[y]) rank[x]++; } } }; #endif //INC_233_UNIONFIND_H
9f85013dacd94fd6d4b1d449b0b0c4e56de4f8ad
a8facd0784b9d0a477b969f39e2b3e9be2ae8752
/source/creature.cpp
adc57ac5339e19f2a10f59d9800e09c468f85144
[]
no_license
LuizHenr/Demiourgos
160454fa19aeaf7cbb059b45c42b37efe21eb05f
0d91f10182dc3f6fcd2a2fe9d65ea3c683905104
refs/heads/master
2021-09-05T14:41:03.190113
2018-01-29T00:29:18
2018-01-29T00:29:18
111,836,125
0
0
null
null
null
null
ISO-8859-2
C++
false
false
6,264
cpp
creature.cpp
#include <creature.h> void Criatura::gestacao_mm(){ Criatura::gestacao--; } void Criatura::resguardo_mm(){ Criatura::resguardo--; } void Criatura::idade_pp(){ Criatura::idade++; } void Criatura::fome_mm(){ Criatura::fome--; } void Criatura::sede_mm(){ Criatura::sede--; } void Criatura::mover(posXY posicao2, dimXY dim_campo){ //recebe a posicao p se mover if (posicao2.x <= 0 + Criatura::tamanho) posicao2.x = 1 + Criatura::tamanho; if (posicao2.x >= dim_campo.x - Criatura::tamanho) //limite posicao2.x = dim_campo.x - 1 - Criatura::tamanho; if (posicao2.y <= 0 + Criatura::tamanho) posicao2.y = 1 + Criatura::tamanho; if (posicao2.y >= dim_campo.y - Criatura::tamanho) //limite posicao2.y = dim_campo.y - 1 - Criatura::tamanho; Criatura::posicao = posicao2; } posXY Criatura::aproximar(posXY posicao2){ //linha e coluna (posicao média) da presa mais proximo //--refazer usando a funcao calcula_distamcia int distancia; //distancia entre a presa e o predador mais proximo int nova_distancia; //distancia entre a presa e o predador mais proximo posXY nova_posicao; //lin_aux,col_aux;// //var de distancia recebem o valor absoluto da distancia entre os pontos distancia = calcula_distancia(posicao, posicao2); do{ /*sorteado a posicao -coluna- -linha- 0 1 2 0 0 0 0 1 2 1 1 1 0 1 2 2 2 2 */ nova_posicao.y = (posicao.y - 1) + rand() % 3;// nova_posicao.x = (posicao.x - 1) + rand() % 3;// //var de distancia aux recebem a nova distancia entre a presa e o predador mais proximo nova_distancia = calcula_distancia(nova_posicao, posicao2); } while (nova_distancia >= distancia); return nova_posicao; } posXY Criatura::afastar(posXY posicao2){ //linha e coluna (posicao média) da presa mais proximo //--refazer usando a funcao calcula_distamcia int distancia; //distancia entre a presa e o predador mais proximo int nova_distancia; //distancia entre a presa e o predador mais proximo posXY nova_posicao; //lin_aux,col_aux;// //var de distancia recebem o valor absoluto da distancia entre os pontos distancia = calcula_distancia(posicao, posicao2); do{ /*sorteado a posicao -coluna- -linha- 0 1 2 0 0 0 0 1 2 1 1 1 0 1 2 2 2 2 */ nova_posicao.y = (posicao.y - 1) + rand() % 3;// nova_posicao.x = (posicao.x - 1) + rand() % 3;// //var de distancia aux recebem a nova distancia entre a presa e o predador mais proximo nova_distancia = calcula_distancia(nova_posicao, posicao2); } while (nova_distancia >= distancia); return nova_posicao; } void Criatura::kill(){ Criatura::posicao.x = -1; Criatura::posicao.y = -1; } int Criatura::isAlive(){ if (Criatura::posicao.x == -1 || Criatura::posicao.y == -1) return 0; return 1; } int Criatura::getCodigo(){ return Criatura::codigo; } posXY Criatura::getPosicao(){ return Criatura::posicao; } corRGB Criatura::getCor(){ return Criatura::cor; } bool Criatura::getSexo(){ return Criatura::sexo; } pthread_t Criatura::getMove_td(){ return Criatura::move_td; } int Criatura::getVelocidade(){ if (Criatura::velocidade == -1){ if (Criatura::categoria == 1 || Criatura::categoria == 4) Criatura::velocidade = rand() % 5; else Criatura::velocidade = 5 + rand() % 5; } return Criatura::velocidade; } int Criatura::getIdade_max(){ return Criatura::idade_max; } int Criatura::getVisao_reproducao_max(){ return Criatura::visao_reproducao_max; } int Criatura::getArea_interesse(){ return Criatura::area_interesse; } int Criatura::getTamanho(){ return Criatura::tamanho; } int Criatura::getCategoria(){ return Criatura::categoria; } int Criatura::getSentidos(){ return Criatura::sentidos; } int Criatura::getVisao_reproducao(){ return Criatura::visao_reproducao; } int Criatura::getCod_mae(){ return Criatura::cod_mae; } int Criatura::getCod_parceiro(){ return Criatura::cod_parceiro; } bool Criatura::getFertil(){ if (Criatura::categoria == 2 || Criatura::categoria == 3) return true; else return false; } int Criatura::getResguardo(){ return Criatura::resguardo; } int Criatura::getGestacao(){ return Criatura::gestacao; } int Criatura::getIdade(){ return Criatura::idade; } int Criatura::getFome(){ return Criatura::fome; } int Criatura::getSede(){ return Criatura::sede; } int Criatura::getCod_alvo_fome(){ return Criatura::cod_alvo_fome; } int Criatura::getCod_alvo_sede(){ return Criatura::cod_alvo_sede; } bool Criatura::getDoenca(){ return Criatura::doenca; } bool Criatura::getMutacao(){ return Criatura::mutacao; } bool Criatura::getCamuflado(){ return Criatura::camuflado; } void Criatura::setCor(corRGB c){ Criatura::cor = c; } void Criatura::setCod_parceiro(int c){ Criatura::cod_parceiro = c; } void Criatura::setCod_mae(int c){ Criatura::cod_mae = c; } // void setFertil(bool f){ // fertil=f; } void Criatura::setVelocidade(int v){ Criatura::velocidade = v; } void Criatura::setTamanho(int t){ Criatura::tamanho = t; } void Criatura::setPosicao(posXY p){ Criatura::posicao = p; } void Criatura::setCategoria(int c){ Criatura::categoria = c; } void Criatura::setMove_td(pthread_t m){ Criatura::move_td = m; } void Criatura::setIdade_max(int ida, int var){ Criatura::idade_max = (ida - (ida*var / 100)) + rand() % ((ida*var * 2 / 100) + 1); } void Criatura::setVisao_reproducao_max(int v){ Criatura::visao_reproducao_max = v; } void Criatura::setArea_interesse(int a){ Criatura::area_interesse = a; } void Criatura::setSentidos(int s){ Criatura::sentidos = s; } void Criatura::setVisao_reproducao(int v){ Criatura::visao_reproducao = v; } void Criatura::setResguardo(int r){ Criatura::resguardo = r; } void Criatura::setGestacao(int g){ Criatura::gestacao = g; } void Criatura::setIdade(int i){ Criatura::idade = i; } void Criatura::setFome(int f){ Criatura::fome = f; } void Criatura::setSede(int s){ Criatura::sede = s; } void Criatura::setCod_alvo_fome(int c){ Criatura::cod_alvo_fome = c; } void Criatura::setCod_alvo_sede(int c){ Criatura::cod_alvo_sede = c; } void Criatura::setDoenca(bool d){ Criatura::doenca = d; } void Criatura::setMutacao(bool m){ Criatura::mutacao = m; } void Criatura::setCamuflado(bool c){ Criatura::camuflado = c; }
66d07620eaeada7c1e20873b29dfb8b489aeacf8
3d30e70b254376f0ce9832308515b3b8ab7fc2a2
/clustering/IPartition.h
a512c6fbfd918ceb79c22cf77599f30c702e5262
[]
no_license
klorel/clusterisator
34eb36dec2aeb66bac358e51cec681cd2fd44e4b
4b17c661bf413d76fdd30ea87e6a56b572ea52c3
refs/heads/master
2020-05-31T13:00:38.078631
2017-01-13T14:47:20
2017-01-13T14:47:20
5,205,208
0
0
null
2013-02-18T18:48:25
2012-07-27T14:03:13
C++
UTF-8
C++
false
false
2,886
h
IPartition.h
/* * IPartition.h * * Created on: 4 août 2012 * Author: manuel */ #ifndef I_PARTITION_HPP_ #define I_PARTITION_HPP_ /** * IPartition is aimed to be used in general clustering * * It represents a dynamic partition of the observations */ #include "IndexedList.h" class IPartition { public: typedef IntList::iterator NodePosition; typedef std::vector<NodePosition> NodePositions; typedef std::vector<Int2Double> LabelGraph; typedef std::vector<IntList> LabelLists; typedef IndexedList::iterator iterator; typedef IndexedList::const_iterator const_iterator; public: /** * Define the partition * * @param labels For every observation, its label. Size must equal the number of observations */ virtual void setLabels(IntVector const & labels) = 0; /** * Define the weight of every observation. * * @param weights For every observation, its weights. Size mumst equal the number of observation */ virtual void setWeights(DoubleVector const & weights) = 0; /// Get the number of observations present in the partition virtual int nbObs() const = 0; /// Get the number of used labels virtual int nbLabels() const = 0; /// Get the maximum number of labels allowed. virtual int maxNbLabels() const=0; /// Get the weight of a given observation virtual Double obsWeight(int obs) const=0; /// Get the sum of the weights of the observations contained in a given label virtual Double labelWeight(int label) const=0; /// Get the label in which belong a given observation virtual int label(int obs) const = 0; /// Get the number of observation contained in the given label virtual int sizeOfLabel(int label) const = 0; /** * Returns an arbitrary unused label, assuming one exist. * If every label if used, the behavior is undefined */ virtual int getUnUsedLabel() const = 0; /// @return TRUE is every label is used, FALSE if at least one is empty virtual bool allLabelsUsed() const = 0; /// @return The list of every unused labels virtual IndexedList const & unUsed() const = 0; /// @return TRUE is at least one observation has the given label virtual bool isUsed(int label) const = 0; /// @return The list of every used label virtual IndexedList const & usedLabels() const =0; /// @return The list of every unused label virtual IndexedList const & unUsedLabels() const =0; /// @returns The observations contained by the given label virtual IntList const & observations(int label) const = 0; /// Change the label of one observation virtual bool shift(int observation, int to) = 0; /** * Merge one label into another * * @return The label which contains every observation (the other one is then empty) */ virtual int fusion(int label1, int label2) = 0; virtual ~IPartition(); }; inline IPartition::~IPartition() { } #endif /* IPARTITION_HPP_ */
e7d49e7e6259b7ca8355b0e6487017836d44c6f8
050d27ad2ff3536eb944b04998411d7067aab9a4
/cat3/pizzabonnen/cpp/WouterE.cpp
9e0cf7f98484c0e3900feef4ca0d8c8e685948b6
[]
no_license
UCLeuvenLimburg/vpw
0a96d719b064f6c3015b8815ee3770e700de3a9a
a5146a7b91db6bbefa4dddcf3069d47c25c2506a
refs/heads/master
2022-02-17T14:37:55.646823
2022-02-14T08:16:20
2022-02-14T08:16:20
160,670,367
1
3
null
2019-03-05T09:09:28
2018-12-06T12:16:30
C++
UTF-8
C++
false
false
1,396
cpp
WouterE.cpp
#include <iostream> #include <vector> #include <algorithm> #include <map> using namespace std; int inf = 1'000'000'000; struct ii { int a, b; }; using vi = vector<int>; using vii = vector<ii>; using vb = vector<bool>; map<vb, int> cache; vi pizzas; vii bonnen; int solve(vb used, int bought) { if (cache.find(used) != cache.end()) return cache.at(used); if (bought >= pizzas.size()) return 0; if (all_of(used.begin(), used.end(), [](bool b) {return b; })) { int sum = 0; for (int i = bought; i < pizzas.size(); i++) sum += pizzas.at(i); return sum; } int min = inf; for (int i = 0; i < bonnen.size(); i++) { if (!used.at(i)) { used.at(i) = true; int cost = solve(used, bought + bonnen.at(i).a + bonnen.at(i).b); used.at(i) = false; for (int j = bought; j < pizzas.size() && j < bought + bonnen.at(i).a; j++) cost += pizzas.at(j); if (cost < min) min = cost; } } cache[used] = min; return min; } int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { int ps; cin >> ps; pizzas.clear(); for (int j = 0; j < ps; j++) { int x; cin >> x; pizzas.push_back(x); } int bs; cin >> bs; bonnen.clear(); for (int j = 0; j < bs; j++) { int a, b; cin >> a >> b; bonnen.push_back({ a, b }); } sort(pizzas.rbegin(), pizzas.rend()); cache.clear(); cout << i << " " << solve(vb(bs, false), 0) << endl; } }
818e6688b2f55c22ac2b7dfc1c7f6929d64dd8f8
4e4257e2e5925840f76ecef85ff5d67ff769ca33
/Program/MainProgram.h
b3e50816d7ca2221cfde3ae2e4940536f24393ad
[]
no_license
nosstek/HearthstoneDeckGuide
b9462f20bc158cbdcfe834bebe2573d5181851cc
0ef8d814c3246dd330e69f5f0d59f1453c080d8a
refs/heads/master
2021-01-10T05:44:20.011823
2016-01-18T01:00:11
2016-01-18T01:00:11
48,925,710
0
0
null
2016-01-18T01:00:11
2016-01-02T22:18:10
C++
UTF-8
C++
false
false
78
h
MainProgram.h
#pragma once class MainProgram { public: MainProgram(); ~MainProgram(); };
bc5504af90a27ba75df97ef32411cb022abcc767
36e73dc3889c970df6e6bf9df8a2b8fd92c52737
/hw1/the_rani/the_rani.cpp
207db626879782b3f72168b075147e16e8d4e27f
[]
no_license
guswns3396/CSCI104
82536507c99c2e1932bec2331f82d07d0afbddc9
a8b22351fb6b797d2bbb00f82b8aa71e16e0a332
refs/heads/master
2022-07-09T09:57:39.570112
2020-05-18T03:19:41
2020-05-18T03:19:41
null
0
0
null
null
null
null
UTF-8
C++
false
false
11,517
cpp
the_rani.cpp
#include <iostream> #include <fstream> #include <sstream> #include <stdexcept> #include <string> #include <cmath> using namespace std; class TheRani { public: TheRani(char* input_path, char* output_path); ~TheRani(); // Call execute and handles exceptions void main(); private: int experiment_count; // You will need to track the number of experiments int* subject_counts; // For each, the number of subjects string** subject_history; // And for each subject, their history ifstream input; // Input file stream ofstream output; // Output file stream // to keep track of line number int lnum; // bool to keep track of heap allocation bool usedHeap; // Called in the main method void execute(const string& line); // function to deallocate / delete experiments void deleteExp(int* counts, string** exp, int numExp); // function to check input void checkInput(stringstream& ss, int& val); }; TheRani::TheRani(char* input_path, char* output_path){ // set private variables experiment_count = 0; subject_counts = 0; subject_history = 0; lnum = 0; usedHeap = false; output.open(output_path); input.open(input_path); } TheRani::~TheRani() { deleteExp(subject_counts, subject_history, experiment_count); } void TheRani::deleteExp(int* counts, string** exp, int numExp){ // only deallocate memory if there was memory allocated if(!usedHeap){ return; } // if just 1 experiment // deallocate counts & exp singly if(numExp == 0){ // deallocate subject count singly delete counts; counts = 0; // deallocate exp[0] delete[] exp[0]; exp[0] = 0; // deallocate exp singly delete exp; exp = 0; } // if more than 1 experiment // deallocate counts [] & exp [] else{ // deallocate previous subject count delete[] counts; counts = 0; // deallocate subject history for(int i=0;i<=numExp;i++){ delete[] exp[i]; exp[i] = 0; } delete[] exp; exp = 0; } return; } // Possible helper: read an integer argument from a stream void TheRani::checkInput(stringstream& ss, int& val){ double fraction; double integer; double number; ss >> number; // check if theres enough arguments if(ss.fail() && ss.eof()){ throw invalid_argument("too few arguments"); } // check if number if(ss.fail()){ throw invalid_argument("expected number as argument"); } // check if double fraction = modf(number, &integer); if(fraction > 0){ throw invalid_argument("expected integer as argument"); } // store integer val = (int)integer; } void TheRani::main() { // string to read in each line string line; // check if file correctly open if(!input.is_open()){ this->output << "unable to open file" << endl; return; } // read input file line by line while (getline(input, line)) { // update lnum lnum++; // try to execute the line try { this->execute(line); } catch(exception& e) { // If you use exceptions, make sure the line number is printed here this->output << "Error on line " << lnum << ": " << e.what() << endl; } } // if file is empty => lnum = 0 if(lnum == 0){ this->output << "file is empty" << endl; return; } } void TheRani::execute(const string& line) { string command; stringstream stream(line); // Initialize the stream with the line stream >> command; // Read the first word, which is the command // make it already has had a "START" if (subject_history == 0 && command != "START"){ throw invalid_argument("no subjects yet"); } // commands if (command == "START") { // This code should be edited for error checking int temp; int subject_pool_count; // check for valid input checkInput(stream, temp); subject_pool_count = temp; // make sure it's a valid number if (subject_pool_count <= 0) { throw out_of_range("expected number of subjects to be greater than 0"); } // if already started, erase everything first if(subject_counts != 0 || subject_history != 0){ deleteExp(subject_counts, subject_history, experiment_count); experiment_count = 0; // denote there is no more heap memory usage usedHeap = false; } // notify using heap usedHeap = true; // if everything's good // create initial subject history (exp 0 => subject pool) // and initialize their history subject_history = new string*; *subject_history = new string[subject_pool_count]; for(int i=0;i<subject_pool_count;i++){ subject_history[0][i]=""; } // create array for number of subjects subject_counts = new int; *subject_counts = subject_pool_count; } // ADD command else if(command == "ADD"){ // increment experiment experiment_count++; // temp to store previous subject_history string** history_temp = subject_history; // temp to store previous subject count int* counts_temp = subject_counts; // create new subject history subject_history = new string*[experiment_count+1]; for(int i=0;i<=experiment_count;i++){ // each experiment has at most total number of subjects subject_history[i] = new string[counts_temp[0]]; } // create new subject count subject_counts = new int[experiment_count+1]; // copy previous subject count to new subject count for(int i=0;i<experiment_count;i++){ subject_counts[i] = counts_temp[i]; } // the added element should be zero (no subjects) subject_counts[experiment_count] = 0; // copy previous subject history to new subject history for(int i=0;i<=experiment_count;i++){ for(int j=0;j<subject_counts[i];j++){ subject_history[i][j] = history_temp[i][j]; } } // delete old deleteExp(counts_temp, history_temp, experiment_count-1); } // MOVE command else if(command == "MOVE"){ // int array to store int from stream // 0=>x, 1=>y, 2=>n, 3=>m int args[3]; int x,y,n,m; // check for valid input for(int i=0;i<4;i++){ checkInput(stream,args[i]); } x = args[0]; y = args[1]; n = args[2]; m = args[3]; // make sure the numbers are valid // check if any are negative if(x < 0 || y < 0 || n < 0 || m < 0){ throw out_of_range("argument out of range (negative number)"); } // check if valid experiment if(x > experiment_count || y > experiment_count){ throw out_of_range("argument out of range (invalid experiment)"); } // check if valid subject if(n >= subject_counts[x] || m >= subject_counts[x]){ throw out_of_range("argument out of range (invalid subject)"); } // check if n is smaller than m if(n > m){ throw invalid_argument("invalid range of subjects to move"); } // stringstream and string for updating stringstream update; string s; // convert to string update << y; update >> s; // if moving within same experiment if(x == y){ // if m is the last element in array => do not change positions if(m == subject_counts[x]-1){ // just update n to m with added exp for(int i =n;i<=m;i++){ subject_history[x][i] = subject_history[x][i] + " " + s; } } // if m is not the last element => position change required from n to last else{ // create a temp subject history string* tempsh = new string[m-n+1]; // copy the elements getting moved through MOVE for(int i=n;i<=m;i++){ tempsh[i-n] = subject_history[x][i]; } // shift the elements getting shifted for(int i=m+1;i<subject_counts[x];i++){ subject_history[x][i-n] = subject_history[x][i]; } // put the elements back at the end with exp added int shiftedIndex = n + subject_counts[x] - m - 1; for(int i=shiftedIndex;i<subject_counts[x];i++){ subject_history[x][i] = tempsh[i - shiftedIndex] + " " + s; } // delete temp array delete[] tempsh; tempsh = 0; } } // if moving betweeen experiments else{ // move the subjects by copying and updating // update y subject counts & subject history for(int i=n;i<=m;i++){ // counter for adding subject to exp int counter = subject_counts[y]; // copy subject_history[y][counter] = subject_history[x][i]; // update subject history subject_history[y][counter] = subject_history[y][counter] + " " + s; // update counter & subject counts subject_counts[y]++; } // update x subject counts & subject history int count = 0; for(int i=n;i<=m;i++){ count++; // make sure within range if(m+count < subject_counts[x]){ subject_history[x][n] = subject_history[x][m+count]; } } // update subject history subject_counts[x] -= count; } } // QUERY command else if(command == "QUERY"){ // int array to store from command int args[2]; int x,n; // check for valid input for(int i=0;i<2;i++){ checkInput(stream, args[i]); } x = args[0]; n = args[1]; // make sure input is non negative if(x < 0 || n < 0){ throw out_of_range("argument out of range"); } // make sure input is valid if(x > experiment_count || n >= subject_counts[x]){ throw out_of_range("argument out of range"); } // stringstream to read each string // string for output stringstream exp; string result; // store subject exp history exp << subject_history[x][n]; // output history except if exp 0 while(!exp.fail()){ exp >> result; if(!exp.fail() && result != "0"){ this->output << result << " "; } } this->output << endl; } // any other invalid command else{ throw invalid_argument("command does not exist"); } } int main(int argc, char* argv[]) { if (argc < 3) { cerr << "Please provide an input and output file!" << endl; return 1; } TheRani tr(argv[1], argv[2]); tr.main(); return 0; } // [DONE] must handle new START // [DONE] must handle invalid argument types (doubles, strings, etc) // what if last input is double? => still works // [DONE] must handle excess arguments // [DONE] must handle too few arguments // [DONE] must handle invalid commands // [DONE] must handle out of range arguments // [DONE] must handle if first line is not START // [DONE] START 0? // [DONE] try moving within same exp // [DONE] continue executing after catch // [DONE] no valgrind errors // [DONE] must handle empty file // [DONE] must handle no file
f4a25d82ce2e578d869729ab6cfce33399aff10f
6b2a8dd202fdce77c971c412717e305e1caaac51
/solutions_2453486_0/C++/iitrsonu/tic.cpp
af304ac9aff9fd64f007050b95a4723acf4b0879
[]
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
3,932
cpp
tic.cpp
#include<iostream> #include<cstdio> #include<vector> #include<map> #include<algorithm> #include<string> #include<stack> #include<cstring> #include<utility> #include<cmath> #include<queue> #include<cstdlib> using namespace std; #define LL long long #define REP(i,a,b) for(int i = a;i<b;i++) #define REP0(i,b) REP(i,0,b) #define PB(x) push_back(x) #define MP(x,y) make_pair(x,y) char BOARD[5][5]; void PRINT(char won,char wonby,int cases) { if(won == 'X') printf("Case #%d: X won\n",cases+1); else if(won == 'O') printf("Case #%d: O won\n",cases+1); else if(won == 'i') printf("Case #%d: Game has not completed\n",cases+1); else if(won =='d') printf("Case #%d: Draw\n",cases+1); } void GETIN() { REP0(i,4) scanf("%s",BOARD[i]); getchar();; //getchar(); } int main() { freopen("A-small-attempt0.in","r",stdin); freopen("test.out","w",stdout); int CASES,TEST_CASES = 0; scanf("%d",&CASES); // printf("%d",CASES); getchar(); while(TEST_CASES<CASES) { //printf("%d\n",TEST_CASES+1); char isWON = 'i'; char WONBY = 'n'; GETIN(); int freespace = 0; REP0(j,4) { REP0(k,4) { if(BOARD[j][k] == '.') freespace++; } } REP0(j,4) { if(!strcmp(BOARD[j],"XXXX") || !strcmp(BOARD[j],"XXXT") || !strcmp(BOARD[j],"XXTX") || !strcmp(BOARD[j],"XTXX") || !strcmp(BOARD[j],"TXXX")) { isWON = 'X'; break; } else if(!strcmp(BOARD[j],"OOOO") || !strcmp(BOARD[j],"OOOT") || !strcmp(BOARD[j],"OOTO") || !strcmp(BOARD[j],"OTOO") || !strcmp(BOARD[j],"TOOO")) { isWON = 'O'; break; } } REP0(j,4) { if((BOARD[0][j] =='X' || BOARD[0][j] == 'T') &&(BOARD[1][j] =='X' || BOARD[1][j] == 'T') &&(BOARD[2][j] =='X' || BOARD[2][j] == 'T')&&(BOARD[3][j] =='X' || BOARD[3][j] == 'T')) { isWON = 'X'; WONBY = 'X'; break; } else if((BOARD[0][j] =='O' || BOARD[0][j] == 'T') &&(BOARD[1][j] =='O' || BOARD[1][j] == 'T') &&(BOARD[2][j] =='O' || BOARD[2][j] == 'T')&&(BOARD[3][j] =='O' || BOARD[3][j] == 'T')) { isWON = 'O'; WONBY = 'O'; break; } } if((isWON != 'O' || isWON!='X') && (BOARD[0][0] =='O' || BOARD[0][0] == 'T') &&(BOARD[1][1] =='O' || BOARD[1][1] == 'T') &&(BOARD[2][2] =='O' || BOARD[2][2] == 'T')&&(BOARD[3][3] =='O' || BOARD[3][3] == 'T')) { isWON = 'O'; WONBY = 'O'; } else if((isWON != 'O' || isWON!='X') && (BOARD[0][0] =='X' || BOARD[0][0] == 'T') &&(BOARD[1][1] =='X' || BOARD[1][1] == 'T') &&(BOARD[2][2] =='X' || BOARD[2][2] == 'T')&&(BOARD[3][3] =='X' || BOARD[3][3] == 'T')) { isWON = 'X'; WONBY = 'X'; } else if((isWON != 'O' || isWON!='X') && (BOARD[0][3] =='X' || BOARD[0][3] == 'T') &&(BOARD[1][2] =='X' || BOARD[1][2] == 'T') &&(BOARD[2][1] =='X' || BOARD[2][1] == 'T')&&(BOARD[3][0] =='X' || BOARD[3][0] == 'T')) { isWON = 'X'; WONBY = 'X'; } else if((isWON != 'O' || isWON!='X') && (BOARD[0][3] =='O' || BOARD[0][3] == 'T') &&(BOARD[1][2] =='O' || BOARD[1][2] == 'T') &&(BOARD[2][1] =='O' || BOARD[2][1] == 'T')&&(BOARD[3][0] =='O' || BOARD[3][0] == 'T')) { isWON = 'O'; WONBY = 'O'; } if(isWON == 'i' && freespace == 0) isWON = 'd'; PRINT(isWON,WONBY,TEST_CASES); TEST_CASES++; } }
c8b4ea3b0309aeb831e76723187ca4064bc79a3a
b9f6b4978d5062baac46642dc1cf94f582833e02
/eglibrary-cpp-core/graphics/es/graphics/gl/context/RenderState.cpp
01c38b551699a5c92cef840506744d48d2d91099
[]
no_license
eaglesakura/eglibrary-cpp
ed363e7d4a09fc0c1ebb50af4d18fe06a5675cc4
c7cfebf4ae5cb9747a629b5fffcb65ae9869a363
refs/heads/master
2021-01-19T08:15:59.281103
2015-05-08T16:24:06
2015-05-08T16:24:06
23,229,728
0
0
null
null
null
null
UTF-8
C++
false
false
7,183
cpp
RenderState.cpp
#include "es/graphics/gl/context/RenderState.h" #include <map> #include <thread> using namespace std; namespace es { RenderState::RenderState() { // 必ず一つは生成されるようにする states.push_back(glstates()); // Stateと同期を行う sync(); } RenderState::~RenderState() { } /** * 現在のEGLContext状態に合わせて更新する */ void RenderState::sync() { glstates *cur = get(); cur->flags = 0; GLint temp; // depth check if (glIsEnabled(GL_DEPTH_TEST)) { cur->flags |= GLStates_DepthTest_Enable; } assert_gl(); // cull if (glIsEnabled(GL_CULL_FACE)) { glGetIntegerv(GL_CULL_FACE_MODE, &temp); if (temp == GL_FRONT) { cur->flags |= GLStates_Cull_Front; } else { cur->flags |= GLStates_Cull_Back; } } assert_gl(); // stencil if (glIsEnabled(GL_STENCIL_TEST)) { cur->flags |= GLStates_StencilTest_Enable; } assert_gl(); // viewport { GLint xywh[4] = { 0 }; glGetIntegerv(GL_VIEWPORT, xywh); assert_gl(); cur->viewport.setXYWH((int16_t) xywh[0], (int16_t) xywh[1], (int16_t) xywh[2], (int16_t) xywh[3]); } // scissor { GLint xywh[4] = { 0 }; glGetIntegerv(GL_SCISSOR_BOX, xywh); assert_gl(); cur->scissor.setXYWH((int16_t) xywh[0], (int16_t) xywh[1], (int16_t) xywh[2], (int16_t) xywh[3]); } // framebuffer { glGetIntegerv(GL_FRAMEBUFFER_BINDING, (GLint*) &cur->framebuffer); assert_gl(); } // ブレンドタイプは不明にしておく cur->blendType = GLBlendType_Unknown; } /** * Viewport値を更新する */ void RenderState::viewport(int x, int y, int width, int heidht) { glstates *cur = get(); if (cur->viewport.left != (int16_t) x || cur->viewport.top != (int16_t) y || cur->viewport.width() != (int16_t) width || cur->viewport.height() != (int16_t) heidht) { cur->viewport.setXYWH(x, y, width, heidht); glViewport(x, y, width, heidht); } } void RenderState::clearColorI(uint8_t r, uint8_t g, uint8_t b, uint8_t a) { clearColor((float) r / 255.0f, (float) g / 255.0f, (float) b / 255.0f, (float) a / 255.0f); } void RenderState::clearColor(float r, float g, float b, float a) { glstates *cur = get(); Color rgba = Color::fromRGBAf(r, g, b, a); if (rgba != cur->clear) { cur->clear = rgba; glClearColor(r, g, b, a); } } /** * フレームバッファを使用する */ void RenderState::bindFramebuffer(GLuint framebuffer) { glstates *cur = get(); if (cur->framebuffer != framebuffer) { cur->framebuffer = framebuffer; glBindFramebuffer(GL_FRAMEBUFFER, framebuffer); } } /** * ライン描画の太さを指定する */ void RenderState::lineWidth(const float width) { uint8_t newWidth = (uint8_t) width; glstates *cur = get(); if (cur->lineWidth != newWidth) { glLineWidth(width); cur->lineWidth = newWidth; } } /** * 現在のステートを保存し、新たなステートで上書きする */ void RenderState::push(const glstates &state) { // 一つ積み上げる push(); // ステートを更新する set(state); } /** * 現在のステートを保存する。 */ void RenderState::push() { states.push_back(getCurrent()); } /** * 現在のステートを廃棄し、ステートを以前の状態に戻す */ void RenderState::pop() { // 1つ以上pushされていなければならない。 assert(states.size() >= 2); // 一つ古いステートに直す { const glstates &old = states[states.size() - 2]; set(old); } // ステートを一つ外す states.pop_back(); assert(!states.empty()); } /** * GLのブレンドタイプを指定する */ void RenderState::setBlendType(const GLBlendType_e type) { glstates *cur = get(); if (cur->blendType == type) { // 差分がないなら何もしない return; } static const GLenum sfactor[] = { GL_SRC_ALPHA, GL_SRC_ALPHA, }; static const GLenum dfactor[] = { GL_ONE_MINUS_SRC_ALPHA, GL_ONE }; if (type == GLBlendType_None) { // no blend glDisable(GL_BLEND); } else { glEnable(GL_BLEND); glBlendFunc(sfactor[type], dfactor[type]); } } /** * レンダリングステートを更新する */ void RenderState::setFlags(const glstates_flags flags) { const glstates_flags oldFlags = get()->flags; // 差分をチェックする const glstates_flags diffFlags = oldFlags ^ flags; if (!diffFlags) { // 差分がないなら何もしない return; } if (diffFlags & GLStates_DepthTest_Enable) { // 深度チェックが切り替わった if (flags & GLStates_DepthTest_Enable) { glEnable(GL_DEPTH_TEST); } else { glDisable(GL_DEPTH_TEST); } } // back cullingを切り替える if (diffFlags & GLStates_Cull_Back) { if (flags & GLStates_Cull_Back) { glEnable(GL_CULL_FACE); glCullFace(GL_BACK); } else { glDisable(GL_CULL_FACE); } } else if (diffFlags & GLStates_Cull_Front) { // frontが切り替わった if (flags & GLStates_Cull_Front) { glEnable(GL_CULL_FACE); glCullFace(GL_FRONT); } else { glDisable(GL_CULL_FACE); } } // stencil test if (diffFlags & GLStates_StencilTest_Enable) { // ステンシルチェックが切り替わった if (flags & GLStates_StencilTest_Enable) { glEnable(GL_STENCIL_TEST); } else { glDisable(GL_STENCIL_TEST); } } // フラグの上書き get()->flags = flags; } /** * ステートを更新する */ void RenderState::set(const glstates &state) { glstates *cur = get(); setFlags(state.flags); setBlendType(state.blendType); bindFramebuffer(state.framebuffer); // viewport check if (cur->viewport != state.viewport) { glViewport(state.viewport.left, state.viewport.top, state.viewport.width(), state.viewport.height()); cur->viewport = state.viewport; } // scissor check if (cur->scissor != state.scissor) { if (state.isDisableScissor()) { glDisable(GL_SCISSOR_TEST); } else { glEnable(GL_SCISSOR_TEST); glScissor(state.scissor.left, state.scissor.top, state.scissor.width(), state.scissor.height()); } cur->scissor = state.scissor; } // clear color if (cur->clear != state.clear) { glClearColor(state.clear.rf(), state.clear.gf(), state.clear.bf(), state.clear.af()); cur->clear = state.clear; } } /** * バッファを全てアンバインドしてクリアーな状態にする */ void RenderState::unbindBuffers() { glBindBuffer(GL_ARRAY_BUFFER, 0); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); glBindRenderbuffer(GL_RENDERBUFFER, 0); bindFramebuffer(0); } }
ab7737802136697fcecafefb656d9e2ecabf6f3d
f6bba47c42799967ad8018352b721337f346b106
/engunits/force.h
24b53d4ddf523156164983c13817facabf05610f
[ "MIT" ]
permissive
AzamBham/EngUnits
f4dfe97e8f09abf45f2fa83fe7faf126edcc150c
3264d04088b57548e6a6f6691e5a5f0616d630e2
refs/heads/master
2020-06-09T18:40:59.962862
2019-11-29T22:31:17
2019-11-29T22:31:17
null
0
0
null
null
null
null
UTF-8
C++
false
false
595
h
force.h
#ifndef __ENGUNITS_FORCE_H #define __ENGUNITS_FORCE_H #include<iostream> #include<string> #include "../engunits/_abstract/abstract_unit.h" #include "../engunits/_conversion/force_conversion.h" namespace engunits::force{ class MegaNewtons: public ForceUnit<MegaNewtons> { public: using ForceUnit<MegaNewtons>::ForceUnit; constexpr static double conversion = conversion::FO_MEGANEWTONS; const std::string symbol() const override { return "MN"; } }; } namespace engunits::literals{ ADD_LITERALS(force::Newtons, N); ADD_LITERALS(force::MegaNewtons, MN); } #endif
690129af38065bf3b1f6706c76868ada929581c5
4ee14db026e21269380c485f0756a5dcdeefe5a2
/common/include/RX/RXRenderObjectDX9.h
9c41b6fb46d0e1cb0cab60800a0fc9a335e00132
[]
no_license
ruvendix/CPP-Game-Programming-Training
ec4093e167ffbe7551fd4ccdaa6fc43030285a3a
9264805be932bc0ea168d0891ca745ae013813c6
refs/heads/master
2020-03-31T09:56:13.751695
2019-05-16T15:57:51
2019-05-16T15:57:51
152,115,926
0
0
null
null
null
null
UHC
C++
false
false
1,415
h
RXRenderObjectDX9.h
/*==================================================================================== * * Copyright (C) Ruvendix. All Rights Reserved. * * <작성 날짜> * 2018-10-15 * * <파일 내용> * 렌더링되는 오브젝트의 기본 클래스입니다. * ====================================================================================*/ #ifndef RXRENDEROBJECTDX9_H__ #define RXRENDEROBJECTDX9_H__ #include "common.h" #include "RXVertexBufferDX9.h" namespace RX { class DLL_DEFINE RXRenderObjectDX9 { public: RXRenderObjectDX9(); virtual ~RXRenderObjectDX9(); void AllocVertexBuffer(); void AllocIndexBuffer(); void CreateVertexBuffer(); void CreateIndexBuffer(INT32 triangleCnt); void InsertVertex(FLOAT rX, FLOAT rY, FLOAT rZ, DWORD dwColor); void InsertVertex(const D3DXVECTOR3& vPos, DWORD dwColor); void InsertIndex(WORD first, WORD second, WORD third); HRESULT DrawPrimitive(); HRESULT DrawIdxedPrimitive(); // ==================================================================================== // Setter void setPrimitiveType(D3DPRIMITIVETYPE primitiveType) { m_primitiveType = primitiveType; } private: RX::RXVertexBufferDX9* m_pVB; // 정점 버퍼입니다. RX::RXIndexBufferDX9* m_pIB; // 인덱스 버퍼입니다. D3DPRIMITIVETYPE m_primitiveType; // 렌더링 방식입니다. }; } // namespace RX end #endif
ec7aa29498989cced7f8188060c66e09ec654391
58c41bfbdc3f7f5deac0ce9863fb88eb2a202e31
/MeteoxQuest/character.cpp
71a11ccde5961f743a3b11707ef864c29ef887d7
[]
no_license
Malpp/MeteoxQuest
c4617d3e646199419cd705489aaadd64ea2e414d
1d1d3fb13f0539b0fbebff7c2ca86d1ee11ca151
refs/heads/master
2021-08-30T13:34:21.956894
2017-12-18T05:04:22
2017-12-18T05:04:22
111,315,394
0
0
null
null
null
null
UTF-8
C++
false
false
1,166
cpp
character.cpp
#include "stdafx.h" #include "character.h" Character::Character( const sf::Vector2f& pos, const float angle, sf::Texture* texture, const sf::Vector2f& size, const int no_frames, const int no_states, const float frame_delay, const float move_speed, const int life, Color color, const int damage, const GameType type) : GameObject(pos, angle, texture, size, no_frames, no_states, frame_delay, life, color, damage, type) { movespeed_ = move_speed; weapon_ = nullptr; } Character::~Character() { delete weapon_; } void Character::update(const float delta_time, LevelBase* level) { weapon_->update(delta_time); if (velocity_.x != 0 && velocity_.y != 0) { velocity_.x *= 0.7071; velocity_.y *= 0.7071; } GameObject::update(delta_time, level); } void Character::up() { velocity_.y -= movespeed_; } void Character::down() { velocity_.y += movespeed_; } void Character::left() { velocity_.x -= movespeed_; } void Character::right() { velocity_.x += movespeed_; } void Character::fire(LevelBase* level) { weapon_->fire(level, this); } Weapon* Character::get_weapon() const { return weapon_; }
87c1a0b5badaf8faa5ef62437b15ab2d7988737f
da8288574cf44006a1fc09dee5aba85386c808a5
/bullet.cpp
9cb48acbe4f16079a616a13ae2e3a4a7efc131eb
[]
no_license
jjinijj/Project_HollowKnight
f168bfd24e5a73b74db2d1fb995be906b8c62a22
19a64a4a9281be72d84597ae87c9f34feb80f008
refs/heads/master
2020-04-27T07:46:01.397758
2019-03-31T16:31:00
2019-03-31T16:31:00
174,146,983
0
1
null
null
null
null
UTF-8
C++
false
false
3,645
cpp
bullet.cpp
#include "stdafx.h" #include "bullet.h" #include "bulletState.h" HRESULT bullet::init() { return S_OK; } HRESULT bullet::init( UINT uid ,float x, float y ,float angle, float speed, float radius ,const char* moveimgName, const char* pangimgName) { actorBase::init(uid, x, y); _width = radius; _height = radius; _colWidth = radius; _colHeight = radius; _lifeTime = 0.f; _type = eActor_Bullet; { image* img = IMAGEMANAGER->findImage(moveimgName); ANIMANAGER->addArrayFrameAnimation( _uid, eMOVE, moveimgName , 0, img->GetMaxFrameX(), 5, true); } { image* img = IMAGEMANAGER->findImage(pangimgName); ANIMANAGER->addArrayFrameAnimation( _uid, ePANG, pangimgName , 0, img->GetMaxFrameX(), 5, false); } _isAppear = true; _speed = speed; _radius = radius; _angle = angle; _colPos = {_x, _y}; _dir = (angle < PI / 2) ? eRIGHT : eLEFT; return S_OK; } void bullet::release() { actorBase::release(); clear(); } void bullet::update() { actorBase::update(); updateCollision(); _lifeTime += TIMEMANAGER->getElapsedTime(); } void bullet::render() { actorBase::render(); //if (_isDebugMode) //{ // RECT collision = { (int)(_colPos.x - _radius) // , (int)(_colPos.y - _radius) // , (int)(_colPos.x + _radius) // , (int)(_colPos.y + _radius) }; // // D2DMANAGER->drawRectangle(D2DMANAGER->_defaultBrush // , (float)collision.left, (float)collision.top // , (float)collision.right, (float)collision.bottom); //} } ACTORPACK* bullet::makePack() { return nullptr; } void bullet::loadPack(ACTORPACK * pack) { } void bullet::move() { } void bullet::clear() { _x = 0.f; _y = 0.f; _angle = 0.f; _speed = 0.f; _radius = 0.f; _isAppear = false; _lifeTime = 0.f; SAFE_RELEASE(_state); SAFE_RELEASE(_nextState); SAFE_DELETE(_state); SAFE_DELETE(_nextState); } void bullet::hitSomething() { bulletState* bs = new bulletPang; bs->init(this); changeState(bs); } bool bullet::isPang() { return (_state->getState() == ePANG); } void bullet::updateCollision() { _collision = {_colPos.x - _colWidth, _colPos.y - _colHeight ,_colPos.x + _colWidth, _colPos.y + _colHeight}; _rc = {_x - _width, _y - _height ,_x + _width, _y + _height}; } HRESULT linearBullet::init( UINT uid ,float x, float y ,float angle, float speed, float radius ,const char* moveimgName, const char* pangimgName) { bullet::init(uid, x, y, angle, speed, radius, moveimgName, pangimgName); _subType = eLINEARBULLET; bulletState* bs = new bulletMove; bs->init(this); _state = bs; _state->start(); return S_OK; } void linearBullet::update() { bullet::update(); } void linearBullet::move() { float x = cosf(_angle) * _speed; float y = sinf(_angle) * _speed; _x += x; _y += y; _colPos.x += x; _colPos.y += y; bullet::move(); } HRESULT arcBullet::init( UINT uid ,float x, float y ,float angle, float speed, float radius ,const char* moveimgName, const char* pangimgName) { bullet::init(uid, x, y, angle, speed, radius, moveimgName, pangimgName); _subType = eARCBULLET; _startPos = {x, y}; _gravity = 0.5f; bulletState* bs = new bulletMove; bs->init(this); _state = bs; _state->start(); return S_OK; } void arcBullet::update() { bullet::update(); _time += 0.5f; move(); } void arcBullet::move() { _x = _startPos.x + -cosf(_angle) * _time * _speed * 2; _y = _startPos.y - (sinf(_angle) * _time *( _speed * 2 ) - (float)(_gravity * pow(_time, 2))); } void arcBullet::clear() { bullet::clear(); _startPos = {}; _time = 0.f; _gravity = 0.f; }
c74f20d60732e8af61361f311eda5561af6afeea
6086964a2d8c3d22a1473b3b1dcb036e8ac8a824
/test_impl.h
29265c9bbc545e95e40902ebe7b826b4e6ed569c
[]
no_license
devyueightfive/sorting
610c2bc746283a9f1803a0d2a5fa233cad4eb012
f9392bc5871ae0d25628a11f64463983cd0e744e
refs/heads/master
2020-05-18T05:38:44.692886
2019-04-30T22:37:05
2019-04-30T22:37:05
184,213,319
0
0
null
null
null
null
UTF-8
C++
false
false
540
h
test_impl.h
// // Created by yuri on 01.05.19. // #ifndef SORT_TEST_IMPL_H #define SORT_TEST_IMPL_H template<typename Function, typename Parameters> void test_function(const std::string &message, Function fun, Parameters params) { std::cout << message << std::endl; //timer vars std::clock_t start; double duration; start = std::clock(); //run function fun(params); duration = (std::clock() - start) / (double) CLOCKS_PER_SEC; std::cout << "Time of running = " << duration << "\n\n"; } #endif //SORT_TEST_IMPL_H
617182f27b6507b346b06e303bae1f8f6e40d974
6b40e9cba1dd06cd31a289adff90e9ea622387ac
/Develop/mdk/RealSpace3/RActorNodePhysique.h
74f289013fafd57ab25b189db65f812a881c921a
[]
no_license
AmesianX/SHZPublicDev
c70a84f9170438256bc9b2a4d397d22c9c0e1fb9
0f53e3b94a34cef1bc32a06c80730b0d8afaef7d
refs/heads/master
2022-02-09T07:34:44.339038
2014-06-09T09:20:04
2014-06-09T09:20:04
null
0
0
null
null
null
null
UHC
C++
false
false
1,731
h
RActorNodePhysique.h
#pragma once #include "RActorNode.h" #include "MMemPool.h" namespace rs3 { /// RActorNodePhysique 는 CPU physique class RS_API RActorNodePhysique : public RActorNode { MDeclareRTTI; protected: unsigned int m_nLastUpdatedFrame; ///< 한 프레임 내의 중복업데이트를 막기 위한 변수 //bool m_bResetVertexAgainstMatrix; // 베이스 매트릭스 Inv에 곱해졌는지 public: explicit RActorNodePhysique(ACTOR_NODE_TYPE eActorNodeType); virtual ~RActorNodePhysique(void); virtual void UpdateTransformAndVertex(); virtual void ResetTransform(); /// cpu 로 physique 를 처리하는 펑션 int UpdatePoint_SoftPhysiqueAnimation(); virtual void RenderNormal(DWORD dwColor); // 디버깅 인포 : 노멀 virtual void RenderWire(DWORD dwColor); // 디버깅 인포 : 와이어 virtual void RenderPrimitive(int index); // 마테이얼에 열견된 버텍스의 DP virtual void RenderAllNodePrimitive(); virtual bool OnPick(RPICKINFO& pickInfo); virtual bool Validate(); //virtual bool ResetVertexAgainstMatrix(); // 피직은 버텍스를 베이스 매트릭스 Inv에 곱해진 결과로 가지고 있는다. }; class RS_API RActorNodePhysiqueGPU : public RActorNodePhysique, public MMemPool<RActorNodePhysiqueGPU, 50000> { friend RActor; MDeclareRTTI; public: RActorNodePhysiqueGPU(void); virtual ~RActorNodePhysiqueGPU(void); virtual void SetShaderTransformConstant(const RMatrix& matView, const RMatrix& matViewProj); virtual void RenderPrimitive(int index); // 마테이얼에 열견된 버텍스의 DP virtual void RenderAllNodePrimitive(); }; }
807c519ad270f5feca61890d5569ed5c89493743
a162830776a07c5d16f1c43b70c17b979af24526
/sort/insert_sort.cpp
f8a28ccec67532cf5db397b887eb318fe997e705
[]
no_license
fancy2110/algorithm
e46c9440b05ca2b69f8fae6cfe0fef6caf5d1cb6
d564763b28e2141981c0a974455ced1b490cc7ae
refs/heads/master
2022-02-22T15:15:12.575997
2022-01-28T03:57:09
2022-01-28T03:57:09
107,639,570
0
0
null
null
null
null
UTF-8
C++
false
false
1,116
cpp
insert_sort.cpp
/** * 插入排序 * * @author 樊溪 * @date 2017/10/27 */ #include<iostream> #include<fstream> #include<vector> using namespace std; /** * */ int sort(vector<int> & data, bool reverse) { int size = data.size(); int min = 0; int min_pos = 0; for(int i=0; i < size; i++) { min = data[i]; for (int j = size - 1; j > i; --j) { if (min < data[j]) { continue; } min = data[j]; min_pos = j; } int num = data[i]; data[i] = min; data[min_pos] = num; } return 0; } int main() { vector<int> items; ifstream in_data("in.dat"); if (! in_data.is_open()) { std::cout << "File name error" << std::endl; return -1; } int i; while(in_data >> i) { items.push_back(i); } sort(items, true); ofstream out_data("out.txt"); for (vector<int>::iterator it = items.begin(); it != items.end(); ++it) { out_data << *it << endl; } out_data.close(); return 1; }
7c6296cb704d99694dbed454cb15edaff8d257a9
2fceedc14d81d9fcd4ae515522e10feca48ff74a
/4.21第九周实验课实验1/第九周实验课实验1/第九周实验课实验1Dlg.cpp
55abaf3a24137673485e402be30bb8d6c6fe22b4
[]
no_license
Ella666666/66666
f9758fdf91c8c872475f81854d451e6d117a0616
f25303cdb52cd5a2b793d7e47e0c2cbf46f76c60
refs/heads/master
2022-11-20T00:42:55.974532
2020-07-04T01:26:21
2020-07-04T01:26:21
266,958,955
0
0
null
null
null
null
GB18030
C++
false
false
5,597
cpp
第九周实验课实验1Dlg.cpp
// 第九周实验课实验1Dlg.cpp : 实现文件 // #include "stdafx.h" #include "第九周实验课实验1.h" #include "第九周实验课实验1Dlg.h" #include "afxdialogex.h" #ifdef _DEBUG #define new DEBUG_NEW #endif #include"string" #include"iostream" #include"fstream" using namespace std; // 用于应用程序“关于”菜单项的 CAboutDlg 对话框 class CAboutDlg : public CDialogEx { public: CAboutDlg(); // 对话框数据 #ifdef AFX_DESIGN_TIME enum { IDD = IDD_ABOUTBOX }; #endif protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 // 实现 protected: DECLARE_MESSAGE_MAP() }; CAboutDlg::CAboutDlg() : CDialogEx(IDD_ABOUTBOX) { } void CAboutDlg::DoDataExchange(CDataExchange* pDX) { CDialogEx::DoDataExchange(pDX); } BEGIN_MESSAGE_MAP(CAboutDlg, CDialogEx) END_MESSAGE_MAP() // C第九周实验课实验1Dlg 对话框 C第九周实验课实验1Dlg::C第九周实验课实验1Dlg(CWnd* pParent /*=NULL*/) : CDialogEx(IDD_MY1_DIALOG, pParent) { m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); } void C第九周实验课实验1Dlg::DoDataExchange(CDataExchange* pDX) { CDialogEx::DoDataExchange(pDX); } BEGIN_MESSAGE_MAP(C第九周实验课实验1Dlg, CDialogEx) ON_WM_SYSCOMMAND() ON_WM_PAINT() ON_WM_QUERYDRAGICON() ON_LBN_SELCHANGE(IDC_LIST1, &C第九周实验课实验1Dlg::OnLbnSelchangeList1) ON_EN_CHANGE(IDC_EDIT1, &C第九周实验课实验1Dlg::OnEnChangeEdit1) ON_BN_CLICKED(IDC_BUTTON1, &C第九周实验课实验1Dlg::OnBnClickedButton1) ON_BN_CLICKED(IDCANCEL, &C第九周实验课实验1Dlg::OnBnClickedCancel) ON_WM_DESTROY() END_MESSAGE_MAP() // C第九周实验课实验1Dlg 消息处理程序 BOOL C第九周实验课实验1Dlg::OnInitDialog() { CDialogEx::OnInitDialog(); filename = _T(""); // 将“关于...”菜单项添加到系统菜单中。 CString filter, strtext; CFileDialog dlg(TRUE, NULL, NULL, OFN_HIDEREADONLY, filter); if (dlg.DoModal() == IDOK) { CString str; CStdioFile file; filename = dlg.GetPathName(); if (!file.Open(filename, CFile::modeRead)) { ::AfxMessageBox(_T("文件打开失败。")); } strtext = _T(""); while (file.ReadString(strtext)) { list.AddString(strtext); } } // IDM_ABOUTBOX 必须在系统命令范围内。 ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); ASSERT(IDM_ABOUTBOX < 0xF000); CMenu* pSysMenu = GetSystemMenu(FALSE); if (pSysMenu != NULL) { BOOL bNameValid; CString strAboutMenu; bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX); ASSERT(bNameValid); if (!strAboutMenu.IsEmpty()) { pSysMenu->AppendMenu(MF_SEPARATOR); pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); } } // 设置此对话框的图标。 当应用程序主窗口不是对话框时,框架将自动 // 执行此操作 SetIcon(m_hIcon, TRUE); // 设置大图标 SetIcon(m_hIcon, FALSE); // 设置小图标 // TODO: 在此添加额外的初始化代码 return TRUE; // 除非将焦点设置到控件,否则返回 TRUE } void C第九周实验课实验1Dlg::OnSysCommand(UINT nID, LPARAM lParam) { if ((nID & 0xFFF0) == IDM_ABOUTBOX) { CAboutDlg dlgAbout; dlgAbout.DoModal(); } else { CDialogEx::OnSysCommand(nID, lParam); } } // 如果向对话框添加最小化按钮,则需要下面的代码 // 来绘制该图标。 对于使用文档/视图模型的 MFC 应用程序, // 这将由框架自动完成。 void C第九周实验课实验1Dlg::OnPaint() { if (IsIconic()) { CPaintDC dc(this); // 用于绘制的设备上下文 SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0); // 使图标在工作区矩形中居中 int cxIcon = GetSystemMetrics(SM_CXICON); int cyIcon = GetSystemMetrics(SM_CYICON); CRect rect; GetClientRect(&rect); int x = (rect.Width() - cxIcon + 1) / 2; int y = (rect.Height() - cyIcon + 1) / 2; // 绘制图标 dc.DrawIcon(x, y, m_hIcon); } else { CDialogEx::OnPaint(); } } //当用户拖动最小化窗口时系统调用此函数取得光标 //显示。 HCURSOR C第九周实验课实验1Dlg::OnQueryDragIcon() { return static_cast<HCURSOR>(m_hIcon); } void C第九周实验课实验1Dlg::OnLbnSelchangeList1() { UpdateData(true); int i = list.GetCurSel(); CString str; list.GetText(i, str); s = str; UpdateData(false); // TODO: 在此添加控件通知处理程序代码 } void C第九周实验课实验1Dlg::OnEnChangeEdit1() { // TODO: 如果该控件是 RICHEDIT 控件,它将不 // 发送此通知,除非重写 CDialogEx::OnInitDialog() // 函数并调用 CRichEditCtrl().SetEventMask(), // 同时将 ENM_CHANGE 标志“或”运算到掩码中。 // TODO: 在此添加控件通知处理程序代码 } void C第九周实验课实验1Dlg::OnBnClickedButton1() { UpdateData(true); int i = list.GetCurSel(); list.DeleteString(i); list.InsertString(i, s); UpdateData(false); // TODO: 在此添加控件通知处理程序代码 } void C第九周实验课实验1Dlg::OnBnClickedCancel() { // TODO: 在此添加控件通知处理程序代码 CDialogEx::OnCancel(); } void C第九周实验课实验1Dlg::OnDestroy() { CDialogEx::OnDestroy(); if (filename != _T("")) { ofstream out(filename); CString r; int i = list.GetCount(); //out.flush(); for (int k = 0; k < i; k++) { list.GetText(k, r); out << CT2A(r.GetString()) << endl; //这种输出流是默认刷新文件的 } out.flush(); out.close(); } AfxMessageBox(_T("系统已自动保存更改")); // TODO: 在此处添加消息处理程序代码 }
37c21cf754a99a05775c149b09f738e1d9a202e5
60f0c7f07115a15a26b758c3ad12cbf64dd62d26
/Source/CADialogue/Private/CADialogueInstanceInterface.cpp
1984aa2d00b43efb3da16ddfdc025b6ac4f2cf9a
[ "MIT" ]
permissive
cmacnair/Catch-All-Dialogue-UE4
18846c80fbb08511304167d7b849e5b914dd45cc
f2cf5b5b658471ab47afeb047dbe25f6100c3bf7
refs/heads/master
2022-09-05T13:34:21.346695
2020-05-28T07:52:37
2020-05-28T07:52:37
266,902,410
1
0
null
null
null
null
UTF-8
C++
false
false
72
cpp
CADialogueInstanceInterface.cpp
#include "CADialogueInstanceInterface.h" #include <Sound/SoundBase.h>
aa1bd5a2733e0143c43662629eb35c544964872d
aa36142da18b5b18fa762bf484beab8be65a2cda
/Lesson 08/03.cpp
7f1ea9dd86023454204151425967a35e8a817a2e
[]
no_license
eyadhr/C-
bfdc35d68a06dfabb23cd1e4b056c166c2bcf45f
785dad975f073e51a1d21ff6d625cd74bf3c439c
refs/heads/master
2022-10-01T18:47:52.494847
2020-06-07T12:16:12
2020-06-07T12:16:12
null
0
0
null
null
null
null
UTF-8
C++
false
false
436
cpp
03.cpp
#include <stdio.h> void avg(); int mul_AB(int x, int y); int main() { avg(); } void avg() { int cnt=0; float avg, num, sum = 0; printf("enter num : "); scanf("%f",&num); while (num) { sum+=num; cnt++; printf("enter num : "); scanf("%f",&num); } avg=(float)sum/cnt; printf("avg %f , sum %f",avg,sum); } int mul_AB(int x, int y) { int sum = x * y; return sum; }
29f13a827a1233a6d8e2d6f76183fcc1e0a96ac2
ae7d0cee8e72d87730f2009a7c083562c6124e3e
/Divide And Conquer/MaximumSubArray.cpp
d37b178e53571131b99b242f553e4d520d8889cb
[]
no_license
baguilar1998/Algorithms
236462e9e4414e5da86192190dc0a0f7c838802f
42ce870b3c4be6e25ab0978174acc18a1ff1a165
refs/heads/master
2020-05-28T05:37:59.853433
2020-04-11T01:31:31
2020-04-11T01:31:31
188,896,619
3
0
null
null
null
null
UTF-8
C++
false
false
1,537
cpp
MaximumSubArray.cpp
#include <iostream> using namespace std; int* findMaximumSubArray(int arr[],int low,int high); int* findMaximumCrossSubArray(int arr[],int low,int mid, int high); int* findMaximumSubArray(int arr[],int low,int high) { if (low==high) { int* ans = new int[3]; ans[0] = low; ans[1] = high; ans[2] = arr[0]; return ans; } int mid = (low+high)/2; int* left = findMaximumSubArray(arr,low,mid); int* right = findMaximumSubArray(arr,mid+1,high); int* cross = findMaximumCrossSubArray(arr,low,mid,high); if(left[2] >= right[2] && left[2] >= cross[2]) { delete right; delete cross; return left; } if(right[2] >= left[2] && right[2] >= cross[2]) { delete left; delete cross; return right; } delete left; delete right; return cross; } int* findMaximumCrossSubArray(int arr[],int low,int mid, int high) { int* cross = new int[3]; int leftSum = 0; int leftIndex = 0; int sum=0; for(int i=mid; i>=low; i--) { sum+=arr[i]; if(sum > leftSum) { leftSum = sum; leftIndex = i; } } int rightSum = 0; int rightIndex = 0; sum = 0; for(int i = mid+1; i<=high; i++) { sum+=arr[i]; if(sum > rightSum) { rightSum = sum; rightIndex = i; } } cross[0]=leftIndex; cross[1]=rightIndex; cross[2]=leftSum+rightSum; return cross; } int main() { int array [] = {13,-3,-25,20,-3,-16,-23,18,20,-7,12,-5,-22,15,-4,7}; int* answer = findMaximumSubArray(array,0,15); cout<<"The maximum subarray is "; for (int i = *(answer); i <= *(answer+1); i++) cout<<array[i]<< " "; }
40c3893d0eaa5fda45d739c5553a6d5ecee49441
8d98dd0706da1db7ca0aea2e24b7a241867364c4
/ComponentCanvas.h
3e13a6d7a85ad2b88b6cd7834e8065564a1e227d
[ "MIT" ]
permissive
MORTAL2000/Project3
7e9549187e4d58462b62fb3ce5393ac565993a63
5076dbaf4eced4eb69bb43b811684206e62eded4
refs/heads/master
2020-08-29T16:43:19.980686
2017-07-06T12:30:48
2017-07-06T12:30:48
null
0
0
null
null
null
null
UTF-8
C++
false
false
879
h
ComponentCanvas.h
#ifndef __COMPONENTCANVAS_H__ #define __COMPONENTCANVAS_H__ #include "Component.h" class GameObject; class RaceTimer; class ComponentCar; class ComponentUiText; class ComponentUiButton; class ComponentCanvas : public Component { public: ComponentCanvas(ComponentType type, GameObject* game_object); ~ComponentCanvas(); void Update(); void OnPlay(); void OnInspector(bool debug); void OnTransformModified(); void ResizeScreen(); // Save void Save(Data& file)const; void Load(Data& conf); void Remove(); vector<GameObject*> GetUI(); vector<GameObject*> GetGoFocus()const; void AddGoFocus(GameObject* new_focus); void RemoveGoFocus(GameObject* new_focus); void ClearFocus(); private: vector<GameObject*> GetGameObjectChilds(GameObject* go); vector<GameObject*> go_focus; int current_width = 1600; int current_height = 900; }; #endif __COMPONENTCANVAS_H__
b13a1586895b80038384005097d5e870db401a48
7dfb7e6f21753e1fdeb9a70595eced9deaedfb7c
/src/cube.cpp
07cf0e0341f5d2b58d7c980e30750474ee6882cf
[]
no_license
matty5749/QGLLearning
d9d08bacb81d56a4ac9015150e11b7f181d32b03
b2ac7b1b95574028098030961a69bbd4fdef26bf
refs/heads/master
2020-05-16T08:24:06.676406
2012-05-30T16:00:53
2012-05-30T16:00:53
null
0
0
null
null
null
null
UTF-8
C++
false
false
3,406
cpp
cube.cpp
/** *\file cube.cpp *\author Gaetan PICOT *\author Jean_Mathieu CHANTREIN *\version 2.0 Copyright CC-BY-NC-SA (Creative Commons) https://fr.wikipedia.org/wiki/Licence_Creative_Commons */ #include "cube.h" #include "quad.h" #include "vertex.h" #include "qglcullface.h" #include "switchwidget.h" /** *\fn Cube::Cube(Vertex* base, GLfloat size, bool lessParam) *\param base represente le vertex a partir duquel on dessinera le cube :c'est le coin inferieur gauche de la face de devant *\param size represente la taille arrete du cube *\param lessParam variable booleenne = vrai si l'on souhaite un cube en lessParam. =faux si l'on souhaite un cube en fullParam */ Cube::Cube(Vertex* base, GLfloat size, bool lessParam):Figure(1,1,1,1) { m_one = new Vertex(base->getX(), base->getY(), base->getZ()); m_two = new Vertex(base->getX() + size, base->getY(), base->getZ()); m_three = new Vertex(base->getX() + size, base->getY() + size, base->getZ()); m_four = new Vertex(base->getX(), base->getY() + size , base->getZ()); m_five = new Vertex(base->getX(), base->getY(), base->getZ() - size); m_six = new Vertex(base->getX(), base->getY() + size, base->getZ() - size); m_seven = new Vertex(base->getX() + size, base->getY() + size, base->getZ() - size); m_eight = new Vertex(base->getX() + size, base->getY(), base->getZ() - size); if (lessParam) { m_front = new Quad(0.8,0.4,0.2,0.5, m_one, m_two, m_three, m_four, true); m_back = new Quad(0.2,0.4,0.8,0.5, m_five, m_six, m_seven, m_eight, false, false, false, false); m_left = new Quad(0.8,0.2,0.4,0.5, m_one, m_four, m_six ,m_five, false, false, false, false); m_right = new Quad(0.2,0.8,0.4,0.5, m_two, m_eight, m_seven, m_three, false, false, false, false); m_up = new Quad(1,0.0,0.0,0.5, m_four, m_three, m_seven, m_six, false, false, false, false); m_down = new Quad(1,1,0.0,0.5, m_one, m_five, m_eight, m_two, false, false, false, false); } else { m_front = new Quad(0.8,0.4,0.2,0.5, m_one, m_two, m_three, m_four, true); m_back = new Quad(0.2,0.4,0.8,0.5, m_five, m_six, m_seven, m_eight, true); m_left = new Quad(0.8,0.2,0.4,0.5, m_one, m_four, m_six ,m_five, true); m_right = new Quad(0.2,0.8,0.4,0.5, m_two, m_eight, m_seven, m_three, true); m_up = new Quad(1,0.0,0.0,0.5, m_four, m_three, m_seven, m_six, true); m_down = new Quad(1,1,0.0,0.5, m_one, m_five, m_eight, m_two, true); } } Cube::~Cube() { /*On detruit les vertex ici afin d'eviter de vouloir detruire plusieurs fois le meme objet , ce qui est le cas ici , un sommet est concerné par 3 Quad */ delete m_one;m_one=NULL; delete m_two;m_two=NULL; delete m_three;m_three=NULL; delete m_four;m_four=NULL; delete m_five;m_five=NULL; delete m_six;m_six=NULL; delete m_seven;m_seven=NULL; delete m_eight;m_eight=NULL; delete m_front; delete m_back; delete m_down; delete m_left; delete m_right; delete m_up; } void Cube::drawFigure() { //MODELISATION m_front->drawFigure(); m_back->drawFigure(); m_left->drawFigure(); m_right->drawFigure(); m_up->drawFigure(); m_down->drawFigure(); } /** * \fn QDialog* Cube::getDialogCode() * \brief N'est jamais appelé , est implanté afin de pouvoir instancier la classe.Virtuelle pure sinon */ QDialog* Cube::getDialogCode() { return 0; }
c3212dc0c3fb1bc5f4a7797f99d6f223758f790f
3e7ac8e120d78791141464d43d17276f1109eb33
/test/span_buffer_test.cpp
18a6313815dcbf016b76ae3e46522319c2b74511
[ "BSD-3-Clause", "MIT", "BSL-1.0", "Apache-2.0" ]
permissive
DataDog/dd-opentracing-cpp
a48619646e8d5db54af32f183190b42d61ee7100
d07478e1bdecf3ea4f2d64c947e1aecad2c2cf40
refs/heads/master
2023-08-18T05:17:21.271943
2023-08-16T16:18:52
2023-08-16T16:18:52
128,264,903
41
41
Apache-2.0
2023-08-29T11:59:31
2018-04-05T21:12:56
C++
UTF-8
C++
false
false
8,359
cpp
span_buffer_test.cpp
#include "../src/span_buffer.h" #include <catch2/catch.hpp> #include "../src/sample.h" #include "mocks.h" using namespace datadog::opentracing; TEST_CASE("span buffer") { auto logger = std::make_shared<MockLogger>(); auto sampler = std::make_shared<RulesSampler>(); auto writer = std::make_shared<MockWriter>(sampler); auto buffer = std::make_shared<SpanBuffer>(logger, writer, sampler, nullptr, SpanBufferOptions{}); auto context_from_span = [](const TestSpanData& span) -> SpanContext { auto logger = std::make_shared<const MockLogger>(); return SpanContext{logger, span.span_id, span.trace_id, "", {}}; }; SECTION("can write a single-span trace") { auto span = std::make_unique<TestSpanData>("type", "service", "resource", "name", 420, 420, 0, 123, 456, 0); buffer->registerSpan(context_from_span(*span)); buffer->finishSpan(std::move(span)); REQUIRE(writer->traces.size() == 1); REQUIRE(writer->traces[0].size() == 1); auto& result = writer->traces[0][0]; REQUIRE(result->name == "name"); REQUIRE(result->service == "service"); REQUIRE(result->resource == "resource"); REQUIRE(result->type == "type"); REQUIRE(result->span_id == 420); REQUIRE(result->trace_id == 420); REQUIRE(result->parent_id == 0); REQUIRE(result->error == 0); REQUIRE(result->start == 123); REQUIRE(result->duration == 456); REQUIRE(result->meta == std::unordered_map<std::string, std::string>{}); } SECTION("can write a multi-span trace") { auto rootSpan = std::make_unique<TestSpanData>("type", "service", "resource", "name", 420, 420, 0, 123, 456, 0); buffer->registerSpan(context_from_span(*rootSpan)); auto childSpan = std::make_unique<TestSpanData>("type", "service", "resource", "name", 420, 421, 0, 124, 455, 0); buffer->registerSpan(context_from_span(*childSpan)); buffer->finishSpan(std::move(childSpan)); buffer->finishSpan(std::move(rootSpan)); REQUIRE(writer->traces.size() == 1); REQUIRE(writer->traces[0].size() == 2); // Although order doesn't actually matter. REQUIRE(writer->traces[0][0]->span_id == 421); REQUIRE(writer->traces[0][1]->span_id == 420); } SECTION("can write a multi-span trace, even if the root finishes before a child") { auto rootSpan = std::make_unique<TestSpanData>("type", "service", "resource", "name", 420, 420, 0, 123, 456, 0); buffer->registerSpan(context_from_span(*rootSpan)); auto childSpan = std::make_unique<TestSpanData>("type", "service", "resource", "name", 420, 421, 0, 124, 455, 0); buffer->registerSpan(context_from_span(*childSpan)); buffer->finishSpan(std::move(rootSpan)); buffer->finishSpan(std::move(childSpan)); REQUIRE(writer->traces.size() == 1); REQUIRE(writer->traces[0].size() == 2); // Although order doesn't actually matter. REQUIRE(writer->traces[0][0]->span_id == 420); REQUIRE(writer->traces[0][1]->span_id == 421); } SECTION("doesn't write an unfinished trace") { auto rootSpan = std::make_unique<TestSpanData>("type", "service", "resource", "name", 420, 420, 0, 123, 456, 0); buffer->registerSpan(context_from_span(*rootSpan)); auto childSpan = std::make_unique<TestSpanData>("type", "service", "resource", "name", 420, 421, 0, 124, 455, 0); buffer->registerSpan(context_from_span(*childSpan)); buffer->finishSpan(std::move(childSpan)); REQUIRE(writer->traces.size() == 0); // rootSpan still outstanding auto childSpan2 = std::make_unique<TestSpanData>("type", "service", "resource", "name", 420, 422, 0, 125, 457, 0); buffer->registerSpan(context_from_span(*childSpan2)); buffer->finishSpan(std::move(rootSpan)); // Root span finished, but *after* childSpan2 was registered, so childSpan2 still oustanding. REQUIRE(writer->traces.size() == 0); // Ok now we're done! buffer->finishSpan(std::move(childSpan2)); REQUIRE(writer->traces.size() == 1); REQUIRE(writer->traces[0].size() == 3); } SECTION("discards spans written without a corresponding startSpan call") { // Redirect cerr, so the the terminal output doesn't imply failure. std::stringstream error_message; std::streambuf* stderr = std::cerr.rdbuf(error_message.rdbuf()); SECTION("not even a trace") { auto rootSpan = std::make_unique<TestSpanData>("type", "service", "resource", "name", 420, 420, 0, 123, 456, 0); buffer->finishSpan(std::move(rootSpan)); REQUIRE(writer->traces.size() == 0); } SECTION("there's a trace but no startSpan call") { auto rootSpan = std::make_unique<TestSpanData>("type", "service", "resource", "name", 420, 420, 0, 123, 456, 0); buffer->registerSpan(context_from_span(*rootSpan)); auto childSpan = std::make_unique<TestSpanData>("type", "service", "resource", "name", 420, 421, 0, 124, 455, 0); buffer->finishSpan(std::move(childSpan)); buffer->finishSpan(std::move(rootSpan)); REQUIRE(writer->traces.size() == 1); REQUIRE(writer->traces[0].size() == 1); // Only rootSpan got written. REQUIRE(writer->traces[0][0]->span_id == 420); } std::cerr.rdbuf(stderr); // Restore stderr. } SECTION("spans written after a trace is submitted just start a new trace") { auto rootSpan = std::make_unique<TestSpanData>("type", "service", "resource", "name", 420, 420, 0, 123, 456, 0); buffer->registerSpan(context_from_span(*rootSpan)); buffer->finishSpan(std::move(rootSpan)); REQUIRE(writer->traces.size() == 1); auto childSpan = std::make_unique<TestSpanData>("type", "service", "resource", "name", 420, 421, 0, 123, 456, 0); buffer->registerSpan(context_from_span(*childSpan)); buffer->finishSpan(std::move(childSpan)); REQUIRE(writer->traces.size() == 2); } SECTION("thread safe") { std::vector<std::thread> trace_writers; // Buffer 5 traces at once. for (uint64_t trace_id = 10; trace_id <= 50; trace_id += 10) { trace_writers.emplace_back( [&](uint64_t trace_id) { // For each trace, buffer 5 spans at once. std::vector<std::thread> span_writers; for (uint64_t span_id = trace_id; span_id < trace_id + 5; span_id++) { span_writers.emplace_back( [&](uint64_t span_id) { auto span = std::make_unique<TestSpanData>( "type", "service", "resource", "name", trace_id, span_id, 0, 123, 456, 0); buffer->registerSpan(context_from_span(*span)); }, span_id); } // Wait for all spans to be registered before finishing them. for (std::thread& span_writer : span_writers) { span_writer.join(); } span_writers.clear(); for (uint64_t span_id = trace_id; span_id < trace_id + 5; span_id++) { span_writers.emplace_back( [&](uint64_t span_id) { auto span = std::make_unique<TestSpanData>( "type", "service", "resource", "name", trace_id, span_id, 0, 123, 456, 0); buffer->finishSpan(std::move(span)); }, span_id); } for (std::thread& span_writer : span_writers) { span_writer.join(); } }, trace_id); } for (std::thread& trace_writer : trace_writers) { trace_writer.join(); } // Mostly we REQUIRE that this doesn't SIGABRT :D REQUIRE(writer->traces.size() == 5); for (int i = 0; i < 5; i++) { REQUIRE(writer->traces[i].size() == 5); } } }
bb4b1d7c3388a89e1ae13aafe927a2407acc79e4
e57ae9d9c78bbb22596c20cbdb3d52c863f6dba1
/src/common/StringUtil.h
e4ad5c795437116162d815a3d40f988deec9a781
[ "Apache-2.0" ]
permissive
mongmong/smartcube
1e1f745ff6f9fe51802f4b7416c098706afd921e
3fda549684b87613008cf968e67cda65c07dea9b
refs/heads/master
2016-09-06T13:51:03.466212
2010-03-23T14:13:51
2010-03-23T14:13:51
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,145
h
StringUtil.h
/* * Copyright 2010 Chris Chou <m2chrischou@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef STRINGUTIL_H_ #define STRINGUTIL_H_ #include <string> namespace smartcube { class StringUtil { public: template<typename ArrayType> static void StringUtil::split(const std::string& s, char delimiter, ArrayType& parts) { parts.reserve(64); std::string::const_iterator start = s.begin(); std::string::const_iterator end = s.end(); std::string::const_iterator iter = s.begin(); for (; iter != end; iter++) { if (*iter == delimiter) { parts.push_back(std::string(start, iter)); start = iter + 1; } } if (start != end) { parts.push_back(std::string(start, iter)); } else { parts.push_back(std::string("")); } } template<typename ArrayType> static void StringUtil::split(const std::string& s, const std::string& delimiters, ArrayType& parts) { if (delimiters.size() == 1) { return split<ArrayType> (s, delimiters[0], parts); } parts.reserve(64); std::string::const_iterator start = s.begin(); std::string::const_iterator end = s.end(); std::string::const_iterator iter = s.begin(); for (; iter != end; iter++) { if (delimiters.find(*iter) != std::string::npos) { parts.push_back(std::string(start, iter)); start = iter + 1; } } if (start != end) { parts.push_back(std::string(start, iter)); } else { parts.push_back(std::string("")); } } }; } #endif /* STRINGUTIL_H_ */
09cdbab0baee1a823d10a4c75ae6b5cec608eb92
96cfaaa771c2d83fc0729d8c65c4d4707235531a
/RecoLocalMuon/CSCStandAlone/interface/AnoTrkFnd.h
4cad2b83168f5a7239155b469d6524cbcfc8289e
[]
no_license
khotilov/cmssw
a22a160023c7ce0e4d59d15ef1f1532d7227a586
7636f72278ee0796d0203ac113b492b39da33528
refs/heads/master
2021-01-15T18:51:30.061124
2013-04-20T17:18:07
2013-04-20T17:18:07
null
0
0
null
null
null
null
UTF-8
C++
false
false
8,961
h
AnoTrkFnd.h
/* Calman Filter using Anode strip positions to determine what hits belong to a Track Written By S Durkin */ #include "EventFilter/CSCRawToDigi/interface/CSCDDUEventData.h" #include "DataFormats/CSCDigi/interface/CSCWireDigi.h" class AnoTrkFnd { public: AnoTrkFnd(const CSCEventData & data) { int use[6]; int debug=0; float atrk_dist=1.0; natrk=0; for(int layer=1;layer<=6;layer++){ std::vector<CSCWireDigi> wires =data.wireDigis(layer); for(unsigned i=0;i<wires.size();i++){ int wire_group=wires[i].getWireGroup(); int wire_tbin=wires[i].getBeamCrossingTag(); int old=0; for(unsigned k=0;k<wire[layer-1].size();k++){ if(wire[layer-1][k]==wire_group)old=1; } if(old==0){ wire[layer-1].push_back(wire_group); twire[layer-1].push_back(wire_tbin); int tmp=0; wuse[layer-1].push_back(tmp); } } } if(debug>0){ for(int layer=0;layer<=5;layer++){ printf(" layer %d size %d:",layer,wire[layer].size()); for(unsigned hit=0;hit<wire[layer].size();hit++){ printf(" %d ",wire[layer][hit]); } printf("\n"); } } // fit some tracks int nhits_left=wire[0].size()+wire[1].size()+wire[2].size()+wire[3].size()+wire[4].size()+wire[5].size(); float x[6],y[6]; float intr=0.; float slp=0; int np=0; int ns=0; for(int i = 6; i > 2; i--){ // Loop over all the hits on all the layers. This loop looks a little // strange, since the range is one more than the number of hits. This // is just a clever way to write the algorithm; there is more explanation // below for (unsigned i0 = 0; i0 < wire[0].size()+1;i0++){ if(i0 == wire[0].size()){use[0]=0;}else{use[0]=wuse[0][i0];} if(use[0]==0){ for (unsigned i1 = 0; i1 < wire[1].size()+1;i1++){ if(i1 == wire[1].size()){use[1]=0;}else{use[1]=wuse[1][i1];} if(use[1]==0){ for (unsigned i2 = 0; i2 < wire[2].size()+1;i2++){ if(i2 == wire[2].size()){use[2]=0;}else{use[2]=wuse[2][i2];} if(use[2]==0){ for (unsigned i3 = 0; i3 < wire[3].size()+1;i3++){ if(i3 == wire[3].size()){use[3]=0;}else{use[3]=wuse[3][i3];} if(use[3]==0){ for (unsigned i4 = 0; i4 < wire[4].size()+1;i4++){ if(i4 == wire[4].size()){use[4]=0;}else{use[4]=wuse[4][i4];} if(use[4]==0){ for (unsigned i5 = 0; i5 < wire[5].size()+1;i5++){ if(i5 == wire[5].size()){use[5]=0;}else{use[5]=wuse[5][i5];} if(use[5]==0){ // The first part of this conditional only allows the search // to continue if the hit has not already been used in a track. // This speeds up the algorithm since, double looping is // avoided. But if all your hits have already been used to // make tracks, you still need to be able to continue the // search for unused hits on other layers. // This is just a temporary flag to let the // algorithm know which layers have hits which // still have not been used in tracks. int u[6]; for (int l = 0; l < 6; l++)u[l] = 1; if (i0 == wire[0].size())u[0] = 0; if (i1 == wire[1].size())u[1] = 0; if (i2 == wire[2].size())u[2] = 0; if (i3 == wire[3].size())u[3] = 0; if (i4 == wire[4].size())u[4] = 0; if (i5 == wire[5].size())u[5] = 0; //printf(" try %d %d %d %d %d %d \n",i0,i1,i2,i3,i4,i5); //printf(" u sss %d %d %d %d %d %d \n",u[0],u[1],u[2],u[3],u[4],u[5]); // Double check that count of layers with // available hits is consistent if (u[0] + u[1] + u[2] + u[3] + u[4] + u[5] == i){ // If hit is still available to be used in // track hunt, store layer and track number. if (u[0] == 1){x[0]=0.0;y[0]=(float)wire[0][i0];} if (u[1] == 1){x[1]=1.0;y[1]=(float)wire[1][i1];} if (u[2] == 1){x[2]=2.0;y[2]=(float)wire[2][i2];} if (u[3] == 1){x[3]=3.0;y[3]=(float)wire[3][i3];} if (u[4] == 1){x[4]=4.0;y[4]=(float)wire[4][i4];} if (u[5] == 1){x[5]=5.0;y[5]=(float)wire[5][i5];} //for(int kk=0;kk<0;kk++){ // printf(" plane %d x %f y %f \n",kk,x[kk],y[kk]); //} // Do least squares fit. float s1 = 0.0; float sx = 0.0; float sy = 0.0; float sx2 = 0.0; float sxy = 0.0; ns=0; for (int j = 0; j < 6; j++){ if (u[j] == 1){ ns = ns + 1; s1 = s1 + 1; sx = sx + x[j]; sx2 = sx2 + x[j]*x[j]; sy = sy + y[j]; sxy = sxy + x[j]*y[j]; } } float dd = s1*sx2 - sx*sx; // Calculate slope and intersect for line going through // hits, from least squares fit. if (dd > 0.0){ intr = (sy*sx2 - sxy*sx)/dd; slp = (sxy*s1 - sy*sx)/dd; } np = 0; // Find all hits that are within an acceptable distance // of the line. float yy,diff; for(int j = 0; j < 6; j++){ for(unsigned hit=0;hit<wire[j].size();hit++){ if(wuse[j][hit]==0){ yy = slp*x[j] + intr; float w=wire[j][hit]; diff = w - yy; if (diff < 0.0){ diff = -diff; } // if position of wire is within certain range // (q.0), then accept the hit, and increase number // of potentially useful hits by one. if (diff < atrk_dist){ np = np + 1; } } } } if (debug > 0){ std::cout << " Number of hits within 1.0 of fitted track = " << np << std::endl; std::cout << " Number of layers with hits = " << ns << std::endl; } // If the number of accepted hits is greater than or equal // to the number of layers, then store the track and // store the track and layer hits for that track. if (np >= ns){ np = 0; if(natrk<10){ trk_slp[natrk]=slp; trk_intr[natrk]=intr; } natrk=natrk+1; // This is a repeat of the previous loop, but this time // the hits and layers are recorded into an array, // designating them as being used in a track. float yy,diff; for (int j = 0; j < 6; j++){ for(unsigned hit=0;hit<wire[j].size();hit++){ if(wuse[j][hit]==0){ yy = slp*x[j] + intr; float w=wire[j][hit]; diff = w - yy; if (diff < 0.0){ diff = -diff; } if (diff < atrk_dist){ trk_layer[natrk-1].push_back(j); int ww=(int)w; trk_wire[natrk-1].push_back(ww); int tw=twire[j][hit]; trk_twire[natrk-1].push_back(tw); if (debug > 0){ if (j == 0){ std::cout << "--- Saved Anode hits" << std::endl; } std::cout << " Layer " << j << " wire "<< w <<std::endl; } // Keep track of which hits are used. wuse[j][hit] = 1; // If hit is used in track, the total number // of hits available for other tracks decreases // by one. nhits_left = nhits_left - 1; np = np + 1; } } } } if (debug > 0){ std::cout << "--- Number of found anode tracks = " << natrk << std::endl; std::cout << " Hits used in track = " << np << ", hits left = " << nhits_left << std::endl; } // Quit if number of leftover hits is less than 3. if (nhits_left <= 2)goto Terminate; if(natrk==10)goto Terminate; } } }} }} }} }} }} }} } Terminate: use[0]=0; // label must be followed by a statement } virtual ~AnoTrkFnd(){} int size(){return natrk;} // hits along a track std::vector<int> atrk_layer(int trk){return trk_layer[trk];} //layer std::vector<int> atrk_wire(int trk){return trk_wire[trk];} //wire std::vector<int> atrk_twire(int trk){return trk_twire[trk];} //time wire float atrk_slp(int trk){return trk_slp[trk];} //slope float atrk_intr(int trk){return trk_intr[trk];} //slope // raw hits in chamber std::vector<int> araw_wire(int layer){return wire[layer];} // wire std::vector<int> araw_twire(int layer){return twire[layer];} // wire time std::vector<int> araw_use(int layer){return wuse[layer];} // used in track private: std::vector<int> wire[6]; std::vector<int> twire[6]; std::vector<int> wuse[6]; int use[6]; int natrk; float trk_intr[10]; float trk_slp[10]; std::vector<int> trk_layer[10]; std::vector<int> trk_wire[10]; std::vector<int> trk_twire[10]; };
75f29d9bafcbe316c1bbc434e09fe6d980cfb3aa
dd1c45cd88d7890d82ebaec83049b4ff71c5e80a
/src/software/world/robot_test.cpp
c57a2eac9885ce5903f041ef82161e6ae2fd73f6
[ "LGPL-3.0-only" ]
permissive
phelanm20/Software
3e6134e8f1e445269333838cebdf4f256a20da61
4681c7cffc9c1ca8f739ea692daffc490a8c1910
refs/heads/master
2020-07-30T02:37:16.382710
2019-11-23T11:31:03
2019-11-23T11:31:03
210,057,346
0
0
MIT
2019-09-21T21:46:56
2019-09-21T21:46:55
null
UTF-8
C++
false
false
22,091
cpp
robot_test.cpp
#include "software/world/robot.h" #include <gtest/gtest.h> #include "shared/constants.h" class RobotTest : public ::testing::Test { protected: void SetUp() override { // An arbitrary fixed point in time // We use this fixed point in time to make the tests deterministic. current_time = Timestamp::fromSeconds(123); half_second_future = current_time + Duration::fromMilliseconds(500); one_second_future = current_time + Duration::fromSeconds(1); one_second_past = current_time - Duration::fromSeconds(1); } Timestamp current_time; Timestamp half_second_future; Timestamp one_second_future; Timestamp one_second_past; }; TEST_F(RobotTest, construct_with_all_params) { Robot robot = Robot(3, Point(1, 1), Vector(-0.3, 0), Angle::fromRadians(2.2), AngularVelocity::fromRadians(-0.6), current_time); EXPECT_EQ(3, robot.id()); EXPECT_EQ(Point(1, 1), robot.position()); EXPECT_EQ(Vector(-0.3, 0), robot.velocity()); EXPECT_EQ(Angle::fromRadians(2.2), robot.orientation()); EXPECT_EQ(AngularVelocity::fromRadians(-0.6), robot.angularVelocity()); EXPECT_EQ(current_time, robot.lastUpdateTimestamp()); } TEST_F(RobotTest, update_state_with_all_params) { Robot robot = Robot(0, Point(), Vector(), Angle::zero(), AngularVelocity::zero(), current_time); robot.updateState(Point(-1.2, 3), Vector(2.2, -0.05), Angle::quarter(), AngularVelocity::fromRadians(1.1), half_second_future); EXPECT_EQ(0, robot.id()); EXPECT_EQ(Point(-1.2, 3), robot.position()); EXPECT_EQ(Vector(2.2, -0.05), robot.velocity()); EXPECT_EQ(Angle::quarter(), robot.orientation()); EXPECT_EQ(AngularVelocity::fromRadians(1.1), robot.angularVelocity()); EXPECT_EQ(half_second_future, robot.lastUpdateTimestamp()); } TEST_F(RobotTest, update_state_with_new_robot_with_same_id) { Robot robot = Robot(0, Point(), Vector(), Angle::zero(), AngularVelocity::zero(), current_time); Robot update_robot = Robot(0, Point(-1.2, 3), robot.velocity(), Angle::quarter(), robot.angularVelocity(), current_time); robot.updateState(update_robot); EXPECT_EQ(robot, update_robot); } TEST_F(RobotTest, update_state_with_new_robot_with_different_id) { Robot robot = Robot(0, Point(), Vector(), Angle::zero(), AngularVelocity::zero(), current_time); Robot update_robot = Robot(1, Point(-1.2, 3), robot.velocity(), Angle::quarter(), robot.angularVelocity(), current_time); ASSERT_THROW(robot.updateState(update_robot), std::invalid_argument); } TEST_F(RobotTest, update_state_to_predicted_state_with_future_timestamp) { Robot robot = Robot(1, Point(1, -2), Vector(3.5, 1), Angle::fromRadians(-0.3), AngularVelocity::fromRadians(2), current_time); robot.updateStateToPredictedState(one_second_future); EXPECT_EQ(Point(4.5, -1), robot.position()); EXPECT_EQ(Vector(3.5, 1), robot.velocity()); EXPECT_EQ(Angle::fromRadians(-0.3) + Angle::fromRadians(2), robot.orientation()); EXPECT_EQ(AngularVelocity::fromRadians(2), robot.angularVelocity()); EXPECT_EQ(one_second_future, robot.lastUpdateTimestamp()); } TEST_F(RobotTest, update_state_to_predicted_state_with_positive_duration) { Robot robot = Robot(1, Point(1, -2), Vector(3.5, 1), Angle::fromRadians(-0.3), AngularVelocity::fromRadians(2), current_time); robot.updateStateToPredictedState(Duration::fromSeconds(1)); EXPECT_EQ(Point(4.5, -1), robot.position()); EXPECT_EQ(Vector(3.5, 1), robot.velocity()); EXPECT_EQ(Angle::fromRadians(-0.3) + Angle::fromRadians(2), robot.orientation()); EXPECT_EQ(AngularVelocity::fromRadians(2), robot.angularVelocity()); EXPECT_EQ(one_second_future, robot.lastUpdateTimestamp()); } TEST_F(RobotTest, update_state_to_predicted_state_with_past_timestamp) { Robot robot = Robot(1, Point(1, -2), Vector(3.5, 1), Angle::fromRadians(-0.3), AngularVelocity::fromRadians(2), current_time); ASSERT_THROW(robot.updateStateToPredictedState(one_second_past), std::invalid_argument); } TEST_F(RobotTest, update_state_to_predicted_state_with_negative_duration) { Robot robot = Robot(1, Point(1, -2), Vector(3.5, 1), Angle::fromRadians(-0.3), AngularVelocity::fromRadians(2), current_time); ASSERT_THROW(robot.updateStateToPredictedState(Duration::fromSeconds(-1)), std::invalid_argument); } TEST_F(RobotTest, get_position_at_current_time) { Robot robot = Robot(0, Point(-1.2, 3), Vector(-0.5, 2.6), Angle::quarter(), AngularVelocity::fromRadians(0.7), current_time); EXPECT_EQ(Point(-1.2, 3), robot.position()); } TEST_F(RobotTest, get_position_at_future_time_with_negative_robot_velocity) { Robot robot = Robot(0, Point(-1.2, 3), Vector(-0.5, -2.6), Angle::quarter(), AngularVelocity::fromRadians(0.7), current_time); EXPECT_EQ(Point(-1.4, 1.96), robot.estimatePositionAtFutureTime(Duration::fromMilliseconds(400))); EXPECT_EQ(Point(-1.7, 0.4), robot.estimatePositionAtFutureTime(Duration::fromMilliseconds(1000))); EXPECT_EQ(Point(-2.7, -4.8), robot.estimatePositionAtFutureTime(Duration::fromMilliseconds(3000))); } TEST_F(RobotTest, get_position_at_future_time_with_positive_robot_velocity) { Robot robot_other = Robot(1, Point(1, -2), Vector(3.5, 1), Angle::fromRadians(-0.3), AngularVelocity::fromRadians(2), current_time); EXPECT_EQ(Point(2.4, -1.6), robot_other.estimatePositionAtFutureTime(Duration::fromMilliseconds(400))); EXPECT_EQ(Point(4.5, -1), robot_other.estimatePositionAtFutureTime(Duration::fromMilliseconds(1000))); EXPECT_EQ(Point(11.5, 1), robot_other.estimatePositionAtFutureTime(Duration::fromMilliseconds(3000))); } TEST_F(RobotTest, get_position_at_past_time) { Robot robot_other = Robot(1, Point(1, -2), Vector(3.5, 1), Angle::fromRadians(-0.3), AngularVelocity::fromRadians(2), current_time); ASSERT_THROW( (robot_other.estimatePositionAtFutureTime(Duration::fromMilliseconds(-100))), std::invalid_argument); ASSERT_THROW( (robot_other.estimatePositionAtFutureTime(Duration::fromMilliseconds(-1000))), std::invalid_argument); } TEST_F(RobotTest, get_velocity_at_current_time) { Robot robot = Robot(0, Point(-1.2, 3), Vector(-0.5, 2.6), Angle::quarter(), AngularVelocity::fromRadians(0.7), current_time); EXPECT_EQ(Vector(-0.5, 2.6), robot.velocity()); } TEST_F(RobotTest, get_velocity_at_future_time_with_negative_robot_velocity) { Robot robot = Robot(0, Point(-1.2, 3), Vector(-0.5, -2.6), Angle::quarter(), AngularVelocity::fromRadians(0.7), current_time); EXPECT_EQ(Vector(-0.5, -2.6), robot.estimateVelocityAtFutureTime(Duration::fromMilliseconds(400))); EXPECT_EQ(Vector(-0.5, -2.6), robot.estimateVelocityAtFutureTime(Duration::fromMilliseconds(1000))); EXPECT_EQ(Vector(-0.5, -2.6), robot.estimateVelocityAtFutureTime(Duration::fromMilliseconds(3000))); } TEST_F(RobotTest, get_velocity_at_future_time_with_positive_robot_velocity) { Robot robot_other = Robot(1, Point(1, -2), Vector(3.5, 1), Angle::fromRadians(-0.3), AngularVelocity::fromRadians(2), current_time); EXPECT_EQ(Vector(3.5, 1), robot_other.estimateVelocityAtFutureTime(Duration::fromMilliseconds(400))); EXPECT_EQ(Vector(3.5, 1), robot_other.estimateVelocityAtFutureTime(Duration::fromMilliseconds(1000))); EXPECT_EQ(Vector(3.5, 1), robot_other.estimateVelocityAtFutureTime(Duration::fromMilliseconds(3000))); } TEST_F(RobotTest, get_velocity_at_past_time) { Robot robot_other = Robot(1, Point(1, -2), Vector(3.5, 1), Angle::fromRadians(-0.3), AngularVelocity::fromRadians(2), current_time); ASSERT_THROW( (robot_other.estimateVelocityAtFutureTime(Duration::fromMilliseconds(-100))), std::invalid_argument); ASSERT_THROW( (robot_other.estimateVelocityAtFutureTime(Duration::fromMilliseconds(-1000))), std::invalid_argument); } TEST_F(RobotTest, get_orientation_at_current_time) { Robot robot = Robot(0, Point(-1.2, 3), Vector(-0.5, 2.6), Angle::quarter(), AngularVelocity::fromRadians(0.7), current_time); EXPECT_EQ(Angle::quarter(), robot.orientation()); } TEST_F(RobotTest, get_orientation_at_future_time_with_positive_robot_angular_velocity) { Robot robot = Robot(0, Point(-1.2, 3), Vector(-0.5, 2.6), Angle::quarter(), AngularVelocity::fromRadians(0.7), current_time); EXPECT_EQ(Angle::quarter() + Angle::fromRadians(0.28), robot.estimateOrientationAtFutureTime(Duration::fromMilliseconds(400))); EXPECT_EQ(Angle::quarter() + Angle::fromRadians(0.7), robot.estimateOrientationAtFutureTime(Duration::fromMilliseconds(1000))); EXPECT_EQ(Angle::quarter() + Angle::fromRadians(2.1), robot.estimateOrientationAtFutureTime(Duration::fromMilliseconds(3000))); } TEST_F(RobotTest, get_orientation_at_future_time_with_negative_robot_angular_velocity) { Robot robot_other = Robot(1, Point(1, -2), Vector(3.5, 1), Angle::fromRadians(-0.3), AngularVelocity::fromRadians(2), current_time); EXPECT_EQ( Angle::fromRadians(-0.3) + Angle::fromRadians(0.8), robot_other.estimateOrientationAtFutureTime(Duration::fromMilliseconds(400))); EXPECT_EQ( Angle::fromRadians(-0.3) + Angle::fromRadians(2), robot_other.estimateOrientationAtFutureTime(Duration::fromMilliseconds(1000))); EXPECT_EQ( Angle::fromRadians(-0.3) + Angle::fromRadians(6), robot_other.estimateOrientationAtFutureTime(Duration::fromMilliseconds(3000))); } TEST_F(RobotTest, get_orientation_at_past_time) { Robot robot_other = Robot(1, Point(1, -2), Vector(3.5, 1), Angle::fromRadians(-0.3), AngularVelocity::fromRadians(2), current_time); ASSERT_THROW( robot_other.estimateOrientationAtFutureTime(Duration::fromMilliseconds(-100)), std::invalid_argument); ASSERT_THROW( robot_other.estimateOrientationAtFutureTime(Duration::fromMilliseconds(-1000)), std::invalid_argument); } TEST_F(RobotTest, get_angular_velocity_at_current_time) { Robot robot = Robot(0, Point(-1.2, 3), Vector(-0.5, 2.6), Angle::quarter(), AngularVelocity::fromRadians(0.7), current_time); EXPECT_EQ(AngularVelocity::fromRadians(0.7), robot.angularVelocity()); } TEST_F(RobotTest, get_angular_velocity_at_future_time_with_positive_robot_angular_velocity) { Robot robot = Robot(0, Point(-1.2, 3), Vector(-0.5, 2.6), Angle::quarter(), AngularVelocity::fromRadians(0.7), current_time); EXPECT_EQ(AngularVelocity::fromRadians(0.7), robot.estimateAngularVelocityAtFutureTime(Duration::fromMilliseconds(400))); EXPECT_EQ( AngularVelocity::fromRadians(0.7), robot.estimateAngularVelocityAtFutureTime(Duration::fromMilliseconds(1000))); EXPECT_EQ( AngularVelocity::fromRadians(0.7), robot.estimateAngularVelocityAtFutureTime(Duration::fromMilliseconds(3000))); } TEST_F(RobotTest, get_angular_velocity_at_future_time_with_negative_robot_angular_velocity) { Robot robot_other = Robot(1, Point(1, -2), Vector(3.5, 1), Angle::fromRadians(-0.3), AngularVelocity::fromRadians(2), current_time); EXPECT_EQ( AngularVelocity::fromRadians(2), robot_other.estimateAngularVelocityAtFutureTime(Duration::fromMilliseconds(400))); EXPECT_EQ(AngularVelocity::fromRadians(2), robot_other.estimateAngularVelocityAtFutureTime( Duration::fromMilliseconds(1000))); EXPECT_EQ(AngularVelocity::fromRadians(2), robot_other.estimateAngularVelocityAtFutureTime( Duration::fromMilliseconds(3000))); } TEST_F(RobotTest, get_angular_velocity_at_past_time) { Robot robot_other = Robot(1, Point(1, -2), Vector(3.5, 1), Angle::fromRadians(-0.3), AngularVelocity::fromRadians(2), current_time); ASSERT_THROW( robot_other.estimateAngularVelocityAtFutureTime(Duration::fromMilliseconds(-100)), std::invalid_argument); ASSERT_THROW(robot_other.estimateAngularVelocityAtFutureTime( Duration::fromMilliseconds(-1000)), std::invalid_argument); } TEST_F(RobotTest, get_last_update_timestamp) { Robot robot = Robot(1, Point(1, -2), Vector(3.5, 1), Angle::fromRadians(-0.3), AngularVelocity::fromRadians(2), current_time); EXPECT_EQ(current_time, robot.lastUpdateTimestamp()); robot.updateStateToPredictedState(half_second_future); EXPECT_EQ(half_second_future, robot.lastUpdateTimestamp()); } TEST_F(RobotTest, equality_operator_compare_same_robot) { Robot robot = Robot(0, Point(1, -1.5), Vector(-0.7, -0.55), Angle::fromDegrees(100), AngularVelocity::fromDegrees(30), current_time); EXPECT_EQ(robot, robot); } TEST_F(RobotTest, equality_operator_robots_with_different_id) { Robot robot_0 = Robot(0, Point(3, 1.2), Vector(-3, 1), Angle::fromDegrees(0), AngularVelocity::fromDegrees(25), current_time); Robot robot_1 = Robot(1, Point(3, 1.2), Vector(-3, 1), Angle::fromDegrees(0), AngularVelocity::fromDegrees(25), current_time); EXPECT_NE(robot_0, robot_1); } TEST_F(RobotTest, equality_operator_robots_with_different_position) { Robot robot = Robot(0, Point(3, 1.2), Vector(-3, 1), Angle::fromDegrees(0), AngularVelocity::fromDegrees(25), current_time); Robot robot_other = Robot(0, Point(-3, 1.2), Vector(-3, 1), Angle::fromDegrees(0), AngularVelocity::fromDegrees(25), current_time); EXPECT_NE(robot, robot_other); } TEST_F(RobotTest, equality_operator_robots_with_different_velocity) { Robot robot = Robot(0, Point(3, 1.2), Vector(-3, 1), Angle::fromDegrees(0), AngularVelocity::fromDegrees(25), current_time); Robot robot_other = Robot(0, Point(3, 1.2), Vector(), Angle::fromDegrees(0), AngularVelocity::fromDegrees(25), current_time); EXPECT_NE(robot, robot_other); } TEST_F(RobotTest, equality_operator_robots_with_different_orientation) { Robot robot = Robot(0, Point(3, 1.2), Vector(-3, 1), Angle::fromDegrees(0), AngularVelocity::fromDegrees(25), current_time); Robot robot_other = Robot(0, Point(3, 1.2), Vector(-3, 1), Angle::fromDegrees(45), AngularVelocity::fromDegrees(25), current_time); EXPECT_NE(robot, robot_other); } TEST_F(RobotTest, equality_operator_robots_with_different_angular_velocity) { Robot robot = Robot(0, Point(3, 1.2), Vector(-3, 1), Angle::fromDegrees(0), AngularVelocity::fromDegrees(25), current_time); Robot robot_other = Robot(0, Point(3, 1.2), Vector(-3, 1), Angle::fromDegrees(0), AngularVelocity::fromDegrees(-70), current_time); EXPECT_NE(robot, robot_other); } TEST_F(RobotTest, equality_operator_robots_with_different_timestamp) { Robot robot = Robot(0, Point(3, 1.2), Vector(-3, 1), Angle::fromDegrees(0), AngularVelocity::fromDegrees(25), current_time); Robot robot_other = Robot(0, Point(3, 1.2), Vector(-3, 1), Angle::fromDegrees(0), AngularVelocity::fromDegrees(25), one_second_future); EXPECT_EQ(robot, robot_other); } TEST_F(RobotTest, get_position_history) { std::vector prevPositions = {Point(-1.3, 3), Point(-1.2, 3), Point(3, 1.2)}; Robot robot = Robot(0, Point(3, 1.2), Vector(-3, 1), Angle::fromDegrees(0), AngularVelocity::fromDegrees(25), current_time, 3); robot.updateState(Point(-1.2, 3), Vector(2.2, -0.05), Angle::quarter(), AngularVelocity::fromRadians(1.1), half_second_future); robot.updateState(Point(-1.3, 3), Vector(2.3, -0.05), Angle::quarter(), AngularVelocity::fromRadians(1.1), half_second_future); EXPECT_EQ(prevPositions, robot.getPreviousPositions()); } TEST_F(RobotTest, get_velocity_history) { std::vector prevVelocities = {Vector(2.3, -0.05), Vector(2.2, -0.05), Vector(-3, 1)}; Robot robot = Robot(0, Point(3, 1.2), Vector(-3, 1), Angle::fromDegrees(0), AngularVelocity::fromDegrees(25), current_time, 3); robot.updateState(Point(-1.2, 3), Vector(2.2, -0.05), Angle::quarter(), AngularVelocity::fromRadians(1.1), half_second_future); robot.updateState(Point(-1.3, 3), Vector(2.3, -0.05), Angle::quarter(), AngularVelocity::fromRadians(1.1), half_second_future); EXPECT_EQ(prevVelocities, robot.getPreviousVelocities()); } TEST_F(RobotTest, get_orientation_history) { std::vector prevOrientations = {Angle::quarter(), Angle::quarter(), Angle::fromDegrees(0)}; Robot robot = Robot(0, Point(3, 1.2), Vector(-3, 1), Angle::fromDegrees(0), AngularVelocity::fromDegrees(25), current_time, 3); robot.updateState(Point(-1.2, 3), Vector(2.2, -0.05), Angle::quarter(), AngularVelocity::fromRadians(1.1), half_second_future); robot.updateState(Point(-1.3, 3), Vector(2.3, -0.05), Angle::quarter(), AngularVelocity::fromRadians(1.1), half_second_future); EXPECT_EQ(prevOrientations, robot.getPreviousOrientations()); } TEST_F(RobotTest, get_angular_velocity_history) { std::vector prevAngularVelocities = { AngularVelocity::fromRadians(1.2), AngularVelocity::fromRadians(1.1), AngularVelocity::fromDegrees(25), }; Robot robot = Robot(0, Point(3, 1.2), Vector(-3, 1), Angle::fromDegrees(0), AngularVelocity::fromDegrees(25), current_time, 3); robot.updateState(Point(-1.2, 3), Vector(2.2, -0.05), Angle::quarter(), AngularVelocity::fromRadians(1.1), half_second_future); robot.updateState(Point(-1.3, 3), Vector(2.3, -0.05), Angle::quarter(), AngularVelocity::fromRadians(1.2), half_second_future); EXPECT_EQ(prevAngularVelocities, robot.getPreviousAngularVelocities()); } TEST_F(RobotTest, get_timestamp_history) { std::vector prevAngularVelocities = {half_second_future, half_second_future, current_time}; Robot robot = Robot(0, Point(3, 1.2), Vector(-3, 1), Angle::fromDegrees(0), AngularVelocity::fromDegrees(25), current_time, 3); robot.updateState(Point(-1.2, 3), Vector(2.2, -0.05), Angle::quarter(), AngularVelocity::fromRadians(1.1), half_second_future); robot.updateState(Point(-1.3, 3), Vector(2.3, -0.05), Angle::quarter(), AngularVelocity::fromRadians(1.2), half_second_future); EXPECT_EQ(prevAngularVelocities, robot.getPreviousTimestamps()); } TEST_F(RobotTest, get_timestamp_index_fetches_first_index) { std::vector prevAngularVelocities = {half_second_future, half_second_future, current_time}; Robot robot = Robot(0, Point(3, 1.2), Vector(-3, 1), Angle::fromDegrees(0), AngularVelocity::fromDegrees(25), current_time, 3); robot.updateState(Point(-1.2, 3), Vector(2.2, -0.05), Angle::quarter(), AngularVelocity::fromRadians(1.1), half_second_future); robot.updateState(Point(-1.3, 3), Vector(2.3, -0.05), Angle::quarter(), AngularVelocity::fromRadians(1.2), one_second_future); EXPECT_EQ(0, robot.getHistoryIndexFromTimestamp(one_second_future)); } TEST_F(RobotTest, get_timestamp_index_fetches_last_index) { std::vector prevAngularVelocities = {half_second_future, half_second_future, current_time}; Robot robot = Robot(0, Point(3, 1.2), Vector(-3, 1), Angle::fromDegrees(0), AngularVelocity::fromDegrees(25), current_time, 3); robot.updateState(Point(-1.2, 3), Vector(2.2, -0.05), Angle::quarter(), AngularVelocity::fromRadians(1.1), half_second_future); robot.updateState(Point(-1.3, 3), Vector(2.3, -0.05), Angle::quarter(), AngularVelocity::fromRadians(1.2), one_second_future); EXPECT_EQ(2, robot.getHistoryIndexFromTimestamp(current_time)); } TEST_F(RobotTest, get_timestamp_index_no_matching_timestamp) { std::vector prevAngularVelocities = {half_second_future, half_second_future, current_time}; Robot robot = Robot(0, Point(3, 1.2), Vector(-3, 1), Angle::fromDegrees(0), AngularVelocity::fromDegrees(25), current_time, 3); robot.updateState(Point(-1.2, 3), Vector(2.2, -0.05), Angle::quarter(), AngularVelocity::fromRadians(1.1), half_second_future); robot.updateState(Point(-1.3, 3), Vector(2.3, -0.05), Angle::quarter(), AngularVelocity::fromRadians(1.2), one_second_future); Timestamp no_matching_time = half_second_future + Duration::fromMilliseconds(POSSESSION_TIMESTAMP_TOLERANCE_IN_MILLISECONDS + 1.0); EXPECT_EQ(std::nullopt, robot.getHistoryIndexFromTimestamp(no_matching_time)); }
4b071633b8c277818304977a2fc8486458f54442
ab8c6b670e5a106f110466cea93d1b62aca02c53
/src/sched/entry/l0/l0_allreduce_typed_entry.hpp
58e6f235f430c6a54d40ebecf221034807cea694
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
hundeboll-silicom/oneccl
4fa418568f0f0b6f6b480007e9c065b1f74d1414
9ea46ba5d9b81017ee27af4e66573881dc574477
refs/heads/main
2023-06-18T22:26:36.159277
2021-07-09T23:19:21
2021-07-09T23:19:21
386,219,244
0
0
NOASSERTION
2021-07-15T08:30:06
2021-07-15T08:30:05
null
UTF-8
C++
false
false
6,739
hpp
l0_allreduce_typed_entry.hpp
/* Copyright 2016-2020 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #pragma once #include <initializer_list> #include <atomic> #include "sched/entry/l0/l0_entry.hpp" #include "common/comm/l0/context/scale/ipc/ipc_ctx_impl.hpp" #include "kernels/shared.h" namespace native { template <class gpu_comm_impl, ccl::group_split_type topology> class l0_allreduce_typed_entry : public base_gpu_entry<gpu_comm_impl, topology, ccl::device_topology_type::ring, ccl_coll_allreduce> { public: friend class ccl_gpu_comm; friend class ccl_virtual_gpu_comm; using base = base_gpu_entry<gpu_comm_impl, topology, ccl::device_topology_type::ring, ccl_coll_allreduce>; using base::parent_communicator; using base::comm_addr; using base::req; using base::status; using base::kernel_router; using base::get_ctx; using base::alloc_memory_wrap; using base::get_local_kernel; using kernel_main_typed = ring::allreduce::main_kernel; static constexpr const char* class_name() noexcept { return "L0_ALLREDUCE_TYPED"; } static constexpr ccl_coll_type type() noexcept { return ccl_coll_allreduce; } l0_allreduce_typed_entry() = delete; l0_allreduce_typed_entry( ccl_sched* sched, std::shared_ptr<gpu_comm_impl> comm, specific_indexed_device_storage& available_devices, ccl_driver_context_ptr in_ctx, const ccl_buffer send_buf, ccl_buffer recv_buf, size_t cnt, const coll_param_gpu& params, std::shared_ptr<ccl_stream> device_stream = std::shared_ptr<ccl_stream>()) : base(sched, comm, in_ctx, send_buf, params, device_stream) { recv_buf_typed_entry = recv_buf; cnt_entry = cnt; int next_rank = (comm_addr.rank + 1) % comm_addr.size; kernel_router = base::template create_kernel_router_for_rank< l0_allreduce_typed_entry<gpu_comm_impl, topology>>( *this, next_rank, available_devices, base::get_params()); ENTRY_LOG_DEBUG("Init phase of current entry for ext_rank:", next_rank); this->set_state(gpu_entry_state::created); } ~l0_allreduce_typed_entry() { // TODO: remove the memory once the entry is destroyed if it's not cleared automatically // TODO: should we destroy handles here? } void start() override { ENTRY_LOG_DEBUG("Start entry, cnt ", cnt_entry); //Create base primitives base::start(); auto& main_entry_function = get_local_kernel(); // TODO: try to remove indirect buffer void* recv_buf_ptr = recv_buf_typed_entry.get_ptr(); //create implementation specified primitives main_entry_function.template set_args<typename ring::allreduce::recv_buf_arg<void>, typename ring::allreduce::send_buf_size_arg>( recv_buf_ptr, cnt_entry); // Once we filled our local parameters, we go wait for another entry to set its // parameters so we can use them this->set_state(gpu_entry_state::wait_for_entry); //make sure, that kernel ready for launch this->submit_for_execution(); status = ccl_sched_entry_status_started; } const char* name() const override { return class_name(); } std::vector<ccl_device::device_ipc_memory_handle> get_ipc_data() override { ccl_device& owned_device = parent_communicator->get_device(); auto send_buf_ptr = reinterpret_cast<void*>(base::send_buf.get_ptr()); auto recv_buf_ptr = reinterpret_cast<void*>(recv_buf_typed_entry.get_ptr()); std::vector<ccl_device::device_ipc_memory_handle> ret; ret.reserve(2); ret.push_back(owned_device.create_ipc_memory_handle(send_buf_ptr, get_ctx())); ret.push_back(owned_device.create_ipc_memory_handle(recv_buf_ptr, get_ctx())); return ret; } observer::invoke_params<type()> get_numa_data() override { observer::producer_description in_params{ .rank = comm_addr.rank, //TODO unused .comm_size = comm_addr.size, //TODO unused .staged_buffer_elem_count = cnt_entry, .context = get_ctx(), .device = parent_communicator->get_device(), .immediate_list = parent_communicator->get_device().create_immediate_cmd_list(get_ctx()) }; // TODO: Should get_params() be a part of in_params? return observer::invoke_params<type()>(std::move(in_params), base::get_params()); } protected: void dump_detail(std::stringstream& str) const override { base::dump_detail(str); } private: ccl_buffer recv_buf_typed_entry; size_t cnt_entry; public: template <class left_kernel_t, class right_kernel_t> bool execute(left_kernel_t& left_kernel, right_kernel_t& right_kernel) { bool is_right_kernel_ready = right_kernel.template test_args<typename ring::allreduce::send_buf_arg<void>, typename ring::allreduce::recv_buf_arg<void>>(); if (is_right_kernel_ready) { auto right_send_buf_arg = right_kernel.template get_arg<typename ring::allreduce::send_buf_arg<void>>(); auto right_recv_buf_arg = right_kernel.template get_arg<typename ring::allreduce::recv_buf_arg<void>>(); left_kernel.template set_args<typename ring::allreduce::right_send_buf_arg<void>, typename ring::allreduce::right_recv_buf_arg<void>>( right_send_buf_arg.second, right_recv_buf_arg.second); ENTRY_LOG_DEBUG("Binding arguments between kernels is complete. ", "Arguments of the left kernel after binding:\n", left_kernel.to_string()); } return is_right_kernel_ready; } }; } // namespace native
4233366eef08838d3aff0883407058868be5147a
8c819b83e603acecb0c651ce85e69633ee03c3cc
/BinDec.cpp
13b4a01c8a4550ed440dbbcff33a20df3d55c813
[]
no_license
Flaviohmm/TrabalhoCalculoNumerico
3cdc5cb79d0946be9578c2b33aa8199316d1d4ce
522f04e9d06af862be5a502feaffffa299596703
refs/heads/master
2016-09-05T16:24:35.439235
2015-03-25T03:11:19
2015-03-25T03:11:19
32,414,518
0
0
null
2015-03-17T19:13:34
2015-03-17T19:13:34
null
UTF-8
C++
false
false
450
cpp
BinDec.cpp
#include <stdio.h> int bin_to_dec(int bin) { int total = 0; int potenc = 1; while(bin > 0) { total += bin % 10 * potenc; bin = bin / 10; potenc = potenc * 2; } return total; } int main(void) { int dec = 0; int bin = 0; printf("Digite um numero binario: "); scanf("%d", &bin); dec = bin_to_dec(bin); printf("\nBinario = %d -> Decimal = %d\n", bin, dec); return 0; }
8a2c5b21c2cc2ebc0eb4b3fdc75edc1b1c5fb2a3
cad35287bc893aaef3761af2079a4ad08db2299c
/client/cpp/src/tarscli/util/include/util/detail/tc_shared_count_impl.h
922abf6fb45d210d512e4e2079c27637425d4287
[ "Apache-2.0" ]
permissive
foolishantcat/CxxDBC
3eafb94b6c1532a2ac236392be8544182206a9e9
f0f9e95baad72318e7fe53231aeca2ffa4a8b574
refs/heads/master
2021-09-25T21:23:11.977712
2018-10-25T17:19:46
2018-10-25T17:19:46
272,710,881
1
0
Apache-2.0
2020-06-16T13:08:34
2020-06-16T13:08:33
null
UTF-8
C++
false
false
1,768
h
tc_shared_count_impl.h
/** * Tencent is pleased to support the open source community by making Tars available. * * Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved. * * Licensed under the BSD 3-Clause License (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * https://opensource.org/licenses/BSD-3-Clause * * Unless required by applicable law or agreed to in writing, software distributed * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ #ifndef __TC_SHARED_COUNT_IMPL_H__ #define __TC_SHARED_COUNT_IMPL_H__ #include "tc_shared_count_base.h" #include "tc_checked_delete.h" namespace tars { namespace detail { template <typename T> class tc_shared_count_impl_p : public tc_shared_count_base { public: template <typename U> tc_shared_count_impl_p(U *p) : m_px(p) {} virtual void dispose() { tc_checked_delete(m_px); } private: T *m_px; }; template <typename T, typename D> class tc_shared_count_impl_pd : public tc_shared_count_base { public: tc_shared_count_impl_pd(T *p, D& d) : m_px(p) , m_deleter(d) {} virtual void dispose() // no throw { m_deleter(m_px); } private: T *m_px; D m_deleter; }; } } #endif
35698b781a675beeb105e7d968e9bff2ea8ca1ec
b8fe0ddfa6869de08ba9cd434e3cf11e57d59085
/ouan-tests/ConfigLoaderTest/main.cpp
83b744e50aa751ad807e2a2355e015eb09dcc633
[]
no_license
juanjmostazo/ouan-tests
c89933891ed4f6ad48f48d03df1f22ba0f3ff392
eaa73fb482b264d555071f3726510ed73bef22ea
refs/heads/master
2021-01-10T20:18:35.918470
2010-06-20T15:45:00
2010-06-20T15:45:00
38,101,212
0
0
null
null
null
null
UTF-8
C++
false
false
2,419
cpp
main.cpp
#include "Configuration.h" #include <iostream> const std::string INPUT_FILE="configTest_IN.xml"; const std::string OUTPUT_FILE="configTest_OUT.xml"; int main() { Configuration config; if(!config.loadFromFile(INPUT_FILE)) return 1; std::cout<<"------------------------------------------"<<std::endl; std::cout<<"Accessor test 1- existing key \"fullscreen\" "; std::string value; bool result=config.getOption("fullscreen",value); if(result) std::cout<<" FOUND. Value:"<<value<<std::endl; else std::cout<<"NOT FOUND"; std::cout<<"Accessor test 2- non-existing key \"useHDR\" "; result=config.getOption("useHDR",value); if(result) std::cout<<" FOUND. Value:"<<value<<std::endl; else std::cout<<"NOT FOUND"; std::cout<<"------------------------------------------"<<std::endl; std::cout<<"Traversal test"<<std::endl; for (TConfigMapConstIterator iter=config.begin();iter!=config.end();++iter) { std::cout<<"Key: "<<iter->first<<", Value: "<<iter->second<<std::endl; } std::cout<<"------------------------------------------"<<std::endl; std::cout<<"Option modifying test 1 - new key \"textureDetail\", value \"High\""<<std::endl; config.setOption("textureDetail","High"); if(config.getOption("textureDetail",value)) std::cout<<"Key addition successful. Value: "<<value<<std::endl; std::cout<<"Option modifying test 2 - existing key \"textureDetail\", value \"Low\", replace=true"<<std::endl; config.setOption("textureDetail","Low"); if(config.getOption("textureDetail",value)) std::cout<<"Key substitution successful. Value: "<<value<<std::endl; std::cout<<"Option modifying test 3 - new key \"textureDetail\", value \"Medium\", replace=false"<<std::endl; config.setOption("textureDetail","Medium",false); if(!config.getOption("textureDetail",value)) std::cout<<"Key wasn't replaced. Old Value: "<<value<<std::endl; std::cout<<"------------------------------------------"<<std::endl; std::cout<<"New map creation"<<std::endl; TConfigMap newMap; newMap["difficultyLevel"]="Easy"; newMap["numLives"]="3"; newMap["autoSaveEnabled"]="true"; config.setMap(newMap); std::cout<<"New map traversal:"<<std::endl; for (TConfigMapConstIterator iter=config.begin();iter!=config.end();++iter) { std::cout<<"Key: "<<iter->first<<", Value: "<<iter->second<<std::endl; } config.saveToFile(OUTPUT_FILE); return 0; }
30f7b968d9a10e7c3a2c4472f7a1563dd2fa6d50
ed260a07bacf0b7efd276831c57031b62e9dde9f
/utilities/floodlight.logparser/parsers/aggregated_flow_probe_parser/aggregated_flow_probe_parser.cpp
0e9a40f26e2c5b56911fd41d6a41a71cd1d7d007
[]
no_license
chunhui-pang/fade
12e124267f90330a0d89aa57a2910ca49b4ef292
7e228150d49c54e7890f09c5777f2ccd3904200c
refs/heads/master
2021-08-23T04:43:24.329186
2017-12-03T10:39:15
2017-12-03T10:39:15
108,712,033
2
1
null
null
null
null
UTF-8
C++
false
false
3,396
cpp
aggregated_flow_probe_parser.cpp
#include <parsers/aggregated_flow_probe_parser/aggregated_flow_probe_parser.h> #include <cstdlib> const std::string aggregated_flow_probe_parser::PARSER_NAME = "aggregated_flow_probe parser"; static const std::string AGGREGATED_FLOW_NODE_REGEX = "AggregatedFlowNode.*?(.*?datapathId=.*?:([0-9a-f]{2}),.*?ipv4_dst=([0-9.]+).*?dependsOnSize=0}(,\\W)?)(,\\W)?+\\]\\}"; static const std::string AGGREGATED_FLOW_REGEX = "AggregatedFlow\\{flowId=([0-9]+).*?flowNodes=\\[((" + AGGREGATED_FLOW_NODE_REGEX + "(,\\W)?)+)\\]\\}"; static const std::string PROBE_CONTENT_REGEX = "(" + AGGREGATED_FLOW_NODE_REGEX + "(,\\W)?)+"; const std::regex aggregated_flow_probe_parser::AGGREGATED_FLOW_NODE(AGGREGATED_FLOW_NODE_REGEX); const std::regex aggregated_flow_probe_parser::AGGREGATED_FLOW_NODE_EX( "(" + AGGREGATED_FLOW_NODE_REGEX + ")(,\\W)?(.*)" ); const std::regex aggregated_flow_probe_parser::AGGREGATED_FLOW(AGGREGATED_FLOW_REGEX); const std::regex aggregated_flow_probe_parser::AGGREGATED_FLOW_EX("(" + AGGREGATED_FLOW_REGEX + "),\\W(.*)"); const std::regex aggregated_flow_probe_parser::PROBE_CONTENT( PROBE_CONTENT_REGEX ); const std::regex aggregated_flow_probe_parser::AGGREGATED_FLOW_PROBE(".*select\\Wprobes\\Wfor\\Wflow\\W(" + AGGREGATED_FLOW_REGEX + "),\\Wprobes\\Ware\\W\\[(" + PROBE_CONTENT_REGEX + ")\\]"); void aggregated_flow_probe_parser::parse_flow(const std::string &flow_content) { std::smatch sm; if (std::regex_match(flow_content, sm, AGGREGATED_FLOW)) { int flow_id = std::atoi(sm[1].str().c_str()); std::string nodes_content = sm[2].str(); while (std::regex_match(nodes_content, sm, AGGREGATED_FLOW_NODE_EX)) { std::string node_content = sm[1].str(); nodes_content = sm[sm.size()-1].str(); if (std::regex_match(node_content, sm, AGGREGATED_FLOW_NODE)) { std::string dst = sm[3].str(); if (NULL == this->result) this->result = new aggregated_flow_probe(flow_id, dst); int dpid = std::strtol(sm[2].str().c_str(), NULL, 16); this->result->append_switch(dpid); } } } } void aggregated_flow_probe_parser::parse_probes(const std::string &probes_content) { std::smatch sm; std::string content = probes_content; while (std::regex_match(content, sm, AGGREGATED_FLOW_NODE_EX)) { std::string node_content = sm[1].str(); content = sm[sm.size()-1].str(); if (std::regex_match(node_content, sm, AGGREGATED_FLOW_NODE)) { int dpid = std::strtol(sm[2].str().c_str(), NULL, 16); this->result->append_probe(dpid); } } } aggregated_flow_probe_parser::aggregated_flow_probe_parser() : result(NULL) { } const std::string& aggregated_flow_probe_parser::get_name() const { return PARSER_NAME; } parser::parse_result aggregated_flow_probe_parser::parse_line(const std::string &line, int n) { std::smatch sm; if (std::regex_match(line, sm, AGGREGATED_FLOW_PROBE)) { std::string flow_content = sm[1].str(); std::string probe_content = sm[11].str(); this->parse_flow(flow_content); this->parse_probes(probe_content); return SUCCESS_AND_STOP; } return parser::SKIP; } const entity* aggregated_flow_probe_parser::pop_parse_result() { const entity* tmp = this->result; this->result = NULL; return tmp; } aggregated_flow_probe_parser::~aggregated_flow_probe_parser() { if (NULL != this->result) delete this->result; } extern "C" { parser* create_parser() { return new aggregated_flow_probe_parser(); } }
37a4186627baccd5bf2c3846105507ceaa96c62b
199b0ae4e479a31ae810c5a302e2251c20e5fb64
/RF1276/radiodialog.h
37bcbd005850dcc0cda52c05f29a6d3d21dd3ed9
[]
no_license
cukier/qt
31d52082c74981d70bfbaaae083094004125a98a
401c0acef6b6ab0edb41f9cbf527746ad3ac383a
refs/heads/master
2018-06-01T02:19:52.326043
2018-05-30T19:53:45
2018-05-30T19:53:45
114,905,975
0
0
null
null
null
null
UTF-8
C++
false
false
735
h
radiodialog.h
#ifndef RADIODIALOG_H #define RADIODIALOG_H #include <QWidget> namespace Ui { class RadioDialog; } class RadioDialog : public QWidget { Q_OBJECT public: struct RadioSettings { int baudRate = 0; int parity = 0; int rfFactor = 0; int mode = 0; int rfBw = 0; int id = 0; int NetId = 0; int rfPower = 0; float freq = 0.0; }; explicit RadioDialog(QWidget *parent = 0); ~RadioDialog(); RadioSettings settings() const; void setSettings(const RadioSettings &settings); signals: void apply(); private slots: void on_btApply_clicked(); private: Ui::RadioDialog *ui; RadioSettings m_settings; }; #endif // RADIODIALOG_H
36de5da7822539c5da26a14b10632c79f4696e20
28e10f7ddd4736cc8bc08d7d20652271117ac414
/Problems/LCS_sp/lcsdp.cpp
0864afef677227f4c5662a8dfa1be1f2cdf443a5
[]
no_license
johnmmm/LeetCode_training
3911394adc98e0e929409bc0fd8186ccb1eb7e97
fbcb1b437a692f4949426478353c272b62302cc6
refs/heads/master
2020-03-31T14:04:55.835162
2019-02-13T14:10:30
2019-02-13T14:10:30
152,279,034
2
0
null
null
null
null
UTF-8
C++
false
false
3,067
cpp
lcsdp.cpp
#include <string> #include <vector> #include <unordered_map> using namespace std; const int bufN = 10000; char buf[bufN], *p = buf; const int maxw = 500001; const int maxh = 500; short dp[maxh+1][maxw] = {-1}; inline int getint() { while (*p < 48 || *p > 57) ++p; int res = 0; while (*p > 47 && *p < 58) res = res * 10 + *p++ - 48; return res; } inline string getstring() { string res; while(*p == ' ' || *p == '\n') ++p; while(*p != ' ' && *p != '\n') res += *p++; return res; } class Solution { public: Solution(){} int minDp(int a, int b) { int ans = 0; if (a == -1 && b == -1) return -1; else if (a == -1 && b != -1) ans = b; else if (a != -1 && b == -1) ans = a; else { if (a > b) ans = b; else ans = a; } if (ans + 1 > 100) return -1; else return ans+1; } void displaydp(int a, int b) { for (int i = 0; i <= a; i++) { for (int j = 0; j <= b; j++) { printf("%d ", dp[i][j]); } printf("\n"); } } int minDis(string a, string b) { int sizea = a.size(), sizeb = b.size(); // printf("%s\n", a.c_str()); // printf("%s\n", b.c_str()); // printf("len: %d %d\n", sizea, sizeb); if ((sizea - sizeb > 100) || (sizeb - sizea > 100)) return -1; memset(dp, -1, maxh * maxw * 2); for (int i = 0; i < maxh; i++) dp[i][0] = i; for (int i = 0; i < maxw; i++) dp[0][i] = i; int h_place = 1; int tmpdp = 0; int tmpdp_11 = 0, tmpdp_1 = 0; for (int i = 1; i <= a.size(); i++) { if (h_place == maxh+1) { dp[0][0] = dp[maxh][0]; for (int j = 1; j < maxh; j++) dp[j][0] = dp[j-1][0] + 1; for (int j = 1; j < maxw; j++) dp[0][j] = dp[maxh][j]; h_place = 1; } for (int j = 1; j <= b.size(); j++) { if (a.c_str()[i-1] == b.c_str()[j-1]) tmpdp = dp[h_place-1][j-1]; else tmpdp = minDp(dp[h_place][j-1], dp[h_place-1][j]); dp[h_place][j] = tmpdp; if (tmpdp == -1 && tmpdp_11 == -1 && tmpdp_1 == -1) break; } h_place++; } //displaydp(10, 10); return dp[h_place-1][b.size()]; } private: int num; }; int main () { FILE *fp = fopen("./in.txt", "r"); fread(buf, 1, bufN, fp); int num = getint(); int ans; for (int i = 0; i < num; i++) { Solution solution; string a = getstring(); string b = getstring(); ans = solution.minDis(a, b); printf("%d\n", ans); } return 0; }
21775436e25383d0f631b370bff6bde4b88a2e33
f03f6f6b4f8501fa257f2007b7f66dbcabfb341e
/hphp/runtime/ext/asio/async-generator.h
84148033706d63b22dc02d4c4c1b36b8081ec3a3
[ "PHP-3.01", "BSD-3-Clause", "Zend-2.0" ]
permissive
blueprintmrk/hhvm
a5c69a9ba560a1090717c3061a9a0e15d405b765
cb0c92ff52ff368f63ad516c9f3118b7ff30cd81
refs/heads/master
2021-01-21T09:20:21.322671
2015-06-17T23:03:15
2015-06-17T23:32:16
37,628,408
2
0
null
2015-06-18T00:27:56
2015-06-18T00:27:56
null
UTF-8
C++
false
false
2,964
h
async-generator.h
/* +----------------------------------------------------------------------+ | HipHop for PHP | +----------------------------------------------------------------------+ | Copyright (c) 2010-2014 Facebook, Inc. (http://www.facebook.com) | | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ */ #ifndef incl_HPHP_EXT_ASIO_ASYNC_GENERATOR_H_ #define incl_HPHP_EXT_ASIO_ASYNC_GENERATOR_H_ #include "hphp/runtime/ext/extension.h" #include "hphp/runtime/ext/ext_generator.h" #include "hphp/runtime/vm/resumable.h" #include "hphp/runtime/vm/jit/types.h" #include "hphp/system/systemlib.h" namespace HPHP { /////////////////////////////////////////////////////////////////////////////// // class AsyncGenerator class c_AsyncGeneratorWaitHandle; class c_StaticWaitHandle; class c_WaitableWaitHandle; class c_AsyncGenerator final : public BaseGenerator { public: DECLARE_CLASS_NO_SWEEP(AsyncGenerator) explicit c_AsyncGenerator(Class* cls = c_AsyncGenerator::classof()) : BaseGenerator(cls) {} ~c_AsyncGenerator(); void t___construct(); void t_next(); void t_send(const Variant& value); void t_raise(const Object& exception); public: static c_AsyncGenerator* Create(const ActRec* fp, size_t numSlots, jit::TCA resumeAddr, Offset resumeOffset); bool isEagerlyExecuted() const { assert(getState() == State::Running); return m_waitHandle == nullptr; } c_AsyncGeneratorWaitHandle* getWaitHandle() const { assert(getState() == State::Running); return m_waitHandle; } c_AsyncGeneratorWaitHandle* await(Offset resumeOffset, c_WaitableWaitHandle* child); c_StaticWaitHandle* yield(Offset resumeOffset, const Cell* key, Cell value); c_StaticWaitHandle* ret(); c_StaticWaitHandle* fail(ObjectData* exception); void failCpp(); private: // valid only in Running state; null during eager execution c_AsyncGeneratorWaitHandle* m_waitHandle; }; /////////////////////////////////////////////////////////////////////////////// } #endif // incl_HPHP_EXT_ASIO_ASYNC_GENERATOR_H_
6e37a35dccd7bc9dc481df5c5011a51a92aa3aaa
b0580b638f7649e34ac53ef47794752657600bf1
/programs/RxStep/src/RxSelectReportFile.cpp
81264b982889385d8ac904b194e821b29dad2589
[]
no_license
Automation-group/Relaxation
e653801bb2fb4aeb93f708c0df60a8162db54b7e
36079f758c181079dd7ee0df4053d8729c26c61a
refs/heads/master
2021-06-04T09:42:45.023152
2019-08-22T14:05:00
2019-08-22T14:05:00
96,538,876
0
0
null
null
null
null
UTF-8
C++
false
false
1,113
cpp
RxSelectReportFile.cpp
#include "RxSelectReportFile.h" #include <QFileInfo> #include <QDir> #include <QFileDialog> #include <ui_SelectReportFileWizardPage.h> RxSelectReportFile::RxSelectReportFile() : m_ui(new Ui_SelectReportFileForm) { m_ui->setupUi(this); } QString RxSelectReportFile::fileName() const { return m_ui->leFileName -> text (); } void RxSelectReportFile::setFileName(const QString& fname) { m_ui->leFileName -> setText(fname); } void RxSelectReportFile::on_tbSelectReportFile_clicked() { QString dir = QFileInfo (m_ui->leFileName -> text ()).absolutePath() + QDir::separator(); QString fileName = QFileDialog::getSaveFileName(this, tr("Выберете файл эксперимента"), dir, tr("Файл отчета (*.rxz)")); if (fileName.isEmpty()) m_ui->leFileName -> setText(dir); else { if(!fileName.endsWith(".rxz")) fileName += ".rxz"; m_ui->leFileName -> setText(fileName); } } void RxSelectReportFile::on_leFileName_textChanged(const QString& text) { completeChanged (); } bool RxSelectReportFile::isComplete () const { return !QFileInfo (m_ui->leFileName -> text ()).isDir(); }
e64311eed5ac30e82c78ebdde5161684aeabbed0
8b491a0ae78a5aadda660aae7e9207394fa362a8
/UVa 11966 - Galactic Bonding/src/UVa 11966 - Galactic Bonding.cpp
1a59931d1d6862f44f671fc50248438c95ea2f18
[]
no_license
GIMPS/UVa-Solutions
77dfba09a534ce64dcee58ff6e4bbd99582c875c
4ec248126c86a24d723ed556a796ba507ccbbb5c
refs/heads/master
2021-01-23T05:29:53.942348
2013-04-11T10:48:58
2013-04-11T10:48:58
86,313,322
0
1
null
2017-03-27T08:57:52
2017-03-27T08:57:52
null
UTF-8
C++
false
false
1,331
cpp
UVa 11966 - Galactic Bonding.cpp
#include<vector> #include<cstdio> #include<cmath> using namespace std; class UFDS { private: vector<int> p, rank, setSize; int numSets; public: UFDS(int N) { numSets = N; rank.assign(N, 0); p.assign(N, 0); for (int i = 0; i < N; i++) p[i] = i; setSize.assign(N, 1); } int findSet(int i) { return (p[i] == i) ? i : p[i] = findSet(p[i]); } bool isSameSet(int i, int j) { return findSet(i) == findSet(j); } void unionSet(int i, int j) { if (!isSameSet(i, j)) { int x = findSet(i), y = findSet(j); if (rank[x] > rank[y]) { p[y] = x; setSize[findSet(x)] += setSize[findSet(y)]; } else { p[x] = y; if (rank[x] == rank[y]) rank[y]++; setSize[findSet(y)] += setSize[findSet(x)]; } numSets--; } } int nSets() { return numSets; } }; double x[1005], y[1005]; double dist(int i, int j) { return sqrt((x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j])); } int main() { int tc, n, count = 1; double d; scanf("%d", &tc); while (tc--) { scanf("%d %lf", &n, &d); for (int i = 0; i < n; i++) { scanf("%lf %lf", &x[i], &y[i]); } UFDS us(n); for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { if (dist(i, j) - d < 1e-8) us.unionSet(i, j); } } printf("Case %d: %d\n", count++, us.nSets()); } return 0; }
63b9ab6b3eb283ad484e1dca0da623d54f210417
09e9f04bd98495b81598cd6e8110457f9e71039f
/March_Challenge/1.cpp
1f603431fb8ef054b4a1ce6ee58050ba36525846
[]
no_license
AnjaliPatle/Leetcode-Challenge
64a1ee381b3141b820f7c179fb288f0e8d2f4459
842fe0bcb968902db4b1bcacae74199f9e0e66dc
refs/heads/master
2023-06-23T12:25:45.993507
2021-07-25T18:15:14
2021-07-25T18:15:14
300,607,343
1
0
null
null
null
null
UTF-8
C++
false
false
249
cpp
1.cpp
class Solution { public: int distributeCandies(vector<int>& candies) { unordered_map<int,int>um; for(int i=0;i<candies.size();i++){ um[candies[i]]++; } return min(candies.size()/2,um.size()); } };
09633e5a94e27bbfc82a2e5b946aa80654f4a938
e76fbdfa0b47a1e713ffca8a027adf5235c88976
/Pointers/function-pointers.cpp
1daff3e13149de9f00046f34556709bfc4ce7862
[]
no_license
Rithvik-14/Cplusplus
a85713ea229a52a7c38b62401a5e4a6b53ee1829
95c3aec7661871c9b666712732ea989be53fef7f
refs/heads/main
2023-08-11T10:58:08.875412
2021-10-03T06:56:44
2021-10-03T06:56:44
349,350,055
0
0
null
null
null
null
UTF-8
C++
false
false
318
cpp
function-pointers.cpp
#include<iostream> using namespace std; void print(int*p){ cout<<*p<<endl; } void incrementpointer(int*p){ p=p+1; } void increment(int*p){ (*p)++; } int main(){ int i=10; int*p = &i; print(p); cout<<p<<endl; cout<<&i<<endl; cout<<*p<<endl; increment(p); cout<<*p<<endl; }
6f68d8d10abe56bfda71855c34c806b850d1193f
f319e33e032ef05bae3ba7fbf72135f98883860d
/codes/Controller/InteractorStyles/QInteractorStyleVesselSegmentation2.cpp
6ad8d0b2f9fd00f7360818937a377ca9e0bfe27f
[ "MIT", "Apache-2.0" ]
permissive
wuzhuobin/IADE_Analyzer
6cfb6402b990ce6f8171e95e2b7c5db3f9c7fab2
3b6c9ab0ef02ce076566385d532929ffc205324b
refs/heads/master
2021-01-13T12:16:39.319305
2017-09-27T03:00:03
2017-09-27T03:00:03
85,917,248
2
0
null
null
null
null
UTF-8
C++
false
false
26,355
cpp
QInteractorStyleVesselSegmentation2.cpp
#include "QInteractorStyleVesselSegmentation2.h" #include "ui_QInteractorStyleVesselSegmentation2.h" #include "ui_QInteractorStylePolygonDrawSeries.h" #include <vtkObjectFactory.h> #include <vtkOrientedGlyphContourRepresentation.h> #include <vtkImageData.h> #include <vtkContourWidget.h> #include <vtkImageActorPointPlacer.h> #include <vtkCommand.h> #include <vtkProperty.h> #include <vtkLookupTable.h> #include <vtkPolyData.h> #include <vtkCellData.h> #include <vtkLinearContourLineInterpolator.h> #include <vtkBezierContourLineInterpolator.h> #include <vtkImageThreshold.h> #include <vtkMarchingSquares.h> #include <vtkPolyDataConnectivityFilter.h> #include <vtkCleanPolyData.h> #include <vtkCallbackCommand.h> #include <vtkRenderWindowInteractor.h> #include "MagneticContourLineInterpolator.h" #include "ContourWidgetSeries.h" #include "ContourWidgetSeriesOrientedGlyphRepresentation.h" #include "VesselWallHoughTransformCircles.h" #include "ReorderPointIdOfContourFilter.h" #include "LumenSegmentationFilter2.h" #include "ImageViewer.h" vtkStandardNewMacro(QInteractorStyleVesselSegmentation2); QSETUP_UI_SRC(QInteractorStyleVesselSegmentation2); QInteractorStyleVesselSegmentation2::ContourMap QInteractorStyleVesselSegmentation2::m_normalXZ; QInteractorStyleVesselSegmentation2::ContourMap QInteractorStyleVesselSegmentation2::m_normalYZ; QInteractorStyleVesselSegmentation2::ContourMap QInteractorStyleVesselSegmentation2::m_normalXY; QInteractorStyleVesselSegmentation2::ContourMap QInteractorStyleVesselSegmentation2::m_lumen; QInteractorStyleVesselSegmentation2::ContourMap QInteractorStyleVesselSegmentation2::m_vesselWall; class QInteractorStyleVesselSegmentation2Callback : public vtkCommand { public: vtkTypeMacro(QInteractorStyleVesselSegmentation2Callback, vtkCommand); static QInteractorStyleVesselSegmentation2Callback* New() { return new QInteractorStyleVesselSegmentation2Callback; } virtual void Execute(vtkObject *caller, unsigned long eventId, void *callData) override { //ContourWidgetSeries* contourSeries = ContourWidgetSeries::SafeDownCast(caller); if (self->m_currentMode != QInteractorStyleVesselSegmentation2::NORMAL) { switch (eventId) { case InteractionEvent: case EndInteractionEvent: self->SaveContoursToContourMap(); self->m_lumenContours->SetWidgetState(ContourWidgetSeries::DEFINE); self->m_vesselWallContours->SetWidgetState(ContourWidgetSeries::DEFINE); break; case MouseMoveEvent: // conducting event to other widgets { //self->m_lumenContours->InvokeEvent(MouseMoveEvent, NULL); //self->m_vesselWallContours->InvokeEvent(MouseMoveEvent, NULL); int X = self->Interactor->GetEventPosition()[0]; int Y = self->Interactor->GetEventPosition()[1]; int state1, state2; state1 = self->m_lumenContoursRep->ComputeInteractionState(X, Y); state2 = self->m_vesselWallContoursRep->ComputeInteractionState(X, Y); if (state1 == ContourWidgetSeriesRepresentation::OUTSIDE && state2 == ContourWidgetSeriesRepresentation::OUTSIDE) { self->m_contourSeries->ProcessEventsOn(); self->m_lumenContours->ProcessEventsOff(); self->m_vesselWallContours->ProcessEventsOff(); } else if (state1 != ContourWidgetSeriesRepresentation::OUTSIDE) { self->m_contourSeries->ProcessEventsOff(); self->m_lumenContours->ProcessEventsOn(); self->m_vesselWallContours->ProcessEventsOff(); } else if (state2 != ContourWidgetSeriesRepresentation::OUTSIDE) { self->m_contourSeries->ProcessEventsOff(); self->m_lumenContours->ProcessEventsOff(); self->m_vesselWallContours->ProcessEventsOn(); } } break; case LeftButtonPressEvent: { int X = self->Interactor->GetEventPosition()[0]; int Y = self->Interactor->GetEventPosition()[1]; int state; state = self->m_lumenContoursRep->ComputeInteractionState(X, Y); if (state != ContourWidgetSeriesRepresentation::OUTSIDE) { self->m_lumenContours->InvokeEvent(LeftButtonPressEvent, NULL); return; } state = self->m_vesselWallContoursRep->ComputeInteractionState(X, Y); if (state != ContourWidgetSeriesRepresentation::OUTSIDE) { self->m_vesselWallContours->InvokeEvent(LeftButtonPressEvent, NULL); return; } } break; case LeftButtonReleaseEvent: { int X = self->Interactor->GetEventPosition()[0]; int Y = self->Interactor->GetEventPosition()[1]; int state; state = self->m_lumenContoursRep->ComputeInteractionState(X, Y); if (state != ContourWidgetSeriesRepresentation::OUTSIDE) { self->m_lumenContours->InvokeEvent(LeftButtonReleaseEvent, NULL); SetAbortFlag(1); return; } state = self->m_vesselWallContoursRep->ComputeInteractionState(X, Y); if (state != ContourWidgetSeriesRepresentation::OUTSIDE) { self->m_vesselWallContours->InvokeEvent(LeftButtonReleaseEvent, NULL); SetAbortFlag(1); return; } } break; default: break; } } } QInteractorStyleVesselSegmentation2* self = nullptr; }; QInteractorStyleVesselSegmentation2::QInteractorStyleVesselSegmentation2(int uiType, QWidget * parent) { QNEW_UI(); } QInteractorStyleVesselSegmentation2::~QInteractorStyleVesselSegmentation2() { QDELETE_UI(); } void QInteractorStyleVesselSegmentation2::uniqueInitialization() { } void QInteractorStyleVesselSegmentation2::initialization() { m_callback = vtkSmartPointer<QInteractorStyleVesselSegmentation2Callback>::New(); m_callback->self = this; m_contourSeries->AddObserver(vtkCommand::MouseMoveEvent, m_callback); //m_contourSeries->AddObserver(vtkCommand::LeftButtonPressEvent, m_callback); //m_contourSeries->AddObserver(vtkCommand::LeftButtonReleaseEvent, m_callback); m_lumenContoursRep = vtkSmartPointer<ContourWidgetSeriesOrientedGlyphRepresentation>::New(); m_lumenContours = vtkSmartPointer<ContourWidgetSeries>::New(); m_lumenContours->SetRepresentation(m_lumenContoursRep); m_lumenContours->AddObserver(vtkCommand::MouseMoveEvent, m_callback); m_lumenContours->AddObserver(vtkCommand::InteractionEvent, m_callback); m_lumenContours->AddObserver(vtkCommand::EndInteractionEvent, m_callback); m_vesselWallContoursRep = vtkSmartPointer<ContourWidgetSeriesOrientedGlyphRepresentation>::New(); m_vesselWallContours = vtkSmartPointer<ContourWidgetSeries>::New(); m_vesselWallContours->SetRepresentation(m_vesselWallContoursRep); m_vesselWallContours->AddObserver(vtkCommand::MouseMoveEvent, m_callback); m_vesselWallContours->AddObserver(vtkCommand::InteractionEvent, m_callback); m_vesselWallContours->AddObserver(vtkCommand::EndInteractionEvent, m_callback); // disconnect the old one disconnect(QInteractorStylePolygonDrawSeries::getUi()->cleanAllPushButton, SIGNAL(clicked()), this, SLOT(CleanAll())); disconnect(QInteractorStylePolygonDrawSeries::getUi()->cleanOnePushButton, SIGNAL(clicked()), this, SLOT(CleanOne())); disconnect(QInteractorStylePolygonDrawSeries::getUi()->fillContourPushButton, SIGNAL(clicked()), this, SLOT(FillContours())); disconnect(QInteractorStylePolygonDrawSeries::getUi()->polygonRadionButton, SIGNAL(clicked()), this, SLOT(SetLinearInterpolator())); disconnect(QInteractorStylePolygonDrawSeries::getUi()->smoothCurveRadioButton, SIGNAL(clicked()), this, SLOT(SetBezierInterpolator())); disconnect(QInteractorStylePolygonDrawSeries::getUi()->radioButtonMagnetic, SIGNAL(clicked()), this, SLOT(SetMagneticInterpolator())); disconnect(QInteractorStylePolygonDrawSeries::getUi()->comboBoxLabel, SIGNAL(currentIndexChanged(int)), this, SLOT(SetContourLabel(int))); // connect the new one connect(ui->cleanAllPushButton, SIGNAL(clicked()), this, SLOT(CleanAll())); connect(ui->cleanOnePushButton, SIGNAL(clicked()), this, SLOT(CleanOne())); connect(ui->fillContourPushButton, SIGNAL(clicked()), this, SLOT(FillContours())); connect(ui->polygonRadionButton, SIGNAL(clicked()), this, SLOT(SetLinearInterpolator())); connect(ui->smoothCurveRadioButton, SIGNAL(clicked()), this, SLOT(SetBezierInterpolator())); connect(ui->radioButtonMagnetic, SIGNAL(clicked()), this, SLOT(SetMagneticInterpolator())); connect(ui->comboBoxLabel, SIGNAL(currentIndexChanged(int)), this, SLOT(SetContourLabel(int))); // connect the mode change button connect(ui->radioButtonNormal, SIGNAL(clicked()), this, SLOT(SetSegmentationModeToNormal())); connect(ui->radioButtonLumenSegmentation, SIGNAL(clicked()), this, SLOT(SetSegmentationModeToLumenSegmentation())); connect(ui->radioButtonVesselWallSegmentation, SIGNAL(clicked()), this, SLOT(SetSegmentationModeToVesselSegmentation())); // autoLumenSegmentation connect(ui->autoLumenSegmentationSpinBox, SIGNAL(valueChanged(int)), this, SLOT(SetLumenSegmentationValue(int))); connect(ui->pushButtonAutoLumenSegmentation, SIGNAL(clicked()), this, SLOT(AutoLumenSegmentation())); // autoVesselWallSegmentation connect(ui->pushButtonAutoVesselWallSegmentation, SIGNAL(clicked()), this, SLOT(AutoVesselWallSegmentation())); connect(ui->spinBoxVesselWallThickness, SIGNAL(valueChanged(int)), this, SLOT(setVesselWallSegmentationRadius(int))); // fill slices connect(ui->spinBoxFillSlicesBegin, SIGNAL(valueChanged(int)), this, SLOT(SetFillSliceBegin(int))); connect(ui->spinBoxFillSliceEnd, SIGNAL(valueChanged(int)), this, SLOT(SetFillSliceEnd(int))); connect(ui->pushButtonFillSlices, SIGNAL(clicked()), this, SLOT(FillSlices())); } void QInteractorStyleVesselSegmentation2::uniqueEnable() { QInteractorStylePolygonDrawSeries::uniqueEnable(); int* extent = GetImageViewer()->GetDisplayExtent(); ui->spinBoxFillSlicesBegin->setRange(extent[4], extent[5]); ui->spinBoxFillSliceEnd->setRange(extent[4], extent[5]); } void QInteractorStyleVesselSegmentation2::OnEnter() { InteractorStylePolygonDrawSeries::OnEnter(); QList<QInteractorStyleVesselSegmentation2*> _disable; QList<QInteractorStyleVesselSegmentation2*> _enable; for (std::list<AbstractInteractorStyleImage*>::const_iterator cit = m_imageStyles.cbegin(); cit != m_imageStyles.cend(); ++cit) { QInteractorStyleVesselSegmentation2* _style = QInteractorStyleVesselSegmentation2::SafeDownCast(*cit); if (_style != nullptr && _style->GetCustomEnabled()) { // find out all styles which needs to be disable if (_style->m_contourSeries->GetEnabled() && _style->GetSliceOrientation() == this->GetSliceOrientation() && _style != this) { _disable << _style; } // find out all styles which needs to be enable else if (!_style->m_contourSeries->GetEnabled() && (_style->GetSliceOrientation() != this->GetSliceOrientation() || _style == this)) { _enable << _style; } } } foreach(QInteractorStyleVesselSegmentation2* style, _disable) { style->m_contourSeries->ResetContours(); style->m_contourSeries->EnabledOff(); if (m_currentMode != NORMAL && style->GetSliceOrientation() == ImageViewer::SLICE_ORIENTATION_XY) { style->m_vesselWallContours->ResetContours(); style->m_lumenContours->ResetContours(); style->m_vesselWallContours->EnabledOff(); style->m_lumenContours->EnabledOff(); } } foreach(QInteractorStyleVesselSegmentation2* style, _enable) { style->m_contourSeries->EnabledOn(); style->LoadContoursFromContourMap(); if (m_currentMode != NORMAL && style->GetSliceOrientation() == ImageViewer::SLICE_ORIENTATION_XY) { style->m_vesselWallContours->EnabledOn(); style->m_lumenContours->EnabledOn(); } } } void QInteractorStyleVesselSegmentation2::OnMouseMove() { QInteractorStylePolygonDrawSeries::OnMouseMove(); if (m_currentMode != NORMAL) { //int X = this->Interactor->GetEventPosition()[0]; //int Y = this->Interactor->GetEventPosition()[1]; //int state1, state2; //state1 = this->m_lumenContoursRep->ComputeInteractionState(X, Y); //state2 = this->m_vesselWallContoursRep->ComputeInteractionState(X, Y); //if (state1 == ContourWidgetSeriesRepresentation::OUTSIDE && // state2 == ContourWidgetSeriesRepresentation::OUTSIDE) { // m_contourSeries->ProcessEventsOn(); //} //else if (state1 != ContourWidgetSeriesRepresentation::OUTSIDE) { // m_lumenContours->ProcessEventsOn(); //} //else if (state2 != ContourWidgetSeriesRepresentation::OUTSIDE) { // m_vesselWallContours->ProcessEventsOn(); //} } } void QInteractorStyleVesselSegmentation2::OnLeftButtonDown() { QInteractorStylePolygonDrawSeries::OnLeftButtonDown(); if (m_currentMode != NORMAL) { //m_vesselWallContours->InvokeEvent(vtkCommand::LeftButtonPressEvent); //m_lumenContours->InvokeEvent(vtkCommand::LeftButtonPressEvent); } } void QInteractorStyleVesselSegmentation2::OnLeftButtonUp() { QInteractorStylePolygonDrawSeries::OnLeftButtonUp(); if (m_currentMode != NORMAL) { //m_vesselWallContours->InvokeEvent(vtkCommand::LeftButtonReleaseEvent); //m_lumenContours->InvokeEvent(vtkCommand::LeftButtonReleaseEvent); } } void QInteractorStyleVesselSegmentation2::SetCustomEnabled(bool flag) { QInteractorStylePolygonDrawSeries::SetCustomEnabled(flag); if (flag) { vtkSmartPointer<vtkImageActorPointPlacer> imagePointPlacer = vtkSmartPointer<vtkImageActorPointPlacer>::New(); imagePointPlacer->SetImageActor(GetImageViewer()->GetImageActor()); vtkSmartPointer<vtkOrientedGlyphContourRepresentation> lumenRep = vtkSmartPointer<vtkOrientedGlyphContourRepresentation>::New(); lumenRep->SetPointPlacer(imagePointPlacer); lumenRep->SetLineColor(1, 0, 0); m_lumenContoursRep->SetContourRepresentation(lumenRep); vtkSmartPointer<vtkOrientedGlyphContourRepresentation> vesselWallRep = vtkSmartPointer<vtkOrientedGlyphContourRepresentation>::New(); vesselWallRep->SetPointPlacer(imagePointPlacer); vesselWallRep->SetLineColor(0, 0, 1); m_vesselWallContoursRep->SetContourRepresentation(vesselWallRep); m_lumenContours->SetInteractor(this->Interactor); m_vesselWallContours->SetInteractor(this->Interactor); SetSegmentationMode(m_currentMode); } else { m_lumenContours->ResetContours(); m_lumenContours->EnabledOff(); m_vesselWallContours->ResetContours(); m_vesselWallContours->EnabledOff(); } } void QInteractorStyleVesselSegmentation2::SetCurrentFocalPointWithImageCoordinateByViewer(int i, int j, int k) { int ijk[3]; GetImageViewer()->GetFocalPointWithImageCoordinate(ijk); InteractorStylePolygonDrawSeries::SetCurrentFocalPointWithImageCoordinateByViewer(i, j, k); if (GetSlice() != ijk[GetSliceOrientation()]) { m_contourSeries->ResetContours(); m_vesselWallContours->ResetContours(); m_lumenContours->ResetContours(); LoadContoursFromContourMap(); } } void QInteractorStyleVesselSegmentation2::SetSegmentationMode(int mode) { m_currentMode = mode; switch (mode) { case NORMAL: ui->stackedWidgetMode->setCurrentWidget(ui->pageNormal); m_lumenContours->EnabledOff(); m_vesselWallContours->EnabledOff(); return; case LUMEN_SEGMENTATION: ui->stackedWidgetMode->setCurrentWidget(ui->pageLumenSegmentation); m_lumenContours->EnabledOn(); //m_lumenContours->SetWidgetState(ContourWidgetSeries::DEFINE); m_vesselWallContours->EnabledOn(); //m_vesselWallContours->SetWidgetState(ContourWidgetSeries::DEFINE); break; case VESSEL_WALL_SEGMENTATION: ui->stackedWidgetMode->setCurrentWidget(ui->pageVesselWallSegmentation); m_lumenContours->EnabledOn(); //m_lumenContours->SetWidgetState(ContourWidgetSeries::DEFINE); m_vesselWallContours->EnabledOn(); //m_vesselWallContours->SetWidgetState(ContourWidgetSeries::DEFINE); break; default: break; } } void QInteractorStyleVesselSegmentation2::SaveContoursToContourMap() { if (m_contourSeries->GetEnabled()) { switch (this->GetSliceOrientation()) { case ImageViewer::SLICE_ORIENTATION_YZ: QInteractorStylePolygonDrawSeries::SaveContoursToContourMap(this->GetSlice(), this->m_contourSeries, this->m_normalYZ); break; case ImageViewer::SLICE_ORIENTATION_XZ: QInteractorStylePolygonDrawSeries::SaveContoursToContourMap(this->GetSlice(), this->m_contourSeries, this->m_normalXZ); break; case ImageViewer::SLICE_ORIENTATION_XY: QInteractorStylePolygonDrawSeries::SaveContoursToContourMap(this->GetSlice(), this->m_contourSeries, this->m_normalXY); if (m_currentMode != NORMAL) { QInteractorStylePolygonDrawSeries::SaveContoursToContourMap(this->GetSlice(), this->m_lumenContours, this->m_lumen); QInteractorStylePolygonDrawSeries::SaveContoursToContourMap(this->GetSlice(), this->m_vesselWallContours, this->m_vesselWall); } break; default: break; } } } void QInteractorStyleVesselSegmentation2::LoadContoursFromContourMap() { if (this->m_contourSeries->GetEnabled()) { int ijk[3]; GetImageViewer()->GetFocalPointWithImageCoordinate(ijk); switch (this->GetSliceOrientation()) { case ImageViewer::SLICE_ORIENTATION_YZ: QInteractorStylePolygonDrawSeries::LoadContoursFromContourMap(ijk[0], m_contourSeries, m_normalYZ); m_contourSeries->Render(); break; case ImageViewer::SLICE_ORIENTATION_XZ: QInteractorStylePolygonDrawSeries::LoadContoursFromContourMap(ijk[1], m_contourSeries, m_normalXZ); m_contourSeries->Render(); break; case ImageViewer::SLICE_ORIENTATION_XY: QInteractorStylePolygonDrawSeries::LoadContoursFromContourMap(ijk[2], m_contourSeries, m_normalXY); m_contourSeries->Render(); if (m_currentMode != NORMAL) { QInteractorStylePolygonDrawSeries::LoadContoursFromContourMap(ijk[2], m_lumenContours, m_lumen); m_lumenContours->Render(); QInteractorStylePolygonDrawSeries::LoadContoursFromContourMap(ijk[2], m_vesselWallContours, m_vesselWall); m_vesselWallContours->Render(); } default: break; } } } void QInteractorStyleVesselSegmentation2::CleanAll() { m_normalXY.clear(); m_normalXZ.clear(); m_normalYZ.clear(); m_vesselWall.clear(); m_lumen.clear(); m_contourSeries->ResetContours(); m_lumenContours->ResetContours(); m_vesselWallContours->ResetContours(); m_contourSeries->Render(); m_lumenContours->Render(); m_vesselWallContours->Render(); } void QInteractorStyleVesselSegmentation2::FillContours() { if (m_contourSeries->GetEnabled()) { InteractorStylePolygonDrawSeries::FillContours(m_contourSeriesRep); if (m_currentMode != NORMAL && GetSliceOrientation() == ImageViewer::SLICE_ORIENTATION_XY) { InteractorStylePolygonDrawSeries::FillContours(m_vesselWallContoursRep); InteractorStylePolygonDrawSeries::FillContours(m_lumenContoursRep); } } GetImageViewer()->GetOverlay()->Modified(); GetImageViewer()->GetOverlay()->InvokeEvent(vtkCommand::UpdateDataEvent); SAFE_DOWN_CAST_IMAGE_CONSTITERATOR(InteractorStylePolygonDrawSeries, GetImageViewer()->Render()); } //void QInteractorStyleVesselSegmentation2::FillSlices() //{ //} void QInteractorStyleVesselSegmentation2::AutoVesselWallSegmentation() { if (!m_lumenContours->GetEnabled() || GetSliceOrientation() != ImageViewer::SLICE_ORIENTATION_XY) { return; } int extent[6]; std::copy_n(GetImageViewer()->GetDisplayExtent(), 6, extent); vtkSmartPointer<vtkImageThreshold> imageThreshold = vtkSmartPointer<vtkImageThreshold>::New(); imageThreshold->ThresholdBetween(m_lumenWallLabel, m_lumenWallLabel); imageThreshold->SetInputData(GetImageViewer()->GetOverlay()); imageThreshold->ReplaceOutOn(); imageThreshold->SetOutValue(0); imageThreshold->Update(); for (int i = extent[4]; i <= extent[5]; ++i) { int _extent[6] = { extent[0], extent[1], extent[2], extent[3], i, i }; ContourMapElementPtr elementLumen = ContourMapElementPtr(new PolyDataList); vtkSmartPointer<vtkMarchingSquares> marchingSquares = vtkSmartPointer<vtkMarchingSquares>::New(); marchingSquares->SetInputConnection(imageThreshold->GetOutputPort()); marchingSquares->CreateDefaultLocator(); marchingSquares->SetImageRange(_extent); marchingSquares->SetValue(1, m_lumenWallLabel); marchingSquares->Update(); vtkSmartPointer<vtkPolyDataConnectivityFilter> connectivityFilter = vtkSmartPointer<vtkPolyDataConnectivityFilter>::New(); connectivityFilter->SetInputConnection(marchingSquares->GetOutputPort()); connectivityFilter->SetExtractionModeToAllRegions(); connectivityFilter->Update(); for (int j = 0; j < connectivityFilter->GetNumberOfExtractedRegions(); ++j) { // extract lumen contour polydata vtkSmartPointer<vtkPolyData> nodePolyData = vtkSmartPointer<vtkPolyData>::New(); vtkSmartPointer<vtkPolyDataConnectivityFilter> _connectivityFilter = vtkSmartPointer<vtkPolyDataConnectivityFilter>::New(); _connectivityFilter->SetInputConnection(marchingSquares->GetOutputPort()); _connectivityFilter->AddSpecifiedRegion(j); _connectivityFilter->SetExtractionModeToSpecifiedRegions(); _connectivityFilter->Update(); vtkSmartPointer<vtkCleanPolyData> clean1 = vtkSmartPointer<vtkCleanPolyData>::New(); clean1->SetInputConnection(_connectivityFilter->GetOutputPort()); clean1->PointMergingOn(); clean1->Update(); // vtkError handling vtkSmartPointer<vtkCallbackCommand> errorCatch = vtkSmartPointer<vtkCallbackCommand>::New(); // lambda function for handling error errorCatch->SetCallback([](vtkObject *caller, unsigned long eid, void *clientdata, void *calldata)->void { // error catch and error display char* ErrorMessage = static_cast<char *>(calldata); vtkOutputWindowDisplayErrorText(ErrorMessage); ReorderPointIdOfContourFilter* reorder = ReorderPointIdOfContourFilter::SafeDownCast(caller); // if error happened, skip this filer reorder->SetOutput(reorder->GetInput()); }); vtkSmartPointer<ReorderPointIdOfContourFilter> reorder = vtkSmartPointer<ReorderPointIdOfContourFilter>::New(); reorder->SetInputConnection(clean1->GetOutputPort()); reorder->SetOutputCellType(VTK_POLY_LINE); reorder->AddObserver(vtkCommand::ErrorEvent, errorCatch); reorder->Update(); if (reorder->GetInput() == reorder->GetOutput()) { std::string ErrorMessage = "Error in slice " + std::to_string(i); vtkErrorMacro(<< ErrorMessage); } double toleranceInitial = 1; int loopBreaker = 0; vtkSmartPointer<vtkCleanPolyData> clean2 = vtkSmartPointer<vtkCleanPolyData>::New(); clean2->SetInputConnection(reorder->GetOutputPort()); clean2->ToleranceIsAbsoluteOn(); clean2->SetAbsoluteTolerance(toleranceInitial); clean2->PointMergingOn(); clean2->Update(); while (clean2->GetOutput()->GetNumberOfPoints() < 3 && loopBreaker < 10) { toleranceInitial *= 0.75; clean2->SetAbsoluteTolerance(toleranceInitial); clean2->Update(); loopBreaker += 1; } nodePolyData->ShallowCopy(clean2->GetOutput()); (*elementLumen) << nodePolyData; } m_lumen[i] = elementLumen; // extract vessel wall contour polydata ContourMapElementPtr elementVesselWall = ContourMapElementPtr(new PolyDataList); vtkSmartPointer<VesselWallHoughTransformCircles> hough = vtkSmartPointer<VesselWallHoughTransformCircles>::New(); hough->SetOuterRadius(m_vesselWallSegmentationRadius); hough->SetInputData(0, GetImageViewer()->GetInput()); hough->SetInputData(1, imageThreshold->GetOutput()); hough->SetImageRange(_extent); hough->Update(); for (VesselWallHoughTransformCircles::CircleVector::const_iterator cit = hough->GetCircles()->cbegin(); cit != hough->GetCircles()->cend(); ++cit) { vtkSmartPointer<vtkPolyData> nodePolyData = vtkSmartPointer<vtkPolyData>::New(); nodePolyData->ShallowCopy(*cit); (*elementVesselWall) << nodePolyData; } m_vesselWall[i] = elementVesselWall; } } void QInteractorStyleVesselSegmentation2::AutoLumenSegmentation() { if (!m_lumenContours->GetEnabled() || GetSliceOrientation() != ImageViewer::SLICE_ORIENTATION_XY) { return; } int ijk[3]; GetImageViewer()->GetFocalPointWithImageCoordinate(ijk); ContourMapElementPtr element = ContourMapElementPtr(new PolyDataList); vtkLookupTable* lookupTable = GetImageViewer()->GetLookupTable(); double vesselWallColour[3]; lookupTable->GetColor(m_vesselWallLabel, vesselWallColour); for (int i = 0; i < m_contourSeriesRep->GetNumberOfContours(); ++i) { vtkOrientedGlyphContourRepresentation* _rep = vtkOrientedGlyphContourRepresentation::SafeDownCast(m_contourSeriesRep->GetContourRepresentation(i)); double* colour = _rep->GetLinesProperty()->GetColor(); if (std::equal(vesselWallColour, vesselWallColour + 3, colour)) { vtkSmartPointer<vtkPolyData> nodePolyData = vtkSmartPointer<vtkPolyData>::New(); vtkSmartPointer<LumenSegmentationFilter2> lsFilter = vtkSmartPointer<LumenSegmentationFilter2>::New(); lsFilter->SetInputData(GetImageViewer()->GetInput()); lsFilter->SetGenerateValues(1, m_lumenSegmentationValue, m_lumenSegmentationValue); lsFilter->SetVesselWallContourRepresentation(_rep); lsFilter->SetSlice(ijk[2]); lsFilter->Update(); nodePolyData->ShallowCopy(lsFilter->GetOutput()); (*element) << nodePolyData; } } for (int i = 0; i < m_vesselWallContoursRep->GetNumberOfContours(); ++i) { vtkOrientedGlyphContourRepresentation* _rep = vtkOrientedGlyphContourRepresentation::SafeDownCast(m_vesselWallContoursRep->GetContourRepresentation(i)); double* colour = _rep->GetLinesProperty()->GetColor(); if (std::equal(vesselWallColour, vesselWallColour + 3, colour)) { vtkSmartPointer<vtkPolyData> nodePolyData = vtkSmartPointer<vtkPolyData>::New(); vtkSmartPointer<LumenSegmentationFilter2> lsFilter = vtkSmartPointer<LumenSegmentationFilter2>::New(); lsFilter->SetInputData(GetImageViewer()->GetInput()); lsFilter->SetGenerateValues(1, m_lumenSegmentationValue, m_lumenSegmentationValue); lsFilter->SetVesselWallContourRepresentation(_rep); lsFilter->SetSlice(ijk[2]); lsFilter->Update(); nodePolyData->ShallowCopy(lsFilter->GetOutput()); (*element) << nodePolyData; } } m_lumen[ijk[2]] = element; m_lumenContours->ResetContours(); QInteractorStylePolygonDrawSeries::LoadContoursFromContourMap(ijk[2], m_lumenContours, m_lumen); m_lumenContours->Render(); } void QInteractorStyleVesselSegmentation2::SetLumenSegmentationValue(int value) { this->m_lumenSegmentationValue = value; AutoLumenSegmentation(); } void QInteractorStyleVesselSegmentation2::setVesselWallSegmentationRadius(int value) { this->m_vesselWallSegmentationRadius = value; }
cd51179cb31eab8755faf0d8a085d54c129417b3
5984c5eba66073756d778b121eb0fb7984c5f1cc
/Sources/main.cpp
63e52d8fac4c89d792470624baa623cf33950a27
[]
no_license
Afshinzkh/DifferentialEvolutionGPU
1958117d3022b2cc010e4d6cbf7ca8a087fa3bc2
53f54b93e16882eb7cc5b58fab795441c8d89a92
refs/heads/master
2021-01-12T08:22:46.396652
2017-04-04T09:37:53
2017-04-04T09:37:53
76,558,373
1
1
null
null
null
null
UTF-8
C++
false
false
3,058
cpp
main.cpp
#include "../Headers/DE.cuh" #include "../Headers/Helper.h" int main(int argc, char* argv[]) { // Cheking the Arguments if( argc != 3){ std::cout << "Error: Wrong number of Arguments" << std::endl; return -1; } std::string method = argv[2]; std::cout << "Method to use: "<< method << std::endl; const int maturityCount = 9; // Jan 2015 bis Dec. 2015 const int seriesCount = 12; double tau[] = {0.25, 1, 3, 5, 7, 10, 15, 20, 30}; std::array<std::array<double,9>, seriesCount> myData; readData(argv[1], myData); std::array<double,9> crrntMonthMrktDataArray; std::vector<double> crrntMonthMrktData; std::cout << "Data is Read." << '\n'; std::array<double , seriesCount> alphaArray; std::array<double , seriesCount> betaArray; std::array<double , seriesCount> sigmaArray; std::array<double , seriesCount> errorArray; std::array<double , seriesCount> iterArray; std::array<double , seriesCount> timeArray; std::array< std::array< double, maturityCount>, seriesCount> mdlData; double deltaTTerm = std::sqrt(1.0/seriesCount); DE d(method, deltaTTerm); auto start = std::chrono::steady_clock::now(); for(int i = 0; i<seriesCount; i++){ crrntMonthMrktDataArray = myData[seriesCount-1-i]; crrntMonthMrktData.insert(crrntMonthMrktData.begin(), &crrntMonthMrktDataArray[0], &crrntMonthMrktDataArray[9]); d.setMrktArray(crrntMonthMrktData); d.runDE(); alphaArray[i] = d.getAlpha(); betaArray[i] = d.getBeta(); sigmaArray[i] = d.getSigma(); errorArray[i] = d.getError(); mdlData[i] = d.getMdlArray(); iterArray[i] = d.getIter(); timeArray[i] = d.getTime(); } auto end = std::chrono::steady_clock::now(); std::chrono::duration<double> durationCount = end - start; double totalTime = durationCount.count(); /****************************************************************************/ /*************************** STEP 4 : Print Out *****************************/ /****************************************************************************/ for(int i = 0; i < seriesCount; i++) { std::cout << "\nfinal alpha:" << alphaArray[i] <<std::endl; std::cout << "final beta:" << betaArray[i] <<std::endl; std::cout << "final sigma:" << sigmaArray[i] <<std::endl; std::cout << "Average Error for month : " << i; std::cout << "\t is : " << errorArray[i] << std::endl; std::cout << "Elapsed Time: " << timeArray[i] << std::endl; std::cout << "Number of Iterations: " << iterArray[i] << std::endl; for (size_t j = 0; j < 9; j++) { std::cout << "y for maturity: " << tau[j] << "\t is: \t" << mdlData[i][j] << std::endl; } } method = method + "GPU" ; writeData(mdlData, myData, alphaArray, betaArray, sigmaArray, errorArray, iterArray, timeArray,method); std::cout << "Data has been written to file" << std::endl; std::cout << "Total Calculation Time is: " << totalTime << std::endl; return 0; }
1fd72f6601d93c3e49512bc6187055a0a0558aa6
927eff7f52e98ec4f5f00c16751981bbdf33489c
/DEU3D_PlatformCore/ParameterSys/DynPointCloudDetail.cpp
f29713fedc2d2eb53cc4d49326ee2ff7c69e0913
[]
no_license
Armida220/MyEarth
cafa24cfb6f0eda6b3e68948e60af54a2242eaad
6e8826fbcedff45e119009e49d11179df7c0ec3f
refs/heads/master
2020-03-18T08:52:49.390253
2018-05-22T14:11:27
2018-05-22T14:11:27
null
0
0
null
null
null
null
UTF-8
C++
false
false
5,037
cpp
DynPointCloudDetail.cpp
#include "DynPointCloudDetail.h" #include <IDProvider/Definer.h> #include <osgUtil/CommonModelCreater.h> #include <osg/MatrixTransform> #include <osg/CoordinateSystemNode> #include <osg/Geode> #include <osg/Geometry> #include <osg/SharedStateAttributes> #include <osg/PointSprite> namespace param { DynPointCloudDetail::DynPointCloudDetail(void) { m_dblPointSize = 1.0; m_PointClr.m_fltR = 1.0; m_PointClr.m_fltG = 1.0; m_PointClr.m_fltB = 1.0; m_PointClr.m_fltA = 1.0; } DynPointCloudDetail::DynPointCloudDetail(unsigned int nDataSetCode) : Detail(ID(nDataSetCode, DETAIL_DYN_POINT_CLOUD_ID)) { m_dblPointSize = 1.0; m_PointClr.m_fltR = 1.0; m_PointClr.m_fltG = 1.0; m_PointClr.m_fltB = 1.0; m_PointClr.m_fltA = 1.0; } DynPointCloudDetail::~DynPointCloudDetail(void) { } bool DynPointCloudDetail::fromBson(bson::bsonDocument &bsonDoc) { if(!Detail::fromBson(bsonDoc)) { return false; } bson::bsonDoubleEle *pDoubleEle = NULL; pDoubleEle = dynamic_cast<bson::bsonDoubleEle *>(bsonDoc.GetElement("Size")); if(pDoubleEle == NULL) { return false; } setPointSize(pDoubleEle->DblValue()); bson::bsonArrayEle *pArrayEle = dynamic_cast<bson::bsonArrayEle *>(bsonDoc.GetElement("Color")); if(pArrayEle == NULL || pArrayEle->ChildCount() != 4) { return false; } pDoubleEle = dynamic_cast<bson::bsonDoubleEle *>(pArrayEle->GetElement(0u)); if(pDoubleEle == NULL) { return false; } m_PointClr.m_fltR = pDoubleEle->DblValue(); pDoubleEle = dynamic_cast<bson::bsonDoubleEle *>(pArrayEle->GetElement(1u)); if(pDoubleEle == NULL) { return false; } m_PointClr.m_fltG = pDoubleEle->DblValue(); pDoubleEle = dynamic_cast<bson::bsonDoubleEle *>(pArrayEle->GetElement(2u)); if(pDoubleEle == NULL) { return false; } m_PointClr.m_fltB = pDoubleEle->DblValue(); pDoubleEle = dynamic_cast<bson::bsonDoubleEle *>(pArrayEle->GetElement(3u)); if(pDoubleEle == NULL) { return false; } m_PointClr.m_fltA = pDoubleEle->DblValue(); return true; } bool DynPointCloudDetail::toBson(bson::bsonDocument &bsonDoc) const { if(!Detail::toBson(bsonDoc)) { return false; } if(!bsonDoc.AddDblElement("Size", m_dblPointSize)) { return false; } bson::bsonArrayEle *pArrayEle = dynamic_cast<bson::bsonArrayEle *>(bsonDoc.AddArrayElement("Color")); if(pArrayEle == NULL) { return false; } if(!pArrayEle->AddDblElement(m_PointClr.m_fltR) || !pArrayEle->AddDblElement(m_PointClr.m_fltG) || !pArrayEle->AddDblElement(m_PointClr.m_fltB) || !pArrayEle->AddDblElement(m_PointClr.m_fltA)) { return false; } return true; } double DynPointCloudDetail::getBoundingSphereRadius(void) const { return m_dblPointSize; } osg::Node *DynPointCloudDetail::createDetailNode(const CreationInfo *pInfo) const { const PointCloudCreationInfo *pPointCloudInfo = dynamic_cast<const PointCloudCreationInfo*>(pInfo); if(pPointCloudInfo == NULL) { return NULL; } osg::ref_ptr<osg::Node> pPointCloudNode = createPointCloudNode(pPointCloudInfo); return pPointCloudNode.release(); } osg::Geode* DynPointCloudDetail::createPointCloudNode(const PointCloudCreationInfo* pPointCloudInfo) const { osg::ref_ptr<osg::Geode> geode = new osg::Geode; osg::ref_ptr<osg::Geometry> galaxy = new osg::Geometry; osg::ref_ptr<osg::Vec3Array> vertices = new osg::Vec3Array; osg::ref_ptr<osg::Vec4Array> colors = new osg::Vec4Array; osg::EllipsoidModel *pEllipsoidModel = osg::EllipsoidModel::instance(); for(unsigned int i = 0; i < pPointCloudInfo->m_pPoints->size(); i++) { osg::Vec3d point; const osg::Vec3d &coord = pPointCloudInfo->m_pPoints->at(i); pEllipsoidModel->convertLatLongHeightToXYZ(coord.y(), coord.x(), coord.z(), point.x(), point.y(), point.z()); vertices->push_back(point); if (i < pPointCloudInfo->m_pColors->size()) { const osg::Vec3d &color = pPointCloudInfo->m_pColors->at(i); colors->push_back(osg::Vec4(color.x(), color.y(), color.z(), 1.0)); } } galaxy->setVertexArray(vertices); galaxy->setColorArray(colors); if (colors->size() == 0) { colors->push_back(osg::Vec4(m_PointClr.m_fltR, m_PointClr.m_fltG, m_PointClr.m_fltB, m_PointClr.m_fltA)); galaxy->setColorBinding(osg::Geometry::BIND_OVERALL); } else { galaxy->setColorBinding(osg::Geometry::BIND_PER_VERTEX); } galaxy->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::POINTS, 0, pPointCloudInfo->m_pPoints->size())); osg::StateSet* pStateSet = galaxy->getOrCreateStateSet(); pStateSet->setMode(GL_LIGHTING, osg::StateAttribute::OFF | osg::StateAttribute::PROTECTED); if(m_dblPointSize > 1.0) { osg::Point *pPoint = osg::SharedStateAttributes::instance()->getPoint(m_dblPointSize); pStateSet->setAttribute(pPoint); } geode->addDrawable(galaxy); return geode.release(); } }
308ed5291e099cf285312444fd7bd537fb9489d7
251a32ef195f68514724c19ff254a98dc6557ee3
/DelphiIntegration/CLIWrapper/FooBar.h
25f053fc8f2bdd99b30881854263d90f9bdc27ee
[]
no_license
colin-mullikin/CLIExperiments
08390a81c9c0614a3d4154feda1ea6e34edde8b2
2addf2450f507d58ccca345ea56ca9ed7efee73a
refs/heads/master
2021-01-19T11:57:20.111934
2016-09-26T15:58:43
2016-09-26T15:58:43
68,952,983
0
0
null
null
null
null
UTF-8
C++
false
false
623
h
FooBar.h
#pragma once #include <Windows.h> typedef void* (__stdcall *CreateFooBar)(); typedef void(__stdcall *DestroyFooBar)(void*); typedef int(__stdcall *GetFoo)(void*); namespace CLIWrapper { public ref class FooBar { public: FooBar(); ~FooBar(); !FooBar(); int GetFooValue(); static void Initialize(); //Must call this before FooBar class can be used! static void TearDown(); //Must call this after FooBar class is done being used! private: void* fInternalFooBar; static HINSTANCE libHandle; static CreateFooBar proc_Create; static DestroyFooBar proc_Destroy; static GetFoo proc_GetFoo; }; }
a328d32f5ed7e5d5ce2948288476248158969957
e89f4889c63b21f580840695e6600810a1c3fcd5
/2A_Winner.cpp
aab5ab5d7bed8455094f43c59fdafdf497be3ded
[]
no_license
Thisayang/C-
b60a5074485797cf57c8ecfd67d04ae91ec398dc
b1ca13fa9e16f267130d3f3ef7b9ff06c69c1fd1
refs/heads/main
2023-02-12T09:53:25.517632
2021-01-03T11:54:03
2021-01-03T11:54:03
324,344,527
0
0
null
null
null
null
UTF-8
C++
false
false
586
cpp
2A_Winner.cpp
#include <stdio.h> #include <iostream> #include <string> #include <map> #include <cstring> using namespace std; int main() { int n; while(cin>>n) { map<string,int> a,b; string name[1000]; int x[1000]; for(int i=0;i<n;i++) { cin>>name[i]>>x[i]; a[name[i]]+=x[i]; } int max; for(int i=0;i<n;i++) { if(i==0) max=a[name[i]]; if(a[name[i]]>max) max=a[name[i]]; } for(int i=0;i<n;i++) { b[name[i]]+=x[i]; if((a[name[i]]>=max)&&(b[name[i]]>=max)) { cout<<name[i]<<endl; break; } } } return 0; }
69f7953507a62a28db848498b599e0371ca1ee08
7e4999d12b8668c3f54697afb0df34f5b7030673
/project/algorithm/leetcode/src/1340.maxJumps.cpp
66992c9db5bf7f3e3786a31b58cade5cd11f46ed
[]
no_license
leeeyupeng/leeeyupeng.github.io
b34e29696190bcc1e05ec0d43385118acddd743c
63f7d3d8c0c56e70b087ca71cc22f57f4367aa1f
refs/heads/master
2023-08-21T01:55:17.190264
2021-10-28T10:12:38
2021-10-28T10:12:38
239,906,740
1
0
null
null
null
null
UTF-8
C++
false
false
1,154
cpp
1340.maxJumps.cpp
#include"leetcode.h" class Solution { public: int maxJumps(vector<int>& arr, int d) { int n = arr.size(); vector<int> dp(n,1); for(int i = 0; i < n; i ++){ for(int i = 0; i < n; i ++){ for(int j = i-1;j >= max(0,i-d); j --){ if(arr[j] < arr[i]){ dp[i] = max(dp[i],dp[j] + 1); } else{ break; } } } for(int i = n-1;i >=0;i --){ for(int j = i + 1;j <= min(n-1,i+d); j ++){ if(arr[j] < arr[i]){ dp[i] = max(dp[i],dp[j] + 1); } else{ break; } } } } int ret = 0; for(int i = 0; i < n; i ++){ ret = max(ret,dp[i]); } return ret; } }; // int main() // { // vector<int> arr={ // 6,4,14,6,8,13,9,7,10,6,12 // }; // Solution solution; // int ret = solution.maxJumps(arr,25); // return 0; // }
4b38d7088132a30c856240dfa7367e78ac39c7da
08f7bb3d26daa5a62b6f994138601182de953550
/ancient-slave-ship/FileBuffer.cpp
a450c0433d3d36fc81e1ff25044a230896eed840
[]
no_license
geordieboy83/ancient-slave-ship
da8d7a6cf3b8650d7cb89de296c119c5be7eee98
1eb684e40fdeb4f1295b55572b7d17ebb98ca7f1
refs/heads/master
2020-05-04T04:23:15.386391
2011-05-23T16:19:53
2011-05-23T16:19:53
39,701,081
0
0
null
null
null
null
UTF-8
C++
false
false
631
cpp
FileBuffer.cpp
#include "FileBuffer.h" FileBuffer::FileBuffer(string filename):data(NULL) { Load(filename); } bool FileBuffer::Load(string filename) { ifstream in(filename); if(!in) return false; Clear(); int length; // get length of file: in.seekg (0, ios::end); length = in.tellg(); in.seekg (0, ios::beg); // allocate memory: data = new char[length]; // read data as a block: in.read (data,length); in.close(); return true; } stringstream FileToStream(string filename) { FileBuffer fb(filename); if(fb.GetData()) return stringstream(fb.GetData()); else return stringstream(""); }
8c620e7ec32ac088594dff4774f1f8846175ef88
c743807ad2fd31ecde0ef624f3bbdfe9ec91ed9a
/Problema/Torre.h
955616742238ad7e3100af32922d6b82e6ce2689
[]
no_license
NQYQL/Dia2-2020-Chaturanga
02805b659ebeafc9a068845b7291703f8aafec29
479e0de4bf37d571f1b7a362b2e101e996c31456
refs/heads/master
2022-10-17T10:57:40.719175
2020-06-14T22:07:12
2020-06-14T22:07:12
272,290,000
0
0
null
null
null
null
UTF-8
C++
false
false
175
h
Torre.h
#ifndef TORRE #define TORRE #include "Pieza.h" class Torre : public Pieza{ private: bool valid(int fil, int col); public: Torre(int, int, Pieza**, bool); }; #endif
5cdd8d69226e61410222456cdbe179175a6d91d0
433918960a7a3c6b09d9b29a63ed1e8fb5de1050
/src/fuml/src_gen/fUML/Semantics/Actions/impl/ActionsPackageImpl_Initialization.cpp
fcadd5046f708b4d1466a95ca409b1d6778081c4
[ "EPL-1.0", "MIT" ]
permissive
MDE4CPP/MDE4CPP
476709da6c9f0d92504c1539ee4b1012786e3254
24e8ef69956d2a3c6b04dca3a61a97223f6aa959
refs/heads/master
2023-08-31T03:15:56.104582
2023-01-05T14:45:37
2023-01-05T14:45:37
82,116,322
14
27
MIT
2023-06-23T09:23:01
2017-02-15T23:11:29
C++
UTF-8
C++
false
false
143,589
cpp
ActionsPackageImpl_Initialization.cpp
#include "fUML/Semantics/Actions/impl/ActionsPackageImpl.hpp" #include <cassert> #include "abstractDataTypes/SubsetUnion.hpp" //metametamodel classes #include "ecore/EParameter.hpp" #include "ecore/EOperation.hpp" #include "ecore/EDataType.hpp" #include "ecore/EAnnotation.hpp" #include "ecore/EClass.hpp" #include "ecore/EReference.hpp" #include "ecore/EStringToStringMapEntry.hpp" #include "ecore/EAttribute.hpp" #include "ecore/EGenericType.hpp" // metametamodel factory #include "ecore/ecoreFactory.hpp" //depending model packages #include "fUML/Semantics/Activities/ActivitiesPackage.hpp" #include "fUML/Semantics/CommonBehavior/CommonBehaviorPackage.hpp" #include "fUML/Semantics/SimpleClassifiers/SimpleClassifiersPackage.hpp" #include "fUML/Semantics/StructuredClassifiers/StructuredClassifiersPackage.hpp" #include "fUML/Semantics/Values/ValuesPackage.hpp" #include "ecore/ecorePackage.hpp" #include "fUML/fUMLPackage.hpp" #include "uml/umlPackage.hpp" using namespace fUML::Semantics::Actions; void ActionsPackageImpl::initializePackageContents() { if (isInitialized) { return; } isInitialized = true; // Initialize package setName(eNAME); setNsPrefix(eNS_PREFIX); setNsURI(eNS_URI); // Add supertypes to classes m_acceptCallActionActivation_Class->getESuperTypes()->push_back(getAcceptEventActionActivation_Class()); m_acceptEventActionActivation_Class->getESuperTypes()->push_back(getActionActivation_Class()); m_acceptEventActionEventAccepter_Class->getESuperTypes()->push_back(fUML::Semantics::CommonBehavior::CommonBehaviorPackage::eInstance()->getEventAccepter_Class()); m_actionActivation_Class->getESuperTypes()->push_back(fUML::Semantics::Activities::ActivitiesPackage::eInstance()->getActivityNodeActivation_Class()); m_addStructuralFeatureValueActionActivation_Class->getESuperTypes()->push_back(getWriteStructuralFeatureActionActivation_Class()); m_callActionActivation_Class->getESuperTypes()->push_back(getInvocationActionActivation_Class()); m_callBehaviorActionActivation_Class->getESuperTypes()->push_back(getCallActionActivation_Class()); m_callOperationActionActivation_Class->getESuperTypes()->push_back(getCallActionActivation_Class()); m_clearAssociationActionActivation_Class->getESuperTypes()->push_back(getActionActivation_Class()); m_clearStructuralFeatureActionActivation_Class->getESuperTypes()->push_back(getStructuralFeatureActionActivation_Class()); m_conditionalNodeActivation_Class->getESuperTypes()->push_back(getStructuredActivityNodeActivation_Class()); m_createLinkActionActivation_Class->getESuperTypes()->push_back(getWriteLinkActionActivation_Class()); m_createObjectActionActivation_Class->getESuperTypes()->push_back(getActionActivation_Class()); m_destroyLinkActionActivation_Class->getESuperTypes()->push_back(getWriteLinkActionActivation_Class()); m_destroyObjectActionActivation_Class->getESuperTypes()->push_back(getActionActivation_Class()); m_inputPinActivation_Class->getESuperTypes()->push_back(getPinActivation_Class()); m_invocationActionActivation_Class->getESuperTypes()->push_back(getActionActivation_Class()); m_linkActionActivation_Class->getESuperTypes()->push_back(getActionActivation_Class()); m_loopNodeActivation_Class->getESuperTypes()->push_back(getStructuredActivityNodeActivation_Class()); m_outputPinActivation_Class->getESuperTypes()->push_back(getPinActivation_Class()); m_pinActivation_Class->getESuperTypes()->push_back(fUML::Semantics::Activities::ActivitiesPackage::eInstance()->getObjectNodeActivation_Class()); m_readExtentActionActivation_Class->getESuperTypes()->push_back(getActionActivation_Class()); m_readIsClassifiedObjectActionActivation_Class->getESuperTypes()->push_back(getActionActivation_Class()); m_readLinkActionActivation_Class->getESuperTypes()->push_back(getLinkActionActivation_Class()); m_readSelfActionActivation_Class->getESuperTypes()->push_back(getActionActivation_Class()); m_readStructuralFeatureActionActivation_Class->getESuperTypes()->push_back(getStructuralFeatureActionActivation_Class()); m_reclassifyObjectActionActivation_Class->getESuperTypes()->push_back(getActionActivation_Class()); m_reduceActionActivation_Class->getESuperTypes()->push_back(getActionActivation_Class()); m_removeStructuralFeatureValueActivation_Class->getESuperTypes()->push_back(getWriteStructuralFeatureActionActivation_Class()); m_replyActionActivation_Class->getESuperTypes()->push_back(getActionActivation_Class()); m_returnInformation_Class->getESuperTypes()->push_back(fUML::Semantics::Values::ValuesPackage::eInstance()->getValue_Class()); m_sendSignalActionActivation_Class->getESuperTypes()->push_back(getInvocationActionActivation_Class()); m_startClassifierBehaviorActionActivation_Class->getESuperTypes()->push_back(getActionActivation_Class()); m_startObjectBehaviorActionActivation_Class->getESuperTypes()->push_back(getInvocationActionActivation_Class()); m_structuralFeatureActionActivation_Class->getESuperTypes()->push_back(getActionActivation_Class()); m_structuredActivityNodeActivation_Class->getESuperTypes()->push_back(getActionActivation_Class()); m_testIdentityActionActivation_Class->getESuperTypes()->push_back(getActionActivation_Class()); m_valueSpecificationActionActivation_Class->getESuperTypes()->push_back(getActionActivation_Class()); m_writeLinkActionActivation_Class->getESuperTypes()->push_back(getLinkActionActivation_Class()); m_writeStructuralFeatureActionActivation_Class->getESuperTypes()->push_back(getStructuralFeatureActionActivation_Class()); // Initialize classes and features; add operations and parameters initializeAcceptCallActionActivationContent(); initializeAcceptCallActionActivationsContent(); initializeAcceptEventActionActivationContent(); initializeAcceptEventActionEventAccepterContent(); initializeActionActivationContent(); initializeAddStructuralFeatureValueActionActivationContent(); initializeCallActionActivationContent(); initializeCallBehaviorActionActivationContent(); initializeCallOperationActionActivationContent(); initializeClauseActivationContent(); initializeClearAssociationActionActivationContent(); initializeClearStructuralFeatureActionActivationContent(); initializeConditionalNodeActivationContent(); initializeCreateLinkActionActivationContent(); initializeCreateObjectActionActivationContent(); initializeDestroyLinkActionActivationContent(); initializeDestroyObjectActionActivationContent(); initializeInputPinActivationContent(); initializeInvocationActionActivationContent(); initializeLinkActionActivationContent(); initializeLoopNodeActivationContent(); initializeOutputPinActivationContent(); initializePinActivationContent(); initializeReadExtentActionActivationContent(); initializeReadIsClassifiedObjectActionActivationContent(); initializeReadLinkActionActivationContent(); initializeReadSelfActionActivationContent(); initializeReadStructuralFeatureActionActivationContent(); initializeReclassifyObjectActionActivationContent(); initializeReduceActionActivationContent(); initializeRemoveStructuralFeatureValueActivationContent(); initializeReplyActionActivationContent(); initializeReturnInformationContent(); initializeSendSignalActionActivationContent(); initializeStartClassifierBehaviorActionActivationContent(); initializeStartObjectBehaviorActionActivationContent(); initializeStructuralFeatureActionActivationContent(); initializeStructuredActivityNodeActivationContent(); initializeTestIdentityActionActivationContent(); initializeValueSpecificationActionActivationContent(); initializeValuesContent(); initializeWriteLinkActionActivationContent(); initializeWriteStructuralFeatureActionActivationContent(); initializePackageEDataTypes(); } void ActionsPackageImpl::initializeAcceptCallActionActivationContent() { m_acceptCallActionActivation_Class->setName("AcceptCallActionActivation"); m_acceptCallActionActivation_Class->setAbstract(false); m_acceptCallActionActivation_Class->setInterface(false); m_acceptCallActionActivation_Operation_accept_EventOccurrence->setName("accept"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_acceptCallActionActivation_Operation_accept_EventOccurrence->setEType(unknownClass); } m_acceptCallActionActivation_Operation_accept_EventOccurrence->setLowerBound(1); m_acceptCallActionActivation_Operation_accept_EventOccurrence->setUpperBound(1); m_acceptCallActionActivation_Operation_accept_EventOccurrence->setUnique(true); m_acceptCallActionActivation_Operation_accept_EventOccurrence->setOrdered(true); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_acceptCallActionActivation_Operation_accept_EventOccurrence); parameter->setName("eventOccurrence"); parameter->setEType(nullptr); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } } void ActionsPackageImpl::initializeAcceptCallActionActivationsContent() { m_acceptCallActionActivations_Class->setName("AcceptCallActionActivations"); m_acceptCallActionActivations_Class->setAbstract(false); m_acceptCallActionActivations_Class->setInterface(false); } void ActionsPackageImpl::initializeAcceptEventActionActivationContent() { m_acceptEventActionActivation_Class->setName("AcceptEventActionActivation"); m_acceptEventActionActivation_Class->setAbstract(false); m_acceptEventActionActivation_Class->setInterface(false); m_acceptEventActionActivation_Attribute_waiting = getAcceptEventActionActivation_Attribute_waiting(); m_acceptEventActionActivation_Attribute_waiting->setName("waiting"); m_acceptEventActionActivation_Attribute_waiting->setEType(ecore::ecorePackage::eInstance()->getEBoolean_Class()); m_acceptEventActionActivation_Attribute_waiting->setLowerBound(1); m_acceptEventActionActivation_Attribute_waiting->setUpperBound(1); m_acceptEventActionActivation_Attribute_waiting->setTransient(false); m_acceptEventActionActivation_Attribute_waiting->setVolatile(false); m_acceptEventActionActivation_Attribute_waiting->setChangeable(true); m_acceptEventActionActivation_Attribute_waiting->setUnsettable(false); m_acceptEventActionActivation_Attribute_waiting->setUnique(true); m_acceptEventActionActivation_Attribute_waiting->setDerived(false); m_acceptEventActionActivation_Attribute_waiting->setOrdered(false); m_acceptEventActionActivation_Attribute_waiting->setID(false); { std::string defaultValue = ""; if (!defaultValue.empty()) { m_acceptEventActionActivation_Attribute_waiting->setDefaultValueLiteral(defaultValue); } } m_acceptEventActionActivation_Attribute_eventAccepter->setName("eventAccepter"); m_acceptEventActionActivation_Attribute_eventAccepter->setEType(getAcceptEventActionEventAccepter_Class()); m_acceptEventActionActivation_Attribute_eventAccepter->setLowerBound(0); m_acceptEventActionActivation_Attribute_eventAccepter->setUpperBound(1); m_acceptEventActionActivation_Attribute_eventAccepter->setTransient(false); m_acceptEventActionActivation_Attribute_eventAccepter->setVolatile(false); m_acceptEventActionActivation_Attribute_eventAccepter->setChangeable(true); m_acceptEventActionActivation_Attribute_eventAccepter->setUnsettable(false); m_acceptEventActionActivation_Attribute_eventAccepter->setUnique(true); m_acceptEventActionActivation_Attribute_eventAccepter->setDerived(false); m_acceptEventActionActivation_Attribute_eventAccepter->setOrdered(false); m_acceptEventActionActivation_Attribute_eventAccepter->setContainment(false); m_acceptEventActionActivation_Attribute_eventAccepter->setResolveProxies(true); { std::string defaultValue = ""; if (!defaultValue.empty()) { m_acceptEventActionActivation_Attribute_eventAccepter->setDefaultValueLiteral(defaultValue); } //undefined otherEnd std::shared_ptr<ecore::EReference> otherEnd = nullptr; } m_acceptEventActionActivation_Operation_accept_EventOccurrence->setName("accept"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_acceptEventActionActivation_Operation_accept_EventOccurrence->setEType(unknownClass); } m_acceptEventActionActivation_Operation_accept_EventOccurrence->setLowerBound(1); m_acceptEventActionActivation_Operation_accept_EventOccurrence->setUpperBound(1); m_acceptEventActionActivation_Operation_accept_EventOccurrence->setUnique(true); m_acceptEventActionActivation_Operation_accept_EventOccurrence->setOrdered(false); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_acceptEventActionActivation_Operation_accept_EventOccurrence); parameter->setName("eventOccurrence"); parameter->setEType(nullptr); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } m_acceptEventActionActivation_Operation_doAction->setName("doAction"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_acceptEventActionActivation_Operation_doAction->setEType(unknownClass); } m_acceptEventActionActivation_Operation_doAction->setLowerBound(1); m_acceptEventActionActivation_Operation_doAction->setUpperBound(1); m_acceptEventActionActivation_Operation_doAction->setUnique(true); m_acceptEventActionActivation_Operation_doAction->setOrdered(true); m_acceptEventActionActivation_Operation_fire_Token->setName("fire"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_acceptEventActionActivation_Operation_fire_Token->setEType(unknownClass); } m_acceptEventActionActivation_Operation_fire_Token->setLowerBound(1); m_acceptEventActionActivation_Operation_fire_Token->setUpperBound(1); m_acceptEventActionActivation_Operation_fire_Token->setUnique(true); m_acceptEventActionActivation_Operation_fire_Token->setOrdered(true); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_acceptEventActionActivation_Operation_fire_Token); parameter->setName("incomingTokens"); parameter->setEType(nullptr); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } m_acceptEventActionActivation_Operation_initialize_ActivityNode_ActivityNodeActivationGroup->setName("initialize"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_acceptEventActionActivation_Operation_initialize_ActivityNode_ActivityNodeActivationGroup->setEType(unknownClass); } m_acceptEventActionActivation_Operation_initialize_ActivityNode_ActivityNodeActivationGroup->setLowerBound(1); m_acceptEventActionActivation_Operation_initialize_ActivityNode_ActivityNodeActivationGroup->setUpperBound(1); m_acceptEventActionActivation_Operation_initialize_ActivityNode_ActivityNodeActivationGroup->setUnique(true); m_acceptEventActionActivation_Operation_initialize_ActivityNode_ActivityNodeActivationGroup->setOrdered(true); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_acceptEventActionActivation_Operation_initialize_ActivityNode_ActivityNodeActivationGroup); parameter->setName("node"); parameter->setEType(nullptr); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_acceptEventActionActivation_Operation_initialize_ActivityNode_ActivityNodeActivationGroup); parameter->setName("group"); parameter->setEType(nullptr); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } m_acceptEventActionActivation_Operation_isReady->setName("isReady"); m_acceptEventActionActivation_Operation_isReady->setEType(ecore::ecorePackage::eInstance()->getEBoolean_Class()); m_acceptEventActionActivation_Operation_isReady->setLowerBound(1); m_acceptEventActionActivation_Operation_isReady->setUpperBound(1); m_acceptEventActionActivation_Operation_isReady->setUnique(true); m_acceptEventActionActivation_Operation_isReady->setOrdered(true); m_acceptEventActionActivation_Operation_match_EventOccurrence->setName("match"); m_acceptEventActionActivation_Operation_match_EventOccurrence->setEType(ecore::ecorePackage::eInstance()->getEBoolean_Class()); m_acceptEventActionActivation_Operation_match_EventOccurrence->setLowerBound(1); m_acceptEventActionActivation_Operation_match_EventOccurrence->setUpperBound(1); m_acceptEventActionActivation_Operation_match_EventOccurrence->setUnique(true); m_acceptEventActionActivation_Operation_match_EventOccurrence->setOrdered(false); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_acceptEventActionActivation_Operation_match_EventOccurrence); parameter->setName("eventOccurrence"); parameter->setEType(fUML::Semantics::CommonBehavior::CommonBehaviorPackage::eInstance()->getEventOccurrence_Class()); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } m_acceptEventActionActivation_Operation_run->setName("run"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_acceptEventActionActivation_Operation_run->setEType(unknownClass); } m_acceptEventActionActivation_Operation_run->setLowerBound(1); m_acceptEventActionActivation_Operation_run->setUpperBound(1); m_acceptEventActionActivation_Operation_run->setUnique(true); m_acceptEventActionActivation_Operation_run->setOrdered(true); m_acceptEventActionActivation_Operation_terminate->setName("terminate"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_acceptEventActionActivation_Operation_terminate->setEType(unknownClass); } m_acceptEventActionActivation_Operation_terminate->setLowerBound(1); m_acceptEventActionActivation_Operation_terminate->setUpperBound(1); m_acceptEventActionActivation_Operation_terminate->setUnique(true); m_acceptEventActionActivation_Operation_terminate->setOrdered(true); } void ActionsPackageImpl::initializeAcceptEventActionEventAccepterContent() { m_acceptEventActionEventAccepter_Class->setName("AcceptEventActionEventAccepter"); m_acceptEventActionEventAccepter_Class->setAbstract(false); m_acceptEventActionEventAccepter_Class->setInterface(false); m_acceptEventActionEventAccepter_Attribute_actionActivation->setName("actionActivation"); m_acceptEventActionEventAccepter_Attribute_actionActivation->setEType(getAcceptEventActionActivation_Class()); m_acceptEventActionEventAccepter_Attribute_actionActivation->setLowerBound(1); m_acceptEventActionEventAccepter_Attribute_actionActivation->setUpperBound(1); m_acceptEventActionEventAccepter_Attribute_actionActivation->setTransient(false); m_acceptEventActionEventAccepter_Attribute_actionActivation->setVolatile(false); m_acceptEventActionEventAccepter_Attribute_actionActivation->setChangeable(true); m_acceptEventActionEventAccepter_Attribute_actionActivation->setUnsettable(false); m_acceptEventActionEventAccepter_Attribute_actionActivation->setUnique(true); m_acceptEventActionEventAccepter_Attribute_actionActivation->setDerived(false); m_acceptEventActionEventAccepter_Attribute_actionActivation->setOrdered(false); m_acceptEventActionEventAccepter_Attribute_actionActivation->setContainment(false); m_acceptEventActionEventAccepter_Attribute_actionActivation->setResolveProxies(true); { std::string defaultValue = ""; if (!defaultValue.empty()) { m_acceptEventActionEventAccepter_Attribute_actionActivation->setDefaultValueLiteral(defaultValue); } //undefined otherEnd std::shared_ptr<ecore::EReference> otherEnd = nullptr; } } void ActionsPackageImpl::initializeActionActivationContent() { m_actionActivation_Class->setName("ActionActivation"); m_actionActivation_Class->setAbstract(true); m_actionActivation_Class->setInterface(false); m_actionActivation_Attribute_firing = getActionActivation_Attribute_firing(); m_actionActivation_Attribute_firing->setName("firing"); m_actionActivation_Attribute_firing->setEType(ecore::ecorePackage::eInstance()->getEBoolean_Class()); m_actionActivation_Attribute_firing->setLowerBound(1); m_actionActivation_Attribute_firing->setUpperBound(1); m_actionActivation_Attribute_firing->setTransient(false); m_actionActivation_Attribute_firing->setVolatile(false); m_actionActivation_Attribute_firing->setChangeable(true); m_actionActivation_Attribute_firing->setUnsettable(false); m_actionActivation_Attribute_firing->setUnique(true); m_actionActivation_Attribute_firing->setDerived(false); m_actionActivation_Attribute_firing->setOrdered(false); m_actionActivation_Attribute_firing->setID(false); { std::string defaultValue = "false"; if (!defaultValue.empty()) { m_actionActivation_Attribute_firing->setDefaultValueLiteral(defaultValue); } } m_actionActivation_Attribute_action->setName("action"); m_actionActivation_Attribute_action->setEType(uml::umlPackage::eInstance()->getAction_Class()); m_actionActivation_Attribute_action->setLowerBound(1); m_actionActivation_Attribute_action->setUpperBound(1); m_actionActivation_Attribute_action->setTransient(false); m_actionActivation_Attribute_action->setVolatile(false); m_actionActivation_Attribute_action->setChangeable(true); m_actionActivation_Attribute_action->setUnsettable(false); m_actionActivation_Attribute_action->setUnique(true); m_actionActivation_Attribute_action->setDerived(false); m_actionActivation_Attribute_action->setOrdered(true); m_actionActivation_Attribute_action->setContainment(false); m_actionActivation_Attribute_action->setResolveProxies(true); { std::string defaultValue = ""; if (!defaultValue.empty()) { m_actionActivation_Attribute_action->setDefaultValueLiteral(defaultValue); } //undefined otherEnd std::shared_ptr<ecore::EReference> otherEnd = nullptr; } m_actionActivation_Attribute_inputPinActivation->setName("inputPinActivation"); m_actionActivation_Attribute_inputPinActivation->setEType(getInputPinActivation_Class()); m_actionActivation_Attribute_inputPinActivation->setLowerBound(0); m_actionActivation_Attribute_inputPinActivation->setUpperBound(-1); m_actionActivation_Attribute_inputPinActivation->setTransient(false); m_actionActivation_Attribute_inputPinActivation->setVolatile(false); m_actionActivation_Attribute_inputPinActivation->setChangeable(true); m_actionActivation_Attribute_inputPinActivation->setUnsettable(false); m_actionActivation_Attribute_inputPinActivation->setUnique(true); m_actionActivation_Attribute_inputPinActivation->setDerived(false); m_actionActivation_Attribute_inputPinActivation->setOrdered(false); m_actionActivation_Attribute_inputPinActivation->setContainment(false); m_actionActivation_Attribute_inputPinActivation->setResolveProxies(true); { std::string defaultValue = ""; if (!defaultValue.empty()) { m_actionActivation_Attribute_inputPinActivation->setDefaultValueLiteral(defaultValue); } //undefined otherEnd std::shared_ptr<ecore::EReference> otherEnd = nullptr; } m_actionActivation_Attribute_outputPinActivation->setName("outputPinActivation"); m_actionActivation_Attribute_outputPinActivation->setEType(getOutputPinActivation_Class()); m_actionActivation_Attribute_outputPinActivation->setLowerBound(0); m_actionActivation_Attribute_outputPinActivation->setUpperBound(-1); m_actionActivation_Attribute_outputPinActivation->setTransient(false); m_actionActivation_Attribute_outputPinActivation->setVolatile(false); m_actionActivation_Attribute_outputPinActivation->setChangeable(true); m_actionActivation_Attribute_outputPinActivation->setUnsettable(false); m_actionActivation_Attribute_outputPinActivation->setUnique(true); m_actionActivation_Attribute_outputPinActivation->setDerived(false); m_actionActivation_Attribute_outputPinActivation->setOrdered(false); m_actionActivation_Attribute_outputPinActivation->setContainment(false); m_actionActivation_Attribute_outputPinActivation->setResolveProxies(true); { std::string defaultValue = ""; if (!defaultValue.empty()) { m_actionActivation_Attribute_outputPinActivation->setDefaultValueLiteral(defaultValue); } //undefined otherEnd std::shared_ptr<ecore::EReference> otherEnd = nullptr; } m_actionActivation_Attribute_pinActivation->setName("pinActivation"); m_actionActivation_Attribute_pinActivation->setEType(getPinActivation_Class()); m_actionActivation_Attribute_pinActivation->setLowerBound(0); m_actionActivation_Attribute_pinActivation->setUpperBound(-1); m_actionActivation_Attribute_pinActivation->setTransient(false); m_actionActivation_Attribute_pinActivation->setVolatile(false); m_actionActivation_Attribute_pinActivation->setChangeable(true); m_actionActivation_Attribute_pinActivation->setUnsettable(false); m_actionActivation_Attribute_pinActivation->setUnique(true); m_actionActivation_Attribute_pinActivation->setDerived(false); m_actionActivation_Attribute_pinActivation->setOrdered(false); m_actionActivation_Attribute_pinActivation->setContainment(false); m_actionActivation_Attribute_pinActivation->setResolveProxies(true); { std::string defaultValue = ""; if (!defaultValue.empty()) { m_actionActivation_Attribute_pinActivation->setDefaultValueLiteral(defaultValue); } std::shared_ptr<ecore::EReference> otherEnd = fUML::Semantics::Actions::ActionsPackage::eInstance()->getPinActivation_Attribute_actionActivation(); if (otherEnd != nullptr) { m_actionActivation_Attribute_pinActivation->setEOpposite(otherEnd); } } m_actionActivation_Operation_addOutgoingEdge_ActivityEdgeInstance->setName("addOutgoingEdge"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_actionActivation_Operation_addOutgoingEdge_ActivityEdgeInstance->setEType(unknownClass); } m_actionActivation_Operation_addOutgoingEdge_ActivityEdgeInstance->setLowerBound(1); m_actionActivation_Operation_addOutgoingEdge_ActivityEdgeInstance->setUpperBound(1); m_actionActivation_Operation_addOutgoingEdge_ActivityEdgeInstance->setUnique(true); m_actionActivation_Operation_addOutgoingEdge_ActivityEdgeInstance->setOrdered(false); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_actionActivation_Operation_addOutgoingEdge_ActivityEdgeInstance); parameter->setName("edge"); parameter->setEType(nullptr); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } m_actionActivation_Operation_addPinActivation_PinActivation->setName("addPinActivation"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_actionActivation_Operation_addPinActivation_PinActivation->setEType(unknownClass); } m_actionActivation_Operation_addPinActivation_PinActivation->setLowerBound(1); m_actionActivation_Operation_addPinActivation_PinActivation->setUpperBound(1); m_actionActivation_Operation_addPinActivation_PinActivation->setUnique(true); m_actionActivation_Operation_addPinActivation_PinActivation->setOrdered(false); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_actionActivation_Operation_addPinActivation_PinActivation); parameter->setName("pinActivation"); parameter->setEType(nullptr); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } m_actionActivation_Operation_completeAction->setName("completeAction"); m_actionActivation_Operation_completeAction->setEType(fUML::Semantics::Activities::ActivitiesPackage::eInstance()->getToken_Class()); m_actionActivation_Operation_completeAction->setLowerBound(0); m_actionActivation_Operation_completeAction->setUpperBound(-1); m_actionActivation_Operation_completeAction->setUnique(true); m_actionActivation_Operation_completeAction->setOrdered(false); m_actionActivation_Operation_createNodeActivations->setName("createNodeActivations"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_actionActivation_Operation_createNodeActivations->setEType(unknownClass); } m_actionActivation_Operation_createNodeActivations->setLowerBound(1); m_actionActivation_Operation_createNodeActivations->setUpperBound(1); m_actionActivation_Operation_createNodeActivations->setUnique(true); m_actionActivation_Operation_createNodeActivations->setOrdered(false); m_actionActivation_Operation_doAction->setName("doAction"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_actionActivation_Operation_doAction->setEType(unknownClass); } m_actionActivation_Operation_doAction->setLowerBound(1); m_actionActivation_Operation_doAction->setUpperBound(1); m_actionActivation_Operation_doAction->setUnique(true); m_actionActivation_Operation_doAction->setOrdered(false); m_actionActivation_Operation_fire_Token->setName("fire"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_actionActivation_Operation_fire_Token->setEType(unknownClass); } m_actionActivation_Operation_fire_Token->setLowerBound(1); m_actionActivation_Operation_fire_Token->setUpperBound(1); m_actionActivation_Operation_fire_Token->setUnique(true); m_actionActivation_Operation_fire_Token->setOrdered(false); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_actionActivation_Operation_fire_Token); parameter->setName("incomingTokens"); parameter->setEType(nullptr); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } m_actionActivation_Operation_getTokens_InputPin->setName("getTokens"); m_actionActivation_Operation_getTokens_InputPin->setEType(fUML::Semantics::Values::ValuesPackage::eInstance()->getValue_Class()); m_actionActivation_Operation_getTokens_InputPin->setLowerBound(0); m_actionActivation_Operation_getTokens_InputPin->setUpperBound(-1); m_actionActivation_Operation_getTokens_InputPin->setUnique(true); m_actionActivation_Operation_getTokens_InputPin->setOrdered(false); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_actionActivation_Operation_getTokens_InputPin); parameter->setName("pin"); parameter->setEType(uml::umlPackage::eInstance()->getInputPin_Class()); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } m_actionActivation_Operation_isFirng->setName("isFirng"); m_actionActivation_Operation_isFirng->setEType(ecore::ecorePackage::eInstance()->getEBoolean_Class()); m_actionActivation_Operation_isFirng->setLowerBound(1); m_actionActivation_Operation_isFirng->setUpperBound(1); m_actionActivation_Operation_isFirng->setUnique(true); m_actionActivation_Operation_isFirng->setOrdered(false); m_actionActivation_Operation_isReady->setName("isReady"); m_actionActivation_Operation_isReady->setEType(ecore::ecorePackage::eInstance()->getEBoolean_Class()); m_actionActivation_Operation_isReady->setLowerBound(1); m_actionActivation_Operation_isReady->setUpperBound(1); m_actionActivation_Operation_isReady->setUnique(true); m_actionActivation_Operation_isReady->setOrdered(false); m_actionActivation_Operation_isSourceFor_ActivityEdgeInstance->setName("isSourceFor"); m_actionActivation_Operation_isSourceFor_ActivityEdgeInstance->setEType(ecore::ecorePackage::eInstance()->getEBoolean_Class()); m_actionActivation_Operation_isSourceFor_ActivityEdgeInstance->setLowerBound(1); m_actionActivation_Operation_isSourceFor_ActivityEdgeInstance->setUpperBound(1); m_actionActivation_Operation_isSourceFor_ActivityEdgeInstance->setUnique(true); m_actionActivation_Operation_isSourceFor_ActivityEdgeInstance->setOrdered(false); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_actionActivation_Operation_isSourceFor_ActivityEdgeInstance); parameter->setName("edgeInstance"); parameter->setEType(fUML::Semantics::Activities::ActivitiesPackage::eInstance()->getActivityEdgeInstance_Class()); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } m_actionActivation_Operation_makeBooleanValue_EBoolean->setName("makeBooleanValue"); m_actionActivation_Operation_makeBooleanValue_EBoolean->setEType(fUML::Semantics::SimpleClassifiers::SimpleClassifiersPackage::eInstance()->getBooleanValue_Class()); m_actionActivation_Operation_makeBooleanValue_EBoolean->setLowerBound(1); m_actionActivation_Operation_makeBooleanValue_EBoolean->setUpperBound(1); m_actionActivation_Operation_makeBooleanValue_EBoolean->setUnique(true); m_actionActivation_Operation_makeBooleanValue_EBoolean->setOrdered(false); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_actionActivation_Operation_makeBooleanValue_EBoolean); parameter->setName("value"); parameter->setEType(ecore::ecorePackage::eInstance()->getEBoolean_Class()); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } m_actionActivation_Operation_putToken_OutputPin_Value->setName("putToken"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_actionActivation_Operation_putToken_OutputPin_Value->setEType(unknownClass); } m_actionActivation_Operation_putToken_OutputPin_Value->setLowerBound(1); m_actionActivation_Operation_putToken_OutputPin_Value->setUpperBound(1); m_actionActivation_Operation_putToken_OutputPin_Value->setUnique(true); m_actionActivation_Operation_putToken_OutputPin_Value->setOrdered(false); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_actionActivation_Operation_putToken_OutputPin_Value); parameter->setName("pin"); parameter->setEType(nullptr); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_actionActivation_Operation_putToken_OutputPin_Value); parameter->setName("value"); parameter->setEType(nullptr); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } m_actionActivation_Operation_putTokens_OutputPin_Value->setName("putTokens"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_actionActivation_Operation_putTokens_OutputPin_Value->setEType(unknownClass); } m_actionActivation_Operation_putTokens_OutputPin_Value->setLowerBound(1); m_actionActivation_Operation_putTokens_OutputPin_Value->setUpperBound(1); m_actionActivation_Operation_putTokens_OutputPin_Value->setUnique(true); m_actionActivation_Operation_putTokens_OutputPin_Value->setOrdered(false); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_actionActivation_Operation_putTokens_OutputPin_Value); parameter->setName("pin"); parameter->setEType(nullptr); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_actionActivation_Operation_putTokens_OutputPin_Value); parameter->setName("values"); parameter->setEType(nullptr); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } m_actionActivation_Operation_retrievePinActivation_Pin->setName("retrievePinActivation"); m_actionActivation_Operation_retrievePinActivation_Pin->setEType(getPinActivation_Class()); m_actionActivation_Operation_retrievePinActivation_Pin->setLowerBound(1); m_actionActivation_Operation_retrievePinActivation_Pin->setUpperBound(1); m_actionActivation_Operation_retrievePinActivation_Pin->setUnique(true); m_actionActivation_Operation_retrievePinActivation_Pin->setOrdered(false); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_actionActivation_Operation_retrievePinActivation_Pin); parameter->setName("pin"); parameter->setEType(uml::umlPackage::eInstance()->getPin_Class()); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } m_actionActivation_Operation_run->setName("run"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_actionActivation_Operation_run->setEType(unknownClass); } m_actionActivation_Operation_run->setLowerBound(1); m_actionActivation_Operation_run->setUpperBound(1); m_actionActivation_Operation_run->setUnique(true); m_actionActivation_Operation_run->setOrdered(false); m_actionActivation_Operation_sendOffers->setName("sendOffers"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_actionActivation_Operation_sendOffers->setEType(unknownClass); } m_actionActivation_Operation_sendOffers->setLowerBound(1); m_actionActivation_Operation_sendOffers->setUpperBound(1); m_actionActivation_Operation_sendOffers->setUnique(true); m_actionActivation_Operation_sendOffers->setOrdered(false); m_actionActivation_Operation_takeOfferedTokens->setName("takeOfferedTokens"); m_actionActivation_Operation_takeOfferedTokens->setEType(fUML::Semantics::Activities::ActivitiesPackage::eInstance()->getToken_Class()); m_actionActivation_Operation_takeOfferedTokens->setLowerBound(0); m_actionActivation_Operation_takeOfferedTokens->setUpperBound(-1); m_actionActivation_Operation_takeOfferedTokens->setUnique(true); m_actionActivation_Operation_takeOfferedTokens->setOrdered(false); m_actionActivation_Operation_takeTokens_InputPin->setName("takeTokens"); m_actionActivation_Operation_takeTokens_InputPin->setEType(fUML::Semantics::Values::ValuesPackage::eInstance()->getValue_Class()); m_actionActivation_Operation_takeTokens_InputPin->setLowerBound(0); m_actionActivation_Operation_takeTokens_InputPin->setUpperBound(-1); m_actionActivation_Operation_takeTokens_InputPin->setUnique(true); m_actionActivation_Operation_takeTokens_InputPin->setOrdered(false); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_actionActivation_Operation_takeTokens_InputPin); parameter->setName("pin"); parameter->setEType(uml::umlPackage::eInstance()->getInputPin_Class()); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } m_actionActivation_Operation_terminate->setName("terminate"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_actionActivation_Operation_terminate->setEType(unknownClass); } m_actionActivation_Operation_terminate->setLowerBound(1); m_actionActivation_Operation_terminate->setUpperBound(1); m_actionActivation_Operation_terminate->setUnique(true); m_actionActivation_Operation_terminate->setOrdered(false); m_actionActivation_Operation_valueParticipatesInLink_Value_Link->setName("valueParticipatesInLink"); m_actionActivation_Operation_valueParticipatesInLink_Value_Link->setEType(ecore::ecorePackage::eInstance()->getEBoolean_Class()); m_actionActivation_Operation_valueParticipatesInLink_Value_Link->setLowerBound(1); m_actionActivation_Operation_valueParticipatesInLink_Value_Link->setUpperBound(1); m_actionActivation_Operation_valueParticipatesInLink_Value_Link->setUnique(true); m_actionActivation_Operation_valueParticipatesInLink_Value_Link->setOrdered(false); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_actionActivation_Operation_valueParticipatesInLink_Value_Link); parameter->setName("value"); parameter->setEType(fUML::Semantics::Values::ValuesPackage::eInstance()->getValue_Class()); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_actionActivation_Operation_valueParticipatesInLink_Value_Link); parameter->setName("link"); parameter->setEType(fUML::Semantics::StructuredClassifiers::StructuredClassifiersPackage::eInstance()->getLink_Class()); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } } void ActionsPackageImpl::initializeAddStructuralFeatureValueActionActivationContent() { m_addStructuralFeatureValueActionActivation_Class->setName("AddStructuralFeatureValueActionActivation"); m_addStructuralFeatureValueActionActivation_Class->setAbstract(false); m_addStructuralFeatureValueActionActivation_Class->setInterface(false); m_addStructuralFeatureValueActionActivation_Attribute_addStructuralFeatureValueAction->setName("addStructuralFeatureValueAction"); m_addStructuralFeatureValueActionActivation_Attribute_addStructuralFeatureValueAction->setEType(uml::umlPackage::eInstance()->getAddStructuralFeatureValueAction_Class()); m_addStructuralFeatureValueActionActivation_Attribute_addStructuralFeatureValueAction->setLowerBound(1); m_addStructuralFeatureValueActionActivation_Attribute_addStructuralFeatureValueAction->setUpperBound(1); m_addStructuralFeatureValueActionActivation_Attribute_addStructuralFeatureValueAction->setTransient(false); m_addStructuralFeatureValueActionActivation_Attribute_addStructuralFeatureValueAction->setVolatile(false); m_addStructuralFeatureValueActionActivation_Attribute_addStructuralFeatureValueAction->setChangeable(true); m_addStructuralFeatureValueActionActivation_Attribute_addStructuralFeatureValueAction->setUnsettable(false); m_addStructuralFeatureValueActionActivation_Attribute_addStructuralFeatureValueAction->setUnique(true); m_addStructuralFeatureValueActionActivation_Attribute_addStructuralFeatureValueAction->setDerived(false); m_addStructuralFeatureValueActionActivation_Attribute_addStructuralFeatureValueAction->setOrdered(true); m_addStructuralFeatureValueActionActivation_Attribute_addStructuralFeatureValueAction->setContainment(false); m_addStructuralFeatureValueActionActivation_Attribute_addStructuralFeatureValueAction->setResolveProxies(true); { std::string defaultValue = ""; if (!defaultValue.empty()) { m_addStructuralFeatureValueActionActivation_Attribute_addStructuralFeatureValueAction->setDefaultValueLiteral(defaultValue); } //undefined otherEnd std::shared_ptr<ecore::EReference> otherEnd = nullptr; } m_addStructuralFeatureValueActionActivation_Operation_doAction->setName("doAction"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_addStructuralFeatureValueActionActivation_Operation_doAction->setEType(unknownClass); } m_addStructuralFeatureValueActionActivation_Operation_doAction->setLowerBound(0); m_addStructuralFeatureValueActionActivation_Operation_doAction->setUpperBound(1); m_addStructuralFeatureValueActionActivation_Operation_doAction->setUnique(true); m_addStructuralFeatureValueActionActivation_Operation_doAction->setOrdered(true); } void ActionsPackageImpl::initializeCallActionActivationContent() { m_callActionActivation_Class->setName("CallActionActivation"); m_callActionActivation_Class->setAbstract(true); m_callActionActivation_Class->setInterface(false); m_callActionActivation_Attribute_callAction->setName("callAction"); m_callActionActivation_Attribute_callAction->setEType(uml::umlPackage::eInstance()->getCallAction_Class()); m_callActionActivation_Attribute_callAction->setLowerBound(1); m_callActionActivation_Attribute_callAction->setUpperBound(1); m_callActionActivation_Attribute_callAction->setTransient(false); m_callActionActivation_Attribute_callAction->setVolatile(false); m_callActionActivation_Attribute_callAction->setChangeable(true); m_callActionActivation_Attribute_callAction->setUnsettable(false); m_callActionActivation_Attribute_callAction->setUnique(true); m_callActionActivation_Attribute_callAction->setDerived(false); m_callActionActivation_Attribute_callAction->setOrdered(true); m_callActionActivation_Attribute_callAction->setContainment(false); m_callActionActivation_Attribute_callAction->setResolveProxies(true); { std::string defaultValue = ""; if (!defaultValue.empty()) { m_callActionActivation_Attribute_callAction->setDefaultValueLiteral(defaultValue); } //undefined otherEnd std::shared_ptr<ecore::EReference> otherEnd = nullptr; } m_callActionActivation_Attribute_callExecutions->setName("callExecutions"); m_callActionActivation_Attribute_callExecutions->setEType(fUML::Semantics::CommonBehavior::CommonBehaviorPackage::eInstance()->getExecution_Class()); m_callActionActivation_Attribute_callExecutions->setLowerBound(0); m_callActionActivation_Attribute_callExecutions->setUpperBound(-1); m_callActionActivation_Attribute_callExecutions->setTransient(false); m_callActionActivation_Attribute_callExecutions->setVolatile(false); m_callActionActivation_Attribute_callExecutions->setChangeable(true); m_callActionActivation_Attribute_callExecutions->setUnsettable(false); m_callActionActivation_Attribute_callExecutions->setUnique(true); m_callActionActivation_Attribute_callExecutions->setDerived(false); m_callActionActivation_Attribute_callExecutions->setOrdered(false); m_callActionActivation_Attribute_callExecutions->setContainment(true); m_callActionActivation_Attribute_callExecutions->setResolveProxies(true); { std::string defaultValue = ""; if (!defaultValue.empty()) { m_callActionActivation_Attribute_callExecutions->setDefaultValueLiteral(defaultValue); } //undefined otherEnd std::shared_ptr<ecore::EReference> otherEnd = nullptr; } m_callActionActivation_Operation_doAction->setName("doAction"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_callActionActivation_Operation_doAction->setEType(unknownClass); } m_callActionActivation_Operation_doAction->setLowerBound(1); m_callActionActivation_Operation_doAction->setUpperBound(1); m_callActionActivation_Operation_doAction->setUnique(true); m_callActionActivation_Operation_doAction->setOrdered(false); m_callActionActivation_Operation_getCallExecution->setName("getCallExecution"); m_callActionActivation_Operation_getCallExecution->setEType(fUML::Semantics::CommonBehavior::CommonBehaviorPackage::eInstance()->getExecution_Class()); m_callActionActivation_Operation_getCallExecution->setLowerBound(1); m_callActionActivation_Operation_getCallExecution->setUpperBound(1); m_callActionActivation_Operation_getCallExecution->setUnique(true); m_callActionActivation_Operation_getCallExecution->setOrdered(false); m_callActionActivation_Operation_removeCallExecution_Execution->setName("removeCallExecution"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_callActionActivation_Operation_removeCallExecution_Execution->setEType(unknownClass); } m_callActionActivation_Operation_removeCallExecution_Execution->setLowerBound(1); m_callActionActivation_Operation_removeCallExecution_Execution->setUpperBound(1); m_callActionActivation_Operation_removeCallExecution_Execution->setUnique(true); m_callActionActivation_Operation_removeCallExecution_Execution->setOrdered(false); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_callActionActivation_Operation_removeCallExecution_Execution); parameter->setName("execution"); parameter->setEType(nullptr); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } m_callActionActivation_Operation_terminate->setName("terminate"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_callActionActivation_Operation_terminate->setEType(unknownClass); } m_callActionActivation_Operation_terminate->setLowerBound(1); m_callActionActivation_Operation_terminate->setUpperBound(1); m_callActionActivation_Operation_terminate->setUnique(true); m_callActionActivation_Operation_terminate->setOrdered(false); } void ActionsPackageImpl::initializeCallBehaviorActionActivationContent() { m_callBehaviorActionActivation_Class->setName("CallBehaviorActionActivation"); m_callBehaviorActionActivation_Class->setAbstract(false); m_callBehaviorActionActivation_Class->setInterface(false); m_callBehaviorActionActivation_Attribute_callBehaviorAction->setName("callBehaviorAction"); m_callBehaviorActionActivation_Attribute_callBehaviorAction->setEType(uml::umlPackage::eInstance()->getCallBehaviorAction_Class()); m_callBehaviorActionActivation_Attribute_callBehaviorAction->setLowerBound(1); m_callBehaviorActionActivation_Attribute_callBehaviorAction->setUpperBound(1); m_callBehaviorActionActivation_Attribute_callBehaviorAction->setTransient(false); m_callBehaviorActionActivation_Attribute_callBehaviorAction->setVolatile(false); m_callBehaviorActionActivation_Attribute_callBehaviorAction->setChangeable(true); m_callBehaviorActionActivation_Attribute_callBehaviorAction->setUnsettable(false); m_callBehaviorActionActivation_Attribute_callBehaviorAction->setUnique(true); m_callBehaviorActionActivation_Attribute_callBehaviorAction->setDerived(false); m_callBehaviorActionActivation_Attribute_callBehaviorAction->setOrdered(true); m_callBehaviorActionActivation_Attribute_callBehaviorAction->setContainment(false); m_callBehaviorActionActivation_Attribute_callBehaviorAction->setResolveProxies(true); { std::string defaultValue = ""; if (!defaultValue.empty()) { m_callBehaviorActionActivation_Attribute_callBehaviorAction->setDefaultValueLiteral(defaultValue); } //undefined otherEnd std::shared_ptr<ecore::EReference> otherEnd = nullptr; } m_callBehaviorActionActivation_Operation_getCallExecution->setName("getCallExecution"); m_callBehaviorActionActivation_Operation_getCallExecution->setEType(fUML::Semantics::CommonBehavior::CommonBehaviorPackage::eInstance()->getExecution_Class()); m_callBehaviorActionActivation_Operation_getCallExecution->setLowerBound(1); m_callBehaviorActionActivation_Operation_getCallExecution->setUpperBound(1); m_callBehaviorActionActivation_Operation_getCallExecution->setUnique(true); m_callBehaviorActionActivation_Operation_getCallExecution->setOrdered(false); } void ActionsPackageImpl::initializeCallOperationActionActivationContent() { m_callOperationActionActivation_Class->setName("CallOperationActionActivation"); m_callOperationActionActivation_Class->setAbstract(false); m_callOperationActionActivation_Class->setInterface(false); m_callOperationActionActivation_Attribute_callOperationAction->setName("callOperationAction"); m_callOperationActionActivation_Attribute_callOperationAction->setEType(uml::umlPackage::eInstance()->getCallOperationAction_Class()); m_callOperationActionActivation_Attribute_callOperationAction->setLowerBound(1); m_callOperationActionActivation_Attribute_callOperationAction->setUpperBound(1); m_callOperationActionActivation_Attribute_callOperationAction->setTransient(false); m_callOperationActionActivation_Attribute_callOperationAction->setVolatile(false); m_callOperationActionActivation_Attribute_callOperationAction->setChangeable(true); m_callOperationActionActivation_Attribute_callOperationAction->setUnsettable(false); m_callOperationActionActivation_Attribute_callOperationAction->setUnique(true); m_callOperationActionActivation_Attribute_callOperationAction->setDerived(false); m_callOperationActionActivation_Attribute_callOperationAction->setOrdered(true); m_callOperationActionActivation_Attribute_callOperationAction->setContainment(false); m_callOperationActionActivation_Attribute_callOperationAction->setResolveProxies(true); { std::string defaultValue = ""; if (!defaultValue.empty()) { m_callOperationActionActivation_Attribute_callOperationAction->setDefaultValueLiteral(defaultValue); } //undefined otherEnd std::shared_ptr<ecore::EReference> otherEnd = nullptr; } m_callOperationActionActivation_Operation_getCallExecution->setName("getCallExecution"); m_callOperationActionActivation_Operation_getCallExecution->setEType(fUML::Semantics::CommonBehavior::CommonBehaviorPackage::eInstance()->getExecution_Class()); m_callOperationActionActivation_Operation_getCallExecution->setLowerBound(1); m_callOperationActionActivation_Operation_getCallExecution->setUpperBound(1); m_callOperationActionActivation_Operation_getCallExecution->setUnique(true); m_callOperationActionActivation_Operation_getCallExecution->setOrdered(false); } void ActionsPackageImpl::initializeClauseActivationContent() { m_clauseActivation_Class->setName("ClauseActivation"); m_clauseActivation_Class->setAbstract(false); m_clauseActivation_Class->setInterface(false); m_clauseActivation_Attribute_clause->setName("clause"); m_clauseActivation_Attribute_clause->setEType(uml::umlPackage::eInstance()->getClause_Class()); m_clauseActivation_Attribute_clause->setLowerBound(1); m_clauseActivation_Attribute_clause->setUpperBound(1); m_clauseActivation_Attribute_clause->setTransient(false); m_clauseActivation_Attribute_clause->setVolatile(false); m_clauseActivation_Attribute_clause->setChangeable(true); m_clauseActivation_Attribute_clause->setUnsettable(false); m_clauseActivation_Attribute_clause->setUnique(true); m_clauseActivation_Attribute_clause->setDerived(false); m_clauseActivation_Attribute_clause->setOrdered(false); m_clauseActivation_Attribute_clause->setContainment(false); m_clauseActivation_Attribute_clause->setResolveProxies(true); { std::string defaultValue = ""; if (!defaultValue.empty()) { m_clauseActivation_Attribute_clause->setDefaultValueLiteral(defaultValue); } //undefined otherEnd std::shared_ptr<ecore::EReference> otherEnd = nullptr; } m_clauseActivation_Attribute_conditionalNodeActivation->setName("conditionalNodeActivation"); m_clauseActivation_Attribute_conditionalNodeActivation->setEType(getConditionalNodeActivation_Class()); m_clauseActivation_Attribute_conditionalNodeActivation->setLowerBound(1); m_clauseActivation_Attribute_conditionalNodeActivation->setUpperBound(1); m_clauseActivation_Attribute_conditionalNodeActivation->setTransient(false); m_clauseActivation_Attribute_conditionalNodeActivation->setVolatile(false); m_clauseActivation_Attribute_conditionalNodeActivation->setChangeable(true); m_clauseActivation_Attribute_conditionalNodeActivation->setUnsettable(false); m_clauseActivation_Attribute_conditionalNodeActivation->setUnique(true); m_clauseActivation_Attribute_conditionalNodeActivation->setDerived(false); m_clauseActivation_Attribute_conditionalNodeActivation->setOrdered(false); m_clauseActivation_Attribute_conditionalNodeActivation->setContainment(false); m_clauseActivation_Attribute_conditionalNodeActivation->setResolveProxies(true); { std::string defaultValue = ""; if (!defaultValue.empty()) { m_clauseActivation_Attribute_conditionalNodeActivation->setDefaultValueLiteral(defaultValue); } //undefined otherEnd std::shared_ptr<ecore::EReference> otherEnd = nullptr; } m_clauseActivation_Operation_getDecision->setName("getDecision"); m_clauseActivation_Operation_getDecision->setEType(fUML::Semantics::SimpleClassifiers::SimpleClassifiersPackage::eInstance()->getBooleanValue_Class()); m_clauseActivation_Operation_getDecision->setLowerBound(0); m_clauseActivation_Operation_getDecision->setUpperBound(1); m_clauseActivation_Operation_getDecision->setUnique(true); m_clauseActivation_Operation_getDecision->setOrdered(false); m_clauseActivation_Operation_getPredecessors->setName("getPredecessors"); m_clauseActivation_Operation_getPredecessors->setEType(getClauseActivation_Class()); m_clauseActivation_Operation_getPredecessors->setLowerBound(0); m_clauseActivation_Operation_getPredecessors->setUpperBound(-1); m_clauseActivation_Operation_getPredecessors->setUnique(true); m_clauseActivation_Operation_getPredecessors->setOrdered(false); m_clauseActivation_Operation_getSuccessors->setName("getSuccessors"); m_clauseActivation_Operation_getSuccessors->setEType(getClauseActivation_Class()); m_clauseActivation_Operation_getSuccessors->setLowerBound(0); m_clauseActivation_Operation_getSuccessors->setUpperBound(-1); m_clauseActivation_Operation_getSuccessors->setUnique(true); m_clauseActivation_Operation_getSuccessors->setOrdered(false); m_clauseActivation_Operation_isReady->setName("isReady"); m_clauseActivation_Operation_isReady->setEType(ecore::ecorePackage::eInstance()->getEBoolean_Class()); m_clauseActivation_Operation_isReady->setLowerBound(1); m_clauseActivation_Operation_isReady->setUpperBound(1); m_clauseActivation_Operation_isReady->setUnique(true); m_clauseActivation_Operation_isReady->setOrdered(false); m_clauseActivation_Operation_recieveControl->setName("recieveControl"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_clauseActivation_Operation_recieveControl->setEType(unknownClass); } m_clauseActivation_Operation_recieveControl->setLowerBound(1); m_clauseActivation_Operation_recieveControl->setUpperBound(1); m_clauseActivation_Operation_recieveControl->setUnique(true); m_clauseActivation_Operation_recieveControl->setOrdered(false); m_clauseActivation_Operation_runTest->setName("runTest"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_clauseActivation_Operation_runTest->setEType(unknownClass); } m_clauseActivation_Operation_runTest->setLowerBound(1); m_clauseActivation_Operation_runTest->setUpperBound(1); m_clauseActivation_Operation_runTest->setUnique(true); m_clauseActivation_Operation_runTest->setOrdered(false); m_clauseActivation_Operation_selectBody->setName("selectBody"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_clauseActivation_Operation_selectBody->setEType(unknownClass); } m_clauseActivation_Operation_selectBody->setLowerBound(1); m_clauseActivation_Operation_selectBody->setUpperBound(1); m_clauseActivation_Operation_selectBody->setUnique(true); m_clauseActivation_Operation_selectBody->setOrdered(false); } void ActionsPackageImpl::initializeClearAssociationActionActivationContent() { m_clearAssociationActionActivation_Class->setName("ClearAssociationActionActivation"); m_clearAssociationActionActivation_Class->setAbstract(false); m_clearAssociationActionActivation_Class->setInterface(false); } void ActionsPackageImpl::initializeClearStructuralFeatureActionActivationContent() { m_clearStructuralFeatureActionActivation_Class->setName("ClearStructuralFeatureActionActivation"); m_clearStructuralFeatureActionActivation_Class->setAbstract(false); m_clearStructuralFeatureActionActivation_Class->setInterface(false); m_clearStructuralFeatureActionActivation_Operation_doAction->setName("doAction"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_clearStructuralFeatureActionActivation_Operation_doAction->setEType(unknownClass); } m_clearStructuralFeatureActionActivation_Operation_doAction->setLowerBound(0); m_clearStructuralFeatureActionActivation_Operation_doAction->setUpperBound(1); m_clearStructuralFeatureActionActivation_Operation_doAction->setUnique(true); m_clearStructuralFeatureActionActivation_Operation_doAction->setOrdered(true); } void ActionsPackageImpl::initializeConditionalNodeActivationContent() { m_conditionalNodeActivation_Class->setName("ConditionalNodeActivation"); m_conditionalNodeActivation_Class->setAbstract(false); m_conditionalNodeActivation_Class->setInterface(false); m_conditionalNodeActivation_Attribute_clauseActivations->setName("clauseActivations"); m_conditionalNodeActivation_Attribute_clauseActivations->setEType(getClauseActivation_Class()); m_conditionalNodeActivation_Attribute_clauseActivations->setLowerBound(0); m_conditionalNodeActivation_Attribute_clauseActivations->setUpperBound(-1); m_conditionalNodeActivation_Attribute_clauseActivations->setTransient(false); m_conditionalNodeActivation_Attribute_clauseActivations->setVolatile(false); m_conditionalNodeActivation_Attribute_clauseActivations->setChangeable(true); m_conditionalNodeActivation_Attribute_clauseActivations->setUnsettable(false); m_conditionalNodeActivation_Attribute_clauseActivations->setUnique(true); m_conditionalNodeActivation_Attribute_clauseActivations->setDerived(false); m_conditionalNodeActivation_Attribute_clauseActivations->setOrdered(false); m_conditionalNodeActivation_Attribute_clauseActivations->setContainment(true); m_conditionalNodeActivation_Attribute_clauseActivations->setResolveProxies(true); { std::string defaultValue = ""; if (!defaultValue.empty()) { m_conditionalNodeActivation_Attribute_clauseActivations->setDefaultValueLiteral(defaultValue); } //undefined otherEnd std::shared_ptr<ecore::EReference> otherEnd = nullptr; } m_conditionalNodeActivation_Attribute_selectedClauses->setName("selectedClauses"); m_conditionalNodeActivation_Attribute_selectedClauses->setEType(uml::umlPackage::eInstance()->getClause_Class()); m_conditionalNodeActivation_Attribute_selectedClauses->setLowerBound(0); m_conditionalNodeActivation_Attribute_selectedClauses->setUpperBound(-1); m_conditionalNodeActivation_Attribute_selectedClauses->setTransient(false); m_conditionalNodeActivation_Attribute_selectedClauses->setVolatile(false); m_conditionalNodeActivation_Attribute_selectedClauses->setChangeable(true); m_conditionalNodeActivation_Attribute_selectedClauses->setUnsettable(false); m_conditionalNodeActivation_Attribute_selectedClauses->setUnique(true); m_conditionalNodeActivation_Attribute_selectedClauses->setDerived(false); m_conditionalNodeActivation_Attribute_selectedClauses->setOrdered(false); m_conditionalNodeActivation_Attribute_selectedClauses->setContainment(false); m_conditionalNodeActivation_Attribute_selectedClauses->setResolveProxies(true); { std::string defaultValue = ""; if (!defaultValue.empty()) { m_conditionalNodeActivation_Attribute_selectedClauses->setDefaultValueLiteral(defaultValue); } //undefined otherEnd std::shared_ptr<ecore::EReference> otherEnd = nullptr; } m_conditionalNodeActivation_Operation_getClauseActivation_Clause->setName("getClauseActivation"); m_conditionalNodeActivation_Operation_getClauseActivation_Clause->setEType(getClauseActivation_Class()); m_conditionalNodeActivation_Operation_getClauseActivation_Clause->setLowerBound(1); m_conditionalNodeActivation_Operation_getClauseActivation_Clause->setUpperBound(1); m_conditionalNodeActivation_Operation_getClauseActivation_Clause->setUnique(true); m_conditionalNodeActivation_Operation_getClauseActivation_Clause->setOrdered(false); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_conditionalNodeActivation_Operation_getClauseActivation_Clause); parameter->setName("clause"); parameter->setEType(uml::umlPackage::eInstance()->getClause_Class()); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } m_conditionalNodeActivation_Operation_runTest_Clause->setName("runTest"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_conditionalNodeActivation_Operation_runTest_Clause->setEType(unknownClass); } m_conditionalNodeActivation_Operation_runTest_Clause->setLowerBound(1); m_conditionalNodeActivation_Operation_runTest_Clause->setUpperBound(1); m_conditionalNodeActivation_Operation_runTest_Clause->setUnique(true); m_conditionalNodeActivation_Operation_runTest_Clause->setOrdered(false); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_conditionalNodeActivation_Operation_runTest_Clause); parameter->setName("clause"); parameter->setEType(nullptr); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } m_conditionalNodeActivation_Operation_selectBody_Clause->setName("selectBody"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_conditionalNodeActivation_Operation_selectBody_Clause->setEType(unknownClass); } m_conditionalNodeActivation_Operation_selectBody_Clause->setLowerBound(1); m_conditionalNodeActivation_Operation_selectBody_Clause->setUpperBound(1); m_conditionalNodeActivation_Operation_selectBody_Clause->setUnique(true); m_conditionalNodeActivation_Operation_selectBody_Clause->setOrdered(false); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_conditionalNodeActivation_Operation_selectBody_Clause); parameter->setName("clause"); parameter->setEType(nullptr); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } } void ActionsPackageImpl::initializeCreateLinkActionActivationContent() { m_createLinkActionActivation_Class->setName("CreateLinkActionActivation"); m_createLinkActionActivation_Class->setAbstract(false); m_createLinkActionActivation_Class->setInterface(false); } void ActionsPackageImpl::initializeCreateObjectActionActivationContent() { m_createObjectActionActivation_Class->setName("CreateObjectActionActivation"); m_createObjectActionActivation_Class->setAbstract(false); m_createObjectActionActivation_Class->setInterface(false); m_createObjectActionActivation_Attribute_createObjectAction->setName("createObjectAction"); m_createObjectActionActivation_Attribute_createObjectAction->setEType(uml::umlPackage::eInstance()->getCreateObjectAction_Class()); m_createObjectActionActivation_Attribute_createObjectAction->setLowerBound(1); m_createObjectActionActivation_Attribute_createObjectAction->setUpperBound(1); m_createObjectActionActivation_Attribute_createObjectAction->setTransient(false); m_createObjectActionActivation_Attribute_createObjectAction->setVolatile(false); m_createObjectActionActivation_Attribute_createObjectAction->setChangeable(true); m_createObjectActionActivation_Attribute_createObjectAction->setUnsettable(false); m_createObjectActionActivation_Attribute_createObjectAction->setUnique(true); m_createObjectActionActivation_Attribute_createObjectAction->setDerived(false); m_createObjectActionActivation_Attribute_createObjectAction->setOrdered(true); m_createObjectActionActivation_Attribute_createObjectAction->setContainment(false); m_createObjectActionActivation_Attribute_createObjectAction->setResolveProxies(true); { std::string defaultValue = ""; if (!defaultValue.empty()) { m_createObjectActionActivation_Attribute_createObjectAction->setDefaultValueLiteral(defaultValue); } //undefined otherEnd std::shared_ptr<ecore::EReference> otherEnd = nullptr; } m_createObjectActionActivation_Operation_doAction->setName("doAction"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_createObjectActionActivation_Operation_doAction->setEType(unknownClass); } m_createObjectActionActivation_Operation_doAction->setLowerBound(0); m_createObjectActionActivation_Operation_doAction->setUpperBound(1); m_createObjectActionActivation_Operation_doAction->setUnique(true); m_createObjectActionActivation_Operation_doAction->setOrdered(true); } void ActionsPackageImpl::initializeDestroyLinkActionActivationContent() { m_destroyLinkActionActivation_Class->setName("DestroyLinkActionActivation"); m_destroyLinkActionActivation_Class->setAbstract(false); m_destroyLinkActionActivation_Class->setInterface(false); } void ActionsPackageImpl::initializeDestroyObjectActionActivationContent() { m_destroyObjectActionActivation_Class->setName("DestroyObjectActionActivation"); m_destroyObjectActionActivation_Class->setAbstract(false); m_destroyObjectActionActivation_Class->setInterface(false); m_destroyObjectActionActivation_Attribute_destroyObjectAction->setName("destroyObjectAction"); m_destroyObjectActionActivation_Attribute_destroyObjectAction->setEType(uml::umlPackage::eInstance()->getDestroyObjectAction_Class()); m_destroyObjectActionActivation_Attribute_destroyObjectAction->setLowerBound(1); m_destroyObjectActionActivation_Attribute_destroyObjectAction->setUpperBound(1); m_destroyObjectActionActivation_Attribute_destroyObjectAction->setTransient(false); m_destroyObjectActionActivation_Attribute_destroyObjectAction->setVolatile(false); m_destroyObjectActionActivation_Attribute_destroyObjectAction->setChangeable(true); m_destroyObjectActionActivation_Attribute_destroyObjectAction->setUnsettable(false); m_destroyObjectActionActivation_Attribute_destroyObjectAction->setUnique(true); m_destroyObjectActionActivation_Attribute_destroyObjectAction->setDerived(false); m_destroyObjectActionActivation_Attribute_destroyObjectAction->setOrdered(true); m_destroyObjectActionActivation_Attribute_destroyObjectAction->setContainment(false); m_destroyObjectActionActivation_Attribute_destroyObjectAction->setResolveProxies(true); { std::string defaultValue = ""; if (!defaultValue.empty()) { m_destroyObjectActionActivation_Attribute_destroyObjectAction->setDefaultValueLiteral(defaultValue); } //undefined otherEnd std::shared_ptr<ecore::EReference> otherEnd = nullptr; } m_destroyObjectActionActivation_Operation_destroyObject_Value_EBoolean->setName("destroyObject"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_destroyObjectActionActivation_Operation_destroyObject_Value_EBoolean->setEType(unknownClass); } m_destroyObjectActionActivation_Operation_destroyObject_Value_EBoolean->setLowerBound(1); m_destroyObjectActionActivation_Operation_destroyObject_Value_EBoolean->setUpperBound(1); m_destroyObjectActionActivation_Operation_destroyObject_Value_EBoolean->setUnique(true); m_destroyObjectActionActivation_Operation_destroyObject_Value_EBoolean->setOrdered(false); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_destroyObjectActionActivation_Operation_destroyObject_Value_EBoolean); parameter->setName("value"); parameter->setEType(nullptr); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_destroyObjectActionActivation_Operation_destroyObject_Value_EBoolean); parameter->setName("isDestroyLinks"); parameter->setEType(nullptr); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_destroyObjectActionActivation_Operation_destroyObject_Value_EBoolean); parameter->setName("isDestroyOwnedObjects"); parameter->setEType(nullptr); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } m_destroyObjectActionActivation_Operation_doAction->setName("doAction"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_destroyObjectActionActivation_Operation_doAction->setEType(unknownClass); } m_destroyObjectActionActivation_Operation_doAction->setLowerBound(0); m_destroyObjectActionActivation_Operation_doAction->setUpperBound(1); m_destroyObjectActionActivation_Operation_doAction->setUnique(true); m_destroyObjectActionActivation_Operation_doAction->setOrdered(true); m_destroyObjectActionActivation_Operation_objectIsComposite_Reference_Link->setName("objectIsComposite"); m_destroyObjectActionActivation_Operation_objectIsComposite_Reference_Link->setEType(ecore::ecorePackage::eInstance()->getEBoolean_Class()); m_destroyObjectActionActivation_Operation_objectIsComposite_Reference_Link->setLowerBound(1); m_destroyObjectActionActivation_Operation_objectIsComposite_Reference_Link->setUpperBound(1); m_destroyObjectActionActivation_Operation_objectIsComposite_Reference_Link->setUnique(true); m_destroyObjectActionActivation_Operation_objectIsComposite_Reference_Link->setOrdered(false); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_destroyObjectActionActivation_Operation_objectIsComposite_Reference_Link); parameter->setName("reference"); parameter->setEType(fUML::Semantics::StructuredClassifiers::StructuredClassifiersPackage::eInstance()->getReference_Class()); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_destroyObjectActionActivation_Operation_objectIsComposite_Reference_Link); parameter->setName("link"); parameter->setEType(fUML::Semantics::StructuredClassifiers::StructuredClassifiersPackage::eInstance()->getLink_Class()); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } } void ActionsPackageImpl::initializeInputPinActivationContent() { m_inputPinActivation_Class->setName("InputPinActivation"); m_inputPinActivation_Class->setAbstract(false); m_inputPinActivation_Class->setInterface(false); m_inputPinActivation_Operation_isReady->setName("isReady"); m_inputPinActivation_Operation_isReady->setEType(ecore::ecorePackage::eInstance()->getEBoolean_Class()); m_inputPinActivation_Operation_isReady->setLowerBound(1); m_inputPinActivation_Operation_isReady->setUpperBound(1); m_inputPinActivation_Operation_isReady->setUnique(true); m_inputPinActivation_Operation_isReady->setOrdered(false); m_inputPinActivation_Operation_receiveOffer->setName("receiveOffer"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_inputPinActivation_Operation_receiveOffer->setEType(unknownClass); } m_inputPinActivation_Operation_receiveOffer->setLowerBound(1); m_inputPinActivation_Operation_receiveOffer->setUpperBound(1); m_inputPinActivation_Operation_receiveOffer->setUnique(true); m_inputPinActivation_Operation_receiveOffer->setOrdered(false); } void ActionsPackageImpl::initializeInvocationActionActivationContent() { m_invocationActionActivation_Class->setName("InvocationActionActivation"); m_invocationActionActivation_Class->setAbstract(true); m_invocationActionActivation_Class->setInterface(false); } void ActionsPackageImpl::initializeLinkActionActivationContent() { m_linkActionActivation_Class->setName("LinkActionActivation"); m_linkActionActivation_Class->setAbstract(true); m_linkActionActivation_Class->setInterface(false); m_linkActionActivation_Operation_endMatchesEndData_Link_LinkEndData->setName("endMatchesEndData"); m_linkActionActivation_Operation_endMatchesEndData_Link_LinkEndData->setEType(ecore::ecorePackage::eInstance()->getEBoolean_Class()); m_linkActionActivation_Operation_endMatchesEndData_Link_LinkEndData->setLowerBound(1); m_linkActionActivation_Operation_endMatchesEndData_Link_LinkEndData->setUpperBound(1); m_linkActionActivation_Operation_endMatchesEndData_Link_LinkEndData->setUnique(true); m_linkActionActivation_Operation_endMatchesEndData_Link_LinkEndData->setOrdered(false); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_linkActionActivation_Operation_endMatchesEndData_Link_LinkEndData); parameter->setName("link"); parameter->setEType(fUML::Semantics::StructuredClassifiers::StructuredClassifiersPackage::eInstance()->getLink_Class()); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_linkActionActivation_Operation_endMatchesEndData_Link_LinkEndData); parameter->setName("endData"); parameter->setEType(uml::umlPackage::eInstance()->getLinkEndData_Class()); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } m_linkActionActivation_Operation_getAssociation->setName("getAssociation"); m_linkActionActivation_Operation_getAssociation->setEType(uml::umlPackage::eInstance()->getAssociation_Class()); m_linkActionActivation_Operation_getAssociation->setLowerBound(1); m_linkActionActivation_Operation_getAssociation->setUpperBound(1); m_linkActionActivation_Operation_getAssociation->setUnique(true); m_linkActionActivation_Operation_getAssociation->setOrdered(false); m_linkActionActivation_Operation_linkMatchesEndData_Link_LinkEndData->setName("linkMatchesEndData"); m_linkActionActivation_Operation_linkMatchesEndData_Link_LinkEndData->setEType(ecore::ecorePackage::eInstance()->getEBoolean_Class()); m_linkActionActivation_Operation_linkMatchesEndData_Link_LinkEndData->setLowerBound(1); m_linkActionActivation_Operation_linkMatchesEndData_Link_LinkEndData->setUpperBound(1); m_linkActionActivation_Operation_linkMatchesEndData_Link_LinkEndData->setUnique(true); m_linkActionActivation_Operation_linkMatchesEndData_Link_LinkEndData->setOrdered(false); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_linkActionActivation_Operation_linkMatchesEndData_Link_LinkEndData); parameter->setName("link"); parameter->setEType(fUML::Semantics::StructuredClassifiers::StructuredClassifiersPackage::eInstance()->getLink_Class()); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_linkActionActivation_Operation_linkMatchesEndData_Link_LinkEndData); parameter->setName("endDataList"); parameter->setEType(uml::umlPackage::eInstance()->getLinkEndData_Class()); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } } void ActionsPackageImpl::initializeLoopNodeActivationContent() { m_loopNodeActivation_Class->setName("LoopNodeActivation"); m_loopNodeActivation_Class->setAbstract(false); m_loopNodeActivation_Class->setInterface(false); m_loopNodeActivation_Attribute_bodyOutputLists->setName("bodyOutputLists"); m_loopNodeActivation_Attribute_bodyOutputLists->setEType(getValues_Class()); m_loopNodeActivation_Attribute_bodyOutputLists->setLowerBound(0); m_loopNodeActivation_Attribute_bodyOutputLists->setUpperBound(-1); m_loopNodeActivation_Attribute_bodyOutputLists->setTransient(false); m_loopNodeActivation_Attribute_bodyOutputLists->setVolatile(false); m_loopNodeActivation_Attribute_bodyOutputLists->setChangeable(true); m_loopNodeActivation_Attribute_bodyOutputLists->setUnsettable(false); m_loopNodeActivation_Attribute_bodyOutputLists->setUnique(true); m_loopNodeActivation_Attribute_bodyOutputLists->setDerived(false); m_loopNodeActivation_Attribute_bodyOutputLists->setOrdered(false); m_loopNodeActivation_Attribute_bodyOutputLists->setContainment(true); m_loopNodeActivation_Attribute_bodyOutputLists->setResolveProxies(true); { std::string defaultValue = ""; if (!defaultValue.empty()) { m_loopNodeActivation_Attribute_bodyOutputLists->setDefaultValueLiteral(defaultValue); } //undefined otherEnd std::shared_ptr<ecore::EReference> otherEnd = nullptr; } m_loopNodeActivation_Operation_makeLoopVariableList->setName("makeLoopVariableList"); m_loopNodeActivation_Operation_makeLoopVariableList->setEType(uml::umlPackage::eInstance()->getActivityNode_Class()); m_loopNodeActivation_Operation_makeLoopVariableList->setLowerBound(1); m_loopNodeActivation_Operation_makeLoopVariableList->setUpperBound(1); m_loopNodeActivation_Operation_makeLoopVariableList->setUnique(true); m_loopNodeActivation_Operation_makeLoopVariableList->setOrdered(false); m_loopNodeActivation_Operation_runBody->setName("runBody"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_loopNodeActivation_Operation_runBody->setEType(unknownClass); } m_loopNodeActivation_Operation_runBody->setLowerBound(1); m_loopNodeActivation_Operation_runBody->setUpperBound(1); m_loopNodeActivation_Operation_runBody->setUnique(true); m_loopNodeActivation_Operation_runBody->setOrdered(false); m_loopNodeActivation_Operation_runLoopVariables->setName("runLoopVariables"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_loopNodeActivation_Operation_runLoopVariables->setEType(unknownClass); } m_loopNodeActivation_Operation_runLoopVariables->setLowerBound(1); m_loopNodeActivation_Operation_runLoopVariables->setUpperBound(1); m_loopNodeActivation_Operation_runLoopVariables->setUnique(true); m_loopNodeActivation_Operation_runLoopVariables->setOrdered(false); m_loopNodeActivation_Operation_runTest->setName("runTest"); m_loopNodeActivation_Operation_runTest->setEType(ecore::ecorePackage::eInstance()->getEBoolean_Class()); m_loopNodeActivation_Operation_runTest->setLowerBound(1); m_loopNodeActivation_Operation_runTest->setUpperBound(1); m_loopNodeActivation_Operation_runTest->setUnique(true); m_loopNodeActivation_Operation_runTest->setOrdered(false); } void ActionsPackageImpl::initializeOutputPinActivationContent() { m_outputPinActivation_Class->setName("OutputPinActivation"); m_outputPinActivation_Class->setAbstract(false); m_outputPinActivation_Class->setInterface(false); } void ActionsPackageImpl::initializePinActivationContent() { m_pinActivation_Class->setName("PinActivation"); m_pinActivation_Class->setAbstract(true); m_pinActivation_Class->setInterface(false); m_pinActivation_Attribute_actionActivation->setName("actionActivation"); m_pinActivation_Attribute_actionActivation->setEType(getActionActivation_Class()); m_pinActivation_Attribute_actionActivation->setLowerBound(0); m_pinActivation_Attribute_actionActivation->setUpperBound(1); m_pinActivation_Attribute_actionActivation->setTransient(false); m_pinActivation_Attribute_actionActivation->setVolatile(false); m_pinActivation_Attribute_actionActivation->setChangeable(true); m_pinActivation_Attribute_actionActivation->setUnsettable(false); m_pinActivation_Attribute_actionActivation->setUnique(true); m_pinActivation_Attribute_actionActivation->setDerived(false); m_pinActivation_Attribute_actionActivation->setOrdered(false); m_pinActivation_Attribute_actionActivation->setContainment(false); m_pinActivation_Attribute_actionActivation->setResolveProxies(true); { std::string defaultValue = ""; if (!defaultValue.empty()) { m_pinActivation_Attribute_actionActivation->setDefaultValueLiteral(defaultValue); } std::shared_ptr<ecore::EReference> otherEnd = fUML::Semantics::Actions::ActionsPackage::eInstance()->getActionActivation_Attribute_pinActivation(); if (otherEnd != nullptr) { m_pinActivation_Attribute_actionActivation->setEOpposite(otherEnd); } } m_pinActivation_Attribute_pin->setName("pin"); m_pinActivation_Attribute_pin->setEType(uml::umlPackage::eInstance()->getPin_Class()); m_pinActivation_Attribute_pin->setLowerBound(1); m_pinActivation_Attribute_pin->setUpperBound(1); m_pinActivation_Attribute_pin->setTransient(false); m_pinActivation_Attribute_pin->setVolatile(false); m_pinActivation_Attribute_pin->setChangeable(true); m_pinActivation_Attribute_pin->setUnsettable(false); m_pinActivation_Attribute_pin->setUnique(true); m_pinActivation_Attribute_pin->setDerived(false); m_pinActivation_Attribute_pin->setOrdered(true); m_pinActivation_Attribute_pin->setContainment(false); m_pinActivation_Attribute_pin->setResolveProxies(true); { std::string defaultValue = ""; if (!defaultValue.empty()) { m_pinActivation_Attribute_pin->setDefaultValueLiteral(defaultValue); } //undefined otherEnd std::shared_ptr<ecore::EReference> otherEnd = nullptr; } m_pinActivation_Operation_fire_Token->setName("fire"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_pinActivation_Operation_fire_Token->setEType(unknownClass); } m_pinActivation_Operation_fire_Token->setLowerBound(1); m_pinActivation_Operation_fire_Token->setUpperBound(1); m_pinActivation_Operation_fire_Token->setUnique(true); m_pinActivation_Operation_fire_Token->setOrdered(false); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_pinActivation_Operation_fire_Token); parameter->setName("incomingTokens"); parameter->setEType(nullptr); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } m_pinActivation_Operation_takeOfferedTokens->setName("takeOfferedTokens"); m_pinActivation_Operation_takeOfferedTokens->setEType(fUML::Semantics::Activities::ActivitiesPackage::eInstance()->getToken_Class()); m_pinActivation_Operation_takeOfferedTokens->setLowerBound(0); m_pinActivation_Operation_takeOfferedTokens->setUpperBound(-1); m_pinActivation_Operation_takeOfferedTokens->setUnique(true); m_pinActivation_Operation_takeOfferedTokens->setOrdered(false); } void ActionsPackageImpl::initializeReadExtentActionActivationContent() { m_readExtentActionActivation_Class->setName("ReadExtentActionActivation"); m_readExtentActionActivation_Class->setAbstract(false); m_readExtentActionActivation_Class->setInterface(false); } void ActionsPackageImpl::initializeReadIsClassifiedObjectActionActivationContent() { m_readIsClassifiedObjectActionActivation_Class->setName("ReadIsClassifiedObjectActionActivation"); m_readIsClassifiedObjectActionActivation_Class->setAbstract(false); m_readIsClassifiedObjectActionActivation_Class->setInterface(false); m_readIsClassifiedObjectActionActivation_Operation_checkAllParents_Classifier_Classifier->setName("checkAllParents"); m_readIsClassifiedObjectActionActivation_Operation_checkAllParents_Classifier_Classifier->setEType(ecore::ecorePackage::eInstance()->getEBoolean_Class()); m_readIsClassifiedObjectActionActivation_Operation_checkAllParents_Classifier_Classifier->setLowerBound(0); m_readIsClassifiedObjectActionActivation_Operation_checkAllParents_Classifier_Classifier->setUpperBound(1); m_readIsClassifiedObjectActionActivation_Operation_checkAllParents_Classifier_Classifier->setUnique(true); m_readIsClassifiedObjectActionActivation_Operation_checkAllParents_Classifier_Classifier->setOrdered(false); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_readIsClassifiedObjectActionActivation_Operation_checkAllParents_Classifier_Classifier); parameter->setName("type"); parameter->setEType(uml::umlPackage::eInstance()->getClassifier_Class()); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_readIsClassifiedObjectActionActivation_Operation_checkAllParents_Classifier_Classifier); parameter->setName("classifier"); parameter->setEType(uml::umlPackage::eInstance()->getClassifier_Class()); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } } void ActionsPackageImpl::initializeReadLinkActionActivationContent() { m_readLinkActionActivation_Class->setName("ReadLinkActionActivation"); m_readLinkActionActivation_Class->setAbstract(false); m_readLinkActionActivation_Class->setInterface(false); } void ActionsPackageImpl::initializeReadSelfActionActivationContent() { m_readSelfActionActivation_Class->setName("ReadSelfActionActivation"); m_readSelfActionActivation_Class->setAbstract(false); m_readSelfActionActivation_Class->setInterface(false); m_readSelfActionActivation_Attribute_readSelfAction->setName("readSelfAction"); m_readSelfActionActivation_Attribute_readSelfAction->setEType(uml::umlPackage::eInstance()->getReadSelfAction_Class()); m_readSelfActionActivation_Attribute_readSelfAction->setLowerBound(1); m_readSelfActionActivation_Attribute_readSelfAction->setUpperBound(1); m_readSelfActionActivation_Attribute_readSelfAction->setTransient(false); m_readSelfActionActivation_Attribute_readSelfAction->setVolatile(false); m_readSelfActionActivation_Attribute_readSelfAction->setChangeable(true); m_readSelfActionActivation_Attribute_readSelfAction->setUnsettable(false); m_readSelfActionActivation_Attribute_readSelfAction->setUnique(true); m_readSelfActionActivation_Attribute_readSelfAction->setDerived(false); m_readSelfActionActivation_Attribute_readSelfAction->setOrdered(true); m_readSelfActionActivation_Attribute_readSelfAction->setContainment(false); m_readSelfActionActivation_Attribute_readSelfAction->setResolveProxies(true); { std::string defaultValue = ""; if (!defaultValue.empty()) { m_readSelfActionActivation_Attribute_readSelfAction->setDefaultValueLiteral(defaultValue); } //undefined otherEnd std::shared_ptr<ecore::EReference> otherEnd = nullptr; } m_readSelfActionActivation_Operation_doAction->setName("doAction"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_readSelfActionActivation_Operation_doAction->setEType(unknownClass); } m_readSelfActionActivation_Operation_doAction->setLowerBound(0); m_readSelfActionActivation_Operation_doAction->setUpperBound(1); m_readSelfActionActivation_Operation_doAction->setUnique(true); m_readSelfActionActivation_Operation_doAction->setOrdered(true); } void ActionsPackageImpl::initializeReadStructuralFeatureActionActivationContent() { m_readStructuralFeatureActionActivation_Class->setName("ReadStructuralFeatureActionActivation"); m_readStructuralFeatureActionActivation_Class->setAbstract(false); m_readStructuralFeatureActionActivation_Class->setInterface(false); m_readStructuralFeatureActionActivation_Attribute_readStructuralFeatureAction->setName("readStructuralFeatureAction"); m_readStructuralFeatureActionActivation_Attribute_readStructuralFeatureAction->setEType(uml::umlPackage::eInstance()->getReadStructuralFeatureAction_Class()); m_readStructuralFeatureActionActivation_Attribute_readStructuralFeatureAction->setLowerBound(1); m_readStructuralFeatureActionActivation_Attribute_readStructuralFeatureAction->setUpperBound(1); m_readStructuralFeatureActionActivation_Attribute_readStructuralFeatureAction->setTransient(false); m_readStructuralFeatureActionActivation_Attribute_readStructuralFeatureAction->setVolatile(false); m_readStructuralFeatureActionActivation_Attribute_readStructuralFeatureAction->setChangeable(true); m_readStructuralFeatureActionActivation_Attribute_readStructuralFeatureAction->setUnsettable(false); m_readStructuralFeatureActionActivation_Attribute_readStructuralFeatureAction->setUnique(true); m_readStructuralFeatureActionActivation_Attribute_readStructuralFeatureAction->setDerived(false); m_readStructuralFeatureActionActivation_Attribute_readStructuralFeatureAction->setOrdered(true); m_readStructuralFeatureActionActivation_Attribute_readStructuralFeatureAction->setContainment(false); m_readStructuralFeatureActionActivation_Attribute_readStructuralFeatureAction->setResolveProxies(true); { std::string defaultValue = ""; if (!defaultValue.empty()) { m_readStructuralFeatureActionActivation_Attribute_readStructuralFeatureAction->setDefaultValueLiteral(defaultValue); } //undefined otherEnd std::shared_ptr<ecore::EReference> otherEnd = nullptr; } m_readStructuralFeatureActionActivation_Operation_doAction->setName("doAction"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_readStructuralFeatureActionActivation_Operation_doAction->setEType(unknownClass); } m_readStructuralFeatureActionActivation_Operation_doAction->setLowerBound(0); m_readStructuralFeatureActionActivation_Operation_doAction->setUpperBound(1); m_readStructuralFeatureActionActivation_Operation_doAction->setUnique(true); m_readStructuralFeatureActionActivation_Operation_doAction->setOrdered(true); } void ActionsPackageImpl::initializeReclassifyObjectActionActivationContent() { m_reclassifyObjectActionActivation_Class->setName("ReclassifyObjectActionActivation"); m_reclassifyObjectActionActivation_Class->setAbstract(false); m_reclassifyObjectActionActivation_Class->setInterface(false); } void ActionsPackageImpl::initializeReduceActionActivationContent() { m_reduceActionActivation_Class->setName("ReduceActionActivation"); m_reduceActionActivation_Class->setAbstract(false); m_reduceActionActivation_Class->setInterface(false); m_reduceActionActivation_Attribute_currentExecution->setName("currentExecution"); m_reduceActionActivation_Attribute_currentExecution->setEType(fUML::Semantics::CommonBehavior::CommonBehaviorPackage::eInstance()->getExecution_Class()); m_reduceActionActivation_Attribute_currentExecution->setLowerBound(0); m_reduceActionActivation_Attribute_currentExecution->setUpperBound(1); m_reduceActionActivation_Attribute_currentExecution->setTransient(false); m_reduceActionActivation_Attribute_currentExecution->setVolatile(false); m_reduceActionActivation_Attribute_currentExecution->setChangeable(true); m_reduceActionActivation_Attribute_currentExecution->setUnsettable(false); m_reduceActionActivation_Attribute_currentExecution->setUnique(true); m_reduceActionActivation_Attribute_currentExecution->setDerived(false); m_reduceActionActivation_Attribute_currentExecution->setOrdered(false); m_reduceActionActivation_Attribute_currentExecution->setContainment(false); m_reduceActionActivation_Attribute_currentExecution->setResolveProxies(true); { std::string defaultValue = ""; if (!defaultValue.empty()) { m_reduceActionActivation_Attribute_currentExecution->setDefaultValueLiteral(defaultValue); } //undefined otherEnd std::shared_ptr<ecore::EReference> otherEnd = nullptr; } } void ActionsPackageImpl::initializeRemoveStructuralFeatureValueActivationContent() { m_removeStructuralFeatureValueActivation_Class->setName("RemoveStructuralFeatureValueActivation"); m_removeStructuralFeatureValueActivation_Class->setAbstract(false); m_removeStructuralFeatureValueActivation_Class->setInterface(false); m_removeStructuralFeatureValueActivation_Attribute_removeStructuralFeatureValueAction->setName("removeStructuralFeatureValueAction"); m_removeStructuralFeatureValueActivation_Attribute_removeStructuralFeatureValueAction->setEType(uml::umlPackage::eInstance()->getRemoveStructuralFeatureValueAction_Class()); m_removeStructuralFeatureValueActivation_Attribute_removeStructuralFeatureValueAction->setLowerBound(1); m_removeStructuralFeatureValueActivation_Attribute_removeStructuralFeatureValueAction->setUpperBound(1); m_removeStructuralFeatureValueActivation_Attribute_removeStructuralFeatureValueAction->setTransient(false); m_removeStructuralFeatureValueActivation_Attribute_removeStructuralFeatureValueAction->setVolatile(false); m_removeStructuralFeatureValueActivation_Attribute_removeStructuralFeatureValueAction->setChangeable(true); m_removeStructuralFeatureValueActivation_Attribute_removeStructuralFeatureValueAction->setUnsettable(false); m_removeStructuralFeatureValueActivation_Attribute_removeStructuralFeatureValueAction->setUnique(true); m_removeStructuralFeatureValueActivation_Attribute_removeStructuralFeatureValueAction->setDerived(false); m_removeStructuralFeatureValueActivation_Attribute_removeStructuralFeatureValueAction->setOrdered(true); m_removeStructuralFeatureValueActivation_Attribute_removeStructuralFeatureValueAction->setContainment(false); m_removeStructuralFeatureValueActivation_Attribute_removeStructuralFeatureValueAction->setResolveProxies(true); { std::string defaultValue = ""; if (!defaultValue.empty()) { m_removeStructuralFeatureValueActivation_Attribute_removeStructuralFeatureValueAction->setDefaultValueLiteral(defaultValue); } //undefined otherEnd std::shared_ptr<ecore::EReference> otherEnd = nullptr; } m_removeStructuralFeatureValueActivation_Operation_doAction->setName("doAction"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_removeStructuralFeatureValueActivation_Operation_doAction->setEType(unknownClass); } m_removeStructuralFeatureValueActivation_Operation_doAction->setLowerBound(0); m_removeStructuralFeatureValueActivation_Operation_doAction->setUpperBound(1); m_removeStructuralFeatureValueActivation_Operation_doAction->setUnique(true); m_removeStructuralFeatureValueActivation_Operation_doAction->setOrdered(true); } void ActionsPackageImpl::initializeReplyActionActivationContent() { m_replyActionActivation_Class->setName("ReplyActionActivation"); m_replyActionActivation_Class->setAbstract(false); m_replyActionActivation_Class->setInterface(false); m_replyActionActivation_Operation_doAction->setName("doAction"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_replyActionActivation_Operation_doAction->setEType(unknownClass); } m_replyActionActivation_Operation_doAction->setLowerBound(0); m_replyActionActivation_Operation_doAction->setUpperBound(1); m_replyActionActivation_Operation_doAction->setUnique(true); m_replyActionActivation_Operation_doAction->setOrdered(true); } void ActionsPackageImpl::initializeReturnInformationContent() { m_returnInformation_Class->setName("ReturnInformation"); m_returnInformation_Class->setAbstract(false); m_returnInformation_Class->setInterface(false); m_returnInformation_Attribute_callEventOccurrence->setName("callEventOccurrence"); m_returnInformation_Attribute_callEventOccurrence->setEType(fUML::Semantics::CommonBehavior::CommonBehaviorPackage::eInstance()->getCallEventOccurrence_Class()); m_returnInformation_Attribute_callEventOccurrence->setLowerBound(1); m_returnInformation_Attribute_callEventOccurrence->setUpperBound(1); m_returnInformation_Attribute_callEventOccurrence->setTransient(false); m_returnInformation_Attribute_callEventOccurrence->setVolatile(false); m_returnInformation_Attribute_callEventOccurrence->setChangeable(true); m_returnInformation_Attribute_callEventOccurrence->setUnsettable(false); m_returnInformation_Attribute_callEventOccurrence->setUnique(true); m_returnInformation_Attribute_callEventOccurrence->setDerived(false); m_returnInformation_Attribute_callEventOccurrence->setOrdered(true); m_returnInformation_Attribute_callEventOccurrence->setContainment(false); m_returnInformation_Attribute_callEventOccurrence->setResolveProxies(true); { std::string defaultValue = ""; if (!defaultValue.empty()) { m_returnInformation_Attribute_callEventOccurrence->setDefaultValueLiteral(defaultValue); } //undefined otherEnd std::shared_ptr<ecore::EReference> otherEnd = nullptr; } m_returnInformation_Operation__copy->setName("_copy"); m_returnInformation_Operation__copy->setEType(fUML::Semantics::Values::ValuesPackage::eInstance()->getValue_Class()); m_returnInformation_Operation__copy->setLowerBound(1); m_returnInformation_Operation__copy->setUpperBound(1); m_returnInformation_Operation__copy->setUnique(true); m_returnInformation_Operation__copy->setOrdered(true); m_returnInformation_Operation_equals_Value->setName("equals"); m_returnInformation_Operation_equals_Value->setEType(ecore::ecorePackage::eInstance()->getEBoolean_Class()); m_returnInformation_Operation_equals_Value->setLowerBound(1); m_returnInformation_Operation_equals_Value->setUpperBound(1); m_returnInformation_Operation_equals_Value->setUnique(true); m_returnInformation_Operation_equals_Value->setOrdered(true); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_returnInformation_Operation_equals_Value); parameter->setName("otherValue"); parameter->setEType(fUML::Semantics::Values::ValuesPackage::eInstance()->getValue_Class()); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } m_returnInformation_Operation_getOperation->setName("getOperation"); m_returnInformation_Operation_getOperation->setEType(uml::umlPackage::eInstance()->getOperation_Class()); m_returnInformation_Operation_getOperation->setLowerBound(1); m_returnInformation_Operation_getOperation->setUpperBound(1); m_returnInformation_Operation_getOperation->setUnique(true); m_returnInformation_Operation_getOperation->setOrdered(true); m_returnInformation_Operation_getTypes->setName("getTypes"); m_returnInformation_Operation_getTypes->setEType(uml::umlPackage::eInstance()->getClassifier_Class()); m_returnInformation_Operation_getTypes->setLowerBound(0); m_returnInformation_Operation_getTypes->setUpperBound(-1); m_returnInformation_Operation_getTypes->setUnique(true); m_returnInformation_Operation_getTypes->setOrdered(true); m_returnInformation_Operation_new_->setName("new_"); m_returnInformation_Operation_new_->setEType(fUML::Semantics::Values::ValuesPackage::eInstance()->getValue_Class()); m_returnInformation_Operation_new_->setLowerBound(1); m_returnInformation_Operation_new_->setUpperBound(1); m_returnInformation_Operation_new_->setUnique(true); m_returnInformation_Operation_new_->setOrdered(true); m_returnInformation_Operation_reply_ParameterValue->setName("reply"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_returnInformation_Operation_reply_ParameterValue->setEType(unknownClass); } m_returnInformation_Operation_reply_ParameterValue->setLowerBound(0); m_returnInformation_Operation_reply_ParameterValue->setUpperBound(1); m_returnInformation_Operation_reply_ParameterValue->setUnique(true); m_returnInformation_Operation_reply_ParameterValue->setOrdered(true); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_returnInformation_Operation_reply_ParameterValue); parameter->setName("outputParameterValues"); parameter->setEType(nullptr); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } m_returnInformation_Operation_specify->setName("specify"); m_returnInformation_Operation_specify->setEType(uml::umlPackage::eInstance()->getValueSpecification_Class()); m_returnInformation_Operation_specify->setLowerBound(1); m_returnInformation_Operation_specify->setUpperBound(1); m_returnInformation_Operation_specify->setUnique(true); m_returnInformation_Operation_specify->setOrdered(true); m_returnInformation_Operation_toString->setName("toString"); m_returnInformation_Operation_toString->setEType(ecore::ecorePackage::eInstance()->getEString_Class()); m_returnInformation_Operation_toString->setLowerBound(1); m_returnInformation_Operation_toString->setUpperBound(1); m_returnInformation_Operation_toString->setUnique(true); m_returnInformation_Operation_toString->setOrdered(true); } void ActionsPackageImpl::initializeSendSignalActionActivationContent() { m_sendSignalActionActivation_Class->setName("SendSignalActionActivation"); m_sendSignalActionActivation_Class->setAbstract(false); m_sendSignalActionActivation_Class->setInterface(false); m_sendSignalActionActivation_Operation_doAction->setName("doAction"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_sendSignalActionActivation_Operation_doAction->setEType(unknownClass); } m_sendSignalActionActivation_Operation_doAction->setLowerBound(1); m_sendSignalActionActivation_Operation_doAction->setUpperBound(1); m_sendSignalActionActivation_Operation_doAction->setUnique(true); m_sendSignalActionActivation_Operation_doAction->setOrdered(false); } void ActionsPackageImpl::initializeStartClassifierBehaviorActionActivationContent() { m_startClassifierBehaviorActionActivation_Class->setName("StartClassifierBehaviorActionActivation"); m_startClassifierBehaviorActionActivation_Class->setAbstract(false); m_startClassifierBehaviorActionActivation_Class->setInterface(false); m_startClassifierBehaviorActionActivation_Operation_doAction->setName("doAction"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_startClassifierBehaviorActionActivation_Operation_doAction->setEType(unknownClass); } m_startClassifierBehaviorActionActivation_Operation_doAction->setLowerBound(0); m_startClassifierBehaviorActionActivation_Operation_doAction->setUpperBound(1); m_startClassifierBehaviorActionActivation_Operation_doAction->setUnique(true); m_startClassifierBehaviorActionActivation_Operation_doAction->setOrdered(true); } void ActionsPackageImpl::initializeStartObjectBehaviorActionActivationContent() { m_startObjectBehaviorActionActivation_Class->setName("StartObjectBehaviorActionActivation"); m_startObjectBehaviorActionActivation_Class->setAbstract(false); m_startObjectBehaviorActionActivation_Class->setInterface(false); m_startObjectBehaviorActionActivation_Operation_doAction->setName("doAction"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_startObjectBehaviorActionActivation_Operation_doAction->setEType(unknownClass); } m_startObjectBehaviorActionActivation_Operation_doAction->setLowerBound(0); m_startObjectBehaviorActionActivation_Operation_doAction->setUpperBound(1); m_startObjectBehaviorActionActivation_Operation_doAction->setUnique(true); m_startObjectBehaviorActionActivation_Operation_doAction->setOrdered(true); } void ActionsPackageImpl::initializeStructuralFeatureActionActivationContent() { m_structuralFeatureActionActivation_Class->setName("StructuralFeatureActionActivation"); m_structuralFeatureActionActivation_Class->setAbstract(true); m_structuralFeatureActionActivation_Class->setInterface(false); m_structuralFeatureActionActivation_Operation_getAssociation_StructuralFeature->setName("getAssociation"); m_structuralFeatureActionActivation_Operation_getAssociation_StructuralFeature->setEType(uml::umlPackage::eInstance()->getAssociation_Class()); m_structuralFeatureActionActivation_Operation_getAssociation_StructuralFeature->setLowerBound(0); m_structuralFeatureActionActivation_Operation_getAssociation_StructuralFeature->setUpperBound(1); m_structuralFeatureActionActivation_Operation_getAssociation_StructuralFeature->setUnique(true); m_structuralFeatureActionActivation_Operation_getAssociation_StructuralFeature->setOrdered(false); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_structuralFeatureActionActivation_Operation_getAssociation_StructuralFeature); parameter->setName("feature"); parameter->setEType(uml::umlPackage::eInstance()->getStructuralFeature_Class()); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } m_structuralFeatureActionActivation_Operation_getMatchingLinks_Association_Value->setName("getMatchingLinks"); m_structuralFeatureActionActivation_Operation_getMatchingLinks_Association_Value->setEType(fUML::Semantics::StructuredClassifiers::StructuredClassifiersPackage::eInstance()->getLink_Class()); m_structuralFeatureActionActivation_Operation_getMatchingLinks_Association_Value->setLowerBound(0); m_structuralFeatureActionActivation_Operation_getMatchingLinks_Association_Value->setUpperBound(-1); m_structuralFeatureActionActivation_Operation_getMatchingLinks_Association_Value->setUnique(true); m_structuralFeatureActionActivation_Operation_getMatchingLinks_Association_Value->setOrdered(false); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_structuralFeatureActionActivation_Operation_getMatchingLinks_Association_Value); parameter->setName("association"); parameter->setEType(uml::umlPackage::eInstance()->getAssociation_Class()); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_structuralFeatureActionActivation_Operation_getMatchingLinks_Association_Value); parameter->setName("end"); parameter->setEType(uml::umlPackage::eInstance()->getStructuralFeature_Class()); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_structuralFeatureActionActivation_Operation_getMatchingLinks_Association_Value); parameter->setName("oppositeValue"); parameter->setEType(fUML::Semantics::Values::ValuesPackage::eInstance()->getValue_Class()); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } m_structuralFeatureActionActivation_Operation_getMatchingLinksForEndValue_Association_Value->setName("getMatchingLinksForEndValue"); m_structuralFeatureActionActivation_Operation_getMatchingLinksForEndValue_Association_Value->setEType(fUML::Semantics::StructuredClassifiers::StructuredClassifiersPackage::eInstance()->getLink_Class()); m_structuralFeatureActionActivation_Operation_getMatchingLinksForEndValue_Association_Value->setLowerBound(0); m_structuralFeatureActionActivation_Operation_getMatchingLinksForEndValue_Association_Value->setUpperBound(-1); m_structuralFeatureActionActivation_Operation_getMatchingLinksForEndValue_Association_Value->setUnique(true); m_structuralFeatureActionActivation_Operation_getMatchingLinksForEndValue_Association_Value->setOrdered(true); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_structuralFeatureActionActivation_Operation_getMatchingLinksForEndValue_Association_Value); parameter->setName("association"); parameter->setEType(uml::umlPackage::eInstance()->getAssociation_Class()); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_structuralFeatureActionActivation_Operation_getMatchingLinksForEndValue_Association_Value); parameter->setName("end"); parameter->setEType(uml::umlPackage::eInstance()->getStructuralFeature_Class()); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_structuralFeatureActionActivation_Operation_getMatchingLinksForEndValue_Association_Value); parameter->setName("oppositeValue"); parameter->setEType(fUML::Semantics::Values::ValuesPackage::eInstance()->getValue_Class()); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_structuralFeatureActionActivation_Operation_getMatchingLinksForEndValue_Association_Value); parameter->setName("endValue"); parameter->setEType(fUML::Semantics::Values::ValuesPackage::eInstance()->getValue_Class()); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } m_structuralFeatureActionActivation_Operation_getOppositeEnd_Association_StructuralFeature->setName("getOppositeEnd"); m_structuralFeatureActionActivation_Operation_getOppositeEnd_Association_StructuralFeature->setEType(uml::umlPackage::eInstance()->getProperty_Class()); m_structuralFeatureActionActivation_Operation_getOppositeEnd_Association_StructuralFeature->setLowerBound(1); m_structuralFeatureActionActivation_Operation_getOppositeEnd_Association_StructuralFeature->setUpperBound(1); m_structuralFeatureActionActivation_Operation_getOppositeEnd_Association_StructuralFeature->setUnique(true); m_structuralFeatureActionActivation_Operation_getOppositeEnd_Association_StructuralFeature->setOrdered(false); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_structuralFeatureActionActivation_Operation_getOppositeEnd_Association_StructuralFeature); parameter->setName("association"); parameter->setEType(uml::umlPackage::eInstance()->getAssociation_Class()); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_structuralFeatureActionActivation_Operation_getOppositeEnd_Association_StructuralFeature); parameter->setName("end"); parameter->setEType(uml::umlPackage::eInstance()->getStructuralFeature_Class()); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } } void ActionsPackageImpl::initializeStructuredActivityNodeActivationContent() { m_structuredActivityNodeActivation_Class->setName("StructuredActivityNodeActivation"); m_structuredActivityNodeActivation_Class->setAbstract(false); m_structuredActivityNodeActivation_Class->setInterface(false); m_structuredActivityNodeActivation_Attribute_activationGroup->setName("activationGroup"); m_structuredActivityNodeActivation_Attribute_activationGroup->setEType(fUML::Semantics::Activities::ActivitiesPackage::eInstance()->getActivityNodeActivationGroup_Class()); m_structuredActivityNodeActivation_Attribute_activationGroup->setLowerBound(1); m_structuredActivityNodeActivation_Attribute_activationGroup->setUpperBound(1); m_structuredActivityNodeActivation_Attribute_activationGroup->setTransient(false); m_structuredActivityNodeActivation_Attribute_activationGroup->setVolatile(false); m_structuredActivityNodeActivation_Attribute_activationGroup->setChangeable(true); m_structuredActivityNodeActivation_Attribute_activationGroup->setUnsettable(false); m_structuredActivityNodeActivation_Attribute_activationGroup->setUnique(true); m_structuredActivityNodeActivation_Attribute_activationGroup->setDerived(false); m_structuredActivityNodeActivation_Attribute_activationGroup->setOrdered(false); m_structuredActivityNodeActivation_Attribute_activationGroup->setContainment(true); m_structuredActivityNodeActivation_Attribute_activationGroup->setResolveProxies(true); { std::string defaultValue = ""; if (!defaultValue.empty()) { m_structuredActivityNodeActivation_Attribute_activationGroup->setDefaultValueLiteral(defaultValue); } std::shared_ptr<ecore::EReference> otherEnd = fUML::Semantics::Activities::ActivitiesPackage::eInstance()->getActivityNodeActivationGroup_Attribute_containingNodeActivation(); if (otherEnd != nullptr) { m_structuredActivityNodeActivation_Attribute_activationGroup->setEOpposite(otherEnd); } } m_structuredActivityNodeActivation_Operation_completeAction->setName("completeAction"); m_structuredActivityNodeActivation_Operation_completeAction->setEType(fUML::Semantics::Activities::ActivitiesPackage::eInstance()->getToken_Class()); m_structuredActivityNodeActivation_Operation_completeAction->setLowerBound(0); m_structuredActivityNodeActivation_Operation_completeAction->setUpperBound(-1); m_structuredActivityNodeActivation_Operation_completeAction->setUnique(true); m_structuredActivityNodeActivation_Operation_completeAction->setOrdered(false); m_structuredActivityNodeActivation_Operation_createEdgeInstances->setName("createEdgeInstances"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_structuredActivityNodeActivation_Operation_createEdgeInstances->setEType(unknownClass); } m_structuredActivityNodeActivation_Operation_createEdgeInstances->setLowerBound(1); m_structuredActivityNodeActivation_Operation_createEdgeInstances->setUpperBound(1); m_structuredActivityNodeActivation_Operation_createEdgeInstances->setUnique(true); m_structuredActivityNodeActivation_Operation_createEdgeInstances->setOrdered(false); m_structuredActivityNodeActivation_Operation_createNodeActivations->setName("createNodeActivations"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_structuredActivityNodeActivation_Operation_createNodeActivations->setEType(unknownClass); } m_structuredActivityNodeActivation_Operation_createNodeActivations->setLowerBound(1); m_structuredActivityNodeActivation_Operation_createNodeActivations->setUpperBound(1); m_structuredActivityNodeActivation_Operation_createNodeActivations->setUnique(true); m_structuredActivityNodeActivation_Operation_createNodeActivations->setOrdered(false); m_structuredActivityNodeActivation_Operation_doAction->setName("doAction"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_structuredActivityNodeActivation_Operation_doAction->setEType(unknownClass); } m_structuredActivityNodeActivation_Operation_doAction->setLowerBound(1); m_structuredActivityNodeActivation_Operation_doAction->setUpperBound(1); m_structuredActivityNodeActivation_Operation_doAction->setUnique(true); m_structuredActivityNodeActivation_Operation_doAction->setOrdered(false); m_structuredActivityNodeActivation_Operation_doStructuredActivity->setName("doStructuredActivity"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_structuredActivityNodeActivation_Operation_doStructuredActivity->setEType(unknownClass); } m_structuredActivityNodeActivation_Operation_doStructuredActivity->setLowerBound(0); m_structuredActivityNodeActivation_Operation_doStructuredActivity->setUpperBound(1); m_structuredActivityNodeActivation_Operation_doStructuredActivity->setUnique(true); m_structuredActivityNodeActivation_Operation_doStructuredActivity->setOrdered(false); m_structuredActivityNodeActivation_Operation_getNodeActivation_ActivityNode->setName("getNodeActivation"); m_structuredActivityNodeActivation_Operation_getNodeActivation_ActivityNode->setEType(fUML::Semantics::Activities::ActivitiesPackage::eInstance()->getActivityNodeActivation_Class()); m_structuredActivityNodeActivation_Operation_getNodeActivation_ActivityNode->setLowerBound(1); m_structuredActivityNodeActivation_Operation_getNodeActivation_ActivityNode->setUpperBound(1); m_structuredActivityNodeActivation_Operation_getNodeActivation_ActivityNode->setUnique(true); m_structuredActivityNodeActivation_Operation_getNodeActivation_ActivityNode->setOrdered(false); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_structuredActivityNodeActivation_Operation_getNodeActivation_ActivityNode); parameter->setName("node"); parameter->setEType(uml::umlPackage::eInstance()->getActivityNode_Class()); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } m_structuredActivityNodeActivation_Operation_getPinValues_OutputPin->setName("getPinValues"); m_structuredActivityNodeActivation_Operation_getPinValues_OutputPin->setEType(fUML::Semantics::Values::ValuesPackage::eInstance()->getValue_Class()); m_structuredActivityNodeActivation_Operation_getPinValues_OutputPin->setLowerBound(0); m_structuredActivityNodeActivation_Operation_getPinValues_OutputPin->setUpperBound(-1); m_structuredActivityNodeActivation_Operation_getPinValues_OutputPin->setUnique(true); m_structuredActivityNodeActivation_Operation_getPinValues_OutputPin->setOrdered(false); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_structuredActivityNodeActivation_Operation_getPinValues_OutputPin); parameter->setName("pin"); parameter->setEType(uml::umlPackage::eInstance()->getOutputPin_Class()); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } m_structuredActivityNodeActivation_Operation_isSourceFor_ActivityEdgeInstance->setName("isSourceFor"); m_structuredActivityNodeActivation_Operation_isSourceFor_ActivityEdgeInstance->setEType(ecore::ecorePackage::eInstance()->getEBoolean_Class()); m_structuredActivityNodeActivation_Operation_isSourceFor_ActivityEdgeInstance->setLowerBound(1); m_structuredActivityNodeActivation_Operation_isSourceFor_ActivityEdgeInstance->setUpperBound(1); m_structuredActivityNodeActivation_Operation_isSourceFor_ActivityEdgeInstance->setUnique(true); m_structuredActivityNodeActivation_Operation_isSourceFor_ActivityEdgeInstance->setOrdered(false); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_structuredActivityNodeActivation_Operation_isSourceFor_ActivityEdgeInstance); parameter->setName("edgeInstance"); parameter->setEType(fUML::Semantics::Activities::ActivitiesPackage::eInstance()->getActivityEdgeInstance_Class()); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } m_structuredActivityNodeActivation_Operation_isSuspended->setName("isSuspended"); m_structuredActivityNodeActivation_Operation_isSuspended->setEType(ecore::ecorePackage::eInstance()->getEBoolean_Class()); m_structuredActivityNodeActivation_Operation_isSuspended->setLowerBound(1); m_structuredActivityNodeActivation_Operation_isSuspended->setUpperBound(1); m_structuredActivityNodeActivation_Operation_isSuspended->setUnique(true); m_structuredActivityNodeActivation_Operation_isSuspended->setOrdered(false); m_structuredActivityNodeActivation_Operation_makeActivityNodeList_ExecutableNode->setName("makeActivityNodeList"); m_structuredActivityNodeActivation_Operation_makeActivityNodeList_ExecutableNode->setEType(uml::umlPackage::eInstance()->getActivityNode_Class()); m_structuredActivityNodeActivation_Operation_makeActivityNodeList_ExecutableNode->setLowerBound(0); m_structuredActivityNodeActivation_Operation_makeActivityNodeList_ExecutableNode->setUpperBound(-1); m_structuredActivityNodeActivation_Operation_makeActivityNodeList_ExecutableNode->setUnique(true); m_structuredActivityNodeActivation_Operation_makeActivityNodeList_ExecutableNode->setOrdered(false); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_structuredActivityNodeActivation_Operation_makeActivityNodeList_ExecutableNode); parameter->setName("nodes"); parameter->setEType(uml::umlPackage::eInstance()->getExecutableNode_Class()); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } m_structuredActivityNodeActivation_Operation_putPinValues_OutputPin_Value->setName("putPinValues"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_structuredActivityNodeActivation_Operation_putPinValues_OutputPin_Value->setEType(unknownClass); } m_structuredActivityNodeActivation_Operation_putPinValues_OutputPin_Value->setLowerBound(1); m_structuredActivityNodeActivation_Operation_putPinValues_OutputPin_Value->setUpperBound(1); m_structuredActivityNodeActivation_Operation_putPinValues_OutputPin_Value->setUnique(true); m_structuredActivityNodeActivation_Operation_putPinValues_OutputPin_Value->setOrdered(false); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_structuredActivityNodeActivation_Operation_putPinValues_OutputPin_Value); parameter->setName("pin"); parameter->setEType(nullptr); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_structuredActivityNodeActivation_Operation_putPinValues_OutputPin_Value); parameter->setName("values"); parameter->setEType(nullptr); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } m_structuredActivityNodeActivation_Operation_resume->setName("resume"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_structuredActivityNodeActivation_Operation_resume->setEType(unknownClass); } m_structuredActivityNodeActivation_Operation_resume->setLowerBound(1); m_structuredActivityNodeActivation_Operation_resume->setUpperBound(1); m_structuredActivityNodeActivation_Operation_resume->setUnique(true); m_structuredActivityNodeActivation_Operation_resume->setOrdered(false); m_structuredActivityNodeActivation_Operation_terminate->setName("terminate"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_structuredActivityNodeActivation_Operation_terminate->setEType(unknownClass); } m_structuredActivityNodeActivation_Operation_terminate->setLowerBound(1); m_structuredActivityNodeActivation_Operation_terminate->setUpperBound(1); m_structuredActivityNodeActivation_Operation_terminate->setUnique(true); m_structuredActivityNodeActivation_Operation_terminate->setOrdered(false); m_structuredActivityNodeActivation_Operation_terminateAll->setName("terminateAll"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_structuredActivityNodeActivation_Operation_terminateAll->setEType(unknownClass); } m_structuredActivityNodeActivation_Operation_terminateAll->setLowerBound(1); m_structuredActivityNodeActivation_Operation_terminateAll->setUpperBound(1); m_structuredActivityNodeActivation_Operation_terminateAll->setUnique(true); m_structuredActivityNodeActivation_Operation_terminateAll->setOrdered(false); } void ActionsPackageImpl::initializeTestIdentityActionActivationContent() { m_testIdentityActionActivation_Class->setName("TestIdentityActionActivation"); m_testIdentityActionActivation_Class->setAbstract(false); m_testIdentityActionActivation_Class->setInterface(false); } void ActionsPackageImpl::initializeValueSpecificationActionActivationContent() { m_valueSpecificationActionActivation_Class->setName("ValueSpecificationActionActivation"); m_valueSpecificationActionActivation_Class->setAbstract(false); m_valueSpecificationActionActivation_Class->setInterface(false); m_valueSpecificationActionActivation_Operation_doAction->setName("doAction"); { std::shared_ptr<ecore::ecoreFactory> factory = ecore::ecoreFactory::eInstance(); std::shared_ptr<ecore::EClass> unknownClass = factory ->createEClass(-1); unknownClass->setName("invalid"); unknownClass->setAbstract(true); unknownClass->setInterface(true); m_valueSpecificationActionActivation_Operation_doAction->setEType(unknownClass); } m_valueSpecificationActionActivation_Operation_doAction->setLowerBound(0); m_valueSpecificationActionActivation_Operation_doAction->setUpperBound(1); m_valueSpecificationActionActivation_Operation_doAction->setUnique(true); m_valueSpecificationActionActivation_Operation_doAction->setOrdered(true); } void ActionsPackageImpl::initializeValuesContent() { m_values_Class->setName("Values"); m_values_Class->setAbstract(false); m_values_Class->setInterface(false); m_values_Attribute_values->setName("values"); m_values_Attribute_values->setEType(fUML::Semantics::Values::ValuesPackage::eInstance()->getValue_Class()); m_values_Attribute_values->setLowerBound(0); m_values_Attribute_values->setUpperBound(-1); m_values_Attribute_values->setTransient(false); m_values_Attribute_values->setVolatile(false); m_values_Attribute_values->setChangeable(true); m_values_Attribute_values->setUnsettable(false); m_values_Attribute_values->setUnique(true); m_values_Attribute_values->setDerived(false); m_values_Attribute_values->setOrdered(false); m_values_Attribute_values->setContainment(false); m_values_Attribute_values->setResolveProxies(true); { std::string defaultValue = ""; if (!defaultValue.empty()) { m_values_Attribute_values->setDefaultValueLiteral(defaultValue); } //undefined otherEnd std::shared_ptr<ecore::EReference> otherEnd = nullptr; } } void ActionsPackageImpl::initializeWriteLinkActionActivationContent() { m_writeLinkActionActivation_Class->setName("WriteLinkActionActivation"); m_writeLinkActionActivation_Class->setAbstract(true); m_writeLinkActionActivation_Class->setInterface(false); } void ActionsPackageImpl::initializeWriteStructuralFeatureActionActivationContent() { m_writeStructuralFeatureActionActivation_Class->setName("WriteStructuralFeatureActionActivation"); m_writeStructuralFeatureActionActivation_Class->setAbstract(true); m_writeStructuralFeatureActionActivation_Class->setInterface(false); m_writeStructuralFeatureActionActivation_Operation_position_Value_EInt->setName("position"); m_writeStructuralFeatureActionActivation_Operation_position_Value_EInt->setEType(ecore::ecorePackage::eInstance()->getEInt_Class()); m_writeStructuralFeatureActionActivation_Operation_position_Value_EInt->setLowerBound(1); m_writeStructuralFeatureActionActivation_Operation_position_Value_EInt->setUpperBound(1); m_writeStructuralFeatureActionActivation_Operation_position_Value_EInt->setUnique(true); m_writeStructuralFeatureActionActivation_Operation_position_Value_EInt->setOrdered(false); { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_writeStructuralFeatureActionActivation_Operation_position_Value_EInt); parameter->setName("value"); parameter->setEType(fUML::Semantics::Values::ValuesPackage::eInstance()->getValue_Class()); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_writeStructuralFeatureActionActivation_Operation_position_Value_EInt); parameter->setName("list"); parameter->setEType(fUML::Semantics::Values::ValuesPackage::eInstance()->getValue_Class()); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } { std::shared_ptr<ecore::EParameter> parameter = ecore::ecoreFactory::eInstance()->createEParameter_as_eParameters_in_EOperation(m_writeStructuralFeatureActionActivation_Operation_position_Value_EInt); parameter->setName("startAt"); parameter->setEType(ecore::ecorePackage::eInstance()->getEInt_Class()); parameter->setLowerBound(0); parameter->setUpperBound(1); parameter->setUnique(true); parameter->setOrdered(true); } } void ActionsPackageImpl::initializePackageEDataTypes() { }
473b6684e11dc816efcfa6d03a6b7a9c4f957266
5722258ec3ce781cd5ec13e125d71064a67c41d4
/java/util/function/IntPredicateProxy.cpp
346a3a1c1b7f2fff20f7f24c0f582307578db2a6
[]
no_license
ISTE-SQA/HamsterJNIPP
7312ef3e37c157b8656aa10f122cbdb510d53c2f
b29096d0baa9d93ec0aa21391b5a11b154928940
refs/heads/master
2022-03-19T11:27:03.765328
2019-10-24T15:06:26
2019-10-24T15:06:26
216,854,309
1
0
null
null
null
null
UTF-8
C++
false
false
2,718
cpp
IntPredicateProxy.cpp
#include "net/sourceforge/jnipp/JNIEnvHelper.h" #include "IntPredicateProxy.h" // includes for parameter and return type proxy classes using namespace net::sourceforge::jnipp; using namespace java::util::function; std::string IntPredicateProxy::className = "java/util/function/IntPredicate"; jclass IntPredicateProxy::objectClass = NULL; jclass IntPredicateProxy::_getObjectClass() { if ( objectClass == NULL ) objectClass = static_cast<jclass>( JNIEnvHelper::NewGlobalRef( JNIEnvHelper::FindClass( className.c_str() ) ) ); return objectClass; } IntPredicateProxy::IntPredicateProxy(void* unused) { } jobject IntPredicateProxy::_getPeerObject() const { return peerObject; } jclass IntPredicateProxy::getObjectClass() { return _getObjectClass(); } IntPredicateProxy::operator jobject() { return _getPeerObject(); } // constructors IntPredicateProxy::IntPredicateProxy(jobject obj) { peerObject = JNIEnvHelper::NewGlobalRef( obj ); } IntPredicateProxy::~IntPredicateProxy() { JNIEnvHelper::DeleteGlobalRef( peerObject ); } IntPredicateProxy& IntPredicateProxy::operator=(const IntPredicateProxy& rhs) { JNIEnvHelper::DeleteGlobalRef( peerObject ); peerObject = JNIEnvHelper::NewGlobalRef( rhs.peerObject ); return *this; } // methods jboolean IntPredicateProxy::test(jint p0) { static jmethodID mid = NULL; if ( mid == NULL ) mid = JNIEnvHelper::GetMethodID( _getObjectClass(), "test", "(I)Z" ); return JNIEnvHelper::CallBooleanMethod( _getPeerObject(), mid, p0 ); } ::java::util::function::IntPredicateProxy IntPredicateProxy::_and(::java::util::function::IntPredicateProxy p0) { static jmethodID mid = NULL; if ( mid == NULL ) mid = JNIEnvHelper::GetMethodID( _getObjectClass(), "and", "(Ljava/util/function/IntPredicate;)Ljava/util/function/IntPredicate;" ); return ::java::util::function::IntPredicateProxy( JNIEnvHelper::CallObjectMethod( _getPeerObject(), mid, static_cast<jobject>( p0 ) ) ); } ::java::util::function::IntPredicateProxy IntPredicateProxy::negate() { static jmethodID mid = NULL; if ( mid == NULL ) mid = JNIEnvHelper::GetMethodID( _getObjectClass(), "negate", "()Ljava/util/function/IntPredicate;" ); return ::java::util::function::IntPredicateProxy( JNIEnvHelper::CallObjectMethod( _getPeerObject(), mid ) ); } ::java::util::function::IntPredicateProxy IntPredicateProxy::_or(::java::util::function::IntPredicateProxy p0) { static jmethodID mid = NULL; if ( mid == NULL ) mid = JNIEnvHelper::GetMethodID( _getObjectClass(), "or", "(Ljava/util/function/IntPredicate;)Ljava/util/function/IntPredicate;" ); return ::java::util::function::IntPredicateProxy( JNIEnvHelper::CallObjectMethod( _getPeerObject(), mid, static_cast<jobject>( p0 ) ) ); }
a1fdf73536ba63e63920203f0bff7d6c19fe7d56
986c21d401983789d9b3e5255bcf9d76070f65ec
/src/plugins/lmp/plugins/brainslugz/checktab.cpp
de92605395e575980167db3c2ed6a83f224e4997
[ "BSL-1.0" ]
permissive
0xd34df00d/leechcraft
613454669be3a0cecddd11504950372c8614c4c8
15c091d15262abb0a011db03a98322248b96b46f
refs/heads/master
2023-07-21T05:08:21.348281
2023-06-04T16:50:17
2023-06-04T16:50:17
119,854
149
71
null
2017-09-03T14:16:15
2009-02-02T13:52:45
C++
UTF-8
C++
false
false
5,008
cpp
checktab.cpp
/********************************************************************** * LeechCraft - modular cross-platform feature rich internet client. * Copyright (C) 2006-2014 Georg Rudoy * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt) **********************************************************************/ #include "checktab.h" #include <QStandardItemModel> #include <QToolBar> #include <QQuickWidget> #include <QQmlContext> #include <QQmlEngine> #include <QSortFilterProxyModel> #include <util/sys/paths.h> #include <util/qml/colorthemeproxy.h> #include <util/qml/themeimageprovider.h> #include <util/qml/standardnamfactory.h> #include <util/qml/util.h> #include <util/sll/prelude.h> #include <util/sll/udls.h> #include <interfaces/lmp/ilmpproxy.h> #include <interfaces/lmp/ilocalcollection.h> #include "checkmodel.h" #include "checker.h" namespace LC::LMP::BrainSlugz { namespace { class MissingModel final : public QSortFilterProxyModel { public: MissingModel (QAbstractItemModel *source, QObject *parent) : QSortFilterProxyModel { parent } { setSourceModel (source); setDynamicSortFilter (true); } protected: bool filterAcceptsRow (int row, const QModelIndex&) const override { const auto& idx = sourceModel ()->index (row, 0); return idx.data (CheckModel::MissingCount).toInt (); } }; auto SortArtists (Collection::Artists_t artists) { std::sort (artists.begin (), artists.end (), Util::ComparingBy (&Collection::Artist::Name_)); return artists; } } CheckTab::CheckTab (const ILMPProxy_ptr& lmpProxy, const TabClassInfo& tc, QObject* plugin) : CheckView_ { new QQuickWidget } , TC_ (tc) , Plugin_ { plugin } , Toolbar_ { new QToolBar { this } } , Model_ { new CheckModel { SortArtists (lmpProxy->GetLocalCollection ()->GetAllArtists ()), lmpProxy, this } } , CheckedModel_ { new MissingModel { Model_, this } } { Ui_.setupUi (this); Ui_.CheckViewWidget_->layout ()->addWidget (CheckView_); for (const auto& cand : Util::GetPathCandidates (Util::SysPath::QML, {})) CheckView_->engine ()->addImportPath (cand); CheckView_->engine ()->addImageProvider (QStringLiteral ("ThemeIcons"), new Util::ThemeImageProvider { GetProxyHolder () }); CheckView_->setResizeMode (QQuickWidget::SizeRootObjectToView); constexpr auto obj = &QVariant::fromValue<QObject*>; CheckView_->rootContext ()->setContextProperties ({ { QStringLiteral ("colorProxy"), obj (new Util::ColorThemeProxy { GetProxyHolder ()->GetColorThemeManager (), this }) }, { QStringLiteral ("artistsModel"), obj (Model_) }, { QStringLiteral ("checkedModel"), obj (CheckedModel_) }, { QStringLiteral ("checkingState"), QString {} }, }); new Util::StandardNAMFactory { QStringLiteral ("lmp/qml"), [] { return 50_mib; }, CheckView_->engine () }; Util::WatchQmlErrors (*CheckView_); const auto& filename = Util::GetSysPath (Util::SysPath::QML, QStringLiteral ("lmp/brainslugz"), QStringLiteral ("CheckView.qml")); CheckView_->setSource (QUrl::fromLocalFile (filename)); SetupToolbar (); connect (Ui_.SelectAll_, &QPushButton::released, Model_, &CheckModel::SelectAll); connect (Ui_.SelectNone_, &QPushButton::released, Model_, &CheckModel::SelectNone); } TabClassInfo CheckTab::GetTabClassInfo () const { return TC_; } QObject* CheckTab::ParentMultiTabs () { return Plugin_; } void CheckTab::Remove () { emit removeTab (); deleteLater (); } QToolBar* CheckTab::GetToolBar () const { return Toolbar_; } void CheckTab::SetupToolbar () { const auto startAction = Toolbar_->addAction (tr ("Start"), this, &CheckTab::Start); startAction->setProperty ("ActionIcon", "system-run"); connect (this, &CheckTab::runningStateChanged, startAction, &QAction::setDisabled); } void CheckTab::Start () { QList<Media::ReleaseInfo::Type> types; auto check = [&types] (QCheckBox *box, Media::ReleaseInfo::Type type) { if (box->checkState () == Qt::Checked) types << type; }; check (Ui_.Album_, Media::ReleaseInfo::Type::Standard); check (Ui_.EP_, Media::ReleaseInfo::Type::EP); check (Ui_.Single_, Media::ReleaseInfo::Type::Single); check (Ui_.Compilation_, Media::ReleaseInfo::Type::Compilation); check (Ui_.Live_, Media::ReleaseInfo::Type::Live); check (Ui_.Soundtrack_, Media::ReleaseInfo::Type::Soundtrack); check (Ui_.Other_, Media::ReleaseInfo::Type::Other); Model_->RemoveUnscheduled (); const auto checker = new Checker { Model_, types, this }; connect (checker, &Checker::finished, this, [this] { IsRunning_ = false; emit runningStateChanged (IsRunning_); }); emit checkStarted (checker); CheckView_->rootContext ()->setContextProperty ("checkingState", QStringLiteral ("checking")); IsRunning_ = true; emit runningStateChanged (IsRunning_); } }
f0615391c4e30a67f8266deb278dade93b575f43
f969f027e98c3d5106c423e57ea4fc7d2903a8fb
/牛客_小米秋招2019系统软件/最大新整数.cpp
ddcb1287d9b0e195147bf6e4194787fe6d2b087e
[]
no_license
BenQuickDeNN/LeetCodeSolutions
eb2e1e3d2f13621f4d603e26f28a0fce2af75f1b
4165aca74114e9841a312b27ccc4a807a9fd65e5
refs/heads/master
2023-09-04T12:02:24.846562
2021-11-13T03:44:11
2021-11-13T03:44:11
255,344,497
0
0
null
null
null
null
UTF-8
C++
false
false
258
cpp
最大新整数.cpp
#include <string> #include <iostream> #include <queue> #include <vector> using namespace std; int main() { string str; int K; cin>>str; cin>>K; int curr = 0; int next = curr + 1; int count = 0; return 0; }
af7fe9b711a9252290e4d7ff3ef9f0d42b262600
c32ee8ade268240a8064e9b8efdbebfbaa46ddfa
/Libraries/m2sdk/CryptoPP/PKCS8PrivateKey.h
752a34c3a7187665054d37b3cb378eaa4a15087f
[]
no_license
hopk1nz/maf2mp
6f65bd4f8114fdeb42f9407a4d158ad97f8d1789
814cab57dc713d9ff791dfb2a2abeb6af0e2f5a8
refs/heads/master
2021-03-12T23:56:24.336057
2015-08-22T13:53:10
2015-08-22T13:53:10
41,209,355
19
21
null
2015-08-31T05:28:13
2015-08-22T13:56:04
C++
UTF-8
C++
false
false
846
h
PKCS8PrivateKey.h
// auto-generated file (rttidump-exporter by h0pk1nz) #pragma once #include <CryptoPP/ASN1CryptoMaterial_TPL_304AD7B8.h> namespace CryptoPP { /** CryptoPP::PKCS8PrivateKey (VTable=0x01EAEE04) */ class PKCS8PrivateKey : public ASN1CryptoMaterial_TPL_304AD7B8 { public: virtual void vfn_0001_74769A42() = 0; virtual void vfn_0002_74769A42() = 0; virtual void vfn_0003_74769A42() = 0; virtual void vfn_0004_74769A42() = 0; virtual void vfn_0005_74769A42() = 0; virtual void vfn_0006_74769A42() = 0; virtual void vfn_0007_74769A42() = 0; virtual void vfn_0008_74769A42() = 0; virtual void vfn_0009_74769A42() = 0; virtual void vfn_0010_74769A42() = 0; virtual void vfn_0011_74769A42() = 0; virtual void vfn_0012_74769A42() = 0; virtual void vfn_0013_74769A42() = 0; virtual void vfn_0014_74769A42() = 0; }; } // namespace CryptoPP
ab8a4487d57b2c4687017172a6485560d07fa8d0
e07311ca2a43a9649fe8a9760fde97855e339e00
/src/iscas/DFlipFlop.cpp
e9cc77089318c144a9ce9ec0bda502e448011358
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
wilseypa/warped-models
afafee2457d5004ac578c0978012bc3321109d41
3b43934ab0de69d776df369d1fd010360b1ea0b2
refs/heads/master
2016-08-05T15:20:30.795510
2015-11-12T20:02:11
2015-11-12T20:02:11
12,739,052
2
0
null
null
null
null
UTF-8
C++
false
false
1,859
cpp
DFlipFlop.cpp
#include "DFlipFlop.h" #include "ClockEvent.h" #include "DFlipFlopState.h" #include "SignalEvent.h" #include <IntVTime.h> #include <string> #include <stdexcept> DFlipFlop::DFlipFlop(std::string name, unsigned int propagationDelay, unsigned int clockPeriod) : Component(name, propagationDelay, clockPeriod) {} State* DFlipFlop::allocateState() { return new DFlipFlopState(); } void DFlipFlop::executeProcess() { auto state = static_cast<DFlipFlopState*>(getState()); while (haveMoreEvents() == true) { auto event = getEvent(); if (auto signalEvent = dynamic_cast<const SignalEvent*>(event)) { state->input = signalEvent->getInputValue(); return; } if (dynamic_cast<const ClockEvent*>(event)) { IntVTime currentTime = dynamic_cast<const IntVTime&>(getSimulationTime()); IntVTime recvTime = currentTime + propagationDelay; if (state->input != state->previousOutput) { state->previousOutput = state->input; // Send the new output signal to all connected components for (auto& it : outputs) { it.first->receiveEvent(new SignalEvent( getSimulationTime(), recvTime, this, it.first, it.second, state->input )); } } // Schedule another clock tick recvTime = currentTime + clockPeriod; receiveEvent(new ClockEvent(getSimulationTime(), recvTime, this, this)); return; } } }
7888d0300436b9e184043024495eb01c1027fcc4
b54f80551cd9678bf1da953054e560142ecf8085
/hardware/uhfoutreader.h
8d2565af066565ffcea08e9658222c5766d4bfdf
[]
no_license
guomeng666/faka
7508e853aeca1c20aa0bec198c5a744c73358dcc
ff39774eb113896fa9790dad3ca762cf4ac66cb7
refs/heads/master
2020-08-18T16:27:34.827888
2019-10-17T12:01:09
2019-10-17T12:01:09
215,810,416
1
1
null
null
null
null
UTF-8
C++
false
false
851
h
uhfoutreader.h
#ifndef UHFOUTREADER_H #define UHFOUTREADER_H #include <QObject> #include <QTcpSocket> #ifndef TAGINFO #define TAGINFO struct TagInfo { QByteArray tagID; bool communicationStat; bool warningStat; quint8 workStat; quint8 warningTriggerValue; quint8 temperatureCompensation; quint8 activeTime; quint16 magneticTrigger; quint16 magneticReference; quint16 magneticRealTime; quint16 power; }; #endif class UhfOutReader : public QTcpSocket { Q_OBJECT public: explicit UhfOutReader(QTcpSocket *parent = nullptr); bool connectReader(QString ip,qint16 port); void readTID(); TagInfo parseTagInfo(QByteArray tid); quint8 crcCheck(unsigned char *data, quint32 len); private slots: void onReadyRead(); signals: void recvTagInfo(TagInfo); public slots: }; #endif // UHFOUTREADER_H
5e58a9781c3290a00e68b19a5d441b40b8d434b5
ba090c829530373bfca7f9d95ac42216a3d24b35
/src/main.cpp
fe9582bccbb034c01fce79ce8a1f3dcbc141f6c5
[]
no_license
vladkozlov69/ESP32_TTGO23_213_Weather
8de2e98655894c399d38c8c1b6531d0bdbcf9e43
22c81e0c603737d564907037f053381d2e4c3173
refs/heads/master
2023-07-09T09:44:46.496575
2021-08-16T06:59:48
2021-08-16T06:59:48
345,301,430
0
0
null
2021-08-14T08:49:20
2021-03-07T09:06:04
C++
UTF-8
C++
false
false
48,220
cpp
main.cpp
/* ESP Weather Display using an EPD 2.7" Display, obtains data from Open Weather Map, decodes it and then displays it. #################################################################################################################################### This software, the ideas and concepts is Copyright (c) David Bird 2018. All rights to this software are reserved. Any redistribution or reproduction of any part or all of the contents in any form is prohibited other than the following: 1. You may print or download to a local hard disk extracts for your personal and non-commercial use only. 2. You may copy the content to individual third parties for their personal use, but only if you acknowledge the author David Bird as the source of the material. 3. You may not, except with my express written permission, distribute or commercially exploit the content. 4. You may not transmit it or store it in any other website or other form of electronic retrieval system for commercial purposes. The above copyright ('as annotated') notice and this permission notice shall be included in all copies or substantial portions of the Software and where the software use is visible to an end-user. THE SOFTWARE IS PROVIDED "AS IS" FOR PRIVATE USE ONLY, IT IS NOT FOR COMMERCIAL USE IN WHOLE OR PART OR CONCEPT. FOR PERSONAL USE IT IS SUPPLIED 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 AUTHOR OR COPYRIGHT HOLDER 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. See more at http://www.dsbird.org.uk */ #include "owm_credentials.h" #include <ArduinoJson.h> // https://github.com/bblanchon/ArduinoJson #include <WiFi.h> // Built-in #include "time.h" #include <SPI.h> #include <Wire.h> #define ENABLE_GxEPD2_display 0 // #include <GxEPD2_BW.h> // #include <GxEPD2_3C.h> #include <U8g2_for_Adafruit_GFX.h> #include "forecast_record.h" #include "lang.h" // Localisation (English) //#include "lang_cz.h" // Localisation (Czech) //#include "lang_fr.h" // Localisation (French) //#include "lang_gr.h" // Localisation (German) //#include "lang_it.h" // Localisation (Italian) //#include "lang_nl.h" // Localisation (Dutch) //#include "lang_pl.h" // Localisation (Polish) #include <NetworkManager.h> //#define DRAW_GRID 1 //Help debug layout changes #define SCREEN_WIDTH 250 #define SCREEN_HEIGHT 122 enum alignmentType {LEFT, RIGHT, CENTER}; #define DONE_PIN 21 #define SETUP_PIN 15 //34 //#define USE_OWM 1 //#define USE_CLIMACELL 1 //#define USE_ACCUWEATHER 1 uint8_t StartWiFi(); boolean SetupTime(); void InitialiseDisplay(); void StopWiFi(); void DisplayWeather(); void BeginSleep(); boolean UpdateLocalTime(); void Draw_Heading_Section(); void Draw_Main_Weather_Section(); void Draw_3hr_Forecast(int x, int y, int index); void DisplayAstronomySection(int x, int y); void DrawBattery(int x, int y); void drawString(int x, int y, String text, alignmentType alignment); void DisplayWXicon(int x, int y, String IconName, bool IconSize); String MoonPhase(int d, int m, int y, String hemisphere); void DrawMoon(int x, int y, int dd, int mm, int yy, String hemisphere); void DrawSmallWind(int x, int y, float angle, float windspeed); void DrawWind(int x, int y, float angle, float windspeed); String WindDegToDirection(float winddirection); void arrow(int x, int y, int asize, float aangle, int pwidth, int plength); void DrawPressureTrend(int x, int y, float pressure, String slope); void DisplayWXicon(int x, int y, String IconName, bool IconSize); void addcloud(int x, int y, int scale, int linesize); void addraindrop(int x, int y, int scale); void addrain(int x, int y, int scale, bool IconSize); void addsnow(int x, int y, int scale, bool IconSize); void addtstorm(int x, int y, int scale); void addsun(int x, int y, int scale, bool IconSize); void addfog(int x, int y, int scale, int linesize, bool IconSize); void Sunny(int x, int y, bool IconSize, String IconName); void MostlySunny(int x, int y, bool IconSize, String IconName); void MostlyCloudy(int x, int y, bool IconSize, String IconName); void Cloudy(int x, int y, bool IconSize, String IconName); void Rain(int x, int y, bool IconSize, String IconName); void ExpectRain(int x, int y, bool IconSize, String IconName); void ChanceRain(int x, int y, bool IconSize, String IconName); void Tstorms(int x, int y, bool IconSize, String IconName); void Snow(int x, int y, bool IconSize, String IconName); void Fog(int x, int y, bool IconSize, String IconName); void Haze(int x, int y, bool IconSize, String IconName); void CloudCover(int x, int y, int CCover); void Visibility(int x, int y, String Visi); void addmoon(int x, int y, int scale, bool IconSize); void Nodata(int x, int y, bool IconSize, String IconName); void drawString(int x, int y, String text, alignmentType alignment); void drawStringMaxWidth(int x, int y, unsigned int text_width, String text, alignmentType alignment); void InitialiseDisplay(); void setupDeviceSettings(); // Connections for Lilygo TTGO T5 V2.3_2.13 from // https://github.com/lewisxhe/TTGO-EPaper-Series#board-pins static const uint8_t EPD_BUSY = 4; static const uint8_t EPD_CS = 5; static const uint8_t EPD_RST = 16; static const uint8_t EPD_DC = 17; //Data/Command static const uint8_t EPD_SCK = 18; //CLK on pinout? static const uint8_t EPD_MISO = -1; // Master-In Slave-Out not used, as no data from display static const uint8_t EPD_MOSI = 23; #include <GxDEPG0213BN/GxDEPG0213BN.h> // 2.13" b/w newer panel #include <GxIO/GxIO_SPI/GxIO_SPI.h> #include <GxIO/GxIO.h> GxIO_Class io(SPI, EPD_CS, EPD_DC, EPD_RST); GxEPD_Class display(io, EPD_RST, EPD_BUSY); //GxEPD2_BW<GxEPD2_213_B73, GxEPD2_213_B73::HEIGHT> display(GxEPD2_213_B73(/*CS=D8*/ EPD_CS, /*DC=D3*/ EPD_DC, /*RST=D4*/ EPD_RST, /*BUSY=D2*/ EPD_BUSY)); U8G2_FOR_ADAFRUIT_GFX u8g2Fonts; // Select u8g2 font from here: https://github.com/olikraus/u8g2/wiki/fntlistall // Using fonts: // u8g2_font_helvB08_tf // u8g2_font_helvB10_tf // u8g2_font_helvB12_tf // u8g2_font_helvB14_tf // u8g2_font_helvB18_tf // u8g2_font_helvB24_tf //################# LIBRARIES ########################## String version = "6.5"; // Version of this program //################ VARIABLES ########################### bool LargeIcon = true, SmallIcon = false; #define Large 7 // For best results use odd numbers #define Small 3 // For best results use odd numbers struct tm current_time; String time_str, date_str; // strings to hold time and date int wifi_signal, CurrentHour = 0, CurrentMin = 0, CurrentSec = 0; long StartTime = 0; //################ PROGRAM VARIABLES and OBJECTS ########################################## #define max_readings 5 Forecast_record_type WxConditions[1]; Forecast_record_type WxForecast[max_readings]; #include "common.h" float pressure_readings[max_readings] = {0}; float temperature_readings[max_readings] = {0}; float humidity_readings[max_readings] = {0}; float rain_readings[max_readings] = {0}; float snow_readings[max_readings] = {0}; long SleepDuration = 30; // Sleep time in minutes, aligned to the nearest minute boundary, so if 30 will always update at 00 or 30 past the hour int WakeupTime = 7; // Don't wakeup until after 07:00 to save battery power int SleepTime = 23; // Sleep after (23+1) 00:00 to save battery power Preferences preferences; NetworkSettings settings; NetworkManager nm(&preferences, &Serial, &settings); //######################################################################################### void setup() { pinMode(DONE_PIN, OUTPUT); pinMode(SETUP_PIN, INPUT_PULLUP); digitalWrite(DONE_PIN, LOW); StartTime = millis(); Serial.begin(115200); nm.loadSettings(); Serial.print("SETUP_PIN:"); Serial.println(digitalRead(SETUP_PIN)); if (digitalRead(SETUP_PIN) == LOW || settings.ssid.length() == 0) { setupDeviceSettings(); ESP.restart(); } //delay(5000); if (StartWiFi() == WL_CONNECTED && SetupTime() == true) { //if ((CurrentHour >= WakeupTime && CurrentHour <= SleepTime)) { Serial.println("Initialising Display"); InitialiseDisplay(); // Give screen time to initialise by getting weather data! byte Attempts = 1; bool RxWeather = false, RxForecast = false, RxCurrent = false; Serial.println("Attempt to get weather"); WiFiClient client; // wifi client object WiFiClientSecure secureClient; while ((RxWeather == false || RxForecast == false || RxCurrent == false) && Attempts <= 5) { // Try up-to 2 time for Weather and Forecast data if (settings.climacell_key.length() > 0) { if (RxWeather == false) RxWeather = obtain_wx_data_climacell(secureClient, "current,1h", &current_time, 24, settings.climacell_key, settings.latitude, settings.longitude, settings.iana_tz); if (RxForecast == false) RxForecast = obtain_wx_data_climacell(secureClient, "1d", &current_time, 24, settings.climacell_key, settings.latitude, settings.longitude, settings.iana_tz); } if (settings.owm_key.length() > 0) { if (RxWeather == false) RxWeather = obtain_wx_data_owm(client, "onecall", settings.latitude, settings.longitude, settings.owm_key); if (RxForecast == false) RxForecast = obtain_wx_data_owm(client, "forecast", settings.latitude, settings.longitude, settings.owm_key); } if (settings.accu_key.length() > 0 && settings.accu_loc.length() > 0) { if (RxCurrent == false) RxCurrent = obtain_wx_data_accuweather(client, "currentconditions", settings.accu_loc, settings.accu_key); } else { RxCurrent = true; } Attempts++; } if (RxWeather && RxForecast) { // Only if received both Weather or Forecast proceed StopWiFi(); // Reduces power consumption Serial.println("Displaying Weather"); DisplayWeather(); display.update(); // Full screen update mode } //} } BeginSleep(); } //######################################################################################### void loop() { // this will never run! } //######################################################################################### void BeginSleep() { digitalWrite(DONE_PIN, HIGH); delay(200); display.powerDown(); long SleepTimer = (SleepDuration * 60 - ((CurrentMin % SleepDuration) * 60 + CurrentSec)); //Some ESP32 are too fast to maintain accurate time esp_sleep_enable_timer_wakeup((SleepTimer+20) * 1000000LL); // Added 20-sec extra delay to cater for slow ESP32 RTC timers #ifdef BUILTIN_LED pinMode(BUILTIN_LED, INPUT); // If it's On, turn it off and some boards use GPIO-5 for SPI-SS, which remains low after screen use digitalWrite(BUILTIN_LED, HIGH); #endif Serial.println("Entering " + String(SleepTimer) + "-secs of sleep time"); Serial.println("Awake for : " + String((millis() - StartTime) / 1000.0, 3) + "-secs"); Serial.println("Starting deep-sleep period..."); esp_deep_sleep_start(); // Sleep for e.g. 30 minutes } //######################################################################################### void DisplayWeather() { // 2.13" e-paper display is 250x122 useable resolution #if DRAW_GRID Draw_Grid(); #endif //UpdateLocalTime(); // already done in setup Draw_Heading_Section(); // Top line of the display Draw_Main_Weather_Section(); // Centre section of display for Location, temperature, Weather report, Wx Symbol and wind direction //Gak, each forecast is about 50 wide, which means we can fit about 5 of them onto our 250 wide screen. // Leaves us a little 25 wide gap on the right - let's see if we can find something to fill that out with. //Index from 0, not 1 - gets us more useful 'near' data. // For instance, indexing from 1 at 10am got us our first 3h prediction at 15:00, which is a *long* way off. // Indexing from 0 made that 12:00, which is much more useful. for (int i = 0; i < 5; i++) { Draw_3hr_Forecast(50 * i, 92, i); } DisplayAstronomySection(140, 18); // Astronomy section Sun rise/set and Moon phase plus icon // Not really enough space for these //if (WxConditions[0].Visibility > 0) Visibility(110, 40, String(WxConditions[0].Visibility) + "M"); //if (WxConditions[0].Cloudcover > 0) CloudCover(110, 55, WxConditions[0].Cloudcover); DrawBattery(20, 12); } //######################################################################################### // Help debug screen layout by drawing a grid of little crosses void Draw_Grid() { int x, y; const int grid_step = 10; //Draw the screen border so we know how far we can push things out display.drawLine(0, 0, SCREEN_WIDTH-1, 0, GxEPD_BLACK); //across top display.drawLine(0, SCREEN_HEIGHT-1, SCREEN_WIDTH-1, SCREEN_HEIGHT-1, GxEPD_BLACK); //across bottom display.drawLine(0, 0, 0, SCREEN_HEIGHT-1, GxEPD_BLACK); //lhs display.drawLine(SCREEN_WIDTH-1, 0, SCREEN_WIDTH-1, SCREEN_HEIGHT-1, GxEPD_BLACK); //rhs for( x=grid_step; x<SCREEN_WIDTH; x+=grid_step ) { for( y=grid_step; y<SCREEN_HEIGHT; y+=grid_step ) { display.drawLine(x-1, y, x+1, y, GxEPD_BLACK); //Horizontal line display.drawLine(x, y-1, x, y+1, GxEPD_BLACK); //Vertical line } } } //######################################################################################### void Draw_Heading_Section() { u8g2Fonts.setFont(u8g2_font_helvB08_tf); //display.drawRect(0,0,SCREEN_WIDTH,SCREEN_HEIGHT,GxEPD_BLACK); //drawString(95, 1, City, LEFT); // FIXME drawString(0, 1, time_str, LEFT); drawString(SCREEN_WIDTH, 1, date_str, RIGHT); display.drawLine(0, 11, SCREEN_WIDTH, 11, GxEPD_BLACK); } //######################################################################################### void Draw_Main_Weather_Section() { DisplayWXicon(150, 30, WxConditions[0].Icon, SmallIcon); u8g2Fonts.setFont(u8g2_font_helvB18_tf); drawString(3, 25, String(WxConditions[0].Temperature, 1) + "° / " + String(WxConditions[0].Humidity, 0) + "%", LEFT); u8g2Fonts.setFont(u8g2_font_helvB10_tf); drawString(3, 25 + 14, "Sun: " + ConvertUnixTime(WxConditions[0].Sunrise).substring(0, (Units == "M"?5:7)) + " - " + ConvertUnixTime(WxConditions[0].Sunset).substring(0, (Units == "M"?5:7)), LEFT); u8g2Fonts.setFont(u8g2_font_helvB12_tf); String Wx_Description = WxConditions[0].Forecast0; if (WxConditions[0].Forecast1 != "") Wx_Description += " & " + WxConditions[0].Forecast1; if (WxConditions[0].Forecast2 != "" && WxConditions[0].Forecast1 != WxConditions[0].Forecast2) Wx_Description += " & " + WxConditions[0].Forecast2; Wx_Description += ", " + WindDegToDirection(WxConditions[0].Winddir); Wx_Description += String(WxConditions[0].Windspeed, 0) + (Units == "M" ? " m/s" : " mph"); drawString(2, 25+16+14, TitleCase(Wx_Description), LEFT); display.drawLine(0, 68, 250, 68, GxEPD_BLACK); //Draw width of the 5 weather forcasts } //######################################################################################### // ? How 'big' is a weather forecast box?? // From the lines, looks like 50 wide and 56 high? void Draw_3hr_Forecast(int x, int y, int index) { DisplayWXicon(x + 26, y + 2, WxForecast[index].Icon, SmallIcon); u8g2Fonts.setFont(u8g2_font_helvB10_tf); //drawString(x + 22, y - 20, WxForecast[index].Period.substring(11, 16), CENTER); drawString(x + 22, y - 18, String(ConvertUnixTime(WxForecast[index].Dt).substring(0, 5)), CENTER); //drawString(x + 3, y + 15, String(WxForecast[index].High, 0) + "°/" + String(WxForecast[index].Low, 0) + "°", LEFT); u8g2Fonts.setFont(u8g2_font_helvB14_tf); drawString(x + 22, y + 22, String((WxForecast[index].High + WxForecast[index].Low)/2, 0) + "°", CENTER); display.drawLine(x + 50, y - 24, x + 50, y - 24 + 56 , GxEPD_BLACK); display.drawLine(x, y - 24 + 56, x + 50, y - 24 + 56 , GxEPD_BLACK); } /*void Draw_3hr_Forecast(int x, int y, int index) { DisplayWXicon(x, y, WxForecast[index].Icon, SmallIcon); u8g2Fonts.setFont(u8g2_font_helvB08_tf); drawString(x + 22, y, WxForecast[index].Period.substring(11, 16), CENTER); drawString(x + 22, y + 40, String(WxForecast[index].High, 0) + "°/" + String(WxForecast[index].Low, 0) + "°", CENTER); display.drawLine(x + 44, y, x + 44, y + 52 , GxEPD_BLACK); }*/ //######################################################################################### void DisplayAstronomySection(int x, int y) { u8g2Fonts.setFont(u8g2_font_helvB08_tf); // drawString(x, y, ConvertUnixTime(WxConditions[0].Sunrise).substring(0, (Units == "M"?5:7)) + " " + TXT_SUNRISE, LEFT); // drawString(x, y + 16, ConvertUnixTime(WxConditions[0].Sunset).substring(0, (Units == "M"?5:7)) + " " + TXT_SUNSET, LEFT); time_t now = time(NULL); struct tm * now_utc = gmtime(&now); const int day_utc = now_utc->tm_mday; const int month_utc = now_utc->tm_mon + 1; const int year_utc = now_utc->tm_year + 1900; //drawString(x + 5, y + 32, MoonPhase(day_utc, month_utc, year_utc, Hemisphere), RIGHT); DrawMoon(x+50, y-20, day_utc, month_utc, year_utc, Hemisphere); } //######################################################################################### String MoonPhase(int d, int m, int y, String hemisphere) { int c, e; double jd; int b; if (m < 3) { y--; m += 12; } ++m; c = 365.25 * y; e = 30.6 * m; jd = c + e + d - 694039.09; /* jd is total days elapsed */ jd /= 29.53059; /* divide by the moon cycle (29.53 days) */ b = jd; /* int(jd) -> b, take integer part of jd */ jd -= b; /* subtract integer part to leave fractional part of original jd */ b = jd * 8 + 0.5; /* scale fraction from 0-8 and round by adding 0.5 */ b = b & 7; /* 0 and 8 are the same phase so modulo 8 for 0 */ if (hemisphere == "south") b = 7 - b; if (b == 0) return TXT_MOON_NEW; // New; 0% illuminated if (b == 1) return TXT_MOON_WAXING_CRESCENT; // Waxing crescent; 25% illuminated if (b == 2) return TXT_MOON_FIRST_QUARTER; // First quarter; 50% illuminated if (b == 3) return TXT_MOON_WAXING_GIBBOUS; // Waxing gibbous; 75% illuminated if (b == 4) return TXT_MOON_FULL; // Full; 100% illuminated if (b == 5) return TXT_MOON_WANING_GIBBOUS; // Waning gibbous; 75% illuminated if (b == 6) return TXT_MOON_THIRD_QUARTER; // Third quarter; 50% illuminated if (b == 7) return TXT_MOON_WANING_CRESCENT; // Waning crescent; 25% illuminated return ""; } //######################################################################################### void DrawMoon(int x, int y, int dd, int mm, int yy, String hemisphere) { const int diameter = 38; double Phase = NormalizedMoonPhase(dd, mm, yy); hemisphere.toLowerCase(); if (hemisphere == "south") Phase = 1 - Phase; // Draw dark part of moon display.fillCircle(x + diameter - 1, y + diameter, diameter / 2 + 1, GxEPD_BLACK); const int number_of_lines = 90; for (double Ypos = 0; Ypos <= number_of_lines / 2; Ypos++) { double Xpos = sqrt(number_of_lines / 2 * number_of_lines / 2 - Ypos * Ypos); // Determine the edges of the lighted part of the moon double Rpos = 2 * Xpos; double Xpos1, Xpos2; if (Phase < 0.5) { Xpos1 = -Xpos; Xpos2 = Rpos - 2 * Phase * Rpos - Xpos; } else { Xpos1 = Xpos; Xpos2 = Xpos - 2 * Phase * Rpos + Rpos; } // Draw light part of moon double pW1x = (Xpos1 + number_of_lines) / number_of_lines * diameter + x; double pW1y = (number_of_lines - Ypos) / number_of_lines * diameter + y; double pW2x = (Xpos2 + number_of_lines) / number_of_lines * diameter + x; double pW2y = (number_of_lines - Ypos) / number_of_lines * diameter + y; double pW3x = (Xpos1 + number_of_lines) / number_of_lines * diameter + x; double pW3y = (Ypos + number_of_lines) / number_of_lines * diameter + y; double pW4x = (Xpos2 + number_of_lines) / number_of_lines * diameter + x; double pW4y = (Ypos + number_of_lines) / number_of_lines * diameter + y; display.drawLine(pW1x, pW1y, pW2x, pW2y, GxEPD_WHITE); display.drawLine(pW3x, pW3y, pW4x, pW4y, GxEPD_WHITE); } display.drawCircle(x + diameter - 1, y + diameter, diameter / 2, GxEPD_BLACK); } //######################################################################################### // Squeeze some wind info into a tiny space - just the speed, direction, and an arrow // No nice compass :-( void DrawSmallWind(int x, int y, float angle, float windspeed) { #define Cradius 15 float dx = Cradius * cos((angle - 90) * PI / 180) + x; // calculate X position float dy = Cradius * sin((angle - 90) * PI / 180) + y; // calculate Y position arrow(x+12, y, Cradius - 3, angle, 10, 20); // Show wind direction as just an arrow u8g2Fonts.setFont(u8g2_font_helvB08_tf); drawString(x, y+15, WindDegToDirection(angle), CENTER); drawString(x+5, y+25, String(windspeed, 1), CENTER); drawString(x+5, y+35, String(Units == "M" ? " m/s" : " mph"), CENTER); } //######################################################################################### void DrawWind(int x, int y, float angle, float windspeed) { #define Cradius 15 float dx = Cradius * cos((angle - 90) * PI / 180) + x; // calculate X position float dy = Cradius * sin((angle - 90) * PI / 180) + y; // calculate Y position arrow(x, y, Cradius - 3, angle, 10, 12); // Show wind direction on outer circle display.drawCircle(x, y, Cradius + 2, GxEPD_BLACK); display.drawCircle(x, y, Cradius + 3, GxEPD_BLACK); for (int m = 0; m < 360; m = m + 45) { dx = Cradius * cos(m * PI / 180); // calculate X position dy = Cradius * sin(m * PI / 180); // calculate Y position display.drawLine(x + dx, y + dy, x + dx * 0.8, y + dy * 0.8, GxEPD_BLACK); } u8g2Fonts.setFont(u8g2_font_helvB10_tf); drawString(x - 7, y + Cradius + 10, WindDegToDirection(angle), CENTER); u8g2Fonts.setFont(u8g2_font_helvB08_tf); drawString(x, y - Cradius - 14, String(windspeed, 1) + (Units == "M" ? " m/s" : " mph"), CENTER); } //######################################################################################### String WindDegToDirection(float winddirection) { if (winddirection >= 348.75 || winddirection < 11.25) return TXT_N; if (winddirection >= 11.25 && winddirection < 33.75) return TXT_NNE; if (winddirection >= 33.75 && winddirection < 56.25) return TXT_NE; if (winddirection >= 56.25 && winddirection < 78.75) return TXT_ENE; if (winddirection >= 78.75 && winddirection < 101.25) return TXT_E; if (winddirection >= 101.25 && winddirection < 123.75) return TXT_ESE; if (winddirection >= 123.75 && winddirection < 146.25) return TXT_SE; if (winddirection >= 146.25 && winddirection < 168.75) return TXT_SSE; if (winddirection >= 168.75 && winddirection < 191.25) return TXT_S; if (winddirection >= 191.25 && winddirection < 213.75) return TXT_SSW; if (winddirection >= 213.75 && winddirection < 236.25) return TXT_SW; if (winddirection >= 236.25 && winddirection < 258.75) return TXT_WSW; if (winddirection >= 258.75 && winddirection < 281.25) return TXT_W; if (winddirection >= 281.25 && winddirection < 303.75) return TXT_WNW; if (winddirection >= 303.75 && winddirection < 326.25) return TXT_NW; if (winddirection >= 326.25 && winddirection < 348.75) return TXT_NNW; return "?"; } //######################################################################################### void arrow(int x, int y, int asize, float aangle, int pwidth, int plength) { // x,y is the centre poistion of the arrow and asize is the radius out from the x,y position // aangle is angle to draw the pointer at e.g. at 45° for NW // pwidth is the pointer width in pixels // plength is the pointer length in pixels float dx = (asize - 10) * cos((aangle - 90) * PI / 180) + x; // calculate X position float dy = (asize - 10) * sin((aangle - 90) * PI / 180) + y; // calculate Y position float x1 = 0; float y1 = plength; float x2 = pwidth / 2; float y2 = pwidth / 2; float x3 = -pwidth / 2; float y3 = pwidth / 2; float angle = aangle * PI / 180 - 135; float xx1 = x1 * cos(angle) - y1 * sin(angle) + dx; float yy1 = y1 * cos(angle) + x1 * sin(angle) + dy; float xx2 = x2 * cos(angle) - y2 * sin(angle) + dx; float yy2 = y2 * cos(angle) + x2 * sin(angle) + dy; float xx3 = x3 * cos(angle) - y3 * sin(angle) + dx; float yy3 = y3 * cos(angle) + x3 * sin(angle) + dy; display.fillTriangle(xx1, yy1, xx3, yy3, xx2, yy2, GxEPD_BLACK); } //######################################################################################### void DrawPressureTrend(int x, int y, float pressure, String slope) { drawString(x, y, String(pressure, (Units == "M"?0:1)) + (Units == "M" ? "hPa" : "in"), LEFT); x = x + 48 - (Units == "M"?0:15); y = y + 3; if (slope == "+") { display.drawLine(x, y, x + 4, y - 4, GxEPD_BLACK); display.drawLine(x + 4, y - 4, x + 8, y, GxEPD_BLACK); } else if (slope == "0") { display.drawLine(x + 3, y - 4, x + 8, y, GxEPD_BLACK); display.drawLine(x + 3, y + 4, x + 8, y, GxEPD_BLACK); } else if (slope == "-") { display.drawLine(x, y, x + 4, y + 4, GxEPD_BLACK); display.drawLine(x + 4, y + 4, x + 8, y, GxEPD_BLACK); } } //######################################################################################### void DisplayWXicon(int x, int y, String IconName, bool IconSize) { Serial.println("Icon name: " + IconName); if (IconName == "01d" || IconName == "01n") Sunny(x, y, IconSize, IconName); else if (IconName == "02d" || IconName == "02n") MostlySunny(x, y, IconSize, IconName); else if (IconName == "03d" || IconName == "03n") Cloudy(x, y, IconSize, IconName); else if (IconName == "04d" || IconName == "04n") MostlySunny(x, y, IconSize, IconName); else if (IconName == "09d" || IconName == "09n") ChanceRain(x, y, IconSize, IconName); else if (IconName == "10d" || IconName == "10n") Rain(x, y, IconSize, IconName); else if (IconName == "11d" || IconName == "11n") Tstorms(x, y, IconSize, IconName); else if (IconName == "13d" || IconName == "13n") Snow(x, y, IconSize, IconName); else if (IconName == "50d") Haze(x, y, IconSize, IconName); else if (IconName == "50n") Fog(x, y, IconSize, IconName); else Nodata(x, y, IconSize, IconName); } //######################################################################################### uint8_t StartWiFi() { Serial.print("\r\nConnecting to: "); Serial.println(settings.ssid); IPAddress dns(8, 8, 8, 8); // Google DNS WiFi.disconnect(); WiFi.mode(WIFI_STA); // switch off AP WiFi.setAutoConnect(true); WiFi.setAutoReconnect(true); WiFi.begin(settings.ssid.c_str(), settings.pass.c_str()); unsigned long start = millis(); uint8_t connectionStatus; bool AttemptConnection = true; while (AttemptConnection) { connectionStatus = WiFi.status(); if (millis() > start + 15000) { // Wait 15-secs maximum AttemptConnection = false; } if (connectionStatus == WL_CONNECTED || connectionStatus == WL_CONNECT_FAILED) { AttemptConnection = false; } delay(50); } if (connectionStatus == WL_CONNECTED) { wifi_signal = WiFi.RSSI(); // Get Wifi Signal strength now, because the WiFi will be turned off to save power! Serial.println("WiFi connected at: " + WiFi.localIP().toString()); } else Serial.println("WiFi connection *** FAILED ***"); return connectionStatus; } //######################################################################################### void StopWiFi() { WiFi.disconnect(); WiFi.mode(WIFI_OFF); } //######################################################################################### boolean SetupTime() { configTime(settings.gmt_offset * 3600, settings.dst_offset * 3600, ntpServer, "time.nist.gov"); //(gmtOffset_sec, daylightOffset_sec, ntpServer) setenv("TZ", settings.posix_tz.c_str(), 1); //setenv()adds the "TZ" variable to the environment with a value TimeZone, only used if set to 1, 0 means no change tzset(); // Set the TZ environment variable delay(100); bool TimeStatus = UpdateLocalTime(); return TimeStatus; } //######################################################################################### boolean UpdateLocalTime() { char time_output[30], day_output[30], update_time[30]; while (!getLocalTime(&current_time, 5000)) { // Wait for 5-sec for time to synchronise Serial.println("Failed to obtain time"); return false; } CurrentHour = current_time.tm_hour; CurrentMin = current_time.tm_min; CurrentSec = current_time.tm_sec; Serial.print("IsDst:"); Serial.println(current_time.tm_isdst); //See http://www.cplusplus.com/reference/ctime/strftime/ Serial.println(&current_time, "%a %b %d %Y %H:%M:%S"); // Displays: Saturday, June 24 2017 14:05:49 if (Units == "M") { if ((Language == "CZ") || (Language == "DE") || (Language == "NL") || (Language == "PL") || (Language == "GR")) { sprintf(day_output, "%s, %02u. %s %02u", weekday_D[current_time.tm_wday], current_time.tm_mday, month_M[current_time.tm_mon], (current_time.tm_year) % 100); // day_output >> So., 23. Juni 19 << } else { sprintf(day_output, "%s %02u-%s-%02u", weekday_D[current_time.tm_wday], current_time.tm_mday, month_M[current_time.tm_mon], (current_time.tm_year) % 100); } strftime(update_time, sizeof(update_time), "%H:%M", &current_time); // Creates: '@ 14:05', 24h, no am or pm or seconds. and change from 30 to 8 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< sprintf(time_output, "%s", update_time); } else { strftime(day_output, sizeof(day_output), "%a %b-%d-%y", &current_time); // Creates 'Sat May-31-2019' strftime(update_time, sizeof(update_time), "%H:%M", &current_time); // Creates: '@ 02:05' - 24h, no seconds or am/pm sprintf(time_output, "%s", update_time); } date_str = day_output; time_str = time_output; return true; } //######################################################################################### void DrawBattery(int x, int y) { uint8_t percentage = 100; float voltage = analogRead(35) / 4096.0 * 7.46; if (voltage > 1 ) { // Only display if there is a valid reading Serial.println("Voltage = " + String(voltage)); percentage = 2836.9625 * pow(voltage, 4) - 43987.4889 * pow(voltage, 3) + 255233.8134 * pow(voltage, 2) - 656689.7123 * voltage + 632041.7303; if (voltage >= 4.20) percentage = 100; if (voltage <= 3.50) percentage = 0; display.drawRect(x + 15, y - 12, 19, 10, GxEPD_BLACK); display.fillRect(x + 34, y - 10, 2, 5, GxEPD_BLACK); display.fillRect(x + 17, y - 10, 15 * percentage / 100.0, 6, GxEPD_BLACK); drawString(x + 60, y - 11, String(percentage) + "%", RIGHT); //drawString(x + 13, y + 5, String(voltage, 2) + "v", CENTER); } } //######################################################################################### // Symbols are drawn on a relative 10x10grid and 1 scale unit = 1 drawing unit void addcloud(int x, int y, int scale, int linesize) { //Draw cloud outer display.fillCircle(x - scale * 3, y, scale, GxEPD_BLACK); // Left most circle display.fillCircle(x + scale * 3, y, scale, GxEPD_BLACK); // Right most circle display.fillCircle(x - scale, y - scale, scale * 1.4, GxEPD_BLACK); // left middle upper circle display.fillCircle(x + scale * 1.5, y - scale * 1.3, scale * 1.75, GxEPD_BLACK); // Right middle upper circle display.fillRect(x - scale * 3 - 1, y - scale, scale * 6, scale * 2 + 1, GxEPD_BLACK); // Upper and lower lines //Clear cloud inner display.fillCircle(x - scale * 3, y, scale - linesize, GxEPD_WHITE); // Clear left most circle display.fillCircle(x + scale * 3, y, scale - linesize, GxEPD_WHITE); // Clear right most circle display.fillCircle(x - scale, y - scale, scale * 1.4 - linesize, GxEPD_WHITE); // left middle upper circle display.fillCircle(x + scale * 1.5, y - scale * 1.3, scale * 1.75 - linesize, GxEPD_WHITE); // Right middle upper circle display.fillRect(x - scale * 3 + 2, y - scale + linesize - 1, scale * 5.9, scale * 2 - linesize * 2 + 2, GxEPD_WHITE); // Upper and lower lines } //######################################################################################### void addraindrop(int x, int y, int scale) { display.fillCircle(x, y, scale / 2, GxEPD_BLACK); display.fillTriangle(x - scale / 2, y, x, y - scale * 1.2, x + scale / 2, y , GxEPD_BLACK); x = x + scale * 1.6; y = y + scale / 3; display.fillCircle(x, y, scale / 2, GxEPD_BLACK); display.fillTriangle(x - scale / 2, y, x, y - scale * 1.2, x + scale / 2, y , GxEPD_BLACK); } //######################################################################################### void addrain(int x, int y, int scale, bool IconSize) { if (IconSize == SmallIcon) scale *= 1.34; for (int d = 0; d < 4; d++) { addraindrop(x + scale * (7.8 - d * 1.95) - scale * 5.2, y + scale * 2.1 - scale / 6, scale / 1.6); } } //######################################################################################### void addsnow(int x, int y, int scale, bool IconSize) { int dxo, dyo, dxi, dyi; for (int flakes = 0; flakes < 5; flakes++) { for (int i = 0; i < 360; i = i + 45) { dxo = 0.5 * scale * cos((i - 90) * 3.14 / 180); dxi = dxo * 0.1; dyo = 0.5 * scale * sin((i - 90) * 3.14 / 180); dyi = dyo * 0.1; display.drawLine(dxo + x + flakes * 1.5 * scale - scale * 3, dyo + y + scale * 2, dxi + x + 0 + flakes * 1.5 * scale - scale * 3, dyi + y + scale * 2, GxEPD_BLACK); } } } //######################################################################################### void addtstorm(int x, int y, int scale) { y = y + scale / 2; for (int i = 0; i < 5; i++) { display.drawLine(x - scale * 4 + scale * i * 1.5 + 0, y + scale * 1.5, x - scale * 3.5 + scale * i * 1.5 + 0, y + scale, GxEPD_BLACK); if (scale != Small) { display.drawLine(x - scale * 4 + scale * i * 1.5 + 1, y + scale * 1.5, x - scale * 3.5 + scale * i * 1.5 + 1, y + scale, GxEPD_BLACK); display.drawLine(x - scale * 4 + scale * i * 1.5 + 2, y + scale * 1.5, x - scale * 3.5 + scale * i * 1.5 + 2, y + scale, GxEPD_BLACK); } display.drawLine(x - scale * 4 + scale * i * 1.5, y + scale * 1.5 + 0, x - scale * 3 + scale * i * 1.5 + 0, y + scale * 1.5 + 0, GxEPD_BLACK); if (scale != Small) { display.drawLine(x - scale * 4 + scale * i * 1.5, y + scale * 1.5 + 1, x - scale * 3 + scale * i * 1.5 + 0, y + scale * 1.5 + 1, GxEPD_BLACK); display.drawLine(x - scale * 4 + scale * i * 1.5, y + scale * 1.5 + 2, x - scale * 3 + scale * i * 1.5 + 0, y + scale * 1.5 + 2, GxEPD_BLACK); } display.drawLine(x - scale * 3.5 + scale * i * 1.4 + 0, y + scale * 2.5, x - scale * 3 + scale * i * 1.5 + 0, y + scale * 1.5, GxEPD_BLACK); if (scale != Small) { display.drawLine(x - scale * 3.5 + scale * i * 1.4 + 1, y + scale * 2.5, x - scale * 3 + scale * i * 1.5 + 1, y + scale * 1.5, GxEPD_BLACK); display.drawLine(x - scale * 3.5 + scale * i * 1.4 + 2, y + scale * 2.5, x - scale * 3 + scale * i * 1.5 + 2, y + scale * 1.5, GxEPD_BLACK); } } } //######################################################################################### void addsun(int x, int y, int scale, bool IconSize) { int linesize = 3; if (IconSize == SmallIcon) linesize = 1; display.fillRect(x - scale * 2, y, scale * 4, linesize, GxEPD_BLACK); display.fillRect(x, y - scale * 2, linesize, scale * 4, GxEPD_BLACK); display.drawLine(x - scale * 1.3, y - scale * 1.3, x + scale * 1.3, y + scale * 1.3, GxEPD_BLACK); display.drawLine(x - scale * 1.3, y + scale * 1.3, x + scale * 1.3, y - scale * 1.3, GxEPD_BLACK); if (IconSize == LargeIcon) { display.drawLine(1 + x - scale * 1.3, y - scale * 1.3, 1 + x + scale * 1.3, y + scale * 1.3, GxEPD_BLACK); display.drawLine(2 + x - scale * 1.3, y - scale * 1.3, 2 + x + scale * 1.3, y + scale * 1.3, GxEPD_BLACK); display.drawLine(3 + x - scale * 1.3, y - scale * 1.3, 3 + x + scale * 1.3, y + scale * 1.3, GxEPD_BLACK); display.drawLine(1 + x - scale * 1.3, y + scale * 1.3, 1 + x + scale * 1.3, y - scale * 1.3, GxEPD_BLACK); display.drawLine(2 + x - scale * 1.3, y + scale * 1.3, 2 + x + scale * 1.3, y - scale * 1.3, GxEPD_BLACK); display.drawLine(3 + x - scale * 1.3, y + scale * 1.3, 3 + x + scale * 1.3, y - scale * 1.3, GxEPD_BLACK); } display.fillCircle(x, y, scale * 1.3, GxEPD_WHITE); display.fillCircle(x, y, scale, GxEPD_BLACK); display.fillCircle(x, y, scale - linesize, GxEPD_WHITE); } //######################################################################################### void addfog(int x, int y, int scale, int linesize, bool IconSize) { if (IconSize == SmallIcon) { linesize = 1; y = y - 1; } else y = y - 3; for (int i = 0; i < 6; i++) { display.fillRect(x - scale * 3, y + scale * 1.5, scale * 6, linesize, GxEPD_BLACK); display.fillRect(x - scale * 3, y + scale * 2.0, scale * 6, linesize, GxEPD_BLACK); display.fillRect(x - scale * 3, y + scale * 2.6, scale * 6, linesize, GxEPD_BLACK); } } //######################################################################################### void Sunny(int x, int y, bool IconSize, String IconName) { int scale = Small; if (IconSize == LargeIcon) { scale = Large; y = y - 4; // Shift up large sun } else y = y + 2; // Shift down small sun icon if (IconName.endsWith("n")) addmoon(x, y + 3, scale, IconSize); scale = scale * 1.6; addsun(x, y, scale, IconSize); } //######################################################################################### void MostlySunny(int x, int y, bool IconSize, String IconName) { int scale = Small, linesize = 3, offset = 5; if (IconSize == LargeIcon) { scale = Large; offset = 10; } if (scale == Small) linesize = 1; if (IconName.endsWith("n")) addmoon(x, y + offset + (IconSize ? -8 : 0), scale, IconSize); addcloud(x, y + offset, scale, linesize); addsun(x - scale * 1.8, y - scale * 1.8 + offset, scale, IconSize); } //######################################################################################### void MostlyCloudy(int x, int y, bool IconSize, String IconName) { int scale = Small, linesize = 3; if (IconSize == LargeIcon) { scale = Large; linesize = 1; } if (IconName.endsWith("n")) addmoon(x, y, scale, IconSize); addcloud(x, y, scale, linesize); addsun(x - scale * 1.8, y - scale * 1.8, scale, IconSize); addcloud(x, y, scale, linesize); } //######################################################################################### void Cloudy(int x, int y, bool IconSize, String IconName) { int scale = Large, linesize = 3; if (IconSize == SmallIcon) { scale = Small; if (IconName.endsWith("n")) addmoon(x, y, scale, IconSize); linesize = 1; addcloud(x, y, scale, linesize); } else { y += 12; if (IconName.endsWith("n")) addmoon(x - 5, y - 15, scale, IconSize); addcloud(x + 15, y - 25, 5, linesize); // Cloud top right addcloud(x - 15, y - 10, 7, linesize); // Cloud top left addcloud(x, y, scale, linesize); // Main cloud } } //######################################################################################### void Rain(int x, int y, bool IconSize, String IconName) { int scale = Large, linesize = 3; if (IconSize == SmallIcon) { scale = Small; linesize = 1; } if (IconName.endsWith("n")) addmoon(x, y, scale, IconSize); addcloud(x, y, scale, linesize); addrain(x, y, scale, IconSize); } //######################################################################################### void ExpectRain(int x, int y, bool IconSize, String IconName) { int scale = Large, linesize = 3; if (IconSize == SmallIcon) { scale = Small; linesize = 1; } if (IconName.endsWith("n")) addmoon(x, y, scale, IconSize); addsun(x - scale * 1.8, y - scale * 1.8, scale, IconSize); addcloud(x, y, scale, linesize); addrain(x, y, scale, IconSize); } //######################################################################################### void ChanceRain(int x, int y, bool IconSize, String IconName) { int scale = Large, linesize = 3; if (IconSize == SmallIcon) { scale = Small; linesize = 1; } if (IconName.endsWith("n")) addmoon(x - (IconSize ? 8 : 0), y, scale, IconSize); addsun(x - scale * 1.8, y - scale * 1.8, scale, IconSize); addcloud(x, y, scale, linesize); addrain(x, y, scale, IconSize); } //######################################################################################### void Tstorms(int x, int y, bool IconSize, String IconName) { int scale = Large, linesize = 3; if (IconSize == SmallIcon) { scale = Small; linesize = 1; } if (IconName.endsWith("n")) addmoon(x, y, scale, IconSize); addcloud(x, y, scale, linesize); addtstorm(x, y, scale); } //######################################################################################### void Snow(int x, int y, bool IconSize, String IconName) { int scale = Large, linesize = 3; if (IconSize == SmallIcon) { scale = Small; linesize = 1; } if (IconName.endsWith("n")) addmoon(x, y, scale, IconSize); addcloud(x, y, scale, linesize); addsnow(x, y, scale, IconSize); } //######################################################################################### void Fog(int x, int y, bool IconSize, String IconName) { int linesize = 3, scale = Large; if (IconSize == SmallIcon) { scale = Small; linesize = 1; y = y + 5; } if (IconName.endsWith("n")) addmoon(x, y, scale, IconSize); addcloud(x, y - 5, scale, linesize); addfog(x, y - 2, scale, linesize, IconSize); } //######################################################################################### void Haze(int x, int y, bool IconSize, String IconName) { int linesize = 3, scale = Large; if (IconSize == SmallIcon) { scale = Small; linesize = 1; } if (IconName.endsWith("n")) addmoon(x, y, scale, IconSize); addsun(x, y - 2, scale * 1.4, IconSize); addfog(x, y + 3 - (IconSize ? 12 : 0), scale * 1.4, linesize, IconSize); } //######################################################################################### void CloudCover(int x, int y, int CCover) { addcloud(x - 9, y - 3, Small * 0.6, 2); // Cloud top left addcloud(x + 3, y - 3, Small * 0.6, 2); // Cloud top right addcloud(x, y, Small * 0.6, 2); // Main cloud u8g2Fonts.setFont(u8g2_font_helvB08_tf); drawString(x + 15, y - 5, String(CCover) + "%", LEFT); } //######################################################################################### void Visibility(int x, int y, String Visi) { y = y - 3; // float start_angle = 0.52, end_angle = 2.61; int r = 10; for (float i = start_angle; i < end_angle; i = i + 0.05) { display.drawPixel(x + r * cos(i), y - r / 2 + r * sin(i), GxEPD_BLACK); display.drawPixel(x + r * cos(i), 1 + y - r / 2 + r * sin(i), GxEPD_BLACK); } start_angle = 3.61; end_angle = 5.78; for (float i = start_angle; i < end_angle; i = i + 0.05) { display.drawPixel(x + r * cos(i), y + r / 2 + r * sin(i), GxEPD_BLACK); display.drawPixel(x + r * cos(i), 1 + y + r / 2 + r * sin(i), GxEPD_BLACK); } display.fillCircle(x, y, r / 4, GxEPD_BLACK); u8g2Fonts.setFont(u8g2_font_helvB08_tf); drawString(x + 12, y - 3, Visi, LEFT); } //######################################################################################### void addmoon(int x, int y, int scale, bool IconSize) { if (IconSize == LargeIcon) { x = x - 5; y = y + 5; display.fillCircle(x - 21, y - 23, scale, GxEPD_BLACK); display.fillCircle(x - 14, y - 23, scale * 1.7, GxEPD_WHITE); } else { display.fillCircle(x - 16, y - 11, scale, GxEPD_BLACK); display.fillCircle(x - 11, y - 11, scale * 1.7, GxEPD_WHITE); } } //######################################################################################### void Nodata(int x, int y, bool IconSize, String IconName) { if (IconSize == LargeIcon) u8g2Fonts.setFont(u8g2_font_helvB24_tf); else u8g2Fonts.setFont(u8g2_font_helvB10_tf); drawString(x - 3, y - 8, "?", CENTER); u8g2Fonts.setFont(u8g2_font_helvB08_tf); } //######################################################################################### void drawString(int x, int y, String text, alignmentType alignment) { int16_t x1, y1; //the bounds of x,y and w and h of the variable 'text' in pixels. uint16_t w, h; display.setTextWrap(false); display.getTextBounds(text, x, y, &x1, &y1, &w, &h); if (alignment == RIGHT) x = x - w; if (alignment == CENTER) x = x - w / 2; u8g2Fonts.setCursor(x, y + h); u8g2Fonts.print(text); } //######################################################################################### void drawStringMaxWidth(int x, int y, unsigned int text_width, String text, alignmentType alignment) { int16_t x1, y1; //the bounds of x,y and w and h of the variable 'text' in pixels. uint16_t w, h; display.getTextBounds(text, x, y, &x1, &y1, &w, &h); if (alignment == RIGHT) x = x - w; if (alignment == CENTER) x = x - w / 2; u8g2Fonts.setCursor(x, y); if (text.length() > text_width * 2) { u8g2Fonts.setFont(u8g2_font_helvB10_tf); text_width = 42; y = y - 3; } u8g2Fonts.println(text.substring(0, text_width)); if (text.length() > text_width) { u8g2Fonts.setCursor(x, y + h + 15); String secondLine = text.substring(text_width); secondLine.trim(); // Remove any leading spaces u8g2Fonts.println(secondLine); } } //######################################################################################### void InitialiseDisplay() { Serial.println("Begin InitialiseDisplay..."); display.init(115200); SPI.end(); SPI.begin(EPD_SCK, EPD_MISO, EPD_MOSI, EPD_CS); display.setRotation(3); // Use 1 or 3 for landscape modes u8g2Fonts.begin(display); // connect u8g2 procedures to Adafruit GFX u8g2Fonts.setFontMode(1); // use u8g2 transparent mode (this is default) u8g2Fonts.setFontDirection(0); // left to right (this is default) u8g2Fonts.setForegroundColor(GxEPD_BLACK); // apply Adafruit GFX color u8g2Fonts.setBackgroundColor(GxEPD_WHITE); // apply Adafruit GFX color u8g2Fonts.setFont(u8g2_font_helvB10_tf); // Explore u8g2 fonts from here: https://github.com/olikraus/u8g2/wiki/fntlistall display.fillScreen(GxEPD_WHITE); //display. Serial.println("... End InitialiseDisplay"); } void setupDeviceSettings() { nm.begin(); } /* Version 6.0 reformatted to use u8g2 fonts 1. Screen layout revised 2. Made consitent with other versions specifically 7x5 variant 3. Introduced Visibility in Metres, Cloud cover in % and RH in % 4. Correct sunrise/sunset time when in imperial mode. Version 6.1 Provided connection support for Waveshare ESP32 driver board Version 6.2 Changed GxEPD2 initialisation from 115200 to 0 1. display.init(115200); becomes display.init(0); to stop blank screen following update to GxEPD2 Version 6.3 changed u8g2 fonts selection 1. Omitted 'FONT(' and added _tf to font names either Regular (R) or Bold (B) Version 6.4 1. Added an extra 20-secs sleep delay to allow for slow ESP32 RTC timers Version 6.5 1. Modified for GxEPD2 */
7bf540bd1ab5c339ae52a234b18ce317d34ce512
a1ed23965b64e12ba38725f4715a301b267d7528
/CPP_US/src/MovementScript.cpp
32bd7fbd69a7ac2846d22c2031c266b7951536c8
[ "MIT" ]
permissive
Basher207/Unity-style-Cpp-engine
2a571a47d38c9be3684585242e52c86dbd0e382a
812b0be2c61aea828cfd8c6d6f06f2cf6e889661
refs/heads/master
2022-04-21T16:58:28.319397
2020-04-24T20:14:09
2020-04-24T20:14:09
258,613,853
0
0
null
null
null
null
UTF-8
C++
false
false
2,261
cpp
MovementScript.cpp
#include <stdio.h> #include <glm/vec3.hpp> #include <glm/vec4.hpp> #include <glm/mat4x4.hpp> #include <glm/gtc/matrix_transform.hpp> #include <glm/gtx/transform.hpp> #include <glm/gtx/rotate_vector.hpp> #include <glm/gtx/vector_angle.hpp> #include <glm/gtc/type_ptr.hpp> #include "MovementScript.hpp" #include <Engine.hpp> #include <stdio.h> void MovementScript::Awake () { this->pos = transform->localPos; this->forward = glm::vec3(0., 0, 1.); } void MovementScript::Rotate (int rotateX, int rotateY) { this->forward = glm::rotateY(this->forward,-rotateX * 0.01f); //By getting the cross product of the forward vector and the up vector ill //get a vector perpendicular to both. This would be the desired vector to rotate around //when looking up and down. glm::vec3 yRotationAxis = glm::cross (this->forward, glm::vec3(0, 1, 0)); yRotationAxis = glm::normalize (yRotationAxis); this->forward = glm::rotate (this->forward,-rotateY * 0.01f ,yRotationAxis); transform->LookAt(transform->localPos + this->forward); } void MovementScript::Translate (float moveX, float moveZ) { glm::vec3 movementForward = this->forward; movementForward.y = 0;//To prevent movement due to looking up movementForward = glm::normalize (movementForward); //Make's sure it's normalized so you don't move less if you are looking up this->pos += movementForward * moveZ; glm::vec3 side = glm::cross(movementForward, glm::vec3(0, 1, 0)); //A cross product of forward and up would give me a perpendicular vector to use for side movement. side = glm::normalize(side);//Again normalized to make sure speed consistency this->pos += side *-moveX; transform->localPos = this->pos; } void MovementScript::Update () { float moveX = 0, moveZ = 0; float moveSpeed = Input::keys[SDL_SCANCODE_LSHIFT] ? 1 : 0.5; if (Input::keys[SDL_SCANCODE_W]) { moveZ += moveSpeed; } if (Input::keys[SDL_SCANCODE_S]) { moveZ -= moveSpeed; } if (Input::keys[SDL_SCANCODE_D]) { moveX -= moveSpeed; } if (Input::keys[SDL_SCANCODE_A]) { moveX += moveSpeed; } //Adds all the input movenets than applies the movenet to the transform through the Translate and Rotate functions this->Translate(moveX, moveZ); this->Rotate(Input::mouse_delta_pos.x, Input::mouse_delta_pos.y); }
c3d4a3bfd4809cb285c5451c6d2937225bfe4158
096281a038056005b2fb802a59d13822b08d28cf
/OLD (Portugal)/Base_Sapo_espinho1/Base_Sapo_espinho1/Base_Sapo_espinho.ino
6993f5f466714a75507553d9a9f43330447ef5ac
[ "MIT" ]
permissive
tiferrei/CJP2.0
a6a769c01b1da4e2b15fb2d7f569703eb242ff0c
28f59c4abe369a8fc8d74d6a48f2357800c73c3b
refs/heads/main
2021-01-01T05:58:41.421028
2016-04-08T07:53:42
2016-04-08T07:53:42
47,972,919
0
0
null
null
null
null
UTF-8
C++
false
false
8,388
ino
Base_Sapo_espinho.ino
// Copyright (c) 2014 The CJP2.0 Team // 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 <Wire.h> // preciso para Omni3MD.cpp e bussola #include <Omni3MD.h> // biblioteca para programar o omni //constants definitions| #define ADDRESS 0x60 // define adereço para CMPS10 #define OMNI3MD_ADDRESS 0x30 // endereço padrão de fábrica //variable declarations byte highByte, lowByte, fine; // highByte and lowByte store high and low bytes of the bearing and fine stores decimal place of bearing int bearing, pitch, roll; // Stores full bearing -> orientation, pitch and roll values of CMPS10 int leds= 2; // define a variável leds Omni3MD omni; // [byte omniAddress] int lin_speed; int rot_speed; int dir; // direção varia entre 0 (frontal) a 359 graus. void setup() { //setup routines Serial.begin(115200); // set baud rate to 115200bps for printing values in serial monitor. Press (ctrl+shift+m) after uploading // Wire.begin(); omni.i2c_connect(OMNI3MD_ADDRESS); // set i2c connection delay(10); // pausa 10 millisegundos omni.stop_motors(); // pára todos os motores delay(10); omni.set_i2c_timeout(0); // parâmetro de segurança -> I2C a comunicação deve ocorrer a cada [byte timeout] x 100 milisegundos para o movimento do motor delay(5); // 5ms pause required for Omni3MD eeprom writing omni.set_PID(250,400,125); // Ajuste os parâmetros para o controle PID [word Kp, word Ki, word Kd] // omni.set_PID(750,300,600); // Ajuste os parâmetros para o controle PID [word Kp, word Ki, word Kd] delay(15); // 15ms pausa necessária para Omni3MD escrita eeprom omni.set_ramp(2000,1500,400); // void set_ramp(int time, int slope, int Kl);set acceleration ramp and limiar take off parameter gain[word ramp_time, word slope, word Kl] delay(15); // 10ms puasa requerida para Omni3MD pinMode (leds, OUTPUT); alinha(); } void loop() { delay(1000); frente_270(); //direita - tendo em conta a posição do sapo, movimenta-se para a direita frente_90(); //esquerda - tendo em conta a posição do sapo, movimenta-se para a esquerda frente_90(); frente_270(); //direita - tendo em conta a posição do sapo, movimenta-se para a direita frente_270(); frente_90(); //esquerda - tendo em conta a posição do sapo, movimenta-se para a esquerda frente_90(); frente_270(); //direita - tendo em conta a posição do sapo, movimenta-se para a direita frente_270(); frente_90(); //esquerda - tendo em conta a posição do sapo, movimenta-se para a esquerda frente_90(); delay (3000); rodaCW(); alinha(); delay (3000); rodaCW(); //movimento de rotação no sentido dos ponteiros do relogio rodaCCW(); //movimento de rotação no sentido contrário ao dos ponteiros do relogio rodaCW(); rodaCCW(); rodaCW(); rodaCCW(); rodaCW(); rodaCCW(); rodaCW(); rodaCCW(); rodaCW(); rodaCCW(); rodaCW(); rodaCCW(); rodaCW(); rodaCCW(); rodaCW(); rodaCCW(); rodaCW(); rodaCCW(); delay (1000); //--- alinha(); //--- frente_270(); //direita - tendo em conta a posição do sapo, movimenta-se para a direita frente_270(); frente_90(); //direita - tendo em conta a posição do sapo, movimenta-se para a esquerda frente_90(); frente_270(); //direita - tendo em conta a posição do sapo, movimenta-se para a direita frente_270(); frente_90(); //direita - tendo em conta a posição do sapo, movimenta-se para a esquerda frente_90(); //--- delay (2000); alinha_contrario(); delay (5000); alinha(); delay (3000); //--- espiral(); espiral(); espiral(); espiral(); delay (40000); } //========================================================== void rodaCW() { omni.mov_omni(0,60,0); //omni.mov_omni(linear ,rotação ,direção)Movimentar o robô Serial.println("RodaCW"); digitalWrite(leds, HIGH); delay (3000); digitalWrite(leds, LOW); omni.stop_motors(); (10); } //------------------------------------------------ void rodaCCW() { omni.mov_omni(0,-60,0); //omni.mov_omni(linear ,rotação ,direção)Movimentar o robô Serial.println("RodaCCW"); digitalWrite(leds, HIGH); delay (3000); digitalWrite(leds, LOW); omni.stop_motors(); (10); } //------------------------------------------------ void frente_zero() { omni.mov_omni(60,0,0); //omni.mov_omni(linear ,rotação ,direção)Movimentar o robô digitalWrite(leds, HIGH); delay (3000); digitalWrite(leds, LOW); omni.stop_motors(); } //------------------------------------------------ void frente_90() { omni.mov_omni(60,0,90); //omni.mov_omni(linear ,rotação ,direção)Movimentar o robô Serial.println("90"); digitalWrite(leds, HIGH); delay (3000); digitalWrite(leds, LOW); omni.stop_motors(); } //------------------------------------------------ void frente_180() { omni.mov_omni(60,0,180); //omni.mov_omni(linear ,rotação ,direção)Movimentar o robô Serial.println("180"); digitalWrite(leds, HIGH); delay (2000); digitalWrite(leds, LOW); omni.stop_motors(); }//------------------------------------------------ void frente_270() { omni.mov_omni(60,0,270); //omni.mov_omni(linear ,rotação ,direção)Movimentar o robô Serial.println("270"); delay (2000); omni.stop_motors(); }//------------------------------------------------ void espiral() { omni.mov_omni(50,30,0); //omni.mov_omni(linear ,rotação ,direção)Movimentar o robô Serial.println("Espiral"); digitalWrite(leds, HIGH); delay (7000); digitalWrite(leds, LOW); omni.stop_motors(); } //------------------------------------------------ void alinha() // Rotina para alinhar o robô { Serial.println("Alinha"); ler_bussola(); Serial.print("Bearing:"); Serial.println(bearing); while(bearing<180 || bearing>220) // Enquanto o robô estiver desalinhado ||->ou lógico &&->e lógico (valor inicial) { omni.mov_omni(0,40,0); //omni.mov_omni(linear ,rotação ,direção)Movimentar o robô delay (100); ler_bussola(); //Ler a bússola Serial.print("Bearing:"); Serial.println(bearing); delay (30); } omni.stop_motors(); // pára todos os motores delay(10); } //------------------------------------------------ void alinha_contrario() // Rotina para alinhar o robô { ler_bussola(); while (bearing<0 || bearing>40) // 200 Enquanto o robô estiver desalinhado ||->ou lógico &&->e lógico (valor inicial 80-180) { omni.mov_omni(0,40,0); //omni.mov_omni(linear ,rotação ,direção)Movimentar o robô delay (100); ler_bussola(); //Ler a bússola Serial.print("Bearing:"); Serial.println(bearing); delay (30); } omni.stop_motors(); // pára todos os motores delay(10); } //--------------------------------------- void ler_bussola() { Wire.beginTransmission(ADDRESS); //starts communication with CMPS10 Wire.write(2); //Sends the register we wish to start reading from Wire.endTransmission(); Wire.requestFrom(ADDRESS, 4); // Request 4 bytes from CMPS10 while(Wire.available() < 4); // Wait for bytes to become available highByte=Wire.read(); lowByte = Wire.read(); pitch = Wire.read(); roll = Wire.read(); bearing = ((highByte<<8)+lowByte)/10; // Calcula full bearing fine = ((highByte<<8)+lowByte)%10; // Calcula decimal place of bearing delay(100); } void imprime_valores() { Serial.print("\nBearing:"); Serial.println(bearing); // prints bearing Value on screen Serial.print("Pitch:"); Serial.println(pitch); // prints pitch Value on screen Serial.print("Roll:"); Serial.println(roll); // prints roll Value on screen delay(500); }
ef4f8be8aa338e8bfa092279612d45b8fcdd2b8d
87d6384c941ffd1762e46d9222fb70a8650dbe94
/PlaygroundEngine/PGLog.cpp
5f9c9ad761e4137c8e929323b1c91c2308376cea
[]
no_license
imgeself/PlaygroundEngine
1bed262a2a036b08249cb806995ea48fcf6e5dec
da76957f86ce241fde49bac013739e4efd26a257
refs/heads/master
2022-04-22T22:29:38.190309
2020-04-20T21:55:13
2020-04-20T21:55:13
207,020,133
15
2
null
null
null
null
UTF-8
C++
false
false
1,418
cpp
PGLog.cpp
#include "PGLog.h" #include <time.h> LogList PGLog::m_LogList = LogList(); PGLog::PGLog() { } void PGLog::Log(LogType type, const char* fmt, ...) { const size_t logBufferMaxSize = 1024; char logBuffer[logBufferMaxSize] = {0}; // Get time time_t rawtime; tm timeinfo; time(&rawtime); localtime_s(&timeinfo, &rawtime); // Format [HH:MM:SS] // TODO: Print milliseconds! const size_t timeFormatMaxSize = 12; // length of "[HH:MM:SS] \0" const size_t timeFormatSize = timeFormatMaxSize - 1; // without terminating character strftime(logBuffer, timeFormatMaxSize, "[%T] ", &timeinfo); va_list args; va_start(args, fmt); vsnprintf(logBuffer + timeFormatSize, logBufferMaxSize - timeFormatSize, fmt, args); va_end(args); size_t logLength = strlen(logBuffer) + 2; // Length of the log text plus new line and termination character if (logBuffer[logLength - 3] != '\n') { logBuffer[logLength - 2] = '\n'; } char* logData = (char*) malloc(logLength); memcpy((void*) logData, (const void*) logBuffer, logLength); // Print log to stdout printf(logData); LogItem logItem; logItem.type = type; logItem.logData = (const char*) logData; m_LogList.push_back(logItem); } void PGLog::ClearLogList() { for (LogItem item : m_LogList) { free((void*) item.logData); } m_LogList.clear(); }
8220722ad6d69a0c64b6a8f8c8c3f863456be0f1
f2eadf001eb823c6b5459b74e8636043ca9fbd7a
/Books/SFML Game Development by Example/Chapter 13/Chat/Server/Server/src/Server.cpp
da4dda415b1f8fef5c639c1f0a25288cb44c3902
[ "MIT" ]
permissive
mequint/Cpp-Samples
4a5b18fa4fbcab5c839140527dc3b2ed666d16dd
a5e8e08381121c10c100632ae190cc509be3293e
refs/heads/master
2021-11-05T17:31:01.323207
2021-09-13T23:39:12
2021-09-13T23:39:12
125,294,464
0
0
null
null
null
null
UTF-8
C++
false
false
8,680
cpp
Server.cpp
#include "Server.h" #include <iostream> Server::Server(void(*handler)(sf::IpAddress &, const PortNumber &, const PacketID &, sf::Packet &, Server *)) : m_listenThread(&Server::Listen, this), m_running(false) { m_packetHandler = std::bind(handler, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5); } Server::~Server() { Stop(); } void Server::BindTimeoutHandler(void(*handler)(const ClientID &)) { m_timeoutHandler = std::bind(handler, std::placeholders::_1); } bool Server::Send(const ClientID & id, sf::Packet & packet) { sf::Lock lock(m_mutex); auto iter = m_clients.find(id); if (iter == m_clients.end()) return false; if (m_outgoing.send(packet, iter->second.m_clientIP, iter->second.m_clientPort) != sf::Socket::Done) { std::cout << "Error sending a packet..." << std::endl; return false; } m_totalSent += packet.getDataSize(); return true; } bool Server::Send(sf::IpAddress & ip, const PortNumber & port, sf::Packet & packet) { if (m_outgoing.send(packet, ip, port) != sf::Socket::Done) return false; m_totalSent += packet.getDataSize(); return true; } void Server::Broadcast(sf::Packet & packet, const ClientID & ignore) { sf::Lock lock(m_mutex); for (auto& iter : m_clients) { if (iter.first != ignore) { if (m_outgoing.send(packet, iter.second.m_clientIP, iter.second.m_clientPort) != sf::Socket::Done) { std::cout << "Error broadcasting a packet to client: " << iter.first << std::endl; continue; } m_totalSent += packet.getDataSize(); } } } void Server::Listen() { sf::IpAddress ip; PortNumber port; sf::Packet packet; std::cout << "Beginning to listen..." << std::endl; while (m_running) { packet.clear(); sf::Socket::Status status = m_incoming.receive(packet, ip, port); if (status != sf::Socket::Done) { if (m_running) { std::cout << "Error receiving a packet from: " << ip << ":" << port << ". Code:" << status << std::endl; continue; } else { std::cout << "Socket unbound." << std::endl; break; } } m_totalReceived += packet.getDataSize(); PacketID pId; // Non-conventional packet if (!(packet >> pId)) { std::cout << "Invalid packet received: unable to extract id." << std::endl; continue; } // Invalid packet type PacketType type = static_cast<PacketType>(pId); if (type < PacketType::Disconnect || type >= PacketType::OutOfBounds) { std::cout << "Invalid packet received: id is out of bounds." << std::endl; continue; } if (type == PacketType::Heartbeat) { bool clientFound = false; sf::Lock lock(m_mutex); for (auto& iter : m_clients) { if (iter.second.m_clientIP != ip || iter.second.m_clientPort != port) continue; clientFound = true; if (!iter.second.m_heartbeatWaiting) { std::cout << "Invalid heartbeat packet received!" << std::endl; break; } iter.second.m_ping = m_serverTime.asMilliseconds() - iter.second.m_heartbeatSent.asMilliseconds(); iter.second.m_lastHeartbeat = m_serverTime; iter.second.m_heartbeatWaiting = false; iter.second.m_heartbeatRetry = 0; break; } if (!clientFound) { std::cout << "Heartbeat from unknown client received..." << std::endl; } } else if (m_packetHandler) { m_packetHandler(ip, port, static_cast<PacketID>(type), packet, this); } } std::cout << "...Listening stopped." << std::endl; } void Server::Update(const sf::Time & time) { m_serverTime += time; if (m_serverTime.asMilliseconds() < 0) { m_serverTime -= sf::milliseconds(sf::Int32(Network::HighestTimestamp)); sf::Lock lock(m_mutex); for (auto& iter : m_clients) { iter.second.m_lastHeartbeat = sf::milliseconds(std::abs(iter.second.m_lastHeartbeat.asMilliseconds() - sf::Int32(Network::HighestTimestamp))); } } sf::Lock lock(m_mutex); for (auto iter = m_clients.begin(); iter != m_clients.end(); ) { sf::Int32 elapsed = m_serverTime.asMilliseconds() - iter->second.m_lastHeartbeat.asMilliseconds(); if (elapsed >= HEARTBEAT_INTERVAL) { if (elapsed >= sf::Int32(Network::ClientTimeout) || iter->second.m_heartbeatRetry > HEARTBEAT_RETRIES) { // Remove client std::cout << "Client " << iter->first << " has timed out." << std::endl; if (m_timeoutHandler) { m_timeoutHandler(iter->first); } iter = m_clients.erase(iter); continue; } if (!iter->second.m_heartbeatWaiting || (elapsed >= HEARTBEAT_INTERVAL * (iter->second.m_heartbeatRetry + 1))) { // Heartbeat if (iter->second.m_heartbeatRetry >= 3) { std::cout << "Re-try(" << iter->second.m_heartbeatRetry << ") heartbeat for client " << iter->first << std::endl; } sf::Packet heartbeat; StampPacket(PacketType::Heartbeat, heartbeat); heartbeat << m_serverTime.asMilliseconds(); Send(iter->first, heartbeat); if (iter->second.m_heartbeatRetry == 0) { iter->second.m_heartbeatSent = m_serverTime; } iter->second.m_heartbeatWaiting = true; ++iter->second.m_heartbeatRetry; m_totalSent += heartbeat.getDataSize(); } } ++iter; } } ClientID Server::AddClient(const sf::IpAddress& ip, const PortNumber& port) { sf::Lock lock(m_mutex); for (auto& iter : m_clients) { if (iter.second.m_clientIP == ip && iter.second.m_clientPort == port) { return ClientID(Network::NullID); } } ClientID id = m_lastID; ClientInfo info(ip, port, m_serverTime); m_clients.emplace(id, info); ++m_lastID; return id; } ClientID Server::GetClientID(const sf::IpAddress& ip, const PortNumber& port) { sf::Lock lock(m_mutex); for (auto& iter : m_clients) { if (iter.second.m_clientIP == ip && iter.second.m_clientPort == port) return iter.first; } return ClientID(Network::NullID); } bool Server::HasClient(const ClientID& id) { return m_clients.find(id) != m_clients.end(); } bool Server::HasClient(const sf::IpAddress& ip, const PortNumber & port) { return GetClientID(ip, port) >= 0; } bool Server::GetClientInfo(const ClientID& id, ClientInfo & info) { sf::Lock lock(m_mutex); for (auto& iter : m_clients) { if (iter.first == id) { info = iter.second; return true; } } return false; } bool Server::RemoveClient(const ClientID& id) { sf::Lock lock(m_mutex); auto iter = m_clients.find(id); if (iter == m_clients.end()) return false; sf::Packet p; StampPacket(PacketType::Disconnect, p); Send(id, p); m_clients.erase(iter); return true; } bool Server::RemoveClient(const sf::IpAddress& ip, const PortNumber& port) { sf::Lock lock(m_mutex); for (auto iter = m_clients.begin(); iter != m_clients.end(); ++iter) { if (iter->second.m_clientIP == ip && iter->second.m_clientPort == port) { sf::Packet p; StampPacket(PacketType::Disconnect, p); Send(iter->first, p); m_clients.erase(iter); return true; } } return false; } void Server::DisconnectAll() { if (!m_running) return; sf::Packet p; StampPacket(PacketType::Disconnect, p); Broadcast(p); sf::Lock lock(m_mutex); m_clients.clear(); } bool Server::Start() { if (m_running) return false; if (m_incoming.bind(static_cast<unsigned short>(Network::ServerPort) != sf::Socket::Done)) return false; m_outgoing.bind(sf::Socket::AnyPort); Setup(); std::cout << "Incoming port: " << m_incoming.getLocalPort() << ". Outgoing port: " << m_outgoing.getLocalPort() << std::endl; m_listenThread.launch(); m_running = true; return true; } bool Server::Stop() { if (!m_running) return false; DisconnectAll(); m_running = false; m_incoming.unbind(); return true; } bool Server::IsRunning() { return m_running; } unsigned int Server::GetClientCount() { return m_clients.size(); } std::string Server::GetClientList() { std::string list; std::string delimiter = "--------------------------------------"; list = delimiter; list += '\n'; list += "ID"; list += '\t'; list += "Client IP:PORT"; list += '\t'; list += '\t'; list += "Ping"; list += '\n'; list += delimiter; list += '\n'; for (auto iter = m_clients.begin(); iter != m_clients.end(); ++iter) { list += std::to_string(iter->first); list += '\t'; list += iter->second.m_clientIP.toString() + ":" + std::to_string(iter->second.m_clientPort); list += '\t'; list += std::to_string(iter->second.m_ping) + "ms."; list += '\n'; } list += delimiter; list += '\n'; list += "Total data sent: " + std::to_string(m_totalSent / 1000) + "kB. Total data received: " + std::to_string(m_totalReceived / 1000) + "kB"; return list; } sf::Mutex& Server::GetMutex() { return m_mutex; } void Server::Setup() { m_lastID = 0; m_running = false; m_totalSent = 0; m_totalReceived = 0; }
304c22821f55705f1f04b202250a1a0f259c4412
9f520bcbde8a70e14d5870fd9a88c0989a8fcd61
/pitzDaily/76/pa
8989a599dff450698e60c93df99b59fbf7e32097
[]
no_license
asAmrita/adjoinShapOptimization
6d47c89fb14d090941da706bd7c39004f515cfea
079cbec87529be37f81cca3ea8b28c50b9ceb8c5
refs/heads/master
2020-08-06T21:32:45.429939
2019-10-06T09:58:20
2019-10-06T09:58:20
213,144,901
1
0
null
null
null
null
UTF-8
C++
false
false
107,336
pa
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v1806 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "76"; object pa; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField nonuniform List<scalar> 6400 ( -0.09352180353 -0.0935295400824 -0.0935509952196 -0.0935908986342 -0.0936455903391 -0.0937134479893 -0.0937954532178 -0.0938972647204 -0.0940171146796 -0.0941507243858 -0.0943210707314 -0.0945402498622 -0.094789072508 -0.0950691763457 -0.0953909685832 -0.0957651779084 -0.096191276384 -0.096664081366 -0.0971827243911 -0.0977315752827 -0.0982787839729 -0.0988169265778 -0.0993644068726 -0.0999478457044 -0.100590912787 -0.101293581481 -0.102037514562 -0.102811983173 -0.103620934018 -0.104474286266 -0.105382090904 -0.106342197698 -0.107322724539 -0.108294218637 -0.109258254618 -0.110186843105 -0.111057247225 -0.111941059079 -0.112839999607 -0.113659090846 -0.114397792342 -0.115164748877 -0.116011718452 -0.116891041294 -0.117781916567 -0.118669094594 -0.11953869094 -0.120394877405 -0.121244591829 -0.122083947309 -0.122934629777 -0.123696084824 -0.124359314248 -0.124923000301 -0.125417250282 -0.125951502867 -0.126477238707 -0.126857093579 -0.127126445821 -0.127337590926 -0.127511208807 -0.127663900145 -0.127791062309 -0.127912575798 -0.128105184173 -0.12840447773 -0.128789902837 -0.129179882144 -0.129511543762 -0.129777287855 -0.129991574368 -0.130171947984 -0.130330101884 -0.130464212365 -0.130578856962 -0.13067466617 -0.130751676267 -0.130801187926 -0.130832537278 -0.130845463594 -0.0935097361176 -0.0935177189237 -0.0935360113111 -0.0935750711129 -0.093636548327 -0.0937118168045 -0.0937966902144 -0.0938918405093 -0.0940038380854 -0.0941387370457 -0.0943077774582 -0.0945197465286 -0.0947697160977 -0.095055739115 -0.0953805825398 -0.0957481515749 -0.0961707322507 -0.0966463714902 -0.0971748747733 -0.0977350326733 -0.0982756700833 -0.0988025396403 -0.0993450244368 -0.0999216808496 -0.100564092768 -0.10127323049 -0.10201571633 -0.102791327518 -0.103606167816 -0.104464864916 -0.105368004423 -0.10632669598 -0.107317495085 -0.108289012853 -0.109260723711 -0.11019276547 -0.111060531288 -0.111950969528 -0.112855747834 -0.113659020064 -0.11433321916 -0.115058070518 -0.11597132158 -0.116885333625 -0.117794784892 -0.118701665253 -0.119589589336 -0.120462814796 -0.121313374413 -0.122119031716 -0.122896261691 -0.123661566372 -0.124441382472 -0.125019373889 -0.125530633315 -0.12613166276 -0.126583433779 -0.126896409209 -0.127150094335 -0.127354308613 -0.127507464838 -0.127656199545 -0.127805744734 -0.127928664814 -0.128126636069 -0.128429401633 -0.128821616224 -0.12921224037 -0.129541557314 -0.129805717167 -0.130018540213 -0.130198111643 -0.130356523128 -0.130491473446 -0.130603682053 -0.130695449381 -0.130766068157 -0.130813315201 -0.130843106065 -0.130853231102 -0.0934768174797 -0.0934906056141 -0.0935052487865 -0.0935408287159 -0.0936010105833 -0.093687425364 -0.0937835093559 -0.0938761214181 -0.0939801907412 -0.0941107636192 -0.0942768425893 -0.0944846868299 -0.0947339628856 -0.0950218658122 -0.0953471853118 -0.095697217687 -0.0961093233752 -0.0966261967789 -0.0971757820937 -0.0977307571933 -0.0982516729201 -0.0987415912838 -0.0992677990107 -0.0998610380804 -0.100503541469 -0.101200796154 -0.101948448134 -0.102734624868 -0.103556743515 -0.104422269137 -0.105327990095 -0.106287075354 -0.107299783522 -0.108263324527 -0.109215422313 -0.110186825571 -0.111050401434 -0.111912137286 -0.112821479263 -0.113640899471 -0.114370212648 -0.115125544196 -0.115974933646 -0.116868106533 -0.117775772746 -0.118684462039 -0.119582723479 -0.120464587019 -0.121322890539 -0.122149612355 -0.122943117698 -0.123692336182 -0.124376410342 -0.124998458145 -0.125639867602 -0.126222596503 -0.126630904907 -0.12693872457 -0.127189545245 -0.127393536467 -0.127561494146 -0.127713334161 -0.127837737013 -0.127964179836 -0.128184497536 -0.128503530292 -0.128887421763 -0.129268778735 -0.129599110231 -0.129865251686 -0.130079222044 -0.130257948511 -0.13040973608 -0.130536561662 -0.130643575685 -0.130729962684 -0.130793537788 -0.130836437301 -0.130863054733 -0.130872495746 -0.0934342582404 -0.0934473728645 -0.0934564152658 -0.0934892868934 -0.0935419697779 -0.0936271231116 -0.0937570859961 -0.0938485060845 -0.0939446706594 -0.0940677977013 -0.0942299045859 -0.0944351464108 -0.094683993952 -0.0949670879993 -0.0952939406357 -0.0956813613144 -0.0961282958877 -0.0966341861426 -0.0971544703426 -0.0976478271036 -0.0981316606832 -0.0986343750433 -0.099168343901 -0.0997536249136 -0.100397111563 -0.101100293513 -0.101858186308 -0.10265526534 -0.103490163645 -0.104361817554 -0.105282582069 -0.106250539909 -0.107261720479 -0.108280251512 -0.10920968681 -0.11013191239 -0.111054911959 -0.111901505201 -0.112716498648 -0.113516408027 -0.114297624653 -0.115097782226 -0.115950605121 -0.116841414289 -0.117751107703 -0.118665475106 -0.119572630074 -0.120463940638 -0.12133184688 -0.122169420859 -0.122971397567 -0.123730128635 -0.124441236488 -0.125107864009 -0.125736471857 -0.126277406915 -0.126691038151 -0.127006005216 -0.127256618208 -0.127463207885 -0.127638012118 -0.127790229705 -0.127922914509 -0.128077614819 -0.128296863421 -0.128603980353 -0.128985527854 -0.129366896949 -0.129698060097 -0.129964227801 -0.130172983364 -0.130339616635 -0.130478591365 -0.130601526769 -0.130706563995 -0.130785059586 -0.130838602558 -0.130878266538 -0.130905207853 -0.130916630368 -0.0933691281628 -0.0933681533525 -0.0933799854291 -0.0934136210219 -0.0934711266808 -0.0935481628952 -0.0936618689382 -0.0937686373417 -0.0938745026445 -0.0940018294869 -0.0941617406309 -0.094365542755 -0.0946167070357 -0.0949287584966 -0.0952967154 -0.0956946259816 -0.0961239022952 -0.0965768940009 -0.0970370295347 -0.0975095494327 -0.0979984233112 -0.0984993493346 -0.099031690761 -0.0996181553141 -0.100263977491 -0.100975154469 -0.101740394534 -0.102552648777 -0.103400228625 -0.104291665833 -0.105222213975 -0.106218763065 -0.107283258954 -0.108257044102 -0.109192662107 -0.110097668588 -0.11094313377 -0.111767977779 -0.112581464478 -0.113392958111 -0.114204771842 -0.115032792068 -0.115895437934 -0.116790680834 -0.117706788461 -0.118630521855 -0.119549240752 -0.120452995425 -0.121334103444 -0.122186574883 -0.123005167119 -0.123784321837 -0.124520642552 -0.125211195847 -0.125842361106 -0.126377713686 -0.126796088696 -0.127116907674 -0.127371880275 -0.127581862673 -0.127760144592 -0.127915512649 -0.128063126579 -0.128250807025 -0.128454041661 -0.128753093264 -0.129129359353 -0.129507933128 -0.129837749485 -0.13009874917 -0.130293986403 -0.130445303566 -0.130580149947 -0.130703922838 -0.130801054859 -0.130868379266 -0.130916263403 -0.130958284639 -0.130983632906 -0.130991828872 -0.0932430880332 -0.0932392837249 -0.0932659599906 -0.093298098062 -0.0933595985227 -0.093444525788 -0.09354580915 -0.0936577036995 -0.0937752717715 -0.0939101259983 -0.0940644772257 -0.0942728071014 -0.0945650567509 -0.0949117597277 -0.0952810898678 -0.0956593812503 -0.0960483016522 -0.0964573889866 -0.096899227485 -0.0973668100712 -0.0978384249089 -0.0983294786585 -0.0988623937492 -0.0994541723726 -0.100106697198 -0.100817486945 -0.10160060305 -0.102424784058 -0.10329500714 -0.104201639686 -0.10516318194 -0.106182702396 -0.107227960148 -0.108261790176 -0.109148242539 -0.109968030266 -0.110778720527 -0.111596345422 -0.11241908816 -0.113247355661 -0.114082842865 -0.114934710849 -0.115813245197 -0.116719767847 -0.117647077674 -0.118583479969 -0.119516512804 -0.120435659783 -0.121334031672 -0.122207156994 -0.123050707527 -0.123859252231 -0.124626274153 -0.125340647328 -0.125981242938 -0.126520574497 -0.126948624358 -0.12728252917 -0.127545645425 -0.127757775494 -0.12793544694 -0.12809539885 -0.128280533837 -0.128474657602 -0.128657616997 -0.128959877266 -0.129339242535 -0.12971050291 -0.130028708444 -0.130272254021 -0.130448454827 -0.130593131266 -0.130731230335 -0.130847384804 -0.130930824593 -0.130987644298 -0.131034444205 -0.131072935023 -0.131092524492 -0.131100949919 -0.0930486359396 -0.0930613910706 -0.093114248752 -0.0931638835955 -0.0932112060972 -0.093295188696 -0.0934068262316 -0.0935201801938 -0.0936474444964 -0.0937899649963 -0.093960895372 -0.0941780688772 -0.0945033305337 -0.094853615282 -0.0952083342885 -0.0955515525657 -0.0959087115045 -0.0963106612215 -0.0967537849078 -0.0971923460047 -0.0976442229638 -0.0981337148784 -0.0986666369965 -0.0992564345012 -0.0999120738665 -0.10065117107 -0.101428815414 -0.102276790193 -0.103168557365 -0.104117771991 -0.105110452077 -0.106127495965 -0.107182849402 -0.108158309287 -0.109005791054 -0.109781539327 -0.110576490194 -0.111397474055 -0.11223295158 -0.113076958732 -0.113932252983 -0.114805668015 -0.115702828784 -0.116625234593 -0.117567881706 -0.118520366786 -0.119470613493 -0.120408778628 -0.121329602904 -0.122230341001 -0.12310713381 -0.123953099746 -0.124756959404 -0.125500713456 -0.126160383 -0.126715047132 -0.127160926438 -0.127511253054 -0.127782135053 -0.127989162119 -0.128157841405 -0.128331909431 -0.128531834536 -0.128713119179 -0.128942046328 -0.129240280981 -0.12962229013 -0.129976821257 -0.130269173319 -0.130488489515 -0.130653959533 -0.130802183532 -0.130935376812 -0.131034106046 -0.131101195012 -0.131148497872 -0.131191040683 -0.131218903838 -0.131229750532 -0.131235529747 -0.0928226029773 -0.0928497417906 -0.0929158832655 -0.0929958931292 -0.0930486356165 -0.0931306321009 -0.0932399187433 -0.0933569283552 -0.0934975582357 -0.0936298176624 -0.0938269616423 -0.0940929585106 -0.094411155893 -0.0947533096009 -0.0950775212576 -0.0953854190576 -0.0957394199222 -0.0961536646413 -0.0965706979248 -0.0969831776348 -0.0974192333005 -0.0979073686914 -0.0984434763942 -0.0990431017305 -0.0997105224342 -0.100453420158 -0.10126134445 -0.102086107012 -0.103033462584 -0.104052917524 -0.105038311166 -0.106018018847 -0.107072927828 -0.107979832088 -0.108770893657 -0.10954949272 -0.110347147635 -0.111172904327 -0.112019209445 -0.112878050037 -0.113751283614 -0.114645065572 -0.115562847214 -0.116504690054 -0.117466118712 -0.118437710885 -0.119408311487 -0.120369778339 -0.121319094846 -0.122255107675 -0.123173824969 -0.124065869334 -0.124914634469 -0.125696238674 -0.126385806183 -0.126967516147 -0.127439894651 -0.127809346878 -0.128080377828 -0.128260496214 -0.1284040503 -0.12857050181 -0.128772737731 -0.12900337207 -0.129281281653 -0.129582476671 -0.129972032355 -0.130307373087 -0.130571402796 -0.130771383195 -0.130933724971 -0.131079603152 -0.131193073106 -0.131268211039 -0.131315695273 -0.131350390485 -0.131376291319 -0.131388437934 -0.131385122021 -0.13138396667 -0.0925783287753 -0.0926154459025 -0.0926844489599 -0.0927458718645 -0.0928226286656 -0.0929368394477 -0.0930395717783 -0.0931591897287 -0.0933207210252 -0.0934707510973 -0.093650304918 -0.0939513346739 -0.0942799719319 -0.0946021182609 -0.0948985770736 -0.0952051261746 -0.0955522392693 -0.0959554018024 -0.096349325492 -0.0967468632417 -0.0971707773 -0.0976469469317 -0.0981768490264 -0.0987773175476 -0.0994977979763 -0.100235868662 -0.101069662241 -0.101947600126 -0.102889242867 -0.103896259456 -0.10491522232 -0.105951374669 -0.106866204913 -0.107708967495 -0.108495879024 -0.109283768745 -0.110088954145 -0.110919416744 -0.111773976805 -0.112646646304 -0.113537783545 -0.114451802884 -0.115391242874 -0.116355155147 -0.117338302747 -0.118331586011 -0.119325764353 -0.120315460774 -0.121299998071 -0.122279471329 -0.123249408512 -0.124197374451 -0.125100885249 -0.125930525779 -0.126660915684 -0.127279789241 -0.127785339044 -0.128173175637 -0.128430211291 -0.128552402974 -0.128651628893 -0.128811451434 -0.129044236454 -0.129332571234 -0.129652616948 -0.130035168331 -0.130435037616 -0.130724750953 -0.130956730483 -0.131142285751 -0.131299041449 -0.131426033765 -0.131508658696 -0.131553953325 -0.131575729458 -0.131586016138 -0.13158346865 -0.131571728802 -0.13155336855 -0.131540857292 -0.0923136122333 -0.0923603882058 -0.0924397968871 -0.0925018575309 -0.0925811274815 -0.0927012444981 -0.0928036273628 -0.0929230133504 -0.0930711280844 -0.0932792447961 -0.0934755217461 -0.0937732805885 -0.0941041635109 -0.0944044481615 -0.0946743773733 -0.0949894402986 -0.0953552456535 -0.0957288385538 -0.0960957574334 -0.0964810493026 -0.0969035016475 -0.0973714109788 -0.0978954867673 -0.0984790580965 -0.0992303209664 -0.100016133637 -0.100793339517 -0.101734716653 -0.102690510645 -0.10373220259 -0.10474875029 -0.105755703626 -0.106627373261 -0.107406438798 -0.108189144541 -0.10898674744 -0.109799575356 -0.110634812894 -0.111495203369 -0.112379319335 -0.113287874373 -0.114222913243 -0.115185204968 -0.116172920647 -0.117180257224 -0.118198091493 -0.119219069704 -0.120241732228 -0.121268456324 -0.122300078535 -0.123331245038 -0.124346005658 -0.12531544235 -0.126203854412 -0.126984591814 -0.127647695795 -0.12818775121 -0.128582062504 -0.128790273239 -0.128818579825 -0.128876030756 -0.129059120952 -0.129345239301 -0.129696386396 -0.130093507302 -0.130529047366 -0.130927163785 -0.131245271464 -0.131446544918 -0.131618510113 -0.131755712774 -0.131846613409 -0.131889198755 -0.131896356757 -0.131882154526 -0.131852981606 -0.131812424891 -0.131769977704 -0.131732475714 -0.131710802913 -0.0920178849465 -0.0920659605313 -0.0921481961466 -0.0922324702855 -0.0923400617244 -0.0924318532434 -0.0925310551919 -0.0926555883172 -0.0927715611832 -0.0930004854499 -0.0932453572372 -0.0935444637452 -0.0938757321297 -0.0941671478978 -0.0944313492722 -0.094737607632 -0.0951095526669 -0.0954634754775 -0.0958101372688 -0.0961783147888 -0.0966004359199 -0.0970716683694 -0.0976146245859 -0.0981893966893 -0.0988875745661 -0.0997628043729 -0.100579410203 -0.101501945027 -0.102455073631 -0.103411251045 -0.104489634887 -0.105475255024 -0.106307912024 -0.107063206989 -0.10784961666 -0.10865529248 -0.109475648531 -0.110316511834 -0.111181627881 -0.112073809048 -0.112997907839 -0.11395443368 -0.114940715051 -0.115953736874 -0.116987189314 -0.118032156491 -0.119083648434 -0.120144298439 -0.121219690355 -0.122311816593 -0.123414204143 -0.124507288746 -0.125554635218 -0.126512974877 -0.127351279392 -0.128058037327 -0.128615936993 -0.128957222651 -0.129001260808 -0.128972014442 -0.129046080953 -0.129306367091 -0.129681722914 -0.130119956295 -0.130587654089 -0.131053687639 -0.131481013276 -0.131852266771 -0.132044018165 -0.1322237922 -0.132318599669 -0.132355743971 -0.132346634471 -0.132301904488 -0.132237073684 -0.132155096833 -0.132065653803 -0.131984230419 -0.131923130385 -0.131888878136 -0.0916848078055 -0.0917238106999 -0.0917801471837 -0.0918905773058 -0.0920407068705 -0.0921216673357 -0.0922191425945 -0.0923565288776 -0.0924652426314 -0.0926747889523 -0.0929564803643 -0.0932640506472 -0.0935907643365 -0.0938791310165 -0.0941660256382 -0.0944731787006 -0.0948301910335 -0.0951636284936 -0.0954952586396 -0.0958472729606 -0.0962514802988 -0.0967073528599 -0.0972915636704 -0.0979282565786 -0.098580662691 -0.0994436312557 -0.10030367403 -0.101170300581 -0.10220630995 -0.103189515479 -0.104195603362 -0.105083041834 -0.105890778937 -0.106676129398 -0.10747106949 -0.108283929211 -0.109112471438 -0.109960817375 -0.110832141082 -0.111728903201 -0.112663140619 -0.113640269753 -0.11465283407 -0.115692689399 -0.116753586999 -0.117828142586 -0.118914013426 -0.120017653653 -0.12114773609 -0.122307717462 -0.123490594715 -0.124672126048 -0.125810195158 -0.126852264436 -0.127753083822 -0.128491154713 -0.129012956 -0.129124191428 -0.129051204208 -0.129014450304 -0.129184840477 -0.129583985316 -0.13008617485 -0.130636382759 -0.131188512567 -0.131693600162 -0.132132964298 -0.132499784358 -0.132764965098 -0.132978425441 -0.133019524216 -0.132975104352 -0.132900675437 -0.132781626003 -0.132649352182 -0.132497768279 -0.132342227671 -0.132208124549 -0.132107428032 -0.132055384195 -0.0913132179997 -0.0913413029262 -0.0913603963735 -0.0914872454226 -0.091632657983 -0.0917382219687 -0.091848607429 -0.0920007883519 -0.0921321920538 -0.0923306224698 -0.0926257213036 -0.0929355872489 -0.0932523517749 -0.0935234782345 -0.093835311293 -0.0941748735789 -0.0945129173374 -0.0948285368436 -0.0951485233565 -0.0954916026599 -0.0958754923226 -0.096300209178 -0.0968597942567 -0.0976076067783 -0.0982839338651 -0.0990541554935 -0.0999855185118 -0.100870050203 -0.101822674435 -0.10282960551 -0.103806146775 -0.104665610917 -0.10544083681 -0.10624258074 -0.107049337348 -0.107870537146 -0.108705268844 -0.109557644443 -0.110438480114 -0.111344783297 -0.11228509331 -0.113275795572 -0.114313410197 -0.11538273306 -0.116473076949 -0.117579431881 -0.118703406764 -0.119854949272 -0.121045111972 -0.122278671753 -0.12354770758 -0.124824907489 -0.12606919194 -0.127216095328 -0.128183128864 -0.128931139298 -0.129325946552 -0.129193931266 -0.129045731053 -0.12904498506 -0.129376165809 -0.129947367592 -0.130607514563 -0.131305055847 -0.131966038949 -0.132503913385 -0.132940259807 -0.133284980915 -0.133698576723 -0.13393838978 -0.133868060175 -0.133720498091 -0.133570907696 -0.133341535129 -0.133130617249 -0.132885535598 -0.132632467318 -0.132424116897 -0.132266453455 -0.132183374634 -0.0909073781499 -0.0909397950013 -0.0909828930873 -0.0910601874463 -0.0911817778939 -0.0913017282016 -0.0914277707907 -0.0915852647669 -0.091757650521 -0.0919529325909 -0.0922540672866 -0.0925633649158 -0.0928723139297 -0.0931325622669 -0.0934312700305 -0.093802959452 -0.0941429911021 -0.0944533336621 -0.0947657630016 -0.0951029229629 -0.0954757342203 -0.095877214234 -0.0964015131708 -0.097186562206 -0.097934639868 -0.098669640595 -0.099613473051 -0.100531575542 -0.10142846094 -0.102420972427 -0.103307113095 -0.104131470241 -0.104938192882 -0.105758920325 -0.106578732369 -0.107407764614 -0.108253785239 -0.109111302568 -0.109990954699 -0.110907091063 -0.111859659466 -0.112861190554 -0.113917666783 -0.115014943502 -0.116136928356 -0.117278392636 -0.118444438395 -0.119648003184 -0.120900754348 -0.122211168304 -0.123567673641 -0.124941765952 -0.12630963602 -0.127595637507 -0.128640024817 -0.12939484163 -0.129507026197 -0.129209874367 -0.12902944477 -0.129105288264 -0.129658775707 -0.130445487679 -0.131294158251 -0.132196705689 -0.132991908067 -0.133472179059 -0.133843735424 -0.134148908073 -0.134444991402 -0.134699534238 -0.134882387907 -0.134538843823 -0.134369978299 -0.133953070184 -0.133685119274 -0.133323674244 -0.132913184806 -0.132612574189 -0.13236650755 -0.132242097901 -0.0904556573418 -0.0904910138444 -0.0905729056695 -0.09060732397 -0.090699836681 -0.0908230862282 -0.0909611131069 -0.0911317837987 -0.0913556896279 -0.0915429038616 -0.0918418449011 -0.0921502180451 -0.0924549629786 -0.092717865908 -0.0930114639208 -0.0933897288764 -0.0937310850886 -0.094041111769 -0.0943495657211 -0.0946796065018 -0.0950441866688 -0.0954374970026 -0.0959192981136 -0.0966659186505 -0.0975250254695 -0.0982826267047 -0.0991466360039 -0.10016136319 -0.101099475506 -0.101948999667 -0.102775888389 -0.103579377698 -0.104397007506 -0.10522651554 -0.106057499306 -0.106896491397 -0.107745404292 -0.108612382238 -0.10949624039 -0.110411212996 -0.11137367874 -0.112388801026 -0.11346161577 -0.114582601485 -0.115736025386 -0.116916782468 -0.118126349446 -0.119382240028 -0.120702217689 -0.122088087178 -0.123520408124 -0.124981519425 -0.126488569212 -0.127960144644 -0.12910528368 -0.129710381296 -0.129557626868 -0.129176883848 -0.129031189915 -0.129278362232 -0.130156217043 -0.131240512914 -0.132069293148 -0.132890371931 -0.133320828253 -0.133618974505 -0.13390084022 -0.134159674806 -0.134407578335 -0.134622445836 -0.13483028426 -0.135311341899 -0.135764155603 -0.134582998885 -0.134319557525 -0.133813019291 -0.133126174938 -0.132750676809 -0.13235904288 -0.132176999959 -0.0899487204419 -0.0899788338858 -0.0900451885759 -0.0900882740617 -0.0901673915212 -0.0902969618743 -0.0904384425182 -0.0906016999413 -0.0908743130056 -0.0910902670946 -0.0913837619275 -0.0916940562659 -0.0919995452526 -0.0922761917479 -0.0925724277588 -0.0929461122792 -0.0932853177924 -0.0935973051996 -0.0939038440881 -0.0942277383865 -0.0945815924042 -0.094969352375 -0.0954279802469 -0.0961237539397 -0.0970312187128 -0.0978547136727 -0.0986480313518 -0.0996022980929 -0.100588510577 -0.10143031808 -0.102218116619 -0.103000018563 -0.10381872284 -0.104654825224 -0.10549304368 -0.106333372208 -0.107186915173 -0.108052181062 -0.108941893557 -0.109857609139 -0.110822210211 -0.111849303065 -0.112939394978 -0.114077588364 -0.115250927658 -0.116467245857 -0.117732456025 -0.119055048002 -0.120435171443 -0.121861527303 -0.123343068415 -0.124885885635 -0.126493111544 -0.12830214324 -0.12944986701 -0.12971688229 -0.129465907033 -0.12915590918 -0.129194886133 -0.129838109022 -0.130938364169 -0.131431370812 -0.131828860463 -0.132435001608 -0.132858283677 -0.133073719828 -0.13318212283 -0.133254317359 -0.133353110466 -0.133507637805 -0.133630760267 -0.133443460639 -0.133265244031 -0.134073735675 -0.135634667223 -0.135051775492 -0.133184993324 -0.132846043826 -0.132138623183 -0.131905231867 -0.0893984877795 -0.0894233598262 -0.0894867302134 -0.0895261476127 -0.0896013391691 -0.0897311144242 -0.0898727071595 -0.0900161496759 -0.0902838569486 -0.0905577188828 -0.0908677615345 -0.0911866288595 -0.091498471215 -0.0918047869321 -0.0921038195008 -0.0924703744866 -0.0928068850471 -0.0931239634309 -0.0934301928811 -0.0937493493333 -0.0940933476222 -0.094469010409 -0.0949091902366 -0.0955514894346 -0.0964315901048 -0.0973687818652 -0.0981677427058 -0.0990380137438 -0.0999669248825 -0.100782787363 -0.101546311691 -0.102349518861 -0.103180143267 -0.104023350353 -0.104873613393 -0.10572193608 -0.106571496409 -0.107436558401 -0.108322496677 -0.109239120981 -0.110203157843 -0.11122728296 -0.112326251497 -0.113486103663 -0.114683497978 -0.115939713438 -0.117260242965 -0.118639924487 -0.120050162825 -0.121491796464 -0.122984350851 -0.124551965549 -0.126209874963 -0.127978357274 -0.129693759148 -0.129733435331 -0.129449317101 -0.129290910222 -0.129636683333 -0.129974751407 -0.130323479322 -0.130874441806 -0.131191770099 -0.131414733631 -0.13135183599 -0.131007084047 -0.130439682886 -0.129757585076 -0.129075564063 -0.128490061758 -0.128034823965 -0.127695611627 -0.127693750734 -0.128100567231 -0.12865427659 -0.129158456953 -0.131315905272 -0.133706614046 -0.131588990044 -0.13134725335 -0.0888136922581 -0.0888318549566 -0.0888747320813 -0.0889152668227 -0.0890064959321 -0.0891328681181 -0.0892798688607 -0.0894130121594 -0.0896687489218 -0.0899736257145 -0.0902965708743 -0.0906208547383 -0.0909312263976 -0.091275009207 -0.091592947875 -0.0919511824949 -0.0922870290191 -0.0926168111772 -0.092925258396 -0.0932416285598 -0.0935776204679 -0.0939388789136 -0.0943600314685 -0.0949575524275 -0.095801647743 -0.096791346061 -0.0976643641493 -0.0984920804906 -0.0993315129451 -0.100098446001 -0.10083659708 -0.101640537655 -0.10246942214 -0.103318800404 -0.104179084238 -0.105037694934 -0.105895463063 -0.106757019678 -0.107639936719 -0.108548174799 -0.109500112367 -0.110525325345 -0.1116243222 -0.112785808845 -0.113955875398 -0.115199202012 -0.116601166049 -0.118086367726 -0.119533136059 -0.120953379068 -0.122424206009 -0.123964074027 -0.125611875302 -0.127425330907 -0.129640921921 -0.129903448109 -0.129700132529 -0.129578942498 -0.129601263199 -0.129459462602 -0.12954374321 -0.129692914144 -0.129468043426 -0.128791263388 -0.127636484937 -0.126119015642 -0.124372281286 -0.122543621504 -0.120757432271 -0.119126773657 -0.117763300863 -0.116703874773 -0.115996044576 -0.115975198031 -0.117107093971 -0.119307889633 -0.121862038291 -0.124273875369 -0.129434341551 -0.130312369398 -0.0882032548955 -0.0882161904544 -0.088236833156 -0.0882803538561 -0.0883864709198 -0.0885055504908 -0.0886538214535 -0.0887974513639 -0.089029177539 -0.0893463058118 -0.0896743910908 -0.0899988348318 -0.0902995846879 -0.0906493353212 -0.0910128385206 -0.0913742538125 -0.0917108215454 -0.0920544156672 -0.0923775724511 -0.0926970408635 -0.0930301152278 -0.0933737735609 -0.0937754851264 -0.0943309518261 -0.0951153504343 -0.0960609886674 -0.0970141770321 -0.0978481050905 -0.098639213888 -0.0993783431826 -0.100084068647 -0.100874779397 -0.101710856686 -0.102537818203 -0.103406703972 -0.104273456447 -0.105133768253 -0.105999042253 -0.106881784089 -0.107793102487 -0.108729772562 -0.109725745464 -0.110797418295 -0.111951242836 -0.113152475963 -0.114375731187 -0.11572246358 -0.117154434189 -0.118617735217 -0.120054445802 -0.121497951626 -0.122937821085 -0.124442388814 -0.126122337101 -0.12808443084 -0.130543051903 -0.13033580861 -0.129858437942 -0.129140133239 -0.128518467082 -0.127922114674 -0.127045771251 -0.125617083004 -0.123642319965 -0.121234703786 -0.118614207456 -0.115983343368 -0.113485327552 -0.111159225032 -0.108975606482 -0.106929180743 -0.105065100249 -0.103282852432 -0.101857665066 -0.101455781468 -0.102752718505 -0.105937516907 -0.110038695021 -0.115452957084 -0.132388135221 -0.087567952665 -0.0875784132111 -0.0875912407865 -0.0876460889615 -0.0877498201421 -0.0878537379108 -0.0879845971231 -0.0881498823938 -0.0883564187128 -0.0886736947347 -0.0890031902737 -0.0893272027161 -0.0896242137903 -0.0899614169475 -0.0903604363211 -0.09073771429 -0.0910811042764 -0.0914299811418 -0.0917703350072 -0.0921027738817 -0.0924437838401 -0.0927722069398 -0.0931515537359 -0.0936695969516 -0.0943929410795 -0.0952797358304 -0.0962277687813 -0.0970950062746 -0.0978186452536 -0.0985252255083 -0.0992446444528 -0.0999873977604 -0.100815601006 -0.101657131294 -0.102541151642 -0.103422124486 -0.104283015676 -0.105148693489 -0.106032491555 -0.10694207829 -0.107877821216 -0.108850439339 -0.10991200808 -0.111055901657 -0.112264541634 -0.113487744098 -0.114784348203 -0.116166588464 -0.117576949911 -0.11896052325 -0.120282216127 -0.121399077642 -0.122443590991 -0.123722878285 -0.125026246573 -0.128192842554 -0.131296191809 -0.129965402634 -0.127874665163 -0.126347340791 -0.124499785798 -0.122260843018 -0.119515226781 -0.116413854975 -0.113143683006 -0.10991610811 -0.106863470946 -0.104006956144 -0.101238895715 -0.0983801238182 -0.0953167239735 -0.0920942671062 -0.088752104869 -0.0853510767626 -0.08233019681 -0.0804695384265 -0.0803885523704 -0.0802122422531 -0.0737830525333 -0.0587130220151 -0.0868973392781 -0.0869062830882 -0.0869204250762 -0.0869958124961 -0.0870918195014 -0.0871791517775 -0.0872837079424 -0.0874635504078 -0.0876401667978 -0.0879503537717 -0.0882815452551 -0.0886059672566 -0.0889044192523 -0.0892392654382 -0.0896509641669 -0.090044297472 -0.0904007277488 -0.0907568793129 -0.0911034139758 -0.0914487132754 -0.0918056924111 -0.0921278717843 -0.0924791879774 -0.092963269686 -0.0936304233567 -0.0944548027624 -0.0953801495284 -0.0962525098361 -0.0970168780339 -0.0976529634876 -0.0983563087319 -0.099092086751 -0.0998708882869 -0.100649022185 -0.101521220843 -0.102458117109 -0.103335771031 -0.104215485449 -0.105091450464 -0.105990854396 -0.106928154402 -0.107908348895 -0.108964007873 -0.110129836417 -0.111339617567 -0.112565281734 -0.113843634375 -0.115211753843 -0.116622912521 -0.117922999253 -0.119064178752 -0.119578884661 -0.120223131977 -0.122254763687 -0.123506859014 -0.125641651459 -0.127377769939 -0.126487426224 -0.124567316099 -0.12209233953 -0.119051285138 -0.115610393484 -0.111842406753 -0.107950507627 -0.104079719349 -0.10031963461 -0.0966583346896 -0.0929976113191 -0.0891774086052 -0.0850256937137 -0.0804318638504 -0.0754126116729 -0.0700375093699 -0.0641564950035 -0.0578231718097 -0.051574571094 -0.0450469421023 -0.0330131193406 -0.00480881116286 0.0309831836309 -0.0861697980592 -0.0861761255336 -0.0861991713361 -0.0863019995858 -0.0863904653574 -0.0864650038827 -0.0865548172798 -0.0867300406948 -0.0868773124212 -0.0871730628009 -0.087506035545 -0.0878312895514 -0.0881321388322 -0.0884648433715 -0.0888794067093 -0.0892856959654 -0.0896642693463 -0.0900286515574 -0.0903752914689 -0.0907280715269 -0.0911010877131 -0.0914285707471 -0.0917467747065 -0.0921973525047 -0.0928156593967 -0.0935727413694 -0.0944471857623 -0.0952612397203 -0.0960714247084 -0.0967310206187 -0.0973818743862 -0.0980636742323 -0.0988413912758 -0.099650701406 -0.100439391594 -0.10135008869 -0.102259229554 -0.103157605772 -0.104057948146 -0.104953359608 -0.105883734475 -0.106880376409 -0.107955775714 -0.109127511627 -0.110320417134 -0.111532134646 -0.112828796303 -0.114250370193 -0.115752437554 -0.116999398054 -0.118509265025 -0.119609099469 -0.120018000506 -0.120297516883 -0.120841435153 -0.121440427618 -0.121866878254 -0.121157004976 -0.119160121326 -0.115975852903 -0.112073196207 -0.107770518974 -0.103286176805 -0.0988102007512 -0.0944238159427 -0.0901287585138 -0.0858520970173 -0.081478217585 -0.0768704007504 -0.0718763631336 -0.0663197261746 -0.0600307873467 -0.0528590284935 -0.04463049731 -0.035219863091 -0.0247242943869 -0.0113697731125 0.0129855305069 0.0595821622007 0.111185950803 -0.0853554872564 -0.0853598142173 -0.0853903057449 -0.0855187937977 -0.0855976820815 -0.085675680524 -0.0857585898408 -0.085913731264 -0.0860446044695 -0.0863356176375 -0.0866723617563 -0.0869983034519 -0.0873015346083 -0.0876300308959 -0.0880388773253 -0.0884475908416 -0.0888557295921 -0.0892315519471 -0.0895783827832 -0.0899338045656 -0.090312509359 -0.0906595297776 -0.0909492988882 -0.0913615465466 -0.0919386549118 -0.0926331691486 -0.0934434930662 -0.094192709248 -0.0949368311313 -0.0956602304006 -0.0963414084858 -0.0969869549727 -0.0976589837482 -0.0984491115186 -0.0992919443549 -0.100156759161 -0.101068280852 -0.101966905794 -0.102877752927 -0.103797592149 -0.104747304937 -0.105732010451 -0.106817082216 -0.107972853136 -0.109153348179 -0.110376287625 -0.11170002429 -0.113238305812 -0.115149527004 -0.1166564464 -0.117882485497 -0.11876683141 -0.119144024832 -0.119182352542 -0.119021122443 -0.118511447454 -0.117703165097 -0.115956743304 -0.113001395439 -0.109011148296 -0.104400334749 -0.0994933315723 -0.0945394352595 -0.0896927606712 -0.0849961894778 -0.080416546609 -0.0758612763011 -0.071197069153 -0.066254811794 -0.0608275678891 -0.0546443928069 -0.0473532873119 -0.0386113525902 -0.0282832386899 -0.0164523732766 -0.0028581305874 0.0154264323528 0.0472537279361 0.100624998131 0.151899586308 -0.0844272401381 -0.0844405773077 -0.0844717685053 -0.0845931611033 -0.0846815123466 -0.0847875835692 -0.0848794162566 -0.085025151523 -0.0851725813739 -0.0854381856315 -0.0857758887673 -0.086102229355 -0.0864077285504 -0.0867306972828 -0.0871278198094 -0.0875232899227 -0.0879378906466 -0.0883404692436 -0.0887008049395 -0.0890610737938 -0.089433047803 -0.0898065354772 -0.0901150203535 -0.0904559674733 -0.0909987776863 -0.0916381407323 -0.0923815629627 -0.0930750753777 -0.0937438110063 -0.0944629279581 -0.095181039848 -0.0958847074957 -0.0964945089661 -0.0971754434913 -0.0979786658572 -0.0988517656525 -0.0997605877286 -0.100674404277 -0.101571500098 -0.102507326806 -0.103447060772 -0.104425116453 -0.105491476062 -0.106620416046 -0.107800118031 -0.109050987765 -0.110421425595 -0.112251220368 -0.114091928016 -0.116292305787 -0.116865969867 -0.117690083237 -0.118447868482 -0.118388109544 -0.117640528452 -0.116245708178 -0.114108871251 -0.110896035875 -0.106702973036 -0.101824223567 -0.0965919325229 -0.0912674722108 -0.0860434840078 -0.0810117301954 -0.0761685916827 -0.071439573054 -0.0666914415364 -0.0617438352846 -0.0563784801822 -0.0503492961604 -0.043363565137 -0.0350382077034 -0.0249616578101 -0.012939001194 0.000888883218292 0.0169555223978 0.0387711112825 0.0745910349124 0.128315432743 0.174102115123 -0.0834067436754 -0.0834382264742 -0.0834665739273 -0.0835520643763 -0.0836679713266 -0.0838014138231 -0.0839151251586 -0.0840717814062 -0.0842566123547 -0.0844898023947 -0.0848157063108 -0.0851392266739 -0.0854471594242 -0.0857654152246 -0.086151141478 -0.0865358913846 -0.0869303570828 -0.0873562574194 -0.0877424222043 -0.0881115054786 -0.0884785690711 -0.0888834667478 -0.0892472809834 -0.0895741432804 -0.0900218677674 -0.0905994092909 -0.0912787786849 -0.0919191770119 -0.0925069294856 -0.0931841348899 -0.0938995460999 -0.0946606382435 -0.0952746756582 -0.0958865827906 -0.0965798421626 -0.097387133513 -0.0982843993306 -0.0992188544626 -0.10013393053 -0.10105296451 -0.101959736867 -0.102921720082 -0.103948850514 -0.105042643616 -0.106236389649 -0.107664851576 -0.109158612808 -0.110792595366 -0.112808875828 -0.114022104358 -0.115600692728 -0.11666068778 -0.117448243489 -0.11682414294 -0.115309460399 -0.112948059563 -0.10963122387 -0.105250815643 -0.100099781393 -0.094541075104 -0.0888817442193 -0.0833252418651 -0.0779880932487 -0.0728907222368 -0.0679746955502 -0.0631210120783 -0.0581610606884 -0.0528881377689 -0.0470699160413 -0.0404590390492 -0.0327700596557 -0.023629701035 -0.0126181608046 0.000525825948364 0.0157826996547 0.0337156677473 0.0578484899378 0.0952325137369 0.146880926049 0.187502372283 -0.0823529341631 -0.0823879534339 -0.0824093472234 -0.0824552591409 -0.0825886851979 -0.0827309209724 -0.082859672582 -0.0830203853652 -0.0832276529908 -0.0834622910904 -0.0837834585833 -0.0841050712779 -0.0844163330398 -0.084731165335 -0.0851078789336 -0.0854888489759 -0.0858747406803 -0.0863119641741 -0.0867221149548 -0.0871171768172 -0.0875090720289 -0.0879315161205 -0.0883139158656 -0.0886856038244 -0.0891014383639 -0.0896052828472 -0.0901781463415 -0.0907531695515 -0.0912550690569 -0.0918699908318 -0.0925429961205 -0.0932681795123 -0.0939685420028 -0.0945488343721 -0.0951820357758 -0.0958688492078 -0.0966756422994 -0.0975804127954 -0.0985173984844 -0.0993924840412 -0.100285039417 -0.101219861963 -0.102198089719 -0.103260170845 -0.1046037086 -0.10607869063 -0.107748115306 -0.109439779266 -0.109921428443 -0.1114784136 -0.113308880215 -0.115451004306 -0.115690040093 -0.11431883948 -0.111873846792 -0.108478084667 -0.104137373511 -0.0989214616847 -0.0931713545929 -0.0872372239853 -0.08138526295 -0.0757621952522 -0.0704162725193 -0.0653065205482 -0.060327899995 -0.0553293282562 -0.0501260563531 -0.0445099628719 -0.0382576010376 -0.0311332373413 -0.022864587224 -0.0130998853211 -0.00145125648963 0.0123251568788 0.0282707016372 0.0470540606129 0.0720273200598 0.109073734603 0.15763845236 0.194124942418 -0.0812843241666 -0.0813118381764 -0.0813233030082 -0.0813606250815 -0.0814724641892 -0.0816037702114 -0.0817364323312 -0.0818905038628 -0.0821034446502 -0.0823497036563 -0.0826755210507 -0.0829969037982 -0.0833120665977 -0.0836239228876 -0.0839927528346 -0.0843709200226 -0.0847516637615 -0.0851973374685 -0.0856277331896 -0.0860511350682 -0.0864942209564 -0.0869246614567 -0.0873251596427 -0.0876827721776 -0.0881041204023 -0.088598776013 -0.0891126869435 -0.089589813666 -0.090006236727 -0.0905441861689 -0.091153625856 -0.0917874452401 -0.0924628412342 -0.0930502596505 -0.0936493294817 -0.0942833745985 -0.0949871744618 -0.0958105626754 -0.0967131389024 -0.0975743323338 -0.0984553734774 -0.0993557487935 -0.100292162707 -0.101415539604 -0.102767881731 -0.104351845605 -0.106172135678 -0.108374365274 -0.107702354423 -0.108742444308 -0.112085201671 -0.11390648826 -0.113260617399 -0.111054253959 -0.107644665132 -0.103264551871 -0.0980555241751 -0.092228496333 -0.0861259834543 -0.0800409465119 -0.0741673996343 -0.0685847074408 -0.0632799964405 -0.0581658688828 -0.0531072960178 -0.0479397479641 -0.0424812751921 -0.0365394398188 -0.0299128081928 -0.022386073452 -0.0137065778451 -0.00355024764737 0.00843497530042 0.0224615129928 0.038560623963 0.0573239322316 0.081669771829 0.116699631804 0.16150842826 0.194858912708 -0.0801742335286 -0.080210820026 -0.0802060096188 -0.0802623496918 -0.0803360719104 -0.0804443555555 -0.0805691806367 -0.0807133505735 -0.0809241726189 -0.0811641304246 -0.0814947490613 -0.0818153715631 -0.0821302986301 -0.0824399371055 -0.0828041662053 -0.0831754222428 -0.0835460032971 -0.0840000640305 -0.0844473253108 -0.0848816587013 -0.0853534627817 -0.0857840439953 -0.0862198531123 -0.0866055501261 -0.0869823394566 -0.0874583105747 -0.0879888279657 -0.0884106801194 -0.0887677424732 -0.0892011606539 -0.0897598959839 -0.0903419219767 -0.0909319179389 -0.0914648519319 -0.0919756784053 -0.0925638717959 -0.093186686481 -0.0939270505212 -0.0947717325956 -0.0956293154834 -0.0964956253262 -0.0973526993159 -0.0983060748004 -0.0994740570011 -0.100763927823 -0.102222511084 -0.104160921357 -0.104259745602 -0.105462996207 -0.107319074821 -0.111221161275 -0.111872262263 -0.110236728812 -0.107118140818 -0.102787130441 -0.0975601431489 -0.0916811824186 -0.085441502344 -0.0791592258855 -0.0730583885261 -0.0672540396379 -0.0617579096507 -0.0565051976755 -0.0513763720349 -0.0462220822198 -0.0408791339159 -0.0351796843387 -0.0289533712743 -0.0220230486733 -0.0141946068705 -0.00523567672882 0.00515099678703 0.0172912863956 0.0313865928973 0.0474483117605 0.0658868627296 0.0890276376424 0.121219217893 0.161941097923 0.192736689963 -0.0789869999904 -0.0790265905026 -0.0790300774964 -0.0790927927449 -0.0791560954175 -0.0792501186236 -0.0793627473399 -0.07949514496 -0.0796948629228 -0.0799155451196 -0.0802457917405 -0.0805664296943 -0.0808721178857 -0.0811819113355 -0.0815489066783 -0.0819142958199 -0.0822707978814 -0.0827180929754 -0.0831787231132 -0.0836111305906 -0.0840917354095 -0.0845331041964 -0.0849679083204 -0.0854234161941 -0.0858296209816 -0.0862960341848 -0.0868264805823 -0.0872744930563 -0.0875545975522 -0.0878691690231 -0.0883353949024 -0.0888770007047 -0.0894108284645 -0.0898946296099 -0.0903122630148 -0.0908072880985 -0.0913147003947 -0.0919512815201 -0.0927310148555 -0.0935714375076 -0.0943990659102 -0.0951725866971 -0.0962019421295 -0.0972745911278 -0.0983537056884 -0.0997311616619 -0.101231484194 -0.100647621653 -0.102012806676 -0.106726054781 -0.109819577994 -0.109268867749 -0.106613015781 -0.102559758911 -0.0973955871165 -0.091493456798 -0.0851554050165 -0.0786898289057 -0.0723635589355 -0.0663296327275 -0.0606332504373 -0.055230839985 -0.0500196945586 -0.0448613150523 -0.0396029628599 -0.0340903790864 -0.0281731332505 -0.0217025189683 -0.0145236927564 -0.00646344252162 0.00268785052413 0.0131971133941 0.0253630760952 0.0393827342453 0.0552548140284 0.0732131562354 0.0950380845035 0.124443530721 0.161399822475 0.189894172293 -0.0777215116404 -0.0777463749316 -0.0777812146092 -0.0778445322247 -0.0779157380596 -0.0780089237718 -0.0781113332699 -0.0782329659557 -0.0784185788825 -0.0786122772471 -0.0789343851508 -0.079259597071 -0.0795521146075 -0.0798527010601 -0.0802315122566 -0.0806007059808 -0.0809517715391 -0.0813678833417 -0.0818196309576 -0.082252893527 -0.0827282399881 -0.0832040361562 -0.0836838653084 -0.0841559664222 -0.0846173927775 -0.0850775694778 -0.0856088840413 -0.0861256754914 -0.0863689200181 -0.0865807655038 -0.086894616334 -0.087349282717 -0.0878302986512 -0.0883168925891 -0.0886654879148 -0.0890144055562 -0.0894014973812 -0.0898996703432 -0.0906054722381 -0.0914157755245 -0.0922011127078 -0.0929988776299 -0.0939282468201 -0.0947665516259 -0.0955264969416 -0.0966940334343 -0.0958916580556 -0.0971067560933 -0.100617626022 -0.10607083383 -0.107675100482 -0.106055873972 -0.102403314944 -0.0974760902788 -0.0916049362822 -0.0852016562266 -0.0785874732366 -0.0720442525245 -0.0657705545803 -0.0598503112847 -0.0542716898479 -0.0489517170646 -0.0437649186885 -0.0385652009091 -0.0332036629483 -0.0275381509238 -0.0214355773141 -0.0147672560454 -0.00739962220177 0.000817917488545 0.0100678591216 0.0205816368836 0.032624708805 0.0463835390187 0.0618435196335 0.0790946724635 0.0994852788709 0.12624614108 0.159814748356 0.186301446174 -0.0764060282786 -0.076425993551 -0.0764691439367 -0.076533248655 -0.0766136116447 -0.076711820265 -0.0768070605572 -0.0769206916631 -0.0770974594861 -0.0772656880177 -0.0775689598262 -0.0779013535036 -0.0781897776817 -0.0784662159048 -0.0788502808682 -0.0792291579812 -0.0795841406705 -0.0799673363497 -0.0803886539867 -0.0808126481494 -0.0812883626455 -0.0817528768276 -0.0822905427019 -0.0827979232857 -0.083298193643 -0.0837722699314 -0.0843094160468 -0.0848830424996 -0.0852243679198 -0.0853579268213 -0.0855468486776 -0.0858353079145 -0.0862341162153 -0.0866485945575 -0.0870222159515 -0.0872537336183 -0.0874926631818 -0.0877763399089 -0.0883953818228 -0.0891427644308 -0.0898427376038 -0.090751954386 -0.0915333899465 -0.0921021909759 -0.0923343982803 -0.0900424343229 -0.0915573425719 -0.0933850295789 -0.100453744735 -0.104698380473 -0.104899460757 -0.102261188268 -0.0976842407601 -0.09199922021 -0.0855705253537 -0.0788278386437 -0.0720797560922 -0.0655586867587 -0.0593918885333 -0.0536018357073 -0.04813285015 -0.0428767212977 -0.0376974906787 -0.0324498460439 -0.0269930926191 -0.0211981438596 -0.0149479855784 -0.00813198262047 -0.000636595075076 0.00766575063293 0.0169288495769 0.0273470947372 0.0391492962072 0.0525044344963 0.0673821325124 0.0837567703984 0.102631685505 0.126848535911 0.15727091764 0.181925528638 -0.075044150589 -0.0750611720104 -0.0751007304294 -0.0751716417903 -0.0752547693297 -0.0753545202574 -0.0754437714134 -0.0755458625994 -0.0757302895126 -0.0759037408213 -0.076159873634 -0.0764929577544 -0.0767896114914 -0.0770608756375 -0.0774134300181 -0.0777920065281 -0.0781525792385 -0.0785138980948 -0.0789131779701 -0.0793075603154 -0.0797886183049 -0.0802474869353 -0.0807486930946 -0.0812678436914 -0.0818006408584 -0.0823419091739 -0.0829100049206 -0.0835525520128 -0.0840658553869 -0.0841900512836 -0.0843169926115 -0.0844849444893 -0.0847372679729 -0.0849826286881 -0.0852791058938 -0.0855084043387 -0.0856317965992 -0.0856637102538 -0.0860540742332 -0.086763825161 -0.0874877197491 -0.0883317312115 -0.089164055677 -0.0899640292578 -0.0912283597977 -0.0882367333231 -0.0882321616561 -0.0932755532478 -0.10053222985 -0.102666371028 -0.101618445422 -0.0979583633066 -0.0925641663534 -0.0862581266943 -0.0794244646066 -0.0724833130782 -0.0657065639288 -0.0592677420488 -0.0532293919193 -0.047564647728 -0.0421871754067 -0.0369749581007 -0.0317902194254 -0.0264937158826 -0.0209553596264 -0.0150593381608 -0.0087036406723 -0.0017942496916 0.0057635847664 0.014075153103 0.0232662578931 0.0334952105003 0.0449531119414 0.0577868503301 0.071951476307 0.0873328709599 0.104651184413 0.126402088842 0.15381169338 0.176691831887 -0.0736383635537 -0.0736540728484 -0.0736912626553 -0.0737720214979 -0.0738475891032 -0.0739379564724 -0.0740251101614 -0.074111541623 -0.0742934047322 -0.074490268034 -0.0746972811582 -0.0750236998584 -0.0753288105363 -0.0756154607019 -0.0759217072578 -0.0762839788731 -0.0766434826505 -0.0769894935502 -0.0773872586274 -0.0777693824813 -0.0782172733258 -0.0786915085663 -0.079149699461 -0.0796470927833 -0.0801871842134 -0.0807405693074 -0.0813470633616 -0.0820283997231 -0.0827259705843 -0.0830554730473 -0.083122305144 -0.0832408543927 -0.0833158791134 -0.0834811603194 -0.083597416866 -0.0837228341857 -0.0837542860723 -0.0836557952358 -0.083419535894 -0.0842189051257 -0.0850991994115 -0.0858172638438 -0.0866549385809 -0.0878402918628 -0.0894994166021 -0.0865863816704 -0.085667999841 -0.0943403534948 -0.0997860881608 -0.100084247319 -0.097876413736 -0.0932372078023 -0.0871515619361 -0.0803622342162 -0.0732631666227 -0.0662379334093 -0.0595067829284 -0.0531830059002 -0.0472751946037 -0.0417204903879 -0.0364139482474 -0.0312286947429 -0.0260308933345 -0.0206903536535 -0.0150886666557 -0.00912320977858 -0.00270636442328 0.00424007919596 0.0117930245559 0.0200367379877 0.0290708015366 0.0390195370645 0.0500360879755 0.0622417493829 0.0755799150636 0.0898744817015 0.105611588816 0.12495747235 0.149421459497 0.170510049416 -0.0721903534799 -0.0722053877312 -0.072263479174 -0.0723454459751 -0.0723995806409 -0.072474767272 -0.0725623437106 -0.0726423942825 -0.0727869142888 -0.0729854606111 -0.0731667649789 -0.0734813661413 -0.0737892741992 -0.0740774312211 -0.0743534797231 -0.0746987964938 -0.0750398026197 -0.075374532561 -0.0757768519602 -0.0761706213933 -0.0765682367876 -0.0770233513238 -0.0774637162126 -0.0779531519822 -0.0784684237682 -0.0790005634568 -0.0796018021165 -0.0802750582987 -0.0810250824401 -0.0817297466053 -0.0819220449952 -0.0819211361599 -0.0819293484349 -0.0819587200688 -0.0819537568747 -0.0819300797913 -0.0818688846209 -0.0817268543096 -0.0814445513126 -0.0816273907456 -0.0825918375502 -0.0832003737377 -0.0837849874777 -0.0847067063771 -0.0815517721075 -0.0813107099277 -0.083629649986 -0.0947392437852 -0.0979306026017 -0.0969796633587 -0.0936814491004 -0.0881851034672 -0.0815419767287 -0.0744005210668 -0.0671540109912 -0.0601306536766 -0.0534934806158 -0.0472994853973 -0.0415150258277 -0.0360532477956 -0.030800399669 -0.0256313218939 -0.0204198155638 -0.0150462597026 -0.00940419953188 -0.00340401086797 0.00302772039892 0.00995347606212 0.0174326166382 0.0255293843818 0.0343193918752 0.0438962167705 0.0543767681122 0.0658549523062 0.0782651292588 0.0913924330219 0.105530039852 0.122519007346 0.144060307625 0.163282307128 -0.0707037345253 -0.0707237930745 -0.0708012063225 -0.0708636048096 -0.0708999721808 -0.070965932448 -0.0710530026179 -0.0711328343712 -0.0712392990546 -0.0714209647734 -0.0715785971989 -0.0718673678639 -0.0721767090683 -0.0724477996336 -0.0727027147323 -0.0730436696927 -0.0733600670649 -0.0736669085746 -0.0740671704197 -0.0744563412255 -0.0748292349072 -0.0752642387669 -0.0756744351925 -0.076164638088 -0.0766524273807 -0.0771722743293 -0.0777178330155 -0.0783289222159 -0.0790118998714 -0.0797825953056 -0.0804383101901 -0.0805471437015 -0.0805681934283 -0.080436301854 -0.0803366584234 -0.0802590340855 -0.0801977906431 -0.0800899217574 -0.0800361663909 -0.0800277391622 -0.0803095258342 -0.0806320406305 -0.0811462613261 -0.0834875518565 -0.076058786483 -0.0737915260313 -0.0827572975315 -0.0939123929052 -0.0952315494678 -0.0933873259849 -0.0890828675091 -0.082890396812 -0.0758191698969 -0.068444222097 -0.0611434867393 -0.0541816048528 -0.0476659930266 -0.0416048325545 -0.0359333078354 -0.0305502290034 -0.0253401617686 -0.0201840629866 -0.0149655709271 -0.00957625934478 -0.00392140902591 0.00207604244982 0.00847554711836 0.0153239391177 0.0226633452157 0.0305391568709 0.0390055798175 0.0481292711376 0.0579930850366 0.0686601127512 0.0800520533946 0.0919287720401 0.10443006276 0.119084189765 0.137687386696 0.154907331111 -0.0691673213824 -0.0691913553536 -0.0692309181458 -0.0692894321349 -0.0693351484522 -0.069401213041 -0.0694861101204 -0.0695601343313 -0.0696478495215 -0.0698103831562 -0.0699622202411 -0.070195427332 -0.0705080036693 -0.0707670698178 -0.0709977100624 -0.0713296947347 -0.0716460269032 -0.0719310943702 -0.0722873172708 -0.0726572566567 -0.0730020272716 -0.0734345608444 -0.0738311501632 -0.0742621370879 -0.0747235566194 -0.0752324131192 -0.0757258707159 -0.0762637115548 -0.0768548700849 -0.0775051093343 -0.0782271603021 -0.0788739387424 -0.0790361984007 -0.0790664187392 -0.0790371800445 -0.078976223599 -0.0788814429807 -0.078761590673 -0.07868654175 -0.0785081209801 -0.0780214000947 -0.0775962046546 -0.0769749334038 -0.0724710298122 -0.0700023026342 -0.0690989373928 -0.0831955638717 -0.0921403005217 -0.0920656921202 -0.0893792594191 -0.0841769654245 -0.0774404678343 -0.0700560391958 -0.0625480520329 -0.0552620800067 -0.0483994571566 -0.0420177940258 -0.0360857746901 -0.0305171355291 -0.0252036179803 -0.0200328396734 -0.014894497761 -0.00968322045452 -0.00430190363732 0.00133291482178 0.00728633697736 0.0136041464012 0.020317321777 0.0274502093011 0.0350289138714 0.0430866451388 0.0516652587289 0.0608161546207 0.0705711634168 0.0808370624361 0.0913623789913 0.102179518212 0.114536771316 0.130225443057 0.145296363314 -0.0675847743344 -0.0676055908764 -0.0676116615141 -0.0676702415291 -0.0677278526855 -0.0677891072965 -0.0678613599358 -0.0679245407316 -0.0679928810588 -0.0681398883516 -0.0683053050118 -0.0684784727769 -0.0687848832509 -0.0690562837477 -0.0692853831517 -0.0695648150866 -0.069884190901 -0.0701702825464 -0.0704634664783 -0.0708181393554 -0.0711410902575 -0.0715223985642 -0.0719223851598 -0.0722873951838 -0.0727100438101 -0.0731488873128 -0.0736111069259 -0.0740898054408 -0.0745886123005 -0.0751339744361 -0.0757051783503 -0.0763496188155 -0.0769050364516 -0.0773296569715 -0.0774720473565 -0.0774481271675 -0.0772609750857 -0.0770642920281 -0.0768004469164 -0.076114222694 -0.0753252835407 -0.0749094717135 -0.0757482737426 -0.0679961759571 -0.0637697881488 -0.0684479013503 -0.0839644509271 -0.0898122935788 -0.0886539194184 -0.0850430998691 -0.0790702750341 -0.0719120268753 -0.0643116101315 -0.0567503542456 -0.0495271368454 -0.0427853194464 -0.0365403089458 -0.0307310101972 -0.0252577847206 -0.0200105465517 -0.0148828094158 -0.0097742957794 -0.00459104155363 0.000752882372558 0.00633020732554 0.0121947036662 0.0183788045318 0.0248974639874 0.0317569662162 0.0389646717485 0.0465355856648 0.0544932071517 0.0628671957399 0.0716640616047 0.0807687665658 0.0898991081886 0.0989747055346 0.108991121461 0.121738852256 0.134555613161 -0.0659674243779 -0.0659894290813 -0.0660175361224 -0.0660545106828 -0.0660963896113 -0.0661396319868 -0.066191055094 -0.0662443690238 -0.0662937523331 -0.0664143894985 -0.0665829825082 -0.0667162264694 -0.0669883188595 -0.0672839382823 -0.0675208842046 -0.0677396529631 -0.0680507339985 -0.0683260166471 -0.0685705959107 -0.0689092342208 -0.0692288590456 -0.0695400127195 -0.0699096545833 -0.0702299971204 -0.0706152488244 -0.0709838085351 -0.0714042852252 -0.0718110373273 -0.072223819862 -0.0726667406844 -0.0731193801116 -0.0735569843793 -0.0739955593664 -0.074382355677 -0.0745769235567 -0.0745635930545 -0.0744007252742 -0.0741312681921 -0.0736116421548 -0.0727197755362 -0.0720402744019 -0.0719313937279 -0.0747340936715 -0.0647766132753 -0.0591359831493 -0.070013809939 -0.0840672968047 -0.0871184765182 -0.0850259415848 -0.0804489928198 -0.0738450571584 -0.0663622641433 -0.0586277690841 -0.0510739571827 -0.0439454721151 -0.0373353151196 -0.0312248194681 -0.0255322102047 -0.0201509534077 -0.0149728223008 -0.00989879167876 -0.00483905239792 0.000288923805788 0.00556003161749 0.0110366400321 0.0167617397947 0.0227549593913 0.0290156357142 0.0355325234019 0.0422953368901 0.0493021244 0.0565584090703 0.0640692240637 0.0718056033419 0.0796038664569 0.0871077095126 0.0941287257496 0.101594078045 0.111642910983 0.12291184706 -0.0643133388954 -0.0643328491537 -0.0643717975376 -0.0643957101246 -0.0644144181984 -0.0644466475213 -0.0644862053459 -0.0645341952955 -0.064574545452 -0.0646588671086 -0.0648161878241 -0.0649528561176 -0.0651405717809 -0.0654439407384 -0.0656807129553 -0.0658710678823 -0.0661506203864 -0.0664225089206 -0.0666465568856 -0.0669298502004 -0.0672294423525 -0.0674927982806 -0.0678318693624 -0.0681319294476 -0.0684458407492 -0.0687780019523 -0.0691158043743 -0.069452495232 -0.0697902377578 -0.0701179088167 -0.0704564913719 -0.0707431272488 -0.0710006351073 -0.0711822168548 -0.0712713449338 -0.0711966175042 -0.0709617486465 -0.0705336499755 -0.0698622120905 -0.0690241889174 -0.0679754610195 -0.0668824445573 -0.0614499570654 -0.0580488373064 -0.0551841449916 -0.0718924549867 -0.0830298332258 -0.0840895408925 -0.081118176356 -0.0756426842065 -0.0685496431894 -0.0608273345821 -0.0530291933925 -0.0455286625021 -0.0385161972131 -0.0320427295586 -0.0260635399094 -0.0204841511955 -0.0151962035219 -0.0100959181198 -0.00509248907574 -0.000106490174084 0.00493341364842 0.0100913017329 0.0154195207182 0.0209509619025 0.0266933498056 0.0326312964616 0.0387367945276 0.0449825962515 0.051350338497 0.0578281597774 0.0644012953865 0.0710227393553 0.077511468492 0.0834715911261 0.0886448770073 0.0939457271646 0.101758554887 0.111642612916 -0.0626161603499 -0.0626264570507 -0.0626395890677 -0.0626448672639 -0.0626715617931 -0.0627097432616 -0.0627491755716 -0.0627942042906 -0.0628241737957 -0.0628713963726 -0.0630004095619 -0.0631585058724 -0.0632741247725 -0.063533525357 -0.063796014197 -0.0639831654602 -0.0641912496794 -0.0644658264759 -0.06468973131 -0.0648978867978 -0.0651784000633 -0.0654129598205 -0.0656890260613 -0.0659837672109 -0.0662163144574 -0.066516341148 -0.0667793969766 -0.0670618742241 -0.0673197450745 -0.0675489958896 -0.0677809373861 -0.0679605999508 -0.0680888581996 -0.0681285939083 -0.0680628684912 -0.0678784475896 -0.0675246602531 -0.0669983037372 -0.0663193252961 -0.0656401550329 -0.0648117434798 -0.0654663625807 -0.0565161245484 -0.0508439937864 -0.0542509419862 -0.0732424368825 -0.0809730741062 -0.0807259109124 -0.0768832764544 -0.0706598773317 -0.0632087752411 -0.0553273912873 -0.0475267934638 -0.0401149260346 -0.0332336296696 -0.026899817802 -0.0210503160543 -0.0155845662779 -0.010396341362 -0.00538819057611 -0.000477927033174 0.00440370655198 0.00931704543567 0.0143152563696 0.0194405022792 0.0247156744926 0.0301372814395 0.035676513161 0.0412908764563 0.0469399954976 0.0525948746225 0.0582331914018 0.0638244012241 0.0692928153106 0.0744012451752 0.0785992503234 0.081233735798 0.0825630628784 0.0847755224772 0.0886388900183 -0.0608862547315 -0.0608889280249 -0.0608769122344 -0.0608483023133 -0.0608969239216 -0.0609451694174 -0.0609855324209 -0.0610247042924 -0.0610429723099 -0.0610610042847 -0.0611499092645 -0.061299677053 -0.0614215138053 -0.061581751506 -0.0618497347736 -0.0620553024975 -0.0622083138332 -0.062447282053 -0.062672916553 -0.0628378721785 -0.0630720397879 -0.0633007819836 -0.0634948313323 -0.0637537706148 -0.0639674532471 -0.0641914504466 -0.0644206346448 -0.064640472531 -0.0648359524351 -0.0650031434496 -0.0651405134627 -0.065229324793 -0.0652534693284 -0.065175572933 -0.0649872431578 -0.0646625669264 -0.0641922012519 -0.0635567469801 -0.0627796081205 -0.0620815152085 -0.0616291730388 -0.0654539403843 -0.0533794106466 -0.0453882947109 -0.0555186869813 -0.0736622596097 -0.0782853632758 -0.0770603840758 -0.0723394254369 -0.0655394160469 -0.0578383323618 -0.0498735404872 -0.0421225943653 -0.0348276783917 -0.0280897421018 -0.0218990859983 -0.0161808703185 -0.0108337418546 -0.00575667009114 -0.000860009928493 0.00392946082865 0.00867092536373 0.0134136915153 0.0181996563675 0.0230603513897 0.0280088525641 0.0330318259196 0.0380898856857 0.0431295053219 0.0480990005663 0.0529533827464 0.0576351261581 0.06203166569 0.065910545187 0.0687888772036 0.069756476315 0.0673638103458 0.0605762218142 0.0523941662357 0.0488978876909 -0.0591253305108 -0.0591313536766 -0.0591314619413 -0.0591124435593 -0.0591316264394 -0.0591717212375 -0.0592065880573 -0.0592351259552 -0.0592484295757 -0.0592475999573 -0.0592839058191 -0.0593978994651 -0.0595439959182 -0.0596434237734 -0.0598370015743 -0.0600697061481 -0.0602164200415 -0.0603646846948 -0.0605953426499 -0.0607545928547 -0.0609014790117 -0.0611226908151 -0.0612885947772 -0.0614880903347 -0.0616970029324 -0.061853810733 -0.0620324425959 -0.0621956701013 -0.0623456354165 -0.0624523507816 -0.0625177655128 -0.0625447972664 -0.0624866402781 -0.0623162750446 -0.0620317066898 -0.061588530385 -0.0609639301681 -0.0601090613119 -0.0590173476571 -0.0575711831949 -0.0560216784787 -0.0533737484137 -0.0469217603815 -0.040102239058 -0.0572804374842 -0.0729038341231 -0.0751730970375 -0.0730844759153 -0.0675341976655 -0.0603170370102 -0.0524518876399 -0.0444721583269 -0.0368138776536 -0.0296593038321 -0.0230759327121 -0.0170339778352 -0.0114526863004 -0.00623392059607 -0.0012842419509 0.00347692622631 0.00811329852673 0.0126736711612 0.0171957219287 0.0217088700677 0.026232340295 0.0307675713469 0.0352894990797 0.0397449834235 0.0440623603916 0.0481629306848 0.0519528612918 0.0552778971391 0.0578522032554 0.0591771654612 0.0584442646338 0.0542414138494 0.0441751204902 0.028041640616 0.0127403881078 -0.00520898922295 -0.0573345450619 -0.0573442656246 -0.0573553394204 -0.0573855512227 -0.0573657313357 -0.0573933221728 -0.0574208523609 -0.0574398554184 -0.0574513448341 -0.0574320285706 -0.0574180077746 -0.0574707043433 -0.0575873512012 -0.0576947265552 -0.0577958213026 -0.0580063811192 -0.0581866162921 -0.0582887209866 -0.0584594698901 -0.0586296081793 -0.0587354198587 -0.0589020832834 -0.0590688298037 -0.0592111430517 -0.0593730782399 -0.0595111668404 -0.0596311071436 -0.0597596956269 -0.0598480902974 -0.0599049869785 -0.0599385425491 -0.0599045516763 -0.0597747430154 -0.059531490592 -0.0591714363983 -0.0586355437537 -0.0578847242181 -0.0569019356821 -0.0556655711031 -0.0538185220927 -0.052188506726 -0.0459454627426 -0.0401576585667 -0.0373214596291 -0.0589758842598 -0.0710551826648 -0.0717065344094 -0.0687729463216 -0.0625154683907 -0.0550177885994 -0.0470606137116 -0.0391261297254 -0.0315954911901 -0.0246013815796 -0.0181839183624 -0.012299009887 -0.00686452662461 -0.00178852765649 0.0030129867676 0.00761028649551 0.0120566764173 0.0163895577657 0.0206333654504 0.0248023704137 0.0288997167574 0.0329106048476 0.036792780289 0.0404725573078 0.043851992086 0.0468172113164 0.0492200154883 0.0508116467906 0.0511536983463 0.0495575668303 0.0448988902076 0.0351974916821 0.0196622833943 0.00472591461951 -0.00961030254683 -0.00854258521439 -0.0555300461011 -0.055537880431 -0.0555342350219 -0.0555937540003 -0.055592078826 -0.0556107930261 -0.0556309812764 -0.0556407856987 -0.0556441066611 -0.0556135829783 -0.0555699053393 -0.0555489448829 -0.0556057619639 -0.0557061290399 -0.0557808476186 -0.0558851016933 -0.0560774516148 -0.0562117953266 -0.056295389778 -0.0564514334675 -0.0565725622339 -0.0566616315959 -0.0567983920448 -0.0569118991773 -0.0570285223447 -0.0571415492329 -0.0572303108834 -0.0573115082822 -0.0573677241829 -0.0574054492087 -0.05738450874 -0.0572898336465 -0.0571111562871 -0.0568351657735 -0.0564265931852 -0.0558417283415 -0.055056681202 -0.0541290143736 -0.053066877168 -0.051968268228 -0.0534733443751 -0.0429363474031 -0.0333355316068 -0.0371458635198 -0.0600892769527 -0.0684313892996 -0.0679519643533 -0.0641439494188 -0.0573322026269 -0.0496593832435 -0.0416733725806 -0.0338353172562 -0.0264610163624 -0.0196454226262 -0.0134060366425 -0.0076895208622 -0.00241583252532 0.00249862657302 0.00712688365388 0.01152757897 0.0157421260615 0.0197946090586 0.0236932511912 0.0274327374601 0.0309942267467 0.0343400950468 0.0374045125386 0.0400878414266 0.0422628939089 0.0437861711013 0.0444813362647 0.0440526474301 0.0419452103973 0.0371823541786 0.0281799496086 0.0142222533938 0.000404712202911 -0.00915956133023 -0.0106131084346 -0.011059370659 -0.0537321137538 -0.0537380294561 -0.0537326828439 -0.0537846760398 -0.0538327772449 -0.0538311894704 -0.0538346526068 -0.0538290151122 -0.0538156232542 -0.0537844658393 -0.0537237267706 -0.0536602177336 -0.0536388691014 -0.0536856342019 -0.0537653324343 -0.0538060599147 -0.0539166362707 -0.0540631278532 -0.0541319941049 -0.0542150125943 -0.0543354267492 -0.0544049613289 -0.0544846940607 -0.0545772445611 -0.0546589502614 -0.0547324320216 -0.0548019171906 -0.0548498049156 -0.0549020242845 -0.0549150972807 -0.0548565700727 -0.054744137298 -0.0545420394816 -0.0542437477923 -0.0538011242333 -0.0531846172805 -0.0523950246242 -0.0514367312591 -0.0502961798235 -0.0493601787099 -0.0522309188743 -0.0391815149673 -0.0272755715956 -0.0380488102384 -0.0601096947277 -0.0652575652677 -0.0639271374109 -0.0592416956973 -0.052027372217 -0.0442553588816 -0.0362966653474 -0.0285971165436 -0.0214032915929 -0.0147830972319 -0.00873513458706 -0.00320127637845 0.00189392584734 0.00662406812062 0.0110498810456 0.01521677821 0.0191522107107 0.0228640343516 0.026340146893 0.0295498771034 0.0324454136448 0.0349594734625 0.0369981532828 0.0384349395487 0.0391172781404 0.0388870324205 0.0375868137578 0.0349778972655 0.0304156383129 0.0223752405773 0.00980683054522 -0.0037808066269 -0.0116794468299 -0.0126082468811 -0.0137052243224 -0.014126515546 -0.051913762782 -0.0519177878205 -0.0519218039373 -0.0519335889769 -0.0519969569714 -0.052011213423 -0.0520136848731 -0.0519950862802 -0.051964746114 -0.0519301063212 -0.051858717051 -0.0517782344535 -0.0516891703666 -0.0516606968693 -0.0517003895226 -0.0517522912428 -0.0517812435651 -0.0518761056233 -0.0519585910373 -0.0519953102672 -0.0520443961559 -0.0521146457431 -0.0521614979072 -0.0522111104629 -0.0522651080906 -0.0523197639806 -0.0523584951716 -0.0523990301729 -0.0524175370363 -0.0524051486187 -0.0523316469273 -0.052202813556 -0.0519954012255 -0.0516890147743 -0.0512389184317 -0.0506341837962 -0.0498543633002 -0.0486738534488 -0.0468735687827 -0.0442569400403 -0.0404312036153 -0.0316938450631 -0.020650483808 -0.0388329069657 -0.0588814945196 -0.0616250366626 -0.0595991214849 -0.0541026056577 -0.0466262137353 -0.0388132748857 -0.0309331074249 -0.0234064882642 -0.016414526073 -0.0100061487042 -0.00416437424229 0.0011699299518 0.00606569854882 0.0105851791665 0.0147754252195 0.0186667232621 0.0222697486502 0.0255723295917 0.0285368807963 0.0311009251279 0.0331805066341 0.0346731081249 0.0354561436644 0.0353840499977 0.0342975809049 0.0320595406642 0.0285981741473 0.023841429484 0.0171339842672 0.00649065931331 -0.00737125698269 -0.016685227157 -0.0159558454691 -0.0165504043216 -0.0170696169288 -0.0173419727058 -0.0500448870415 -0.0500379568755 -0.0500302400499 -0.050002127031 -0.0500410961612 -0.0501070760841 -0.0501403067089 -0.0501226385528 -0.0500829417292 -0.0500360051793 -0.0499676859695 -0.0498643812828 -0.0497584530422 -0.0496530469355 -0.0496156471044 -0.0496449026959 -0.0496611042506 -0.0496761010876 -0.0497330073146 -0.0497751638457 -0.0497745744369 -0.0497796393223 -0.0498147641588 -0.0498299800502 -0.0498516693618 -0.0498810565857 -0.0498988437883 -0.0499030352686 -0.0498837783542 -0.0498365718154 -0.0497437082738 -0.0496129482423 -0.0494400606134 -0.0491728514521 -0.0487925193031 -0.0483093331082 -0.0475702114024 -0.0463848267772 -0.0443720257507 -0.0408383006078 -0.0339092614802 -0.0253568768715 -0.0167238986019 -0.0399191444326 -0.0566711140943 -0.0576442975139 -0.0549543016339 -0.0487569890918 -0.0411381454404 -0.0333342531715 -0.0255803305021 -0.0182559455841 -0.0114861447184 -0.00530625780925 0.000313003945642 0.00542850104864 0.0101011163905 0.0143803944531 0.0182982260838 0.0218674173474 0.0250785173448 0.0278948538365 0.0302481724181 0.032038910245 0.0331434512589 0.0334254780445 0.0327454356838 0.0309658018736 0.0279682483066 0.0237115646164 0.0182877537276 0.0117508545896 0.00357963228439 -0.00726902534045 -0.0200215056588 -0.0191926105968 -0.0196602995303 -0.0200330593642 -0.020328431019 -0.0204780550525 -0.0481346515531 -0.048111309353 -0.0480756328895 -0.0480392239426 -0.0480430758703 -0.0481102469947 -0.0481745962968 -0.048183329526 -0.0481547849981 -0.0481043012621 -0.0480421050222 -0.0479389281203 -0.0478266701828 -0.0476922889574 -0.0475821778006 -0.0475229351651 -0.047522595433 -0.0475020387737 -0.0474898611645 -0.0475052791876 -0.04750629475 -0.0474657131786 -0.0474352877572 -0.0474301584525 -0.0474220888298 -0.0474042393231 -0.0473835862883 -0.0473442851341 -0.0473041500183 -0.0472358442892 -0.0471708371534 -0.0470651669971 -0.0469211988117 -0.0467238609108 -0.0464873868477 -0.0461600653688 -0.0456753618065 -0.0450418440694 -0.04405188049 -0.0437489152377 -0.0320935679186 -0.0197110257231 -0.0156900358569 -0.0409613976369 -0.053835081584 -0.0534611306107 -0.050019654477 -0.0432373738955 -0.0355653583855 -0.0278152297862 -0.0202318270967 -0.0131360913147 -0.00660892939601 -0.00067502999678 0.00470368917649 0.00957906022917 0.0140023925562 0.0180090994454 0.0216141097962 0.0248100973734 0.0275636942998 0.0298092359214 0.0314434868023 0.0323277486755 0.0323015762749 0.0312062128867 0.028908917506 0.0253192544374 0.0204109567474 0.0143037300041 0.00732967362665 -0.000459928470869 -0.0100313960566 -0.01924259231 -0.0214584405473 -0.0224487813243 -0.0228508202089 -0.0231157708046 -0.0232766836581 -0.0233367356745 -0.0462241936149 -0.0461861254407 -0.0461329988454 -0.0460926966779 -0.0460628152498 -0.0460745800692 -0.0461276860192 -0.0461825430954 -0.0461829220892 -0.0461452680074 -0.0460832446629 -0.045997523934 -0.0458653302174 -0.0457372827166 -0.0455860479646 -0.0454614572612 -0.045374047221 -0.0453288456869 -0.0452721988603 -0.0452217689532 -0.045189700977 -0.0451466082728 -0.0450754656364 -0.0450132989514 -0.0449673705707 -0.0449099938857 -0.0448406946701 -0.0447857799921 -0.0447210282108 -0.0446674527637 -0.0445910476062 -0.0444959082133 -0.0443895325639 -0.0442951552037 -0.0442076984989 -0.0440868180355 -0.0439832395 -0.0439564983271 -0.0440193407337 -0.0464551610587 -0.0300797717939 -0.0137426064624 -0.0153236260145 -0.0411523356181 -0.0505153441613 -0.0490819815111 -0.0448024681388 -0.0375632708854 -0.0299034459055 -0.022250035885 -0.0148783774079 -0.00803662467781 -0.00177346660353 0.00389570050933 0.00901412037569 0.0136261709627 0.0177719975544 0.021471175958 0.0247196420461 0.0274870002596 0.0297122490007 0.031296843431 0.0321006085639 0.0319488275523 0.0306563392113 0.0280659100553 0.0240891460356 0.0187341887349 0.0121248904456 0.00456417389214 -0.00338508383341 -0.0112922579809 -0.019822643913 -0.0285823101003 -0.0259256347213 -0.0257736236224 -0.025725510039 -0.0257622418487 -0.0258054321641 -0.0257902329207 -0.0443246655173 -0.0442851759141 -0.0442308204465 -0.0441771007721 -0.044127854606 -0.044089838752 -0.0440992176717 -0.0441670733724 -0.0441920264077 -0.0441691478878 -0.0441098372745 -0.0440258354052 -0.0438989111644 -0.0437473905913 -0.0435928626107 -0.0434145299702 -0.0432530705097 -0.0431297735778 -0.0430453387571 -0.0429509039051 -0.0428674130482 -0.0427748287591 -0.0426974442756 -0.0425889551053 -0.0424855870155 -0.0423894490901 -0.042297574846 -0.042208535148 -0.042124984633 -0.0420316949722 -0.0419304822299 -0.0418774041489 -0.0418476284425 -0.041850333093 -0.0418750697387 -0.0419393928245 -0.0420959110761 -0.0424789125302 -0.0430856618293 -0.0469147845225 -0.0248613867583 -0.00559423809066 -0.0142347500754 -0.0401012495908 -0.0466333159902 -0.044358422195 -0.0392663207611 -0.0317278406239 -0.0241387704915 -0.0166293097926 -0.00950939541447 -0.00294739588717 0.00302910864672 0.00841337629309 0.0132500327956 0.0175738824857 0.0214120546305 0.0247663727145 0.0276114426356 0.0298908818169 0.0315127170312 0.0323431293642 0.0322063617382 0.0309012024649 0.0282393295287 0.0240995988601 0.0184813634205 0.0115381857566 0.00358947572762 -0.00488197565791 -0.0133061131188 -0.0211436839897 -0.0271531344848 -0.0293439324419 -0.0285932674804 -0.0282070153061 -0.0280113047682 -0.0278934494246 -0.0278383334831 -0.0277817564442 -0.0424259090007 -0.0424046584867 -0.0423540879383 -0.0422935664857 -0.0422270509482 -0.0421617385466 -0.0421210266385 -0.0421546300238 -0.0421972073823 -0.0421872917043 -0.0421331634639 -0.042043243459 -0.0419262489822 -0.0417632119888 -0.0415871568641 -0.0413730652409 -0.0411551492649 -0.0409700424031 -0.0408057901437 -0.0406661922702 -0.0405453954386 -0.0404096250751 -0.0402674917824 -0.0401277188198 -0.0399715711006 -0.0398242850761 -0.0396975015945 -0.0395622264854 -0.0394264143074 -0.0392940674956 -0.0392388144672 -0.0392136455522 -0.0392288048383 -0.039288708233 -0.0393969901825 -0.0395821186493 -0.0398979685219 -0.040489320809 -0.0411832230414 -0.0454172818219 -0.0165517560866 0.0046568202239 -0.0123312548437 -0.0378252627478 -0.0420970757274 -0.0391512414296 -0.033377457258 -0.0257117501635 -0.0182543411681 -0.0109432197059 -0.00411508232732 0.00214013804759 0.00780611117188 0.0128839469339 0.0174158544819 0.0214250647464 0.0249236388 0.027893461484 0.0302853467412 0.0320141408153 0.032954480064 0.0329370014729 0.0317561067058 0.0292005065571 0.0251087662624 0.0194371698192 0.0123161773595 0.00407556600699 -0.00475726734558 -0.0135105261175 -0.0216177446518 -0.0286843234287 -0.0326208744541 -0.0323900179264 -0.0308643213822 -0.0300669353857 -0.0296958114286 -0.0295306430878 -0.0293875849184 -0.0292869778879 -0.0405389336753 -0.0405418828548 -0.0404988501604 -0.0404372171125 -0.0403600862286 -0.0402752863316 -0.0402039281578 -0.0401680626221 -0.0401964315633 -0.0402023961496 -0.0401567599551 -0.040065523181 -0.0399369700149 -0.039776496712 -0.0395621918548 -0.0393448564319 -0.0390919685934 -0.0388530079665 -0.0386140676388 -0.038405262824 -0.0382151230321 -0.0380417725189 -0.0378295255413 -0.0376221276698 -0.0374114770108 -0.03721552601 -0.0370210408359 -0.0368294145359 -0.0366426627499 -0.0365354091305 -0.0364710945129 -0.0364377268525 -0.0364678234225 -0.0365677678998 -0.0367498332588 -0.0370367114998 -0.0374961337929 -0.0381671578092 -0.0387750021017 -0.0434037257427 -0.0064831177778 0.0159727635344 -0.0099514849728 -0.0344689060681 -0.0369098819057 -0.033430571368 -0.0271465898168 -0.019507915658 -0.0122419971808 -0.00518698053385 0.00131049705375 0.00723123324655 0.0125621953816 0.0173111191149 0.021514063774 0.025180817072 0.0283061057969 0.0308495830578 0.0327357494937 0.0338483526826 0.034027445754 0.0330706290329 0.0307530064067 0.0268760442652 0.0213404387479 0.0142211969694 0.0058146836447 -0.00336235901733 -0.0126103670297 -0.0211196075756 -0.0281643959291 -0.0332762431238 -0.0361488367372 -0.033794499118 -0.0323182686946 -0.0313589094836 -0.0308468715345 -0.0306377560643 -0.0305217364097 -0.0304028820858 -0.038697476931 -0.0386996701442 -0.0386617801347 -0.0385969144462 -0.0385144801586 -0.03841789625 -0.0383251554532 -0.0382453085576 -0.0382091544126 -0.0382157917118 -0.0381840722831 -0.0380950072951 -0.0379572266397 -0.037778730131 -0.0375531635779 -0.0373018174651 -0.0370435365507 -0.0367396890681 -0.0364523063592 -0.0361710273524 -0.0359020684985 -0.03564874354 -0.0353774598258 -0.0350906463665 -0.0348127708499 -0.0345483052652 -0.0342916498193 -0.0340348247941 -0.0338396987173 -0.0336914382109 -0.0335737465298 -0.0335214640473 -0.0335519705594 -0.0336798702105 -0.0339205532285 -0.0342962086011 -0.0348458150871 -0.0355714238708 -0.0359753335966 -0.0412529144878 0.00433398765723 0.0276080992458 -0.00727132158615 -0.0301588631465 -0.0311539312026 -0.0272555583322 -0.0206253723713 -0.0131318679267 -0.0061100181553 0.000634588030757 0.00676653565231 0.0123261386202 0.0172982215056 0.0216955457011 0.0255445775129 0.0288398791773 0.0315565175289 0.0336295745368 0.0349548700023 0.0353833079406 0.0347207049799 0.0327372349293 0.0292043643309 0.0239650365476 0.017020860836 0.008604288871 -0.000796507931607 -0.0104771037814 -0.0196113287418 -0.0273895159192 -0.0331236550267 -0.0361202665696 -0.0365494323683 -0.0347707631891 -0.0332801303665 -0.0322691445405 -0.0316563177804 -0.0313657546548 -0.0312605632384 -0.0311668247732 -0.0368943704559 -0.036877574255 -0.0368381820571 -0.036769167773 -0.0366817482554 -0.0365788247286 -0.036464634414 -0.0363630754821 -0.0362826338347 -0.0362386952502 -0.036213846566 -0.0361328012172 -0.0359919373934 -0.0358000720681 -0.0355655450276 -0.0352844202598 -0.0349758452914 -0.0346430076987 -0.0342934157597 -0.0339535776148 -0.0336065697616 -0.0332564874351 -0.0329019366457 -0.0325382810697 -0.0321831495046 -0.0318329240984 -0.0314959051811 -0.0311907713575 -0.0309261209781 -0.0306920807655 -0.0305239350005 -0.0304401576201 -0.0304632331742 -0.0306157428807 -0.0309114479147 -0.0313816099067 -0.0319735059864 -0.0327385962764 -0.0329308562056 -0.0389315590995 0.0155564034314 0.0394107973818 -0.00423922815072 -0.0249951059565 -0.0249439236117 -0.0207195911793 -0.0138829380392 -0.0066172021976 0.000117866592463 0.00650643714463 0.0122445300081 0.0174193638687 0.0220106773767 0.0260344168762 0.0295044246062 0.0323983973504 0.0346694526732 0.0362259179291 0.0369329082681 0.0366076217407 0.035023897661 0.0319338874181 0.0271268764754 0.0205218797413 0.0122619165744 0.00276868174194 -0.00727030033849 -0.0169920044392 -0.0255132854738 -0.0321252025352 -0.0363641722782 -0.0378163990063 -0.0374327383513 -0.0354568206738 -0.0339444047169 -0.0329134692539 -0.0322412003246 -0.0318778640369 -0.0317470263697 -0.0317548097446 -0.0351111699907 -0.0350783381721 -0.0350300816006 -0.034960999743 -0.0348721129767 -0.0347681552853 -0.0346493612067 -0.0345212635418 -0.0344178666643 -0.0343160840724 -0.0342455285316 -0.0341691952822 -0.0340330542362 -0.0338363448344 -0.0335844021553 -0.0332858477877 -0.0329353965245 -0.0325568672739 -0.0321584655069 -0.0317460391825 -0.031310973714 -0.0308650945292 -0.0304172535324 -0.0299691745476 -0.0295142148602 -0.0290612099428 -0.0286237142385 -0.0282227761032 -0.0278485812687 -0.0275341910198 -0.0273004907952 -0.0271726775994 -0.0271796061214 -0.0273567173129 -0.0277189397153 -0.0282624883187 -0.0289296850095 -0.0297910416155 -0.0301732371463 -0.0370617551246 0.0274082463638 0.0515040606226 -0.000763175862657 -0.019087898093 -0.0183992199308 -0.0139171632544 -0.00699043186158 -8.03792328231e-06 0.00640710336153 0.0124050354206 0.0177287013915 0.0224996680501 0.0266914963333 0.0303212731288 0.0333876116171 0.0358498251561 0.0376369384441 0.0386286155475 0.0386577724436 0.0375080765081 0.0349257432488 0.0306582792594 0.0245394934728 0.0166022040352 0.00716686610691 -0.0031408647401 -0.0134568242494 -0.0228222422345 -0.0303893369107 -0.0355879889018 -0.038154937598 -0.0387714572924 -0.0374435050556 -0.0356907771371 -0.0343168300309 -0.0333373444649 -0.0326539042087 -0.0322372101096 -0.0320540620312 -0.0320119072775 -0.0333292329259 -0.0332965190738 -0.0332459426333 -0.0331866143112 -0.0331063776821 -0.0330071512067 -0.0328890454754 -0.0327506787799 -0.0326074767043 -0.0324772836583 -0.032334390492 -0.0322138353564 -0.0320675845255 -0.0318716556065 -0.0316089481885 -0.0312868553984 -0.0309122824345 -0.0304825519745 -0.0300224141756 -0.0295312344311 -0.0290143055027 -0.0284724075043 -0.0279237684043 -0.0273629088627 -0.0267881572615 -0.0262124401731 -0.0256460759282 -0.0251097953579 -0.0246185657807 -0.0241989691869 -0.0238765100415 -0.0236846650017 -0.0236601646432 -0.0238460476994 -0.0242436180638 -0.0248416001864 -0.025667640395 -0.0267611985616 -0.0274733770906 -0.0357232056681 0.0398560729602 0.063799292476 0.00312974821666 -0.0125919914856 -0.0116417958496 -0.00693889766142 -1.85510014106e-05 0.00664524459439 0.0127165439352 0.0183006822586 0.0231973288613 0.0275507969165 0.031328472856 0.0345462869435 0.0371853959676 0.0391853017742 0.0404490351345 0.0408261327722 0.0401166405904 0.0380722308837 0.0344184898432 0.0289163153197 0.0214761587541 0.0122841559325 0.00186845442872 -0.00894269766908 -0.0191564242473 -0.0277948157639 -0.0341202871902 -0.0378499804155 -0.0390897706989 -0.0388750390742 -0.037308150254 -0.0357218825032 -0.0344953503324 -0.0335963349332 -0.0329297456907 -0.0324776088316 -0.0322659502226 -0.0321708756485 -0.0315915703917 -0.0315601311094 -0.031527479755 -0.0314842644567 -0.0314174721379 -0.0313235661293 -0.0312027660581 -0.0310550051585 -0.0308794623459 -0.0307133544127 -0.0305273601569 -0.0303259418969 -0.0301124400513 -0.029907135908 -0.0296326840092 -0.0292930001709 -0.0288825517386 -0.0284120437053 -0.0278834383891 -0.0273137633786 -0.026703312814 -0.0260606291364 -0.0253948620693 -0.0247005357098 -0.023988918942 -0.0232693033692 -0.0225524991185 -0.0218630833963 -0.0212244778169 -0.0206694509299 -0.0202312692711 -0.019948634736 -0.0198701010492 -0.0200308810028 -0.0204214327487 -0.0211015014528 -0.0220835004011 -0.0233816616169 -0.0241837694534 -0.0336556942904 0.0523394107763 0.0760817451088 0.00730220928846 -0.00570609987585 -0.00480082612444 0.000121442953696 0.00695868304654 0.0132870706278 0.019000388964 0.0241589246313 0.0286238498076 0.0325522989938 0.0359058304435 0.0386967272314 0.0408867058571 0.0423940900147 0.0430942600959 0.0428056891231 0.0412957443325 0.0382871192829 0.0334945197401 0.0267151954309 0.017972900678 0.00764492701649 -0.00351317113419 -0.0144882805672 -0.0242363181594 -0.0318767534 -0.0367923567312 -0.0389933200818 -0.0396929023642 -0.0384277510298 -0.0369915551953 -0.0356139541329 -0.0345315909622 -0.0337389085214 -0.0331315751854 -0.0326504117251 -0.0324022942225 -0.0323162300693 -0.0299853799843 -0.0299694013211 -0.0299453496988 -0.0299046063734 -0.0298394990356 -0.0297414063612 -0.0296089297523 -0.0294424352855 -0.029241408233 -0.0290161277104 -0.0287957108236 -0.0285511701204 -0.0282828765769 -0.0279910708906 -0.0276698408503 -0.0273011798276 -0.0268558458289 -0.0263328193145 -0.0257479993237 -0.0250892929008 -0.0243808203507 -0.0236251847661 -0.0228287098215 -0.0219861700228 -0.0211180364507 -0.0202346311155 -0.0193438452763 -0.0184725464284 -0.017655570509 -0.0169299957611 -0.0163376088389 -0.0159176952796 -0.0157288388006 -0.0157750802249 -0.0161448522113 -0.01691124089 -0.0180154618181 -0.0195771993522 -0.0205376051702 -0.0311294974201 0.0649698636504 0.0884333854961 0.0116295394357 0.0013761980728 0.0019945780305 0.00716335783496 0.0138619766174 0.0198569945868 0.0252089890997 0.0299414024202 0.0339779255676 0.0374804407898 0.0404050167211 0.0427576533351 0.0444788684147 0.0454644731099 0.0455609251077 0.0445553849639 0.0421840525408 0.038145692772 0.0321580120075 0.0240843685887 0.0141040952527 0.00282059871489 -0.00877973482678 -0.0195309874303 -0.0284171128413 -0.0348237187827 -0.0384453234547 -0.0395564638663 -0.0393341705151 -0.0379347662693 -0.0366100601586 -0.0354084440317 -0.0344654627527 -0.0337645432379 -0.0332320882014 -0.0327770620965 -0.0324971015787 -0.0323884856616 -0.0285145040185 -0.0285227731899 -0.0284955067668 -0.0284496163429 -0.0283748217946 -0.0282615390879 -0.0281079905536 -0.027914965694 -0.0276832806145 -0.0274107720204 -0.0271296208175 -0.0268485691481 -0.0265575093205 -0.0261874085184 -0.0257880579129 -0.0253407156393 -0.0248369091748 -0.0242606700709 -0.0236066919631 -0.0228638965533 -0.0220507933644 -0.0211730505103 -0.0202253560937 -0.0192199765156 -0.0181781729414 -0.0171050870209 -0.0160162916157 -0.014935529184 -0.0139050476544 -0.0129715557955 -0.0121735084649 -0.0115416250247 -0.0111366114611 -0.0110118333867 -0.0113255988839 -0.0121064632899 -0.0134508471883 -0.0154368939342 -0.016886849337 -0.0288734805413 0.0780109192484 0.100884646217 0.0159778999993 0.00848780792716 0.00862149330163 0.0140831004612 0.020608656845 0.0262904841243 0.0312890495614 0.0356064476273 0.0392263487843 0.0423091959111 0.0448056348066 0.0467128207926 0.0479484423009 0.0483845544141 0.0478377589552 0.0460644049815 0.0427720956983 0.0376425736366 0.0304143600068 0.0210528430772 0.00993842004469 -0.00207309640818 -0.0137861532811 -0.0239479279144 -0.0316372254116 -0.0366784524475 -0.0393545836629 -0.0399893869062 -0.0385686019564 -0.0373135936848 -0.0361310099455 -0.0350962085261 -0.0342766802443 -0.0336496134229 -0.0331815046663 -0.032794136749 -0.0325080905425 -0.0323974471569 -0.0270960382701 -0.0271286810859 -0.0271154169257 -0.0270754037897 -0.0269912809959 -0.0268597225048 -0.0266819707482 -0.0264604037696 -0.026197005814 -0.0258926171338 -0.0255504115612 -0.0251949972097 -0.0248420029755 -0.0244533916055 -0.0239889794883 -0.0234505186719 -0.0228547248213 -0.0221956343958 -0.0214503560866 -0.020622980264 -0.0197098425313 -0.0186857996198 -0.0175823464042 -0.0164053989504 -0.015174498347 -0.0138978490392 -0.0125836444187 -0.0112642220836 -0.00998726810572 -0.00880287356366 -0.00770881903106 -0.00673510281641 -0.00601043895422 -0.00567820923132 -0.00583790833721 -0.00665314654131 -0.00827230469924 -0.0108279835089 -0.012987084931 -0.0271004968735 0.0915012958162 0.113226318616 0.0201554250235 0.015460705634 0.0149576498142 0.020778728836 0.0271165417054 0.0325205106358 0.0371845895604 0.0411099806281 0.0443340447073 0.0470111576355 0.0490863821396 0.0505455930579 0.051282233558 0.0511434821763 0.0499157656586 0.0473261999011 0.0430582888671 0.036786654356 0.0282952747021 0.0176982061406 0.00562687325066 -0.00679229566521 -0.0182010478384 -0.0273924413853 -0.0336868869678 -0.0373290424852 -0.0398390095498 -0.0387471699797 -0.0376429086662 -0.0365574197813 -0.0355528082648 -0.0346742731434 -0.0339660992014 -0.0334113436736 -0.0329926967441 -0.0326507258156 -0.0323967714041 -0.0322873976886 -0.025725533491 -0.0257679223663 -0.0257770508082 -0.0257440044693 -0.0256503684733 -0.0255035777194 -0.0253063045631 -0.0250607373138 -0.0247687678104 -0.0244321076241 -0.024049974448 -0.023625457318 -0.0231790650046 -0.0227178328319 -0.0222064809912 -0.0216104205475 -0.0209291046865 -0.0201614775 -0.0193098438641 -0.0183761462639 -0.017333792999 -0.0161782003656 -0.0149152452493 -0.0135590690141 -0.0121285536665 -0.0106228276558 -0.00905973809341 -0.00746728833204 -0.00590614464786 -0.0043632923323 -0.00279593211987 -0.00141119906451 -0.000298619816568 0.000400964372485 0.000495632661204 -0.000279218944371 -0.00204255467257 -0.00526253053391 -0.0084144284177 -0.025411922479 0.105281052738 0.12507456457 0.0238975803594 0.0221063749154 0.0208815038153 0.0271547243973 0.0333059135088 0.0384791864953 0.0428386476027 0.0464072576584 0.049265620901 0.0515590086259 0.0532264001804 0.0542402544057 0.0544684761532 0.0537324970356 0.0517887873075 0.0483379181743 0.0430452044757 0.0355900657797 0.0258316838956 0.0140846864169 0.00127497715516 -0.0112165287529 -0.0219579969306 -0.0299579623618 -0.0351976497978 -0.0381321498026 -0.0385883299796 -0.0375951205695 -0.0366513299291 -0.0357349161898 -0.0348901131851 -0.034148266125 -0.033540684661 -0.0330568561631 -0.0326869566455 -0.0323815201452 -0.032160538651 -0.0320751346508 -0.0244595963171 -0.0244765290459 -0.0244822612429 -0.0244331707045 -0.0243265105876 -0.0241704791341 -0.0239640846485 -0.0237036209167 -0.0233900187359 -0.0230246837504 -0.0226078623555 -0.0221383449484 -0.0216172762927 -0.0210581200085 -0.0204607165501 -0.0198106855266 -0.0190513555197 -0.0181881406432 -0.0172266431485 -0.016157438674 -0.0149737880627 -0.0136721277775 -0.0122427646867 -0.0106969509094 -0.00904779442297 -0.00729940420937 -0.00544839536564 -0.00354753485316 -0.00159598919584 0.000495434131562 0.0025624387568 0.00444356771024 0.00606939068168 0.00729145469832 0.00781771263881 0.00740634361115 0.00566072168055 0.00194384709363 -0.00220204244615 -0.0229198252147 0.119014838247 0.135879590927 0.0268914042092 0.0282477064335 0.0262912293135 0.0331264252022 0.0390996373843 0.0440986697208 0.0481947578601 0.051454170281 0.0539865711733 0.0559266090612 0.0572064072927 0.0577830959352 0.0574980273504 0.0561463162871 0.0534555599455 0.0491040929313 0.0427480177916 0.0340883114097 0.0230982060408 0.01035602683 -0.0028776055242 -0.0150052136766 -0.0246844375767 -0.0312780281887 -0.0353157287422 -0.0389582609813 -0.0373940219218 -0.0364928517128 -0.035635475392 -0.0348600933673 -0.0341419890568 -0.0335167860907 -0.0329993418722 -0.0325836060463 -0.0322594413579 -0.0319878361621 -0.0318092892945 -0.0317458646943 -0.0232769797075 -0.0232602537021 -0.0232294221086 -0.023157734968 -0.0230391481859 -0.0228737942091 -0.022658067713 -0.0223876683933 -0.0220595337457 -0.0216715937529 -0.0212247250689 -0.020718325779 -0.0201502090963 -0.0195184030419 -0.0188374987896 -0.0180911390107 -0.0172276402853 -0.0162755546181 -0.0152010435515 -0.0139980123269 -0.0126614009141 -0.011194918068 -0.00959261503081 -0.0078395835698 -0.00595830119689 -0.00391869551531 -0.00174483027512 0.000547661916395 0.00304594740378 0.00567125110432 0.00826251006017 0.01075605922 0.0130827874856 0.0150192851752 0.016363524958 0.0167145824447 0.0153736657033 0.0118262450572 0.00691879865428 -0.0168767295068 0.131428236868 0.144586650635 0.0287359465117 0.0337545441629 0.0311175296061 0.0386191449559 0.0444229431763 0.0493134110966 0.0531996384174 0.0562097499846 0.0584654782413 0.0600910292445 0.0610104555775 0.0611640611143 0.0603658298065 0.0583844818421 0.0549204785033 0.0496355867797 0.0421875919769 0.0323180328057 0.0201567144979 0.00659877324605 -0.00675476858179 -0.0181589661841 -0.0265645762031 -0.0323698173951 -0.0360850159674 -0.0366952542431 -0.0359490585261 -0.0352441678318 -0.0345544823923 -0.0339079821291 -0.0333028021823 -0.0327813154639 -0.0323465485873 -0.0319955493413 -0.0317205345328 -0.0314918808264 -0.0313475980584 -0.0312997785644 -0.0221307283012 -0.0220984105674 -0.0220336762111 -0.0219538876275 -0.0218234384886 -0.0216429406471 -0.02141018145 -0.0211243687498 -0.0207805234415 -0.0203746375744 -0.0199020328446 -0.019362720953 -0.0187533548397 -0.0180682297287 -0.0173064291444 -0.016441047181 -0.0154948800299 -0.0144330281095 -0.0132243665697 -0.0118940131643 -0.0104127999057 -0.00877735523168 -0.00697249997623 -0.00500416506309 -0.00284875032921 -0.000478298950168 0.0020628842781 0.00483603222184 0.00785006348727 0.0110182245716 0.0142267098568 0.017491329018 0.0207432264287 0.0237697023095 0.0263260112365 0.0277789393419 0.0277648356633 0.0259194437357 0.0220445848585 0.00500454953999 0.139066598509 0.149885699642 0.0293283098434 0.038669869573 0.035323728634 0.0435570145573 0.0491987836901 0.0540594166786 0.0578036726015 0.0606371585003 0.0626753668683 0.064033892995 0.0646272988394 0.0643779485951 0.0630721079371 0.0604524635862 0.056195064679 0.0499523493911 0.0413984354539 0.0303425876312 0.0171276715423 0.003026873226 -0.0100462260981 -0.0203566526112 -0.0271662696482 -0.0317924806959 -0.0371407888553 -0.03531843405 -0.0346228954717 -0.0339854895408 -0.0334276153758 -0.0328874632799 -0.0323899760715 -0.0319653182572 -0.031609403099 -0.0313208616482 -0.031088029303 -0.0309106080924 -0.0308059737742 -0.0307719393617 -0.0210349903028 -0.0209987395639 -0.0209218819609 -0.020832418296 -0.0206868564871 -0.0204887151325 -0.0202364026746 -0.0199287444785 -0.0195635908093 -0.0191361359912 -0.0186405548455 -0.0180709898811 -0.0174207017312 -0.0166819791604 -0.0158410039233 -0.0148995838911 -0.0138557842847 -0.0126642425246 -0.0113407145364 -0.00987618961767 -0.0082201141718 -0.0064068857959 -0.00441178117829 -0.00219588234113 0.000286013253907 0.00297774731004 0.00592034437554 0.00918545116942 0.0127327771637 0.0164786080195 0.0204367117576 0.0247127551337 0.0290959884294 0.033487356783 0.0373814054968 0.0404655648617 0.0426284661375 0.0432845951096 0.0429678550479 0.0328237703347 0.136219041791 0.149830252649 0.028810207377 0.0430154354687 0.038822087018 0.047841551144 0.0533446767873 0.0582755414112 0.0619631568482 0.0647062744674 0.0665960494026 0.0677434686134 0.0680520273484 0.0674259539356 0.0656237893709 0.062363379741 0.0573000709748 0.0500857442289 0.0404269313067 0.0282310177856 0.0141105243972 -0.000265703204981 -0.0127524320588 -0.021899448991 -0.0279932189197 -0.0320493004285 -0.0335149143705 -0.0334226610278 -0.0330772730793 -0.0326655873516 -0.0322457781174 -0.0318275812686 -0.0314414654599 -0.0311138944109 -0.0308411841123 -0.030620303831 -0.0304440978918 -0.030317667819 -0.0302338802256 -0.0301957087065 -0.0200092237084 -0.0199745715693 -0.019895097109 -0.0197897866973 -0.0196271617103 -0.0194103318152 -0.0191378115641 -0.0188084216708 -0.0184197446802 -0.0179676471472 -0.0174471691437 -0.0168480418505 -0.016161239835 -0.0153744896047 -0.0144775215711 -0.0134611058237 -0.0123049131345 -0.0110051833016 -0.00955881993761 -0.00791797247962 -0.00610906196529 -0.00413234410122 -0.00189927120901 0.000628983682577 0.00337835959834 0.00640157600263 0.00981495031967 0.0135637013931 0.0176248151575 0.0220641698295 0.0269654597085 0.0322852126877 0.0379212381339 0.0437175446142 0.049303585234 0.0546329562525 0.0592246235434 0.0620669939396 0.0617925006731 0.0491066630278 0.141237979357 0.151120143509 0.0289917695327 0.0468332530908 0.0414696322956 0.0513507931753 0.0567745419947 0.0619066017813 0.0656438093857 0.0683967478955 0.0702167483149 0.0712165359707 0.0712876471864 0.0703168051199 0.068035503901 0.0641382289288 0.0582643168521 0.0500750000998 0.0393255056858 0.0260554696964 0.0112312725421 -0.00307192405455 -0.0146434475677 -0.0224139288628 -0.0280549092946 -0.0327438037426 -0.0320199516822 -0.0318675167486 -0.031619699981 -0.0313476824527 -0.0310482290703 -0.0307515617233 -0.0304815935489 -0.0302574398585 -0.0300723066431 -0.0299240353185 -0.0298095090698 -0.0297167015229 -0.0296449438847 -0.029583342658 -0.0190608161538 -0.0190291413443 -0.0189439491561 -0.0188190218988 -0.0186418368069 -0.0184062585634 -0.0181137809467 -0.0177640963906 -0.0173545621833 -0.0168801788019 -0.0163336847696 -0.0157059954782 -0.0149837415937 -0.0141538772599 -0.013204242392 -0.0121148535874 -0.010865826933 -0.00945360129758 -0.0078593874712 -0.00606893226704 -0.00410461303949 -0.00189641772417 0.000614153368099 0.00336494616157 0.00637810910772 0.00983179396377 0.0136821232959 0.017872615028 0.0225435914564 0.0277444409055 0.033537500426 0.0399455552496 0.0469281059221 0.0543314738219 0.0620910115637 0.0700886629579 0.0777374826176 0.083610604913 0.0846381353861 0.0721150914388 0.158406377589 0.156001984253 0.030719841684 0.0499989842482 0.0431442298935 0.0539740038677 0.0594139637214 0.0649124958709 0.0688262849238 0.0717016694972 0.0735380121264 0.0744595029716 0.0743453916351 0.0730670402045 0.0703298898283 0.0658072296509 0.0591281855862 0.0499774594256 0.0381792613298 0.0239373526744 0.00866337069434 -0.00514256006961 -0.0156481473524 -0.022529266275 -0.027050982126 -0.0317487993326 -0.0305660641576 -0.0303283931643 -0.0301601183161 -0.0300076150068 -0.0298335967649 -0.0296589160691 -0.0295198882571 -0.02939940978 -0.0292973338652 -0.0292127682397 -0.0291451039826 -0.029079570455 -0.0290315666446 -0.0289886342761 -0.0181856366935 -0.0181575538165 -0.0180633371965 -0.0179249322311 -0.0177335921589 -0.0174762614128 -0.0171628358677 -0.0167945531714 -0.0163681975532 -0.0158765528496 -0.0153096160929 -0.0146554677833 -0.0139004361492 -0.0130311067116 -0.0120268872938 -0.0108621450466 -0.0095219968737 -0.00799721096034 -0.00626947154685 -0.00432404474638 -0.00215844397965 0.000275697007493 0.00298736590316 0.00595061600235 0.00932575204834 0.013183991983 0.0174166410703 0.0220764278156 0.0273342934882 0.0332922124 0.0400319349789 0.0475468088303 0.0558923072547 0.0651143232311 0.0752120783905 0.0862988366464 0.0979570713143 0.108899728026 0.115920793102 0.111782346102 0.181452522224 0.159269916429 0.03172836653 0.051691505705 0.0436088670827 0.0555929832882 0.061214716627 0.0672830062055 0.0715167148482 0.0746337776438 0.0765755393516 0.0774903673285 0.0772461818621 0.0757020026108 0.0725388458187 0.0674107339144 0.0599415965233 0.0498534237848 0.0370615696164 0.0219446053029 0.00639179114069 -0.00658203295763 -0.0156254995427 -0.0226927016847 -0.0281718175129 -0.0287725781985 -0.0286447110307 -0.0286323950805 -0.0286359681333 -0.0286227718081 -0.0286013677161 -0.0285673107717 -0.0285541816343 -0.0285338751965 -0.0285108941471 -0.0284878584729 -0.0284622758213 -0.0284176297651 -0.028397473796 -0.0283887033211 -0.0173916741598 -0.0173603638322 -0.0172627146563 -0.0171224681428 -0.0169045396303 -0.0166199353895 -0.0162853286224 -0.0159037379841 -0.0154689101993 -0.0149690316783 -0.0143899943359 -0.0137165906224 -0.0129327279207 -0.0120207069128 -0.0109563618184 -0.00971184996683 -0.00827152959368 -0.00662728855726 -0.00476406478836 -0.00268343778104 -0.000351355566944 0.00227996813555 0.00518776068831 0.00842753708015 0.0121506236275 0.0163457214186 0.0209598277022 0.0261011594931 0.0319815578394 0.0386526250825 0.046195411963 0.0548200026763 0.0646505569072 0.0755961176791 0.0879934521889 0.102234614336 0.118209416846 0.135635279413 0.153731815143 0.162971613198 0.200948595161 0.148726482817 0.0278960346877 0.0503755408242 0.0423750463975 0.0560405410127 0.0621543282699 0.0690436645004 0.0737498138043 0.0772261674261 0.0793585393506 0.0803361249835 0.0800170938862 0.0782521834023 0.0746993754854 0.0689954062177 0.0607629098204 0.0497757581379 0.0360779769066 0.020298039264 0.00484273667568 -0.00690695976947 -0.0136133782 -0.0194514621586 -0.0301550712759 -0.0270125240998 -0.0268127115166 -0.026876721767 -0.0270421754267 -0.0271982947887 -0.0273387742514 -0.0274633724174 -0.0275674868143 -0.0276425642227 -0.027693987322 -0.027727172458 -0.0277364115604 -0.027726587376 -0.0277350206264 -0.0277513052048 -0.0167007700017 -0.0166538764676 -0.0165621056188 -0.0164176386501 -0.0161705211771 -0.0158741869069 -0.0155393984701 -0.0151665213558 -0.0147399998058 -0.0142409960382 -0.0136514843252 -0.0129533982548 -0.0121283215644 -0.0111556765082 -0.0100060982641 -0.00865245798246 -0.00709798514656 -0.00534722015692 -0.00338173248957 -0.0011682411304 0.00133522893262 0.00412792552327 0.00723084003743 0.010756835969 0.0148009273334 0.0193444011317 0.0243335694553 0.0298888898523 0.036248123539 0.0435351836095 0.0520196042925 0.0618415846204 0.0728350850822 0.0852354582798 0.0996944181771 0.11637758857 0.135800650311 0.15828743388 0.18514690669 0.195134641106 0.205025311164 0.12333601142 0.0185024153323 0.0454055853715 0.0392069524362 0.0552791130446 0.0623016238859 0.0702806788937 0.0756000490624 0.0795376404721 0.0819326374192 0.0830346357184 0.0826937550982 0.0807565990674 0.0768594241531 0.0706238649779 0.0616757670028 0.0498529061331 0.0353618912563 0.0191587803165 0.00423075409453 -0.00647841931539 -0.013046450146 -0.0179548199011 -0.0211604399576 -0.0234330633721 -0.0242957621746 -0.0248733025821 -0.0253256159997 -0.0257265536027 -0.0260425546183 -0.0263243588157 -0.0265458837086 -0.0267146912667 -0.0268367759798 -0.0269210374746 -0.0269641392285 -0.0270023278692 -0.027037053293 -0.0270722917453 -0.0161368000246 -0.0160690223425 -0.0159825359018 -0.0158355629838 -0.0155860181259 -0.0152932758687 -0.0149752944183 -0.0146206010093 -0.0142004455729 -0.0136911996557 -0.0130734490381 -0.0123279266908 -0.011435366828 -0.0103757299954 -0.0091251026934 -0.00767263852342 -0.00602860651595 -0.00418480117068 -0.00211011137483 0.000245778129287 0.00290289670745 0.00586565197195 0.00919096738713 0.0129762000701 0.0172827456143 0.0220735199108 0.027322226329 0.0332625999418 0.0401375297813 0.0481613723876 0.0575657723658 0.068209752549 0.0801046409766 0.0938992502853 0.109812869216 0.128013586618 0.149004393005 0.172263096411 0.198373027473 0.20396324895 0.204827225886 0.0850571699292 0.00553140158521 0.0377564626058 0.034639178783 0.053633645707 0.0618952146737 0.0711580962741 0.0771782461397 0.0816416199239 0.0843466455765 0.0856197807762 0.0853041986159 0.083245288791 0.0790576485928 0.072349370492 0.0627501312776 0.0501670808255 0.0349788063724 0.0185144154764 0.00456479359616 -0.00453205472156 -0.0125020791864 -0.0195345007729 -0.0197267106222 -0.0209144436949 -0.0220027186542 -0.0228802421676 -0.0235996995667 -0.0242143302713 -0.0247363734815 -0.0251614186479 -0.0255036084233 -0.0257700141547 -0.0259646716708 -0.0261012731102 -0.026189977291 -0.0262637467889 -0.0263150963401 -0.0263513368138 -0.0156793768844 -0.0156048430514 -0.0155132025366 -0.0153607458919 -0.0151147107884 -0.0148339710356 -0.0145449119424 -0.0142021832433 -0.0137718078578 -0.0132316360155 -0.0125653061408 -0.0117540976781 -0.0107816248351 -0.00963594390389 -0.00829786521299 -0.00676432868342 -0.00503776014538 -0.0030936190679 -0.000893419792945 0.00159501073376 0.00438155656419 0.00750083033911 0.0110158843779 0.0150081352565 0.0195078400356 0.024490340532 0.0300266663252 0.0363718448327 0.0437744517995 0.0524567871048 0.0624902357384 0.0737569868589 0.0865680129429 0.101414182782 0.118222107305 0.136920915334 0.157596827938 0.179827501064 0.201901793682 0.208250999659 0.204612044697 0.0473361982592 -0.00602616714156 0.0297650751764 0.0299144713126 0.0518194265875 0.0613696381915 0.0719395794258 0.0786459090897 0.0836403610616 0.0866650590805 0.0881377842128 0.0878888996144 0.0857653449743 0.0813577993589 0.0742615150699 0.0641147328005 0.0509035883973 0.0352493011272 0.0189575790941 0.00649353458721 -9.8439594019e-05 -0.00719779100418 -0.02135301884 -0.0178586987305 -0.0185898807474 -0.0197085166831 -0.0208707750586 -0.0218990270765 -0.0227372847906 -0.0234422369069 -0.0240137229254 -0.0244742590843 -0.0248370924741 -0.0251027459237 -0.0252959677146 -0.0254376361774 -0.0255425363728 -0.0256163002956 -0.025649491314 -0.0152761127939 -0.0152101353104 -0.0151088767349 -0.0149324691644 -0.0147044626872 -0.0144793278037 -0.0142167874524 -0.0138657076375 -0.0134023788425 -0.0128075949959 -0.0120718772117 -0.0111798350204 -0.0101281362198 -0.00891098788616 -0.00750910299688 -0.00591378720382 -0.00410918134096 -0.00206764085841 0.000241976911258 0.00284269714387 0.00575488837955 0.00901592705472 0.0126859157816 0.0168324880913 0.0214976154619 0.0266870251029 0.0325214119633 0.0392597053918 0.0471016660614 0.0562355663759 0.066747490626 0.078635676271 0.0921912729171 0.107688171623 0.124869174777 0.143522065283 0.163790838412 0.184775720272 0.20423407577 0.212364259112 0.204298659979 0.0154474487154 -0.0133201083196 0.0233861003256 0.0263046589676 0.0505953004703 0.0611769503197 0.0728713029393 0.0801326433336 0.0855890986921 0.0889025448304 0.0905754562865 0.090423657753 0.0882921302632 0.0837458044401 0.076370677976 0.065818652963 0.0521495059965 0.0362300770821 0.0205430443748 0.00961397158947 0.00243274647457 -0.00565692235641 -0.00946470618265 -0.0130448085703 -0.0153598763803 -0.017195009646 -0.0187942766909 -0.02018135782 -0.0213101188948 -0.0222068127691 -0.0229206324439 -0.0234906464158 -0.0239471083744 -0.0242958794331 -0.0245530238578 -0.0247407977376 -0.0248696754341 -0.0249651445445 -0.0249967827531 -0.0149039256916 -0.0148622303374 -0.014765526703 -0.0146095555461 -0.0144399162523 -0.0142392977651 -0.0139553523158 -0.0135574287115 -0.0130266927748 -0.0123578761417 -0.0115583754055 -0.0106149676104 -0.00951828708175 -0.0082517507323 -0.00679711042912 -0.00513802159657 -0.00325393987628 -0.00111922970322 0.00129095595703 0.00399429099278 0.00701576429007 0.0103985913786 0.0142068771879 0.018496167983 0.0233006647045 0.0286702588202 0.0347648533276 0.0418083306146 0.050022754628 0.0595893882697 0.070500389841 0.0827900650307 0.0968807094054 0.11287937234 0.130249433443 0.148786169051 0.168427190287 0.188022719187 0.205959013176 0.216596245147 0.204716620955 -0.00853497008272 -0.0151402957817 0.0201195226679 0.0249050045046 0.0507614715448 0.0618287389037 0.0742794662604 0.0818363955022 0.087617755261 0.0911370413184 0.0930003120938 0.0929762913071 0.0909190860718 0.0863594527188 0.0788675404376 0.0681218444835 0.0542537284352 0.0383487490222 0.0239781731362 0.0163474226009 0.00678423642334 -0.00679533873572 -0.0062415777884 -0.00954311274937 -0.0124054249502 -0.0148010210972 -0.016816616349 -0.0185265338227 -0.0199348967903 -0.021048029372 -0.0219133371576 -0.0225885176312 -0.0231262046754 -0.0235526989921 -0.0238758630922 -0.0241116316639 -0.0242578567922 -0.0243704817475 -0.024409884081 -0.0146077287727 -0.0145862796338 -0.0145101788152 -0.0143973590672 -0.0142550594964 -0.0140245707184 -0.0136783153585 -0.0132141585044 -0.0126342319714 -0.0119332689365 -0.0110998748768 -0.0101197291047 -0.00897966037707 -0.00766302509013 -0.00615093129184 -0.00442262839012 -0.00245865274319 -0.000237906810702 0.00225606454349 0.00504296680886 0.00815815181444 0.0116461893919 0.0155576569723 0.0199448847673 0.0248647818404 0.0304027925892 0.0367159218644 0.0440304855722 0.052569501522 0.0624339145241 0.0736296536341 0.0863772927988 0.10100509676 0.117251402485 0.134596091946 0.152849443767 0.171792189801 0.190049253731 0.206765638689 0.22045319139 0.206450624026 -0.0239496335753 -0.0108354622579 0.0204273291186 0.026135028199 0.052420369244 0.0633359994353 0.0760617852085 0.0836103139454 0.0895270023772 0.0931602923417 0.0951594504388 0.0952716637584 0.0933342797788 0.0888601797157 0.0814216921794 0.0707489621157 0.0571654772707 0.0418929466406 0.0291191067614 0.025093907349 0.0164122418549 -0.00481689818941 -0.00327852243049 -0.00634542282404 -0.00956273913167 -0.0124695570181 -0.0149531450397 -0.0170087665949 -0.0186761890795 -0.0199984610931 -0.0210214716277 -0.0218026696754 -0.0224157943535 -0.0228967036188 -0.0232651595156 -0.0235463749508 -0.02372497739 -0.0238439727604 -0.0239077385526 -0.014397554365 -0.0143810735566 -0.0143176818852 -0.014225510937 -0.0140769753341 -0.0137913627376 -0.0134012875658 -0.0129112032764 -0.0123062965212 -0.0115755381681 -0.0107067479196 -0.009686199709 -0.00849931935581 -0.00712897704317 -0.00555307797445 -0.00375430053779 -0.00172902384832 0.000540842769851 0.00308786646105 0.0059424861477 0.009137098583 0.0127080659537 0.0166978048427 0.0211643624597 0.0261881050108 0.0318702908964 0.0383609231184 0.0458875620111 0.054665199937 0.064774224486 0.0762875328433 0.0894477115839 0.104435762964 0.120940296552 0.13836304705 0.156221614399 0.174084749967 0.191027668852 0.205517880877 0.22256848458 0.208175466493 -0.0303067523568 -0.000353688415445 0.0259122297539 0.0308154244364 0.0565962765726 0.0663935536596 0.0788000657074 0.0859029958813 0.0917318602837 0.0953037913422 0.0974569291158 0.0977455505809 0.0961015461684 0.0919836226012 0.0849516638722 0.0747899068949 0.0619199871213 0.0479370681198 0.0356858287689 0.0294176713985 0.0203765446507 0.011606006211 0.00368141522019 -0.00191022154321 -0.00643437168232 -0.0101317334218 -0.0131665882569 -0.0156258242565 -0.0175692608618 -0.0190865638753 -0.0202604905884 -0.0211451041676 -0.0218254101556 -0.0223619303878 -0.0227674403426 -0.023072090052 -0.0232809763869 -0.0234141905258 -0.0234949495862 -0.0142387327793 -0.0142170329014 -0.0141699170985 -0.0140880305237 -0.0139189103456 -0.0135969913846 -0.0131875276671 -0.0126725767363 -0.0120395674776 -0.0112768503161 -0.0103711676663 -0.00930829746707 -0.00807266634156 -0.00664684529318 -0.00501593582352 -0.00318072285433 -0.00113185510278 0.00116909662214 0.00376318054811 0.00667838482861 0.00994222396388 0.013580461153 0.017627068575 0.0221475263281 0.02725325902 0.0330514955358 0.0396752259632 0.0473447662098 0.0562979341048 0.0666350358011 0.0784401854686 0.0919636101438 0.107360858979 0.12418822922 0.141738395209 0.15954395879 0.17696813399 0.192809191311 0.203793431686 0.224085654254 0.212794779135 -0.0272732820923 0.0183151932258 0.0339255787746 0.0373879518523 0.0609185318296 0.0691390976773 0.0807922499608 0.0872116948463 0.0927848445778 0.0963130066282 0.098434387408 0.0988719808945 0.0973710014483 0.0934918976276 0.0868936631365 0.0774706099076 0.0660473140267 0.0549024659785 0.0473975038809 0.036799553714 0.0174250387547 0.0148222946167 0.00817689200613 0.00186919556033 -0.00350087777908 -0.00794749117027 -0.0115485086956 -0.0144122173301 -0.0166341514106 -0.0183349163058 -0.0196377601449 -0.0206183706959 -0.0213541065247 -0.0219349845265 -0.0223864715216 -0.0227185975814 -0.0229441023572 -0.0230799356877 -0.023146811235 -0.0141431750311 -0.0141222445984 -0.0140768273889 -0.0139796273837 -0.013787298842 -0.0134550526372 -0.0130294782458 -0.0124902089412 -0.0118295401308 -0.0110352146897 -0.0100945782399 -0.00899198202692 -0.00771135214258 -0.00624231109584 -0.00458314533348 -0.00273358455935 -0.00067453199003 0.00164824379155 0.00428128798312 0.00724739168817 0.0105682255306 0.0142630137637 0.018340120679 0.0228775861937 0.0280353660228 0.0339346259525 0.040651552079 0.04838246385 0.0574630870943 0.0680265649253 0.0801005116286 0.0939628390751 0.109747908199 0.126969835322 0.144960348752 0.16329237814 0.181073883447 0.195958626664 0.199297570661 0.22099425864 0.207963892012 -0.0163769422254 0.0465496955786 0.0505486810496 0.0501082425856 0.070824320163 0.075783696652 0.0858012224401 0.0906988569748 0.0957422197929 0.0989352840555 0.101188918153 0.102094753534 0.101311269195 0.0986364708195 0.0935974447011 0.0864181809694 0.0774116798611 0.0704878759531 0.0714199121515 0.0570522268445 0.012585848775 0.0186991154192 0.0121774886251 0.00525776924693 -0.000969658911661 -0.00607494140903 -0.0102057386167 -0.0134538091376 -0.015916810224 -0.0177624731083 -0.0191614801211 -0.0202162483468 -0.0210069790289 -0.0216138691838 -0.0220879718154 -0.0224437881521 -0.0226882517519 -0.0228266045888 -0.0228757981766 -0.0140972277948 -0.0140774509733 -0.0140104077208 -0.0138908268187 -0.0137004099492 -0.0133679224808 -0.0129309652315 -0.0123653597391 -0.011678490052 -0.0108598420259 -0.00989657542366 -0.00876663861357 -0.00745438550972 -0.00595270028396 -0.00426522564474 -0.00240828338607 -0.000356747542985 0.00197622186062 0.00463752300293 0.00763755018747 0.0110096049871 0.0147511343379 0.0188040359551 0.0232934098411 0.0284881846806 0.034493762041 0.0413053961713 0.0490867733206 0.0581884012777 0.0688939370214 0.0812414946218 0.0953504845425 0.111476920905 0.129200420865 0.147954026379 0.167786243662 0.188482924814 0.208936691836 0.21265389549 0.238454373683 0.19214927286 0.00252446613362 0.105072280131 0.0465148399996 0.0615587211103 0.0692463791376 0.0751564080661 0.0835809574858 0.0869372877086 0.0924106731258 0.0959775443066 0.0969912089696 0.0989242812612 0.096978580873 0.0940076002402 0.0892027436305 0.0824216643109 0.0795410822416 0.0772172736149 0.0903454927246 0.0877350466523 0.0564791127777 0.0312539471315 0.018031612107 0.008636606411 0.00116127745357 -0.00469743693115 -0.00924019814055 -0.0127921174057 -0.015472907659 -0.0173972453015 -0.0188167106162 -0.0199173980751 -0.0207594902208 -0.0213956180857 -0.0218830929188 -0.0222500701916 -0.0225041596631 -0.0226578417392 -0.022719189086 -0.0140797082943 -0.0140547018536 -0.0139573983075 -0.0138247724514 -0.013633170051 -0.0133505518337 -0.0129185326016 -0.0123213594605 -0.0116224643311 -0.0107981106051 -0.00982246308087 -0.00866845737636 -0.00731778022281 -0.00576992784113 -0.0040481772012 -0.00220564265636 -0.000203672121198 0.00210292889749 0.00478382144988 0.00780998382742 0.0111964591071 0.0149397122044 0.0190066103294 0.0235098228574 0.0287157415047 0.0347696991042 0.0416400121429 0.0494512322327 0.0585873505746 0.0693913544512 0.0818610300909 0.0960661465603 0.112405564584 0.130497290835 0.149884422182 0.171091191068 0.195279312336 0.200778009691 0.196958261243 0.216369426674 0.168948973543 0.0112832891505 0.190753176745 0.0629610398721 0.109875164297 0.0964110881575 0.100735545057 0.102109318802 0.100409449677 0.10645760367 0.107251606235 0.109520057431 0.114461666311 0.115469312144 0.118953107245 0.123122142004 0.124462299935 0.132372317155 0.126745524702 0.13421373841 0.0571320395501 0.0303378493003 0.0291819229295 0.0187279904274 0.00982787256683 0.00220354738315 -0.0039639879015 -0.00872913498027 -0.0124804984091 -0.0153209740378 -0.0172643741588 -0.0186497568313 -0.0197508112721 -0.0206230402196 -0.0212825155286 -0.0217782508078 -0.0221487465315 -0.022410924286 -0.0225816985401 -0.0226544523766 ) ; boundaryField { frontAndBack { type empty; } upperWall { type zeroGradient; } lowerWall { type zeroGradient; } inlet { type zeroGradient; } outlet { type adjointOutletPressurePower; value nonuniform List<scalar> 20 ( 0.0140637678417 0.101443957966 0.142448241759 0.16575420104 0.180257631381 0.187884993866 0.189627276572 0.188345636095 0.186087085238 0.183021759052 0.179138918761 0.174375861087 0.168648633755 0.161862160787 0.153913045524 0.144686981613 0.134234689491 0.122871206828 0.11205046775 0.0864104011623 ) ; } } // ************************************************************************* //