blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
3
264
content_id
stringlengths
40
40
detected_licenses
listlengths
0
85
license_type
stringclasses
2 values
repo_name
stringlengths
5
140
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
905 values
visit_date
timestamp[us]date
2015-08-09 11:21:18
2023-09-06 10:45:07
revision_date
timestamp[us]date
1997-09-14 05:04:47
2023-09-17 19:19:19
committer_date
timestamp[us]date
1997-09-14 05:04:47
2023-09-06 06:22:19
github_id
int64
3.89k
681M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]date
2012-06-07 00:51:45
2023-09-14 21:58:39
gha_created_at
timestamp[us]date
2008-03-27 23:40:48
2023-08-21 23:17:38
gha_language
stringclasses
141 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
10.4M
extension
stringclasses
115 values
content
stringlengths
3
10.4M
authors
listlengths
1
1
author_id
stringlengths
0
158
441e65f4edcec72d32868f33fd2dc6f15895c249
ece5f0f44b4f91d09af81d74c232852919488cf8
/2021/CAMP_2/BF_and_GD/Destroy_Bottle.cpp
1f2cad0888d14b6fe15c6e7739c42920fcf47d9c
[]
no_license
Phatteronyyz/POSN
57020f27065fe106d49be8b6f89248da0ccd21e9
3c6fa467377d367104476208801993697a15bd4d
refs/heads/main
2023-04-30T03:42:57.386892
2021-05-16T13:23:57
2021-05-16T13:23:57
351,687,620
2
0
null
null
null
null
UTF-8
C++
false
false
1,406
cpp
#include<bits/stdc++.h> using namespace std; #define sz(a) (int)a.size() #define pu(b,a) a.push(b) #define pop(a) a.pop() #define setdcm(a) fixed << setprecision(a) #define empty(a) a.empty() #define mxheap priority_queue<int, vector<int> > #define mnheap priority_queue<int, vector<int> , greater<int> > #define nl << "\n" #define sp << " " #define loop0(i,a) for(i=0;i<a;i++) #define loop1(i,a) for(i=1;i<=a;i++) using ll = long long; typedef pair<int,int> PII; struct A{ ll nu, att; bool operator<(const A&o) const{ return nu<o.nu; } }; A a[100100]; ll b[100100],c[100100],mark[100100],ch[100100]; void solve(){ ll n, m, cnt, ans, idx, i, num, j; cin>>n>>m; cnt=n; for (i=1;i<=n;i++) { cin>>a[i].nu; a[i].att=i; } sort(a+1,a+n+1); for (i=1;i<=n;i++) { b[i]=a[i].nu, c[i]=a[i].att; } for (j=1;j<=m;j++) { cin>>num; ans=0; for (i=cnt;i>=1;i--) { if (b[i]<=num) { cnt=i;break; } if (mark[c[i]]&&mark[c[i]]!=j) continue; if (mark[c[i]]!=j) ans++,mark[c[i]]=j; if (c[i]+1<=n&&!mark[c[i]+1]) ans++, mark[c[i]+1]=j; if (c[i]-1>=1&&!mark[c[i]-1]) ans++, mark[c[i]-1]=j; } cout<<ans<<endl; } } int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); solve(); return 0; }
[ "pattarawat123.k@gmail.com" ]
pattarawat123.k@gmail.com
512225942decb869d15a68ecb77bfe444968d42d
b9c62e76aa57e5482ac1bfb96852b74046acea55
/leetcode/306additive-number.cpp
ea92187b0b588382cb770eb038b224d077fb0da3
[]
no_license
demeiyan/algorithm
e7c9401a3d3486582865cd1d04a4d34a130bbe56
75c02ae3375e34a6209fdc91ba2a30979f091901
refs/heads/master
2022-11-13T03:59:09.175400
2019-09-17T05:01:06
2019-09-17T05:01:06
59,123,515
0
0
null
null
null
null
UTF-8
C++
false
false
1,451
cpp
/** * @Date 2019/2/23 11:05 * @Created by dmyan */ #include<bits/stdc++.h> using namespace std; class Solution { public: long long toInt(string &num, int i, int j){ long long count = 0; if(j>i&&num[i] == '0')return -1; for(int k = i; k<=j;k++){ count = count*10 + (num[k] - '0'); } return count; } void backtracking(string &num, long long first, long long second, bool &flag, int idx, int w){ if(idx>=num.size()){ flag = true; return; } for(int i = idx;i<num.size();i++){ if(i - idx +1 > w + 1)return; long long count = toInt(num, idx, i); if(count == -1)return; if(count != first + second)continue; backtracking(num, second, count, flag, i+1, i - idx +1); } } bool isAdditiveNumber(string num) { if(num.size()<3)return false; bool flag = false; long long first, second; for(int i = 0;i<num.size()-2;i++){ for(int j=i+1;j<num.size()-1;j++){ if(num.size() - 1 - j < max(i+1, j-i))continue; first = toInt(num, 0, i); second = toInt(num, i+1, j); if(first == -1||second == -1)continue; backtracking(num, first, second, flag, j+1, max(i+1, j-i)); if(flag)return true; } } return false; } };
[ "1312480794@qq.com" ]
1312480794@qq.com
0b3bcf51fe62a6ba35b2329cc50a9025c20fbe82
f1bd4d38d8a279163f472784c1ead12920b70be2
/Editors/!old/LevelEditor/Edit/ESceneSpawnTools.h
ded1f26a10f7948f9463ad13729dec8663f6de1c
[]
no_license
YURSHAT/stk_2005
49613f4e4a9488ae5e3fd99d2b60fd9c6aca2c83
b68bbf136688d57740fd9779423459ef5cbfbdbb
refs/heads/master
2023-04-05T16:08:44.658227
2021-04-18T09:08:18
2021-04-18T18:35:59
361,129,668
1
0
null
null
null
null
UTF-8
C++
false
false
1,988
h
//--------------------------------------------------------------------------- #ifndef ESceneSpawnToolsH #define ESceneSpawnToolsH #include "ESceneCustomOTools.h" class ESceneSpawnTools: public ESceneCustomOTools { typedef ESceneCustomOTools inherited; friend class CSpawnPoint; protected: // controls virtual void CreateControls (); virtual void RemoveControls (); enum{ flPickSpawnType = (1<<30), flShowSpawnType = (1<<31), }; Flags32 m_Flags; // class DEFINE_VECTOR (SChooseItem,SSVec,SSVecIt); DEFINE_MAP (CLASS_ID,SSVec,ClassSpawnMap,ClassSpawnMapIt); ClassSpawnMap m_Classes; // icon list DEFINE_MAP (shared_str,ref_shader,ShaderMap,ShaderPairIt); ShaderMap m_Icons; ref_shader CreateIcon (shared_str name); ref_shader GetIcon (shared_str name); public: ESceneSpawnTools (); virtual ~ESceneSpawnTools (); // definition IC LPCSTR ClassName (){return "spawn";} IC LPCSTR ClassDesc (){return "Spawn";} IC int RenderPriority (){return 1;} void FillProp (LPCSTR pref, PropItemVec& items); virtual void Clear (bool bSpecific=false){inherited::Clear(bSpecific);m_Flags.zero();} // IO virtual bool IsNeedSave (){return true;} virtual bool Load (IReader&); virtual void Save (IWriter&); virtual bool LoadSelection (IReader&); virtual void SaveSelection (IWriter&); virtual CCustomObject* CreateObject (LPVOID data, LPCSTR name); }; //--------------------------------------------------------------------------- // refs class ISE_Abstract; typedef ISE_Abstract* (__stdcall *Tcreate_entity) (LPCSTR section); typedef void (__stdcall *Tdestroy_entity) (ISE_Abstract *&); extern Tcreate_entity create_entity; extern Tdestroy_entity destroy_entity; //--------------------------------------------------------------------------- #endif
[ "loxotron@bk.ru" ]
loxotron@bk.ru
d43760df7f2e510e15e868d240f0015a9ae12ae9
3a0c6853c494347443209b7ff6bb8e2346569391
/caide_archive/2016-05-25/cf676D~1/cf676D.cpp
27d1cb1a396f1a0bec82efd5cdd35371b4076a74
[]
no_license
agul/contest-tasks
9b6e5656f66394d3aba4442087d3fd27746c201f
739ded97b34f9767433bb85744877de787ace636
refs/heads/master
2023-03-27T19:32:06.490883
2021-03-30T17:06:25
2021-03-30T17:06:25
259,159,370
0
0
null
null
null
null
UTF-8
C++
false
false
3,799
cpp
#include "Head.h" #include "Queue.h" using namespace std; int __; const int MOD = 1000000007; const int MAXN = 1111; class Cell { public: Cell() : Cell('*') {} Cell(const bool up, const bool right, const bool down, const bool left) { set(up, right, down, left); } Cell(const char ch) { if (ch == '+') { set(1, 1, 1, 1); } else if (ch == '-') { set(0, 1, 0, 1); } else if (ch == '|') { set(1, 0, 1, 0); } else if (ch == '^') { set(1, 0, 0, 0); } else if (ch == '>') { set(0, 1, 0, 0); } else if (ch == 'v') { set(0, 0, 1, 0); } else if (ch == '<') { set(0, 0, 0, 1); } else if (ch == 'L') { set(1, 1, 1, 0); } else if (ch == 'R') { set(1, 0, 1, 1); } else if (ch == 'U') { set(0, 1, 1, 1); } else if (ch == 'D') { set(1, 1, 0, 1); } else if (ch == '*') { set(0, 0, 0, 0); } else { assert(false); } } bool left() const { return left_; } bool right() const { return right_; } bool up() const { return up_; } bool down() const { return down_; } Cell rotate() const { return{ left_, up_, right_, down_ }; } private: bool up_; bool right_; bool down_; bool left_; void set(const bool up, const bool right, const bool down, const bool left) { up_ = up; right_ = right; down_ = down; left_ = left; } }; class Point3D { public: Point3D() : Point3D(0, 0, 0) {} Point3D(const int x, const int y, const int z) : x_(x), y_(y), z_(z) {} int x() const { return x_; } int y() const { return y_; } int z() const { return z_; } private: int x_; int y_; int z_; }; Queue<Point3D> q(MAXN * MAXN * 4); Cell field[4][MAXN][MAXN]; int dist[4][MAXN][MAXN]; bool used[4][MAXN][MAXN]; int n, m; inline bool check_bounds(const int z, const int x, const int y) { return x > 0 && x <= n && y > 0 && y <= m && z >= 0 && z < 4; } inline void add(const int z, const int x, const int y, const int len) { if (check_bounds(z, x, y) && !used[z][x][y]) { dist[z][x][y] = len; used[z][x][y] = true; q.push({ x, y, z }); } } bool connection(const Cell& lhs, const Cell& rhs, const Direction dir) { if (dir == Direction::Up) { return lhs.up() && rhs.down(); } if (dir == Direction::Right) { return lhs.right() && rhs.left(); } if (dir == Direction::Down) { return lhs.down() && rhs.up(); } if (dir == Direction::Left) { return lhs.left() && rhs.right(); } assert(false); return false; } void solve(istream& ins, ostream& out) { ins >> n >> m; for (int i = 1; i <= n; ++i) { std::string row; ins >> row; for (int j = 1; j <= m; ++j) { field[0][i][j] = Cell(row[j - 1]); for (int k = 1; k < 4; ++k) { field[k][i][j] = field[k - 1][i][j].rotate(); } } } pii start, finish; ins >> start.X >> start.Y >> finish.X >> finish.Y; fill(dist, INF); add(0, start.X, start.Y, 0); while (!q.empty()) { const auto point = q.pop_front(); const int len = dist[point.z()][point.x()][point.y()]; const Cell& cur = field[point.z()][point.x()][point.y()]; for (int dir = 0; dir < 4; ++dir) { const int new_z = point.z(); const int new_x = point.x() + DX[dir]; const int new_y = point.y() + DY[dir]; if (!check_bounds(new_z, new_x, new_y)) { continue; } const Cell& rhs = field[new_z][new_x][new_y]; if (connection(cur, rhs, static_cast<Direction>(dir))) { add(new_z, new_x, new_y, len + 1); } } add((point.z() + 1) & 3, point.x(), point.y(), len + 1); } int ans = INF; for (int i = 0; i < 4; ++i) { umin(ans, dist[i][finish.X][finish.Y]); } out << (ans == INF ? -1 : ans) << endl; }
[ "agul@yandex-team.ru" ]
agul@yandex-team.ru
f0bcdd089ad8dc2dfddc0f2641d3ed92dbfc840f
6b84794b2b0aa23a2d2c3c5f1437001d103213ae
/Problems & Contents/URI/1-Beginner/1009-SalaryWithBonus.cpp
62f945c2ac65609461d6fee096b3f38d1211f740
[]
no_license
mtreviso/university
2406d3782759a75ef00af4da8e4e1ed99cfb89d8
164dbfc13d6dddb3bdbb04957c4702d0e0885402
refs/heads/master
2021-01-09T08:14:21.551497
2016-06-09T23:19:01
2016-06-09T23:19:01
16,703,296
0
2
null
null
null
null
UTF-8
C++
false
false
268
cpp
#include <iostream> #include <iomanip> using namespace std; int main(){ string name; double salary, sales, result; cin >> name >> salary >> sales; result = salary+(0.15*sales); cout << "TOTAL = R$ " << fixed << setprecision(2) << result << endl; return 0; }
[ "marcosvtreviso@gmail.com" ]
marcosvtreviso@gmail.com
ecbe5633903ab187130e92c677963b508e08ede3
3488515b33bdafbdb4ba2dd652e309b311255891
/chromecast/media/cma/backend/mixer_service_receiver.h
e249f188189e9a9b7be827929ae82eb2bd8f9db7
[ "BSD-3-Clause" ]
permissive
Jishun/chromium
bbacceb5d7b29a5cb0b17612c109e2b6560f9735
309b078c964e2b61edfe87c29581dab4410eaa25
refs/heads/master
2022-11-30T00:36:27.261439
2019-10-09T03:59:15
2019-10-09T03:59:15
212,290,313
0
0
BSD-3-Clause
2019-10-10T03:05:03
2019-10-02T08:30:28
null
UTF-8
C++
false
false
1,563
h
// Copyright 2019 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROMECAST_MEDIA_CMA_BACKEND_MIXER_SERVICE_RECEIVER_H_ #define CHROMECAST_MEDIA_CMA_BACKEND_MIXER_SERVICE_RECEIVER_H_ #include <memory> #include "base/macros.h" #include "chromecast/media/audio/mixer_service/receiver/receiver.h" namespace chromecast { namespace media { class StreamMixer; namespace mixer_service { class Generic; class MixerSocket; } // namespace mixer_service class MixerServiceReceiver : public mixer_service::Receiver { public: explicit MixerServiceReceiver(StreamMixer* mixer); ~MixerServiceReceiver() override; private: // mixer_service::Receiver implementation: void CreateOutputStream(std::unique_ptr<mixer_service::MixerSocket> socket, const mixer_service::Generic& message) override; void CreateLoopbackConnection( std::unique_ptr<mixer_service::MixerSocket> socket, const mixer_service::Generic& message) override; void CreateAudioRedirection( std::unique_ptr<mixer_service::MixerSocket> socket, const mixer_service::Generic& message) override; void CreateControlConnection( std::unique_ptr<mixer_service::MixerSocket> socket, const mixer_service::Generic& message) override; StreamMixer* const mixer_; DISALLOW_COPY_AND_ASSIGN(MixerServiceReceiver); }; } // namespace media } // namespace chromecast #endif // CHROMECAST_MEDIA_CMA_BACKEND_MIXER_SERVICE_RECEIVER_H_
[ "commit-bot@chromium.org" ]
commit-bot@chromium.org
28e700b23515817012690d2e41ed6d6cfcd303ba
565a1a95a343a01e43aa3026a46da677cb05b4a1
/2016_fall_semester/windows_programing/1101/ImageTool_Ch6_2_Histogram/HistogramDlg.cpp
2796437f0b58cdf157c525fbb76c51b4f0fb76dc
[]
no_license
younggyu0906/koreatech_class_projects
af31ed35eaa14a1a4977a39cf00603265acaa049
b97dedcb0bf4a459bbe0b6bb9cf9828552951921
refs/heads/master
2021-07-11T07:13:08.184777
2019-02-26T09:14:55
2019-02-26T09:14:55
102,804,792
0
0
null
null
null
null
UHC
C++
false
false
2,207
cpp
// HistogramDlg.cpp : 구현 파일입니다. // #include "stdafx.h" #include "ImageTool.h" #include "HistogramDlg.h" #include "DibEnhancement.h" #include "afxdialogex.h" // CHistogramDlg 대화 상자입니다. IMPLEMENT_DYNAMIC(CHistogramDlg, CDialogEx) CHistogramDlg::CHistogramDlg(CWnd* pParent /*=NULL*/) : CDialogEx(CHistogramDlg::IDD, pParent) { } CHistogramDlg::~CHistogramDlg() { } void CHistogramDlg::DoDataExchange(CDataExchange* pDX) { CDialogEx::DoDataExchange(pDX); } void CHistogramDlg::SetImage(CDib& dib) { // 정규화된 히스토그램을 임시 배열에 저장한다. float histo[256] = {0.f, }; DibHistogram(dib, histo); // m_Histogram 배열의 최대값을 구한다. register int i; float max_value = histo[0]; for( i = 1 ; i < 256 ; i++ ) { if( histo[i] > max_value ) max_value = histo[i]; } // m_Histogram 배열의 최대값이 100이 되도록 전체 배열의 값을 조절한다. for( i = 0 ; i < 256 ; i++ ) { m_Histogram[i] = (int)(histo[i]*100/max_value); } } BEGIN_MESSAGE_MAP(CHistogramDlg, CDialogEx) ON_WM_PAINT() END_MESSAGE_MAP() // CHistogramDlg 메시지 처리기입니다. void CHistogramDlg::OnPaint() { CPaintDC dc(this); // device context for painting // TODO: 여기에 메시지 처리기 코드를 추가합니다. // 그리기 메시지에 대해서는 CDialogEx::OnPaint()을(를) 호출하지 마십시오. register int i; // 히스토그램 박스 출력 dc.MoveTo(20, 30); dc.LineTo(20, 130); dc.LineTo(275, 130); dc.LineTo(275, 30); // 각 그레이스케일에 해당하는 히스토그램 출력 for( i = 0 ; i < 256 ; i++ ) { dc.MoveTo( 20+i, 130 ); dc.LineTo( 20+i, 130 - m_Histogram[i] ); } // 그레이스케일 레벨 출력 for( i = 0 ; i < 256 ; i++ ) { dc.SelectStockObject(DC_PEN); dc.SetDCPenColor(RGB(i, i, i)); dc.MoveTo( 20+i, 140 ); dc.LineTo( 20+i, 155 ); } dc.SelectStockObject(DC_PEN); dc.SetDCPenColor(RGB(128, 128, 128)); int sum[256] = {0, }; sum[0] = m_Histogram[0]; for( i = 1 ; i < 256 ; i++ ) sum[i] = sum[i-1] + m_Histogram[i]; dc.MoveTo( 20, 130 ); for( i = 0 ; i < 256 ; i++ ) { dc.LineTo( 20+i, 130 - sum[i]*100/sum[255] ); } }
[ "younggyu0906@naver.com" ]
younggyu0906@naver.com
ae32b1d4300bf8b6cc07fdc1c2a7a79778db288f
aafacc0112992d5c84613a01c947385e0f288279
/firstlight/tests/test_core/unit_test/test/flt/ResMgrTest.h
b0248725c93dc06c4c2d3ff84d85d726c6667aa2
[]
no_license
KerwinMa/firstlight
a9aa72d6f581f31b701f580aa4a743a5926a9fb4
864abf974d898b94b92a645d66642ba891ac3983
refs/heads/master
2020-12-25T04:17:37.765589
2012-12-23T15:59:39
2012-12-23T15:59:39
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,205
h
#ifndef TEST_FLT_RES_MGR_H #define TEST_FLT_RES_MGR_H #include "DummyResMgr.h" #include <gtest/gtest.h> namespace flt_test { using namespace flt; class ResMgrTest : public testing::Test { protected: ResMgrTest() { // You can do set-up work for each test here. } virtual ~ResMgrTest() { // You can do clean-up work that doesn't throw exceptions here. } virtual void SetUp() { // Code here will be called immediately after the constructor (right // before each test). } virtual void TearDown() { // Code here will be called immediately after each test (right // before the destructor). } }; TEST_F(ResMgrTest, MainTest) { DummyResMgr::newInstance(); DummyResMgr& mgr = DummyResMgr::getInstance(); //ger res, not found, so create it in getRes DummyPtr dummy = mgr.getRes("test"); EXPECT_EQ(dummy->getRefCount(),2); EXPECT_EQ(mgr.getResCount(),1); EXPECT_EQ(dummy->getName(),"test"); EXPECT_EQ(dummy->idata,123); EXPECT_EQ(mgr.getResCount(),1); //clone res, modify and put into mgr as a new res DummyPtr cloned = mgr.cloneRes(dummy,"cloned"); cloned->idata = 456; mgr.addRes(cloned); EXPECT_EQ(cloned->getRefCount(),2); EXPECT_EQ(mgr.getResCount(),2); EXPECT_EQ(cloned->getName(),"cloned"); EXPECT_EQ(cloned->idata,456); EXPECT_EQ(mgr.getResCount(),2);//added in clone //cloned user drop it, but mgr hold it cloned.reset(); EXPECT_EQ(mgr.getResCount(),2); //test if used "cloned,456" EXPECT_EQ(mgr.isResUsed("cloned"),false); //mgr clear unused res - the "cloned,456" mgr.removeAllUnusedRes(); EXPECT_EQ(mgr.getResCount(),1); //get res, share DummyPtr dummy2 = mgr.getRes("test"); EXPECT_TRUE(dummy2==dummy); EXPECT_EQ(dummy2->getRefCount(),3); EXPECT_EQ(mgr.getResCount(),1); //remove test, all user's ref count -1, and mgr now has 0 res mgr.removeRes("test"); EXPECT_EQ(dummy->getRefCount(),2); EXPECT_EQ(dummy2->getRefCount(),2); EXPECT_EQ(mgr.getResCount(),0); DummyResMgr::deleteInstance(); } } #endif //TEST_FLT_RES_MGR_H
[ "happyfire@gmail.com" ]
happyfire@gmail.com
1d2eaa277cc34c3eda64f21a118ae05be3bef303
578ab9a52db104742cc23c758d386a8cff885706
/export/android/obj/include/flixel/addons/ui/FlxUIAssets.h
72ffdf49e8730f821d95067b363698521a74eb62
[]
no_license
evo0705/SpaceWar
a16695d9ae57c6ae7a17f9cbbefe7188701493d7
97a5a894977c56cda8d3d61866d7d6e237e1cbd9
refs/heads/master
2021-01-17T23:17:28.000163
2017-03-07T15:32:04
2017-03-07T15:32:04
84,214,718
0
0
null
null
null
null
UTF-8
C++
false
false
2,444
h
#ifndef INCLUDED_flixel_addons_ui_FlxUIAssets #define INCLUDED_flixel_addons_ui_FlxUIAssets #ifndef HXCPP_H #include <hxcpp.h> #endif HX_DECLARE_CLASS3(flixel,addons,ui,FlxUIAssets) HX_DECLARE_CLASS1(haxe,IMap) HX_DECLARE_CLASS2(haxe,ds,StringMap) namespace flixel{ namespace addons{ namespace ui{ class HXCPP_CLASS_ATTRIBUTES FlxUIAssets_obj : public hx::Object{ public: typedef hx::Object super; typedef FlxUIAssets_obj OBJ_; FlxUIAssets_obj(); Void __construct(); public: inline void *operator new( size_t inSize, bool inContainer=false,const char *inName="flixel.addons.ui.FlxUIAssets") { return hx::Object::operator new(inSize,inContainer,inName); } static hx::ObjectPtr< FlxUIAssets_obj > __new(); static Dynamic __CreateEmpty(); static Dynamic __Create(hx::DynamicArray inArgs); //~FlxUIAssets_obj(); HX_DO_RTTI_ALL; static bool __GetStatic(const ::String &inString, Dynamic &outValue, hx::PropertyAccess inCallProp); static void __register(); ::String __ToString() const { return HX_HCSTRING("FlxUIAssets","\x49","\x9c","\x5b","\x97"); } static void __boot(); static ::String IMG_BUTTON; static ::String IMG_BUTTON_ARROW_DOWN; static ::String IMG_BUTTON_ARROW_LEFT; static ::String IMG_BUTTON_ARROW_RIGHT; static ::String IMG_BUTTON_ARROW_UP; static ::String IMG_BUTTON_THIN; static ::String IMG_BUTTON_TOGGLE; static int IMG_BUTTON_SIZE; static ::String IMG_CHECK_MARK; static ::String IMG_CHECK_BOX; static ::String IMG_CHROME; static ::String IMG_CHROME_LIGHT; static ::String IMG_CHROME_FLAT; static ::String IMG_CHROME_INSET; static ::String IMG_RADIO; static ::String IMG_RADIO_DOT; static ::String IMG_TAB; static ::String IMG_TAB_BACK; static ::String IMG_BOX; static ::String IMG_DROPDOWN; static ::String IMG_PLUS; static ::String IMG_MINUS; static ::String IMG_HILIGHT; static ::String IMG_INVIS; static ::String IMG_SWATCH; static ::String IMG_FINGER_SMALL; static ::String IMG_FINGER_BIG; static ::String SLICE9_BUTTON; static ::String SLICE9_BUTTON_THIN; static ::String SLICE9_BUTTON_TOGGLE; static ::String SLICE9_TAB; static ::String XML_DEFAULTS_ID; static ::String XML_DEFAULT_POPUP_ID; static ::String XML_DEFAULT_LOADING_SCREEN_ID; static ::haxe::ds::StringMap index_size; }; } // end namespace flixel } // end namespace addons } // end namespace ui #endif /* INCLUDED_flixel_addons_ui_FlxUIAssets */
[ "evo0705@gmail.com" ]
evo0705@gmail.com
0627eb9440c9166895a7488dadf86d954d42356f
8c9732c0c574ab8966c640157d726ec4e36196d3
/Texture_Class.cpp
643eed73d98d21573cfb15e5ccc44c9e6c749087
[]
no_license
Symasan765/DirectX9Lib
c1450719f953b744b8e3fef0d3e20a06264948ef
b21e031ae6159e91ba752d0989f5bff6116e6398
refs/heads/master
2021-01-12T04:46:04.238516
2017-03-25T14:02:36
2017-03-25T14:02:36
77,791,667
0
0
null
null
null
null
SHIFT_JIS
C++
false
false
9,633
cpp
#include "Texture_Class.h" #include "GameManager.h" #include <cmath> #define PI (3.14159265) /*=================================================== // 関数 : テクスチャファイルを読み込むコンストラクタ // 引数 : fileNmae - 読み込むテクスチャファイル名 // anmNo - アニメーション番号 // widthNo - 横方向アニメーション数 // heightNo - 縦方向アニメーション数 // 備考 : anmeNo以降省略可。省略した場合はテクスチャ一枚全体が指定される // 座標は設定されていないのでまた必ず設定する ===================================================*/ Texture2D::Texture2D(const char* fileName, const short anmNo, const unsigned char widthNo, const unsigned char heightNo){ bool result = true; //テクスチャを読めたか格納する pTex = nullptr; //テクスチャは初期では使用しない //テクスチャを読み込み真偽を格納 if (fileName) result = SUCCEEDED(D3DXCreateTextureFromFile(GetD3DDevice, fileName, &pTex)); //正常に読めたらUV値設定 if (result) { //テクスチャ番号、テクスチャ個数(縦横)から描画位置を割り出す const float offset_tu = (float)1 / widthNo; //tuサイズ const float offset_tv = (float)1 / heightNo; //tvサイズ const unsigned char xNo = anmNo % widthNo; const unsigned char yNo = anmNo / widthNo; //実際にUVへ格納 vx[0].tu = xNo * offset_tu; vx[0].tv = yNo * offset_tv; vx[1].tu = xNo * offset_tu + offset_tu; vx[1].tv = yNo * offset_tv; vx[2].tu = xNo * offset_tu + offset_tu; vx[2].tv = yNo * offset_tv + offset_tv; vx[3].tu = xNo * offset_tu; vx[3].tv = yNo * offset_tv + offset_tv; } else result = false; //Z座標クリア vx[0].z = vx[1].z = vx[2].z = vx[3].z = 0; //2Dフラグ vx[0].rhw = vx[1].rhw = vx[2].rhw = vx[3].rhw = 1; //カラー情報初期値 vx[0].diffuse = vx[1].diffuse = vx[2].diffuse = vx[3].diffuse = D3DCOLOR_XRGB(0xFF, 0xFF, 0xFF); //座標設定(とりあえず全てNULL) vx[0].x = NULL; vx[0].y = NULL; vx[1].x = NULL; vx[1].y = NULL; vx[2].x = NULL; vx[2].y = NULL; vx[3].x = NULL; vx[3].y = NULL; //中心座標設定(初期では座標設定されていないので中心を消去) center.x = NULL; center.y = NULL; uvReversFlag = true; } /*=================================================== // 関数 : 確保していたテクスチャを解放するデストラクタ // ===================================================*/ Texture2D::~Texture2D(){ pTex->Release(); //解放 pTex = nullptr; //安全のために } /*=================================================== // 関数 : テクスチャを描画する関数 // ===================================================*/ void Texture2D::Draw() const{ //テクスチャの有無で処理を分ける if (pTex){ GetD3DDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE); //色をつける(初期はコンストラクタにより白) //テクスチャ反転処理 if (uvReversFlag){ GetD3DDevice->SetFVF(D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1); GetD3DDevice->SetTexture(0, pTex); GetD3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, 2, vx, sizeof(VERTEX2D)); } else{ VERTEX2D buf[4]; for (int i = 0; i < 4; i++){ buf[i] = vx[i]; } buf[0].tu = vx[1].tu; buf[0].tv = vx[1].tv; buf[1].tu = vx[0].tu; buf[1].tv = vx[0].tv; GetD3DDevice->SetFVF(D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1); GetD3DDevice->SetTexture(0, pTex); GetD3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, 2, vx, sizeof(VERTEX2D)); } } else{ GetD3DDevice->SetFVF(D3DFVF_XYZRHW | D3DFVF_DIFFUSE); //テクスチャなし GetD3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, 2, vx, sizeof(VERTEX2D)); } } /*=================================================== // 関数 : 座標を設定する関数 // 引数 : baseX - 左上座標X // baseY - 左上座標Y // sizeX - 大きさ(横方向) // sizeY - 大きさ(縦方向) // 備考 : 頂点番号は0が左上スタートで時計周り設定(将来的に変更) ===================================================*/ void Texture2D::SetPosition(const float baseX, const float baseY, const float sizeX, const float sizeY){ //座標設定 vx[0].x = baseX; vx[0].y = baseY; vx[1].x = baseX + sizeX; vx[1].y = baseY; vx[2].x = baseX + sizeX; vx[2].y = baseY + sizeY; vx[3].x = baseX; vx[3].y = baseY + sizeY; //中心座標設定 center.x = (vx[1].x - vx[0].x) / 2 + vx[0].x; center.y = (vx[2].y - vx[0].y) / 2 + vx[0].y; } /*=================================================== // 関数 : テクスチャファイルを読み込む関数 // 引数 : anmNo - アニメーション番号 // widthNo - 横方向アニメーション数 // heightNo - 縦方向アニメーション数 // 備考 : anmeNo以降省略可。省略した場合はテクスチャ一枚全体が指定される ===================================================*/ void Texture2D::SetTextureUV(short anmNo, const unsigned char widthNo, const unsigned char heightNo){ anmNo %= widthNo * heightNo; //テクスチャ番号、テクスチャ個数(縦横)から描画位置を割り出す const float offset_tu_size = (float)1 / widthNo; //tuサイズ const float offset_tv_size = (float)1 / heightNo; //tvサイズ const unsigned char xNo = anmNo % widthNo; const unsigned char yNo = anmNo / widthNo; //実際にUVへ格納 vx[0].tu = xNo * offset_tu_size; vx[0].tv = yNo * offset_tv_size; vx[1].tu = xNo * offset_tu_size + offset_tu_size; vx[1].tv = yNo * offset_tv_size; vx[2].tu = xNo * offset_tu_size + offset_tu_size; vx[2].tv = yNo * offset_tv_size + offset_tv_size; vx[3].tu = xNo * offset_tu_size; vx[3].tv = yNo * offset_tv_size + offset_tv_size; } /*=================================================== // 関数 : ポリゴンの色を変更する関数 // 引数 : DIF - 表示する色(RGB 0 ~ 255) // 備考 : 全ての頂点が同じ色になる ===================================================*/ void Texture2D::SetColor(D3DCOLOR DIF){ vx[0].diffuse = vx[1].diffuse = vx[2].diffuse = vx[3].diffuse = DIF; } /*=================================================== // 関数 : 図形を回転させる関数 // 引数 : angle - 回転角度(0 ~ 360) ===================================================*/ void Texture2D::Rotat(const float angle){ //回転角度のラジアンを出しておく const float rad = static_cast<float>(angle * PI / 180.0f); //回転処理 for (int i = 0; i < 4; ++i) RotatePrimitive(vx[i], center, rad); } /*=================================================== // 関数 : 図形を拡大・縮小する関数 // 引数 : rate - 拡縮率(1.0 == 100%,0.0 == 0%) ===================================================*/ void Texture2D::Scale(const float rate){ for (int i = 0; i < 4; ++i) ScalePrimitive(vx[i], center, rate); } /*=================================================== // 関数 : 移動処理を行う関数 // 引数 : moveX - 横移動量,moveY - 縦移動量 ===================================================*/ void Texture2D::Move(const float moveX, const float moveY){ //各頂点を移動 for (int i = 0; i < 4; ++i) { MovePrimitive(vx[i], moveX, moveY); } //最後に中心座標も移動 center.x += moveX; center.y += moveY; } /*=================================================== // 関数 : 移動処理を行う関数 // 戻値 : 中心座標が返却 ===================================================*/ POS2D Texture2D::GetCenter() const{ return center; } /*============================================通常関数(外部に見せる必要なし)==========================================================*/ /*=================================================== // 関数 : 渡された座標を起点から回転する関数 // 引数 : src - 回転する座標 base - 回転の起点(軸) rad - ラジアン ===================================================*/ void Texture2D::RotatePrimitive(VERTEX2D& src, const POS2D base, const float rad){ VERTEX2D buf = src; //バッファ //回転処理 src.x = ((buf.x - base.x) * cosf(rad) - (buf.y - base.y) * sinf(rad)) + base.x; src.y = ((buf.x - base.x) * sinf(rad) + (buf.y - base.y) * cosf(rad)) + base.y; } /*=================================================== // 関数 : 渡された座標を起点を中心に拡縮する関数 // 引数 : src - 変更する頂点情報 // base - 起点(中心) rate - 拡大・縮小率(0.0 == 0%,1.0 == 100%) ===================================================*/ void Texture2D::ScalePrimitive(VERTEX2D& src, const POS2D base, const float rate){ VERTEX2D buf = src; //拡大・縮小処理 src.x = (buf.x - base.x) * rate + base.x; src.y = (buf.y - base.y) * rate + base.y; } /*=================================================== // 関数 : 頂点の移動を行う関数 // 引数 : src - 変更する頂点 // moveX - 横移動量 // moveY - 縦移動量 ===================================================*/ void Texture2D::MovePrimitive(VERTEX2D& src, const float moveX, const float moveY){ src.x += moveX; src.y += moveY; } /*=================================================== // 関数 : テクスチャをスクロールする関数 // 引数 : moveU - 移動量U // moveV - 移動量V ===================================================*/ void Texture2D::TexUVScroll(const float moveU, const float moveV){ for (int i = 0; i < 4; ++i){ vx[i].tu += moveU; vx[i].tv += moveV; } }
[ "yunosukematsumoto.hal@gmail.com" ]
yunosukematsumoto.hal@gmail.com
ab934cb84d23ad460ce217af3b39790ef7cf2c7c
2f6e9f4007975d446489892c6d36050c3438bc51
/Webserver/srcs/location.cpp
0e29249089699345b8b71e99b991a78e2fc319db
[]
no_license
qperrot/qperrot
10cb3cf7ca86a2ba4c6cdfc9bd8b4cbd9fae2a4e
d9b6d203cefbc069b47a006c356a8c895c8bf698
refs/heads/master
2023-03-08T13:12:37.180525
2022-02-02T09:14:36
2022-02-02T09:14:36
216,030,915
0
0
null
2023-03-08T01:47:57
2019-10-18T13:31:26
C++
UTF-8
C++
false
false
3,972
cpp
#include "location.hpp" Location::Location() : _clientMaxBodySize(-1), _hasBodySize(false) { } Location::Location(Location const &other) { *this = other; } Location &Location::operator=(Location const &other) { this->_requestURI = other._requestURI; this->_root = other._root; this->_methods = other._methods; this->_index = other._index; this->_cgi = other._cgi; this->_auth = other._auth; this->_autoindex = other._autoindex; this->_clientMaxBodySize = other._clientMaxBodySize; this->_uploadPath = other._uploadPath; this->_hasBodySize = other._hasBodySize; return *this; } Location::~Location() { } void Location::setURI(std::string &buffer) { _requestURI = buffer; } void Location::setRoot(std::string &buffer) { _root = buffer; } void Location::setMethod(std::string &buffer) { _methods = utils::split(buffer, ' '); } void Location::setIndex(std::string &buffer) { _index = buffer; } void Location::setCgi(std::string &buffer) { if (!_cgi.empty()) { throw std::runtime_error("Cgi: already present"); } std::vector<std::string> cgi; std::string ext; std::string cgi_path; cgi = utils::split(buffer, ' '); if (cgi.size() != 2) throw std::runtime_error("Cgi: incorrect number of arguments. Expected <ext> <path>"); ext = cgi.front(); cgi_path = cgi.back(); _cgi[ext] = cgi_path; } void Location::setAutoindex(std::string &buffer) { bool idx; idx = (buffer == "on ") ? true : false; _autoindex = idx; } void Location::setAuth(std::string &buffer) { _auth = buffer; } void Location::setMaxBodySize(std::string &buffer) { if (_hasBodySize) { throw std::runtime_error("Client_max_body_size: already present once"); } std::vector<std::string> bodySize = utils::split(buffer, ' '); if (bodySize.size() > 1) { throw std::runtime_error("Client_max_body_size: too many parameters"); } _clientMaxBodySize = utils::stringToInt(bodySize[0]); // doesnt work if param = ex: 1ret332 if (_clientMaxBodySize < 0) { throw std::runtime_error("Client_max_body_size: bad value"); } _hasBodySize = true; } void Location::setUploadPath(std::string &buffer) { if (!_uploadPath.empty()) { throw std::runtime_error("Upload_folder: already present"); } buffer.erase(buffer.find_last_not_of(" ") + 1); _uploadPath = buffer; } std::string Location::getUri(void) const { return _requestURI; } std::string Location::getRoot(void) const { return _root; } std::vector<std::string> Location::getMethod(void) const { return _methods; } std::string Location::getIndex(void) const { return _index; } std::map<std::string, std::string> Location::getCgi(void) const { return _cgi; } bool Location::getAutoindex(void) const { return _autoindex; } std::string Location::getAuth(void) const { return _auth; } int Location::getClientMaxBodySize(void) const { return _clientMaxBodySize; } std::string Location::getUploadPath(void) { return _uploadPath; } void Location::printLocation(void) { std::cout << "requestURI: " << _requestURI << std::endl; std::cout << "root: " << _root << std::endl; if (!_methods.empty()) { for (std::vector<std::string>::iterator it = _methods.begin(); it != _methods.end(); it++) std::cout << "methods: " << *it << std::endl; } std::cout << "index: " << _index << std::endl; if (!_cgi.empty()) std::cout << "cgi: " << _cgi.begin()->first << "=" << _cgi.begin()->second << std::endl; std::cout << "auth: " << _auth << std::endl; std::cout << "autoindex: " << _autoindex << std::endl; std::cout << "max size: " << _clientMaxBodySize << std::endl; std::cout << "upload: " << _uploadPath << std::endl; std::cout << std::endl; }
[ "quentinperrotm@gmail.com" ]
quentinperrotm@gmail.com
1403a80203e2a64d6859f5120d907062b921c9b6
d0fb46aecc3b69983e7f6244331a81dff42d9595
/cloudphoto/include/alibabacloud/cloudphoto/model/ListAlbumsResult.h
4bf056c114a18c96e925ece8228dfb893ba1cd05
[ "Apache-2.0" ]
permissive
aliyun/aliyun-openapi-cpp-sdk
3d8d051d44ad00753a429817dd03957614c0c66a
e862bd03c844bcb7ccaa90571bceaa2802c7f135
refs/heads/master
2023-08-29T11:54:00.525102
2023-08-29T03:32:48
2023-08-29T03:32:48
115,379,460
104
82
NOASSERTION
2023-09-14T06:13:33
2017-12-26T02:53:27
C++
UTF-8
C++
false
false
2,197
h
/* * Copyright 2009-2017 Alibaba Cloud 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. */ #ifndef ALIBABACLOUD_CLOUDPHOTO_MODEL_LISTALBUMSRESULT_H_ #define ALIBABACLOUD_CLOUDPHOTO_MODEL_LISTALBUMSRESULT_H_ #include <string> #include <vector> #include <utility> #include <alibabacloud/core/ServiceResult.h> #include <alibabacloud/cloudphoto/CloudPhotoExport.h> namespace AlibabaCloud { namespace CloudPhoto { namespace Model { class ALIBABACLOUD_CLOUDPHOTO_EXPORT ListAlbumsResult : public ServiceResult { public: struct Album { struct Cover { bool isVideo; std::string idStr; std::string state; long ctime; std::string title; long mtime; std::string fileId; long height; long id; long width; std::string md5; std::string remark; }; Cover cover; std::string idStr; std::string state; long ctime; long photosCount; long mtime; long id; std::string name; std::string remark; }; ListAlbumsResult(); explicit ListAlbumsResult(const std::string &payload); ~ListAlbumsResult(); std::string getNextCursor()const; int getTotalCount()const; std::string getAction()const; std::string getMessage()const; std::string getCode()const; std::vector<Album> getAlbums()const; protected: void parse(const std::string &payload); private: std::string nextCursor_; int totalCount_; std::string action_; std::string message_; std::string code_; std::vector<Album> albums_; }; } } } #endif // !ALIBABACLOUD_CLOUDPHOTO_MODEL_LISTALBUMSRESULT_H_
[ "haowei.yao@alibaba-inc.com" ]
haowei.yao@alibaba-inc.com
3097d148c861ce6816d847ab430fccfe0a4116db
499fa6c95d724cdbc95e34b5721146e14b31e60a
/OpenGLInterfacing/Sphere.h
1c6f988441ede9c09a856007ad268bcdfd6f3792
[]
no_license
Rushabh3996/OpenGLInterfacing
282c78445c46b30ae7ce57df0c338dd142b99aa3
f37ee321baf4288e5f87d694840d3060bd56e97c
refs/heads/master
2021-09-05T15:45:28.291137
2018-01-29T11:30:54
2018-01-29T11:30:54
117,630,108
0
5
null
2018-01-29T11:31:15
2018-01-16T04:12:43
C++
UTF-8
C++
false
false
345
h
#pragma once #pragma once #include "IOpenGL.h" #include <windows.h> //OpenGL headers #include <gl/GL.h> #include <gl/GLU.h> class Sphere : public IOpenGL { private: float angle = 0.0f; GLUquadric *quadric = NULL; void drawSphere(GLUquadric *gluquadric); public: void initialize(); void update(); void display(); void uninitialize(); };
[ "patole.manisha66@gmail.com" ]
patole.manisha66@gmail.com
baa852bf34beda4c583f396a07400094bf8af1b9
bd35373d773ef17ea3c4f07398b98237e00a0a6d
/programstool/HashMaps/pairSumto0.cpp
ec2923e69c13dd956582afb3d83386eff4c7162a
[]
no_license
NilanshBansal/DataStructures
e5868a0a38dcc12b4bb0f383dbe65c03548f87c0
8ec784a212bca2218cdda754553e68bd522be533
refs/heads/master
2020-03-21T16:38:18.016299
2019-02-22T07:05:57
2019-02-22T07:05:57
138,782,734
0
0
null
null
null
null
UTF-8
C++
false
false
1,490
cpp
Pair sum to 0 Send Feedback Given a random integer array A of size N. Find and print the pair of elements in the array which sum to 0. Array A can contain duplicate elements. While printing a pair, print the smaller element first. That is, if a valid pair is (6, -6) print "-6 6". There is no constraint that out of 5 pairs which have to be printed in 1st line. You can print pairs in any order, just be careful about the order of elements in a pair. Input format : Line 1 : Integer N (Array size) Line 2 : Array elements (separated by space) Output format : Line 1 : Pair 1 elements (separated by space) Line 2 : Pair 2 elements (separated by space) Line 3 : and so on Constraints : 1 <= N <= 10^6 Ai contains all non-zero values Sample Input: 5 2 1 -2 2 3 Sample Output : -2 2 -2 2 #include<unordered_map> void PairSum(int *input, int n) { /* Don't write main(). * the input array is already passed as function argument. * Don't need to return anything. Print the desired pairs in the function itself. */ unordered_map<int,int> help; for(int i=0;i<n;i++) { if(help.count(input[i])==0) { pair<int,int> p(input[i],1); continue; } help[input[i]]++; } unordered_map<int,int>::iterator it=help.begin(); while(it!=help.end()) { if(help.count(-it->first)>0 && -it->first->second!=0) { for(int j=0;j<) } } }
[ "bansalnilansh@gmail.com" ]
bansalnilansh@gmail.com
cd6c0dc2f05e290af4bb14935873831a1b71675a
d701b78f64aa444c89e9ff26d186416e54086930
/download_fly_camera_texture_load-master/Demo/opengl/SrCameraEdit.h
9ceb67634c5c96d753d1dabc3daf6e43d1573970
[ "BSD-2-Clause" ]
permissive
domzhaosh/blog-file
c2c8d55ccc0ef748634c368f59ada8f0a14f6c4c
27b2ad35c2a8ef360d07ed1c70c545f29f85e99f
refs/heads/master
2016-09-05T20:12:21.786572
2015-09-29T07:52:17
2015-09-29T07:52:17
42,811,678
1
0
null
null
null
null
UTF-8
C++
false
false
892
h
/************************************************************************ \link www.twinklingstar.cn \author Twinkling Star \date 2013/11/23 ****************************************************************************/ #ifndef SR_OPENGL_CAMERA_EDIT_H_ #define SR_OPENGL_CAMERA_EDIT_H_ /** \addtogroup opengl @{ */ #include "SrCameraBase.h" /* \brief Inherit the class SrCameraBase. We can use it to move camera to edit an object like the software of 3d max. */ class SrCameraEdit:public SrCameraBase { public: SrCameraEdit(double doFovy, double doZNear, double doZFar, int inViewX, int inViewY, int unWidth, int unHeight, const SrPoint3D& origin=SrVector3(0,0,-3), const SrVector3& center=SrVector3(0,0,0)); SrVector3 center(); void setCenter(SrVector3 center); virtual void setCamera(); private: SrVector3 m_rotCenter; }; /** @} */ #endif
[ "domzhaosh@sina.cn" ]
domzhaosh@sina.cn
1f3a2378ea7b09ecf755d4f25807f5a73f532d6a
7901e09d4f0827e0590fa6a7f038e7d9363e903b
/effective_cpp/Customer.cpp
1fa651ccbc73b508b33746f868a077b2c8c3987f
[]
no_license
jiesoul/c_cpp_learn
32298fa21d159d3fc9a6c0c2711700548db9e4a2
cd4e411f73222dd26d22c1110ce0af4ecc60f051
refs/heads/main
2023-03-16T15:54:54.553175
2022-06-14T05:30:51
2022-06-14T05:30:51
204,853,153
0
0
null
null
null
null
UTF-8
C++
false
false
315
cpp
// // Created by jiesoul on 2019/9/25. // #include "Customer.h" Customer::Customer(const Customer& rhs) :name(rhs.name) { logCall("Customer copy constructor"); } Customer& Customer::operator=(const Customer &rhs) { logCall("Customer copy assignment operator"); name = rhs.name; return *this; }
[ "jiesoul@gmail.com" ]
jiesoul@gmail.com
5a8582ae98a526d5cc8e06ce9cde2aeff4f18947
44295298cdb2c452f5915764979a9cf1e08c12c6
/NAOAGDemo/NAOAGDemo/MainFrm.cpp
20e23e3464f1f904ff764742da1f8b2751b4e621
[]
no_license
davidxue1989/MASc
e797a41246e36c0770a6944a2c216bc760d23d3d
58a8d725447e0852e285f923733d658f4d7a15c8
refs/heads/master
2021-06-03T10:14:51.409328
2016-07-10T20:56:25
2016-07-10T20:56:25
24,718,221
0
0
null
null
null
null
UTF-8
C++
false
false
1,978
cpp
// MainFrm.cpp : implementation of the CMainFrame class // #include "stdafx.h" #include "NAOAGDemo.h" #include "MainFrm.h" #ifdef _DEBUG #define new DEBUG_NEW #endif // CMainFrame IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd) BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd) ON_WM_CREATE() END_MESSAGE_MAP() static UINT indicators[] = { ID_SEPARATOR, // status line indicator ID_INDICATOR_CAPS, ID_INDICATOR_NUM, ID_INDICATOR_SCRL, }; // CMainFrame construction/destruction CMainFrame::CMainFrame() { // TODO: add member initialization code here } CMainFrame::~CMainFrame() { } int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CFrameWnd::OnCreate(lpCreateStruct) == -1) return -1; if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) || !m_wndToolBar.LoadToolBar(IDR_MAINFRAME)) { TRACE0("Failed to create toolbar\n"); return -1; // fail to create } if (!m_wndStatusBar.Create(this)) { TRACE0("Failed to create status bar\n"); return -1; // fail to create } m_wndStatusBar.SetIndicators(indicators, sizeof(indicators) / sizeof(UINT)); // TODO: Delete these three lines if you don't want the toolbar to be dockable m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY); EnableDocking(CBRS_ALIGN_ANY); DockControlBar(&m_wndToolBar); return 0; } BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) { if( !CFrameWnd::PreCreateWindow(cs) ) return FALSE; // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs cs.style = WS_OVERLAPPED | WS_CAPTION | FWS_ADDTOTITLE | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_MINIMIZE | WS_SYSMENU; return TRUE; } // CMainFrame diagnostics #ifdef _DEBUG void CMainFrame::AssertValid() const { CFrameWnd::AssertValid(); } void CMainFrame::Dump(CDumpContext& dc) const { CFrameWnd::Dump(dc); } #endif //_DEBUG // CMainFrame message handlers
[ "davidxue1989@gmail.com" ]
davidxue1989@gmail.com
67828ff01d86794b363d5431dc47fb3af29a2b8a
0723a2f377cfbf639f0577dc525c25803daa03ab
/libraries/WS2812/WS2812.h
aa627badf6bcb90d87b9948af819fde5825e5cf0
[ "CC0-1.0", "LicenseRef-scancode-public-domain" ]
permissive
davidje13/MiscArduinoLibraries
4b5aa4e3f3b7057f96a8d24f0870b84ddd6f4f32
8caf747172adfc8344cff2f1d5d017068e06c4ef
refs/heads/master
2021-01-22T04:09:36.743930
2018-07-14T14:04:11
2018-07-14T14:04:11
81,503,372
0
0
null
null
null
null
UTF-8
C++
false
false
4,176
h
/* * WS2812 - "NeoPixel" communication library. * Written in 2018 by David Evans * * To the extent possible under law, the author(s) have dedicated all copyright * and related and neighboring rights to this software to the public domain * worldwide. This software is distributed without any warranty. * * You should have received a copy of the CC0 Public Domain Dedication along * with this software. If not, see * <http://creativecommons.org/publicdomain/zero/1.0/>. */ #ifndef WS2812_H_INCLUDED #define WS2812_H_INCLUDED #include "ext.h" // https://cpldcpu.wordpress.com/2014/06/16/timing-of-ws2812-clones-pd9823/ #define NOP_1 __asm__ __volatile__ ("nop") #define NOP_2 NOP_1; NOP_1 #define NOP_3 NOP_2; NOP_1 #define NOP_4 NOP_2; NOP_2 #define NOP_5 NOP_4; NOP_1 #define NOP_6 NOP_4; NOP_2 #define NOP_7 NOP_4; NOP_3 #define NOP_8 NOP_4; NOP_4 class WS2812 { protected: WS2812(void) = default; WS2812(const WS2812&) = delete; WS2812(WS2812&&) = default; WS2812 &operator=(const WS2812&) = delete; WS2812 &operator=(WS2812&&) = delete; }; template <typename InPinT> class WS2812_impl : public WS2812 { InPinT pin; template <typename TurboPinT> [[gnu::always_inline]] inline void send_value(TurboPinT &turbo, uint8_t v) { // This function requires somewhat precise timing; // The high pulse must be: // 0: 62--500ns (1--8 clocks) // 1: >= 625ns (10+ clocks) // The low pulse can be longer, but not more than 9000ns (144 clocks) // The total period per bit must be at least 1060ns (17 clocks) // We assume 62.5ns per clock (16MHz) // We use pin functions which are almost direct register access; // they typically perform *bank = value (for pre-computed bank & value) // This is (st) or (mov, st) (?) // On an ATmega328 this translates to 2 or 4 clocks // A NOP consumes 1 clock for(int b = 0; b < 7; ++ b) { // loop counter uses ~4 clocks turbo.high(); // 2 clocks if(v & 0x80) { // 1--3 clocks (?) (uses SBRS) // Must be high for 10 clocks total // Seems we can rely on SBRS using 3 clocks in this branch // (?) if this isn't true, this needs to be 7 instead NOP_5; turbo.low(); // 2 clocks } else { turbo.low(); // 2 clocks NOP_5; } v <<= 1; // 1 clock (uses v += v in generated asm) // Loop must be at least 17 clocks total // Seems we can rely on the loop using some extra clocks // (?) if this isn't true, this needs to be 3 instead // NOP_3; } turbo.high(); if(v & 0x80) { NOP_5; // as above, this may need to be 7 turbo.low(); } else { turbo.low(); NOP_5; } // destructor of turbo in calling function restores interrupts } public: // Channel order: Green Red Blue template <typename Fn> void send_fn(uint16_t count, Fn fn) { // Function must not take more than ~8us (~128 clocks) auto p = pin.fast(); for(uint16_t i = 0; i < count; ++ i) { uint8_t v = fn(i); auto turbo = p.turbo(); send_value(turbo, v); } } template <typename Fn> void send_rgb_fn(uint16_t count, Fn fn) { // Function must not take more than ~8us (~128 clocks) auto p = pin.fast(); for(uint16_t i = 0; i < count; ++ i) { uint8_t r; uint8_t g; uint8_t b; fn(i, &r, &g, &b); auto turbo = p.turbo(); send_value(turbo, g); // Green send_value(turbo, r); // Red send_value(turbo, b); // Blue } } template <typename FnR, typename FnG, typename FnB> void send_rgb_fn(uint16_t count, FnR fnR, FnG fnG, FnB fnB) { // Functions must not take more than ~8us (~128 clocks) auto p = pin.fast(); for(uint16_t i = 0; i < count; ++ i) { uint8_t v; auto turbo = p.turbo(); fnG(i, &v); send_value(turbo, v); // Green fnR(i, &v); send_value(turbo, v); // Red fnB(i, &v); send_value(turbo, v); // Blue } } template <typename T> // byte array void send(uint16_t count, T bytes) { send_fn(count, [&bytes] (uint16_t i) { return bytes[i]; }); } WS2812_impl(InPinT pin) : pin(pin) { pin.set_output(); } }; template <typename InPinT> [[gnu::always_inline,nodiscard]] inline WS2812_impl<InPinT> MakeWS2812(InPinT pin) { return WS2812_impl<InPinT>(pin); } #endif
[ "davidje13@users.noreply.github.com" ]
davidje13@users.noreply.github.com
ca248bcf2d07c8818cb10c812e1b7bc7bad109f4
46279163a543cd8820bdc38133404d79e787c5d2
/torch/csrc/jit/runtime/custom_operator.h
45ad6676376ceb25f300cb14c31f068f0b5c1ac0
[ "BSD-3-Clause", "LicenseRef-scancode-generic-cla", "BSL-1.0", "Apache-2.0", "BSD-2-Clause" ]
permissive
erwincoumans/pytorch
31738b65e7b998bfdc28d0e8afa7dadeeda81a08
ae9f39eb580c4d92157236d64548b055f71cf14b
refs/heads/master
2023-01-23T10:27:33.628897
2020-12-06T01:22:00
2020-12-06T01:23:40
318,930,000
5
1
NOASSERTION
2020-12-06T01:58:57
2020-12-06T01:58:56
null
UTF-8
C++
false
false
1,070
h
#pragma once #include <ATen/core/op_registration/op_registration.h> #include <ATen/core/stack.h> #include <torch/csrc/jit/runtime/operator.h> namespace torch { namespace jit { /// Registration class for new operators. Effectively calls /// `torch::jit::registerOperator` for every supplied operator, but allows doing /// so in the global scope when a `RegisterOperators` object is assigned to a /// static variable. /// Note: This is *not* the custom operator API. If you want to register custom /// operators, take a look at torch::RegisterOperators. struct TORCH_API RegisterOperators { RegisterOperators() = default; /// Registers a vector of already created `Operator`s. /// The operator element is now optional to filter null ops. It's backward /// compatible and works for selective operator registration. RegisterOperators(std::vector<c10::optional<Operator>> operators) { for (c10::optional<Operator>& o : operators) { if (o) { registerOperator(std::move(o.value())); } } } }; } // namespace jit } // namespace torch
[ "facebook-github-bot@users.noreply.github.com" ]
facebook-github-bot@users.noreply.github.com
c098f4afd37990e86925903fc8ebedf28404f732
65d7574d73bc4de67265e5dcf8603f6a701bec72
/codebase/apps/radar/src/HawkEdit/PolarWidget.cc
6c7ba4629d6cd629fcf9e3333f29bb615cb224af
[ "BSD-3-Clause" ]
permissive
Nina-Om/lrose-core
84245e25633ca3e75999774bb82d838e625f36ca
14d5e087518627e5bfd62da8a3e369a44d46ad3d
refs/heads/master
2023-07-07T03:05:55.205016
2021-08-16T18:03:57
2021-08-16T18:03:57
null
0
0
null
null
null
null
UTF-8
C++
false
false
39,827
cc
// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* // ** Copyright UCAR (c) 1990 - 2016 // ** University Corporation for Atmospheric Research (UCAR) // ** National Center for Atmospheric Research (NCAR) // ** Boulder, Colorado, USA // ** BSD licence applies - redistribution and use in source and binary // ** forms, with or without modification, are permitted provided that // ** the following conditions are met: // ** 1) If the software is modified to produce derivative works, // ** such modified software should be clearly marked, so as not // ** to confuse it with the version available from UCAR. // ** 2) Redistributions of source code must retain the above copyright // ** notice, this list of conditions and the following disclaimer. // ** 3) Redistributions in binary form must reproduce the above copyright // ** notice, this list of conditions and the following disclaimer in the // ** documentation and/or other materials provided with the distribution. // ** 4) Neither the name of UCAR nor the names of its contributors, // ** if any, may be used to endorse or promote products derived from // ** this software without specific prior written permission. // ** DISCLAIMER: THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS // ** OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED // ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. // *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* #include <assert.h> #include <cmath> #include <unistd.h> #include <iostream> #include <fstream> #include <toolsa/toolsa_macros.h> #include <toolsa/uusleep.h> #include <toolsa/LogStream.hh> #include <QTimer> #include <QBrush> #include <QPalette> #include <QPaintEngine> #include <QPen> #include <QResizeEvent> #include <QStylePainter> #include <QToolTip> #include <QMenu> #include <QAction> #include <QLabel> #include <QLayout> #include <QMessageBox> #include <QErrorMessage> #include "ParameterColorView.hh" #include "DisplayFieldModel.hh" #include "FieldColorController.hh" #include "PolarWidget.hh" #include "PolarManager.hh" #include "SpreadSheetView.hh" #include "SpreadSheetController.hh" #include "BoundaryPointEditor.hh" using namespace std; const double PolarWidget::SIN_45 = sin(45.0 * DEG_TO_RAD); const double PolarWidget::SIN_30 = sin(30.0 * DEG_TO_RAD); const double PolarWidget::COS_30 = cos(30.0 * DEG_TO_RAD); PolarWidget::PolarWidget(QWidget* parent, PolarManager *manager, const RadxPlatform &platform, DisplayFieldController *displayFieldController, // const vector<DisplayField *> &fields, bool haveFilteredFields) : QWidget(parent), _parent(parent), _manager(manager), _platform(platform), //_fields(fields), displayFieldController(displayFieldController), _haveFilteredFields(haveFilteredFields), // _selectedField(0), _ringsEnabled(false), _gridsEnabled(false), _angleLinesEnabled(false), _scaledLabel(ScaledLabel::DistanceEng), _rubberBand(0), _ringSpacing(10.0) { _params = ParamFile::Instance(); string color = _params->backgroundColor; _backgroundBrush = QColor(color.c_str()); _gridRingsColor = _params->gridColor.c_str(); // mode _archiveMode = _params->begin_in_archive_mode; // Set up the background color QPalette new_palette = palette(); new_palette.setColor(QPalette::Dark, _backgroundBrush.color()); setPalette(new_palette); setBackgroundRole(QPalette::Dark); setAutoFillBackground(true); setAttribute(Qt::WA_OpaquePaintEvent); // Allow the widget to get focus setFocusPolicy(Qt::StrongFocus); // create the rubber band _rubberBand = new QRubberBand(QRubberBand::Rectangle, this); // Allow the size_t type to be passed to slots qRegisterMetaType<size_t>("size_t"); // create the field renderers _fieldRendererController = new FieldRendererController(); /* size_t nFields = displayFieldController->getNFields(); for (size_t ii = 0; ii < nFields; ii++) { DisplayField *displayField = displayFieldController->getField(ii); FieldRenderer *fieldRenderer = new FieldRenderer(displayField->getName()); // *_fields[ii]); fieldRenderer->createImage(width(), height()); _fieldRendererController->addFieldRenderer(fieldRenderer); } */ // init other values _worldPressX = 0.0; _worldPressY = 0.0; _worldReleaseX = 0.0; _worldReleaseY = 0.0; _pointClicked = false; _mousePressX = 0; _mousePressY = 0; _mouseReleaseX = 0; _mouseReleaseY = 0; _zoomCornerX = 0; _zoomCornerY = 0; } /************************************************************************* * Destructor */ PolarWidget::~PolarWidget() { // Delete all of the field renderers //delete _fieldRendererController; /* for (size_t i = 0; i < _fieldRenderers.size(); ++i) { delete _fieldRenderers[i]; } _fieldRenderers.clear(); */ } void PolarWidget::configureRange(double max_range) { // Save the specified values _maxRangeKm = max_range; // Set the ring spacing. This is dependent on the value of _maxRange. _setGridSpacing(); // set world view int leftMargin = 0; int rightMargin = 0; int topMargin = 0; int bottomMargin = 0; int colorScaleWidth = _params->color_scale_width; int axisTickLen = 7; int nTicksIdeal = 7; int textMargin = 5; if (_params->ppi_display_type == Params::PPI_AIRBORNE) { _fullWorld.set(width(), height(), leftMargin, rightMargin, topMargin, bottomMargin, colorScaleWidth, -_maxRangeKm, 0.0, _maxRangeKm, _maxRangeKm, axisTickLen, nTicksIdeal, textMargin); } else { _fullWorld.set(width(), height(), leftMargin, rightMargin, topMargin, bottomMargin, colorScaleWidth, -_maxRangeKm, -_maxRangeKm, _maxRangeKm, _maxRangeKm, axisTickLen, nTicksIdeal, textMargin); } _zoomWorld = _fullWorld; _isZoomed = false; _setTransform(_zoomWorld.getTransform()); _setGridSpacing(); // Initialize the images used for double-buffering. For some reason, // the window size is incorrect at this point, but that will be corrected // by the system with a call to resize(). _dirty = true; _refreshImages(); } /************************************************************************* * configure the axes */ /************************************************************************* * set archive mode */ void PolarWidget::setArchiveMode(bool archive_mode) { _archiveMode = archive_mode; } /************************************************************************* * unzoom the view */ void PolarWidget::unzoomView() { LOG(DEBUG) << "enter"; _zoomWorld = _fullWorld; _isZoomed = false; _setTransform(_zoomWorld.getTransform()); _setGridSpacing(); _dirty = true; _refreshImages(); update(); LOG(DEBUG) << "exit"; } /************************************************************************* * setRings() */ void PolarWidget::setRings(const bool enabled) { _ringsEnabled = enabled; update(); } /************************************************************************* * setGrids() */ void PolarWidget::setGrids(const bool enabled) { _gridsEnabled = enabled; update(); } /************************************************************************* * setAngleLines() */ void PolarWidget::setAngleLines(const bool enabled) { _angleLinesEnabled = enabled; update(); } // TODO: this should be a slot? // TODO: sort out new fields in PolarManager // Who needs to know about the new fields? // Beams, FieldRenderers, DisplayFieldController void PolarWidget::addNewFields(vector<DisplayField *> &newFields) //void PolarWidget::addField(string &fieldName) { LOG(DEBUG) << "enter"; //FieldRendererView *fieldRenderer = // new FieldRenderer(_params, fieldIdx, *newFields[ii]); //fieldRenderer->createImage(width(), height()); // add to the field renderers any new fields in the volume // for each field in the volume /* LOG(DEBUG) << "all fields in _vol ... "; vector<RadxField *> allFields = vol->getFields(); vector<RadxField *>::iterator it; for (it = allFields.begin(); it != allFields.end(); it++) { LOG(DEBUG) << *it; } */ /* //LOG(DEBUG) << "fieldRenderers ..."; for (size_t ii = 0; ii < newFields.size(); ii++) { // displayFieldController->addField(newFields[ii]); int fieldIdx = newFields[ii]->getButtonRow() - 1; // TODO: fix HACK! //LOG(DEBUG) << "_fieldRenderers.size() before insert = " << lastFieldIdx; // HERE ... // Q: What is fieldIndex? FieldRenderer *fieldRenderer = new FieldRenderer(_params, fieldIdx, *newFields[ii]); fieldRenderer->createImage(width(), height()); _fieldRendererController->addFieldRenderer(fieldRenderer); // _fieldRenderers.push_back(fieldRenderer); //LOG(DEBUG) << "_fieldRenderers.size() after insert = " << _fieldRenderers.size(); } */ // TODO: this may be handled by addBeam, or fillColor? //_ppiBeamController->addFieldsToEachBeam(needRay, newFields); // activateArchiveRendering(); LOG(DEBUG) << "exit"; } /* // TODO: this should be a slot? // TODO: sort out new fields in PolarManager // Who needs to know about the new fields? // Beams, FieldRenderers, DisplayFieldController void PolarWidget::updateField(size_t fieldIdx) { LOG(DEBUG) << "enter"; _fieldRendererController->updateImage(fieldIdx, width(), height()); // fieldRenderer->createImage(width(), height()); LOG(DEBUG) << "exit"; } */ /************************************************************************* * turn on archive-style rendering - all fields */ void PolarWidget::activateArchiveRendering() { LOG(DEBUG) << "enter"; //_fieldRendererController->activateArchiveRendering(); //_fieldRendererController->performRendering(0); /* LOG(DEBUG) << "_fieldRenderers.size() = " << _fieldRenderers.size(); for (size_t ii = 0; ii < _fieldRenderers.size(); ii++) { _fieldRenderers[ii]->setBackgroundRenderingOn(); } */ LOG(DEBUG) << "exit"; } /************************************************************************* * displayImage() */ void PolarWidget::displayImage(string currentFieldName, double currentSweepAngle, RayLocationController *rayLocationController, ColorMap &colorMap, QColor backgroundColor) { try { // If we weren't rendering the current field, do nothing //if (field_num != selectedField) { // return; //} //update(); //setImage( // set the context ... _currentSweepAngle = currentSweepAngle; _rayLocationController = rayLocationController; _currentColorMap = colorMap; _backgroundColor = backgroundColor; /* _fieldRendererController->renderImage(width(), height(), currentFieldName, _zoomTransform, currentSweepAngle, rayLocationController, colorMap, "purple"); // backgroundColor); */ /* _fieldRendererController->refreshImages(width(), height(), size(), _backgroundBrush.color().rgb(), _zoomTransform, selectedField, _ppiBeams); */ update(); } catch (std::range_error &ex) { LOG(ERROR) << ex.what(); //QMessageBox::warning(NULL, "Error changing field (displayImage):", ex.what()); } } /************************************************************************* * backgroundColor() */ void PolarWidget::backgroundColor(const QColor &color) { _backgroundBrush.setColor(color); QPalette new_palette = palette(); new_palette.setColor(QPalette::Dark, _backgroundBrush.color()); setPalette(new_palette); _dirty = true; _refreshImages(); } /************************************************************************* * gridRingsColor() */ void PolarWidget::gridRingsColor(const QColor &color) { LOG(DEBUG) << "enter " << color.name().toStdString(); _gridRingsColor = color; update(); LOG(DEBUG) << "exit"; } /************************************************************************* * ColorScaleLegend() */ void PolarWidget::colorScaleLegend() { LOG(DEBUG) << "enter " ; update(); LOG(DEBUG) << "exit"; } /************************************************************************* * getImage() */ QImage* PolarWidget::getImage() { QPixmap pixmap = QPixmap::grabWidget(this); QImage* image = new QImage(pixmap.toImage()); return image; } /************************************************************************* * getPixmap() */ QPixmap* PolarWidget::getPixmap() { QPixmap* pixmap = new QPixmap(QPixmap::grabWidget(this)); return pixmap; } /************************************************************************* * Slots *************************************************************************/ /************************************************************************* * mousePressEvent() */ void PolarWidget::mousePressEvent(QMouseEvent *e) { if (e->button() == Qt::RightButton) { //------- QPointF clickPos(e->pos()); _mousePressX = e->x(); _mousePressY = e->y(); _worldPressX = _zoomWorld.getXWorld(_mousePressX); _worldPressY = _zoomWorld.getYWorld(_mousePressY); emit customContextMenuRequested(clickPos.toPoint()); // , closestRay); } else { _rubberBand->setGeometry(QRect(e->pos(), QSize())); _rubberBand->show(); _mousePressX = e->x(); _mousePressY = e->y(); _worldPressX = _zoomWorld.getXWorld(_mousePressX); _worldPressY = _zoomWorld.getYWorld(_mousePressY); } } /************************************************************************* * mouseMoveEvent(), mouse button is down and mouse is moving */ void PolarWidget::mouseMoveEvent(QMouseEvent * e) { int worldX = (int)_zoomWorld.getXWorld(e->pos().x()); int worldY = (int)_zoomWorld.getYWorld(e->pos().y()); // ---- insert here --- _manager->mouseMoveEvent(worldX, worldY); /* if (_manager._boundaryEditorDialog->isVisible()) { BoundaryToolType tool = BoundaryPointEditor::Instance()->getCurrentTool(); if (tool == BoundaryToolType::polygon && BoundaryPointEditor::Instance()->isAClosedPolygon() && BoundaryPointEditor::Instance()->isOverAnyPoint(worldX, worldY)) { BoundaryPointEditor::Instance()->moveNearestPointTo(worldX, worldY); } else if (tool == BoundaryToolType::brush) { BoundaryPointEditor::Instance()->addToBrushShape(worldX, worldY); } //_dirty = true; update(); return; } */ /* ---- cut here --- if (_manager._boundaryEditorDialog->isVisible() && BoundaryPointEditor::Instance()->isPolygonFinished() && BoundaryPointEditor::Instance()->isOverAnyPoint(worldX, worldY)) { BoundaryPointEditor::Instance()->moveNearestPointTo(worldX, worldY); update(); return; } // ----- cut here ---- */ // Zooming with the mouse int x = e->x(); int y = e->y(); int deltaX = x - _mousePressX; int deltaY = y - _mousePressY; // Make the rubberband aspect ratio match that // of the window double dx = fabs(deltaY * _aspectRatio); double dy = fabs(dx / _aspectRatio); // Preserve the signs dx *= fabs(deltaX)/deltaX; dy *= fabs(deltaY)/deltaY; int moveX = (int) floor(dx + 0.5); int moveY = (int) floor(dy + 0.5); QRect newRect = QRect(_mousePressX, _mousePressY, moveX, moveY); _zoomCornerX = _mousePressX + moveX; _zoomCornerY = _mousePressY + moveY; newRect = newRect.normalized(); _rubberBand->setGeometry(newRect); } /************************************************************************* * mouseReleaseEvent() */ void PolarWidget::mouseReleaseEvent(QMouseEvent *e) { _pointClicked = false; if (e->button() == Qt::RightButton) { QPointF clickPos(e->pos()); _mousePressX = e->x(); _mousePressY = e->y(); //emit customContextMenuRequested(clickPos.toPoint()); // , closestRay); } else { QRect rgeom = _rubberBand->geometry(); // If the mouse hasn't moved much, assume we are clicking rather than // zooming QPointF clickPos(e->pos()); _mouseReleaseX = clickPos.x(); _mouseReleaseY = clickPos.y(); // get click location in world coords if (rgeom.width() <= 20) { // Emit a signal to indicate that the click location has changed _worldReleaseX = _zoomWorld.getXWorld(_mouseReleaseX); _worldReleaseY = _zoomWorld.getYWorld(_mouseReleaseY); double x_km = _worldReleaseX; double y_km = _worldReleaseY; _pointClicked = true; // get ray closest to click point const RadxRay *closestRay = _getClosestRay(x_km, y_km); // emit signal emit locationClicked(x_km, y_km, closestRay); } else { // mouse moved more than 20 pixels, so a zoom occurred _worldPressX = _zoomWorld.getXWorld(_mousePressX); _worldPressY = _zoomWorld.getYWorld(_mousePressY); _worldReleaseX = _zoomWorld.getXWorld(_zoomCornerX); _worldReleaseY = _zoomWorld.getYWorld(_zoomCornerY); _zoomWorld.set(_worldPressX, _worldPressY, _worldReleaseX, _worldReleaseY); _setTransform(_zoomWorld.getTransform()); _setGridSpacing(); // enable unzoom button _manager->enableZoomButton(); // Update the window in the renderers _dirty = true; _refreshImages(); } // hide the rubber band _rubberBand->hide(); update(); } } //void PolarWidget::imageReady(QImage *image) { // _image = image; // TODO: make sure this isn't a copy! just assign a pointer // update(); //} /************************************************************************* * paintEvent() */ void PolarWidget::paintEvent(QPaintEvent *event) { static int trial= 0; LOG(DEBUG) << "enter"; try { _refreshImages(); QPainter painter(this); //painter.save(); //painter.setCompositionMode(QPainter::CompositionMode_Source); /* painter.setPen(Qt::blue); painter.setFont(QFont("Arial", 30)); trial += 1; QString theText; theText.append("Qt "); QString junk; junk.setNum(trial); theText.append(junk); painter.drawText(rect(), Qt::AlignCenter, theText); */ /* if (_image != NULL) { LOG(DEBUG) << "image is NOT NULL image = " << _image; painter.drawImage(0, 0, *_image); //painter.drawImage(100, 300, *_image); } */ //painter.restore(); //-------- here kluge ... content of showSelectedField ... string selectedField = displayFieldController->getSelectedFieldName(); if (selectedField.length() > 0) { //_fieldRendererController->renderImage(&painter, selectedField); _fieldRendererController->renderImage(&painter, width(), height(), selectedField, _zoomTransform, _currentSweepAngle, _rayLocationController, _currentColorMap, "purple"); // backgroundColor); } /* _image = _fieldRendererController->getImage(selectedField); if (_image != NULL) { LOG(DEBUG) << "image is NOT NULL"; painter.drawImage(0, 0, *_image); //painter.drawImage(100, 300, *_image); } */ // _drawOverlays(painter); /* // keep pointer to BoundaryPointEditorControl ??? //QImage _boundaryImage = //_manager->drawBoundary(_zoomWorld, painter); //if there are no points, this does nothing // todo overlay boundary image } else { LOG(DEBUG) << "selected field is empty"; painter.drawText(rect(), Qt::AlignCenter, "No image available"); } //-- end kluge */ /* string selectedField = displayFieldController->getSelectedFieldName(); _image = _fieldRendererController->getImage(selectedField); //update(); QPainter painter(this); //size_t selectedField = displayFieldController->getSelectedFieldNum(); //FieldRenderer *fieldRenderer = _fieldRendererController->get(selectedField); //QImage *image = _fieldRendererController->getImage(selectedField, selectedSweep); //painter.drawImage(0, 0, *(displayFieldController->getSelectedFieldImage())); //painter.(0, 0, *(fieldRenderer->getImage())); // painter.drawImage(0, 0, *(_fieldRenderers[_selectedField]->getImage())); // _image should already be set by previous slot imageReady if (_image != NULL) { painter.drawImage(0, 0, *_image); //painter.drawImage(100, 300, *_image); } _drawOverlays(painter); BoundaryPointEditor::Instance()->draw(_zoomWorld, painter); //if there are no points, this does nothing */ } catch (const std::out_of_range& ex) { LOG(DEBUG) << ex.what(); } catch (std::range_error &ex) { LOG(ERROR) << ex.what(); //QMessageBox::warning(NULL, "Error changing field (_changeField):", ex.what()); } LOG(DEBUG) << "exit"; } void PolarWidget::showSelectedField() { LOG(DEBUG) << "enter"; try { string selectedField = displayFieldController->getSelectedFieldName(); if (selectedField.length() > 0) { setImage(_fieldRendererController->getImage(selectedField)); //update(); //QPainter painter(this); //size_t selectedField = displayFieldController->getSelectedFieldNum(); //FieldRenderer *fieldRenderer = _fieldRendererController->get(selectedField); //QImage *image = _fieldRendererController->getImage(selectedField, selectedSweep); //painter.drawImage(0, 0, *(displayFieldController->getSelectedFieldImage())); //painter.(0, 0, *(fieldRenderer->getImage())); // painter.drawImage(0, 0, *(_fieldRenderers[_selectedField]->getImage())); /* moved to paintEvent ... // _image should already be set by previous slot imageReady if (_image != NULL) { LOG(DEBUG) << "image is NOT NULL"; painter.drawImage(0, 0, *_image); //painter.drawImage(100, 300, *_image); } */ //_drawOverlays(painter); // keep pointer to BoundaryPointEditorControl ??? //QImage _boundaryImage = //_manager->drawBoundary(_zoomWorld, painter); //if there are no points, this does nothing // todo overlay boundary image } else { LOG(DEBUG) << "selected field is empty"; } } catch (const std::out_of_range& ex) { LOG(DEBUG) << ex.what(); } catch (std::range_error &ex) { LOG(ERROR) << ex.what(); //QMessageBox::warning(NULL, "Error changing field (_changeField):", ex.what()); } LOG(DEBUG) << "exit"; } /************************************************************************* * resizeEvent() */ void PolarWidget::resizeEvent(QResizeEvent * e) { LOG(DEBUG) << "enter"; _resetWorld(width(), height()); LOG(DEBUG) << "exit"; } /************************************************************************* * resize() */ void PolarWidget::resize(const int width, const int height) { LOG(DEBUG) << "enter"; // Set the geometry based on the aspect ratio that we need for this display. // The setGeometry() method will fire off the resizeEvent() so we leave the // updating of the display to that event. int sizeNeeded = (int) ((width - _colorScaleWidth) / _aspectRatio + 0.5); if (height < sizeNeeded) { sizeNeeded = height; } // setGeometry triggers a resizeEvent setGeometry(0, 0, (int) (sizeNeeded * _aspectRatio + 0.5) + _colorScaleWidth, sizeNeeded); LOG(DEBUG) << "exit"; } ////////////////////////////////////////////////////////////// // reset the pixel size of the world view void PolarWidget::_resetWorld(int width, int height) { _fullWorld.resize(width, height); _zoomWorld = _fullWorld; _setTransform(_fullWorld.getTransform()); _setGridSpacing(); _dirty = true; } /************************************************************************* * Protected methods *************************************************************************/ //////////////////// // set the transform void PolarWidget::_setTransform(const QTransform &transform) { _fullTransform = transform; _zoomTransform = transform; } /************************************************************************* * perform the rendering */ void PolarWidget::_performRendering() { LOG(DEBUG) << "enter"; /* try { size_t selectedField = displayFieldController->getSelectedFieldNum(); _fieldRendererController->performRendering(selectedField); update(); } catch (std::range_error &ex) { LOG(ERROR) << ex.what(); // QMessageBox::warning(NULL, "Error changing color map", ex.what()); } */ LOG(DEBUG) << "exit"; } void PolarWidget::setImage(QImage *image) { _image = image; LOG(DEBUG) << "\n\n IMAGE = " << _image; } void PolarWidget::informationMessage() { // QMessageBox::StandardButton reply; // QLabel *informationLabel; // reply = QMessageBox::information(this, "QMessageBox::information()", "Not implemented"); QMessageBox::information(this, "QMessageBox::information()", "Not implemented"); // if (reply == QMessageBox::Ok) // informationLabel->setText("OK"); //else // informationLabel->setText("Escape"); } void PolarWidget::notImplemented() { cerr << "inside notImplemented() ... " << endl; QErrorMessage *errorMessageDialog = new QErrorMessage(_parent); // QLabel *informationLabel = new QLabel(); errorMessageDialog->showMessage("This option is not implemented yet."); QLabel errorLabel; int frameStyle = QFrame::Sunken | QFrame::Panel; errorLabel.setFrameStyle(frameStyle); errorLabel.setText("If the box is unchecked, the message " "won't appear again."); cerr << "exiting notImplemented() " << endl; } //////////////////////////////////////////////////////////////////////////// // get ray closest to click point const RadxRay *PolarWidget::_getClosestRay(double x_km, double y_km) { /* TODO: fix up ... double clickAz = atan2(y_km, x_km) * RAD_TO_DEG; double radarDisplayAz = 90.0 - clickAz; if (radarDisplayAz < 0.0) radarDisplayAz += 360.0; LOG(DEBUG) << "clickAz = " << clickAz << " from x_km, y_km = " << x_km << "," << y_km; LOG(DEBUG) << "radarDisplayAz = " << radarDisplayAz << " from x_km, y_km = " << x_km << y_km; double minDiff = 1.0e99; const RadxRay *closestRay = NULL; // _ppiBeams may be empty at this point, so get the closest ray from the // RadxVol itself. // LOG(DEBUG) << "_ppiBeams.size() = " << _ppiBeams.size(); for (size_t ii = 0; ii < _ppiBeams.size(); ii++) { const RadxRay *ray = _ppiBeams[ii]->getRay(); double rayAz = ray->getAzimuthDeg(); // LOG(DEBUG) << "rayAz = " << rayAz; double diff = fabs(radarDisplayAz - rayAz); if (diff > 180.0) { diff = fabs(diff - 360.0); } if (diff < minDiff) { closestRay = ray; minDiff = diff; } } if (closestRay != NULL) LOG(DEBUG) << "closestRay has azimuth " << closestRay->getAzimuthDeg(); else LOG(DEBUG) << "Error: No ray found"; return closestRay; */ return NULL; } /* //////////////////////////////////////////////////////////////////////////// // get azimuth closest to click point double PolarWidget::_getClosestAz(double x_km, double y_km) { double clickAz = atan2(y_km, x_km) * RAD_TO_DEG; double radarDisplayAz = 90.0 - clickAz; if (radarDisplayAz < 0.0) radarDisplayAz += 360.0; LOG(DEBUG) << "clickAz = " << clickAz << " from x_km, y_km = " << x_km << "," << y_km; LOG(DEBUG) << "radarDisplayAz = " << radarDisplayAz << " from x_km, y_km = " << x_km << y_km; return radarDisplayAz; } */ /************************************************************************* * _setGridSpacing() */ void PolarWidget::_setGridSpacing() { double xRange = _zoomWorld.getXMaxWorld() - _zoomWorld.getXMinWorld(); double yRange = _zoomWorld.getYMaxWorld() - _zoomWorld.getYMinWorld(); double diagonal = sqrt(xRange * xRange + yRange * yRange); if (diagonal <= 1.0) { _ringSpacing = 0.05; } else if (diagonal <= 2.0) { _ringSpacing = 0.1; } else if (diagonal <= 5.0) { _ringSpacing = 0.2; } else if (diagonal <= 10.0) { _ringSpacing = 0.5; } else if (diagonal <= 20.0) { _ringSpacing = 1.0; } else if (diagonal <= 50.0) { _ringSpacing = 2.0; } else if (diagonal <= 100.0) { _ringSpacing = 5.0; } else if (diagonal <= 200.0) { _ringSpacing = 10.0; } else if (diagonal <= 300.0) { _ringSpacing = 20.0; } else if (diagonal <= 400.0) { _ringSpacing = 25.0; } else if (diagonal <= 500.0) { _ringSpacing = 50.0; } else { _ringSpacing = 50.0; } } /************************************************************************* * _drawOverlays() */ void PolarWidget::_drawOverlays(QPainter &painter) { LOG(DEBUG) << "enter"; // Don't try to draw rings if we haven't been configured yet or if the // rings or grids aren't enabled. if (!_ringsEnabled && !_gridsEnabled && !_angleLinesEnabled) { return; } // save painter state painter.save(); // store font QFont origFont = painter.font(); // Draw rings if (_ringSpacing > 0.0 && _ringsEnabled) { // Set up the painter painter.save(); painter.setTransform(_zoomTransform); painter.setPen(_gridRingsColor); // set narrow line width QPen pen = painter.pen(); pen.setWidth(0); painter.setPen(pen); double ringRange = _ringSpacing; while (ringRange <= _maxRangeKm) { QRectF rect(-ringRange, -ringRange, ringRange * 2.0, ringRange * 2.0); painter.drawEllipse(rect); ringRange += _ringSpacing; } painter.restore(); // Draw the labels QFont font = painter.font(); font.setPointSizeF(_params->range_ring_label_font_size); painter.setFont(font); // painter.setWindow(0, 0, width(), height()); ringRange = _ringSpacing; while (ringRange <= _maxRangeKm) { double labelPos = ringRange * SIN_45; const string &labelStr = _scaledLabel.scale(ringRange); _zoomWorld.drawText(painter, labelStr, labelPos, labelPos, Qt::AlignCenter); _zoomWorld.drawText(painter, labelStr, -labelPos, labelPos, Qt::AlignCenter); _zoomWorld.drawText(painter, labelStr, labelPos, -labelPos, Qt::AlignCenter); _zoomWorld.drawText(painter, labelStr, -labelPos, -labelPos, Qt::AlignCenter); ringRange += _ringSpacing; } } /* endif - draw rings */ // Draw the grid if (_ringSpacing > 0.0 && _gridsEnabled) { // Set up the painter painter.save(); painter.setTransform(_zoomTransform); painter.setPen(_gridRingsColor); double ringRange = _ringSpacing; double maxRingRange = ringRange; while (ringRange <= _maxRangeKm) { _zoomWorld.drawLine(painter, ringRange, -_maxRangeKm, ringRange, _maxRangeKm); _zoomWorld.drawLine(painter, -ringRange, -_maxRangeKm, -ringRange, _maxRangeKm); _zoomWorld.drawLine(painter, -_maxRangeKm, ringRange, _maxRangeKm, ringRange); _zoomWorld.drawLine(painter, -_maxRangeKm, -ringRange, _maxRangeKm, -ringRange); maxRingRange = ringRange; ringRange += _ringSpacing; } painter.restore(); _zoomWorld.setSpecifyTicks(true, -maxRingRange, _ringSpacing); _zoomWorld.drawAxisLeft(painter, "km", true, true, true); _zoomWorld.drawAxisRight(painter, "km", true, true, true); _zoomWorld.drawAxisTop(painter, "km", true, true, true); _zoomWorld.drawAxisBottom(painter, "km", true, true, true); _zoomWorld.setSpecifyTicks(false); } // Draw the azimuth lines if (_angleLinesEnabled) { // Set up the painter painter.save(); painter.setPen(_gridRingsColor); // Draw the lines along the X and Y axes _zoomWorld.drawLine(painter, 0, -_maxRangeKm, 0, _maxRangeKm); _zoomWorld.drawLine(painter, -_maxRangeKm, 0, _maxRangeKm, 0); // Draw the lines along the 30 degree lines double end_pos1 = SIN_30 * _maxRangeKm; double end_pos2 = COS_30 * _maxRangeKm; _zoomWorld.drawLine(painter, end_pos1, end_pos2, -end_pos1, -end_pos2); _zoomWorld.drawLine(painter, end_pos2, end_pos1, -end_pos2, -end_pos1); _zoomWorld.drawLine(painter, -end_pos1, end_pos2, end_pos1, -end_pos2); _zoomWorld.drawLine(painter, end_pos2, -end_pos1, -end_pos2, end_pos1); painter.restore(); } // click point cross hairs if (_pointClicked) { int startX = _mouseReleaseX - _params->click_cross_size / 2; int endX = _mouseReleaseX + _params->click_cross_size / 2; int startY = _mouseReleaseY - _params->click_cross_size / 2; int endY = _mouseReleaseY + _params->click_cross_size / 2; painter.drawLine(startX, _mouseReleaseY, endX, _mouseReleaseY); painter.drawLine(_mouseReleaseX, startY, _mouseReleaseX, endY); } // reset painter state painter.restore(); // draw the color scale DisplayField *field = displayFieldController->getSelectedField(); _zoomWorld.drawColorScale(field->getColorMap(), painter, _params->label_font_size); if (_archiveMode) { // add legends with time, field name and elevation angle vector<string> legends; char text[1024]; // time legend //sprintf(text, "Start time: %s", _plotStartTime.asString(0).c_str()); //legends.push_back(text); // radar and site name legend string radarName(_platform.getInstrumentName()); if (_params->override_radar_name) { radarName = _params->radar_name; } string siteName(_platform.getInstrumentName()); if (_params->override_site_name) { siteName = _params->site_name; } string radarSiteLabel = radarName; if (siteName.size() > 0 && siteName != radarName) { radarSiteLabel += "/"; radarSiteLabel += siteName; } legends.push_back(radarSiteLabel); // field name legend //size_t selectedField = displayFieldController->getSelectedFieldNum(); //if (0) { //FieldRenderer *selectedFieldRenderer = _fieldRendererController->get(selectedField); //string fieldName = selectedFieldRenderer->getField().getLabel(); //} string fieldName = displayFieldController->getSelectedFieldName(); //string fieldName = _fieldRenderers[_selectedField]->getField().getLabel(); sprintf(text, "Field: %s", fieldName.c_str()); legends.push_back(text); // elevation legend //sprintf(text, "Elevation(deg): %.2f", _meanElev); //legends.push_back(text); // nrays legend //sprintf(text, "NRays: %g", _nRays); //legends.push_back(text); painter.save(); painter.setPen(Qt::yellow); painter.setBrush(Qt::black); painter.setBackgroundMode(Qt::OpaqueMode); switch (_params->ppi_main_legend_pos) { case Params::LEGEND_TOP_LEFT: _zoomWorld.drawLegendsTopLeft(painter, legends); break; case Params::LEGEND_TOP_RIGHT: _zoomWorld.drawLegendsTopRight(painter, legends); break; case Params::LEGEND_BOTTOM_LEFT: _zoomWorld.drawLegendsBottomLeft(painter, legends); break; case Params::LEGEND_BOTTOM_RIGHT: _zoomWorld.drawLegendsBottomRight(painter, legends); break; default: {} } // painter.setBrush(Qt::white); // painter.setBackgroundMode(Qt::TransparentMode); painter.restore(); } // if (_archiveMode) { LOG(DEBUG) << "exit"; } void PolarWidget::drawColorScaleLegend() { QPainter painter(this); // draw the color scale DisplayField *field = displayFieldController->getSelectedField(); _zoomWorld.drawColorScale(field->getColorMap(), painter, _params->label_font_size); } /////////////////////////////////////////////////////////////////////////// // Draw text, with (X, Y) in screen space // // Flags give the justification in Qt, and are or'd from the following: // Qt::AlignLeft aligns to the left border. // Qt::AlignRight aligns to the right border. // Qt::AlignJustify produces justified text. // Qt::AlignHCenter aligns horizontally centered. // Qt::AlignTop aligns to the top border. // Qt::AlignBottom aligns to the bottom border. // Qt::AlignVCenter aligns vertically centered // Qt::AlignCenter (== Qt::AlignHCenter | Qt::AlignVCenter) // Qt::TextSingleLine ignores newline characters in the text. // Qt::TextExpandTabs expands tabs (see below) // Qt::TextShowMnemonic interprets "&x" as x; i.e., underlined. // Qt::TextWordWrap breaks the text to fit the rectangle. // draw text in world coords void PolarWidget::_drawScreenText(QPainter &painter, const string &text, int text_x, int text_y, int flags) { int ixx = text_x; int iyy = text_y; QRect tRect(painter.fontMetrics().tightBoundingRect(text.c_str())); QRect bRect(painter.fontMetrics(). boundingRect(ixx, iyy, tRect.width() + 2, tRect.height() + 2, flags, text.c_str())); painter.drawText(bRect, flags, text.c_str()); } void PolarWidget::_refreshImages() { //FieldRendererController::refreshImages(int width, int height, QSize image_size, // QColor backgroundColor, // QRgb background_brush_color_rgb, // QTransform zoomTransform, // size_t selectedField, // vector< PpiBeam* > &Beams); LOG(DEBUG) << "enter " << "image dirty? = " << (_dirty ? "true" : "false"); if (_dirty) { _fieldRendererController->refreshImages(width(), height(), size(), _backgroundBrush, // .color().rgb(), _zoomTransform); //selectedField); // _ppiBeams); _dirty = false; } LOG(DEBUG) << "exit"; } /* slots for context editing; create and show the associated modeless dialog and return void PolarWidget::contextMenuCancel() { // informationMessage(); //notImplemented(); } void PolarWidget::contextMenuParameterColors() { informationMessage(); } void PolarWidget::contextMenuView() { informationMessage(); // notImplemented(); } void PolarWidget::contextMenuEditor() { informationMessage(); // notImplemented(); } void PolarWidget::contextMenuExamine() { informationMessage(); } void PolarWidget::contextMenuDataWidget() { informationMessage(); // notImplemented(); } void PolarWidget::contextMenuHistogram() { informationMessage(); // notImplemented(); } */ /* void PolarWidget::ExamineEdit(const RadxRay *closestRay) { notImplemented(); } void PolarWidget::ShowContextMenu(const QPoint &pos, RadxVol *vol) { notImplemented(); } */
[ "brenda@eol-albireo.local" ]
brenda@eol-albireo.local
b2b99a27ed984de39e47fedce8b7eeeb19460357
85eb574fc95f0d7a6d8fdca0cd84e622e78b402c
/src/Core/Utils/Message.cpp
2585973cb854a68a0efdc214dbd10a56fa9c7420
[ "MIT" ]
permissive
pedrohsreis/Mari
b0ee0534d0b2388410365f586e69b3563379bc61
ef0e0f3ffbecdeb49e8238df9795f4a07b84ad8b
refs/heads/master
2020-04-04T06:56:42.143270
2018-11-03T19:49:25
2018-11-03T19:49:25
155,762,829
0
0
MIT
2018-11-01T19:06:45
2018-11-01T19:06:44
null
UTF-8
C++
false
false
2,388
cpp
#include "Message.h" #include <cstring> using namespace std; int Message::ID = 0; void Message::initId() { id = ID++; } void Message::initMessage() { message = ""; } void Message::initLevel() { level = LEVEL_INFO; } Message::Message() { setType(TYPE_BASIC); initId(); initMessage(); initLevel(); } Message::Message(long id) { setType(TYPE_BASIC); this->id = id; initLevel(); } Message::Message(string &message) { setType(TYPE_BASIC); initId(); this->message = message; initLevel(); } Message::Message(long id, string &message) { setType(TYPE_BASIC); this->id = id; this->message = message; initLevel(); } Message::Message(const Message &message) { initId(); setLevel(message.level); setMessage(message.message); setType(message.type); } Message::~Message() { } void Message::setType(int type) { this->type = type; } int Message::getType() { return type; } void Message::setLevel(int level) { this->level = level; } int Message::getLevel() { return level; } void Message::setMessage(const string &message) { this->message = message; } string &Message::getMessage() { return message; } string Message::toString() { return message; } int Message::decode(vector<char> &data) { int sz = 0; if(data.size() < 4) return sz; char *ptr = data.data(); if(!(ptr[0] == 'R' && ptr[1] == 'I' && ptr[2] == 'N' && ptr[3] == 'O')) return sz; sz += 4; type = ((int*)ptr + sz)[0]; sz += sizeof (type); level = ((int*)ptr + sz)[0]; sz += sizeof (level); int msgLen = ((int*)ptr + sz)[0]; sz += sizeof (msgLen); char *str = new char[msgLen+1]; memcpy(str, ptr + sz, msgLen); str[msgLen] = '\0'; sz += msgLen; message = string(str); return sz; } int Message::encode(vector<char> &data) { char buff[message.size() + 128]; int sz = 0; const char *init = "RINO"; memcpy(buff + sz, init, 4); sz += 4; memcpy(buff + sz, (char*)(&type), sizeof(type)); sz += 4; memcpy(buff + sz, (char*)(&level), sizeof(level)); sz += 4; int len = message.length(); memcpy(buff + sz, (char*)(&len), sizeof(len)); sz += 4; memcpy(buff + sz, message.c_str(), len); for(int i = 0; i < sz; i++) data.push_back(buff[i]); return data.size(); }
[ "alexander.lmx@outlook.com" ]
alexander.lmx@outlook.com
d3f7429e80d10a754b718e93648709dc86ce422f
41d4967f85562d58b23c4e3ff106ddb8830f1366
/unified_transmitter/main.cpp
249e339e0923e335472dbf688c4913b590f97816
[]
no_license
maliatsos/wildcat
b184e4f91d01862691a83584d585cc9276842bb4
f2f33cb6419ddbec91300559bdcf9f96ae61d678
refs/heads/master
2020-04-11T19:40:54.795331
2019-01-29T08:44:05
2019-01-29T08:44:05
162,043,340
2
0
null
null
null
null
UTF-8
C++
false
false
9,717
cpp
// // Copyright 2011-2012,2014 Ettus Research LLC // Copyright 2018 Ettus Research, a National Instruments Company // // SPDX-License-Identifier: GPL-3.0-or-later // #include <uhd/types/tune_request.hpp> #include <uhd/utils/thread.hpp> #include <uhd/utils/safe_main.hpp> #include <uhd/usrp/multi_usrp.hpp> #include <boost/program_options.hpp> #include <boost/format.hpp> #include <iostream> #include <fstream> #include <complex> #include <csignal> #include <chrono> #include <thread> #include "usrp_config.h" namespace po = boost::program_options; using namespace std; static bool stop_signal_called = false; void sig_int_handler(int){stop_signal_called = true;} template<typename samp_type> void send_from_file( uhd::tx_streamer::sptr tx_stream, const std::string &file, size_t samps_per_buff ){ uhd::tx_metadata_t md; md.start_of_burst = false; md.end_of_burst = false; std::vector<samp_type> buff(samps_per_buff); std::ifstream infile(file.c_str(), std::ifstream::binary); //loop until the entire file has been read while(not md.end_of_burst and not stop_signal_called){ infile.read((char*)&buff.front(), buff.size()*sizeof(samp_type)); size_t num_tx_samps = size_t(infile.gcount()/sizeof(samp_type)); md.end_of_burst = infile.eof(); tx_stream->send(&buff.front(), num_tx_samps, md); } infile.close(); } void discover_usrps(uhd::device_addr_t & hint, uhd::device_addrs_t & dev_addrs, UsrpConfig & usrp_config) { try { // ===== Find devices: dev_addrs = uhd::device::find(hint); // ===== Number of identified devices: cout << "Discovered USRPs:" << dev_addrs.size() << endl; // Check the type of detected USRPs vector<size_t> n_ind;vector<size_t> b_ind; vector<string> serials; vector<string> ip_addresses; for (size_t ii = 0; ii<dev_addrs.size(); ii++) { usrp_config.usrp_type.push_back(dev_addrs[ii].get("type")); usrp_config.usrp_discovered_serials.push_back(dev_addrs[ii].get("serial")); if (usrp_config.usrp_type[ii].at(0) == 'b') { //=================== cout << "Found b-device with serial:" << usrp_config.usrp_discovered_serials[ii] << endl; //================== usrp_config.usrp_discovered_addresses.push_back("N/A"); } else if (usrp_config.usrp_type[ii] == "usrp2") { usrp_config.usrp_discovered_addresses.push_back(dev_addrs[ii].get("addr")); //=========================== cout << "Found n-device with address:" << usrp_config.usrp_discovered_addresses[ii] << endl; //=========================== } else if (usrp_config.usrp_type[ii] == "x300") { usrp_config.usrp_discovered_addresses.push_back(dev_addrs[ii].get("addr")); //=========================== cout << "Found x-device with address:" << usrp_config.usrp_discovered_addresses[ii] << endl; //=========================== } } } catch (invalid_argument& e) { cerr << e.what() << endl; } } int UHD_SAFE_MAIN(int argc, char *argv[]){ if (argc != 3) { cout << "Usage: ./unified_receiver <path_to_usrp_config> <path_to_waveform_config> <file-to-sent>" << endl; return -1; } UsrpConfig config; // Read the configuration file initialize_config(argv[1], &config); uhd::set_thread_priority_safe(); uhd::device_addr_t hint; uhd::device_addrs_t dev_addrs; discover_usrps(hint, dev_addrs, config); cout << "===========================================================" << endl; cout << "Number of Discovered usrps: " << dev_addrs.size() << endl; cout << "===========================================================" << endl; //variables to be set by po std::string args, file, type, ant, subdev, ref, wirefmt, channel; size_t spb; double rate, freq, gain, bw, delay, lo_off; file = argv[2]; rate = config.usrp_tx_rate[0][0]; freq = config.usrp_tx_freq[0]; gain = config.usrp_tx_gain[0][0]; spb = config.usrp_tx_frame_size[0]; lo_off = config.usrp_lo_off[0]; bw = config.usrp_tx_analog_bw[0]; ref = config.usrp_ref[0]; channel = config.usrp_tx_chan_num[0]; type = "double"; wirefmt = "sc16"; bool repeat = true; delay = 0; if (config.usrp_type[0][0]=='b') { string tmp = to_string(config.usrp_master_clock_rate[0]); args = "master_clock_rate=" + tmp; } else { args = "addr=" + config.usrp_addresses[0][0]; bw = 100000000; } //create a usrp device std::cout << std::endl; std::cout << boost::format("Creating the usrp device with: %s...") % args << std::endl; uhd::usrp::multi_usrp::sptr usrp = uhd::usrp::multi_usrp::make(args); //Lock mboard clocks usrp->set_clock_source(ref); std::this_thread::sleep_for(std::chrono::seconds(1)); if (config.usrp_tx_subdevs[0].size()>0) { //always select the subdevice first, the channel mapping affects the other settings subdev = config.usrp_tx_subdevs[0][0]; usrp->set_tx_subdev_spec(subdev); } std::cout << boost::format("Using Device: %s") % usrp->get_pp_string() << std::endl; //set the sample rate if (rate <= 0.0){ std::cerr << "Please specify a valid sample rate" << std::endl; return ~0; } std::cout << boost::format("Setting TX Rate: %f Msps...") % (rate/1e6) << std::endl; usrp->set_tx_rate(rate); std::cout << boost::format("Actual TX Rate: %f Msps...") % (usrp->get_tx_rate()/1e6) << std::endl << std::endl; //set the center frequency std::cout << boost::format("Setting TX Freq: %f MHz...") % (freq/1e6) << std::endl; uhd::tune_request_t tune_request; if(lo_off!=0.0) tune_request = uhd::tune_request_t(freq, lo_off); else tune_request = uhd::tune_request_t(freq); if(config.usrp_intn[0]) tune_request.args = uhd::device_addr_t("mode_n=integer"); usrp->set_tx_freq(tune_request); std::cout << boost::format("Actual TX Freq: %f MHz...") % (usrp->get_tx_freq()/1e6) << std::endl << std::endl; //set the rf gain std::cout << boost::format("Setting TX Gain: %f dB...") % gain << std::endl; usrp->set_tx_gain(gain); std::cout << boost::format("Actual TX Gain: %f dB...") % usrp->get_tx_gain() << std::endl << std::endl; //set the IF filter bandwidth std::cout << boost::format("Setting TX Bandwidth: %f MHz...") % (bw/1e6) << std::endl; usrp->set_tx_bandwidth(bw); std::cout << boost::format("Actual TX Bandwidth: %f MHz...") % (usrp->get_tx_bandwidth()/1e6) << std::endl << std::endl; //set the antenna if (config.usrp_tx_antennas[0].size()>0) { ant = config.usrp_tx_antennas[0][0]; usrp->set_tx_antenna(ant); } //allow for some setup time: std::this_thread::sleep_for(std::chrono::seconds(1)); //Check Ref and LO Lock detect std::vector<std::string> sensor_names; sensor_names = usrp->get_tx_sensor_names(0); if (std::find(sensor_names.begin(), sensor_names.end(), "lo_locked") != sensor_names.end()) { uhd::sensor_value_t lo_locked = usrp->get_tx_sensor("lo_locked",0); std::cout << boost::format("Checking TX: %s ...") % lo_locked.to_pp_string() << std::endl; UHD_ASSERT_THROW(lo_locked.to_bool()); } sensor_names = usrp->get_mboard_sensor_names(0); if ((ref == "mimo") and (std::find(sensor_names.begin(), sensor_names.end(), "mimo_locked") != sensor_names.end())) { uhd::sensor_value_t mimo_locked = usrp->get_mboard_sensor("mimo_locked",0); std::cout << boost::format("Checking TX: %s ...") % mimo_locked.to_pp_string() << std::endl; UHD_ASSERT_THROW(mimo_locked.to_bool()); } if ((ref == "external") and (std::find(sensor_names.begin(), sensor_names.end(), "ref_locked") != sensor_names.end())) { uhd::sensor_value_t ref_locked = usrp->get_mboard_sensor("ref_locked",0); std::cout << boost::format("Checking TX: %s ...") % ref_locked.to_pp_string() << std::endl; UHD_ASSERT_THROW(ref_locked.to_bool()); } //set sigint if user wants to receive if(repeat){ std::signal(SIGINT, &sig_int_handler); std::cout << "Press Ctrl + C to stop streaming..." << std::endl; } //create a transmit streamer std::string cpu_format; std::vector<size_t> channel_nums; if (type == "double") cpu_format = "fc64"; else if (type == "float") cpu_format = "fc32"; else if (type == "short") cpu_format = "sc16"; uhd::stream_args_t stream_args(cpu_format, wirefmt); channel_nums.push_back(boost::lexical_cast<size_t>(0)); stream_args.channels = channel_nums; uhd::tx_streamer::sptr tx_stream = usrp->get_tx_stream(stream_args); //send from file int packet_counter = 0; do{ if (type == "double") send_from_file<std::complex<double> >(tx_stream, file, spb); else if (type == "float") send_from_file<std::complex<float> >(tx_stream, file, spb); else if (type == "short") send_from_file<std::complex<short> >(tx_stream, file, spb); else throw std::runtime_error("Unknown type " + type); if(repeat and delay > 0.0) { std::this_thread::sleep_for( std::chrono::milliseconds(int64_t(delay*1000)) ); } packet_counter++; if (packet_counter % 50 == 0) {cout << "Packets send:" << packet_counter << endl;} } while(repeat and not stop_signal_called); //finished std::cout << std::endl << "Done!" << std::endl << std::endl; return EXIT_SUCCESS; }
[ "maliatsos@mobile.ntua.gr" ]
maliatsos@mobile.ntua.gr
577cbb81c9f013059ec89c4a2716dac3bacf2832
147ef4283347f9201e1adbb7ef634d84a6f7c3ab
/src/libANGLE/renderer/vulkan/VertexArrayVk.h
efa36325e29b4de80bb384f9cdf84b8f0fc02343
[ "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference" ]
permissive
kindow/angle
c700d35df2956da326dc2bdf00a4648640336adc
f3e23295953090c56f50caf048519ae66c3baf89
refs/heads/master
2021-05-14T10:03:07.866349
2018-01-04T23:19:21
2018-01-05T00:08:29
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,045
h
// // Copyright 2016 The ANGLE Project Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // VertexArrayVk.h: // Defines the class interface for VertexArrayVk, implementing VertexArrayImpl. // #ifndef LIBANGLE_RENDERER_VULKAN_VERTEXARRAYVK_H_ #define LIBANGLE_RENDERER_VULKAN_VERTEXARRAYVK_H_ #include "libANGLE/renderer/VertexArrayImpl.h" #include "libANGLE/renderer/vulkan/renderervk_utils.h" namespace rx { class BufferVk; class VertexArrayVk : public VertexArrayImpl { public: VertexArrayVk(const gl::VertexArrayState &state); ~VertexArrayVk() override; void destroy(const gl::Context *context) override; void syncState(const gl::Context *context, const gl::VertexArray::DirtyBits &dirtyBits) override; const gl::AttribArray<VkBuffer> &getCurrentArrayBufferHandles() const; void updateDrawDependencies(vk::CommandBufferNode *readNode, const gl::AttributesMask &activeAttribsMask, Serial serial, DrawType drawType); void invalidateVertexDescriptions(); void updateVertexDescriptions(const gl::Context *context); const std::vector<VkVertexInputBindingDescription> &getVertexBindingDescs() const; const std::vector<VkVertexInputAttributeDescription> &getVertexAttribDescs() const; private: gl::AttribArray<VkBuffer> mCurrentArrayBufferHandles; gl::AttribArray<ResourceVk *> mCurrentArrayBufferResources; ResourceVk *mCurrentElementArrayBufferResource; // Keep a cache of binding and attribute descriptions for easy pipeline updates. // TODO(jmadill): Update this when we support pipeline caching. bool mCurrentVertexDescsValid; std::vector<VkVertexInputBindingDescription> mCurrentVertexBindingDescs; std::vector<VkVertexInputAttributeDescription> mCurrentVertexAttribDescs; }; } // namespace rx #endif // LIBANGLE_RENDERER_VULKAN_VERTEXARRAYVK_H_
[ "commit-bot@chromium.org" ]
commit-bot@chromium.org
7b01d432c33f95fb197714ed8323c2b8e965d4ec
eed18c0d21fe0b2c1e41c14a0c0da4e6c56a1cda
/planet-old/sphere.cpp
c8253f3c5116939e40acd387d906d3af13a058e1
[]
no_license
geekpradd/Planet-Atmosphere-Renderer
d7371b3be2df4574a09e898fecb262ce3ee806ec
e7b18efc6beba78aaff8752d7c9d3f99eb1076b6
refs/heads/master
2021-04-14T00:11:46.959162
2020-06-25T11:43:59
2020-06-25T11:43:59
249,197,028
4
0
null
null
null
null
UTF-8
C++
false
false
4,285
cpp
#include <GL/glew.h> #include <GLFW/glfw3.h> #include <iostream> #include <cmath> #include "include/utility.hpp" #include "include/shader.hpp" #include "glm/glm.hpp" #include "glm/gtc/type_ptr.hpp" #include "glm/gtc/matrix_transform.hpp" #include "include/sphere.hpp" #define STB_IMAGE_IMPLEMENTATION #include "include/stb_image.h" glm::vec3 cameraPos = glm::vec3(0.0f, 0.0f, 6.0f); // +Z glm::vec3 upperVec = glm::vec3(0.0f, 1.0f, 0.0f); //+Y glm::vec3 rightVec = glm::normalize(glm::cross(upperVec, cameraPos)); // +X glm::vec3 lookAt = glm::vec3(0.0f, 0.0f, -1.0f); float yaw = -90.0f; // yaw is measured wrt x axis in xz plane (rotation axis is y) float pitch = 0.0f; // pitch is measured wrt z axis in yz plane (rotation axis is x) float curTime = glfwGetTime(); float deltaTime = 0.0f; void reshape_viewport(GLFWwindow *w, int width, int height){ glViewport(0, 0, width, height); } float x_glob = 400; float y_glob = 300; void cursor_callback(GLFWwindow* window, double x, double y){ float delta_x = x - x_glob; float delta_y = y_glob - y; x_glob = x; y_glob = y; float senstivity = 0.05f; pitch += senstivity*delta_y; yaw += senstivity*delta_x; if (pitch > 89.0f) pitch = 89.0f; if (pitch < -89.0f) pitch = -89.0f; } float fov = 45.0f; void scroll_callback(GLFWwindow* w, double x, double y){ if (fov > 1.0f && fov <= 45.0f){ fov -= y; } else if (fov<=1.0f){ fov= 1.0f; } else if (fov > 45.0f){ fov = 45.0f; } } void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) { //!Close the window if the ESC key was pressed float speed = 5000.0f*deltaTime; if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) glfwSetWindowShouldClose(window, GL_TRUE); else if (key == GLFW_KEY_A && action == GLFW_PRESS) cameraPos = (cameraPos - speed*rightVec); else if (key == GLFW_KEY_D && action == GLFW_PRESS) cameraPos = (cameraPos + speed*rightVec); else if (key == GLFW_KEY_W && action == GLFW_PRESS) cameraPos = (cameraPos + speed*lookAt); else if (key == GLFW_KEY_S && action == GLFW_PRESS) cameraPos = (cameraPos - speed*lookAt); if (key != GLFW_KEY_ESCAPE){ std::cout << "Current Position is " << cameraPos.x << ", " << cameraPos.y << ", " << cameraPos.z << std::endl; } } int main(){ glfwInit(); glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); GLFWwindow* w = glfwCreateWindow(800, 600, "Triangle", NULL, NULL); glfwMakeContextCurrent(w); glewExperimental = GL_TRUE; glewInit(); glEnable(GL_DEPTH_TEST); glViewport(0, 0, 800, 600); glfwSetInputMode(w, GLFW_CURSOR, GLFW_CURSOR_DISABLED); glfwSetCursorPosCallback(w, cursor_callback); glfwSetFramebufferSizeCallback(w, reshape_viewport); glfwSetScrollCallback(w, scroll_callback); glfwSetKeyCallback(w, key_callback); Shader *shdr = new Shader("shaders/spherevertexshader.glsl", "shaders/simplefragment.glsl"); Sphere sph (5.0f); shdr->use(); while (!glfwWindowShouldClose(w)){ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); deltaTime = glfwGetTime() - curTime; curTime = glfwGetTime(); glBindVertexArray(sph.VAO); glm::mat4 projection = glm::perspective(glm::radians(fov), 800.0f/600.0f, 0.1f, 100.0f); shdr->setMatrix4f("projection", projection); //for camera we will exclusively modify only the view matrix lookAt.y = sin(glm::radians(pitch)); lookAt.x = cos(glm::radians(pitch))*cos(glm::radians(yaw)); lookAt.z = cos(glm::radians(pitch))*sin(glm::radians(yaw)); rightVec = glm::normalize(glm::cross(lookAt, upperVec)); // +X glm::mat4 view = glm::lookAt(cameraPos, cameraPos+lookAt, upperVec); shdr->setMatrix4f("view", view); glm::mat4 model = glm::mat4(1.0f); shdr->setMatrix4f("model", model); glDrawArrays(GL_TRIANGLES, 0, sph.vertex_count); glfwSwapBuffers(w); glfwPollEvents(); } // glfwTerminate(); return 0; }
[ "geekpradd@gmail.com" ]
geekpradd@gmail.com
f641f611496ef81a43628105d5638cdb82c9e108
9934a879dae3f3b9a3a765b431684bcb984dd71a
/abc064/a/main.cpp
4182f35d24e889c3326431c152d4585d743bda1c
[]
no_license
kdnk/at_corder
799b30948be7072a899df512fbb45ac6af80a2c6
dc4eee9e5b532eb4e96b09ccf3b423b3be199e8b
refs/heads/master
2021-07-21T12:25:12.169150
2020-05-25T13:19:57
2020-05-25T13:19:57
163,845,920
0
0
null
null
null
null
UTF-8
C++
false
false
321
cpp
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { cin.tie(0); ios::sync_with_stdio(false); int r, g, b; cin >> r >> g >> b; if ((r * 100 + g * 10 + b) % 4 == 0) { cout << "YES" << endl; } else { cout << "NO" << endl; } return 0; }
[ "kodai.nakamura.215@gmail.com" ]
kodai.nakamura.215@gmail.com
cdb79a6a3ff68337cd4db93ea922b08a92866cd6
b41cbf77e191a8e19f5d559d4d8be1e9e199865b
/globals.h
681452b7715f1960e83b2ea5749198e2b546d3fb
[]
no_license
rajuljain88/cs505-Project1
a67484bd2cc3ba71a9297135d1f5c2ccfbd2b923
64139127c23a0e64434f091283d1b3faa396b6a7
refs/heads/master
2021-01-15T23:02:18.600109
2011-09-25T01:51:11
2011-09-25T01:51:11
2,452,800
0
0
null
null
null
null
UTF-8
C++
false
false
1,587
h
#include <iostream> #include <fstream> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <netdb.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> #include <string.h> #include <pthread.h> #include <openssl/rsa.h> #include <openssl/evp.h> #include <openssl/objects.h> #include <openssl/x509.h> #include <openssl/err.h> #include <openssl/pem.h> #include <openssl/ssl.h> using namespace std; #define SEND_BUF_SIZE 256 #define RECV_BUF_SIZE 256 #define PORT 8080 #define DEFAULT_DECISION 0 #define NPROC 101 bool checkAndPopulateArgs(int args, char* argv[], bool* loyal, int* port, char* hostfile, char* decision); void waitAndProcessMessages(pthread_t*, int port); void* recvMesgAndSendToAll(void *); void sendMessage(struct mesgPackage mesg, char *dest_hostname, int port); bool isGeneral(char* command); bool isMessageFromGeneral(char* mesg); void makeDecision(); void signMessage(int message, char* keyfile, unsigned char* signature); bool verifySignature(int message, unsigned char* signature, char* certfile); bool verifySignatures(struct mesgPackage); int num_hosts = 0; int attacknum = 0; int retreatnum = 0; char localhostname[30]; int localhostindex; char* hostnames[101]; int decisionCount = 0; pthread_t threads[2*NPROC]; int connectSockets[2*NPROC]; pthread_mutex_t mutex; int port; bool loyal; int traitordecision; //0: send mesg like loyal, 1 to forge and 2 to not send the message at all struct mesgPackage { int message; unsigned char signatures[NPROC][256]; bool pid[NPROC]; };
[ "rajuljain88@gmail.com" ]
rajuljain88@gmail.com
f13e664fb2d539f3d81a9920dff777e23e84ae26
a53f8d2859477f837c81f943c81ceed56cf37238
/RTL/Component/Rendering/OpenGL/CIFXOpenGL.cpp
f8dac42c1fed1071907052447cb5cfdbebeddd33
[ "Apache-2.0" ]
permissive
ClinicalGraphics/u3d
ffd062630cde8c27a0792370c158966d51182d4d
a2dc4bf9ead5400939f698d5834b7c5d43dbf42a
refs/heads/master
2023-04-13T17:25:55.126360
2023-03-30T07:34:12
2023-03-31T18:20:43
61,121,064
11
5
Apache-2.0
2023-09-01T04:23:31
2016-06-14T12:29:13
C++
UTF-8
C++
false
false
4,439
cpp
//*************************************************************************** // // Copyright (c) 2001 - 2006 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. // //*************************************************************************** // CIFXOpenGL.cpp #include "IFXRenderPCHOGL.h" #include "CIFXOpenGL.h" #include "IFXOSLoader.h" IFXRESULT CIFXOpenGL::Construct() { IFXRESULT rc = IFX_OK; return rc; } IFXRESULT CIFXOpenGL::LoadExtensions() { IFXRESULT rc = IFX_OK; const char* szExtensions = (const char*)glGetString(GL_EXTENSIONS); char* pExts = new char[strlen(szExtensions)+1]; if(pExts) { #ifdef IFXDEBUG_OGLINFO IFXTRACE_GENERIC(L"\nOpenGL Information:\n"); IFXTRACE_GENERIC(L"\tVendor: %hs\n", glGetString(GL_VENDOR)); IFXTRACE_GENERIC(L"\tRenderer: %hs\n", glGetString(GL_RENDERER)); IFXTRACE_GENERIC(L"\tVersion: %hs\n", glGetString(GL_VERSION)); IFXTRACE_GENERIC(L"\tExtensions:\n"); #endif strcpy(pExts, szExtensions); char* pExt = pExts; for(pExt = strtok(pExts, " "); pExt; pExt = strtok(NULL, " ")) { #ifdef IFXDEBUG_OGLINFO IFXTRACE_GENERIC(L"\t\t%hs\n", pExt); #endif if(!strcmp(pExt, "GL_ARB_multitexture")) { m_bMultiTexture = TRUE; } else if(!strcmp(pExt, "GL_ARB_texture_compression")) { m_bTexCompress = TRUE; } else if(!strcmp(pExt, "GL_EXT_packed_pixels")) { m_bPackedPixels = TRUE; } else if(!strcmp(pExt, "GL_EXT_bgra")) { m_bBGRA = TRUE; } else if(!strcmp(pExt, "GL_EXT_separate_specular_color")) { m_bSeparateSpecular = TRUE; } else if(!strcmp(pExt, "GL_EXT_texture_env_combine")) { m_bTexCombine = TRUE; } else if(!strcmp(pExt, "GL_EXT_texture_env_add")) { m_bTexAdd = TRUE; } else if(!strcmp(pExt, "GL_EXT_texture_env_dot3")) { m_bTexDot3 = TRUE; } else if(!strcmp(pExt, "GL_EXT_texture_cube_map")) { m_bCubeTexture = TRUE; } else if(!strcmp(pExt, "GL_ARB_texture_cube_map")) { m_bCubeTexture = TRUE; } else if(!strcmp(pExt, "GL_SGIS_generate_mipmap")) { m_bAutoMipMap = TRUE; } } IFXDELETE_ARRAY(pExts); const char* szVersion = (const char*)glGetString(GL_VERSION); I32 iMajor; I32 iMinor; sscanf(szVersion, "%d.%d", &iMajor, &iMinor); if(iMinor >= 2 && strcmp((const char*)glGetString(GL_VENDOR), "ATI Technologies Inc.")) { m_bOpenGL_1_2 = TRUE; ///@todo: it is not right way to check 1.2 OpenGL version m_bPackedPixels = TRUE; } } else { rc = IFX_E_OUT_OF_MEMORY; } if(m_bOpenGL_1_2) { glDrawRangeElements = (GLDrawRangeElements) GetOGLExtensionFunc("glDrawRangeElements"); } if(m_bMultiTexture) { glActiveTextureARB = (GLActiveTextureARB) GetOGLExtensionFunc("glActiveTextureARB"); glClientActiveTextureARB = (GLClientActiveTextureARB) GetOGLExtensionFunc("glClientActiveTextureARB"); } /* if(m_bTexCompress) { glCompressedTexImage3DARB = (GLCompressedTexImage3DARB) GetOGLExtensionFunc("glCompressedTexImage3DARB"); glCompressedTexImage2DARB = (GLCompressedTexImage2DARB) GetOGLExtensionFunc("glCompressedTexImage2DARB"); glCompressedTexImage1DARB = (GLCompressedTexImage1DARB) GetOGLExtensionFunc("glCompressedTexImage1DARB"); glCompressedTexSubImage3DARB = (GLCompressedTexSubImage3DARB) GetOGLExtensionFunc("glCompressedTexSubImage3DARB"); glCompressedTexSubImage2DARB = (GLCompressedTexSubImage2DARB) GetOGLExtensionFunc("glCompressedTexSubImage2DARB"); glCompressedTexSubImage1DARB = (GLCompressedTexSubImage1DARB) GetOGLExtensionFunc("glCompressedTexSubImage1DARB"); glGetCompressedTexImageARB = (GLGetCompressedTexImageARB) GetOGLExtensionFunc("glGetCompressedTexImageARB"); } */ return rc; } IFXOGLPROC IFXAPI CIFXOpenGL::GetOGLExtensionFunc(const char* szFuncName) { IFXHANDLE m_hLibrary = NULL; IFXGetAddress(m_hLibrary, szFuncName); return (IFXOGLPROC)m_hLibrary; }
[ "ningfei.li@gmail.com" ]
ningfei.li@gmail.com
1ee73cedf27ead6a87e590a0d3595307ad5ad49b
807315581299c7dd9896a13b0ad56a1d678623ec
/src/modules/transitions/src/transition_executor.cpp
86f1afd750225f432f4faf107b6c94e1e0c59229
[ "MIT" ]
permissive
P8P-7/core
4b68bf5980883422f48045fd6fb47c1aa520b094
820873e7da867392729b2e65922205afe98e41d8
refs/heads/master
2020-03-12T14:19:57.499223
2018-07-04T13:58:01
2018-07-04T13:58:01
130,664,669
3
1
MIT
2018-07-05T20:34:25
2018-04-23T08:26:54
C++
UTF-8
C++
false
false
1,369
cpp
#include <goliath/transitions/transition_executor.h> #include <boost/log/trivial.hpp> #include <chrono> #include <thread> #include <iostream> #include <cmath> using namespace goliath::transitions; size_t TransitionExecutor::execute(std::shared_ptr<Tickable> tickable) { Microseconds interval = Microseconds(static_cast<int>(1.0 / tickable->getTicksPerSecond() * 1000000.0)); TimePoint start = Clock::now(); TimePoint end = start + tickable->getDuration(); TimePoint current = start; size_t skippedTicks = 0; size_t currentSkips = 0; TimePoint intervalStart; while (current < end) { if (currentSkips > 0) { skippedTicks++; BOOST_LOG_TRIVIAL(info) << "Skipped a tick"; std::this_thread::sleep_for(intervalStart - Clock::now() + (interval * (currentSkips + 1))); currentSkips = 0; current = Clock::now(); continue; } intervalStart = Clock::now(); tickable->tick(); auto timeAfter = intervalStart - Clock::now() + interval; if (timeAfter.count() < 0) { currentSkips = static_cast<size_t>(std::abs(timeAfter.count() / interval.count() / 1000) + 1); } else { std::this_thread::sleep_for(timeAfter); } current = Clock::now(); } return skippedTicks; }
[ "jan@janwilts.com" ]
jan@janwilts.com
d9d2d7ad612ddc3e60a31b0b369c8e5be8f5655f
56ef1f249f9de8ad0a63ff1da521b70dfb622ec7
/BoHeApp/extensions/nlb/include/sppincl.h
dda0245a26be31a89de8be57509307f19a9ef0d6
[]
no_license
BoHeTeachnology/boheyayi
c56640f5c46215790cded01065a8547c7fb24947
4f58bf006426052053368c329497290fd2dfd54f
refs/heads/master
2021-08-26T07:06:47.560093
2017-11-22T02:30:19
2017-11-22T02:30:19
109,786,600
0
2
null
null
null
null
UTF-8
C++
false
false
545
h
#ifndef _SPP_INCL_H_ #define _SPP_INCL_H_ #include "spp_incl/spp_version.h" //框架版本号 #include "spp_incl/tlog.h" //日志 #include "spp_incl/tstat.h" //统计 #include "spp_incl/tcommu.h" //通讯组件 #include "spp_incl/serverbase.h" //服务器容器 #include "spp_incl/ICostStat.h" #include "spp_incl/monitor.h" #define GROUPID(x) (((x)|1<<31)) using namespace tbase::tlog; using namespace tbase::tstat; using namespace tbase::tcommu; using namespace spp::comm; using namespace spp::comm; using namespace SPP_STAT_NS; #endif
[ "j@rallets.com" ]
j@rallets.com
32c34556048f9128d3768022e4a523d5fbf27e27
69e9606809eb77c5b032e8fa3c476c3fa9d8d015
/include/cvx/array_view.hpp
83652038b39531ae2c108c7b1918c13b24bd9791
[]
no_license
MisanthropicBit/cvx
a8a3d923d1c6ee1d181f4534cb64f9e4405a4820
3d1c95ff9b26a72af2b6d9b892667870fc880518
refs/heads/master
2021-01-22T22:35:18.935557
2015-11-13T20:31:59
2015-11-13T20:31:59
39,440,351
7
2
null
null
null
null
UTF-8
C++
false
false
14,236
hpp
#ifndef CVX_ARRAY_VIEW_HPP #define CVX_ARRAY_VIEW_HPP #include "cvx/exception.hpp" #include "cvx/export.hpp" #include "cvx/point2.hpp" #include "cvx/rectangle2.hpp" #include "cvx/utils.hpp" #include <iterator> #include <type_traits> namespace cvx { ////////////////////////////////////////////////////////////////////// /// Abstracts a 2D view of an arbitrary range of values /// /// \param <RandomAccessIterator> Type of the iterator range that is /// being viewed ////////////////////////////////////////////////////////////////////// template<typename RandomAccessIterator> class CVX_EXPORT array_view final { #if defined(CVX_WITH_OPENCV) && !defined(OPENCV_NOSTL) // Note: We check this before the typedefs to avoid excess errors // Note: Update for contiguous_iterators when available static_assert(std::is_same<typename std::iterator_traits<RandomAccessIterator>::iterator_category, std::random_access_iterator_tag>::value, "Iterator type must be random access"); #endif public: using value_type = typename std::iterator_traits<RandomAccessIterator>::value_type; using reference = typename std::iterator_traits<RandomAccessIterator>::reference; using pointer = typename std::iterator_traits<RandomAccessIterator>::pointer; using difference_type = typename std::iterator_traits<RandomAccessIterator>::difference_type; using iterator_category = typename std::iterator_traits<RandomAccessIterator>::iterator_category; using iterator = RandomAccessIterator; using const_iterator = const RandomAccessIterator; using size_type = std::size_t; public: ////////////////////////////////////////////////////////////////////// /// Create an empty view ////////////////////////////////////////////////////////////////////// array_view() : first(RandomAccessIterator()), last(RandomAccessIterator()), _width(0), _height(0) { } ////////////////////////////////////////////////////////////////////// /// Create a view of some data /// /// \param first Iterator to the beginning of the data /// \param last Iterator to the end of the data /// \param width Width of the data /// \param height Height of the data ////////////////////////////////////////////////////////////////////// array_view(RandomAccessIterator first, RandomAccessIterator last, size_type width, size_type height) : first(first), last(last), _width(width), _height(height) { } ////////////////////////////////////////////////////////////////////// /// \return True if the view is pointing to valid data ////////////////////////////////////////////////////////////////////// bool valid() const noexcept { return (first != last); } ////////////////////////////////////////////////////////////////////// /// \return True if the view contains the given point ////////////////////////////////////////////////////////////////////// bool contains(const point2i& point) const noexcept { return (point.x >= 0 && point.x < width() && point.y >= 0 && point.y < height()); } ////////////////////////////////////////////////////////////////////// /// Access the data pointed to by the view by index /// /// \param i Index /// \return The data at i ////////////////////////////////////////////////////////////////////// reference operator[](size_type i) { size_type x = i % width(); size_type y = i / width(); return operator()(y, x); } ////////////////////////////////////////////////////////////////////// /// Access the data pointed to by the view by index /// /// \param i Index /// \return The data at i ////////////////////////////////////////////////////////////////////// const reference operator[](size_type i) const { size_type x = i % width(); size_type y = i / width(); return operator()(y, x); } ////////////////////////////////////////////////////////////////////// /// Access the data pointed to by the view by index. Does bounds /// checking as well. /// /// \param i Index /// \return The data at i ////////////////////////////////////////////////////////////////////// reference at(size_type i) { if (i >= size()) { throw exception("Index out of bounds"); } return operator[](i); } ////////////////////////////////////////////////////////////////////// /// Access the data pointed to by the view by index. Does bounds /// checking as well. /// /// \param i Index /// \return The data at i ////////////////////////////////////////////////////////////////////// const reference at(size_type i) const { if (i >= size()) { throw exception("Index out of bounds"); } return operator[](i); } ////////////////////////////////////////////////////////////////////// /// Treat the viewed data as a 2D array and access the data at (x, y) /// /// \param y Y-coordinate of data /// \param x X-coordinate of data /// \return The data at (x, y) ////////////////////////////////////////////////////////////////////// reference at(size_type x, size_type y) { if (x >= width()) { throw exception("X-coordinate out of bounds"); } return row(y)[x]; } ////////////////////////////////////////////////////////////////////// /// Treat the viewed data as a 2D array and access the data at (x, y) /// /// \param y Y-coordinate of data /// \param x X-coordinate of data /// \return The data at (x, y) ////////////////////////////////////////////////////////////////////// const reference at(size_type y, size_type x) const { if (x >= width()) { throw exception("X-coordinate out of bounds"); } return row(y)[x]; } ////////////////////////////////////////////////////////////////////// /// Treat the viewed data as a 2D array and access the data at (x, y) /// /// \param y Y-coordinate of data /// \param x X-coordinate of data /// \return The data at (x, y) ////////////////////////////////////////////////////////////////////// reference operator()(size_type y, size_type x) { return *(first + width() * y + x); } ////////////////////////////////////////////////////////////////////// /// Treat the viewed data as a 2D array and access the data at (x, y) /// /// \param y Y-coordinate of data /// \param x X-coordinate of data /// \return The data at (x, y) ////////////////////////////////////////////////////////////////////// const reference operator()(size_type y, size_type x) const { return *(first + width() * y + x); } ////////////////////////////////////////////////////////////////////// /// Treat the viewed data as a 2D array and access the data at (x, y) /// /// \param point Where to access the data /// \return The data at (x, y) ////////////////////////////////////////////////////////////////////// template<typename T> reference operator()(const point2<T>& point) { return operator()(point.y, point.x); } ////////////////////////////////////////////////////////////////////// /// Treat the viewed data as a 2D array and access the data at (x, y) /// /// \param point Where to access the data /// \return The data at (x, y) ////////////////////////////////////////////////////////////////////// template<typename T> const reference operator()(const point2<T>& point) const { return operator()(point.y, point.x); } ////////////////////////////////////////////////////////////////////// /// Return a pointer to the specified row /// /// \param y Row to query /// \return The yth row ////////////////////////////////////////////////////////////////////// pointer row(size_type y) { if (y >= height()) { throw exception("Y-coordinate out of bounds"); } return first + y * width(); } ////////////////////////////////////////////////////////////////////// /// Return a pointer to the specified row /// /// \param y Row to query /// \return The yth row ////////////////////////////////////////////////////////////////////// const pointer row(size_type y) const { if (y >= height()) { throw exception("Y-coordinate out of bounds"); } return first + y * width(); } ////////////////////////////////////////////////////////////////////// /// \return The width of the data viewed as a 2D array ////////////////////////////////////////////////////////////////////// size_type width() const noexcept { return _width; } ////////////////////////////////////////////////////////////////////// /// \return The height of the data viewed as a 2D array ////////////////////////////////////////////////////////////////////// size_type height() const noexcept { return _height; } ////////////////////////////////////////////////////////////////////// /// \return The stride or pitch of the data viewed as a 2D array ////////////////////////////////////////////////////////////////////// size_type pitch() const noexcept { return _width * sizeof(value_type); } //array_view subview(const rectangle2i& bounds) { // if (bounds.x < 0 || bounds.y < 0 || bounds.right() >= width || bounds.bottom() >= height) { // throw std::out_of_range("Subview bounds out of range"); // } // RandomAccessIterator iter = first + bounds.x + stride * bounds.y; // return array_view(iter, // iter + bounds.area(), // Include padding // bounds.width, // bounds.height, // ?); // return array_view<RandomAccessIterator>(); //} ////////////////////////////////////////////////////////////////////// /// \return The total number of elements in the view ////////////////////////////////////////////////////////////////////// size_type size() const { return _width * _height; } ////////////////////////////////////////////////////////////////////// /// \return The total number of bytes spanned by the view ////////////////////////////////////////////////////////////////////// size_type bytesize() const { return pitch() * _height; } ////////////////////////////////////////////////////////////////////// /// \return An iterator to the beginning of the data ////////////////////////////////////////////////////////////////////// iterator begin() noexcept { return first; } ////////////////////////////////////////////////////////////////////// /// \return An iterator to the end of the data ////////////////////////////////////////////////////////////////////// iterator end() noexcept { return last; } ////////////////////////////////////////////////////////////////////// /// \return An iterator to the end of the data ////////////////////////////////////////////////////////////////////// const_iterator cbegin() const noexcept { return first; } ////////////////////////////////////////////////////////////////////// /// \return An iterator to the end of the data ////////////////////////////////////////////////////////////////////// const_iterator cend() const noexcept { return last; } private: RandomAccessIterator first, last; size_type _width, _height; }; } // cvx #endif // CVX_ARRAY_VIEW_HPP
[ "alexander.asp.bock@gmail.com" ]
alexander.asp.bock@gmail.com
ceecb024371d1a9136ae9c845ae57162401f7d3a
5f3d781407e3e36c09b2dce4eeb5b3d65426a4e2
/DG/SWEElevationLimiter2d.cpp
461dd5c67b10612296a761a366181c83df4a2bc0
[]
no_license
Latio/DG
07d2bb5dcaaf22b73c1153197ca446e0692f5bd8
4baa6ddeb47272a515e0ae006e972494ba20ce48
refs/heads/master
2020-08-21T16:11:02.003177
2019-12-16T17:55:21
2019-12-16T17:55:21
216,195,421
0
0
null
null
null
null
UTF-8
C++
false
false
4,159
cpp
#include "SWEElevationLimiter2d.h" SWEElevationLimiter2d::SWEElevationLimiter2d() { int Nv = *meshunion->Nv; int Nv_cell = *meshunion->cell_p->Nv; int K = *meshunion->K; double *xc = meshunion->xc; double *yc = meshunion->yc; double *vx = meshunion->vx; double *vy = meshunion->vy; double *EToV = meshunion->EToV; requestmemory(&Nvc, Nv); double *v; requestmemory(&v, Nv_cell); for (int k = 0; k < K; k++) { double *temp_etov = EToV + k * Nv_cell; cblas_dcopy(Nv_cell, temp_etov, 1, v, 1); for (int i = 0; i < Nv_cell; i++) { Nvc[(int)v[i] - 1] = Nvc[(int)v[i] - 1] + 1; } } const int maxindex = cblas_idamax(Nv, Nvc, 1); Nvcmax = (int)Nvc[maxindex]; freememory(&Nvc); requestmemory(&VToK, Nvcmax, Nv); requestmemory(&VToM, Nvcmax, Nv); requestmemory(&Nvc, Nv); double *ind; requestmemory(&ind, Nv_cell); for (int k = 0; k < K; k++) { double *temp_etov = EToV + k * Nv_cell; cblas_dcopy(Nv_cell, temp_etov, 1, v, 1); for (int n = 0; n < Nv_cell; n++) { ind[n] = Nvc[(int)v[n] - 1] + 1 + (v[n] - 1)*Nvcmax; VToK[(int)ind[n] - 1] = k + 1; VToM[(int)ind[n] - 1] = 1; Nvc[(int)v[n] - 1] = Nvc[(int)v[n] - 1] + 1; } } requestmemory(&VToW, Nvcmax, Nv); for (int n = 0; n < Nv; n++) { int nvcn = (int)Nvc[n]; double *w; requestmemory(&w, nvcn); for (int m = 0; m < nvcn; m++) { int cellid = VToK[n*Nvcmax + m] - 1; int msehid = VToM[n*Nvcmax + m] - 1; double xc_ = xc[cellid]; double yc_ = yc[cellid]; w[m] = 1.0 / (pow(vx[n] - xc_, 2) + pow(vy[n] - yc_, 2)); } double sum = cblas_dasum(nvcn, w, 1); for (int i = 0; i < nvcn; i++) { VToW[n*Nvcmax + i] = w[i] / sum; } freememory(&w); } freememory(&ind); freememory(&v); } SWEElevationLimiter2d::~SWEElevationLimiter2d() { freememory(&Nvc); freememory(&VToK); freememory(&VToM); freememory(&VToW); } void SWEElevationLimiter2d::apply(double *fphys) { int *Np = meshunion->cell_p->Np; int *K = meshunion->K; signed char *status = meshunion->status; const int num = (*Np)*(*K); double *fphys_1 = fphys; double *fphys_2 = fphys + num; double *fphys_3 = fphys + 2 * num; double *fphys_4 = fphys + 3 * num; double *fphys_5 = fphys + 4 * num; cblas_dcopy(num, fphys_1, 1, fphys_5, 1); cblas_daxpy(num, 1, fphys_4, 1, fphys_5, 1); matLimit(fphys, 5); bool *ind; requestmemory(&ind, K); for (int i = 0; i < (*K); i++) { if (status[i] == (signed char)enumSWERegion::Wet) { ind[i] = true; } else { ind[i] = false; } } for (int i = 0; i < (*K); i++) { if (ind[i] = true) { for (int j = 0; j < (*Np); j++) { fphys_1[i*(*Np) + j] = fphys_5[i*(*Np) + j] + fphys_4[i*(*Np) + j]; } } } matLimit(fphys, 2); matLimit(fphys, 3); freememory(&ind); }; void SWEElevationLimiter2d::matLimit(double *fphys, int fieldId) { int *K = meshunion->K; int *Np = meshunion->cell_p->Np; int *Nv_cell = meshunion->cell_p->Nv; int *Nfp = meshunion->inneredge_p->Nfp; double *x = meshunion->x; double *y = meshunion->y; double *xc = meshunion->xc; double *yc = meshunion->yc; double *vx = meshunion->vx; double *vy = meshunion->vy; double *EToV = meshunion->EToV; double *Fmask = meshunion->cell_p->Fmask; double *fvert, *fvmin, *fvmax, *cvar; requestmemory(&fvert, K); requestmemory(&fvmin, K); requestmemory(&fvmax, K); requestmemory(&cvar, K); EvaluateVertAverage(fphys, fieldId, fvert, fvmin, fvmax, cvar); double *fphys_fieldId = fphys + (fieldId - 1)*(*K)*(*Np); c_VertLimit2d(fphys_fieldId, x, y, xc, yc, vx, vy, fvert, fvmin, fvmax, cvar, EToV, Fmask, Np, Nv_cell, K, Nfp); freememory(&fvert); freememory(&fvmin); freememory(&fvmax); freememory(&cvar); }; void SWEElevationLimiter2d::EvaluateVertAverage(double *fphys, int fieldId, double *fvert, double *fvmin, double *fvmax, double *cvar) { int *Nv = meshunion->Nv; int Np = *meshunion->cell_p->Np; int K = *meshunion->K; double *fphys_fieldId = fphys + (fieldId - 1) * K*Np; mesh.GetMeshAverageValue(fphys_fieldId, cvar); c_EvaluateVertAverage(cvar, Nv, Nvc, VToM, VToK, VToW, fvert, fvmin, fvmax, Nvcmax); }; void assembleVertexCellConnect() { };
[ "wangrjharbor@163.com" ]
wangrjharbor@163.com
e19339b0696371a646b29f9889f4f60318f0080d
42084de08fda762307c9c4e99ac3f175d18f6700
/game_shared/common.cpp
4c7c9c0e43930fec2ca0a750d22e72bdbbb99da3
[]
no_license
tyabus/quakewrapper
89cbe905772374a6183b8c8565cf031171b31312
ca51e5910671f5b47238bece555a11abd4a2fc3c
refs/heads/master
2020-05-30T04:42:23.716228
2019-06-01T04:04:55
2019-06-01T04:04:55
189,545,527
1
0
null
2019-05-31T07:07:37
2019-05-31T07:07:37
null
UTF-8
C++
false
false
5,791
cpp
/* common.cpp - common game routines Copyright (C) 2011 Uncle Mike This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #define NOMINMAX #ifdef _WIN32 #include <windows.h> #endif #include <stdio.h> #include <stringlib.h> /* ============ COM_FileBase Extracts the base name of a file (no path, no extension, assumes '/' as path separator) ============ */ void COM_FileBase( const char *in, char *out ) { int len, start, end; len = Q_strlen( in ); if( !len ) return; // scan backward for '.' end = len - 1; while( end && in[end] != '.' && in[end] != '/' && in[end] != '\\' ) end--; if( in[end] != '.' ) end = len-1; // no '.', copy to end else end--; // found ',', copy to left of '.' // scan backward for '/' start = len - 1; while( start >= 0 && in[start] != '/' && in[start] != '\\' ) start--; if( start < 0 || ( in[start] != '/' && in[start] != '\\' )) start = 0; else start++; // length of new sting len = end - start + 1; // Copy partial string Q_strncpy( out, &in[start], len + 1 ); out[len] = 0; } /* ============ COM_ExtractFilePath ============ */ void COM_ExtractFilePath( const char *path, char *dest ) { const char *src; src = path + Q_strlen( path ) - 1; // back up until a \ or the start while( src != path && !(*(src - 1) == '\\' || *(src - 1) == '/' )) src--; if( src != path ) { memcpy( dest, path, src - path ); dest[src - path - 1] = 0; // cutoff backslash } else Q_strcpy( dest, "" ); // file without path } /* ============ COM_StripExtension ============ */ void COM_StripExtension( char *path ) { size_t length; length = Q_strlen( path ) - 1; while( length > 0 && path[length] != '.' ) { length--; if( path[length] == '/' || path[length] == '\\' || path[length] == ':' ) return; // no extension } if( length ) path[length] = 0; } /* ================== COM_DefaultExtension ================== */ void COM_DefaultExtension( char *path, const char *extension ) { const char *src; // if path doesn't have a .EXT, append extension // (extension should include the .) src = path + Q_strlen( path ) - 1; while( *src != '/' && src != path ) { // it has an extension if( *src == '.' ) return; src--; } Q_strcat( path, extension ); } /* ============ COM_FixSlashes Changes all '/' characters into '\' characters, in place. ============ */ void COM_FixSlashes( char *pname ) { while( *pname ) { if( *pname == '\\' ) *pname = '/'; pname++; } } /* ============== COM_ParseFile safe version text parser ============== */ char *COM_ParseFileExt( char *data, char *token, long token_size, bool allowNewLines ) { bool newline = false; int c, len; if( !token || !token_size ) return NULL; len = 0; token[0] = 0; if( !data ) return NULL; // skip whitespace skipwhite: while(( c = ((unsigned char)*data)) <= ' ' ) { if( c == 0 ) return NULL; // end of file; if( c == '\n' ) newline = true; data++; } if( newline && !allowNewLines ) return data; newline = false; // skip // comments if( c == '/' && data[1] == '/' ) { while( *data && *data != '\n' ) data++; goto skipwhite; } // handle quoted strings specially if( c == '\"' ) { data++; while( 1 ) { c = (unsigned char)*data++; if( c == '\"' || !c ) { if( len < token_size ) token[len] = 0; return data; } if( len < token_size ) token[len] = c; len++; } } // parse single characters if( c == '{' || c == '}' || c == ')' || c == '(' || c == '\'' || c == ',' || c == '|' ) { if( len < token_size ) token[len] = c; len++; if( len < token_size ) token[len] = 0; else token[0] = 0; // string is too long return data + 1; } // parse a regular word do { if( len < token_size ) token[len] = c; data++; len++; c = ((unsigned char)*data); if( c == '{' || c == '}' || c == ')' || c == '(' || c == '\'' || c == ',' || c == '|' ) break; } while( c > 32 ); if( len < token_size ) token[len] = 0; else token[0] = 0; // string is too long return data; } /* ================= COM_SkipBracedSection The next token should be an open brace. Skips until a matching close brace is found. Internal brace depths are properly skipped. ================= */ char *COM_SkipBracedSection( char *pfile ) { char token[256]; int depth = 0; do { pfile = COM_ParseFile( pfile, token ); if( token[1] == 0 ) { if( token[0] == '{' ) depth++; else if( token[0] == '}' ) depth--; } } while( depth && pfile != NULL ); return pfile; } /* ============ COM_FileExtension ============ */ const char *COM_FileExtension( const char *in ) { const char *separator, *backslash, *colon, *dot; separator = Q_strrchr( in, '/' ); backslash = Q_strrchr( in, '\\' ); if( !separator || separator < backslash ) separator = backslash; colon = Q_strrchr( in, ':' ); if( !separator || separator < colon ) separator = colon; dot = Q_strrchr( in, '.' ); if( dot == NULL || ( separator && ( dot < separator ))) return ""; return dot + 1; } /* ================= COM_HashKey returns hash key for string ================= */ unsigned int COM_HashKey( const char *string, unsigned int hashSize ) { unsigned int hashKey = 0; for( int i = 0; string[i]; i++ ) hashKey = (hashKey + i) * 37 + Q_tolower( string[i] ); return (hashKey % hashSize); }
[ "a1ba.omarov@gmail.com" ]
a1ba.omarov@gmail.com
6e248fcfd03350d9df1e801796bf3ac0590eff2b
641fa8341d8c436ad24945bcbf8e7d7d1dd7dbb2
/chrome/browser/process_resource_usage.cc
4c2da5ba20409131d07189d8b085581102baefa3
[ "BSD-3-Clause" ]
permissive
massnetwork/mass-browser
7de0dfc541cbac00ffa7308541394bac1e945b76
67526da9358734698c067b7775be491423884339
refs/heads/master
2022-12-07T09:01:31.027715
2017-01-19T14:29:18
2017-01-19T14:29:18
73,799,690
4
4
BSD-3-Clause
2022-11-26T11:53:23
2016-11-15T09:49:29
null
UTF-8
C++
false
false
2,847
cc
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/process_resource_usage.h" #include <utility> #include "base/bind.h" #include "base/location.h" #include "base/logging.h" #include "base/single_thread_task_runner.h" #include "base/threading/thread_task_runner_handle.h" #include "chrome/common/resource_usage_reporter_type_converters.h" ProcessResourceUsage::ProcessResourceUsage( chrome::mojom::ResourceUsageReporterPtr service) : service_(std::move(service)), update_in_progress_(false) { service_.set_connection_error_handler( base::Bind(&ProcessResourceUsage::RunPendingRefreshCallbacks, base::Unretained(this))); } ProcessResourceUsage::~ProcessResourceUsage() { DCHECK(thread_checker_.CalledOnValidThread()); } void ProcessResourceUsage::RunPendingRefreshCallbacks() { DCHECK(thread_checker_.CalledOnValidThread()); auto task_runner = base::ThreadTaskRunnerHandle::Get(); for (const auto& callback : refresh_callbacks_) task_runner->PostTask(FROM_HERE, callback); refresh_callbacks_.clear(); } void ProcessResourceUsage::Refresh(const base::Closure& callback) { DCHECK(thread_checker_.CalledOnValidThread()); if (!service_ || service_.encountered_error()) { if (!callback.is_null()) base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, callback); return; } if (!callback.is_null()) refresh_callbacks_.push_back(callback); if (!update_in_progress_) { update_in_progress_ = true; service_->GetUsageData(base::Bind(&ProcessResourceUsage::OnRefreshDone, base::Unretained(this))); } } void ProcessResourceUsage::OnRefreshDone( chrome::mojom::ResourceUsageDataPtr data) { DCHECK(thread_checker_.CalledOnValidThread()); update_in_progress_ = false; stats_ = std::move(data); RunPendingRefreshCallbacks(); } bool ProcessResourceUsage::ReportsV8MemoryStats() const { DCHECK(thread_checker_.CalledOnValidThread()); if (stats_) return stats_->reports_v8_stats; return false; } size_t ProcessResourceUsage::GetV8MemoryAllocated() const { DCHECK(thread_checker_.CalledOnValidThread()); if (stats_ && stats_->reports_v8_stats) return stats_->v8_bytes_allocated; return 0; } size_t ProcessResourceUsage::GetV8MemoryUsed() const { DCHECK(thread_checker_.CalledOnValidThread()); if (stats_ && stats_->reports_v8_stats) return stats_->v8_bytes_used; return 0; } blink::WebCache::ResourceTypeStats ProcessResourceUsage::GetWebCoreCacheStats() const { DCHECK(thread_checker_.CalledOnValidThread()); if (stats_ && stats_->web_cache_stats) return stats_->web_cache_stats->To<blink::WebCache::ResourceTypeStats>(); return {}; }
[ "xElvis89x@gmail.com" ]
xElvis89x@gmail.com
233e816df46bcd902788566a3dd41edbc0d8f3bf
73ee941896043f9b3e2ab40028d24ddd202f695f
/external/chromium_org/content/renderer/dom_storage/webstoragenamespace_impl.cc
d5f1dc5bc8e3c36f6ecc42ce04429aeedd2d8004
[ "BSD-3-Clause" ]
permissive
CyFI-Lab-Public/RetroScope
d441ea28b33aceeb9888c330a54b033cd7d48b05
276b5b03d63f49235db74f2c501057abb9e79d89
refs/heads/master
2022-04-08T23:11:44.482107
2016-09-22T20:15:43
2016-09-22T20:15:43
58,890,600
5
3
null
null
null
null
UTF-8
C++
false
false
1,674
cc
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "content/renderer/dom_storage/webstoragenamespace_impl.h" #include "base/logging.h" #include "content/common/dom_storage/dom_storage_types.h" #include "content/renderer/dom_storage/webstoragearea_impl.h" #include "third_party/WebKit/public/platform/WebString.h" #include "url/gurl.h" using WebKit::WebStorageArea; using WebKit::WebStorageNamespace; using WebKit::WebString; namespace content { WebStorageNamespaceImpl::WebStorageNamespaceImpl() : namespace_id_(kLocalStorageNamespaceId) { } WebStorageNamespaceImpl::WebStorageNamespaceImpl( int64 namespace_id) : namespace_id_(namespace_id) { DCHECK_NE(kInvalidSessionStorageNamespaceId, namespace_id); } WebStorageNamespaceImpl::~WebStorageNamespaceImpl() { } WebStorageArea* WebStorageNamespaceImpl::createStorageArea( const WebString& origin) { return new WebStorageAreaImpl(namespace_id_, GURL(origin)); } WebStorageNamespace* WebStorageNamespaceImpl::copy() { // By returning NULL, we're telling WebKit to lazily fetch it the next time // session storage is used. In the WebViewClient::createView, we do the // book-keeping necessary to make it a true copy-on-write despite not doing // anything here, now. return NULL; } bool WebStorageNamespaceImpl::isSameNamespace( const WebStorageNamespace& other) const { const WebStorageNamespaceImpl* other_impl = static_cast<const WebStorageNamespaceImpl*>(&other); return namespace_id_ == other_impl->namespace_id_; } } // namespace content
[ "ProjectRetroScope@gmail.com" ]
ProjectRetroScope@gmail.com
d12c9a7b189779ac6a19a8cd77a856de5c1e03d7
803f2f69fd44905637222b9ca45c9bb5aea5ff5e
/undohist/!home!suehiro!C++!point.cpp
58ff5ff4d2121bbc9d4fd2edb35c67fb369310dd
[]
no_license
sue7ga/.emacs.d
e535429b405ace7aa517cb2864d63bf4da1913fc
4459e79ca888cc2a148fab445cd5d06f8e620468
refs/heads/master
2021-01-18T15:04:02.025873
2014-10-02T12:53:10
2014-10-02T12:53:10
null
0
0
null
null
null
null
UTF-8
C++
false
false
8,465
cpp
((digest . "2bd70268fae04fa82ced53bb9f187759") (undo-list nil (329 . 331) (t 21374 . 9151) nil (#("n" 0 1 (fontified t)) . 329) (t 21374 . 9149) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker* . 331) . 1) ((marker) . -1) nil (330 . 332) nil (329 . 330) (t 21374 . 7759) nil (329 . 331) (t 21374 . 7746) nil (229 . 230) (t 21374 . 7733) nil (#(" " 0 1 (symbol "d" fontified t)) . -156) (t 21374 . 7719) nil (323 . 324) nil (313 . 323) nil (311 . 313) (t 21374 . 7717) nil (310 . 311) nil (305 . 310) nil (303 . 305) nil (302 . 303) nil (300 . 302) nil (289 . 300) (#("get_pro" 0 7 (symbol "d" fontified t)) . -289) nil (#("c" 0 1 (symbol "d" fontified t)) . -296) nil (#("u" 0 1 (symbol "d" fontified t)) . -297) nil (#("t" 0 1 (symbol "d" fontified t)) . -298) nil (289 . 299) nil (#("p" 0 1 (symbol "d" fontified t)) . -289) nil (289 . 290) nil (288 . 289) nil (286 . 288) (t 21374 . 7702) nil (279 . 280) nil (#("席" 0 1 (fontified t face font-lock-string-face)) . -279) nil (279 . 281) nil (#("s" 0 1 (symbol "d" fontified t face font-lock-string-face)) . -279) nil (#("e" 0 1 (symbol "d" fontified t face font-lock-string-face)) . -280) nil (#("k" 0 1 (symbol "d" fontified t face font-lock-string-face)) . -281) nil (#("i" 0 1 (symbol "d" fontified t face font-lock-string-face)) . -282) nil (#("h" 0 1 (symbol "d" fontified t face font-lock-string-face)) . -283) nil (#("a" 0 1 (symbol "d" fontified t face font-lock-string-face)) . -284) nil (279 . 285) nil (#(" " 0 1 (symbol "d" fontified t face font-lock-string-face)) . -279) nil (#("s" 0 1 (symbol "d" fontified t face font-lock-string-face)) . -280) nil (#("e" 0 1 (symbol "d" fontified t face font-lock-string-face)) . -281) nil (#("k" 0 1 (symbol "d" fontified t face font-lock-string-face)) . -282) nil (#("i" 0 1 (symbol "d" fontified t face font-lock-string-face)) . -283) nil (280 . 284) nil (284 . 285) nil (282 . 284) nil (281 . 282) nil (279 . 280) nil (278 . 281) nil (276 . 278) nil (269 . 276) nil (267 . 269) (t 21374 . 7686) nil (264 . 265) nil (263 . 264) nil (262 . 263) nil (263 . 264) nil (261 . 263) nil (#("(" 0 1 (symbol "d" fontified t)) . -261) nil (261 . 262) nil (256 . 261) nil (255 . 256) nil (254 . 255) nil (#("=" 0 1 (symbol "d" fontified t)) . -254) nil (251 . 255) (t 21374 . 7674) nil (#(" " 0 1 (symbol "d" fontified t)) . -235) nil (#(" " 0 1 (symbol "d" fontified t)) . -236) (t 21374 . 7672) nil (231 . 237) (#(" " 0 4 (symbol "d" fontified nil)) . 231) (243 . 244) nil (231 . 243) nil (#(" " 0 1 (symbol "d" fontified t)) . -231) nil (#(" " 0 1 (symbol "d" fontified t)) . -232) nil (232 . 233) (t 21374 . 7666) nil (225 . 229) nil (222 . 225) nil (221 . 223) nil (219 . 221) nil (210 . 219) nil (213 . 215) (213 . 214) nil (209 . 213) nil (#("}" 0 1 (symbol "d" fontified t)) . -209) nil (#(" " 0 1 (symbol "d" fontified t)) . -210) nil (#(" " 0 1 (symbol "d" fontified t)) . -211) nil (210 . 212) nil (208 . 210) nil (207 . 208) nil (205 . 207) nil (204 . 205) nil (202 . 204) nil (#("i" 0 1 (symbol "d" fontified nil)) . -202) nil (#("f" 0 1 (symbol "d" fontified t face font-lock-keyword-face)) . -203) nil (200 . 204) nil (198 . 200) nil (197 . 198) nil (187 . 197) nil (#(" " 0 1 (symbol "d" fontified t)) . -187) nil (#("=" 0 1 (symbol "d" fontified t)) . -188) nil (183 . 189) nil (181 . 183) nil (180 . 181) nil (179 . 180) nil (178 . 179) nil (176 . 178) nil (#(" " 0 1 (symbol "d" fontified t)) . -176) nil (171 . 177) nil (172 . 173) nil (170 . 173) (t 21374 . 7636) nil (172 . 173) nil (169 . 172) nil (168 . 169) nil (166 . 168) nil (158 . 166) nil (#(" " 0 1 (symbol "d" fontified t)) . -158) nil (158 . 159) nil (155 . 158) (t 21374 . 7631) nil (154 . 155) nil (#(" " 0 1 (symbol "d" fontified t)) . -152) (t 21374 . 7628) nil (149 . 150) nil (148 . 149) nil (#(" " 0 1 (fontified t)) . -148) nil (#("j" 0 1 (fontified t)) . -149) nil (148 . 150) nil (147 . 148) nil (#(" " 0 1 (fontified t)) . -147) nil (146 . 148) nil (#("-" 0 1 (fontified t)) . -146) nil (139 . 147) nil (138 . 140) nil (#("O" 0 1 (fontified t)) . -138) nil (#("{" 0 1 (fontified t)) . -139) nil (139 . 140) nil (138 . 139) nil (#("}" 0 1 (fontified t)) . -138) ((marker*) . 1) ((marker) . -1) nil (138 . 139) nil (#("{" 0 1 (fontified t)) . -138) nil (#("P" 0 1 (fontified t)) . -139) nil (139 . 140) nil (138 . 139) nil (136 . 138) nil (#("I" 0 1 (fontified t face font-lock-variable-name-face)) . -136) nil (#("O" 0 1 (fontified t face font-lock-variable-name-face)) . -137) nil (136 . 138) nil (#("I" 0 1 (fontified t face font-lock-variable-name-face)) . -136) nil (#("O" 0 1 (fontified t face font-lock-variable-name-face)) . -137) nil (119 . 138) nil (117 . 119) (t 21374 . 7611) nil (115 . 116) nil (109 . 115) nil (108 . 109) nil (#(";" 0 1 (fontified t)) . -108) nil (#(" " 0 1 (fontified t)) . -109) nil (109 . 110) nil (108 . 109) nil (107 . 108) nil (#("1" 0 1 (fontified t)) . -107) nil (103 . 108) nil (#("a" 0 1 (fontified t)) . -103) nil (102 . 104) nil (#("]" 0 1 (fontified t)) . -103) ((marker*) . 1) ((marker) . -1) nil (103 . 104) nil (101 . 103) nil (95 . 100) nil (#("t" 0 1 (fontified t)) . -95) nil (#("i" 0 1 (fontified t)) . -96) nil (#("n" 0 1 (fontified t)) . -97) nil (95 . 98) nil (94 . 95) nil (89 . 94) nil (88 . 90) nil (nil rear-nonsticky nil 87 . 88) (nil fontified nil 83 . 88) (83 . 88) nil (#("set_i" 0 5 (fontified t face font-lock-variable-name-face)) . 88) (t 21374 . 7592) nil (93 . 94) 88 nil (88 . 93) nil (76 . 83) nil (74 . 76) nil (#(" " 0 2 (symbol "d" fontified nil)) . 67) (75 . 76) nil (#(" " 0 1 (symbol "d" fontified t)) . -75) nil (67 . 76) nil (65 . 68) (t 21374 . 7581) nil (64 . 65) nil (#("p" 0 1 (symbol "d" fontified t face font-lock-variable-name-face)) . -64) nil (#(";" 0 1 (symbol "d" fontified t)) . -65) nil (#(" " 0 1 (symbol "d" fontified t)) . -66) nil (#(" " 0 1 (symbol "d" fontified t)) . -67) ((marker . 66) . -1) ((marker . 66) . -1) nil (66 . 68) nil (65 . 66) nil (63 . 65) nil (62 . 63) nil (55 . 62) nil (54 . 56) (t 21374 . 7576) nil (56 . 57) nil (55 . 56) nil (53 . 55) nil (52 . 53) nil (42 . 52) nil (40 . 42) nil (39 . 40) nil (35 . 39) nil (26 . 35) (#("na" 0 1 (fontified nil face font-lock-type-face) 1 2 (fontified nil c-type c-decl-id-start face font-lock-type-face)) . -26) nil (26 . 28) nil (#("n" 0 1 (fontified nil c-type c-decl-id-start face font-lock-type-face)) . -26) nil (#("a" 0 1 (fontified nil c-type c-decl-id-start face font-lock-type-face)) . -27) nil (#("m" 0 1 (fontified nil c-type c-decl-id-start face font-lock-type-face)) . -28) nil (22 . 29) nil (#("g" 0 1 (fontified t)) . -22) nil (#("i" 0 1 (fontified t)) . -23) nil (#("n" 0 1 (fontified t)) . -24) nil (#(" " 0 1 (fontified t)) . -25) nil (#("n" 0 1 (fontified nil face font-lock-variable-name-face)) . -26) nil (#("a" 0 1 (fontified nil face font-lock-variable-name-face)) . -27) nil (#("m" 0 1 (fontified nil face font-lock-variable-name-face)) . -28) nil (20 . 29) nil (#("#" 0 1 (fontified t category c-cpp-delimiter c-is-sws t)) . -20) nil (20 . 21) nil (#(" " 0 1 (fontified t c-is-sws t)) . -20) nil (19 . 21) nil (18 . 19) nil (10 . 18) nil (#("s" 0 1 (fontified t c-in-sws t face font-lock-string-face)) . -10) nil (#("t" 0 1 (fontified nil c-in-sws t face font-lock-string-face)) . -11) nil (10 . 12) nil (#("s" 0 1 (fontified t c-in-sws t face font-lock-string-face)) . -10) nil (#("i" 0 1 (fontified t c-in-sws t face font-lock-string-face)) . -11) nil (#("t" 0 1 (fontified t face font-lock-string-face)) . -12) nil (10 . 13) nil (9 . 10) nil (2 . 9) nil (1 . 2) (t 21374 . 7554)))
[ "sue77ga@gmail.com" ]
sue77ga@gmail.com
7c8f80859a415d81a2b17bc6c406db9ad906785b
3fcbc5cc45cb7ce71ea8fd71aa52e6c8d9ff80ab
/20190923.cpp
fa67d598cbd20f9abd20d79136860482bdbdb927
[]
no_license
ploffer11/CPP
83a14601dcc11894bbf5e9b8df1a462f4c494b3a
c47160a9f3f474cee630af0c6e020c6a980c9ab6
refs/heads/master
2020-12-06T15:19:10.331008
2020-10-04T13:51:53
2020-10-04T13:51:53
232,493,338
0
0
null
null
null
null
UTF-8
C++
false
false
2,017
cpp
#include <bits/stdc++.h> #pragma GCC optimize("Ofast") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #define int long long using namespace std; using ll = long long; using pii = pair<int, int>; const int INF = 987654321; const int MOD = 1e9 + 7; int parent[7005]; int find(int me) { if (parent[me] < 0) return me; else return parent[me] = find(parent[me]); } void uni(int a, int b) { a = find(a), b = find(b); if (a != b) { parent[a] += parent[b]; parent[b] = a; } } int a[7005], b[7005]; bool flag[7005]; vector<int> group[7005]; vector<int> adj[7005]; main() { cin.tie(0); ios::sync_with_stdio(0); memset(parent, -1, sizeof(parent)); int n; cin >> n; for (int i = 1; i <= n; i++) cin >> a[i]; for (int i = 1; i <= n; i++) cin >> b[i]; vector<pii> edge; for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) { if (i == j) continue; if ((a[i] & a[j]) == a[i]) { flag[i] = true; edge.push_back({i, j}); adj[i].push_back(j); } } } for (int t = 0; t < n + 100; t++) { for (int i = 1; i <= n; i++) { if (!flag[i]) continue; bool f = false; for (auto e : adj[i]) { if (flag[e]) { f = true; break; } } flag[i] = f; } } for (auto [i, j] : edge) if (flag[i] && flag[j]) uni(i, j); for (int i = 1; i <= n; i++) group[find(i)].push_back(b[i]); ll ans = 0; for (int i = 1; i <= n; i++) { if (group[i].size() >= 2) { ll m = 0; for (auto j : group[i]) m += j; ans = max(ans, m); } } cout << ans; }
[ "ploffer11@naver.com" ]
ploffer11@naver.com
d98b3c663497da13f5673ffaf87b16debc1eb0f7
b4052809a4a08eb9ddc4551b6fc34ef61b90a24c
/frameworks/vtk.framework/Headers/vtkMapper.h
3c8d023874f026fd7c4702c8060892e58b555cb8
[]
no_license
9gel/hellopcl
548687167b0b17bd393b55f37e99d05207971a9e
19c39b39ad169c0a79b42cd72232d51b419f4f3d
refs/heads/master
2020-02-26T17:05:09.470167
2014-02-27T07:59:52
2014-02-27T07:59:52
17,192,517
21
5
null
null
null
null
UTF-8
C++
false
false
17,869
h
/*========================================================================= Program: Visualization Toolkit Module: vtkMapper.h Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ // .NAME vtkMapper - abstract class specifies interface to map data to graphics primitives // .SECTION Description // vtkMapper is an abstract class to specify interface between data and // graphics primitives. Subclasses of vtkMapper map data through a // lookuptable and control the creation of rendering primitives that // interface to the graphics library. The mapping can be controlled by // supplying a lookup table and specifying a scalar range to map data // through. // // There are several important control mechanisms affecting the behavior of // this object. The ScalarVisibility flag controls whether scalar data (if // any) controls the color of the associated actor(s) that refer to the // mapper. The ScalarMode ivar is used to determine whether scalar point data // or cell data is used to color the object. By default, point data scalars // are used unless there are none, in which cell scalars are used. Or you can // explicitly control whether to use point or cell scalar data. Finally, the // mapping of scalars through the lookup table varies depending on the // setting of the ColorMode flag. See the documentation for the appropriate // methods for an explanation. // // Another important feature of this class is whether to use immediate mode // rendering (ImmediateModeRenderingOn) or display list rendering // (ImmediateModeRenderingOff). If display lists are used, a data structure // is constructed (generally in the rendering library) which can then be // rapidly traversed and rendered by the rendering library. The disadvantage // of display lists is that they require additionally memory which may affect // the performance of the system. // // Another important feature of the mapper is the ability to shift the // z-buffer to resolve coincident topology. For example, if you'd like to // draw a mesh with some edges a different color, and the edges lie on the // mesh, this feature can be useful to get nice looking lines. (See the // ResolveCoincidentTopology-related methods.) // .SECTION See Also // vtkDataSetMapper vtkPolyDataMapper #ifndef __vtkMapper_h #define __vtkMapper_h #include "vtkRenderingCoreModule.h" // For export macro #include "vtkAbstractMapper3D.h" #include "vtkScalarsToColors.h" // For VTK_COLOR_MODE_DEFAULT and _MAP_SCALARS #define VTK_RESOLVE_OFF 0 #define VTK_RESOLVE_POLYGON_OFFSET 1 #define VTK_RESOLVE_SHIFT_ZBUFFER 2 #define VTK_GET_ARRAY_BY_ID 0 #define VTK_GET_ARRAY_BY_NAME 1 #define VTK_MATERIALMODE_DEFAULT 0 #define VTK_MATERIALMODE_AMBIENT 1 #define VTK_MATERIALMODE_DIFFUSE 2 #define VTK_MATERIALMODE_AMBIENT_AND_DIFFUSE 3 class vtkWindow; class vtkRenderer; class vtkActor; class vtkDataSet; class vtkFloatArray; class vtkImageData; class VTKRENDERINGCORE_EXPORT vtkMapper : public vtkAbstractMapper3D { public: vtkTypeMacro(vtkMapper,vtkAbstractMapper3D); void PrintSelf(ostream& os, vtkIndent indent); // Description: // Make a shallow copy of this mapper. void ShallowCopy(vtkAbstractMapper *m); // Description: // Overload standard modified time function. If lookup table is modified, // then this object is modified as well. unsigned long GetMTime(); // Description: // Method initiates the mapping process. Generally sent by the actor // as each frame is rendered. virtual void Render(vtkRenderer *ren, vtkActor *a) = 0; // Description: // Release any graphics resources that are being consumed by this mapper. // The parameter window could be used to determine which graphic // resources to release. virtual void ReleaseGraphicsResources(vtkWindow *) {}; // Description: // Specify a lookup table for the mapper to use. void SetLookupTable(vtkScalarsToColors *lut); vtkScalarsToColors *GetLookupTable(); // Description: // Create default lookup table. Generally used to create one when none // is available with the scalar data. virtual void CreateDefaultLookupTable(); // Description: // Turn on/off flag to control whether scalar data is used to color objects. vtkSetMacro(ScalarVisibility,int); vtkGetMacro(ScalarVisibility,int); vtkBooleanMacro(ScalarVisibility,int); // Description: // Turn on/off flag to control whether the mapper's data is static. Static data // means that the mapper does not propagate updates down the pipeline, greatly // decreasing the time it takes to update many mappers. This should only be // used if the data never changes. vtkSetMacro(Static,int); vtkGetMacro(Static,int); vtkBooleanMacro(Static,int); // Description: // Control how the scalar data is mapped to colors. By default // (ColorModeToDefault), unsigned char scalars are treated as colors, and // NOT mapped through the lookup table, while everything else is. Setting // ColorModeToMapScalars means that all scalar data will be mapped through // the lookup table. (Note that for multi-component scalars, the // particular component to use for mapping can be specified using the // SelectColorArray() method.) vtkSetMacro(ColorMode,int); vtkGetMacro(ColorMode,int); void SetColorModeToDefault() {this->SetColorMode(VTK_COLOR_MODE_DEFAULT);}; void SetColorModeToMapScalars() {this->SetColorMode(VTK_COLOR_MODE_MAP_SCALARS);}; // Description: // Return the method of coloring scalar data. const char *GetColorModeAsString(); // Description: // By default, vertex color is used to map colors to a surface. // Colors are interpolated after being mapped. // This option avoids color interpolation by using a one dimensional // texture map for the colors. vtkSetMacro(InterpolateScalarsBeforeMapping,int); vtkGetMacro(InterpolateScalarsBeforeMapping,int); vtkBooleanMacro(InterpolateScalarsBeforeMapping,int); // Description: // Control whether the mapper sets the lookuptable range based on its // own ScalarRange, or whether it will use the LookupTable ScalarRange // regardless of it's own setting. By default the Mapper is allowed to set // the LookupTable range, but users who are sharing LookupTables between // mappers/actors will probably wish to force the mapper to use the // LookupTable unchanged. vtkSetMacro(UseLookupTableScalarRange,int); vtkGetMacro(UseLookupTableScalarRange,int); vtkBooleanMacro(UseLookupTableScalarRange,int); // Description: // Specify range in terms of scalar minimum and maximum (smin,smax). These // values are used to map scalars into lookup table. Has no effect when // UseLookupTableScalarRange is true. vtkSetVector2Macro(ScalarRange,double); vtkGetVectorMacro(ScalarRange,double,2); // Description: // Turn on/off flag to control whether data is rendered using // immediate mode or note. Immediate mode rendering // tends to be slower but it can handle larger datasets. // The default value is immediate mode off. If you are // having problems rendering a large dataset you might // want to consider using immediate more rendering. vtkSetMacro(ImmediateModeRendering,int); vtkGetMacro(ImmediateModeRendering,int); vtkBooleanMacro(ImmediateModeRendering,int); // Description: // Turn on/off flag to control whether data is rendered using // immediate mode or note. Immediate mode rendering // tends to be slower but it can handle larger datasets. // The default value is immediate mode off. If you are // having problems rendering a large dataset you might // want to consider using immediate more rendering. static void SetGlobalImmediateModeRendering(int val); static void GlobalImmediateModeRenderingOn() {vtkMapper::SetGlobalImmediateModeRendering(1);}; static void GlobalImmediateModeRenderingOff() {vtkMapper::SetGlobalImmediateModeRendering(0);}; static int GetGlobalImmediateModeRendering(); //BTX // Description: // Force compile only mode in case display lists are used // (ImmediateModeRendering is false). If ImmediateModeRendering is true, // no rendering happens. Changing the value of this flag does not change // modified time of the mapper. Initial value is false. // This can be used by another rendering class which also uses display lists // (call of display lists can be nested but not their creation.) // There is no good reason to expose it to wrappers. vtkGetMacro(ForceCompileOnly,int); void SetForceCompileOnly(int value); //ETX // Description: // Control how the filter works with scalar point data and cell attribute // data. By default (ScalarModeToDefault), the filter will use point data, // and if no point data is available, then cell data is used. Alternatively // you can explicitly set the filter to use point data // (ScalarModeToUsePointData) or cell data (ScalarModeToUseCellData). // You can also choose to get the scalars from an array in point field // data (ScalarModeToUsePointFieldData) or cell field data // (ScalarModeToUseCellFieldData). If scalars are coming from a field // data array, you must call SelectColorArray before you call // GetColors. // When ScalarMode is set to use Field Data (ScalarModeToFieldData), you // must call SelectColorArray to choose the field data array to be used to // color cells. In this mode, if the poly data has triangle strips, // the field data is treated as the celldata for each mini-cell formed by // a triangle in the strip rather than the entire strip. vtkSetMacro(ScalarMode,int); vtkGetMacro(ScalarMode,int); void SetScalarModeToDefault() { this->SetScalarMode(VTK_SCALAR_MODE_DEFAULT);}; void SetScalarModeToUsePointData() { this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_DATA);}; void SetScalarModeToUseCellData() { this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_DATA);}; void SetScalarModeToUsePointFieldData() { this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_FIELD_DATA);}; void SetScalarModeToUseCellFieldData() { this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_FIELD_DATA);}; void SetScalarModeToUseFieldData() { this->SetScalarMode(VTK_SCALAR_MODE_USE_FIELD_DATA); } // Description: // When ScalarMode is set to UsePointFieldData or UseCellFieldData, // you can specify which array to use for coloring using these methods. // The lookup table will decide how to convert vectors to colors. void SelectColorArray(int arrayNum); void SelectColorArray(const char* arrayName); // Description: // Legacy: // These methods used to be used to specify the array component. // It is better to do this in the lookup table. void ColorByArrayComponent(int arrayNum, int component); void ColorByArrayComponent(const char* arrayName, int component); // Description: // Get the array name or number and component to color by. char* GetArrayName() { return this->ArrayName; } int GetArrayId() { return this->ArrayId; } int GetArrayAccessMode() { return this->ArrayAccessMode; } int GetArrayComponent() { return this->ArrayComponent; } // Description: // Return the method for obtaining scalar data. const char *GetScalarModeAsString(); // Description: // Set/Get a global flag that controls whether coincident topology (e.g., a // line on top of a polygon) is shifted to avoid z-buffer resolution (and // hence rendering problems). If not off, there are two methods to choose // from. PolygonOffset uses graphics systems calls to shift polygons, but // does not distinguish vertices and lines from one another. ShiftZBuffer // remaps the z-buffer to distinguish vertices, lines, and polygons, but // does not always produce acceptable results. If you use the ShiftZBuffer // approach, you may also want to set the ResolveCoincidentTopologyZShift // value. (Note: not all mappers/graphics systems implement this // functionality.) static void SetResolveCoincidentTopology(int val); static int GetResolveCoincidentTopology(); static void SetResolveCoincidentTopologyToDefault(); static void SetResolveCoincidentTopologyToOff() {SetResolveCoincidentTopology(VTK_RESOLVE_OFF);} static void SetResolveCoincidentTopologyToPolygonOffset() {SetResolveCoincidentTopology(VTK_RESOLVE_POLYGON_OFFSET);} static void SetResolveCoincidentTopologyToShiftZBuffer() {SetResolveCoincidentTopology(VTK_RESOLVE_SHIFT_ZBUFFER);} // Description: // Used to set the polygon offset scale factor and units. // Used when ResolveCoincidentTopology is set to PolygonOffset. // These are global variables. static void SetResolveCoincidentTopologyPolygonOffsetParameters( double factor, double units); static void GetResolveCoincidentTopologyPolygonOffsetParameters( double& factor, double& units); // Description: // Used when ResolveCoincidentTopology is set to PolygonOffset. The polygon // offset can be applied either to the solid polygonal faces or the // lines/vertices. When set (default), the offset is applied to the faces // otherwise it is applied to lines and vertices. // This is a global variable. static void SetResolveCoincidentTopologyPolygonOffsetFaces(int faces); static int GetResolveCoincidentTopologyPolygonOffsetFaces(); // Description: // Used to set the z-shift if ResolveCoincidentTopology is set to // ShiftZBuffer. This is a global variable. static void SetResolveCoincidentTopologyZShift(double val); static double GetResolveCoincidentTopologyZShift(); // Description: // Return bounding box (array of six doubles) of data expressed as // (xmin,xmax, ymin,ymax, zmin,zmax). virtual double *GetBounds(); virtual void GetBounds(double bounds[6]) {this->vtkAbstractMapper3D::GetBounds(bounds);}; // Description: // This instance variable is used by vtkLODActor to determine which // mapper to use. It is an estimate of the time necessary to render. // Setting the render time does not modify the mapper. void SetRenderTime(double time) {this->RenderTime = time;} vtkGetMacro(RenderTime, double); //BTX // Description: // Get the input as a vtkDataSet. This method is overridden in // the specialized mapper classes to return more specific data types. vtkDataSet *GetInput(); //ETX // Description: // Get the input to this mapper as a vtkDataSet, instead of as a // more specialized data type that the subclass may return from // GetInput(). This method is provided for use in the wrapper languages, // C++ programmers should use GetInput() instead. vtkDataSet *GetInputAsDataSet() {return this->GetInput();} // Description: // Map the scalars (if there are any scalars and ScalarVisibility is on) // through the lookup table, returning an unsigned char RGBA array. This is // typically done as part of the rendering process. The alpha parameter // allows the blending of the scalars with an additional alpha (typically // which comes from a vtkActor, etc.) vtkUnsignedCharArray *MapScalars(double alpha); // Description: // Set/Get the light-model color mode. vtkSetMacro(ScalarMaterialMode,int); vtkGetMacro(ScalarMaterialMode,int); void SetScalarMaterialModeToDefault() {this->SetScalarMaterialMode(VTK_MATERIALMODE_DEFAULT);}; void SetScalarMaterialModeToAmbient() {this->SetScalarMaterialMode(VTK_MATERIALMODE_AMBIENT);}; void SetScalarMaterialModeToDiffuse() {this->SetScalarMaterialMode(VTK_MATERIALMODE_DIFFUSE);}; void SetScalarMaterialModeToAmbientAndDiffuse() {this->SetScalarMaterialMode(VTK_MATERIALMODE_AMBIENT_AND_DIFFUSE);}; // Description: // Return the light-model color mode. const char *GetScalarMaterialModeAsString(); // Description: // Returns if the mapper does not expect to have translucent geometry. This // may happen when using ColorMode is set to not map scalars i.e. render the // scalar array directly as colors and the scalar array has opacity i.e. alpha // component. Default implementation simply returns true. Note that even if // this method returns true, an actor may treat the geometry as translucent // since a constant translucency is set on the property, for example. virtual bool GetIsOpaque() { return true; } // Description: // WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE // DO NOT USE THIS METHOD OUTSIDE OF THE RENDERING PROCESS // Used by vtkHardwareSelector to determine if the prop supports hardware // selection. virtual bool GetSupportsSelection() { return false; } protected: vtkMapper(); ~vtkMapper(); vtkUnsignedCharArray *Colors; // Use texture coordinates for coloring. int InterpolateScalarsBeforeMapping; // Coordinate for each point. vtkFloatArray *ColorCoordinates; // 1D ColorMap used for the texture image. vtkImageData* ColorTextureMap; void MapScalarsToTexture(vtkDataArray* scalars, double alpha); vtkScalarsToColors *LookupTable; int ScalarVisibility; vtkTimeStamp BuildTime; double ScalarRange[2]; int UseLookupTableScalarRange; int ImmediateModeRendering; int ColorMode; int ScalarMode; int ScalarMaterialMode; double RenderTime; // for coloring by a component of a field data array int ArrayId; char ArrayName[256]; int ArrayComponent; int ArrayAccessMode; int Static; int ForceCompileOnly; private: vtkMapper(const vtkMapper&); // Not implemented. void operator=(const vtkMapper&); // Not implemented. }; #endif
[ "nigel@vannevartech.com" ]
nigel@vannevartech.com
914b5534211777399bf8177b9f0fc2c3cc040a86
8eec517a28de5f53164d9791b265e62e117935c0
/symbol.hpp
b3f79f597893c6f6bb171d9926bf4695bba9dc3f
[]
no_license
rlt3/repartee
8aa63ecc22a59d26a8ed224ef045a9a213f50fd3
56cc624ecd4f0586720f2531922feb98854e98d9
refs/heads/master
2020-05-22T19:48:48.620287
2019-06-08T20:32:49
2019-06-08T20:32:49
186,499,402
0
0
null
null
null
null
UTF-8
C++
false
false
6,245
hpp
#pragma once #include "expression.hpp" #include <assert.h> /* * If all 'types' are defined by their storage sizes then there should be a * common interface for storage. Thus common types (int, floats, bytes) can get * pre-baked constructors whereas more complex types need a constructor with * size information. This size information is kept within the symbol itself so * it can remain dynamic within the VM but explicit in the final bytecode. */ typedef uint8_t Byte; class Storage { public: Storage (int value) : stride(1) { resize(sizeof(int)); set(0, value); } Storage (double value) : stride(1) { resize(sizeof(double)); set(0, value); } Storage (void *value) : stride(1) { resize(sizeof(void*)); set(0, value); } Storage (const unsigned size, const unsigned stride) { resize(size); /* * TODO: figure out how to create structure types * e.g { int, void*, int[10] } */ } void resize (const unsigned num_bytes) { /* 0 initializes all memory */ size = num_bytes; container.resize(num_bytes); } /* * Containers are meant to be byte addressable so the index is which byte * to access. From the address of the first byte in the container we add * the index. Then we cast that index into whichever type. Before we do all * this we make sure that the index exists and also there's enough bytes to * handle a read at that index. This holds for both the 'get' methods and * set method. */ int integer_at (const unsigned index) const { assert(index + sizeof(int) <= container.size()); return *(reinterpret_cast<const int*>(&container[0] + index)); } double floating_at (const unsigned index) const { assert(index + sizeof(double) <= container.size()); return *(reinterpret_cast<const double*>(&container[0] + index)); } void* ptr_at (const unsigned index) const { assert(index + sizeof(void*) <= container.size()); return *(reinterpret_cast<void* const*>(&container[0] + index)); } void set (unsigned index, int val) { assert(index + sizeof(int) <= container.size()); *(reinterpret_cast<int*>(&container[0] + index)) = val; } void set (unsigned index, double val) { assert(index + sizeof(double) <= container.size()); *(reinterpret_cast<double*>(&container[0] + index)) = val; } void set (unsigned index, void *val) { assert(index + sizeof(void*) <= container.size()); *(reinterpret_cast<void**>(&container[0] + index)) = val; } protected: /* * Guaranteed by the standard to have contiguous memory blocks. Therefore * it can be byte addressable and also dynamic because it is a container. */ std::vector<Byte> container; unsigned size; unsigned stride; }; typedef enum _SymbolType { INTEGER, DOUBLE, REFERENCE, FUNCTION, CHUNK /* contiguous block of memory */ } SymbolType; /* * A symbol essentially defines something in the program. Whether it be a * function, integer, or some complex structure, there should be some symbol * that acts as a handle to it. */ class Symbol { public: Symbol (int val) : symtype(INTEGER) , storage(Storage(val)) , was_allocated(false) { } Symbol (double val) : symtype(DOUBLE) , storage(Storage(val)) , was_allocated(false) { } Symbol (Symbol *val) : symtype(REFERENCE) , storage(Storage(val)) , was_allocated(false) { } Symbol (Expression *val) : symtype(FUNCTION) , storage(Storage(val)) , was_allocated(false) { } Symbol (unsigned size, unsigned stride) : symtype(CHUNK) , storage(Storage(size, stride)) , was_allocated(false) { } Symbol (const Symbol &other, bool was_allocated) : symtype(other.symtype) , storage(other.storage) , was_allocated(was_allocated) { } /* * Create a new Symbol that's a clone of this one. This is how to allocate * Symbols and how symbols are typed allocated. */ Symbol* allocate () const { return new Symbol(*this, true); } bool is_allocated () const { return was_allocated; } SymbolType type () const { return symtype; } /* * Return the value of the symbol iff it is the right type. */ int integer_at (unsigned index) const { return storage.integer_at(index); } double floating_at (unsigned index) const { return storage.floating_at(index); } Expression* expr_at (unsigned index) const { return (Expression*) storage.ptr_at(index); } Symbol* ref_at (unsigned index) const { return (Symbol*) storage.ptr_at(index); } /* * Quality-of-Life methods for non-chunk access of values. */ int integer () const { assert(symtype == INTEGER); return integer_at(0); } float floating () const { assert(symtype == DOUBLE); return floating_at(0); } Expression* expr () const { assert(symtype == FUNCTION); return expr_at(0); } Symbol* ref () const { assert(symtype == REFERENCE); return ref_at(0); } /* * Only accept indexes > 0 if the type is a chunk. */ void set (unsigned index, int val) { assert(index == 0 || (index >= 0 && symtype == CHUNK)); storage.set(index, val); } void set (unsigned index, double val) { assert(index == 0 || (index >= 0 && symtype == CHUNK)); storage.set(index, val); } void set (unsigned index, void *val) { assert(index == 0 || (index >= 0 && symtype == CHUNK)); storage.set(index, val); } protected: SymbolType symtype; Storage storage; bool was_allocated; };
[ "rlt3@utk.edu" ]
rlt3@utk.edu
55eeb7e1ccdddf8974d1f03baf85456616c4d7b5
5b1812e709fb0d253d6fce2b0b4a9579a055e4d1
/Crusaders/Crusaders/BeatmapReadSection.hpp
2161b10499ebdc0d00c16c44cc1fe007fc6ae259
[]
no_license
maxrchung/Crusaders
29df061a52ed94b012d1944c68db10aac15929b4
9a0e9ecc3004cbc42db0e2ac2145f51a965137dc
refs/heads/master
2020-01-23T22:04:02.281278
2017-06-07T14:27:29
2017-06-07T14:27:29
74,705,061
0
0
null
null
null
null
UTF-8
C++
false
false
169
hpp
#pragma once namespace BeatmapReadSection { enum Section { None, General, Editor, Metadata, Difficulty, Events, TimingPoints, HitObjects, Count }; }
[ "maxrchung@gmail.com" ]
maxrchung@gmail.com
1876385cf50c1b17f5865c39dd2bd36e6335f2a0
083fc8944a4460f70e9083bcd3be0ab48efb1794
/apps/device/integration/kernels/app_intg_rdc_8to4.cpp
39c4afcc39637eec11d7c58101d6dbf31ba88113
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
zainryan/INSIDER-System
db71987f6d5b2ef8d2636ddbbcea258d9b842291
748b1c4df4fc2c508451e15f6883b08dd94696ad
refs/heads/master
2021-06-30T23:31:50.782462
2020-11-06T18:45:32
2020-11-06T18:45:32
189,896,803
37
13
MIT
2020-11-06T18:45:33
2019-06-02T21:26:10
Coq
UTF-8
C++
false
false
1,055
cpp
#ifndef APP_INTG_RDC8_CPP_ #define APP_INTG_RDC8_CPP_ #include <insider_kernel.h> #include "constant.h" #include "structure.h" void app_intg_rdc_8to4(ST_Queue<APP_Reduce_Record8> &app_intg_rdc_input_8to4, ST_Queue<APP_Reduce_Record4> &app_intg_rdc_input_4to2) { while (1) { #pragma HLS pipeline APP_Reduce_Record8 record_in; #pragma HLS array_partition variable = record_in.record complete APP_Reduce_Record4 record_out; #pragma HLS array_partition variable = record_out.record complete if (app_intg_rdc_input_8to4.read_nb(record_in)) { if (record_in.valid) { for (int i = 0; i < 8; i += 2) { #pragma HLS unroll record_out.overlap[i / 2] = record_in.overlap[i] + record_in.overlap[i + 1]; } for (int i = 0; i < 64; i++) { #pragma HLS unroll record_out.record[i] = record_in.record[i]; } } record_out.eop = record_in.eop; record_out.valid = record_in.valid; app_intg_rdc_input_4to2.write(record_out); } } } #endif
[ "rzyrzyrzy2014@gmail.com" ]
rzyrzyrzy2014@gmail.com
eca5f657d8cd8e81fc0f9450057b360d6433f2a9
23dd9d94f20f52fe405b7ac96ea05e0db943e718
/PAO/ownerdata.cpp
9063e7210fc8d1f8877565aac714563a1bc1f219
[]
no_license
fedsib/pao-project
c44d7ed19839ec50f47e19a303e152d94869cfaa
83744a04892c792c0908acdcea0f7031322f2c2c
refs/heads/master
2021-03-27T16:39:13.872401
2017-01-01T11:12:40
2017-01-01T11:12:40
24,765,166
0
0
null
null
null
null
UTF-8
C++
false
false
1,037
cpp
#include "ownerdata.h" OwnerData::OwnerData(){} OwnerData::OwnerData(const QString& n, const QString& s, const ContactInfo& ci) : name(n), surname(s), contacts(ci){} OwnerData::OwnerData(const QJsonObject& js) : name(js["name"].toString()), surname(js["surname"].toString()){ contacts.setAddress(js["address"].toString()); contacts.setMail(js["mail"].toString()); contacts.setPhone(js["phone"].toString()); } QString OwnerData::getName() const{ return name; } QString OwnerData::getSurname() const{ return surname; } ContactInfo OwnerData::getContacts() const{ return contacts; } void OwnerData::setName(const QString& n){ name = n; } void OwnerData::setSurname(const QString& s){ surname = s; } void OwnerData::setContacts(const QString& a, const QString& m, const QString& p){ contacts.setAddress(a); contacts.setMail(m); contacts.setPhone(p); } void OwnerData::saveOwnerDataToFile(QJsonObject& js){ js["name"] = name; js["surname"] = surname; this->contacts.ContactInfo::saveContactToFile(js); }
[ "fedsib@users.noreply.github.com" ]
fedsib@users.noreply.github.com
92356c2ac13198d3286e205f6e36872321a52bba
2bb5ffa26516d667a3116d1f772f21b5abad1dcc
/oop/exam_again/main_gui.cpp
0aa22a97abfa7b5266e2b6c959d818a3092102e8
[]
no_license
Demon000/uni
71a0c8d26ae1a6024f2215f4105dc8daee3c1bb5
7735fc90b17f452879bfca4b0e4e8c2c4e80831f
refs/heads/master
2022-08-14T03:08:51.029670
2021-12-15T16:50:06
2021-12-15T16:51:09
154,342,332
0
4
null
2022-07-21T08:25:57
2018-10-23T14:26:35
Jupyter Notebook
UTF-8
C++
false
false
425
cpp
#include "repositories/TTTTableRepository.h" #include "services/TTTTableService.h" #include "ui/MainWindow.h" #include <QApplication> int main(int argc, char **argv) { QApplication app(argc, argv); TTTTableRepository repository{"tables.csv"}; TTTTableValidator validator; TTTTableService service{repository, validator}; MainWindow mainWindow{service}; mainWindow.show(); return app.exec(); }
[ "demonsingur@gmail.com" ]
demonsingur@gmail.com
f6c7c03560c8925ea0e3fd10933ccb433e9186c8
27e5cf7dc7fc8ff3b39d06e6d742a6667347026f
/EX13/file_server/file_server/main.cpp
7a05fbea97dac088eb607282713c727574ee0686
[]
no_license
KennEskildsen/I4IKN
56668396a42a8fba9e8144e1a8f9a0573c1d1aea
62fe2a711517b526f8fea845f1168c6be9320739
refs/heads/master
2021-01-18T11:15:50.931481
2015-12-01T13:00:36
2015-12-01T13:00:36
42,582,660
0
0
null
null
null
null
UTF-8
C++
false
false
2,042
cpp
#include <iostream> #include <fstream> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include "Transport.h" #define BUFSIZE 1000 using namespace std; Transport::Transport *transportlayer; int testIfFileExist(const char* fileName,int length){ char buf[length]; memcpy(buf, fileName, length); buf[length-1]=0; FILE *fp = fopen(buf,"r"); if(fp==NULL){ return 0; } fclose(fp); return 1; } void sendFile(const char* fileName, int length, Transport::Transport *transportlayer_) { // Fil der ønskes afsendt char buf[length]; memcpy(buf, fileName, length); buf[length-1]=0; int fd = open(buf, O_RDONLY); if(fd == 0) { printf("\nError opening file\n"); return; } // data læses fra filen og afsendes while(1) { // Data brydes op i BUF_SIZE stykker char buff[BUFSIZE]={0}; int nread = read(fd,buff,BUFSIZE); printf("Bytes read %d \n", nread); // Hvis læsning lykkes afsendes filen if(nread > 0) { printf("Sending \n"); transportlayer_->send(buff,nread); } else { printf("File sent \n"); break; } } } int main(int argc, char** argv) { char buffer[BUFSIZE]; int n; transportlayer = new Transport::Transport(BUFSIZE); //Hvilken fil skal sendes? n = transportlayer->receive(buffer, BUFSIZE); printf("File to send: '%s'\n",buffer); // Test om filen eksisterer if (testIfFileExist(buffer,n)==0) { char buf[]="ERROR file does not exist\n"; transportlayer->send(buf,26); cout<<"ERROR file does not exist"<<endl; exit(1); } else { char buf[]="Ok"; transportlayer->send(buf,2); } sleep(1); sendFile(buffer,n,transportlayer); //Luk forbindelsen return 0; }
[ "karstenschoun@gmail.com" ]
karstenschoun@gmail.com
7e59f76a4d884c402319f12d154e15bd8be17970
4181356d79c13215b91f9cbe68ae701df1593661
/examples/expand_tabs/main.cpp
fc065fe71056f64506606919ab10839bb394a19c
[ "Unlicense" ]
permissive
lostjared/cplusplus17.Examples
5f68f87d36bc0394d6b54341a798cfb01a517ab1
7b4a22f7dd44410df9d2aeae4a6239b1852d59e5
refs/heads/master
2023-03-08T14:13:58.511044
2023-02-24T20:46:27
2023-02-24T20:46:27
98,051,532
20
7
null
2018-10-19T00:59:19
2017-07-22T18:49:51
C++
UTF-8
C++
false
false
1,267
cpp
// Arguments take the form of // --switch=value // --file=input-filename // --num=number of spaces #include<iostream> #include<fstream> #include"cmd-switch.hpp" int main(int argc, char **argv) { try { cmd::ArgumentList<std::string> argz(argc, argv); std::string filename; argz.require("--file", filename, "input filename"); std::string num; argz.require("--num", num, "number of spaces"); int num_spaces = atoi(num.c_str()); if(num_spaces <= 0) { std::cerr << "Requires Greater than Zero value for spaces.\n"; exit(EXIT_FAILURE); } std::fstream file; file.open(filename, std::ios::in); if(!file.is_open()) { std::cerr << "Error could not open file: " << filename << "\n"; exit(EXIT_FAILURE); } while(!file.eof()) { char c = file.get(); if(c == '\t') { for(int i = 0; i < num_spaces; ++i) { std::cout << " "; } } else { std::cout << c; } } file.close(); } catch(cmd::ArgExcep<std::string> &e) { std::cerr << e.what() << "\n"; } return 0; }
[ "jaredbruni@gmail.com" ]
jaredbruni@gmail.com
94b70d106470bca82adb351e030bbaff3976d297
ac1c9fbc1f1019efb19d0a8f3a088e8889f1e83c
/out/release/gen/v8/torque-generated/src/objects/ordered-hash-table-tq-csa.cc
dfa327a63ffb99436effc7aceb63d0213f7aea20
[ "BSD-3-Clause" ]
permissive
xueqiya/chromium_src
5d20b4d3a2a0251c063a7fb9952195cda6d29e34
d4aa7a8f0e07cfaa448fcad8c12b29242a615103
refs/heads/main
2022-07-30T03:15:14.818330
2021-01-16T16:47:22
2021-01-16T16:47:22
330,115,551
1
0
null
null
null
null
UTF-8
C++
false
false
70,407
cc
#include "src/builtins/builtins-array-gen.h" #include "src/builtins/builtins-bigint-gen.h" #include "src/builtins/builtins-collections-gen.h" #include "src/builtins/builtins-constructor-gen.h" #include "src/builtins/builtins-data-view-gen.h" #include "src/builtins/builtins-iterator-gen.h" #include "src/builtins/builtins-promise-gen.h" #include "src/builtins/builtins-promise.h" #include "src/builtins/builtins-proxy-gen.h" #include "src/builtins/builtins-regexp-gen.h" #include "src/builtins/builtins-string-gen.h" #include "src/builtins/builtins-typed-array-gen.h" #include "src/builtins/builtins-utils-gen.h" #include "src/builtins/builtins.h" #include "src/codegen/code-factory.h" #include "src/heap/factory-inl.h" #include "src/objects/arguments.h" #include "src/objects/bigint.h" #include "src/objects/elements-kind.h" #include "src/objects/free-space.h" #include "src/objects/js-break-iterator.h" #include "src/objects/js-collator.h" #include "src/objects/js-date-time-format.h" #include "src/objects/js-display-names.h" #include "src/objects/js-generator.h" #include "src/objects/js-list-format.h" #include "src/objects/js-locale.h" #include "src/objects/js-number-format.h" #include "src/objects/js-objects.h" #include "src/objects/js-plural-rules.h" #include "src/objects/js-promise.h" #include "src/objects/js-regexp-string-iterator.h" #include "src/objects/js-relative-time-format.h" #include "src/objects/js-segment-iterator.h" #include "src/objects/js-segmenter.h" #include "src/objects/js-weak-refs.h" #include "src/objects/objects.h" #include "src/objects/ordered-hash-table.h" #include "src/objects/property-array.h" #include "src/objects/property-descriptor-object.h" #include "src/objects/source-text-module.h" #include "src/objects/stack-frame-info.h" #include "src/objects/synthetic-module.h" #include "src/objects/template-objects.h" #include "src/torque/runtime-support.h" #include "torque-generated/src/builtins/array-copywithin-tq-csa.h" #include "torque-generated/src/builtins/array-every-tq-csa.h" #include "torque-generated/src/builtins/array-filter-tq-csa.h" #include "torque-generated/src/builtins/array-find-tq-csa.h" #include "torque-generated/src/builtins/array-findindex-tq-csa.h" #include "torque-generated/src/builtins/array-foreach-tq-csa.h" #include "torque-generated/src/builtins/array-from-tq-csa.h" #include "torque-generated/src/builtins/array-isarray-tq-csa.h" #include "torque-generated/src/builtins/array-join-tq-csa.h" #include "torque-generated/src/builtins/array-lastindexof-tq-csa.h" #include "torque-generated/src/builtins/array-map-tq-csa.h" #include "torque-generated/src/builtins/array-of-tq-csa.h" #include "torque-generated/src/builtins/array-reduce-right-tq-csa.h" #include "torque-generated/src/builtins/array-reduce-tq-csa.h" #include "torque-generated/src/builtins/array-reverse-tq-csa.h" #include "torque-generated/src/builtins/array-shift-tq-csa.h" #include "torque-generated/src/builtins/array-slice-tq-csa.h" #include "torque-generated/src/builtins/array-some-tq-csa.h" #include "torque-generated/src/builtins/array-splice-tq-csa.h" #include "torque-generated/src/builtins/array-unshift-tq-csa.h" #include "torque-generated/src/builtins/array-tq-csa.h" #include "torque-generated/src/builtins/base-tq-csa.h" #include "torque-generated/src/builtins/bigint-tq-csa.h" #include "torque-generated/src/builtins/boolean-tq-csa.h" #include "torque-generated/src/builtins/builtins-string-tq-csa.h" #include "torque-generated/src/builtins/collections-tq-csa.h" #include "torque-generated/src/builtins/cast-tq-csa.h" #include "torque-generated/src/builtins/convert-tq-csa.h" #include "torque-generated/src/builtins/console-tq-csa.h" #include "torque-generated/src/builtins/data-view-tq-csa.h" #include "torque-generated/src/builtins/frames-tq-csa.h" #include "torque-generated/src/builtins/frame-arguments-tq-csa.h" #include "torque-generated/src/builtins/growable-fixed-array-tq-csa.h" #include "torque-generated/src/builtins/internal-coverage-tq-csa.h" #include "torque-generated/src/builtins/iterator-tq-csa.h" #include "torque-generated/src/builtins/math-tq-csa.h" #include "torque-generated/src/builtins/number-tq-csa.h" #include "torque-generated/src/builtins/object-fromentries-tq-csa.h" #include "torque-generated/src/builtins/object-tq-csa.h" #include "torque-generated/src/builtins/promise-abstract-operations-tq-csa.h" #include "torque-generated/src/builtins/promise-all-tq-csa.h" #include "torque-generated/src/builtins/promise-all-element-closure-tq-csa.h" #include "torque-generated/src/builtins/promise-constructor-tq-csa.h" #include "torque-generated/src/builtins/promise-finally-tq-csa.h" #include "torque-generated/src/builtins/promise-misc-tq-csa.h" #include "torque-generated/src/builtins/promise-race-tq-csa.h" #include "torque-generated/src/builtins/promise-reaction-job-tq-csa.h" #include "torque-generated/src/builtins/promise-resolve-tq-csa.h" #include "torque-generated/src/builtins/promise-then-tq-csa.h" #include "torque-generated/src/builtins/promise-jobs-tq-csa.h" #include "torque-generated/src/builtins/proxy-constructor-tq-csa.h" #include "torque-generated/src/builtins/proxy-delete-property-tq-csa.h" #include "torque-generated/src/builtins/proxy-get-property-tq-csa.h" #include "torque-generated/src/builtins/proxy-get-prototype-of-tq-csa.h" #include "torque-generated/src/builtins/proxy-has-property-tq-csa.h" #include "torque-generated/src/builtins/proxy-is-extensible-tq-csa.h" #include "torque-generated/src/builtins/proxy-prevent-extensions-tq-csa.h" #include "torque-generated/src/builtins/proxy-revocable-tq-csa.h" #include "torque-generated/src/builtins/proxy-revoke-tq-csa.h" #include "torque-generated/src/builtins/proxy-set-property-tq-csa.h" #include "torque-generated/src/builtins/proxy-set-prototype-of-tq-csa.h" #include "torque-generated/src/builtins/proxy-tq-csa.h" #include "torque-generated/src/builtins/reflect-tq-csa.h" #include "torque-generated/src/builtins/regexp-exec-tq-csa.h" #include "torque-generated/src/builtins/regexp-match-all-tq-csa.h" #include "torque-generated/src/builtins/regexp-match-tq-csa.h" #include "torque-generated/src/builtins/regexp-replace-tq-csa.h" #include "torque-generated/src/builtins/regexp-search-tq-csa.h" #include "torque-generated/src/builtins/regexp-source-tq-csa.h" #include "torque-generated/src/builtins/regexp-split-tq-csa.h" #include "torque-generated/src/builtins/regexp-test-tq-csa.h" #include "torque-generated/src/builtins/regexp-tq-csa.h" #include "torque-generated/src/builtins/string-endswith-tq-csa.h" #include "torque-generated/src/builtins/string-html-tq-csa.h" #include "torque-generated/src/builtins/string-iterator-tq-csa.h" #include "torque-generated/src/builtins/string-pad-tq-csa.h" #include "torque-generated/src/builtins/string-repeat-tq-csa.h" #include "torque-generated/src/builtins/string-replaceall-tq-csa.h" #include "torque-generated/src/builtins/string-slice-tq-csa.h" #include "torque-generated/src/builtins/string-startswith-tq-csa.h" #include "torque-generated/src/builtins/string-substring-tq-csa.h" #include "torque-generated/src/builtins/string-substr-tq-csa.h" #include "torque-generated/src/builtins/symbol-tq-csa.h" #include "torque-generated/src/builtins/torque-internal-tq-csa.h" #include "torque-generated/src/builtins/typed-array-createtypedarray-tq-csa.h" #include "torque-generated/src/builtins/typed-array-every-tq-csa.h" #include "torque-generated/src/builtins/typed-array-filter-tq-csa.h" #include "torque-generated/src/builtins/typed-array-find-tq-csa.h" #include "torque-generated/src/builtins/typed-array-findindex-tq-csa.h" #include "torque-generated/src/builtins/typed-array-foreach-tq-csa.h" #include "torque-generated/src/builtins/typed-array-from-tq-csa.h" #include "torque-generated/src/builtins/typed-array-of-tq-csa.h" #include "torque-generated/src/builtins/typed-array-reduce-tq-csa.h" #include "torque-generated/src/builtins/typed-array-reduceright-tq-csa.h" #include "torque-generated/src/builtins/typed-array-set-tq-csa.h" #include "torque-generated/src/builtins/typed-array-slice-tq-csa.h" #include "torque-generated/src/builtins/typed-array-some-tq-csa.h" #include "torque-generated/src/builtins/typed-array-sort-tq-csa.h" #include "torque-generated/src/builtins/typed-array-subarray-tq-csa.h" #include "torque-generated/src/builtins/typed-array-tq-csa.h" #include "torque-generated/src/ic/handler-configuration-tq-csa.h" #include "torque-generated/src/objects/allocation-site-tq-csa.h" #include "torque-generated/src/objects/api-callbacks-tq-csa.h" #include "torque-generated/src/objects/arguments-tq-csa.h" #include "torque-generated/src/objects/cell-tq-csa.h" #include "torque-generated/src/objects/code-tq-csa.h" #include "torque-generated/src/objects/contexts-tq-csa.h" #include "torque-generated/src/objects/data-handler-tq-csa.h" #include "torque-generated/src/objects/debug-objects-tq-csa.h" #include "torque-generated/src/objects/descriptor-array-tq-csa.h" #include "torque-generated/src/objects/embedder-data-array-tq-csa.h" #include "torque-generated/src/objects/feedback-cell-tq-csa.h" #include "torque-generated/src/objects/feedback-vector-tq-csa.h" #include "torque-generated/src/objects/fixed-array-tq-csa.h" #include "torque-generated/src/objects/foreign-tq-csa.h" #include "torque-generated/src/objects/free-space-tq-csa.h" #include "torque-generated/src/objects/heap-number-tq-csa.h" #include "torque-generated/src/objects/heap-object-tq-csa.h" #include "torque-generated/src/objects/intl-objects-tq-csa.h" #include "torque-generated/src/objects/js-array-buffer-tq-csa.h" #include "torque-generated/src/objects/js-array-tq-csa.h" #include "torque-generated/src/objects/js-collection-iterator-tq-csa.h" #include "torque-generated/src/objects/js-collection-tq-csa.h" #include "torque-generated/src/objects/js-generator-tq-csa.h" #include "torque-generated/src/objects/js-objects-tq-csa.h" #include "torque-generated/src/objects/js-promise-tq-csa.h" #include "torque-generated/src/objects/js-proxy-tq-csa.h" #include "torque-generated/src/objects/js-regexp-string-iterator-tq-csa.h" #include "torque-generated/src/objects/js-regexp-tq-csa.h" #include "torque-generated/src/objects/js-weak-refs-tq-csa.h" #include "torque-generated/src/objects/literal-objects-tq-csa.h" #include "torque-generated/src/objects/map-tq-csa.h" #include "torque-generated/src/objects/microtask-tq-csa.h" #include "torque-generated/src/objects/module-tq-csa.h" #include "torque-generated/src/objects/name-tq-csa.h" #include "torque-generated/src/objects/oddball-tq-csa.h" #include "torque-generated/src/objects/ordered-hash-table-tq-csa.h" #include "torque-generated/src/objects/primitive-heap-object-tq-csa.h" #include "torque-generated/src/objects/promise-tq-csa.h" #include "torque-generated/src/objects/property-array-tq-csa.h" #include "torque-generated/src/objects/property-cell-tq-csa.h" #include "torque-generated/src/objects/property-descriptor-object-tq-csa.h" #include "torque-generated/src/objects/prototype-info-tq-csa.h" #include "torque-generated/src/objects/regexp-match-info-tq-csa.h" #include "torque-generated/src/objects/scope-info-tq-csa.h" #include "torque-generated/src/objects/script-tq-csa.h" #include "torque-generated/src/objects/shared-function-info-tq-csa.h" #include "torque-generated/src/objects/source-text-module-tq-csa.h" #include "torque-generated/src/objects/stack-frame-info-tq-csa.h" #include "torque-generated/src/objects/string-tq-csa.h" #include "torque-generated/src/objects/struct-tq-csa.h" #include "torque-generated/src/objects/synthetic-module-tq-csa.h" #include "torque-generated/src/objects/template-objects-tq-csa.h" #include "torque-generated/src/objects/template-tq-csa.h" #include "torque-generated/src/wasm/wasm-objects-tq-csa.h" #include "torque-generated/test/torque/test-torque-tq-csa.h" #include "torque-generated/third_party/v8/builtins/array-sort-tq-csa.h" namespace v8 { namespace internal { TNode<Map> kSmallOrderedHashSetMap_0(compiler::CodeAssemblerState* state_) { compiler::CodeAssembler ca_(state_); compiler::CodeAssemblerParameterizedLabel<> block0(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); ca_.Goto(&block0); ca_.Bind(&block0); TNode<Map> tmp0; USE(tmp0); tmp0 = CodeStubAssembler(state_).SmallOrderedHashSetMapConstant(); return TNode<Map>{tmp0}; } TNode<SmallOrderedHashSet> AllocateSmallOrderedHashSet_0(compiler::CodeAssemblerState* state_, TNode<IntPtrT> p_capacity) { compiler::CodeAssembler ca_(state_); compiler::CodeAssemblerParameterizedLabel<IntPtrT> block0(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<IntPtrT, IntPtrT, BoolT> block6(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<IntPtrT, IntPtrT, BoolT> block7(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<IntPtrT, IntPtrT, BoolT, BoolT> block8(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<IntPtrT, IntPtrT> block5(&ca_, compiler::CodeAssemblerLabel::kDeferred); compiler::CodeAssemblerParameterizedLabel<IntPtrT, IntPtrT> block4(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<IntPtrT, SmallOrderedHashSet> block9(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); ca_.Goto(&block0, p_capacity); if (block0.is_used()) { TNode<IntPtrT> tmp0; ca_.Bind(&block0, &tmp0); TNode<IntPtrT> tmp1; USE(tmp1); tmp1 = FromConstexpr_intptr_constexpr_int31_0(state_, SmallOrderedHashTable<int>::kLoadFactor); TNode<IntPtrT> tmp2; USE(tmp2); tmp2 = CodeStubAssembler(state_).IntPtrDiv(TNode<IntPtrT>{tmp0}, TNode<IntPtrT>{tmp1}); TNode<Map> tmp3; USE(tmp3); tmp3 = kSmallOrderedHashSetMap_0(state_); TNode<Uint8T> tmp4; USE(tmp4); tmp4 = Convert_uint8_intptr_0(state_, TNode<IntPtrT>{tmp2}); TNode<Uint8T> tmp5; USE(tmp5); tmp5 = FromConstexpr_uint8_constexpr_int31_0(state_, 0); TNode<Uint8T> tmp6; USE(tmp6); std::tie(tmp6) = ConstantIterator_uint8_0(state_, TNode<Uint8T>{tmp5}).Flatten(); TNode<Oddball> tmp7; USE(tmp7); tmp7 = TheHole_0(state_); TNode<Oddball> tmp8; USE(tmp8); std::tie(tmp8) = ConstantIterator_TheHole_0(state_, TNode<Oddball>{tmp7}).Flatten(); TNode<Uint8T> tmp9; USE(tmp9); tmp9 = FromConstexpr_uint8_constexpr_int31_0(state_, SmallOrderedHashTable<int>::kNotFound); TNode<Uint8T> tmp10; USE(tmp10); std::tie(tmp10) = ConstantIterator_uint8_0(state_, TNode<Uint8T>{tmp9}).Flatten(); TNode<Uint8T> tmp11; USE(tmp11); tmp11 = FromConstexpr_uint8_constexpr_int31_0(state_, SmallOrderedHashTable<int>::kNotFound); TNode<Uint8T> tmp12; USE(tmp12); std::tie(tmp12) = ConstantIterator_uint8_0(state_, TNode<Uint8T>{tmp11}).Flatten(); TNode<IntPtrT> tmp13; USE(tmp13); tmp13 = Convert_intptr_constexpr_int31_0(state_, 1); TNode<IntPtrT> tmp14; USE(tmp14); tmp14 = FromConstexpr_intptr_constexpr_int31_0(state_, 7); TNode<IntPtrT> tmp15; USE(tmp15); tmp15 = AddIndexedFieldSizeToObjectSize_0(state_, TNode<IntPtrT>{tmp14}, TNode<IntPtrT>{tmp13}, kUInt8Size); TNode<IntPtrT> tmp16; USE(tmp16); tmp16 = Convert_intptr_uint8_0(state_, TNode<Uint8T>{tmp4}); TNode<IntPtrT> tmp17; USE(tmp17); tmp17 = FromConstexpr_intptr_constexpr_int31_0(state_, SmallOrderedHashTable<int>::kLoadFactor); TNode<IntPtrT> tmp18; USE(tmp18); tmp18 = CodeStubAssembler(state_).IntPtrMul(TNode<IntPtrT>{tmp16}, TNode<IntPtrT>{tmp17}); TNode<IntPtrT> tmp19; USE(tmp19); tmp19 = Convert_intptr_intptr_0(state_, TNode<IntPtrT>{tmp18}); TNode<IntPtrT> tmp20; USE(tmp20); tmp20 = FromConstexpr_intptr_constexpr_int31_0(state_, 8); TNode<IntPtrT> tmp21; USE(tmp21); tmp21 = AddIndexedFieldSizeToObjectSize_0(state_, TNode<IntPtrT>{tmp20}, TNode<IntPtrT>{tmp19}, kTaggedSize); TNode<IntPtrT> tmp22; USE(tmp22); tmp22 = Convert_intptr_uint8_0(state_, TNode<Uint8T>{tmp4}); TNode<IntPtrT> tmp23; USE(tmp23); tmp23 = AddIndexedFieldSizeToObjectSize_0(state_, TNode<IntPtrT>{tmp21}, TNode<IntPtrT>{tmp22}, kUInt8Size); TNode<IntPtrT> tmp24; USE(tmp24); tmp24 = Convert_intptr_uint8_0(state_, TNode<Uint8T>{tmp4}); TNode<IntPtrT> tmp25; USE(tmp25); tmp25 = FromConstexpr_intptr_constexpr_int31_0(state_, SmallOrderedHashTable<int>::kLoadFactor); TNode<IntPtrT> tmp26; USE(tmp26); tmp26 = CodeStubAssembler(state_).IntPtrMul(TNode<IntPtrT>{tmp24}, TNode<IntPtrT>{tmp25}); TNode<IntPtrT> tmp27; USE(tmp27); tmp27 = Convert_intptr_intptr_0(state_, TNode<IntPtrT>{tmp26}); TNode<IntPtrT> tmp28; USE(tmp28); tmp28 = AddIndexedFieldSizeToObjectSize_0(state_, TNode<IntPtrT>{tmp23}, TNode<IntPtrT>{tmp27}, kUInt8Size); TNode<IntPtrT> tmp29; USE(tmp29); tmp29 = AlignTagged_0(state_, TNode<IntPtrT>{tmp28}); TNode<HeapObject> tmp30; USE(tmp30); tmp30 = Allocate_0(state_, TNode<IntPtrT>{tmp29}, TNode<Map>{tmp3}); TNode<IntPtrT> tmp31; USE(tmp31); tmp31 = FromConstexpr_intptr_constexpr_int31_0(state_, 0); CodeStubAssembler(state_).StoreReference<Map>(CodeStubAssembler::Reference{tmp30, tmp31}, tmp3); TNode<IntPtrT> tmp32; USE(tmp32); tmp32 = FromConstexpr_intptr_constexpr_int31_0(state_, 4); TNode<Uint8T> tmp33; USE(tmp33); tmp33 = FromConstexpr_uint8_constexpr_int31_0(state_, 0); CodeStubAssembler(state_).StoreReference<Uint8T>(CodeStubAssembler::Reference{tmp30, tmp32}, tmp33); TNode<IntPtrT> tmp34; USE(tmp34); tmp34 = FromConstexpr_intptr_constexpr_int31_0(state_, 5); TNode<Uint8T> tmp35; USE(tmp35); tmp35 = FromConstexpr_uint8_constexpr_int31_0(state_, 0); CodeStubAssembler(state_).StoreReference<Uint8T>(CodeStubAssembler::Reference{tmp30, tmp34}, tmp35); TNode<IntPtrT> tmp36; USE(tmp36); tmp36 = FromConstexpr_intptr_constexpr_int31_0(state_, 6); CodeStubAssembler(state_).StoreReference<Uint8T>(CodeStubAssembler::Reference{tmp30, tmp36}, tmp4); TNode<IntPtrT> tmp37; USE(tmp37); tmp37 = FromConstexpr_intptr_constexpr_int31_0(state_, 7); InitializeFieldsFromIterator_uint8_ConstantIterator_uint8_0(state_, TorqueStructSlice_uint8_0{TNode<HeapObject>{tmp30}, TNode<IntPtrT>{tmp37}, TNode<IntPtrT>{tmp13}, TorqueStructUnsafe_0{}}, TorqueStructConstantIterator_uint8_0{TNode<Uint8T>{tmp6}}); TNode<IntPtrT> tmp38; USE(tmp38); tmp38 = FromConstexpr_intptr_constexpr_int31_0(state_, 8); InitializeFieldsFromIterator_JSReceiver_OR_Smi_OR_HeapNumber_OR_BigInt_OR_String_OR_Symbol_OR_True_OR_False_OR_Null_OR_Undefined_OR_TheHole_ConstantIterator_TheHole_0(state_, TorqueStructSlice_JSReceiver_OR_Smi_OR_HeapNumber_OR_BigInt_OR_String_OR_Symbol_OR_True_OR_False_OR_Null_OR_Undefined_OR_TheHole_0{TNode<HeapObject>{tmp30}, TNode<IntPtrT>{tmp38}, TNode<IntPtrT>{tmp19}, TorqueStructUnsafe_0{}}, TorqueStructConstantIterator_TheHole_0{TNode<Oddball>{tmp8}}); InitializeFieldsFromIterator_uint8_ConstantIterator_uint8_0(state_, TorqueStructSlice_uint8_0{TNode<HeapObject>{tmp30}, TNode<IntPtrT>{tmp21}, TNode<IntPtrT>{tmp22}, TorqueStructUnsafe_0{}}, TorqueStructConstantIterator_uint8_0{TNode<Uint8T>{tmp10}}); InitializeFieldsFromIterator_uint8_ConstantIterator_uint8_0(state_, TorqueStructSlice_uint8_0{TNode<HeapObject>{tmp30}, TNode<IntPtrT>{tmp23}, TNode<IntPtrT>{tmp27}, TorqueStructUnsafe_0{}}, TorqueStructConstantIterator_uint8_0{TNode<Uint8T>{tmp12}}); TNode<SmallOrderedHashSet> tmp39; USE(tmp39); tmp39 = TORQUE_CAST(TNode<HeapObject>{tmp30}); ca_.Goto(&block9, tmp0, tmp39); } if (block6.is_used()) { TNode<IntPtrT> tmp40; TNode<IntPtrT> tmp41; TNode<BoolT> tmp42; ca_.Bind(&block6, &tmp40, &tmp41, &tmp42); TNode<IntPtrT> tmp43; USE(tmp43); tmp43 = FromConstexpr_intptr_constexpr_int31_0(state_, SmallOrderedHashTable<int>::kMaxCapacity); TNode<BoolT> tmp44; USE(tmp44); tmp44 = CodeStubAssembler(state_).IntPtrLessThanOrEqual(TNode<IntPtrT>{tmp41}, TNode<IntPtrT>{tmp43}); ca_.Goto(&block8, tmp40, tmp41, tmp42, tmp44); } if (block7.is_used()) { TNode<IntPtrT> tmp45; TNode<IntPtrT> tmp46; TNode<BoolT> tmp47; ca_.Bind(&block7, &tmp45, &tmp46, &tmp47); TNode<BoolT> tmp48; USE(tmp48); tmp48 = FromConstexpr_bool_constexpr_bool_0(state_, false); ca_.Goto(&block8, tmp45, tmp46, tmp47, tmp48); } if (block8.is_used()) { TNode<IntPtrT> tmp49; TNode<IntPtrT> tmp50; TNode<BoolT> tmp51; TNode<BoolT> tmp52; ca_.Bind(&block8, &tmp49, &tmp50, &tmp51, &tmp52); ca_.Branch(tmp52, &block4, &block5, tmp49, tmp50); } if (block5.is_used()) { TNode<IntPtrT> tmp53; TNode<IntPtrT> tmp54; ca_.Bind(&block5, &tmp53, &tmp54); CodeStubAssembler(state_).FailAssert("Torque assert '0 <= hashTableSize && hashTableSize <= kSmallOrderedHashTableMaxCapacity' failed", "src/objects/ordered-hash-table.tq", 43); } if (block4.is_used()) { TNode<IntPtrT> tmp55; TNode<IntPtrT> tmp56; ca_.Bind(&block4, &tmp55, &tmp56); } TNode<IntPtrT> tmp57; TNode<SmallOrderedHashSet> tmp58; ca_.Bind(&block9, &tmp57, &tmp58); return TNode<SmallOrderedHashSet>{tmp58}; } TNode<Map> kSmallOrderedHashMapMap_0(compiler::CodeAssemblerState* state_) { compiler::CodeAssembler ca_(state_); compiler::CodeAssemblerParameterizedLabel<> block0(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); ca_.Goto(&block0); ca_.Bind(&block0); TNode<Map> tmp0; USE(tmp0); tmp0 = CodeStubAssembler(state_).SmallOrderedHashMapMapConstant(); return TNode<Map>{tmp0}; } TNode<SmallOrderedHashMap> AllocateSmallOrderedHashMap_0(compiler::CodeAssemblerState* state_, TNode<IntPtrT> p_capacity) { compiler::CodeAssembler ca_(state_); compiler::CodeAssemblerParameterizedLabel<IntPtrT> block0(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<IntPtrT, IntPtrT, BoolT> block6(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<IntPtrT, IntPtrT, BoolT> block7(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<IntPtrT, IntPtrT, BoolT, BoolT> block8(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<IntPtrT, IntPtrT> block5(&ca_, compiler::CodeAssemblerLabel::kDeferred); compiler::CodeAssemblerParameterizedLabel<IntPtrT, IntPtrT> block4(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<IntPtrT, SmallOrderedHashMap> block9(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); ca_.Goto(&block0, p_capacity); if (block0.is_used()) { TNode<IntPtrT> tmp0; ca_.Bind(&block0, &tmp0); TNode<IntPtrT> tmp1; USE(tmp1); tmp1 = FromConstexpr_intptr_constexpr_int31_0(state_, SmallOrderedHashTable<int>::kLoadFactor); TNode<IntPtrT> tmp2; USE(tmp2); tmp2 = CodeStubAssembler(state_).IntPtrDiv(TNode<IntPtrT>{tmp0}, TNode<IntPtrT>{tmp1}); TNode<Map> tmp3; USE(tmp3); tmp3 = kSmallOrderedHashMapMap_0(state_); TNode<Uint8T> tmp4; USE(tmp4); tmp4 = Convert_uint8_intptr_0(state_, TNode<IntPtrT>{tmp2}); TNode<Uint8T> tmp5; USE(tmp5); tmp5 = FromConstexpr_uint8_constexpr_int31_0(state_, 0); TNode<Uint8T> tmp6; USE(tmp6); std::tie(tmp6) = ConstantIterator_uint8_0(state_, TNode<Uint8T>{tmp5}).Flatten(); TNode<Oddball> tmp7; USE(tmp7); tmp7 = TheHole_0(state_); TNode<Oddball> tmp8; USE(tmp8); tmp8 = TheHole_0(state_); TNode<Object> tmp9; USE(tmp9); TNode<Object> tmp10; USE(tmp10); std::tie(tmp9, tmp10) = ConstantIterator_HashMapEntry_0(state_, TorqueStructHashMapEntry_0{TNode<Object>{tmp7}, TNode<Object>{tmp8}}).Flatten(); TNode<Uint8T> tmp11; USE(tmp11); tmp11 = FromConstexpr_uint8_constexpr_int31_0(state_, SmallOrderedHashTable<int>::kNotFound); TNode<Uint8T> tmp12; USE(tmp12); std::tie(tmp12) = ConstantIterator_uint8_0(state_, TNode<Uint8T>{tmp11}).Flatten(); TNode<Uint8T> tmp13; USE(tmp13); tmp13 = FromConstexpr_uint8_constexpr_int31_0(state_, SmallOrderedHashTable<int>::kNotFound); TNode<Uint8T> tmp14; USE(tmp14); std::tie(tmp14) = ConstantIterator_uint8_0(state_, TNode<Uint8T>{tmp13}).Flatten(); TNode<IntPtrT> tmp15; USE(tmp15); tmp15 = Convert_intptr_constexpr_int31_0(state_, 1); TNode<IntPtrT> tmp16; USE(tmp16); tmp16 = FromConstexpr_intptr_constexpr_int31_0(state_, 7); TNode<IntPtrT> tmp17; USE(tmp17); tmp17 = AddIndexedFieldSizeToObjectSize_0(state_, TNode<IntPtrT>{tmp16}, TNode<IntPtrT>{tmp15}, kUInt8Size); TNode<IntPtrT> tmp18; USE(tmp18); tmp18 = Convert_intptr_uint8_0(state_, TNode<Uint8T>{tmp4}); TNode<IntPtrT> tmp19; USE(tmp19); tmp19 = FromConstexpr_intptr_constexpr_int31_0(state_, SmallOrderedHashTable<int>::kLoadFactor); TNode<IntPtrT> tmp20; USE(tmp20); tmp20 = CodeStubAssembler(state_).IntPtrMul(TNode<IntPtrT>{tmp18}, TNode<IntPtrT>{tmp19}); TNode<IntPtrT> tmp21; USE(tmp21); tmp21 = Convert_intptr_intptr_0(state_, TNode<IntPtrT>{tmp20}); TNode<IntPtrT> tmp22; USE(tmp22); tmp22 = FromConstexpr_intptr_constexpr_int31_0(state_, 8); TNode<IntPtrT> tmp23; USE(tmp23); tmp23 = AddIndexedFieldSizeToObjectSize_0(state_, TNode<IntPtrT>{tmp22}, TNode<IntPtrT>{tmp21}, 8); TNode<IntPtrT> tmp24; USE(tmp24); tmp24 = Convert_intptr_uint8_0(state_, TNode<Uint8T>{tmp4}); TNode<IntPtrT> tmp25; USE(tmp25); tmp25 = AddIndexedFieldSizeToObjectSize_0(state_, TNode<IntPtrT>{tmp23}, TNode<IntPtrT>{tmp24}, kUInt8Size); TNode<IntPtrT> tmp26; USE(tmp26); tmp26 = Convert_intptr_uint8_0(state_, TNode<Uint8T>{tmp4}); TNode<IntPtrT> tmp27; USE(tmp27); tmp27 = FromConstexpr_intptr_constexpr_int31_0(state_, SmallOrderedHashTable<int>::kLoadFactor); TNode<IntPtrT> tmp28; USE(tmp28); tmp28 = CodeStubAssembler(state_).IntPtrMul(TNode<IntPtrT>{tmp26}, TNode<IntPtrT>{tmp27}); TNode<IntPtrT> tmp29; USE(tmp29); tmp29 = Convert_intptr_intptr_0(state_, TNode<IntPtrT>{tmp28}); TNode<IntPtrT> tmp30; USE(tmp30); tmp30 = AddIndexedFieldSizeToObjectSize_0(state_, TNode<IntPtrT>{tmp25}, TNode<IntPtrT>{tmp29}, kUInt8Size); TNode<IntPtrT> tmp31; USE(tmp31); tmp31 = AlignTagged_0(state_, TNode<IntPtrT>{tmp30}); TNode<HeapObject> tmp32; USE(tmp32); tmp32 = Allocate_0(state_, TNode<IntPtrT>{tmp31}, TNode<Map>{tmp3}); TNode<IntPtrT> tmp33; USE(tmp33); tmp33 = FromConstexpr_intptr_constexpr_int31_0(state_, 0); CodeStubAssembler(state_).StoreReference<Map>(CodeStubAssembler::Reference{tmp32, tmp33}, tmp3); TNode<IntPtrT> tmp34; USE(tmp34); tmp34 = FromConstexpr_intptr_constexpr_int31_0(state_, 4); TNode<Uint8T> tmp35; USE(tmp35); tmp35 = FromConstexpr_uint8_constexpr_int31_0(state_, 0); CodeStubAssembler(state_).StoreReference<Uint8T>(CodeStubAssembler::Reference{tmp32, tmp34}, tmp35); TNode<IntPtrT> tmp36; USE(tmp36); tmp36 = FromConstexpr_intptr_constexpr_int31_0(state_, 5); TNode<Uint8T> tmp37; USE(tmp37); tmp37 = FromConstexpr_uint8_constexpr_int31_0(state_, 0); CodeStubAssembler(state_).StoreReference<Uint8T>(CodeStubAssembler::Reference{tmp32, tmp36}, tmp37); TNode<IntPtrT> tmp38; USE(tmp38); tmp38 = FromConstexpr_intptr_constexpr_int31_0(state_, 6); CodeStubAssembler(state_).StoreReference<Uint8T>(CodeStubAssembler::Reference{tmp32, tmp38}, tmp4); TNode<IntPtrT> tmp39; USE(tmp39); tmp39 = FromConstexpr_intptr_constexpr_int31_0(state_, 7); InitializeFieldsFromIterator_uint8_ConstantIterator_uint8_0(state_, TorqueStructSlice_uint8_0{TNode<HeapObject>{tmp32}, TNode<IntPtrT>{tmp39}, TNode<IntPtrT>{tmp15}, TorqueStructUnsafe_0{}}, TorqueStructConstantIterator_uint8_0{TNode<Uint8T>{tmp6}}); TNode<IntPtrT> tmp40; USE(tmp40); tmp40 = FromConstexpr_intptr_constexpr_int31_0(state_, 8); InitializeFieldsFromIterator_HashMapEntry_ConstantIterator_HashMapEntry_0(state_, TorqueStructSlice_HashMapEntry_0{TNode<HeapObject>{tmp32}, TNode<IntPtrT>{tmp40}, TNode<IntPtrT>{tmp21}, TorqueStructUnsafe_0{}}, TorqueStructConstantIterator_HashMapEntry_0{TorqueStructHashMapEntry_0{TNode<Object>{tmp9}, TNode<Object>{tmp10}}}); InitializeFieldsFromIterator_uint8_ConstantIterator_uint8_0(state_, TorqueStructSlice_uint8_0{TNode<HeapObject>{tmp32}, TNode<IntPtrT>{tmp23}, TNode<IntPtrT>{tmp24}, TorqueStructUnsafe_0{}}, TorqueStructConstantIterator_uint8_0{TNode<Uint8T>{tmp12}}); InitializeFieldsFromIterator_uint8_ConstantIterator_uint8_0(state_, TorqueStructSlice_uint8_0{TNode<HeapObject>{tmp32}, TNode<IntPtrT>{tmp25}, TNode<IntPtrT>{tmp29}, TorqueStructUnsafe_0{}}, TorqueStructConstantIterator_uint8_0{TNode<Uint8T>{tmp14}}); TNode<SmallOrderedHashMap> tmp41; USE(tmp41); tmp41 = TORQUE_CAST(TNode<HeapObject>{tmp32}); ca_.Goto(&block9, tmp0, tmp41); } if (block6.is_used()) { TNode<IntPtrT> tmp42; TNode<IntPtrT> tmp43; TNode<BoolT> tmp44; ca_.Bind(&block6, &tmp42, &tmp43, &tmp44); TNode<IntPtrT> tmp45; USE(tmp45); tmp45 = FromConstexpr_intptr_constexpr_int31_0(state_, SmallOrderedHashTable<int>::kMaxCapacity); TNode<BoolT> tmp46; USE(tmp46); tmp46 = CodeStubAssembler(state_).IntPtrLessThanOrEqual(TNode<IntPtrT>{tmp43}, TNode<IntPtrT>{tmp45}); ca_.Goto(&block8, tmp42, tmp43, tmp44, tmp46); } if (block7.is_used()) { TNode<IntPtrT> tmp47; TNode<IntPtrT> tmp48; TNode<BoolT> tmp49; ca_.Bind(&block7, &tmp47, &tmp48, &tmp49); TNode<BoolT> tmp50; USE(tmp50); tmp50 = FromConstexpr_bool_constexpr_bool_0(state_, false); ca_.Goto(&block8, tmp47, tmp48, tmp49, tmp50); } if (block8.is_used()) { TNode<IntPtrT> tmp51; TNode<IntPtrT> tmp52; TNode<BoolT> tmp53; TNode<BoolT> tmp54; ca_.Bind(&block8, &tmp51, &tmp52, &tmp53, &tmp54); ca_.Branch(tmp54, &block4, &block5, tmp51, tmp52); } if (block5.is_used()) { TNode<IntPtrT> tmp55; TNode<IntPtrT> tmp56; ca_.Bind(&block5, &tmp55, &tmp56); CodeStubAssembler(state_).FailAssert("Torque assert '0 <= hashTableSize && hashTableSize <= kSmallOrderedHashTableMaxCapacity' failed", "src/objects/ordered-hash-table.tq", 82); } if (block4.is_used()) { TNode<IntPtrT> tmp57; TNode<IntPtrT> tmp58; ca_.Bind(&block4, &tmp57, &tmp58); } TNode<IntPtrT> tmp59; TNode<SmallOrderedHashMap> tmp60; ca_.Bind(&block9, &tmp59, &tmp60); return TNode<SmallOrderedHashMap>{tmp60}; } TNode<Uint8T> LoadSmallOrderedHashSetNumberOfElements_0(compiler::CodeAssemblerState* state_, TNode<SmallOrderedHashSet> p_o) { compiler::CodeAssembler ca_(state_); compiler::CodeAssemblerParameterizedLabel<SmallOrderedHashSet> block0(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<SmallOrderedHashSet, Uint8T> block2(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); ca_.Goto(&block0, p_o); if (block0.is_used()) { TNode<SmallOrderedHashSet> tmp0; ca_.Bind(&block0, &tmp0); TNode<IntPtrT> tmp1; USE(tmp1); tmp1 = FromConstexpr_intptr_constexpr_int31_0(state_, 4); TNode<Uint8T>tmp2 = CodeStubAssembler(state_).LoadReference<Uint8T>(CodeStubAssembler::Reference{tmp0, tmp1}); ca_.Goto(&block2, tmp0, tmp2); } TNode<SmallOrderedHashSet> tmp3; TNode<Uint8T> tmp4; ca_.Bind(&block2, &tmp3, &tmp4); return TNode<Uint8T>{tmp4}; } void StoreSmallOrderedHashSetNumberOfElements_0(compiler::CodeAssemblerState* state_, TNode<SmallOrderedHashSet> p_o, TNode<Uint8T> p_v) { compiler::CodeAssembler ca_(state_); compiler::CodeAssemblerParameterizedLabel<SmallOrderedHashSet, Uint8T> block0(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<SmallOrderedHashSet, Uint8T> block2(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); ca_.Goto(&block0, p_o, p_v); if (block0.is_used()) { TNode<SmallOrderedHashSet> tmp0; TNode<Uint8T> tmp1; ca_.Bind(&block0, &tmp0, &tmp1); TNode<IntPtrT> tmp2; USE(tmp2); tmp2 = FromConstexpr_intptr_constexpr_int31_0(state_, 4); CodeStubAssembler(state_).StoreReference<Uint8T>(CodeStubAssembler::Reference{tmp0, tmp2}, tmp1); ca_.Goto(&block2, tmp0, tmp1); } TNode<SmallOrderedHashSet> tmp3; TNode<Uint8T> tmp4; ca_.Bind(&block2, &tmp3, &tmp4); } TNode<Uint8T> LoadSmallOrderedHashSetNumberOfDeletedElements_0(compiler::CodeAssemblerState* state_, TNode<SmallOrderedHashSet> p_o) { compiler::CodeAssembler ca_(state_); compiler::CodeAssemblerParameterizedLabel<SmallOrderedHashSet> block0(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<SmallOrderedHashSet, Uint8T> block2(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); ca_.Goto(&block0, p_o); if (block0.is_used()) { TNode<SmallOrderedHashSet> tmp0; ca_.Bind(&block0, &tmp0); TNode<IntPtrT> tmp1; USE(tmp1); tmp1 = FromConstexpr_intptr_constexpr_int31_0(state_, 5); TNode<Uint8T>tmp2 = CodeStubAssembler(state_).LoadReference<Uint8T>(CodeStubAssembler::Reference{tmp0, tmp1}); ca_.Goto(&block2, tmp0, tmp2); } TNode<SmallOrderedHashSet> tmp3; TNode<Uint8T> tmp4; ca_.Bind(&block2, &tmp3, &tmp4); return TNode<Uint8T>{tmp4}; } void StoreSmallOrderedHashSetNumberOfDeletedElements_0(compiler::CodeAssemblerState* state_, TNode<SmallOrderedHashSet> p_o, TNode<Uint8T> p_v) { compiler::CodeAssembler ca_(state_); compiler::CodeAssemblerParameterizedLabel<SmallOrderedHashSet, Uint8T> block0(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<SmallOrderedHashSet, Uint8T> block2(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); ca_.Goto(&block0, p_o, p_v); if (block0.is_used()) { TNode<SmallOrderedHashSet> tmp0; TNode<Uint8T> tmp1; ca_.Bind(&block0, &tmp0, &tmp1); TNode<IntPtrT> tmp2; USE(tmp2); tmp2 = FromConstexpr_intptr_constexpr_int31_0(state_, 5); CodeStubAssembler(state_).StoreReference<Uint8T>(CodeStubAssembler::Reference{tmp0, tmp2}, tmp1); ca_.Goto(&block2, tmp0, tmp1); } TNode<SmallOrderedHashSet> tmp3; TNode<Uint8T> tmp4; ca_.Bind(&block2, &tmp3, &tmp4); } TNode<Uint8T> LoadSmallOrderedHashSetNumberOfBuckets_0(compiler::CodeAssemblerState* state_, TNode<SmallOrderedHashSet> p_o) { compiler::CodeAssembler ca_(state_); compiler::CodeAssemblerParameterizedLabel<SmallOrderedHashSet> block0(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<SmallOrderedHashSet, Uint8T> block2(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); ca_.Goto(&block0, p_o); if (block0.is_used()) { TNode<SmallOrderedHashSet> tmp0; ca_.Bind(&block0, &tmp0); TNode<IntPtrT> tmp1; USE(tmp1); tmp1 = FromConstexpr_intptr_constexpr_int31_0(state_, 6); TNode<Uint8T>tmp2 = CodeStubAssembler(state_).LoadReference<Uint8T>(CodeStubAssembler::Reference{tmp0, tmp1}); ca_.Goto(&block2, tmp0, tmp2); } TNode<SmallOrderedHashSet> tmp3; TNode<Uint8T> tmp4; ca_.Bind(&block2, &tmp3, &tmp4); return TNode<Uint8T>{tmp4}; } void StoreSmallOrderedHashSetNumberOfBuckets_0(compiler::CodeAssemblerState* state_, TNode<SmallOrderedHashSet> p_o, TNode<Uint8T> p_v) { compiler::CodeAssembler ca_(state_); compiler::CodeAssemblerParameterizedLabel<SmallOrderedHashSet, Uint8T> block0(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<SmallOrderedHashSet, Uint8T> block2(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); ca_.Goto(&block0, p_o, p_v); if (block0.is_used()) { TNode<SmallOrderedHashSet> tmp0; TNode<Uint8T> tmp1; ca_.Bind(&block0, &tmp0, &tmp1); TNode<IntPtrT> tmp2; USE(tmp2); tmp2 = FromConstexpr_intptr_constexpr_int31_0(state_, 6); CodeStubAssembler(state_).StoreReference<Uint8T>(CodeStubAssembler::Reference{tmp0, tmp2}, tmp1); ca_.Goto(&block2, tmp0, tmp1); } TNode<SmallOrderedHashSet> tmp3; TNode<Uint8T> tmp4; ca_.Bind(&block2, &tmp3, &tmp4); } TNode<Uint8T> LoadSmallOrderedHashMapNumberOfElements_0(compiler::CodeAssemblerState* state_, TNode<SmallOrderedHashMap> p_o) { compiler::CodeAssembler ca_(state_); compiler::CodeAssemblerParameterizedLabel<SmallOrderedHashMap> block0(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<SmallOrderedHashMap, Uint8T> block2(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); ca_.Goto(&block0, p_o); if (block0.is_used()) { TNode<SmallOrderedHashMap> tmp0; ca_.Bind(&block0, &tmp0); TNode<IntPtrT> tmp1; USE(tmp1); tmp1 = FromConstexpr_intptr_constexpr_int31_0(state_, 4); TNode<Uint8T>tmp2 = CodeStubAssembler(state_).LoadReference<Uint8T>(CodeStubAssembler::Reference{tmp0, tmp1}); ca_.Goto(&block2, tmp0, tmp2); } TNode<SmallOrderedHashMap> tmp3; TNode<Uint8T> tmp4; ca_.Bind(&block2, &tmp3, &tmp4); return TNode<Uint8T>{tmp4}; } void StoreSmallOrderedHashMapNumberOfElements_0(compiler::CodeAssemblerState* state_, TNode<SmallOrderedHashMap> p_o, TNode<Uint8T> p_v) { compiler::CodeAssembler ca_(state_); compiler::CodeAssemblerParameterizedLabel<SmallOrderedHashMap, Uint8T> block0(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<SmallOrderedHashMap, Uint8T> block2(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); ca_.Goto(&block0, p_o, p_v); if (block0.is_used()) { TNode<SmallOrderedHashMap> tmp0; TNode<Uint8T> tmp1; ca_.Bind(&block0, &tmp0, &tmp1); TNode<IntPtrT> tmp2; USE(tmp2); tmp2 = FromConstexpr_intptr_constexpr_int31_0(state_, 4); CodeStubAssembler(state_).StoreReference<Uint8T>(CodeStubAssembler::Reference{tmp0, tmp2}, tmp1); ca_.Goto(&block2, tmp0, tmp1); } TNode<SmallOrderedHashMap> tmp3; TNode<Uint8T> tmp4; ca_.Bind(&block2, &tmp3, &tmp4); } TNode<Uint8T> LoadSmallOrderedHashMapNumberOfDeletedElements_0(compiler::CodeAssemblerState* state_, TNode<SmallOrderedHashMap> p_o) { compiler::CodeAssembler ca_(state_); compiler::CodeAssemblerParameterizedLabel<SmallOrderedHashMap> block0(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<SmallOrderedHashMap, Uint8T> block2(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); ca_.Goto(&block0, p_o); if (block0.is_used()) { TNode<SmallOrderedHashMap> tmp0; ca_.Bind(&block0, &tmp0); TNode<IntPtrT> tmp1; USE(tmp1); tmp1 = FromConstexpr_intptr_constexpr_int31_0(state_, 5); TNode<Uint8T>tmp2 = CodeStubAssembler(state_).LoadReference<Uint8T>(CodeStubAssembler::Reference{tmp0, tmp1}); ca_.Goto(&block2, tmp0, tmp2); } TNode<SmallOrderedHashMap> tmp3; TNode<Uint8T> tmp4; ca_.Bind(&block2, &tmp3, &tmp4); return TNode<Uint8T>{tmp4}; } void StoreSmallOrderedHashMapNumberOfDeletedElements_0(compiler::CodeAssemblerState* state_, TNode<SmallOrderedHashMap> p_o, TNode<Uint8T> p_v) { compiler::CodeAssembler ca_(state_); compiler::CodeAssemblerParameterizedLabel<SmallOrderedHashMap, Uint8T> block0(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<SmallOrderedHashMap, Uint8T> block2(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); ca_.Goto(&block0, p_o, p_v); if (block0.is_used()) { TNode<SmallOrderedHashMap> tmp0; TNode<Uint8T> tmp1; ca_.Bind(&block0, &tmp0, &tmp1); TNode<IntPtrT> tmp2; USE(tmp2); tmp2 = FromConstexpr_intptr_constexpr_int31_0(state_, 5); CodeStubAssembler(state_).StoreReference<Uint8T>(CodeStubAssembler::Reference{tmp0, tmp2}, tmp1); ca_.Goto(&block2, tmp0, tmp1); } TNode<SmallOrderedHashMap> tmp3; TNode<Uint8T> tmp4; ca_.Bind(&block2, &tmp3, &tmp4); } TNode<Uint8T> LoadSmallOrderedHashMapNumberOfBuckets_0(compiler::CodeAssemblerState* state_, TNode<SmallOrderedHashMap> p_o) { compiler::CodeAssembler ca_(state_); compiler::CodeAssemblerParameterizedLabel<SmallOrderedHashMap> block0(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<SmallOrderedHashMap, Uint8T> block2(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); ca_.Goto(&block0, p_o); if (block0.is_used()) { TNode<SmallOrderedHashMap> tmp0; ca_.Bind(&block0, &tmp0); TNode<IntPtrT> tmp1; USE(tmp1); tmp1 = FromConstexpr_intptr_constexpr_int31_0(state_, 6); TNode<Uint8T>tmp2 = CodeStubAssembler(state_).LoadReference<Uint8T>(CodeStubAssembler::Reference{tmp0, tmp1}); ca_.Goto(&block2, tmp0, tmp2); } TNode<SmallOrderedHashMap> tmp3; TNode<Uint8T> tmp4; ca_.Bind(&block2, &tmp3, &tmp4); return TNode<Uint8T>{tmp4}; } void StoreSmallOrderedHashMapNumberOfBuckets_0(compiler::CodeAssemblerState* state_, TNode<SmallOrderedHashMap> p_o, TNode<Uint8T> p_v) { compiler::CodeAssembler ca_(state_); compiler::CodeAssemblerParameterizedLabel<SmallOrderedHashMap, Uint8T> block0(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<SmallOrderedHashMap, Uint8T> block2(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); ca_.Goto(&block0, p_o, p_v); if (block0.is_used()) { TNode<SmallOrderedHashMap> tmp0; TNode<Uint8T> tmp1; ca_.Bind(&block0, &tmp0, &tmp1); TNode<IntPtrT> tmp2; USE(tmp2); tmp2 = FromConstexpr_intptr_constexpr_int31_0(state_, 6); CodeStubAssembler(state_).StoreReference<Uint8T>(CodeStubAssembler::Reference{tmp0, tmp2}, tmp1); ca_.Goto(&block2, tmp0, tmp1); } TNode<SmallOrderedHashMap> tmp3; TNode<Uint8T> tmp4; ca_.Bind(&block2, &tmp3, &tmp4); } TNode<Int32T> LoadSmallOrderedNameDictionaryHash_0(compiler::CodeAssemblerState* state_, TNode<SmallOrderedNameDictionary> p_o) { compiler::CodeAssembler ca_(state_); compiler::CodeAssemblerParameterizedLabel<SmallOrderedNameDictionary> block0(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<SmallOrderedNameDictionary, Int32T> block2(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); ca_.Goto(&block0, p_o); if (block0.is_used()) { TNode<SmallOrderedNameDictionary> tmp0; ca_.Bind(&block0, &tmp0); TNode<IntPtrT> tmp1; USE(tmp1); tmp1 = FromConstexpr_intptr_constexpr_int31_0(state_, 4); TNode<Int32T>tmp2 = CodeStubAssembler(state_).LoadReference<Int32T>(CodeStubAssembler::Reference{tmp0, tmp1}); ca_.Goto(&block2, tmp0, tmp2); } TNode<SmallOrderedNameDictionary> tmp3; TNode<Int32T> tmp4; ca_.Bind(&block2, &tmp3, &tmp4); return TNode<Int32T>{tmp4}; } void StoreSmallOrderedNameDictionaryHash_0(compiler::CodeAssemblerState* state_, TNode<SmallOrderedNameDictionary> p_o, TNode<Int32T> p_v) { compiler::CodeAssembler ca_(state_); compiler::CodeAssemblerParameterizedLabel<SmallOrderedNameDictionary, Int32T> block0(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<SmallOrderedNameDictionary, Int32T> block2(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); ca_.Goto(&block0, p_o, p_v); if (block0.is_used()) { TNode<SmallOrderedNameDictionary> tmp0; TNode<Int32T> tmp1; ca_.Bind(&block0, &tmp0, &tmp1); TNode<IntPtrT> tmp2; USE(tmp2); tmp2 = FromConstexpr_intptr_constexpr_int31_0(state_, 4); CodeStubAssembler(state_).StoreReference<Int32T>(CodeStubAssembler::Reference{tmp0, tmp2}, tmp1); ca_.Goto(&block2, tmp0, tmp1); } TNode<SmallOrderedNameDictionary> tmp3; TNode<Int32T> tmp4; ca_.Bind(&block2, &tmp3, &tmp4); } TNode<Uint8T> LoadSmallOrderedNameDictionaryNumberOfElements_0(compiler::CodeAssemblerState* state_, TNode<SmallOrderedNameDictionary> p_o) { compiler::CodeAssembler ca_(state_); compiler::CodeAssemblerParameterizedLabel<SmallOrderedNameDictionary> block0(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<SmallOrderedNameDictionary, Uint8T> block2(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); ca_.Goto(&block0, p_o); if (block0.is_used()) { TNode<SmallOrderedNameDictionary> tmp0; ca_.Bind(&block0, &tmp0); TNode<IntPtrT> tmp1; USE(tmp1); tmp1 = FromConstexpr_intptr_constexpr_int31_0(state_, 8); TNode<Uint8T>tmp2 = CodeStubAssembler(state_).LoadReference<Uint8T>(CodeStubAssembler::Reference{tmp0, tmp1}); ca_.Goto(&block2, tmp0, tmp2); } TNode<SmallOrderedNameDictionary> tmp3; TNode<Uint8T> tmp4; ca_.Bind(&block2, &tmp3, &tmp4); return TNode<Uint8T>{tmp4}; } void StoreSmallOrderedNameDictionaryNumberOfElements_0(compiler::CodeAssemblerState* state_, TNode<SmallOrderedNameDictionary> p_o, TNode<Uint8T> p_v) { compiler::CodeAssembler ca_(state_); compiler::CodeAssemblerParameterizedLabel<SmallOrderedNameDictionary, Uint8T> block0(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<SmallOrderedNameDictionary, Uint8T> block2(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); ca_.Goto(&block0, p_o, p_v); if (block0.is_used()) { TNode<SmallOrderedNameDictionary> tmp0; TNode<Uint8T> tmp1; ca_.Bind(&block0, &tmp0, &tmp1); TNode<IntPtrT> tmp2; USE(tmp2); tmp2 = FromConstexpr_intptr_constexpr_int31_0(state_, 8); CodeStubAssembler(state_).StoreReference<Uint8T>(CodeStubAssembler::Reference{tmp0, tmp2}, tmp1); ca_.Goto(&block2, tmp0, tmp1); } TNode<SmallOrderedNameDictionary> tmp3; TNode<Uint8T> tmp4; ca_.Bind(&block2, &tmp3, &tmp4); } TNode<Uint8T> LoadSmallOrderedNameDictionaryNumberOfDeletedElements_0(compiler::CodeAssemblerState* state_, TNode<SmallOrderedNameDictionary> p_o) { compiler::CodeAssembler ca_(state_); compiler::CodeAssemblerParameterizedLabel<SmallOrderedNameDictionary> block0(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<SmallOrderedNameDictionary, Uint8T> block2(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); ca_.Goto(&block0, p_o); if (block0.is_used()) { TNode<SmallOrderedNameDictionary> tmp0; ca_.Bind(&block0, &tmp0); TNode<IntPtrT> tmp1; USE(tmp1); tmp1 = FromConstexpr_intptr_constexpr_int31_0(state_, 9); TNode<Uint8T>tmp2 = CodeStubAssembler(state_).LoadReference<Uint8T>(CodeStubAssembler::Reference{tmp0, tmp1}); ca_.Goto(&block2, tmp0, tmp2); } TNode<SmallOrderedNameDictionary> tmp3; TNode<Uint8T> tmp4; ca_.Bind(&block2, &tmp3, &tmp4); return TNode<Uint8T>{tmp4}; } void StoreSmallOrderedNameDictionaryNumberOfDeletedElements_0(compiler::CodeAssemblerState* state_, TNode<SmallOrderedNameDictionary> p_o, TNode<Uint8T> p_v) { compiler::CodeAssembler ca_(state_); compiler::CodeAssemblerParameterizedLabel<SmallOrderedNameDictionary, Uint8T> block0(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<SmallOrderedNameDictionary, Uint8T> block2(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); ca_.Goto(&block0, p_o, p_v); if (block0.is_used()) { TNode<SmallOrderedNameDictionary> tmp0; TNode<Uint8T> tmp1; ca_.Bind(&block0, &tmp0, &tmp1); TNode<IntPtrT> tmp2; USE(tmp2); tmp2 = FromConstexpr_intptr_constexpr_int31_0(state_, 9); CodeStubAssembler(state_).StoreReference<Uint8T>(CodeStubAssembler::Reference{tmp0, tmp2}, tmp1); ca_.Goto(&block2, tmp0, tmp1); } TNode<SmallOrderedNameDictionary> tmp3; TNode<Uint8T> tmp4; ca_.Bind(&block2, &tmp3, &tmp4); } TNode<Uint8T> LoadSmallOrderedNameDictionaryNumberOfBuckets_0(compiler::CodeAssemblerState* state_, TNode<SmallOrderedNameDictionary> p_o) { compiler::CodeAssembler ca_(state_); compiler::CodeAssemblerParameterizedLabel<SmallOrderedNameDictionary> block0(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<SmallOrderedNameDictionary, Uint8T> block2(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); ca_.Goto(&block0, p_o); if (block0.is_used()) { TNode<SmallOrderedNameDictionary> tmp0; ca_.Bind(&block0, &tmp0); TNode<IntPtrT> tmp1; USE(tmp1); tmp1 = FromConstexpr_intptr_constexpr_int31_0(state_, 10); TNode<Uint8T>tmp2 = CodeStubAssembler(state_).LoadReference<Uint8T>(CodeStubAssembler::Reference{tmp0, tmp1}); ca_.Goto(&block2, tmp0, tmp2); } TNode<SmallOrderedNameDictionary> tmp3; TNode<Uint8T> tmp4; ca_.Bind(&block2, &tmp3, &tmp4); return TNode<Uint8T>{tmp4}; } void StoreSmallOrderedNameDictionaryNumberOfBuckets_0(compiler::CodeAssemblerState* state_, TNode<SmallOrderedNameDictionary> p_o, TNode<Uint8T> p_v) { compiler::CodeAssembler ca_(state_); compiler::CodeAssemblerParameterizedLabel<SmallOrderedNameDictionary, Uint8T> block0(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<SmallOrderedNameDictionary, Uint8T> block2(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); ca_.Goto(&block0, p_o, p_v); if (block0.is_used()) { TNode<SmallOrderedNameDictionary> tmp0; TNode<Uint8T> tmp1; ca_.Bind(&block0, &tmp0, &tmp1); TNode<IntPtrT> tmp2; USE(tmp2); tmp2 = FromConstexpr_intptr_constexpr_int31_0(state_, 10); CodeStubAssembler(state_).StoreReference<Uint8T>(CodeStubAssembler::Reference{tmp0, tmp2}, tmp1); ca_.Goto(&block2, tmp0, tmp1); } TNode<SmallOrderedNameDictionary> tmp3; TNode<Uint8T> tmp4; ca_.Bind(&block2, &tmp3, &tmp4); } TNode<Uint8T> LoadSmallOrderedNameDictionaryPadding_0(compiler::CodeAssemblerState* state_, TNode<SmallOrderedNameDictionary> p_o) { compiler::CodeAssembler ca_(state_); compiler::CodeAssemblerParameterizedLabel<SmallOrderedNameDictionary> block0(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<SmallOrderedNameDictionary, Uint8T> block2(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); ca_.Goto(&block0, p_o); if (block0.is_used()) { TNode<SmallOrderedNameDictionary> tmp0; ca_.Bind(&block0, &tmp0); TNode<IntPtrT> tmp1; USE(tmp1); tmp1 = FromConstexpr_intptr_constexpr_int31_0(state_, 11); TNode<Uint8T>tmp2 = CodeStubAssembler(state_).LoadReference<Uint8T>(CodeStubAssembler::Reference{tmp0, tmp1}); ca_.Goto(&block2, tmp0, tmp2); } TNode<SmallOrderedNameDictionary> tmp3; TNode<Uint8T> tmp4; ca_.Bind(&block2, &tmp3, &tmp4); return TNode<Uint8T>{tmp4}; } void StoreSmallOrderedNameDictionaryPadding_0(compiler::CodeAssemblerState* state_, TNode<SmallOrderedNameDictionary> p_o, TNode<Uint8T> p_v) { compiler::CodeAssembler ca_(state_); compiler::CodeAssemblerParameterizedLabel<SmallOrderedNameDictionary, Uint8T> block0(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<SmallOrderedNameDictionary, Uint8T> block2(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); ca_.Goto(&block0, p_o, p_v); if (block0.is_used()) { TNode<SmallOrderedNameDictionary> tmp0; TNode<Uint8T> tmp1; ca_.Bind(&block0, &tmp0, &tmp1); TNode<IntPtrT> tmp2; USE(tmp2); tmp2 = FromConstexpr_intptr_constexpr_int31_0(state_, 11); CodeStubAssembler(state_).StoreReference<Uint8T>(CodeStubAssembler::Reference{tmp0, tmp2}, tmp1); ca_.Goto(&block2, tmp0, tmp1); } TNode<SmallOrderedNameDictionary> tmp3; TNode<Uint8T> tmp4; ca_.Bind(&block2, &tmp3, &tmp4); } TorqueStructConstantIterator_uint8_0 ConstantIterator_uint8_0(compiler::CodeAssemblerState* state_, TNode<Uint8T> p_value) { compiler::CodeAssembler ca_(state_); compiler::CodeAssemblerParameterizedLabel<Uint8T> block0(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<Uint8T, Uint8T> block2(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); ca_.Goto(&block0, p_value); if (block0.is_used()) { TNode<Uint8T> tmp0; ca_.Bind(&block0, &tmp0); ca_.Goto(&block2, tmp0, tmp0); } TNode<Uint8T> tmp1; TNode<Uint8T> tmp2; ca_.Bind(&block2, &tmp1, &tmp2); return TorqueStructConstantIterator_uint8_0{TNode<Uint8T>{tmp2}}; } void InitializeFieldsFromIterator_uint8_ConstantIterator_uint8_0(compiler::CodeAssemblerState* state_, TorqueStructSlice_uint8_0 p_target, TorqueStructConstantIterator_uint8_0 p_originIterator) { compiler::CodeAssembler ca_(state_); compiler::CodeAssemblerParameterizedLabel<HeapObject, IntPtrT, IntPtrT, Uint8T> block0(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<HeapObject, IntPtrT, IntPtrT, Uint8T, HeapObject, IntPtrT, IntPtrT, Uint8T> block5(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<HeapObject, IntPtrT, IntPtrT, Uint8T, HeapObject, IntPtrT, IntPtrT, Uint8T> block3(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<HeapObject, IntPtrT, IntPtrT, Uint8T, HeapObject, IntPtrT, IntPtrT, Uint8T> block9(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<HeapObject, IntPtrT, IntPtrT, Uint8T, HeapObject, IntPtrT, IntPtrT, Uint8T> block10(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<HeapObject, IntPtrT, IntPtrT, Uint8T, HeapObject, IntPtrT, IntPtrT, Uint8T> block4(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<HeapObject, IntPtrT, IntPtrT, Uint8T> block16(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); ca_.Goto(&block0, p_target.object, p_target.offset, p_target.length, p_originIterator.value); if (block0.is_used()) { TNode<HeapObject> tmp0; TNode<IntPtrT> tmp1; TNode<IntPtrT> tmp2; TNode<Uint8T> tmp3; ca_.Bind(&block0, &tmp0, &tmp1, &tmp2, &tmp3); TNode<IntPtrT> tmp4; USE(tmp4); tmp4 = FromConstexpr_intptr_constexpr_int31_0(state_, kUInt8Size); TNode<IntPtrT> tmp5; USE(tmp5); tmp5 = CodeStubAssembler(state_).IntPtrMul(TNode<IntPtrT>{tmp2}, TNode<IntPtrT>{tmp4}); TNode<IntPtrT> tmp6; USE(tmp6); tmp6 = CodeStubAssembler(state_).IntPtrAdd(TNode<IntPtrT>{tmp1}, TNode<IntPtrT>{tmp5}); ca_.Goto(&block5, tmp0, tmp1, tmp2, tmp3, tmp0, tmp1, tmp6, tmp3); } if (block5.is_used()) { TNode<HeapObject> tmp7; TNode<IntPtrT> tmp8; TNode<IntPtrT> tmp9; TNode<Uint8T> tmp10; TNode<HeapObject> tmp11; TNode<IntPtrT> tmp12; TNode<IntPtrT> tmp13; TNode<Uint8T> tmp14; ca_.Bind(&block5, &tmp7, &tmp8, &tmp9, &tmp10, &tmp11, &tmp12, &tmp13, &tmp14); TNode<BoolT> tmp15; USE(tmp15); tmp15 = FromConstexpr_bool_constexpr_bool_0(state_, true); ca_.Branch(tmp15, &block3, &block4, tmp7, tmp8, tmp9, tmp10, tmp11, tmp12, tmp13, tmp14); } if (block3.is_used()) { TNode<HeapObject> tmp16; TNode<IntPtrT> tmp17; TNode<IntPtrT> tmp18; TNode<Uint8T> tmp19; TNode<HeapObject> tmp20; TNode<IntPtrT> tmp21; TNode<IntPtrT> tmp22; TNode<Uint8T> tmp23; ca_.Bind(&block3, &tmp16, &tmp17, &tmp18, &tmp19, &tmp20, &tmp21, &tmp22, &tmp23); TNode<BoolT> tmp24; USE(tmp24); tmp24 = CodeStubAssembler(state_).WordEqual(TNode<IntPtrT>{tmp21}, TNode<IntPtrT>{tmp22}); ca_.Branch(tmp24, &block9, &block10, tmp16, tmp17, tmp18, tmp19, tmp20, tmp21, tmp22, tmp23); } if (block9.is_used()) { TNode<HeapObject> tmp25; TNode<IntPtrT> tmp26; TNode<IntPtrT> tmp27; TNode<Uint8T> tmp28; TNode<HeapObject> tmp29; TNode<IntPtrT> tmp30; TNode<IntPtrT> tmp31; TNode<Uint8T> tmp32; ca_.Bind(&block9, &tmp25, &tmp26, &tmp27, &tmp28, &tmp29, &tmp30, &tmp31, &tmp32); ca_.Goto(&block4, tmp25, tmp26, tmp27, tmp28, tmp29, tmp30, tmp31, tmp32); } if (block10.is_used()) { TNode<HeapObject> tmp33; TNode<IntPtrT> tmp34; TNode<IntPtrT> tmp35; TNode<Uint8T> tmp36; TNode<HeapObject> tmp37; TNode<IntPtrT> tmp38; TNode<IntPtrT> tmp39; TNode<Uint8T> tmp40; ca_.Bind(&block10, &tmp33, &tmp34, &tmp35, &tmp36, &tmp37, &tmp38, &tmp39, &tmp40); TNode<HeapObject> tmp41; USE(tmp41); TNode<IntPtrT> tmp42; USE(tmp42); std::tie(tmp41, tmp42) = UnsafeNewReference_uint8_0(state_, TNode<HeapObject>{tmp37}, TNode<IntPtrT>{tmp38}).Flatten(); TNode<IntPtrT> tmp43; USE(tmp43); tmp43 = FromConstexpr_intptr_constexpr_int31_0(state_, kUInt8Size); TNode<IntPtrT> tmp44; USE(tmp44); tmp44 = CodeStubAssembler(state_).IntPtrAdd(TNode<IntPtrT>{tmp38}, TNode<IntPtrT>{tmp43}); CodeStubAssembler(state_).StoreReference<Uint8T>(CodeStubAssembler::Reference{tmp41, tmp42}, tmp40); ca_.Goto(&block5, tmp33, tmp34, tmp35, tmp36, tmp37, tmp44, tmp39, tmp40); } if (block4.is_used()) { TNode<HeapObject> tmp45; TNode<IntPtrT> tmp46; TNode<IntPtrT> tmp47; TNode<Uint8T> tmp48; TNode<HeapObject> tmp49; TNode<IntPtrT> tmp50; TNode<IntPtrT> tmp51; TNode<Uint8T> tmp52; ca_.Bind(&block4, &tmp45, &tmp46, &tmp47, &tmp48, &tmp49, &tmp50, &tmp51, &tmp52); ca_.Goto(&block16, tmp45, tmp46, tmp47, tmp48); } TNode<HeapObject> tmp53; TNode<IntPtrT> tmp54; TNode<IntPtrT> tmp55; TNode<Uint8T> tmp56; ca_.Bind(&block16, &tmp53, &tmp54, &tmp55, &tmp56); } void InitializeFieldsFromIterator_JSReceiver_OR_Smi_OR_HeapNumber_OR_BigInt_OR_String_OR_Symbol_OR_True_OR_False_OR_Null_OR_Undefined_OR_TheHole_ConstantIterator_TheHole_0(compiler::CodeAssemblerState* state_, TorqueStructSlice_JSReceiver_OR_Smi_OR_HeapNumber_OR_BigInt_OR_String_OR_Symbol_OR_True_OR_False_OR_Null_OR_Undefined_OR_TheHole_0 p_target, TorqueStructConstantIterator_TheHole_0 p_originIterator) { compiler::CodeAssembler ca_(state_); compiler::CodeAssemblerParameterizedLabel<HeapObject, IntPtrT, IntPtrT, Oddball> block0(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<HeapObject, IntPtrT, IntPtrT, Oddball, HeapObject, IntPtrT, IntPtrT, Oddball> block5(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<HeapObject, IntPtrT, IntPtrT, Oddball, HeapObject, IntPtrT, IntPtrT, Oddball> block3(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<HeapObject, IntPtrT, IntPtrT, Oddball, HeapObject, IntPtrT, IntPtrT, Oddball> block9(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<HeapObject, IntPtrT, IntPtrT, Oddball, HeapObject, IntPtrT, IntPtrT, Oddball> block10(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<HeapObject, IntPtrT, IntPtrT, Oddball, HeapObject, IntPtrT, IntPtrT, Oddball> block4(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<HeapObject, IntPtrT, IntPtrT, Oddball> block16(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); ca_.Goto(&block0, p_target.object, p_target.offset, p_target.length, p_originIterator.value); if (block0.is_used()) { TNode<HeapObject> tmp0; TNode<IntPtrT> tmp1; TNode<IntPtrT> tmp2; TNode<Oddball> tmp3; ca_.Bind(&block0, &tmp0, &tmp1, &tmp2, &tmp3); TNode<IntPtrT> tmp4; USE(tmp4); tmp4 = FromConstexpr_intptr_constexpr_int31_0(state_, kTaggedSize); TNode<IntPtrT> tmp5; USE(tmp5); tmp5 = CodeStubAssembler(state_).IntPtrMul(TNode<IntPtrT>{tmp2}, TNode<IntPtrT>{tmp4}); TNode<IntPtrT> tmp6; USE(tmp6); tmp6 = CodeStubAssembler(state_).IntPtrAdd(TNode<IntPtrT>{tmp1}, TNode<IntPtrT>{tmp5}); ca_.Goto(&block5, tmp0, tmp1, tmp2, tmp3, tmp0, tmp1, tmp6, tmp3); } if (block5.is_used()) { TNode<HeapObject> tmp7; TNode<IntPtrT> tmp8; TNode<IntPtrT> tmp9; TNode<Oddball> tmp10; TNode<HeapObject> tmp11; TNode<IntPtrT> tmp12; TNode<IntPtrT> tmp13; TNode<Oddball> tmp14; ca_.Bind(&block5, &tmp7, &tmp8, &tmp9, &tmp10, &tmp11, &tmp12, &tmp13, &tmp14); TNode<BoolT> tmp15; USE(tmp15); tmp15 = FromConstexpr_bool_constexpr_bool_0(state_, true); ca_.Branch(tmp15, &block3, &block4, tmp7, tmp8, tmp9, tmp10, tmp11, tmp12, tmp13, tmp14); } if (block3.is_used()) { TNode<HeapObject> tmp16; TNode<IntPtrT> tmp17; TNode<IntPtrT> tmp18; TNode<Oddball> tmp19; TNode<HeapObject> tmp20; TNode<IntPtrT> tmp21; TNode<IntPtrT> tmp22; TNode<Oddball> tmp23; ca_.Bind(&block3, &tmp16, &tmp17, &tmp18, &tmp19, &tmp20, &tmp21, &tmp22, &tmp23); TNode<BoolT> tmp24; USE(tmp24); tmp24 = CodeStubAssembler(state_).WordEqual(TNode<IntPtrT>{tmp21}, TNode<IntPtrT>{tmp22}); ca_.Branch(tmp24, &block9, &block10, tmp16, tmp17, tmp18, tmp19, tmp20, tmp21, tmp22, tmp23); } if (block9.is_used()) { TNode<HeapObject> tmp25; TNode<IntPtrT> tmp26; TNode<IntPtrT> tmp27; TNode<Oddball> tmp28; TNode<HeapObject> tmp29; TNode<IntPtrT> tmp30; TNode<IntPtrT> tmp31; TNode<Oddball> tmp32; ca_.Bind(&block9, &tmp25, &tmp26, &tmp27, &tmp28, &tmp29, &tmp30, &tmp31, &tmp32); ca_.Goto(&block4, tmp25, tmp26, tmp27, tmp28, tmp29, tmp30, tmp31, tmp32); } if (block10.is_used()) { TNode<HeapObject> tmp33; TNode<IntPtrT> tmp34; TNode<IntPtrT> tmp35; TNode<Oddball> tmp36; TNode<HeapObject> tmp37; TNode<IntPtrT> tmp38; TNode<IntPtrT> tmp39; TNode<Oddball> tmp40; ca_.Bind(&block10, &tmp33, &tmp34, &tmp35, &tmp36, &tmp37, &tmp38, &tmp39, &tmp40); TNode<HeapObject> tmp41; USE(tmp41); TNode<IntPtrT> tmp42; USE(tmp42); std::tie(tmp41, tmp42) = UnsafeNewReference_JSReceiver_OR_Smi_OR_HeapNumber_OR_BigInt_OR_String_OR_Symbol_OR_True_OR_False_OR_Null_OR_Undefined_OR_TheHole_0(state_, TNode<HeapObject>{tmp37}, TNode<IntPtrT>{tmp38}).Flatten(); TNode<IntPtrT> tmp43; USE(tmp43); tmp43 = FromConstexpr_intptr_constexpr_int31_0(state_, kTaggedSize); TNode<IntPtrT> tmp44; USE(tmp44); tmp44 = CodeStubAssembler(state_).IntPtrAdd(TNode<IntPtrT>{tmp38}, TNode<IntPtrT>{tmp43}); CodeStubAssembler(state_).StoreReference<Object>(CodeStubAssembler::Reference{tmp41, tmp42}, tmp40); ca_.Goto(&block5, tmp33, tmp34, tmp35, tmp36, tmp37, tmp44, tmp39, tmp40); } if (block4.is_used()) { TNode<HeapObject> tmp45; TNode<IntPtrT> tmp46; TNode<IntPtrT> tmp47; TNode<Oddball> tmp48; TNode<HeapObject> tmp49; TNode<IntPtrT> tmp50; TNode<IntPtrT> tmp51; TNode<Oddball> tmp52; ca_.Bind(&block4, &tmp45, &tmp46, &tmp47, &tmp48, &tmp49, &tmp50, &tmp51, &tmp52); ca_.Goto(&block16, tmp45, tmp46, tmp47, tmp48); } TNode<HeapObject> tmp53; TNode<IntPtrT> tmp54; TNode<IntPtrT> tmp55; TNode<Oddball> tmp56; ca_.Bind(&block16, &tmp53, &tmp54, &tmp55, &tmp56); } TorqueStructConstantIterator_HashMapEntry_0 ConstantIterator_HashMapEntry_0(compiler::CodeAssemblerState* state_, TorqueStructHashMapEntry_0 p_value) { compiler::CodeAssembler ca_(state_); compiler::CodeAssemblerParameterizedLabel<Object, Object> block0(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<Object, Object, Object, Object> block2(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); ca_.Goto(&block0, p_value.key, p_value.value); if (block0.is_used()) { TNode<Object> tmp0; TNode<Object> tmp1; ca_.Bind(&block0, &tmp0, &tmp1); ca_.Goto(&block2, tmp0, tmp1, tmp0, tmp1); } TNode<Object> tmp2; TNode<Object> tmp3; TNode<Object> tmp4; TNode<Object> tmp5; ca_.Bind(&block2, &tmp2, &tmp3, &tmp4, &tmp5); return TorqueStructConstantIterator_HashMapEntry_0{TorqueStructHashMapEntry_0{TNode<Object>{tmp4}, TNode<Object>{tmp5}}}; } void InitializeFieldsFromIterator_HashMapEntry_ConstantIterator_HashMapEntry_0(compiler::CodeAssemblerState* state_, TorqueStructSlice_HashMapEntry_0 p_target, TorqueStructConstantIterator_HashMapEntry_0 p_originIterator) { compiler::CodeAssembler ca_(state_); compiler::CodeAssemblerParameterizedLabel<HeapObject, IntPtrT, IntPtrT, Object, Object> block0(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<HeapObject, IntPtrT, IntPtrT, Object, Object, HeapObject, IntPtrT, IntPtrT, Object, Object> block5(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<HeapObject, IntPtrT, IntPtrT, Object, Object, HeapObject, IntPtrT, IntPtrT, Object, Object> block3(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<HeapObject, IntPtrT, IntPtrT, Object, Object, HeapObject, IntPtrT, IntPtrT, Object, Object> block9(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<HeapObject, IntPtrT, IntPtrT, Object, Object, HeapObject, IntPtrT, IntPtrT, Object, Object> block10(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<HeapObject, IntPtrT, IntPtrT, Object, Object, HeapObject, IntPtrT, IntPtrT, Object, Object> block4(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); compiler::CodeAssemblerParameterizedLabel<HeapObject, IntPtrT, IntPtrT, Object, Object> block16(&ca_, compiler::CodeAssemblerLabel::kNonDeferred); ca_.Goto(&block0, p_target.object, p_target.offset, p_target.length, p_originIterator.value.key, p_originIterator.value.value); if (block0.is_used()) { TNode<HeapObject> tmp0; TNode<IntPtrT> tmp1; TNode<IntPtrT> tmp2; TNode<Object> tmp3; TNode<Object> tmp4; ca_.Bind(&block0, &tmp0, &tmp1, &tmp2, &tmp3, &tmp4); TNode<IntPtrT> tmp5; USE(tmp5); tmp5 = FromConstexpr_intptr_constexpr_int31_0(state_, 8); TNode<IntPtrT> tmp6; USE(tmp6); tmp6 = CodeStubAssembler(state_).IntPtrMul(TNode<IntPtrT>{tmp2}, TNode<IntPtrT>{tmp5}); TNode<IntPtrT> tmp7; USE(tmp7); tmp7 = CodeStubAssembler(state_).IntPtrAdd(TNode<IntPtrT>{tmp1}, TNode<IntPtrT>{tmp6}); ca_.Goto(&block5, tmp0, tmp1, tmp2, tmp3, tmp4, tmp0, tmp1, tmp7, tmp3, tmp4); } if (block5.is_used()) { TNode<HeapObject> tmp8; TNode<IntPtrT> tmp9; TNode<IntPtrT> tmp10; TNode<Object> tmp11; TNode<Object> tmp12; TNode<HeapObject> tmp13; TNode<IntPtrT> tmp14; TNode<IntPtrT> tmp15; TNode<Object> tmp16; TNode<Object> tmp17; ca_.Bind(&block5, &tmp8, &tmp9, &tmp10, &tmp11, &tmp12, &tmp13, &tmp14, &tmp15, &tmp16, &tmp17); TNode<BoolT> tmp18; USE(tmp18); tmp18 = FromConstexpr_bool_constexpr_bool_0(state_, true); ca_.Branch(tmp18, &block3, &block4, tmp8, tmp9, tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16, tmp17); } if (block3.is_used()) { TNode<HeapObject> tmp19; TNode<IntPtrT> tmp20; TNode<IntPtrT> tmp21; TNode<Object> tmp22; TNode<Object> tmp23; TNode<HeapObject> tmp24; TNode<IntPtrT> tmp25; TNode<IntPtrT> tmp26; TNode<Object> tmp27; TNode<Object> tmp28; ca_.Bind(&block3, &tmp19, &tmp20, &tmp21, &tmp22, &tmp23, &tmp24, &tmp25, &tmp26, &tmp27, &tmp28); TNode<BoolT> tmp29; USE(tmp29); tmp29 = CodeStubAssembler(state_).WordEqual(TNode<IntPtrT>{tmp25}, TNode<IntPtrT>{tmp26}); ca_.Branch(tmp29, &block9, &block10, tmp19, tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27, tmp28); } if (block9.is_used()) { TNode<HeapObject> tmp30; TNode<IntPtrT> tmp31; TNode<IntPtrT> tmp32; TNode<Object> tmp33; TNode<Object> tmp34; TNode<HeapObject> tmp35; TNode<IntPtrT> tmp36; TNode<IntPtrT> tmp37; TNode<Object> tmp38; TNode<Object> tmp39; ca_.Bind(&block9, &tmp30, &tmp31, &tmp32, &tmp33, &tmp34, &tmp35, &tmp36, &tmp37, &tmp38, &tmp39); ca_.Goto(&block4, tmp30, tmp31, tmp32, tmp33, tmp34, tmp35, tmp36, tmp37, tmp38, tmp39); } if (block10.is_used()) { TNode<HeapObject> tmp40; TNode<IntPtrT> tmp41; TNode<IntPtrT> tmp42; TNode<Object> tmp43; TNode<Object> tmp44; TNode<HeapObject> tmp45; TNode<IntPtrT> tmp46; TNode<IntPtrT> tmp47; TNode<Object> tmp48; TNode<Object> tmp49; ca_.Bind(&block10, &tmp40, &tmp41, &tmp42, &tmp43, &tmp44, &tmp45, &tmp46, &tmp47, &tmp48, &tmp49); TNode<HeapObject> tmp50; USE(tmp50); TNode<IntPtrT> tmp51; USE(tmp51); std::tie(tmp50, tmp51) = UnsafeNewReference_HashMapEntry_0(state_, TNode<HeapObject>{tmp45}, TNode<IntPtrT>{tmp46}).Flatten(); TNode<IntPtrT> tmp52; USE(tmp52); tmp52 = FromConstexpr_intptr_constexpr_int31_0(state_, 8); TNode<IntPtrT> tmp53; USE(tmp53); tmp53 = CodeStubAssembler(state_).IntPtrAdd(TNode<IntPtrT>{tmp46}, TNode<IntPtrT>{tmp52}); CodeStubAssembler(state_).StoreReference<Object>(CodeStubAssembler::Reference{tmp50, tmp51}, tmp48); TNode<IntPtrT> tmp54; USE(tmp54); tmp54 = FromConstexpr_intptr_constexpr_intptr_0(state_, 4); TNode<IntPtrT> tmp55; USE(tmp55); tmp55 = CodeStubAssembler(state_).IntPtrAdd(TNode<IntPtrT>{tmp51}, TNode<IntPtrT>{tmp54}); CodeStubAssembler(state_).StoreReference<Object>(CodeStubAssembler::Reference{tmp50, tmp55}, tmp49); ca_.Goto(&block5, tmp40, tmp41, tmp42, tmp43, tmp44, tmp45, tmp53, tmp47, tmp48, tmp49); } if (block4.is_used()) { TNode<HeapObject> tmp56; TNode<IntPtrT> tmp57; TNode<IntPtrT> tmp58; TNode<Object> tmp59; TNode<Object> tmp60; TNode<HeapObject> tmp61; TNode<IntPtrT> tmp62; TNode<IntPtrT> tmp63; TNode<Object> tmp64; TNode<Object> tmp65; ca_.Bind(&block4, &tmp56, &tmp57, &tmp58, &tmp59, &tmp60, &tmp61, &tmp62, &tmp63, &tmp64, &tmp65); ca_.Goto(&block16, tmp56, tmp57, tmp58, tmp59, tmp60); } TNode<HeapObject> tmp66; TNode<IntPtrT> tmp67; TNode<IntPtrT> tmp68; TNode<Object> tmp69; TNode<Object> tmp70; ca_.Bind(&block16, &tmp66, &tmp67, &tmp68, &tmp69, &tmp70); } } // namespace internal } // namespace v8
[ "xueqi@zjmedia.net" ]
xueqi@zjmedia.net
d7bdb6892536be83d247306382b6d9fd2383dccd
6ecbf084f558b37f0cee51c7226c1e116b5aa7bf
/SIR/.SIR/build_openmp_sse/src/model/var/VarCoord13.hpp
3a4c45ff3065292477f1636fff06ee951f483f88
[]
no_license
reichlab/bayesian_non_parametric
364b12ad07b09e9a4386572bd47c709ad7629497
c8d7eb7493addb919b8f7159768dc732ce1a1f35
refs/heads/master
2021-01-01T06:43:10.176687
2018-03-25T14:33:32
2018-03-25T14:33:32
97,492,688
2
0
null
2018-01-02T15:23:21
2017-07-17T15:38:01
Python
UTF-8
C++
false
false
1,798
hpp
/** * @file * * @author Generated by LibBi * $Rev$ * $Date$ */ #ifndef LIBBI_VARCOORD13_HPP #define LIBBI_VARCOORD13_HPP /** * Coordinate: 13. */ class VarCoord13 { public: /** * Default constructor. */ CUDA_FUNC_BOTH VarCoord13(); /** * Construct from serial index. * * @param ix Serial index. */ CUDA_FUNC_BOTH VarCoord13(const int ix); /** * Increment to next coordinate in serial ordering. */ CUDA_FUNC_BOTH void inc(); /** * Decrement to previous coordinate in serial ordering. */ CUDA_FUNC_BOTH void dec(); /** * Recover serial index. * * @return Serial index for coordinate. */ CUDA_FUNC_BOTH int index() const; /** * Set serial index. * * @param ix Serial index for coordinate. * * Sets the coordinate to be equivalent to the given serial index. */ CUDA_FUNC_BOTH void setIndex(const int ix); /** * Prefix increment operator. */ CUDA_FUNC_BOTH VarCoord13& operator++() { inc(); return *this; } /** * Postfix increment operator. */ CUDA_FUNC_BOTH VarCoord13 operator++(int) { VarCoord13 tmp(*this); inc(); return tmp; } /** * Prefix decrement operator. */ CUDA_FUNC_BOTH VarCoord13& operator--() { dec(); return *this; } /** * Postfix decrement operator. */ CUDA_FUNC_BOTH VarCoord13 operator--(int) { VarCoord13 tmp(*this); dec(); return tmp; } }; inline VarCoord13::VarCoord13() { } inline VarCoord13::VarCoord13(const int ix) { setIndex(ix); } inline void VarCoord13::inc() { } inline void VarCoord13::dec() { } inline int VarCoord13::index() const { return 0; } inline void VarCoord13::setIndex(const int ix) { } #endif
[ "gcgibson@1x-nat-vl931-172-30-142-196.wireless.umass.edu" ]
gcgibson@1x-nat-vl931-172-30-142-196.wireless.umass.edu
d89c75df6685589fa0702a74ded642d19b1916d8
701e220bb13e5efdc0de945a8d179d53f81d94bb
/42/Piscine C++/erobert/d05/ex01/Form.hpp
d98c4db0dcd4353e8cbd283103a4929f3c3ec0cb
[]
no_license
Elojah/Meuh2.0
486273ac9d5192c6f945f5ed9a56b3582f2aafb0
1706b6cd96deb56af8ab5b2164c05584435c7e35
refs/heads/master
2021-01-11T18:20:18.614432
2017-05-19T14:35:10
2017-05-19T14:35:10
28,937,663
0
0
null
null
null
null
UTF-8
C++
false
false
2,194
hpp
// ************************************************************************** // // // // ::: :::::::: // // Form.hpp :+: :+: :+: // // +:+ +:+ +:+ // // By: erobert <erobert@student.42.fr> +#+ +:+ +#+ // // +#+#+#+#+#+ +#+ // // Created: 2015/01/12 11:53:49 by erobert #+# #+# // // Updated: 2015/01/12 13:21:41 by erobert ### ########.fr // // // // ************************************************************************** // #ifndef FORM_HPP # define FORM_HPP # include <string> # include "Bureaucrat.hpp" class Form { private: std::string const _name; int const _sGrade; int const _eGrade; bool _signed; Form(void); Form(Form const &f); Form &operator=(Form const &f); public: Form(std::string const &name, int const sGrade, int const eGrade); ~Form(void); std::string const &getName(void) const; int getSGrade(void) const; int getEGrade(void) const; bool getSigned(void) const; void beSigned(Bureaucrat const &b); class GradeTooHighException: public std::exception { private: GradeTooHighException &operator=(GradeTooHighException const &gTHE); public: GradeTooHighException(void); GradeTooHighException(GradeTooHighException const &gTHE); virtual ~GradeTooHighException(void) throw(); virtual char const *what(void) const throw(); }; class GradeTooLowException: public std::exception { private: GradeTooLowException &operator=(GradeTooLowException const &gTLE); public: GradeTooLowException(void); GradeTooLowException(GradeTooLowException const &gTLE); virtual ~GradeTooLowException(void) throw(); virtual char const *what(void) const throw(); }; }; std::ostream &operator<<(std::ostream &os, Form &f); #endif
[ "erobert@student.42.fr" ]
erobert@student.42.fr
a256796cd624245ee981c5f9323fc6e73f1a1df8
dcd70031041dabecc6abfa5f2847c299fc7fef70
/백준/1520_내리막길.cpp
b956bf6859897086364e01dacfc72586f80ca00f
[]
no_license
JJJoonngg/Algorithm
cab395760ef604a1764391847473c838e3beac9f
32d574558c1747008e7ac3dfe4f9d4f07c58a58b
refs/heads/master
2021-06-21T01:01:36.302243
2021-03-24T14:01:06
2021-03-24T14:01:06
196,032,101
1
0
null
null
null
null
UHC
C++
false
false
2,588
cpp
/* https://www.acmicpc.net/problem/1520 문제 지도가 주어질 때 이와 같이 제일 왼쪽 위 지점에서 출발하여 제일 오른쪽 아래 지점까지 항상 내리막길로만 이동하는 경로의 개수를 구하는 프로그램을 작성하시오. 입력 첫째 줄에는 지도의 세로의 크기 M과 가로의 크기 N이 빈칸을 사이에 두고 주어진다. 이어 다음 M개 줄에 걸쳐 한 줄에 N개씩 위에서부터 차례로 각 지점의 높이가 빈 칸을 사이에 두고 주어진다. M과 N은 각각 500이하의 자연수이고, 각 지점의 높이는 10000이하의 자연수이다. 4 5 50 45 37 32 30 35 50 40 20 25 30 30 25 17 28 27 24 22 15 10 출력 첫째 줄에 이동 가능한 경로의 수 H를 출력한다. 모든 입력에 대하여 H는 10억 이하의 음이 아닌 정수이다. 3 */ //Bottom-up //#include <iostream> //#include <string.h> //#define MAXI 500 + 1 //using namespace std; //int dx[] = { 0,0,1,-1 }; //int dy[] = { -1,1,0,0 }; //int map[MAXI][MAXI]; //int dp[MAXI][MAXI]; //int n, m; //bool checkRange(int x, int y) { return 0 < x && x <= n && 0 < y && y <= m; } //int dfs(int x, int y) { // if (dp[x][y] != -1) return dp[x][y]; // if (!checkRange(x, y)) return 0; // if (x == 1 && y == 1) return 1; // dp[x][y] = 0; // for (int i = 0; i < 4; i++) { // int nextX = x + dx[i]; // int nextY = y + dy[i]; // if (map[nextX][nextY] > map[x][y]) { // dp[x][y] += dfs(nextX, nextY); // } // } // return dp[x][y]; //} //int main() { // std::ios::sync_with_stdio(false); // cin.tie(NULL); cout.tie(NULL); // cin >> n >> m; // for (int i = 1; i <= n; i++) // for (int j = 1; j <= m; j++) // cin >> map[i][j]; // memset(dp, -1, sizeof(dp)); // cout << dfs(n, m) << "\n"; //} //Top-down #include <iostream> #include <string.h> #define MAXI 500 + 1 using namespace std; int dx[] = { 0,0,1,-1 }; int dy[] = { -1,1,0,0 }; int map[MAXI][MAXI]; int dp[MAXI][MAXI]; int n, m; bool checkRange(int x, int y) { return 0 < x && x <= n && 0 < y && y <= m; } int dfs(int x, int y) { if (dp[x][y] != -1) return dp[x][y]; if (!checkRange(x, y)) return 0; if (x == n && y == m) return 1; dp[x][y] = 0; for (int i = 0; i < 4; i++) { int nextX = x + dx[i]; int nextY = y + dy[i]; if (map[nextX][nextY] < map[x][y]) { dp[x][y] += dfs(nextX, nextY); } } return dp[x][y]; } int main() { std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin >> n >> m; for (int i = 1; i <= n; i++) for (int j = 1; j <= m; j++) cin >> map[i][j]; memset(dp, -1, sizeof(dp)); cout << dfs(1, 1) << "\n"; }
[ "whdtls3878@gmail.com" ]
whdtls3878@gmail.com
9be393d127ea30fbbf6ad002d711a808cf621a9c
9787a93624dca250bb34eb8d7558ec6cf693467c
/task-3a-empty.cc
437f866ea373f114c21370b39414b60ef4753ed6
[]
no_license
peterrum/dealii-hereon-workshop
bdeda800f02ee36a6280e0aa1d4b52a6721861e0
b6f7ae5be1ea2b7a4352274009b313c4e7f1f778
refs/heads/master
2023-04-07T09:26:59.122015
2021-04-21T12:47:29
2021-04-21T12:47:29
null
0
0
null
null
null
null
UTF-8
C++
false
false
7,346
cc
// --------------------------------------------------------------------- // // Copyright (C) 2021 by the deal.II authors // // This file is part of the deal.II library. // // The deal.II library is free software; you can use it, redistribute // it, and/or modify it under the terms of the GNU Lesser General // Public License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // The full text of the license can be found in the file LICENSE.md at // the top level directory of deal.II. // // --------------------------------------------------------------------- #include <deal.II/distributed/tria.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_system.h> #include <deal.II/grid/grid_generator.h> #include <deal.II/lac/dynamic_sparsity_pattern.h> #include <deal.II/lac/la_vector.h> #include <deal.II/lac/precondition.h> #include <deal.II/lac/solver_cg.h> #include <deal.II/lac/solver_control.h> #include <deal.II/lac/sparse_matrix.h> #include <deal.II/lac/sparsity_pattern.h> #include <deal.II/numerics/data_out.h> #include <deal.II/numerics/vector_tools.h> using namespace dealii; /** * Return stress-strain tensor. */ template <int dim> SymmetricTensor<4, dim> get_stress_strain_tensor(const double lambda, const double mu) { SymmetricTensor<4, dim> tmp; for (unsigned int i = 0; i < dim; ++i) for (unsigned int j = 0; j < dim; ++j) for (unsigned int k = 0; k < dim; ++k) for (unsigned int l = 0; l < dim; ++l) tmp[i][j][k][l] = (((i == k) && (j == l) ? mu : 0.0) + ((i == l) && (j == k) ? mu : 0.0) + ((i == j) && (k == l) ? lambda : 0.0)); return tmp; } /** * Compute strain. */ template <int dim> inline SymmetricTensor<2, dim> get_strain(const FEValues<dim> &fe_values, const unsigned int shape_func, const unsigned int q_point) { SymmetricTensor<2, dim> tmp; for (unsigned int i = 0; i < dim; ++i) tmp[i][i] = fe_values.shape_grad_component(shape_func, q_point, i)[i]; for (unsigned int i = 0; i < dim; ++i) for (unsigned int j = i + 1; j < dim; ++j) tmp[i][j] = (fe_values.shape_grad_component(shape_func, q_point, i)[j] + fe_values.shape_grad_component(shape_func, q_point, j)[i]) / 2; return tmp; } int main() { const unsigned int dim = 2, degree = 1, n_refinements = 0; // create mesh, select relevant FEM ingredients, and set up DoFHandler Triangulation<dim> tria; GridGenerator::subdivided_hyper_rectangle( tria, {10, 2}, Point<dim>(0, 0), Point<dim>(1, 0.2), true); tria.refine_global(n_refinements); FESystem<dim> fe(FE_Q<dim>(degree), dim); QGauss<dim> quad(degree + 1); QGauss<dim - 1> face_quad(degree + 1); MappingQGeneric<dim> mapping(1); DoFHandler<dim> dof_handler(tria); dof_handler.distribute_dofs(fe); // Create constraint matrix AffineConstraints<double> constraints; // ... fill constraint matrix VectorTools::interpolate_boundary_values(dof_handler, 0, // left face Functions::ConstantFunction<dim>( std::vector<double>{0.0, 0.0}), constraints); // compute traction Tensor<1, dim> traction; traction[0] = +0e9; // x-direction traction[1] = -1e9; // y-direction // compute stress strain tensor const auto stress_strain_tensor = get_stress_strain_tensor<dim>(9.695e10, 7.617e10); // ... finalize constraint matrix constraints.close(); // initialize vectors and system matrix Vector<double> x(dof_handler.n_dofs()), b(dof_handler.n_dofs()); SparseMatrix<double> A; SparsityPattern sparsity_pattern; DynamicSparsityPattern dsp(dof_handler.n_dofs()); DoFTools::make_sparsity_pattern(dof_handler, dsp); sparsity_pattern.copy_from(dsp); A.reinit(sparsity_pattern); // assemble right-hand side and system matrix FEValues<dim> fe_values(mapping, fe, quad, update_gradients | update_JxW_values); FEFaceValues<dim> fe_face_values(mapping, fe, face_quad, update_values | update_JxW_values); FullMatrix<double> cell_matrix; Vector<double> cell_rhs; std::vector<types::global_dof_index> local_dof_indices; // loop over all cells for (const auto &cell : dof_handler.active_cell_iterators()) { if (cell->is_locally_owned() == false) continue; fe_values.reinit(cell); const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell; cell_matrix.reinit(dofs_per_cell, dofs_per_cell); cell_rhs.reinit(dofs_per_cell); // loop over cell dofs for (unsigned int i = 0; i < dofs_per_cell; ++i) for (unsigned int j = 0; j < dofs_per_cell; ++j) for (unsigned int q = 0; q < fe_values.n_quadrature_points; ++q) { const auto eps_phi_i = get_strain(fe_values, i, q); const auto eps_phi_j = get_strain(fe_values, j, q); cell_matrix(i, j) += (eps_phi_i * // stress_strain_tensor * // eps_phi_j // ) * // fe_values.JxW(q); // } // loop over all cell faces and their dofs for (const auto &face : cell->face_iterators()) { // we only want to apply NBC on the right face if (!face->at_boundary() || face->boundary_id() != 1) continue; fe_face_values.reinit(cell, face); for (unsigned int q = 0; q < fe_face_values.n_quadrature_points; ++q) for (unsigned int i = 0; i < dofs_per_cell; ++i) cell_rhs(i) += fe_face_values.shape_value(i, q) * traction[fe.system_to_component_index(i).first] * fe_face_values.JxW(q); } local_dof_indices.resize(cell->get_fe().dofs_per_cell); cell->get_dof_indices(local_dof_indices); constraints.distribute_local_to_global( cell_matrix, cell_rhs, local_dof_indices, A, b); } // solve linear equation system ReductionControl reduction_control; SolverCG<Vector<double>> solver(reduction_control); solver.solve(A, x, b, PreconditionIdentity()); printf("Solved in %d iterations.\n", reduction_control.last_step()); constraints.distribute(x); // output results DataOut<dim> data_out; data_out.attach_dof_handler(dof_handler); x.update_ghost_values(); data_out.add_data_vector( dof_handler, x, "solution", std::vector<DataComponentInterpretation::DataComponentInterpretation>( dim, DataComponentInterpretation::component_is_part_of_vector)); data_out.build_patches(mapping, degree + 1); std::ofstream output("solution.vtu"); data_out.write_vtu(output); }
[ "peterrmuench@gmail.com" ]
peterrmuench@gmail.com
f43e4077e22c76bd16b64973fdfe956978ab455f
cf7225bfc0301ca84b94fcd91b016b35ca4a8c9e
/source/engine/AssetsManager.hpp
f645bf344109016cc35cc13f5cfb2f09bb8e73d5
[]
no_license
WideWord/nanoexcalibur
850264c9d83dbaa9bf459ed838528edb8054fbd3
1cb3c181b7c2d2f7df7e001500cca2cc394b2c26
refs/heads/master
2020-03-19T11:24:07.264583
2018-06-14T23:06:21
2018-06-14T23:06:21
136,453,419
0
0
null
null
null
null
UTF-8
C++
false
false
785
hpp
#pragma once #include <memory> #include "../gfx/Texture.hpp" #include "../util/Memory.hpp" #include <unordered_map> namespace nexc { class AssetsManager { public: Ref<Texture> getTexture(const std::string& filename) { return getAsset(filename, textures); } private: template<typename T> using AssetsStorage = std::unordered_map<std::string, WRef<T>>; template<typename T> Ref<T> getAsset(const std::string& filename, AssetsStorage<T>& storage) { auto it = storage.find(filename); if (it != storage.end()) { auto ptr = it->second.lock(); if (ptr != nullptr) { return ptr; } } auto asset = New<T>(); asset->loadFromFile(filename); storage[filename] = WRef<T>(asset); return asset; } AssetsStorage<Texture> textures; }; }
[ "wide.wrd@gmail.com" ]
wide.wrd@gmail.com
4765b0a2ebe11a02c5373a3020d6de767fc98862
65964baaae2c631c0b73716886d0eeae2013838b
/combination_sum/combination_sum.cpp
ff9982d0d5a9383c8a1525ae222d4ec9be3a43ab
[]
no_license
try-your-best/leetcode
d3a5f53bee8e917b11f12c3f21b34fd11a7eafb3
859ff86a138d667a839adec0d352e39ae88a15da
refs/heads/master
2016-09-15T20:33:30.394740
2014-10-13T14:42:28
2014-10-13T14:42:28
null
0
0
null
null
null
null
GB18030
C++
false
false
1,001
cpp
//思路:深搜+剪枝 class Solution { private: void DFS(vector<int>& nums, int gap, vector<int>& intermediate, vector<vector<int>>& result) { if(gap == 0) { result.push_back(intermediate); } for(int i = 0; i < nums.size(); i++) { if( gap - nums[i] >= 0)//剪枝 { if(intermediate.empty() || nums[i] >= intermediate.back())//剪枝 { intermediate.push_back(nums[i]); DFS(nums, gap-nums[i], intermediate, result); intermediate.pop_back(); } } else { break; } } } public: vector<vector<int> > combinationSum(vector<int> &candidates, int target) { vector<int> intermediate; vector<vector<int>> result; std::sort (candidates.begin(), candidates.end()); //注意,题目中没有说待选数组是升序的。 DFS(candidates, target, intermediate, result); return result; } };
[ "damonhao@qq.com" ]
damonhao@qq.com
664f41a840e369f60caeb497ba1036e20779a8dc
c80cd2d263cffae4981e8a92366ce3dabeec4c75
/exercises/8/8_6_Sales_data.h
8e30b1db605ba25fcf9b127e3d39a9364f994e7e
[]
no_license
cat1984x/Learning_Cpp_Primer
72398a00f4f24c242b9d3bb22b6426391d17c773
fb5f1aa3f5a157d19c64e6ab260cd68db571f90a
refs/heads/master
2022-01-05T12:41:55.587426
2018-07-23T03:57:59
2018-07-23T03:57:59
null
0
0
null
null
null
null
UTF-8
C++
false
false
971
h
#include <iostream> #ifndef SALES_DATA_H #define SALES_DATA_H #include <string> using namespace std; struct Sales_data { string isbn() const {return bookNo;} Sales_data &combine(const Sales_data &); double agv_price() const; string bookNo; unsigned unit_sold = 0; double revenue = 0.0; }; Sales_data & Sales_data::combine(const Sales_data &rhs) { unit_sold += rhs.unit_sold; revenue += rhs.revenue; return *this; } double Sales_data::agv_price() const { if(unit_sold) return revenue / unit_sold; else return 0; } Sales_data add(const Sales_data &lhs, const Sales_data &rhs) { Sales_data sum = lhs; sum.combine(rhs); return sum; } istream &read(istream &is, Sales_data &item) { double price; is >> item.bookNo >> item.unit_sold >> price; item.revenue = item.unit_sold * price; return is; } ostream &print(ostream &os, const Sales_data &item) { os << item.bookNo << " " << item.unit_sold << " " << item.agv_price(); return os; } #endif
[ "chenyushen1989@163.com" ]
chenyushen1989@163.com
923886f03deafc47e7d197edf92bc974459ae84d
6eb480527e3ce5ca7ba1f0f88ceb1e8a7943486d
/L1Trigger/L1BarrelMuonTrackFinder/src/L1MuMBTrackFinder.cc
6903f95f110c0db0002dfd973accb4b851f3ff9e
[]
no_license
gflouris/L1BarrelTrackFinder
38f591ebce13fc79cc019440befee4d68e264875
2dbc57553b472adefad8774ca8c2b7aab520d7f4
refs/heads/master
2021-01-10T11:23:18.873204
2015-06-22T12:00:11
2015-06-22T12:00:11
36,854,405
0
0
null
null
null
null
UTF-8
C++
false
false
9,855
cc
//------------------------------------------------- // // Class: L1MuMBTrackFinder // // Description: L1 barrel Muon Trigger Track Finder // // // // Author : // N. Neumeister CERN EP // J. Troconiz UAM Madrid // //-------------------------------------------------- //----------------------- // This Class's Header -- //----------------------- #include "L1Trigger/L1BarrelMuonTrackFinder/interface/L1MuMBTrackFinder.h" //--------------- // C++ Headers -- //--------------- #include <iostream> //------------------------------- // Collaborating Class Headers -- //------------------------------- #include <DataFormats/Common/interface/Handle.h> #include <FWCore/Framework/interface/Event.h> #include "DataFormats/L1DTTrackFinder/interface/L1MuDTChambPhContainer.h" #include "DataFormats/L1DTTrackFinder/interface/L1MuDTTrackCand.h" #include "L1Trigger/L1BarrelMuonTrackFinder/src/L1MuMBTFConfig.h" #include "L1Trigger/L1BarrelMuonTrackFinder/src/L1MuMBSecProcId.h" #include "L1Trigger/L1BarrelMuonTrackFinder/src/L1MuMBSecProcMap.h" #include "L1Trigger/L1BarrelMuonTrackFinder/src/L1MuMBSectorProcessor.h" #include "L1Trigger/L1BarrelMuonTrackFinder/src/L1MuMBEtaProcessor.h" #include "L1Trigger/L1BarrelMuonTrackFinder/src/L1MuMBWedgeSorter.h" #include "L1Trigger/L1BarrelMuonTrackFinder/src/L1MuMBMuonSorter.h" #include "L1Trigger/L1BarrelMuonTrackFinder/interface/L1MuMBTrack.h" #include "DataFormats/L1TMuon/interface/L1TRegionalMuonCandidate.h" using namespace std; //--------------------------------- // class L1MuMBTrackFinder //--------------------------------- //---------------- // Constructors -- //---------------- L1MuMBTrackFinder::L1MuMBTrackFinder(const edm::ParameterSet & ps,edm::ConsumesCollector && iC) { // set configuration parameters if ( m_config == 0 ) m_config = new L1MuMBTFConfig(ps); if ( L1MuMBTFConfig::Debug(1) ) cout << endl; if ( L1MuMBTFConfig::Debug(1) ) cout << "**** entering L1MuMBTrackFinder ****" << endl; if ( L1MuMBTFConfig::Debug(1) ) cout << endl; m_spmap = new L1MuMBSecProcMap(); m_epvec.reserve(12); m_wsvec.reserve(12); m_ms = 0; _cache.reserve(4*17); _cache0.reserve(144*17); iC.consumes<L1MuDTChambPhDigi>(L1MuMBTFConfig::getMBDigiInputTag()); } //-------------- // Destructor -- //-------------- L1MuMBTrackFinder::~L1MuMBTrackFinder() { delete m_spmap; vector<L1MuMBEtaProcessor*>::iterator it_ep = m_epvec.begin(); while ( it_ep != m_epvec.end() ) { delete (*it_ep); it_ep++; } m_epvec.clear(); vector<L1MuMBWedgeSorter*>::iterator it_ws = m_wsvec.begin(); while ( it_ws != m_wsvec.end() ) { delete (*it_ws); it_ws++; } m_wsvec.clear(); delete m_ms; if ( m_config ) delete m_config; m_config = 0; } //-------------- // Operations -- //-------------- // // setup MTTF configuration // void L1MuMBTrackFinder::setup() { // build the barrel Muon Trigger Track Finder if ( L1MuMBTFConfig::Debug(1) ) cout << endl; if ( L1MuMBTFConfig::Debug(1) ) cout << "**** L1MuMBTrackFinder building ****" << endl; if ( L1MuMBTFConfig::Debug(1) ) cout << endl; // create new sector processors for ( int wh = -3; wh <= 3; wh++ ) { if ( wh == 0 ) continue; for ( int sc = 0; sc < 12; sc++ ) { L1MuMBSecProcId tmpspid(wh,sc); L1MuMBSectorProcessor* sp = new L1MuMBSectorProcessor(*this,tmpspid); if ( L1MuMBTFConfig::Debug(2) ) cout << "creating " << tmpspid << endl; m_spmap->insert(tmpspid,sp); } } // create new eta processors and wedge sorters for ( int sc = 0; sc < 12; sc++ ) { L1MuMBEtaProcessor* ep = new L1MuMBEtaProcessor(*this,sc); if ( L1MuMBTFConfig::Debug(2) ) cout << "creating Eta Processor " << sc << endl; m_epvec.push_back(ep); L1MuMBWedgeSorter* ws = new L1MuMBWedgeSorter(*this,sc); if ( L1MuMBTFConfig::Debug(2) ) cout << "creating Wedge Sorter " << sc << endl; m_wsvec.push_back(ws); } // create new muon sorter if ( L1MuMBTFConfig::Debug(2) ) cout << "creating MB Muon Sorter " << endl; m_ms = new L1MuMBMuonSorter(*this); } // // run MTTF // void L1MuMBTrackFinder::run(const edm::Event& e, const edm::EventSetup& c) { // run the barrel Muon Trigger Track Finder edm::Handle<L1MuDTChambPhContainer> dttrig; e.getByLabel(L1MuMBTFConfig::getMBDigiInputTag(),dttrig); if ( dttrig->getContainer()->size() == 0 ) return; if ( L1MuMBTFConfig::Debug(2) ) cout << endl; if ( L1MuMBTFConfig::Debug(2) ) cout << "**** L1MuMBTrackFinder processing ------****" << endl; if ( L1MuMBTFConfig::Debug(2) ) cout << endl; int bx_min = L1MuMBTFConfig::getBxMin(); int bx_max = L1MuMBTFConfig::getBxMax(); for ( int bx = bx_min; bx <= bx_max; bx++ ) { if ( dttrig->bxEmpty(bx) ) continue; if ( L1MuMBTFConfig::Debug(2) ) cout << "L1MuMBTrackFinder processing bunch-crossing : " << bx << endl; // reset MTTF reset(); // run sector processors L1MuMBSecProcMap::SPmap_iter it_sp = m_spmap->begin(); while ( it_sp != m_spmap->end() ) { if ( L1MuMBTFConfig::Debug(2) ) cout << "running " << (*it_sp).second->id() << endl; if ( (*it_sp).second ) (*it_sp).second->run(bx,e,c); if ( L1MuMBTFConfig::Debug(2) && (*it_sp).second ) (*it_sp).second->print(); it_sp++; } // run eta processors vector<L1MuMBEtaProcessor*>::iterator it_ep = m_epvec.begin(); while ( it_ep != m_epvec.end() ) { if ( L1MuMBTFConfig::Debug(2) ) cout << "running Eta Processor " << (*it_ep)->id() << endl; if ( *it_ep ) (*it_ep)->run(bx,e,c); if ( L1MuMBTFConfig::Debug(2) && *it_ep ) (*it_ep)->print(); it_ep++; } // read sector processors it_sp = m_spmap->begin(); while ( it_sp != m_spmap->end() ) { if ( L1MuMBTFConfig::Debug(2) ) cout << "reading " << (*it_sp).second->id() << endl; for ( int number = 0; number < 2; number++ ) { const L1MuMBTrack* cand = (*it_sp).second->tracK(number); // if ( cand && !cand->empty() ) _cache0.push_back(L1MuDTTrackCand(cand->getDataWord(),cand->bx(), // cand->spid().wheel(),cand->spid().sector(),number,cand->address(1), // cand->address(2),cand->address(3),cand->address(4),cand->tc())); if ( cand && !cand->empty() ) _cache0.push_back(L1MuDTTrackCand(1,cand->bx(), cand->spid().wheel(),cand->spid().sector(),number,cand->address(1), cand->address(2),cand->address(3),cand->address(4),cand->tc())); } it_sp++; } // run wedge sorters vector<L1MuMBWedgeSorter*>::iterator it_ws = m_wsvec.begin(); while ( it_ws != m_wsvec.end() ) { if ( L1MuMBTFConfig::Debug(2) ) cout << "running Wedge Sorter " << (*it_ws)->id() << endl; if ( *it_ws ) (*it_ws)->run(); if ( L1MuMBTFConfig::Debug(2) && *it_ws ) (*it_ws)->print(); it_ws++; } // run muon sorter if ( L1MuMBTFConfig::Debug(2) ) cout << "running MB Muon Sorter" << endl; if ( m_ms ) m_ms->run(); if ( L1MuMBTFConfig::Debug(2) && m_ms ) m_ms->print(); //cout <<m_ms->numberOfTracks()<<"<--------------------"<<endl; // store found track candidates in container (cache) if ( m_ms->numberOfTracks() > 0 ) { const vector<const L1MuMBTrack*>& mttf_cont = m_ms->tracks(); vector<const L1MuMBTrack*>::const_iterator iter; for ( iter = mttf_cont.begin(); iter != mttf_cont.end(); iter++ ) { //if ( *iter ) _cache.push_back(L1MuRegionalCand((*iter)->getDataWord(),(*iter)->bx())); if ( *iter ) _cache.push_back(l1t::L1TRegionalMuonCandidate((*iter)->hwPt(), (*iter)->hwPhi(), (*iter)->hwEta(), (*iter)->hwSign(), (*iter)->hwSignValid(), (*iter)->hwQual() )); } } } } // // reset MTTF // void L1MuMBTrackFinder::reset() { L1MuMBSecProcMap::SPmap_iter it_sp = m_spmap->begin(); while ( it_sp != m_spmap->end() ) { if ( (*it_sp).second ) (*it_sp).second->reset(); it_sp++; } vector<L1MuMBEtaProcessor*>::iterator it_ep = m_epvec.begin(); while ( it_ep != m_epvec.end() ) { if ( *it_ep ) (*it_ep)->reset(); it_ep++; } vector<L1MuMBWedgeSorter*>::iterator it_ws = m_wsvec.begin(); while ( it_ws != m_wsvec.end() ) { if ( *it_ws ) (*it_ws)->reset(); it_ws++; } if ( m_ms ) m_ms->reset(); } // // return Sector Processor container // const L1MuMBSectorProcessor* L1MuMBTrackFinder::sp(const L1MuMBSecProcId& id) const { return m_spmap->sp(id); } // // return number of muon candidates found by the barrel MTTF // int L1MuMBTrackFinder::numberOfTracks() { return _cache.size(); } L1MuMBTrackFinder::TFtracks_const_iter L1MuMBTrackFinder::begin() { return _cache.begin(); } L1MuMBTrackFinder::TFtracks_const_iter L1MuMBTrackFinder::end() { return _cache.end(); } void L1MuMBTrackFinder::clear() { _cache.clear(); _cache0.clear(); } // // return number of muon candidates found by the barrel MTTF at a given bx // int L1MuMBTrackFinder::numberOfTracks(int bx) { int number = 0; for ( TFtracks_const_iter it = _cache.begin(); it != _cache.end(); it++ ) { if ( (*it).bx() == bx ) number++; } return number; } // static data members L1MuMBTFConfig* L1MuMBTrackFinder::m_config = 0;
[ "flourisj@gmail.com" ]
flourisj@gmail.com
f6735d759aee85ca926603d73219f39bc68204ea
89319570560553047d3e1d9bb07a6b8118c707be
/extension/widgets_value.cpp
1300b59e4f7b42914f2f761d7e6fc89486035808
[ "MIT" ]
permissive
haddock7/hlimgui
9adb101f97ea5d0941382aaf903be3d48b3ab5c3
9f89772b7ab8bce54821f1d6956dc5c18a8d5faa
refs/heads/master
2023-06-29T00:29:13.229134
2021-08-03T03:25:48
2021-08-03T03:25:48
271,698,591
39
7
MIT
2021-08-03T03:25:49
2020-06-12T03:20:23
C++
UTF-8
C++
false
false
615
cpp
#define HL_NAME(n) hlimgui_##n #include <hl.h> #include "imgui/imgui.h" #include "utils.h" HL_PRIM void HL_NAME(value_bool)(vstring* prefix, bool b) { ImGui::Value(convertString(prefix), b); } HL_PRIM void HL_NAME(value_int)(vstring* prefix, int v) { ImGui::Value(convertString(prefix), v); } HL_PRIM void HL_NAME(value_single)(vstring* prefix, float v, vstring* float_format) { ImGui::Value(convertString(prefix), v, convertString(float_format)); } DEFINE_PRIM(_VOID, value_bool, _STRING _BOOL); DEFINE_PRIM(_VOID, value_int, _STRING _I32); DEFINE_PRIM(_VOID, value_single, _STRING _F32 _STRING);
[ "haddock7.github@gmail.com" ]
haddock7.github@gmail.com
50a90adf837cf85a9c2bc4c6404acdf6cf44fe83
7baa41c1b04027302215c8b0a25b7036872eb43c
/LineTracer/PolyLineIterator.cpp
3cbd538ff2834d4387da6b19d4b4bc34a716140a
[]
no_license
jkotlinski/linetracer
eb7707c53288b73a130ad269289adfb04caf8ab3
1dc59782bdd0b63444ca8e107843658eeea06c82
refs/heads/master
2016-09-06T08:55:19.493747
2015-03-14T14:07:21
2015-03-14T14:07:21
32,207,995
5
1
null
null
null
null
UTF-8
C++
false
false
2,287
cpp
/** This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "StdAfx.h" #include ".\polylineiterator.h" #include <assert.h> PolyLineIterator::PolyLineIterator(const CPolyLine * const a_line, CFPoint a_start_point, bool & a_status) : m_line(a_line) , m_index(0) , m_is_forward_iterator(false) { a_status=true; assert ( a_line ); CSketchPoint * l_headpoint = a_line->GetHeadPoint(); CSketchPoint * l_tailpoint = a_line->GetTailPoint(); if ( l_headpoint->GetCoords( ) == a_start_point ) { m_is_forward_iterator = true; } else if ( l_tailpoint->GetCoords() == a_start_point ) { m_index = a_line->Size() - 1; } else { a_status = false; } m_is_valid = a_status; } PolyLineIterator::~PolyLineIterator(void) { } CSketchPoint * PolyLineIterator::Next ( bool & l_status ) { assert ( m_is_valid ); l_status = true; if ( m_index < 0 ) { m_index = 0; l_status = false; } else if ( static_cast<unsigned int>(m_index) >= m_line->Size() ) { m_index = m_line->Size() - 1; l_status = false; } CSketchPoint * a_p = m_line->At(m_index); m_index += m_is_forward_iterator ? 1 : -1; return a_p; } CSketchPoint * PolyLineIterator::Next ( ) { bool l_status = false; return Next ( l_status ); } PolyLineIterator * PolyLineIterator::CreateIteratorFromOtherEnd() { bool l_status; assert ( m_is_valid ); int l_index = m_is_forward_iterator ? m_line->Size() - 1 : 0; return new PolyLineIterator(m_line, m_line->At(l_index)->GetCoords(), l_status); } int PolyLineIterator::PointsLeftToIterate () { assert ( m_is_valid ); if ( m_is_forward_iterator ) { return m_line->Size() - 1 - m_index; } else { return m_index; } }
[ "kotlinski@e5dc2c24-8a51-11dd-aa02-45bbecb07bf0" ]
kotlinski@e5dc2c24-8a51-11dd-aa02-45bbecb07bf0
ee34b5cb0d66ae9c61723c72af214beafa18af79
7898c2b40fb12adbb691ecbd274e5cbed20f83d8
/armamento.cpp
dd84255d4527e9b35dae7b157826c78443b13d04
[ "MIT" ]
permissive
hl0d0w1g/concesionario-naves-espaciales
8ea7d7df63718513f75199a1031155bce24b4e4b
22b69b4260f1fe9dc70379f957f9ae15b72aa265
refs/heads/master
2023-02-18T23:20:11.884187
2018-04-30T14:00:24
2018-04-30T14:00:24
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,268
cpp
#include <iostream> #include <cstring> #include <plantillas.h> #include <armamento.h> Armamento::Armamento(){ _canionPlasma = 0; _misiles = 0; _rayoLaser = 0; _PEM = 0; calcular_capacidadDestructiva(); } Armamento::Armamento(int canionPlasma, int misiles, int rayoLaser, int PEM){ _canionPlasma = canionPlasma; _misiles = misiles; _rayoLaser = rayoLaser; _PEM = PEM; calcular_capacidadDestructiva(); } void Armamento::set_canionPlasma(int canionPlasma){ _canionPlasma = canionPlasma; calcular_capacidadDestructiva(); } void Armamento::set_misiles(int misiles){ _misiles = misiles; calcular_capacidadDestructiva(); } void Armamento::set_rayoLaser(int rayoLaser){ _rayoLaser = rayoLaser; calcular_capacidadDestructiva(); } void Armamento::set_pem(int pem){ _PEM = pem; calcular_capacidadDestructiva(); } void Armamento::set_capacidadDestructiva(int capacidadDestructiva){ _capacidadDestructiva = capacidadDestructiva; } void Armamento::pedirArmas(){ _canionPlasma = validar(0,100,"¿Cuantos cañones de plasa tiene?"); _misiles = validar(0,100,"¿Cuantos misiles tiene?"); _rayoLaser = validar(0,100,"¿Cuantos rayos laser tiene?"); _PEM = validar(0,100,"¿Cuantos PEMs tiene?"); calcular_capacidadDestructiva(); } int Armamento::get_canionPlasma(){ return _canionPlasma; } int Armamento::get_misiles(){ return _misiles; } int Armamento::get_rayoLaser(){ return _rayoLaser; } int Armamento::get_pem(){ return _PEM; } int Armamento::get_capacidadDestructiva(){ return _capacidadDestructiva; } void Armamento::calcular_capacidadDestructiva(){ _capacidadDestructiva = ((_canionPlasma*10)+(_misiles*20)+(_rayoLaser*5)+(_PEM*15)); } void Armamento::mostrar(){ std::cout << "Esta nave va equipada con el siguiente armamento (" << _capacidadDestructiva << "): " << std::endl; //Se muestra entre parentesis su "puntuacion destructiva" std::cout << " Cañones de plasma: " << _canionPlasma << std::endl; std::cout << " Misiles: " << _misiles << std::endl; std::cout << " Rayos laser: " << _rayoLaser << std::endl; std::cout << " PEMs: " << _PEM << std::endl; std::cout << "" << std::endl; } Armamento::~Armamento(){ }
[ "chumbepiq@gmail.com" ]
chumbepiq@gmail.com
9beeff78c6d92c576ad0ee9d825da64d0fe50317
d8faa77436c6620e1e66ef2a43ab9100168467de
/rts/game_TD/ai.h
2b5af033cd44234d78ae87191438b48005a50ba1
[ "BSD-3-Clause" ]
permissive
zeyuan1987/ELF
7f805dedd99b6614431eb0f646d07dd920f56814
dc3eff02c240cab8312830602c6ae2f7b61b03b3
refs/heads/master
2020-12-02T07:47:48.317686
2019-12-31T01:51:38
2019-12-31T01:51:38
96,727,570
0
0
null
2017-07-10T02:26:02
2017-07-10T02:26:02
null
UTF-8
C++
false
false
2,725
h
/** * Copyright (c) 2017-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ #pragma once #include "../engine/omni_ai.h" #include "td_rule_actor.h" // TDTrainedAI for Tower Defense, connected with a python wrapper / ELF. class TDTrainedAI : public OmniAI { private: Tick _backup_ai_tick_thres; std::unique_ptr<OmniAI> _backup_ai; TDRuleActor _td_rule_actor; void set_rule_actor() override { _rule_actor = &_td_rule_actor; } bool on_act(const GameEnv &env) override; public: TDTrainedAI() {} TDTrainedAI(PlayerId id, int frame_skip, CmdReceiver *receiver, AIComm *ai_comm, OmniAI *backup_ai = nullptr) : OmniAI(id, frame_skip, receiver, ai_comm), _backup_ai_tick_thres(0){ if (ai_comm == nullptr) { throw std::range_error("TDTrainedAI: ai_comm cannot be nullptr!"); } if (backup_ai != nullptr) { backup_ai->SetId(GetId()); backup_ai->SetCmdReceiver(_receiver); _backup_ai.reset(backup_ai); } set_rule_actor(); _rule_actor->SetReceiver(receiver); _rule_actor->SetPlayerId(id); } void SetBackupAIEndTick(Tick thres) { _backup_ai_tick_thres = thres; } SERIALIZER_DERIVED(TDTrainedAI, OmniAI, _state); }; // TDSimple AI, rule-based AI for Tower Defense class TDSimpleAI : public OmniAI { private: TDRuleActor _td_rule_actor; void set_rule_actor() override { _rule_actor = &_td_rule_actor; } bool on_act(const GameEnv &env) override; public: TDSimpleAI() { } TDSimpleAI(PlayerId id, int frame_skip, CmdReceiver *receiver, AIComm *ai_comm = nullptr) : OmniAI(id, frame_skip, receiver, ai_comm) { set_rule_actor(); _rule_actor->SetReceiver(receiver); _rule_actor->SetPlayerId(id); } SERIALIZER_DERIVED(TDSimpleAI, OmniAI, _state); }; // TDBuiltInAI, environment for Tower Defense. i.e. generate waves to defeat. class TDBuiltInAI : public OmniAI { private: TDRuleActor _td_rule_actor; void set_rule_actor() override { _rule_actor = &_td_rule_actor; } bool on_act(const GameEnv &env) override; public: TDBuiltInAI() { } TDBuiltInAI(PlayerId id, int frame_skip, CmdReceiver *receiver, AIComm *ai_comm = nullptr) : OmniAI(id, frame_skip, receiver, ai_comm) { set_rule_actor(); _rule_actor->SetReceiver(receiver); _rule_actor->SetPlayerId(id); } SERIALIZER_DERIVED(TDBuiltInAI, OmniAI, _state); };
[ "yuandong.tian@gmail.com" ]
yuandong.tian@gmail.com
06d3cf8f15d42361f18a2c952f137e000234864f
703c16c73e35e5b408e7c9b549aa35d9964e3a58
/applications/StructuralMechanicsApplication/custom_constitutive/truss_plasticity_constitutive_law.h
cc06226083867b4c3826a9809cdfac09dfcbeb70
[ "BSD-3-Clause" ]
permissive
ozw4/Kratos
a8e57b3230568c93bcdd7d6c286507ae6f780e65
7388b920531ce53543e31fc3d8d7420b14fdc429
refs/heads/master
2020-03-25T03:42:04.233931
2018-08-02T16:49:25
2018-08-02T16:49:25
null
0
0
null
null
null
null
UTF-8
C++
false
false
8,247
h
// KRATOS ___| | | | // \___ \ __| __| | | __| __| | | __| _` | | // | | | | | ( | | | | ( | | // _____/ \__|_| \__,_|\___|\__|\__,_|_| \__,_|_| MECHANICS // // License: BSD License // license: structural_mechanics_application/license.txt // // Main authors: Klaus B. Sautter // #if !defined (KRATOS_TRUSS_PLASTICITY_LAW_H_INCLUDED) #define KRATOS_TRUSS_PLASTICITY_LAW_H_INCLUDED // System includes // External includes // Project includes #include "includes/constitutive_law.h" #include "includes/checks.h" namespace Kratos { /** * @namespace TrussPlasticityConstitutiveLaw * * @brief This constitutive law represents a linear hardening plasticity 1D law * * @author Klaus B Sautter */ class KRATOS_API(STRUCTURAL_MECHANICS_APPLICATION) TrussPlasticityConstitutiveLaw : public ConstitutiveLaw { public: /** * Type Definitions */ typedef ProcessInfo ProcessInfoType; typedef ConstitutiveLaw BaseType; typedef std::size_t SizeType; /** * Counted pointer of TrussPlasticityConstitutiveLaw */ KRATOS_CLASS_POINTER_DEFINITION( TrussPlasticityConstitutiveLaw ); /** * Life Cycle */ /** * Default constructor. */ TrussPlasticityConstitutiveLaw(); ConstitutiveLaw::Pointer Clone() const override; /** * Copy constructor. */ TrussPlasticityConstitutiveLaw (const TrussPlasticityConstitutiveLaw& rOther); /** * Destructor. */ ~TrussPlasticityConstitutiveLaw() override; /** * Operators */ /** * Operations needed by the base class: */ /** * This function is designed to be called once to check compatibility with element * @param rFeatures */ void GetLawFeatures(Features& rFeatures) override; void SetValue(const Variable<bool>& rVariable, const bool& rValue, const ProcessInfo& rCurrentProcessInfo) override; void SetValue(const Variable<double>& rThisVariable, const double& rValue, const ProcessInfo& rCurrentProcessInfo) override; double& GetValue(const Variable<double>& rThisVariable, double& rValue) override; bool& GetValue(const Variable<bool>& rThisVariable,bool& rValue) override; array_1d<double, 3 > & GetValue(const Variable<array_1d<double, 3 > >& rThisVariable, array_1d<double, 3 > & rValue) override; double& CalculateValue(ConstitutiveLaw::Parameters& rParameterValues, const Variable<double>& rThisVariable, double& rValue) override; Vector& CalculateValue(ConstitutiveLaw::Parameters& rParameterValues, const Variable<Vector>& rThisVariable, Vector& rValue) override; void CalculateMaterialResponse(const Vector& rStrainVector, const Matrix& rDeformationGradient, Vector& rStressVector, Matrix& rAlgorithmicTangent, const ProcessInfo& rCurrentProcessInfo, const Properties& rMaterialProperties, const GeometryType& rElementGeometry, const Vector& rShapeFunctionsValues, bool CalculateStresses = true, int CalculateTangent = true, bool SaveInternalVariables = true) override; /** * @brief This function calculates the yield function for the plastic model * @param rMaterialProperties Material Properties of the problem * @param rCurrentStress Current stress value */ double TrialYieldFunction(const Properties& rMaterialProperties, const double& rCurrentStress); /** * @brief This function checks if the current stress is in the plastic regime * @param rMaterialProperties Material Properties of the problem * @param rCurrentStress Current stress value */ bool CheckIfIsPlasticRegime(const Properties& rMaterialProperties, const double& rCurrentStress); void FinalizeNonLinearIteration(const Properties& rMaterialProperties, const GeometryType& rElementGeometry, const Vector& rShapeFunctionsValues, const ProcessInfo& rCurrentProcessInfo) override; void FinalizeSolutionStep(const Properties& rMaterialProperties, const GeometryType& rElementGeometry, const Vector& rShapeFunctionsValues, const ProcessInfo& rCurrentProcessInfo) override; /** * @brief This function checks if the predicted stress state is in the elastic regime * but was in the plastic regime in the previous non_linear iteration step */ bool CheckPlasticIterationHistory() const { bool check_flag = false; if(this->mInElasticFlagVector[1] && !this->mInElasticFlagVector[0]) { check_flag = true; } return check_flag; } /** * Voigt tensor size: */ SizeType GetStrainSize() override { return 1; } /** * This function provides the place to perform checks on the completeness of the input. * It is designed to be called only once (or anyway, not often) typically at the beginning * of the calculations, so to verify that nothing is missing from the input * or that no common error is found. * @param rMaterialProperties: The properties of the material * @param rElementGeometry: The geometry of the element * @param rCurrentProcessInfo: The current process info instance */ int Check( const Properties& rMaterialProperties, const GeometryType& rElementGeometry, const ProcessInfo& rCurrentProcessInfo ) override; protected: ///@name Protected static Member Variables ///@{ ///@} ///@name Protected member Variables ///@{ ///@} ///@name Protected Operators ///@{ ///@} ///@name Protected Operations ///@{ ///@} private: ///@name Static Member Variables ///@{ ///@} ///@name Member Variables ///@{ double mStressState = 0.0; // The current stress state //the following members are vectors where //[0] is the current non_linear iteration step //[1] is the previous non_linear iteration step BoundedVector<bool, 2> mInElasticFlagVector = ZeroVector(2); /// This flags tells if we are in a elastic or ineslastic regime BoundedVector<double, 2> mPlasticAlphaVector = ZeroVector(2); /// The current plastic increment BoundedVector<double, 2> mAccumulatedPlasticStrainVector = ZeroVector(2); /// The current accumulated plastic strain ///@} ///@name Private Operators ///@{ ///@} ///@name Private Operations ///@{ ///@} ///@} ///@name Private Access ///@{ ///@} ///@} ///@name Serialization ///@{ friend class Serializer; void save(Serializer& rSerializer) const override { KRATOS_SERIALIZE_SAVE_BASE_CLASS( rSerializer, ConstitutiveLaw); rSerializer.save("StressState", this->mStressState); rSerializer.save("PlasticAlpha", this->mPlasticAlphaVector); rSerializer.save("AccumulatedPlasticStrain", this->mAccumulatedPlasticStrainVector); rSerializer.save("InelasticFlag", this->mInElasticFlagVector); } void load(Serializer& rSerializer) override { KRATOS_SERIALIZE_LOAD_BASE_CLASS( rSerializer, ConstitutiveLaw); rSerializer.load("StressState", this->mStressState); rSerializer.load("PlasticAlpha", this->mPlasticAlphaVector); rSerializer.load("AccumulatedPlasticStrain", this->mAccumulatedPlasticStrainVector); rSerializer.load("InelasticFlag", this->mInElasticFlagVector); } }; // Class TrussPlasticityConstitutiveLaw } // namespace Kratos. #endif // KRATOS_DUMMY_TRUSS_LAW_H_INCLUDED defined
[ "klaus.sautter@tum.de" ]
klaus.sautter@tum.de
93fc37268a1db3c2b1744711c7db9d083075d374
144f26484af30a4b00c76d8b52b0d0bac98e552c
/charpter_02/exer_2.cpp
9f0db9ea3ca63ed8ffcafa2a2b61b3537519038f
[]
no_license
IntelligentSense/Cpp_Learning
4f4d1c7fcfcaf65508228c45c18bd7d3623d8cc0
a59220f5a0fac58a7b1693b94ef9ce18b5d626ef
refs/heads/master
2020-12-01T18:53:39.889436
2020-02-15T12:45:51
2020-02-15T12:45:51
230,734,861
0
0
null
null
null
null
UTF-8
C++
false
false
323
cpp
#include <iostream> int long2yard(int); // function prototype using namespace std; int main() { cout << "Enter long: "; int ilong; cin >> ilong; int yard = long2yard(ilong); cout << ilong << " long = "; cout << yard << " yard" << endl; return 0; } int long2yard(int l) { return 220 * l; }
[ "zallerting@outlook.com" ]
zallerting@outlook.com
ce71f62d0df1fe7394b9d20ff6093de43157228d
1298ea578afc58b2cb1234439cbfc2c099a2b895
/Assignment 3/Sphere.h
59299e8e3942db0ff8477a362d823b53a9b79f2a
[ "MIT" ]
permissive
0xen/Year-One-Hover-Car-Racer
a5018fd9678b428c93dab0304be131f84f30d47f
f7dd8fac073b7bda9f2b1bd96843080b313c34c5
refs/heads/master
2021-01-19T11:26:32.469044
2017-10-29T14:15:41
2017-10-29T14:15:41
87,968,778
0
0
null
null
null
null
UTF-8
C++
false
false
204
h
#pragma once #include "Vec.h" class Sphere { public: Sphere(); void setPositon(vec2 _pos); void setRadius(float _rad); vec2 getPosition(); float getRadius(); private: vec2 position; float rad; };
[ "JKGreen@uclan.ac.uk" ]
JKGreen@uclan.ac.uk
e736575600a6b975ffd92d0838cae87277fa973b
32a3b1ead3c2b172866588dc484cfa4b62b12caa
/R/calcVIFarm.cpp
3018494b781f0ad8aa36d962e0c80e8813ddd15b
[]
no_license
arcolombo/junk
df08a10503a3fe46674d30fe7f8ee06bc1c18d99
5d39a5893bb7dd6328d587791b9735de14b2ff45
refs/heads/master
2020-04-13T15:28:36.085665
2016-03-31T16:47:00
2016-03-31T16:47:00
51,175,677
0
0
null
null
null
null
UTF-8
C++
false
false
3,964
cpp
//[[Rcpp::depends(RcppArmadillo)]] #include <RcppArmadillo.h> using namespace arma; //[[Rcpp::export]] extern "C" SEXP calcVIFarm(SEXP namesGrms, SEXP geneSets, SEXP rnEsets, SEXP esets, SEXP labels, SEXP sdAlphas) { Rcpp::CharacterVector namesGrm(namesGrms); Rcpp::NumericVector geneSet(geneSets); Rcpp::CharacterVector rnEset(rnEsets); Rcpp::NumericVector idx = geneSet-1; //0 based Rcpp::CharacterVector GNames = namesGrm[idx]; Rcpp::NumericVector gs(0); //not efficient what size does gs need ? Rcpp::NumericVector grps(0); Rcpp::NumericMatrix eset(esets); Rcpp::CharacterVector label(labels); //unique colnames(eset) arma::mat covarMat; Rcpp::NumericVector sdAlpha(sdAlphas); //must not be NULL check in R arma::mat results; arma::uvec agrps; arma::vec vif; int lengthGrps = label.size(); int n = eset.nrow(), m = eset.ncol(); arma::mat est(eset.begin(),n,m,false); //R is 1 based vectors , C++ is 0 based. we subtract 1 from the R vectors to make 0 based, and extract rownames. then we make gs 1 based when pushing back to R; this matches R compus for(int i =0; i < rnEset.size();i++){ for( int j=0; j<GNames.size();j++){ if(rnEset(i)==GNames(j)){ gs.push_back( i +1); // 1 based } } } if (gs.size() <2){ cout << "GeneSet contains one of zero overlapping genes. NAs produced"; Rcpp::CharacterVector gs = "NA"; } //arma::vec ags(gs.begin(),gs.size(),false); // ags = ags -1;//0 based arma::uvec ags = Rcpp::as<arma::uvec>(gs) - 1; //0 based //find groups to split the eset by labels using only unique labeling, where column names of eset is in terms of labels Rcpp::CharacterVector colN = Rcpp::List(eset.attr("dimnames"))[1]; covarMat = covarMat.zeros(gs.size(), gs.size()); // the covariance matrix is square by nrow X nrow by definition of the inner product of a matrix with itself //index of columns matching label type for(int k =0; k<label.size();k++) { Rcpp::NumericVector grps(0); for( int j = 0; j< eset.ncol();j++){ if(colN(j) == label(k)){ grps.push_back(j+1); // 1 based } } // arma::uvec atmp(tmp.begin(),tmp.size(),false); // atmp = atmp - 1 ; //0 based // int tmpSize = tmp.size(); arma::uvec agrps = Rcpp::as<arma::uvec>(grps) -1; // cout << agrps; covarMat += cov(est.submat(ags,agrps).t()) * as_scalar(grps.size()-1) ; } //for each label covarMat = covarMat/as_scalar(m - lengthGrps); //FIX ME: check the sd.alpha computations //multiply matrix by the sd.alpha vectors //Rcpp::CharacterVector a = rnEset[gs-1]; sdAlpha = sdAlpha[gs-1]; //cout << covarMat; arma::vec sdalpha(sdAlpha.begin(),sdAlpha.size(),false); // FIX ME : fix the covar.mat = t(covar.mat*a)*a computations int row = size(covarMat)[0]; int col = size(covarMat)[1]; //cout << " row "<<row << " col "<<col; results = results.zeros(row,col); //storage object for(int i=0; i<row;i++){ for(int j =0; j<col;j++){ covarMat(i,j) = covarMat(i,j)*as_scalar(sdalpha(i)); } } for(int i=0; i<row;i++){ for(int j =0; j<col;j++){ results(i,j) = covarMat(j,i)*as_scalar(sdalpha(i)); } } //cout<<accu(results)<<" "<<accu(results.diag()) ; vif = accu(results)/accu(results.diag()); //FIX ME: just return the vif /*return Rcpp::List::create(Rcpp::Named("GNames") = GNames, // Rcpp::Named("gs.i") = Rcpp::wrap(ags), 0 based Rcpp::Named("gs.i") = gs, Rcpp::Named("covar.mat") = Rcpp::wrap(covarMat), Rcpp::Named("final.covar.mat") = Rcpp::wrap(results), Rcpp::Named("a") = Rcpp::wrap(sdAlpha), Rcpp::Named("vif") = Rcpp::wrap(vif)); */ return Rcpp::List::create(Rcpp::Named("vif") = Rcpp::wrap(vif)); }
[ "anthonycolombo60@gmail.com" ]
anthonycolombo60@gmail.com
a1558a540c08ca0ffc43825bdb2bcdeccb9f7039
7213128e7939a61a74e7a7b0e8352905d0fca626
/server/hive/hivehandler.h
6fca4218d2edfbd0a4a5b4a981415d3efcd130e3
[]
no_license
jingchenzhong/bee-hive
a30089a20f6fc6b8523d672cfe0fc4fd28fd1825
6a3eb1686f1b0d3eadd31ee9b5b5fef4c366cdce
refs/heads/master
2020-03-23T04:05:39.333030
2018-06-28T14:48:11
2018-06-28T14:48:11
null
0
0
null
null
null
null
UTF-8
C++
false
false
6,103
h
// // Created by IntelliJ IDEA. // User: AppleTree // Date: 2017/7/29 // Time: 下午4:50 // To change this template use File | Settings | File Templates. // #ifndef __hive__hivehandler__ #define __hive__hivehandler__ #include "core.h" NS_HIVE_BEGIN #define CHECK_NODE_CONNECT_TIME 3000 #define MAX_HIVE_NUMBER 4096 #define MAX_TYPE_INDEX 4096 #define MAX_NODE_INDEX 10240 typedef struct HiveInformation{ uint32 id; char ip[IP_SIZE];//192.168.110.110 --> 16 byte uint16 port; uint16 localPort; bool encrypt; bool decrypt; HiveInformation(void){ reset(); } ~HiveInformation(void){} void set(const char* ptr){ memcpy((char*)get(), ptr, sizeof(HiveInformation)); } const char* get(void) const { return ((char*)(&id)); } void set(uint32 id, const char* ip, uint16 port, uint16 localPort, bool encrypt, bool decrypt){ this->id = id; memcpy(this->ip, ip, IP_SIZE); this->port = port; this->localPort = localPort; this->encrypt = encrypt; this->decrypt = decrypt; } void reset(void){ memset((char*)get(), 0, sizeof(HiveInformation)); } inline bool operator==(const HiveInformation& h) const{ return (memcmp(get(), (h.get()), sizeof(HiveInformation)) == 0); } inline HiveInformation& operator=(const HiveInformation& h){ set(h.get()); return *this; } }HiveInformation; typedef struct DestinationRoute{ DestinationHandle destination; // 目标服务的类型和下标 uint32 nodeID; // 目标服务所在的节点ID Accept* pAccept; // 目标服务的连接,不在当前节点则为NULL;没有建立连接也为NULL DestinationRoute(void) : destination(0), nodeID(0), pAccept(NULL){} ~DestinationRoute(void){} }DestinationRoute; typedef std::vector<HiveInformation> HiveInformationVector; typedef std::vector<Client*> HiveClientVector; typedef std::vector<Accept*> HiveAcceptVector; typedef std::map<uint32, uint32> HandleToID; typedef std::vector<DestinationRoute> DestinationRouteVector; typedef std::vector<DestinationRouteVector> TypeVector; typedef std::vector<uint16> RefIndexVector; typedef std::vector<RefIndexVector> TypeRefIndexVector; typedef std::vector<uint32> RefVector; typedef struct RefIndexInfo{ uint16 moduleType; uint16 moduleIndex; uint32 refIndex; }RefIndexInfo; class HiveHandler : public Handler, public TimerObject { public: // discovery node information uint32 m_destID; std::string m_destIP; uint16 m_destPort; uint16 m_destLocal; bool m_destEncrypt; bool m_destDecrypt; // local address std::string m_localIP; uint16 m_localPort; bool m_localEncrypt; bool m_localDecrypt; // global address std::string m_globalIP; uint16 m_globalPort; bool m_globalEncrypt; bool m_globalDecrypt; HiveInformationVector m_hiveNodes; HandleToID m_handleToNode; HiveClientVector m_hiveClients; HandleToID m_acceptHandleToNode; HiveAcceptVector m_hiveAccepts; HandleToID m_handleToDestination; TypeVector m_destinations; TypeRefIndexVector m_typeRefIndex; public: HiveHandler(void); virtual ~HiveHandler(void); DEFINE_INSTANCE_H(HiveHandler) // from Handler virtual void onReceiveHttp(Http* pHttp, Packet* pPacket); virtual bool onReceiveAccept(Accept* pAccept, Packet* pPacket); virtual void onReceiveClient(Client* pClient); virtual void onCurlResponse(Buffer* pBuffer, uint32 nodeID, uint32 callbackID, bool isRequestOK); virtual void onCloseAccept(Accept* pAccept); virtual void onCloseClient(Client* pClient); virtual void onCloseHttp(Http* pHttp); virtual void onCloseListener(Listener* pListener); virtual bool dispatchMessage(Packet* pPacket); virtual uint32 startTimer(uint32 callbackID, int64 timeCount, uint32 nodeID){ return 0; }; virtual void removeTimer(uint32 handle){}; virtual void changeTimer(uint32 handle, int64 timeCount){}; virtual int64 getTimerLeft(uint32 handle){ return -1; }; // from TimerObject virtual int64 timerCallback(void); void onInitialize(void); void identifyHive(Accept* pAccept); void notifyBeeOffline(DestinationHandle destination); // 广播给除了自己之外的所有节点 void broadcastHive(Packet* pPacket); // 广播给所有bee节点 void broadcastDestination(uint32 moduleType, Packet* pPacket, bool shouldBroadcastHive); // 单独发送给某个节点 bool sendToDestination(DestinationHandle destination, Packet* pPacket); void recordHiveInfo(Packet* pPacket); void writeHiveInfo(Packet* pPacket); void writeModuleInfo(Packet* pPacket); void recordModuleInfo(Packet* pPacket); void writeRefIndex(Packet* pPacket); void recordRefIndex(Packet* pPacket); void registerRefIndex(DestinationHandle destination, uint32 refIndex); DestinationRoute* getDestinationRouteByRefIndex(DestinationHandle destination); RefIndexVector* getRefIndexVector(uint32 moduleType); bool isDestinationExisted(DestinationHandle destination); void registerDestination(DestinationHandle destination, uint32 nodeID, Accept* pAccept); void unregisterDestination(DestinationHandle destination, bool notifyKickOff); void resetDestination(DestinationHandle destination); DestinationRoute* getDestinationRoute(DestinationHandle destination); DestinationRouteVector* getDestinationRouteVector(uint32 moduleType); void notifyBeeKickoff(Accept* pAccept, DestinationHandle destination); bool registerNode(const char* ptr); bool registerNode(uint32 id, const char* ip, uint16 port, uint16 localPort, bool encrypt, bool decrypt); bool registerNode(const HiveInformation& regInfo); bool unregisterNode(uint32 id); void setNodeClient(uint32 id, Client* pClient); Client* getNodeClient(uint32 id); uint32 getNodeIDByConnectHandle(uint32 connectHandle); void setNodeAccept(uint32 id, Accept* pAccept); Accept* getNodeAccept(uint32 id); protected: bool sendToDestinationByRoute(DestinationRoute* pRoute, Packet* pPacket); void updateCheckNodeConnect(void); void checkNodeConnect(uint32 id); void openLocalListener(void); void openGlobalListener(void); }; NS_HIVE_END #endif
[ "appletreezxt@qq.com" ]
appletreezxt@qq.com
cef81dfcbda64ce960bbc9eee56f40c5d18275c1
06d0b413a0984ae18cbb16cff222795dc95400f2
/99_TEMP/Julian/Testprogramme/QTMehrereKlassen/mainwindow.cpp
7bc01b0d939bfece6e81ec1a06f7045362313ca5
[]
no_license
BBRUSS/VPJW17G5
ed73d3c3a58a533af91af52fa9a9cf9d70750a87
c142e367fdc0c713ef4552eafcac76c54a6fc0ef
refs/heads/master
2021-09-16T00:26:27.065431
2018-06-13T19:30:17
2018-06-13T19:30:17
113,431,976
0
1
null
null
null
null
UTF-8
C++
false
false
1,293
cpp
/** Testprogramm zur Veranschaulichung, wie mehrere Klassen in QT eingebunden werden * und die anderen Klassen auf das Mainwindow zugreifen können, z.B. um Texte zu ändern. * Funktioniert, Stand 11.01.2018 12:18 * * Quelle: https://www.c-plusplus.net/forum/283030-full **/ #include "mainwindow.h" #include "ui_mainwindow.h" #include "world.h" #include "settings.h" #include "camera.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) // build mainwindow { ui->setupUi(this); ui->labelGer->setText(" "); ui->labelWorld->setText(" "); ui->labelDebug->setText(" "); ui->pushButtonGer->setText("Germany"); ui->pushButtonWorld->setText("World"); // Erstellen eines Pointer auf die Klasse World, bei der der Pointer auf das Ui übergaben wird. world *myWorld = new world(ui); Camera *cam1 = new Camera(1, ui); // Durch connect wird der Button mit der Funktion aus der Klasse World verbunden. connect(ui->pushButtonWorld,SIGNAL(clicked()),myWorld,SLOT(pushWorld())); connect(ui->pushButtonCalib, SIGNAL(clicked(bool)), cam1, SLOT(calibrate())); } MainWindow::~MainWindow() { delete ui; } void MainWindow::on_pushButtonGer_clicked() { ui->labelGer->setText("Hello Germany"); }
[ "34537156+JulianPotti@users.noreply.github.com" ]
34537156+JulianPotti@users.noreply.github.com
c7b2759f462b45330a86690aeb2085632c57dabc
868e8628acaa0bf276134f9cc3ced379679eab10
/squareDrop/0.172/p_rgh
54e248f92b36bf9c7ac5b29e992ad4d768117978
[]
no_license
stigmn/droplet
921af6851f88c0acf8b1cd84f5e2903f1d0cb87a
1649ceb0a9ce5abb243fb77569211558c2f0dc96
refs/heads/master
2020-04-04T20:08:37.912624
2015-11-25T11:20:32
2015-11-25T11:20:32
45,102,907
0
0
null
2015-10-28T09:46:30
2015-10-28T09:46:29
null
UTF-8
C++
false
false
118,070
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.4.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0.172"; object p_rgh; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 -1 -2 0 0 0 0]; internalField nonuniform List<scalar> 10000 ( -0.00811346 -0.00811178 -0.00811199 -0.00811434 -0.00811918 -0.00812669 -0.00813694 -0.00815001 -0.00816603 -0.00818519 -0.00820776 -0.0082341 -0.00826469 -0.00830015 -0.00834121 -0.00838868 -0.00844348 -0.00850662 -0.00857912 -0.00866202 -0.00875629 -0.00886278 -0.0089822 -0.00911499 -0.0092614 -0.00942137 -0.00959459 -0.00978046 -0.00997811 -0.0101864 -0.010404 -0.0106293 -0.0108606 -0.011096 -0.011334 -0.0115727 -0.0118106 -0.0120464 -0.0122792 -0.0125081 -0.0127326 -0.0129524 -0.0131673 -0.0133775 -0.0135833 -0.013785 -0.0139832 -0.0141784 -0.0143714 -0.0145625 -0.00811467 -0.00811301 -0.00811366 -0.00811624 -0.00812104 -0.00812826 -0.00813804 -0.00815051 -0.00816584 -0.00818424 -0.00820601 -0.00823155 -0.00826137 -0.0082961 -0.00833651 -0.00838344 -0.00843786 -0.00850077 -0.00857324 -0.00865632 -0.00875098 -0.00885806 -0.00897822 -0.00911187 -0.00925919 -0.00942006 -0.00959408 -0.00978059 -0.00997862 -0.010187 -0.0104043 -0.0106289 -0.0108592 -0.0110933 -0.0113297 -0.0115667 -0.0118028 -0.0120368 -0.0122678 -0.0124951 -0.012718 -0.0129364 -0.0131502 -0.0133596 -0.0135647 -0.0137661 -0.0139643 -0.0141598 -0.0143532 -0.0145451 -0.00811312 -0.00811153 -0.00811216 -0.00811459 -0.00811896 -0.00812542 -0.00813415 -0.00814534 -0.00815921 -0.00817603 -0.00819618 -0.00822012 -0.00824844 -0.00828188 -0.00832124 -0.00836747 -0.00842158 -0.00848464 -0.00855774 -0.00864191 -0.00873809 -0.00884704 -0.00896929 -0.00910517 -0.00925468 -0.00941759 -0.00959336 -0.00978119 -0.00998003 -0.0101886 -0.0104056 -0.0106293 -0.0108582 -0.0110906 -0.0113249 -0.0115595 -0.0117933 -0.012025 -0.0122538 -0.0124792 -0.0127005 -0.0129177 -0.0131307 -0.0133396 -0.0135448 -0.0137465 -0.0139454 -0.0141418 -0.0143363 -0.0145294 -0.00810799 -0.00810625 -0.00810663 -0.00810856 -0.00811204 -0.00811723 -0.00812431 -0.00813352 -0.00814517 -0.00815962 -0.00817735 -0.00819897 -0.0082252 -0.00825689 -0.00829501 -0.00834061 -0.0083948 -0.00845871 -0.00853343 -0.00861993 -0.00871903 -0.00883135 -0.00895724 -0.00909678 -0.00924979 -0.00941581 -0.00959411 -0.00978375 -0.00998359 -0.0101924 -0.0104087 -0.0106311 -0.010858 -0.0110878 -0.0113192 -0.0115508 -0.0117814 -0.0120102 -0.0122364 -0.0124594 -0.0126789 -0.0128948 -0.013107 -0.0133158 -0.0135212 -0.0137237 -0.0139236 -0.0141214 -0.0143173 -0.0145118 -0.00809759 -0.00809593 -0.00809604 -0.00809723 -0.00809945 -0.00810288 -0.00810776 -0.00811439 -0.00812318 -0.00813463 -0.0081494 -0.00816826 -0.00819212 -0.00822204 -0.00825914 -0.00830462 -0.0083597 -0.00842553 -0.00850315 -0.00859343 -0.008697 -0.00881423 -0.0089452 -0.0090897 -0.00924726 -0.00941715 -0.00959845 -0.00979006 -0.00999078 -0.0101993 -0.0104144 -0.0106348 -0.0108589 -0.0110854 -0.0113129 -0.0115404 -0.0117669 -0.0119917 -0.0122143 -0.0124341 -0.012651 -0.012865 -0.0130759 -0.013284 -0.0134893 -0.0136921 -0.0138927 -0.0140914 -0.0142883 -0.0144836 -0.0080807 -0.00807926 -0.00807909 -0.00807936 -0.00808002 -0.00808132 -0.00808356 -0.00808716 -0.00809268 -0.0081008 -0.00811239 -0.00812844 -0.00815013 -0.0081787 -0.00821549 -0.00826184 -0.00831902 -0.00838817 -0.00847022 -0.00856586 -0.00867543 -0.00879899 -0.00893627 -0.0090867 -0.00924949 -0.00942365 -0.00960805 -0.00980147 -0.0100027 -0.0102104 -0.0104236 -0.0106411 -0.0108617 -0.0110839 -0.0113067 -0.0115291 -0.0117504 -0.0119701 -0.0121879 -0.0124034 -0.0126166 -0.0128275 -0.0130361 -0.0132424 -0.0134466 -0.0136487 -0.0138489 -0.0140474 -0.0142442 -0.0144393 -0.00805584 -0.00805472 -0.00805426 -0.00805348 -0.00805237 -0.00805127 -0.00805062 -0.00805099 -0.00805311 -0.00805792 -0.00806653 -0.00808021 -0.00810039 -0.00812857 -0.00816625 -0.00821487 -0.00827571 -0.00834982 -0.00843795 -0.00854048 -0.00865745 -0.00878849 -0.00893295 -0.00908987 -0.00925816 -0.00943658 -0.00962386 -0.0098187 -0.0100198 -0.010226 -0.0104367 -0.0106509 -0.0108675 -0.0110849 -0.0113023 -0.0115189 -0.0117341 -0.0119477 -0.0121597 -0.0123698 -0.0125782 -0.0127849 -0.0129899 -0.0131932 -0.0133949 -0.0135949 -0.0137933 -0.0139901 -0.0141851 -0.0143785 -0.00802147 -0.00802072 -0.00801997 -0.00801806 -0.00801508 -0.00801151 -0.00800795 -0.00800516 -0.00800413 -0.00800605 -0.00801234 -0.00802457 -0.00804443 -0.00807362 -0.00811379 -0.00816639 -0.00823263 -0.00831339 -0.00840913 -0.00851988 -0.00864527 -0.0087845 -0.00893651 -0.00910002 -0.00927366 -0.00945605 -0.00964584 -0.00984168 -0.0100423 -0.0102465 -0.0104543 -0.0106652 -0.0108781 -0.011091 -0.0113029 -0.0115134 -0.0117221 -0.0119292 -0.0121346 -0.0123387 -0.0125414 -0.0127429 -0.0129432 -0.0131423 -0.0133401 -0.0135365 -0.0137313 -0.0139245 -0.0141161 -0.0143059 -0.00797606 -0.0079757 -0.00797465 -0.00797163 -0.00796683 -0.00796094 -0.00795474 -0.00794924 -0.00794569 -0.00794561 -0.00795072 -0.00796289 -0.00798403 -0.008016 -0.00806047 -0.00811887 -0.0081922 -0.00828108 -0.0083856 -0.0085054 -0.00863968 -0.00878727 -0.00894671 -0.00911647 -0.00929504 -0.00948101 -0.00967311 -0.00986997 -0.0100702 -0.0102721 -0.0104774 -0.0106859 -0.0108964 -0.0111058 -0.0113129 -0.0115176 -0.01172 -0.0119205 -0.0121194 -0.0123171 -0.0125137 -0.0127094 -0.0129042 -0.013098 -0.0132906 -0.0134816 -0.013671 -0.0138587 -0.0140446 -0.0142289 -0.00791816 -0.00791824 -0.00791693 -0.00791292 -0.00790658 -0.00789879 -0.00789056 -0.00788317 -0.00787819 -0.00787744 -0.00788294 -0.0078968 -0.0079211 -0.00795775 -0.00800837 -0.0080742 -0.00815598 -0.00825394 -0.0083678 -0.00849682 -0.00863984 -0.00879537 -0.0089617 -0.00913716 -0.00932026 -0.00950971 -0.0097045 -0.00990322 -0.0101039 -0.010303 -0.0105067 -0.0107149 -0.0109262 -0.011134 -0.0113375 -0.0115372 -0.0117339 -0.0119283 -0.0121209 -0.0123123 -0.0125028 -0.0126924 -0.012881 -0.0130685 -0.0132543 -0.0134383 -0.0136201 -0.0138 -0.013978 -0.0141544 -0.00784657 -0.00784721 -0.00784573 -0.00784103 -0.00783364 -0.00782468 -0.0078154 -0.00780736 -0.00780243 -0.00780273 -0.00781051 -0.00782805 -0.00785747 -0.00790062 -0.00795895 -0.0080334 -0.00812435 -0.00823165 -0.00835464 -0.00849231 -0.00864332 -0.00880603 -0.00897857 -0.0091593 -0.00934689 -0.00954028 -0.00973872 -0.00994067 -0.0101441 -0.0103377 -0.0105414 -0.0107525 -0.0109702 -0.0111798 -0.0113816 -0.0115774 -0.0117689 -0.0119576 -0.0121445 -0.01233 -0.0125145 -0.0126977 -0.0128795 -0.0130594 -0.0132369 -0.0134118 -0.0135838 -0.0137535 -0.0139212 -0.0140876 -0.00776056 -0.00776183 -0.00776038 -0.00775546 -0.00774779 -0.0077387 -0.00772969 -0.0077226 -0.00771956 -0.0077229 -0.00773502 -0.00775823 -0.00779458 -0.00784572 -0.0079128 -0.00799638 -0.00809644 -0.00821247 -0.00834356 -0.00848866 -0.00864655 -0.00881569 -0.00899407 -0.00918012 -0.00937259 -0.00957066 -0.00977426 -0.00998105 -0.0101873 -0.0103697 -0.0105732 -0.0107956 -0.0110303 -0.0112461 -0.0114478 -0.0116404 -0.0118275 -0.0120111 -0.0121927 -0.0123728 -0.0125512 -0.0127278 -0.0129019 -0.013073 -0.0132404 -0.0134041 -0.0135642 -0.0137215 -0.0138769 -0.0140317 -0.00766009 -0.00766167 -0.00766069 -0.00765624 -0.00764931 -0.00764143 -0.00763434 -0.00763009 -0.00763098 -0.00763947 -0.00765794 -0.00768861 -0.00773331 -0.00779336 -0.0078695 -0.00796188 -0.00807014 -0.00819349 -0.00833096 -0.00848187 -0.0086456 -0.00882094 -0.00900539 -0.00919726 -0.00939516 -0.00959864 -0.00980967 -0.0100296 -0.0102327 -0.0103588 -0.0105683 -0.0108268 -0.0111066 -0.0113358 -0.0115359 -0.0117249 -0.0119081 -0.0120876 -0.012265 -0.0124401 -0.0126126 -0.012782 -0.0129475 -0.0131084 -0.0132642 -0.0134151 -0.0135616 -0.013705 -0.013847 -0.0139892 -0.00754513 -0.00754726 -0.00754714 -0.007544 -0.00753903 -0.00753393 -0.0075306 -0.00753123 -0.00753816 -0.0075538 -0.00758041 -0.00761991 -0.00767377 -0.0077429 -0.00782759 -0.00792763 -0.00804241 -0.00817108 -0.00831284 -0.00846785 -0.00863677 -0.00881901 -0.00901038 -0.00920906 -0.00941355 -0.00962385 -0.00984418 -0.0100667 -0.0103099 -0.0100223 -0.0102178 -0.0107414 -0.0111686 -0.011432 -0.0116356 -0.0118231 -0.0120061 -0.0121832 -0.0123577 -0.0125291 -0.0126963 -0.0128582 -0.0130142 -0.0131638 -0.0133069 -0.0134439 -0.013576 -0.0137051 -0.0138334 -0.013963 -0.00741661 -0.00741947 -0.00742074 -0.00741988 -0.00741825 -0.00741763 -0.00742 -0.00742751 -0.00744243 -0.00746695 -0.007503 -0.00755209 -0.00761521 -0.00769279 -0.00778475 -0.00789065 -0.00800987 -0.00814175 -0.00828551 -0.0084426 -0.0086165 -0.00880812 -0.00900848 -0.00921518 -0.0094271 -0.00964178 -0.00986404 -0.0101112 -0.00940798 -0.00675025 -0.00685406 -0.00831661 -0.0111932 -0.0114859 -0.011729 -0.0119357 -0.0121213 -0.0122956 -0.0124673 -0.012636 -0.0127987 -0.0129538 -0.0131002 -0.0132379 -0.0133677 -0.0134906 -0.0136084 -0.0137233 -0.0138381 -0.0139553 -0.00727602 -0.00727985 -0.00728311 -0.00728556 -0.00728868 -0.00729423 -0.00730411 -0.00732032 -0.00734483 -0.00737945 -0.00742562 -0.00748432 -0.00755602 -0.00764071 -0.00773811 -0.00784784 -0.00796958 -0.0081026 -0.00824546 -0.00840175 -0.00858134 -0.00878755 -0.00900156 -0.00921792 -0.00943599 -0.00965886 -0.00986284 -0.0100122 -0.00642881 -0.0066048 -0.00685802 -0.00682506 -0.0100575 -0.0115742 -0.0118328 -0.0120681 -0.0122545 -0.0124237 -0.0125922 -0.0127577 -0.0129164 -0.0130656 -0.0132036 -0.0133302 -0.0134468 -0.0135558 -0.0136596 -0.0137607 -0.013862 -0.0139662 -0.00712543 -0.00713048 -0.00713634 -0.00714312 -0.00715231 -0.00716554 -0.00718446 -0.00721073 -0.00724589 -0.00729118 -0.00734741 -0.00741499 -0.0074939 -0.00758387 -0.00768469 -0.00779649 -0.00791931 -0.00805126 -0.0081882 -0.00833977 -0.00852726 -0.00875668 -0.00899107 -0.00921995 -0.00944003 -0.00968305 -0.00990422 -0.0101388 -0.0097079 -0.00716195 -0.00703006 -0.00814645 -0.0113354 -0.0117765 -0.0119074 -0.0117887 -0.0124075 -0.0125656 -0.0127281 -0.0128903 -0.0130458 -0.0131905 -0.0133218 -0.0134394 -0.0135444 -0.0136399 -0.0137296 -0.0138164 -0.0139031 -0.0139923 -0.00696735 -0.00697387 -0.00698292 -0.0069949 -0.00701125 -0.00703328 -0.00706229 -0.00709942 -0.00714558 -0.00720133 -0.00726681 -0.00734186 -0.00742614 -0.00751939 -0.00762172 -0.00773371 -0.00785653 -0.00798646 -0.00810507 -0.00823827 -0.00843535 -0.00872279 -0.00896764 -0.00921547 -0.00943787 -0.00960201 -0.00994492 -0.0102057 -0.0104648 -0.0103551 -0.0105144 -0.0111195 -0.0116295 -0.0118609 -0.0120727 -0.0122959 -0.012518 -0.0127005 -0.0128656 -0.0130281 -0.0131835 -0.0133262 -0.0134532 -0.0135639 -0.0136593 -0.0137423 -0.013817 -0.0138875 -0.0139571 -0.0140284 -0.00680466 -0.00681287 -0.00682555 -0.00684336 -0.00686754 -0.006899 -0.00693849 -0.00698652 -0.00704324 -0.00710846 -0.0071817 -0.00726235 -0.00734999 -0.00744463 -0.00754642 -0.00765577 -0.00777517 -0.00789268 -0.00797368 -0.00800728 -0.00816 -0.00873092 -0.00887891 -0.00921639 -0.00943605 -0.00967617 -0.00964078 -0.0102069 -0.0104534 -0.0106558 -0.0109178 -0.0112592 -0.0116281 -0.0119441 -0.0122331 -0.0124703 -0.0126672 -0.0128423 -0.0130063 -0.0131707 -0.0133289 -0.0134725 -0.013598 -0.0137042 -0.0137914 -0.0138618 -0.0139197 -0.0139706 -0.0140192 -0.0140689 -0.00664038 -0.00665043 -0.00666698 -0.00669087 -0.00672305 -0.00676389 -0.0068135 -0.00687163 -0.00693766 -0.00701068 -0.00708968 -0.00717388 -0.00726301 -0.0073572 -0.00745659 -0.00756128 -0.00766866 -0.00775551 -0.0075393 -0.00555518 -0.00505945 -0.00675742 -0.00888248 -0.00916203 -0.00940633 -0.00966518 -0.00992575 -0.0101995 -0.0104677 -0.010724 -0.0110265 -0.0113637 -0.0117196 -0.0120822 -0.0124218 -0.0125858 -0.012849 -0.0129969 -0.0131445 -0.0133126 -0.0134803 -0.013631 -0.0137594 -0.0138638 -0.0139429 -0.0139985 -0.0140359 -0.0140623 -0.0140851 -0.0141093 -0.00647747 -0.00648941 -0.0065098 -0.00653958 -0.00657929 -0.00662872 -0.00668725 -0.00675387 -0.00682724 -0.00690587 -0.00698845 -0.00707432 -0.0071636 -0.00725692 -0.00735598 -0.00746429 -0.00758025 -0.00766543 -0.0057152 -0.00458223 -0.00481613 -0.00496318 -0.00866511 -0.00907472 -0.00935639 -0.00963952 -0.00991151 -0.0101869 -0.0104742 -0.0107653 -0.0110991 -0.0114473 -0.0117866 -0.0122125 -0.0127133 -0.0130187 -0.0130475 -0.0131409 -0.0132615 -0.0134434 -0.013639 -0.0138078 -0.0139448 -0.0140498 -0.0141191 -0.0141547 -0.0141641 -0.0141595 -0.014151 -0.0141462 -0.00631865 -0.00633235 -0.00635624 -0.0063912 -0.00643732 -0.00649378 -0.00655926 -0.00663206 -0.00671024 -0.00679194 -0.00687582 -0.0069615 -0.00704961 -0.0071419 -0.00724243 -0.0073587 -0.00749931 -0.00768949 -0.0062601 -0.00480105 -0.00569162 -0.00770456 -0.00874225 -0.0090238 -0.00932449 -0.0096047 -0.00988105 -0.0101599 -0.0100937 -0.0107732 -0.0111572 -0.0115373 -0.0117795 -0.0122072 -0.0128612 -0.0133553 -0.0131247 -0.0131936 -0.0133014 -0.0135493 -0.0138149 -0.0140153 -0.0141656 -0.0142729 -0.0143281 -0.0143341 -0.0143038 -0.0142582 -0.0142136 -0.0141767 -0.00616615 -0.00618133 -0.00620803 -0.00624693 -0.0062977 -0.00635892 -0.00642872 -0.00650484 -0.006585 -0.00666718 -0.0067502 -0.00683394 -0.00691925 -0.00700817 -0.0071044 -0.00721522 -0.00735623 -0.00753781 -0.00774876 -0.00763105 -0.00772914 -0.00813408 -0.00856104 -0.00895731 -0.00928844 -0.00955887 -0.00983113 -0.0101151 -0.0104107 -0.0107629 -0.0111938 -0.0114384 -0.0107819 -0.00937717 -0.00969064 -0.0102816 -0.0114477 -0.0131384 -0.0131776 -0.0136535 -0.0140244 -0.0142702 -0.0144351 -0.0145455 -0.0145793 -0.0145422 -0.0144541 -0.0143547 -0.0142697 -0.0142003 -0.00602159 -0.00603777 -0.00606624 -0.00610739 -0.00616048 -0.00622366 -0.00629467 -0.00637101 -0.00645029 -0.00653066 -0.00661128 -0.00669229 -0.00677451 -0.00685969 -0.00695049 -0.00705076 -0.00716684 -0.00729177 -0.00741045 -0.00742415 -0.00760565 -0.00803987 -0.00852878 -0.00893173 -0.00927851 -0.00952644 -0.00977534 -0.0100651 -0.0103854 -0.0106687 -0.0110393 -0.0103074 -0.00794498 -0.00908886 -0.0103834 -0.0110254 -0.0111319 -0.011375 -0.0122698 -0.013884 -0.0143928 -0.0146046 -0.0147766 -0.0148947 -0.0148937 -0.0147863 -0.0146121 -0.014444 -0.0143166 -0.0142195 -0.0058858 -0.00590235 -0.00593126 -0.00597258 -0.00602526 -0.00608725 -0.00615618 -0.00622961 -0.00630542 -0.00638222 -0.0064597 -0.00653827 -0.00661857 -0.00670148 -0.00678789 -0.00687893 -0.00697785 -0.00709136 -0.00698289 -0.00716352 -0.00736166 -0.00781854 -0.00842578 -0.00888907 -0.00938936 -0.00944674 -0.00970009 -0.0100052 -0.0103825 -0.0103409 -0.0109429 -0.0114344 -0.0119043 -0.0118664 -0.0113666 -0.0116205 -0.0125894 -0.0119342 -0.011341 -0.0124222 -0.014774 -0.0150133 -0.0152093 -0.0153572 -0.0152954 -0.0150782 -0.0147737 -0.0145172 -0.0143498 -0.0142377 -0.00575883 -0.00577496 -0.00580278 -0.00584195 -0.00589128 -0.00594881 -0.00601241 -0.00608007 -0.00615026 -0.00622232 -0.00629656 -0.00637362 -0.0064538 -0.00653677 -0.00662131 -0.0067052 -0.00678348 -0.00683556 -0.00681884 -0.00679187 -0.00659035 -0.00509016 -0.00356614 -0.00605866 -0.00935613 -0.00945056 -0.00957859 -0.00987072 -0.010351 -0.00980411 -0.0109412 -0.0110627 -0.0113492 -0.0116812 -0.0118767 -0.0121895 -0.0126936 -0.0132237 -0.0128276 -0.0133741 -0.0154327 -0.0154643 -0.0157257 -0.0159701 -0.0157771 -0.0154066 -0.0149636 -0.0145346 -0.0143494 -0.0142586 -0.00563986 -0.00565471 -0.0056798 -0.00571443 -0.00575751 -0.00580748 -0.00586281 -0.00592226 -0.00598522 -0.00605192 -0.00612336 -0.00620039 -0.00628297 -0.00636984 -0.00645831 -0.00654378 -0.00661478 -0.0066382 -0.00651601 -0.00593963 -0.00352487 -0.00298405 -0.00251778 -0.00210978 -0.0075213 -0.00908018 -0.00935338 -0.00971118 -0.0100963 -0.0104247 -0.0109808 -0.0112002 -0.0117088 -0.0120411 -0.0123536 -0.0127941 -0.0133288 -0.0139132 -0.0146641 -0.0154241 -0.015656 -0.0157864 -0.0162253 -0.0171952 -0.0154443 -0.0149602 -0.0151877 -0.0143261 -0.0142712 -0.0142984 -0.00552736 -0.00554004 -0.0055608 -0.00558866 -0.00562285 -0.00566255 -0.00570715 -0.00575651 -0.00581112 -0.0058722 -0.00594141 -0.00601978 -0.00610715 -0.00620217 -0.0063025 -0.00640469 -0.00650195 -0.0065741 -0.00651162 -0.00430019 -0.00281407 -0.00280701 -0.00283617 -0.002528 -0.00789409 -0.00864015 -0.00900969 -0.00941833 -0.00983959 -0.0102319 -0.0106451 -0.0108736 -0.011352 -0.0120565 -0.0128032 -0.0133133 -0.0138874 -0.0144724 -0.0150651 -0.015683 -0.0158902 -0.0158807 -0.0162978 -0.0150079 0.000300768 0.00129145 -0.00893596 -0.0134305 -0.0141654 -0.0144231 -0.0054192 -0.00542887 -0.00544388 -0.00546304 -0.00548619 -0.0055135 -0.00554557 -0.00558355 -0.00562909 -0.00568433 -0.00575136 -0.00583129 -0.00592387 -0.0060282 -0.00614393 -0.0062723 -0.00641521 -0.00657749 -0.00678639 -0.00128975 -0.00198084 -0.00264156 -0.00344649 -0.00474754 -0.00758308 -0.00812532 -0.00861462 -0.00910157 -0.0096062 -0.0101522 -0.0107917 -0.0112251 -0.0120008 -0.0126342 -0.0131492 -0.0137767 -0.0144171 -0.0150298 -0.0155923 -0.0160796 -0.0161848 -0.0156198 -0.0155058 -0.00605695 -7.18332e-05 -0.000898654 -0.00289092 -0.0118597 -0.0146167 -0.0149056 -0.00531283 -0.00531882 -0.00532694 -0.00533599 -0.00534659 -0.00536015 -0.00537862 -0.00540448 -0.00544049 -0.00548938 -0.00555334 -0.00563312 -0.00572799 -0.00583676 -0.00595956 -0.00609922 -0.00626274 -0.0064647 -0.00662413 -0.00112776 -0.00108111 -0.00238138 -0.00454775 -0.00605318 -0.00704126 -0.00768498 -0.00823661 -0.00878083 -0.00935191 -0.00996628 -0.0106327 -0.0112872 -0.0119109 -0.0127055 -0.013405 -0.0142004 -0.01496 -0.0156306 -0.0161388 -0.016685 -0.0162441 -0.0163888 -0.0148379 -0.0149443 -0.00424648 -0.0017082 -0.00037158 -0.00868312 -0.0161234 -0.01601 -0.00520561 -0.00520742 -0.00520794 -0.00520608 -0.00520341 -0.00520267 -0.00520722 -0.00522076 -0.0052469 -0.00528861 -0.00534774 -0.00542431 -0.00551665 -0.00562309 -0.00574413 -0.00588346 -0.00604926 -0.00626728 -0.00657621 -0.00652071 -0.00273132 -0.00529016 -0.0058458 -0.00624962 -0.00682143 -0.0073645 -0.00790053 -0.00846648 -0.00907644 -0.00973122 -0.0104266 -0.0111863 -0.0120095 -0.0127805 -0.0135671 -0.014587 -0.0155003 -0.0163912 -0.0167604 -0.015528 -0.0147667 -0.0154322 -0.0164239 -0.0155978 -0.0124454 -0.00231786 0.00217991 -0.0106278 -0.0181128 -0.0173579 -0.00509503 -0.00509235 -0.00508503 -0.00507215 -0.00505631 -0.00504157 -0.00503256 -0.00503401 -0.00505003 -0.00508345 -0.00513537 -0.00520472 -0.00528861 -0.00538413 -0.00549046 -0.00560853 -0.00575032 -0.00593847 -0.00564649 -0.00627517 -0.00610962 -0.00610493 -0.00601621 -0.00623763 -0.00659586 -0.00704315 -0.00755283 -0.00813298 -0.00876929 -0.00945832 -0.0101944 -0.0109901 -0.0117996 -0.0127095 -0.0116075 -0.00860331 -0.00832062 -0.0159709 -0.0176155 -0.0171442 -0.0174427 -0.0173074 -0.0171656 -0.0167078 -0.0161971 -0.0171509 -0.0164295 -0.0181287 -0.0198149 -0.0185235 -0.00497878 -0.00497173 -0.00495675 -0.00493342 -0.00490529 -0.0048776 -0.00485601 -0.00484592 -0.00485161 -0.00487545 -0.00491759 -0.00497584 -0.00504623 -0.00512483 -0.00520967 -0.00530186 -0.00541027 -0.00553123 -0.00565186 -0.00575467 -0.00575895 -0.00576626 -0.00581155 -0.00598738 -0.00627898 -0.00666829 -0.00715277 -0.00773535 -0.00838826 -0.00894373 -0.00989947 -0.0107191 -0.0119935 -0.0110314 -0.00757898 -0.00741811 -0.00716318 -0.011707 -0.0176353 -0.0177191 -0.0183121 -0.0188928 -0.0188703 -0.0180466 -0.0182001 -0.019395 -0.0203818 -0.02105 -0.0195275 -0.0194169 -0.00485528 -0.00484407 -0.00482213 -0.00478953 -0.00475068 -0.0047117 -0.00467892 -0.00465806 -0.00465322 -0.00466613 -0.00469601 -0.00473982 -0.00479305 -0.00485159 -0.00491358 -0.00498064 -0.00505727 -0.00513962 -0.00519279 -0.00529745 -0.00533986 -0.00538604 -0.00545763 -0.00561541 -0.0057633 -0.00621518 -0.0066685 -0.00723163 -0.00782703 -0.00765142 -0.00876336 -0.0101791 -0.0122041 -0.00950074 -0.00762426 -0.00908011 -0.010302 -0.0162614 -0.017774 -0.0184143 -0.019042 -0.0200139 -0.019895 -0.0188142 -0.0193899 -0.0212874 -0.0219373 -0.0215402 -0.0203269 -0.0201134 -0.00472349 -0.00470857 -0.00468073 -0.00464055 -0.00459306 -0.00454486 -0.00450255 -0.00447176 -0.00445617 -0.00445682 -0.00447217 -0.00449878 -0.0045323 -0.00456918 -0.00460831 -0.00465172 -0.00470228 -0.00475056 -0.00480794 -0.00486093 -0.00489036 -0.00490816 -0.00502399 -0.00516048 -0.00537933 -0.00568387 -0.00608953 -0.00660366 -0.00706855 -0.00703758 -0.0083653 -0.00961775 -0.0115693 -0.0107466 -0.00878549 -0.010952 -0.0150051 -0.0171635 -0.0182213 -0.0190295 -0.0199158 -0.0218715 -0.0213569 -0.0183362 -0.0196298 -0.0226742 -0.0241629 -0.022516 -0.0205891 -0.0200708 -0.00458313 -0.00456512 -0.0045327 -0.00448696 -0.0044332 -0.00437804 -0.00432792 -0.00428802 -0.00426142 -0.00424854 -0.00424743 -0.00425477 -0.00426697 -0.00428154 -0.00429826 -0.00431893 -0.00434382 -0.00437268 -0.0044021 -0.00398857 -0.00443239 -0.00446159 -0.00451817 -0.00463369 -0.00481273 -0.00506878 -0.00541075 -0.00585797 -0.00641547 -0.00704167 -0.0078355 -0.00880501 -0.00982559 -0.0107271 -0.0143008 -0.015981 -0.0158363 -0.018097 -0.0189185 -0.0194216 -0.0205293 -0.0260762 -0.0239782 -0.01581 -0.0182167 -0.0244078 -0.0255112 -0.0215985 -0.0180947 -0.0180848 -0.00443462 -0.00441423 -0.00437871 -0.00432957 -0.00427195 -0.00421208 -0.00415577 -0.00410749 -0.00406962 -0.00404215 -0.00402315 -0.00400988 -0.00399997 -0.00399223 -0.00398712 -0.00398583 -0.00398798 -0.00399276 -0.00398979 -0.00399353 -0.00392495 -0.00395579 -0.00398253 -0.00405225 -0.00417781 -0.00437436 -0.00464151 -0.00500197 -0.00546479 -0.00604437 -0.00685095 -0.0080565 -0.0102901 -0.0106832 -0.0109568 -0.0153586 -0.0157496 -0.0194032 -0.021156 -0.020397 -0.0167621 -0.0271232 -0.00936469 -0.0081417 -0.0110496 -0.0246399 -0.0280222 -0.0176555 -0.0159158 -0.0309915 -0.00427905 -0.00425702 -0.00421989 -0.00416943 -0.00411024 -0.00404768 -0.00398659 -0.00393051 -0.00388116 -0.00383838 -0.00380062 -0.00376612 -0.0037339 -0.00370401 -0.00367722 -0.0036538 -0.00363183 -0.00360691 -0.0035703 -0.00353092 -0.00347951 -0.00342312 -0.00341109 -0.00342928 -0.00349256 -0.00361144 -0.00379323 -0.0040553 -0.00438626 -0.00478988 -0.00535719 -0.00622582 -0.0078688 -0.00473959 -0.00522893 -0.0242545 -0.0278095 -0.0244623 -0.022765 -0.0160151 -0.0187201 -0.0213938 0.00423936 0.0263985 0.0239032 -0.0507487 -0.0886099 -0.0300391 -0.0549507 0.839338 -0.00411805 -0.00409511 -0.00405774 -0.00400779 -0.00394897 -0.00388538 -0.00382061 -0.00375719 -0.00369632 -0.0036379 -0.00358112 -0.0035254 -0.00347107 -0.00341918 -0.00337038 -0.00332369 -0.00327536 -0.00321912 -0.00314912 -0.00306286 -0.00297077 -0.00288715 -0.0028173 -0.0027734 -0.00276383 -0.00279813 -0.00288981 -0.00304408 -0.0032177 -0.00337599 -0.00353427 -0.00364172 -0.00501568 -0.00792578 -0.0154123 -0.0271827 -0.0361249 -0.035273 -0.0268328 0.000503981 0.0260922 -0.0300451 -0.16143 1.09723 1.21837 2.90474 9.88561 22.1989 32.9664 39.2367 -0.00395368 -0.00393043 -0.00389394 -0.00384597 -0.00378898 -0.00372556 -0.0036579 -0.00358755 -0.00351531 -0.00344139 -0.0033659 -0.00328945 -0.00321348 -0.00313961 -0.00306809 -0.00299649 -0.00291954 -0.00283034 -0.00272367 -0.00259961 -0.00246474 -0.00233197 -0.0022076 -0.00209429 -0.00200203 -0.00193814 -0.00192175 -0.00198927 -0.00187266 -0.00199164 -0.0024533 -0.00244287 -0.00233838 -0.00303743 -0.0108206 -0.0250419 -0.0547743 -0.0583463 -0.0290173 0.0548576 0.0384447 0.025943 5.29923 10.396 17.6538 35.4319 41.7264 40.0301 40.0187 41.0323 -0.00378817 -0.0037651 -0.00373029 -0.00368527 -0.00363104 -0.00356851 -0.00349847 -0.00342157 -0.00333839 -0.00324957 -0.00315616 -0.00305984 -0.00296285 -0.00286699 -0.00277194 -0.00267414 -0.00256728 -0.00244459 -0.00230172 -0.00213939 -0.00196292 -0.00178234 -0.00159543 -0.00119865 -0.00121445 -0.00103314 -0.000868111 -0.000704993 0.000521255 0.0037788 0.00755165 0.00497304 0.00714959 0.00425285 0.00429876 -0.0207821 -0.0689851 -0.0892374 -0.0782046 0.132455 0.230634 8.07098 19.7354 35.6276 41.3227 41.3113 40.9911 40.4592 40.4026 40.7072 -0.00362384 -0.00360126 -0.00356858 -0.00352696 -0.00347584 -0.00341446 -0.00334232 -0.00325931 -0.00316589 -0.00306318 -0.00295304 -0.00283799 -0.00272072 -0.00260293 -0.00248384 -0.00235927 -0.00222263 -0.00206761 -0.00189091 -0.00169307 -0.00147663 -0.00124497 -0.000991843 -0.0007217 -0.000424358 -0.000104291 0.000254374 0.000669477 0.00203706 0.00742906 0.00600378 0.0059037 0.0100686 0.0181577 0.0271679 0.0505513 0.0287146 1.10653 -0.308933 -0.258388 8.98283 29.0976 41.4072 42.0882 41.3015 40.9327 40.6657 40.4508 40.3813 40.3995 -0.00346289 -0.00344091 -0.00341045 -0.00337217 -0.003324 -0.00326366 -0.00318955 -0.00310096 -0.00299829 -0.00288303 -0.00275764 -0.00262516 -0.00248849 -0.00234916 -0.00220615 -0.00205526 -0.00189034 -0.00170577 -0.00149865 -0.00126844 -0.00101465 -0.000734636 -0.00042255 -6.66493e-05 0.000337213 0.000803727 0.0013507 0.00193355 0.002933 0.00466116 0.00736551 0.0105167 0.0157556 0.0183128 0.0420059 0.0966839 0.196787 0.343747 -0.636462 10.8675 36.6773 41.1711 41.9937 41.5412 41.0431 40.7322 40.5045 40.3761 40.2975 40.2237 -0.00330726 -0.00328584 -0.00325734 -0.00322191 -0.0031761 -0.00311641 -0.00304038 -0.00294685 -0.00283616 -0.00270996 -0.002571 -0.00242255 -0.00226759 -0.00210762 -0.00194169 -0.00176613 -0.00157564 -0.00136533 -0.00113196 -0.00087316 -0.000584959 -0.000260686 0.000108787 0.000535353 0.00102935 0.00161222 0.00231019 0.00315936 0.00462644 0.00611874 0.00849139 0.0114523 0.0155134 0.01781 0.0342863 0.119927 0.194228 0.790886 5.35313 34.4328 41.5139 41.5377 41.759 41.3278 40.8957 40.6082 40.4291 40.323 40.2447 40.1503 -0.00315858 -0.00313752 -0.00311042 -0.00307697 -0.00303265 -0.00297307 -0.00289518 -0.0027975 -0.00268019 -0.00254485 -0.00239414 -0.00223135 -0.00205952 -0.00188044 -0.00169358 -0.00149609 -0.00128366 -0.00105183 -0.000796598 -0.000513393 -0.000195487 0.000165957 0.000580435 0.00105846 0.00161331 0.0022661 0.00305001 0.00401014 0.00556675 0.00704204 0.00926598 0.0120527 0.0156926 0.0190551 0.0131563 -0.0243648 -0.256506 4.23636 16.2395 42.6541 41.9701 42.072 41.7563 41.2275 40.8197 40.5685 40.4157 40.3175 40.236 40.1443 -0.00301806 -0.00299705 -0.00297059 -0.00293801 -0.00289411 -0.00283404 -0.00275441 -0.00265351 -0.00253116 -0.00238857 -0.00222805 -0.00205274 -0.00186592 -0.00166988 -0.00146494 -0.00124911 -0.00101879 -0.000769638 -0.000496651 -0.000193453 0.000148304 0.000537784 0.000983015 0.00149204 0.00207592 0.00275173 0.00354459 0.00449444 0.00571025 0.0070872 0.00888589 0.0112723 0.0143291 0.0194326 0.0375912 0.0587462 1.07177 12.8215 35.5258 42.1534 41.6652 41.4619 41.289 40.9751 40.713 40.5396 40.4181 40.3266 40.2474 40.1649 -0.0028865 -0.00286514 -0.00283844 -0.00280551 -0.00276093 -0.00269979 -0.00261866 -0.00251558 -0.00238984 -0.00224195 -0.00207364 -0.0018879 -0.00168836 -0.00147815 -0.00125856 -0.0010284 -0.000784361 -0.000521788 -0.000234838 8.39125e-05 0.000443142 0.000850981 0.00131326 0.00183486 0.00242285 0.00308654 0.00383419 0.00467488 0.0056028 0.00653838 0.00741997 0.00820363 0.00921769 0.0262313 0.204731 0.129288 0.696294 17.1459 41.1392 40.8524 40.6657 40.6472 40.6621 40.6124 40.5439 40.4744 40.3993 40.3244 40.2529 40.181 -0.00276428 -0.00274215 -0.00271428 -0.00267981 -0.00263351 -0.00257086 -0.00248861 -0.00238448 -0.00225704 -0.00210581 -0.00193182 -0.00173794 -0.00152837 -0.00130718 -0.00107665 -0.000836137 -0.000582319 -0.000310062 -1.29452e-05 0.000316688 0.000686921 0.00110432 0.00157261 0.00209397 0.00267133 0.00330676 0.00399533 0.00472185 0.00545072 0.00610477 0.00665645 0.00692309 0.00591234 0.00511543 0.0281678 0.0382589 3.19821 30.282 39.3984 39.8501 39.9789 40.0666 40.1813 40.2899 40.3593 40.3769 40.3499 40.2981 40.2384 40.1778 -0.00265137 -0.00262807 -0.0025982 -0.0025611 -0.00251224 -0.00244785 -0.002365 -0.00226104 -0.00213356 -0.00198092 -0.00180342 -0.0016039 -0.00138723 -0.00115849 -0.000920674 -0.000673426 -0.000413322 -0.000134989 0.000168066 0.000503186 0.000877726 0.00129701 0.00176324 0.00227633 0.00283509 0.0034347 0.00405968 0.00467838 0.00523309 0.00562489 0.00570115 0.00509703 0.00394458 0.0050518 0.0114028 -0.0355035 12.2428 40.4178 39.6672 39.5458 39.5754 39.6956 39.8748 40.0611 40.2013 40.2725 40.2814 40.2512 40.2047 40.1548 -0.00254742 -0.00252263 -0.00249004 -0.00244946 -0.00239747 -0.00233135 -0.00224858 -0.00214604 -0.00202012 -0.00186798 -0.00168916 -0.00148662 -0.00126596 -0.00103307 -0.000791363 -0.000540512 -0.000277089 3.91873e-06 0.000308247 0.000642644 0.00101445 0.00142866 0.00188682 0.00238685 0.0029238 0.00348701 0.00405317 0.00458127 0.00500125 0.00519092 0.00495132 0.00407983 0.00262536 0.0047777 0.0108803 0.0253875 26.2303 40.8238 39.6697 39.3946 39.3941 39.5201 39.7164 39.9233 40.0863 40.1804 40.2094 40.1947 40.1595 40.1184 -0.0147524 -0.0149414 -0.0151301 -0.0153186 -0.0155073 -0.0156962 -0.0158854 -0.0160749 -0.0162648 -0.0164549 -0.0166452 -0.0168355 -0.0170258 -0.0172159 -0.017406 -0.017596 -0.0177859 -0.0179758 -0.018166 -0.0183569 -0.0185487 -0.0187418 -0.0189364 -0.0191327 -0.0193308 -0.0195304 -0.0197304 -0.0199293 -0.0201251 -0.0203154 -0.0204977 -0.0206699 -0.0208301 -0.0209773 -0.021111 -0.0212315 -0.02134 -0.0214384 -0.0215294 -0.0216162 -0.0217019 -0.0217884 -0.0218764 -0.0219643 -0.022049 -0.0221256 -0.0221896 -0.0222361 -0.022262 -0.0222687 -0.0147358 -0.0149259 -0.0151157 -0.0153053 -0.0154951 -0.0156852 -0.0158755 -0.0160661 -0.016257 -0.0164481 -0.0166394 -0.0168308 -0.0170221 -0.0172134 -0.0174048 -0.0175961 -0.0177874 -0.0179787 -0.0181704 -0.0183627 -0.0185559 -0.0187502 -0.0189459 -0.019143 -0.0193414 -0.0195407 -0.0197403 -0.0199387 -0.020134 -0.0203241 -0.0205067 -0.0206794 -0.0208406 -0.0209891 -0.0211242 -0.0212461 -0.0213555 -0.021454 -0.0215437 -0.0216273 -0.0217076 -0.0217871 -0.0218673 -0.0219481 -0.0220273 -0.0221013 -0.022165 -0.0222126 -0.0222393 -0.0222463 -0.0147215 -0.0149127 -0.0151035 -0.0152941 -0.0154845 -0.015675 -0.0158655 -0.0160561 -0.0162469 -0.0164379 -0.0166291 -0.0168204 -0.017012 -0.0172038 -0.0173962 -0.0175887 -0.0177816 -0.0179748 -0.0181685 -0.0183629 -0.0185582 -0.0187544 -0.0189515 -0.0191493 -0.0193477 -0.0195462 -0.0197443 -0.0199411 -0.0201351 -0.0203244 -0.0205071 -0.0206809 -0.0208442 -0.0209955 -0.021134 -0.0212594 -0.0213717 -0.0214716 -0.0215603 -0.0216394 -0.0217116 -0.0217801 -0.0218477 -0.0219165 -0.0219864 -0.0220551 -0.0221177 -0.0221668 -0.0221952 -0.0222034 -0.014705 -0.0148973 -0.0150887 -0.0152795 -0.0154698 -0.0156597 -0.0158494 -0.0160389 -0.0162285 -0.0164183 -0.0166084 -0.016799 -0.0169904 -0.0171826 -0.0173755 -0.0175695 -0.0177644 -0.0179601 -0.0181565 -0.0183536 -0.0185515 -0.0187498 -0.0189484 -0.0191468 -0.0193446 -0.0195414 -0.019737 -0.0199308 -0.020122 -0.0203094 -0.0204913 -0.0206659 -0.0208312 -0.0209858 -0.0211283 -0.021258 -0.0213743 -0.0214768 -0.0215656 -0.0216415 -0.0217064 -0.0217638 -0.021818 -0.0218731 -0.0219315 -0.0219925 -0.0220518 -0.0221003 -0.0221298 -0.022139 -0.0146775 -0.0148701 -0.0150614 -0.0152518 -0.0154412 -0.0156299 -0.0158181 -0.0160061 -0.0161941 -0.0163825 -0.0165716 -0.0167616 -0.0169529 -0.0171457 -0.01734 -0.0175361 -0.0177338 -0.0179328 -0.0181326 -0.0183329 -0.0185335 -0.0187339 -0.0189337 -0.0191324 -0.0193293 -0.0195239 -0.0197161 -0.0199058 -0.0200928 -0.0202766 -0.0204559 -0.0206292 -0.0207947 -0.0209508 -0.0210959 -0.0212287 -0.0213484 -0.0214543 -0.0215456 -0.0216225 -0.0216857 -0.0217379 -0.0217836 -0.0218279 -0.0218749 -0.0219258 -0.0219771 -0.0220208 -0.0220475 -0.0220561 -0.0146327 -0.0148246 -0.015015 -0.0152041 -0.0153921 -0.0155793 -0.0157661 -0.0159527 -0.0161396 -0.0163273 -0.0165161 -0.0167064 -0.0168986 -0.0170929 -0.0172895 -0.0174885 -0.0176897 -0.0178926 -0.0180962 -0.0183001 -0.0185034 -0.0187057 -0.0189065 -0.0191051 -0.0193007 -0.0194929 -0.0196813 -0.0198661 -0.0200476 -0.0202258 -0.0204 -0.0205692 -0.0207319 -0.0208864 -0.0210311 -0.0211648 -0.0212866 -0.0213959 -0.0214923 -0.0215752 -0.0216443 -0.0217005 -0.0217464 -0.0217863 -0.0218248 -0.0218642 -0.0219031 -0.0219355 -0.0219543 -0.0219597 -0.0145701 -0.0147601 -0.0149485 -0.0151357 -0.0153219 -0.0155075 -0.0156931 -0.015879 -0.0160657 -0.0162538 -0.0164436 -0.0166355 -0.0168298 -0.0170267 -0.0172263 -0.0174287 -0.0176337 -0.0178405 -0.0180482 -0.0182556 -0.0184616 -0.0186656 -0.0188669 -0.019065 -0.0192592 -0.0194487 -0.0196332 -0.0198127 -0.0199878 -0.020159 -0.0203263 -0.0204888 -0.0206458 -0.0207958 -0.0209376 -0.0210699 -0.0211921 -0.0213043 -0.0214065 -0.0214985 -0.0215793 -0.0216475 -0.0217028 -0.0217466 -0.0217815 -0.0218105 -0.0218341 -0.0218502 -0.0218566 -0.0218563 -0.0144941 -0.0146806 -0.0148659 -0.0150503 -0.0152343 -0.0154184 -0.0156032 -0.0157891 -0.0159766 -0.0161663 -0.0163583 -0.016553 -0.0167505 -0.0169508 -0.0171538 -0.0173596 -0.0175679 -0.0177782 -0.0179894 -0.0182 -0.0184086 -0.018614 -0.0188155 -0.0190127 -0.0192049 -0.0193916 -0.0195721 -0.0197464 -0.0199152 -0.0200792 -0.0202388 -0.0203938 -0.0205437 -0.0206878 -0.0208253 -0.0209552 -0.0210769 -0.0211908 -0.0212977 -0.0213985 -0.0214922 -0.0215762 -0.0216469 -0.0217016 -0.0217392 -0.0217613 -0.0217701 -0.0217685 -0.0217605 -0.0217534 -0.0144116 -0.0145932 -0.014774 -0.0149547 -0.0151359 -0.0153182 -0.0155023 -0.0156887 -0.0158776 -0.0160696 -0.0162645 -0.0164627 -0.0166639 -0.016868 -0.0170747 -0.0172836 -0.0174944 -0.017707 -0.0179203 -0.0181331 -0.0183436 -0.0185501 -0.0187515 -0.0189473 -0.0191372 -0.0193207 -0.0194972 -0.0196667 -0.0198297 -0.0199873 -0.0201402 -0.0202886 -0.0204322 -0.020571 -0.0207048 -0.020833 -0.0209549 -0.0210705 -0.0211808 -0.0212873 -0.0213907 -0.0214883 -0.0215749 -0.0216435 -0.0216889 -0.0217093 -0.0217074 -0.0216907 -0.02167 -0.0216567 -0.0143297 -0.0145045 -0.0146794 -0.0148554 -0.0150331 -0.0152132 -0.0153963 -0.015583 -0.0157733 -0.0159675 -0.0161655 -0.016367 -0.0165719 -0.0167797 -0.0169898 -0.0172013 -0.0174139 -0.0176273 -0.0178413 -0.0180547 -0.0182659 -0.0184727 -0.0186737 -0.0188679 -0.0190551 -0.019235 -0.0194076 -0.0195726 -0.0197307 -0.0198832 -0.0200313 -0.0201753 -0.020315 -0.0204506 -0.0205827 -0.0207113 -0.0208358 -0.0209551 -0.0210691 -0.0211791 -0.0212869 -0.0213916 -0.0214883 -0.0215684 -0.0216227 -0.021646 -0.0216398 -0.0216146 -0.0215864 -0.0215694 -0.0142536 -0.01442 -0.0145878 -0.014758 -0.0149314 -0.0151086 -0.0152902 -0.0154764 -0.0156674 -0.0158631 -0.0160632 -0.0162673 -0.0164749 -0.0166857 -0.0168986 -0.0171124 -0.0173261 -0.0175396 -0.0177527 -0.0179653 -0.0181759 -0.0183824 -0.0185827 -0.0187753 -0.0189598 -0.0191361 -0.0193044 -0.0194652 -0.0196191 -0.0197676 -0.0199126 -0.0200546 -0.0201934 -0.0203287 -0.0204613 -0.0205925 -0.0207221 -0.0208484 -0.0209689 -0.021083 -0.021192 -0.0212968 -0.0213948 -0.0214788 -0.0215385 -0.0215661 -0.0215618 -0.0215362 -0.0215078 -0.021491 -0.0141869 -0.014344 -0.0145039 -0.0146677 -0.014836 -0.0150095 -0.0151885 -0.0153732 -0.0155635 -0.0157594 -0.0159601 -0.016165 -0.0163736 -0.0165855 -0.0168 -0.0170155 -0.0172305 -0.017444 -0.0176562 -0.0178671 -0.0180763 -0.0182818 -0.0184814 -0.018673 -0.0188553 -0.0190282 -0.0191924 -0.0193492 -0.0194993 -0.0196448 -0.0197877 -0.0199294 -0.0200695 -0.020207 -0.0203422 -0.0204769 -0.0206125 -0.0207476 -0.0208781 -0.0209997 -0.0211106 -0.0212118 -0.0213035 -0.021382 -0.02144 -0.0214699 -0.0214709 -0.0214523 -0.0214307 -0.0214179 -0.0141332 -0.0142805 -0.0144321 -0.014589 -0.0147517 -0.0149206 -0.015096 -0.0152777 -0.0154655 -0.0156593 -0.0158584 -0.0160619 -0.016269 -0.0164798 -0.016694 -0.0169104 -0.0171268 -0.0173414 -0.0175535 -0.0177634 -0.0179712 -0.0181757 -0.0183749 -0.0185662 -0.0187474 -0.0189176 -0.0190777 -0.0192312 -0.0193783 -0.0195218 -0.0196633 -0.0198051 -0.0199477 -0.0200894 -0.0202288 -0.0203671 -0.0205071 -0.0206497 -0.0207907 -0.0209227 -0.0210392 -0.021138 -0.0212201 -0.0212864 -0.0213351 -0.0213626 -0.0213691 -0.0213616 -0.0213514 -0.0213455 -0.0140958 -0.0142332 -0.0143762 -0.0145256 -0.0146818 -0.0148449 -0.015015 -0.0151919 -0.015375 -0.0155641 -0.0157591 -0.0159591 -0.0161628 -0.0163704 -0.0165824 -0.0167982 -0.0170158 -0.0172322 -0.0174457 -0.0176562 -0.0178639 -0.0180681 -0.0182676 -0.0184597 -0.0186413 -0.0188097 -0.018965 -0.0191156 -0.0192609 -0.0194049 -0.0195467 -0.0196887 -0.0198334 -0.0199801 -0.0201255 -0.0202682 -0.0204106 -0.0205562 -0.0207035 -0.0208449 -0.0209695 -0.0210696 -0.0211442 -0.0211968 -0.0212317 -0.0212524 -0.0212622 -0.021266 -0.0212683 -0.0212699 -0.0140767 -0.0142036 -0.0143371 -0.0144776 -0.0146256 -0.0147809 -0.0149437 -0.0151134 -0.0152894 -0.0154718 -0.0156608 -0.0158558 -0.0160553 -0.0162588 -0.0164673 -0.016681 -0.0168984 -0.0171165 -0.0173326 -0.0175453 -0.0177547 -0.0179605 -0.0181618 -0.0183565 -0.0185404 -0.0187076 -0.0188548 -0.0190027 -0.019146 -0.0192945 -0.019441 -0.0195848 -0.0197305 -0.0198813 -0.020034 -0.0201834 -0.0203286 -0.0204735 -0.0206205 -0.020765 -0.0208953 -0.020999 -0.0210703 -0.0211126 -0.021134 -0.0211463 -0.0211567 -0.0211693 -0.021182 -0.0211899 -0.014075 -0.0141898 -0.0143114 -0.0144406 -0.0145778 -0.0147227 -0.0148754 -0.0150358 -0.0152031 -0.0153772 -0.0155589 -0.0157483 -0.0159438 -0.016144 -0.0163491 -0.01656 -0.0167761 -0.0169949 -0.0172132 -0.0174292 -0.0176421 -0.0178516 -0.0180574 -0.0182579 -0.0184474 -0.0186131 -0.0187431 -0.0188868 -0.0190254 -0.0191856 -0.0193449 -0.0194943 -0.0196401 -0.0197923 -0.0199512 -0.0201096 -0.0202611 -0.0204058 -0.020548 -0.0206879 -0.0208172 -0.0209221 -0.0209928 -0.0210295 -0.0210429 -0.0210482 -0.021058 -0.0210759 -0.0210951 -0.0211067 -0.0140862 -0.0141859 -0.0142926 -0.0144074 -0.0145306 -0.0146622 -0.0148024 -0.0149518 -0.0151094 -0.0152747 -0.0154486 -0.0156321 -0.0158241 -0.0160224 -0.0162257 -0.0164346 -0.0166492 -0.0168679 -0.0170877 -0.0173069 -0.0175247 -0.0177405 -0.0179536 -0.0181659 -0.0183682 -0.0185291 -0.0186228 -0.0187603 -0.0188946 -0.019077 -0.0192569 -0.0194176 -0.0195632 -0.0197126 -0.0198731 -0.0200391 -0.0202 -0.0203492 -0.0204877 -0.0206191 -0.0207402 -0.0208408 -0.02091 -0.0209451 -0.0209556 -0.0209583 -0.0209682 -0.0209887 -0.0210106 -0.0210233 -0.0141039 -0.0141853 -0.014274 -0.0143714 -0.0144782 -0.0145943 -0.0147202 -0.0148573 -0.0150049 -0.0151615 -0.0153276 -0.0155048 -0.0156933 -0.0158905 -0.0160939 -0.0163027 -0.016517 -0.0167359 -0.0169568 -0.0171782 -0.0174022 -0.0176274 -0.0178502 -0.0180797 -0.0183138 -0.0184911 -0.0184736 -0.0185944 -0.0187163 -0.0189703 -0.019173 -0.0193528 -0.0194994 -0.0196442 -0.0198003 -0.0199674 -0.0201357 -0.0202927 -0.0204327 -0.0205574 -0.0206679 -0.0207597 -0.0208244 -0.020859 -0.0208708 -0.0208754 -0.0208872 -0.020909 -0.0209308 -0.0209427 -0.0141228 -0.0141833 -0.014252 -0.0143302 -0.0144191 -0.0145185 -0.0146289 -0.0147525 -0.0148893 -0.0150374 -0.0151959 -0.0153666 -0.0155509 -0.0157468 -0.0159511 -0.0161617 -0.0163776 -0.0165982 -0.016821 -0.0170456 -0.0172738 -0.0174528 -0.017738 -0.0179917 -0.018279 -0.0186431 -0.0175624 -0.0177088 -0.017322 -0.0188886 -0.0190332 -0.0192847 -0.0194408 -0.0195874 -0.0197381 -0.0198987 -0.0200663 -0.0202281 -0.0203725 -0.0204953 -0.020598 -0.0206805 -0.0207395 -0.0207736 -0.0207889 -0.0207984 -0.0208138 -0.0208365 -0.020857 -0.0208671 -0.0141393 -0.0141776 -0.0142254 -0.0142839 -0.0143544 -0.0144366 -0.0145304 -0.0146387 -0.0147632 -0.014902 -0.0150532 -0.0152175 -0.0153971 -0.0155913 -0.0157969 -0.0160108 -0.0162303 -0.016454 -0.0166798 -0.0169066 -0.0171362 -0.0173713 -0.0175406 -0.017873 -0.0181868 -0.0163358 -0.00881538 -0.00852629 -0.00949916 -0.0160042 -0.0188266 -0.01917 -0.0193702 -0.0195366 -0.019689 -0.0198409 -0.0199991 -0.020157 -0.0203019 -0.0204249 -0.0205241 -0.0206009 -0.0206559 -0.0206906 -0.0207109 -0.0207269 -0.0207469 -0.0207704 -0.0207891 -0.020797 -0.0141509 -0.014167 -0.014194 -0.0142326 -0.0142842 -0.0143483 -0.0144243 -0.0145151 -0.0146245 -0.0147525 -0.0148957 -0.0150538 -0.0152297 -0.0154231 -0.0156309 -0.0158494 -0.0160763 -0.0163036 -0.0165345 -0.0167627 -0.0169914 -0.0172207 -0.0174604 -0.0177374 -0.0180287 -0.00971566 -0.00805357 -0.00842148 -0.00866942 -0.00815233 -0.018873 -0.0191404 -0.0193317 -0.0194998 -0.0196533 -0.019798 -0.0199429 -0.0200882 -0.0202255 -0.020345 -0.020442 -0.0205169 -0.0205717 -0.0206098 -0.0206368 -0.0206602 -0.0206851 -0.0207095 -0.0207264 -0.0207321 -0.0141559 -0.0141506 -0.0141573 -0.0141757 -0.0142073 -0.0142518 -0.0143078 -0.0143784 -0.0144698 -0.0145844 -0.0147182 -0.0148704 -0.0150443 -0.0152399 -0.0154536 -0.0156791 -0.0158572 -0.0161484 -0.016391 -0.0166212 -0.0168475 -0.0170608 -0.0172784 -0.0175006 -0.0176936 -0.0121234 -0.00884927 -0.0085298 -0.00852402 -0.0080226 -0.0188915 -0.0191168 -0.0192919 -0.0194581 -0.0196158 -0.0197606 -0.0198968 -0.0200278 -0.0201512 -0.0202612 -0.0203534 -0.0204273 -0.0204849 -0.0205294 -0.0205653 -0.0205971 -0.020627 -0.0206522 -0.0206673 -0.0206708 -0.0141547 -0.0141299 -0.0141166 -0.0141142 -0.014124 -0.0141459 -0.0141782 -0.0142252 -0.0142972 -0.0143987 -0.0145213 -0.0146637 -0.0148376 -0.0150402 -0.0152648 -0.0155029 -0.0157483 -0.0160048 -0.0162562 -0.016494 -0.0167155 -0.0169028 -0.0170746 -0.0172348 -0.0173272 -0.0168387 -0.0123185 -0.00897814 -0.0094393 -0.0164226 -0.0188686 -0.0191017 -0.0192554 -0.0194124 -0.0195701 -0.019718 -0.0198523 -0.0199737 -0.0200833 -0.0201803 -0.020264 -0.0203355 -0.0203964 -0.0204489 -0.0204948 -0.0205355 -0.0205705 -0.0205964 -0.0206098 -0.0206111 -0.0141513 -0.0141108 -0.0140773 -0.0140527 -0.0140383 -0.0140333 -0.0140369 -0.0140616 -0.0141099 -0.014193 -0.0143089 -0.0144375 -0.0146089 -0.0148242 -0.0150679 -0.0153282 -0.0155975 -0.0158695 -0.0161318 -0.0163124 -0.016616 -0.0167784 -0.0169237 -0.0170455 -0.0171096 -0.0170886 -0.0172698 -0.0178926 -0.0178329 -0.0187408 -0.0187315 -0.0191009 -0.0192298 -0.0193721 -0.0195229 -0.0196697 -0.0198035 -0.0199202 -0.02002 -0.0201051 -0.0201793 -0.0202466 -0.0203096 -0.0203694 -0.0204249 -0.020474 -0.0205136 -0.02054 -0.0205515 -0.0205507 -0.0141539 -0.014103 -0.0140499 -0.0140017 -0.0139595 -0.0139272 -0.0139028 -0.0138817 -0.0138896 -0.0139471 -0.0139118 -0.0141785 -0.0143517 -0.0145905 -0.0148616 -0.0151508 -0.0154473 -0.0157456 -0.0160413 -0.016236 -0.0165733 -0.0166859 -0.0168003 -0.0169023 -0.0170118 -0.0171556 -0.017387 -0.0177802 -0.0180709 -0.0185334 -0.018866 -0.0190705 -0.0192085 -0.0193444 -0.019485 -0.0196238 -0.0197528 -0.0198651 -0.0199583 -0.0200348 -0.0201011 -0.0201642 -0.0202282 -0.0202935 -0.0203566 -0.0204121 -0.0204548 -0.020481 -0.0204904 -0.0204877 -0.014176 -0.0141219 -0.0140504 -0.0139756 -0.0139052 -0.0138403 -0.013781 -0.0136523 -0.0132536 -0.0131635 -0.0136202 -0.0138099 -0.01404 -0.0143262 -0.0146401 -0.0149675 -0.0152993 -0.0156297 -0.0159651 -0.0163029 -0.0165982 -0.0166517 -0.016655 -0.0167603 -0.016895 -0.0171267 -0.0174206 -0.017846 -0.0179981 -0.0185077 -0.0187977 -0.019034 -0.0191891 -0.0193273 -0.01946 -0.0195876 -0.0197069 -0.0198115 -0.019898 -0.0199682 -0.0200292 -0.0200894 -0.0201542 -0.0202233 -0.0202913 -0.0203504 -0.0203939 -0.0204184 -0.0204252 -0.0204205 -0.014247 -0.0141947 -0.0141032 -0.0139981 -0.0138913 -0.0137807 -0.0136266 -0.013056 -0.012991 -0.0131579 -0.0130516 -0.0133608 -0.013673 -0.0140266 -0.0144026 -0.0147804 -0.0151533 -0.0155196 -0.0158959 -0.016371 -0.0166537 -0.0164959 -0.0149137 -0.0152618 -0.016622 -0.0169925 -0.0173522 -0.0180303 -0.0183898 -0.0187383 -0.0188459 -0.0190186 -0.0191778 -0.0193155 -0.0194421 -0.0195607 -0.0196691 -0.0197637 -0.0198419 -0.0199059 -0.019963 -0.0200219 -0.0200878 -0.0201596 -0.0202299 -0.0202896 -0.0203312 -0.0203522 -0.0203556 -0.020349 -0.0144283 -0.0143702 -0.0142451 -0.0140968 -0.0139134 -0.0137657 -0.0136083 -0.0133384 -0.0130741 -0.0123132 -0.0125566 -0.0129161 -0.0132644 -0.0136938 -0.014153 -0.0145853 -0.0150063 -0.0154018 -0.0157672 -0.0161664 -0.0156462 -0.00889843 -0.0044626 -0.00557651 -0.0137362 -0.0166738 -0.016937 -0.0180395 -0.0160499 -0.017558 -0.0188396 -0.0190018 -0.0191652 -0.0193017 -0.0194254 -0.0195379 -0.0196378 -0.0197227 -0.0197921 -0.0198495 -0.0199029 -0.0199609 -0.020028 -0.0201014 -0.0201721 -0.0202298 -0.0202672 -0.0202832 -0.0202824 -0.0202738 -0.0148664 -0.0147318 -0.014525 -0.0142788 -0.0140247 -0.0137486 -0.0134657 -0.0132217 -0.0129495 -0.0123205 -0.0118428 -0.0122542 -0.0127334 -0.0132954 -0.0138943 -0.0144125 -0.0148675 -0.0152687 -0.0156061 -0.0158608 -0.0156133 -0.003745 -0.00474153 -0.0049161 -0.00465044 -0.0167678 -0.0163041 -0.0172748 -0.0164519 -0.0166898 -0.0185185 -0.0189848 -0.0191577 -0.0192932 -0.0194123 -0.0195184 -0.0196108 -0.0196874 -0.0197486 -0.0197995 -0.019849 -0.0199059 -0.0199735 -0.0200473 -0.0201168 -0.0201707 -0.0202023 -0.0202122 -0.0202071 -0.0201967 -0.0156704 -0.0153453 -0.0149769 -0.0146237 -0.0142626 -0.0138407 -0.0132892 -0.0133468 -0.0101108 -0.00451457 -0.00497063 -0.0072564 -0.0116541 -0.0128546 -0.013666 -0.0142709 -0.0147679 -0.015179 -0.0154677 -0.0156613 -0.0157383 -0.00883641 -0.00580338 -0.00452363 -0.00403923 -0.0173094 -0.0166905 -0.0171444 -0.0165444 -0.0165194 -0.0185105 -0.0190402 -0.01919 -0.019309 -0.0194131 -0.0195072 -0.0195894 -0.0196569 -0.0197103 -0.0197551 -0.0198008 -0.0198559 -0.0199229 -0.0199957 -0.0200623 -0.0201111 -0.0201363 -0.0201402 -0.0201312 -0.0201193 -0.0166753 -0.016136 -0.0156106 -0.015114 -0.0146257 -0.013318 -0.0133285 -0.0120264 -0.00152052 -0.00264692 -0.00356596 -0.00429549 -0.00941347 -0.0127393 -0.0136128 -0.0142378 -0.0147543 -0.0151825 -0.0154234 -0.0155306 -0.0154758 -0.0149678 -0.0122806 -0.010502 -0.0160651 -0.0177885 -0.0173947 -0.0182735 -0.017141 -0.0166738 -0.0189926 -0.0191499 -0.0192409 -0.0193353 -0.0194259 -0.0195063 -0.0195755 -0.0196318 -0.0196763 -0.0197148 -0.0197565 -0.0198094 -0.0198746 -0.0199446 -0.020007 -0.02005 -0.020069 -0.0200677 -0.0200558 -0.0200433 -0.0176833 -0.0170364 -0.016366 -0.0156564 -0.0123419 -0.0114353 -0.0131395 -0.0111698 -0.00979131 -0.00962268 -0.008078 -0.0036921 -0.00534791 -0.0128739 -0.0136956 -0.0143064 -0.0148508 -0.0153333 -0.0155 -0.0155464 -0.015494 -0.0154902 -0.0158176 -0.0165024 -0.0173553 -0.0177562 -0.0178379 -0.0181988 -0.0185427 -0.0188625 -0.0190945 -0.0190294 -0.0192729 -0.0193544 -0.0194452 -0.0195151 -0.0195695 -0.0196124 -0.0196465 -0.0196779 -0.019715 -0.0197647 -0.0198267 -0.0198926 -0.0199494 -0.0199864 -0.0199998 -0.0199949 -0.0199817 -0.0199695 -0.0186623 -0.0180981 -0.0173938 -0.0168056 -0.0125164 -0.0126034 -0.0126977 -0.0104479 -0.00859278 -0.00789398 -0.00793257 -0.00935215 -0.0104366 -0.0131026 -0.0139873 -0.0143846 -0.014972 -0.0156216 -0.0152798 -0.0154947 -0.0154955 -0.0157009 -0.016127 -0.0167109 -0.0172782 -0.0176578 -0.0179379 -0.0182488 -0.018541 -0.0188005 -0.0190087 -0.0191542 -0.0192856 -0.0193786 -0.0194778 -0.0195373 -0.0195721 -0.0195987 -0.0196206 -0.0196436 -0.0196754 -0.019721 -0.0197783 -0.0198384 -0.0198887 -0.0199195 -0.0199286 -0.0199218 -0.019909 -0.0198981 -0.0195824 -0.0191524 -0.0184001 -0.0158065 -0.0138712 -0.0152385 -0.0127101 -0.00923125 -0.00641377 -0.00576969 -0.00558175 -0.0064276 -0.0098372 -0.0132232 -0.0151784 -0.0141918 -0.0146266 -0.0122875 -0.0106136 -0.0128758 -0.0149298 -0.0157175 -0.0163182 -0.0168763 -0.0173641 -0.017728 -0.0180164 -0.0183021 -0.0185764 -0.0188078 -0.0189501 -0.0191825 -0.0193266 -0.0194094 -0.0195246 -0.0195812 -0.0195866 -0.0195891 -0.0195962 -0.0196105 -0.0196366 -0.0196772 -0.0197287 -0.0197816 -0.0198245 -0.0198493 -0.0198551 -0.0198483 -0.0198373 -0.0198285 -0.020033 -0.0197489 -0.018527 -0.0141765 -0.0146479 -0.0179741 -0.0136186 -0.0076887 -0.0029398 -0.00246592 -0.00193773 -0.00319477 -0.00925346 -0.00807548 -0.012573 -0.0137461 -0.0132391 -0.0127922 -0.0115056 -0.0121526 -0.0134715 -0.0157404 -0.0166047 -0.0171258 -0.0175532 -0.0178933 -0.0181703 -0.0184197 -0.0186432 -0.0187763 -0.0190556 -0.0192618 -0.0194669 -0.0193186 -0.0196572 -0.0197068 -0.0196222 -0.0195771 -0.0195674 -0.0195755 -0.0195968 -0.0196323 -0.0196772 -0.0197222 -0.0197571 -0.019776 -0.0197797 -0.019774 -0.019766 -0.0197597 -0.0191955 -0.0192888 -0.0162181 -0.0151795 -0.015803 -0.0206184 -0.0154195 -0.00695869 0.00127043 0.00153252 0.00232871 -0.000122514 -0.00822481 -0.00448623 -0.0104335 -0.0136752 -0.0133193 -0.0139789 -0.0134043 -0.0123471 -0.0127792 -0.0150209 -0.0171058 -0.0175155 -0.0178502 -0.0181264 -0.0183683 -0.0185672 -0.0187388 -0.018863 -0.0190337 -0.0193108 -0.0199695 -0.017586 -0.0198268 -0.0197955 -0.0196103 -0.0195389 -0.0195271 -0.0195342 -0.0195537 -0.019585 -0.0196233 -0.0196599 -0.0196869 -0.0197005 -0.0197026 -0.0196989 -0.0196944 -0.019691 -0.0358879 -0.039934 -0.0242604 -0.00344325 -0.0135755 -0.0217302 -0.0198652 -0.00532891 0.011386 0.0238542 0.0154343 0.00731951 -0.017597 -0.00278833 -0.0129679 -0.0123022 -0.0127694 -0.0133623 -0.0135297 -0.0125305 -0.0118727 -0.0150829 -0.0177328 -0.0180048 -0.0182427 -0.0184151 -0.0186179 -0.0187516 -0.0188519 -0.0189095 -0.018944 -0.0190057 -0.0148334 0.0115077 -0.00614854 -0.0193519 -0.0194104 -0.0194261 -0.0194584 -0.0194814 -0.0195053 -0.0195347 -0.0195667 -0.019595 -0.0196142 -0.0196229 -0.0196242 -0.0196228 -0.0196217 -0.0196214 2.24688 1.80085 0.27478 0.0448045 -0.0543334 -0.0482062 -0.00120122 0.0141668 0.0576754 0.163882 0.0438904 -0.00777932 -0.011067 -0.0104622 -0.0123382 -0.0113058 -0.0119906 -0.0135383 -0.0144516 -0.0140817 -0.0114245 -0.0170279 -0.0183092 -0.0184897 -0.01867 -0.0188169 -0.0189228 -0.0189919 -0.0190092 -0.0189681 -0.0188093 -0.0182837 0.008342 0.0103136 0.0102074 -0.0113989 -0.019065 -0.0193047 -0.019397 -0.0194323 -0.0194586 -0.0194841 -0.0195085 -0.0195278 -0.0195393 -0.0195435 -0.0195442 -0.0195451 -0.0195474 -0.0195501 42.4757 41.4472 35.0627 24.6385 11.2444 3.4063 2.42542 2.2945 0.522721 0.343645 0.0475457 0.314627 0.0783123 0.0207812 -0.0139655 -0.0100349 -0.0118717 -0.014229 -0.0156765 -0.0166431 -0.0175264 -0.0185585 -0.0188906 -0.0190293 -0.0191595 -0.0192442 -0.0192936 -0.0193092 -0.0192662 -0.0191807 -0.0189563 -0.0184306 0.00656022 0.0103407 0.00990449 -0.0124229 -0.0191157 -0.0193108 -0.019379 -0.0194064 -0.0194223 -0.0194368 -0.0194497 -0.0194584 -0.0194619 -0.0194619 -0.0194621 -0.019465 -0.0194703 -0.0194762 41.692 40.9387 38.596 36.0228 34.8176 36.5771 29.5549 12.8453 4.66262 2.77007 -0.310859 0.196276 0.133875 0.0536367 -0.00986385 -0.00908233 -0.0119816 -0.0153572 -0.0165483 -0.0176234 -0.0184806 -0.0191553 -0.0194853 -0.0196421 -0.0197226 -0.0197488 -0.0197359 -0.0196961 -0.0196297 -0.0193155 -0.0194208 -0.0193691 -0.0155756 0.010974 -0.00787773 -0.0195324 -0.019451 -0.0194193 -0.0194106 -0.0194023 -0.0193951 -0.0193916 -0.0193894 -0.019386 -0.0193812 -0.0193771 -0.0193768 -0.0193813 -0.0193895 -0.0193985 40.7478 40.162 39.0032 37.6964 37.0446 37.7321 38.8761 37.2668 28.3515 20.1356 11.4008 1.16785 0.166184 0.73166 0.0221312 0.016603 -0.000845368 -0.0170579 -0.0175286 -0.0185058 -0.0193613 -0.0199561 -0.0202632 -0.020375 -0.0203792 -0.0203219 -0.02023 -0.0201208 -0.0198698 -0.0198001 -0.0198395 -0.0198869 -0.0203168 -0.0181814 -0.0200592 -0.0197445 -0.0196202 -0.0194988 -0.0194343 -0.0193932 -0.0193637 -0.0193418 -0.019324 -0.0193085 -0.0192957 -0.0192878 -0.0192868 -0.0192928 -0.0193035 -0.0193157 40.2618 39.8189 39.1141 38.3746 37.9618 38.1133 38.6399 38.8191 39.6052 39.2678 27.9206 12.0878 -2.47908 0.222829 0.115483 0.0494046 0.0146925 -0.0171612 -0.0180568 -0.0193733 -0.0203774 -0.0209831 -0.0212299 -0.0212438 -0.0211337 -0.0209638 -0.0207699 -0.0205791 -0.0203875 -0.0201914 -0.0201157 -0.0200585 -0.0200146 -0.0196432 -0.0198003 -0.0197506 -0.0196209 -0.0195073 -0.0194257 -0.0193663 -0.01932 -0.0192822 -0.0192502 -0.0192235 -0.0192036 -0.0191924 -0.0191909 -0.0191979 -0.019211 -0.0192264 40.0507 39.7192 39.2617 38.799 38.5102 38.533 38.9373 39.456 40.3225 41.7539 41.9121 34.2511 11.6318 0.866756 0.144738 0.320907 0.00482228 -0.00163923 -0.015524 -0.0197628 -0.0216123 -0.0223132 -0.022423 -0.0222633 -0.0219858 -0.0216675 -0.0213462 -0.0210402 -0.0207645 -0.0205329 -0.0203432 -0.0201818 -0.0200365 -0.0198721 -0.019804 -0.0197143 -0.0195955 -0.0194856 -0.0193955 -0.0193228 -0.0192623 -0.0192102 -0.0191654 -0.0191291 -0.0191032 -0.0190894 -0.0190874 -0.0190953 -0.0191105 -0.019129 39.9934 39.7488 39.4416 39.139 38.942 38.9482 39.2381 39.6992 40.2752 41.0548 41.1363 40.2543 31.0229 10.711 -0.536706 0.0596889 0.0384176 -0.01539 -0.0242845 -0.0240852 -0.0243584 -0.024297 -0.0239198 -0.0234356 -0.0229177 -0.022415 -0.0219521 -0.0213341 -0.0211594 -0.0208308 -0.0205536 -0.0203218 -0.0201278 -0.0199475 -0.0198218 -0.0196953 -0.0195672 -0.0194503 -0.01935 -0.0192646 -0.0191903 -0.0191246 -0.0190681 -0.0190232 -0.0189925 -0.0189769 -0.0189748 -0.0189835 -0.0190005 -0.0190218 40.0154 39.8395 39.6329 39.435 39.3053 39.3051 39.4774 39.7752 40.1535 40.6339 40.7661 40.4993 39.7167 22.2265 4.46746 0.149087 0.16263 -0.0343246 -0.0318319 -0.0286542 -0.0272894 -0.0263344 -0.0254841 -0.0246542 -0.0238769 -0.0231698 -0.0224249 -0.0219822 -0.0215102 -0.0211015 -0.0207539 -0.0204598 -0.0202126 -0.0199982 -0.0198288 -0.0196739 -0.0195305 -0.0194024 -0.0192904 -0.019192 -0.0191036 -0.0190245 -0.018957 -0.0189047 -0.0188703 -0.0188535 -0.0188515 -0.0188609 -0.0188794 -0.0189033 40.0639 39.9402 39.8043 39.6792 39.5967 39.5876 39.6652 39.8023 39.969 40.1252 40.1126 39.9676 39.6186 34.4277 12.1977 2.17654 -0.0109956 -0.0395881 -0.0352636 -0.0318545 -0.0298568 -0.028405 -0.0270757 -0.0258831 -0.0248496 -0.0235288 -0.0231263 -0.0224295 -0.0218426 -0.0213498 -0.0209342 -0.020582 -0.0202843 -0.0200313 -0.0198225 -0.0196408 -0.0194803 -0.0193394 -0.0192153 -0.0191038 -0.0190016 -0.0189094 -0.0188315 -0.0187727 -0.0187353 -0.0187178 -0.018716 -0.0187259 -0.0187457 -0.0187718 40.1028 40.0165 39.9284 39.8512 39.7992 39.7827 39.7957 39.8147 39.8229 39.8134 39.7698 39.7141 39.6796 39.7792 26.9172 3.03088 -0.0400664 -0.0251159 -0.0332086 -0.0341427 -0.0323741 -0.0304004 -0.0286207 -0.0270656 -0.0252792 -0.0240616 -0.0236559 -0.0228231 -0.0221343 -0.0215622 -0.0210827 -0.0206774 -0.020334 -0.0200433 -0.0197999 -0.0195925 -0.0194141 -0.0192593 -0.0191226 -0.0189979 -0.0188824 -0.0187781 -0.0186909 -0.0186266 -0.0185868 -0.0185687 -0.018567 -0.0185772 -0.0185979 -0.0186256 40.1166 40.0549 39.9963 39.9467 39.9113 39.8885 39.8651 39.8217 39.7502 39.6711 39.6166 39.6332 39.7487 40.0501 38.1696 1.99954 0.0165329 -0.0183645 -0.0374699 -0.0366596 -0.0346494 -0.0322843 -0.030049 -0.0277507 -0.0260375 -0.0249989 -0.0240645 -0.0231427 -0.0223691 -0.0217269 -0.0211891 -0.020736 -0.0203526 -0.0200284 -0.019756 -0.0195259 -0.01933 -0.0191608 -0.0190107 -0.0188727 -0.0187443 -0.018629 -0.018534 -0.0184653 -0.0184238 -0.0184053 -0.0184035 -0.0184134 -0.0184344 -0.0184633 40.1056 40.0588 40.0163 39.9805 39.9524 39.9261 39.8881 39.8248 39.7357 39.6473 39.6032 39.6422 39.7807 40.025 40.0114 16.5672 0.0151825 -0.0315234 -0.0407911 -0.0405414 -0.0371496 -0.0337455 -0.0309554 -0.0287604 -0.0270922 -0.0256086 -0.0243955 -0.0233842 -0.0225415 -0.0218373 -0.0212483 -0.0207525 -0.0203339 -0.0199813 -0.0196856 -0.0194368 -0.0192254 -0.0190423 -0.0188786 -0.0187272 -0.0185866 -0.0184616 -0.0183603 -0.0182884 -0.0182458 -0.0182269 -0.0182244 -0.0182335 -0.0182541 -0.0182835 40.0775 40.0392 40.0051 39.9759 39.9508 39.9242 39.8858 39.8266 39.75 39.6807 39.6589 39.7134 39.8572 40.0718 40.2759 33.4212 -0.397458 -0.0732118 -0.0475124 -0.0444412 -0.0395456 -0.0352902 -0.0321847 -0.0295761 -0.0275628 -0.0259458 -0.0246323 -0.0235462 -0.022643 -0.0218891 -0.0212576 -0.0207252 -0.0202758 -0.019899 -0.0195844 -0.0193207 -0.0190964 -0.0189009 -0.0187245 -0.0185606 -0.018409 -0.0182759 -0.0181697 -0.0180958 -0.0180524 -0.0180328 -0.018029 -0.0180365 -0.018056 -0.0180851 -0.00245183 -0.0024253 -0.00238948 -0.00234486 -0.00228947 -0.0022219 -0.00214003 -0.00204014 -0.00191735 -0.00176753 -0.00158958 -0.00138667 -0.00116508 -0.000931259 -0.000688696 -0.00043694 -0.000172849 0.000107454 0.000407974 0.000734773 0.00109661 0.00149957 0.0019456 0.00243085 0.00294644 0.0034771 0.00399764 0.00446689 0.00481513 0.00491801 0.00457627 0.00380551 0.00334207 0.00513394 -0.00349177 0.15807 31.4591 38.7136 39.1013 39.199 39.2977 39.4488 39.6461 39.8492 40.009 40.106 40.1425 40.137 40.1102 40.076 -0.0023638 -0.0023354 -0.00229607 -0.00224716 -0.00218845 -0.00211993 -0.0020399 -0.0019439 -0.0018257 -0.00167993 -0.00150498 -0.00130428 -0.00108465 -0.000852727 -0.00061182 -0.000361425 -9.91744e-05 0.000176811 0.000467609 0.000778665 0.00112252 0.00150705 0.00193545 0.00240189 0.0028966 0.00340439 0.00389886 0.00434189 0.00467794 0.00480375 0.00457331 0.00418941 0.00463272 0.00758093 -0.0133186 1.67644 34.1823 37.9849 38.8454 39.0903 39.2476 39.4197 39.615 39.8044 39.9536 40.0452 40.0826 40.0818 40.0608 40.0318 -0.00228239 -0.00225211 -0.00220923 -0.00215613 -0.00209449 -0.00202577 -0.00194858 -0.00185766 -0.00174542 -0.00160533 -0.00143544 -0.0012394 -0.00102434 -0.000796693 -0.00055937 -0.000311945 -5.33038e-05 0.000215442 0.000489856 0.00077467 0.00109234 0.00145221 0.00185845 0.00229973 0.00276311 0.00323591 0.0036996 0.00412247 0.00445554 0.00462363 0.00452951 0.00448966 0.00545914 0.00947054 -0.0072562 2.63063 37.1586 38.4819 38.9167 39.073 39.226 39.401 39.592 39.7705 39.908 39.9932 40.0287 40.0298 40.0124 39.9872 -0.00220661 -0.00217457 -0.00212834 -0.00207143 -0.00200753 -0.00193954 -0.00186626 -0.00178155 -0.0016765 -0.0015436 -0.00138068 -0.00119163 -0.000983534 -0.000762281 -0.000529978 -0.000286145 -3.0992e-05 0.000230443 0.000482669 0.000725561 0.00100681 0.00133604 0.00171872 0.00213472 0.00256536 0.00299949 0.00342167 0.0038023 0.00409204 0.00421725 0.004078 0.00399264 0.00485056 0.00848609 -0.0110593 2.81061 37.7974 38.7328 38.9032 39.0345 39.1907 39.3717 39.5631 39.7369 39.8679 39.9472 39.9804 39.9816 39.9657 39.9426 -0.00213542 -0.00210186 -0.00205268 -0.00199264 -0.0019274 -0.00186118 -0.00179288 -0.00171543 -0.00161866 -0.00149431 -0.00134013 -0.00116018 -0.000961336 -0.000748462 -0.00052227 -0.000281488 -2.65805e-05 0.000231936 0.000455681 0.000638293 0.00086486 0.001152 0.00151484 0.00190934 0.00230312 0.00269141 0.00306023 0.00337795 0.00359962 0.00359728 0.00324769 0.0028288 0.0034567 0.00687749 -0.0144955 1.48485 35.5816 38.3964 38.7305 38.9331 39.124 39.3247 39.526 39.7029 39.8328 39.9091 39.9396 39.939 39.9221 39.8988 -0.00206781 -0.00203304 -0.00198153 -0.00191924 -0.00185374 -0.00179042 -0.00172815 -0.00165889 -0.00157137 -0.0014568 -0.00131296 -0.00114409 -0.000956647 -0.000754075 -0.000535243 -0.000295965 -3.08227e-05 0.000248576 0.000433963 0.000532499 0.000661577 0.000865272 0.00126423 0.00164454 0.001987 0.0023189 0.00263617 0.00294002 0.0030456 0.00292525 0.00234316 0.00144382 0.0015221 0.00446037 0.000404787 -0.0441491 32.1681 38.3813 38.5719 38.8177 39.0478 39.2747 39.4915 39.6775 39.809 39.8827 39.9088 39.9037 39.883 39.8566 -0.00200279 -0.00196723 -0.00191411 -0.00185061 -0.00178603 -0.00172674 -0.00167144 -0.00161118 -0.00153378 -0.00143011 -0.00129817 -0.00114244 -0.000968791 -0.000779083 -0.000571058 -0.00033566 -4.44998e-05 0.000321294 0.000679043 0.00127674 0.00184573 0.000933879 0.000989883 0.00135968 0.00165953 0.00197592 0.00223745 0.00243957 0.00256814 0.00259754 0.00253826 0.00179342 0.000555475 0.00262951 0.0092049 0.0149924 22.6039 38.2901 38.4031 38.7576 39.017 39.2621 39.4869 39.6811 39.8065 39.872 39.8887 39.8753 39.8477 39.8155 -0.0019394 -0.00190355 -0.00184966 -0.00178605 -0.00172358 -0.00166938 -0.00162186 -0.0015712 -0.00150456 -0.00141274 -0.00129423 -0.00115399 -0.000997686 -0.000826265 -0.000638549 -0.000428454 -0.000166404 0.000628583 0.00162759 0.00237558 0.00282419 0.0010525 0.000842036 0.00104398 0.00130926 0.00149992 0.00174 0.00192847 0.00229587 0.00311444 0.00394834 0.00132927 0.000887109 0.00472987 0.012133 0.018404 6.53698 37.338 38.3338 38.7999 39.1055 39.3499 39.5581 39.7255 39.8315 39.875 39.8733 39.847 39.8106 39.7708 -0.00187677 -0.00184117 -0.0017874 -0.00172481 -0.00166561 -0.00161745 -0.00157833 -0.00153762 -0.00148199 -0.00140246 -0.00129834 -0.00117549 -0.00104063 -0.000895597 -0.00074636 -0.00058578 -0.000218103 0.00204468 0.00184272 0.00171311 0.00121361 0.000470782 0.00060318 0.000737803 0.000882712 0.00104904 0.00121581 0.00124959 0.00274322 0.00261091 0.000341342 0.000500217 0.00138215 0.00615469 0.0333644 0.0512156 2.92357 31.4935 38.8124 39.1706 39.4532 39.6293 39.7551 39.8448 39.8849 39.88 39.8474 39.8048 39.7599 39.7136 -0.00181411 -0.00177931 -0.00172655 -0.00166609 -0.00161121 -0.00156989 -0.00153959 -0.00150893 -0.00146413 -0.00139656 -0.00130636 -0.00120035 -0.00108672 -0.000968628 -0.000860182 -0.000752874 -0.000343496 0.00229048 0.00169209 0.000627969 0.000465538 0.000324067 0.000330619 0.000395878 0.000485146 0.00057341 0.000688747 0.000740163 0.00189264 0.00151217 -0.00067284 -0.00169473 -0.00432518 -0.0133062 0.0877257 0.0398388 2.74901 17.6616 38.8726 39.7233 39.9893 40.0773 40.0831 40.0251 39.9484 39.8673 39.7929 39.7332 39.6836 39.6346 -0.00175073 -0.0017173 -0.0016664 -0.00160907 -0.00155942 -0.00152553 -0.00150428 -0.00148351 -0.00144911 -0.00139264 -0.00131473 -0.00122247 -0.00112426 -0.00102369 -0.000935552 -0.000893503 -0.000987607 -0.000611069 -0.000285083 1.09831e-05 2.53747e-05 1.39682e-06 1.37408e-06 2.61084e-05 6.62928e-05 0.000114145 0.000178384 0.000161328 0.00116957 0.00125281 -0.000793563 -0.00139153 -0.00340802 -0.00804072 0.0353541 0.044169 0.811686 7.80649 34.8968 40.576 40.5492 40.5169 40.4212 40.2189 40.003 39.8275 39.7051 39.6299 39.5807 39.5335 -0.00168608 -0.00165458 -0.00160635 -0.00155302 -0.00150932 -0.0014832 -0.00147093 -0.00145967 -0.00143506 -0.00138883 -0.00132167 -0.00124019 -0.00115235 -0.00106251 -0.000982593 -0.000924934 -0.000866038 -0.000683787 -0.000479512 -0.000413748 -0.000348064 -0.000340403 -0.000352081 -0.000375054 -0.000388721 -0.000340051 -0.000318392 -0.000289905 -8.2556e-05 0.00108345 1.41058e-05 0.00142604 0.00268057 0.00739184 0.0241058 0.0556238 0.262658 5.4496 24.1051 39.7369 40.9944 41.0582 40.9251 40.4625 40.0741 39.7883 39.6085 39.5167 39.4695 39.4261 -0.00161975 -0.0015907 -0.00154589 -0.00149736 -0.00146015 -0.00144193 -0.00143825 -0.00143577 -0.0014201 -0.00138331 -0.00132614 -0.00125478 -0.00117747 -0.00109926 -0.00102479 -0.000960332 -0.000906433 -0.000831471 -0.000767404 -0.00068512 -0.000646891 -0.000654307 -0.000696359 -0.000768168 -0.00086821 -0.000942064 -0.000856038 -0.000956307 -0.00132992 0.000202807 0.000107768 0.000340649 0.00189949 0.00585625 0.0211871 0.0308026 0.0942318 0.200161 9.7425 28.8383 41.5198 41.6003 41.4316 40.7051 40.1885 39.7832 39.5374 39.4272 39.3799 39.338 -0.00155148 -0.00152536 -0.00148463 -0.00144156 -0.00141128 -0.00140093 -0.00140531 -0.00141061 -0.00140266 -0.00137407 -0.00132596 -0.00126456 -0.00119784 -0.00113483 -0.000939854 -0.00100782 -0.000979257 -0.000956682 -0.000922503 -0.000893667 -0.000897462 -0.000933941 -0.00100771 -0.00112231 -0.00132549 -0.000608711 0.00110436 -0.00185534 -0.00154458 -0.00232233 -0.00334344 -0.0032722 -0.0056382 -0.0108223 -0.0153176 0.119483 0.268206 -0.0891306 0.735501 14.6423 37.4739 41.2145 41.8136 41.0626 40.418 39.8515 39.5136 39.3818 39.3332 39.2867 -0.0014812 -0.00145839 -0.00142227 -0.00138519 -0.00136211 -0.00135947 -0.0013713 -0.00138343 -0.00138193 -0.00136 -0.00131935 -0.00126707 -0.00121065 -0.0011594 -0.00111731 -0.000807431 -0.00104436 -0.00105973 -0.00107599 -0.00107498 -0.00111435 -0.00117709 -0.0012715 -0.00139004 -0.000543013 0.00442972 0.00417167 -0.0016567 -0.00198864 -0.00294375 -0.00461622 -0.00653317 -0.00991584 -0.0206568 -0.0406113 -0.0379894 -0.029111 -0.0422669 -0.0465596 -0.630053 11.2544 38.7411 43.4641 41.4016 40.8419 39.9555 39.48 39.3721 39.3329 39.2626 -0.00140898 -0.00138978 -0.00135869 -0.00132793 -0.00131205 -0.00131671 -0.00133525 -0.00135333 -0.00135737 -0.00134107 -0.00130654 -0.00126129 -0.00121481 -0.00117215 -0.00114404 -0.00112128 -0.00113633 -0.00117452 -0.00121991 -0.00123057 -0.00131753 -0.00138798 -0.00150926 -0.00165963 0.000772551 0.00368664 0.00264872 -0.000842965 -0.00233143 -0.00350518 -0.00550225 -0.00753544 -0.0105881 -0.0156719 -0.0245696 -0.0183314 0.0249107 0.017069 0.0985212 0.478138 1.0485 16.9016 24.1977 38.235 41.9236 39.7705 39.2139 39.3979 39.3888 39.1988 -0.00133498 -0.00131966 -0.00129397 -0.0012697 -0.00126073 -0.00127187 -0.001296 -0.00131897 -0.00132783 -0.0013168 -0.00128817 -0.00124952 -0.00121042 -0.00117948 -0.00115966 -0.00116839 -0.00120213 -0.00128467 -0.00135815 -0.00113188 -0.00152827 -0.00154121 -0.00166424 -0.00180292 0.000771063 0.00336467 0.00266438 -0.00110467 -0.00282994 -0.00385369 -0.0050447 -0.00641131 -0.00727127 -0.00883762 -0.00956273 -1.17262e-05 0.0240271 0.0389521 0.101123 0.181116 -0.0443504 0.280727 3.49558 19.7453 32.859 36.1643 38.1645 39.8404 39.6026 38.8524 -0.00125942 -0.00124832 -0.00122829 -0.00121056 -0.00120803 -0.00122456 -0.00125272 -0.00127903 -0.00129168 -0.00128573 -0.00126351 -0.00123219 -0.00120086 -0.00117767 -0.0011674 -0.00117405 -0.00119583 -0.00123774 0.000507017 0.001729 -0.00142746 -0.00163635 -0.00179033 -0.0019226 -0.00116361 0.00334208 0.00365497 -0.00214579 -0.0033497 -0.00395683 -0.00459536 -0.0049726 -0.0047066 -0.00472855 -0.00282076 0.00350754 0.00887644 0.0184992 0.0259474 0.0322796 0.461295 0.444763 0.321227 4.35875 2.03271 0.482391 18.163 35.804 39.3566 37.4783 -0.0011828 -0.00117595 -0.00116176 -0.00115056 -0.00115397 -0.00117473 -0.00120528 -0.00123311 -0.00124804 -0.00124649 -0.00123115 -0.0012086 -0.00118661 -0.00117151 -0.00116497 -0.00116404 -0.00114811 -0.000920929 0.00132519 0.0014666 -0.000828803 -0.00179417 -0.00193393 -0.00210533 -0.00236302 -0.00166597 -0.000509471 -0.00374682 -0.00370019 -0.00401949 -0.00452602 -0.00444669 -0.00349725 -0.00281589 -0.00293774 0.00118474 0.00149609 -0.00373147 -0.00652517 -0.00606106 0.0301422 0.217023 0.167063 0.134571 0.183199 0.145241 -0.168703 0.586158 2.6182 6.08249 -0.00110549 -0.00110286 -0.00109447 -0.00108959 -0.00109838 -0.00112235 -0.00115388 -0.00118166 -0.00119742 -0.00119928 -0.00119085 -0.00117855 -0.0011691 -0.00116739 -0.00117383 -0.00118298 -0.00117651 -0.000955478 0.00106685 0.00122887 -0.000384884 -0.00191671 -0.0020472 -0.00223276 -0.00248161 -0.00279 -0.00309992 -0.00347468 -0.00369727 -0.00396456 -0.00318884 0.00203696 0.00121179 0.000832477 0.00227312 -0.000818398 -0.00142498 -0.000492191 -0.00646507 -0.00884019 0.00634033 0.0152013 0.00673463 0.0134646 0.0352563 0.043877 -0.00217012 -0.0442994 -0.0512608 -0.0460183 -0.00102804 -0.00102943 -0.00102651 -0.00102739 -0.0010407 -0.00106689 -0.00109842 -0.00112529 -0.00114104 -0.00114555 -0.00114362 -0.00114207 -0.00114728 -0.00116363 -0.00119241 -0.00123112 -0.00128153 -0.00135146 -0.00044773 0.00128941 -0.00165324 -0.0019958 -0.00211127 -0.00228397 -0.00250626 -0.00277505 -0.00306607 -0.00333951 -0.0036041 -0.00389347 -0.00371982 0.00190122 0.00273786 0.00256746 0.00207435 -0.00269718 -0.0015656 -0.00253896 -0.00350062 -0.00313543 -0.00183601 -0.00661686 -0.00990874 -0.00720651 0.00114342 0.00219599 -0.0103885 -0.0196885 -0.0127049 -0.00438236 -0.000951087 -0.000956156 -0.000958093 -0.000963738 -0.000980287 -0.00100745 -0.00103824 -0.00106398 -0.00107976 -0.00108681 -0.00109095 -0.0010995 -0.00111874 -0.00115262 -0.00120273 -0.00126913 -0.00135739 -0.00151785 -0.00181297 -0.00158398 -0.00210973 -0.00203002 -0.00212857 -0.00229115 -0.00249708 -0.00273987 -0.00299775 -0.00325174 -0.00349759 -0.00378554 -0.00414725 -0.00404341 -0.00429686 -0.00417712 -0.00370165 -0.00377666 -0.00334275 -0.00333506 -0.00318832 -0.00327359 -0.0022492 -0.00480985 -0.00542227 -0.00529897 -0.00242166 -0.00382438 -0.00579107 -0.0174378 -0.0147029 -0.0109227 -0.000875251 -0.00088358 -0.000889582 -0.000898658 -0.000916726 -0.000943295 -0.000972457 -0.000997147 -0.00101368 -0.00102393 -0.00103409 -0.00105166 -0.00108256 -0.00112949 -0.00119225 -0.00127057 -0.00136822 -0.00146472 -0.00144768 -0.00127218 -0.00177382 -0.00195583 -0.00209733 -0.00226147 -0.00246356 -0.00268847 -0.00292055 -0.00316255 -0.00336245 -0.00355753 -0.00377851 -0.00394174 -0.00418038 -0.0041825 -0.00387356 -0.00369917 -0.00350626 -0.00331475 -0.00323798 -0.00339717 -0.00378235 -0.00408218 -0.0040537 -0.00390366 -0.00375025 -0.00527927 -0.0102086 -0.0129742 -0.0123683 -0.0107571 -0.000800964 -0.000812131 -0.000821373 -0.000832437 -0.000850094 -0.00087427 -0.000900782 -0.000924445 -0.000942593 -0.000957147 -0.000973908 -0.000999985 -0.00104093 -0.00109878 -0.00117274 -0.00126322 -0.00137269 -0.00148643 -0.00156906 -0.00158076 -0.00177816 -0.00190382 -0.00201982 -0.00221501 -0.00242371 -0.0026443 -0.00285517 -0.00307563 -0.00320823 -0.00329799 -0.00347143 -0.0036259 -0.00377305 -0.00379463 -0.00365581 -0.00354629 -0.00340328 -0.00325006 -0.00319681 -0.00328179 -0.00348005 -0.00359073 -0.00341031 -0.00344717 -0.00382449 -0.00497331 -0.00739507 -0.00907266 -0.00917066 -0.008544 -0.000728428 -0.000742033 -0.000753653 -0.000765309 -0.000780843 -0.000801046 -0.000823926 -0.000846444 -0.000866851 -0.000886657 -0.000910592 -0.000944741 -0.000993949 -0.00105977 -0.00114126 -0.00123742 -0.00136315 -0.00155825 -0.00144039 -0.000578771 -0.00124083 -0.00183289 -0.00192165 -0.00214274 -0.00236715 -0.00253775 -0.00279621 -0.00306274 -0.00308777 -0.00299055 -0.00314455 -0.00332757 -0.00345355 -0.00349372 -0.00343598 -0.00336401 -0.00326336 -0.00314909 -0.00308672 -0.00309924 -0.00317944 -0.00317849 -0.00305632 -0.00307005 -0.00344426 -0.00425986 -0.00555222 -0.00643675 -0.00667043 -0.00644053 -0.000657539 -0.000673119 -0.000686244 -0.000697261 -0.000709447 -0.000724805 -0.000743655 -0.000765066 -0.000788094 -0.000813606 -0.00084486 -0.000886353 -0.000941501 -0.00101045 -0.0010897 -0.00117689 -0.00127915 -0.00135154 0.000988107 0.00226279 0.00172058 -0.00103647 -0.00172226 -0.00202458 -0.00230524 -0.00264428 -0.00188038 0.0036704 0.00234654 -0.00234076 -0.00276937 -0.00306445 -0.00320685 -0.00325588 -0.00323995 -0.00319017 -0.0031118 -0.00302053 -0.00295218 -0.00292624 -0.00292742 -0.00288083 -0.00279305 -0.00281687 -0.0030048 -0.00357593 -0.00430285 -0.00483966 -0.00504545 -0.00496395 -0.00058813 -0.000604979 -0.00061852 -0.000627819 -0.000636098 -0.000646724 -0.000662123 -0.000683088 -0.000709213 -0.00074059 -0.00077899 -0.000827224 -0.000887079 -0.000957184 -0.00103195 -0.00110833 -0.00117494 -0.00100916 0.00202669 0.00195232 0.00168278 0.00060327 -0.00174967 -0.00191767 -0.0021411 -0.00212706 0.00321655 0.00468863 0.00402291 0.00139458 -0.00265487 -0.00290452 -0.00302885 -0.0030776 -0.00307223 -0.00303363 -0.00296731 -0.00287545 -0.00281748 -0.00276262 -0.00272312 -0.00266302 -0.00258963 -0.00260952 -0.00268564 -0.00298966 -0.00350172 -0.0038357 -0.00398197 -0.00394664 -0.000519949 -0.000537131 -0.000549806 -0.000556376 -0.000560685 -0.000567571 -0.000581109 -0.000603151 -0.000633335 -0.000670796 -0.000715989 -0.000770376 -0.000834355 -0.000904861 -0.000973764 -0.00103859 -0.00108681 -0.000994027 0.00176261 0.00189943 0.00184027 0.00156811 -0.00198006 -0.00179453 -0.0020362 -0.00212567 0.00481929 0.00443411 0.00426445 0.00426086 -0.0021155 -0.002881 -0.00293875 -0.00295864 -0.00293949 -0.00289809 -0.00283579 -0.0027658 -0.00266715 -0.00262114 -0.00256515 -0.00250279 -0.00242078 -0.00245851 -0.00256272 -0.00275142 -0.00299009 -0.00318777 -0.00327788 -0.00325214 -0.000452643 -0.000469131 -0.000479657 -0.000482702 -0.00048334 -0.000487975 -0.000501833 -0.000527089 -0.000562771 -0.000606805 -0.000658469 -0.000718487 -0.000786739 -0.000859638 -0.000929743 -0.000991477 -0.00103225 -0.00104689 -0.000117027 0.00197145 0.00226498 -6.80332e-05 -0.00184031 -0.00184663 -0.00192947 -0.00190797 0.00262184 0.00395389 0.00451432 0.00431858 -0.00188839 -0.00284766 -0.00284654 -0.00284506 -0.00281945 -0.00277583 -0.00269697 -0.0026441 -0.00256929 -0.00249468 -0.00243563 -0.00234007 -0.00230624 -0.00233059 -0.00239874 -0.00250724 -0.00264206 -0.00275294 -0.00280056 -0.00277481 -0.000385525 -0.00040049 -0.000408011 -0.000407271 -0.00040496 -0.000409039 -0.000425458 -0.000456084 -0.000498769 -0.000549974 -0.000607825 -0.000672742 -0.000744996 -0.00082212 -0.000899294 -0.000972587 -0.00103757 -0.00107881 -0.00115643 -0.000676416 0.000514309 -0.00188954 -0.00180788 -0.00181115 -0.00186089 -0.00183812 -0.00107047 0.00208499 0.00551586 -0.000275885 -0.00292482 -0.00279638 -0.00275085 -0.00273002 -0.00270196 -0.00262204 -0.00260115 -0.00253107 -0.00246472 -0.00230853 -0.00233113 -0.00227297 -0.00223634 -0.00223648 -0.00226514 -0.00232004 -0.00238902 -0.00244632 -0.0024658 -0.00243952 -0.000317515 -0.000330527 -0.000334961 -0.000331077 -0.000327207 -0.000332622 -0.000353609 -0.000391261 -0.000441927 -0.000500523 -0.000564117 -0.000632908 -0.000707728 -0.000787192 -0.000868084 -0.000947976 -0.00103039 -0.00112265 -0.0012106 -0.00146081 -0.00157614 -0.00170241 -0.00166342 -0.00175622 -0.00177729 -0.00180807 -0.00179847 -0.00205385 -0.00237341 -0.00264119 -0.0026961 -0.00266047 -0.00262282 -0.00256095 -0.00257723 -0.00253265 -0.00247857 -0.00242068 -0.0022013 -0.00228908 -0.00223707 -0.00218659 -0.00215372 -0.0021444 -0.00215133 -0.00217 -0.00219647 -0.00221898 -0.00222132 -0.00219727 -0.000247288 -0.000258395 -0.000260514 -0.000255134 -0.000251895 -0.000260875 -0.00028825 -0.000334 -0.000392837 -0.000458236 -0.00052654 -0.000597992 -0.000674025 -0.000753911 -0.000834925 -0.000916198 -0.00100214 -0.00110035 -0.00121613 -0.00137779 -0.00150664 -0.00159022 -0.00163912 -0.00166422 -0.00152088 -0.0017909 -0.00189527 -0.00206798 -0.00226813 -0.00240825 -0.00249112 -0.00249654 -0.00248428 -0.00246899 -0.0024439 -0.00240624 -0.00235824 -0.00231034 -0.00223553 -0.00219939 -0.00214835 -0.00209924 -0.00206625 -0.00204905 -0.00204064 -0.00203733 -0.00203912 -0.00204069 -0.00203246 -0.00201059 -0.000173808 -0.00018343 -0.000184655 -0.000180157 -0.000180322 -0.000195364 -0.000230837 -0.00028538 -0.000352056 -0.000423027 -0.000494201 -0.000566352 -0.000641964 -0.000721145 -0.000801223 -0.000880959 -0.000964168 -0.00105781 -0.00116519 -0.00129062 -0.00140815 -0.00150154 -0.00157984 -0.0016485 -0.0017085 -0.00176316 -0.00185706 -0.00199872 -0.00214333 -0.00224644 -0.0023168 -0.00233902 -0.00233981 -0.00233216 -0.00231388 -0.00227985 -0.00223926 -0.00219786 -0.0021506 -0.002104 -0.00205344 -0.00200438 -0.00196708 -0.00194204 -0.00192315 -0.00190724 -0.00189552 -0.00188508 -0.00186982 -0.0018484 -9.69179e-05 -0.00010566 -0.000107671 -0.000106649 -0.000113037 -0.000136446 -0.000181373 -0.00024508 -0.000319147 -0.000394516 -0.000466606 -0.000536885 -0.000609436 -0.000685998 -0.000764642 -0.000843447 -0.000924251 -0.00101145 -0.00110744 -0.00121296 -0.0013167 -0.00141605 -0.00150561 -0.00158024 -0.00163837 -0.00170185 -0.00179177 -0.00190784 -0.00201833 -0.00210113 -0.0021592 -0.00218699 -0.00219567 -0.00219445 -0.00218217 -0.00215451 -0.00211757 -0.00207848 -0.00203882 -0.0019959 -0.00194586 -0.00189503 -0.00185255 -0.00182051 -0.00179435 -0.00177142 -0.00175278 -0.00173597 -0.00171686 -0.00169624 -1.76718e-05 -2.62302e-05 -3.06754e-05 -3.54699e-05 -5.03191e-05 -8.35058e-05 -0.000138219 -0.000210659 -0.00029147 -0.000370601 -0.000442701 -0.000509365 -0.000576092 -0.000646748 -0.000721224 -0.000798299 -0.000878873 -0.0009644 -0.00105277 -0.00114031 -0.0012263 -0.00131707 -0.00141121 -0.0014952 -0.00156073 -0.00162396 -0.00170629 -0.0018052 -0.0018956 -0.00196411 -0.00201338 -0.00204247 -0.00205524 -0.00205763 -0.0020491 -0.00202596 -0.00199204 -0.00195467 -0.00191587 -0.00187355 -0.00182429 -0.00177292 -0.00172785 -0.00169158 -0.00166075 -0.00163363 -0.00161151 -0.00159231 -0.00157269 -0.00155439 6.1799e-05 5.26738e-05 4.42807e-05 3.18059e-05 7.1775e-06 -3.58669e-05 -9.91162e-05 -0.000178332 -0.000264167 -0.000346267 -0.000418561 -0.000482019 -0.000542439 -0.00060503 -0.000671584 -0.000742874 -0.000821314 -0.000908036 -0.000997245 -0.00107934 -0.0011524 -0.00122823 -0.00131504 -0.00140248 -0.00147537 -0.00153954 -0.00161363 -0.0016985 -0.00177571 -0.00183435 -0.00187658 -0.00190354 -0.00191699 -0.00192042 -0.00191344 -0.00189273 -0.00186035 -0.00182295 -0.00178431 -0.00174294 -0.00169586 -0.00164665 -0.00160205 -0.00156443 -0.00153094 -0.00150089 -0.00147652 -0.00145663 -0.00143806 -0.00142224 0.000138669 0.000128181 0.000114512 9.30524e-05 5.82677e-05 6.55468e-06 -6.24954e-05 -0.000144889 -0.000232354 -0.000315273 -0.000387466 -0.000449209 -0.000505672 -0.00056191 -0.000620041 -0.000682011 -0.000752952 -0.000837484 -0.000930778 -0.00101827 -0.00109045 -0.00115611 -0.00123035 -0.00131251 -0.00138784 -0.00145304 -0.00152012 -0.00159312 -0.00165997 -0.00171092 -0.00174677 -0.00176967 -0.00178111 -0.00178331 -0.00177582 -0.00175536 -0.00172282 -0.00168517 -0.00164806 -0.00161005 -0.00156727 -0.00152124 -0.00147813 -0.00144055 -0.00140599 -0.00137387 -0.00134717 -0.00132617 -0.00130827 -0.00129395 0.000209983 0.000197317 0.000177289 0.000146164 0.000101746 4.35047e-05 -2.77768e-05 -0.00010893 -0.000193546 -0.000273616 -0.000343589 -0.000403687 -0.000458751 -0.000513171 -0.000567616 -0.00062239 -0.00068324 -0.000759315 -0.000851726 -0.000946698 -0.00102746 -0.00109339 -0.00115881 -0.00123163 -0.00130364 -0.00136772 -0.00142905 -0.00149207 -0.00154968 -0.00159365 -0.00162349 -0.00164157 -0.00164967 -0.00164947 -0.00164033 -0.00161921 -0.00158677 -0.00155006 -0.00151494 -0.00148019 -0.00144114 -0.00139791 -0.00135597 -0.00131853 -0.00128366 -0.00125042 -0.00122165 -0.00119902 -0.00118108 -0.00116762 0.000273016 0.000257462 0.000230413 0.000189754 0.0001372 7.52744e-05 5.48491e-06 -7.03628e-05 -0.000148113 -0.000221631 -0.000286261 -0.000342608 -0.000396118 -0.000451662 -0.000508711 -0.000563952 -0.000619546 -0.000685791 -0.000770711 -0.000867382 -0.000957567 -0.00103101 -0.00109492 -0.00116006 -0.00122557 -0.00128571 -0.00134148 -0.00139606 -0.00144533 -0.00148267 -0.00150679 -0.00152001 -0.00152466 -0.00152238 -0.00151265 -0.00149266 -0.00146217 -0.00142636 -0.00139143 -0.00135784 -0.00132138 -0.00128057 -0.0012395 -0.00120198 -0.00116721 -0.00113394 -0.00110428 -0.00108046 -0.0010623 -0.00104956 0.0003254 0.000306495 0.000272434 0.000223404 0.000165233 0.00010305 3.84046e-05 -2.88746e-05 -9.72619e-05 -0.00016245 -0.000220182 -0.000270784 -0.00032039 -0.000375883 -0.000437899 -0.000500601 -0.000560138 -0.000622622 -0.00069905 -0.000790845 -0.000884787 -0.000966128 -0.00103334 -0.00109449 -0.00115326 -0.00120745 -0.00125704 -0.00130404 -0.00134592 -0.00137725 -0.00139618 -0.00140485 -0.00140634 -0.00140291 -0.0013944 -0.00137755 -0.00135014 -0.00131563 -0.00128039 -0.00124691 -0.0012123 -0.00117408 -0.00113458 -0.00109751 -0.00106337 -0.00103108 -0.00100177 -0.000977553 -0.000959084 -0.000946431 0.000365288 0.000343008 0.000302824 0.000247645 0.000187144 0.000128402 7.23429e-05 1.62217e-05 -4.1615e-05 -9.8938e-05 -0.000151344 -0.000197443 -0.000242428 -0.000294945 -0.000359063 -0.000429924 -0.000499312 -0.000566137 -0.000638673 -0.000723434 -0.000814793 -0.000899312 -0.000969892 -0.00102947 -0.00108259 -0.00113011 -0.00117284 -0.00121261 -0.00124799 -0.00127437 -0.00128921 -0.00129404 -0.00129237 -0.00128736 -0.00127956 -0.00126589 -0.0012429 -0.00121176 -0.00117787 -0.00114513 -0.00111257 -0.00107765 -0.0010411 -0.00100584 -0.000973099 -0.000942358 -0.000914068 -0.0008898 -0.000870572 -0.00085682 0.000391368 0.000366309 0.000321874 0.000263655 0.000204355 0.000152268 0.000107423 6.43676e-05 1.78302e-05 -3.28262e-05 -8.34465e-05 -0.00012989 -0.000173914 -0.000223383 -0.000285533 -0.000359463 -0.000436817 -0.000510973 -0.000584189 -0.000662999 -0.000747704 -0.000829559 -0.00090013 -0.00095805 -0.00100632 -0.00104726 -0.00108292 -0.00111571 -0.00114533 -0.00116801 -0.00118043 -0.00118273 -0.00117807 -0.00117034 -0.00116148 -0.00114969 -0.00113124 -0.00110514 -0.00107482 -0.00104437 -0.00101457 -0.000983637 -0.000951196 -0.00091904 -0.000888533 -0.000859652 -0.000832583 -0.000808378 -0.000788112 -0.000772488 0.000402859 0.000376429 0.000330623 0.000273098 0.000218127 0.000174394 0.000141413 0.000111807 7.69095e-05 3.25127e-05 -1.88096e-05 -7.07949e-05 -0.000120241 -0.000170878 -0.000230044 -0.000301101 -0.000379212 -0.000456423 -0.000529964 -0.000603341 -0.000679204 -0.000753762 -0.000820071 -0.00087458 -0.000918169 -0.000953037 -0.000981936 -0.00100802 -0.00103233 -0.00105224 -0.00106395 -0.00106592 -0.00105995 -0.00104982 -0.00103872 -0.00102682 -0.00101136 -0.000990129 -0.000964405 -0.000937437 -0.000910851 -0.000883914 -0.000855889 -0.00082752 -0.000799872 -0.000773206 -0.000747716 -0.000724127 -0.000703408 -0.00068637 0.000399268 0.000373707 0.000330346 0.000277556 0.000229193 0.000193474 0.000170099 0.000151494 0.000127141 8.94169e-05 3.79188e-05 -2.09633e-05 -7.97888e-05 -0.000136459 -0.000194867 -0.000259925 -0.000331336 -0.000403752 -0.000472769 -0.00053887 -0.000604599 -0.000669205 -0.000728259 -0.000777794 -0.000816861 -0.000846628 -0.00086966 -0.000889494 -0.000908496 -0.000925629 -0.000937437 -0.000941033 -0.00093626 -0.000925727 -0.000913017 -0.000900007 -0.000885649 -0.000867857 -0.000846362 -0.000823094 -0.000799754 -0.000776363 -0.000752353 -0.000727826 -0.000703442 -0.000679558 -0.000656424 -0.000634565 -0.000614782 -0.000597837 0.000380337 0.000358354 0.000321584 0.000277393 0.000237013 0.000207245 0.000188659 0.000175528 0.000158023 0.000126874 7.8466e-05 1.70345e-05 -4.85899e-05 -0.000111384 -0.000170245 -0.000228586 -0.000288958 -0.000350174 -0.000409401 -0.000465818 -0.000520975 -0.000575326 -0.000626396 -0.000670646 -0.00070594 -0.000732076 -0.000750673 -0.000764932 -0.000778241 -0.000791391 -0.000802176 -0.000807391 -0.000805306 -0.000796779 -0.000784585 -0.00077137 -0.000757651 -0.000742256 -0.000724395 -0.000704796 -0.000684738 -0.000664613 -0.000644205 -0.000623436 -0.000602654 -0.000582181 -0.000562292 -0.000543377 -0.000526009 -0.000510759 0.000345724 0.000329832 0.000303132 0.000270426 0.000238618 0.000212189 0.000192864 0.000178347 0.000162202 0.000136235 9.49023e-05 3.91964e-05 -2.39866e-05 -8.61137e-05 -0.000142222 -0.000192855 -0.000240995 -0.000288572 -0.000335761 -0.00038192 -0.000427545 -0.000473162 -0.00051733 -0.000557073 -0.000589671 -0.000613714 -0.000629503 -0.000639135 -0.000646364 -0.000653662 -0.000660767 -0.000665436 -0.000665391 -0.000660031 -0.000650669 -0.000639473 -0.000627739 -0.000615198 -0.000601161 -0.000585663 -0.000569415 -0.000552885 -0.000536158 -0.000519247 -0.000502381 -0.000485819 -0.000469813 -0.00045462 -0.000440562 -0.00042794 0.000295249 0.000286764 0.000271693 0.00025138 0.000228079 0.000203287 0.000179778 0.000159174 0.000140035 0.000117691 8.67013e-05 4.49018e-05 -4.74442e-06 -5.59071e-05 -0.000102839 -0.000143652 -0.000179925 -0.000214541 -0.000250445 -0.000287753 -0.000325734 -0.000364423 -0.000402816 -0.000438476 -0.000468666 -0.000491387 -0.000505805 -0.000512264 -0.000513773 -0.000514085 -0.000515096 -0.000516468 -0.000516582 -0.000514038 -0.000508766 -0.000501724 -0.000493938 -0.000485564 -0.000476142 -0.000465443 -0.000453766 -0.000441488 -0.000428874 -0.000416105 -0.000403436 -0.000391091 -0.000379248 -0.000368024 -0.000357521 -0.000347789 0.000228597 0.000226676 0.000221773 0.000212464 0.000198449 0.000176291 0.000149899 0.000124266 0.000102474 8.39291e-05 6.4893e-05 4.1236e-05 1.16527e-05 -2.15228e-05 -5.42156e-05 -8.33389e-05 -0.000107969 -0.000130257 -0.000157072 -0.000187759 -0.000219351 -0.000251526 -0.000283649 -0.000314026 -0.000340486 -0.000361382 -0.000375452 -0.000378978 -0.000375301 -0.000369266 -0.000364136 -0.000361292 -0.000360232 -0.000359557 -0.000358193 -0.000355895 -0.000352875 -0.000349203 -0.000344606 -0.000338831 -0.000331988 -0.000324359 -0.000316269 -0.000307998 -0.000299819 -0.000291922 -0.000284397 -0.000277233 -0.000270356 -0.000263631 0.000146932 0.000147875 0.000148486 0.000147025 0.000144358 0.000129914 0.000107731 8.47253e-05 6.59806e-05 5.33422e-05 4.49119e-05 3.65987e-05 2.49419e-05 9.19325e-06 -8.65393e-06 -2.5428e-05 -3.74244e-05 -4.39337e-05 -5.81291e-05 -8.57075e-05 -0.000110873 -0.000134883 -0.00015826 -0.000180374 -0.000200148 -0.000217546 -0.000231127 -0.00023878 -0.000227871 -0.00021777 -0.000209617 -0.000204662 -0.000202832 -0.000203058 -0.000204033 -0.000204904 -0.00020535 -0.000205232 -0.000204408 -0.000202739 -0.000200301 -0.000197285 -0.000193944 -0.000190504 -0.000187159 -0.000184009 -0.000181039 -0.000178131 -0.000175099 -0.000171727 5.20809e-05 5.28731e-05 5.37309e-05 5.30957e-05 5.51611e-05 5.13271e-05 4.21033e-05 3.18456e-05 2.3615e-05 1.89625e-05 1.73934e-05 1.69963e-05 1.57139e-05 1.24978e-05 8.00195e-06 4.48652e-06 6.93142e-06 1.99282e-05 1.21983e-05 -1.16569e-05 -2.68591e-05 -3.89368e-05 -4.9896e-05 -6.01263e-05 -6.96307e-05 -7.96997e-05 -9.16527e-05 -0.00010176 -8.336e-05 -7.33718e-05 -6.75271e-05 -6.44122e-05 -6.34277e-05 -6.39481e-05 -6.52993e-05 -6.69673e-05 -6.87356e-05 -7.05106e-05 -7.226e-05 -7.39525e-05 -7.56282e-05 -7.73408e-05 -7.91421e-05 -8.10515e-05 -8.30489e-05 -8.5049e-05 -8.68987e-05 -8.83957e-05 -8.93141e-05 -8.94404e-05 40.0409 40.0077 39.9778 39.952 39.929 39.9043 39.8702 39.8208 39.7601 39.7091 39.7015 39.7686 39.931 40.2142 40.6857 40.9801 2.35162 -0.0994928 -0.0447858 -0.0439697 -0.0403625 -0.0360684 -0.0325528 -0.0298861 -0.0277965 -0.0261108 -0.0247393 -0.0236075 -0.0226654 -0.0218768 -0.0212131 -0.0206517 -0.0201778 -0.0197812 -0.0194513 -0.0191751 -0.0189398 -0.0187335 -0.0185461 -0.0183715 -0.018211 -0.0180717 -0.0179625 -0.0178874 -0.0178435 -0.0178226 -0.0178167 -0.0178218 -0.0178392 -0.0178673 40.0011 39.9713 39.944 39.92 39.8983 39.875 39.8436 39.7992 39.7456 39.7007 39.6935 39.7485 39.8819 40.1034 40.4443 41.3384 7.5781 -0.0924906 -0.038071 -0.0410881 -0.0390635 -0.0355738 -0.0323923 -0.0298478 -0.0277926 -0.026111 -0.0247272 -0.0235754 -0.02261 -0.021797 -0.0211099 -0.0205279 -0.0200373 -0.0196274 -0.0192862 -0.0189998 -0.0187548 -0.0185389 -0.018342 -0.0181589 -0.0179919 -0.017849 -0.0177385 -0.0176632 -0.0176187 -0.017596 -0.0175871 -0.0175887 -0.0176033 -0.0176297 39.9598 39.9326 39.907 39.8839 39.8622 39.8378 39.8042 39.7567 39.6983 39.6453 39.6233 39.6523 39.728 39.8052 39.7539 39.5187 11.3643 -0.0823084 -0.0326313 -0.038279 -0.0375965 -0.0348261 -0.0320006 -0.0296305 -0.0276478 -0.0259918 -0.0246084 -0.023448 -0.0224701 -0.0216437 -0.0209434 -0.0203504 -0.0198516 -0.019435 -0.019087 -0.0187934 -0.0185405 -0.0183166 -0.0181122 -0.0179229 -0.0177522 -0.017608 -0.0174979 -0.0174233 -0.017378 -0.0173528 -0.0173399 -0.0173373 -0.0173483 -0.0173722 39.9173 39.8917 39.8672 39.844 39.8207 39.7922 39.7511 39.6917 39.6173 39.545 39.502 39.5089 39.5549 39.5734 39.3723 38.7798 11.078 -0.0767748 -0.0309424 -0.0371433 -0.036781 -0.0342506 -0.0315733 -0.0292994 -0.0273739 -0.0257484 -0.02438 -0.0232252 -0.0222475 -0.0214184 -0.0207149 -0.0201199 -0.0196201 -0.0192022 -0.0188513 -0.0185533 -0.0182953 -0.0180661 -0.0178567 -0.0176641 -0.0174922 -0.0173491 -0.017241 -0.0171674 -0.0171212 -0.0170927 -0.0170751 -0.0170677 -0.0170745 -0.0170954 39.8735 39.8482 39.8235 39.7993 39.773 39.7377 39.6842 39.6055 39.5051 39.4042 39.3374 39.3343 39.3984 39.4927 39.5017 39.6166 6.83805 -0.0888959 -0.0338077 -0.0378383 -0.0367445 -0.0338974 -0.0311513 -0.0288917 -0.0269962 -0.0253986 -0.0240508 -0.0229104 -0.0219439 -0.0211234 -0.0204272 -0.019839 -0.0193447 -0.0189296 -0.0185788 -0.0182789 -0.0180185 -0.0177868 -0.0175757 -0.0173828 -0.0172126 -0.0170727 -0.0169677 -0.0168956 -0.016848 -0.0168157 -0.016793 -0.0167802 -0.0167825 -0.0168 39.8289 39.8013 39.7744 39.7474 39.7166 39.6726 39.6036 39.5006 39.3671 39.2297 39.1338 39.1225 39.2206 39.4284 39.6676 39.3202 1.8955 -0.0873002 -0.0374119 -0.0389947 -0.0367071 -0.0334219 -0.0306122 -0.0283474 -0.0264982 -0.0249367 -0.0236193 -0.0225049 -0.0215605 -0.0207593 -0.0200806 -0.0195078 -0.0190252 -0.0186172 -0.0182697 -0.017971 -0.0177111 -0.01748 -0.0172702 -0.0170799 -0.016914 -0.0167791 -0.0166784 -0.0166078 -0.0165586 -0.016522 -0.0164938 -0.0164757 -0.0164734 -0.0164872 39.7823 39.7494 39.7168 39.6835 39.6467 39.5923 39.5076 39.3806 39.2133 39.0363 38.9039 38.8707 38.9788 39.2562 39.6657 33.6957 -0.557808 -0.0519403 -0.0380565 -0.0385579 -0.0356119 -0.0323707 -0.0297583 -0.0276124 -0.0258456 -0.0243491 -0.0230838 -0.0220116 -0.0211016 -0.02033 -0.0196772 -0.0191265 -0.0186606 -0.0182638 -0.0179236 -0.0176304 -0.0173747 -0.0171474 -0.0169416 -0.0167567 -0.0165971 -0.0164688 -0.0163728 -0.0163038 -0.0162528 -0.0162119 -0.0161785 -0.0161554 -0.0161487 -0.0161587 39.7299 39.6882 39.6449 39.5979 39.5549 39.4864 39.3894 39.2475 39.0587 38.8535 38.6861 38.6187 38.7187 39.0762 39.4668 16.6285 0.0228869 -0.0262198 -0.0352725 -0.0358273 -0.0333391 -0.0307649 -0.0285439 -0.0266374 -0.0250054 -0.0236259 -0.0224435 -0.0214344 -0.0205731 -0.019841 -0.019222 -0.0186984 -0.0182526 -0.0178702 -0.0175415 -0.0172583 -0.0170113 -0.016791 -0.0165919 -0.0164143 -0.0162629 -0.0161422 -0.0160513 -0.0159838 -0.0159309 -0.015886 -0.015848 -0.0158207 -0.01581 -0.0158164 39.6643 39.6108 39.5521 39.4885 39.4197 39.338 39.2354 39.0972 38.9176 38.7134 38.5271 38.4215 38.4717 38.933 37.869 1.24207 0.011571 -0.0255189 -0.031872 -0.0322555 -0.0308039 -0.0288779 -0.027065 -0.0254404 -0.0240148 -0.022776 -0.0217032 -0.0207644 -0.0199812 -0.0193003 -0.0187195 -0.0182274 -0.0178046 -0.0174399 -0.0171266 -0.0168576 -0.0166231 -0.0164131 -0.0162229 -0.0160542 -0.0159121 -0.0157995 -0.0157138 -0.0156478 -0.0155932 -0.015545 -0.0155035 -0.0154732 -0.0154595 -0.0154625 39.5783 39.511 39.431 39.3394 39.2394 39.1361 39.0321 38.9225 38.8 38.6461 38.4673 38.3209 38.2276 38.4571 26.6666 2.57719 -0.00583807 -0.0305808 -0.0309863 -0.0292182 -0.0274176 -0.0266415 -0.0253042 -0.0240419 -0.0228734 -0.0218186 -0.0208793 -0.0200511 -0.0193315 -0.0187117 -0.0181766 -0.017718 -0.017321 -0.0169776 -0.0166838 -0.0164326 -0.0162133 -0.0160158 -0.0158364 -0.0156779 -0.0155457 -0.0154414 -0.0153609 -0.0152963 -0.0152405 -0.0151901 -0.0151467 -0.0151148 -0.0150991 -0.0150991 39.4728 39.3909 39.2849 39.1574 39.0169 38.8809 38.775 38.7158 38.7224 38.7156 38.6001 38.46 38.0867 32.6843 11.8131 2.84564 0.0387688 -0.0313046 -0.0294178 -0.0254777 -0.024292 -0.0239681 -0.023329 -0.0225108 -0.0216408 -0.0207917 -0.0199983 -0.0192781 -0.0186392 -0.0180466 -0.0176003 -0.0171779 -0.0168074 -0.0164888 -0.0162182 -0.0159874 -0.0157849 -0.0156011 -0.0154337 -0.0152866 -0.0151647 -0.0150686 -0.0149929 -0.0149299 -0.0148737 -0.0148227 -0.0147792 -0.0147475 -0.0147309 -0.0147284 39.3629 39.2675 39.1337 38.9661 38.7805 38.6012 38.4833 38.4617 38.662 38.9279 38.9247 38.9627 39.031 21.072 4.03061 0.385854 0.159189 -0.00316753 -0.0115382 -0.0197967 -0.0210415 -0.0216001 -0.0215058 -0.0210393 -0.0204174 -0.0197491 -0.0190898 -0.0184745 -0.01792 -0.0174309 -0.0169581 -0.0166099 -0.0162707 -0.0159799 -0.0157353 -0.0155262 -0.0153407 -0.0151708 -0.0150162 -0.0148812 -0.01477 -0.0146818 -0.0146107 -0.0145495 -0.0144941 -0.0144442 -0.0144028 -0.0143732 -0.0143569 -0.0143525 39.2739 39.1694 39.0082 38.8 38.5786 38.3483 38.2133 38.1363 38.4898 38.9857 38.8692 38.3643 29.9402 13.9675 -0.671804 0.223247 0.0758227 0.0137086 -0.00683538 -0.0155476 -0.0185922 -0.0197192 -0.019912 -0.0196835 -0.019248 -0.018724 -0.0181789 -0.0176584 -0.0171845 -0.0167574 -0.0163679 -0.0160205 -0.0157164 -0.015458 -0.015241 -0.0150534 -0.014884 -0.0147276 -0.0145858 -0.0144634 -0.0143629 -0.0142822 -0.0142154 -0.0141566 -0.0141032 -0.0140565 -0.0140193 -0.0139936 -0.0139788 -0.0139729 39.2258 39.1266 38.937 38.6767 38.4139 38.191 37.9784 37.8231 38.1743 38.8431 38.0812 33.4496 12.1457 0.980687 -0.0623188 0.555779 -0.00400482 0.0219711 0.00272456 -0.0112333 -0.0163894 -0.0180533 -0.0185153 -0.0184633 -0.0181607 -0.0177445 -0.0172903 -0.0168443 -0.0164465 -0.0160716 -0.015727 -0.0154204 -0.0151532 -0.014929 -0.0147397 -0.0145723 -0.0144177 -0.014274 -0.0141451 -0.0140353 -0.0139452 -0.0138716 -0.0138089 -0.013753 -0.0137032 -0.0136615 -0.0136305 -0.0136103 -0.0135981 -0.0135912 39.2234 39.1571 38.9391 38.5862 38.2995 38.1808 37.8734 37.2331 37.7894 40.2984 32.1093 13.1368 -2.55217 0.337326 0.268435 0.0927369 -0.0159128 -0.0118063 -0.0174481 -0.0185483 -0.0179578 -0.0179476 -0.0178027 -0.0175542 -0.017225 -0.016847 -0.0164482 -0.0160682 -0.0157176 -0.0153899 -0.0150844 -0.0147846 -0.0145883 -0.0143987 -0.0142346 -0.0140852 -0.0139439 -0.0138126 -0.0136967 -0.0135994 -0.0135193 -0.0134521 -0.0133933 -0.0133409 -0.0132961 -0.0132614 -0.0132383 -0.0132248 -0.0132157 -0.0132083 39.2234 39.3078 39.046 38.4294 38.1059 38.4823 38.2329 35.5513 31.3292 23.8748 13.8349 1.38085 0.109995 1.07183 0.0631291 0.0451183 0.00743217 -0.0170382 -0.0234218 -0.0201322 -0.0183326 -0.0175308 -0.0170363 -0.0166835 -0.0163534 -0.016018 -0.0156551 -0.0153119 -0.0150004 -0.0147113 -0.0144463 -0.0142195 -0.0140098 -0.0138724 -0.0137298 -0.0135945 -0.0134654 -0.0133463 -0.0132435 -0.0131584 -0.0130876 -0.013026 -0.012971 -0.0129229 -0.0128844 -0.0128581 -0.0128441 -0.012838 -0.0128325 -0.0128246 39.088 39.7316 39.4051 37.8878 37.2887 39.465 39.0875 21.4444 2.97733 0.401903 -0.506192 -0.0400083 0.0664157 0.0936616 -0.00856272 0.00142616 -0.00829705 -0.020411 -0.0195412 -0.0185837 -0.0174215 -0.0165717 -0.0160503 -0.0157864 -0.0155008 -0.0152901 -0.0149103 -0.0145744 -0.0142931 -0.0140388 -0.0138132 -0.013608 -0.0134793 -0.0133495 -0.013225 -0.0131019 -0.012985 -0.0128786 -0.0127892 -0.0127156 -0.0126528 -0.0125961 -0.0125448 -0.0125016 -0.0124704 -0.0124535 -0.0124492 -0.0124506 -0.0124485 -0.0124403 38.5755 41.2152 40.8743 35.4838 27.0509 17.053 6.21649 3.68962 0.607278 0.773168 0.281017 1.24325 0.119016 0.0431378 0.000453124 0.00420222 -0.0108499 -0.0148441 -0.0178504 -0.0168598 -0.0162005 -0.0152437 -0.0147768 -0.0130284 -0.0115991 -0.0143003 -0.0141434 -0.0138291 -0.013583 -0.013371 -0.013194 -0.0130518 -0.0129365 -0.0128307 -0.0127219 -0.0126091 -0.0125044 -0.0124124 -0.0123368 -0.0122738 -0.0122176 -0.0121649 -0.0121173 -0.0120797 -0.0120565 -0.0120494 -0.0120545 -0.0120629 -0.0120639 -0.0120552 11.4136 12.7561 8.75882 2.41375 -0.654407 0.121354 -0.0177466 -0.0260028 0.108003 0.255929 0.121006 0.0284645 -0.0309115 -0.0242642 -0.0152316 -0.00669931 -0.0113787 -0.0159074 -0.0139461 -0.0129336 -0.0142026 -0.0134498 -0.0132403 -0.0102636 -0.00934218 -0.0126185 -0.0132545 -0.0130435 -0.012859 -0.0126774 -0.0125894 -0.0124884 -0.0124057 -0.012317 -0.0121756 -0.0121216 -0.0120282 -0.0119513 -0.0118892 -0.0118352 -0.0117843 -0.011735 -0.0116912 -0.0116596 -0.0116448 -0.0116471 -0.0116607 -0.0116749 -0.0116782 -0.0116688 -0.0511719 -0.0660317 -0.064378 -0.0568042 -0.0163547 0.016751 5.12657e-05 0.00203037 0.0316951 0.0817615 0.049662 0.0134821 -0.0438711 -0.032089 -0.0207693 -0.0131784 -0.012379 -0.0135551 -0.0139572 -0.013697 -0.0131091 -0.0126243 -0.0118442 -0.00940538 -0.0094527 -0.0114184 -0.0122802 -0.0122239 -0.012141 -0.0120669 -0.0120046 -0.0119473 -0.0118803 -0.0117039 -0.0117253 -0.0116384 -0.0115607 -0.0114995 -0.0114488 -0.0114022 -0.0113551 -0.0113086 -0.0112689 -0.0112437 -0.0112371 -0.0112477 -0.0112681 -0.0112866 -0.011291 -0.0112807 -0.00331666 -0.00697151 -0.00798115 -0.00501213 -0.00106726 0.00143279 0.00126563 0.00316209 0.015135 0.0240916 0.0202795 0.00227473 -0.0175798 -0.0200674 -0.0165569 -0.0131026 -0.012012 -0.0121602 -0.0123064 -0.012199 -0.0119092 -0.0117813 -0.00938958 -0.00884592 -0.00939313 -0.0111047 -0.0114322 -0.0114793 -0.0114794 -0.011468 -0.0114518 -0.0114239 -0.0113739 -0.0113073 -0.0112332 -0.0111626 -0.0111056 -0.0110586 -0.0110177 -0.0109764 -0.0109319 -0.010888 -0.0108527 -0.0108339 -0.0108346 -0.010852 -0.0108771 -0.0108977 -0.010902 -0.0108903 -0.00976179 -0.0104207 -0.0100157 -0.00806424 -0.00508382 -0.00206191 -0.000303035 0.00277522 0.00940692 0.012941 0.00994431 0.000733992 -0.00960867 -0.0131782 -0.0128932 -0.0115951 -0.0110026 -0.0109871 -0.011075 -0.0111153 -0.0111337 -0.011173 -0.00708379 -0.00746228 -0.0101321 -0.0106054 -0.0107785 -0.010854 -0.0108961 -0.0109234 -0.0109341 -0.0109224 -0.0108239 -0.0108173 -0.0107573 -0.0107047 -0.0106637 -0.0106299 -0.0105967 -0.0105587 -0.010516 -0.0104749 -0.0104444 -0.0104318 -0.0104386 -0.0104604 -0.0104876 -0.010508 -0.0105109 -0.0104976 -0.00985804 -0.00952326 -0.00869039 -0.0072026 -0.00492152 -0.00217579 -0.000281363 0.00203791 0.00528451 0.00652522 0.00450314 -0.000444686 -0.00628207 -0.00933071 -0.0101821 -0.0100487 -0.00991827 -0.00996362 -0.0100678 -0.0101861 -0.0103726 -0.0106587 -0.00720884 -0.00915158 -0.010188 -0.0101939 -0.010272 -0.010334 -0.0103864 -0.0104254 -0.0104435 -0.0103877 -0.0103934 -0.0103452 -0.0102991 -0.0102638 -0.0102376 -0.010214 -0.0101858 -0.0101496 -0.0101085 -0.0100707 -0.0100454 -0.0100384 -0.0100495 -0.0100732 -0.0100997 -0.0101176 -0.0101177 -0.0101026 -0.00793094 -0.00738925 -0.0065852 -0.00541328 -0.00380692 -0.00199895 -0.000538398 0.000997291 0.00251123 0.00284211 0.00139011 -0.00152914 -0.00490586 -0.00720676 -0.00832326 -0.00871927 -0.00889067 -0.00902807 -0.00916265 -0.00931979 -0.00954807 -0.00989671 -0.00992423 -0.00996711 -0.00984756 -0.00978939 -0.00981671 -0.00986792 -0.00991917 -0.00995584 -0.00997088 -0.0099573 -0.00992472 -0.00988772 -0.00985925 -0.00984055 -0.00982667 -0.00980977 -0.00978388 -0.00974863 -0.00970967 -0.00967611 -0.00965629 -0.00965406 -0.0096676 -0.00969044 -0.00971336 -0.00972664 -0.009723 -0.00970583 -0.00604746 -0.0055627 -0.00490934 -0.00404282 -0.00296299 -0.00180299 -0.000783697 5.59304e-05 0.000724409 0.000667971 -0.000254279 -0.00223548 -0.00434956 -0.00602579 -0.00707775 -0.00764482 -0.00796747 -0.00817954 -0.00834557 -0.00851769 -0.00873285 -0.00901417 -0.00921399 -0.00932045 -0.00932787 -0.0093343 -0.00937233 -0.00942577 -0.00947426 -0.00950463 -0.00951036 -0.00949419 -0.00946987 -0.009449 -0.00943794 -0.00943352 -0.00942819 -0.00941453 -0.00938926 -0.00935506 -0.00931942 -0.00929131 -0.00927726 -0.00927878 -0.00929254 -0.00931189 -0.00932882 -0.00933573 -0.00932752 -0.00930835 -0.00470992 -0.0043334 -0.00384418 -0.00323379 -0.00253192 -0.00180729 -0.00114982 -0.000639455 -0.000416412 -0.000636525 -0.00143059 -0.00267618 -0.00409154 -0.00532079 -0.00621215 -0.00679446 -0.00717546 -0.00743913 -0.00762758 -0.0077696 -0.00795403 -0.00825791 -0.00851229 -0.00871766 -0.00882591 -0.00888642 -0.00894297 -0.00899789 -0.00903971 -0.00905925 -0.00905698 -0.00904383 -0.00903236 -0.00902899 -0.00903357 -0.00903939 -0.00903841 -0.00902531 -0.0090001 -0.00896807 -0.00893746 -0.00891602 -0.00890774 -0.00891182 -0.00892379 -0.00893736 -0.00894634 -0.00894568 -0.00893251 -0.00891152 -0.00377736 -0.00350489 -0.00315584 -0.0027374 -0.00228276 -0.00175418 -0.00111074 -0.00116176 -0.00113056 -0.00141674 -0.00204138 -0.00292977 -0.00392623 -0.00484241 -0.00557604 -0.00612247 -0.00652784 -0.00682764 -0.00700033 -0.00699644 -0.00710345 -0.00755358 -0.00781357 -0.00817714 -0.00841799 -0.00848771 -0.00853416 -0.00857702 -0.00860436 -0.00861321 -0.00861007 -0.00860717 -0.00861222 -0.00862551 -0.00864182 -0.00865314 -0.0086529 -0.00863902 -0.0086147 -0.00858687 -0.00856333 -0.00854958 -0.00854677 -0.00855206 -0.00856042 -0.00856656 -0.00856641 -0.00855763 -0.00853955 -0.0085171 -0.00313265 -0.00294048 -0.00269783 -0.0024162 -0.00212274 -0.00182417 -0.00129078 -0.00134212 -0.00157972 -0.00188183 -0.00238342 -0.0030428 -0.00377388 -0.00447777 -0.00509165 -0.00559949 -0.00601471 -0.00635485 -0.00657267 -0.0061964 -0.00537444 -0.00378739 -0.00488878 -0.00762819 -0.00819877 -0.00811705 -0.00812562 -0.00814838 -0.00816118 -0.00816611 -0.00817162 -0.00818503 -0.00820717 -0.00823356 -0.00825656 -0.00826899 -0.00826729 -0.00825297 -0.00823166 -0.00821069 -0.00819622 -0.00819084 -0.0081929 -0.00819808 -0.00820146 -0.00819921 -0.00818964 -0.00817295 -0.00815046 -0.00812705 -0.00268672 -0.00255109 -0.0023839 -0.00219842 -0.0020093 -0.00184041 -0.00148124 -0.00146915 -0.00188229 -0.00214953 -0.00254962 -0.00305651 -0.00362062 -0.00418746 -0.00471755 -0.00519289 -0.00561375 -0.00600479 -0.00628617 -0.00223672 -0.00161892 -0.00138692 -0.00101965 -0.000440222 -0.00765258 -0.00768456 -0.0076886 -0.00769625 -0.00770626 -0.00772052 -0.00774326 -0.00777507 -0.00781177 -0.00784618 -0.00787087 -0.00788139 -0.00787799 -0.00786524 -0.00785001 -0.00783871 -0.00783494 -0.00783809 -0.00784423 -0.00784824 -0.00784588 -0.00783516 -0.00781674 -0.0077931 -0.00776712 -0.0077434 -0.00237425 -0.00227963 -0.0021676 -0.00205079 -0.00193942 -0.00185133 -0.00174177 -0.00159302 -0.00204185 -0.00227942 -0.00260499 -0.00301154 -0.0034707 -0.00394432 -0.00440236 -0.00482711 -0.00521443 -0.00556188 -0.005726 0.000720076 -0.000482707 -0.000765491 -0.000542658 -0.00226772 -0.00708957 -0.00715368 -0.00718574 -0.00721293 -0.00724273 -0.00727949 -0.00732383 -0.00737243 -0.00741882 -0.00745578 -0.00747839 -0.0074861 -0.00748274 -0.00747486 -0.00746915 -0.00746999 -0.00747783 -0.00748919 -0.00749856 -0.00750076 -0.0074927 -0.00747434 -0.00744849 -0.00741951 -0.00739132 -0.00736801 -0.00215015 -0.00208519 -0.00201193 -0.00194116 -0.00187986 -0.00183853 -0.00183431 -0.00182323 -0.00188343 -0.00233802 -0.00259923 -0.00294094 -0.0033244 -0.00372277 -0.00411224 -0.00447721 -0.00481271 -0.00514443 -0.00537476 -0.00349604 -0.000954301 -0.000587635 -0.00190996 -0.00548717 -0.00635673 -0.00656044 -0.00665131 -0.00671972 -0.00678297 -0.00684667 -0.00691085 -0.006971 -0.0070209 -0.00705575 -0.00707461 -0.00708085 -0.00708089 -0.00708179 -0.00708875 -0.00710332 -0.00712284 -0.00714165 -0.00715352 -0.00715384 -0.00714097 -0.00711671 -0.00708563 -0.00705342 -0.00702454 -0.00700236 -0.0019761 -0.00193091 -0.00188278 -0.00184125 -0.00181214 -0.0018046 -0.00183036 -0.00190863 -0.00207286 -0.00221881 -0.00254666 -0.00285057 -0.00317472 -0.00350594 -0.003829 -0.00413426 -0.00441472 -0.00458687 -0.00491653 -0.00488706 -0.00465838 -0.00501968 -0.00526249 -0.00562259 -0.00585703 -0.00603616 -0.00615741 -0.00625241 -0.00634098 -0.00642455 -0.00650062 -0.00656445 -0.00661187 -0.00664191 -0.00665772 -0.00666569 -0.0066733 -0.00668663 -0.00670844 -0.00673719 -0.00676763 -0.00679288 -0.0068068 -0.00680582 -0.00678984 -0.00676221 -0.0067287 -0.00669571 -0.00666776 -0.00664742 -0.00182172 -0.00179011 -0.0017596 -0.00173892 -0.00173407 -0.00175124 -0.00180043 -0.00189553 -0.00204562 -0.00225843 -0.00238902 -0.00271568 -0.00302027 -0.00328855 -0.0035634 -0.00382955 -0.00403991 -0.0042049 -0.00435394 -0.00441058 -0.00454379 -0.00478936 -0.00499604 -0.00519422 -0.0054054 -0.00556671 -0.00569739 -0.00581203 -0.00591629 -0.00600924 -0.00608732 -0.00614723 -0.0061882 -0.00621331 -0.0062289 -0.0062428 -0.00626194 -0.00629028 -0.00632767 -0.00636978 -0.00640973 -0.00644036 -0.0064563 -0.00645527 -0.00643858 -0.0064107 -0.00637796 -0.00634679 -0.00632135 -0.00630344 -0.001676 -0.00165608 -0.00164061 -0.00163692 -0.00165082 -0.0016866 -0.00175027 -0.00184583 -0.00198222 -0.00215705 -0.00234758 -0.00238602 -0.00235687 -0.00288144 -0.00333023 -0.00361202 -0.00374476 -0.00385702 -0.00388326 -0.00390565 -0.00411602 -0.00441818 -0.00462078 -0.00462946 -0.00500043 -0.00514054 -0.00527411 -0.00539669 -0.00550423 -0.00559485 -0.00566583 -0.0057166 -0.00575011 -0.00577256 -0.00579195 -0.00581584 -0.00584928 -0.0058935 -0.00594553 -0.00599911 -0.00604677 -0.0060819 -0.00610031 -0.00610108 -0.00608662 -0.00606192 -0.00603324 -0.00600642 -0.00598494 -0.00596996 -0.0015402 -0.00153039 -0.00152715 -0.00153579 -0.00156102 -0.00160622 -0.00167479 -0.00176968 -0.00189115 -0.0020433 -0.0022131 -0.00241431 -0.00264723 -0.00286564 -0.00316042 -0.00347057 -0.00251595 -0.00196574 -0.00246761 -0.00315652 -0.00360971 -0.00411564 -0.00428711 -0.00449989 -0.00462058 -0.00475037 -0.00488307 -0.0049992 -0.00509768 -0.00517617 -0.00523407 -0.005274 -0.00530181 -0.00532535 -0.00535249 -0.00538912 -0.00543769 -0.00549665 -0.00556088 -0.00562329 -0.00567677 -0.00571584 -0.00573767 -0.00574255 -0.00573351 -0.00571545 -0.00569392 -0.00567374 -0.00565743 -0.0056457 -0.00141231 -0.00140907 -0.00141349 -0.00142886 -0.00145884 -0.00150627 -0.00157373 -0.00166338 -0.00177637 -0.00191331 -0.00207368 -0.0022524 -0.00244601 -0.00266695 -0.002873 -0.00260407 -0.000463116 -0.000993441 -0.00149856 -0.00180021 -0.00232444 -0.0039796 -0.00403915 -0.00417409 -0.00427779 -0.00439536 -0.00451109 -0.00461034 -0.00469062 -0.00475133 -0.00479443 -0.00482514 -0.00485081 -0.00487925 -0.00491676 -0.00496676 -0.00502898 -0.00509964 -0.00517256 -0.00524083 -0.00529843 -0.00534128 -0.00536791 -0.00537943 -0.00537893 -0.00537066 -0.00535894 -0.00534722 -0.00533696 -0.00532864 -0.00128604 -0.0012859 -0.00129418 -0.00131292 -0.00134494 -0.00139277 -0.00145871 -0.00154461 -0.00165129 -0.00177837 -0.00192343 -0.00208121 -0.00224736 -0.00242141 -0.00260817 -0.00272387 -0.00108765 -0.00101681 -0.00111503 -0.00112746 -0.000694068 -0.00305934 -0.00370727 -0.00384412 -0.00394948 -0.00405066 -0.00414553 -0.00422245 -0.00428105 -0.00432338 -0.00435384 -0.00437907 -0.00440639 -0.0044422 -0.00449045 -0.00455194 -0.00462418 -0.00470217 -0.00477974 -0.004851 -0.00491137 -0.00495829 -0.00499132 -0.00501192 -0.0050227 -0.00502672 -0.00502678 -0.00502475 -0.00502102 -0.00501607 -0.00116076 -0.00116218 -0.00117275 -0.00119391 -0.00122784 -0.00127665 -0.00134201 -0.00142509 -0.00152593 -0.00164299 -0.00177289 -0.00191018 -0.00204824 -0.00218078 -0.00230505 -0.00235213 -0.00212493 -0.00148442 -0.000791314 -0.000934328 -0.00229575 -0.00335159 -0.00347409 -0.0035374 -0.0036276 -0.00371014 -0.00378102 -0.00383446 -0.00387273 -0.0039001 -0.00392232 -0.00394613 -0.00397762 -0.004021 -0.00407779 -0.00414662 -0.00422374 -0.00430405 -0.00438231 -0.00445408 -0.00451638 -0.00456793 -0.00460892 -0.0046406 -0.00466464 -0.00468261 -0.00469556 -0.00470374 -0.00470658 -0.00470478 -0.00104358 -0.00104603 -0.00105801 -0.0010807 -0.00111568 -0.00116445 -0.00122788 -0.00130617 -0.00139856 -0.00150306 -0.00161623 -0.00173329 -0.00184929 -0.00195914 -0.00205615 -0.00210893 -0.00212158 -0.00224133 -0.0024293 -0.00255026 -0.00282091 -0.00303883 -0.00310113 -0.00322325 -0.00330186 -0.0033668 -0.00341677 -0.00345062 -0.00347371 -0.00349167 -0.00351041 -0.00353563 -0.00357155 -0.00362017 -0.00368104 -0.00375157 -0.00382786 -0.00390565 -0.00398114 -0.00405157 -0.00411541 -0.00417223 -0.00422235 -0.00426636 -0.00430464 -0.00433712 -0.00436309 -0.00438127 -0.00439028 -0.00439125 -0.000940508 -0.000942716 -0.000954224 -0.000976025 -0.0010092 -0.00105463 -0.0011126 -0.00118265 -0.00126355 -0.00135341 -0.00144965 -0.00154905 -0.00164835 -0.00174435 -0.00183394 -0.00191098 -0.00198329 -0.00210382 -0.00227025 -0.00242178 -0.0025765 -0.00272586 -0.00283792 -0.00291619 -0.00297858 -0.00302651 -0.00305923 -0.00307966 -0.00309396 -0.00310788 -0.00312647 -0.00315372 -0.00319192 -0.00324137 -0.00330056 -0.00336677 -0.00343689 -0.0035081 -0.00357828 -0.0036462 -0.00371143 -0.00377391 -0.00383364 -0.00389021 -0.00394255 -0.00398894 -0.00402705 -0.00405429 -0.00406868 -0.00407194 -0.000849342 -0.000849287 -0.000857747 -0.000875597 -0.000903587 -0.000942226 -0.000991497 -0.00105083 -0.00111911 -0.00119487 -0.00127645 -0.00136216 -0.00145038 -0.00153967 -0.00162905 -0.00171725 -0.00180904 -0.00192647 -0.00206636 -0.00220024 -0.00233244 -0.00245245 -0.0025443 -0.00261265 -0.00266071 -0.00269466 -0.0027165 -0.00273028 -0.00274158 -0.00275514 -0.00277457 -0.00280216 -0.00283871 -0.00288361 -0.00293532 -0.00299192 -0.00305171 -0.00311352 -0.00317684 -0.00324166 -0.00330813 -0.00337616 -0.00344504 -0.00351321 -0.00357818 -0.00363671 -0.00368514 -0.00371986 -0.00373852 -0.00374351 -0.000762325 -0.000758635 -0.00076241 -0.000774453 -0.000795366 -0.000825521 -0.000864915 -0.000913176 -0.00096962 -0.00103333 -0.00110337 -0.00117891 -0.00125932 -0.00134411 -0.00143286 -0.00152516 -0.00162308 -0.00173431 -0.00185638 -0.00197297 -0.00208254 -0.00218037 -0.00225586 -0.00231104 -0.00234992 -0.00237683 -0.00239481 -0.00240779 -0.00241997 -0.00243453 -0.00245361 -0.00247827 -0.00250857 -0.00254393 -0.00258356 -0.0026269 -0.00267386 -0.00272488 -0.00278073 -0.00284217 -0.00290949 -0.00298219 -0.00305871 -0.00313632 -0.00321128 -0.00327915 -0.00333528 -0.00337538 -0.00339698 -0.00340308 -0.000673863 -0.000666808 -0.000666065 -0.000672365 -0.00068627 -0.000708163 -0.000738182 -0.000776225 -0.000822018 -0.000875157 -0.000935202 -0.00100174 -0.00107439 -0.00115287 -0.00123692 -0.0013262 -0.00142096 -0.00152267 -0.00162801 -0.00172824 -0.00182038 -0.001901 -0.00196544 -0.00201413 -0.00205005 -0.00207654 -0.00209628 -0.00211211 -0.00212658 -0.00214143 -0.0021577 -0.00217587 -0.00219607 -0.00221844 -0.00224343 -0.00227198 -0.0023055 -0.0023457 -0.00239419 -0.00245201 -0.00251929 -0.00259493 -0.00267649 -0.00276027 -0.00284156 -0.00291512 -0.00297572 -0.00301875 -0.00304182 -0.00304845 -0.000584498 -0.000575532 -0.000571617 -0.000573372 -0.000581324 -0.000595871 -0.000617278 -0.000645679 -0.000681129 -0.000723593 -0.000772949 -0.000829007 -0.000891472 -0.000960013 -0.00103441 -0.00111461 -0.00120014 -0.0012899 -0.00138071 -0.0014675 -0.00154741 -0.00161801 -0.0016772 -0.00172511 -0.00176328 -0.00179369 -0.00181796 -0.00183758 -0.00185364 -0.00186687 -0.00187779 -0.00188694 -0.00189506 -0.00190335 -0.00191356 -0.00192796 -0.00194911 -0.00197951 -0.0020211 -0.00207491 -0.00214066 -0.00221664 -0.0022997 -0.00238547 -0.00246868 -0.00254373 -0.00260521 -0.00264855 -0.00267159 -0.00267819 -0.000498171 -0.000488781 -0.000483042 -0.000481396 -0.000484272 -0.000492053 -0.000505103 -0.000523754 -0.000548307 -0.000578999 -0.00061594 -0.000659123 -0.000708403 -0.000763562 -0.000824597 -0.000892187 -0.000965906 -0.00104368 -0.00112268 -0.00119953 -0.00127185 -0.00133778 -0.00139598 -0.00144614 -0.00148856 -0.00152382 -0.00155233 -0.00157438 -0.00159013 -0.00159982 -0.00160395 -0.00160348 -0.00159996 -0.00159561 -0.00159322 -0.00159597 -0.00160704 -0.00162922 -0.00166446 -0.00171349 -0.0017756 -0.0018486 -0.00192893 -0.00201193 -0.00209225 -0.00216437 -0.00222303 -0.00226409 -0.00228567 -0.0022918 -0.000417012 -0.000408033 -0.000401209 -0.000396779 -0.000395057 -0.000396414 -0.0004013 -0.000410195 -0.000423588 -0.000441931 -0.000465546 -0.000494591 -0.000529047 -0.000568866 -0.000614467 -0.000668285 -0.000730292 -0.000797366 -0.000866866 -0.000936169 -0.00100323 -0.00106639 -0.00112433 -0.00117619 -0.00122131 -0.00125919 -0.00128933 -0.00131127 -0.00132474 -0.00132991 -0.00132752 -0.00131904 -0.00130666 -0.00129327 -0.0012822 -0.00127697 -0.00128089 -0.00129662 -0.00132581 -0.00136885 -0.00142471 -0.00149095 -0.00156398 -0.00163928 -0.00171185 -0.00177668 -0.00182913 -0.00186549 -0.00188438 -0.0018897 -0.00033881 -0.000330575 -0.000323089 -0.000316441 -0.000310866 -0.00030673 -0.000304535 -0.000304866 -0.000308341 -0.000315555 -0.000326961 -0.000342761 -0.00036282 -0.000386822 -0.000415321 -0.000454841 -0.000506631 -0.000564476 -0.000625457 -0.000687342 -0.000748369 -0.000806992 -0.000861818 -0.000911606 -0.000955197 -0.000991534 -0.00101968 -0.00103891 -0.00104892 -0.00104999 -0.00104311 -0.00103003 -0.00101321 -0.000995653 -0.000980674 -0.000971571 -0.000971294 -0.000982087 -0.0010052 -0.00104068 -0.00108737 -0.00114294 -0.00120414 -0.00126705 -0.00132742 -0.00138106 -0.00142419 -0.00145384 -0.00146917 -0.00147353 -0.000256865 -0.000249888 -0.000242598 -0.000235019 -0.000227338 -0.000219904 -0.000213224 -0.000207924 -0.000204656 -0.000204019 -0.000206435 -0.000211937 -0.000219582 -0.000226933 -0.000232738 -0.000254917 -0.000300759 -0.00035184 -0.000404402 -0.000457227 -0.00050923 -0.0005592 -0.000605953 -0.000648329 -0.000685189 -0.000715474 -0.000738285 -0.000753003 -0.00075945 -0.000758025 -0.000749771 -0.000736365 -0.000720016 -0.000703301 -0.000688951 -0.000679598 -0.000677509 -0.000684319 -0.000700836 -0.000726934 -0.000761554 -0.000802813 -0.000848168 -0.000894635 -0.000939041 -0.000978296 -0.00100967 -0.0010311 -0.00104223 -0.00104567 -0.000167779 -0.000163055 -0.000157439 -0.000150942 -0.000143723 -0.000136094 -0.000128508 -0.000121517 -0.000115683 -0.000111468 -0.000109122 -0.000108309 -0.000106324 -9.45146e-05 -6.19514e-05 -5.78797e-05 -0.000109335 -0.000158528 -0.000202673 -0.000244088 -0.000283306 -0.000319936 -0.000353466 -0.000383327 -0.000408896 -0.000429557 -0.000444793 -0.000454286 -0.00045803 -0.000456412 -0.000450235 -0.000440684 -0.000429247 -0.000417605 -0.000407494 -0.000400553 -0.000398152 -0.000401244 -0.000410254 -0.000425038 -0.000444907 -0.000468696 -0.000494869 -0.000521647 -0.000547156 -0.000569585 -0.000587364 -0.000599281 -0.000605535 -0.000609582 -8.85839e-05 -8.65979e-05 -8.34128e-05 -7.9057e-05 -7.36677e-05 -6.74862e-05 -6.08397e-05 -5.41087e-05 -4.76592e-05 -4.17342e-05 -3.62707e-05 -3.04571e-05 -2.04512e-05 7.47923e-06 8.52168e-05 7.91536e-05 2.19493e-05 -1.6809e-05 -4.46625e-05 -6.76663e-05 -8.76974e-05 -0.000105217 -0.00012045 -0.000133494 -0.000144337 -0.000152905 -0.000159121 -0.000162957 -0.000164488 -0.000163917 -0.000161576 -0.000157919 -0.000153487 -0.000148878 -0.0001447 -0.00014152 -0.000139807 -0.000139881 -0.000141887 -0.000145781 -0.000151345 -0.000158207 -0.000165872 -0.000173764 -0.000181276 -0.000187819 -0.000192879 -0.000196016 -0.000197465 -0.000199519 ) ; boundaryField { leftWall { type fixedFluxPressure; gradient uniform 0; value nonuniform List<scalar> 100 ( -0.00811346 -0.00811467 -0.00811312 -0.00810799 -0.00809759 -0.0080807 -0.00805584 -0.00802147 -0.00797606 -0.00791816 -0.00784657 -0.00776056 -0.00766009 -0.00754513 -0.00741661 -0.00727602 -0.00712543 -0.00696735 -0.00680466 -0.00664038 -0.00647747 -0.00631865 -0.00616615 -0.00602159 -0.0058858 -0.00575883 -0.00563986 -0.00552736 -0.0054192 -0.00531283 -0.00520561 -0.00509503 -0.00497878 -0.00485528 -0.00472349 -0.00458313 -0.00443462 -0.00427905 -0.00411805 -0.00395368 -0.00378817 -0.00362384 -0.00346289 -0.00330726 -0.00315858 -0.00301806 -0.0028865 -0.00276428 -0.00265137 -0.00254742 -0.00245183 -0.0023638 -0.00228239 -0.00220661 -0.00213542 -0.00206781 -0.00200279 -0.0019394 -0.00187677 -0.00181411 -0.00175073 -0.00168608 -0.00161975 -0.00155148 -0.0014812 -0.00140898 -0.00133498 -0.00125942 -0.0011828 -0.00110549 -0.00102804 -0.000951087 -0.000875251 -0.000800964 -0.000728428 -0.000657539 -0.00058813 -0.000519949 -0.000452643 -0.000385525 -0.000317515 -0.000247288 -0.000173808 -9.69179e-05 -1.76718e-05 6.1799e-05 0.000138669 0.000209983 0.000273016 0.0003254 0.000365288 0.000391368 0.000402859 0.000399268 0.000380337 0.000345724 0.000295249 0.000228597 0.000146932 5.20809e-05 ) ; } rightWall { type fixedFluxPressure; gradient uniform 0; value nonuniform List<scalar> 100 ( -0.0222687 -0.0222463 -0.0222034 -0.022139 -0.0220561 -0.0219597 -0.0218563 -0.0217534 -0.0216567 -0.0215694 -0.021491 -0.0214179 -0.0213455 -0.0212699 -0.0211899 -0.0211067 -0.0210233 -0.0209427 -0.0208671 -0.020797 -0.0207321 -0.0206708 -0.0206111 -0.0205507 -0.0204877 -0.0204205 -0.020349 -0.0202738 -0.0201967 -0.0201193 -0.0200433 -0.0199695 -0.0198981 -0.0198285 -0.0197597 -0.019691 -0.0196214 -0.0195501 -0.0194762 -0.0193985 -0.0193157 -0.0192264 -0.019129 -0.0190218 -0.0189033 -0.0187718 -0.0186256 -0.0184633 -0.0182835 -0.0180851 -0.0178673 -0.0176297 -0.0173722 -0.0170954 -0.0168 -0.0164872 -0.0161587 -0.0158164 -0.0154625 -0.0150991 -0.0147284 -0.0143525 -0.0139729 -0.0135912 -0.0132083 -0.0128246 -0.0124403 -0.0120552 -0.0116688 -0.0112807 -0.0108903 -0.0104976 -0.0101026 -0.00970583 -0.00930835 -0.00891152 -0.0085171 -0.00812705 -0.0077434 -0.00736801 -0.00700236 -0.00664742 -0.00630344 -0.00596996 -0.0056457 -0.00532864 -0.00501607 -0.00470478 -0.00439125 -0.00407194 -0.00374351 -0.00340308 -0.00304845 -0.00267819 -0.0022918 -0.0018897 -0.00147353 -0.00104567 -0.000609582 -0.000199519 ) ; } lowerWall { type fixedFluxPressure; gradient uniform 0; value nonuniform List<scalar> 100 ( -0.00811346 -0.00811178 -0.00811199 -0.00811434 -0.00811918 -0.00812669 -0.00813694 -0.00815001 -0.00816603 -0.00818519 -0.00820776 -0.0082341 -0.00826469 -0.00830015 -0.00834121 -0.00838868 -0.00844348 -0.00850662 -0.00857912 -0.00866202 -0.00875629 -0.00886278 -0.0089822 -0.00911499 -0.0092614 -0.00942137 -0.00959459 -0.00978046 -0.00997811 -0.0101864 -0.010404 -0.0106293 -0.0108606 -0.011096 -0.011334 -0.0115727 -0.0118106 -0.0120464 -0.0122792 -0.0125081 -0.0127326 -0.0129524 -0.0131673 -0.0133775 -0.0135833 -0.013785 -0.0139832 -0.0141784 -0.0143714 -0.0145625 -0.0147524 -0.0149414 -0.0151301 -0.0153186 -0.0155073 -0.0156962 -0.0158854 -0.0160749 -0.0162648 -0.0164549 -0.0166452 -0.0168355 -0.0170258 -0.0172159 -0.017406 -0.017596 -0.0177859 -0.0179758 -0.018166 -0.0183569 -0.0185487 -0.0187418 -0.0189364 -0.0191327 -0.0193308 -0.0195304 -0.0197304 -0.0199293 -0.0201251 -0.0203154 -0.0204977 -0.0206699 -0.0208301 -0.0209773 -0.021111 -0.0212315 -0.02134 -0.0214384 -0.0215294 -0.0216162 -0.0217019 -0.0217884 -0.0218764 -0.0219643 -0.022049 -0.0221256 -0.0221896 -0.0222361 -0.022262 -0.0222687 ) ; } atmosphere { type totalPressure; rho rho; psi none; gamma 1; p0 uniform 0; value nonuniform List<scalar> 100 ( 0 0 0 0 -5.85097e-11 -7.75495e-09 -2.80956e-08 -5.45075e-08 -7.90273e-08 -9.62549e-08 -1.01874e-07 -9.27657e-08 -6.97092e-08 -3.94706e-08 -1.29353e-08 -3.22557e-10 0 0 0 0 0 0 0 0 0 0 0 0 0 -1.34747e-08 -1.15278e-07 -3.60799e-07 -8.06351e-07 -1.51483e-06 -2.55541e-06 -3.99903e-06 -5.91126e-06 -8.34595e-06 -1.13395e-05 -1.49034e-05 -1.90149e-05 -2.3612e-05 -2.85905e-05 -3.38032e-05 -3.90619e-05 -4.41464e-05 -4.88166e-05 -5.28269e-05 -5.5942e-05 -5.79562e-05 -5.87105e-05 -5.81074e-05 -5.61215e-05 -5.28056e-05 -4.82917e-05 -4.27859e-05 -3.65578e-05 -2.99258e-05 -2.32378e-05 -1.68518e-05 -1.11145e-05 -6.34302e-06 -2.80497e-06 -6.94715e-07 -4.77965e-09 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ) ; } defaultFaces { type empty; } } // ************************************************************************* //
[ "stig.m.nilsen@gmail.com" ]
stig.m.nilsen@gmail.com
47e3d630717480f06e8f800356c60cdabd6604c3
679c7f96c27bc17ba3ce7176e3019ca99038acbb
/CvGameCoreDLL/CvMapInterfaceBase.h
3515d80bfe186cc4906c8071b2804bfb876d1a39
[]
no_license
f1rpo/RoM-AND
61e3541940f09b2b9c3c6d4302f1338d9a86b1bc
5077b32403fad41240ce3f9f9dc3bb475eb454b0
refs/heads/master
2021-07-18T05:36:58.298487
2021-02-06T14:56:22
2021-02-06T15:04:03
237,295,618
0
2
null
null
null
null
UTF-8
C++
false
false
6,079
h
#pragma once #ifndef CIV4_MAP_INTERFACE_BASE_H #define CIV4_MAP_INTERFACE_BASE_H // // FILE: CvMapInterfaceBase.h // AUTHOR: Soren Johnson // PURPOSE: Game map class //----------------------------------------------------------------------------- // Copyright (c) 2004 Firaxis Games, Inc. All rights reserved. //----------------------------------------------------------------------------- // #include "CvArea.h" #include "CvPlot.h" class FAStar; class CvPlotGroup; // // holds initialization info // struct CvMapInitData { int m_iGridW; // in game plots int m_iGridH; // in game plots int m_iTopLatitude; int m_iBottomLatitude; bool m_bWrapX; bool m_bWrapY; CvMapInitData(int iGridW=0, int iGridH=0, int iTopLatitude=90, int iBottomLatitude=-90, bool bWrapX=false, bool bWrapY=false) : m_iGridH(iGridH),m_iGridW(iGridW),m_iTopLatitude(iTopLatitude),m_iBottomLatitude(iBottomLatitude),m_bWrapY(bWrapY),m_bWrapX(bWrapX) { } }; // // CvMapInterfaceBase // class CvMapExternal; class CvMapInterfaceBase { public: CvMapInterfaceBase(); virtual ~CvMapInterfaceBase(); CvMapExternal* getProxy(); virtual CvMapInterfaceBase* getUnderlyingMap() const = 0; virtual void init(CvMapInitData* pInitData=NULL) = 0; virtual void setupGraphical() = 0; virtual void reset(CvMapInitData* pInitData) = 0; public: /*********************************/ /***** Parallel Maps - Begin *****/ /*********************************/ virtual MapTypes getType() const = 0; virtual void setType(MapTypes eNewType) = 0; virtual void beforeSwitch() = 0; virtual void afterSwitch() = 0; /*******************************/ /***** Parallel Maps - End *****/ /*******************************/ virtual void erasePlots() = 0; // Exposed to Python virtual void setRevealedPlots(TeamTypes eTeam, bool bNewValue, bool bTerrainOnly = false) = 0; // Exposed to Python virtual void setAllPlotTypes(PlotTypes ePlotType) = 0; // Exposed to Python virtual void doTurn() = 0; virtual void updateFlagSymbols() = 0; virtual void updateFog() = 0; virtual void updateVisibility() = 0; // Exposed to Python virtual void updateSymbolVisibility() = 0; virtual void updateSymbols() = 0; virtual void updateMinimapColor() = 0; // Exposed to Python virtual void updateSight(bool bIncrement, bool bUpdatePlotGroups = true) = 0; virtual void updateIrrigated() = 0; virtual void updateCenterUnit() = 0; virtual void updateWorkingCity() = 0; virtual void updateMinOriginalStartDist(CvArea* pArea) = 0; // Exposed to Python virtual void updateYield() = 0; virtual void verifyUnitValidPlot() = 0; virtual CvPlot* syncRandPlot(int iFlags = 0, int iArea = -1, int iMinUnitDistance = -1, int iTimeout = 100) = 0;// Exposed to Python virtual CvCity* findCity(int iX, int iY, PlayerTypes eOwner = NO_PLAYER, TeamTypes eTeam = NO_TEAM, bool bSameArea = true, bool bCoastalOnly = false, TeamTypes eTeamAtWarWith = NO_TEAM, DirectionTypes eDirection = NO_DIRECTION, CvCity* pSkipCity = NULL) = 0; // Exposed to Python virtual CvSelectionGroup* findSelectionGroup(int iX, int iY, PlayerTypes eOwner = NO_PLAYER, bool bReadyToSelect = false, bool bWorkers = false) = 0; // Exposed to Python virtual CvArea* findBiggestArea(bool bWater) = 0; // Exposed to Python virtual int getMapFractalFlags() = 0; // Exposed to Python virtual bool findWater(CvPlot* pPlot, int iRange, bool bFreshWater) = 0; // Exposed to Python virtual bool isPlot(int iX, int iY) const = 0; // Exposed to Python virtual int numPlots() const = 0; // Exposed to Python virtual int plotNum(int iX, int iY) const = 0; // Exposed to Python virtual int plotX(int iIndex) const = 0; // Exposed to Python virtual int plotY(int iIndex) const = 0; // Exposed to Python virtual int pointXToPlotX(float fX) = 0; virtual float plotXToPointX(int iX) = 0; virtual int pointYToPlotY(float fY) = 0; virtual float plotYToPointY(int iY) = 0; virtual float getWidthCoords() = 0; virtual float getHeightCoords() = 0; virtual int maxPlotDistance() = 0; // Exposed to Python virtual int maxStepDistance() = 0; // Exposed to Python virtual int getGridWidth() const = 0; // Exposed to Python virtual int getGridHeight() const = 0; // Exposed to Python virtual int getLandPlots() = 0; // Exposed to Python virtual int getOwnedPlots() = 0; // Exposed to Python virtual int getTopLatitude() = 0; // Exposed to Python virtual int getBottomLatitude() = 0; // Exposed to Python virtual bool isWrapX() const = 0; // Exposed to Python virtual bool isWrapY() const = 0; // Exposed to Python virtual bool isWrap() const = 0; virtual WorldSizeTypes getWorldSize() = 0; // Exposed to Python virtual ClimateTypes getClimate() = 0; // Exposed to Python virtual SeaLevelTypes getSeaLevel() = 0; // Exposed to Python virtual int getNumCustomMapOptions() = 0; virtual CustomMapOptionTypes getCustomMapOption(int iOption) = 0; // Exposed to Python virtual CvPlot* plotByIndex(int iIndex) const = 0; // Exposed to Python virtual CvPlot* plot(int iX, int iY) const = 0; // Exposed to Python virtual CvPlot* pointToPlot(float fX, float fY) = 0; virtual int getNumAreas() = 0; // Exposed to Python virtual int getNumLandAreas() = 0; // Serialization: virtual void read(FDataStreamBase* pStream) = 0; virtual void write(FDataStreamBase* pStream) = 0; private: CvMapExternal* m_proxy; }; #endif
[ "no.m@il.specified" ]
no.m@il.specified
1f9ad25155bf721021a27a59590648160e9170a5
cd651073ca32d65bc76049d31106f6d373ff730d
/0627/Circle.cc
5c128f10d5fcaf718fd33309f503973f32fb89f1
[]
no_license
jnn1991/study-cpp
6eabf0a4912a77d2e22f78d185f6a838d2bbd466
1c035c595b371695400bc2aad7d98a8122e1073f
refs/heads/master
2020-06-11T21:12:49.962207
2019-07-24T15:49:38
2019-07-24T15:49:38
194,086,260
0
0
null
null
null
null
UTF-8
C++
false
false
870
cc
#include <iostream> using std::cout; using std::endl; #define PI 3.14159 class Circle { public: Circle() :_radius(0) {} Circle(double r) :_radius(r) {} double getArea() { return PI*_radius*_radius; } double getPerimeter() { return 2*PI*_radius; } void show() { cout << "半径:" << _radius << endl << "周长:" << getPerimeter() << endl << "面积:" << getArea() << endl; } private: double _radius; } class Cylinder :public Circle { public: Cylinder (double r, double h) :Circle(r) ,_high(h) {} double getVolume() { return getArea()*_high; } void showVolume() { cout <<"圆柱体体积:" << getVolume() << endl; } private: double _high; } int main(void) { return 0; }
[ "304342171@qq.com" ]
304342171@qq.com
43cf5753e96561059df1af7f9c2911ecf6ce3172
7fb149b31b9321fc14396dad040fabf7e6e6eb52
/build/tmp/expandedArchives/netcomm-2019.12.1-headers.zip_97d07b8af9f28e0504c6dc239ac1f176/FRC_NetworkCommunication/UsageReporting.h
43970805995c1464db2348188f4d86f57abcebd9
[ "BSD-3-Clause" ]
permissive
FRCTeam5458DigitalMinds/Axon
4feb4e7cc1a50d93d77c204dbf6cca863850ba3f
af571142de3f9d6589252c89537210015a1a26a0
refs/heads/master
2020-04-18T20:14:50.004225
2019-10-30T03:05:29
2019-10-30T03:05:29
167,732,922
3
0
BSD-3-Clause
2019-03-11T01:25:14
2019-01-26T20:00:28
C++
UTF-8
C++
false
false
5,936
h
#ifndef __UsageReporting_h__ #define __UsageReporting_h__ #ifdef _WIN32 #include <stdint.h> #define EXPORT_FUNC __declspec(dllexport) __cdecl #elif defined (__vxworks) #include <vxWorks.h> #define EXPORT_FUNC #else #include <stdint.h> #include <stdlib.h> #define EXPORT_FUNC #endif #define kUsageReporting_version 1 namespace nUsageReporting { typedef enum { kResourceType_Controller, kResourceType_Module, kResourceType_Language, kResourceType_CANPlugin, kResourceType_Accelerometer, kResourceType_ADXL345, kResourceType_AnalogChannel, kResourceType_AnalogTrigger, kResourceType_AnalogTriggerOutput, kResourceType_CANJaguar, kResourceType_Compressor, // 10 kResourceType_Counter, kResourceType_Dashboard, kResourceType_DigitalInput, kResourceType_DigitalOutput, kResourceType_DriverStationCIO, kResourceType_DriverStationEIO, kResourceType_DriverStationLCD, kResourceType_Encoder, kResourceType_GearTooth, kResourceType_Gyro, // 20 kResourceType_I2C, kResourceType_Framework, kResourceType_Jaguar, kResourceType_Joystick, kResourceType_Kinect, kResourceType_KinectStick, kResourceType_PIDController, kResourceType_Preferences, kResourceType_PWM, kResourceType_Relay, // 30 kResourceType_RobotDrive, kResourceType_SerialPort, kResourceType_Servo, kResourceType_Solenoid, kResourceType_SPI, kResourceType_Task, kResourceType_Ultrasonic, kResourceType_Victor, kResourceType_Button, kResourceType_Command, // 40 kResourceType_AxisCamera, kResourceType_PCVideoServer, kResourceType_SmartDashboard, kResourceType_Talon, kResourceType_HiTechnicColorSensor, kResourceType_HiTechnicAccel, kResourceType_HiTechnicCompass, kResourceType_SRF08, kResourceType_AnalogOutput, kResourceType_VictorSP, // 50 kResourceType_PWMTalonSRX, kResourceType_CANTalonSRX, kResourceType_ADXL362, kResourceType_ADXRS450, kResourceType_RevSPARK, kResourceType_MindsensorsSD540, kResourceType_DigitalGlitchFilter, kResourceType_ADIS16448, kResourceType_PDP, kResourceType_PCM, // 60 kResourceType_PigeonIMU, kResourceType_NidecBrushless, kResourceType_CANifier, kResourceType_CTRE_future0, kResourceType_CTRE_future1, kResourceType_CTRE_future2, kResourceType_CTRE_future3, kResourceType_CTRE_future4, kResourceType_CTRE_future5, kResourceType_CTRE_future6, // 70 kResourceType_LinearFilter, kResourceType_XboxController, kResourceType_UsbCamera, kResourceType_NavX, kResourceType_Pixy, kResourceType_Pixy2, kResourceType_ScanseSweep, kResourceType_Shuffleboard, kResourceType_CAN, kResourceType_DigilentDMC60, // 80 kResourceType_PWMVictorSPX, kResourceType_RevSparkMaxPWM, kResourceType_RevSparkMaxCAN, kResourceType_ADIS16470, } tResourceType; typedef enum { kLanguage_LabVIEW = 1, kLanguage_CPlusPlus = 2, kLanguage_Java = 3, kLanguage_Python = 4, kLanguage_DotNet = 5, kCANPlugin_BlackJagBridge = 1, kCANPlugin_2CAN = 2, kFramework_Iterative = 1, kFramework_Simple = 2, kFramework_CommandControl = 3, kFramework_Timed = 4, kFramework_ROS = 5, kFramework_RobotBuilder = 6, kRobotDrive_ArcadeStandard = 1, kRobotDrive_ArcadeButtonSpin = 2, kRobotDrive_ArcadeRatioCurve = 3, kRobotDrive_Tank = 4, kRobotDrive_MecanumPolar = 5, kRobotDrive_MecanumCartesian = 6, kRobotDrive2_DifferentialArcade = 7, kRobotDrive2_DifferentialTank = 8, kRobotDrive2_DifferentialCurvature = 9, kRobotDrive2_MecanumCartesian = 10, kRobotDrive2_MecanumPolar = 11, kRobotDrive2_KilloughCartesian = 12, kRobotDrive2_KilloughPolar = 13, kDriverStationCIO_Analog = 1, kDriverStationCIO_DigitalIn = 2, kDriverStationCIO_DigitalOut = 3, kDriverStationEIO_Acceleration = 1, kDriverStationEIO_AnalogIn = 2, kDriverStationEIO_AnalogOut = 3, kDriverStationEIO_Button = 4, kDriverStationEIO_LED = 5, kDriverStationEIO_DigitalIn = 6, kDriverStationEIO_DigitalOut = 7, kDriverStationEIO_FixedDigitalOut = 8, kDriverStationEIO_PWM = 9, kDriverStationEIO_Encoder = 10, kDriverStationEIO_TouchSlider = 11, kADXL345_SPI = 1, kADXL345_I2C = 2, kCommand_Scheduler = 1, kSmartDashboard_Instance = 1, } tInstances; /** * Report the usage of a resource of interest. * * @param resource one of the values in the tResourceType above (max value 51). * @param instanceNumber an index that identifies the resource instance. * @param context an optional additional context number for some cases (such as module number). Set to 0 to omit. * @param feature a string to be included describing features in use on a specific resource. Setting the same resource more than once allows you to change the feature string. */ uint32_t EXPORT_FUNC report(tResourceType resource, uint8_t instanceNumber, uint8_t context = 0, const char *feature = NULL); } #ifdef __cplusplus extern "C" { #endif uint32_t EXPORT_FUNC FRC_NetworkCommunication_nUsageReporting_report(uint8_t resource, uint8_t instanceNumber, uint8_t context, const char *feature); #ifdef __cplusplus } #endif #endif // __UsageReporting_h__
[ "maximo43873@gmail.com" ]
maximo43873@gmail.com
5caafb2c676de5a939b4ea952b977947de99afc8
5df1a677af9379c9a82f1b29359a65ad8cbc385e
/CodeForces/PastContest/1552/B.cpp
bd54837320fe3c3e4d6dc9f8e819e0f3ae16ad5c
[]
no_license
heyshb/Competitive-Programming
92741a4e7234e1ebce685c1b870f1287bee18f1a
363ef78d950afb53f0e5f1d2329f27dd7b9a44c2
refs/heads/master
2021-12-15T03:12:37.676111
2021-12-01T14:32:25
2021-12-01T14:32:25
122,315,094
1
0
null
null
null
null
UTF-8
C++
false
false
814
cpp
#include <bits/stdc++.h> using namespace std; typedef long long LL; typedef pair<int,int> pii; int n; int a[100100][5]; bool better(int x, int y) { int cnt = 0; for (int i = 0; i < 5; i++) { if (a[x][i] < a[y][i]) cnt++; } return cnt >= 3; } int main() { int T; scanf("%d",&T); while(T--) { scanf("%d",&n); for (int i = 1; i <= n; i++) { for (int j = 0; j < 5; j++) { scanf("%d",&a[i][j]); } } int best = 1; for (int i = 2; i <= n; i++) { if (better(i, best)) best = i; } int ans = best; for (int i = 1; i <= n; i++) { if (i != best && !better(best, i)) { ans = -1; } } printf("%d\n",ans); } }
[ "heyshb123@gmail.com" ]
heyshb123@gmail.com
c9659c8ac5400773097417338c0e729f4a614a1f
396124da20ba58266abb81e40cd335bf7198dac2
/example_hls/solution1/syn/systemc/FIFO_example_Block_codeRepl951_proc_merger_network_0_V_last_V.h
9c8805a7e8636cb1d5e0be8a71d2b290f365eb4b
[]
no_license
Ahrfry/vasado
d6d2f4824f674a845b916b5188b3347b644ccbde
a3bec59220d4a807eeaae831317e446cb08b76ac
refs/heads/master
2020-08-26T17:59:29.867336
2019-10-23T15:48:25
2019-10-23T15:48:25
153,848,350
0
0
null
null
null
null
UTF-8
C++
false
false
6,343
h
// ============================================================== // File generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC // Version: 2016.2 // Copyright (C) 1986-2016 Xilinx, Inc. All Rights Reserved. // // ============================================================== #ifndef FIFO_example_Block_codeRepl951_proc_merger_network_0_V_last_V_HH_ #define FIFO_example_Block_codeRepl951_proc_merger_network_0_V_last_V_HH_ #include <systemc> using namespace std; SC_MODULE(FIFO_example_Block_codeRepl951_proc_merger_network_0_V_last_V) { static const unsigned int DATA_WIDTH = 1; static const unsigned int ADDR_WIDTH = 5; static const unsigned int FIFO_example_Block_codeRepl951_proc_merger_network_0_V_last_V_depth = 17; sc_core::sc_in_clk clk; sc_core::sc_in< sc_dt::sc_logic > reset; sc_core::sc_out< sc_dt::sc_logic > if_empty_n; sc_core::sc_in< sc_dt::sc_logic > if_read_ce; sc_core::sc_in< sc_dt::sc_logic > if_read; sc_core::sc_out< sc_dt::sc_lv<DATA_WIDTH> > if_dout; sc_core::sc_out< sc_dt::sc_logic > if_full_n; sc_core::sc_in< sc_dt::sc_logic > if_write_ce; sc_core::sc_in< sc_dt::sc_logic > if_write; sc_core::sc_in< sc_dt::sc_lv<DATA_WIDTH> > if_din; sc_core::sc_signal< sc_dt::sc_logic > internal_empty_n; sc_core::sc_signal< sc_dt::sc_logic > internal_full_n; sc_core::sc_signal< sc_dt::sc_lv<DATA_WIDTH> > mStorage[FIFO_example_Block_codeRepl951_proc_merger_network_0_V_last_V_depth]; sc_core::sc_signal< sc_dt::sc_uint<ADDR_WIDTH> > mInPtr; sc_core::sc_signal< sc_dt::sc_uint<ADDR_WIDTH> > mOutPtr; sc_core::sc_signal< sc_dt::sc_uint<1> > mFlag_nEF_hint; sc_core::sc_trace_file* mTrace; SC_CTOR(FIFO_example_Block_codeRepl951_proc_merger_network_0_V_last_V) : mTrace(0) { const char* dump_vcd = std::getenv("AP_WRITE_VCD"); if (dump_vcd && string(dump_vcd) == "1") { std::string tracefn = "sc_trace_" + std::string(name()); mTrace = sc_core::sc_create_vcd_trace_file( tracefn.c_str()); sc_trace(mTrace, clk, "(port)clk"); sc_trace(mTrace, reset, "(port)reset"); sc_trace(mTrace, if_full_n, "(port)if_full_n"); sc_trace(mTrace, if_write_ce, "(port)if_write_ce"); sc_trace(mTrace, if_write, "(port)if_write"); sc_trace(mTrace, if_din, "(port)if_din"); sc_trace(mTrace, if_empty_n, "(port)if_empty_n"); sc_trace(mTrace, if_read_ce, "(port)if_read_ce"); sc_trace(mTrace, if_read, "(port)if_read"); sc_trace(mTrace, if_dout, "(port)if_dout"); sc_trace(mTrace, mInPtr, "mInPtr"); sc_trace(mTrace, mOutPtr, "mOutPtr"); sc_trace(mTrace, mFlag_nEF_hint, "mFlag_nEF_hint"); } mInPtr = 0; mOutPtr = 0; mFlag_nEF_hint = 0; SC_METHOD(proc_read_write); sensitive << clk.pos(); SC_METHOD(proc_dout); sensitive << mOutPtr; for (unsigned i = 0; i < FIFO_example_Block_codeRepl951_proc_merger_network_0_V_last_V_depth; i++) { sensitive << mStorage[i]; } SC_METHOD(proc_ptr); sensitive << mInPtr << mOutPtr<< mFlag_nEF_hint; SC_METHOD(proc_status); sensitive << internal_empty_n << internal_full_n; } ~FIFO_example_Block_codeRepl951_proc_merger_network_0_V_last_V() { if (mTrace) sc_core::sc_close_vcd_trace_file(mTrace); } void proc_status() { if_empty_n.write(internal_empty_n.read()); if_full_n.write(internal_full_n.read()); } void proc_read_write() { if (reset.read() == sc_dt::SC_LOGIC_1) { mInPtr.write(0); mOutPtr.write(0); mFlag_nEF_hint.write(0); } else { if (if_read_ce.read() == sc_dt::SC_LOGIC_1 && if_read.read() == sc_dt::SC_LOGIC_1 && internal_empty_n.read() == sc_dt::SC_LOGIC_1) { sc_dt::sc_uint<ADDR_WIDTH> ptr; if (mOutPtr.read().to_uint() == (FIFO_example_Block_codeRepl951_proc_merger_network_0_V_last_V_depth-1)) { ptr = 0; mFlag_nEF_hint.write(~mFlag_nEF_hint.read()); } else { ptr = mOutPtr.read(); ptr++; } assert(ptr.to_uint() < FIFO_example_Block_codeRepl951_proc_merger_network_0_V_last_V_depth); mOutPtr.write(ptr); } if (if_write_ce.read() == sc_dt::SC_LOGIC_1 && if_write.read() == sc_dt::SC_LOGIC_1 && internal_full_n.read() == sc_dt::SC_LOGIC_1) { sc_dt::sc_uint<ADDR_WIDTH> ptr; ptr = mInPtr.read(); mStorage[ptr.to_uint()].write(if_din.read()); if (ptr.to_uint() == (FIFO_example_Block_codeRepl951_proc_merger_network_0_V_last_V_depth-1)) { ptr = 0; mFlag_nEF_hint.write(~mFlag_nEF_hint.read()); } else { ptr++; assert(ptr.to_uint() < FIFO_example_Block_codeRepl951_proc_merger_network_0_V_last_V_depth); } mInPtr.write(ptr); } } } void proc_dout() { sc_dt::sc_uint<ADDR_WIDTH> ptr = mOutPtr.read(); if (ptr.to_uint() > FIFO_example_Block_codeRepl951_proc_merger_network_0_V_last_V_depth) { if_dout.write(sc_dt::sc_lv<DATA_WIDTH>()); } else { if_dout.write(mStorage[ptr.to_uint()]); } } void proc_ptr() { if (mInPtr.read() == mOutPtr.read() && mFlag_nEF_hint.read().to_uint()==0) { internal_empty_n.write(sc_dt::SC_LOGIC_0); } else { internal_empty_n.write(sc_dt::SC_LOGIC_1); } if (mInPtr.read() == mOutPtr.read() && mFlag_nEF_hint.read().to_uint()==1) { internal_full_n.write(sc_dt::SC_LOGIC_0); } else { internal_full_n.write(sc_dt::SC_LOGIC_1); } } }; #endif //FIFO_example_Block_codeRepl951_proc_merger_network_0_V_last_V_HH_
[ "frythelegend@gmail.com" ]
frythelegend@gmail.com
cd116d3b9e20b1014eb1247fa5d3960e1e2aa5c0
65bd8cffc08b19ffed14a991cbfd730a6f458e04
/Programs/Skeleton/Skeleton/parser_to_framework.cpp
000957b63db4aaab4f4ed7ebee39e711cd978b4c
[]
no_license
navima/graf13
c60da69ec1f725d318f10d12d8596bc5a4d2015a
7f3f7816886595c3baaf135bead2ff86522f329a
refs/heads/main
2023-01-22T02:26:12.079665
2020-11-22T13:52:37
2020-11-22T13:55:19
297,340,386
0
0
null
null
null
null
UTF-8
C++
false
false
35
cpp
#include "parser_to_framework.hpp"
[ "draco.109@gmail.com" ]
draco.109@gmail.com
61de6215dbb858fd1b7c3f24f9c3af5c34fa1fe4
337e351f12c583c6c86e6a8e7d6edeb0e0a43107
/C++/RecordingAudioSolution/winrt/Windows.UI.ViewManagement.h
30f0a69c16a9fe021e9f02d63ae7d10dd94bccf6
[]
no_license
dngoins/HololensDXTutorials
de7d3ba8f25f633557b98f51828ac73d671266a4
532907a7be6005e9f3483e26727324b3392c02f3
refs/heads/master
2020-04-02T06:11:29.362302
2018-10-27T21:16:03
2018-10-27T21:16:03
64,985,100
30
5
null
2016-10-01T00:17:51
2016-08-05T03:16:10
C++
UTF-8
C++
false
false
147,306
h
// C++/WinRT v1.0.171013.2 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "winrt/base.h" WINRT_WARNING_PUSH #include "winrt/Windows.Foundation.h" #include "winrt/Windows.Foundation.Collections.h" #include "winrt/impl/Windows.Devices.Enumeration.2.h" #include "winrt/impl/Windows.UI.2.h" #include "winrt/impl/Windows.UI.Core.2.h" #include "winrt/impl/Windows.UI.Popups.2.h" #include "winrt/impl/Windows.UI.ViewManagement.2.h" #include "winrt/Windows.UI.h" namespace winrt::impl { template <typename D> bool consume_Windows_UI_ViewManagement_IAccessibilitySettings<D>::HighContrast() const noexcept { bool value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IAccessibilitySettings)->get_HighContrast(&value)); return value; } template <typename D> hstring consume_Windows_UI_ViewManagement_IAccessibilitySettings<D>::HighContrastScheme() const noexcept { hstring value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IAccessibilitySettings)->get_HighContrastScheme(put_abi(value))); return value; } template <typename D> event_token consume_Windows_UI_ViewManagement_IAccessibilitySettings<D>::HighContrastChanged(Windows::Foundation::TypedEventHandler<Windows::UI::ViewManagement::AccessibilitySettings, Windows::Foundation::IInspectable> const& handler) const { event_token cookie{}; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IAccessibilitySettings)->add_HighContrastChanged(get_abi(handler), put_abi(cookie))); return cookie; } template <typename D> event_revoker<Windows::UI::ViewManagement::IAccessibilitySettings> consume_Windows_UI_ViewManagement_IAccessibilitySettings<D>::HighContrastChanged(auto_revoke_t, Windows::Foundation::TypedEventHandler<Windows::UI::ViewManagement::AccessibilitySettings, Windows::Foundation::IInspectable> const& handler) const { return impl::make_event_revoker<D, Windows::UI::ViewManagement::IAccessibilitySettings>(this, &abi_t<Windows::UI::ViewManagement::IAccessibilitySettings>::remove_HighContrastChanged, HighContrastChanged(handler)); } template <typename D> void consume_Windows_UI_ViewManagement_IAccessibilitySettings<D>::HighContrastChanged(event_token const& cookie) const { check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IAccessibilitySettings)->remove_HighContrastChanged(get_abi(cookie))); } template <typename D> Windows::Foundation::IAsyncAction consume_Windows_UI_ViewManagement_IActivationViewSwitcher<D>::ShowAsStandaloneAsync(int32_t viewId) const { Windows::Foundation::IAsyncAction operation{ nullptr }; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IActivationViewSwitcher)->ShowAsStandaloneAsync(viewId, put_abi(operation))); return operation; } template <typename D> Windows::Foundation::IAsyncAction consume_Windows_UI_ViewManagement_IActivationViewSwitcher<D>::ShowAsStandaloneAsync(int32_t viewId, Windows::UI::ViewManagement::ViewSizePreference const& sizePreference) const { Windows::Foundation::IAsyncAction operation{ nullptr }; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IActivationViewSwitcher)->ShowAsStandaloneWithSizePreferenceAsync(viewId, get_abi(sizePreference), put_abi(operation))); return operation; } template <typename D> bool consume_Windows_UI_ViewManagement_IActivationViewSwitcher<D>::IsViewPresentedOnActivationVirtualDesktop(int32_t viewId) const { bool value{}; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IActivationViewSwitcher)->IsViewPresentedOnActivationVirtualDesktop(viewId, &value)); return value; } template <typename D> Windows::UI::ViewManagement::ApplicationViewOrientation consume_Windows_UI_ViewManagement_IApplicationView<D>::Orientation() const noexcept { Windows::UI::ViewManagement::ApplicationViewOrientation value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationView)->get_Orientation(put_abi(value))); return value; } template <typename D> bool consume_Windows_UI_ViewManagement_IApplicationView<D>::AdjacentToLeftDisplayEdge() const noexcept { bool value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationView)->get_AdjacentToLeftDisplayEdge(&value)); return value; } template <typename D> bool consume_Windows_UI_ViewManagement_IApplicationView<D>::AdjacentToRightDisplayEdge() const noexcept { bool value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationView)->get_AdjacentToRightDisplayEdge(&value)); return value; } template <typename D> bool consume_Windows_UI_ViewManagement_IApplicationView<D>::IsFullScreen() const noexcept { bool value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationView)->get_IsFullScreen(&value)); return value; } template <typename D> bool consume_Windows_UI_ViewManagement_IApplicationView<D>::IsOnLockScreen() const noexcept { bool value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationView)->get_IsOnLockScreen(&value)); return value; } template <typename D> bool consume_Windows_UI_ViewManagement_IApplicationView<D>::IsScreenCaptureEnabled() const noexcept { bool value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationView)->get_IsScreenCaptureEnabled(&value)); return value; } template <typename D> void consume_Windows_UI_ViewManagement_IApplicationView<D>::IsScreenCaptureEnabled(bool value) const noexcept { check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationView)->put_IsScreenCaptureEnabled(value)); } template <typename D> void consume_Windows_UI_ViewManagement_IApplicationView<D>::Title(param::hstring const& value) const noexcept { check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationView)->put_Title(get_abi(value))); } template <typename D> hstring consume_Windows_UI_ViewManagement_IApplicationView<D>::Title() const noexcept { hstring value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationView)->get_Title(put_abi(value))); return value; } template <typename D> int32_t consume_Windows_UI_ViewManagement_IApplicationView<D>::Id() const noexcept { int32_t value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationView)->get_Id(&value)); return value; } template <typename D> event_token consume_Windows_UI_ViewManagement_IApplicationView<D>::Consolidated(Windows::Foundation::TypedEventHandler<Windows::UI::ViewManagement::ApplicationView, Windows::UI::ViewManagement::ApplicationViewConsolidatedEventArgs> const& handler) const { event_token token{}; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationView)->add_Consolidated(get_abi(handler), put_abi(token))); return token; } template <typename D> event_revoker<Windows::UI::ViewManagement::IApplicationView> consume_Windows_UI_ViewManagement_IApplicationView<D>::Consolidated(auto_revoke_t, Windows::Foundation::TypedEventHandler<Windows::UI::ViewManagement::ApplicationView, Windows::UI::ViewManagement::ApplicationViewConsolidatedEventArgs> const& handler) const { return impl::make_event_revoker<D, Windows::UI::ViewManagement::IApplicationView>(this, &abi_t<Windows::UI::ViewManagement::IApplicationView>::remove_Consolidated, Consolidated(handler)); } template <typename D> void consume_Windows_UI_ViewManagement_IApplicationView<D>::Consolidated(event_token const& token) const { check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationView)->remove_Consolidated(get_abi(token))); } template <typename D> bool consume_Windows_UI_ViewManagement_IApplicationView2<D>::SuppressSystemOverlays() const noexcept { bool value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationView2)->get_SuppressSystemOverlays(&value)); return value; } template <typename D> void consume_Windows_UI_ViewManagement_IApplicationView2<D>::SuppressSystemOverlays(bool value) const noexcept { check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationView2)->put_SuppressSystemOverlays(value)); } template <typename D> Windows::Foundation::Rect consume_Windows_UI_ViewManagement_IApplicationView2<D>::VisibleBounds() const noexcept { Windows::Foundation::Rect value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationView2)->get_VisibleBounds(put_abi(value))); return value; } template <typename D> event_token consume_Windows_UI_ViewManagement_IApplicationView2<D>::VisibleBoundsChanged(Windows::Foundation::TypedEventHandler<Windows::UI::ViewManagement::ApplicationView, Windows::Foundation::IInspectable> const& handler) const { event_token token{}; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationView2)->add_VisibleBoundsChanged(get_abi(handler), put_abi(token))); return token; } template <typename D> event_revoker<Windows::UI::ViewManagement::IApplicationView2> consume_Windows_UI_ViewManagement_IApplicationView2<D>::VisibleBoundsChanged(auto_revoke_t, Windows::Foundation::TypedEventHandler<Windows::UI::ViewManagement::ApplicationView, Windows::Foundation::IInspectable> const& handler) const { return impl::make_event_revoker<D, Windows::UI::ViewManagement::IApplicationView2>(this, &abi_t<Windows::UI::ViewManagement::IApplicationView2>::remove_VisibleBoundsChanged, VisibleBoundsChanged(handler)); } template <typename D> void consume_Windows_UI_ViewManagement_IApplicationView2<D>::VisibleBoundsChanged(event_token const& token) const { check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationView2)->remove_VisibleBoundsChanged(get_abi(token))); } template <typename D> bool consume_Windows_UI_ViewManagement_IApplicationView2<D>::SetDesiredBoundsMode(Windows::UI::ViewManagement::ApplicationViewBoundsMode const& boundsMode) const { bool success{}; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationView2)->SetDesiredBoundsMode(get_abi(boundsMode), &success)); return success; } template <typename D> Windows::UI::ViewManagement::ApplicationViewBoundsMode consume_Windows_UI_ViewManagement_IApplicationView2<D>::DesiredBoundsMode() const noexcept { Windows::UI::ViewManagement::ApplicationViewBoundsMode value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationView2)->get_DesiredBoundsMode(put_abi(value))); return value; } template <typename D> Windows::UI::ViewManagement::ApplicationViewTitleBar consume_Windows_UI_ViewManagement_IApplicationView3<D>::TitleBar() const noexcept { Windows::UI::ViewManagement::ApplicationViewTitleBar value{ nullptr }; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationView3)->get_TitleBar(put_abi(value))); return value; } template <typename D> Windows::UI::ViewManagement::FullScreenSystemOverlayMode consume_Windows_UI_ViewManagement_IApplicationView3<D>::FullScreenSystemOverlayMode() const noexcept { Windows::UI::ViewManagement::FullScreenSystemOverlayMode value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationView3)->get_FullScreenSystemOverlayMode(put_abi(value))); return value; } template <typename D> void consume_Windows_UI_ViewManagement_IApplicationView3<D>::FullScreenSystemOverlayMode(Windows::UI::ViewManagement::FullScreenSystemOverlayMode const& value) const noexcept { check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationView3)->put_FullScreenSystemOverlayMode(get_abi(value))); } template <typename D> bool consume_Windows_UI_ViewManagement_IApplicationView3<D>::IsFullScreenMode() const noexcept { bool value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationView3)->get_IsFullScreenMode(&value)); return value; } template <typename D> bool consume_Windows_UI_ViewManagement_IApplicationView3<D>::TryEnterFullScreenMode() const { bool success{}; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationView3)->TryEnterFullScreenMode(&success)); return success; } template <typename D> void consume_Windows_UI_ViewManagement_IApplicationView3<D>::ExitFullScreenMode() const { check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationView3)->ExitFullScreenMode()); } template <typename D> void consume_Windows_UI_ViewManagement_IApplicationView3<D>::ShowStandardSystemOverlays() const { check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationView3)->ShowStandardSystemOverlays()); } template <typename D> bool consume_Windows_UI_ViewManagement_IApplicationView3<D>::TryResizeView(Windows::Foundation::Size const& value) const { bool success{}; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationView3)->TryResizeView(get_abi(value), &success)); return success; } template <typename D> void consume_Windows_UI_ViewManagement_IApplicationView3<D>::SetPreferredMinSize(Windows::Foundation::Size const& minSize) const { check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationView3)->SetPreferredMinSize(get_abi(minSize))); } template <typename D> Windows::UI::ViewManagement::ApplicationViewMode consume_Windows_UI_ViewManagement_IApplicationView4<D>::ViewMode() const noexcept { Windows::UI::ViewManagement::ApplicationViewMode value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationView4)->get_ViewMode(put_abi(value))); return value; } template <typename D> bool consume_Windows_UI_ViewManagement_IApplicationView4<D>::IsViewModeSupported(Windows::UI::ViewManagement::ApplicationViewMode const& viewMode) const { bool isViewModeSupported{}; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationView4)->IsViewModeSupported(get_abi(viewMode), &isViewModeSupported)); return isViewModeSupported; } template <typename D> Windows::Foundation::IAsyncOperation<bool> consume_Windows_UI_ViewManagement_IApplicationView4<D>::TryEnterViewModeAsync(Windows::UI::ViewManagement::ApplicationViewMode const& viewMode) const { Windows::Foundation::IAsyncOperation<bool> operation{ nullptr }; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationView4)->TryEnterViewModeAsync(get_abi(viewMode), put_abi(operation))); return operation; } template <typename D> Windows::Foundation::IAsyncOperation<bool> consume_Windows_UI_ViewManagement_IApplicationView4<D>::TryEnterViewModeAsync(Windows::UI::ViewManagement::ApplicationViewMode const& viewMode, Windows::UI::ViewManagement::ViewModePreferences const& viewModePreferences) const { Windows::Foundation::IAsyncOperation<bool> operation{ nullptr }; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationView4)->TryEnterViewModeWithPreferencesAsync(get_abi(viewMode), get_abi(viewModePreferences), put_abi(operation))); return operation; } template <typename D> Windows::Foundation::IAsyncOperation<bool> consume_Windows_UI_ViewManagement_IApplicationView4<D>::TryConsolidateAsync() const { Windows::Foundation::IAsyncOperation<bool> operation{ nullptr }; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationView4)->TryConsolidateAsync(put_abi(operation))); return operation; } template <typename D> bool consume_Windows_UI_ViewManagement_IApplicationViewConsolidatedEventArgs<D>::IsUserInitiated() const noexcept { bool value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewConsolidatedEventArgs)->get_IsUserInitiated(&value)); return value; } template <typename D> bool consume_Windows_UI_ViewManagement_IApplicationViewConsolidatedEventArgs2<D>::IsAppInitiated() const noexcept { bool value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewConsolidatedEventArgs2)->get_IsAppInitiated(&value)); return value; } template <typename D> bool consume_Windows_UI_ViewManagement_IApplicationViewFullscreenStatics<D>::TryUnsnapToFullscreen() const { bool success{}; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewFullscreenStatics)->TryUnsnapToFullscreen(&success)); return success; } template <typename D> int32_t consume_Windows_UI_ViewManagement_IApplicationViewInteropStatics<D>::GetApplicationViewIdForWindow(Windows::UI::Core::ICoreWindow const& window) const { int32_t id{}; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewInteropStatics)->GetApplicationViewIdForWindow(get_abi(window), &id)); return id; } template <typename D> bool consume_Windows_UI_ViewManagement_IApplicationViewScalingStatics<D>::DisableLayoutScaling() const noexcept { bool value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewScalingStatics)->get_DisableLayoutScaling(&value)); return value; } template <typename D> bool consume_Windows_UI_ViewManagement_IApplicationViewScalingStatics<D>::TrySetDisableLayoutScaling(bool disableLayoutScaling) const { bool success{}; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewScalingStatics)->TrySetDisableLayoutScaling(disableLayoutScaling, &success)); return success; } template <typename D> Windows::UI::ViewManagement::ApplicationViewState consume_Windows_UI_ViewManagement_IApplicationViewStatics<D>::Value() const noexcept { Windows::UI::ViewManagement::ApplicationViewState value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewStatics)->get_Value(put_abi(value))); return value; } template <typename D> bool consume_Windows_UI_ViewManagement_IApplicationViewStatics<D>::TryUnsnap() const { bool success{}; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewStatics)->TryUnsnap(&success)); return success; } template <typename D> Windows::UI::ViewManagement::ApplicationView consume_Windows_UI_ViewManagement_IApplicationViewStatics2<D>::GetForCurrentView() const { Windows::UI::ViewManagement::ApplicationView current{ nullptr }; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewStatics2)->GetForCurrentView(put_abi(current))); return current; } template <typename D> bool consume_Windows_UI_ViewManagement_IApplicationViewStatics2<D>::TerminateAppOnFinalViewClose() const noexcept { bool value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewStatics2)->get_TerminateAppOnFinalViewClose(&value)); return value; } template <typename D> void consume_Windows_UI_ViewManagement_IApplicationViewStatics2<D>::TerminateAppOnFinalViewClose(bool value) const noexcept { check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewStatics2)->put_TerminateAppOnFinalViewClose(value)); } template <typename D> Windows::UI::ViewManagement::ApplicationViewWindowingMode consume_Windows_UI_ViewManagement_IApplicationViewStatics3<D>::PreferredLaunchWindowingMode() const noexcept { Windows::UI::ViewManagement::ApplicationViewWindowingMode value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewStatics3)->get_PreferredLaunchWindowingMode(put_abi(value))); return value; } template <typename D> void consume_Windows_UI_ViewManagement_IApplicationViewStatics3<D>::PreferredLaunchWindowingMode(Windows::UI::ViewManagement::ApplicationViewWindowingMode const& value) const noexcept { check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewStatics3)->put_PreferredLaunchWindowingMode(get_abi(value))); } template <typename D> Windows::Foundation::Size consume_Windows_UI_ViewManagement_IApplicationViewStatics3<D>::PreferredLaunchViewSize() const noexcept { Windows::Foundation::Size value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewStatics3)->get_PreferredLaunchViewSize(put_abi(value))); return value; } template <typename D> void consume_Windows_UI_ViewManagement_IApplicationViewStatics3<D>::PreferredLaunchViewSize(Windows::Foundation::Size const& value) const noexcept { check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewStatics3)->put_PreferredLaunchViewSize(get_abi(value))); } template <typename D> void consume_Windows_UI_ViewManagement_IApplicationViewSwitcherStatics<D>::DisableShowingMainViewOnActivation() const { check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewSwitcherStatics)->DisableShowingMainViewOnActivation()); } template <typename D> Windows::Foundation::IAsyncOperation<bool> consume_Windows_UI_ViewManagement_IApplicationViewSwitcherStatics<D>::TryShowAsStandaloneAsync(int32_t viewId) const { Windows::Foundation::IAsyncOperation<bool> operation{ nullptr }; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewSwitcherStatics)->TryShowAsStandaloneAsync(viewId, put_abi(operation))); return operation; } template <typename D> Windows::Foundation::IAsyncOperation<bool> consume_Windows_UI_ViewManagement_IApplicationViewSwitcherStatics<D>::TryShowAsStandaloneAsync(int32_t viewId, Windows::UI::ViewManagement::ViewSizePreference const& sizePreference) const { Windows::Foundation::IAsyncOperation<bool> operation{ nullptr }; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewSwitcherStatics)->TryShowAsStandaloneWithSizePreferenceAsync(viewId, get_abi(sizePreference), put_abi(operation))); return operation; } template <typename D> Windows::Foundation::IAsyncOperation<bool> consume_Windows_UI_ViewManagement_IApplicationViewSwitcherStatics<D>::TryShowAsStandaloneAsync(int32_t viewId, Windows::UI::ViewManagement::ViewSizePreference const& sizePreference, int32_t anchorViewId, Windows::UI::ViewManagement::ViewSizePreference const& anchorSizePreference) const { Windows::Foundation::IAsyncOperation<bool> operation{ nullptr }; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewSwitcherStatics)->TryShowAsStandaloneWithAnchorViewAndSizePreferenceAsync(viewId, get_abi(sizePreference), anchorViewId, get_abi(anchorSizePreference), put_abi(operation))); return operation; } template <typename D> Windows::Foundation::IAsyncAction consume_Windows_UI_ViewManagement_IApplicationViewSwitcherStatics<D>::SwitchAsync(int32_t viewId) const { Windows::Foundation::IAsyncAction operation{ nullptr }; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewSwitcherStatics)->SwitchAsync(viewId, put_abi(operation))); return operation; } template <typename D> Windows::Foundation::IAsyncAction consume_Windows_UI_ViewManagement_IApplicationViewSwitcherStatics<D>::SwitchAsync(int32_t toViewId, int32_t fromViewId) const { Windows::Foundation::IAsyncAction operation{ nullptr }; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewSwitcherStatics)->SwitchFromViewAsync(toViewId, fromViewId, put_abi(operation))); return operation; } template <typename D> Windows::Foundation::IAsyncAction consume_Windows_UI_ViewManagement_IApplicationViewSwitcherStatics<D>::SwitchAsync(int32_t toViewId, int32_t fromViewId, Windows::UI::ViewManagement::ApplicationViewSwitchingOptions const& options) const { Windows::Foundation::IAsyncAction operation{ nullptr }; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewSwitcherStatics)->SwitchFromViewWithOptionsAsync(toViewId, fromViewId, get_abi(options), put_abi(operation))); return operation; } template <typename D> Windows::Foundation::IAsyncOperation<bool> consume_Windows_UI_ViewManagement_IApplicationViewSwitcherStatics<D>::PrepareForCustomAnimatedSwitchAsync(int32_t toViewId, int32_t fromViewId, Windows::UI::ViewManagement::ApplicationViewSwitchingOptions const& options) const { Windows::Foundation::IAsyncOperation<bool> operation{ nullptr }; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewSwitcherStatics)->PrepareForCustomAnimatedSwitchAsync(toViewId, fromViewId, get_abi(options), put_abi(operation))); return operation; } template <typename D> void consume_Windows_UI_ViewManagement_IApplicationViewSwitcherStatics2<D>::DisableSystemViewActivationPolicy() const { check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewSwitcherStatics2)->DisableSystemViewActivationPolicy()); } template <typename D> Windows::Foundation::IAsyncOperation<bool> consume_Windows_UI_ViewManagement_IApplicationViewSwitcherStatics3<D>::TryShowAsViewModeAsync(int32_t viewId, Windows::UI::ViewManagement::ApplicationViewMode const& viewMode) const { Windows::Foundation::IAsyncOperation<bool> operation{ nullptr }; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewSwitcherStatics3)->TryShowAsViewModeAsync(viewId, get_abi(viewMode), put_abi(operation))); return operation; } template <typename D> Windows::Foundation::IAsyncOperation<bool> consume_Windows_UI_ViewManagement_IApplicationViewSwitcherStatics3<D>::TryShowAsViewModeAsync(int32_t viewId, Windows::UI::ViewManagement::ApplicationViewMode const& viewMode, Windows::UI::ViewManagement::ViewModePreferences const& viewModePreferences) const { Windows::Foundation::IAsyncOperation<bool> operation{ nullptr }; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewSwitcherStatics3)->TryShowAsViewModeWithPreferencesAsync(viewId, get_abi(viewMode), get_abi(viewModePreferences), put_abi(operation))); return operation; } template <typename D> void consume_Windows_UI_ViewManagement_IApplicationViewTitleBar<D>::ForegroundColor(optional<Windows::UI::Color> const& value) const noexcept { check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewTitleBar)->put_ForegroundColor(get_abi(value))); } template <typename D> Windows::Foundation::IReference<Windows::UI::Color> consume_Windows_UI_ViewManagement_IApplicationViewTitleBar<D>::ForegroundColor() const noexcept { Windows::Foundation::IReference<Windows::UI::Color> value{ nullptr }; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewTitleBar)->get_ForegroundColor(put_abi(value))); return value; } template <typename D> void consume_Windows_UI_ViewManagement_IApplicationViewTitleBar<D>::BackgroundColor(optional<Windows::UI::Color> const& value) const noexcept { check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewTitleBar)->put_BackgroundColor(get_abi(value))); } template <typename D> Windows::Foundation::IReference<Windows::UI::Color> consume_Windows_UI_ViewManagement_IApplicationViewTitleBar<D>::BackgroundColor() const noexcept { Windows::Foundation::IReference<Windows::UI::Color> value{ nullptr }; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewTitleBar)->get_BackgroundColor(put_abi(value))); return value; } template <typename D> void consume_Windows_UI_ViewManagement_IApplicationViewTitleBar<D>::ButtonForegroundColor(optional<Windows::UI::Color> const& value) const noexcept { check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewTitleBar)->put_ButtonForegroundColor(get_abi(value))); } template <typename D> Windows::Foundation::IReference<Windows::UI::Color> consume_Windows_UI_ViewManagement_IApplicationViewTitleBar<D>::ButtonForegroundColor() const noexcept { Windows::Foundation::IReference<Windows::UI::Color> value{ nullptr }; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewTitleBar)->get_ButtonForegroundColor(put_abi(value))); return value; } template <typename D> void consume_Windows_UI_ViewManagement_IApplicationViewTitleBar<D>::ButtonBackgroundColor(optional<Windows::UI::Color> const& value) const noexcept { check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewTitleBar)->put_ButtonBackgroundColor(get_abi(value))); } template <typename D> Windows::Foundation::IReference<Windows::UI::Color> consume_Windows_UI_ViewManagement_IApplicationViewTitleBar<D>::ButtonBackgroundColor() const noexcept { Windows::Foundation::IReference<Windows::UI::Color> value{ nullptr }; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewTitleBar)->get_ButtonBackgroundColor(put_abi(value))); return value; } template <typename D> void consume_Windows_UI_ViewManagement_IApplicationViewTitleBar<D>::ButtonHoverForegroundColor(optional<Windows::UI::Color> const& value) const noexcept { check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewTitleBar)->put_ButtonHoverForegroundColor(get_abi(value))); } template <typename D> Windows::Foundation::IReference<Windows::UI::Color> consume_Windows_UI_ViewManagement_IApplicationViewTitleBar<D>::ButtonHoverForegroundColor() const noexcept { Windows::Foundation::IReference<Windows::UI::Color> value{ nullptr }; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewTitleBar)->get_ButtonHoverForegroundColor(put_abi(value))); return value; } template <typename D> void consume_Windows_UI_ViewManagement_IApplicationViewTitleBar<D>::ButtonHoverBackgroundColor(optional<Windows::UI::Color> const& value) const noexcept { check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewTitleBar)->put_ButtonHoverBackgroundColor(get_abi(value))); } template <typename D> Windows::Foundation::IReference<Windows::UI::Color> consume_Windows_UI_ViewManagement_IApplicationViewTitleBar<D>::ButtonHoverBackgroundColor() const noexcept { Windows::Foundation::IReference<Windows::UI::Color> value{ nullptr }; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewTitleBar)->get_ButtonHoverBackgroundColor(put_abi(value))); return value; } template <typename D> void consume_Windows_UI_ViewManagement_IApplicationViewTitleBar<D>::ButtonPressedForegroundColor(optional<Windows::UI::Color> const& value) const noexcept { check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewTitleBar)->put_ButtonPressedForegroundColor(get_abi(value))); } template <typename D> Windows::Foundation::IReference<Windows::UI::Color> consume_Windows_UI_ViewManagement_IApplicationViewTitleBar<D>::ButtonPressedForegroundColor() const noexcept { Windows::Foundation::IReference<Windows::UI::Color> value{ nullptr }; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewTitleBar)->get_ButtonPressedForegroundColor(put_abi(value))); return value; } template <typename D> void consume_Windows_UI_ViewManagement_IApplicationViewTitleBar<D>::ButtonPressedBackgroundColor(optional<Windows::UI::Color> const& value) const noexcept { check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewTitleBar)->put_ButtonPressedBackgroundColor(get_abi(value))); } template <typename D> Windows::Foundation::IReference<Windows::UI::Color> consume_Windows_UI_ViewManagement_IApplicationViewTitleBar<D>::ButtonPressedBackgroundColor() const noexcept { Windows::Foundation::IReference<Windows::UI::Color> value{ nullptr }; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewTitleBar)->get_ButtonPressedBackgroundColor(put_abi(value))); return value; } template <typename D> void consume_Windows_UI_ViewManagement_IApplicationViewTitleBar<D>::InactiveForegroundColor(optional<Windows::UI::Color> const& value) const noexcept { check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewTitleBar)->put_InactiveForegroundColor(get_abi(value))); } template <typename D> Windows::Foundation::IReference<Windows::UI::Color> consume_Windows_UI_ViewManagement_IApplicationViewTitleBar<D>::InactiveForegroundColor() const noexcept { Windows::Foundation::IReference<Windows::UI::Color> value{ nullptr }; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewTitleBar)->get_InactiveForegroundColor(put_abi(value))); return value; } template <typename D> void consume_Windows_UI_ViewManagement_IApplicationViewTitleBar<D>::InactiveBackgroundColor(optional<Windows::UI::Color> const& value) const noexcept { check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewTitleBar)->put_InactiveBackgroundColor(get_abi(value))); } template <typename D> Windows::Foundation::IReference<Windows::UI::Color> consume_Windows_UI_ViewManagement_IApplicationViewTitleBar<D>::InactiveBackgroundColor() const noexcept { Windows::Foundation::IReference<Windows::UI::Color> value{ nullptr }; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewTitleBar)->get_InactiveBackgroundColor(put_abi(value))); return value; } template <typename D> void consume_Windows_UI_ViewManagement_IApplicationViewTitleBar<D>::ButtonInactiveForegroundColor(optional<Windows::UI::Color> const& value) const noexcept { check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewTitleBar)->put_ButtonInactiveForegroundColor(get_abi(value))); } template <typename D> Windows::Foundation::IReference<Windows::UI::Color> consume_Windows_UI_ViewManagement_IApplicationViewTitleBar<D>::ButtonInactiveForegroundColor() const noexcept { Windows::Foundation::IReference<Windows::UI::Color> value{ nullptr }; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewTitleBar)->get_ButtonInactiveForegroundColor(put_abi(value))); return value; } template <typename D> void consume_Windows_UI_ViewManagement_IApplicationViewTitleBar<D>::ButtonInactiveBackgroundColor(optional<Windows::UI::Color> const& value) const noexcept { check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewTitleBar)->put_ButtonInactiveBackgroundColor(get_abi(value))); } template <typename D> Windows::Foundation::IReference<Windows::UI::Color> consume_Windows_UI_ViewManagement_IApplicationViewTitleBar<D>::ButtonInactiveBackgroundColor() const noexcept { Windows::Foundation::IReference<Windows::UI::Color> value{ nullptr }; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewTitleBar)->get_ButtonInactiveBackgroundColor(put_abi(value))); return value; } template <typename D> int32_t consume_Windows_UI_ViewManagement_IApplicationViewTransferContext<D>::ViewId() const noexcept { int32_t value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewTransferContext)->get_ViewId(&value)); return value; } template <typename D> void consume_Windows_UI_ViewManagement_IApplicationViewTransferContext<D>::ViewId(int32_t value) const noexcept { check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewTransferContext)->put_ViewId(value)); } template <typename D> hstring consume_Windows_UI_ViewManagement_IApplicationViewTransferContextStatics<D>::DataPackageFormatId() const noexcept { hstring value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IApplicationViewTransferContextStatics)->get_DataPackageFormatId(put_abi(value))); return value; } template <typename D> event_token consume_Windows_UI_ViewManagement_IInputPane<D>::Showing(Windows::Foundation::TypedEventHandler<Windows::UI::ViewManagement::InputPane, Windows::UI::ViewManagement::InputPaneVisibilityEventArgs> const& handler) const { event_token token{}; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IInputPane)->add_Showing(get_abi(handler), put_abi(token))); return token; } template <typename D> event_revoker<Windows::UI::ViewManagement::IInputPane> consume_Windows_UI_ViewManagement_IInputPane<D>::Showing(auto_revoke_t, Windows::Foundation::TypedEventHandler<Windows::UI::ViewManagement::InputPane, Windows::UI::ViewManagement::InputPaneVisibilityEventArgs> const& handler) const { return impl::make_event_revoker<D, Windows::UI::ViewManagement::IInputPane>(this, &abi_t<Windows::UI::ViewManagement::IInputPane>::remove_Showing, Showing(handler)); } template <typename D> void consume_Windows_UI_ViewManagement_IInputPane<D>::Showing(event_token const& token) const { check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IInputPane)->remove_Showing(get_abi(token))); } template <typename D> event_token consume_Windows_UI_ViewManagement_IInputPane<D>::Hiding(Windows::Foundation::TypedEventHandler<Windows::UI::ViewManagement::InputPane, Windows::UI::ViewManagement::InputPaneVisibilityEventArgs> const& handler) const { event_token token{}; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IInputPane)->add_Hiding(get_abi(handler), put_abi(token))); return token; } template <typename D> event_revoker<Windows::UI::ViewManagement::IInputPane> consume_Windows_UI_ViewManagement_IInputPane<D>::Hiding(auto_revoke_t, Windows::Foundation::TypedEventHandler<Windows::UI::ViewManagement::InputPane, Windows::UI::ViewManagement::InputPaneVisibilityEventArgs> const& handler) const { return impl::make_event_revoker<D, Windows::UI::ViewManagement::IInputPane>(this, &abi_t<Windows::UI::ViewManagement::IInputPane>::remove_Hiding, Hiding(handler)); } template <typename D> void consume_Windows_UI_ViewManagement_IInputPane<D>::Hiding(event_token const& token) const { check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IInputPane)->remove_Hiding(get_abi(token))); } template <typename D> Windows::Foundation::Rect consume_Windows_UI_ViewManagement_IInputPane<D>::OccludedRect() const noexcept { Windows::Foundation::Rect value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IInputPane)->get_OccludedRect(put_abi(value))); return value; } template <typename D> bool consume_Windows_UI_ViewManagement_IInputPane2<D>::TryShow() const { bool result{}; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IInputPane2)->TryShow(&result)); return result; } template <typename D> bool consume_Windows_UI_ViewManagement_IInputPane2<D>::TryHide() const { bool result{}; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IInputPane2)->TryHide(&result)); return result; } template <typename D> bool consume_Windows_UI_ViewManagement_IInputPaneControl<D>::Visible() const noexcept { bool value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IInputPaneControl)->get_Visible(&value)); return value; } template <typename D> void consume_Windows_UI_ViewManagement_IInputPaneControl<D>::Visible(bool value) const noexcept { check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IInputPaneControl)->put_Visible(value)); } template <typename D> Windows::UI::ViewManagement::InputPane consume_Windows_UI_ViewManagement_IInputPaneStatics<D>::GetForCurrentView() const { Windows::UI::ViewManagement::InputPane inputPane{ nullptr }; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IInputPaneStatics)->GetForCurrentView(put_abi(inputPane))); return inputPane; } template <typename D> Windows::Foundation::Rect consume_Windows_UI_ViewManagement_IInputPaneVisibilityEventArgs<D>::OccludedRect() const noexcept { Windows::Foundation::Rect value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IInputPaneVisibilityEventArgs)->get_OccludedRect(put_abi(value))); return value; } template <typename D> void consume_Windows_UI_ViewManagement_IInputPaneVisibilityEventArgs<D>::EnsuredFocusedElementInView(bool value) const noexcept { check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IInputPaneVisibilityEventArgs)->put_EnsuredFocusedElementInView(value)); } template <typename D> bool consume_Windows_UI_ViewManagement_IInputPaneVisibilityEventArgs<D>::EnsuredFocusedElementInView() const noexcept { bool value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IInputPaneVisibilityEventArgs)->get_EnsuredFocusedElementInView(&value)); return value; } template <typename D> Windows::Foundation::IAsyncAction consume_Windows_UI_ViewManagement_IProjectionManagerStatics<D>::StartProjectingAsync(int32_t projectionViewId, int32_t anchorViewId) const { Windows::Foundation::IAsyncAction operation{ nullptr }; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IProjectionManagerStatics)->StartProjectingAsync(projectionViewId, anchorViewId, put_abi(operation))); return operation; } template <typename D> Windows::Foundation::IAsyncAction consume_Windows_UI_ViewManagement_IProjectionManagerStatics<D>::SwapDisplaysForViewsAsync(int32_t projectionViewId, int32_t anchorViewId) const { Windows::Foundation::IAsyncAction operation{ nullptr }; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IProjectionManagerStatics)->SwapDisplaysForViewsAsync(projectionViewId, anchorViewId, put_abi(operation))); return operation; } template <typename D> Windows::Foundation::IAsyncAction consume_Windows_UI_ViewManagement_IProjectionManagerStatics<D>::StopProjectingAsync(int32_t projectionViewId, int32_t anchorViewId) const { Windows::Foundation::IAsyncAction operation{ nullptr }; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IProjectionManagerStatics)->StopProjectingAsync(projectionViewId, anchorViewId, put_abi(operation))); return operation; } template <typename D> bool consume_Windows_UI_ViewManagement_IProjectionManagerStatics<D>::ProjectionDisplayAvailable() const noexcept { bool value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IProjectionManagerStatics)->get_ProjectionDisplayAvailable(&value)); return value; } template <typename D> event_token consume_Windows_UI_ViewManagement_IProjectionManagerStatics<D>::ProjectionDisplayAvailableChanged(Windows::Foundation::EventHandler<Windows::Foundation::IInspectable> const& handler) const { event_token token{}; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IProjectionManagerStatics)->add_ProjectionDisplayAvailableChanged(get_abi(handler), put_abi(token))); return token; } template <typename D> event_revoker<Windows::UI::ViewManagement::IProjectionManagerStatics> consume_Windows_UI_ViewManagement_IProjectionManagerStatics<D>::ProjectionDisplayAvailableChanged(auto_revoke_t, Windows::Foundation::EventHandler<Windows::Foundation::IInspectable> const& handler) const { return impl::make_event_revoker<D, Windows::UI::ViewManagement::IProjectionManagerStatics>(this, &abi_t<Windows::UI::ViewManagement::IProjectionManagerStatics>::remove_ProjectionDisplayAvailableChanged, ProjectionDisplayAvailableChanged(handler)); } template <typename D> void consume_Windows_UI_ViewManagement_IProjectionManagerStatics<D>::ProjectionDisplayAvailableChanged(event_token const& token) const { check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IProjectionManagerStatics)->remove_ProjectionDisplayAvailableChanged(get_abi(token))); } template <typename D> Windows::Foundation::IAsyncAction consume_Windows_UI_ViewManagement_IProjectionManagerStatics2<D>::StartProjectingAsync(int32_t projectionViewId, int32_t anchorViewId, Windows::Devices::Enumeration::DeviceInformation const& displayDeviceInfo) const { Windows::Foundation::IAsyncAction operation{ nullptr }; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IProjectionManagerStatics2)->StartProjectingWithDeviceInfoAsync(projectionViewId, anchorViewId, get_abi(displayDeviceInfo), put_abi(operation))); return operation; } template <typename D> Windows::Foundation::IAsyncOperation<bool> consume_Windows_UI_ViewManagement_IProjectionManagerStatics2<D>::RequestStartProjectingAsync(int32_t projectionViewId, int32_t anchorViewId, Windows::Foundation::Rect const& selection) const { Windows::Foundation::IAsyncOperation<bool> operation{ nullptr }; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IProjectionManagerStatics2)->RequestStartProjectingAsync(projectionViewId, anchorViewId, get_abi(selection), put_abi(operation))); return operation; } template <typename D> Windows::Foundation::IAsyncOperation<bool> consume_Windows_UI_ViewManagement_IProjectionManagerStatics2<D>::RequestStartProjectingAsync(int32_t projectionViewId, int32_t anchorViewId, Windows::Foundation::Rect const& selection, Windows::UI::Popups::Placement const& prefferedPlacement) const { Windows::Foundation::IAsyncOperation<bool> operation{ nullptr }; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IProjectionManagerStatics2)->RequestStartProjectingWithPlacementAsync(projectionViewId, anchorViewId, get_abi(selection), get_abi(prefferedPlacement), put_abi(operation))); return operation; } template <typename D> hstring consume_Windows_UI_ViewManagement_IProjectionManagerStatics2<D>::GetDeviceSelector() const { hstring selector{}; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IProjectionManagerStatics2)->GetDeviceSelector(put_abi(selector))); return selector; } template <typename D> Windows::Foundation::IAsyncAction consume_Windows_UI_ViewManagement_IStatusBar<D>::ShowAsync() const { Windows::Foundation::IAsyncAction returnValue{ nullptr }; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IStatusBar)->ShowAsync(put_abi(returnValue))); return returnValue; } template <typename D> Windows::Foundation::IAsyncAction consume_Windows_UI_ViewManagement_IStatusBar<D>::HideAsync() const { Windows::Foundation::IAsyncAction returnValue{ nullptr }; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IStatusBar)->HideAsync(put_abi(returnValue))); return returnValue; } template <typename D> double consume_Windows_UI_ViewManagement_IStatusBar<D>::BackgroundOpacity() const noexcept { double value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IStatusBar)->get_BackgroundOpacity(&value)); return value; } template <typename D> void consume_Windows_UI_ViewManagement_IStatusBar<D>::BackgroundOpacity(double value) const noexcept { check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IStatusBar)->put_BackgroundOpacity(value)); } template <typename D> Windows::Foundation::IReference<Windows::UI::Color> consume_Windows_UI_ViewManagement_IStatusBar<D>::ForegroundColor() const noexcept { Windows::Foundation::IReference<Windows::UI::Color> value{ nullptr }; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IStatusBar)->get_ForegroundColor(put_abi(value))); return value; } template <typename D> void consume_Windows_UI_ViewManagement_IStatusBar<D>::ForegroundColor(optional<Windows::UI::Color> const& value) const noexcept { check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IStatusBar)->put_ForegroundColor(get_abi(value))); } template <typename D> Windows::Foundation::IReference<Windows::UI::Color> consume_Windows_UI_ViewManagement_IStatusBar<D>::BackgroundColor() const noexcept { Windows::Foundation::IReference<Windows::UI::Color> value{ nullptr }; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IStatusBar)->get_BackgroundColor(put_abi(value))); return value; } template <typename D> void consume_Windows_UI_ViewManagement_IStatusBar<D>::BackgroundColor(optional<Windows::UI::Color> const& value) const noexcept { check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IStatusBar)->put_BackgroundColor(get_abi(value))); } template <typename D> Windows::UI::ViewManagement::StatusBarProgressIndicator consume_Windows_UI_ViewManagement_IStatusBar<D>::ProgressIndicator() const noexcept { Windows::UI::ViewManagement::StatusBarProgressIndicator value{ nullptr }; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IStatusBar)->get_ProgressIndicator(put_abi(value))); return value; } template <typename D> Windows::Foundation::Rect consume_Windows_UI_ViewManagement_IStatusBar<D>::OccludedRect() const noexcept { Windows::Foundation::Rect value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IStatusBar)->get_OccludedRect(put_abi(value))); return value; } template <typename D> event_token consume_Windows_UI_ViewManagement_IStatusBar<D>::Showing(Windows::Foundation::TypedEventHandler<Windows::UI::ViewManagement::StatusBar, Windows::Foundation::IInspectable> const& eventHandler) const { event_token token{}; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IStatusBar)->add_Showing(get_abi(eventHandler), put_abi(token))); return token; } template <typename D> event_revoker<Windows::UI::ViewManagement::IStatusBar> consume_Windows_UI_ViewManagement_IStatusBar<D>::Showing(auto_revoke_t, Windows::Foundation::TypedEventHandler<Windows::UI::ViewManagement::StatusBar, Windows::Foundation::IInspectable> const& eventHandler) const { return impl::make_event_revoker<D, Windows::UI::ViewManagement::IStatusBar>(this, &abi_t<Windows::UI::ViewManagement::IStatusBar>::remove_Showing, Showing(eventHandler)); } template <typename D> void consume_Windows_UI_ViewManagement_IStatusBar<D>::Showing(event_token const& token) const { check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IStatusBar)->remove_Showing(get_abi(token))); } template <typename D> event_token consume_Windows_UI_ViewManagement_IStatusBar<D>::Hiding(Windows::Foundation::TypedEventHandler<Windows::UI::ViewManagement::StatusBar, Windows::Foundation::IInspectable> const& eventHandler) const { event_token token{}; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IStatusBar)->add_Hiding(get_abi(eventHandler), put_abi(token))); return token; } template <typename D> event_revoker<Windows::UI::ViewManagement::IStatusBar> consume_Windows_UI_ViewManagement_IStatusBar<D>::Hiding(auto_revoke_t, Windows::Foundation::TypedEventHandler<Windows::UI::ViewManagement::StatusBar, Windows::Foundation::IInspectable> const& eventHandler) const { return impl::make_event_revoker<D, Windows::UI::ViewManagement::IStatusBar>(this, &abi_t<Windows::UI::ViewManagement::IStatusBar>::remove_Hiding, Hiding(eventHandler)); } template <typename D> void consume_Windows_UI_ViewManagement_IStatusBar<D>::Hiding(event_token const& token) const { check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IStatusBar)->remove_Hiding(get_abi(token))); } template <typename D> Windows::Foundation::IAsyncAction consume_Windows_UI_ViewManagement_IStatusBarProgressIndicator<D>::ShowAsync() const { Windows::Foundation::IAsyncAction returnValue{ nullptr }; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IStatusBarProgressIndicator)->ShowAsync(put_abi(returnValue))); return returnValue; } template <typename D> Windows::Foundation::IAsyncAction consume_Windows_UI_ViewManagement_IStatusBarProgressIndicator<D>::HideAsync() const { Windows::Foundation::IAsyncAction returnValue{ nullptr }; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IStatusBarProgressIndicator)->HideAsync(put_abi(returnValue))); return returnValue; } template <typename D> hstring consume_Windows_UI_ViewManagement_IStatusBarProgressIndicator<D>::Text() const noexcept { hstring value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IStatusBarProgressIndicator)->get_Text(put_abi(value))); return value; } template <typename D> void consume_Windows_UI_ViewManagement_IStatusBarProgressIndicator<D>::Text(param::hstring const& value) const noexcept { check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IStatusBarProgressIndicator)->put_Text(get_abi(value))); } template <typename D> Windows::Foundation::IReference<double> consume_Windows_UI_ViewManagement_IStatusBarProgressIndicator<D>::ProgressValue() const noexcept { Windows::Foundation::IReference<double> value{ nullptr }; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IStatusBarProgressIndicator)->get_ProgressValue(put_abi(value))); return value; } template <typename D> void consume_Windows_UI_ViewManagement_IStatusBarProgressIndicator<D>::ProgressValue(optional<double> const& value) const noexcept { check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IStatusBarProgressIndicator)->put_ProgressValue(get_abi(value))); } template <typename D> Windows::UI::ViewManagement::StatusBar consume_Windows_UI_ViewManagement_IStatusBarStatics<D>::GetForCurrentView() const { Windows::UI::ViewManagement::StatusBar value{ nullptr }; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IStatusBarStatics)->GetForCurrentView(put_abi(value))); return value; } template <typename D> Windows::UI::ViewManagement::HandPreference consume_Windows_UI_ViewManagement_IUISettings<D>::HandPreference() const noexcept { Windows::UI::ViewManagement::HandPreference value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IUISettings)->get_HandPreference(put_abi(value))); return value; } template <typename D> Windows::Foundation::Size consume_Windows_UI_ViewManagement_IUISettings<D>::CursorSize() const noexcept { Windows::Foundation::Size value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IUISettings)->get_CursorSize(put_abi(value))); return value; } template <typename D> Windows::Foundation::Size consume_Windows_UI_ViewManagement_IUISettings<D>::ScrollBarSize() const noexcept { Windows::Foundation::Size value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IUISettings)->get_ScrollBarSize(put_abi(value))); return value; } template <typename D> Windows::Foundation::Size consume_Windows_UI_ViewManagement_IUISettings<D>::ScrollBarArrowSize() const noexcept { Windows::Foundation::Size value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IUISettings)->get_ScrollBarArrowSize(put_abi(value))); return value; } template <typename D> Windows::Foundation::Size consume_Windows_UI_ViewManagement_IUISettings<D>::ScrollBarThumbBoxSize() const noexcept { Windows::Foundation::Size value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IUISettings)->get_ScrollBarThumbBoxSize(put_abi(value))); return value; } template <typename D> uint32_t consume_Windows_UI_ViewManagement_IUISettings<D>::MessageDuration() const noexcept { uint32_t value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IUISettings)->get_MessageDuration(&value)); return value; } template <typename D> bool consume_Windows_UI_ViewManagement_IUISettings<D>::AnimationsEnabled() const noexcept { bool value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IUISettings)->get_AnimationsEnabled(&value)); return value; } template <typename D> bool consume_Windows_UI_ViewManagement_IUISettings<D>::CaretBrowsingEnabled() const noexcept { bool value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IUISettings)->get_CaretBrowsingEnabled(&value)); return value; } template <typename D> uint32_t consume_Windows_UI_ViewManagement_IUISettings<D>::CaretBlinkRate() const noexcept { uint32_t value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IUISettings)->get_CaretBlinkRate(&value)); return value; } template <typename D> uint32_t consume_Windows_UI_ViewManagement_IUISettings<D>::CaretWidth() const noexcept { uint32_t value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IUISettings)->get_CaretWidth(&value)); return value; } template <typename D> uint32_t consume_Windows_UI_ViewManagement_IUISettings<D>::DoubleClickTime() const noexcept { uint32_t value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IUISettings)->get_DoubleClickTime(&value)); return value; } template <typename D> uint32_t consume_Windows_UI_ViewManagement_IUISettings<D>::MouseHoverTime() const noexcept { uint32_t value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IUISettings)->get_MouseHoverTime(&value)); return value; } template <typename D> Windows::UI::Color consume_Windows_UI_ViewManagement_IUISettings<D>::UIElementColor(Windows::UI::ViewManagement::UIElementType const& desiredElement) const { Windows::UI::Color value{}; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IUISettings)->UIElementColor(get_abi(desiredElement), put_abi(value))); return value; } template <typename D> double consume_Windows_UI_ViewManagement_IUISettings2<D>::TextScaleFactor() const noexcept { double value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IUISettings2)->get_TextScaleFactor(&value)); return value; } template <typename D> event_token consume_Windows_UI_ViewManagement_IUISettings2<D>::TextScaleFactorChanged(Windows::Foundation::TypedEventHandler<Windows::UI::ViewManagement::UISettings, Windows::Foundation::IInspectable> const& handler) const { event_token cookie{}; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IUISettings2)->add_TextScaleFactorChanged(get_abi(handler), put_abi(cookie))); return cookie; } template <typename D> event_revoker<Windows::UI::ViewManagement::IUISettings2> consume_Windows_UI_ViewManagement_IUISettings2<D>::TextScaleFactorChanged(auto_revoke_t, Windows::Foundation::TypedEventHandler<Windows::UI::ViewManagement::UISettings, Windows::Foundation::IInspectable> const& handler) const { return impl::make_event_revoker<D, Windows::UI::ViewManagement::IUISettings2>(this, &abi_t<Windows::UI::ViewManagement::IUISettings2>::remove_TextScaleFactorChanged, TextScaleFactorChanged(handler)); } template <typename D> void consume_Windows_UI_ViewManagement_IUISettings2<D>::TextScaleFactorChanged(event_token const& cookie) const { check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IUISettings2)->remove_TextScaleFactorChanged(get_abi(cookie))); } template <typename D> Windows::UI::Color consume_Windows_UI_ViewManagement_IUISettings3<D>::GetColorValue(Windows::UI::ViewManagement::UIColorType const& desiredColor) const { Windows::UI::Color value{}; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IUISettings3)->GetColorValue(get_abi(desiredColor), put_abi(value))); return value; } template <typename D> event_token consume_Windows_UI_ViewManagement_IUISettings3<D>::ColorValuesChanged(Windows::Foundation::TypedEventHandler<Windows::UI::ViewManagement::UISettings, Windows::Foundation::IInspectable> const& handler) const { event_token cookie{}; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IUISettings3)->add_ColorValuesChanged(get_abi(handler), put_abi(cookie))); return cookie; } template <typename D> event_revoker<Windows::UI::ViewManagement::IUISettings3> consume_Windows_UI_ViewManagement_IUISettings3<D>::ColorValuesChanged(auto_revoke_t, Windows::Foundation::TypedEventHandler<Windows::UI::ViewManagement::UISettings, Windows::Foundation::IInspectable> const& handler) const { return impl::make_event_revoker<D, Windows::UI::ViewManagement::IUISettings3>(this, &abi_t<Windows::UI::ViewManagement::IUISettings3>::remove_ColorValuesChanged, ColorValuesChanged(handler)); } template <typename D> void consume_Windows_UI_ViewManagement_IUISettings3<D>::ColorValuesChanged(event_token const& cookie) const { check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IUISettings3)->remove_ColorValuesChanged(get_abi(cookie))); } template <typename D> bool consume_Windows_UI_ViewManagement_IUISettings4<D>::AdvancedEffectsEnabled() const noexcept { bool value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IUISettings4)->get_AdvancedEffectsEnabled(&value)); return value; } template <typename D> event_token consume_Windows_UI_ViewManagement_IUISettings4<D>::AdvancedEffectsEnabledChanged(Windows::Foundation::TypedEventHandler<Windows::UI::ViewManagement::UISettings, Windows::Foundation::IInspectable> const& handler) const { event_token cookie{}; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IUISettings4)->add_AdvancedEffectsEnabledChanged(get_abi(handler), put_abi(cookie))); return cookie; } template <typename D> event_revoker<Windows::UI::ViewManagement::IUISettings4> consume_Windows_UI_ViewManagement_IUISettings4<D>::AdvancedEffectsEnabledChanged(auto_revoke_t, Windows::Foundation::TypedEventHandler<Windows::UI::ViewManagement::UISettings, Windows::Foundation::IInspectable> const& handler) const { return impl::make_event_revoker<D, Windows::UI::ViewManagement::IUISettings4>(this, &abi_t<Windows::UI::ViewManagement::IUISettings4>::remove_AdvancedEffectsEnabledChanged, AdvancedEffectsEnabledChanged(handler)); } template <typename D> void consume_Windows_UI_ViewManagement_IUISettings4<D>::AdvancedEffectsEnabledChanged(event_token const& cookie) const { check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IUISettings4)->remove_AdvancedEffectsEnabledChanged(get_abi(cookie))); } template <typename D> Windows::UI::ViewManagement::UserInteractionMode consume_Windows_UI_ViewManagement_IUIViewSettings<D>::UserInteractionMode() const noexcept { Windows::UI::ViewManagement::UserInteractionMode value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IUIViewSettings)->get_UserInteractionMode(put_abi(value))); return value; } template <typename D> Windows::UI::ViewManagement::UIViewSettings consume_Windows_UI_ViewManagement_IUIViewSettingsStatics<D>::GetForCurrentView() const { Windows::UI::ViewManagement::UIViewSettings current{ nullptr }; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IUIViewSettingsStatics)->GetForCurrentView(put_abi(current))); return current; } template <typename D> Windows::UI::ViewManagement::ViewSizePreference consume_Windows_UI_ViewManagement_IViewModePreferences<D>::ViewSizePreference() const noexcept { Windows::UI::ViewManagement::ViewSizePreference value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IViewModePreferences)->get_ViewSizePreference(put_abi(value))); return value; } template <typename D> void consume_Windows_UI_ViewManagement_IViewModePreferences<D>::ViewSizePreference(Windows::UI::ViewManagement::ViewSizePreference const& value) const noexcept { check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IViewModePreferences)->put_ViewSizePreference(get_abi(value))); } template <typename D> Windows::Foundation::Size consume_Windows_UI_ViewManagement_IViewModePreferences<D>::CustomSize() const noexcept { Windows::Foundation::Size value{}; check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IViewModePreferences)->get_CustomSize(put_abi(value))); return value; } template <typename D> void consume_Windows_UI_ViewManagement_IViewModePreferences<D>::CustomSize(Windows::Foundation::Size const& value) const noexcept { check_terminate(WINRT_SHIM(Windows::UI::ViewManagement::IViewModePreferences)->put_CustomSize(get_abi(value))); } template <typename D> Windows::UI::ViewManagement::ViewModePreferences consume_Windows_UI_ViewManagement_IViewModePreferencesStatics<D>::CreateDefault(Windows::UI::ViewManagement::ApplicationViewMode const& mode) const { Windows::UI::ViewManagement::ViewModePreferences result{ nullptr }; check_hresult(WINRT_SHIM(Windows::UI::ViewManagement::IViewModePreferencesStatics)->CreateDefault(get_abi(mode), put_abi(result))); return result; } template <typename D> struct produce<D, Windows::UI::ViewManagement::IAccessibilitySettings> : produce_base<D, Windows::UI::ViewManagement::IAccessibilitySettings> { HRESULT __stdcall get_HighContrast(bool* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().HighContrast()); return S_OK; } HRESULT __stdcall get_HighContrastScheme(HSTRING* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().HighContrastScheme()); return S_OK; } HRESULT __stdcall add_HighContrastChanged(::IUnknown* handler, event_token* cookie) noexcept final { try { typename D::abi_guard guard(this->shim()); *cookie = detach_abi(this->shim().HighContrastChanged(*reinterpret_cast<Windows::Foundation::TypedEventHandler<Windows::UI::ViewManagement::AccessibilitySettings, Windows::Foundation::IInspectable> const*>(&handler))); return S_OK; } catch (...) { return impl::to_hresult(); } } HRESULT __stdcall remove_HighContrastChanged(event_token cookie) noexcept final { try { typename D::abi_guard guard(this->shim()); this->shim().HighContrastChanged(*reinterpret_cast<event_token const*>(&cookie)); return S_OK; } catch (...) { return impl::to_hresult(); } } }; template <typename D> struct produce<D, Windows::UI::ViewManagement::IActivationViewSwitcher> : produce_base<D, Windows::UI::ViewManagement::IActivationViewSwitcher> { HRESULT __stdcall ShowAsStandaloneAsync(int32_t viewId, ::IUnknown** operation) noexcept final { try { typename D::abi_guard guard(this->shim()); *operation = detach_abi(this->shim().ShowAsStandaloneAsync(viewId)); return S_OK; } catch (...) { *operation = nullptr; return impl::to_hresult(); } } HRESULT __stdcall ShowAsStandaloneWithSizePreferenceAsync(int32_t viewId, Windows::UI::ViewManagement::ViewSizePreference sizePreference, ::IUnknown** operation) noexcept final { try { typename D::abi_guard guard(this->shim()); *operation = detach_abi(this->shim().ShowAsStandaloneAsync(viewId, *reinterpret_cast<Windows::UI::ViewManagement::ViewSizePreference const*>(&sizePreference))); return S_OK; } catch (...) { *operation = nullptr; return impl::to_hresult(); } } HRESULT __stdcall IsViewPresentedOnActivationVirtualDesktop(int32_t viewId, bool* value) noexcept final { try { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().IsViewPresentedOnActivationVirtualDesktop(viewId)); return S_OK; } catch (...) { return impl::to_hresult(); } } }; template <typename D> struct produce<D, Windows::UI::ViewManagement::IApplicationView> : produce_base<D, Windows::UI::ViewManagement::IApplicationView> { HRESULT __stdcall get_Orientation(Windows::UI::ViewManagement::ApplicationViewOrientation* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().Orientation()); return S_OK; } HRESULT __stdcall get_AdjacentToLeftDisplayEdge(bool* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().AdjacentToLeftDisplayEdge()); return S_OK; } HRESULT __stdcall get_AdjacentToRightDisplayEdge(bool* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().AdjacentToRightDisplayEdge()); return S_OK; } HRESULT __stdcall get_IsFullScreen(bool* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().IsFullScreen()); return S_OK; } HRESULT __stdcall get_IsOnLockScreen(bool* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().IsOnLockScreen()); return S_OK; } HRESULT __stdcall get_IsScreenCaptureEnabled(bool* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().IsScreenCaptureEnabled()); return S_OK; } HRESULT __stdcall put_IsScreenCaptureEnabled(bool value) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().IsScreenCaptureEnabled(value); return S_OK; } HRESULT __stdcall put_Title(HSTRING value) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().Title(*reinterpret_cast<hstring const*>(&value)); return S_OK; } HRESULT __stdcall get_Title(HSTRING* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().Title()); return S_OK; } HRESULT __stdcall get_Id(int32_t* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().Id()); return S_OK; } HRESULT __stdcall add_Consolidated(::IUnknown* handler, event_token* token) noexcept final { try { typename D::abi_guard guard(this->shim()); *token = detach_abi(this->shim().Consolidated(*reinterpret_cast<Windows::Foundation::TypedEventHandler<Windows::UI::ViewManagement::ApplicationView, Windows::UI::ViewManagement::ApplicationViewConsolidatedEventArgs> const*>(&handler))); return S_OK; } catch (...) { return impl::to_hresult(); } } HRESULT __stdcall remove_Consolidated(event_token token) noexcept final { try { typename D::abi_guard guard(this->shim()); this->shim().Consolidated(*reinterpret_cast<event_token const*>(&token)); return S_OK; } catch (...) { return impl::to_hresult(); } } }; template <typename D> struct produce<D, Windows::UI::ViewManagement::IApplicationView2> : produce_base<D, Windows::UI::ViewManagement::IApplicationView2> { HRESULT __stdcall get_SuppressSystemOverlays(bool* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().SuppressSystemOverlays()); return S_OK; } HRESULT __stdcall put_SuppressSystemOverlays(bool value) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().SuppressSystemOverlays(value); return S_OK; } HRESULT __stdcall get_VisibleBounds(Windows::Foundation::Rect* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().VisibleBounds()); return S_OK; } HRESULT __stdcall add_VisibleBoundsChanged(::IUnknown* handler, event_token* token) noexcept final { try { typename D::abi_guard guard(this->shim()); *token = detach_abi(this->shim().VisibleBoundsChanged(*reinterpret_cast<Windows::Foundation::TypedEventHandler<Windows::UI::ViewManagement::ApplicationView, Windows::Foundation::IInspectable> const*>(&handler))); return S_OK; } catch (...) { return impl::to_hresult(); } } HRESULT __stdcall remove_VisibleBoundsChanged(event_token token) noexcept final { try { typename D::abi_guard guard(this->shim()); this->shim().VisibleBoundsChanged(*reinterpret_cast<event_token const*>(&token)); return S_OK; } catch (...) { return impl::to_hresult(); } } HRESULT __stdcall SetDesiredBoundsMode(Windows::UI::ViewManagement::ApplicationViewBoundsMode boundsMode, bool* success) noexcept final { try { typename D::abi_guard guard(this->shim()); *success = detach_abi(this->shim().SetDesiredBoundsMode(*reinterpret_cast<Windows::UI::ViewManagement::ApplicationViewBoundsMode const*>(&boundsMode))); return S_OK; } catch (...) { return impl::to_hresult(); } } HRESULT __stdcall get_DesiredBoundsMode(Windows::UI::ViewManagement::ApplicationViewBoundsMode* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().DesiredBoundsMode()); return S_OK; } }; template <typename D> struct produce<D, Windows::UI::ViewManagement::IApplicationView3> : produce_base<D, Windows::UI::ViewManagement::IApplicationView3> { HRESULT __stdcall get_TitleBar(::IUnknown** value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().TitleBar()); return S_OK; } HRESULT __stdcall get_FullScreenSystemOverlayMode(Windows::UI::ViewManagement::FullScreenSystemOverlayMode* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().FullScreenSystemOverlayMode()); return S_OK; } HRESULT __stdcall put_FullScreenSystemOverlayMode(Windows::UI::ViewManagement::FullScreenSystemOverlayMode value) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().FullScreenSystemOverlayMode(*reinterpret_cast<Windows::UI::ViewManagement::FullScreenSystemOverlayMode const*>(&value)); return S_OK; } HRESULT __stdcall get_IsFullScreenMode(bool* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().IsFullScreenMode()); return S_OK; } HRESULT __stdcall TryEnterFullScreenMode(bool* success) noexcept final { try { typename D::abi_guard guard(this->shim()); *success = detach_abi(this->shim().TryEnterFullScreenMode()); return S_OK; } catch (...) { return impl::to_hresult(); } } HRESULT __stdcall ExitFullScreenMode() noexcept final { try { typename D::abi_guard guard(this->shim()); this->shim().ExitFullScreenMode(); return S_OK; } catch (...) { return impl::to_hresult(); } } HRESULT __stdcall ShowStandardSystemOverlays() noexcept final { try { typename D::abi_guard guard(this->shim()); this->shim().ShowStandardSystemOverlays(); return S_OK; } catch (...) { return impl::to_hresult(); } } HRESULT __stdcall TryResizeView(Windows::Foundation::Size value, bool* success) noexcept final { try { typename D::abi_guard guard(this->shim()); *success = detach_abi(this->shim().TryResizeView(*reinterpret_cast<Windows::Foundation::Size const*>(&value))); return S_OK; } catch (...) { return impl::to_hresult(); } } HRESULT __stdcall SetPreferredMinSize(Windows::Foundation::Size minSize) noexcept final { try { typename D::abi_guard guard(this->shim()); this->shim().SetPreferredMinSize(*reinterpret_cast<Windows::Foundation::Size const*>(&minSize)); return S_OK; } catch (...) { return impl::to_hresult(); } } }; template <typename D> struct produce<D, Windows::UI::ViewManagement::IApplicationView4> : produce_base<D, Windows::UI::ViewManagement::IApplicationView4> { HRESULT __stdcall get_ViewMode(Windows::UI::ViewManagement::ApplicationViewMode* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().ViewMode()); return S_OK; } HRESULT __stdcall IsViewModeSupported(Windows::UI::ViewManagement::ApplicationViewMode viewMode, bool* isViewModeSupported) noexcept final { try { typename D::abi_guard guard(this->shim()); *isViewModeSupported = detach_abi(this->shim().IsViewModeSupported(*reinterpret_cast<Windows::UI::ViewManagement::ApplicationViewMode const*>(&viewMode))); return S_OK; } catch (...) { return impl::to_hresult(); } } HRESULT __stdcall TryEnterViewModeAsync(Windows::UI::ViewManagement::ApplicationViewMode viewMode, ::IUnknown** operation) noexcept final { try { typename D::abi_guard guard(this->shim()); *operation = detach_abi(this->shim().TryEnterViewModeAsync(*reinterpret_cast<Windows::UI::ViewManagement::ApplicationViewMode const*>(&viewMode))); return S_OK; } catch (...) { *operation = nullptr; return impl::to_hresult(); } } HRESULT __stdcall TryEnterViewModeWithPreferencesAsync(Windows::UI::ViewManagement::ApplicationViewMode viewMode, ::IUnknown* viewModePreferences, ::IUnknown** operation) noexcept final { try { typename D::abi_guard guard(this->shim()); *operation = detach_abi(this->shim().TryEnterViewModeAsync(*reinterpret_cast<Windows::UI::ViewManagement::ApplicationViewMode const*>(&viewMode), *reinterpret_cast<Windows::UI::ViewManagement::ViewModePreferences const*>(&viewModePreferences))); return S_OK; } catch (...) { *operation = nullptr; return impl::to_hresult(); } } HRESULT __stdcall TryConsolidateAsync(::IUnknown** operation) noexcept final { try { typename D::abi_guard guard(this->shim()); *operation = detach_abi(this->shim().TryConsolidateAsync()); return S_OK; } catch (...) { *operation = nullptr; return impl::to_hresult(); } } }; template <typename D> struct produce<D, Windows::UI::ViewManagement::IApplicationViewConsolidatedEventArgs> : produce_base<D, Windows::UI::ViewManagement::IApplicationViewConsolidatedEventArgs> { HRESULT __stdcall get_IsUserInitiated(bool* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().IsUserInitiated()); return S_OK; } }; template <typename D> struct produce<D, Windows::UI::ViewManagement::IApplicationViewConsolidatedEventArgs2> : produce_base<D, Windows::UI::ViewManagement::IApplicationViewConsolidatedEventArgs2> { HRESULT __stdcall get_IsAppInitiated(bool* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().IsAppInitiated()); return S_OK; } }; template <typename D> struct produce<D, Windows::UI::ViewManagement::IApplicationViewFullscreenStatics> : produce_base<D, Windows::UI::ViewManagement::IApplicationViewFullscreenStatics> { HRESULT __stdcall TryUnsnapToFullscreen(bool* success) noexcept final { try { typename D::abi_guard guard(this->shim()); *success = detach_abi(this->shim().TryUnsnapToFullscreen()); return S_OK; } catch (...) { return impl::to_hresult(); } } }; template <typename D> struct produce<D, Windows::UI::ViewManagement::IApplicationViewInteropStatics> : produce_base<D, Windows::UI::ViewManagement::IApplicationViewInteropStatics> { HRESULT __stdcall GetApplicationViewIdForWindow(::IUnknown* window, int32_t* id) noexcept final { try { typename D::abi_guard guard(this->shim()); *id = detach_abi(this->shim().GetApplicationViewIdForWindow(*reinterpret_cast<Windows::UI::Core::ICoreWindow const*>(&window))); return S_OK; } catch (...) { return impl::to_hresult(); } } }; template <typename D> struct produce<D, Windows::UI::ViewManagement::IApplicationViewScaling> : produce_base<D, Windows::UI::ViewManagement::IApplicationViewScaling> {}; template <typename D> struct produce<D, Windows::UI::ViewManagement::IApplicationViewScalingStatics> : produce_base<D, Windows::UI::ViewManagement::IApplicationViewScalingStatics> { HRESULT __stdcall get_DisableLayoutScaling(bool* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().DisableLayoutScaling()); return S_OK; } HRESULT __stdcall TrySetDisableLayoutScaling(bool disableLayoutScaling, bool* success) noexcept final { try { typename D::abi_guard guard(this->shim()); *success = detach_abi(this->shim().TrySetDisableLayoutScaling(disableLayoutScaling)); return S_OK; } catch (...) { return impl::to_hresult(); } } }; template <typename D> struct produce<D, Windows::UI::ViewManagement::IApplicationViewStatics> : produce_base<D, Windows::UI::ViewManagement::IApplicationViewStatics> { HRESULT __stdcall get_Value(Windows::UI::ViewManagement::ApplicationViewState* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().Value()); return S_OK; } HRESULT __stdcall TryUnsnap(bool* success) noexcept final { try { typename D::abi_guard guard(this->shim()); *success = detach_abi(this->shim().TryUnsnap()); return S_OK; } catch (...) { return impl::to_hresult(); } } }; template <typename D> struct produce<D, Windows::UI::ViewManagement::IApplicationViewStatics2> : produce_base<D, Windows::UI::ViewManagement::IApplicationViewStatics2> { HRESULT __stdcall GetForCurrentView(::IUnknown** current) noexcept final { try { typename D::abi_guard guard(this->shim()); *current = detach_abi(this->shim().GetForCurrentView()); return S_OK; } catch (...) { *current = nullptr; return impl::to_hresult(); } } HRESULT __stdcall get_TerminateAppOnFinalViewClose(bool* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().TerminateAppOnFinalViewClose()); return S_OK; } HRESULT __stdcall put_TerminateAppOnFinalViewClose(bool value) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().TerminateAppOnFinalViewClose(value); return S_OK; } }; template <typename D> struct produce<D, Windows::UI::ViewManagement::IApplicationViewStatics3> : produce_base<D, Windows::UI::ViewManagement::IApplicationViewStatics3> { HRESULT __stdcall get_PreferredLaunchWindowingMode(Windows::UI::ViewManagement::ApplicationViewWindowingMode* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().PreferredLaunchWindowingMode()); return S_OK; } HRESULT __stdcall put_PreferredLaunchWindowingMode(Windows::UI::ViewManagement::ApplicationViewWindowingMode value) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().PreferredLaunchWindowingMode(*reinterpret_cast<Windows::UI::ViewManagement::ApplicationViewWindowingMode const*>(&value)); return S_OK; } HRESULT __stdcall get_PreferredLaunchViewSize(Windows::Foundation::Size* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().PreferredLaunchViewSize()); return S_OK; } HRESULT __stdcall put_PreferredLaunchViewSize(Windows::Foundation::Size value) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().PreferredLaunchViewSize(*reinterpret_cast<Windows::Foundation::Size const*>(&value)); return S_OK; } }; template <typename D> struct produce<D, Windows::UI::ViewManagement::IApplicationViewSwitcherStatics> : produce_base<D, Windows::UI::ViewManagement::IApplicationViewSwitcherStatics> { HRESULT __stdcall DisableShowingMainViewOnActivation() noexcept final { try { typename D::abi_guard guard(this->shim()); this->shim().DisableShowingMainViewOnActivation(); return S_OK; } catch (...) { return impl::to_hresult(); } } HRESULT __stdcall TryShowAsStandaloneAsync(int32_t viewId, ::IUnknown** operation) noexcept final { try { typename D::abi_guard guard(this->shim()); *operation = detach_abi(this->shim().TryShowAsStandaloneAsync(viewId)); return S_OK; } catch (...) { *operation = nullptr; return impl::to_hresult(); } } HRESULT __stdcall TryShowAsStandaloneWithSizePreferenceAsync(int32_t viewId, Windows::UI::ViewManagement::ViewSizePreference sizePreference, ::IUnknown** operation) noexcept final { try { typename D::abi_guard guard(this->shim()); *operation = detach_abi(this->shim().TryShowAsStandaloneAsync(viewId, *reinterpret_cast<Windows::UI::ViewManagement::ViewSizePreference const*>(&sizePreference))); return S_OK; } catch (...) { *operation = nullptr; return impl::to_hresult(); } } HRESULT __stdcall TryShowAsStandaloneWithAnchorViewAndSizePreferenceAsync(int32_t viewId, Windows::UI::ViewManagement::ViewSizePreference sizePreference, int32_t anchorViewId, Windows::UI::ViewManagement::ViewSizePreference anchorSizePreference, ::IUnknown** operation) noexcept final { try { typename D::abi_guard guard(this->shim()); *operation = detach_abi(this->shim().TryShowAsStandaloneAsync(viewId, *reinterpret_cast<Windows::UI::ViewManagement::ViewSizePreference const*>(&sizePreference), anchorViewId, *reinterpret_cast<Windows::UI::ViewManagement::ViewSizePreference const*>(&anchorSizePreference))); return S_OK; } catch (...) { *operation = nullptr; return impl::to_hresult(); } } HRESULT __stdcall SwitchAsync(int32_t viewId, ::IUnknown** operation) noexcept final { try { typename D::abi_guard guard(this->shim()); *operation = detach_abi(this->shim().SwitchAsync(viewId)); return S_OK; } catch (...) { *operation = nullptr; return impl::to_hresult(); } } HRESULT __stdcall SwitchFromViewAsync(int32_t toViewId, int32_t fromViewId, ::IUnknown** operation) noexcept final { try { typename D::abi_guard guard(this->shim()); *operation = detach_abi(this->shim().SwitchAsync(toViewId, fromViewId)); return S_OK; } catch (...) { *operation = nullptr; return impl::to_hresult(); } } HRESULT __stdcall SwitchFromViewWithOptionsAsync(int32_t toViewId, int32_t fromViewId, Windows::UI::ViewManagement::ApplicationViewSwitchingOptions options, ::IUnknown** operation) noexcept final { try { typename D::abi_guard guard(this->shim()); *operation = detach_abi(this->shim().SwitchAsync(toViewId, fromViewId, *reinterpret_cast<Windows::UI::ViewManagement::ApplicationViewSwitchingOptions const*>(&options))); return S_OK; } catch (...) { *operation = nullptr; return impl::to_hresult(); } } HRESULT __stdcall PrepareForCustomAnimatedSwitchAsync(int32_t toViewId, int32_t fromViewId, Windows::UI::ViewManagement::ApplicationViewSwitchingOptions options, ::IUnknown** operation) noexcept final { try { typename D::abi_guard guard(this->shim()); *operation = detach_abi(this->shim().PrepareForCustomAnimatedSwitchAsync(toViewId, fromViewId, *reinterpret_cast<Windows::UI::ViewManagement::ApplicationViewSwitchingOptions const*>(&options))); return S_OK; } catch (...) { *operation = nullptr; return impl::to_hresult(); } } }; template <typename D> struct produce<D, Windows::UI::ViewManagement::IApplicationViewSwitcherStatics2> : produce_base<D, Windows::UI::ViewManagement::IApplicationViewSwitcherStatics2> { HRESULT __stdcall DisableSystemViewActivationPolicy() noexcept final { try { typename D::abi_guard guard(this->shim()); this->shim().DisableSystemViewActivationPolicy(); return S_OK; } catch (...) { return impl::to_hresult(); } } }; template <typename D> struct produce<D, Windows::UI::ViewManagement::IApplicationViewSwitcherStatics3> : produce_base<D, Windows::UI::ViewManagement::IApplicationViewSwitcherStatics3> { HRESULT __stdcall TryShowAsViewModeAsync(int32_t viewId, Windows::UI::ViewManagement::ApplicationViewMode viewMode, ::IUnknown** operation) noexcept final { try { typename D::abi_guard guard(this->shim()); *operation = detach_abi(this->shim().TryShowAsViewModeAsync(viewId, *reinterpret_cast<Windows::UI::ViewManagement::ApplicationViewMode const*>(&viewMode))); return S_OK; } catch (...) { *operation = nullptr; return impl::to_hresult(); } } HRESULT __stdcall TryShowAsViewModeWithPreferencesAsync(int32_t viewId, Windows::UI::ViewManagement::ApplicationViewMode viewMode, ::IUnknown* viewModePreferences, ::IUnknown** operation) noexcept final { try { typename D::abi_guard guard(this->shim()); *operation = detach_abi(this->shim().TryShowAsViewModeAsync(viewId, *reinterpret_cast<Windows::UI::ViewManagement::ApplicationViewMode const*>(&viewMode), *reinterpret_cast<Windows::UI::ViewManagement::ViewModePreferences const*>(&viewModePreferences))); return S_OK; } catch (...) { *operation = nullptr; return impl::to_hresult(); } } }; template <typename D> struct produce<D, Windows::UI::ViewManagement::IApplicationViewTitleBar> : produce_base<D, Windows::UI::ViewManagement::IApplicationViewTitleBar> { HRESULT __stdcall put_ForegroundColor(::IUnknown* value) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().ForegroundColor(*reinterpret_cast<Windows::Foundation::IReference<Windows::UI::Color> const*>(&value)); return S_OK; } HRESULT __stdcall get_ForegroundColor(::IUnknown** value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().ForegroundColor()); return S_OK; } HRESULT __stdcall put_BackgroundColor(::IUnknown* value) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().BackgroundColor(*reinterpret_cast<Windows::Foundation::IReference<Windows::UI::Color> const*>(&value)); return S_OK; } HRESULT __stdcall get_BackgroundColor(::IUnknown** value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().BackgroundColor()); return S_OK; } HRESULT __stdcall put_ButtonForegroundColor(::IUnknown* value) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().ButtonForegroundColor(*reinterpret_cast<Windows::Foundation::IReference<Windows::UI::Color> const*>(&value)); return S_OK; } HRESULT __stdcall get_ButtonForegroundColor(::IUnknown** value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().ButtonForegroundColor()); return S_OK; } HRESULT __stdcall put_ButtonBackgroundColor(::IUnknown* value) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().ButtonBackgroundColor(*reinterpret_cast<Windows::Foundation::IReference<Windows::UI::Color> const*>(&value)); return S_OK; } HRESULT __stdcall get_ButtonBackgroundColor(::IUnknown** value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().ButtonBackgroundColor()); return S_OK; } HRESULT __stdcall put_ButtonHoverForegroundColor(::IUnknown* value) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().ButtonHoverForegroundColor(*reinterpret_cast<Windows::Foundation::IReference<Windows::UI::Color> const*>(&value)); return S_OK; } HRESULT __stdcall get_ButtonHoverForegroundColor(::IUnknown** value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().ButtonHoverForegroundColor()); return S_OK; } HRESULT __stdcall put_ButtonHoverBackgroundColor(::IUnknown* value) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().ButtonHoverBackgroundColor(*reinterpret_cast<Windows::Foundation::IReference<Windows::UI::Color> const*>(&value)); return S_OK; } HRESULT __stdcall get_ButtonHoverBackgroundColor(::IUnknown** value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().ButtonHoverBackgroundColor()); return S_OK; } HRESULT __stdcall put_ButtonPressedForegroundColor(::IUnknown* value) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().ButtonPressedForegroundColor(*reinterpret_cast<Windows::Foundation::IReference<Windows::UI::Color> const*>(&value)); return S_OK; } HRESULT __stdcall get_ButtonPressedForegroundColor(::IUnknown** value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().ButtonPressedForegroundColor()); return S_OK; } HRESULT __stdcall put_ButtonPressedBackgroundColor(::IUnknown* value) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().ButtonPressedBackgroundColor(*reinterpret_cast<Windows::Foundation::IReference<Windows::UI::Color> const*>(&value)); return S_OK; } HRESULT __stdcall get_ButtonPressedBackgroundColor(::IUnknown** value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().ButtonPressedBackgroundColor()); return S_OK; } HRESULT __stdcall put_InactiveForegroundColor(::IUnknown* value) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().InactiveForegroundColor(*reinterpret_cast<Windows::Foundation::IReference<Windows::UI::Color> const*>(&value)); return S_OK; } HRESULT __stdcall get_InactiveForegroundColor(::IUnknown** value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().InactiveForegroundColor()); return S_OK; } HRESULT __stdcall put_InactiveBackgroundColor(::IUnknown* value) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().InactiveBackgroundColor(*reinterpret_cast<Windows::Foundation::IReference<Windows::UI::Color> const*>(&value)); return S_OK; } HRESULT __stdcall get_InactiveBackgroundColor(::IUnknown** value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().InactiveBackgroundColor()); return S_OK; } HRESULT __stdcall put_ButtonInactiveForegroundColor(::IUnknown* value) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().ButtonInactiveForegroundColor(*reinterpret_cast<Windows::Foundation::IReference<Windows::UI::Color> const*>(&value)); return S_OK; } HRESULT __stdcall get_ButtonInactiveForegroundColor(::IUnknown** value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().ButtonInactiveForegroundColor()); return S_OK; } HRESULT __stdcall put_ButtonInactiveBackgroundColor(::IUnknown* value) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().ButtonInactiveBackgroundColor(*reinterpret_cast<Windows::Foundation::IReference<Windows::UI::Color> const*>(&value)); return S_OK; } HRESULT __stdcall get_ButtonInactiveBackgroundColor(::IUnknown** value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().ButtonInactiveBackgroundColor()); return S_OK; } }; template <typename D> struct produce<D, Windows::UI::ViewManagement::IApplicationViewTransferContext> : produce_base<D, Windows::UI::ViewManagement::IApplicationViewTransferContext> { HRESULT __stdcall get_ViewId(int32_t* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().ViewId()); return S_OK; } HRESULT __stdcall put_ViewId(int32_t value) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().ViewId(value); return S_OK; } }; template <typename D> struct produce<D, Windows::UI::ViewManagement::IApplicationViewTransferContextStatics> : produce_base<D, Windows::UI::ViewManagement::IApplicationViewTransferContextStatics> { HRESULT __stdcall get_DataPackageFormatId(HSTRING* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().DataPackageFormatId()); return S_OK; } }; template <typename D> struct produce<D, Windows::UI::ViewManagement::IInputPane> : produce_base<D, Windows::UI::ViewManagement::IInputPane> { HRESULT __stdcall add_Showing(::IUnknown* handler, event_token* token) noexcept final { try { typename D::abi_guard guard(this->shim()); *token = detach_abi(this->shim().Showing(*reinterpret_cast<Windows::Foundation::TypedEventHandler<Windows::UI::ViewManagement::InputPane, Windows::UI::ViewManagement::InputPaneVisibilityEventArgs> const*>(&handler))); return S_OK; } catch (...) { return impl::to_hresult(); } } HRESULT __stdcall remove_Showing(event_token token) noexcept final { try { typename D::abi_guard guard(this->shim()); this->shim().Showing(*reinterpret_cast<event_token const*>(&token)); return S_OK; } catch (...) { return impl::to_hresult(); } } HRESULT __stdcall add_Hiding(::IUnknown* handler, event_token* token) noexcept final { try { typename D::abi_guard guard(this->shim()); *token = detach_abi(this->shim().Hiding(*reinterpret_cast<Windows::Foundation::TypedEventHandler<Windows::UI::ViewManagement::InputPane, Windows::UI::ViewManagement::InputPaneVisibilityEventArgs> const*>(&handler))); return S_OK; } catch (...) { return impl::to_hresult(); } } HRESULT __stdcall remove_Hiding(event_token token) noexcept final { try { typename D::abi_guard guard(this->shim()); this->shim().Hiding(*reinterpret_cast<event_token const*>(&token)); return S_OK; } catch (...) { return impl::to_hresult(); } } HRESULT __stdcall get_OccludedRect(Windows::Foundation::Rect* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().OccludedRect()); return S_OK; } }; template <typename D> struct produce<D, Windows::UI::ViewManagement::IInputPane2> : produce_base<D, Windows::UI::ViewManagement::IInputPane2> { HRESULT __stdcall TryShow(bool* result) noexcept final { try { typename D::abi_guard guard(this->shim()); *result = detach_abi(this->shim().TryShow()); return S_OK; } catch (...) { return impl::to_hresult(); } } HRESULT __stdcall TryHide(bool* result) noexcept final { try { typename D::abi_guard guard(this->shim()); *result = detach_abi(this->shim().TryHide()); return S_OK; } catch (...) { return impl::to_hresult(); } } }; template <typename D> struct produce<D, Windows::UI::ViewManagement::IInputPaneControl> : produce_base<D, Windows::UI::ViewManagement::IInputPaneControl> { HRESULT __stdcall get_Visible(bool* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().Visible()); return S_OK; } HRESULT __stdcall put_Visible(bool value) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().Visible(value); return S_OK; } }; template <typename D> struct produce<D, Windows::UI::ViewManagement::IInputPaneStatics> : produce_base<D, Windows::UI::ViewManagement::IInputPaneStatics> { HRESULT __stdcall GetForCurrentView(::IUnknown** inputPane) noexcept final { try { typename D::abi_guard guard(this->shim()); *inputPane = detach_abi(this->shim().GetForCurrentView()); return S_OK; } catch (...) { *inputPane = nullptr; return impl::to_hresult(); } } }; template <typename D> struct produce<D, Windows::UI::ViewManagement::IInputPaneVisibilityEventArgs> : produce_base<D, Windows::UI::ViewManagement::IInputPaneVisibilityEventArgs> { HRESULT __stdcall get_OccludedRect(Windows::Foundation::Rect* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().OccludedRect()); return S_OK; } HRESULT __stdcall put_EnsuredFocusedElementInView(bool value) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().EnsuredFocusedElementInView(value); return S_OK; } HRESULT __stdcall get_EnsuredFocusedElementInView(bool* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().EnsuredFocusedElementInView()); return S_OK; } }; template <typename D> struct produce<D, Windows::UI::ViewManagement::IProjectionManagerStatics> : produce_base<D, Windows::UI::ViewManagement::IProjectionManagerStatics> { HRESULT __stdcall StartProjectingAsync(int32_t projectionViewId, int32_t anchorViewId, ::IUnknown** operation) noexcept final { try { typename D::abi_guard guard(this->shim()); *operation = detach_abi(this->shim().StartProjectingAsync(projectionViewId, anchorViewId)); return S_OK; } catch (...) { *operation = nullptr; return impl::to_hresult(); } } HRESULT __stdcall SwapDisplaysForViewsAsync(int32_t projectionViewId, int32_t anchorViewId, ::IUnknown** operation) noexcept final { try { typename D::abi_guard guard(this->shim()); *operation = detach_abi(this->shim().SwapDisplaysForViewsAsync(projectionViewId, anchorViewId)); return S_OK; } catch (...) { *operation = nullptr; return impl::to_hresult(); } } HRESULT __stdcall StopProjectingAsync(int32_t projectionViewId, int32_t anchorViewId, ::IUnknown** operation) noexcept final { try { typename D::abi_guard guard(this->shim()); *operation = detach_abi(this->shim().StopProjectingAsync(projectionViewId, anchorViewId)); return S_OK; } catch (...) { *operation = nullptr; return impl::to_hresult(); } } HRESULT __stdcall get_ProjectionDisplayAvailable(bool* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().ProjectionDisplayAvailable()); return S_OK; } HRESULT __stdcall add_ProjectionDisplayAvailableChanged(::IUnknown* handler, event_token* token) noexcept final { try { typename D::abi_guard guard(this->shim()); *token = detach_abi(this->shim().ProjectionDisplayAvailableChanged(*reinterpret_cast<Windows::Foundation::EventHandler<Windows::Foundation::IInspectable> const*>(&handler))); return S_OK; } catch (...) { return impl::to_hresult(); } } HRESULT __stdcall remove_ProjectionDisplayAvailableChanged(event_token token) noexcept final { try { typename D::abi_guard guard(this->shim()); this->shim().ProjectionDisplayAvailableChanged(*reinterpret_cast<event_token const*>(&token)); return S_OK; } catch (...) { return impl::to_hresult(); } } }; template <typename D> struct produce<D, Windows::UI::ViewManagement::IProjectionManagerStatics2> : produce_base<D, Windows::UI::ViewManagement::IProjectionManagerStatics2> { HRESULT __stdcall StartProjectingWithDeviceInfoAsync(int32_t projectionViewId, int32_t anchorViewId, ::IUnknown* displayDeviceInfo, ::IUnknown** operation) noexcept final { try { typename D::abi_guard guard(this->shim()); *operation = detach_abi(this->shim().StartProjectingAsync(projectionViewId, anchorViewId, *reinterpret_cast<Windows::Devices::Enumeration::DeviceInformation const*>(&displayDeviceInfo))); return S_OK; } catch (...) { *operation = nullptr; return impl::to_hresult(); } } HRESULT __stdcall RequestStartProjectingAsync(int32_t projectionViewId, int32_t anchorViewId, Windows::Foundation::Rect selection, ::IUnknown** operation) noexcept final { try { typename D::abi_guard guard(this->shim()); *operation = detach_abi(this->shim().RequestStartProjectingAsync(projectionViewId, anchorViewId, *reinterpret_cast<Windows::Foundation::Rect const*>(&selection))); return S_OK; } catch (...) { *operation = nullptr; return impl::to_hresult(); } } HRESULT __stdcall RequestStartProjectingWithPlacementAsync(int32_t projectionViewId, int32_t anchorViewId, Windows::Foundation::Rect selection, Windows::UI::Popups::Placement prefferedPlacement, ::IUnknown** operation) noexcept final { try { typename D::abi_guard guard(this->shim()); *operation = detach_abi(this->shim().RequestStartProjectingAsync(projectionViewId, anchorViewId, *reinterpret_cast<Windows::Foundation::Rect const*>(&selection), *reinterpret_cast<Windows::UI::Popups::Placement const*>(&prefferedPlacement))); return S_OK; } catch (...) { *operation = nullptr; return impl::to_hresult(); } } HRESULT __stdcall GetDeviceSelector(HSTRING* selector) noexcept final { try { typename D::abi_guard guard(this->shim()); *selector = detach_abi(this->shim().GetDeviceSelector()); return S_OK; } catch (...) { *selector = nullptr; return impl::to_hresult(); } } }; template <typename D> struct produce<D, Windows::UI::ViewManagement::IStatusBar> : produce_base<D, Windows::UI::ViewManagement::IStatusBar> { HRESULT __stdcall ShowAsync(::IUnknown** returnValue) noexcept final { try { typename D::abi_guard guard(this->shim()); *returnValue = detach_abi(this->shim().ShowAsync()); return S_OK; } catch (...) { *returnValue = nullptr; return impl::to_hresult(); } } HRESULT __stdcall HideAsync(::IUnknown** returnValue) noexcept final { try { typename D::abi_guard guard(this->shim()); *returnValue = detach_abi(this->shim().HideAsync()); return S_OK; } catch (...) { *returnValue = nullptr; return impl::to_hresult(); } } HRESULT __stdcall get_BackgroundOpacity(double* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().BackgroundOpacity()); return S_OK; } HRESULT __stdcall put_BackgroundOpacity(double value) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().BackgroundOpacity(value); return S_OK; } HRESULT __stdcall get_ForegroundColor(::IUnknown** value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().ForegroundColor()); return S_OK; } HRESULT __stdcall put_ForegroundColor(::IUnknown* value) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().ForegroundColor(*reinterpret_cast<Windows::Foundation::IReference<Windows::UI::Color> const*>(&value)); return S_OK; } HRESULT __stdcall get_BackgroundColor(::IUnknown** value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().BackgroundColor()); return S_OK; } HRESULT __stdcall put_BackgroundColor(::IUnknown* value) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().BackgroundColor(*reinterpret_cast<Windows::Foundation::IReference<Windows::UI::Color> const*>(&value)); return S_OK; } HRESULT __stdcall get_ProgressIndicator(::IUnknown** value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().ProgressIndicator()); return S_OK; } HRESULT __stdcall get_OccludedRect(Windows::Foundation::Rect* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().OccludedRect()); return S_OK; } HRESULT __stdcall add_Showing(::IUnknown* eventHandler, event_token* token) noexcept final { try { typename D::abi_guard guard(this->shim()); *token = detach_abi(this->shim().Showing(*reinterpret_cast<Windows::Foundation::TypedEventHandler<Windows::UI::ViewManagement::StatusBar, Windows::Foundation::IInspectable> const*>(&eventHandler))); return S_OK; } catch (...) { return impl::to_hresult(); } } HRESULT __stdcall remove_Showing(event_token token) noexcept final { try { typename D::abi_guard guard(this->shim()); this->shim().Showing(*reinterpret_cast<event_token const*>(&token)); return S_OK; } catch (...) { return impl::to_hresult(); } } HRESULT __stdcall add_Hiding(::IUnknown* eventHandler, event_token* token) noexcept final { try { typename D::abi_guard guard(this->shim()); *token = detach_abi(this->shim().Hiding(*reinterpret_cast<Windows::Foundation::TypedEventHandler<Windows::UI::ViewManagement::StatusBar, Windows::Foundation::IInspectable> const*>(&eventHandler))); return S_OK; } catch (...) { return impl::to_hresult(); } } HRESULT __stdcall remove_Hiding(event_token token) noexcept final { try { typename D::abi_guard guard(this->shim()); this->shim().Hiding(*reinterpret_cast<event_token const*>(&token)); return S_OK; } catch (...) { return impl::to_hresult(); } } }; template <typename D> struct produce<D, Windows::UI::ViewManagement::IStatusBarProgressIndicator> : produce_base<D, Windows::UI::ViewManagement::IStatusBarProgressIndicator> { HRESULT __stdcall ShowAsync(::IUnknown** returnValue) noexcept final { try { typename D::abi_guard guard(this->shim()); *returnValue = detach_abi(this->shim().ShowAsync()); return S_OK; } catch (...) { *returnValue = nullptr; return impl::to_hresult(); } } HRESULT __stdcall HideAsync(::IUnknown** returnValue) noexcept final { try { typename D::abi_guard guard(this->shim()); *returnValue = detach_abi(this->shim().HideAsync()); return S_OK; } catch (...) { *returnValue = nullptr; return impl::to_hresult(); } } HRESULT __stdcall get_Text(HSTRING* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().Text()); return S_OK; } HRESULT __stdcall put_Text(HSTRING value) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().Text(*reinterpret_cast<hstring const*>(&value)); return S_OK; } HRESULT __stdcall get_ProgressValue(::IUnknown** value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().ProgressValue()); return S_OK; } HRESULT __stdcall put_ProgressValue(::IUnknown* value) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().ProgressValue(*reinterpret_cast<Windows::Foundation::IReference<double> const*>(&value)); return S_OK; } }; template <typename D> struct produce<D, Windows::UI::ViewManagement::IStatusBarStatics> : produce_base<D, Windows::UI::ViewManagement::IStatusBarStatics> { HRESULT __stdcall GetForCurrentView(::IUnknown** value) noexcept final { try { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().GetForCurrentView()); return S_OK; } catch (...) { *value = nullptr; return impl::to_hresult(); } } }; template <typename D> struct produce<D, Windows::UI::ViewManagement::IUISettings> : produce_base<D, Windows::UI::ViewManagement::IUISettings> { HRESULT __stdcall get_HandPreference(Windows::UI::ViewManagement::HandPreference* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().HandPreference()); return S_OK; } HRESULT __stdcall get_CursorSize(Windows::Foundation::Size* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().CursorSize()); return S_OK; } HRESULT __stdcall get_ScrollBarSize(Windows::Foundation::Size* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().ScrollBarSize()); return S_OK; } HRESULT __stdcall get_ScrollBarArrowSize(Windows::Foundation::Size* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().ScrollBarArrowSize()); return S_OK; } HRESULT __stdcall get_ScrollBarThumbBoxSize(Windows::Foundation::Size* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().ScrollBarThumbBoxSize()); return S_OK; } HRESULT __stdcall get_MessageDuration(uint32_t* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().MessageDuration()); return S_OK; } HRESULT __stdcall get_AnimationsEnabled(bool* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().AnimationsEnabled()); return S_OK; } HRESULT __stdcall get_CaretBrowsingEnabled(bool* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().CaretBrowsingEnabled()); return S_OK; } HRESULT __stdcall get_CaretBlinkRate(uint32_t* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().CaretBlinkRate()); return S_OK; } HRESULT __stdcall get_CaretWidth(uint32_t* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().CaretWidth()); return S_OK; } HRESULT __stdcall get_DoubleClickTime(uint32_t* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().DoubleClickTime()); return S_OK; } HRESULT __stdcall get_MouseHoverTime(uint32_t* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().MouseHoverTime()); return S_OK; } HRESULT __stdcall UIElementColor(Windows::UI::ViewManagement::UIElementType desiredElement, struct_of<4>* value) noexcept final { try { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().UIElementColor(*reinterpret_cast<Windows::UI::ViewManagement::UIElementType const*>(&desiredElement))); return S_OK; } catch (...) { return impl::to_hresult(); } } }; template <typename D> struct produce<D, Windows::UI::ViewManagement::IUISettings2> : produce_base<D, Windows::UI::ViewManagement::IUISettings2> { HRESULT __stdcall get_TextScaleFactor(double* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().TextScaleFactor()); return S_OK; } HRESULT __stdcall add_TextScaleFactorChanged(::IUnknown* handler, event_token* cookie) noexcept final { try { typename D::abi_guard guard(this->shim()); *cookie = detach_abi(this->shim().TextScaleFactorChanged(*reinterpret_cast<Windows::Foundation::TypedEventHandler<Windows::UI::ViewManagement::UISettings, Windows::Foundation::IInspectable> const*>(&handler))); return S_OK; } catch (...) { return impl::to_hresult(); } } HRESULT __stdcall remove_TextScaleFactorChanged(event_token cookie) noexcept final { try { typename D::abi_guard guard(this->shim()); this->shim().TextScaleFactorChanged(*reinterpret_cast<event_token const*>(&cookie)); return S_OK; } catch (...) { return impl::to_hresult(); } } }; template <typename D> struct produce<D, Windows::UI::ViewManagement::IUISettings3> : produce_base<D, Windows::UI::ViewManagement::IUISettings3> { HRESULT __stdcall GetColorValue(Windows::UI::ViewManagement::UIColorType desiredColor, struct_of<4>* value) noexcept final { try { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().GetColorValue(*reinterpret_cast<Windows::UI::ViewManagement::UIColorType const*>(&desiredColor))); return S_OK; } catch (...) { return impl::to_hresult(); } } HRESULT __stdcall add_ColorValuesChanged(::IUnknown* handler, event_token* cookie) noexcept final { try { typename D::abi_guard guard(this->shim()); *cookie = detach_abi(this->shim().ColorValuesChanged(*reinterpret_cast<Windows::Foundation::TypedEventHandler<Windows::UI::ViewManagement::UISettings, Windows::Foundation::IInspectable> const*>(&handler))); return S_OK; } catch (...) { return impl::to_hresult(); } } HRESULT __stdcall remove_ColorValuesChanged(event_token cookie) noexcept final { try { typename D::abi_guard guard(this->shim()); this->shim().ColorValuesChanged(*reinterpret_cast<event_token const*>(&cookie)); return S_OK; } catch (...) { return impl::to_hresult(); } } }; template <typename D> struct produce<D, Windows::UI::ViewManagement::IUISettings4> : produce_base<D, Windows::UI::ViewManagement::IUISettings4> { HRESULT __stdcall get_AdvancedEffectsEnabled(bool* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().AdvancedEffectsEnabled()); return S_OK; } HRESULT __stdcall add_AdvancedEffectsEnabledChanged(::IUnknown* handler, event_token* cookie) noexcept final { try { typename D::abi_guard guard(this->shim()); *cookie = detach_abi(this->shim().AdvancedEffectsEnabledChanged(*reinterpret_cast<Windows::Foundation::TypedEventHandler<Windows::UI::ViewManagement::UISettings, Windows::Foundation::IInspectable> const*>(&handler))); return S_OK; } catch (...) { return impl::to_hresult(); } } HRESULT __stdcall remove_AdvancedEffectsEnabledChanged(event_token cookie) noexcept final { try { typename D::abi_guard guard(this->shim()); this->shim().AdvancedEffectsEnabledChanged(*reinterpret_cast<event_token const*>(&cookie)); return S_OK; } catch (...) { return impl::to_hresult(); } } }; template <typename D> struct produce<D, Windows::UI::ViewManagement::IUIViewSettings> : produce_base<D, Windows::UI::ViewManagement::IUIViewSettings> { HRESULT __stdcall get_UserInteractionMode(Windows::UI::ViewManagement::UserInteractionMode* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().UserInteractionMode()); return S_OK; } }; template <typename D> struct produce<D, Windows::UI::ViewManagement::IUIViewSettingsStatics> : produce_base<D, Windows::UI::ViewManagement::IUIViewSettingsStatics> { HRESULT __stdcall GetForCurrentView(::IUnknown** current) noexcept final { try { typename D::abi_guard guard(this->shim()); *current = detach_abi(this->shim().GetForCurrentView()); return S_OK; } catch (...) { *current = nullptr; return impl::to_hresult(); } } }; template <typename D> struct produce<D, Windows::UI::ViewManagement::IViewModePreferences> : produce_base<D, Windows::UI::ViewManagement::IViewModePreferences> { HRESULT __stdcall get_ViewSizePreference(Windows::UI::ViewManagement::ViewSizePreference* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().ViewSizePreference()); return S_OK; } HRESULT __stdcall put_ViewSizePreference(Windows::UI::ViewManagement::ViewSizePreference value) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().ViewSizePreference(*reinterpret_cast<Windows::UI::ViewManagement::ViewSizePreference const*>(&value)); return S_OK; } HRESULT __stdcall get_CustomSize(Windows::Foundation::Size* value) noexcept final { typename D::abi_guard guard(this->shim()); *value = detach_abi(this->shim().CustomSize()); return S_OK; } HRESULT __stdcall put_CustomSize(Windows::Foundation::Size value) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().CustomSize(*reinterpret_cast<Windows::Foundation::Size const*>(&value)); return S_OK; } }; template <typename D> struct produce<D, Windows::UI::ViewManagement::IViewModePreferencesStatics> : produce_base<D, Windows::UI::ViewManagement::IViewModePreferencesStatics> { HRESULT __stdcall CreateDefault(Windows::UI::ViewManagement::ApplicationViewMode mode, ::IUnknown** result) noexcept final { try { typename D::abi_guard guard(this->shim()); *result = detach_abi(this->shim().CreateDefault(*reinterpret_cast<Windows::UI::ViewManagement::ApplicationViewMode const*>(&mode))); return S_OK; } catch (...) { *result = nullptr; return impl::to_hresult(); } } }; } WINRT_EXPORT namespace winrt::Windows::UI::ViewManagement { inline AccessibilitySettings::AccessibilitySettings() : AccessibilitySettings(activate_instance<AccessibilitySettings>()) {} inline bool ApplicationView::TryUnsnapToFullscreen() { return get_activation_factory<ApplicationView, Windows::UI::ViewManagement::IApplicationViewFullscreenStatics>().TryUnsnapToFullscreen(); } inline int32_t ApplicationView::GetApplicationViewIdForWindow(Windows::UI::Core::ICoreWindow const& window) { return get_activation_factory<ApplicationView, Windows::UI::ViewManagement::IApplicationViewInteropStatics>().GetApplicationViewIdForWindow(window); } inline Windows::UI::ViewManagement::ApplicationViewState ApplicationView::Value() { return get_activation_factory<ApplicationView, Windows::UI::ViewManagement::IApplicationViewStatics>().Value(); } inline bool ApplicationView::TryUnsnap() { return get_activation_factory<ApplicationView, Windows::UI::ViewManagement::IApplicationViewStatics>().TryUnsnap(); } inline Windows::UI::ViewManagement::ApplicationView ApplicationView::GetForCurrentView() { return get_activation_factory<ApplicationView, Windows::UI::ViewManagement::IApplicationViewStatics2>().GetForCurrentView(); } inline bool ApplicationView::TerminateAppOnFinalViewClose() { return get_activation_factory<ApplicationView, Windows::UI::ViewManagement::IApplicationViewStatics2>().TerminateAppOnFinalViewClose(); } inline void ApplicationView::TerminateAppOnFinalViewClose(bool value) { get_activation_factory<ApplicationView, Windows::UI::ViewManagement::IApplicationViewStatics2>().TerminateAppOnFinalViewClose(value); } inline Windows::UI::ViewManagement::ApplicationViewWindowingMode ApplicationView::PreferredLaunchWindowingMode() { return get_activation_factory<ApplicationView, Windows::UI::ViewManagement::IApplicationViewStatics3>().PreferredLaunchWindowingMode(); } inline void ApplicationView::PreferredLaunchWindowingMode(Windows::UI::ViewManagement::ApplicationViewWindowingMode const& value) { get_activation_factory<ApplicationView, Windows::UI::ViewManagement::IApplicationViewStatics3>().PreferredLaunchWindowingMode(value); } inline Windows::Foundation::Size ApplicationView::PreferredLaunchViewSize() { return get_activation_factory<ApplicationView, Windows::UI::ViewManagement::IApplicationViewStatics3>().PreferredLaunchViewSize(); } inline void ApplicationView::PreferredLaunchViewSize(Windows::Foundation::Size const& value) { get_activation_factory<ApplicationView, Windows::UI::ViewManagement::IApplicationViewStatics3>().PreferredLaunchViewSize(value); } inline bool ApplicationViewScaling::DisableLayoutScaling() { return get_activation_factory<ApplicationViewScaling, Windows::UI::ViewManagement::IApplicationViewScalingStatics>().DisableLayoutScaling(); } inline bool ApplicationViewScaling::TrySetDisableLayoutScaling(bool disableLayoutScaling) { return get_activation_factory<ApplicationViewScaling, Windows::UI::ViewManagement::IApplicationViewScalingStatics>().TrySetDisableLayoutScaling(disableLayoutScaling); } inline void ApplicationViewSwitcher::DisableShowingMainViewOnActivation() { get_activation_factory<ApplicationViewSwitcher, Windows::UI::ViewManagement::IApplicationViewSwitcherStatics>().DisableShowingMainViewOnActivation(); } inline Windows::Foundation::IAsyncOperation<bool> ApplicationViewSwitcher::TryShowAsStandaloneAsync(int32_t viewId) { return get_activation_factory<ApplicationViewSwitcher, Windows::UI::ViewManagement::IApplicationViewSwitcherStatics>().TryShowAsStandaloneAsync(viewId); } inline Windows::Foundation::IAsyncOperation<bool> ApplicationViewSwitcher::TryShowAsStandaloneAsync(int32_t viewId, Windows::UI::ViewManagement::ViewSizePreference const& sizePreference) { return get_activation_factory<ApplicationViewSwitcher, Windows::UI::ViewManagement::IApplicationViewSwitcherStatics>().TryShowAsStandaloneAsync(viewId, sizePreference); } inline Windows::Foundation::IAsyncOperation<bool> ApplicationViewSwitcher::TryShowAsStandaloneAsync(int32_t viewId, Windows::UI::ViewManagement::ViewSizePreference const& sizePreference, int32_t anchorViewId, Windows::UI::ViewManagement::ViewSizePreference const& anchorSizePreference) { return get_activation_factory<ApplicationViewSwitcher, Windows::UI::ViewManagement::IApplicationViewSwitcherStatics>().TryShowAsStandaloneAsync(viewId, sizePreference, anchorViewId, anchorSizePreference); } inline Windows::Foundation::IAsyncAction ApplicationViewSwitcher::SwitchAsync(int32_t viewId) { return get_activation_factory<ApplicationViewSwitcher, Windows::UI::ViewManagement::IApplicationViewSwitcherStatics>().SwitchAsync(viewId); } inline Windows::Foundation::IAsyncAction ApplicationViewSwitcher::SwitchAsync(int32_t toViewId, int32_t fromViewId) { return get_activation_factory<ApplicationViewSwitcher, Windows::UI::ViewManagement::IApplicationViewSwitcherStatics>().SwitchAsync(toViewId, fromViewId); } inline Windows::Foundation::IAsyncAction ApplicationViewSwitcher::SwitchAsync(int32_t toViewId, int32_t fromViewId, Windows::UI::ViewManagement::ApplicationViewSwitchingOptions const& options) { return get_activation_factory<ApplicationViewSwitcher, Windows::UI::ViewManagement::IApplicationViewSwitcherStatics>().SwitchAsync(toViewId, fromViewId, options); } inline Windows::Foundation::IAsyncOperation<bool> ApplicationViewSwitcher::PrepareForCustomAnimatedSwitchAsync(int32_t toViewId, int32_t fromViewId, Windows::UI::ViewManagement::ApplicationViewSwitchingOptions const& options) { return get_activation_factory<ApplicationViewSwitcher, Windows::UI::ViewManagement::IApplicationViewSwitcherStatics>().PrepareForCustomAnimatedSwitchAsync(toViewId, fromViewId, options); } inline void ApplicationViewSwitcher::DisableSystemViewActivationPolicy() { get_activation_factory<ApplicationViewSwitcher, Windows::UI::ViewManagement::IApplicationViewSwitcherStatics2>().DisableSystemViewActivationPolicy(); } inline Windows::Foundation::IAsyncOperation<bool> ApplicationViewSwitcher::TryShowAsViewModeAsync(int32_t viewId, Windows::UI::ViewManagement::ApplicationViewMode const& viewMode) { return get_activation_factory<ApplicationViewSwitcher, Windows::UI::ViewManagement::IApplicationViewSwitcherStatics3>().TryShowAsViewModeAsync(viewId, viewMode); } inline Windows::Foundation::IAsyncOperation<bool> ApplicationViewSwitcher::TryShowAsViewModeAsync(int32_t viewId, Windows::UI::ViewManagement::ApplicationViewMode const& viewMode, Windows::UI::ViewManagement::ViewModePreferences const& viewModePreferences) { return get_activation_factory<ApplicationViewSwitcher, Windows::UI::ViewManagement::IApplicationViewSwitcherStatics3>().TryShowAsViewModeAsync(viewId, viewMode, viewModePreferences); } inline ApplicationViewTransferContext::ApplicationViewTransferContext() : ApplicationViewTransferContext(activate_instance<ApplicationViewTransferContext>()) {} inline hstring ApplicationViewTransferContext::DataPackageFormatId() { return get_activation_factory<ApplicationViewTransferContext, Windows::UI::ViewManagement::IApplicationViewTransferContextStatics>().DataPackageFormatId(); } inline Windows::UI::ViewManagement::InputPane InputPane::GetForCurrentView() { return get_activation_factory<InputPane, Windows::UI::ViewManagement::IInputPaneStatics>().GetForCurrentView(); } inline Windows::Foundation::IAsyncAction ProjectionManager::StartProjectingAsync(int32_t projectionViewId, int32_t anchorViewId) { return get_activation_factory<ProjectionManager, Windows::UI::ViewManagement::IProjectionManagerStatics>().StartProjectingAsync(projectionViewId, anchorViewId); } inline Windows::Foundation::IAsyncAction ProjectionManager::SwapDisplaysForViewsAsync(int32_t projectionViewId, int32_t anchorViewId) { return get_activation_factory<ProjectionManager, Windows::UI::ViewManagement::IProjectionManagerStatics>().SwapDisplaysForViewsAsync(projectionViewId, anchorViewId); } inline Windows::Foundation::IAsyncAction ProjectionManager::StopProjectingAsync(int32_t projectionViewId, int32_t anchorViewId) { return get_activation_factory<ProjectionManager, Windows::UI::ViewManagement::IProjectionManagerStatics>().StopProjectingAsync(projectionViewId, anchorViewId); } inline bool ProjectionManager::ProjectionDisplayAvailable() { return get_activation_factory<ProjectionManager, Windows::UI::ViewManagement::IProjectionManagerStatics>().ProjectionDisplayAvailable(); } inline event_token ProjectionManager::ProjectionDisplayAvailableChanged(Windows::Foundation::EventHandler<Windows::Foundation::IInspectable> const& handler) { return get_activation_factory<ProjectionManager, Windows::UI::ViewManagement::IProjectionManagerStatics>().ProjectionDisplayAvailableChanged(handler); } inline factory_event_revoker<Windows::UI::ViewManagement::IProjectionManagerStatics> ProjectionManager::ProjectionDisplayAvailableChanged(auto_revoke_t, Windows::Foundation::EventHandler<Windows::Foundation::IInspectable> const& handler) { auto factory = get_activation_factory<ProjectionManager, Windows::UI::ViewManagement::IProjectionManagerStatics>(); return { factory, &abi_t<Windows::UI::ViewManagement::IProjectionManagerStatics>::remove_ProjectionDisplayAvailableChanged, factory.ProjectionDisplayAvailableChanged(handler) }; } inline void ProjectionManager::ProjectionDisplayAvailableChanged(event_token const& token) { get_activation_factory<ProjectionManager, Windows::UI::ViewManagement::IProjectionManagerStatics>().ProjectionDisplayAvailableChanged(token); } inline Windows::Foundation::IAsyncAction ProjectionManager::StartProjectingAsync(int32_t projectionViewId, int32_t anchorViewId, Windows::Devices::Enumeration::DeviceInformation const& displayDeviceInfo) { return get_activation_factory<ProjectionManager, Windows::UI::ViewManagement::IProjectionManagerStatics2>().StartProjectingAsync(projectionViewId, anchorViewId, displayDeviceInfo); } inline Windows::Foundation::IAsyncOperation<bool> ProjectionManager::RequestStartProjectingAsync(int32_t projectionViewId, int32_t anchorViewId, Windows::Foundation::Rect const& selection) { return get_activation_factory<ProjectionManager, Windows::UI::ViewManagement::IProjectionManagerStatics2>().RequestStartProjectingAsync(projectionViewId, anchorViewId, selection); } inline Windows::Foundation::IAsyncOperation<bool> ProjectionManager::RequestStartProjectingAsync(int32_t projectionViewId, int32_t anchorViewId, Windows::Foundation::Rect const& selection, Windows::UI::Popups::Placement const& prefferedPlacement) { return get_activation_factory<ProjectionManager, Windows::UI::ViewManagement::IProjectionManagerStatics2>().RequestStartProjectingAsync(projectionViewId, anchorViewId, selection, prefferedPlacement); } inline hstring ProjectionManager::GetDeviceSelector() { return get_activation_factory<ProjectionManager, Windows::UI::ViewManagement::IProjectionManagerStatics2>().GetDeviceSelector(); } inline Windows::UI::ViewManagement::StatusBar StatusBar::GetForCurrentView() { return get_activation_factory<StatusBar, Windows::UI::ViewManagement::IStatusBarStatics>().GetForCurrentView(); } inline UISettings::UISettings() : UISettings(activate_instance<UISettings>()) {} inline Windows::UI::ViewManagement::UIViewSettings UIViewSettings::GetForCurrentView() { return get_activation_factory<UIViewSettings, Windows::UI::ViewManagement::IUIViewSettingsStatics>().GetForCurrentView(); } inline Windows::UI::ViewManagement::ViewModePreferences ViewModePreferences::CreateDefault(Windows::UI::ViewManagement::ApplicationViewMode const& mode) { return get_activation_factory<ViewModePreferences, Windows::UI::ViewManagement::IViewModePreferencesStatics>().CreateDefault(mode); } } WINRT_EXPORT namespace std { template<> struct hash<winrt::Windows::UI::ViewManagement::IAccessibilitySettings> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IAccessibilitySettings> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IActivationViewSwitcher> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IActivationViewSwitcher> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IApplicationView> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IApplicationView> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IApplicationView2> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IApplicationView2> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IApplicationView3> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IApplicationView3> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IApplicationView4> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IApplicationView4> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IApplicationViewConsolidatedEventArgs> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IApplicationViewConsolidatedEventArgs> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IApplicationViewConsolidatedEventArgs2> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IApplicationViewConsolidatedEventArgs2> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IApplicationViewFullscreenStatics> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IApplicationViewFullscreenStatics> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IApplicationViewInteropStatics> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IApplicationViewInteropStatics> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IApplicationViewScaling> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IApplicationViewScaling> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IApplicationViewScalingStatics> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IApplicationViewScalingStatics> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IApplicationViewStatics> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IApplicationViewStatics> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IApplicationViewStatics2> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IApplicationViewStatics2> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IApplicationViewStatics3> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IApplicationViewStatics3> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IApplicationViewSwitcherStatics> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IApplicationViewSwitcherStatics> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IApplicationViewSwitcherStatics2> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IApplicationViewSwitcherStatics2> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IApplicationViewSwitcherStatics3> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IApplicationViewSwitcherStatics3> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IApplicationViewTitleBar> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IApplicationViewTitleBar> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IApplicationViewTransferContext> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IApplicationViewTransferContext> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IApplicationViewTransferContextStatics> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IApplicationViewTransferContextStatics> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IInputPane> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IInputPane> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IInputPane2> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IInputPane2> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IInputPaneControl> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IInputPaneControl> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IInputPaneStatics> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IInputPaneStatics> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IInputPaneVisibilityEventArgs> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IInputPaneVisibilityEventArgs> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IProjectionManagerStatics> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IProjectionManagerStatics> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IProjectionManagerStatics2> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IProjectionManagerStatics2> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IStatusBar> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IStatusBar> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IStatusBarProgressIndicator> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IStatusBarProgressIndicator> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IStatusBarStatics> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IStatusBarStatics> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IUISettings> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IUISettings> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IUISettings2> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IUISettings2> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IUISettings3> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IUISettings3> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IUISettings4> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IUISettings4> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IUIViewSettings> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IUIViewSettings> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IUIViewSettingsStatics> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IUIViewSettingsStatics> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IViewModePreferences> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IViewModePreferences> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::IViewModePreferencesStatics> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::IViewModePreferencesStatics> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::AccessibilitySettings> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::AccessibilitySettings> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::ActivationViewSwitcher> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::ActivationViewSwitcher> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::ApplicationView> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::ApplicationView> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::ApplicationViewConsolidatedEventArgs> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::ApplicationViewConsolidatedEventArgs> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::ApplicationViewScaling> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::ApplicationViewScaling> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::ApplicationViewSwitcher> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::ApplicationViewSwitcher> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::ApplicationViewTitleBar> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::ApplicationViewTitleBar> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::ApplicationViewTransferContext> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::ApplicationViewTransferContext> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::InputPane> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::InputPane> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::InputPaneVisibilityEventArgs> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::InputPaneVisibilityEventArgs> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::ProjectionManager> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::ProjectionManager> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::StatusBar> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::StatusBar> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::StatusBarProgressIndicator> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::StatusBarProgressIndicator> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::UISettings> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::UISettings> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::UIViewSettings> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::UIViewSettings> {}; template<> struct hash<winrt::Windows::UI::ViewManagement::ViewModePreferences> : winrt::impl::impl_hash_unknown<winrt::Windows::UI::ViewManagement::ViewModePreferences> {}; } WINRT_WARNING_POP
[ "dngoins@hotmail.com" ]
dngoins@hotmail.com
e6e1a2801ffe639b9b801e7eb7443fb66a0ae71a
0db10f9d35a9cea4165ffbe62cf7f19cae252056
/src/nnet/nnet-lstm-projected.h
e4f956f67492640b3a0d788642943e64213ec6f9
[ "Apache-2.0", "LicenseRef-scancode-public-domain" ]
permissive
nichongjia/kaldi
4da4b985f8fe3b484d60d8929d4b9046f8174372
c7a2331e593da84ad43d13f902b8c6971a1f5bb1
refs/heads/master
2021-01-17T16:08:46.590348
2017-07-21T07:09:48
2017-07-21T07:09:48
72,055,985
1
0
null
2016-10-27T00:23:45
2016-10-27T00:23:45
null
UTF-8
C++
false
false
30,412
h
// nnet/nnet-lstm-projected-streams.h // Copyright 2015-2016 Brno University of Technology (author: Karel Vesely) // Copyright 2014 Jiayu DU (Jerry), Wei Li // See ../../COPYING for clarification regarding multiple authors // // 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 // // THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED // WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, // MERCHANTABLITY OR NON-INFRINGEMENT. // See the Apache 2 License for the specific language governing permissions and // limitations under the License. #ifndef KALDI_NNET_NNET_LSTM_PROJECTED_H_ #define KALDI_NNET_NNET_LSTM_PROJECTED_H_ #include <string> #include <vector> #include "nnet/nnet-component.h" #include "nnet/nnet-utils.h" #include "cudamatrix/cu-math.h" /************************************* * x: input neuron * g: squashing neuron near input * i: Input gate * f: Forget gate * o: Output gate * c: memory Cell (CEC) * h: squashing neuron near output * m: output neuron of Memory block * r: recurrent projection neuron * y: output neuron of LSTMP *************************************/ namespace kaldi { namespace nnet1 { class LstmProjected : public MultistreamComponent { public: LstmProjected(int32 input_dim, int32 output_dim): MultistreamComponent(input_dim, output_dim), cell_dim_(0), proj_dim_(output_dim), cell_clip_(50.0), diff_clip_(1.0), cell_diff_clip_(0.0), grad_clip_(250.0) { } ~LstmProjected() { } Component* Copy() const { return new LstmProjected(*this); } ComponentType GetType() const { return kLstmProjected; } void InitData(std::istream &is) { // define options, float param_range = 0.1; // parse the line from prototype, std::string token; while (is >> std::ws, !is.eof()) { ReadToken(is, false, &token); /**/ if (token == "<ParamRange>") ReadBasicType(is, false, &param_range); else if (token == "<CellDim>") ReadBasicType(is, false, &cell_dim_); else if (token == "<LearnRateCoef>") ReadBasicType(is, false, &learn_rate_coef_); else if (token == "<BiasLearnRateCoef>") ReadBasicType(is, false, &bias_learn_rate_coef_); else if (token == "<CellClip>") ReadBasicType(is, false, &cell_clip_); else if (token == "<DiffClip>") ReadBasicType(is, false, &diff_clip_); else if (token == "<CellDiffClip>") ReadBasicType(is, false, &cell_diff_clip_); else if (token == "<GradClip>") ReadBasicType(is, false, &grad_clip_); else KALDI_ERR << "Unknown token " << token << ", a typo in config?" << " (ParamRange|CellDim|LearnRateCoef|BiasLearnRateCoef|CellClip|DiffClip|GradClip)"; } // init the weights and biases (from uniform dist.), w_gifo_x_.Resize(4*cell_dim_, input_dim_, kUndefined); w_gifo_r_.Resize(4*cell_dim_, proj_dim_, kUndefined); bias_.Resize(4*cell_dim_, kUndefined); peephole_i_c_.Resize(cell_dim_, kUndefined); peephole_f_c_.Resize(cell_dim_, kUndefined); peephole_o_c_.Resize(cell_dim_, kUndefined); w_r_m_.Resize(proj_dim_, cell_dim_, kUndefined); // (mean), (range) RandUniform(0.0, 2.0 * param_range, &w_gifo_x_); RandUniform(0.0, 2.0 * param_range, &w_gifo_r_); RandUniform(0.0, 2.0 * param_range, &bias_); RandUniform(0.0, 2.0 * param_range, &peephole_i_c_); RandUniform(0.0, 2.0 * param_range, &peephole_f_c_); RandUniform(0.0, 2.0 * param_range, &peephole_o_c_); RandUniform(0.0, 2.0 * param_range, &w_r_m_); KALDI_ASSERT(cell_dim_ > 0); KALDI_ASSERT(learn_rate_coef_ >= 0.0); KALDI_ASSERT(bias_learn_rate_coef_ >= 0.0); } void ReadData(std::istream &is, bool binary) { // Read all the '<Tokens>' in arbitrary order, while ('<' == Peek(is, binary)) { std::string token; int first_char = PeekToken(is, binary); switch (first_char) { case 'C': ReadToken(is, false, &token); /**/ if (token == "<CellDim>") ReadBasicType(is, binary, &cell_dim_); else if (token == "<CellClip>") ReadBasicType(is, binary, &cell_clip_); else if (token == "<CellDiffClip>") ReadBasicType(is, binary, &cell_diff_clip_); else if (token == "<ClipGradient>") ReadBasicType(is, binary, &grad_clip_); // bwd-compat. else KALDI_ERR << "Unknown token: " << token; break; case 'L': ExpectToken(is, binary, "<LearnRateCoef>"); ReadBasicType(is, binary, &learn_rate_coef_); break; case 'B': ExpectToken(is, binary, "<BiasLearnRateCoef>"); ReadBasicType(is, binary, &bias_learn_rate_coef_); break; case 'D': ExpectToken(is, binary, "<DiffClip>"); ReadBasicType(is, binary, &diff_clip_); break; case 'G': ExpectToken(is, binary, "<GradClip>"); ReadBasicType(is, binary, &grad_clip_); break; default: ReadToken(is, false, &token); KALDI_ERR << "Unknown token: " << token; } } KALDI_ASSERT(cell_dim_ != 0); // Read the model parameters, w_gifo_x_.Read(is, binary); w_gifo_r_.Read(is, binary); bias_.Read(is, binary); peephole_i_c_.Read(is, binary); peephole_f_c_.Read(is, binary); peephole_o_c_.Read(is, binary); w_r_m_.Read(is, binary); } void WriteData(std::ostream &os, bool binary) const { WriteToken(os, binary, "<CellDim>"); WriteBasicType(os, binary, cell_dim_); WriteToken(os, binary, "<LearnRateCoef>"); WriteBasicType(os, binary, learn_rate_coef_); WriteToken(os, binary, "<BiasLearnRateCoef>"); WriteBasicType(os, binary, bias_learn_rate_coef_); WriteToken(os, binary, "<CellClip>"); WriteBasicType(os, binary, cell_clip_); WriteToken(os, binary, "<DiffClip>"); WriteBasicType(os, binary, diff_clip_); WriteToken(os, binary, "<CellDiffClip>"); WriteBasicType(os, binary, cell_diff_clip_); WriteToken(os, binary, "<GradClip>"); WriteBasicType(os, binary, grad_clip_); // write model parameters, if (!binary) os << "\n"; w_gifo_x_.Write(os, binary); w_gifo_r_.Write(os, binary); bias_.Write(os, binary); peephole_i_c_.Write(os, binary); peephole_f_c_.Write(os, binary); peephole_o_c_.Write(os, binary); w_r_m_.Write(os, binary); } int32 NumParams() const { return ( w_gifo_x_.NumRows() * w_gifo_x_.NumCols() + w_gifo_r_.NumRows() * w_gifo_r_.NumCols() + bias_.Dim() + peephole_i_c_.Dim() + peephole_f_c_.Dim() + peephole_o_c_.Dim() + w_r_m_.NumRows() * w_r_m_.NumCols() ); } void GetGradient(VectorBase<BaseFloat>* gradient) const { KALDI_ASSERT(gradient->Dim() == NumParams()); int32 offset, len; offset = 0; len = w_gifo_x_.NumRows() * w_gifo_x_.NumCols(); gradient->Range(offset, len).CopyRowsFromMat(w_gifo_x_corr_); offset += len; len = w_gifo_r_.NumRows() * w_gifo_r_.NumCols(); gradient->Range(offset, len).CopyRowsFromMat(w_gifo_r_corr_); offset += len; len = bias_.Dim(); gradient->Range(offset, len).CopyFromVec(bias_corr_); offset += len; len = peephole_i_c_.Dim(); gradient->Range(offset, len).CopyFromVec(peephole_i_c_corr_); offset += len; len = peephole_f_c_.Dim(); gradient->Range(offset, len).CopyFromVec(peephole_f_c_corr_); offset += len; len = peephole_o_c_.Dim(); gradient->Range(offset, len).CopyFromVec(peephole_o_c_corr_); offset += len; len = w_r_m_.NumRows() * w_r_m_.NumCols(); gradient->Range(offset, len).CopyRowsFromMat(w_r_m_corr_); offset += len; KALDI_ASSERT(offset == NumParams()); } void GetParams(VectorBase<BaseFloat>* params) const { KALDI_ASSERT(params->Dim() == NumParams()); int32 offset, len; offset = 0; len = w_gifo_x_.NumRows() * w_gifo_x_.NumCols(); params->Range(offset, len).CopyRowsFromMat(w_gifo_x_); offset += len; len = w_gifo_r_.NumRows() * w_gifo_r_.NumCols(); params->Range(offset, len).CopyRowsFromMat(w_gifo_r_); offset += len; len = bias_.Dim(); params->Range(offset, len).CopyFromVec(bias_); offset += len; len = peephole_i_c_.Dim(); params->Range(offset, len).CopyFromVec(peephole_i_c_); offset += len; len = peephole_f_c_.Dim(); params->Range(offset, len).CopyFromVec(peephole_f_c_); offset += len; len = peephole_o_c_.Dim(); params->Range(offset, len).CopyFromVec(peephole_o_c_); offset += len; len = w_r_m_.NumRows() * w_r_m_.NumCols(); params->Range(offset, len).CopyRowsFromMat(w_r_m_); offset += len; KALDI_ASSERT(offset == NumParams()); } void SetParams(const VectorBase<BaseFloat>& params) { KALDI_ASSERT(params.Dim() == NumParams()); int32 offset, len; offset = 0; len = w_gifo_x_.NumRows() * w_gifo_x_.NumCols(); w_gifo_x_.CopyRowsFromVec(params.Range(offset, len)); offset += len; len = w_gifo_r_.NumRows() * w_gifo_r_.NumCols(); w_gifo_r_.CopyRowsFromVec(params.Range(offset, len)); offset += len; len = bias_.Dim(); bias_.CopyFromVec(params.Range(offset, len)); offset += len; len = peephole_i_c_.Dim(); peephole_i_c_.CopyFromVec(params.Range(offset, len)); offset += len; len = peephole_f_c_.Dim(); peephole_f_c_.CopyFromVec(params.Range(offset, len)); offset += len; len = peephole_o_c_.Dim(); peephole_o_c_.CopyFromVec(params.Range(offset, len)); offset += len; len = w_r_m_.NumRows() * w_r_m_.NumCols(); w_r_m_.CopyRowsFromVec(params.Range(offset, len)); offset += len; KALDI_ASSERT(offset == NumParams()); } std::string Info() const { return std::string("cell-dim ") + ToString(cell_dim_) + " " + "( learn_rate_coef_ " + ToString(learn_rate_coef_) + ", bias_learn_rate_coef_ " + ToString(bias_learn_rate_coef_) + ", cell_clip_ " + ToString(cell_clip_) + ", diff_clip_ " + ToString(diff_clip_) + ", grad_clip_ " + ToString(grad_clip_) + " )" + "\n w_gifo_x_ " + MomentStatistics(w_gifo_x_) + "\n w_gifo_r_ " + MomentStatistics(w_gifo_r_) + "\n bias_ " + MomentStatistics(bias_) + "\n peephole_i_c_ " + MomentStatistics(peephole_i_c_) + "\n peephole_f_c_ " + MomentStatistics(peephole_f_c_) + "\n peephole_o_c_ " + MomentStatistics(peephole_o_c_) + "\n w_r_m_ " + MomentStatistics(w_r_m_); } std::string InfoGradient() const { // disassemble forward-propagation buffer into different neurons, const CuSubMatrix<BaseFloat> YG(propagate_buf_.ColRange(0*cell_dim_, cell_dim_)); const CuSubMatrix<BaseFloat> YI(propagate_buf_.ColRange(1*cell_dim_, cell_dim_)); const CuSubMatrix<BaseFloat> YF(propagate_buf_.ColRange(2*cell_dim_, cell_dim_)); const CuSubMatrix<BaseFloat> YO(propagate_buf_.ColRange(3*cell_dim_, cell_dim_)); const CuSubMatrix<BaseFloat> YC(propagate_buf_.ColRange(4*cell_dim_, cell_dim_)); const CuSubMatrix<BaseFloat> YH(propagate_buf_.ColRange(5*cell_dim_, cell_dim_)); const CuSubMatrix<BaseFloat> YM(propagate_buf_.ColRange(6*cell_dim_, cell_dim_)); const CuSubMatrix<BaseFloat> YR(propagate_buf_.ColRange(7*cell_dim_, proj_dim_)); // disassemble backpropagate buffer into different neurons, const CuSubMatrix<BaseFloat> DG(backpropagate_buf_.ColRange(0*cell_dim_, cell_dim_)); const CuSubMatrix<BaseFloat> DI(backpropagate_buf_.ColRange(1*cell_dim_, cell_dim_)); const CuSubMatrix<BaseFloat> DF(backpropagate_buf_.ColRange(2*cell_dim_, cell_dim_)); const CuSubMatrix<BaseFloat> DO(backpropagate_buf_.ColRange(3*cell_dim_, cell_dim_)); const CuSubMatrix<BaseFloat> DC(backpropagate_buf_.ColRange(4*cell_dim_, cell_dim_)); const CuSubMatrix<BaseFloat> DH(backpropagate_buf_.ColRange(5*cell_dim_, cell_dim_)); const CuSubMatrix<BaseFloat> DM(backpropagate_buf_.ColRange(6*cell_dim_, cell_dim_)); const CuSubMatrix<BaseFloat> DR(backpropagate_buf_.ColRange(7*cell_dim_, proj_dim_)); return std::string("") + "( learn_rate_coef_ " + ToString(learn_rate_coef_) + ", bias_learn_rate_coef_ " + ToString(bias_learn_rate_coef_) + ", cell_clip_ " + ToString(cell_clip_) + ", diff_clip_ " + ToString(diff_clip_) + ", grad_clip_ " + ToString(grad_clip_) + " )" + "\n ### Gradients " + "\n w_gifo_x_corr_ " + MomentStatistics(w_gifo_x_corr_) + "\n w_gifo_r_corr_ " + MomentStatistics(w_gifo_r_corr_) + "\n bias_corr_ " + MomentStatistics(bias_corr_) + "\n peephole_i_c_corr_ " + MomentStatistics(peephole_i_c_corr_) + "\n peephole_f_c_corr_ " + MomentStatistics(peephole_f_c_corr_) + "\n peephole_o_c_corr_ " + MomentStatistics(peephole_o_c_corr_) + "\n w_r_m_corr_ " + MomentStatistics(w_r_m_corr_) + "\n ### Activations (mostly after non-linearities)" + "\n YI(0..1)^ " + MomentStatistics(YI) + "\n YF(0..1)^ " + MomentStatistics(YF) + "\n YO(0..1)^ " + MomentStatistics(YO) + "\n YG(-1..1) " + MomentStatistics(YG) + "\n YC(-R..R)* " + MomentStatistics(YC) + "\n YH(-1..1) " + MomentStatistics(YH) + "\n YM(-1..1) " + MomentStatistics(YM) + "\n YR(-R..R) " + MomentStatistics(YR) + "\n ### Derivatives (w.r.t. inputs of non-linearities)" + "\n DI^ " + MomentStatistics(DI) + "\n DF^ " + MomentStatistics(DF) + "\n DO^ " + MomentStatistics(DO) + "\n DG " + MomentStatistics(DG) + "\n DC* " + MomentStatistics(DC) + "\n DH " + MomentStatistics(DH) + "\n DM " + MomentStatistics(DM) + "\n DR " + MomentStatistics(DR); } /** * TODO: Do we really need this? */ void ResetStreams(const std::vector<int32>& stream_reset_flag) { KALDI_ASSERT(NumStreams() == stream_reset_flag.size()); if (prev_nnet_state_.NumRows() != stream_reset_flag.size()) { prev_nnet_state_.Resize(NumStreams(), 7*cell_dim_ + 1*proj_dim_, kSetZero); } else { for (int s = 0; s < NumStreams(); s++) { if (stream_reset_flag[s] == 1) { prev_nnet_state_.Row(s).SetZero(); } } } } void PropagateFnc(const CuMatrixBase<BaseFloat> &in, CuMatrixBase<BaseFloat> *out) { // reset context on each sentence if 'sequence_lengths_' not set // (happens in 'nnet-forward' or 'single-stream' training), if (sequence_lengths_.size() == 0) { ResetStreams(std::vector<int32>(1, 1)); } KALDI_ASSERT(in.NumRows() % NumStreams() == 0); int32 T = in.NumRows() / NumStreams(); int32 S = NumStreams(); // buffers, propagate_buf_.Resize((T+2)*S, 7 * cell_dim_ + proj_dim_, kSetZero); if (prev_nnet_state_.NumRows() != NumStreams()) { prev_nnet_state_.Resize(NumStreams(), 7*cell_dim_ + 1*proj_dim_, kSetZero); // lazy init, } else { propagate_buf_.RowRange(0, S).CopyFromMat(prev_nnet_state_); // use the 'previous-state', } // split activations by neuron types, CuSubMatrix<BaseFloat> YG(propagate_buf_.ColRange(0*cell_dim_, cell_dim_)); CuSubMatrix<BaseFloat> YI(propagate_buf_.ColRange(1*cell_dim_, cell_dim_)); CuSubMatrix<BaseFloat> YF(propagate_buf_.ColRange(2*cell_dim_, cell_dim_)); CuSubMatrix<BaseFloat> YO(propagate_buf_.ColRange(3*cell_dim_, cell_dim_)); CuSubMatrix<BaseFloat> YC(propagate_buf_.ColRange(4*cell_dim_, cell_dim_)); CuSubMatrix<BaseFloat> YH(propagate_buf_.ColRange(5*cell_dim_, cell_dim_)); CuSubMatrix<BaseFloat> YM(propagate_buf_.ColRange(6*cell_dim_, cell_dim_)); CuSubMatrix<BaseFloat> YR(propagate_buf_.ColRange(7*cell_dim_, proj_dim_)); CuSubMatrix<BaseFloat> YGIFO(propagate_buf_.ColRange(0, 4*cell_dim_)); // x -> g, i, f, o, not recurrent, do it all in once YGIFO.RowRange(1*S, T*S).AddMatMat(1.0, in, kNoTrans, w_gifo_x_, kTrans, 0.0); // bias -> g, i, f, o YGIFO.RowRange(1*S, T*S).AddVecToRows(1.0, bias_); // BufferPadding [T0]:dummy, [1, T]:current sequence, [T+1]:dummy for (int t = 1; t <= T; t++) { // multistream buffers for current time-step, CuSubMatrix<BaseFloat> y_all(propagate_buf_.RowRange(t*S, S)); CuSubMatrix<BaseFloat> y_g(YG.RowRange(t*S, S)); CuSubMatrix<BaseFloat> y_i(YI.RowRange(t*S, S)); CuSubMatrix<BaseFloat> y_f(YF.RowRange(t*S, S)); CuSubMatrix<BaseFloat> y_o(YO.RowRange(t*S, S)); CuSubMatrix<BaseFloat> y_c(YC.RowRange(t*S, S)); CuSubMatrix<BaseFloat> y_h(YH.RowRange(t*S, S)); CuSubMatrix<BaseFloat> y_m(YM.RowRange(t*S, S)); CuSubMatrix<BaseFloat> y_r(YR.RowRange(t*S, S)); CuSubMatrix<BaseFloat> y_gifo(YGIFO.RowRange(t*S, S)); // r(t-1) -> g, i, f, o y_gifo.AddMatMat(1.0, YR.RowRange((t-1)*S, S), kNoTrans, w_gifo_r_, kTrans, 1.0); // c(t-1) -> i(t) via peephole y_i.AddMatDiagVec(1.0, YC.RowRange((t-1)*S, S), kNoTrans, peephole_i_c_, 1.0); // c(t-1) -> f(t) via peephole y_f.AddMatDiagVec(1.0, YC.RowRange((t-1)*S, S), kNoTrans, peephole_f_c_, 1.0); // i, f sigmoid squashing y_i.Sigmoid(y_i); y_f.Sigmoid(y_f); // g tanh squashing y_g.Tanh(y_g); // g * i -> c y_c.AddMatMatElements(1.0, y_g, y_i, 0.0); // c(t-1) * f -> c(t) via forget-gate y_c.AddMatMatElements(1.0, YC.RowRange((t-1)*S, S), y_f, 1.0); if (cell_clip_ > 0.0) { y_c.ApplyFloor(-cell_clip_); // optional clipping of cell activation, y_c.ApplyCeiling(cell_clip_); // google paper Interspeech2014: LSTM for LVCSR } // c(t) -> o(t) via peephole (non-recurrent, using c(t)) y_o.AddMatDiagVec(1.0, y_c, kNoTrans, peephole_o_c_, 1.0); // o sigmoid squashing, y_o.Sigmoid(y_o); // h tanh squashing, y_h.Tanh(y_c); // h * o -> m via output gate, y_m.AddMatMatElements(1.0, y_h, y_o, 0.0); // m -> r y_r.AddMatMat(1.0, y_m, kNoTrans, w_r_m_, kTrans, 0.0); // set zeros to padded frames, if (sequence_lengths_.size() > 0) { for (int s = 0; s < S; s++) { if (t > sequence_lengths_[s]) { y_all.Row(s).SetZero(); } } } } // set the 'projection layer' output as the LSTM output, out->CopyFromMat(YR.RowRange(1*S, T*S)); // the state in the last 'frame' is transferred (can be zero vector) prev_nnet_state_.CopyFromMat(propagate_buf_.RowRange(T*S, S)); } void BackpropagateFnc(const CuMatrixBase<BaseFloat> &in, const CuMatrixBase<BaseFloat> &out, const CuMatrixBase<BaseFloat> &out_diff, CuMatrixBase<BaseFloat> *in_diff) { // the number of sequences to be processed in parallel int32 T = in.NumRows() / NumStreams(); int32 S = NumStreams(); // buffer, backpropagate_buf_.Resize((T+2)*S, 7 * cell_dim_ + proj_dim_, kSetZero); // split activations by neuron types, CuSubMatrix<BaseFloat> YG(propagate_buf_.ColRange(0*cell_dim_, cell_dim_)); CuSubMatrix<BaseFloat> YI(propagate_buf_.ColRange(1*cell_dim_, cell_dim_)); CuSubMatrix<BaseFloat> YF(propagate_buf_.ColRange(2*cell_dim_, cell_dim_)); CuSubMatrix<BaseFloat> YO(propagate_buf_.ColRange(3*cell_dim_, cell_dim_)); CuSubMatrix<BaseFloat> YC(propagate_buf_.ColRange(4*cell_dim_, cell_dim_)); CuSubMatrix<BaseFloat> YH(propagate_buf_.ColRange(5*cell_dim_, cell_dim_)); CuSubMatrix<BaseFloat> YM(propagate_buf_.ColRange(6*cell_dim_, cell_dim_)); CuSubMatrix<BaseFloat> YR(propagate_buf_.ColRange(7*cell_dim_, proj_dim_)); // split derivatives by neuron types, CuSubMatrix<BaseFloat> DG(backpropagate_buf_.ColRange(0*cell_dim_, cell_dim_)); CuSubMatrix<BaseFloat> DI(backpropagate_buf_.ColRange(1*cell_dim_, cell_dim_)); CuSubMatrix<BaseFloat> DF(backpropagate_buf_.ColRange(2*cell_dim_, cell_dim_)); CuSubMatrix<BaseFloat> DO(backpropagate_buf_.ColRange(3*cell_dim_, cell_dim_)); CuSubMatrix<BaseFloat> DC(backpropagate_buf_.ColRange(4*cell_dim_, cell_dim_)); CuSubMatrix<BaseFloat> DH(backpropagate_buf_.ColRange(5*cell_dim_, cell_dim_)); CuSubMatrix<BaseFloat> DM(backpropagate_buf_.ColRange(6*cell_dim_, cell_dim_)); CuSubMatrix<BaseFloat> DR(backpropagate_buf_.ColRange(7*cell_dim_, proj_dim_)); CuSubMatrix<BaseFloat> DGIFO(backpropagate_buf_.ColRange(0, 4*cell_dim_)); // pre-copy partial derivatives from the LSTM output, DR.RowRange(1*S, T*S).CopyFromMat(out_diff); // BufferPadding [T0]:dummy, [1,T]:current sequence, [T+1]: dummy, for (int t = T; t >= 1; t--) { CuSubMatrix<BaseFloat> y_g(YG.RowRange(t*S, S)); CuSubMatrix<BaseFloat> y_i(YI.RowRange(t*S, S)); CuSubMatrix<BaseFloat> y_f(YF.RowRange(t*S, S)); CuSubMatrix<BaseFloat> y_o(YO.RowRange(t*S, S)); CuSubMatrix<BaseFloat> y_c(YC.RowRange(t*S, S)); CuSubMatrix<BaseFloat> y_h(YH.RowRange(t*S, S)); CuSubMatrix<BaseFloat> y_m(YM.RowRange(t*S, S)); CuSubMatrix<BaseFloat> y_r(YR.RowRange(t*S, S)); CuSubMatrix<BaseFloat> d_all(backpropagate_buf_.RowRange(t*S, S)); CuSubMatrix<BaseFloat> d_g(DG.RowRange(t*S, S)); CuSubMatrix<BaseFloat> d_i(DI.RowRange(t*S, S)); CuSubMatrix<BaseFloat> d_f(DF.RowRange(t*S, S)); CuSubMatrix<BaseFloat> d_o(DO.RowRange(t*S, S)); CuSubMatrix<BaseFloat> d_c(DC.RowRange(t*S, S)); CuSubMatrix<BaseFloat> d_h(DH.RowRange(t*S, S)); CuSubMatrix<BaseFloat> d_m(DM.RowRange(t*S, S)); CuSubMatrix<BaseFloat> d_r(DR.RowRange(t*S, S)); CuSubMatrix<BaseFloat> d_gifo(DGIFO.RowRange(t*S, S)); // r // Version 1 (precise gradients): // backprop error from g(t+1), i(t+1), f(t+1), o(t+1) to r(t) d_r.AddMatMat(1.0, DGIFO.RowRange((t+1)*S, S), kNoTrans, w_gifo_r_, kNoTrans, 1.0); /* // Version 2 (Alex Graves' PhD dissertation): // only backprop g(t+1) to r(t) CuSubMatrix<BaseFloat> w_g_r_(w_gifo_r_.RowRange(0, cell_dim_)); d_r.AddMatMat(1.0, DG.RowRange((t+1)*S,S), kNoTrans, w_g_r_, kNoTrans, 1.0); */ /* // Version 3 (Felix Gers' PhD dissertation): // truncate gradients of g(t+1), i(t+1), f(t+1), o(t+1) once they leak out memory block // CEC(with forget connection) is the only "error-bridge" through time */ // r -> m d_m.AddMatMat(1.0, d_r, kNoTrans, w_r_m_, kNoTrans, 0.0); // m -> h via output gate d_h.AddMatMatElements(1.0, d_m, y_o, 0.0); d_h.DiffTanh(y_h, d_h); // o d_o.AddMatMatElements(1.0, d_m, y_h, 0.0); d_o.DiffSigmoid(y_o, d_o); // c // 1. diff from h(t) // 2. diff from c(t+1) (via forget-gate between CEC) // 3. diff from i(t+1) (via peephole) // 4. diff from f(t+1) (via peephole) // 5. diff from o(t) (via peephole, not recurrent) d_c.AddMat(1.0, d_h); d_c.AddMatMatElements(1.0, DC.RowRange((t+1)*S, S), YF.RowRange((t+1)*S,S), 1.0); d_c.AddMatDiagVec(1.0, DI.RowRange((t+1)*S, S), kNoTrans, peephole_i_c_, 1.0); d_c.AddMatDiagVec(1.0, DF.RowRange((t+1)*S, S), kNoTrans, peephole_f_c_, 1.0); d_c.AddMatDiagVec(1.0, d_o , kNoTrans, peephole_o_c_, 1.0); // optionally clip the cell_derivative, if (cell_diff_clip_ > 0.0) { d_c.ApplyFloor(-cell_diff_clip_); d_c.ApplyCeiling(cell_diff_clip_); } // f d_f.AddMatMatElements(1.0, d_c, YC.RowRange((t-1)*S,S), 0.0); d_f.DiffSigmoid(y_f, d_f); // i d_i.AddMatMatElements(1.0, d_c, y_g, 0.0); d_i.DiffSigmoid(y_i, d_i); // c -> g via input gate d_g.AddMatMatElements(1.0, d_c, y_i, 0.0); d_g.DiffTanh(y_g, d_g); // Clipping per-frame derivatives for the next `t'. // Clipping applied to gates and input gate (as done in Google). // [ICASSP2015, Sak, Learning acoustic frame labelling...], // // The path from 'out_diff' to 'd_c' via 'd_h' is unclipped, // which is probably important for the 'Constant Error Carousel' // to work well. // if (diff_clip_ > 0.0) { d_gifo.ApplyFloor(-diff_clip_); d_gifo.ApplyCeiling(diff_clip_); } // set zeros to padded frames, if (sequence_lengths_.size() > 0) { for (int s = 0; s < S; s++) { if (t > sequence_lengths_[s]) { d_all.Row(s).SetZero(); } } } } // g,i,f,o -> x, calculating input derivatives, in_diff->AddMatMat(1.0, DGIFO.RowRange(1*S,T*S), kNoTrans, w_gifo_x_, kNoTrans, 0.0); // lazy initialization of udpate buffers, if (w_gifo_x_corr_.NumRows() == 0) { w_gifo_x_corr_.Resize(4*cell_dim_, input_dim_, kSetZero); w_gifo_r_corr_.Resize(4*cell_dim_, proj_dim_, kSetZero); bias_corr_.Resize(4*cell_dim_, kSetZero); peephole_i_c_corr_.Resize(cell_dim_, kSetZero); peephole_f_c_corr_.Resize(cell_dim_, kSetZero); peephole_o_c_corr_.Resize(cell_dim_, kSetZero); w_r_m_corr_.Resize(proj_dim_, cell_dim_, kSetZero); } // calculate delta const BaseFloat mmt = opts_.momentum; // weight x -> g, i, f, o w_gifo_x_corr_.AddMatMat(1.0, DGIFO.RowRange(1*S, T*S), kTrans, in , kNoTrans, mmt); // recurrent weight r -> g, i, f, o w_gifo_r_corr_.AddMatMat(1.0, DGIFO.RowRange(1*S, T*S), kTrans, YR.RowRange(0*S, T*S) , kNoTrans, mmt); // bias of g, i, f, o bias_corr_.AddRowSumMat(1.0, DGIFO.RowRange(1*S, T*S), mmt); // recurrent peephole c -> i peephole_i_c_corr_.AddDiagMatMat(1.0, DI.RowRange(1*S, T*S), kTrans, YC.RowRange(0*S, T*S), kNoTrans, mmt); // recurrent peephole c -> f peephole_f_c_corr_.AddDiagMatMat(1.0, DF.RowRange(1*S, T*S), kTrans, YC.RowRange(0*S, T*S), kNoTrans, mmt); // peephole c -> o peephole_o_c_corr_.AddDiagMatMat(1.0, DO.RowRange(1*S, T*S), kTrans, YC.RowRange(1*S, T*S), kNoTrans, mmt); w_r_m_corr_.AddMatMat(1.0, DR.RowRange(1*S, T*S), kTrans, YM.RowRange(1*S, T*S), kNoTrans, mmt); } void Update(const CuMatrixBase<BaseFloat> &input, const CuMatrixBase<BaseFloat> &diff) { // apply the gradient clipping, if (clip_gradient_ > 0.0) { w_gifo_x_corr_.ApplyFloor(-clip_gradient_); w_gifo_x_corr_.ApplyCeiling(clip_gradient_); w_gifo_r_corr_.ApplyFloor(-clip_gradient_); w_gifo_r_corr_.ApplyCeiling(clip_gradient_); bias_corr_.ApplyFloor(-clip_gradient_); bias_corr_.ApplyCeiling(clip_gradient_); w_r_m_corr_.ApplyFloor(-clip_gradient_); w_r_m_corr_.ApplyCeiling(clip_gradient_); peephole_i_c_corr_.ApplyFloor(-clip_gradient_); peephole_i_c_corr_.ApplyCeiling(clip_gradient_); peephole_f_c_corr_.ApplyFloor(-clip_gradient_); peephole_f_c_corr_.ApplyCeiling(clip_gradient_); peephole_o_c_corr_.ApplyFloor(-clip_gradient_); peephole_o_c_corr_.ApplyCeiling(clip_gradient_); } const BaseFloat lr = opts_.learn_rate; w_gifo_x_.AddMat(-lr * learn_rate_coef_, w_gifo_x_corr_); w_gifo_r_.AddMat(-lr * learn_rate_coef_, w_gifo_r_corr_); bias_.AddVec(-lr * bias_learn_rate_coef_, bias_corr_, 1.0); peephole_i_c_.AddVec(-lr * bias_learn_rate_coef_, peephole_i_c_corr_, 1.0); peephole_f_c_.AddVec(-lr * bias_learn_rate_coef_, peephole_f_c_corr_, 1.0); peephole_o_c_.AddVec(-lr * bias_learn_rate_coef_, peephole_o_c_corr_, 1.0); w_r_m_.AddMat(-lr * learn_rate_coef_, w_r_m_corr_); } private: // dims int32 cell_dim_; int32 proj_dim_; ///< recurrent projection layer dim BaseFloat cell_clip_; ///< Clipping of 'cell-values' in forward pass (per-frame), BaseFloat diff_clip_; ///< Clipping of 'derivatives' in backprop (per-frame), BaseFloat cell_diff_clip_; ///< Clipping of 'cell-derivatives' accumulated over CEC (per-frame), BaseFloat grad_clip_; ///< Clipping of the updates, // buffer for transfering state across batches, CuMatrix<BaseFloat> prev_nnet_state_; // gradient-clipping value, BaseFloat clip_gradient_; // feed-forward connections: from x to [g, i, f, o] CuMatrix<BaseFloat> w_gifo_x_; CuMatrix<BaseFloat> w_gifo_x_corr_; // recurrent projection connections: from r to [g, i, f, o] CuMatrix<BaseFloat> w_gifo_r_; CuMatrix<BaseFloat> w_gifo_r_corr_; // biases of [g, i, f, o] CuVector<BaseFloat> bias_; CuVector<BaseFloat> bias_corr_; // peephole from c to i, f, g // peephole connections are block-internal, so we use vector form CuVector<BaseFloat> peephole_i_c_; CuVector<BaseFloat> peephole_f_c_; CuVector<BaseFloat> peephole_o_c_; CuVector<BaseFloat> peephole_i_c_corr_; CuVector<BaseFloat> peephole_f_c_corr_; CuVector<BaseFloat> peephole_o_c_corr_; // projection layer r: from m to r CuMatrix<BaseFloat> w_r_m_; CuMatrix<BaseFloat> w_r_m_corr_; // propagate buffer: output of [g, i, f, o, c, h, m, r] CuMatrix<BaseFloat> propagate_buf_; // back-propagate buffer: diff-input of [g, i, f, o, c, h, m, r] CuMatrix<BaseFloat> backpropagate_buf_; }; // class LstmProjected } // namespace nnet1 } // namespace kaldi #endif // KALDI_NNET_NNET_LSTM_PROJECTED_H_
[ "nicj@i2r.a-star.edu.sg" ]
nicj@i2r.a-star.edu.sg
d3932a7c872457f4fa3b40db8876519b54060d78
57b6fa831fe532cf0739135c77946f0061e3fbf5
/NWNXLib/API/Linux/API/CNWTileSurfaceMeshLocalInfo.hpp
f15bcffaa9159f74a8d4218ad7409f6d64f010e9
[ "MIT" ]
permissive
presscad/nwnee
dfcb90767258522f2b23afd9437d3dcad74f936d
0f36b281524e0b7e9796bcf30f924792bf9b8a38
refs/heads/master
2020-08-22T05:26:11.221042
2018-11-24T16:45:45
2018-11-24T16:45:45
216,326,718
1
0
MIT
2019-10-20T07:54:45
2019-10-20T07:54:45
null
UTF-8
C++
false
false
259
hpp
#pragma once #include <cstdint> #include "Vector.hpp" namespace NWNXLib { namespace API { struct CNWTileSurfaceMeshLocalInfo { int32_t pnEdgeUsed[12]; Vector pfVertex[3]; int32_t pnVertexIndex[3]; int32_t pnTriangleAdjacency[3]; }; } }
[ "liarethnwn@gmail.com" ]
liarethnwn@gmail.com
09407fe14be948b1217ad576455934afd02f99de
624a1c8acca88c746af2d14d93205599b28e73d7
/include/boundary.h
6fd0869d246534728009f66f64b771787401478c
[ "MIT" ]
permissive
danolivo/avd
107630bc177c37bd7607addcd1b902f3b862b8d1
223e65cc98c4250856e17e14dff5607277010ed4
refs/heads/master
2020-03-19T03:34:22.994924
2018-06-04T17:37:49
2018-06-04T17:37:49
135,740,506
0
0
null
null
null
null
UTF-8
C++
false
false
4,056
h
/** * @file boundary.h * @brief Boundary interface * @version 0.1 * @copyright MIT License * @author A.V. lepikhov * @date 2012 */ #ifndef _BOUNDARY_H_ #define _BOUNDARY_H_ #include <common.h> #include <math_addons.h> #include <model.h> /** * @brief Структура данных, возвращаемых классом ГУ. */ typedef struct { /** Heat transfer coefficient */ double acp; /** Характерная энтальпия. */ double Ie; /** Wall enthalpy. */ double Iw; /** Total enthalpy, [J/kg]. */ double I0; /** Boundary emissivity */ double eps; /** Wall temperature */ double Tw; /** Pressure at the wall, [Pa]. */ double P; } BC_t; /** * @brief Abstract boundary * @details Is an ancestor for any boundaries */ class CBoundary { int Type; protected: /** Base parameters of second-order boundary condition */ BC_t BC; public: /** Output device for logging */ FILE* flog; /** Class Constructor. * @param Type -type of boundary. * @param flog - pointer to the output device */ CBoundary(int Type, FILE* flog = stdout); /** Class constructor * @param boundary - pointer to the class, which will be assigned to the new class. */ CBoundary(CBoundary *boundary); /** Returns class type. */ int type(); /** Calculate boundary parameters. * @param Time - current time, s. */ virtual BC_t GetBC(double Time) = 0; /** * @brief Set time-dependent boundary parameter changes by multipliers. * @param pname - boundary parameter name * @param table - pointer to interpolation table for multiplier * @return Opcode. NULL_VALUE - interpolation table can't be used. -2 - pname is not valid */ virtual int SetTimeChangeCoefs(const char* pname, const func_points_t* table) = 0; /** * @brief Print class preferences. */ virtual void print() = 0; }; class CFOBoundary : public CBoundary { public: /** * @brief Class constructor * @param eps - base value of emissivity * @param Ie - base value of local boundary layer edge enthalpy * @param acp - base value of GHTC * @param flog - output device for logging */ CFOBoundary(double Tw, FILE* flog=stdout); /** * @brief Выдать параметры граничного условия. * param Time - текущий момент расчётного времени. */ virtual BC_t GetBC(double Time); /** * @brief Set time-dependent boundary parameter changes by multipliers. * @param pname - boundary parameter name * @param table - pointer to interpolation table for multiplier * @return Opcode. NULL_VALUE - interpolation table can't be used. -2 - pname is not valid */ virtual int SetTimeChangeCoefs(const char* pname, const func_points_t* table); /** Распечатать внутренние данные класса. */ virtual void print(); }; /** Second-order boundary. */ class CSOBoundary : public CBoundary { public: /** * @brief Class constructor * @param eps - base value of emissivity * @param Ie - base value of local boundary layer edge enthalpy * @param acp - base value of GHTC * @param flog - output device for logging */ CSOBoundary(double acp, double I0, double Ie, double Iw, double Ps, double eps = 0., FILE* flog = stdout); /** * @brief Выдать параметры граничного условия. * param Time - текущий момент расчётного времени. */ virtual BC_t GetBC(double Time); /** * @brief Set time-dependent boundary parameter changes by multipliers. * @param pname - boundary parameter name * @param table - pointer to interpolation table for multiplier * @return Opcode. NULL_VALUE - interpolation table can't be used. -2 - pname is not valid */ virtual int SetTimeChangeCoefs(const char* pname, const func_points_t* table); /** Распечатать внутренние данные класса. */ virtual void print(); }; #endif /* _BOUNDARY_H_ */
[ "a.lepikhov@postgrespro.ru" ]
a.lepikhov@postgrespro.ru
36e217deaa876cca27327bbaf22f17a16e7c7649
a8a11293d507d6575d4ed754196c627c5187f033
/Epolestar_Plugins/KLine/KLine/KLinePresenter.h
bc5c1b4e801451ab2e1b7ebfc7e0ebd7e62a7a48
[]
no_license
xixijiuhao/Workspace_BK
a041cf596d6fe3263dcfb3292c1155e9496813c7
99e62313213364a151a1f17a3903486efadfbae6
refs/heads/master
2021-10-09T09:32:50.054454
2018-12-25T07:24:23
2018-12-25T07:24:23
null
0
0
null
null
null
null
GB18030
C++
false
false
2,042
h
#pragma once class KLinePresenter : public ISHisQuoteSpi, public TIxFrm { public: KLinePresenter(); ~KLinePresenter(); static void OnMenuClick(const unsigned int MenuIndex, const HWND PastLife); protected: virtual LRESULT WndProc(UINT message, WPARAM wParam, LPARAM lParam); void __stdcall OnHisQuote(const SContractNoType contractno, const SKLineTypeType klinetype, const SSessionIdType sessionid); void __stdcall OnHisQuoteTimeLine(const C8[], const SDateType, const SSessionIdType) {}; //历史波动率通知 仅通知数据结束变化,使用get函数获取数据 void __stdcall OnHisVolatility(const SContractNoType contractno, const SKLineTypeType klinetype, const SSessionIdType sessionid) {}; public: void UpdateKLineView(); void ShowMainFrm() { m_MainFrm->CreateView(); }; void ShowSubView(MainFrmRect &rect); void ChangeSubViewFrame(MainFrmRect &rect); void InitSubViewData(RECT CenterKLineRect) {}; const SContract* GetContract(); KContract& GetKContract() { return m_KContract; } public: TMainFrm* getMainFrm(); KLineModel* getKLineModel(); private: KLineModel* m_KLineModel; //Model数据类 TMainFrm* m_MainFrm; //主界面类 KLineView* m_KLineView; //KLine类 KLineSelectTab* m_KLineSelectTab; //选TCTerm类 KLineIntroductView* m_KLineIntroduct; //介绍说明类 KListView* m_KListView; //列表选择类 private: void OnTabChange(int index); void OnClickListItem(KContract p); void GetTCData(); void GetTCDataFromMap(); void GetTCDataSpi(); void UpdateView(); void LoadFileData(); //依次加载自选、商品、外汇 private: std::vector<KContract> m_vtForCur; //外汇品种 std::vector<KContract> m_vtCom; //商品品种 std::vector<KContract> m_vtFav; //自选品种 std::vector<KContract> m_vtInternalCom; //内盘品种 std::vector<KContract> m_vtExternalCom; //外盘品种 KContract m_KContract; //当前选中合约信息 BOOL m_bFirstInitData; //是否初始化 int m_iHttpTimerID; //定时器ID };
[ "zhuyuepeng@esunny.cc" ]
zhuyuepeng@esunny.cc
2ada62bbe5b47f2ab46c46f942353331d9f0ae28
26a4bc5af421262d38605ed6ec38c898899fdc23
/thread/usage_1.h
4f15f03e57205222ff63a391b0ea67b391265f5e
[]
no_license
vcboy1/thread
3d5b769adeeaa1543a8a66e7997c7cf2fd080853
c3e186c1d93eb811145db4d4800be952e2f4ab0b
refs/heads/master
2023-02-27T23:37:21.225394
2021-02-01T01:52:59
2021-02-01T01:52:59
334,792,476
0
0
null
null
null
null
UTF-8
C++
false
false
1,607
h
#pragma once #include <thread> #include "../util/log.h" namespace Usage{ /* 说明: 展现std::thread的几种标准调用方法 作者: 李尚鹏 */ /* 用法1: 通过类静态成员函数调用 std::thread t( Usage1::thread_proc ) */ class Usage1{ public: static void thread_proc(){ std::scout() << "Usage1:进入线程[" <<std::this_thread::get_id()<< "]处理函数.... \n"; } }; /* 用法2: 通过类实例的operator()函数调用 Usage2 obj; std::thread t(obj); */ class Usage2{ public: // opertor()可以带若干个参数,注意没有static void operator()(){ std::scout() << "Usage2:进入线程[" <<std::this_thread::get_id()<< "]处理函数.... \n"; } }; /* 用法3: 类实例的成员函数调用 Usage3 obj; std::thread t(obj); 类实例的成员函数带参数调用 thread t3(&Usage3::thread_proc,&obj3); 模板函数调用 thread t5(&Usage3::thread_proc3<int>, &obj3,0); */ class Usage3{ public: void thread_proc(){ std::scout() << "Usage3:进入线程[" <<std::this_thread::get_id()<< "]处理函数.... \n"; } void thread_proc2(int v,char*){ std::scout() << "Usage3参数版:进入线程[" <<std::this_thread::get_id()<< "]处理函数.... \n"; } template<class T> void thread_proc3(T v){ std::scout() << "Usage3模板成员版:进入线程[" <<std::this_thread::get_id()<< "]处理函数.... \n"; } }; };
[ "393182174@qq.com" ]
393182174@qq.com
3c0a169ef934cf90b6104894949adc8325ce94a0
b4024d8157ff3c83d9c4eb5ca57ef60818c69d46
/inheritance.cpp
b1493ff84fbee83367a0c27a0eb52094f188be2a
[]
no_license
logan-mo/Inheritance-Calculator
3c3dbde801750f844db3e7364ba0bf740712ada6
b91d2bee9a5d18362792940141fe3c13e8a0faa6
refs/heads/main
2023-01-20T13:45:33.618361
2020-10-30T04:28:55
2020-10-30T04:28:55
null
0
0
null
null
null
null
UTF-8
C++
false
false
8,361
cpp
#include <iostream> using namespace std; int main(){ cout << "______________________________________________________\n\n"; cout << "Inheritance Calculator\nbased on Shariah Law\nBy Muhammad Luqman\nFA20/BSAI/005\nFounder of Shinzou Studios\n"; cout << "______________________________________________________\n\n\n"; //variable declaration float asset=0; char gender='x'; bool married = 0; float father = 0; float sfather =0; float mother = 0; float smother=0; float pgfather = 0; float spgfather = 0; float pgmother = 0; float spgmother = 0; float mgmother = 0; float smgmother = 0; float sister = 0; float ssister = 0; float brother = 0; float sbrother = 0; float son = 0; float sson = 0; float daughter = 0; float sdaughter = 0; float gson = 0; float sgson = 0; float gdaughter = 0; float sgdaughter = 0; float wife = 0; float swife = 0; float husband = 0; float shusband = 0; float residue = 0; cout << "If a yes/no question is asked, answer 1 for yes and 0 for no.\nInheritance calculation for siblings of deceased in still under development.\n"; // personal information cout <<"\nEnter total asset amount left after clearing any debts of the deceased and fulfilling the deceased's will: "; cin>> asset; if (!asset) { cout <<"Nothing to share"<<endl; return 0; } for (;gender!='f' && gender!='m';) { cout <<"write gender of deceased as 'm' or 'f':"; cin>>gender; } cout <<"Is father alive?"; cin>>father; if (!father) { cout <<"Is paternal grand father alive?"; cin>>pgfather; if (!mother) { cout <<"Is patenal grand mother alive?"; cin>>pgmother; } } cout <<"Is Mother alive?"; cin>>mother; if (!mother) { cout <<"Is maternal grand mother alive?"; cin>>mgmother; } cout << "How many full sisters are alive?"; cin>>sister; cout << "How many full brothers are alive?"; cin>>brother; cout << "Write marrital status:"<<endl<<"(Write 1 for married and 0 for unmarried)"<<endl; cin>>married; // Case 1: married if (married) { if (gender=='m') { cout << "How many wives are alive?" << endl; cin >> wife; } else { cout << "Is the husband alive?" << endl; cin >> husband; } cout << "How many daughters are alive?"; cin>>daughter; cout << "How many sons are alive?"; cin>>son; if (!son && !daughter) { cout << "How many Grand daughters are alive?"; cin>>gdaughter; cout << "How many Grand sons are alive?"; cin>>gson; } } //share calculation if (married) { //spouse if (husband) { if (!son && !daughter && !gson && !gdaughter) { shusband=1.0/2.0; } else { shusband=1.0/4.0; } shusband=shusband*asset; residue=asset-shusband; } else if (wife) { //swife denotes total share of all wives if (!son && !daughter && !gson && !gdaughter) { swife=1.0/4.0; } else { swife=1.0/8.0; } swife=swife*asset; residue=asset-swife; } //father if (father) { if (son || daughter || gson || gdaughter) { sfather=asset*1.0/6.0; } } residue=residue-sfather; if (mother) { if (son || daughter || gson || gdaughter || sister || brother) { smother=1.0/6.0; smother=smother*asset; } else if (!son && !daughter && !gson && !gdaughter) { if (!father && !(husband || wife) && !sister && !brother) { smother= 1.0/3.0; smother=smother*asset; } else if (father || husband || wife || sister || brother) { smother=residue/3.0; } } } residue=residue-smother; //Paternal Grand Parents if(!father){ if(pgfather){ if (son || daughter || gson || gdaughter) { spgfather=asset*1.0/6.0; } } residue=residue-spgfather; if(pgmother && !mother){ if(mgmother){ spgmother = 1.0/12.0; } else{ spgmother = 1.0/6.0; } spgmother = spgmother*asset; } residue=residue-spgmother; } // Maternal Grand Parents if(mgmother && !mother) { if(pgmother){ smgmother = 1.0/12.0; } else{ smgmother = 1.0/6.0; } smgmother=smgmother*asset; } residue=residue-smgmother; //children if (daughter==1 && !son) { sdaughter=1.0/2.0; sdaughter=sdaughter*asset; } else if (daughter>1 && !son) { //sdaughter denotes share of all daughters sdaughter=2.0/3.0; sdaughter=sdaughter*asset; } else if (daughter && son) { //sson denotes share of all sons float temp=daughter*0.5+son*1; //temp denotes total assets sdaughter=(daughter*0.5)/temp; sson=(son*1)/temp; sson=sson*residue; sdaughter=sdaughter*residue; } else if (son) { sson=residue; } residue=residue-sson-sdaughter; /* if (gdaughter==1 && !daughter) { if (!gson) { sgdaughter=1.0/2.0; } else { //sgdaughter=sgson/2.0; } } else if (gdaughter>1 && !daughter) { if (!gson) { sgdaughter=2.0/3.0; } else { //sgdaughter=sgson/2.0; } } sgson=sgson*asset; sgdaughter=sgdaughter*asset; */ if (gdaughter==1 && !gson) { sgdaughter=1.0/2.0; sgdaughter=sdaughter*asset; } else if (gdaughter>1 && !gson) { sgdaughter=2.0/3.0; sgdaughter=sdaughter*asset; } else if (gdaughter && gson) { float temp=gdaughter*0.5+gson*1; //temp denotes total assets sgdaughter=(gdaughter*0.5)/temp; sgson=(gson*1)/temp; sgson=sgson*residue; sgdaughter=sgdaughter*residue; } else if (gson) { sgson=residue; } residue=residue-sgson-sgdaughter; } //siblings if (!father && !pgfather && !son && !gson) { //gender of deceased is not considered if (!brother && !daughter && !gdaughter && sister==1) { ssister=residue*1.0/2.0; } else if (!sister && !daughter && !gdaughter && brother>1) { sbrother=residue; } else if (brother>1 && sister>1 && !daughter && !gdaughter) { //sbrother=ssister*2; float temp=sister*0.5+brother*1; //temp denotes total assets ssister=(sister*0.5)/temp; sbrother=(sbrother*1)/temp; sbrother=sbrother*residue; ssister=ssister*residue; } else if (!brother && sister>1 && !daughter && !gdaughter) { ssister=residue*2.0/3.0; } if (!brother && sister==1) { ssister=residue*1.0/6.0; } else if (!sister && brother==1) { sbrother=residue*1.0/6.0; } else { float temp=sister*0.5+brother*1; //temp denotes total assets ssister=(sister*0.5)/temp; sbrother=(brother*1)/temp; sbrother=sbrother*residue/3.0; ssister=ssister*residue/3.0; //sbrother+ssister=1.0/3.0; //share equally, write code accordingly } } if (residue>-1) { if (father) { if (son || daughter || gson || gdaughter) { if (!son && !gson) { sfather=sfather+residue; } } else { sfather=residue; } } if(!father){ if(pgfather){ if (son || daughter || gson || gdaughter) { if (!son && !gson) { spgfather=spgfather+residue; } } else { spgfather=residue; } } residue=residue-spgfather; } } //OUTPUTS!!! cout << "Shares of all concerned are as follows:"<<endl; if(husband){ cout << "Share of husband is:"<<shusband<<endl; } if(wife){ cout << "Share of each wife is:"<<swife/wife<<endl; } if(son){ cout << "Share of each son is: "<<sson/son<<endl; } if(daughter){ cout << "Share of each daughter is: "<<sdaughter/daughter<<endl; } if(gson){ cout << "Share of each grand son is: "<<sgson/gson<<endl; } if(gdaughter){ cout << "Share of each grand daughter is: "<<sgdaughter/gdaughter<<endl; } if(father){ cout << "Share of father is: "<<sfather<<endl; } if(mother){ cout << "Share of mother is: "<<smother<<endl; } if(pgfather){ cout << "Share of pateral grandfather is: "<<spgfather<<endl; } if(pgmother){ cout << "Share of paternal grandmother is: "<<spgmother<<endl; } if(mgmother){ cout << "Share of maternal grandmother is: "<<smgmother<<endl; } if(brother){ cout << "Share of each brother is: "<<sbrother/brother<<endl; } if(sister){ cout << "Share of each sister is: "<<ssister/sister<<endl; } if(residue<=-1) { cout<<"All shares exceed total amount."<<residue<<"needs to be subtracted from all share holders according to rules"<<endl; } return 0; }
[ "itsluqman55@gmail.com" ]
itsluqman55@gmail.com
6a7043bbe5fea56df096020252b2cc3bc2a9c9b6
608bf006481e1907cdb5b922f5237cd328905a33
/ocean1/vec4.h
9f44d746120c985c36216268049632a158e86752
[]
no_license
paavan1/Graphics
5ceee112164858fa1939e2737f726aa0b54645ef
a4966e9c692812afc51454d6602006e24f23b7d2
refs/heads/master
2016-09-05T16:15:22.863095
2014-12-11T22:28:42
2014-12-11T22:28:42
null
0
0
null
null
null
null
UTF-8
C++
false
false
4,897
h
#ifndef _VEC4_H_ #define _VEC4_H_ #include <cassert> template <typename type> class vec4 { public: type x, y, z, w; vec4(); vec4(type xi, type yi, type zi, type wi); vec4(const type v[4]); vec4(const vec4& v); type operator[](const int i) const; type& operator[](const int i); vec4 operator=(const vec4& v); bool operator==(const vec4& v) const; bool operator!=(const vec4& v) const; vec4 operator+(const vec4& v) const; vec4 operator-(const vec4& v) const; vec4 operator*(const vec4& v) const; vec4 operator*(const type scalar) const; vec4 operator/(const vec4& v) const; vec4 operator/(const type scalar) const; vec4 operator-() const; vec4& operator+=(const vec4& v); vec4& operator-=(const vec4& v); vec4& operator*=(const type& scalar); vec4& operator/=(const type& scalar); type dotproduct(const vec4& v) const; template <class t> vec4<t> cast() { return vec4<t>((t) x, (t) y, (t) z, (t )w); } static const vec4 ZERO; static const vec4 UNIT_X; static const vec4 UNIT_Y; static const vec4 UNIT_Z; static const vec4 UNIT_W; }; typedef vec4<float> vec4f; typedef vec4<double> vec4d; typedef vec4<int> vec4i; template <typename type> inline vec4<type>::vec4() { } template <typename type> inline vec4<type>::vec4(type xi, type yi, type zi, type wi) : x(xi), y(yi), z(zi), w(wi) { } template <typename type> inline vec4<type>::vec4(const type v[4]) : x(v[0]), y(v[1]), z(v[2]), w(v[3]) { } template <typename type> inline vec4<type>::vec4(const vec4& v) : x(v.x), y(v.y), z(v.z), w(v.w) { } template <typename type> inline type vec4<type>::operator[](const int i) const { return *(&x + i); } template <typename type> inline type& vec4<type>::operator[](const int i) { return *(&x + i); } template <typename type> inline vec4<type> vec4<type>::operator=(const vec4<type>& v) { x = v.x; y = v.y; z = v.z; w = v.w; return *this; } template <typename type> inline bool vec4<type>::operator==(const vec4<type>& v) const { return (x == v.x && y == v.y && z == v.z && w == v.w); } template <typename type> inline bool vec4<type>::operator!=(const vec4<type>& v) const { return (x != v.x || y != v.y || z != v.z || w != v.w); } template <typename type> inline vec4<type> vec4<type>::operator+(const vec4<type>& v) const { return vec4(x + v.x, y + v.y, z + v.z, w + v.w); } template <typename type> inline vec4<type> vec4<type>::operator-(const vec4<type>& v) const { return vec4(x - v.x, y - v.y, z - v.z, w - v.w); } template <typename type> inline vec4<type> vec4<type>::operator*(const vec4<type>& v) const { return vec4(x * v.x, y * v.y, z * v.z, w * v.w); } template <typename type> inline vec4<type> vec4<type>::operator*(const type scalar) const { return vec4(x * scalar, y * scalar, z * scalar, w * scalar); } template <typename type> inline vec4<type> vec4<type>::operator/(const vec4<type>& v) const { return vec4(x / v.x, y / v.y, z / v.z, w / v.w); } template <typename type> inline vec4<type> vec4<type>::operator/(const type scalar) const { assert(scalar != 0); type inv = 1 / scalar; return vec4(x * inv, y * inv, z * inv, w * inv); } template <typename type> inline vec4<type> vec4<type>::operator-() const { return vec4(-x, -y, -z, -w); } template <typename type> inline vec4<type>& vec4<type>::operator+=(const vec4<type>& v) { x += v.x; y += v.y; z += v.z; w += v.w; return *this; } template <typename type> inline vec4<type>& vec4<type>::operator-=(const vec4<type>& v) { x -= v.x; y -= v.y; z -= v.z; w -= v.w; return *this; } template <typename type> inline vec4<type>& vec4<type>::operator*=(const type& scalar) { x *= scalar; y *= scalar; z *= scalar; w *= scalar; return *this; } template <typename type> inline vec4<type>& vec4<type>::operator/=(const type& scalar) { assert(scalar != 0); type inv = 1 / scalar; x *= inv; y *= inv; z *= inv; w *= inv; return *this; } template <typename type> inline type vec4<type>::dotproduct(const vec4<type>& v) const { return (x*v.x + y*v.y + z*v.z + w*v.w); } template <typename type> const vec4<type> vec4<type>::ZERO(0, 0, 0, 0); template <typename type> const vec4<type> vec4<type>::UNIT_X(1, 0, 0, 0); template <typename type> const vec4<type> vec4<type>::UNIT_Y(0, 1, 0, 0); template <typename type> const vec4<type> vec4<type>::UNIT_Z(0, 0, 1, 0); template <typename type> const vec4<type> vec4<type>::UNIT_W(0, 0, 0, 1); #endif
[ "paavankumar.sirigiri@stonybrook.edu" ]
paavankumar.sirigiri@stonybrook.edu
315ec9ab5b91f2de1805e37be1603363390b24b3
a62342d6359a88b0aee911e549a4973fa38de9ea
/0.6.0.3/Internal/SDK/BTTask_GoToWorkSlot_parameters.h
dbcfb326c0c096ad9cdbc818ebcfa011a19828bc
[]
no_license
zanzo420/Medieval-Dynasty-SDK
d020ad634328ee8ee612ba4bd7e36b36dab740ce
d720e49ae1505e087790b2743506921afb28fc18
refs/heads/main
2023-06-20T03:00:17.986041
2021-07-15T04:51:34
2021-07-15T04:51:34
386,165,085
0
0
null
null
null
null
UTF-8
C++
false
false
2,882
h
#pragma once // Name: Medieval Dynasty, Version: 0.6.0.3 /*!!DEFINE!!*/ /*!!HELPER_DEF!!*/ /*!!HELPER_INC!!*/ #ifdef _MSC_VER #pragma pack(push, 0x01) #endif namespace CG { //--------------------------------------------------------------------------- // Parameters //--------------------------------------------------------------------------- // Function BTTask_GoToWorkSlot.BTTask_GoToWorkSlot_C.OnFail_F0DE4E6643F18890478429B2CDF0A5F2 struct UBTTask_GoToWorkSlot_C_OnFail_F0DE4E6643F18890478429B2CDF0A5F2_Params { TEnumAsByte<AIModule_EPathFollowingResult> MovementResult; // (BlueprintVisible, BlueprintReadOnly, Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash) }; // Function BTTask_GoToWorkSlot.BTTask_GoToWorkSlot_C.OnSuccess_F0DE4E6643F18890478429B2CDF0A5F2 struct UBTTask_GoToWorkSlot_C_OnSuccess_F0DE4E6643F18890478429B2CDF0A5F2_Params { TEnumAsByte<AIModule_EPathFollowingResult> MovementResult; // (BlueprintVisible, BlueprintReadOnly, Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash) }; // Function BTTask_GoToWorkSlot.BTTask_GoToWorkSlot_C.ReceiveExecuteAI struct UBTTask_GoToWorkSlot_C_ReceiveExecuteAI_Params { class AAIController* OwnerController; // (BlueprintVisible, BlueprintReadOnly, Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash) class APawn* ControlledPawn; // (BlueprintVisible, BlueprintReadOnly, Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash) }; // Function BTTask_GoToWorkSlot.BTTask_GoToWorkSlot_C.Finish struct UBTTask_GoToWorkSlot_C_Finish_Params { }; // Function BTTask_GoToWorkSlot.BTTask_GoToWorkSlot_C.ReceiveAbortAI struct UBTTask_GoToWorkSlot_C_ReceiveAbortAI_Params { class AAIController* OwnerController; // (BlueprintVisible, BlueprintReadOnly, Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash) class APawn* ControlledPawn; // (BlueprintVisible, BlueprintReadOnly, Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash) }; // Function BTTask_GoToWorkSlot.BTTask_GoToWorkSlot_C.ExecuteUbergraph_BTTask_GoToWorkSlot struct UBTTask_GoToWorkSlot_C_ExecuteUbergraph_BTTask_GoToWorkSlot_Params { int EntryPoint; // (BlueprintVisible, BlueprintReadOnly, Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash) }; } #ifdef _MSC_VER #pragma pack(pop) #endif
[ "zp2kshield@gmail.com" ]
zp2kshield@gmail.com
f3650af4d6d8b958c5d01bbaa06644a7c3c66896
d0a1672648d460f759e76baa4375ce6e69fa3573
/2012874007김용주/HW2-22/hw2-22.cpp
764f52212dd8f264fbbb5e1668659594cb59cf3e
[]
no_license
hellohiju/cp2012874007
7ea04508d6e20b2b61da12a0010f6276dfa2c93a
2eec05bc53612c00d422bc2e5150656e250cbf2f
refs/heads/master
2020-03-30T19:01:38.651824
2018-12-11T07:41:07
2018-12-11T07:41:07
149,241,827
0
0
null
null
null
null
UHC
C++
false
false
499
cpp
// hw2-22.cpp // 사용자가 0을 입력할 때까지 여러 숫자를 입력받아, // 입력받은 숫자의 최대값을 출력하는 프로그램을 작성하시오. /*사용자 입력 3 2 4 8 0 결과: 8 */ #include <stdio.h> int main() { printf("Largest\n"); int a = 0; int b = 0; printf("Enter integers\n"); while (1) { printf("integer: "); scanf("%d", &a); if (a > b) b = a; if (a == 0) { printf("The largest number is %d\n", b); break; } } return 0; }
[ "helloju48@gmail.com" ]
helloju48@gmail.com
a97525d5119a39df4fb7ce7a728ecb546efa3a10
d52d5fdbcd848334c6b7799cad7b3dfd2f1f33e4
/third_party/folly/folly/synchronization/example/HazptrSWMRSet.h
d29e9ba353a346f7ef46ac8b725379ba99588e98
[ "Apache-2.0" ]
permissive
zhiliaoniu/toolhub
4109c2a488b3679e291ae83cdac92b52c72bc592
39a3810ac67604e8fa621c69f7ca6df1b35576de
refs/heads/master
2022-12-10T23:17:26.541731
2020-07-18T03:33:48
2020-07-18T03:33:48
125,298,974
1
0
null
null
null
null
UTF-8
C++
false
false
3,694
h
/* * Copyright 2016-present Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include <folly/synchronization/Hazptr.h> #include <atomic> namespace folly { /** Set implemented as an ordered singly-linked list. * * A single writer thread may add or remove elements. Multiple reader * threads may search the set concurrently with each other and with * the writer's operations. */ template <typename T, template <typename> class Atom = std::atomic> class HazptrSWMRSet { template <typename Node> struct Reclaimer { void operator()(Node* p) { delete p; } }; struct Node : public hazptr_obj_base<Node, Atom, Reclaimer<Node>> { T elem_; Atom<Node*> next_; Node(T e, Node* n) : elem_(e), next_(n) {} }; Atom<Node*> head_{nullptr}; public: HazptrSWMRSet() : head_(nullptr) {} ~HazptrSWMRSet() { auto p = head_.load(); while (p) { auto next = p->next_.load(); delete p; p = next; } } bool add(T v) { auto prev = &head_; locate_lower_bound(v, prev); auto curr = prev->load(std::memory_order_relaxed); if (curr && curr->elem_ == v) { return false; } prev->store(new Node(std::move(v), curr)); return true; } bool remove(const T& v) { auto prev = &head_; locate_lower_bound(v, prev); auto curr = prev->load(std::memory_order_relaxed); if (!curr || curr->elem_ != v) { return false; } Node* curr_next = curr->next_.load(); // Patch up the actual list... prev->store(curr_next, std::memory_order_release); // ...and only then null out the removed node. curr->next_.store(nullptr, std::memory_order_release); curr->retire(); return true; } /* Used by readers */ bool contains(const T& val) const { /* Two hazard pointers for hand-over-hand traversal. */ hazptr_local<2, Atom> hptr; hazptr_holder<Atom>* hptr_prev = &hptr[0]; hazptr_holder<Atom>* hptr_curr = &hptr[1]; while (true) { auto prev = &head_; auto curr = prev->load(std::memory_order_acquire); while (true) { if (!curr) { return false; } if (!hptr_curr->try_protect(curr, *prev)) { break; } auto next = curr->next_.load(std::memory_order_acquire); if (prev->load(std::memory_order_acquire) != curr) { break; } if (curr->elem_ == val) { return true; } else if (!(curr->elem_ < val)) { return false; // because the list is sorted } prev = &(curr->next_); curr = next; std::swap(hptr_curr, hptr_prev); } } } private: /* Used by the single writer */ void locate_lower_bound(const T& v, Atom<Node*>*& prev) const { auto curr = prev->load(std::memory_order_relaxed); while (curr) { if (curr->elem_ >= v) { break; } prev = &(curr->next_); curr = curr->next_.load(std::memory_order_relaxed); } return; } }; } // namespace folly
[ "yangshengzhi1@bigo.sg" ]
yangshengzhi1@bigo.sg
990a69f678625cc8d2d5ab36c845699d87368093
1c4a59a443086e9c256836b295dfb5cbb739369a
/Windows/Demo/TestEcho-SSL/Server/ServerDlg.cpp
7b4dfedcd9b9240249dc755df663d6703573a31b
[ "Apache-2.0" ]
permissive
ldcsaa/HP-Socket
75f1e066472a294d29beba40db73bf9d50eda681
fb45e228974e4f2cac2c222ab0d07a7a316a07f3
refs/heads/dev
2023-08-16T03:00:10.580279
2023-08-12T21:21:14
2023-08-12T21:21:14
15,257,213
6,720
1,934
NOASSERTION
2021-12-27T06:33:17
2013-12-17T14:53:52
C
UTF-8
C++
false
false
6,628
cpp
// ServerDlg.cpp : implementation file // #include "stdafx.h" #include "Server.h" #include "ServerDlg.h" #include "afxdialogex.h" // CServerDlg dialog const LPCTSTR CServerDlg::ADDRESS = _T("0.0.0.0"); const USHORT CServerDlg::PORT = 5555; CServerDlg::CServerDlg(CWnd* pParent /*=NULL*/) : CDialogEx(CServerDlg::IDD, pParent), m_Server(this) { m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); } void CServerDlg::DoDataExchange(CDataExchange* pDX) { CDialogEx::DoDataExchange(pDX); DDX_Control(pDX, IDC_INFO, m_Info); DDX_Control(pDX, IDC_START, m_Start); DDX_Control(pDX, IDC_STOP, m_Stop); DDX_Control(pDX, IDC_ADDRESS, m_Address); DDX_Control(pDX, IDC_CONN_ID, m_ConnID); DDX_Control(pDX, IDC_DISCONNECT, m_DisConn); } BEGIN_MESSAGE_MAP(CServerDlg, CDialogEx) ON_WM_PAINT() ON_WM_QUERYDRAGICON() ON_BN_CLICKED(IDC_START, &CServerDlg::OnBnClickedStart) ON_BN_CLICKED(IDC_STOP, &CServerDlg::OnBnClickedStop) ON_MESSAGE(USER_INFO_MSG, OnUserInfoMsg) ON_BN_CLICKED(IDC_DISCONNECT, &CServerDlg::OnBnClickedDisconnect) ON_EN_CHANGE(IDC_CONN_ID, &CServerDlg::OnEnChangeConnId) ON_WM_VKEYTOITEM() END_MESSAGE_MAP() // CServerDlg message handlers BOOL CServerDlg::OnInitDialog() { CDialogEx::OnInitDialog(); // Set the icon for this dialog. The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon // TODO: Add extra initialization here CString strTitle; CString strOriginTitle; GetWindowText(strOriginTitle); strTitle.Format(_T("%s - (%s:%d)"), strOriginTitle, ADDRESS, PORT); SetWindowText(strTitle); ::SetMainWnd(this); ::SetInfoList(&m_Info); SetAppState(ST_STOPPED); return TRUE; // return TRUE unless you set the focus to a control } // If you add a minimize button to your dialog, you will need the code below // to draw the icon. For MFC applications using the document/view model, // this is automatically done for you by the framework. void CServerDlg::OnPaint() { if (IsIconic()) { CPaintDC dc(this); // device context for painting SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0); // Center icon in client rectangle 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; // Draw the icon dc.DrawIcon(x, y, m_hIcon); } else { CDialogEx::OnPaint(); } } // The system calls this function to obtain the cursor to display while the user drags // the minimized window. HCURSOR CServerDlg::OnQueryDragIcon() { return static_cast<HCURSOR>(m_hIcon); } BOOL CServerDlg::PreTranslateMessage(MSG* pMsg) { if ( pMsg->message == WM_KEYDOWN &&( pMsg->wParam == VK_ESCAPE || pMsg->wParam == VK_CANCEL || pMsg->wParam == VK_RETURN )) return TRUE; return CDialog::PreTranslateMessage(pMsg); } void CServerDlg::SetAppState(EnAppState state) { m_enState = state; if(this->GetSafeHwnd() == nullptr) return; m_Start.EnableWindow(m_enState == ST_STOPPED); m_Stop.EnableWindow(m_enState == ST_STARTED); m_Address.EnableWindow(m_enState == ST_STOPPED); m_DisConn.EnableWindow(m_enState == ST_STARTED && m_ConnID.GetWindowTextLength() > 0); } void CServerDlg::OnBnClickedStart() { USES_CONVERSION; m_Address.GetWindowText(m_strAddress); m_strAddress.Trim(); SetAppState(ST_STARTING); m_Server.CleanupSSLContext(); //if(!m_Server.SetupSSLContext(g_s_iVerifyMode, g_s_lpszPemCertFile, g_s_lpszPemKeyFile, g_s_lpszKeyPasswod, g_s_lpszCAPemCertFileOrPath)) if(!m_Server.SetupSSLContextByMemory(g_s_iVerifyMode, g_s_lpszPemCert, g_s_lpszPemKey, T2A(g_s_lpszKeyPasswod), g_s_lpszCAPemCert)) { ::LogServerStartFail(::GetLastError(), _T("initialize SSL env fail")); SetAppState(ST_STOPPED); return; } if(m_Server.Start(ADDRESS, PORT)) { ::LogServerStart(ADDRESS, PORT); SetAppState(ST_STARTED); } else { ::LogServerStartFail(m_Server.GetLastError(), m_Server.GetLastErrorDesc()); SetAppState(ST_STOPPED); } } void CServerDlg::OnBnClickedStop() { SetAppState(ST_STOPPING); if(m_Server.Stop()) { ::LogServerStop(); SetAppState(ST_STOPPED); } else { ASSERT(FALSE); } } void CServerDlg::OnBnClickedDisconnect() { CString strConnID; m_ConnID.GetWindowText(strConnID); CONNID dwConnID = (CONNID)_ttoi(strConnID); if(m_Server.Disconnect(dwConnID)) ::LogDisconnect(dwConnID); else ::LogDisconnectFail(dwConnID); } void CServerDlg::OnEnChangeConnId() { m_DisConn.EnableWindow(m_enState == ST_STARTED && m_ConnID.GetWindowTextLength() > 0); } int CServerDlg::OnVKeyToItem(UINT nKey, CListBox* pListBox, UINT nIndex) { if(nKey == 'C') pListBox->ResetContent(); return __super::OnVKeyToItem(nKey, pListBox, nIndex); } LRESULT CServerDlg::OnUserInfoMsg(WPARAM wp, LPARAM lp) { info_msg* msg = (info_msg*)wp; ::LogInfoMsg(msg); return 0; } EnHandleResult CServerDlg::OnPrepareListen(ITcpServer* pSender, SOCKET soListen) { TCHAR szAddress[100]; int iAddressLen = sizeof(szAddress) / sizeof(TCHAR); USHORT usPort; pSender->GetListenAddress(szAddress, iAddressLen, usPort); ::PostOnPrepareListen(szAddress, usPort); return HR_OK; } EnHandleResult CServerDlg::OnAccept(ITcpServer* pSender, CONNID dwConnID, UINT_PTR soClient) { BOOL bPass = TRUE; TCHAR szAddress[100]; int iAddressLen = sizeof(szAddress) / sizeof(TCHAR); USHORT usPort; pSender->GetRemoteAddress(dwConnID, szAddress, iAddressLen, usPort); if(!m_strAddress.IsEmpty()) { if(m_strAddress.CompareNoCase(szAddress) == 0) bPass = FALSE; } ::PostOnAccept(dwConnID, szAddress, usPort, bPass); return bPass ? HR_OK : HR_ERROR; } EnHandleResult CServerDlg::OnHandShake(ITcpServer* pSender, CONNID dwConnID) { ::PostOnHandShake(dwConnID); return HR_OK; } EnHandleResult CServerDlg::OnSend(ITcpServer* pSender, CONNID dwConnID, const BYTE* pData, int iLength) { ::PostOnSend(dwConnID, pData, iLength); return HR_OK; } EnHandleResult CServerDlg::OnReceive(ITcpServer* pSender, CONNID dwConnID, const BYTE* pData, int iLength) { ::PostOnReceive(dwConnID, pData, iLength); return pSender->Send(dwConnID, pData, iLength) ? HR_OK : HR_ERROR; } EnHandleResult CServerDlg::OnClose(ITcpServer* pSender, CONNID dwConnID, EnSocketOperation enOperation, int iErrorCode) { iErrorCode == SE_OK ? ::PostOnClose(dwConnID) : ::PostOnError(dwConnID, enOperation, iErrorCode); return HR_OK; } EnHandleResult CServerDlg::OnShutdown(ITcpServer* pSender) { ::PostOnShutdown(); return HR_OK; }
[ "ldcsaa@21cn.com" ]
ldcsaa@21cn.com
da75906e760ff027c6d045798939a262d8624476
1f63dde39fcc5f8be29f2acb947c41f1b6f1683e
/Boss2D/addon/tensorflow-1.2.1_for_boss/tensorflow/contrib/tensor_forest/kernels/count_extremely_random_stats_op.cc
2b8d7f27c3743225d3085adc72e12f1f02cd8392
[ "MIT", "Apache-2.0" ]
permissive
koobonil/Boss2D
09ca948823e0df5a5a53b64a10033c4f3665483a
e5eb355b57228a701495f2660f137bd05628c202
refs/heads/master
2022-10-20T09:02:51.341143
2019-07-18T02:13:44
2019-07-18T02:13:44
105,999,368
7
2
MIT
2022-10-04T23:31:12
2017-10-06T11:57:07
C++
UTF-8
C++
false
false
29,469
cc
// Copyright 2016 The TensorFlow Authors. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // ============================================================================= // CountExtremelyRandomStats outputs count-deltas that should be added to // the node pcws, candidate split pcws, and total split pcws. It also outputs // the leaves that each input arrived to for use in SampleInputs. This is the // only op that involves tree traversal, and is constructed so that it can // be run in parallel on separate batches of data. #include <unordered_map> #include <unordered_set> #include <vector> #include "tensorflow/contrib/tensor_forest/kernels/data_spec.h" #include "tensorflow/contrib/tensor_forest/kernels/tree_utils.h" #include "tensorflow/core/framework/op.h" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/shape_inference.h" #include "tensorflow/core/kernels/bounds_check.h" #include "tensorflow/core/lib/gtl/map_util.h" #include "tensorflow/core/util/work_sharder.h" namespace tensorflow { using std::get; using std::make_pair; using std::make_tuple; using std::tuple; using tensorforest::CHILDREN_INDEX; using tensorforest::FEATURE_INDEX; using tensorforest::LEAF_NODE; using tensorforest::FREE_NODE; using tensorforest::CheckTensorBounds; using tensorforest::DecideNode; using tensorforest::TensorForestDataSpec; using tensorforest::Initialize; using tensorforest::IsAllInitialized; using shape_inference::DimensionHandle; using shape_inference::InferenceContext; using shape_inference::ShapeHandle; // A data structure to store the results of parallel tree traversal. struct InputDataResult { // A list of each node that was visited. std::vector<int32> node_indices; // The accumulator of the leaf that a data point ended up at, or -1 if none. int32 leaf_accumulator; // The left-branch taken candidate splits. std::vector<int32> split_adds; // If the candidate splits for the leaf that a data point arrived at // were initialized or not, which determines if we add this to total // pcw counts or not. bool splits_initialized; }; struct EvaluateParams { TensorForestDataSpec input_spec; Tensor dense_input; Tensor sparse_indices; Tensor sparse_values; Tensor input_labels; Tensor tree_tensor; Tensor tree_thresholds; Tensor node_to_accumulator; Tensor candidate_split_features; Tensor candidate_split_thresholds; InputDataResult* results; }; void Evaluate(const EvaluateParams& params, int32 start, int32 end) { const auto tree = params.tree_tensor.tensor<int32, 2>(); const auto thresholds = params.tree_thresholds.unaligned_flat<float>(); const auto node_map = params.node_to_accumulator.unaligned_flat<int32>(); const auto split_features = params.candidate_split_features.tensor<int32, 2>(); const auto split_thresholds = params.candidate_split_thresholds.tensor<float, 2>(); const int32 num_splits = static_cast<int32>( params.candidate_split_features.shape().dim_size(1)); const int32 num_nodes = static_cast<int32>( params.tree_tensor.shape().dim_size(0)); const int32 num_accumulators = static_cast<int32>( params.candidate_split_features.shape().dim_size(0)); // Lambdas to capture the eigen-tensors so we don't the conversion overhead // on each call to DecideNode. const auto get_dense = tensorforest::GetDenseFunctor(params.dense_input); const auto get_sparse = tensorforest::GetSparseFunctor(params.sparse_indices, params.sparse_values); for (int32 i = start; i < end; ++i) { int node_index = 0; params.results[i].splits_initialized = false; while (true) { params.results[i].node_indices.push_back(node_index); CHECK_LT(node_index, num_nodes); int32 left_child = internal::SubtleMustCopy(tree(node_index, CHILDREN_INDEX)); if (left_child == LEAF_NODE) { const int32 accumulator = internal::SubtleMustCopy(node_map(node_index)); params.results[i].leaf_accumulator = accumulator; // If the leaf is not fertile or is not yet initialized, we don't // count it in the candidate/total split per-class-weights because // it won't have any candidate splits yet. if (accumulator >= 0 && IsAllInitialized(split_features, accumulator, num_splits)) { CHECK_LT(accumulator, num_accumulators); params.results[i].splits_initialized = true; for (int split = 0; split < num_splits; split++) { const int32 feature = split_features(accumulator, split); if (!DecideNode(get_dense, get_sparse, i, feature, split_thresholds(accumulator, split), params.input_spec)) { params.results[i].split_adds.push_back(split); } } } break; } else if (left_child == FREE_NODE) { LOG(ERROR) << "Reached a free node, not good."; params.results[i].node_indices.push_back(FREE_NODE); break; } const int32 feature = tree(node_index, FEATURE_INDEX); node_index = left_child + DecideNode(get_dense, get_sparse, i, feature, thresholds(node_index), params.input_spec); } } } class CountExtremelyRandomStats : public OpKernel { public: explicit CountExtremelyRandomStats(OpKernelConstruction* context) : OpKernel(context) { OP_REQUIRES_OK(context, context->GetAttr( "num_classes", &num_classes_)); OP_REQUIRES_OK(context, context->GetAttr( "regression", &regression_)); string serialized_proto; OP_REQUIRES_OK(context, context->GetAttr("input_spec", &serialized_proto)); input_spec_.ParseFromString(serialized_proto); } void Compute(OpKernelContext* context) override { const Tensor& input_data = context->input(0); const Tensor& sparse_input_indices = context->input(1); const Tensor& sparse_input_values = context->input(2); const Tensor& sparse_input_shape = context->input(3); const Tensor& input_labels = context->input(4); const Tensor& input_weights = context->input(5); const Tensor& tree_tensor = context->input(6); const Tensor& tree_thresholds = context->input(7); const Tensor& node_to_accumulator = context->input(8); const Tensor& candidate_split_features = context->input(9); const Tensor& candidate_split_thresholds = context->input(10); const Tensor& birth_epochs = context->input(11); const Tensor& current_epoch = context->input(12); bool sparse_input = (sparse_input_indices.shape().dims() == 2); bool have_weights = (input_weights.shape().dim_size(0) > 0); int32 num_data = -1; // Check inputs. if (sparse_input) { const auto sparse_shape = sparse_input_shape.unaligned_flat<int64>(); // TODO(gilberth): This is because we can't figure out the shape // of a sparse tensor at graph-build time, even if the dimension is // actually known. input_spec_.mutable_sparse(0)->set_size(sparse_shape(1)); num_data = sparse_shape(0); OP_REQUIRES(context, sparse_input_shape.shape().dims() == 1, errors::InvalidArgument( "sparse_input_shape should be one-dimensional")); OP_REQUIRES(context, sparse_input_shape.shape().dim_size(0) == 2, errors::InvalidArgument( "The sparse input data should be two-dimensional")); OP_REQUIRES(context, sparse_input_values.shape().dims() == 1, errors::InvalidArgument( "sparse_input_values should be one-dimensional")); OP_REQUIRES(context, sparse_input_indices.shape().dims() == 2, errors::InvalidArgument( "The sparse input data should be two-dimensional")); OP_REQUIRES(context, sparse_input_indices.shape().dim_size(0) == sparse_input_values.shape().dim_size(0), errors::InvalidArgument( "sparse_input_indices and sparse_input_values should " "agree on the number of non-zero values")); } if (input_data.shape().dim_size(0) > 0) { const int32 dense_num_data = static_cast<int32>(input_data.shape().dim_size(0)); if (num_data > 0) { CHECK_EQ(num_data, dense_num_data) << "number of examples must match for sparse + dense input."; } num_data = dense_num_data; OP_REQUIRES(context, input_data.shape().dims() == 2, errors::InvalidArgument( "input_data should be two-dimensional")); OP_REQUIRES( context, input_data.shape().dim_size(0) == input_labels.shape().dim_size(0), errors::InvalidArgument( "Number of inputs should be the same in " "input_data and input_labels.")); } if (have_weights) { OP_REQUIRES( context, input_weights.shape().dim_size(0) == input_labels.shape().dim_size(0), errors::InvalidArgument( "Number of inputs should be the same in input_weights and " "input_labels.")); } OP_REQUIRES(context, input_labels.shape().dims() >= 1, errors::InvalidArgument( "input_labels should be at least one-dimensional")); OP_REQUIRES(context, tree_tensor.shape().dims() == 2, errors::InvalidArgument( "tree should be two-dimensional")); OP_REQUIRES(context, tree_thresholds.shape().dims() == 1, errors::InvalidArgument( "tree_thresholds should be one-dimensional")); OP_REQUIRES(context, node_to_accumulator.shape().dims() == 1, errors::InvalidArgument( "node_to_accumulator should be one-dimensional")); OP_REQUIRES(context, candidate_split_features.shape().dims() == 2, errors::InvalidArgument( "candidate_split_features should be two-dimensional")); OP_REQUIRES(context, candidate_split_thresholds.shape().dims() == 2, errors::InvalidArgument( "candidate_split_thresholds should be two-dimensional")); OP_REQUIRES(context, birth_epochs.shape().dims() == 1, errors::InvalidArgument( "birth_epochs should be one-dimensional")); OP_REQUIRES(context, current_epoch.shape().dims() == 1, errors::InvalidArgument( "current_epoch should be one-dimensional")); OP_REQUIRES( context, tree_tensor.shape().dim_size(0) == tree_thresholds.shape().dim_size(0) && tree_tensor.shape().dim_size(0) == node_to_accumulator.shape().dim_size(0) && tree_tensor.shape().dim_size(0) == birth_epochs.shape().dim_size(0), errors::InvalidArgument( "Number of nodes should be the same in " "tree, tree_thresholds, node_to_accumulator, and birth_epoch.")); OP_REQUIRES( context, candidate_split_features.shape() == candidate_split_thresholds.shape(), errors::InvalidArgument( "candidate_split_features and candidate_split_thresholds should be " "the same shape.")); OP_REQUIRES( context, current_epoch.shape().dim_size(0) == 1, errors::InvalidArgument( "The current_epoch should be a tensor of shape (1).")); // Check tensor bounds. if (!CheckTensorBounds(context, input_data)) return; if (!CheckTensorBounds(context, sparse_input_indices)) return; if (!CheckTensorBounds(context, sparse_input_values)) return; if (!CheckTensorBounds(context, sparse_input_shape)) return; if (!CheckTensorBounds(context, input_labels)) return; if (!CheckTensorBounds(context, input_weights)) return; if (!CheckTensorBounds(context, tree_tensor)) return; if (!CheckTensorBounds(context, tree_thresholds)) return; if (!CheckTensorBounds(context, node_to_accumulator)) return; if (!CheckTensorBounds(context, candidate_split_features)) return; if (!CheckTensorBounds(context, candidate_split_thresholds)) return; if (!CheckTensorBounds(context, birth_epochs)) return; if (!CheckTensorBounds(context, current_epoch)) return; // Evaluate input data in parallel. const int32 epoch = current_epoch.unaligned_flat<int32>()(0); std::unique_ptr<InputDataResult[]> results(new InputDataResult[num_data]); auto worker_threads = context->device()->tensorflow_cpu_worker_threads(); int num_threads = worker_threads->num_threads; EvaluateParams params; params.dense_input = input_data; params.sparse_indices = sparse_input_indices; params.sparse_values = sparse_input_values; params.input_spec = input_spec_; params.input_labels = input_labels; params.tree_tensor = tree_tensor; params.tree_thresholds = tree_thresholds; params.node_to_accumulator = node_to_accumulator; params.candidate_split_features = candidate_split_features; params.candidate_split_thresholds = candidate_split_thresholds; params.results = results.get(); // Require at least 100 inputs per thread. I guess that's about 800 cost // per unit. This isn't well defined. const int64 costPerUnit = 800; auto work = [&params, num_data](int64 start, int64 end) { CHECK(start <= end); CHECK(end <= num_data); Evaluate(params, static_cast<int32>(start), static_cast<int32>(end)); }; Shard(num_threads, worker_threads->workers, num_data, costPerUnit, work); const int32 num_nodes = static_cast<int32>(tree_tensor.shape().dim_size(0)); if (regression_) { ProcessResultsRegression(context, input_labels, input_weights, birth_epochs, epoch, std::move(results), num_nodes); } else { ProcessResultsClassification(context, input_labels, input_weights, birth_epochs, epoch, std::move(results), num_nodes); } } protected: void ProcessResultsClassification(OpKernelContext* context, const Tensor& input_labels, const Tensor& input_weights, const Tensor& birth_epochs, int32 epoch, std::unique_ptr<InputDataResult[]> results, int32 num_nodes) { const int32 num_data = static_cast<int32>(input_labels.shape().dim_size(0)); const auto labels = input_labels.unaligned_flat<float>(); const auto start_epochs = birth_epochs.unaligned_flat<int32>(); const auto weights = input_weights.unaligned_flat<float>(); // Unused outputs for classification. Still have to specify them or // tensorflow complains. Tensor* dummy = nullptr; TensorShape dummy_shape; dummy_shape.AddDim(0); OP_REQUIRES_OK(context, context->allocate_output(1, dummy_shape, &dummy)); OP_REQUIRES_OK(context, context->allocate_output(4, dummy_shape, &dummy)); OP_REQUIRES_OK(context, context->allocate_output(7, dummy_shape, &dummy)); // node pcw delta Tensor* output_node_pcw_sums_delta = nullptr; TensorShape node_pcw_sums_shape; node_pcw_sums_shape.AddDim(num_nodes); node_pcw_sums_shape.AddDim(num_classes_); OP_REQUIRES_OK(context, context->allocate_output(0, node_pcw_sums_shape, &output_node_pcw_sums_delta)); Initialize<float>(*output_node_pcw_sums_delta, 0); auto out_node_sums = output_node_pcw_sums_delta->tensor<float, 2>(); // leaves Tensor* output_leaves = nullptr; TensorShape leaves_shape; leaves_shape.AddDim(num_data); OP_REQUIRES_OK(context, context->allocate_output(8, leaves_shape, &output_leaves)); auto out_leaves = output_leaves->unaligned_flat<int32>(); // <accumulator, class> -> count delta PairMapType<float> total_delta; // <accumulator, split, class> -> count delta TupleMapType<float> split_delta; for (int32 i = 0; i < num_data; ++i) { out_leaves(i) = results[i].node_indices.back(); float w = 1.0; if (weights.size() > 0) { w = weights(i); } const int32 label = internal::SubtleMustCopy( static_cast<int32>(labels(i))); // Labels that come from sparse tensors can have missing values. if (label < 0) { continue; } const int32 column = label + 1; CHECK_LT(column, num_classes_); const int32 accumulator = results[i].leaf_accumulator; for (const int32 node : results[i].node_indices) { if (epoch > start_epochs(node) + 1) { continue; } out_node_sums(node, column) += w; out_node_sums(node, 0) += w; } if (epoch > start_epochs(out_leaves(i)) + 1) { continue; } if (accumulator >= 0 && results[i].splits_initialized) { total_delta[make_pair(accumulator, column)] += w; total_delta[make_pair(accumulator, 0)] += w; for (const int32 split : results[i].split_adds) { split_delta[make_tuple(accumulator, split, column)] += w; split_delta[make_tuple(accumulator, split, 0)] += w; } } } // candidate splits pcw indices Tensor* output_candidate_pcw_indices = nullptr; TensorShape candidate_pcw_shape; candidate_pcw_shape.AddDim(split_delta.size()); candidate_pcw_shape.AddDim(3); OP_REQUIRES_OK(context, context->allocate_output(2, candidate_pcw_shape, &output_candidate_pcw_indices)); auto out_candidate_indices = output_candidate_pcw_indices->tensor<int32, 2>(); // candidate splits pcw delta Tensor* output_candidate_pcw_delta = nullptr; TensorShape candidate_pcw_delta_shape; candidate_pcw_delta_shape.AddDim(split_delta.size()); OP_REQUIRES_OK(context, context->allocate_output(3, candidate_pcw_delta_shape, &output_candidate_pcw_delta)); auto out_candidate = output_candidate_pcw_delta->unaligned_flat<float>(); // total splits indices Tensor* output_total_pcw_indices = nullptr; TensorShape total_pcw_shape; total_pcw_shape.AddDim(total_delta.size()); total_pcw_shape.AddDim(2); OP_REQUIRES_OK(context, context->allocate_output(5, total_pcw_shape, &output_total_pcw_indices)); auto out_total_indices = output_total_pcw_indices->tensor<int32, 2>(); // total splits delta Tensor* output_total_pcw_delta = nullptr; TensorShape total_pcw_delta_shape; total_pcw_delta_shape.AddDim(total_delta.size()); OP_REQUIRES_OK(context, context->allocate_output(6, total_pcw_delta_shape, &output_total_pcw_delta)); auto out_total = output_total_pcw_delta->unaligned_flat<float>(); // Copy total deltas to output. int32 output_slot = 0; for (const auto& updates : total_delta) { out_total_indices(output_slot, 0) = updates.first.first; out_total_indices(output_slot, 1) = updates.first.second; out_total(output_slot) = updates.second; ++output_slot; } // Copy split deltas to output. output_slot = 0; for (const auto& updates : split_delta) { out_candidate_indices(output_slot, 0) = get<0>(updates.first); out_candidate_indices(output_slot, 1) = get<1>(updates.first); out_candidate_indices(output_slot, 2) = get<2>(updates.first); out_candidate(output_slot) = updates.second; ++output_slot; } } void ProcessResultsRegression(OpKernelContext* context, const Tensor& input_labels, const Tensor& input_weights, const Tensor& birth_epochs, const int32 epoch, std::unique_ptr<InputDataResult[]> results, int32 num_nodes) { const int32 num_data = static_cast<int32>(input_labels.shape().dim_size(0)); int32 num_outputs = 1; if (input_labels.shape().dims() > 1) { num_outputs = static_cast<int32>(input_labels.shape().dim_size(1)); } const auto labels = input_labels.unaligned_flat<float>(); const auto start_epochs = birth_epochs.unaligned_flat<int32>(); const auto weights = input_weights.unaligned_flat<float>(); // node pcw delta Tensor* output_node_pcw_sums_delta = nullptr; TensorShape node_pcw_sums_shape; node_pcw_sums_shape.AddDim(num_nodes); node_pcw_sums_shape.AddDim(num_classes_); OP_REQUIRES_OK(context, context->allocate_output(0, node_pcw_sums_shape, &output_node_pcw_sums_delta)); Initialize<float>(*output_node_pcw_sums_delta, 0); auto out_node_sums = output_node_pcw_sums_delta->tensor<float, 2>(); Tensor* output_node_pcw_squares_delta = nullptr; TensorShape node_pcw_squares_shape; node_pcw_squares_shape.AddDim(num_nodes); node_pcw_squares_shape.AddDim(num_classes_); OP_REQUIRES_OK(context, context->allocate_output(1, node_pcw_squares_shape, &output_node_pcw_squares_delta)); Initialize<float>(*output_node_pcw_squares_delta, 0); auto out_node_squares = output_node_pcw_squares_delta->tensor<float, 2>(); // leaves Tensor* output_leaves = nullptr; TensorShape leaves_shape; leaves_shape.AddDim(num_data); OP_REQUIRES_OK(context, context->allocate_output(8, leaves_shape, &output_leaves)); auto out_leaves = output_leaves->unaligned_flat<int32>(); // <accumulator> -> label index std::unordered_map<int32, std::unordered_set<int32>> total_delta; // <accumulator, split> -> label index PairMapType<std::unordered_set<int32>> split_delta; for (int32 i = 0; i < num_data; ++i) { const int32 accumulator = results[i].leaf_accumulator; float w = 1.0; if (weights.size() > 0) { w = weights(i); } for (const int32 node : results[i].node_indices) { if (epoch > start_epochs(node) + 1) { continue; } for (int32 j = 0; j < num_outputs; ++j) { const float output = labels(i * num_outputs + j); out_node_sums(node, j + 1) += w * output; out_node_squares(node, j + 1) += w * output * output; out_node_sums(node, 0) += w; out_node_squares(node, 0) += w; } } out_leaves(i) = results[i].node_indices.back(); if (epoch > start_epochs(out_leaves(i)) + 1) { continue; } if (accumulator >= 0 && results[i].splits_initialized) { total_delta[accumulator].insert(i); for (const int32 split : results[i].split_adds) { split_delta[make_pair(accumulator, split)].insert(i); } } } // candidate splits pcw indices Tensor* output_candidate_pcw_indices = nullptr; TensorShape candidate_pcw_shape; candidate_pcw_shape.AddDim(split_delta.size()); candidate_pcw_shape.AddDim(2); OP_REQUIRES_OK(context, context->allocate_output(2, candidate_pcw_shape, &output_candidate_pcw_indices)); auto out_candidate_indices = output_candidate_pcw_indices->tensor<int32, 2>(); // candidate splits pcw delta // sums Tensor* output_candidate_pcw_sums = nullptr; TensorShape candidate_pcw_sums_shape; candidate_pcw_sums_shape.AddDim(split_delta.size()); candidate_pcw_sums_shape.AddDim(num_classes_); OP_REQUIRES_OK(context, context->allocate_output(3, candidate_pcw_sums_shape, &output_candidate_pcw_sums)); Initialize<float>(*output_candidate_pcw_sums, 0); auto out_split_sums = output_candidate_pcw_sums->tensor<float, 2>(); // squares Tensor* output_candidate_pcw_squares = nullptr; TensorShape candidate_pcw_squares_shape; candidate_pcw_squares_shape.AddDim(split_delta.size()); candidate_pcw_squares_shape.AddDim(num_classes_); OP_REQUIRES_OK(context, context->allocate_output(4, candidate_pcw_squares_shape, &output_candidate_pcw_squares)); Initialize<float>(*output_candidate_pcw_squares, 0); auto out_split_squares = output_candidate_pcw_squares->tensor<float, 2>(); // total splits indices Tensor* output_total_pcw_indices = nullptr; TensorShape total_pcw_shape; total_pcw_shape.AddDim(total_delta.size()); total_pcw_shape.AddDim(1); OP_REQUIRES_OK(context, context->allocate_output(5, total_pcw_shape, &output_total_pcw_indices)); auto out_total_indices = output_total_pcw_indices->unaligned_flat<int32>(); // total splits delta // sums Tensor* output_total_pcw_sums = nullptr; TensorShape total_pcw_sums_shape; total_pcw_sums_shape.AddDim(total_delta.size()); total_pcw_sums_shape.AddDim(num_classes_); OP_REQUIRES_OK(context, context->allocate_output(6, total_pcw_sums_shape, &output_total_pcw_sums)); Initialize<float>(*output_total_pcw_sums, 0); auto out_total_sums = output_total_pcw_sums->tensor<float, 2>(); // squares Tensor* output_total_pcw_squares = nullptr; TensorShape total_pcw_squares_shape; total_pcw_squares_shape.AddDim(total_delta.size()); total_pcw_squares_shape.AddDim(num_classes_); OP_REQUIRES_OK(context, context->allocate_output(7, total_pcw_squares_shape, &output_total_pcw_squares)); Initialize<float>(*output_total_pcw_squares, 0); auto out_total_squares = output_total_pcw_squares->tensor<float, 2>(); // Copy total deltas to output. int32 output_slot = 0; for (const auto& updates : total_delta) { out_total_indices(output_slot) = updates.first; for (const int32 i : updates.second) { for (int32 j = 0; j < num_outputs; ++j) { const float output = labels(i * num_outputs + j); out_total_sums(output_slot, j + 1) += output; out_total_squares(output_slot, j + 1) += output * output; } } out_total_sums(output_slot, 0) += updates.second.size(); out_total_squares(output_slot, 0) += updates.second.size(); ++output_slot; } // Copy split deltas to output. output_slot = 0; for (const auto& updates : split_delta) { out_candidate_indices(output_slot, 0) = updates.first.first; out_candidate_indices(output_slot, 1) = updates.first.second; for (const int32 i : updates.second) { for (int32 j = 0; j < num_outputs; ++j) { const float output = labels(i * num_outputs + j); out_split_sums(output_slot, j + 1) += output; out_split_squares(output_slot, j + 1) += output * output; } } out_split_sums(output_slot, 0) += updates.second.size(); out_split_squares(output_slot, 0) += updates.second.size(); ++output_slot; } } struct PairIntHash { public: std::size_t operator()(const std::pair<int32, int32>& x) const { // Bit-rotate x.first by 16 bits before xor-ing to minimize hash // collisions in the frequent case when both elements of the pair are // small. return (x.first << 16 | x.first >> 16) ^ x.second; } }; template <typename V> using PairMapType = std::unordered_map<std::pair<int32, int32>, V, PairIntHash>; struct TupleIntHash { public: std::size_t operator()(const std::tuple<int32, int32, int32>& x) const { const int32 first = get<0>(x); const int32 second = get<1>(x); // Again, we bit-rotate (once by 16 bits, and once by 8 bits) to minimize // hash collisions among small values. return (first << 16 | first >> 16) ^ (second << 8 | second >> 24) ^ get<2>(x); } }; template <typename V> using TupleMapType = std::unordered_map<tuple<int32, int32, int32>, V, TupleIntHash>; int32 num_classes_; bool regression_; tensorforest::TensorForestDataSpec input_spec_; }; REGISTER_KERNEL_BUILDER(Name("CountExtremelyRandomStats").Device(DEVICE_CPU), CountExtremelyRandomStats); } // namespace tensorflow
[ "slacealic@gmail.com" ]
slacealic@gmail.com
df80065679e2df65386e4f245f1ea738631b81cc
eb85acf7edb549663f8a290162cce440f12472e4
/cs141/vector.cpp
0bd4bb332e8cf2a5321ad38a42869f06267a8a8a
[]
no_license
willtrinh/School
c2ef66c289fef260d77861da174e510d1ee97a59
5c48aebc28e6ce32d6314e1877281b52a8a3f720
refs/heads/master
2020-12-10T21:57:25.155217
2020-09-22T21:46:39
2020-09-22T21:46:39
233,718,958
0
0
null
null
null
null
UTF-8
C++
false
false
6,873
cpp
/* * Name: Will Trinh * CS 141 - Programming Languages * Professor Klefstad * Homework #3 * October 25, 2018 */ #include <iostream> #include <string.h> #include <stdlib.h> #include <iterator> #include <vector> using namespace std; template <typename T> class Vector { private: int sz; // the number of elements in this Vector T * buf; // the base of the array of Ts, you must allocate it public: Vector( int n ) // Vector v1(10); -- create a 10 element Vector { sz = n; buf = new T[sz]; for (int i = 0; i < sz; i++) buf[i] = 0; } Vector(initializer_list<T> L ) // Vector v1{T1, T2, T3}; { sz = L.size(); buf = new T[sz]; int idx = 0; for (auto& element : L) { buf[idx] = element; idx++; } } // Destructor ~Vector() // destructor called automatically when a Vector dies { delete buf; buf = NULL; } // Copy constructor Vector( const Vector & v ) // Vector v2(v1); { sz = v.sz; buf = new T[sz]; for (int i = 0; i < sz; i++) buf[i] = v.buf[i]; } int size ( ) // v1.size() returns 10 for v1 example above { return sz; } T & operator [] ( const int i ) // T x = V[i]; { if (i < 0 || i > sz) { throw "Error: Access Index Out of Bound Exception!"; } return buf[i]; } T operator * ( const Vector & v ) const // T x = V1 * V2 { int size = 0; // If the vectors have different sizes, take the smaller size if (sz < v.sz) size = sz; else size = v.sz; T productSum = 0; for (int i = 0; i < size; i++) { productSum += buf[i] * v.buf[i]; } return productSum; } Vector operator + ( const Vector & v ) const // V3 = V1 + V2; { int size = 0; if (sz < v.sz) size = v.sz; else size = sz; Vector<T> vectorSum = Vector(size); Vector<T> vector1 = Vector(size); Vector<T> vector2 = Vector(size); for (int i = 0; i < sz; i++) vector1[i] = buf[i]; for (int i = 0; i < v.sz; i++) vector2[i] = v.buf[i]; for (int i = 0; i < size; i++) { vectorSum[i] = vector1[i] + vector2[i]; } return vectorSum; } const Vector & operator = ( const Vector & v ) // V1 = V2; { sz = v.sz; buf = v.buf; } bool operator == ( const Vector & v ) const //if ( V1 == V2 )... { if (sz != v.sz) return false; for (int i = 0; i < sz; i++) { if (buf[i] != v.buf[i]) return false; } return true; } bool operator != ( const Vector & v ) const // if ( V1 != V2 )... { if (sz != v.sz) return true; for (int i = 0; i < sz; i++) { if (buf[i] != v.buf[i]) return true; } return false; } friend Vector operator * ( const int n, const Vector & v ) // V1 = 20 * V2; -- each element of V1 will be element of V2 * 20 { for (int i = 0; i < v.sz; i++) { v.buf[i] *= n; } return v; } friend Vector operator + ( const int n, const Vector & v ) // V1 = 20 + V2; -- each element of V1 will be element of V2 + 20 { for (int i = 0; i < v.sz; i++) { v.buf[i] += n; } return v; } friend ostream& operator << ( ostream & o, const Vector & v ) // cout << V2; -- prints the vector in format (v0, v1, v2,...,vn) { o << "("; for (int i = 0; i < v.sz - 1; i++) o << v.buf[i] << ", "; o << v.buf[v.sz - 1] << ")"; } }; int main() // I’ll start it for you { cout << "******************** Testing Initializer List ********************" << endl; Vector<int> intVec{1,3,5,7,9}; cout << "intVec" << intVec << endl; Vector<double> doubleVec{1.5,2.5,3.5,4.5}; cout << "doubleVec" << doubleVec << endl << endl; cout << "******************** Testing Copy Constructor ********************" << endl; Vector<int> iv(intVec); Vector<double> dv(doubleVec); cout << "iv" << iv << endl; cout << "dv" << dv << endl << endl; cout << "******************** Testing Vector Size ********************" << endl; cout << "intVec Size: " << iv.size() << endl; cout << "doubleVec Size: " << dv.size() << endl << endl; cout << "******************** Testing T& Operator[] ********************" << endl; cout << "Testing valid index iv[3]: " << iv.operator[](3) << endl; cout << "Testing invalid index iv[10]: "; try { iv.operator[](10); } catch (const char* x) { cout << x << endl << endl; } cout << "******************** Testing T Operator* ********************" << endl; Vector<int> iv1{1, 2, 3}; cout << "Vectors: " << iv << iv1 << endl; cout << "Product Sum of two vectors: " << iv.operator*(iv1) << endl << endl; cout << "******************** Testing Vector Operator+ ********************" << endl; cout << "Vectors: " << iv << iv1 << endl; cout << "Vector Sum of two vectors: " << iv1.operator+(iv) << endl << endl; cout << "******************** Testing Vector Operator= ********************" << endl; Vector<double> dv1{1.1, 2.2, 3.3}; cout << "Vectors: " << dv << dv1 << endl; cout << "Testing dv.operator=(dv1): " << dv.operator=(dv1) << endl; cout << "New Vectors dv & dv1: " << dv << dv1 << endl << endl; cout << "******************** Testing Vector Operator== ********************" << endl; Vector<double> dv2{4.1, 2.2, 3.3, 4.4}; cout << "Vectors: " << dv1 << dv2 << endl; cout << "Testing dv1.operator==(dv2): " << boolalpha << dv1.operator==(dv2) << endl; cout << "Testing dv1.operator==(dv1): " << boolalpha << dv1.operator==(dv1) << endl << endl; cout << "******************** Testing Vector Operator!= ********************" << endl; cout << "Testing dv1.operator!=(dv2): " << boolalpha << dv1.operator!=(dv2) << endl; cout << "Testing dv1.operator!=(dv1): " << boolalpha << dv1.operator!=(dv1) << endl << endl; cout << "******************** Testing friend Vector Operator* ********************" << endl; cout << "Vector:" << iv << endl; Vector <int>iv2 = 20 * iv; cout << "Testing iv2 = 20 * iv: " << iv2 << endl << endl; cout << "******************** Testing friend Vector Operator+ ********************" << endl; cout << "Vector" << iv2 << endl; Vector<int>iv3 = 20 + iv2; cout << "Testing iv3 = 20 + iv2: " << iv2 << endl << endl; return 0; }
[ "williamltrinh@gmail.com" ]
williamltrinh@gmail.com
b1ec6483290198b99aa3525a3c55f471d9db5947
5be3af77f3ecd0851d111b2aaa488c3d9b021caa
/src/governance-object.h
d92b60c5ee6da6ab6c3405de8f570783c5a9c641
[ "MIT" ]
permissive
uhlik-mdfkbtc-veles-development/veles
44f9d22b2c26cbca92fd61247570a8b0b8c5c95d
871c86455a7164ca36020d4b6491d4a646615242
refs/heads/master
2020-06-17T09:50:51.178466
2019-06-08T19:46:34
2019-06-16T13:52:50
195,886,384
0
0
MIT
2019-07-08T21:08:35
2019-07-08T21:08:35
null
UTF-8
C++
false
false
10,049
h
// Copyright (c) 2014-2017 The Dash Core developers // Copyright (c) 2018 FXTC developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef FXTC_GOVERNANCE_OBJECT_H #define FXTC_GOVERNANCE_OBJECT_H //#define ENABLE_DASH_DEBUG #include <cachemultimap.h> #include <governance-exceptions.h> #include <governance-vote.h> #include <governance-votedb.h> #include <key.h> #include <net.h> #include <sync.h> #include <util.h> #include <univalue.h> class CGovernanceManager; class CGovernanceTriggerManager; class CGovernanceObject; class CGovernanceVote; static const int MAX_GOVERNANCE_OBJECT_DATA_SIZE = 16 * 1024; static const int MIN_GOVERNANCE_PEER_PROTO_VERSION = 70206; static const int GOVERNANCE_FILTER_PROTO_VERSION = 70206; static const double GOVERNANCE_FILTER_FP_RATE = 0.001; static const int GOVERNANCE_OBJECT_UNKNOWN = 0; static const int GOVERNANCE_OBJECT_PROPOSAL = 1; static const int GOVERNANCE_OBJECT_TRIGGER = 2; static const int GOVERNANCE_OBJECT_WATCHDOG = 3; static const CAmount GOVERNANCE_PROPOSAL_FEE_TX = (5.0*COIN); static const int64_t GOVERNANCE_FEE_CONFIRMATIONS = 6; static const int64_t GOVERNANCE_MIN_RELAY_FEE_CONFIRMATIONS = 1; static const int64_t GOVERNANCE_UPDATE_MIN = 60*60; static const int64_t GOVERNANCE_DELETION_DELAY = 10*60; static const int64_t GOVERNANCE_ORPHAN_EXPIRATION_TIME = 10*60; static const int64_t GOVERNANCE_WATCHDOG_EXPIRATION_TIME = 2*60*60; static const int GOVERNANCE_TRIGGER_EXPIRATION_BLOCKS = 576; // FOR SEEN MAP ARRAYS - GOVERNANCE OBJECTS AND VOTES static const int SEEN_OBJECT_IS_VALID = 0; static const int SEEN_OBJECT_ERROR_INVALID = 1; static const int SEEN_OBJECT_ERROR_IMMATURE = 2; static const int SEEN_OBJECT_EXECUTED = 3; //used for triggers static const int SEEN_OBJECT_UNKNOWN = 4; // the default typedef std::pair<CGovernanceVote, int64_t> vote_time_pair_t; inline bool operator<(const vote_time_pair_t& p1, const vote_time_pair_t& p2) { return (p1.first < p2.first); } struct vote_instance_t { vote_outcome_enum_t eOutcome; int64_t nTime; int64_t nCreationTime; vote_instance_t(vote_outcome_enum_t eOutcomeIn = VOTE_OUTCOME_NONE, int64_t nTimeIn = 0, int64_t nCreationTimeIn = 0) : eOutcome(eOutcomeIn), nTime(nTimeIn), nCreationTime(nCreationTimeIn) {} ADD_SERIALIZE_METHODS; template <typename Stream, typename Operation> inline void SerializationOp(Stream& s, Operation ser_action) { int nOutcome = int(eOutcome); READWRITE(nOutcome); READWRITE(nTime); READWRITE(nCreationTime); if(ser_action.ForRead()) { eOutcome = vote_outcome_enum_t(nOutcome); } } }; typedef std::map<int,vote_instance_t> vote_instance_m_t; typedef vote_instance_m_t::iterator vote_instance_m_it; typedef vote_instance_m_t::const_iterator vote_instance_m_cit; struct vote_rec_t { vote_instance_m_t mapInstances; ADD_SERIALIZE_METHODS; template <typename Stream, typename Operation> inline void SerializationOp(Stream& s, Operation ser_action) { READWRITE(mapInstances); } }; /** * Governance Object * */ class CGovernanceObject { friend class CGovernanceManager; friend class CGovernanceTriggerManager; public: // Types typedef std::map<COutPoint, vote_rec_t> vote_m_t; typedef vote_m_t::iterator vote_m_it; typedef vote_m_t::const_iterator vote_m_cit; typedef CacheMultiMap<COutPoint, vote_time_pair_t> vote_mcache_t; private: /// critical section to protect the inner data structures mutable CCriticalSection cs; /// Object typecode int nObjectType; /// parent object, 0 is root uint256 nHashParent; /// object revision in the system int nRevision; /// time this object was created int64_t nTime; /// time this object was marked for deletion int64_t nDeletionTime; /// fee-tx uint256 nCollateralHash; /// Data field - can be used for anything std::string strData; /// Masternode info for signed objects CTxIn vinMasternode; std::vector<unsigned char> vchSig; /// is valid by blockchain bool fCachedLocalValidity; std::string strLocalValidityError; // VARIOUS FLAGS FOR OBJECT / SET VIA MASTERNODE VOTING /// true == minimum network support has been reached for this object to be funded (doesn't mean it will for sure though) bool fCachedFunding; /// true == minimum network has been reached flagging this object as a valid and understood governance object (e.g, the serialized data is correct format, etc) bool fCachedValid; /// true == minimum network support has been reached saying this object should be deleted from the system entirely bool fCachedDelete; /** true == minimum network support has been reached flagging this object as endorsed by an elected representative body * (e.g. business review board / technecial review board /etc) */ bool fCachedEndorsed; /// object was updated and cached values should be updated soon bool fDirtyCache; /// Object is no longer of interest bool fExpired; /// Failed to parse object data bool fUnparsable; vote_m_t mapCurrentMNVotes; /// Limited map of votes orphaned by MN vote_mcache_t mapOrphanVotes; CGovernanceObjectVoteFile fileVotes; public: CGovernanceObject(); CGovernanceObject(uint256 nHashParentIn, int nRevisionIn, int64_t nTime, uint256 nCollateralHashIn, std::string strDataIn); CGovernanceObject(const CGovernanceObject& other); void swap(CGovernanceObject& first, CGovernanceObject& second); // nothrow // Public Getter methods int64_t GetCreationTime() const { return nTime; } int64_t GetDeletionTime() const { return nDeletionTime; } int GetObjectType() const { return nObjectType; } const uint256& GetCollateralHash() const { return nCollateralHash; } const CTxIn& GetMasternodeVin() const { return vinMasternode; } bool IsSetCachedFunding() const { return fCachedFunding; } bool IsSetCachedValid() const { return fCachedValid; } bool IsSetCachedDelete() const { return fCachedDelete; } bool IsSetCachedEndorsed() const { return fCachedEndorsed; } bool IsSetDirtyCache() const { return fDirtyCache; } bool IsSetExpired() const { return fExpired; } void InvalidateVoteCache() { fDirtyCache = true; } CGovernanceObjectVoteFile& GetVoteFile() { return fileVotes; } // Signature related functions void SetMasternodeVin(const COutPoint& outpoint); bool Sign(CKey& keyMasternode, CPubKey& pubKeyMasternode); bool CheckSignature(CPubKey& pubKeyMasternode); std::string GetSignatureMessage() const; // CORE OBJECT FUNCTIONS bool IsValidLocally(std::string& strError, bool fCheckCollateral); bool IsValidLocally(std::string& strError, bool& fMissingMasternode, bool& fMissingConfirmations, bool fCheckCollateral); /// Check the collateral transaction for the budget proposal/finalized budget bool IsCollateralValid(std::string& strError, bool &fMissingConfirmations); void UpdateLocalValidity(); void UpdateSentinelVariables(); int GetObjectSubtype(); CAmount GetMinCollateralFee(); UniValue GetJSONObject(); void Relay(CConnman& connman); uint256 GetHash() const; // GET VOTE COUNT FOR SIGNAL int CountMatchingVotes(vote_signal_enum_t eVoteSignalIn, vote_outcome_enum_t eVoteOutcomeIn) const; int GetAbsoluteYesCount(vote_signal_enum_t eVoteSignalIn) const; int GetAbsoluteNoCount(vote_signal_enum_t eVoteSignalIn) const; int GetYesCount(vote_signal_enum_t eVoteSignalIn) const; int GetNoCount(vote_signal_enum_t eVoteSignalIn) const; int GetAbstainCount(vote_signal_enum_t eVoteSignalIn) const; bool GetCurrentMNVotes(const COutPoint& mnCollateralOutpoint, vote_rec_t& voteRecord); // FUNCTIONS FOR DEALING WITH DATA STRING std::string GetDataAsHex(); std::string GetDataAsString(); // SERIALIZER ADD_SERIALIZE_METHODS; template <typename Stream, typename Operation> inline void SerializationOp(Stream& s, Operation ser_action) { // SERIALIZE DATA FOR SAVING/LOADING OR NETWORK FUNCTIONS READWRITE(nHashParent); READWRITE(nRevision); READWRITE(nTime); READWRITE(nCollateralHash); READWRITE(LIMITED_STRING(strData, MAX_GOVERNANCE_OBJECT_DATA_SIZE)); READWRITE(nObjectType); READWRITE(vinMasternode); READWRITE(vchSig); if(s.GetType() & SER_DISK) { // Only include these for the disk file format LogPrint(BCLog::GOBJECT, "CGovernanceObject::SerializationOp Reading/writing votes from/to disk\n"); READWRITE(nDeletionTime); READWRITE(fExpired); READWRITE(mapCurrentMNVotes); READWRITE(fileVotes); LogPrint(BCLog::GOBJECT, "CGovernanceObject::SerializationOp hash = %s, vote count = %d\n", GetHash().ToString(), fileVotes.GetVoteCount()); } // AFTER DESERIALIZATION OCCURS, CACHED VARIABLES MUST BE CALCULATED MANUALLY } CGovernanceObject& operator=(CGovernanceObject from) { swap(*this, from); return *this; } private: // FUNCTIONS FOR DEALING WITH DATA STRING void LoadData(); void GetData(UniValue& objResult); bool ProcessVote(CNode* pfrom, const CGovernanceVote& vote, CGovernanceException& exception, CConnman& connman); /// Called when MN's which have voted on this object have been removed void ClearMasternodeVotes(); void CheckOrphanVotes(CConnman& connman); }; #endif // FXTC_GOVERNANCE_OBJECT_H
[ "uhlik@uhlik.sk" ]
uhlik@uhlik.sk
d71db497aaa83e6dbb06ed00795199f8cb237067
9b553bbfc8b0807d7f860964d6044d6ccf6d1342
/rel/d/a/obj/d_a_obj_hbombkoya/d_a_obj_hbombkoya.cpp
37ff56d2995423ed5539f910cb16f5b97cdbaf20
[]
no_license
DedoGamingONE/tp
5e2e668f7120b154cf6ef6b002c2b4b51ae07ee5
5020395dfd34d4dc846e3ea228f6271bfca1c72a
refs/heads/master
2023-09-03T06:55:25.773029
2021-10-24T21:35:00
2021-10-24T21:35:00
null
0
0
null
null
null
null
UTF-8
C++
false
false
25,614
cpp
// // Generated By: dol2asm // Translation Unit: d_a_obj_hbombkoya // #include "rel/d/a/obj/d_a_obj_hbombkoya/d_a_obj_hbombkoya.h" #include "dol2asm.h" #include "dolphin/types.h" // // Types: // struct request_of_phase_process_class {}; struct mDoMtx_stack_c { /* 8000CE38 */ void scaleM(f32, f32, f32); static u8 now[48]; }; struct fopAc_ac_c { /* 80018C8C */ ~fopAc_ac_c(); }; struct daObjHBombkoya_c { struct PSetTbl {}; /* 80C1B878 */ void create1st(); /* 80C1B938 */ void CreateHeap(); /* 80C1B9CC */ void Create(); /* 80C1BB7C */ void setParticle(u16*, int, daObjHBombkoya_c::PSetTbl*, int, int); /* 80C1BCA0 */ void Execute(f32 (**)[3][4]); /* 80C1C098 */ void Draw(); /* 80C1C16C */ void Delete(); /* 80C1C474 */ ~daObjHBombkoya_c(); }; struct dSv_info_c { /* 80035200 */ void onSwitch(int, int); /* 80035360 */ void isSwitch(int, int) const; }; struct dKy_tevstr_c {}; struct J3DModelData {}; struct cXyz {}; struct dScnKy_env_light_c { /* 801A37C4 */ void settingTevStruct(int, cXyz*, dKy_tevstr_c*); /* 801A4DA0 */ void setLightTevColorType_MAJI(J3DModelData*, dKy_tevstr_c*); }; struct dRes_info_c {}; struct dRes_control_c { /* 8003C2EC */ void getRes(char const*, s32, dRes_info_c*, int); }; struct dPa_levelEcallBack {}; struct csXyz {}; struct _GXColor {}; struct dPa_control_c { /* 8004CA90 */ void set(u8, u16, cXyz const*, dKy_tevstr_c const*, csXyz const*, cXyz const*, u8, dPa_levelEcallBack*, s8, _GXColor const*, _GXColor const*, cXyz const*, f32); /* 8004D4CC */ void set(u32, u8, u16, cXyz const*, dKy_tevstr_c const*, csXyz const*, cXyz const*, u8, dPa_levelEcallBack*, s8, _GXColor const*, _GXColor const*, cXyz const*, f32); }; struct dEvLib_callback_c { /* 80C1C414 */ ~dEvLib_callback_c(); /* 80C1C45C */ bool eventStart(); /* 80C1C464 */ bool eventRun(); /* 80C1C46C */ bool eventEnd(); }; struct dCcD_Stts { /* 80083860 */ void Init(int, int, fopAc_ac_c*); }; struct dCcD_SrcCyl {}; struct dCcD_GStts { /* 80083760 */ dCcD_GStts(); /* 80C1C304 */ ~dCcD_GStts(); }; struct dCcD_GObjInf { /* 80083A28 */ dCcD_GObjInf(); /* 800840E4 */ ~dCcD_GObjInf(); }; struct dCcD_Cyl { /* 800848B4 */ void Set(dCcD_SrcCyl const&); }; struct dBgW {}; struct cBgS_PolyInfo {}; struct dBgS_MoveBgActor { /* 80078624 */ dBgS_MoveBgActor(); /* 800786B0 */ bool IsDelete(); /* 800786B8 */ bool ToFore(); /* 800786C0 */ bool ToBack(); /* 800787BC */ void MoveBGCreate(char const*, int, void (*)(dBgW*, void*, cBgS_PolyInfo const&, bool, cXyz*, csXyz*, csXyz*), u32, f32 (*)[3][4]); /* 800788DC */ void MoveBGDelete(); /* 80078950 */ void MoveBGExecute(); }; struct cM3dGCyl { /* 8026F1DC */ void SetC(cXyz const&); /* 80C1C2BC */ ~cM3dGCyl(); }; struct cM3dGAab { /* 80C1BB34 */ ~cM3dGAab(); }; struct cCcD_Obj {}; struct cCcS { /* 80264BA8 */ void Set(cCcD_Obj*); }; struct cCcD_GStts { /* 80C1C3CC */ ~cCcD_GStts(); }; struct JAISoundID {}; struct Vec {}; struct Z2SeMgr { /* 802AB984 */ void seStart(JAISoundID, Vec const*, u32, s8, f32, f32, f32, f32, u8); /* 802AC50C */ void seStartLevel(JAISoundID, Vec const*, u32, s8, f32, f32, f32, f32, u8); }; struct Z2AudioMgr { static u8 mAudioMgrPtr[4 + 4 /* padding */]; }; struct J3DModel {}; // // Forward References: // extern "C" void create1st__16daObjHBombkoya_cFv(); extern "C" void CreateHeap__16daObjHBombkoya_cFv(); extern "C" void Create__16daObjHBombkoya_cFv(); extern "C" void __dt__8cM3dGAabFv(); extern "C" void setParticle__16daObjHBombkoya_cFPUsiPQ216daObjHBombkoya_c7PSetTblii(); extern "C" void Execute__16daObjHBombkoya_cFPPA3_A4_f(); extern "C" void Draw__16daObjHBombkoya_cFv(); extern "C" void Delete__16daObjHBombkoya_cFv(); extern "C" static void daObjHBombkoya_create1st__FP16daObjHBombkoya_c(); extern "C" void __dt__8cM3dGCylFv(); extern "C" void __dt__10dCcD_GSttsFv(); extern "C" static void daObjHBombkoya_MoveBGDelete__FP16daObjHBombkoya_c(); extern "C" static void daObjHBombkoya_MoveBGExecute__FP16daObjHBombkoya_c(); extern "C" static void daObjHBombkoya_MoveBGDraw__FP16daObjHBombkoya_c(); extern "C" void __dt__10cCcD_GSttsFv(); extern "C" void __dt__17dEvLib_callback_cFv(); extern "C" bool eventStart__17dEvLib_callback_cFv(); extern "C" bool eventRun__17dEvLib_callback_cFv(); extern "C" bool eventEnd__17dEvLib_callback_cFv(); extern "C" void __dt__16daObjHBombkoya_cFv(); extern "C" static void func_80C1C5E8(); extern "C" extern char const* const d_a_obj_hbombkoya__stringBase0; // // External References: // extern "C" void mDoMtx_YrotM__FPA4_fs(); extern "C" void scaleM__14mDoMtx_stack_cFfff(); extern "C" void mDoExt_modelUpdateDL__FP8J3DModel(); extern "C" void mDoExt_J3DModel__create__FP12J3DModelDataUlUl(); extern "C" void __dt__10fopAc_ac_cFv(); extern "C" void fopAcM_delete__FP10fopAc_ac_c(); extern "C" void fopAcM_setCullSizeBox__FP10fopAc_ac_cffffff(); extern "C" void dComIfG_resLoad__FP30request_of_phase_process_classPCc(); extern "C" void dComIfG_resDelete__FP30request_of_phase_process_classPCc(); extern "C" void onSwitch__10dSv_info_cFii(); extern "C" void isSwitch__10dSv_info_cCFii(); extern "C" void getRes__14dRes_control_cFPCclP11dRes_info_ci(); extern "C" void set__13dPa_control_cFUcUsPC4cXyzPC12dKy_tevstr_cPC5csXyzPC4cXyzUcP18dPa_levelEcallBackScPC8_GXColorPC8_GXColorPC4cXyzf(); extern "C" void set__13dPa_control_cFUlUcUsPC4cXyzPC12dKy_tevstr_cPC5csXyzPC4cXyzUcP18dPa_levelEcallBackScPC8_GXColorPC8_GXColorPC4cXyzf(); extern "C" void __ct__16dBgS_MoveBgActorFv(); extern "C" bool IsDelete__16dBgS_MoveBgActorFv(); extern "C" bool ToFore__16dBgS_MoveBgActorFv(); extern "C" bool ToBack__16dBgS_MoveBgActorFv(); extern "C" void MoveBGCreate__16dBgS_MoveBgActorFPCciPFP4dBgWPvRC13cBgS_PolyInfobP4cXyzP5csXyzP5csXyz_vUlPA3_A4_f(); extern "C" void MoveBGDelete__16dBgS_MoveBgActorFv(); extern "C" void MoveBGExecute__16dBgS_MoveBgActorFv(); extern "C" void __ct__10dCcD_GSttsFv(); extern "C" void Init__9dCcD_SttsFiiP10fopAc_ac_c(); extern "C" void __ct__12dCcD_GObjInfFv(); extern "C" void __dt__12dCcD_GObjInfFv(); extern "C" void Set__8dCcD_CylFRC11dCcD_SrcCyl(); extern "C" void settingTevStruct__18dScnKy_env_light_cFiP4cXyzP12dKy_tevstr_c(); extern "C" void setLightTevColorType_MAJI__18dScnKy_env_light_cFP12J3DModelDataP12dKy_tevstr_c(); extern "C" void Set__4cCcSFP8cCcD_Obj(); extern "C" void SetC__8cM3dGCylFRC4cXyz(); extern "C" void seStart__7Z2SeMgrF10JAISoundIDPC3VecUlScffffUc(); extern "C" void seStartLevel__7Z2SeMgrF10JAISoundIDPC3VecUlScffffUc(); extern "C" void __dl__FPv(); extern "C" void PSMTXIdentity(); extern "C" void PSMTXCopy(); extern "C" void PSMTXTrans(); extern "C" void PSMTXMultVec(); extern "C" void _savegpr_19(); extern "C" void _savegpr_24(); extern "C" void _restgpr_19(); extern "C" void _restgpr_24(); extern "C" extern void* g_fopAc_Method[8]; extern "C" extern void* g_fpcLf_Method[5 + 1 /* padding */]; extern "C" extern void* __vt__16dBgS_MoveBgActor[10]; extern "C" extern void* __vt__8dCcD_Cyl[36]; extern "C" extern void* __vt__9dCcD_Stts[11]; extern "C" extern void* __vt__12cCcD_CylAttr[25]; extern "C" extern void* __vt__14cCcD_ShapeAttr[22]; extern "C" extern void* __vt__9cCcD_Stts[8]; extern "C" u8 now__14mDoMtx_stack_c[48]; extern "C" extern u8 g_dComIfG_gameInfo[122384]; extern "C" extern u8 g_env_light[4880]; extern "C" extern u8 j3dSys[284]; extern "C" u8 mAudioMgrPtr__10Z2AudioMgr[4 + 4 /* padding */]; // // Declarations: // /* ############################################################################################## */ /* 80C1C728-80C1C728 000130 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ #pragma push #pragma force_active on SECTION_DEAD static char const* const stringBase_80C1C728 = "H_Bombkoy"; #pragma pop /* 80C1C734-80C1C738 -00001 0004+00 3/3 0/0 0/0 .data l_arcName */ SECTION_DATA static void* l_arcName = (void*)&d_a_obj_hbombkoya__stringBase0; /* 80C1B878-80C1B938 000078 00C0+00 1/1 0/0 0/0 .text create1st__16daObjHBombkoya_cFv */ #pragma push #pragma optimization_level 0 #pragma optimizewithasm off asm void daObjHBombkoya_c::create1st() { nofralloc #include "asm/rel/d/a/obj/d_a_obj_hbombkoya/d_a_obj_hbombkoya/create1st__16daObjHBombkoya_cFv.s" } #pragma pop /* 80C1B938-80C1B9CC 000138 0094+00 1/0 0/0 0/0 .text CreateHeap__16daObjHBombkoya_cFv */ #pragma push #pragma optimization_level 0 #pragma optimizewithasm off asm void daObjHBombkoya_c::CreateHeap() { nofralloc #include "asm/rel/d/a/obj/d_a_obj_hbombkoya/d_a_obj_hbombkoya/CreateHeap__16daObjHBombkoya_cFv.s" } #pragma pop /* ############################################################################################## */ /* 80C1C5F8-80C1C5FC 000000 0004+00 2/2 0/0 0/0 .rodata @3699 */ SECTION_RODATA static f32 const lit_3699 = 200.0f; COMPILER_STRIP_GATE(0x80C1C5F8, &lit_3699); /* 80C1C738-80C1C77C 000004 0044+00 1/1 0/0 0/0 .data l_cc_cyl_src */ SECTION_DATA static u8 l_cc_cyl_src[68] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x7A, 0x00, 0x00, 0x44, 0x7A, 0x00, 0x00, }; /* 80C1C77C-80C1C790 000048 0012+02 1/1 0/0 0/0 .data id$3767 */ SECTION_DATA static u8 id[18 + 2 /* padding */] = { 0x85, 0x77, 0x85, 0x78, 0x85, 0x79, 0x85, 0x7A, 0x85, 0x7B, 0x85, 0x7C, 0x85, 0x7D, 0x85, 0x7E, 0x85, 0x7F, /* padding */ 0x00, 0x00, }; /* 80C1C790-80C1C910 00005C 0180+00 1/1 0/0 0/0 .data ptable$3776 */ SECTION_DATA static u8 ptable[384] = { 0x85, 0x83, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x85, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x85, 0x85, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x85, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x85, 0x87, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x85, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x85, 0x89, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x85, 0x8A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x85, 0x8B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x85, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x85, 0x95, 0x00, 0x00, 0xC4, 0x23, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC4, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x85, 0x95, 0x00, 0x00, 0xC2, 0xC8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC4, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xA0, 0x00, 0x00, 0x85, 0x95, 0x00, 0x00, 0xC3, 0xA2, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC4, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xE6, 0x66, 0x66, 0x85, 0x95, 0x00, 0x00, 0xC4, 0x31, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC3, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xAC, 0xCC, 0xCD, 0x85, 0x95, 0x00, 0x00, 0x42, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC1, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x4C, 0xCC, 0xCD, 0x85, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, }; /* 80C1C910-80C1C930 -00001 0020+00 1/0 0/0 0/0 .data daObjHBombkoya_METHODS */ SECTION_DATA static void* daObjHBombkoya_METHODS[8] = { (void*)daObjHBombkoya_create1st__FP16daObjHBombkoya_c, (void*)daObjHBombkoya_MoveBGDelete__FP16daObjHBombkoya_c, (void*)daObjHBombkoya_MoveBGExecute__FP16daObjHBombkoya_c, (void*)NULL, (void*)daObjHBombkoya_MoveBGDraw__FP16daObjHBombkoya_c, (void*)NULL, (void*)NULL, (void*)NULL, }; /* 80C1C930-80C1C960 -00001 0030+00 0/0 0/0 1/0 .data g_profile_Obj_HBombkoya */ SECTION_DATA extern void* g_profile_Obj_HBombkoya[12] = { (void*)0xFFFFFFFD, (void*)0x0003FFFD, (void*)0x00D80000, (void*)&g_fpcLf_Method, (void*)0x000007C0, (void*)NULL, (void*)NULL, (void*)&g_fopAc_Method, (void*)0x02A30000, (void*)&daObjHBombkoya_METHODS, (void*)0x00040100, (void*)0x000E0000, }; /* 80C1C960-80C1C96C 00022C 000C+00 3/3 0/0 0/0 .data __vt__10cCcD_GStts */ SECTION_DATA extern void* __vt__10cCcD_GStts[3] = { (void*)NULL /* RTTI */, (void*)NULL, (void*)__dt__10cCcD_GSttsFv, }; /* 80C1C96C-80C1C978 000238 000C+00 2/2 0/0 0/0 .data __vt__10dCcD_GStts */ SECTION_DATA extern void* __vt__10dCcD_GStts[3] = { (void*)NULL /* RTTI */, (void*)NULL, (void*)__dt__10dCcD_GSttsFv, }; /* 80C1C978-80C1C984 000244 000C+00 3/3 0/0 0/0 .data __vt__8cM3dGCyl */ SECTION_DATA extern void* __vt__8cM3dGCyl[3] = { (void*)NULL /* RTTI */, (void*)NULL, (void*)__dt__8cM3dGCylFv, }; /* 80C1C984-80C1C99C 000250 0018+00 3/3 0/0 0/0 .data __vt__17dEvLib_callback_c */ SECTION_DATA extern void* __vt__17dEvLib_callback_c[6] = { (void*)NULL /* RTTI */, (void*)NULL, (void*)__dt__17dEvLib_callback_cFv, (void*)eventStart__17dEvLib_callback_cFv, (void*)eventRun__17dEvLib_callback_cFv, (void*)eventEnd__17dEvLib_callback_cFv, }; /* 80C1C99C-80C1C9A8 000268 000C+00 4/4 0/0 0/0 .data __vt__8cM3dGAab */ SECTION_DATA extern void* __vt__8cM3dGAab[3] = { (void*)NULL /* RTTI */, (void*)NULL, (void*)__dt__8cM3dGAabFv, }; /* 80C1B9CC-80C1BB34 0001CC 0168+00 1/0 0/0 0/0 .text Create__16daObjHBombkoya_cFv */ #pragma push #pragma optimization_level 0 #pragma optimizewithasm off asm void daObjHBombkoya_c::Create() { nofralloc #include "asm/rel/d/a/obj/d_a_obj_hbombkoya/d_a_obj_hbombkoya/Create__16daObjHBombkoya_cFv.s" } #pragma pop /* 80C1BB34-80C1BB7C 000334 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGAabFv */ #pragma push #pragma optimization_level 0 #pragma optimizewithasm off asm cM3dGAab::~cM3dGAab() { nofralloc #include "asm/rel/d/a/obj/d_a_obj_hbombkoya/d_a_obj_hbombkoya/__dt__8cM3dGAabFv.s" } #pragma pop /* ############################################################################################## */ /* 80C1C5FC-80C1C600 000004 0004+00 1/2 0/0 0/0 .rodata @3747 */ SECTION_RODATA static f32 const lit_3747 = 1.0f; COMPILER_STRIP_GATE(0x80C1C5FC, &lit_3747); /* 80C1BB7C-80C1BCA0 00037C 0124+00 1/1 0/0 0/0 .text * setParticle__16daObjHBombkoya_cFPUsiPQ216daObjHBombkoya_c7PSetTblii */ #pragma push #pragma optimization_level 0 #pragma optimizewithasm off asm void daObjHBombkoya_c::setParticle(u16* param_0, int param_1, daObjHBombkoya_c::PSetTbl* param_2, int param_3, int param_4) { nofralloc #include "asm/rel/d/a/obj/d_a_obj_hbombkoya/d_a_obj_hbombkoya/func_80C1BB7C.s" } #pragma pop /* ############################################################################################## */ /* 80C1C600-80C1C610 000008 0010+00 0/1 0/0 0/0 .rodata @3758 */ #pragma push #pragma force_active on SECTION_RODATA static u8 const lit_3758[16] = { 0x85, 0x8D, 0x85, 0x8E, 0x85, 0x8F, 0x85, 0x90, 0x85, 0x91, 0x85, 0x92, 0x85, 0x93, 0x85, 0x94, }; COMPILER_STRIP_GATE(0x80C1C600, &lit_3758); #pragma pop /* 80C1C610-80C1C6B0 000018 00A0+00 0/0 0/0 0/0 .rodata @3759 */ #pragma push #pragma force_active on SECTION_RODATA static u8 const lit_3759[160] = { 0x00, 0x00, 0x00, 0x00, 0x43, 0x6B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5A, 0x3F, 0x4C, 0xCC, 0xCD, 0xC4, 0x4D, 0xC0, 0x00, 0x42, 0xFA, 0x00, 0x00, 0xC3, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6E, 0x3F, 0x80, 0x00, 0x00, 0xC4, 0x7A, 0x00, 0x00, 0x44, 0x7A, 0x00, 0x00, 0xC4, 0x13, 0x80, 0x00, 0x00, 0x00, 0x00, 0x73, 0x3F, 0x80, 0x00, 0x00, 0xC4, 0x03, 0x40, 0x00, 0x44, 0x57, 0xC0, 0x00, 0xC3, 0x82, 0x80, 0x00, 0x00, 0x00, 0x00, 0x78, 0x3F, 0x4C, 0xCC, 0xCD, 0xC4, 0x7A, 0x00, 0x00, 0x43, 0xF3, 0x00, 0x00, 0xC4, 0x61, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x8C, 0x3F, 0x80, 0x00, 0x00, 0xC3, 0xF2, 0x80, 0x00, 0x41, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x3F, 0x4C, 0xCC, 0xCD, 0xC3, 0xF0, 0x00, 0x00, 0x44, 0x19, 0x80, 0x00, 0xC3, 0xE7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9B, 0x3F, 0x80, 0x00, 0x00, 0xC4, 0x7A, 0x00, 0x00, 0x42, 0xE8, 0x00, 0x00, 0xC3, 0xEA, 0x80, 0x00, 0x00, 0x00, 0x00, 0xA0, 0x3F, 0x80, 0x00, 0x00, }; COMPILER_STRIP_GATE(0x80C1C610, &lit_3759); #pragma pop /* 80C1C6B0-80C1C6B8 0000B8 0006+02 0/1 0/0 0/0 .rodata @3762 */ #pragma push #pragma force_active on SECTION_RODATA static u8 const lit_3762[6 + 2 /* padding */] = { 0x85, 0x80, 0x85, 0x81, 0x85, 0x82, /* padding */ 0x00, 0x00, }; COMPILER_STRIP_GATE(0x80C1C6B0, &lit_3762); #pragma pop /* 80C1C6B8-80C1C71C 0000C0 0064+00 0/0 0/0 0/0 .rodata @3763 */ #pragma push #pragma force_active on SECTION_RODATA static u8 const lit_3763[100] = { 0xC3, 0x25, 0x00, 0x00, 0x43, 0xFA, 0x00, 0x00, 0x42, 0xD4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0xC4, 0x32, 0xC0, 0x00, 0x43, 0x20, 0x00, 0x00, 0xC3, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x99, 0x99, 0x9A, 0xC3, 0x9F, 0x00, 0x00, 0x44, 0x8C, 0x00, 0x00, 0xC4, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x8C, 0xCC, 0xCD, 0xC4, 0x7A, 0x00, 0x00, 0x43, 0x0C, 0x00, 0x00, 0xC4, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x99, 0x99, 0x9A, 0xC4, 0x66, 0x40, 0x00, 0x44, 0x7A, 0x00, 0x00, 0xC4, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xA0, 0x00, 0x00, }; COMPILER_STRIP_GATE(0x80C1C6B8, &lit_3763); #pragma pop /* 80C1C71C-80C1C720 000124 0004+00 0/1 0/0 0/0 .rodata @3851 */ #pragma push #pragma force_active on SECTION_RODATA static f32 const lit_3851 = -1.0f; COMPILER_STRIP_GATE(0x80C1C71C, &lit_3851); #pragma pop /* 80C1C720-80C1C724 000128 0004+00 0/1 0/0 0/0 .rodata @3852 */ #pragma push #pragma force_active on SECTION_RODATA static f32 const lit_3852 = -500.0f; COMPILER_STRIP_GATE(0x80C1C720, &lit_3852); #pragma pop /* 80C1C724-80C1C728 00012C 0004+00 0/1 0/0 0/0 .rodata @3853 */ #pragma push #pragma force_active on SECTION_RODATA static u8 const lit_3853[4] = { 0x00, 0x00, 0x00, 0x00, }; COMPILER_STRIP_GATE(0x80C1C724, &lit_3853); #pragma pop /* 80C1BCA0-80C1C098 0004A0 03F8+00 1/0 0/0 0/0 .text Execute__16daObjHBombkoya_cFPPA3_A4_f */ #pragma push #pragma optimization_level 0 #pragma optimizewithasm off asm void daObjHBombkoya_c::Execute(f32 (**param_0)[3][4]) { nofralloc #include "asm/rel/d/a/obj/d_a_obj_hbombkoya/d_a_obj_hbombkoya/Execute__16daObjHBombkoya_cFPPA3_A4_f.s" } #pragma pop /* 80C1C098-80C1C16C 000898 00D4+00 1/0 0/0 0/0 .text Draw__16daObjHBombkoya_cFv */ #pragma push #pragma optimization_level 0 #pragma optimizewithasm off asm void daObjHBombkoya_c::Draw() { nofralloc #include "asm/rel/d/a/obj/d_a_obj_hbombkoya/d_a_obj_hbombkoya/Draw__16daObjHBombkoya_cFv.s" } #pragma pop /* 80C1C16C-80C1C1A8 00096C 003C+00 1/0 0/0 0/0 .text Delete__16daObjHBombkoya_cFv */ #pragma push #pragma optimization_level 0 #pragma optimizewithasm off asm void daObjHBombkoya_c::Delete() { nofralloc #include "asm/rel/d/a/obj/d_a_obj_hbombkoya/d_a_obj_hbombkoya/Delete__16daObjHBombkoya_cFv.s" } #pragma pop /* ############################################################################################## */ /* 80C1C9A8-80C1C9EC 000274 0044+00 2/2 0/0 0/0 .data __vt__16daObjHBombkoya_c */ SECTION_DATA extern void* __vt__16daObjHBombkoya_c[17] = { (void*)NULL /* RTTI */, (void*)NULL, (void*)CreateHeap__16daObjHBombkoya_cFv, (void*)Create__16daObjHBombkoya_cFv, (void*)Execute__16daObjHBombkoya_cFPPA3_A4_f, (void*)Draw__16daObjHBombkoya_cFv, (void*)Delete__16daObjHBombkoya_cFv, (void*)IsDelete__16dBgS_MoveBgActorFv, (void*)ToFore__16dBgS_MoveBgActorFv, (void*)ToBack__16dBgS_MoveBgActorFv, (void*)NULL, (void*)NULL, (void*)func_80C1C5E8, (void*)eventStart__17dEvLib_callback_cFv, (void*)eventRun__17dEvLib_callback_cFv, (void*)eventEnd__17dEvLib_callback_cFv, (void*)__dt__16daObjHBombkoya_cFv, }; /* 80C1C1A8-80C1C2BC 0009A8 0114+00 1/0 0/0 0/0 .text * daObjHBombkoya_create1st__FP16daObjHBombkoya_c */ #pragma push #pragma optimization_level 0 #pragma optimizewithasm off static asm void daObjHBombkoya_create1st(daObjHBombkoya_c* param_0) { nofralloc #include "asm/rel/d/a/obj/d_a_obj_hbombkoya/d_a_obj_hbombkoya/daObjHBombkoya_create1st__FP16daObjHBombkoya_c.s" } #pragma pop /* 80C1C2BC-80C1C304 000ABC 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGCylFv */ #pragma push #pragma optimization_level 0 #pragma optimizewithasm off asm cM3dGCyl::~cM3dGCyl() { nofralloc #include "asm/rel/d/a/obj/d_a_obj_hbombkoya/d_a_obj_hbombkoya/__dt__8cM3dGCylFv.s" } #pragma pop /* 80C1C304-80C1C360 000B04 005C+00 1/0 0/0 0/0 .text __dt__10dCcD_GSttsFv */ #pragma push #pragma optimization_level 0 #pragma optimizewithasm off asm dCcD_GStts::~dCcD_GStts() { nofralloc #include "asm/rel/d/a/obj/d_a_obj_hbombkoya/d_a_obj_hbombkoya/__dt__10dCcD_GSttsFv.s" } #pragma pop /* 80C1C360-80C1C380 000B60 0020+00 1/0 0/0 0/0 .text * daObjHBombkoya_MoveBGDelete__FP16daObjHBombkoya_c */ #pragma push #pragma optimization_level 0 #pragma optimizewithasm off static asm void daObjHBombkoya_MoveBGDelete(daObjHBombkoya_c* param_0) { nofralloc #include "asm/rel/d/a/obj/d_a_obj_hbombkoya/d_a_obj_hbombkoya/daObjHBombkoya_MoveBGDelete__FP16daObjHBombkoya_c.s" } #pragma pop /* 80C1C380-80C1C3A0 000B80 0020+00 1/0 0/0 0/0 .text * daObjHBombkoya_MoveBGExecute__FP16daObjHBombkoya_c */ #pragma push #pragma optimization_level 0 #pragma optimizewithasm off static asm void daObjHBombkoya_MoveBGExecute(daObjHBombkoya_c* param_0) { nofralloc #include "asm/rel/d/a/obj/d_a_obj_hbombkoya/d_a_obj_hbombkoya/daObjHBombkoya_MoveBGExecute__FP16daObjHBombkoya_c.s" } #pragma pop /* 80C1C3A0-80C1C3CC 000BA0 002C+00 1/0 0/0 0/0 .text * daObjHBombkoya_MoveBGDraw__FP16daObjHBombkoya_c */ #pragma push #pragma optimization_level 0 #pragma optimizewithasm off static asm void daObjHBombkoya_MoveBGDraw(daObjHBombkoya_c* param_0) { nofralloc #include "asm/rel/d/a/obj/d_a_obj_hbombkoya/d_a_obj_hbombkoya/daObjHBombkoya_MoveBGDraw__FP16daObjHBombkoya_c.s" } #pragma pop /* 80C1C3CC-80C1C414 000BCC 0048+00 1/0 0/0 0/0 .text __dt__10cCcD_GSttsFv */ #pragma push #pragma optimization_level 0 #pragma optimizewithasm off asm cCcD_GStts::~cCcD_GStts() { nofralloc #include "asm/rel/d/a/obj/d_a_obj_hbombkoya/d_a_obj_hbombkoya/__dt__10cCcD_GSttsFv.s" } #pragma pop /* 80C1C414-80C1C45C 000C14 0048+00 1/0 0/0 0/0 .text __dt__17dEvLib_callback_cFv */ #pragma push #pragma optimization_level 0 #pragma optimizewithasm off asm dEvLib_callback_c::~dEvLib_callback_c() { nofralloc #include "asm/rel/d/a/obj/d_a_obj_hbombkoya/d_a_obj_hbombkoya/__dt__17dEvLib_callback_cFv.s" } #pragma pop /* 80C1C45C-80C1C464 000C5C 0008+00 2/0 0/0 0/0 .text eventStart__17dEvLib_callback_cFv */ bool dEvLib_callback_c::eventStart() { return true; } /* 80C1C464-80C1C46C 000C64 0008+00 2/0 0/0 0/0 .text eventRun__17dEvLib_callback_cFv */ bool dEvLib_callback_c::eventRun() { return true; } /* 80C1C46C-80C1C474 000C6C 0008+00 2/0 0/0 0/0 .text eventEnd__17dEvLib_callback_cFv */ bool dEvLib_callback_c::eventEnd() { return true; } /* 80C1C474-80C1C5E8 000C74 0174+00 2/1 0/0 0/0 .text __dt__16daObjHBombkoya_cFv */ #pragma push #pragma optimization_level 0 #pragma optimizewithasm off asm daObjHBombkoya_c::~daObjHBombkoya_c() { nofralloc #include "asm/rel/d/a/obj/d_a_obj_hbombkoya/d_a_obj_hbombkoya/__dt__16daObjHBombkoya_cFv.s" } #pragma pop /* 80C1C5E8-80C1C5F0 000DE8 0008+00 1/0 0/0 0/0 .text @1448@__dt__16daObjHBombkoya_cFv */ #pragma push #pragma optimization_level 0 #pragma optimizewithasm off static asm void func_80C1C5E8() { nofralloc #include "asm/rel/d/a/obj/d_a_obj_hbombkoya/d_a_obj_hbombkoya/func_80C1C5E8.s" } #pragma pop /* 80C1C728-80C1C728 000130 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
[ "" ]
15369827e1215b196003576310a8b90815fa2375
7cb77d21af2277cb395ba41b5a079c9693f90303
/gflags_demo/blade-bin/version.cpp
e18f2dfb3aa32b4a38f28d800223d89805951d78
[]
no_license
zldeng/ThridPartyLib
8812eb3f98f6154f75fda1a59979c0cccda33346
010128c5f2d70818c46f0d1ba3996cd15c2ffad1
refs/heads/master
2021-07-10T11:34:53.442703
2019-02-15T02:17:49
2019-02-15T02:17:49
140,281,953
0
0
null
null
null
null
UTF-8
C++
false
false
409
cpp
/* This file was generated by blade */ extern "C" { namespace binary_version { extern const int kSvnInfoCount = 0; extern const char* const kSvnInfo[0] = {}; extern const char kBuildType[] = "release"; extern const char kBuildTime[] = "Mon Aug 27 15:31:57 2018"; extern const char kBuilderName[] = "dengzhilong"; extern const char kHostName[] = "LY1F-R010608"; extern const char kCompiler[] = "GCC 4.8.5"; }}
[ "hitdzl@gmail.com" ]
hitdzl@gmail.com
c1ad6d6221c7348804e97e0ee723c92651d66d84
c4bf03dff950e421eae66311bad4b9a6dd59973a
/core/modules/replica/VerifyJob.cc
010b9d98229fa6eea37ae22e6032dfdbf55ed030
[]
no_license
tsengj10/qserv
eee6a1b8de7db2a8eaf99e1bd17d4f008c9617bc
97a6c2d206c5d8394d0355461674ae6ce5d449ab
refs/heads/master
2021-06-18T06:00:34.424789
2018-08-22T00:16:59
2018-08-22T00:16:59
96,400,110
0
0
null
2017-07-06T07:13:54
2017-07-06T07:13:54
null
UTF-8
C++
false
false
15,312
cc
/* * LSST Data Management System * Copyright 2017 LSST Corporation. * * This product includes software developed by the * LSST Project (http://www.lsst.org/). * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the LSST License Statement and * the GNU General Public License along with this program. If not, * see <http://www.lsstcorp.org/LegalNotices/>. */ // Class header #include "replica/VerifyJob.h" // System headers #include <stdexcept> #include <thread> // Qserv headers #include "lsst/log/Log.h" #include "replica/DatabaseMySQL.h" #include "replica/DatabaseServices.h" #include "replica/ServiceProvider.h" #include "util/BlockPost.h" namespace { LOG_LOGGER _log = LOG_GET("lsst.qserv.replica.VerifyJob"); } /// namespace namespace lsst { namespace qserv { namespace replica { /////////////////////////////////////////////////// /// ReplicaDiff /// /////////////////////////////////////////////////// ReplicaDiff::ReplicaDiff() : _notEqual(false) { } ReplicaDiff::ReplicaDiff(ReplicaInfo const& replica1, ReplicaInfo const& replica2) : _replica1(replica1), _replica2(replica2), _notEqual(false), _statusMismatch(false), _numFilesMismatch(false), _fileNamesMismatch(false), _fileSizeMismatch(false), _fileCsMismatch(false), _fileMtimeMismatch(false) { if ((replica1.database() != replica2.database()) or (replica1.chunk() != replica2.chunk())) { throw std::invalid_argument( "ReplicaDiff::ReplicaDiff(r1,r2) incompatible aruments"); } // Status and the number of files are expeted to match _statusMismatch = replica1.status() != replica2.status(); _numFilesMismatch = replica1.fileInfo().size() != replica2.fileInfo().size(); // Corresponding file entries must match std::map<std::string,ReplicaInfo::FileInfo> file2info1 = replica1.fileInfoMap(); std::map<std::string,ReplicaInfo::FileInfo> file2info2 = replica2.fileInfoMap(); for (auto&& f: file2info1) { // Check if each file is present in both collections std::string const& name = f.first; // The file name is required to be present in both replicas if (not file2info2.count(name)) { _fileNamesMismatch = true; continue; } ReplicaInfo::FileInfo const& file1 = file2info1[name]; ReplicaInfo::FileInfo const& file2 = file2info2[name]; _fileSizeMismatch = _fileSizeMismatch or (file1.size != file2.size); // Control sums are considered only if they're both defined _fileCsMismatch = _fileCsMismatch or ((not file1.cs.empty() and not file2.cs.empty()) and (file1.cs != file2.cs)); _fileMtimeMismatch = _fileMtimeMismatch or (file1.mtime != file2.mtime); } _notEqual = _statusMismatch or _numFilesMismatch or _fileNamesMismatch or _fileSizeMismatch or _fileCsMismatch or _fileMtimeMismatch; } bool ReplicaDiff::isSelf() const { return _replica1.worker() == _replica2.worker(); } std::string const& ReplicaDiff::flags2string() const { if (_flags.empty()) { if (_notEqual) { _flags = "DIFF "; if (_statusMismatch) _flags += " status"; if (_numFilesMismatch) _flags += " files"; if (_fileNamesMismatch) _flags += " name"; if (_fileSizeMismatch) _flags += " size"; if (_fileCsMismatch) _flags += " cs"; if (_fileMtimeMismatch) _flags += " mtime"; } else { _flags = "EQUAL"; } } return _flags; } std::ostream& operator<<(std::ostream& os, ReplicaDiff const& ri) { ReplicaInfo const& r1 = ri.replica1(); ReplicaInfo const& r2 = ri.replica2(); os << "ReplicaDiff\n" << " <replica1>\n" << " worker: " << r1.worker() << "\n" << " database: " << r1.database() << "\n" << " chunk: " << r1.chunk() << "\n" << " status: " << ReplicaInfo::status2string(r1.status()) << "\n" << " <replica2>\n" << " worker: " << r2.worker() << "\n" << " database: " << r2.database() << "\n" << " chunk: " << r2.chunk() << "\n" << " status: " << ReplicaInfo::status2string(r2.status()) << "\n" << " notEqual: " << (ri() ? "true" : "false") << "\n" << " statusMismatch: " << (ri.statusMismatch() ? "true" : "false") << "\n" << " numFilesMismatch: " << (ri.numFilesMismatch() ? "true" : "false") << "\n" << " fileNamesMismatch: " << (ri.fileNamesMismatch() ? "true" : "false") << "\n" << " fileSizeMismatch: " << (ri.fileSizeMismatch() ? "true" : "false") << "\n" << " fileCsMismatch: " << (ri.fileCsMismatch() ? "true" : "false") << "\n" << " fileMtimeMismatch: " << (ri.fileMtimeMismatch() ? "true" : "false") << "\n"; return os; } ///////////////////////////////////////////////// /// VerifyJob /// ///////////////////////////////////////////////// Job::Options const& VerifyJob::defaultOptions() { static Job::Options const options{ 0, /* priority */ false, /* exclusive */ true /* exclusive */ }; return options; } VerifyJob::Ptr VerifyJob::create( Controller::Ptr const& controller, std::string const& parentJobId, CallbackType onFinish, CallbackTypeOnDiff onReplicaDifference, size_t maxReplicas, bool computeCheckSum, Job::Options const& options) { return VerifyJob::Ptr( new VerifyJob(controller, parentJobId, onFinish, onReplicaDifference, maxReplicas, computeCheckSum, options)); } VerifyJob::VerifyJob(Controller::Ptr const& controller, std::string const& parentJobId, CallbackType onFinish, CallbackTypeOnDiff onReplicaDifference, size_t maxReplicas, bool computeCheckSum, Job::Options const& options) : Job(controller, parentJobId, "VERIFY", options), _onFinish(onFinish), _onReplicaDifference(onReplicaDifference), _maxReplicas(maxReplicas), _computeCheckSum(computeCheckSum) { } std::string VerifyJob::extendedPersistentState(SqlGeneratorPtr const& gen) const { return gen->sqlPackValues(id(), maxReplicas(), computeCheckSum() ? 1 : 0); } void VerifyJob::startImpl(util::Lock const& lock) { LOGS(_log, LOG_LVL_DEBUG, context() << "startImpl"); auto self = shared_from_base<VerifyJob>(); // Launch the first batch of requests std::vector<ReplicaInfo> replicas; if (nextReplicas(lock, replicas, maxReplicas())) { for (ReplicaInfo const& replica: replicas) { auto request = controller()->findReplica( replica.worker(), replica.database(), replica.chunk(), [self] (FindRequest::Ptr request) { self->onRequestFinish(request); }, options(lock).priority, /* inherited from the one of the current job */ computeCheckSum(), true, /* keepTracking*/ id() /* jobId */ ); _replicas[request->id()] = replica; _requests[request->id()] = request; } setState(lock, State::IN_PROGRESS); } else { // In theory this should never happen setState(lock, State::FINISHED); } } void VerifyJob::cancelImpl(util::Lock const& lock) { LOGS(_log, LOG_LVL_DEBUG, context() << "cancelImpl"); // To ensure no lingering "side effects" will be left after cancelling this // job the request cancellation should be also followed (where it makes a sense) // by stopping the request at corresponding worker service. for (auto&& entry: _requests) { auto const& request = entry.second; request->cancel(); if (request->state() != Request::State::FINISHED) { controller()->stopReplicaFind( request->worker(), request->id(), nullptr, /* onFinish */ true, /* keepTracking */ id() /* jobId */); } } _replicas.clear(); _requests.clear(); } void VerifyJob::notifyImpl() { LOGS(_log, LOG_LVL_DEBUG, context() << "notifyImpl"); if (_onFinish) { _onFinish(shared_from_base<VerifyJob>()); } } void VerifyJob::onRequestFinish(FindRequest::Ptr request) { LOGS(_log, LOG_LVL_DEBUG, context() << "onRequestFinish database=" << request->database() << " worker=" << request->worker() << " chunk=" << request->chunk()); // IMPORTANT: the final state is required to be tested twice. The first time // it's done in order to avoid deadlock on the "in-flight" requests reporting // their completion while the job termination is in a progress. And the second // test is made after acquering the lock to recheck the state in case if it // has transitioned while acquering the lock. if (state() == State::FINISHED) return; util::Lock lock(_mtx, context() + "onRequestFinish"); if (state() == State::FINISHED) return; // The default version of the object won't have any difference // reported ReplicaDiff selfReplicaDiff; // against the previous state of the current replica std::vector<ReplicaDiff> otherReplicaDiff; // against other known replicas auto self = shared_from_base<VerifyJob>(); if (request->extendedState() == Request::ExtendedState::SUCCESS) { // TODO: // - check if the replica still exists. It's fine if it's gone // because some jobs may chhose either to purge extra replicas // or rebalance the cluster. So, no subscriber otification is needed // here. ; // Compare new state of the replica against its older one which was // known to the database before this request was launched. Notify // a subscriber of any changes (after releasing a lock on the mutex). // // @see class ReplicaDiff for further specific details on replica // differece analysis. // // ATTENTIONS: Replica differeces are reported into the log stream only // when no interest to be notified in the differences // expressed by a caller (no callback provided). ReplicaInfo const& oldReplica = _replicas[request->id()]; selfReplicaDiff = ReplicaDiff(oldReplica, request->responseData()); if (selfReplicaDiff() and not _onReplicaDifference) { LOGS(_log, LOG_LVL_INFO, context() << "replica missmatch for self\n" << selfReplicaDiff); } std::vector<ReplicaInfo> otherReplicas; controller()->serviceProvider()->databaseServices()->findReplicas( otherReplicas, oldReplica.chunk(), oldReplica.database()); for (auto&& replica: otherReplicas) { ReplicaDiff diff(request->responseData(), replica); if (not diff.isSelf()) { otherReplicaDiff.push_back(diff); if (diff() and not _onReplicaDifference) LOGS(_log, LOG_LVL_INFO, context() << "replica missmatch for other\n" << diff); } } } else { // Report the error and keep going LOGS(_log, LOG_LVL_ERROR, context() << "failed request " << request->context() << " worker: " << request->worker() << " database: " << request->database() << " chunk: " << request->chunk()); } // Remove the processed replica, fetch another one and begin processing it _replicas.erase(request->id()); _requests.erase(request->id()); std::vector<ReplicaInfo> replicas; if (nextReplicas(lock, replicas, 1)) { for (ReplicaInfo const& replica: replicas) { auto request = controller()->findReplica( replica.worker(), replica.database(), replica.chunk(), [self] (FindRequest::Ptr request) { self->onRequestFinish(request); }, options(lock).priority, /* inherited from the one of the current job */ computeCheckSum(), true, /* keepTracking*/ id() /* jobId */ ); _replicas[request->id()] = replica; _requests[request->id()] = request; } } else { // In theory this should never happen unless all replicas are gone // from the system or there was a problem to access the database. // // In any case check if no requests are in flight and finish if that's // the case. if (not _replicas.size()) { finish(lock, ExtendedState::NONE); } } // The callback is being made asynchronously in a separate thread // to avoid blocking the current thread. if (_onReplicaDifference) { auto self = shared_from_base<VerifyJob>(); std::thread notifier([self, selfReplicaDiff, otherReplicaDiff]() { self->_onReplicaDifference(self, selfReplicaDiff, otherReplicaDiff); }); notifier.detach(); } } bool VerifyJob::nextReplicas(util::Lock const& lock, std::vector<ReplicaInfo>& replicas, size_t numReplicas) { return controller()->serviceProvider()->databaseServices()->findOldestReplicas( replicas, numReplicas); } }}} // namespace lsst::qserv::replica
[ "gapon@slac.stanford.edu" ]
gapon@slac.stanford.edu
fa0c0805448dc8c32c8d9ba083273ef843fcc489
534ae31227bbecc3452f3b5e01026b1d0a702b65
/exilespace/src/esAudio/Sound.hpp
108f0e1722e6cd3eb0bb94e8adaa091394310778
[]
no_license
arngorf/exilespace
86b9a5fba67f483d113aaae1d554c266b8b24e08
29f6e6260fc4f6f8f3b2f67490e3beb7655955f4
refs/heads/master
2020-04-24T19:47:25.999701
2015-07-18T02:13:20
2015-07-18T02:13:20
39,282,703
0
0
null
null
null
null
UTF-8
C++
false
false
88
hpp
/* * Sound class * * This class represents a sound and holds playback methods. * */
[ "arngorf@gmail.com" ]
arngorf@gmail.com
e69d498c836c6c33e5897cdc348a7d5319e4cca3
03775f56157805c0106b28eef2fd990726c5f09b
/Examples/Doc-GettingStarted-Yocto-Pressure/main.cpp
511921de1cc81339a288914f3b7d4d66e037dd87
[]
no_license
yoctopuce/yoctolib_cpp
0165e917d98c846af19ac51ae60afaf17200e110
f141d03b83af5b5634971cab1ecc90c463d4e561
refs/heads/master
2023-09-01T09:40:16.408704
2023-08-03T09:11:08
2023-08-03T09:11:08
9,394,667
11
16
null
2021-05-07T06:15:26
2013-04-12T13:18:46
C++
UTF-8
C++
false
false
1,852
cpp
/********************************************************************* * * $Id: main.cpp 44692 2021-04-26 12:17:53Z seb $ * * An example that show how to use a Yocto-Pressure * * You can find more information on our web site: * Yocto-Pressure documentation: * https://www.yoctopuce.com/EN/products/yocto-pressure/doc.html * C++ API Reference: * https://www.yoctopuce.com/EN/doc/reference/yoctolib-cpp-EN.html * *********************************************************************/ #include "yocto_api.h" #include "yocto_pressure.h" #include <iostream> #include <stdlib.h> using namespace std; static void usage(void) { cout << "usage: demo <serial_number> " << endl; cout << " demo <logical_name>" << endl; cout << " demo any" << endl; u64 now = YAPI::GetTickCount(); while (YAPI::GetTickCount() - now < 3000) { // wait 3 sec to show the message } exit(1); } int main(int argc, const char * argv[]) { string errmsg, target; YPressure *psensor; if (argc < 2) { usage(); } target = (string) argv[1]; // Setup the API to use local USB devices if (YAPI::RegisterHub("usb", errmsg) != YAPI::SUCCESS) { cerr << "RegisterHub error: " << errmsg << endl; return 1; } if (target == "any") { psensor = YPressure::FirstPressure(); if (psensor == NULL) { cout << "No module connected (check USB cable)" << endl; return 1; } } else { psensor = YPressure::FindPressure(target + ".pressure"); } while (1) { if (!psensor->isOnline()) { cout << "Module not connected (check identification and USB cable)"; break; } cout << "Current pressure: " << psensor->get_currentValue() << " mbar" << endl; cout << " (press Ctrl-C to exit)" << endl; YAPI::Sleep(1000, errmsg); }; YAPI::FreeAPI(); return 0; }
[ "dev@yoctopuce.com" ]
dev@yoctopuce.com
1e220dd58caf97954422fbd76385039a123f1574
0f6ae94ae0221ae945ce6122f866194da2eb5283
/.svn/pristine/1e/1e220dd58caf97954422fbd76385039a123f1574.svn-base
b8f80df34bf9571d34c0c9e77064ea14d4ab7c2a
[ "NCSA" ]
permissive
peterdfinn/safecode-mainline
2a1621ef839a30664477bbd300123eb16bd204d1
a5587ccd5dfb261ca39b88855879563230f38ce0
refs/heads/master
2021-01-18T15:23:26.296177
2015-09-03T04:23:34
2015-09-03T04:23:34
38,640,903
1
0
null
null
null
null
UTF-8
C++
false
false
20,206
//===- llvm/Analysis/LoopInfoImpl.h - Natural Loop Calculator ---*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This is the generic implementation of LoopInfo used for both Loops and // MachineLoops. // //===----------------------------------------------------------------------===// #ifndef LLVM_ANALYSIS_LOOPINFOIMPL_H #define LLVM_ANALYSIS_LOOPINFOIMPL_H #include "llvm/ADT/DepthFirstIterator.h" #include "llvm/ADT/PostOrderIterator.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/IR/Dominators.h" namespace llvm { //===----------------------------------------------------------------------===// // APIs for simple analysis of the loop. See header notes. /// getExitingBlocks - Return all blocks inside the loop that have successors /// outside of the loop. These are the blocks _inside of the current loop_ /// which branch out. The returned list is always unique. /// template<class BlockT, class LoopT> void LoopBase<BlockT, LoopT>:: getExitingBlocks(SmallVectorImpl<BlockT *> &ExitingBlocks) const { typedef GraphTraits<BlockT*> BlockTraits; for (block_iterator BI = block_begin(), BE = block_end(); BI != BE; ++BI) for (typename BlockTraits::ChildIteratorType I = BlockTraits::child_begin(*BI), E = BlockTraits::child_end(*BI); I != E; ++I) if (!contains(*I)) { // Not in current loop? It must be an exit block. ExitingBlocks.push_back(*BI); break; } } /// getExitingBlock - If getExitingBlocks would return exactly one block, /// return that block. Otherwise return null. template<class BlockT, class LoopT> BlockT *LoopBase<BlockT, LoopT>::getExitingBlock() const { SmallVector<BlockT*, 8> ExitingBlocks; getExitingBlocks(ExitingBlocks); if (ExitingBlocks.size() == 1) return ExitingBlocks[0]; return nullptr; } /// getExitBlocks - Return all of the successor blocks of this loop. These /// are the blocks _outside of the current loop_ which are branched to. /// template<class BlockT, class LoopT> void LoopBase<BlockT, LoopT>:: getExitBlocks(SmallVectorImpl<BlockT*> &ExitBlocks) const { typedef GraphTraits<BlockT*> BlockTraits; for (block_iterator BI = block_begin(), BE = block_end(); BI != BE; ++BI) for (typename BlockTraits::ChildIteratorType I = BlockTraits::child_begin(*BI), E = BlockTraits::child_end(*BI); I != E; ++I) if (!contains(*I)) // Not in current loop? It must be an exit block. ExitBlocks.push_back(*I); } /// getExitBlock - If getExitBlocks would return exactly one block, /// return that block. Otherwise return null. template<class BlockT, class LoopT> BlockT *LoopBase<BlockT, LoopT>::getExitBlock() const { SmallVector<BlockT*, 8> ExitBlocks; getExitBlocks(ExitBlocks); if (ExitBlocks.size() == 1) return ExitBlocks[0]; return nullptr; } /// getExitEdges - Return all pairs of (_inside_block_,_outside_block_). template<class BlockT, class LoopT> void LoopBase<BlockT, LoopT>:: getExitEdges(SmallVectorImpl<Edge> &ExitEdges) const { typedef GraphTraits<BlockT*> BlockTraits; for (block_iterator BI = block_begin(), BE = block_end(); BI != BE; ++BI) for (typename BlockTraits::ChildIteratorType I = BlockTraits::child_begin(*BI), E = BlockTraits::child_end(*BI); I != E; ++I) if (!contains(*I)) // Not in current loop? It must be an exit block. ExitEdges.push_back(Edge(*BI, *I)); } /// getLoopPreheader - If there is a preheader for this loop, return it. A /// loop has a preheader if there is only one edge to the header of the loop /// from outside of the loop. If this is the case, the block branching to the /// header of the loop is the preheader node. /// /// This method returns null if there is no preheader for the loop. /// template<class BlockT, class LoopT> BlockT *LoopBase<BlockT, LoopT>::getLoopPreheader() const { // Keep track of nodes outside the loop branching to the header... BlockT *Out = getLoopPredecessor(); if (!Out) return nullptr; // Make sure there is only one exit out of the preheader. typedef GraphTraits<BlockT*> BlockTraits; typename BlockTraits::ChildIteratorType SI = BlockTraits::child_begin(Out); ++SI; if (SI != BlockTraits::child_end(Out)) return nullptr; // Multiple exits from the block, must not be a preheader. // The predecessor has exactly one successor, so it is a preheader. return Out; } /// getLoopPredecessor - If the given loop's header has exactly one unique /// predecessor outside the loop, return it. Otherwise return null. /// This is less strict that the loop "preheader" concept, which requires /// the predecessor to have exactly one successor. /// template<class BlockT, class LoopT> BlockT *LoopBase<BlockT, LoopT>::getLoopPredecessor() const { // Keep track of nodes outside the loop branching to the header... BlockT *Out = nullptr; // Loop over the predecessors of the header node... BlockT *Header = getHeader(); typedef GraphTraits<Inverse<BlockT*> > InvBlockTraits; for (typename InvBlockTraits::ChildIteratorType PI = InvBlockTraits::child_begin(Header), PE = InvBlockTraits::child_end(Header); PI != PE; ++PI) { typename InvBlockTraits::NodeType *N = *PI; if (!contains(N)) { // If the block is not in the loop... if (Out && Out != N) return nullptr; // Multiple predecessors outside the loop Out = N; } } // Make sure there is only one exit out of the preheader. assert(Out && "Header of loop has no predecessors from outside loop?"); return Out; } /// getLoopLatch - If there is a single latch block for this loop, return it. /// A latch block is a block that contains a branch back to the header. template<class BlockT, class LoopT> BlockT *LoopBase<BlockT, LoopT>::getLoopLatch() const { BlockT *Header = getHeader(); typedef GraphTraits<Inverse<BlockT*> > InvBlockTraits; typename InvBlockTraits::ChildIteratorType PI = InvBlockTraits::child_begin(Header); typename InvBlockTraits::ChildIteratorType PE = InvBlockTraits::child_end(Header); BlockT *Latch = nullptr; for (; PI != PE; ++PI) { typename InvBlockTraits::NodeType *N = *PI; if (contains(N)) { if (Latch) return nullptr; Latch = N; } } return Latch; } //===----------------------------------------------------------------------===// // APIs for updating loop information after changing the CFG // /// addBasicBlockToLoop - This method is used by other analyses to update loop /// information. NewBB is set to be a new member of the current loop. /// Because of this, it is added as a member of all parent loops, and is added /// to the specified LoopInfo object as being in the current basic block. It /// is not valid to replace the loop header with this method. /// template<class BlockT, class LoopT> void LoopBase<BlockT, LoopT>:: addBasicBlockToLoop(BlockT *NewBB, LoopInfoBase<BlockT, LoopT> &LIB) { assert((Blocks.empty() || LIB[getHeader()] == this) && "Incorrect LI specified for this loop!"); assert(NewBB && "Cannot add a null basic block to the loop!"); assert(!LIB[NewBB] && "BasicBlock already in the loop!"); LoopT *L = static_cast<LoopT *>(this); // Add the loop mapping to the LoopInfo object... LIB.BBMap[NewBB] = L; // Add the basic block to this loop and all parent loops... while (L) { L->addBlockEntry(NewBB); L = L->getParentLoop(); } } /// replaceChildLoopWith - This is used when splitting loops up. It replaces /// the OldChild entry in our children list with NewChild, and updates the /// parent pointer of OldChild to be null and the NewChild to be this loop. /// This updates the loop depth of the new child. template<class BlockT, class LoopT> void LoopBase<BlockT, LoopT>:: replaceChildLoopWith(LoopT *OldChild, LoopT *NewChild) { assert(OldChild->ParentLoop == this && "This loop is already broken!"); assert(!NewChild->ParentLoop && "NewChild already has a parent!"); typename std::vector<LoopT *>::iterator I = std::find(SubLoops.begin(), SubLoops.end(), OldChild); assert(I != SubLoops.end() && "OldChild not in loop!"); *I = NewChild; OldChild->ParentLoop = nullptr; NewChild->ParentLoop = static_cast<LoopT *>(this); } /// verifyLoop - Verify loop structure template<class BlockT, class LoopT> void LoopBase<BlockT, LoopT>::verifyLoop() const { #ifndef NDEBUG assert(!Blocks.empty() && "Loop header is missing"); // Setup for using a depth-first iterator to visit every block in the loop. SmallVector<BlockT*, 8> ExitBBs; getExitBlocks(ExitBBs); llvm::SmallPtrSet<BlockT*, 8> VisitSet; VisitSet.insert(ExitBBs.begin(), ExitBBs.end()); df_ext_iterator<BlockT*, llvm::SmallPtrSet<BlockT*, 8> > BI = df_ext_begin(getHeader(), VisitSet), BE = df_ext_end(getHeader(), VisitSet); // Keep track of the number of BBs visited. unsigned NumVisited = 0; // Check the individual blocks. for ( ; BI != BE; ++BI) { BlockT *BB = *BI; bool HasInsideLoopSuccs = false; bool HasInsideLoopPreds = false; SmallVector<BlockT *, 2> OutsideLoopPreds; typedef GraphTraits<BlockT*> BlockTraits; for (typename BlockTraits::ChildIteratorType SI = BlockTraits::child_begin(BB), SE = BlockTraits::child_end(BB); SI != SE; ++SI) if (contains(*SI)) { HasInsideLoopSuccs = true; break; } typedef GraphTraits<Inverse<BlockT*> > InvBlockTraits; for (typename InvBlockTraits::ChildIteratorType PI = InvBlockTraits::child_begin(BB), PE = InvBlockTraits::child_end(BB); PI != PE; ++PI) { BlockT *N = *PI; if (contains(N)) HasInsideLoopPreds = true; else OutsideLoopPreds.push_back(N); } if (BB == getHeader()) { assert(!OutsideLoopPreds.empty() && "Loop is unreachable!"); } else if (!OutsideLoopPreds.empty()) { // A non-header loop shouldn't be reachable from outside the loop, // though it is permitted if the predecessor is not itself actually // reachable. BlockT *EntryBB = BB->getParent()->begin(); for (BlockT *CB : depth_first(EntryBB)) for (unsigned i = 0, e = OutsideLoopPreds.size(); i != e; ++i) assert(CB != OutsideLoopPreds[i] && "Loop has multiple entry points!"); } assert(HasInsideLoopPreds && "Loop block has no in-loop predecessors!"); assert(HasInsideLoopSuccs && "Loop block has no in-loop successors!"); assert(BB != getHeader()->getParent()->begin() && "Loop contains function entry block!"); NumVisited++; } assert(NumVisited == getNumBlocks() && "Unreachable block in loop"); // Check the subloops. for (iterator I = begin(), E = end(); I != E; ++I) // Each block in each subloop should be contained within this loop. for (block_iterator BI = (*I)->block_begin(), BE = (*I)->block_end(); BI != BE; ++BI) { assert(contains(*BI) && "Loop does not contain all the blocks of a subloop!"); } // Check the parent loop pointer. if (ParentLoop) { assert(std::find(ParentLoop->begin(), ParentLoop->end(), this) != ParentLoop->end() && "Loop is not a subloop of its parent!"); } #endif } /// verifyLoop - Verify loop structure of this loop and all nested loops. template<class BlockT, class LoopT> void LoopBase<BlockT, LoopT>::verifyLoopNest( DenseSet<const LoopT*> *Loops) const { Loops->insert(static_cast<const LoopT *>(this)); // Verify this loop. verifyLoop(); // Verify the subloops. for (iterator I = begin(), E = end(); I != E; ++I) (*I)->verifyLoopNest(Loops); } template<class BlockT, class LoopT> void LoopBase<BlockT, LoopT>::print(raw_ostream &OS, unsigned Depth) const { OS.indent(Depth*2) << "Loop at depth " << getLoopDepth() << " containing: "; for (unsigned i = 0; i < getBlocks().size(); ++i) { if (i) OS << ","; BlockT *BB = getBlocks()[i]; BB->printAsOperand(OS, false); if (BB == getHeader()) OS << "<header>"; if (BB == getLoopLatch()) OS << "<latch>"; if (isLoopExiting(BB)) OS << "<exiting>"; } OS << "\n"; for (iterator I = begin(), E = end(); I != E; ++I) (*I)->print(OS, Depth+2); } //===----------------------------------------------------------------------===// /// Stable LoopInfo Analysis - Build a loop tree using stable iterators so the /// result does / not depend on use list (block predecessor) order. /// /// Discover a subloop with the specified backedges such that: All blocks within /// this loop are mapped to this loop or a subloop. And all subloops within this /// loop have their parent loop set to this loop or a subloop. template<class BlockT, class LoopT> static void discoverAndMapSubloop(LoopT *L, ArrayRef<BlockT*> Backedges, LoopInfoBase<BlockT, LoopT> *LI, DominatorTreeBase<BlockT> &DomTree) { typedef GraphTraits<Inverse<BlockT*> > InvBlockTraits; unsigned NumBlocks = 0; unsigned NumSubloops = 0; // Perform a backward CFG traversal using a worklist. std::vector<BlockT *> ReverseCFGWorklist(Backedges.begin(), Backedges.end()); while (!ReverseCFGWorklist.empty()) { BlockT *PredBB = ReverseCFGWorklist.back(); ReverseCFGWorklist.pop_back(); LoopT *Subloop = LI->getLoopFor(PredBB); if (!Subloop) { if (!DomTree.isReachableFromEntry(PredBB)) continue; // This is an undiscovered block. Map it to the current loop. LI->changeLoopFor(PredBB, L); ++NumBlocks; if (PredBB == L->getHeader()) continue; // Push all block predecessors on the worklist. ReverseCFGWorklist.insert(ReverseCFGWorklist.end(), InvBlockTraits::child_begin(PredBB), InvBlockTraits::child_end(PredBB)); } else { // This is a discovered block. Find its outermost discovered loop. while (LoopT *Parent = Subloop->getParentLoop()) Subloop = Parent; // If it is already discovered to be a subloop of this loop, continue. if (Subloop == L) continue; // Discover a subloop of this loop. Subloop->setParentLoop(L); ++NumSubloops; NumBlocks += Subloop->getBlocks().capacity(); PredBB = Subloop->getHeader(); // Continue traversal along predecessors that are not loop-back edges from // within this subloop tree itself. Note that a predecessor may directly // reach another subloop that is not yet discovered to be a subloop of // this loop, which we must traverse. for (typename InvBlockTraits::ChildIteratorType PI = InvBlockTraits::child_begin(PredBB), PE = InvBlockTraits::child_end(PredBB); PI != PE; ++PI) { if (LI->getLoopFor(*PI) != Subloop) ReverseCFGWorklist.push_back(*PI); } } } L->getSubLoopsVector().reserve(NumSubloops); L->reserveBlocks(NumBlocks); } /// Populate all loop data in a stable order during a single forward DFS. template<class BlockT, class LoopT> class PopulateLoopsDFS { typedef GraphTraits<BlockT*> BlockTraits; typedef typename BlockTraits::ChildIteratorType SuccIterTy; LoopInfoBase<BlockT, LoopT> *LI; public: PopulateLoopsDFS(LoopInfoBase<BlockT, LoopT> *li): LI(li) {} void traverse(BlockT *EntryBlock); protected: void insertIntoLoop(BlockT *Block); }; /// Top-level driver for the forward DFS within the loop. template<class BlockT, class LoopT> void PopulateLoopsDFS<BlockT, LoopT>::traverse(BlockT *EntryBlock) { for (BlockT *BB : post_order(EntryBlock)) insertIntoLoop(BB); } /// Add a single Block to its ancestor loops in PostOrder. If the block is a /// subloop header, add the subloop to its parent in PostOrder, then reverse the /// Block and Subloop vectors of the now complete subloop to achieve RPO. template<class BlockT, class LoopT> void PopulateLoopsDFS<BlockT, LoopT>::insertIntoLoop(BlockT *Block) { LoopT *Subloop = LI->getLoopFor(Block); if (Subloop && Block == Subloop->getHeader()) { // We reach this point once per subloop after processing all the blocks in // the subloop. if (Subloop->getParentLoop()) Subloop->getParentLoop()->getSubLoopsVector().push_back(Subloop); else LI->addTopLevelLoop(Subloop); // For convenience, Blocks and Subloops are inserted in postorder. Reverse // the lists, except for the loop header, which is always at the beginning. Subloop->reverseBlock(1); std::reverse(Subloop->getSubLoopsVector().begin(), Subloop->getSubLoopsVector().end()); Subloop = Subloop->getParentLoop(); } for (; Subloop; Subloop = Subloop->getParentLoop()) Subloop->addBlockEntry(Block); } /// Analyze LoopInfo discovers loops during a postorder DominatorTree traversal /// interleaved with backward CFG traversals within each subloop /// (discoverAndMapSubloop). The backward traversal skips inner subloops, so /// this part of the algorithm is linear in the number of CFG edges. Subloop and /// Block vectors are then populated during a single forward CFG traversal /// (PopulateLoopDFS). /// /// During the two CFG traversals each block is seen three times: /// 1) Discovered and mapped by a reverse CFG traversal. /// 2) Visited during a forward DFS CFG traversal. /// 3) Reverse-inserted in the loop in postorder following forward DFS. /// /// The Block vectors are inclusive, so step 3 requires loop-depth number of /// insertions per block. template<class BlockT, class LoopT> void LoopInfoBase<BlockT, LoopT>:: Analyze(DominatorTreeBase<BlockT> &DomTree) { // Postorder traversal of the dominator tree. DomTreeNodeBase<BlockT>* DomRoot = DomTree.getRootNode(); for (auto DomNode : post_order(DomRoot)) { BlockT *Header = DomNode->getBlock(); SmallVector<BlockT *, 4> Backedges; // Check each predecessor of the potential loop header. typedef GraphTraits<Inverse<BlockT*> > InvBlockTraits; for (typename InvBlockTraits::ChildIteratorType PI = InvBlockTraits::child_begin(Header), PE = InvBlockTraits::child_end(Header); PI != PE; ++PI) { BlockT *Backedge = *PI; // If Header dominates predBB, this is a new loop. Collect the backedges. if (DomTree.dominates(Header, Backedge) && DomTree.isReachableFromEntry(Backedge)) { Backedges.push_back(Backedge); } } // Perform a backward CFG traversal to discover and map blocks in this loop. if (!Backedges.empty()) { LoopT *L = new LoopT(Header); discoverAndMapSubloop(L, ArrayRef<BlockT*>(Backedges), this, DomTree); } } // Perform a single forward CFG traversal to populate block and subloop // vectors for all loops. PopulateLoopsDFS<BlockT, LoopT> DFS(this); DFS.traverse(DomRoot->getBlock()); } // Debugging template<class BlockT, class LoopT> void LoopInfoBase<BlockT, LoopT>::print(raw_ostream &OS) const { for (unsigned i = 0; i < TopLevelLoops.size(); ++i) TopLevelLoops[i]->print(OS); #if 0 for (DenseMap<BasicBlock*, LoopT*>::const_iterator I = BBMap.begin(), E = BBMap.end(); I != E; ++I) OS << "BB '" << I->first->getName() << "' level = " << I->second->getLoopDepth() << "\n"; #endif } template<class BlockT, class LoopT> void LoopInfoBase<BlockT, LoopT>::verify() const { DenseSet<const LoopT*> Loops; for (iterator I = begin(), E = end(); I != E; ++I) { assert(!(*I)->getParentLoop() && "Top-level loop has a parent!"); (*I)->verifyLoopNest(&Loops); } // Verify that blocks are mapped to valid loops. #ifndef NDEBUG for (auto &Entry : BBMap) { const BlockT *BB = Entry.first; LoopT *L = Entry.second; assert(Loops.count(L) && "orphaned loop"); assert(L->contains(BB) && "orphaned block"); } #endif } } // namespace llvm #endif
[ "peterdfinn@icloud.com" ]
peterdfinn@icloud.com
02f5ffe8d8f2b6601b594336105b83597e27c6a8
a7f7cd1f9a714bf7a2f3ab3d4b7c232a9b0d9087
/solutions/EllysRoomAssignmentsDiv1/EllysRoomAssignmentsDiv1.cpp
63953e121381ee6b7c25553729ed6e0bfa22d629
[]
no_license
yaoReadingCode/topcoder
a884fb7ccec6c3f2bf9aaced4d757914e0d67917
442f1b0c71d5876b72b499b304229c9db511ef53
refs/heads/master
2023-06-25T09:32:16.698105
2021-07-11T10:24:44
2021-07-11T10:24:44
null
0
0
null
null
null
null
UTF-8
C++
false
false
6,406
cpp
#include <fstream> // for greed plugin #include <iostream> #include <algorithm> // max,min #include <vector> #include <string> #include <sstream> #include <set> #include <map> #include <iostream> #include <utility> #include <cctype> #include <queue> #include <stack> #include <cstdio> #include <cstdlib> #include <cmath> #include <unordered_set> #include <unordered_map> #include <limits.h> #include <cstring> #include <tuple> #include <cassert> #include <numeric> using namespace std; // type alias typedef long long LL; typedef pair< int , int > II; typedef tuple< int, int, int > III; typedef vector<int> VI; typedef vector<string> VS; typedef vector<vector<int>> VVI; typedef unordered_map<int,int> MAPII; typedef unordered_set<int> SETI; template<class T> using VV=vector<vector<T>>; // minmax template<class T> inline T SMIN(T& a, const T b) { return a=(a>b)?b:a; } template<class T> inline T SMAX(T& a, const T b) { return a=(a<b)?b:a; } // repetition #define FORE(i,a,b) for(int i=(a);i<=(b);++i) #define REPE(i,n) for(int i=0;i<=(n);++i) #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define REP(i,n) for(int i=0;i<(n);++i) #define FORR(x,arr) for(auto& x:arr) #define SZ(a) int((a).size()) // collection #define ALL(c) (c).begin(),(c).end() // DP #define MINUS(dp) memset(dp, -1, sizeof(dp)) #define ZERO(dp) memset(dp, 0, sizeof(dp)) // debug cout #define TRACE true #define dump(x) if(TRACE) { cout << #x << " = " << (x) << endl; } #define dump2(x,y) if(TRACE) { cout << #x << " = " << (x) << ", " << #y << " = " << (y) << endl; } #define dump3(x,y,z) if(TRACE) { cout << #x << " = " << (x) << ", " << #y << " = " << (y) << ", " << #z << " = " << (z) << endl; } #define dump4(x,y,z,a) if(TRACE) { cout << #x << " = " << (x) << ", " << #y << " = " << (y) << ", " << #z << " = " << (z) << ", " << #a << " = " << (a) << endl; } #define dumpf(args...) if(TRACE) { fprintf(stdout, ##args); putc('\n',stdout); } #define dumpAR(ar) if(TRACE) { FORR(x,(ar)) { cout << x << ','; } cerr << endl; } template<class Iter> void dumpc(Iter begin, Iter end) { if (TRACE) { for(; begin!=end; ++begin) { cout<<*begin<<','; } cout<<endl; } } /* 1/19/2019 18:06-18:28 pause 1/20/2019 8:13-8:32 AC https://apps.topcoder.com/wiki/display/tc/SRM+577 http://kmjp.hatenablog.jp/entry/2013/05/03/0900 https://creep06.hatenablog.com/entry/20181102/1541101259 http://torus711.hatenablog.com/entry/20130426/p1 */ class EllysRoomAssignmentsDiv1 { public: double getAverage(vector<string> ratings) { VI A; string S; FORR(s,ratings) S+=s; stringstream ss(S); string x; while(getline(ss,x,' ')) A.push_back(stoi(x)); int el=A.front(); int N=SZ(A); sort(A.rbegin(),A.rend()); int R=(N+19)/20; int G=(N+R-1)/R; vector<double> E(G); int elg=-1,lcnt=-1; REP(i,G) { bool hasel=false; double sum=0; int cnt=0; for(int j=R*i; j<N&&j<R*(i+1); ++j) { if(A[j]==el) hasel=true; sum+=A[j],++cnt; } if(hasel) { elg=i; E[i]=el; } else { E[i]=sum/cnt; } // dump3(i,cnt,E[i]); lcnt=cnt; } // dump4(R,G,elg,lcnt); double res=0; if(elg==G-1) { res=accumulate(ALL(E),0.0)/G; } else { double a=accumulate(ALL(E),0.0)/G*lcnt/R; double b=accumulate(E.begin(),E.begin()+G-1,0.0)/(G-1)*(R-lcnt)/R; res=a+b; } return res; } }; // CUT begin ifstream data("EllysRoomAssignmentsDiv1.sample"); string next_line() { string s; getline(data, s); return s; } template <typename T> void from_stream(T &t) { stringstream ss(next_line()); ss >> t; } void from_stream(string &s) { s = next_line(); } template <typename T> void from_stream(vector<T> &ts) { int len; from_stream(len); ts.clear(); for (int i = 0; i < len; ++i) { T t; from_stream(t); ts.push_back(t); } } template <typename T> string to_string(T t) { stringstream s; s << t; return s.str(); } string to_string(string t) { return "\"" + t + "\""; } bool double_equal(const double &a, const double &b) { return b==b && a==a && fabs(b - a) <= 1e-9 * max(1.0, fabs(a) ); } bool do_test(vector<string> ratings, double __expected) { time_t startClock = clock(); EllysRoomAssignmentsDiv1 *instance = new EllysRoomAssignmentsDiv1(); double __result = instance->getAverage(ratings); double elapsed = (double)(clock() - startClock) / CLOCKS_PER_SEC; delete instance; if (double_equal(__expected, __result)) { cout << "PASSED!" << " (" << elapsed << " seconds)" << endl; return true; } else { cout << "FAILED!" << " (" << elapsed << " seconds)" << endl; cout << " Expected: " << to_string(__expected) << endl; cout << " Received: " << to_string(__result) << endl; return false; } } int run_test(bool mainProcess, const set<int> &case_set, const string command) { int cases = 0, passed = 0; while (true) { if (next_line().find("--") != 0) break; vector<string> ratings; from_stream(ratings); next_line(); double __answer; from_stream(__answer); cases++; if (case_set.size() > 0 && case_set.find(cases - 1) == case_set.end()) continue; cout << " Testcase #" << cases - 1 << " ... "; if ( do_test(ratings, __answer)) { passed++; } } if (mainProcess) { cout << endl << "Passed : " << passed << "/" << cases << " cases" << endl; int T = time(NULL) - 1547949926; double PT = T / 60.0, TT = 75.0; cout << "Time : " << T / 60 << " minutes " << T % 60 << " secs" << endl; cout << "Score : " << 250 * (0.3 + (0.7 * TT * TT) / (10.0 * PT * PT + TT * TT)) << " points" << endl; } return 0; } int main(int argc, char *argv[]) { cout.setf(ios::fixed, ios::floatfield); cout.precision(2); set<int> cases; bool mainProcess = true; for (int i = 1; i < argc; ++i) { if ( string(argv[i]) == "-") { mainProcess = false; } else { cases.insert(atoi(argv[i])); } } if (mainProcess) { cout << "EllysRoomAssignmentsDiv1 (250 Points)" << endl << endl; } return run_test(mainProcess, cases, argv[0]); } // CUT end
[ "hiroshi.maybe@gmail.com" ]
hiroshi.maybe@gmail.com
99d293102b69d242980abf7ffcb0c65362826162
72027668a48e70ed95909f91d3fa2ed210aace96
/ch05/side_effect_Assign_test.cpp
2155d4af7a680cd38ce7320a79a12a621fd97af9
[ "MIT" ]
permissive
silenc3502/c_tdd
0a511fa949117c6e8c0fb30d4770601b989d23fc
e13cc1d37a113d856e898bbe2cf9c19798057686
refs/heads/main
2023-04-26T00:48:52.676769
2021-05-15T15:41:18
2021-05-15T15:41:18
364,018,510
0
0
null
null
null
null
UTF-8
C++
false
false
486
cpp
#include "gtest/gtest.h" #include "gmock/gmock.h" using namespace ::testing; class MockDOC { public: MOCK_METHOD2(sum, int(int, int)); }; TEST(ActionTest, SideEffect) { MockDOC mock; int var = 0; EXPECT_CALL(mock, sum(_, _)).WillOnce(DoAll(Assign(&var, 200), Return(100))); std::cout << "sum: " << mock.sum(2, 1) << std::endl; std::cout << "var: " << var << std::endl; } int main(int argc, char **argv) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }
[ "gcccompil3r@gmail.com" ]
gcccompil3r@gmail.com
aa768ac246cfc4980861c420847514914483405b
504d1d75fcf7a4d1d00ce3d07bd263c6b18cec98
/src/swifttx.cpp
c92f4690974d4fa1ddf1976efc5bc439c8402b8d
[ "MIT" ]
permissive
eenglish34/E-BlockMail
698038c14c11cb2ad76f9784934470bc99935835
96f3cb7a3999643b0609d1c31927848dc37faae2
refs/heads/master
2020-03-29T14:46:58.161284
2018-10-10T18:03:30
2018-10-10T18:03:30
150,032,461
2
0
null
null
null
null
UTF-8
C++
false
false
20,314
cpp
// Copyright (c) 2014-2016 The Dash developers // Copyright (c) 2016-2018 The EBlockmail developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "swifttx.h" #include "activemasternode.h" #include "base58.h" #include "key.h" #include "masternodeman.h" #include "net.h" #include "obfuscation.h" #include "protocol.h" #include "spork.h" #include "sync.h" #include "util.h" #include "validationinterface.h" #include <boost/lexical_cast.hpp> using namespace std; using namespace boost; std::map<uint256, CTransaction> mapTxLockReq; std::map<uint256, CTransaction> mapTxLockReqRejected; std::map<uint256, CConsensusVote> mapTxLockVote; std::map<uint256, CTransactionLock> mapTxLocks; std::map<COutPoint, uint256> mapLockedInputs; std::map<uint256, int64_t> mapUnknownVotes; //track votes with no tx for DOS int nCompleteTXLocks; //txlock - Locks transaction // //step 1.) Broadcast intention to lock transaction inputs, "txlreg", CTransaction //step 2.) Top SWIFTTX_SIGNATURES_TOTAL masternodes, open connect to top 1 masternode. // Send "txvote", CTransaction, Signature, Approve //step 3.) Top 1 masternode, waits for SWIFTTX_SIGNATURES_REQUIRED messages. Upon success, sends "txlock' void ProcessMessageSwiftTX(CNode* pfrom, std::string& strCommand, CDataStream& vRecv) { if (fLiteMode) return; //disable all obfuscation/masternode related functionality if (!IsSporkActive(SPORK_2_SWIFTTX)) return; if (!masternodeSync.IsBlockchainSynced()) return; if (strCommand == "ix") { //LogPrintf("ProcessMessageSwiftTX::ix\n"); CDataStream vMsg(vRecv); CTransaction tx; vRecv >> tx; CInv inv(MSG_TXLOCK_REQUEST, tx.GetHash()); pfrom->AddInventoryKnown(inv); GetMainSignals().Inventory(inv.hash); if (mapTxLockReq.count(tx.GetHash()) || mapTxLockReqRejected.count(tx.GetHash())) { return; } if (!IsIXTXValid(tx)) { return; } BOOST_FOREACH (const CTxOut o, tx.vout) { // IX supports normal scripts and unspendable scripts (used in DS collateral and Budget collateral). // TODO: Look into other script types that are normal and can be included if (!o.scriptPubKey.IsNormalPaymentScript() && !o.scriptPubKey.IsUnspendable()) { LogPrintf("ProcessMessageSwiftTX::ix - Invalid Script %s\n", tx.ToString().c_str()); return; } } int nBlockHeight = CreateNewLock(tx); bool fMissingInputs = false; CValidationState state; bool fAccepted = false; { LOCK(cs_main); fAccepted = AcceptToMemoryPool(mempool, state, tx, true, &fMissingInputs); } if (fAccepted) { RelayInv(inv); DoConsensusVote(tx, nBlockHeight); mapTxLockReq.insert(make_pair(tx.GetHash(), tx)); LogPrintf("ProcessMessageSwiftTX::ix - Transaction Lock Request: %s %s : accepted %s\n", pfrom->addr.ToString().c_str(), pfrom->cleanSubVer.c_str(), tx.GetHash().ToString().c_str()); if (GetTransactionLockSignatures(tx.GetHash()) == SWIFTTX_SIGNATURES_REQUIRED) { GetMainSignals().NotifyTransactionLock(tx); } return; } else { mapTxLockReqRejected.insert(make_pair(tx.GetHash(), tx)); // can we get the conflicting transaction as proof? LogPrintf("ProcessMessageSwiftTX::ix - Transaction Lock Request: %s %s : rejected %s\n", pfrom->addr.ToString().c_str(), pfrom->cleanSubVer.c_str(), tx.GetHash().ToString().c_str()); BOOST_FOREACH (const CTxIn& in, tx.vin) { if (!mapLockedInputs.count(in.prevout)) { mapLockedInputs.insert(make_pair(in.prevout, tx.GetHash())); } } // resolve conflicts std::map<uint256, CTransactionLock>::iterator i = mapTxLocks.find(tx.GetHash()); if (i != mapTxLocks.end()) { //we only care if we have a complete tx lock if ((*i).second.CountSignatures() >= SWIFTTX_SIGNATURES_REQUIRED) { if (!CheckForConflictingLocks(tx)) { LogPrintf("ProcessMessageSwiftTX::ix - Found Existing Complete IX Lock\n"); //reprocess the last 15 blocks ReprocessBlocks(15); mapTxLockReq.insert(make_pair(tx.GetHash(), tx)); } } } return; } } else if (strCommand == "txlvote") // SwiftX Lock Consensus Votes { CConsensusVote ctx; vRecv >> ctx; CInv inv(MSG_TXLOCK_VOTE, ctx.GetHash()); pfrom->AddInventoryKnown(inv); if (mapTxLockVote.count(ctx.GetHash())) { return; } mapTxLockVote.insert(make_pair(ctx.GetHash(), ctx)); if (ProcessConsensusVote(pfrom, ctx)) { //Spam/Dos protection /* Masternodes will sometimes propagate votes before the transaction is known to the client. This tracks those messages and allows it at the same rate of the rest of the network, if a peer violates it, it will simply be ignored */ if (!mapTxLockReq.count(ctx.txHash) && !mapTxLockReqRejected.count(ctx.txHash)) { if (!mapUnknownVotes.count(ctx.vinMasternode.prevout.hash)) { mapUnknownVotes[ctx.vinMasternode.prevout.hash] = GetTime() + (60 * 10); } if (mapUnknownVotes[ctx.vinMasternode.prevout.hash] > GetTime() && mapUnknownVotes[ctx.vinMasternode.prevout.hash] - GetAverageVoteTime() > 60 * 10) { LogPrintf("ProcessMessageSwiftTX::ix - masternode is spamming transaction votes: %s %s\n", ctx.vinMasternode.ToString().c_str(), ctx.txHash.ToString().c_str()); return; } else { mapUnknownVotes[ctx.vinMasternode.prevout.hash] = GetTime() + (60 * 10); } } RelayInv(inv); } if (mapTxLockReq.count(ctx.txHash) && GetTransactionLockSignatures(ctx.txHash) == SWIFTTX_SIGNATURES_REQUIRED) { GetMainSignals().NotifyTransactionLock(mapTxLockReq[ctx.txHash]); } return; } } bool IsIXTXValid(const CTransaction& txCollateral) { if (txCollateral.vout.size() < 1) return false; if (txCollateral.nLockTime != 0) return false; CAmount nValueIn = 0; CAmount nValueOut = 0; bool missingTx = false; BOOST_FOREACH (const CTxOut o, txCollateral.vout) nValueOut += o.nValue; BOOST_FOREACH (const CTxIn i, txCollateral.vin) { CTransaction tx2; uint256 hash; if (GetTransaction(i.prevout.hash, tx2, hash, true)) { if (tx2.vout.size() > i.prevout.n) { nValueIn += tx2.vout[i.prevout.n].nValue; } } else { missingTx = true; } } if (nValueOut > GetSporkValue(SPORK_5_MAX_VALUE) * COIN) { LogPrint("swiftx", "IsIXTXValid - Transaction value too high - %s\n", txCollateral.ToString().c_str()); return false; } if (missingTx) { LogPrint("swiftx", "IsIXTXValid - Unknown inputs in IX transaction - %s\n", txCollateral.ToString().c_str()); /* This happens sometimes for an unknown reason, so we'll return that it's a valid transaction. If someone submits an invalid transaction it will be rejected by the network anyway and this isn't very common, but we don't want to block IX just because the client can't figure out the fee. */ return true; } if (nValueIn - nValueOut < COIN * 0.01) { LogPrint("swiftx", "IsIXTXValid - did not include enough fees in transaction %d\n%s\n", nValueOut - nValueIn, txCollateral.ToString().c_str()); return false; } return true; } int64_t CreateNewLock(CTransaction tx) { int64_t nTxAge = 0; BOOST_REVERSE_FOREACH (CTxIn i, tx.vin) { nTxAge = GetInputAge(i); if (nTxAge < 5) //1 less than the "send IX" gui requires, incase of a block propagating the network at the time { LogPrintf("CreateNewLock - Transaction not found / too new: %d / %s\n", nTxAge, tx.GetHash().ToString().c_str()); return 0; } } /* Use a blockheight newer than the input. This prevents attackers from using transaction mallibility to predict which masternodes they'll use. */ int nBlockHeight = (chainActive.Tip()->nHeight - nTxAge) + 4; if (!mapTxLocks.count(tx.GetHash())) { LogPrintf("CreateNewLock - New Transaction Lock %s !\n", tx.GetHash().ToString().c_str()); CTransactionLock newLock; newLock.nBlockHeight = nBlockHeight; newLock.nExpiration = GetTime() + (60 * 60); //locks expire after 60 minutes (24 confirmations) newLock.nTimeout = GetTime() + (60 * 5); newLock.txHash = tx.GetHash(); mapTxLocks.insert(make_pair(tx.GetHash(), newLock)); } else { mapTxLocks[tx.GetHash()].nBlockHeight = nBlockHeight; LogPrint("swiftx", "CreateNewLock - Transaction Lock Exists %s !\n", tx.GetHash().ToString().c_str()); } return nBlockHeight; } // check if we need to vote on this transaction void DoConsensusVote(CTransaction& tx, int64_t nBlockHeight) { if (!fMasterNode) return; int n = mnodeman.GetMasternodeRank(activeMasternode.vin, nBlockHeight, MIN_SWIFTTX_PROTO_VERSION); if (n == -1) { LogPrint("swiftx", "SwiftX::DoConsensusVote - Unknown Masternode\n"); return; } if (n > SWIFTTX_SIGNATURES_TOTAL) { LogPrint("swiftx", "SwiftX::DoConsensusVote - Masternode not in the top %d (%d)\n", SWIFTTX_SIGNATURES_TOTAL, n); return; } /* nBlockHeight calculated from the transaction is the authoritive source */ LogPrint("swiftx", "SwiftX::DoConsensusVote - In the top %d (%d)\n", SWIFTTX_SIGNATURES_TOTAL, n); CConsensusVote ctx; ctx.vinMasternode = activeMasternode.vin; ctx.txHash = tx.GetHash(); ctx.nBlockHeight = nBlockHeight; if (!ctx.Sign()) { LogPrintf("SwiftX::DoConsensusVote - Failed to sign consensus vote\n"); return; } if (!ctx.SignatureValid()) { LogPrintf("SwiftX::DoConsensusVote - Signature invalid\n"); return; } mapTxLockVote[ctx.GetHash()] = ctx; CInv inv(MSG_TXLOCK_VOTE, ctx.GetHash()); RelayInv(inv); } //received a consensus vote bool ProcessConsensusVote(CNode* pnode, CConsensusVote& ctx) { int n = mnodeman.GetMasternodeRank(ctx.vinMasternode, ctx.nBlockHeight, MIN_SWIFTTX_PROTO_VERSION); CMasternode* pmn = mnodeman.Find(ctx.vinMasternode); if (pmn != NULL) LogPrint("swiftx", "SwiftX::ProcessConsensusVote - Masternode ADDR %s %d\n", pmn->addr.ToString().c_str(), n); if (n == -1) { //can be caused by past versions trying to vote with an invalid protocol LogPrint("swiftx", "SwiftX::ProcessConsensusVote - Unknown Masternode\n"); mnodeman.AskForMN(pnode, ctx.vinMasternode); return false; } if (n > SWIFTTX_SIGNATURES_TOTAL) { LogPrint("swiftx", "SwiftX::ProcessConsensusVote - Masternode not in the top %d (%d) - %s\n", SWIFTTX_SIGNATURES_TOTAL, n, ctx.GetHash().ToString().c_str()); return false; } if (!ctx.SignatureValid()) { LogPrintf("SwiftX::ProcessConsensusVote - Signature invalid\n"); // don't ban, it could just be a non-synced masternode mnodeman.AskForMN(pnode, ctx.vinMasternode); return false; } if (!mapTxLocks.count(ctx.txHash)) { LogPrintf("SwiftX::ProcessConsensusVote - New Transaction Lock %s !\n", ctx.txHash.ToString().c_str()); CTransactionLock newLock; newLock.nBlockHeight = 0; newLock.nExpiration = GetTime() + (60 * 60); newLock.nTimeout = GetTime() + (60 * 5); newLock.txHash = ctx.txHash; mapTxLocks.insert(make_pair(ctx.txHash, newLock)); } else LogPrint("swiftx", "SwiftX::ProcessConsensusVote - Transaction Lock Exists %s !\n", ctx.txHash.ToString().c_str()); //compile consessus vote std::map<uint256, CTransactionLock>::iterator i = mapTxLocks.find(ctx.txHash); if (i != mapTxLocks.end()) { (*i).second.AddSignature(ctx); #ifdef ENABLE_WALLET if (pwalletMain) { //when we get back signatures, we'll count them as requests. Otherwise the client will think it didn't propagate. if (pwalletMain->mapRequestCount.count(ctx.txHash)) pwalletMain->mapRequestCount[ctx.txHash]++; } #endif LogPrint("swiftx", "SwiftX::ProcessConsensusVote - Transaction Lock Votes %d - %s !\n", (*i).second.CountSignatures(), ctx.GetHash().ToString().c_str()); if ((*i).second.CountSignatures() >= SWIFTTX_SIGNATURES_REQUIRED) { LogPrint("swiftx", "SwiftX::ProcessConsensusVote - Transaction Lock Is Complete %s !\n", (*i).second.GetHash().ToString().c_str()); CTransaction& tx = mapTxLockReq[ctx.txHash]; if (!CheckForConflictingLocks(tx)) { #ifdef ENABLE_WALLET if (pwalletMain) { if (pwalletMain->UpdatedTransaction((*i).second.txHash)) { nCompleteTXLocks++; } } #endif if (mapTxLockReq.count(ctx.txHash)) { BOOST_FOREACH (const CTxIn& in, tx.vin) { if (!mapLockedInputs.count(in.prevout)) { mapLockedInputs.insert(make_pair(in.prevout, ctx.txHash)); } } } // resolve conflicts //if this tx lock was rejected, we need to remove the conflicting blocks if (mapTxLockReqRejected.count((*i).second.txHash)) { //reprocess the last 15 blocks ReprocessBlocks(15); } } } return true; } return false; } bool CheckForConflictingLocks(CTransaction& tx) { /* It's possible (very unlikely though) to get 2 conflicting transaction locks approved by the network. In that case, they will cancel each other out. Blocks could have been rejected during this time, which is OK. After they cancel out, the client will rescan the blocks and find they're acceptable and then take the chain with the most work. */ BOOST_FOREACH (const CTxIn& in, tx.vin) { if (mapLockedInputs.count(in.prevout)) { if (mapLockedInputs[in.prevout] != tx.GetHash()) { LogPrintf("SwiftX::CheckForConflictingLocks - found two complete conflicting locks - removing both. %s %s", tx.GetHash().ToString().c_str(), mapLockedInputs[in.prevout].ToString().c_str()); if (mapTxLocks.count(tx.GetHash())) mapTxLocks[tx.GetHash()].nExpiration = GetTime(); if (mapTxLocks.count(mapLockedInputs[in.prevout])) mapTxLocks[mapLockedInputs[in.prevout]].nExpiration = GetTime(); return true; } } } return false; } int64_t GetAverageVoteTime() { std::map<uint256, int64_t>::iterator it = mapUnknownVotes.begin(); int64_t total = 0; int64_t count = 0; while (it != mapUnknownVotes.end()) { total += it->second; count++; it++; } return total / count; } void CleanTransactionLocksList() { if (chainActive.Tip() == NULL) return; std::map<uint256, CTransactionLock>::iterator it = mapTxLocks.begin(); while (it != mapTxLocks.end()) { if (GetTime() > it->second.nExpiration) { //keep them for an hour LogPrintf("Removing old transaction lock %s\n", it->second.txHash.ToString().c_str()); if (mapTxLockReq.count(it->second.txHash)) { CTransaction& tx = mapTxLockReq[it->second.txHash]; BOOST_FOREACH (const CTxIn& in, tx.vin) mapLockedInputs.erase(in.prevout); mapTxLockReq.erase(it->second.txHash); mapTxLockReqRejected.erase(it->second.txHash); BOOST_FOREACH (CConsensusVote& v, it->second.vecConsensusVotes) mapTxLockVote.erase(v.GetHash()); } mapTxLocks.erase(it++); } else { it++; } } } int GetTransactionLockSignatures(uint256 txHash) { if(fLargeWorkForkFound || fLargeWorkInvalidChainFound) return -2; if (!IsSporkActive(SPORK_2_SWIFTTX)) return -1; std::map<uint256, CTransactionLock>::iterator it = mapTxLocks.find(txHash); if(it != mapTxLocks.end()) return it->second.CountSignatures(); return -1; } uint256 CConsensusVote::GetHash() const { return vinMasternode.prevout.hash + vinMasternode.prevout.n + txHash; } bool CConsensusVote::SignatureValid() { std::string errorMessage; std::string strMessage = txHash.ToString().c_str() + boost::lexical_cast<std::string>(nBlockHeight); //LogPrintf("verify strMessage %s \n", strMessage.c_str()); CMasternode* pmn = mnodeman.Find(vinMasternode); if (pmn == NULL) { LogPrintf("SwiftX::CConsensusVote::SignatureValid() - Unknown Masternode\n"); return false; } if (!obfuScationSigner.VerifyMessage(pmn->pubKeyMasternode, vchMasterNodeSignature, strMessage, errorMessage)) { LogPrintf("SwiftX::CConsensusVote::SignatureValid() - Verify message failed\n"); return false; } return true; } bool CConsensusVote::Sign() { std::string errorMessage; CKey key2; CPubKey pubkey2; std::string strMessage = txHash.ToString().c_str() + boost::lexical_cast<std::string>(nBlockHeight); //LogPrintf("signing strMessage %s \n", strMessage.c_str()); //LogPrintf("signing privkey %s \n", strMasterNodePrivKey.c_str()); if (!obfuScationSigner.SetKey(strMasterNodePrivKey, errorMessage, key2, pubkey2)) { LogPrintf("CConsensusVote::Sign() - ERROR: Invalid masternodeprivkey: '%s'\n", errorMessage.c_str()); return false; } if (!obfuScationSigner.SignMessage(strMessage, errorMessage, vchMasterNodeSignature, key2)) { LogPrintf("CConsensusVote::Sign() - Sign message failed"); return false; } if (!obfuScationSigner.VerifyMessage(pubkey2, vchMasterNodeSignature, strMessage, errorMessage)) { LogPrintf("CConsensusVote::Sign() - Verify message failed"); return false; } return true; } bool CTransactionLock::SignaturesValid() { BOOST_FOREACH (CConsensusVote vote, vecConsensusVotes) { int n = mnodeman.GetMasternodeRank(vote.vinMasternode, vote.nBlockHeight, MIN_SWIFTTX_PROTO_VERSION); if (n == -1) { LogPrintf("CTransactionLock::SignaturesValid() - Unknown Masternode\n"); return false; } if (n > SWIFTTX_SIGNATURES_TOTAL) { LogPrintf("CTransactionLock::SignaturesValid() - Masternode not in the top %s\n", SWIFTTX_SIGNATURES_TOTAL); return false; } if (!vote.SignatureValid()) { LogPrintf("CTransactionLock::SignaturesValid() - Signature not valid\n"); return false; } } return true; } void CTransactionLock::AddSignature(CConsensusVote& cv) { vecConsensusVotes.push_back(cv); } int CTransactionLock::CountSignatures() { /* Only count signatures where the BlockHeight matches the transaction's blockheight. The votes have no proof it's the correct blockheight */ if (nBlockHeight == 0) return -1; int n = 0; BOOST_FOREACH (CConsensusVote v, vecConsensusVotes) { if (v.nBlockHeight == nBlockHeight) { n++; } } return n; }
[ "eenglish34@hotmail.com" ]
eenglish34@hotmail.com
173e805b21b3288b79c5526dacdeb7d38b83b57f
b9e4f272762d5cf871653e4b4a3aa9ad33b05117
/ACM/周末ing2017-08-06/AtCoder - 2020.cpp
2b938b9c224a56e156272b5a78f042aaf036e6dc
[]
no_license
haozx1997/C
e799cb25e1fa6c86318721834032c008764066ed
afb7657a58b86bf985c4a44bedfaf1c9cff30cf4
refs/heads/master
2021-07-11T23:54:17.357536
2017-10-12T03:42:23
2017-10-12T03:42:23
106,662,415
0
0
null
null
null
null
UTF-8
C++
false
false
744
cpp
#include<bits/stdc++.h> #define ll long long using namespace std; char s[100100]; int main() { while(~scanf("%s",s)) { int len = strlen(s); int n = len; int F= 0; for(int i = 0;i < len-2;i++) { if(s[i] == s[i+1]) { printf("%d %d\n",i+1,i+2); F = 1; break; } if(s[i] == s[i+2]) { printf("%d %d\n",i+1,i+2+1); F = 1; break; } } if(!F) { if(s[n-1] == s[n-2]) { printf("%d %d\n",n-1,n); F = 1; } } if(!F) { printf("-1 -1\n"); } } /* needed atcoder Sample Output The string s2s3s4s5 = eede is unbalanced. There are also other unbalanced substrings. For example, the output 2 6 will also be accepted. Sample Input 2 */ return 0; }
[ "haozx1997@users.noreply.github.com" ]
haozx1997@users.noreply.github.com
7af62679f45f6e4236d0b01547b1bafd221bf833
6490e11a0eea9fafc4ba81912740fa71d2a902f4
/SRC/domain/node/Node.cpp
ea9e0f71e461da437c4fe0ef924e019c29fe1cd5
[]
no_license
dct328/OpenSeesWithoutTcl
acbc11baac135f203ec284e56e7468726e341323
500b5979790713b1f5d751116642caba28a37d40
refs/heads/master
2020-03-17T09:06:35.296435
2018-05-15T05:34:27
2018-05-15T05:34:27
133,461,444
0
0
null
null
null
null
UTF-8
C++
false
false
54,726
cpp
/* ****************************************************************** ** ** OpenSees - Open System for Earthquake Engineering Simulation ** ** Pacific Earthquake Engineering Research Center ** ** ** ** ** ** (C) Copyright 1999, The Regents of the University of California ** ** All Rights Reserved. ** ** ** ** Commercial use of this program without express permission of the ** ** University of California, Berkeley, is strictly prohibited. See ** ** file 'COPYRIGHT' in main directory for information on usage and ** ** redistribution, and for a DISCLAIMER OF ALL WARRANTIES. ** ** ** ** Developed by: ** ** Frank McKenna (fmckenna@ce.berkeley.edu) ** ** Gregory L. Fenves (fenves@ce.berkeley.edu) ** ** Filip C. Filippou (filippou@ce.berkeley.edu) ** ** ** ** ****************************************************************** */ // $Revision: 1.31 $ // $Date: 2010-02-04 00:39:05 $ // $URL: /usr/local/cvs/OpenSees/SRC/domain/node/Node.cpp,v $ // Written: fmk // Created: 11/96 // Revision: A // // This file contains the implementation of the Node class // // What: "@(#) Node.h, revA" #include <Node.h> #include <stdlib.h> #include <Element.h> #include <Vector.h> #include <Matrix.h> #include <Channel.h> #include <FEM_ObjectBroker.h> #include <DOF_Group.h> #include <Renderer.h> #include <string.h> #include <Information.h> #include <Parameter.h> // AddingSensitivity:BEGIN ////////////////////////// #include <Domain.h> #include <Element.h> #include <ElementIter.h> #include <SP_Constraint.h> #include <SP_ConstraintIter.h> // AddingSensitivity:END //////////////////////////// #include <OPS_Globals.h> #include <elementAPI.h> Matrix **Node::theMatrices = 0; int Node::numMatrices = 0; // for FEM_Object Broker to use Node::Node(int theClassTag) :DomainComponent(0,theClassTag), numberDOF(0), theDOF_GroupPtr(0), Crd(0), commitDisp(0), commitVel(0), commitAccel(0), trialDisp(0), trialVel(0), trialAccel(0), unbalLoad(0), incrDisp(0), incrDeltaDisp(0), disp(0), vel(0), accel(0), dbTag1(0), dbTag2(0), dbTag3(0), dbTag4(0), R(0), mass(0), unbalLoadWithInertia(0), alphaM(0.0), theEigenvectors(0), index(-1), reaction(0), displayLocation(0) { // for FEM_ObjectBroker, recvSelf() must be invoked on object // AddingSensitivity:BEGIN ///////////////////////////////////////// dispSensitivity = 0; velSensitivity = 0; accSensitivity = 0; parameterID = 0; // AddingSensitivity:END /////////////////////////////////////////// } Node::Node(int tag, int theClassTag) :DomainComponent(tag,theClassTag), numberDOF(0), theDOF_GroupPtr(0), Crd(0), commitDisp(0), commitVel(0), commitAccel(0), trialDisp(0), trialVel(0), trialAccel(0), unbalLoad(0), incrDisp(0), incrDeltaDisp(0), disp(0), vel(0), accel(0), dbTag1(0), dbTag2(0), dbTag3(0), dbTag4(0), R(0), mass(0), unbalLoadWithInertia(0), alphaM(0.0), theEigenvectors(0), index(-1), reaction(0), displayLocation(0) { // for subclasses - they must implement all the methods with // their own data structures. // AddingSensitivity:BEGIN ///////////////////////////////////////// dispSensitivity = 0; velSensitivity = 0; accSensitivity = 0; parameterID = 0; // AddingSensitivity:END /////////////////////////////////////////// } Node::Node(int tag, int ndof, double Crd1, Vector *dLoc) :DomainComponent(tag,NOD_TAG_Node), numberDOF(ndof), theDOF_GroupPtr(0), Crd(0), commitDisp(0), commitVel(0), commitAccel(0), trialDisp(0), trialVel(0), trialAccel(0), unbalLoad(0), incrDisp(0), incrDeltaDisp(0), disp(0), vel(0), accel(0), dbTag1(0), dbTag2(0), dbTag3(0), dbTag4(0), R(0), mass(0), unbalLoadWithInertia(0), alphaM(0.0), theEigenvectors(0), index(-1), reaction(0), displayLocation(0) { // AddingSensitivity:BEGIN ///////////////////////////////////////// dispSensitivity = 0; velSensitivity = 0; accSensitivity = 0; parameterID = 0; // AddingSensitivity:END /////////////////////////////////////////// Crd = new Vector(1); (*Crd)(0) = Crd1; if (dLoc != 0) { displayLocation = new Vector(*dLoc); } index = -1; if (numMatrices != 0) { for (int i=0; i<numMatrices; i++) if (theMatrices[i]->noRows() == ndof) { index = i; i = numMatrices; } } if (index == -1) { Matrix **nextMatrices = new Matrix *[numMatrices+1]; if (nextMatrices == 0) { opserr << "Element::getTheMatrix - out of memory\n"; exit(-1); } for (int j=0; j<numMatrices; j++) nextMatrices[j] = theMatrices[j]; Matrix *theMatrix = new Matrix(ndof, ndof); if (theMatrix == 0) { opserr << "Element::getTheMatrix - out of memory\n"; exit(-1); } nextMatrices[numMatrices] = theMatrix; if (numMatrices != 0) delete [] theMatrices; index = numMatrices; numMatrices++; theMatrices = nextMatrices; } } // Node(int tag, int ndof, double Crd1, double yCrd); // constructor for 2d nodes Node::Node(int tag, int ndof, double Crd1, double Crd2, Vector *dLoc) :DomainComponent(tag,NOD_TAG_Node), numberDOF(ndof), theDOF_GroupPtr(0), Crd(0), commitDisp(0), commitVel(0), commitAccel(0), trialDisp(0), trialVel(0), trialAccel(0), unbalLoad(0), incrDisp(0), incrDeltaDisp(0), disp(0), vel(0), accel(0), dbTag1(0), dbTag2(0), dbTag3(0), dbTag4(0), R(0), mass(0), unbalLoadWithInertia(0), alphaM(0.0), theEigenvectors(0), reaction(0), displayLocation(0) { // AddingSensitivity:BEGIN ///////////////////////////////////////// dispSensitivity = 0; velSensitivity = 0; accSensitivity = 0; parameterID = 0; // AddingSensitivity:END /////////////////////////////////////////// Crd = new Vector(2); (*Crd)(0) = Crd1; (*Crd)(1) = Crd2; if (dLoc != 0) { displayLocation = new Vector(*dLoc); } index = -1; if (numMatrices != 0) { for (int i=0; i<numMatrices; i++) if (theMatrices[i]->noRows() == ndof) { index = i; i = numMatrices; } } if (index == -1) { Matrix **nextMatrices = new Matrix *[numMatrices+1]; if (nextMatrices == 0) { opserr << "Element::getTheMatrix - out of memory\n"; exit(-1); } for (int j=0; j<numMatrices; j++) nextMatrices[j] = theMatrices[j]; Matrix *theMatrix = new Matrix(ndof, ndof); if (theMatrix == 0) { opserr << "Element::getTheMatrix - out of memory\n"; exit(-1); } nextMatrices[numMatrices] = theMatrix; if (numMatrices != 0) delete [] theMatrices; index = numMatrices; numMatrices++; theMatrices = nextMatrices; } } // Node(int tag, int ndof, double Crd1, double Crd2, double zCrd); // constructor for 3d nodes Node::Node(int tag, int ndof, double Crd1, double Crd2, double Crd3, Vector *dLoc) :DomainComponent(tag,NOD_TAG_Node), numberDOF(ndof), theDOF_GroupPtr(0), Crd(0), commitDisp(0), commitVel(0), commitAccel(0), trialDisp(0), trialVel(0), trialAccel(0), unbalLoad(0), incrDisp(0), incrDeltaDisp(0), disp(0), vel(0), accel(0), dbTag1(0), dbTag2(0), dbTag3(0), dbTag4(0), R(0), mass(0), unbalLoadWithInertia(0), alphaM(0.0), theEigenvectors(0), reaction(0), displayLocation(0) { // AddingSensitivity:BEGIN ///////////////////////////////////////// dispSensitivity = 0; velSensitivity = 0; accSensitivity = 0; parameterID = 0; // AddingSensitivity:END /////////////////////////////////////////// Crd = new Vector(3); (*Crd)(0) = Crd1; (*Crd)(1) = Crd2; (*Crd)(2) = Crd3; if (dLoc != 0) { displayLocation = new Vector(*dLoc); } index = -1; if (numMatrices != 0) { for (int i=0; i<numMatrices; i++) if (theMatrices[i]->noRows() == ndof) { index = i; i = numMatrices; } } if (index == -1) { Matrix **nextMatrices = new Matrix *[numMatrices+1]; if (nextMatrices == 0) { opserr << "Element::getTheMatrix - out of memory\n"; exit(-1); } for (int j=0; j<numMatrices; j++) nextMatrices[j] = theMatrices[j]; Matrix *theMatrix = new Matrix(ndof, ndof); if (theMatrix == 0) { opserr << "Element::getTheMatrix - out of memory\n"; exit(-1); } nextMatrices[numMatrices] = theMatrix; if (numMatrices != 0) delete [] theMatrices; index = numMatrices; numMatrices++; theMatrices = nextMatrices; } } // used for domain decomposition & external nodes // copy everything but the mass // we should really set the mass to 0.0 Node::Node(const Node &otherNode, bool copyMass) :DomainComponent(otherNode.getTag(),otherNode.getClassTag()), numberDOF(otherNode.numberDOF), theDOF_GroupPtr(0), Crd(0), commitDisp(0), commitVel(0), commitAccel(0), trialDisp(0), trialVel(0), trialAccel(0), unbalLoad(0), incrDisp(0), incrDeltaDisp(0), disp(0), vel(0), accel(0), dbTag1(0), dbTag2(0), dbTag3(0), dbTag4(0), R(0), mass(0), unbalLoadWithInertia(0), alphaM(0.0), theEigenvectors(0), reaction(0), displayLocation(0) { // AddingSensitivity:BEGIN ///////////////////////////////////////// dispSensitivity = 0; velSensitivity = 0; accSensitivity = 0; parameterID = 0; // AddingSensitivity:END /////////////////////////////////////////// Crd = new Vector(otherNode.getCrds()); if (Crd == 0) { opserr << " FATAL Node::Node(node *) - ran out of memory for Crd\n"; exit(-1); } if (otherNode.displayLocation != 0) { displayLocation = new Vector(*(otherNode.displayLocation)); } if (otherNode.commitDisp != 0) { if (this->createDisp() < 0) { opserr << " FATAL Node::Node(node *) - ran out of memory for displacement\n"; exit(-1); } for (int i=0; i<4*numberDOF; i++) disp[i] = otherNode.disp[i]; } if (otherNode.commitVel != 0) { if (this->createVel() < 0) { opserr << " FATAL Node::Node(node *) - ran out of memory for velocity\n"; exit(-1); } for (int i=0; i<2*numberDOF; i++) vel[i] = otherNode.vel[i]; } if (otherNode.commitAccel != 0) { if (this->createAccel() < 0) { opserr << " FATAL Node::Node(node *) - ran out of memory for acceleration\n"; exit(-1); } for (int i=0; i<2*numberDOF; i++) accel[i] = otherNode.accel[i]; } if (otherNode.unbalLoad != 0){ unbalLoad = new Vector(*(otherNode.unbalLoad)); if (unbalLoad == 0) { opserr << " FATAL Node::Node(node *) - ran out of memory for Load\n"; exit(-1); } unbalLoad->Zero(); } if (otherNode.mass != 0 && copyMass == true) { mass = new Matrix(*(otherNode.mass)) ; if (mass == 0) { opserr << " FATAL Node::Node(node *) - ran out of memory for mass\n"; exit(-1); } } if (otherNode.R != 0) { R = new Matrix(*(otherNode.R)); if (R == 0) { opserr << " FATAL Node::Node(node *) - ran out of memory for R\n"; exit(-1); } } index = -1; if (numMatrices != 0) { for (int i=0; i<numMatrices; i++) if (theMatrices[i]->noRows() == numberDOF) { index = i; i = numMatrices; } } if (index == -1) { Matrix **nextMatrices = new Matrix *[numMatrices+1]; if (nextMatrices == 0) { opserr << "Element::getTheMatrix - out of memory\n"; exit(-1); } for (int j=0; j<numMatrices; j++) nextMatrices[j] = theMatrices[j]; Matrix *theMatrix = new Matrix(numberDOF, numberDOF); if (theMatrix == 0) { opserr << "Element::getTheMatrix - out of memory\n"; exit(-1); } nextMatrices[numMatrices] = theMatrix; if (numMatrices != 0) delete [] theMatrices; index = numMatrices; numMatrices++; theMatrices = nextMatrices; } } // ~Node(): // destructor Node::~Node() { // delete anything that we created with new if (Crd != 0) delete Crd; if (commitDisp != 0) delete commitDisp; if (commitVel != 0) delete commitVel; if (commitAccel != 0) delete commitAccel; if (trialDisp != 0) delete trialDisp; if (trialVel != 0) delete trialVel; if (trialAccel != 0) delete trialAccel; if (incrDisp != 0) delete incrDisp; if (incrDeltaDisp != 0) delete incrDeltaDisp; if (unbalLoad != 0) delete unbalLoad; if (disp != 0) delete [] disp; if (vel != 0) delete [] vel; if (accel != 0) delete [] accel; if (mass != 0) delete mass; if (R != 0) delete R; if (unbalLoadWithInertia != 0) delete unbalLoadWithInertia; if (theEigenvectors != 0) delete theEigenvectors; // AddingSensitivity:BEGIN /////////////////////////////////////// if (dispSensitivity != 0) delete dispSensitivity; if (velSensitivity != 0) delete velSensitivity; if (accSensitivity != 0) delete accSensitivity; // AddingSensitivity:END ///////////////////////////////////////// if (reaction != 0) delete reaction; if (displayLocation != 0) delete displayLocation; if (theDOF_GroupPtr != 0) theDOF_GroupPtr->resetNodePtr(); } int Node::getNumberDOF(void) const { // return the number of dof return numberDOF; } void Node::setDOF_GroupPtr(DOF_Group *theDOF_Grp) { // set the DOF_Group pointer theDOF_GroupPtr = theDOF_Grp; } DOF_Group * Node::getDOF_GroupPtr(void) { // return the DOF_Group pointer return theDOF_GroupPtr; } const Vector & Node::getCrds() const { // return the vector of nodal coordinates return *Crd; } const Vector & Node::getDisp(void) { // construct memory and Vectors for trial and committed // displacement on first call to this method, getTrialDisp() // setTrialDisp() or incrTrialDisp() if (commitDisp == 0) { if (this->createDisp() < 0) { opserr << "FATAL Node::getDisp() -- ran out of memory\n"; exit(-1); } } // return the committed disp return *commitDisp; } const Vector & Node::getVel(void) { // construct memory and Vectors for trial and committed // velocity on first call to this method, getTrialVel() // setTrialVel() or incrTrialVel() if (commitVel == 0) { if (this->createVel() < 0) { opserr << "FATAL Node::getVel() -- ran out of memory\n"; exit(-1); } } // return the velocity return *commitVel; } const Vector & Node::getAccel(void) { // construct memory and Vectors for trial and committed // accel on first call to this method, getTrialAccel() // setTrialAccel() or incrTrialAccel() if (commitAccel == 0) { if (this->createAccel() < 0) { opserr << "FATAL Node::getAccel() -- ran out of memory\n"; exit(-1); } } return *commitAccel; } /* ********************************************************************* ** ** Methods to return the trial response quantities similar to committed ** ** *********************************************************************/ const Vector & Node::getTrialDisp(void) { if (trialDisp == 0) { if (this->createDisp() < 0) { opserr << "FATAL Node::getTrialDisp() -- ran out of memory\n"; exit(-1); } } return *trialDisp; } const Vector & Node::getTrialVel(void) { if (trialVel == 0) { if (this->createVel() < 0) { opserr << "FATAL Node::getTrialVel() -- ran out of memory\n"; exit(-1); } } return *trialVel; } const Vector & Node::getTrialAccel(void) { if (trialAccel == 0) { if (this->createAccel() < 0) { opserr << "FATAL Node::getTrialAccel() - ran out of memory\n"; exit(0); } } return *trialAccel; } const Vector & Node::getIncrDisp(void) { if (incrDisp == 0) { if (this->createDisp() < 0) { opserr << "FATAL Node::getTrialDisp() -- ran out of memory\n"; exit(-1); } } return *incrDisp; } const Vector & Node::getIncrDeltaDisp(void) { if (incrDeltaDisp == 0) { if (this->createDisp() < 0) { opserr << "FATAL Node::getTrialDisp() -- ran out of memory\n"; exit(-1); } } return *incrDeltaDisp; } int Node::setTrialDisp(double value, int dof) { // check vector arg is of correct size if (dof < 0 || dof >= numberDOF) { opserr << "WARNING Node::setTrialDisp() - incompatable sizes\n"; opserr << "node: " << this->getTag() << endln; return -2; } // construct memory and Vectors for trial and committed // accel on first call to this method, getTrialDisp(), // getDisp(), or incrTrialDisp() if (trialDisp == 0) { if (this->createDisp() < 0) { opserr << "FATAL Node::setTrialDisp() - ran out of memory\n"; exit(-1); } } // perform the assignment .. we dont't go through Vector interface // as we are sure of size and this way is quicker double tDisp = value; disp[dof+2*numberDOF] = tDisp - disp[dof+numberDOF]; disp[dof+3*numberDOF] = tDisp - disp[dof]; disp[dof] = tDisp; return 0; } int Node::setTrialDisp(const Vector &newTrialDisp) { // check vector arg is of correct size if (newTrialDisp.Size() != numberDOF) { opserr << "WARNING Node::setTrialDisp() - incompatable sizes\n"; opserr << "node: " << this->getTag() << endln; return -2; } // construct memory and Vectors for trial and committed // accel on first call to this method, getTrialDisp(), // getDisp(), or incrTrialDisp() if (trialDisp == 0) { if (this->createDisp() < 0) { opserr << "FATAL Node::setTrialDisp() - ran out of memory\n"; exit(-1); } } // perform the assignment .. we dont't go through Vector interface // as we are sure of size and this way is quicker for (int i=0; i<numberDOF; i++) { double tDisp = newTrialDisp(i); disp[i+2*numberDOF] = tDisp - disp[i+numberDOF]; disp[i+3*numberDOF] = tDisp - disp[i]; disp[i] = tDisp; } return 0; } int Node::setTrialVel(const Vector &newTrialVel) { // check vector arg is of correct size if (newTrialVel.Size() != numberDOF) { opserr << "WARNING Node::setTrialVel() - incompatable sizes\n"; return -2; } // construct memory and Vectors for trial and committed // accel on first call to this method, getTrialVEl(), // getVEl(), or incrTrialVel() if (trialVel == 0) { if (this->createVel() < 0) { opserr << "FATAL Node::setTrialVel() - ran out of memory\n"; exit(-1); } } // set the trial quantities for (int i=0; i<numberDOF; i++) vel[i] = newTrialVel(i); return 0; } int Node::setTrialAccel(const Vector &newTrialAccel) { // check vector arg is of correct size if (newTrialAccel.Size() != numberDOF) { opserr << "WARNING Node::setTrialAccel() - incompatable sizes\n"; return -2; } // create a copy if no trial exists if (trialAccel == 0) { if (this->createAccel() < 0) { opserr << "FATAL Node::setTrialAccel() - ran out of memory\n"; exit(-1); } } // use vector assignment otherwise for (int i=0; i<numberDOF; i++) accel[i] = newTrialAccel(i); return 0; } int Node::incrTrialDisp(const Vector &incrDispl) { // check vector arg is of correct size if (incrDispl.Size() != numberDOF) { opserr << "WARNING Node::incrTrialDisp() - incompatable sizes\n"; return -2; } // create a copy if no trial exists andd add committed if (trialDisp == 0) { if (this->createDisp() < 0) { opserr << "FATAL Node::incrTrialDisp() - ran out of memory\n"; exit(-1); } for (int i = 0; i<numberDOF; i++) { double incrDispI = incrDispl(i); disp[i] = incrDispI; disp[i+2*numberDOF] = incrDispI; disp[i+3*numberDOF] = incrDispI; } return 0; } // otherwise set trial = incr + trial for (int i = 0; i<numberDOF; i++) { double incrDispI = incrDispl(i); disp[i] += incrDispI; disp[i+2*numberDOF] += incrDispI; disp[i+3*numberDOF] = incrDispI; } return 0; } int Node::incrTrialVel(const Vector &incrVel) { // check vector arg is of correct size if (incrVel.Size() != numberDOF) { opserr << "WARNING Node::incrTrialVel() - incompatable sizes\n"; return -2; } // create Vectors and array if none exist and set trial if (trialVel == 0) { if (this->createVel() < 0) { opserr << "FATAL Node::incrTrialVel - ran out of memory\n"; exit(-1); } for (int i = 0; i<numberDOF; i++) vel[i] = incrVel(i); return 0; } // otherwise set trial = incr + trial for (int i = 0; i<numberDOF; i++) vel[i] += incrVel(i); return 0; } int Node::incrTrialAccel(const Vector &incrAccel) { // check vector arg is of correct size if (incrAccel.Size() != numberDOF) { opserr << "WARNING Node::incrTrialAccel() - incompatable sizes\n"; return -2; } // create a copy if no trial exists andd add committed if (trialAccel == 0) { if (this->createAccel() < 0) { opserr << "FATAL Node::incrTrialAccel() - ran out of memory\n"; exit(-1); } for (int i = 0; i<numberDOF; i++) accel[i] = incrAccel(i); return 0; } // otherwise set trial = incr + trial for (int i = 0; i<numberDOF; i++) accel[i] += incrAccel(i); return 0; } void Node::zeroUnbalancedLoad(void) { if (unbalLoad != 0) unbalLoad->Zero(); } int Node::addUnbalancedLoad(const Vector &add, double fact) { // check vector arg is of correct size if (add.Size() != numberDOF) { opserr << "Node::addunbalLoad - load to add of incorrect size "; opserr << add.Size() << " should be " << numberDOF << endln; return -1; } // if no load yet create it and assign if (unbalLoad == 0) { unbalLoad = new Vector(add); if (unbalLoad == 0) { opserr << "FATAL Node::addunbalLoad - ran out of memory\n"; exit(-1); } if (fact != 1.0) (*unbalLoad) *= fact; return 0; } // add fact*add to the unbalanced load unbalLoad->addVector(1.0, add,fact); return 0; } int Node::addInertiaLoadToUnbalance(const Vector &accelG, double fact) { // simply return if node has no mass or R matrix if (mass == 0 || R == 0) return 0; // otherwise we must determine MR accelG if (accelG.Size() != R->noCols()) { opserr << "Node::addInertiaLoadToUnbalance - accelG not of correct dimension"; return -1; } // if no load yet create it and assign if (unbalLoad == 0) { unbalLoad = new Vector(numberDOF); if (unbalLoad == 0 || unbalLoad->Size() != numberDOF) { opserr << "FATAL Node::addunbalLoad - ran out of memory\n"; exit(-1); } } // form - fact * M*R*accelG and add it to the unbalanced load //(*unbalLoad) -= ((*mass) * (*R) * accelG)*fact; Matrix MR(mass->noRows(), R->noCols()); MR.addMatrixProduct(0.0, *mass, *R, 1.0); unbalLoad->addMatrixVector(1.0, MR, accelG, -fact); return 0; } int Node::addInertiaLoadSensitivityToUnbalance(const Vector &accelG, double fact, bool somethingRandomInMotions) { // simply return if node has no mass or R matrix if (mass == 0 || R == 0) return 0; // otherwise we must determine MR accelG if (accelG.Size() != R->noCols()) { opserr << "Node::addInertiaLoadToUnbalance - accelG not of correct dimension"; return -1; } // if no load yet create it and assign if (unbalLoad == 0) { unbalLoad = new Vector(numberDOF); if (unbalLoad == 0 || unbalLoad->Size() != numberDOF) { opserr << "FATAL Node::addunbalLoad - ran out of memory\n"; exit(-1); } } // form - fact * M*R*accelG and add it to the unbalanced load //(*unbalLoad) -= ((*mass) * (*R) * accelG)*fact; Matrix massSens(mass->noRows(),mass->noCols()); massSens = this->getMassSensitivity(); Matrix MR(mass->noRows(), R->noCols()); if (somethingRandomInMotions) { MR.addMatrixProduct(0.0, *mass, *R, 1.0); } else { MR.addMatrixProduct(0.0, massSens, *R, 1.0); } unbalLoad->addMatrixVector(1.0, MR, accelG, -fact); return 0; } const Vector & Node::getUnbalancedLoad(void) { // make sure it was created before we return it if (unbalLoad == 0) { unbalLoad = new Vector(numberDOF); if (unbalLoad == 0 || unbalLoad->Size() != numberDOF) { opserr << "FATAL Node::getunbalLoad() -- ran out of memory\n"; exit(-1); } } // return the unbalanced load return *unbalLoad; } const Vector & Node::getUnbalancedLoadIncInertia(void) { // make sure it was created before we return it if (unbalLoadWithInertia == 0) { unbalLoadWithInertia = new Vector(this->getUnbalancedLoad()); if (unbalLoadWithInertia == 0) { opserr << "FATAL Node::getunbalLoadWithInertia -- ran out of memory\n"; exit(-1); } } else (*unbalLoadWithInertia) = this->getUnbalancedLoad(); if (mass != 0) { const Vector &theAccel = this->getTrialAccel(); // in case accel not created unbalLoadWithInertia->addMatrixVector(1.0, *mass, theAccel, -1.0); if (alphaM != 0.0) { const Vector &theVel = this->getTrialVel(); // in case vel not created unbalLoadWithInertia->addMatrixVector(1.0, *mass, theVel, -alphaM); } } return *unbalLoadWithInertia; } int Node::commitState() { // check disp exists, if does set commit = trial, incr = 0.0 if (trialDisp != 0) { for (int i=0; i<numberDOF; i++) { disp[i+numberDOF] = disp[i]; disp[i+2*numberDOF] = 0.0; disp[i+3*numberDOF] = 0.0; } } // check vel exists, if does set commit = trial if (trialVel != 0) { for (int i=0; i<numberDOF; i++) vel[i+numberDOF] = vel[i]; } // check accel exists, if does set commit = trial if (trialAccel != 0) { for (int i=0; i<numberDOF; i++) accel[i+numberDOF] = accel[i]; } // if we get here we are done return 0; } int Node::revertToLastCommit() { // check disp exists, if does set trial = last commit, incr = 0 if (disp != 0) { for (int i=0 ; i<numberDOF; i++) { disp[i] = disp[i+numberDOF]; disp[i+2*numberDOF] = 0.0; disp[i+3*numberDOF] = 0.0; } } // check vel exists, if does set trial = last commit if (vel != 0) { for (int i=0 ; i<numberDOF; i++) vel[i] = vel[numberDOF+i]; } // check accel exists, if does set trial = last commit if (accel != 0) { for (int i=0 ; i<numberDOF; i++) accel[i] = accel[numberDOF+i]; } // if we get here we are done return 0; } int Node::revertToStart() { // check disp exists, if does set all to zero if (disp != 0) { for (int i=0 ; i<4*numberDOF; i++) disp[i] = 0.0; } // check vel exists, if does set all to zero if (vel != 0) { for (int i=0 ; i<2*numberDOF; i++) vel[i] = 0.0; } // check accel exists, if does set all to zero if (accel != 0) { for (int i=0 ; i<2*numberDOF; i++) accel[i] = 0.0; } if (unbalLoad != 0) (*unbalLoad) *= 0; // AddingSensitivity: BEGIN ///////////////////////////////// if (dispSensitivity != 0) dispSensitivity->Zero(); if (velSensitivity != 0) velSensitivity->Zero(); if (accSensitivity != 0) accSensitivity->Zero(); // AddingSensitivity: END /////////////////////////////////// // if we get here we are done return 0; } const Matrix & Node::getMass(void) { // make sure it was created before we return it if (mass == 0) { theMatrices[index]->Zero(); return *theMatrices[index]; } else return *mass; } int Node::setRayleighDampingFactor(double alpham) { alphaM = alpham; return 0; } const Matrix & Node::getDamp(void) { // make sure it was created before we return it if (mass == 0 || alphaM == 0.0) { theMatrices[index]->Zero(); return *theMatrices[index]; } else { Matrix &result = *theMatrices[index]; result = *mass; result *= alphaM; return result; } } const Matrix & Node::getDampSensitivity(void) { // make sure it was created before we return it if (mass == 0 || alphaM == 0.0) { theMatrices[index]->Zero(); return *theMatrices[index]; } else { Matrix &result = *theMatrices[index]; result.Zero(); //result = *mass; //result *= alphaM; return result; } } int Node::setMass(const Matrix &newMass) { // check right size if (newMass.noRows() != numberDOF || newMass.noCols() != numberDOF) { opserr << "Node::setMass - incompatable matrices\n"; return -1; } // create a matrix if no mass yet set if (mass == 0) { mass = new Matrix(newMass); if (mass == 0 || mass->noRows() != numberDOF) { opserr << "FATAL Node::setMass - ran out of memory\n"; return -1; } return 0; } // assign if mass has already been created (*mass) = newMass; return 0; } int Node::setNumColR(int numCol) { if (R != 0) { if (R->noCols() != numCol) { delete R; R = new Matrix(numberDOF, numCol); } } else R = new Matrix(numberDOF, numCol); if (R == 0 || R->noRows() != numberDOF) { opserr << "FATAL Node::setNumColR() - out of memory\n"; exit(-1); } R->Zero(); return 0; } int Node::setR(int row, int col, double Value) { // ensure R had been set if (R == 0) { opserr << "Node:setR() - R has not been initialised\n"; return -1; } // ensure row, col in range (matrix assignment will catch this - extra work) if (row < 0 || row > numberDOF || col < 0 || col > R->noCols()) { opserr << "Node:setR() - row, col index out of range\n"; return -1; } // do the assignment (*R)(row,col) = Value; /* // to test uniform excitation pattern with consistent mass matrices: // found that the static application of a unit ground displacement // needs to also be applied to the constrained DOFs Domain *theDomain = this->getDomain(); SP_ConstraintIter &theSPs = theDomain->getSPs(); SP_Constraint *theSP; // assign zero if there is a homogeneous SP while ((theSP = theSPs()) != 0) { if (theSP->getNodeTag() == this->getTag() && theSP->getDOF_Number() == row && theSP->isHomogeneous()) { (*R)(row,col) = 0.0; } } */ return 0; } const Vector & Node::getRV(const Vector &V) { // we store the product of RV in unbalLoadWithInertia // make sure unbalLoadWithInertia was created, if not create it if (unbalLoadWithInertia == 0) { unbalLoadWithInertia = new Vector(numberDOF); if (unbalLoadWithInertia == 0) { opserr << "Node::getunbalLoadWithInertia -- ran out of memory\n"; exit(-1); } } // see if quick return , i.e. R == 0 if (R == 0) { unbalLoadWithInertia->Zero(); return *unbalLoadWithInertia; } // check dimesions of R and V if (R->noCols() != V.Size()) { opserr << "WARNING Node::getRV() - R and V of incompatable dimesions\n"; opserr << "R: " << *R << "V: " << V; unbalLoadWithInertia->Zero(); return *unbalLoadWithInertia; } // determine the product unbalLoadWithInertia->addMatrixVector(0.0, *R, V, 1.0); return *unbalLoadWithInertia; } int Node::setNumEigenvectors(int numVectorsToStore) { // ensure a positive number of vectors if (numVectorsToStore <= 0) { opserr << "Node::setNumEigenvectors() - " << numVectorsToStore << " < 0\n"; return -1; } // if matrix not yet assigned or not of correct size delete old and create new if (theEigenvectors == 0 || theEigenvectors->noCols() != numVectorsToStore) { if (theEigenvectors != 0) delete theEigenvectors; theEigenvectors = new Matrix(numberDOF, numVectorsToStore); if (theEigenvectors == 0 || theEigenvectors->noCols() != numVectorsToStore) { opserr << "Node::setNumEigenvectors() - out of memory\n"; return -2; } } else // zero the eigenvector matrix theEigenvectors->Zero(); return 0; } int Node::setEigenvector(int mode, const Vector &eigenVector) { if (theEigenvectors == 0 || theEigenvectors->noCols() < mode) { opserr << "Node::setEigenvectors() - mode " << mode << " invalid\n"; return -1; } if (eigenVector.Size() != numberDOF) { opserr << "Node::setEigenvectors() - eigenvector of incorrect size\n"; return -2; } // set the values for (int i=0; i<numberDOF; i++) (*theEigenvectors)(i, mode-1) = eigenVector(i); return 0; } const Matrix & Node::getEigenvectors(void) { // check the eigen vectors have been set if (theEigenvectors == 0) { opserr << "Node::getEigenvectors() - eigenvectors have not been set\n"; exit(0); } return *theEigenvectors; } int Node::sendSelf(int cTag, Channel &theChannel) { int dataTag = this->getDbTag(); ID data(14); data(0) = this->getTag(); data(1) = numberDOF; // indicate whether vector quantaties have been formed if (disp == 0) data(2) = 1; else data(2) = 0; if (vel == 0) data(3) = 1; else data(3) = 0; if (accel == 0) data(4) = 1; else data(4) = 0; if (mass == 0) data(5) = 1; else data(5) = 0; if (unbalLoad == 0) data(6) = 1; else data(6) = 0; if (R == 0) data(12) = 1; else { data(12) = 0; data(13) = R->noCols(); } data(7) = Crd->Size(); if (dbTag1 == 0) dbTag1 = theChannel.getDbTag(); if (dbTag2 == 0) dbTag2 = theChannel.getDbTag(); if (dbTag3 == 0) dbTag3 = theChannel.getDbTag(); if (dbTag4 == 0) dbTag4 = theChannel.getDbTag(); data(8) = dbTag1; data(9) = dbTag2; data(10) = dbTag3; data(11) = dbTag4; int res = 0; res = theChannel.sendID(dataTag, cTag, data); if (res < 0) { opserr << " Node::sendSelf() - failed to send ID data\n"; return res; } res = theChannel.sendVector(dataTag, cTag, *Crd); if (res < 0) { opserr << " Node::sendSelf() - failed to send Vecor data\n"; return res; } if (commitDisp != 0) { res = theChannel.sendVector(dbTag1, cTag, *commitDisp); if (res < 0) { opserr << " Node::sendSelf() - failed to send Disp data\n"; return res; } } if (commitVel != 0) { res = theChannel.sendVector(dbTag2, cTag, *commitVel); if (res < 0) { opserr << " Node::sendSelf() - failed to send Vel data\n"; return res; } } if (commitAccel != 0) { res = theChannel.sendVector(dbTag3, cTag, *commitAccel); if (res < 0) { opserr << " Node::sendSelf() - failed to send Accel data\n"; return res; } } if (mass != 0) { res = theChannel.sendMatrix(dataTag, cTag, *mass); if (res < 0) { opserr << " Node::sendSelf() - failed to send Mass data\n"; return res; } } if (R != 0) { res = theChannel.sendMatrix(dataTag, cTag, *R); if (res < 0) { opserr << " Node::sendSelf() - failed to send R data\n"; return res; } } if (unbalLoad != 0) { res = theChannel.sendVector(dbTag4, cTag, *unbalLoad); if (res < 0) { opserr << " Node::sendSelf() - failed to send Load data\n"; return res; } } // if get here succesfull return 0; } int Node::recvSelf(int cTag, Channel &theChannel, FEM_ObjectBroker &theBroker) { int res = 0; int dataTag = this->getDbTag(); ID data(14); res = theChannel.recvID(dataTag, cTag, data); if (res < 0) { opserr << "Node::recvSelf() - failed to receive ID data\n"; return res; } this->setTag(data(0)); numberDOF = data(1); int numberCrd = data(7); dbTag1 = data(8); dbTag2 = data(9); dbTag3 = data(10); dbTag4 = data(11); // create a Vector to hold coordinates IF one needed if (Crd == 0) { Crd = new Vector(numberCrd); } // check we did not run out of memory if (Crd == 0) { opserr << "Node::recvSelf() - out of memory creating Coordinate vector\n"; return -1; } if (theChannel.recvVector(dataTag, cTag, *Crd) < 0) { opserr << "Node::recvSelf() - failed to receive the Coordinate vector\n"; return -2; } if (data(2) == 0) { // create the disp vectors if node is a total blank if (commitDisp == 0) this->createDisp(); // recv the committed disp if (theChannel.recvVector(dbTag1, cTag, *commitDisp) < 0) { opserr << "Node::recvSelf - failed to receive Disp data\n"; return res; } // set the trial quantities equal to committed for (int i=0; i<numberDOF; i++) disp[i] = disp[i+numberDOF]; // set trial equal commited } else if (commitDisp != 0) { // if going back to initial we will just zero the vectors commitDisp->Zero(); trialDisp->Zero(); } if (data(3) == 0) { // create the vel vectors if node is a total blank if (commitVel == 0) this->createVel(); // recv the committed vel if (theChannel.recvVector(dbTag2, cTag, *commitVel) < 0) { opserr << "Node::recvSelf - failed to receive Velocity data\n"; return -3; } // set the trial quantity for (int i=0; i<numberDOF; i++) vel[i] = vel[i+numberDOF]; // set trial equal commited } if (data(4) == 0) { // create the vel vectors if node is a total blank if (commitAccel == 0) this->createAccel(); // recv the committed accel if (theChannel.recvVector(dbTag3, cTag, *commitAccel) < 0) { opserr << "Node::recvSelf - failed to receive Acceleration data\n"; return -4; } // set the trial values for (int i=0; i<numberDOF; i++) accel[i] = accel[i+numberDOF]; // set trial equal commited } if (data(5) == 0) { // make some room and read in the vector if (mass == 0) { mass = new Matrix(numberDOF,numberDOF); if (mass == 0) { opserr << "Node::recvData -- ran out of memory\n"; return -5; } } if (theChannel.recvMatrix(dataTag, cTag, *mass) < 0) { opserr << "Node::recvSelf() - failed to receive Mass data\n"; return -6; } } if (data(12) == 0) { // create a matrix for R int noCols = data(13); if (R == 0) { R = new Matrix(numberDOF, noCols); if (R == 0) { opserr << "Node::recvData -- ran out of memory\n"; return -1; } } // now recv the R matrix if (theChannel.recvMatrix(dataTag, cTag, *R) < 0) { opserr << "Node::recvSelf() - failed to receive R data\n"; return res; } } if (data(6) == 0) { // create a vector for the load if (unbalLoad == 0) { unbalLoad = new Vector(numberDOF); if (unbalLoad == 0) { opserr << "Node::recvData -- ran out of memory\n"; return -10; } } if (theChannel.recvVector(dbTag4, cTag, *unbalLoad) < 0) { opserr << "Node::recvSelf() - failed to receive Load data\n"; return res; } } index = -1; if (numMatrices != 0) { for (int i=0; i<numMatrices; i++) if (theMatrices[i]->noRows() == numberDOF) { index = i; i = numMatrices; } } if (index == -1) { Matrix **nextMatrices = new Matrix *[numMatrices+1]; if (nextMatrices == 0) { opserr << "Element::getTheMatrix - out of memory\n"; exit(-1); } for (int j=0; j<numMatrices; j++) nextMatrices[j] = theMatrices[j]; Matrix *theMatrix = new Matrix(numberDOF, numberDOF); if (theMatrix == 0) { opserr << "Element::getTheMatrix - out of memory\n"; exit(-1); } nextMatrices[numMatrices] = theMatrix; if (numMatrices != 0) delete [] theMatrices; index = numMatrices; numMatrices++; theMatrices = nextMatrices; } return 0; } void Node::Print(OPS_Stream &s, int flag) { if (flag == 0) { // print out everything s << "\n Node: " << this->getTag() << endln; s << "\tCoordinates : " << *Crd; if (commitDisp != 0) s << "\tDisps: " << *trialDisp; if (commitVel != 0) s << "\tVelocities : " << *trialVel; if (commitAccel != 0) s << "\tcommitAccels: " << *trialAccel; if (unbalLoad != 0) s << "\t unbalanced Load: " << *unbalLoad; if (reaction != 0) s << "\t reaction: " << *reaction; if (mass != 0) { s << "\tMass : " << *mass; s << "\t Rayleigh Factor: alphaM: " << alphaM << endln; s << "\t Rayleigh Forces: " << *this->getResponse(RayleighForces); } if (theEigenvectors != 0) s << "\t Eigenvectors: " << *theEigenvectors; if (theDOF_GroupPtr != 0) s << "\tID : " << theDOF_GroupPtr->getID(); s << "\n"; } else if (flag == 1) { // print out: nodeId displacements s << this->getTag() << " " << *commitDisp; } } int Node::displaySelf(Renderer &theRenderer, int displayMode, float fact) { if (displayMode == 0) return 0; // const Vector &theDisp = this->getDisp(); static Vector position(3); this->getDisplayCrds(position, fact); if (displayMode == -1) { // draw a text string containing tag static char theText[20]; sprintf(theText,"%d",this->getTag()); return theRenderer.drawText(position, theText, strlen(theText)); } else if (displayMode > 0) { // draw a point - pixel size equals displayMode tag return theRenderer.drawPoint(position, 0.0, displayMode); } return 0; } // createDisp(), createVel() and createAccel(): // private methods to create the arrays to hold the disp, vel and acceleration // values and the Vector objects for the committed and trial quantaties. int Node::createDisp(void) { // trial , committed, incr = (committed-trial) disp = new double[4*numberDOF]; if (disp == 0) { opserr << "WARNING - Node::createDisp() ran out of memory for array of size " << 2*numberDOF << endln; return -1; } for (int i=0; i<4*numberDOF; i++) disp[i] = 0.0; commitDisp = new Vector(&disp[numberDOF], numberDOF); trialDisp = new Vector(disp, numberDOF); incrDisp = new Vector(&disp[2*numberDOF], numberDOF); incrDeltaDisp = new Vector(&disp[3*numberDOF], numberDOF); if (commitDisp == 0 || trialDisp == 0 || incrDisp == 0 || incrDeltaDisp == 0) { opserr << "WARNING - Node::createDisp() " << "ran out of memory creating Vectors(double *,int)"; return -2; } return 0; } int Node::createVel(void) { vel = new double[2*numberDOF]; if (vel == 0) { opserr << "WARNING - Node::createVel() ran out of memory for array of size " << 2*numberDOF << endln; return -1; } for (int i=0; i<2*numberDOF; i++) vel[i] = 0.0; commitVel = new Vector(&vel[numberDOF], numberDOF); trialVel = new Vector(vel, numberDOF); if (commitVel == 0 || trialVel == 0) { opserr << "WARNING - Node::createVel() %s" << "ran out of memory creating Vectors(double *,int) \n"; return -2; } return 0; } int Node::createAccel(void) { accel = new double[2*numberDOF]; if (accel == 0) { opserr << "WARNING - Node::createAccel() ran out of memory for array of size " << 2*numberDOF << endln; return -1; } for (int i=0; i<2*numberDOF; i++) accel[i] = 0.0; commitAccel = new Vector(&accel[numberDOF], numberDOF); trialAccel = new Vector(accel, numberDOF); if (commitAccel == 0 || trialAccel == 0) { opserr << "WARNING - Node::createAccel() ran out of memory creating Vectors(double *,int)\n"; return -2; } return 0; } // AddingSensitivity:BEGIN /////////////////////////////////////// Matrix Node::getMassSensitivity(void) { if (mass == 0) { theMatrices[index]->Zero(); return *theMatrices[index]; } else { Matrix massSens(mass->noRows(),mass->noCols()); if ( (parameterID == 1) || (parameterID == 2) || (parameterID == 3) ) { massSens(parameterID-1,parameterID-1) = 1.0; } if (parameterID == 7) { massSens(0,0) = 1.0; massSens(1,1) = 1.0; } if (parameterID == 8) { massSens(0,0) = 1.0; massSens(1,1) = 1.0; massSens(2,2) = 1.0; } return massSens; } } int Node::getCrdsSensitivity(void) { if ( (parameterID == 4) || (parameterID == 5) || (parameterID == 6) ) { return (parameterID-3); } else { return 0; } } int Node::setParameter(const char **argv, int argc, Parameter &param) { // The following parameterID map is being used: // 1: nodal mass in direction 1 // 2: nodal mass in direction 2 // 3: nodal mass in direction 3 // 4: coordinate in direction 1 // 5: coordinate in direction 2 // 6: coordinate in direction 3 if (argc < 2) return -1; if ((strstr(argv[0],"mass") != 0) || (strstr(argv[0],"-mass") != 0)) { int direction = 0; // atoi(argv[1]); if ((strcmp(argv[1],"x") == 0)||(strcmp(argv[1],"X") == 0)||(strcmp(argv[1],"1") == 0)) { direction = 1; if (mass != 0) param.setValue((*mass)(0,0)); } else if ((strcmp(argv[1],"y") == 0)||(strcmp(argv[1],"Y") == 0)||(strcmp(argv[1],"2") == 0)) { direction = 2; if (mass != 0) param.setValue((*mass)(1,1)); } else if ((strcmp(argv[1],"z") == 0)||(strcmp(argv[1],"Z") == 0)||(strcmp(argv[1],"3") == 0)) { direction = 3; if (mass != 0) param.setValue((*mass)(2,2)); } else if ((strcmp(argv[1],"xy") == 0)||(strcmp(argv[1],"XY") == 0)) { direction = 7; if (mass != 0) param.setValue((*mass)(0,0)); } else if ((strcmp(argv[1],"xyz") == 0)||(strcmp(argv[1],"XYZ") == 0)) { direction = 8; if (mass != 0) param.setValue((*mass)(0,0)); } if ((direction >= 1 && direction <= 3) || direction == 7 || direction == 8) return param.addObject(direction, this); } else if (strstr(argv[0],"coord") != 0) { int direction = atoi(argv[1]); if (direction >= 1 && direction <= 3) { if (Crd != 0) param.setValue((*Crd)(direction-1)); return param.addObject(direction+3, this); } } else opserr << "WARNING: Could not set parameter in Node. " << endln; return -1; } int Node::updateParameter(int pparameterID, Information &info) { if (pparameterID >= 1 && pparameterID <= 3) (*mass)(pparameterID-1,pparameterID-1) = info.theDouble; else if (pparameterID == 7) { (*mass)(0,0) = info.theDouble; (*mass)(1,1) = info.theDouble; } else if (pparameterID == 8) { (*mass)(0,0) = info.theDouble; (*mass)(1,1) = info.theDouble; (*mass)(2,2) = info.theDouble; } else if (pparameterID >= 4 && pparameterID <= 6) { if ( (*Crd)(pparameterID-4) != info.theDouble) { // Set the new coordinate value (*Crd)(pparameterID-4) = info.theDouble; // Need to "setDomain" to make the change take effect. Domain *theDomain = this->getDomain(); ElementIter &theElements = theDomain->getElements(); Element *theElement; while ((theElement = theElements()) != 0) { theElement->setDomain(theDomain); } } else { // No change in nodal coordinate } } return -1; } int Node::activateParameter(int passedParameterID) { parameterID = passedParameterID; return 0; } int Node::saveDispSensitivity(const Vector &v, int gradIndex, int numGrads) { // If the sensitivity matrices are not already created: if (dispSensitivity == 0) { dispSensitivity = new Matrix( numberDOF, numGrads ); } if (dispSensitivity->noRows() != numberDOF || dispSensitivity->noCols() != numGrads) { delete dispSensitivity; dispSensitivity = new Matrix( numberDOF, numGrads ); } //opserr << "Node::saveDispSens " << dispSensitivity->noRows() << ' ' << dispSensitivity->noCols() << endln; for (int i=0; i<numberDOF; i++ ) (*dispSensitivity)(i,gradIndex) = v(i); return 0; } int Node::saveVelSensitivity(const Vector &vdot, int gradIndex, int numGrads) { // If the sensitivity matrices are not already created: if (velSensitivity == 0) { velSensitivity = new Matrix( numberDOF, numGrads ); } for (int i=0; i<numberDOF; i++ ) (*velSensitivity)(i,gradIndex) = vdot(i); return 0; } int Node::saveAccelSensitivity(const Vector &vdotdot, int gradIndex, int numGrads) { // If the sensitivity matrices are not already created: if (accSensitivity == 0) { accSensitivity = new Matrix( numberDOF, numGrads ); } for (int i=0; i<numberDOF; i++ ) (*accSensitivity)(i,gradIndex) = vdotdot(i); return 0; } double Node::getDispSensitivity(int dof, int gradIndex) { if (dispSensitivity != 0) return (*dispSensitivity)(dof-1,gradIndex); else return 0.0; } double Node::getVelSensitivity(int dof, int gradIndex) { if (velSensitivity != 0) return (*velSensitivity)(dof-1,gradIndex); else return 0.0; } double Node::getAccSensitivity(int dof, int gradIndex) { if (accSensitivity != 0) return (*accSensitivity)(dof-1,gradIndex); else return 0.0; } // AddingSensitivity:END ///////////////////////////////////////// const Vector & Node::getReaction() { if (reaction == 0) { reaction = new Vector(numberDOF); if (reaction == 0) { opserr << "FATAL Node::getReaction() - out of memory\n"; exit(-1); } } return *reaction; } int Node::addReactionForce(const Vector &add, double factor){ // create rection vector if have not done so already if (reaction == 0) { reaction = new Vector(numberDOF); if (reaction == 0) { opserr << "WARNING Node::addReactionForce() - out of memory\n"; return -1; } } // check vector of appropraie size if (add.Size() != numberDOF) { opserr << "WARNING Node::addReactionForce() - vector not of correct size\n"; return -1; } if (factor == 1.0) *reaction += add; else if (factor == -1.0) *reaction -= add; else *reaction = add * factor; return 0; } int Node::resetReactionForce(int flag){ // create rection vector if have not done so already if (reaction == 0) { reaction = new Vector(numberDOF); if (reaction == 0) { opserr << "WARNING Node::addReactionForce() - out of memory\n"; return -1; } } reaction->Zero(); // add unbalance, the negative of applied forces hence the -= if (flag == 0) { *reaction -= this->getUnbalancedLoad(); } if (flag == 1) { *reaction -= this->getUnbalancedLoadIncInertia(); } else { if (mass != 0 && alphaM != 0) { if (alphaM != 0.0) { const Vector &theVel = this->getTrialVel(); // in case vel not created reaction->addMatrixVector(1.0, *mass, theVel, alphaM); } } } return 0; } const Vector * Node::getResponse(NodeResponseType responseType) { const Vector *result = NULL; if (responseType == Disp) result = &(this->getDisp()); else if (responseType == Vel) return &(this->getVel()); else if (responseType == Accel) return &(this->getAccel()); else if (responseType == IncrDisp) return &(this->getIncrDisp()); else if (responseType == IncrDeltaDisp) return &(this->getIncrDeltaDisp()); else if (responseType == Reaction) return &(this->getReaction()); else if (responseType == Unbalance) return &(this->getUnbalancedLoad()); else if (responseType == RayleighForces) { if (unbalLoadWithInertia == 0) { unbalLoadWithInertia = new Vector(this->getUnbalancedLoad()); } if (alphaM != 0.0 && mass != 0) { const Vector &theVel = this->getTrialVel(); // in case vel not created unbalLoadWithInertia->addMatrixVector(0.0, *mass, theVel, -alphaM); } else unbalLoadWithInertia->Zero(); return unbalLoadWithInertia; } else return NULL; return result; } void Node::setCrds(double Crd1) { if (Crd != 0 && Crd->Size() >= 1) (*Crd)(0) = Crd1; // Need to "setDomain" to make the change take effect. Domain *theDomain = this->getDomain(); ElementIter &theElements = theDomain->getElements(); Element *theElement; while ((theElement = theElements()) != 0) { theElement->setDomain(theDomain); } } void Node::setCrds(double Crd1, double Crd2) { if (Crd != 0 && Crd->Size() >= 2) { (*Crd)(0) = Crd1; (*Crd)(1) = Crd2; // Need to "setDomain" to make the change take effect. Domain *theDomain = this->getDomain(); ElementIter &theElements = theDomain->getElements(); Element *theElement; while ((theElement = theElements()) != 0) { theElement->setDomain(theDomain); } } } void Node::setCrds(double Crd1, double Crd2, double Crd3) { if (Crd != 0 && Crd->Size() >= 3) { (*Crd)(0) = Crd1; (*Crd)(1) = Crd2; (*Crd)(2) = Crd3; // Need to "setDomain" to make the change take effect. Domain *theDomain = this->getDomain(); ElementIter &theElements = theDomain->getElements(); Element *theElement; while ((theElement = theElements()) != 0) { theElement->setDomain(theDomain); } } } void Node::setCrds(const Vector &newCrds) { if (Crd != 0 && Crd->Size() == newCrds.Size()) { (*Crd) = newCrds; return; // Need to "setDomain" to make the change take effect. Domain *theDomain = this->getDomain(); ElementIter &theElements = theDomain->getElements(); Element *theElement; while ((theElement = theElements()) != 0) { theElement->setDomain(theDomain); } } } int Node::getDisplayCrds(Vector &res, double fact) { int ndm = Crd->Size(); int resSize = res.Size(); if (resSize < ndm) return -1; if (commitDisp != 0) { if (displayLocation != 0) for (int i=0; i<ndm; i++) res(i) = (*displayLocation)(i)+(*commitDisp)(i)*fact; else for (int i=0; i<ndm; i++) res(i) = (*Crd)(i)+(*commitDisp)(i)*fact; } else { if (displayLocation != 0) for (int i=0; i<ndm; i++) res(i) = (*displayLocation)(i); else for (int i=0; i<ndm; i++) res(i) = (*Crd)(i); } // zero rest for (int i=ndm; i<resSize; i++) res(i) = 0; return 0; } int Node::setDisplayCrds(const Vector &theCrds) { if (theCrds.Size() != Crd->Size()) { return -1; } if (displayLocation == 0) { displayLocation = new Vector(theCrds); } else { *displayLocation = theCrds; } return 0; }
[ "cdin0003@MU00059029.AD.MONASH.EDU" ]
cdin0003@MU00059029.AD.MONASH.EDU
fe13e8e76e5eef1f43c1c327e6618245a59ce3cb
3d91ea4f9b6741e2eaa59a141937a9a031314ad3
/Counteract_V2/mainwindow.h
aa8f393aa5da49a6c1d468fbb7c63607d9298ce6
[]
no_license
nicolasveilleux/catest
c873bbe96db1a9f00bb9a0dff09e733dadcce0f8
42308f637692f922e1d5b6d5a442daed8d519020
refs/heads/master
2020-12-08T09:01:53.361124
2016-08-31T02:10:38
2016-08-31T02:10:38
66,982,275
0
0
null
null
null
null
UTF-8
C++
false
false
1,631
h
#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include <qproxystyle.h> #include <QStyleOptionTab> namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); private slots: void on_pushButton_pressed(); void on_pushButton_2_pressed(); void on_pushButton_4_pressed(); void on_pushButton_5_pressed(); void on_listView_clicked(const QModelIndex &index); void update(); void on_tabWidget_tabBarClicked(int index); void on_pushButton_3_clicked(); private: Ui::MainWindow *ui; }; class CustomTabStyle : public QProxyStyle { public: QSize sizeFromContents(ContentsType type, const QStyleOption *option, const QSize &size, const QWidget *widget) const { QSize s = QProxyStyle::sizeFromContents(type, option, size, widget); if (type == QStyle::CT_TabBarTab) s.transpose(); return s; } void drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const { if (element == CE_TabBarTabLabel) { if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(option)) { QStyleOptionTab opt(*tab); opt.shape = QTabBar::RoundedNorth; QProxyStyle::drawControl(element, &opt, painter, widget); return; } } QProxyStyle::drawControl(element, option, painter, widget); } }; #endif // MAINWINDOW_H
[ "nicolas.veilleux.1@gmail.com" ]
nicolas.veilleux.1@gmail.com
70c554022f7c2a9706b345752723eb06af667305
68cf5321d0b94ba36a78aca8c4bff41eb99f8852
/src/anki/gr/vulkan/CommandBufferImpl.h
c0d62d7b826ce58e842b44b05ac911a69f39de2d
[ "BSD-2-Clause", "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference" ]
permissive
JustinNoland24/anki-3d-engine
4a8a93379b4680f4939ba449a62467f24d956e00
c7b662308cd1b32608de659ace11b257108fe9ac
refs/heads/master
2020-12-08T00:02:58.054043
2019-12-24T08:25:37
2019-12-24T08:25:37
null
0
0
null
null
null
null
UTF-8
C++
false
false
15,603
h
// Copyright (C) 2009-2019, Panagiotis Christopoulos Charitos and contributors. // All rights reserved. // Code licensed under the BSD License. // http://www.anki3d.org/LICENSE #pragma once #include <anki/gr/CommandBuffer.h> #include <anki/gr/vulkan/VulkanObject.h> #include <anki/gr/vulkan/CommandBufferFactory.h> #include <anki/gr/CommandBuffer.h> #include <anki/gr/Texture.h> #include <anki/gr/Buffer.h> #include <anki/gr/Shader.h> #include <anki/gr/vulkan/BufferImpl.h> #include <anki/gr/vulkan/TextureImpl.h> #include <anki/gr/vulkan/Pipeline.h> #include <anki/gr/vulkan/GrManagerImpl.h> #include <anki/util/List.h> namespace anki { #define ANKI_BATCH_COMMANDS 1 // Forward class CommandBufferInitInfo; /// @addtogroup vulkan /// @{ #define ANKI_CMD(x_, t_) \ flushBatches(CommandBufferCommandType::t_); \ x_; /// List the commands that can be batched. enum class CommandBufferCommandType : U8 { SET_BARRIER, RESET_OCCLUSION_QUERY, WRITE_QUERY_RESULT, PUSH_SECOND_LEVEL, ANY_OTHER_COMMAND }; /// Command buffer implementation. class CommandBufferImpl final : public CommandBuffer, public VulkanObject<CommandBuffer, CommandBufferImpl> { public: /// Default constructor CommandBufferImpl(GrManager* manager, CString name) : CommandBuffer(manager, name) { } ~CommandBufferImpl(); ANKI_USE_RESULT Error init(const CommandBufferInitInfo& init); void setFence(MicroFencePtr& fence) { m_microCmdb->setFence(fence); } VkCommandBuffer getHandle() const { ANKI_ASSERT(m_handle); return m_handle; } Bool renderedToDefaultFramebuffer() const { return m_renderedToDefaultFb; } Bool isEmpty() const { return m_empty; } Bool isSecondLevel() const { return !!(m_flags & CommandBufferFlag::SECOND_LEVEL); } void bindVertexBuffer(U32 binding, BufferPtr buff, PtrSize offset, PtrSize stride, VertexStepRate stepRate) { commandCommon(); m_state.bindVertexBuffer(binding, stride, stepRate); VkBuffer vkbuff = static_cast<const BufferImpl&>(*buff).getHandle(); ANKI_CMD(vkCmdBindVertexBuffers(m_handle, binding, 1, &vkbuff, &offset), ANY_OTHER_COMMAND); m_microCmdb->pushObjectRef(buff); } void setVertexAttribute(U32 location, U32 buffBinding, const Format fmt, PtrSize relativeOffset) { commandCommon(); m_state.setVertexAttribute(location, buffBinding, fmt, relativeOffset); } void bindIndexBuffer(BufferPtr buff, PtrSize offset, IndexType type) { commandCommon(); ANKI_CMD(vkCmdBindIndexBuffer( m_handle, static_cast<const BufferImpl&>(*buff).getHandle(), offset, convertIndexType(type)), ANY_OTHER_COMMAND); m_microCmdb->pushObjectRef(buff); } void setPrimitiveRestart(Bool enable) { commandCommon(); m_state.setPrimitiveRestart(enable); } void setFillMode(FillMode mode) { commandCommon(); m_state.setFillMode(mode); } void setCullMode(FaceSelectionBit mode) { commandCommon(); m_state.setCullMode(mode); } void setViewport(U32 minx, U32 miny, U32 width, U32 height) { ANKI_ASSERT(width > 0 && height > 0); commandCommon(); if(m_viewport[0] != minx || m_viewport[1] != miny || m_viewport[2] != width || m_viewport[3] != height) { m_viewportDirty = true; m_viewport[0] = minx; m_viewport[1] = miny; m_viewport[2] = width; m_viewport[3] = height; } } void setScissor(U32 minx, U32 miny, U32 width, U32 height) { ANKI_ASSERT(width > 0 && height > 0); commandCommon(); if(m_scissor[0] != minx || m_scissor[1] != miny || m_scissor[2] != width || m_scissor[3] != height) { m_scissorDirty = true; m_scissor[0] = minx; m_scissor[1] = miny; m_scissor[2] = width; m_scissor[3] = height; } } void setPolygonOffset(F32 factor, F32 units) { commandCommon(); m_state.setPolygonOffset(factor, units); } void setStencilOperations(FaceSelectionBit face, StencilOperation stencilFail, StencilOperation stencilPassDepthFail, StencilOperation stencilPassDepthPass) { commandCommon(); m_state.setStencilOperations(face, stencilFail, stencilPassDepthFail, stencilPassDepthPass); } void setStencilCompareOperation(FaceSelectionBit face, CompareOperation comp) { commandCommon(); m_state.setStencilCompareOperation(face, comp); } void setStencilCompareMask(FaceSelectionBit face, U32 mask); void setStencilWriteMask(FaceSelectionBit face, U32 mask); void setStencilReference(FaceSelectionBit face, U32 ref); void setDepthWrite(Bool enable) { commandCommon(); m_state.setDepthWrite(enable); } void setDepthCompareOperation(CompareOperation op) { commandCommon(); m_state.setDepthCompareOperation(op); } void setAlphaToCoverage(Bool enable) { commandCommon(); m_state.setAlphaToCoverage(enable); } void setColorChannelWriteMask(U32 attachment, ColorBit mask) { commandCommon(); m_state.setColorChannelWriteMask(attachment, mask); } void setBlendFactors(U32 attachment, BlendFactor srcRgb, BlendFactor dstRgb, BlendFactor srcA, BlendFactor dstA) { commandCommon(); m_state.setBlendFactors(attachment, srcRgb, dstRgb, srcA, dstA); } void setBlendOperation(U32 attachment, BlendOperation funcRgb, BlendOperation funcA) { commandCommon(); m_state.setBlendOperation(attachment, funcRgb, funcA); } void bindTextureAndSamplerInternal( U32 set, U32 binding, TextureViewPtr& texView, SamplerPtr sampler, TextureUsageBit usage, U32 arrayIdx) { commandCommon(); const TextureViewImpl& view = static_cast<const TextureViewImpl&>(*texView); const TextureImpl& tex = view.getTextureImpl(); ANKI_ASSERT(tex.isSubresourceGoodForSampling(view.getSubresource())); const VkImageLayout lay = tex.computeLayout(usage, 0); m_dsetState[set].bindTextureAndSampler(binding, arrayIdx, &view, sampler.get(), lay); m_microCmdb->pushObjectRef(texView); m_microCmdb->pushObjectRef(sampler); } void bindTextureInternal(U32 set, U32 binding, TextureViewPtr& texView, TextureUsageBit usage, U32 arrayIdx) { commandCommon(); const TextureViewImpl& view = static_cast<const TextureViewImpl&>(*texView); const TextureImpl& tex = view.getTextureImpl(); ANKI_ASSERT(tex.isSubresourceGoodForSampling(view.getSubresource())); const VkImageLayout lay = tex.computeLayout(usage, 0); m_dsetState[set].bindTexture(binding, arrayIdx, &view, lay); m_microCmdb->pushObjectRef(texView); } void bindSamplerInternal(U32 set, U32 binding, SamplerPtr& sampler, U32 arrayIdx) { commandCommon(); m_dsetState[set].bindSampler(binding, arrayIdx, sampler.get()); m_microCmdb->pushObjectRef(sampler); } void bindImageInternal(U32 set, U32 binding, TextureViewPtr& img, U32 arrayIdx) { commandCommon(); m_dsetState[set].bindImage(binding, arrayIdx, img.get()); m_microCmdb->pushObjectRef(img); } void bindAllBindlessInternal(U32 set) { commandCommon(); m_dsetState[set].bindCustumDescriptorSet(getGrManagerImpl().getBindlessDescriptorSet().getDescriptorSet()); } U32 bindBindlessTextureInternal(TextureViewPtr tex, TextureUsageBit usage) { TextureViewImpl& view = static_cast<TextureViewImpl&>(*tex); const VkImageLayout layout = view.getTextureImpl().computeLayout(usage, 0); const U32 idx = view.getOrCreateBindlessIndex(layout, DescriptorType::TEXTURE); m_microCmdb->pushObjectRef(tex); return idx; } U32 bindBindlessImageInternal(TextureViewPtr img) { TextureViewImpl& view = static_cast<TextureViewImpl&>(*img); const U32 idx = view.getOrCreateBindlessIndex(VK_IMAGE_LAYOUT_GENERAL, DescriptorType::IMAGE); m_microCmdb->pushObjectRef(img); return idx; } void beginRenderPass(FramebufferPtr fb, const Array<TextureUsageBit, MAX_COLOR_ATTACHMENTS>& colorAttachmentUsages, TextureUsageBit depthStencilAttachmentUsage, U32 minx, U32 miny, U32 width, U32 height); void endRenderPass(); void drawArrays(PrimitiveTopology topology, U32 count, U32 instanceCount, U32 first, U32 baseInstance); void drawElements( PrimitiveTopology topology, U32 count, U32 instanceCount, U32 firstIndex, U32 baseVertex, U32 baseInstance); void drawArraysIndirect(PrimitiveTopology topology, U32 drawCount, PtrSize offset, BufferPtr& buff); void drawElementsIndirect(PrimitiveTopology topology, U32 drawCount, PtrSize offset, BufferPtr& buff); void dispatchCompute(U32 groupCountX, U32 groupCountY, U32 groupCountZ); void resetOcclusionQuery(OcclusionQueryPtr query); void beginOcclusionQuery(OcclusionQueryPtr query); void endOcclusionQuery(OcclusionQueryPtr query); void writeTimestampInternal(TimestampQueryPtr& query); void generateMipmaps2d(TextureViewPtr texView); void clearTextureView(TextureViewPtr texView, const ClearValue& clearValue); void pushSecondLevelCommandBuffer(CommandBufferPtr cmdb); void endRecording(); void setTextureBarrier(TexturePtr tex, TextureUsageBit prevUsage, TextureUsageBit nextUsage, const TextureSubresourceInfo& subresource); void setTextureSurfaceBarrier( TexturePtr tex, TextureUsageBit prevUsage, TextureUsageBit nextUsage, const TextureSurfaceInfo& surf); void setTextureVolumeBarrier( TexturePtr tex, TextureUsageBit prevUsage, TextureUsageBit nextUsage, const TextureVolumeInfo& vol); void setTextureBarrierRange( TexturePtr tex, TextureUsageBit prevUsage, TextureUsageBit nextUsage, const VkImageSubresourceRange& range); void setBufferBarrier(VkPipelineStageFlags srcStage, VkAccessFlags srcAccess, VkPipelineStageFlags dstStage, VkAccessFlags dstAccess, PtrSize offset, PtrSize size, VkBuffer buff); void setBufferBarrier(BufferPtr buff, BufferUsageBit before, BufferUsageBit after, PtrSize offset, PtrSize size); void fillBuffer(BufferPtr buff, PtrSize offset, PtrSize size, U32 value); void writeOcclusionQueryResultToBuffer(OcclusionQueryPtr query, PtrSize offset, BufferPtr buff); void bindShaderProgram(ShaderProgramPtr& prog); void bindUniformBufferInternal(U32 set, U32 binding, BufferPtr& buff, PtrSize offset, PtrSize range, U32 arrayIdx) { commandCommon(); m_dsetState[set].bindUniformBuffer(binding, arrayIdx, buff.get(), offset, range); m_microCmdb->pushObjectRef(buff); } void bindStorageBufferInternal(U32 set, U32 binding, BufferPtr& buff, PtrSize offset, PtrSize range, U32 arrayIdx) { commandCommon(); m_dsetState[set].bindStorageBuffer(binding, arrayIdx, buff.get(), offset, range); m_microCmdb->pushObjectRef(buff); } void copyBufferToTextureViewInternal(BufferPtr buff, PtrSize offset, PtrSize range, TextureViewPtr texView); void copyBufferToBuffer(BufferPtr& src, PtrSize srcOffset, BufferPtr& dst, PtrSize dstOffset, PtrSize range); void setPushConstants(const void* data, U32 dataSize); void setRasterizationOrder(RasterizationOrder order); void setLineWidth(F32 width); private: StackAllocator<U8> m_alloc; MicroCommandBufferPtr m_microCmdb; VkCommandBuffer m_handle = VK_NULL_HANDLE; ThreadId m_tid = ~ThreadId(0); CommandBufferFlag m_flags = CommandBufferFlag::NONE; Bool m_renderedToDefaultFb = false; Bool m_finalized = false; Bool m_empty = true; Bool m_beganRecording = false; #if ANKI_EXTRA_CHECKS U32 m_commandCount = 0; U32 m_setPushConstantsSize = 0; #endif FramebufferPtr m_activeFb; Array<U32, 4> m_renderArea = {{0, 0, MAX_U32, MAX_U32}}; Array<U32, 2> m_fbSize = {{0, 0}}; U32 m_rpCommandCount = 0; ///< Number of drawcalls or pushed cmdbs in rp. Array<TextureUsageBit, MAX_COLOR_ATTACHMENTS> m_colorAttachmentUsages = {}; TextureUsageBit m_depthStencilAttachmentUsage = TextureUsageBit::NONE; ShaderProgramImpl* m_graphicsProg ANKI_DEBUG_CODE(= nullptr); ///< Last bound graphics program PipelineStateTracker m_state; Array<DescriptorSetState, MAX_DESCRIPTOR_SETS> m_dsetState; ShaderProgramImpl* m_computeProg ANKI_DEBUG_CODE(= nullptr); VkSubpassContents m_subpassContents = VK_SUBPASS_CONTENTS_MAX_ENUM; CommandBufferCommandType m_lastCmdType = CommandBufferCommandType::ANY_OTHER_COMMAND; /// @name state_opts /// @{ Array<U32, 4> m_viewport = {{0, 0, 0, 0}}; Array<U32, 4> m_scissor = {{0, 0, MAX_U32, MAX_U32}}; Bool m_viewportDirty = true; VkViewport m_lastViewport = {}; Bool m_scissorDirty = true; VkRect2D m_lastScissor = {{-1, -1}, {MAX_U32, MAX_U32}}; Array<U32, 2> m_stencilCompareMasks = {{0x5A5A5A5A, 0x5A5A5A5A}}; ///< Use a stupid number to initialize. Array<U32, 2> m_stencilWriteMasks = {{0x5A5A5A5A, 0x5A5A5A5A}}; Array<U32, 2> m_stencilReferenceMasks = {{0x5A5A5A5A, 0x5A5A5A5A}}; #if ANKI_ASSERTS_ENABLED Bool m_lineWidthSet = false; #endif /// Rebind the above dynamic state. Needed after pushing secondary command buffers (they dirty the state). void rebindDynamicState(); /// @} /// @name barrier_batch /// @{ DynamicArray<VkImageMemoryBarrier> m_imgBarriers; DynamicArray<VkBufferMemoryBarrier> m_buffBarriers; U16 m_imgBarrierCount = 0; U16 m_buffBarrierCount = 0; VkPipelineStageFlags m_srcStageMask = 0; VkPipelineStageFlags m_dstStageMask = 0; /// @} /// @name reset_query_batch /// @{ class QueryResetAtom { public: VkQueryPool m_pool; U32 m_queryIdx; }; DynamicArray<QueryResetAtom> m_queryResetAtoms; U16 m_queryResetAtomCount = 0; /// @} /// @name write_query_result_batch /// @{ class WriteQueryAtom { public: VkQueryPool m_pool; U32 m_queryIdx; VkBuffer m_buffer; PtrSize m_offset; }; DynamicArray<WriteQueryAtom> m_writeQueryAtoms; /// @} /// @name push_second_level_batch /// @{ DynamicArray<VkCommandBuffer> m_secondLevelAtoms; U16 m_secondLevelAtomCount = 0; /// @} /// Some common operations per command. void commandCommon(); /// Flush batches. Use ANKI_CMD on every vkCmdXXX to do that automatically and call it manually before adding to a /// batch. void flushBatches(CommandBufferCommandType type); void drawcallCommon(); Bool insideRenderPass() const { return m_activeFb.isCreated(); } void beginRenderPassInternal(); Bool secondLevel() const { return !!(m_flags & CommandBufferFlag::SECOND_LEVEL); } /// Flush batched image and buffer barriers. void flushBarriers(); void flushQueryResets(); void flushWriteQueryResults(); void setImageBarrier(VkPipelineStageFlags srcStage, VkAccessFlags srcAccess, VkImageLayout prevLayout, VkPipelineStageFlags dstStage, VkAccessFlags dstAccess, VkImageLayout newLayout, VkImage img, const VkImageSubresourceRange& range); void beginRecording(); Bool flipViewport() const; static VkViewport computeViewport(U32* viewport, U32 fbWidth, U32 fbHeight, Bool flipvp) { const U32 minx = viewport[0]; const U32 miny = viewport[1]; const U32 width = min<U32>(fbWidth, viewport[2]); const U32 height = min<U32>(fbHeight, viewport[3]); ANKI_ASSERT(width > 0 && height > 0); ANKI_ASSERT(minx + width <= fbWidth); ANKI_ASSERT(miny + height <= fbHeight); VkViewport s = {}; s.x = F32(minx); s.y = (flipvp) ? F32(fbHeight - miny) : F32(miny); // Move to the bottom; s.width = F32(width); s.height = (flipvp) ? -F32(height) : F32(height); s.minDepth = 0.0f; s.maxDepth = 1.0f; return s; } static VkRect2D computeScissor(U32* scissor, U32 fbWidth, U32 fbHeight, Bool flipvp) { const U32 minx = scissor[0]; const U32 miny = scissor[1]; const U32 width = min<U32>(fbWidth, scissor[2]); const U32 height = min<U32>(fbHeight, scissor[3]); ANKI_ASSERT(minx + width <= fbWidth); ANKI_ASSERT(miny + height <= fbHeight); VkRect2D out = {}; out.extent.width = width; out.extent.height = height; out.offset.x = minx; out.offset.y = (flipvp) ? (fbHeight - (miny + height)) : miny; return out; } }; /// @} } // end namespace anki #include <anki/gr/vulkan/CommandBufferImpl.inl.h>
[ "godlike@ancient-ritual.com" ]
godlike@ancient-ritual.com
1daf49529652145e9baca4d6c9d93344dd30d147
6dacb8f59751c9647685d4b931b2cbef00fcd302
/InterviewPrep/Practice/evenPicture.cpp
4c54300b5e593cada1cf96bacbcc1c3c4181cfdb
[]
no_license
sudhanshu-t/DSA
88662429514509c3a063d7610db3d32a6854c5c0
042fad26085405f77f159eb08c53555de9fb7732
refs/heads/master
2021-07-19T15:26:34.310444
2020-07-09T11:59:41
2020-07-09T11:59:41
278,350,018
0
0
null
null
null
null
UTF-8
C++
false
false
467
cpp
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int x = 0, y = 0; cout << (n + 1) * 3 + 1 << endl; for (int i = 0; i < n + 1; i++) { cout << x << " " << y << endl; cout << x + 1 << " " << y << endl; cout << x << " " << y + 1 << endl; x++; y++; } cout << x << " " << y << endl; return 0; }
[ "sudhanshu21.st@gmail.com" ]
sudhanshu21.st@gmail.com
3ea67199be3ea8a1ee676986d3468c5374642790
db04ecf258aef8a187823b8e47f4a1ae908e5897
/Cplus/AllDivisionsWiththeHighestScoreofaBinaryArray.cpp
7010bdc138e6fcfafc13c7eea52025b061c3eb38
[ "MIT" ]
permissive
JumHorn/leetcode
9612a26e531ceae7f25e2a749600632da6882075
abf145686dcfac860b0f6b26a04e3edd133b238c
refs/heads/master
2023-08-03T21:12:13.945602
2023-07-30T07:00:50
2023-07-30T07:00:50
74,735,489
0
0
null
null
null
null
UTF-8
C++
false
false
510
cpp
#include <vector> using namespace std; class Solution { public: vector<int> maxScoreIndices(vector<int> &nums) { int zero = 0, one = 0; for (auto n : nums) { if (n == 1) ++one; } int sum = one, minsum = one; vector<int> res = {0}; for (int i = 0; i < (int)nums.size(); ++i) { if (nums[i] == 0) ++zero; else --one; if (sum == one + zero) res.push_back(i + 1); else if (sum < one + zero) { sum = one + zero; res = {i + 1}; } } return res; } };
[ "JumHorn@gmail.com" ]
JumHorn@gmail.com