hexsha
stringlengths
40
40
size
int64
7
1.05M
ext
stringclasses
13 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
4
269
max_stars_repo_name
stringlengths
5
108
max_stars_repo_head_hexsha
stringlengths
40
40
max_stars_repo_licenses
listlengths
1
9
max_stars_count
int64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
4
269
max_issues_repo_name
stringlengths
5
116
max_issues_repo_head_hexsha
stringlengths
40
40
max_issues_repo_licenses
listlengths
1
9
max_issues_count
int64
1
67k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
4
269
max_forks_repo_name
stringlengths
5
116
max_forks_repo_head_hexsha
stringlengths
40
40
max_forks_repo_licenses
listlengths
1
9
max_forks_count
int64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
7
1.05M
avg_line_length
float64
1.21
330k
max_line_length
int64
6
990k
alphanum_fraction
float64
0.01
0.99
author_id
stringlengths
2
40
35b8397827a7b1f9700a9f9b2bba950c91fa569c
906
cpp
C++
10282.cpp
felikjunvianto/kfile-uvaoj-submissions
5bd8b3b413ca8523abe412b0a0545f766f70ce63
[ "MIT" ]
null
null
null
10282.cpp
felikjunvianto/kfile-uvaoj-submissions
5bd8b3b413ca8523abe412b0a0545f766f70ce63
[ "MIT" ]
null
null
null
10282.cpp
felikjunvianto/kfile-uvaoj-submissions
5bd8b3b413ca8523abe412b0a0545f766f70ce63
[ "MIT" ]
null
null
null
#include <cstdio> #include <cmath> #include <iostream> #include <string> #include <cstring> #include <algorithm> #include <vector> #include <utility> #include <stack> #include <queue> #include <map> #define fi first #define se second #define pb push_back #define mp make_pair #define pi 2*acos(0.0) #define eps 1e-9 #define PII pair<int,int> #define PDD pair<double,double> #define LL long long #define INF 1000000000 using namespace std; int x,y,len; map<string,string> idx; char msk[50]; string a,b; int main() { while(gets(msk)) { len=strlen(msk); if(!len) break; for(x=0;x<len;x++) if(msk[x]==' ') break; a.clear(),b.clear(); for(y=0;y<x;y++) a+=msk[y]; for(y=x+1;y<len;y++) b+=msk[y]; idx[b]=a; } while(scanf("%s",msk)!=EOF) if(idx.find(msk)==idx.end()) printf("eh\n"); else printf("%s\n",idx[msk].c_str()); return 0; }
18.12
85
0.610375
felikjunvianto
35bfa942cddd463f93d90460ef7b939aae562857
1,972
cpp
C++
soruce/main.cpp
juyuanmao/pick-ghost
c0e9713d63c1428a93e64dd33497cb97a37758c1
[ "Unlicense" ]
null
null
null
soruce/main.cpp
juyuanmao/pick-ghost
c0e9713d63c1428a93e64dd33497cb97a37758c1
[ "Unlicense" ]
null
null
null
soruce/main.cpp
juyuanmao/pick-ghost
c0e9713d63c1428a93e64dd33497cb97a37758c1
[ "Unlicense" ]
null
null
null
// // main.cpp // pick-ghost // // Created by Ju Yuanmao on 2017/7/15. // Copyleft // #include <iostream> #include <fstream> #include <algorithm> #include "randi.hpp" #include "cards.hpp" #include "player.hpp" using std::cin; using std::cout; using std::endl; int main(int argc, const char * argv[]) { std::ofstream out; switch (argc) { case 2: out.open(argv[1]); case 1: break; default: cout << "usage: ./pick-ghost.out [output_film]\n"; exit(1); break; } cards c; int t; unsigned long long n; cout << "How many people will join the game?\n"; cin >> t; cout << "How many times will the game be played?\n"; cin >> n; while (n--) { c.reset(); player *now = new player('a'); for (char i='b'; i<'a'+t; i++) { now->insert(i); now = now->next(); } now = now->next(); while (!c.empty()) { now->push(c.pop()); now = now->next(); } for (int i=0; i<t; i++) { if (now->last()->empty()) { now->last()->erase(); } now = now->next(); } int m = randi(0, t); while (m--) { now = now -> next(); } while (now->next() != now && now->last() != now) { now->push(now->next()->pop()); if (now->next()->empty()) { now->next()->erase(); } if (now->empty()) { now = now->next(); now->last()->erase(); continue; } now = now->next(); } if (out.is_open()) { out << now->name() << endl; } else { cout << now->name() << endl; } delete now; } if (out.is_open()) { out.close(); } return 0; }
21.911111
62
0.399594
juyuanmao
35c17388680166e4bd3c03c481724aa2ec6cba04
6,640
cpp
C++
src/unused/SceneData.cpp
rampart5555/ark
1399679feac89a84d3597e377992e90756e27dd0
[ "Apache-2.0" ]
null
null
null
src/unused/SceneData.cpp
rampart5555/ark
1399679feac89a84d3597e377992e90756e27dd0
[ "Apache-2.0" ]
null
null
null
src/unused/SceneData.cpp
rampart5555/ark
1399679feac89a84d3597e377992e90756e27dd0
[ "Apache-2.0" ]
null
null
null
#include <stdio.h> #include <osgDB/ReadFile> #include <osgDB/WriteFile> #include <osg/io_utils> #include <osg/UserDataContainer> #include <osg/ValueObject> #include "SceneData.h" #include "AssetsManager.h" #include "Logging.h" static void build_scene_data(const char *osgt_file) { char buf[20]; osg::Group *root = new osg::Group(); for(int i=0;i<EPISODE_NR;i++) { std::string ep_name="Episode_"; osg::Group *episode = new osg::Group(); episode->setUserValue("ep_id",i); sprintf(buf,"%d",i+1); ep_name += buf; episode->setUserValue("ep_name",ep_name); episode->setUserValue("ep_unlocked",false); for(int j=0;j<SCENE_NR;j++) { osg::Group *level = new osg::Group(); level->setUserValue("lvl_id", j); if((i==0)&&(j==0)) level->setUserValue("lvl_unlocked", true ); else level->setUserValue("lvl_unlocked", false ); level->setUserValue("lvl_score", 0); std::string lvl_data = "levels/Level_"; sprintf(buf,"%02d",j+1); lvl_data += buf; lvl_data +=".lua"; level->setUserValue("lvl_data",lvl_data); episode->addChild(level); } root->addChild(episode); } AssetsManager::instance().writeNode(*root, "levels.osgt"); } static void dump_episode_info(EpisodeInfo ei) { printf("Episode\n"); printf("ei_id: %d\n",ei.ep_id); printf("ei_name: %s\n",ei.ep_name.c_str()); printf("ei_unlocked: %d\n",ei.ep_unlocked); } static void dump_level_info(LevelInfo li) { printf(" Level\n"); printf(" lvl_id: %d\n",li.lvl_id); printf(" lvl_unlocked: %d\n",li.lvl_unlocked); printf(" lvl_score: %d\n",li.lvl_score); printf(" lvl_data: %s\n",li.lvl_data.c_str()); } SceneLoader::SceneLoader() { m_osgtFile=AssetsManager::instance().getRootPath() + "models/levels.osgt"; m_epNr = 3; m_lvlNr = 15; //levels per episode if(m_rootGroup==NULL) { readSceneData(); } m_currentEp = -1; m_currentLvl = -1; //build_scene_data(m_osgtFile.c_str()); } SceneLoader::~SceneLoader() { } void SceneLoader::writeSceneData() { AssetsManager::instance().writeNode(*m_rootGroup, m_osgtFile.c_str()); } void SceneLoader::readSceneData() { LOG_INFO("SceneLoader::readSceneData=> %s\n",m_osgtFile.c_str()); osg::Object *obj = AssetsManager::instance().loadObject(m_osgtFile.c_str(),"osgt"); m_rootGroup = dynamic_cast<osg::Group*>(obj); } void SceneLoader::dumpSceneData() { unsigned int i,j; LevelInfo li; EpisodeInfo ei; bool ep_res,lvl_res; if(m_rootGroup!=NULL) { for(i=0;i<m_rootGroup->getNumChildren();i++) { osg::Group *ep_group = dynamic_cast<osg::Group*>(m_rootGroup->getChild(i)); ep_res = ep_group->getUserValue("ep_id",ei.ep_id); if(ep_res==true) { ep_group->getUserValue("ep_name", ei.ep_name); ep_group->getUserValue("ep_unlocked", ei.ep_unlocked); dump_episode_info(ei); } for(j=0;j<ep_group->getNumChildren();j++) { osg::Node *lvl_group = dynamic_cast<osg::Group*>(ep_group->getChild(j)); lvl_res = lvl_group->getUserValue("lvl_id",li.lvl_id); if(lvl_res==true) { lvl_group->getUserValue("lvl_unlocked",li.lvl_unlocked); lvl_group->getUserValue("lvl_score",li.lvl_score); lvl_group->getUserValue("lvl_data",li.lvl_data); dump_level_info(li); } } } } } bool SceneLoader::getLevelInfo(int ep_id, int lvl_id, LevelInfo& lvl_info) { if(m_rootGroup != NULL) { osg::Group *ep_group = NULL; osg::Group *lvl_group = NULL; ep_group = dynamic_cast<osg::Group*>(m_rootGroup->getChild(ep_id)); if(ep_group != NULL) lvl_group = dynamic_cast<osg::Group*>(ep_group->getChild(lvl_id)); if( (ep_group == NULL)||(lvl_group == NULL) ) { LOG_ERROR("Level info not found for ep_id:%d lvl_id:%d\n", ep_id, lvl_id); return false; } lvl_group->getUserValue("lvl_id", lvl_info.lvl_id); lvl_group->getUserValue("lvl_unlocked",lvl_info.lvl_unlocked); lvl_group->getUserValue("lvl_score",lvl_info.lvl_score); lvl_group->getUserValue("lvl_data",lvl_info.lvl_data); //set episode id for this level lvl_info.lvl_ep_id = ep_id; //printf("level info: ep_id: %d,lvl_id:%d\n",ep_id,lvl_id); dump_level_info(lvl_info); return true; } return false; } bool SceneLoader::getEpisodeInfo(int ep_id, EpisodeInfo& ep_info) { if(m_rootGroup != NULL) { osg::Group *ep_group = dynamic_cast<osg::Group*>(m_rootGroup->getChild(ep_id)); if(ep_group==NULL) { LOG_ERROR("Episode info not found for ep_id:%d \n", ep_id); return false; } ep_group->getUserValue("ep_id",ep_info.ep_id); ep_group->getUserValue("ep_name", ep_info.ep_name); ep_group->getUserValue("ep_unlocked", ep_info.ep_unlocked); return true; } return false; } void SceneLoader::getCurrentScene(int& ep_id, int& lvl_id) { ep_id = m_currentEp; lvl_id = m_currentLvl; } void SceneLoader::setCurrentScene(int ep_id, int lvl_id) { LOG_INFO("Set current scene episode: %d level: %d\n",ep_id,lvl_id); m_currentEp = ep_id ; m_currentLvl = lvl_id; } bool SceneLoader::unlockNextLevel() { LOG_INFO("Unlock next level, current scene episode: %d level: %d\n",m_currentEp,m_currentLvl); if(m_currentLvl < m_lvlNr) { osg::Group *ep_group = NULL; osg::Group *lvl_group = NULL; m_currentLvl++; ep_group = dynamic_cast<osg::Group*>(m_rootGroup->getChild(m_currentEp)); if(ep_group != NULL) lvl_group = dynamic_cast<osg::Group*>(ep_group->getChild(m_currentLvl)); if( (ep_group == NULL)||(lvl_group == NULL) ) { LOG_ERROR("Level info not found for ep_id:%d lvl_id:%d\n", m_currentEp, m_currentLvl); return false; } lvl_group->setUserValue("lvl_unlocked", true ); } return true; }
31.923077
106
0.578313
rampart5555
35c7abdfd708fda0bc43202b6a43ad8a27732f1e
391,712
cxx
C++
tools/MuPad/example_gmm_objective_mex_d10_K25.cxx
dsyme/ADBench
87af0219a568807f8432754688ceb636efac12c6
[ "MIT" ]
58
2019-12-30T16:22:01.000Z
2022-01-23T12:26:51.000Z
tools/MuPad/example_gmm_objective_mex_d10_K25.cxx
dsyme/ADBench
87af0219a568807f8432754688ceb636efac12c6
[ "MIT" ]
112
2019-05-25T07:26:58.000Z
2019-12-28T13:55:33.000Z
tools/MuPad/example_gmm_objective_mex_d10_K25.cxx
dsyme/ADBench
87af0219a568807f8432754688ceb636efac12c6
[ "MIT" ]
22
2020-03-12T16:37:55.000Z
2022-02-23T10:14:37.000Z
// Copyright (c) Microsoft Corporation. // Licensed under the MIT license. #line 2 "au_autodiff_generate_template.cpp" #include <math.h> #include "au_mex.h" // Autogenerated by au_ccode // FROM: f // au_autodiff_template.cpp - outline code for au_autodiff* // awf@microsoft.com, Dec 13 void mlx_function(mlx_inputs& ins, mlx_outputs& outs) { mlx_array<mlx_double> in(ins[0]); mlx_array<mlx_double> data(ins[1]); mlx_array<mlx_logical> jacobian(ins[2]); bool do_jacobian = jacobian[0]; mlx_assert(in.cols == data.cols); mlx_assert(in.rows == 1650); mlx_assert(data.rows == 13); mwSize out_rows = 1 + (do_jacobian ? 1650 : 0); mwSize out_cols = 1 * in.cols; mlx_make_array<mlx_double> out(out_rows, out_cols); double const* in_ptr = in.data; double const* data_ptr = data.data; double* out_ptr = out.data; if (do_jacobian) { // const mwSize out_rows = 1650 + 1; const mwSize out_step = (1650 + 1) * 1; for(mwSize c_in = 0; c_in < in.cols; ++c_in, in_ptr += in.rows, data_ptr += data.rows, out_ptr += out_step) { /* inner loop do_jac=1 */ double x1 = in_ptr[0]; double x2 = in_ptr[1]; double x3 = in_ptr[2]; double x4 = in_ptr[3]; double x5 = in_ptr[4]; double x6 = in_ptr[5]; double x7 = in_ptr[6]; double x8 = in_ptr[7]; double x9 = in_ptr[8]; double x10 = in_ptr[9]; double x11 = in_ptr[10]; double x12 = in_ptr[11]; double x13 = in_ptr[12]; double x14 = in_ptr[13]; double x15 = in_ptr[14]; double x16 = in_ptr[15]; double x17 = in_ptr[16]; double x18 = in_ptr[17]; double x19 = in_ptr[18]; double x20 = in_ptr[19]; double x21 = in_ptr[20]; double x22 = in_ptr[21]; double x23 = in_ptr[22]; double x24 = in_ptr[23]; double x25 = in_ptr[24]; double x26 = in_ptr[25]; double x27 = in_ptr[26]; double x28 = in_ptr[27]; double x29 = in_ptr[28]; double x30 = in_ptr[29]; double x31 = in_ptr[30]; double x32 = in_ptr[31]; double x33 = in_ptr[32]; double x34 = in_ptr[33]; double x35 = in_ptr[34]; double x36 = in_ptr[35]; double x37 = in_ptr[36]; double x38 = in_ptr[37]; double x39 = in_ptr[38]; double x40 = in_ptr[39]; double x41 = in_ptr[40]; double x42 = in_ptr[41]; double x43 = in_ptr[42]; double x44 = in_ptr[43]; double x45 = in_ptr[44]; double x46 = in_ptr[45]; double x47 = in_ptr[46]; double x48 = in_ptr[47]; double x49 = in_ptr[48]; double x50 = in_ptr[49]; double x51 = in_ptr[50]; double x52 = in_ptr[51]; double x53 = in_ptr[52]; double x54 = in_ptr[53]; double x55 = in_ptr[54]; double x56 = in_ptr[55]; double x57 = in_ptr[56]; double x58 = in_ptr[57]; double x59 = in_ptr[58]; double x60 = in_ptr[59]; double x61 = in_ptr[60]; double x62 = in_ptr[61]; double x63 = in_ptr[62]; double x64 = in_ptr[63]; double x65 = in_ptr[64]; double x66 = in_ptr[65]; double x67 = in_ptr[66]; double x68 = in_ptr[67]; double x69 = in_ptr[68]; double x70 = in_ptr[69]; double x71 = in_ptr[70]; double x72 = in_ptr[71]; double x73 = in_ptr[72]; double x74 = in_ptr[73]; double x75 = in_ptr[74]; double x76 = in_ptr[75]; double x77 = in_ptr[76]; double x78 = in_ptr[77]; double x79 = in_ptr[78]; double x80 = in_ptr[79]; double x81 = in_ptr[80]; double x82 = in_ptr[81]; double x83 = in_ptr[82]; double x84 = in_ptr[83]; double x85 = in_ptr[84]; double x86 = in_ptr[85]; double x87 = in_ptr[86]; double x88 = in_ptr[87]; double x89 = in_ptr[88]; double x90 = in_ptr[89]; double x91 = in_ptr[90]; double x92 = in_ptr[91]; double x93 = in_ptr[92]; double x94 = in_ptr[93]; double x95 = in_ptr[94]; double x96 = in_ptr[95]; double x97 = in_ptr[96]; double x98 = in_ptr[97]; double x99 = in_ptr[98]; double x100 = in_ptr[99]; double x101 = in_ptr[100]; double x102 = in_ptr[101]; double x103 = in_ptr[102]; double x104 = in_ptr[103]; double x105 = in_ptr[104]; double x106 = in_ptr[105]; double x107 = in_ptr[106]; double x108 = in_ptr[107]; double x109 = in_ptr[108]; double x110 = in_ptr[109]; double x111 = in_ptr[110]; double x112 = in_ptr[111]; double x113 = in_ptr[112]; double x114 = in_ptr[113]; double x115 = in_ptr[114]; double x116 = in_ptr[115]; double x117 = in_ptr[116]; double x118 = in_ptr[117]; double x119 = in_ptr[118]; double x120 = in_ptr[119]; double x121 = in_ptr[120]; double x122 = in_ptr[121]; double x123 = in_ptr[122]; double x124 = in_ptr[123]; double x125 = in_ptr[124]; double x126 = in_ptr[125]; double x127 = in_ptr[126]; double x128 = in_ptr[127]; double x129 = in_ptr[128]; double x130 = in_ptr[129]; double x131 = in_ptr[130]; double x132 = in_ptr[131]; double x133 = in_ptr[132]; double x134 = in_ptr[133]; double x135 = in_ptr[134]; double x136 = in_ptr[135]; double x137 = in_ptr[136]; double x138 = in_ptr[137]; double x139 = in_ptr[138]; double x140 = in_ptr[139]; double x141 = in_ptr[140]; double x142 = in_ptr[141]; double x143 = in_ptr[142]; double x144 = in_ptr[143]; double x145 = in_ptr[144]; double x146 = in_ptr[145]; double x147 = in_ptr[146]; double x148 = in_ptr[147]; double x149 = in_ptr[148]; double x150 = in_ptr[149]; double x151 = in_ptr[150]; double x152 = in_ptr[151]; double x153 = in_ptr[152]; double x154 = in_ptr[153]; double x155 = in_ptr[154]; double x156 = in_ptr[155]; double x157 = in_ptr[156]; double x158 = in_ptr[157]; double x159 = in_ptr[158]; double x160 = in_ptr[159]; double x161 = in_ptr[160]; double x162 = in_ptr[161]; double x163 = in_ptr[162]; double x164 = in_ptr[163]; double x165 = in_ptr[164]; double x166 = in_ptr[165]; double x167 = in_ptr[166]; double x168 = in_ptr[167]; double x169 = in_ptr[168]; double x170 = in_ptr[169]; double x171 = in_ptr[170]; double x172 = in_ptr[171]; double x173 = in_ptr[172]; double x174 = in_ptr[173]; double x175 = in_ptr[174]; double x176 = in_ptr[175]; double x177 = in_ptr[176]; double x178 = in_ptr[177]; double x179 = in_ptr[178]; double x180 = in_ptr[179]; double x181 = in_ptr[180]; double x182 = in_ptr[181]; double x183 = in_ptr[182]; double x184 = in_ptr[183]; double x185 = in_ptr[184]; double x186 = in_ptr[185]; double x187 = in_ptr[186]; double x188 = in_ptr[187]; double x189 = in_ptr[188]; double x190 = in_ptr[189]; double x191 = in_ptr[190]; double x192 = in_ptr[191]; double x193 = in_ptr[192]; double x194 = in_ptr[193]; double x195 = in_ptr[194]; double x196 = in_ptr[195]; double x197 = in_ptr[196]; double x198 = in_ptr[197]; double x199 = in_ptr[198]; double x200 = in_ptr[199]; double x201 = in_ptr[200]; double x202 = in_ptr[201]; double x203 = in_ptr[202]; double x204 = in_ptr[203]; double x205 = in_ptr[204]; double x206 = in_ptr[205]; double x207 = in_ptr[206]; double x208 = in_ptr[207]; double x209 = in_ptr[208]; double x210 = in_ptr[209]; double x211 = in_ptr[210]; double x212 = in_ptr[211]; double x213 = in_ptr[212]; double x214 = in_ptr[213]; double x215 = in_ptr[214]; double x216 = in_ptr[215]; double x217 = in_ptr[216]; double x218 = in_ptr[217]; double x219 = in_ptr[218]; double x220 = in_ptr[219]; double x221 = in_ptr[220]; double x222 = in_ptr[221]; double x223 = in_ptr[222]; double x224 = in_ptr[223]; double x225 = in_ptr[224]; double x226 = in_ptr[225]; double x227 = in_ptr[226]; double x228 = in_ptr[227]; double x229 = in_ptr[228]; double x230 = in_ptr[229]; double x231 = in_ptr[230]; double x232 = in_ptr[231]; double x233 = in_ptr[232]; double x234 = in_ptr[233]; double x235 = in_ptr[234]; double x236 = in_ptr[235]; double x237 = in_ptr[236]; double x238 = in_ptr[237]; double x239 = in_ptr[238]; double x240 = in_ptr[239]; double x241 = in_ptr[240]; double x242 = in_ptr[241]; double x243 = in_ptr[242]; double x244 = in_ptr[243]; double x245 = in_ptr[244]; double x246 = in_ptr[245]; double x247 = in_ptr[246]; double x248 = in_ptr[247]; double x249 = in_ptr[248]; double x250 = in_ptr[249]; double x251 = in_ptr[250]; double x252 = in_ptr[251]; double x253 = in_ptr[252]; double x254 = in_ptr[253]; double x255 = in_ptr[254]; double x256 = in_ptr[255]; double x257 = in_ptr[256]; double x258 = in_ptr[257]; double x259 = in_ptr[258]; double x260 = in_ptr[259]; double x261 = in_ptr[260]; double x262 = in_ptr[261]; double x263 = in_ptr[262]; double x264 = in_ptr[263]; double x265 = in_ptr[264]; double x266 = in_ptr[265]; double x267 = in_ptr[266]; double x268 = in_ptr[267]; double x269 = in_ptr[268]; double x270 = in_ptr[269]; double x271 = in_ptr[270]; double x272 = in_ptr[271]; double x273 = in_ptr[272]; double x274 = in_ptr[273]; double x275 = in_ptr[274]; double x276 = in_ptr[275]; double x277 = in_ptr[276]; double x278 = in_ptr[277]; double x279 = in_ptr[278]; double x280 = in_ptr[279]; double x281 = in_ptr[280]; double x282 = in_ptr[281]; double x283 = in_ptr[282]; double x284 = in_ptr[283]; double x285 = in_ptr[284]; double x286 = in_ptr[285]; double x287 = in_ptr[286]; double x288 = in_ptr[287]; double x289 = in_ptr[288]; double x290 = in_ptr[289]; double x291 = in_ptr[290]; double x292 = in_ptr[291]; double x293 = in_ptr[292]; double x294 = in_ptr[293]; double x295 = in_ptr[294]; double x296 = in_ptr[295]; double x297 = in_ptr[296]; double x298 = in_ptr[297]; double x299 = in_ptr[298]; double x300 = in_ptr[299]; double x301 = in_ptr[300]; double x302 = in_ptr[301]; double x303 = in_ptr[302]; double x304 = in_ptr[303]; double x305 = in_ptr[304]; double x306 = in_ptr[305]; double x307 = in_ptr[306]; double x308 = in_ptr[307]; double x309 = in_ptr[308]; double x310 = in_ptr[309]; double x311 = in_ptr[310]; double x312 = in_ptr[311]; double x313 = in_ptr[312]; double x314 = in_ptr[313]; double x315 = in_ptr[314]; double x316 = in_ptr[315]; double x317 = in_ptr[316]; double x318 = in_ptr[317]; double x319 = in_ptr[318]; double x320 = in_ptr[319]; double x321 = in_ptr[320]; double x322 = in_ptr[321]; double x323 = in_ptr[322]; double x324 = in_ptr[323]; double x325 = in_ptr[324]; double x326 = in_ptr[325]; double x327 = in_ptr[326]; double x328 = in_ptr[327]; double x329 = in_ptr[328]; double x330 = in_ptr[329]; double x331 = in_ptr[330]; double x332 = in_ptr[331]; double x333 = in_ptr[332]; double x334 = in_ptr[333]; double x335 = in_ptr[334]; double x336 = in_ptr[335]; double x337 = in_ptr[336]; double x338 = in_ptr[337]; double x339 = in_ptr[338]; double x340 = in_ptr[339]; double x341 = in_ptr[340]; double x342 = in_ptr[341]; double x343 = in_ptr[342]; double x344 = in_ptr[343]; double x345 = in_ptr[344]; double x346 = in_ptr[345]; double x347 = in_ptr[346]; double x348 = in_ptr[347]; double x349 = in_ptr[348]; double x350 = in_ptr[349]; double x351 = in_ptr[350]; double x352 = in_ptr[351]; double x353 = in_ptr[352]; double x354 = in_ptr[353]; double x355 = in_ptr[354]; double x356 = in_ptr[355]; double x357 = in_ptr[356]; double x358 = in_ptr[357]; double x359 = in_ptr[358]; double x360 = in_ptr[359]; double x361 = in_ptr[360]; double x362 = in_ptr[361]; double x363 = in_ptr[362]; double x364 = in_ptr[363]; double x365 = in_ptr[364]; double x366 = in_ptr[365]; double x367 = in_ptr[366]; double x368 = in_ptr[367]; double x369 = in_ptr[368]; double x370 = in_ptr[369]; double x371 = in_ptr[370]; double x372 = in_ptr[371]; double x373 = in_ptr[372]; double x374 = in_ptr[373]; double x375 = in_ptr[374]; double x376 = in_ptr[375]; double x377 = in_ptr[376]; double x378 = in_ptr[377]; double x379 = in_ptr[378]; double x380 = in_ptr[379]; double x381 = in_ptr[380]; double x382 = in_ptr[381]; double x383 = in_ptr[382]; double x384 = in_ptr[383]; double x385 = in_ptr[384]; double x386 = in_ptr[385]; double x387 = in_ptr[386]; double x388 = in_ptr[387]; double x389 = in_ptr[388]; double x390 = in_ptr[389]; double x391 = in_ptr[390]; double x392 = in_ptr[391]; double x393 = in_ptr[392]; double x394 = in_ptr[393]; double x395 = in_ptr[394]; double x396 = in_ptr[395]; double x397 = in_ptr[396]; double x398 = in_ptr[397]; double x399 = in_ptr[398]; double x400 = in_ptr[399]; double x401 = in_ptr[400]; double x402 = in_ptr[401]; double x403 = in_ptr[402]; double x404 = in_ptr[403]; double x405 = in_ptr[404]; double x406 = in_ptr[405]; double x407 = in_ptr[406]; double x408 = in_ptr[407]; double x409 = in_ptr[408]; double x410 = in_ptr[409]; double x411 = in_ptr[410]; double x412 = in_ptr[411]; double x413 = in_ptr[412]; double x414 = in_ptr[413]; double x415 = in_ptr[414]; double x416 = in_ptr[415]; double x417 = in_ptr[416]; double x418 = in_ptr[417]; double x419 = in_ptr[418]; double x420 = in_ptr[419]; double x421 = in_ptr[420]; double x422 = in_ptr[421]; double x423 = in_ptr[422]; double x424 = in_ptr[423]; double x425 = in_ptr[424]; double x426 = in_ptr[425]; double x427 = in_ptr[426]; double x428 = in_ptr[427]; double x429 = in_ptr[428]; double x430 = in_ptr[429]; double x431 = in_ptr[430]; double x432 = in_ptr[431]; double x433 = in_ptr[432]; double x434 = in_ptr[433]; double x435 = in_ptr[434]; double x436 = in_ptr[435]; double x437 = in_ptr[436]; double x438 = in_ptr[437]; double x439 = in_ptr[438]; double x440 = in_ptr[439]; double x441 = in_ptr[440]; double x442 = in_ptr[441]; double x443 = in_ptr[442]; double x444 = in_ptr[443]; double x445 = in_ptr[444]; double x446 = in_ptr[445]; double x447 = in_ptr[446]; double x448 = in_ptr[447]; double x449 = in_ptr[448]; double x450 = in_ptr[449]; double x451 = in_ptr[450]; double x452 = in_ptr[451]; double x453 = in_ptr[452]; double x454 = in_ptr[453]; double x455 = in_ptr[454]; double x456 = in_ptr[455]; double x457 = in_ptr[456]; double x458 = in_ptr[457]; double x459 = in_ptr[458]; double x460 = in_ptr[459]; double x461 = in_ptr[460]; double x462 = in_ptr[461]; double x463 = in_ptr[462]; double x464 = in_ptr[463]; double x465 = in_ptr[464]; double x466 = in_ptr[465]; double x467 = in_ptr[466]; double x468 = in_ptr[467]; double x469 = in_ptr[468]; double x470 = in_ptr[469]; double x471 = in_ptr[470]; double x472 = in_ptr[471]; double x473 = in_ptr[472]; double x474 = in_ptr[473]; double x475 = in_ptr[474]; double x476 = in_ptr[475]; double x477 = in_ptr[476]; double x478 = in_ptr[477]; double x479 = in_ptr[478]; double x480 = in_ptr[479]; double x481 = in_ptr[480]; double x482 = in_ptr[481]; double x483 = in_ptr[482]; double x484 = in_ptr[483]; double x485 = in_ptr[484]; double x486 = in_ptr[485]; double x487 = in_ptr[486]; double x488 = in_ptr[487]; double x489 = in_ptr[488]; double x490 = in_ptr[489]; double x491 = in_ptr[490]; double x492 = in_ptr[491]; double x493 = in_ptr[492]; double x494 = in_ptr[493]; double x495 = in_ptr[494]; double x496 = in_ptr[495]; double x497 = in_ptr[496]; double x498 = in_ptr[497]; double x499 = in_ptr[498]; double x500 = in_ptr[499]; double x501 = in_ptr[500]; double x502 = in_ptr[501]; double x503 = in_ptr[502]; double x504 = in_ptr[503]; double x505 = in_ptr[504]; double x506 = in_ptr[505]; double x507 = in_ptr[506]; double x508 = in_ptr[507]; double x509 = in_ptr[508]; double x510 = in_ptr[509]; double x511 = in_ptr[510]; double x512 = in_ptr[511]; double x513 = in_ptr[512]; double x514 = in_ptr[513]; double x515 = in_ptr[514]; double x516 = in_ptr[515]; double x517 = in_ptr[516]; double x518 = in_ptr[517]; double x519 = in_ptr[518]; double x520 = in_ptr[519]; double x521 = in_ptr[520]; double x522 = in_ptr[521]; double x523 = in_ptr[522]; double x524 = in_ptr[523]; double x525 = in_ptr[524]; double x526 = in_ptr[525]; double x527 = in_ptr[526]; double x528 = in_ptr[527]; double x529 = in_ptr[528]; double x530 = in_ptr[529]; double x531 = in_ptr[530]; double x532 = in_ptr[531]; double x533 = in_ptr[532]; double x534 = in_ptr[533]; double x535 = in_ptr[534]; double x536 = in_ptr[535]; double x537 = in_ptr[536]; double x538 = in_ptr[537]; double x539 = in_ptr[538]; double x540 = in_ptr[539]; double x541 = in_ptr[540]; double x542 = in_ptr[541]; double x543 = in_ptr[542]; double x544 = in_ptr[543]; double x545 = in_ptr[544]; double x546 = in_ptr[545]; double x547 = in_ptr[546]; double x548 = in_ptr[547]; double x549 = in_ptr[548]; double x550 = in_ptr[549]; double x551 = in_ptr[550]; double x552 = in_ptr[551]; double x553 = in_ptr[552]; double x554 = in_ptr[553]; double x555 = in_ptr[554]; double x556 = in_ptr[555]; double x557 = in_ptr[556]; double x558 = in_ptr[557]; double x559 = in_ptr[558]; double x560 = in_ptr[559]; double x561 = in_ptr[560]; double x562 = in_ptr[561]; double x563 = in_ptr[562]; double x564 = in_ptr[563]; double x565 = in_ptr[564]; double x566 = in_ptr[565]; double x567 = in_ptr[566]; double x568 = in_ptr[567]; double x569 = in_ptr[568]; double x570 = in_ptr[569]; double x571 = in_ptr[570]; double x572 = in_ptr[571]; double x573 = in_ptr[572]; double x574 = in_ptr[573]; double x575 = in_ptr[574]; double x576 = in_ptr[575]; double x577 = in_ptr[576]; double x578 = in_ptr[577]; double x579 = in_ptr[578]; double x580 = in_ptr[579]; double x581 = in_ptr[580]; double x582 = in_ptr[581]; double x583 = in_ptr[582]; double x584 = in_ptr[583]; double x585 = in_ptr[584]; double x586 = in_ptr[585]; double x587 = in_ptr[586]; double x588 = in_ptr[587]; double x589 = in_ptr[588]; double x590 = in_ptr[589]; double x591 = in_ptr[590]; double x592 = in_ptr[591]; double x593 = in_ptr[592]; double x594 = in_ptr[593]; double x595 = in_ptr[594]; double x596 = in_ptr[595]; double x597 = in_ptr[596]; double x598 = in_ptr[597]; double x599 = in_ptr[598]; double x600 = in_ptr[599]; double x601 = in_ptr[600]; double x602 = in_ptr[601]; double x603 = in_ptr[602]; double x604 = in_ptr[603]; double x605 = in_ptr[604]; double x606 = in_ptr[605]; double x607 = in_ptr[606]; double x608 = in_ptr[607]; double x609 = in_ptr[608]; double x610 = in_ptr[609]; double x611 = in_ptr[610]; double x612 = in_ptr[611]; double x613 = in_ptr[612]; double x614 = in_ptr[613]; double x615 = in_ptr[614]; double x616 = in_ptr[615]; double x617 = in_ptr[616]; double x618 = in_ptr[617]; double x619 = in_ptr[618]; double x620 = in_ptr[619]; double x621 = in_ptr[620]; double x622 = in_ptr[621]; double x623 = in_ptr[622]; double x624 = in_ptr[623]; double x625 = in_ptr[624]; double x626 = in_ptr[625]; double x627 = in_ptr[626]; double x628 = in_ptr[627]; double x629 = in_ptr[628]; double x630 = in_ptr[629]; double x631 = in_ptr[630]; double x632 = in_ptr[631]; double x633 = in_ptr[632]; double x634 = in_ptr[633]; double x635 = in_ptr[634]; double x636 = in_ptr[635]; double x637 = in_ptr[636]; double x638 = in_ptr[637]; double x639 = in_ptr[638]; double x640 = in_ptr[639]; double x641 = in_ptr[640]; double x642 = in_ptr[641]; double x643 = in_ptr[642]; double x644 = in_ptr[643]; double x645 = in_ptr[644]; double x646 = in_ptr[645]; double x647 = in_ptr[646]; double x648 = in_ptr[647]; double x649 = in_ptr[648]; double x650 = in_ptr[649]; double x651 = in_ptr[650]; double x652 = in_ptr[651]; double x653 = in_ptr[652]; double x654 = in_ptr[653]; double x655 = in_ptr[654]; double x656 = in_ptr[655]; double x657 = in_ptr[656]; double x658 = in_ptr[657]; double x659 = in_ptr[658]; double x660 = in_ptr[659]; double x661 = in_ptr[660]; double x662 = in_ptr[661]; double x663 = in_ptr[662]; double x664 = in_ptr[663]; double x665 = in_ptr[664]; double x666 = in_ptr[665]; double x667 = in_ptr[666]; double x668 = in_ptr[667]; double x669 = in_ptr[668]; double x670 = in_ptr[669]; double x671 = in_ptr[670]; double x672 = in_ptr[671]; double x673 = in_ptr[672]; double x674 = in_ptr[673]; double x675 = in_ptr[674]; double x676 = in_ptr[675]; double x677 = in_ptr[676]; double x678 = in_ptr[677]; double x679 = in_ptr[678]; double x680 = in_ptr[679]; double x681 = in_ptr[680]; double x682 = in_ptr[681]; double x683 = in_ptr[682]; double x684 = in_ptr[683]; double x685 = in_ptr[684]; double x686 = in_ptr[685]; double x687 = in_ptr[686]; double x688 = in_ptr[687]; double x689 = in_ptr[688]; double x690 = in_ptr[689]; double x691 = in_ptr[690]; double x692 = in_ptr[691]; double x693 = in_ptr[692]; double x694 = in_ptr[693]; double x695 = in_ptr[694]; double x696 = in_ptr[695]; double x697 = in_ptr[696]; double x698 = in_ptr[697]; double x699 = in_ptr[698]; double x700 = in_ptr[699]; double x701 = in_ptr[700]; double x702 = in_ptr[701]; double x703 = in_ptr[702]; double x704 = in_ptr[703]; double x705 = in_ptr[704]; double x706 = in_ptr[705]; double x707 = in_ptr[706]; double x708 = in_ptr[707]; double x709 = in_ptr[708]; double x710 = in_ptr[709]; double x711 = in_ptr[710]; double x712 = in_ptr[711]; double x713 = in_ptr[712]; double x714 = in_ptr[713]; double x715 = in_ptr[714]; double x716 = in_ptr[715]; double x717 = in_ptr[716]; double x718 = in_ptr[717]; double x719 = in_ptr[718]; double x720 = in_ptr[719]; double x721 = in_ptr[720]; double x722 = in_ptr[721]; double x723 = in_ptr[722]; double x724 = in_ptr[723]; double x725 = in_ptr[724]; double x726 = in_ptr[725]; double x727 = in_ptr[726]; double x728 = in_ptr[727]; double x729 = in_ptr[728]; double x730 = in_ptr[729]; double x731 = in_ptr[730]; double x732 = in_ptr[731]; double x733 = in_ptr[732]; double x734 = in_ptr[733]; double x735 = in_ptr[734]; double x736 = in_ptr[735]; double x737 = in_ptr[736]; double x738 = in_ptr[737]; double x739 = in_ptr[738]; double x740 = in_ptr[739]; double x741 = in_ptr[740]; double x742 = in_ptr[741]; double x743 = in_ptr[742]; double x744 = in_ptr[743]; double x745 = in_ptr[744]; double x746 = in_ptr[745]; double x747 = in_ptr[746]; double x748 = in_ptr[747]; double x749 = in_ptr[748]; double x750 = in_ptr[749]; double x751 = in_ptr[750]; double x752 = in_ptr[751]; double x753 = in_ptr[752]; double x754 = in_ptr[753]; double x755 = in_ptr[754]; double x756 = in_ptr[755]; double x757 = in_ptr[756]; double x758 = in_ptr[757]; double x759 = in_ptr[758]; double x760 = in_ptr[759]; double x761 = in_ptr[760]; double x762 = in_ptr[761]; double x763 = in_ptr[762]; double x764 = in_ptr[763]; double x765 = in_ptr[764]; double x766 = in_ptr[765]; double x767 = in_ptr[766]; double x768 = in_ptr[767]; double x769 = in_ptr[768]; double x770 = in_ptr[769]; double x771 = in_ptr[770]; double x772 = in_ptr[771]; double x773 = in_ptr[772]; double x774 = in_ptr[773]; double x775 = in_ptr[774]; double x776 = in_ptr[775]; double x777 = in_ptr[776]; double x778 = in_ptr[777]; double x779 = in_ptr[778]; double x780 = in_ptr[779]; double x781 = in_ptr[780]; double x782 = in_ptr[781]; double x783 = in_ptr[782]; double x784 = in_ptr[783]; double x785 = in_ptr[784]; double x786 = in_ptr[785]; double x787 = in_ptr[786]; double x788 = in_ptr[787]; double x789 = in_ptr[788]; double x790 = in_ptr[789]; double x791 = in_ptr[790]; double x792 = in_ptr[791]; double x793 = in_ptr[792]; double x794 = in_ptr[793]; double x795 = in_ptr[794]; double x796 = in_ptr[795]; double x797 = in_ptr[796]; double x798 = in_ptr[797]; double x799 = in_ptr[798]; double x800 = in_ptr[799]; double x801 = in_ptr[800]; double x802 = in_ptr[801]; double x803 = in_ptr[802]; double x804 = in_ptr[803]; double x805 = in_ptr[804]; double x806 = in_ptr[805]; double x807 = in_ptr[806]; double x808 = in_ptr[807]; double x809 = in_ptr[808]; double x810 = in_ptr[809]; double x811 = in_ptr[810]; double x812 = in_ptr[811]; double x813 = in_ptr[812]; double x814 = in_ptr[813]; double x815 = in_ptr[814]; double x816 = in_ptr[815]; double x817 = in_ptr[816]; double x818 = in_ptr[817]; double x819 = in_ptr[818]; double x820 = in_ptr[819]; double x821 = in_ptr[820]; double x822 = in_ptr[821]; double x823 = in_ptr[822]; double x824 = in_ptr[823]; double x825 = in_ptr[824]; double x826 = in_ptr[825]; double x827 = in_ptr[826]; double x828 = in_ptr[827]; double x829 = in_ptr[828]; double x830 = in_ptr[829]; double x831 = in_ptr[830]; double x832 = in_ptr[831]; double x833 = in_ptr[832]; double x834 = in_ptr[833]; double x835 = in_ptr[834]; double x836 = in_ptr[835]; double x837 = in_ptr[836]; double x838 = in_ptr[837]; double x839 = in_ptr[838]; double x840 = in_ptr[839]; double x841 = in_ptr[840]; double x842 = in_ptr[841]; double x843 = in_ptr[842]; double x844 = in_ptr[843]; double x845 = in_ptr[844]; double x846 = in_ptr[845]; double x847 = in_ptr[846]; double x848 = in_ptr[847]; double x849 = in_ptr[848]; double x850 = in_ptr[849]; double x851 = in_ptr[850]; double x852 = in_ptr[851]; double x853 = in_ptr[852]; double x854 = in_ptr[853]; double x855 = in_ptr[854]; double x856 = in_ptr[855]; double x857 = in_ptr[856]; double x858 = in_ptr[857]; double x859 = in_ptr[858]; double x860 = in_ptr[859]; double x861 = in_ptr[860]; double x862 = in_ptr[861]; double x863 = in_ptr[862]; double x864 = in_ptr[863]; double x865 = in_ptr[864]; double x866 = in_ptr[865]; double x867 = in_ptr[866]; double x868 = in_ptr[867]; double x869 = in_ptr[868]; double x870 = in_ptr[869]; double x871 = in_ptr[870]; double x872 = in_ptr[871]; double x873 = in_ptr[872]; double x874 = in_ptr[873]; double x875 = in_ptr[874]; double x876 = in_ptr[875]; double x877 = in_ptr[876]; double x878 = in_ptr[877]; double x879 = in_ptr[878]; double x880 = in_ptr[879]; double x881 = in_ptr[880]; double x882 = in_ptr[881]; double x883 = in_ptr[882]; double x884 = in_ptr[883]; double x885 = in_ptr[884]; double x886 = in_ptr[885]; double x887 = in_ptr[886]; double x888 = in_ptr[887]; double x889 = in_ptr[888]; double x890 = in_ptr[889]; double x891 = in_ptr[890]; double x892 = in_ptr[891]; double x893 = in_ptr[892]; double x894 = in_ptr[893]; double x895 = in_ptr[894]; double x896 = in_ptr[895]; double x897 = in_ptr[896]; double x898 = in_ptr[897]; double x899 = in_ptr[898]; double x900 = in_ptr[899]; double x901 = in_ptr[900]; double x902 = in_ptr[901]; double x903 = in_ptr[902]; double x904 = in_ptr[903]; double x905 = in_ptr[904]; double x906 = in_ptr[905]; double x907 = in_ptr[906]; double x908 = in_ptr[907]; double x909 = in_ptr[908]; double x910 = in_ptr[909]; double x911 = in_ptr[910]; double x912 = in_ptr[911]; double x913 = in_ptr[912]; double x914 = in_ptr[913]; double x915 = in_ptr[914]; double x916 = in_ptr[915]; double x917 = in_ptr[916]; double x918 = in_ptr[917]; double x919 = in_ptr[918]; double x920 = in_ptr[919]; double x921 = in_ptr[920]; double x922 = in_ptr[921]; double x923 = in_ptr[922]; double x924 = in_ptr[923]; double x925 = in_ptr[924]; double x926 = in_ptr[925]; double x927 = in_ptr[926]; double x928 = in_ptr[927]; double x929 = in_ptr[928]; double x930 = in_ptr[929]; double x931 = in_ptr[930]; double x932 = in_ptr[931]; double x933 = in_ptr[932]; double x934 = in_ptr[933]; double x935 = in_ptr[934]; double x936 = in_ptr[935]; double x937 = in_ptr[936]; double x938 = in_ptr[937]; double x939 = in_ptr[938]; double x940 = in_ptr[939]; double x941 = in_ptr[940]; double x942 = in_ptr[941]; double x943 = in_ptr[942]; double x944 = in_ptr[943]; double x945 = in_ptr[944]; double x946 = in_ptr[945]; double x947 = in_ptr[946]; double x948 = in_ptr[947]; double x949 = in_ptr[948]; double x950 = in_ptr[949]; double x951 = in_ptr[950]; double x952 = in_ptr[951]; double x953 = in_ptr[952]; double x954 = in_ptr[953]; double x955 = in_ptr[954]; double x956 = in_ptr[955]; double x957 = in_ptr[956]; double x958 = in_ptr[957]; double x959 = in_ptr[958]; double x960 = in_ptr[959]; double x961 = in_ptr[960]; double x962 = in_ptr[961]; double x963 = in_ptr[962]; double x964 = in_ptr[963]; double x965 = in_ptr[964]; double x966 = in_ptr[965]; double x967 = in_ptr[966]; double x968 = in_ptr[967]; double x969 = in_ptr[968]; double x970 = in_ptr[969]; double x971 = in_ptr[970]; double x972 = in_ptr[971]; double x973 = in_ptr[972]; double x974 = in_ptr[973]; double x975 = in_ptr[974]; double x976 = in_ptr[975]; double x977 = in_ptr[976]; double x978 = in_ptr[977]; double x979 = in_ptr[978]; double x980 = in_ptr[979]; double x981 = in_ptr[980]; double x982 = in_ptr[981]; double x983 = in_ptr[982]; double x984 = in_ptr[983]; double x985 = in_ptr[984]; double x986 = in_ptr[985]; double x987 = in_ptr[986]; double x988 = in_ptr[987]; double x989 = in_ptr[988]; double x990 = in_ptr[989]; double x991 = in_ptr[990]; double x992 = in_ptr[991]; double x993 = in_ptr[992]; double x994 = in_ptr[993]; double x995 = in_ptr[994]; double x996 = in_ptr[995]; double x997 = in_ptr[996]; double x998 = in_ptr[997]; double x999 = in_ptr[998]; double x1000 = in_ptr[999]; double x1001 = in_ptr[1000]; double x1002 = in_ptr[1001]; double x1003 = in_ptr[1002]; double x1004 = in_ptr[1003]; double x1005 = in_ptr[1004]; double x1006 = in_ptr[1005]; double x1007 = in_ptr[1006]; double x1008 = in_ptr[1007]; double x1009 = in_ptr[1008]; double x1010 = in_ptr[1009]; double x1011 = in_ptr[1010]; double x1012 = in_ptr[1011]; double x1013 = in_ptr[1012]; double x1014 = in_ptr[1013]; double x1015 = in_ptr[1014]; double x1016 = in_ptr[1015]; double x1017 = in_ptr[1016]; double x1018 = in_ptr[1017]; double x1019 = in_ptr[1018]; double x1020 = in_ptr[1019]; double x1021 = in_ptr[1020]; double x1022 = in_ptr[1021]; double x1023 = in_ptr[1022]; double x1024 = in_ptr[1023]; double x1025 = in_ptr[1024]; double x1026 = in_ptr[1025]; double x1027 = in_ptr[1026]; double x1028 = in_ptr[1027]; double x1029 = in_ptr[1028]; double x1030 = in_ptr[1029]; double x1031 = in_ptr[1030]; double x1032 = in_ptr[1031]; double x1033 = in_ptr[1032]; double x1034 = in_ptr[1033]; double x1035 = in_ptr[1034]; double x1036 = in_ptr[1035]; double x1037 = in_ptr[1036]; double x1038 = in_ptr[1037]; double x1039 = in_ptr[1038]; double x1040 = in_ptr[1039]; double x1041 = in_ptr[1040]; double x1042 = in_ptr[1041]; double x1043 = in_ptr[1042]; double x1044 = in_ptr[1043]; double x1045 = in_ptr[1044]; double x1046 = in_ptr[1045]; double x1047 = in_ptr[1046]; double x1048 = in_ptr[1047]; double x1049 = in_ptr[1048]; double x1050 = in_ptr[1049]; double x1051 = in_ptr[1050]; double x1052 = in_ptr[1051]; double x1053 = in_ptr[1052]; double x1054 = in_ptr[1053]; double x1055 = in_ptr[1054]; double x1056 = in_ptr[1055]; double x1057 = in_ptr[1056]; double x1058 = in_ptr[1057]; double x1059 = in_ptr[1058]; double x1060 = in_ptr[1059]; double x1061 = in_ptr[1060]; double x1062 = in_ptr[1061]; double x1063 = in_ptr[1062]; double x1064 = in_ptr[1063]; double x1065 = in_ptr[1064]; double x1066 = in_ptr[1065]; double x1067 = in_ptr[1066]; double x1068 = in_ptr[1067]; double x1069 = in_ptr[1068]; double x1070 = in_ptr[1069]; double x1071 = in_ptr[1070]; double x1072 = in_ptr[1071]; double x1073 = in_ptr[1072]; double x1074 = in_ptr[1073]; double x1075 = in_ptr[1074]; double x1076 = in_ptr[1075]; double x1077 = in_ptr[1076]; double x1078 = in_ptr[1077]; double x1079 = in_ptr[1078]; double x1080 = in_ptr[1079]; double x1081 = in_ptr[1080]; double x1082 = in_ptr[1081]; double x1083 = in_ptr[1082]; double x1084 = in_ptr[1083]; double x1085 = in_ptr[1084]; double x1086 = in_ptr[1085]; double x1087 = in_ptr[1086]; double x1088 = in_ptr[1087]; double x1089 = in_ptr[1088]; double x1090 = in_ptr[1089]; double x1091 = in_ptr[1090]; double x1092 = in_ptr[1091]; double x1093 = in_ptr[1092]; double x1094 = in_ptr[1093]; double x1095 = in_ptr[1094]; double x1096 = in_ptr[1095]; double x1097 = in_ptr[1096]; double x1098 = in_ptr[1097]; double x1099 = in_ptr[1098]; double x1100 = in_ptr[1099]; double x1101 = in_ptr[1100]; double x1102 = in_ptr[1101]; double x1103 = in_ptr[1102]; double x1104 = in_ptr[1103]; double x1105 = in_ptr[1104]; double x1106 = in_ptr[1105]; double x1107 = in_ptr[1106]; double x1108 = in_ptr[1107]; double x1109 = in_ptr[1108]; double x1110 = in_ptr[1109]; double x1111 = in_ptr[1110]; double x1112 = in_ptr[1111]; double x1113 = in_ptr[1112]; double x1114 = in_ptr[1113]; double x1115 = in_ptr[1114]; double x1116 = in_ptr[1115]; double x1117 = in_ptr[1116]; double x1118 = in_ptr[1117]; double x1119 = in_ptr[1118]; double x1120 = in_ptr[1119]; double x1121 = in_ptr[1120]; double x1122 = in_ptr[1121]; double x1123 = in_ptr[1122]; double x1124 = in_ptr[1123]; double x1125 = in_ptr[1124]; double x1126 = in_ptr[1125]; double x1127 = in_ptr[1126]; double x1128 = in_ptr[1127]; double x1129 = in_ptr[1128]; double x1130 = in_ptr[1129]; double x1131 = in_ptr[1130]; double x1132 = in_ptr[1131]; double x1133 = in_ptr[1132]; double x1134 = in_ptr[1133]; double x1135 = in_ptr[1134]; double x1136 = in_ptr[1135]; double x1137 = in_ptr[1136]; double x1138 = in_ptr[1137]; double x1139 = in_ptr[1138]; double x1140 = in_ptr[1139]; double x1141 = in_ptr[1140]; double x1142 = in_ptr[1141]; double x1143 = in_ptr[1142]; double x1144 = in_ptr[1143]; double x1145 = in_ptr[1144]; double x1146 = in_ptr[1145]; double x1147 = in_ptr[1146]; double x1148 = in_ptr[1147]; double x1149 = in_ptr[1148]; double x1150 = in_ptr[1149]; double x1151 = in_ptr[1150]; double x1152 = in_ptr[1151]; double x1153 = in_ptr[1152]; double x1154 = in_ptr[1153]; double x1155 = in_ptr[1154]; double x1156 = in_ptr[1155]; double x1157 = in_ptr[1156]; double x1158 = in_ptr[1157]; double x1159 = in_ptr[1158]; double x1160 = in_ptr[1159]; double x1161 = in_ptr[1160]; double x1162 = in_ptr[1161]; double x1163 = in_ptr[1162]; double x1164 = in_ptr[1163]; double x1165 = in_ptr[1164]; double x1166 = in_ptr[1165]; double x1167 = in_ptr[1166]; double x1168 = in_ptr[1167]; double x1169 = in_ptr[1168]; double x1170 = in_ptr[1169]; double x1171 = in_ptr[1170]; double x1172 = in_ptr[1171]; double x1173 = in_ptr[1172]; double x1174 = in_ptr[1173]; double x1175 = in_ptr[1174]; double x1176 = in_ptr[1175]; double x1177 = in_ptr[1176]; double x1178 = in_ptr[1177]; double x1179 = in_ptr[1178]; double x1180 = in_ptr[1179]; double x1181 = in_ptr[1180]; double x1182 = in_ptr[1181]; double x1183 = in_ptr[1182]; double x1184 = in_ptr[1183]; double x1185 = in_ptr[1184]; double x1186 = in_ptr[1185]; double x1187 = in_ptr[1186]; double x1188 = in_ptr[1187]; double x1189 = in_ptr[1188]; double x1190 = in_ptr[1189]; double x1191 = in_ptr[1190]; double x1192 = in_ptr[1191]; double x1193 = in_ptr[1192]; double x1194 = in_ptr[1193]; double x1195 = in_ptr[1194]; double x1196 = in_ptr[1195]; double x1197 = in_ptr[1196]; double x1198 = in_ptr[1197]; double x1199 = in_ptr[1198]; double x1200 = in_ptr[1199]; double x1201 = in_ptr[1200]; double x1202 = in_ptr[1201]; double x1203 = in_ptr[1202]; double x1204 = in_ptr[1203]; double x1205 = in_ptr[1204]; double x1206 = in_ptr[1205]; double x1207 = in_ptr[1206]; double x1208 = in_ptr[1207]; double x1209 = in_ptr[1208]; double x1210 = in_ptr[1209]; double x1211 = in_ptr[1210]; double x1212 = in_ptr[1211]; double x1213 = in_ptr[1212]; double x1214 = in_ptr[1213]; double x1215 = in_ptr[1214]; double x1216 = in_ptr[1215]; double x1217 = in_ptr[1216]; double x1218 = in_ptr[1217]; double x1219 = in_ptr[1218]; double x1220 = in_ptr[1219]; double x1221 = in_ptr[1220]; double x1222 = in_ptr[1221]; double x1223 = in_ptr[1222]; double x1224 = in_ptr[1223]; double x1225 = in_ptr[1224]; double x1226 = in_ptr[1225]; double x1227 = in_ptr[1226]; double x1228 = in_ptr[1227]; double x1229 = in_ptr[1228]; double x1230 = in_ptr[1229]; double x1231 = in_ptr[1230]; double x1232 = in_ptr[1231]; double x1233 = in_ptr[1232]; double x1234 = in_ptr[1233]; double x1235 = in_ptr[1234]; double x1236 = in_ptr[1235]; double x1237 = in_ptr[1236]; double x1238 = in_ptr[1237]; double x1239 = in_ptr[1238]; double x1240 = in_ptr[1239]; double x1241 = in_ptr[1240]; double x1242 = in_ptr[1241]; double x1243 = in_ptr[1242]; double x1244 = in_ptr[1243]; double x1245 = in_ptr[1244]; double x1246 = in_ptr[1245]; double x1247 = in_ptr[1246]; double x1248 = in_ptr[1247]; double x1249 = in_ptr[1248]; double x1250 = in_ptr[1249]; double x1251 = in_ptr[1250]; double x1252 = in_ptr[1251]; double x1253 = in_ptr[1252]; double x1254 = in_ptr[1253]; double x1255 = in_ptr[1254]; double x1256 = in_ptr[1255]; double x1257 = in_ptr[1256]; double x1258 = in_ptr[1257]; double x1259 = in_ptr[1258]; double x1260 = in_ptr[1259]; double x1261 = in_ptr[1260]; double x1262 = in_ptr[1261]; double x1263 = in_ptr[1262]; double x1264 = in_ptr[1263]; double x1265 = in_ptr[1264]; double x1266 = in_ptr[1265]; double x1267 = in_ptr[1266]; double x1268 = in_ptr[1267]; double x1269 = in_ptr[1268]; double x1270 = in_ptr[1269]; double x1271 = in_ptr[1270]; double x1272 = in_ptr[1271]; double x1273 = in_ptr[1272]; double x1274 = in_ptr[1273]; double x1275 = in_ptr[1274]; double x1276 = in_ptr[1275]; double x1277 = in_ptr[1276]; double x1278 = in_ptr[1277]; double x1279 = in_ptr[1278]; double x1280 = in_ptr[1279]; double x1281 = in_ptr[1280]; double x1282 = in_ptr[1281]; double x1283 = in_ptr[1282]; double x1284 = in_ptr[1283]; double x1285 = in_ptr[1284]; double x1286 = in_ptr[1285]; double x1287 = in_ptr[1286]; double x1288 = in_ptr[1287]; double x1289 = in_ptr[1288]; double x1290 = in_ptr[1289]; double x1291 = in_ptr[1290]; double x1292 = in_ptr[1291]; double x1293 = in_ptr[1292]; double x1294 = in_ptr[1293]; double x1295 = in_ptr[1294]; double x1296 = in_ptr[1295]; double x1297 = in_ptr[1296]; double x1298 = in_ptr[1297]; double x1299 = in_ptr[1298]; double x1300 = in_ptr[1299]; double x1301 = in_ptr[1300]; double x1302 = in_ptr[1301]; double x1303 = in_ptr[1302]; double x1304 = in_ptr[1303]; double x1305 = in_ptr[1304]; double x1306 = in_ptr[1305]; double x1307 = in_ptr[1306]; double x1308 = in_ptr[1307]; double x1309 = in_ptr[1308]; double x1310 = in_ptr[1309]; double x1311 = in_ptr[1310]; double x1312 = in_ptr[1311]; double x1313 = in_ptr[1312]; double x1314 = in_ptr[1313]; double x1315 = in_ptr[1314]; double x1316 = in_ptr[1315]; double x1317 = in_ptr[1316]; double x1318 = in_ptr[1317]; double x1319 = in_ptr[1318]; double x1320 = in_ptr[1319]; double x1321 = in_ptr[1320]; double x1322 = in_ptr[1321]; double x1323 = in_ptr[1322]; double x1324 = in_ptr[1323]; double x1325 = in_ptr[1324]; double x1326 = in_ptr[1325]; double x1327 = in_ptr[1326]; double x1328 = in_ptr[1327]; double x1329 = in_ptr[1328]; double x1330 = in_ptr[1329]; double x1331 = in_ptr[1330]; double x1332 = in_ptr[1331]; double x1333 = in_ptr[1332]; double x1334 = in_ptr[1333]; double x1335 = in_ptr[1334]; double x1336 = in_ptr[1335]; double x1337 = in_ptr[1336]; double x1338 = in_ptr[1337]; double x1339 = in_ptr[1338]; double x1340 = in_ptr[1339]; double x1341 = in_ptr[1340]; double x1342 = in_ptr[1341]; double x1343 = in_ptr[1342]; double x1344 = in_ptr[1343]; double x1345 = in_ptr[1344]; double x1346 = in_ptr[1345]; double x1347 = in_ptr[1346]; double x1348 = in_ptr[1347]; double x1349 = in_ptr[1348]; double x1350 = in_ptr[1349]; double x1351 = in_ptr[1350]; double x1352 = in_ptr[1351]; double x1353 = in_ptr[1352]; double x1354 = in_ptr[1353]; double x1355 = in_ptr[1354]; double x1356 = in_ptr[1355]; double x1357 = in_ptr[1356]; double x1358 = in_ptr[1357]; double x1359 = in_ptr[1358]; double x1360 = in_ptr[1359]; double x1361 = in_ptr[1360]; double x1362 = in_ptr[1361]; double x1363 = in_ptr[1362]; double x1364 = in_ptr[1363]; double x1365 = in_ptr[1364]; double x1366 = in_ptr[1365]; double x1367 = in_ptr[1366]; double x1368 = in_ptr[1367]; double x1369 = in_ptr[1368]; double x1370 = in_ptr[1369]; double x1371 = in_ptr[1370]; double x1372 = in_ptr[1371]; double x1373 = in_ptr[1372]; double x1374 = in_ptr[1373]; double x1375 = in_ptr[1374]; double x1376 = in_ptr[1375]; double x1377 = in_ptr[1376]; double x1378 = in_ptr[1377]; double x1379 = in_ptr[1378]; double x1380 = in_ptr[1379]; double x1381 = in_ptr[1380]; double x1382 = in_ptr[1381]; double x1383 = in_ptr[1382]; double x1384 = in_ptr[1383]; double x1385 = in_ptr[1384]; double x1386 = in_ptr[1385]; double x1387 = in_ptr[1386]; double x1388 = in_ptr[1387]; double x1389 = in_ptr[1388]; double x1390 = in_ptr[1389]; double x1391 = in_ptr[1390]; double x1392 = in_ptr[1391]; double x1393 = in_ptr[1392]; double x1394 = in_ptr[1393]; double x1395 = in_ptr[1394]; double x1396 = in_ptr[1395]; double x1397 = in_ptr[1396]; double x1398 = in_ptr[1397]; double x1399 = in_ptr[1398]; double x1400 = in_ptr[1399]; double x1401 = in_ptr[1400]; double x1402 = in_ptr[1401]; double x1403 = in_ptr[1402]; double x1404 = in_ptr[1403]; double x1405 = in_ptr[1404]; double x1406 = in_ptr[1405]; double x1407 = in_ptr[1406]; double x1408 = in_ptr[1407]; double x1409 = in_ptr[1408]; double x1410 = in_ptr[1409]; double x1411 = in_ptr[1410]; double x1412 = in_ptr[1411]; double x1413 = in_ptr[1412]; double x1414 = in_ptr[1413]; double x1415 = in_ptr[1414]; double x1416 = in_ptr[1415]; double x1417 = in_ptr[1416]; double x1418 = in_ptr[1417]; double x1419 = in_ptr[1418]; double x1420 = in_ptr[1419]; double x1421 = in_ptr[1420]; double x1422 = in_ptr[1421]; double x1423 = in_ptr[1422]; double x1424 = in_ptr[1423]; double x1425 = in_ptr[1424]; double x1426 = in_ptr[1425]; double x1427 = in_ptr[1426]; double x1428 = in_ptr[1427]; double x1429 = in_ptr[1428]; double x1430 = in_ptr[1429]; double x1431 = in_ptr[1430]; double x1432 = in_ptr[1431]; double x1433 = in_ptr[1432]; double x1434 = in_ptr[1433]; double x1435 = in_ptr[1434]; double x1436 = in_ptr[1435]; double x1437 = in_ptr[1436]; double x1438 = in_ptr[1437]; double x1439 = in_ptr[1438]; double x1440 = in_ptr[1439]; double x1441 = in_ptr[1440]; double x1442 = in_ptr[1441]; double x1443 = in_ptr[1442]; double x1444 = in_ptr[1443]; double x1445 = in_ptr[1444]; double x1446 = in_ptr[1445]; double x1447 = in_ptr[1446]; double x1448 = in_ptr[1447]; double x1449 = in_ptr[1448]; double x1450 = in_ptr[1449]; double x1451 = in_ptr[1450]; double x1452 = in_ptr[1451]; double x1453 = in_ptr[1452]; double x1454 = in_ptr[1453]; double x1455 = in_ptr[1454]; double x1456 = in_ptr[1455]; double x1457 = in_ptr[1456]; double x1458 = in_ptr[1457]; double x1459 = in_ptr[1458]; double x1460 = in_ptr[1459]; double x1461 = in_ptr[1460]; double x1462 = in_ptr[1461]; double x1463 = in_ptr[1462]; double x1464 = in_ptr[1463]; double x1465 = in_ptr[1464]; double x1466 = in_ptr[1465]; double x1467 = in_ptr[1466]; double x1468 = in_ptr[1467]; double x1469 = in_ptr[1468]; double x1470 = in_ptr[1469]; double x1471 = in_ptr[1470]; double x1472 = in_ptr[1471]; double x1473 = in_ptr[1472]; double x1474 = in_ptr[1473]; double x1475 = in_ptr[1474]; double x1476 = in_ptr[1475]; double x1477 = in_ptr[1476]; double x1478 = in_ptr[1477]; double x1479 = in_ptr[1478]; double x1480 = in_ptr[1479]; double x1481 = in_ptr[1480]; double x1482 = in_ptr[1481]; double x1483 = in_ptr[1482]; double x1484 = in_ptr[1483]; double x1485 = in_ptr[1484]; double x1486 = in_ptr[1485]; double x1487 = in_ptr[1486]; double x1488 = in_ptr[1487]; double x1489 = in_ptr[1488]; double x1490 = in_ptr[1489]; double x1491 = in_ptr[1490]; double x1492 = in_ptr[1491]; double x1493 = in_ptr[1492]; double x1494 = in_ptr[1493]; double x1495 = in_ptr[1494]; double x1496 = in_ptr[1495]; double x1497 = in_ptr[1496]; double x1498 = in_ptr[1497]; double x1499 = in_ptr[1498]; double x1500 = in_ptr[1499]; double x1501 = in_ptr[1500]; double x1502 = in_ptr[1501]; double x1503 = in_ptr[1502]; double x1504 = in_ptr[1503]; double x1505 = in_ptr[1504]; double x1506 = in_ptr[1505]; double x1507 = in_ptr[1506]; double x1508 = in_ptr[1507]; double x1509 = in_ptr[1508]; double x1510 = in_ptr[1509]; double x1511 = in_ptr[1510]; double x1512 = in_ptr[1511]; double x1513 = in_ptr[1512]; double x1514 = in_ptr[1513]; double x1515 = in_ptr[1514]; double x1516 = in_ptr[1515]; double x1517 = in_ptr[1516]; double x1518 = in_ptr[1517]; double x1519 = in_ptr[1518]; double x1520 = in_ptr[1519]; double x1521 = in_ptr[1520]; double x1522 = in_ptr[1521]; double x1523 = in_ptr[1522]; double x1524 = in_ptr[1523]; double x1525 = in_ptr[1524]; double x1526 = in_ptr[1525]; double x1527 = in_ptr[1526]; double x1528 = in_ptr[1527]; double x1529 = in_ptr[1528]; double x1530 = in_ptr[1529]; double x1531 = in_ptr[1530]; double x1532 = in_ptr[1531]; double x1533 = in_ptr[1532]; double x1534 = in_ptr[1533]; double x1535 = in_ptr[1534]; double x1536 = in_ptr[1535]; double x1537 = in_ptr[1536]; double x1538 = in_ptr[1537]; double x1539 = in_ptr[1538]; double x1540 = in_ptr[1539]; double x1541 = in_ptr[1540]; double x1542 = in_ptr[1541]; double x1543 = in_ptr[1542]; double x1544 = in_ptr[1543]; double x1545 = in_ptr[1544]; double x1546 = in_ptr[1545]; double x1547 = in_ptr[1546]; double x1548 = in_ptr[1547]; double x1549 = in_ptr[1548]; double x1550 = in_ptr[1549]; double x1551 = in_ptr[1550]; double x1552 = in_ptr[1551]; double x1553 = in_ptr[1552]; double x1554 = in_ptr[1553]; double x1555 = in_ptr[1554]; double x1556 = in_ptr[1555]; double x1557 = in_ptr[1556]; double x1558 = in_ptr[1557]; double x1559 = in_ptr[1558]; double x1560 = in_ptr[1559]; double x1561 = in_ptr[1560]; double x1562 = in_ptr[1561]; double x1563 = in_ptr[1562]; double x1564 = in_ptr[1563]; double x1565 = in_ptr[1564]; double x1566 = in_ptr[1565]; double x1567 = in_ptr[1566]; double x1568 = in_ptr[1567]; double x1569 = in_ptr[1568]; double x1570 = in_ptr[1569]; double x1571 = in_ptr[1570]; double x1572 = in_ptr[1571]; double x1573 = in_ptr[1572]; double x1574 = in_ptr[1573]; double x1575 = in_ptr[1574]; double x1576 = in_ptr[1575]; double x1577 = in_ptr[1576]; double x1578 = in_ptr[1577]; double x1579 = in_ptr[1578]; double x1580 = in_ptr[1579]; double x1581 = in_ptr[1580]; double x1582 = in_ptr[1581]; double x1583 = in_ptr[1582]; double x1584 = in_ptr[1583]; double x1585 = in_ptr[1584]; double x1586 = in_ptr[1585]; double x1587 = in_ptr[1586]; double x1588 = in_ptr[1587]; double x1589 = in_ptr[1588]; double x1590 = in_ptr[1589]; double x1591 = in_ptr[1590]; double x1592 = in_ptr[1591]; double x1593 = in_ptr[1592]; double x1594 = in_ptr[1593]; double x1595 = in_ptr[1594]; double x1596 = in_ptr[1595]; double x1597 = in_ptr[1596]; double x1598 = in_ptr[1597]; double x1599 = in_ptr[1598]; double x1600 = in_ptr[1599]; double x1601 = in_ptr[1600]; double x1602 = in_ptr[1601]; double x1603 = in_ptr[1602]; double x1604 = in_ptr[1603]; double x1605 = in_ptr[1604]; double x1606 = in_ptr[1605]; double x1607 = in_ptr[1606]; double x1608 = in_ptr[1607]; double x1609 = in_ptr[1608]; double x1610 = in_ptr[1609]; double x1611 = in_ptr[1610]; double x1612 = in_ptr[1611]; double x1613 = in_ptr[1612]; double x1614 = in_ptr[1613]; double x1615 = in_ptr[1614]; double x1616 = in_ptr[1615]; double x1617 = in_ptr[1616]; double x1618 = in_ptr[1617]; double x1619 = in_ptr[1618]; double x1620 = in_ptr[1619]; double x1621 = in_ptr[1620]; double x1622 = in_ptr[1621]; double x1623 = in_ptr[1622]; double x1624 = in_ptr[1623]; double x1625 = in_ptr[1624]; double x1626 = in_ptr[1625]; double x1627 = in_ptr[1626]; double x1628 = in_ptr[1627]; double x1629 = in_ptr[1628]; double x1630 = in_ptr[1629]; double x1631 = in_ptr[1630]; double x1632 = in_ptr[1631]; double x1633 = in_ptr[1632]; double x1634 = in_ptr[1633]; double x1635 = in_ptr[1634]; double x1636 = in_ptr[1635]; double x1637 = in_ptr[1636]; double x1638 = in_ptr[1637]; double x1639 = in_ptr[1638]; double x1640 = in_ptr[1639]; double x1641 = in_ptr[1640]; double x1642 = in_ptr[1641]; double x1643 = in_ptr[1642]; double x1644 = in_ptr[1643]; double x1645 = in_ptr[1644]; double x1646 = in_ptr[1645]; double x1647 = in_ptr[1646]; double x1648 = in_ptr[1647]; double x1649 = in_ptr[1648]; double x1650 = in_ptr[1649]; double data1 = data_ptr[0]; double data2 = data_ptr[1]; double data3 = data_ptr[2]; double data4 = data_ptr[3]; double data5 = data_ptr[4]; double data6 = data_ptr[5]; double data7 = data_ptr[6]; double data8 = data_ptr[7]; double data9 = data_ptr[8]; double data10 = data_ptr[9]; double data11 = data_ptr[10]; double data12 = data_ptr[11]; double data13 = data_ptr[12]; double t3 = data1-x26; double t4 = data2-x27; double t502 = exp(x277); double t753 = t3*x286; double t754 = t4*t502; double t2 = t753+t754; double t6 = data3-x28; double t7 = data4-x29; double t8 = data5-x30; double t9 = data6-x31; double t10 = data7-x32; double t14 = data8-x33; double t15 = data9-x34; double t509 = exp(x284); double t756 = t3*x293; double t757 = t4*x301; double t758 = t6*x308; double t759 = t7*x314; double t760 = t8*x319; double t761 = t9*x323; double t762 = t10*x326; double t763 = t14*x328; double t764 = t15*t509; double t5 = t756+t757+t758+t759+t760+t761+t762+t763+t764; double t507 = exp(x282); double t766 = t3*x291; double t767 = t4*x299; double t768 = t6*x306; double t769 = t7*x312; double t770 = t8*x317; double t771 = t9*x321; double t772 = t10*t507; double t11 = t766+t767+t768+t769+t770+t771+t772; double t505 = exp(x280); double t774 = t3*x289; double t775 = t4*x297; double t776 = t6*x304; double t777 = t7*x310; double t778 = t8*t505; double t12 = t774+t775+t776+t777+t778; double t503 = exp(x278); double t780 = t3*x287; double t781 = t4*x295; double t782 = t6*t503; double t13 = t780+t781+t782; double t510 = exp(x285); double t785 = t3*x294; double t786 = t4*x302; double t787 = t6*x309; double t788 = t7*x315; double t789 = t8*x320; double t790 = t9*x324; double t791 = t10*x327; double t792 = t14*x329; double t793 = t15*x330; double t794 = data10-x35; double t795 = t510*t794; double t16 = t785+t786+t787+t788+t789+t790+t791+t792+t793+t795; double t508 = exp(x283); double t797 = t3*x292; double t798 = t4*x300; double t799 = t6*x307; double t800 = t7*x313; double t801 = t8*x318; double t802 = t9*x322; double t803 = t10*x325; double t804 = t14*t508; double t17 = t797+t798+t799+t800+t801+t802+t803+t804; double t506 = exp(x281); double t806 = t3*x290; double t807 = t4*x298; double t808 = t6*x305; double t809 = t7*x311; double t810 = t8*x316; double t811 = t9*t506; double t18 = t806+t807+t808+t809+t810+t811; double t504 = exp(x279); double t813 = t3*x288; double t814 = t4*x296; double t815 = t6*x303; double t816 = t7*t504; double t19 = t813+t814+t815+t816; double t21 = data1-x36; double t22 = data2-x37; double t511 = exp(x332); double t830 = t21*x341; double t831 = t22*t511; double t20 = t830+t831; double t24 = data3-x38; double t25 = data4-x39; double t26 = data5-x40; double t27 = data6-x41; double t28 = data7-x42; double t32 = data8-x43; double t33 = data9-x44; double t518 = exp(x339); double t833 = t21*x348; double t834 = t22*x356; double t835 = t24*x363; double t836 = t25*x369; double t837 = t26*x374; double t838 = t27*x378; double t839 = t28*x381; double t840 = t32*x383; double t841 = t33*t518; double t23 = t833+t834+t835+t836+t837+t838+t839+t840+t841; double t516 = exp(x337); double t843 = t21*x346; double t844 = t22*x354; double t845 = t24*x361; double t846 = t25*x367; double t847 = t26*x372; double t848 = t27*x376; double t849 = t28*t516; double t29 = t843+t844+t845+t846+t847+t848+t849; double t514 = exp(x335); double t851 = t21*x344; double t852 = t22*x352; double t853 = t24*x359; double t854 = t25*x365; double t855 = t26*t514; double t30 = t851+t852+t853+t854+t855; double t512 = exp(x333); double t857 = t21*x342; double t858 = t22*x350; double t859 = t24*t512; double t31 = t857+t858+t859; double t519 = exp(x340); double t862 = t21*x349; double t863 = t22*x357; double t864 = t24*x364; double t865 = t25*x370; double t866 = t26*x375; double t867 = t27*x379; double t868 = t28*x382; double t869 = t32*x384; double t870 = t33*x385; double t871 = data10-x45; double t872 = t519*t871; double t34 = t862+t863+t864+t865+t866+t867+t868+t869+t870+t872; double t517 = exp(x338); double t874 = t21*x347; double t875 = t22*x355; double t876 = t24*x362; double t877 = t25*x368; double t878 = t26*x373; double t879 = t27*x377; double t880 = t28*x380; double t881 = t32*t517; double t35 = t874+t875+t876+t877+t878+t879+t880+t881; double t515 = exp(x336); double t883 = t21*x345; double t884 = t22*x353; double t885 = t24*x360; double t886 = t25*x366; double t887 = t26*x371; double t888 = t27*t515; double t36 = t883+t884+t885+t886+t887+t888; double t513 = exp(x334); double t890 = t21*x343; double t891 = t22*x351; double t892 = t24*x358; double t893 = t25*t513; double t37 = t890+t891+t892+t893; double t39 = data1-x46; double t40 = data2-x47; double t520 = exp(x387); double t897 = t39*x396; double t898 = t40*t520; double t38 = t897+t898; double t42 = data3-x48; double t43 = data4-x49; double t44 = data5-x50; double t45 = data6-x51; double t46 = data7-x52; double t50 = data8-x53; double t51 = data9-x54; double t527 = exp(x394); double t900 = t39*x403; double t901 = t40*x411; double t902 = t42*x418; double t903 = t43*x424; double t904 = t44*x429; double t905 = t45*x433; double t906 = t46*x436; double t907 = t50*x438; double t908 = t51*t527; double t41 = t900+t901+t902+t903+t904+t905+t906+t907+t908; double t525 = exp(x392); double t910 = t39*x401; double t911 = t40*x409; double t912 = t42*x416; double t913 = t43*x422; double t914 = t44*x427; double t915 = t45*x431; double t916 = t46*t525; double t47 = t910+t911+t912+t913+t914+t915+t916; double t523 = exp(x390); double t918 = t39*x399; double t919 = t40*x407; double t920 = t42*x414; double t921 = t43*x420; double t922 = t44*t523; double t48 = t918+t919+t920+t921+t922; double t521 = exp(x388); double t924 = t39*x397; double t925 = t40*x405; double t926 = t42*t521; double t49 = t924+t925+t926; double t528 = exp(x395); double t929 = t39*x404; double t930 = t40*x412; double t931 = t42*x419; double t932 = t43*x425; double t933 = t44*x430; double t934 = t45*x434; double t935 = t46*x437; double t936 = t50*x439; double t937 = t51*x440; double t938 = data10-x55; double t939 = t528*t938; double t52 = t929+t930+t931+t932+t933+t934+t935+t936+t937+t939; double t526 = exp(x393); double t941 = t39*x402; double t942 = t40*x410; double t943 = t42*x417; double t944 = t43*x423; double t945 = t44*x428; double t946 = t45*x432; double t947 = t46*x435; double t948 = t50*t526; double t53 = t941+t942+t943+t944+t945+t946+t947+t948; double t524 = exp(x391); double t950 = t39*x400; double t951 = t40*x408; double t952 = t42*x415; double t953 = t43*x421; double t954 = t44*x426; double t955 = t45*t524; double t54 = t950+t951+t952+t953+t954+t955; double t522 = exp(x389); double t957 = t39*x398; double t958 = t40*x406; double t959 = t42*x413; double t960 = t43*t522; double t55 = t957+t958+t959+t960; double t57 = data1-x56; double t58 = data2-x57; double t529 = exp(x442); double t964 = t57*x451; double t965 = t58*t529; double t56 = t964+t965; double t60 = data3-x58; double t61 = data4-x59; double t62 = data5-x60; double t63 = data6-x61; double t64 = data7-x62; double t68 = data8-x63; double t69 = data9-x64; double t536 = exp(x449); double t967 = t57*x458; double t968 = t58*x466; double t969 = t60*x473; double t970 = t61*x479; double t971 = t62*x484; double t972 = t63*x488; double t973 = t64*x491; double t974 = t68*x493; double t975 = t69*t536; double t59 = t967+t968+t969+t970+t971+t972+t973+t974+t975; double t534 = exp(x447); double t977 = t57*x456; double t978 = t58*x464; double t979 = t60*x471; double t980 = t61*x477; double t981 = t62*x482; double t982 = t63*x486; double t983 = t64*t534; double t65 = t977+t978+t979+t980+t981+t982+t983; double t532 = exp(x445); double t985 = t57*x454; double t986 = t58*x462; double t987 = t60*x469; double t988 = t61*x475; double t989 = t62*t532; double t66 = t985+t986+t987+t988+t989; double t530 = exp(x443); double t991 = t57*x452; double t992 = t58*x460; double t993 = t60*t530; double t67 = t991+t992+t993; double t537 = exp(x450); double t996 = t57*x459; double t997 = t58*x467; double t998 = t60*x474; double t999 = t61*x480; double t1000 = t62*x485; double t1001 = t63*x489; double t1002 = t64*x492; double t1003 = t68*x494; double t1004 = t69*x495; double t1005 = data10-x65; double t1006 = t537*t1005; double t70 = t996+t997+t998+t999+t1000+t1001+t1002+t1003+t1004+t1006; double t535 = exp(x448); double t1008 = t57*x457; double t1009 = t58*x465; double t1010 = t60*x472; double t1011 = t61*x478; double t1012 = t62*x483; double t1013 = t63*x487; double t1014 = t64*x490; double t1015 = t68*t535; double t71 = t1008+t1009+t1010+t1011+t1012+t1013+t1014+t1015; double t533 = exp(x446); double t1017 = t57*x455; double t1018 = t58*x463; double t1019 = t60*x470; double t1020 = t61*x476; double t1021 = t62*x481; double t1022 = t63*t533; double t72 = t1017+t1018+t1019+t1020+t1021+t1022; double t531 = exp(x444); double t1024 = t57*x453; double t1025 = t58*x461; double t1026 = t60*x468; double t1027 = t61*t531; double t73 = t1024+t1025+t1026+t1027; double t75 = data1-x66; double t76 = data2-x67; double t538 = exp(x497); double t1031 = t75*x506; double t1032 = t76*t538; double t74 = t1031+t1032; double t78 = data3-x68; double t79 = data4-x69; double t80 = data5-x70; double t81 = data6-x71; double t82 = data7-x72; double t86 = data8-x73; double t87 = data9-x74; double t545 = exp(x504); double t1034 = t75*x513; double t1035 = t76*x521; double t1036 = t78*x528; double t1037 = t79*x534; double t1038 = t80*x539; double t1039 = t81*x543; double t1040 = t82*x546; double t1041 = t86*x548; double t1042 = t87*t545; double t77 = t1034+t1035+t1036+t1037+t1038+t1039+t1040+t1041+t1042; double t543 = exp(x502); double t1044 = t75*x511; double t1045 = t76*x519; double t1046 = t78*x526; double t1047 = t79*x532; double t1048 = t80*x537; double t1049 = t81*x541; double t1050 = t82*t543; double t83 = t1044+t1045+t1046+t1047+t1048+t1049+t1050; double t541 = exp(x500); double t1052 = t75*x509; double t1053 = t76*x517; double t1054 = t78*x524; double t1055 = t79*x530; double t1056 = t80*t541; double t84 = t1052+t1053+t1054+t1055+t1056; double t539 = exp(x498); double t1058 = t75*x507; double t1059 = t76*x515; double t1060 = t78*t539; double t85 = t1058+t1059+t1060; double t546 = exp(x505); double t1063 = t75*x514; double t1064 = t76*x522; double t1065 = t78*x529; double t1066 = t79*x535; double t1067 = t80*x540; double t1068 = t81*x544; double t1069 = t82*x547; double t1070 = t86*x549; double t1071 = t87*x550; double t1072 = data10-x75; double t1073 = t546*t1072; double t88 = t1063+t1064+t1065+t1066+t1067+t1068+t1069+t1070+t1071+t1073; double t544 = exp(x503); double t1075 = t75*x512; double t1076 = t76*x520; double t1077 = t78*x527; double t1078 = t79*x533; double t1079 = t80*x538; double t1080 = t81*x542; double t1081 = t82*x545; double t1082 = t86*t544; double t89 = t1075+t1076+t1077+t1078+t1079+t1080+t1081+t1082; double t542 = exp(x501); double t1084 = t75*x510; double t1085 = t76*x518; double t1086 = t78*x525; double t1087 = t79*x531; double t1088 = t80*x536; double t1089 = t81*t542; double t90 = t1084+t1085+t1086+t1087+t1088+t1089; double t540 = exp(x499); double t1091 = t75*x508; double t1092 = t76*x516; double t1093 = t78*x523; double t1094 = t79*t540; double t91 = t1091+t1092+t1093+t1094; double t93 = data1-x76; double t94 = data2-x77; double t547 = exp(x552); double t1098 = t93*x561; double t1099 = t94*t547; double t92 = t1098+t1099; double t96 = data3-x78; double t97 = data4-x79; double t98 = data5-x80; double t99 = data6-x81; double t100 = data7-x82; double t104 = data8-x83; double t105 = data9-x84; double t554 = exp(x559); double t1101 = t93*x568; double t1102 = t94*x576; double t1103 = t96*x583; double t1104 = t97*x589; double t1105 = t98*x594; double t1106 = t99*x598; double t1107 = t100*x601; double t1108 = t104*x603; double t1109 = t105*t554; double t95 = t1101+t1102+t1103+t1104+t1105+t1106+t1107+t1108+t1109; double t552 = exp(x557); double t1111 = t93*x566; double t1112 = t94*x574; double t1113 = t96*x581; double t1114 = t97*x587; double t1115 = t98*x592; double t1116 = t99*x596; double t1117 = t100*t552; double t101 = t1111+t1112+t1113+t1114+t1115+t1116+t1117; double t550 = exp(x555); double t1119 = t93*x564; double t1120 = t94*x572; double t1121 = t96*x579; double t1122 = t97*x585; double t1123 = t98*t550; double t102 = t1119+t1120+t1121+t1122+t1123; double t548 = exp(x553); double t1125 = t93*x562; double t1126 = t94*x570; double t1127 = t96*t548; double t103 = t1125+t1126+t1127; double t555 = exp(x560); double t1130 = t93*x569; double t1131 = t94*x577; double t1132 = t96*x584; double t1133 = t97*x590; double t1134 = t98*x595; double t1135 = t99*x599; double t1136 = t100*x602; double t1137 = t104*x604; double t1138 = t105*x605; double t1139 = data10-x85; double t1140 = t555*t1139; double t106 = t1130+t1131+t1132+t1133+t1134+t1135+t1136+t1137+t1138+t1140; double t553 = exp(x558); double t1142 = t93*x567; double t1143 = t94*x575; double t1144 = t96*x582; double t1145 = t97*x588; double t1146 = t98*x593; double t1147 = t99*x597; double t1148 = t100*x600; double t1149 = t104*t553; double t107 = t1142+t1143+t1144+t1145+t1146+t1147+t1148+t1149; double t551 = exp(x556); double t1151 = t93*x565; double t1152 = t94*x573; double t1153 = t96*x580; double t1154 = t97*x586; double t1155 = t98*x591; double t1156 = t99*t551; double t108 = t1151+t1152+t1153+t1154+t1155+t1156; double t549 = exp(x554); double t1158 = t93*x563; double t1159 = t94*x571; double t1160 = t96*x578; double t1161 = t97*t549; double t109 = t1158+t1159+t1160+t1161; double t111 = data1-x86; double t112 = data2-x87; double t556 = exp(x607); double t1165 = t111*x616; double t1166 = t112*t556; double t110 = t1165+t1166; double t114 = data3-x88; double t115 = data4-x89; double t116 = data5-x90; double t117 = data6-x91; double t118 = data7-x92; double t122 = data8-x93; double t123 = data9-x94; double t563 = exp(x614); double t1168 = t111*x623; double t1169 = t112*x631; double t1170 = t114*x638; double t1171 = t115*x644; double t1172 = t116*x649; double t1173 = t117*x653; double t1174 = t118*x656; double t1175 = t122*x658; double t1176 = t123*t563; double t113 = t1168+t1169+t1170+t1171+t1172+t1173+t1174+t1175+t1176; double t561 = exp(x612); double t1178 = t111*x621; double t1179 = t112*x629; double t1180 = t114*x636; double t1181 = t115*x642; double t1182 = t116*x647; double t1183 = t117*x651; double t1184 = t118*t561; double t119 = t1178+t1179+t1180+t1181+t1182+t1183+t1184; double t559 = exp(x610); double t1186 = t111*x619; double t1187 = t112*x627; double t1188 = t114*x634; double t1189 = t115*x640; double t1190 = t116*t559; double t120 = t1186+t1187+t1188+t1189+t1190; double t557 = exp(x608); double t1192 = t111*x617; double t1193 = t112*x625; double t1194 = t114*t557; double t121 = t1192+t1193+t1194; double t564 = exp(x615); double t1197 = t111*x624; double t1198 = t112*x632; double t1199 = t114*x639; double t1200 = t115*x645; double t1201 = t116*x650; double t1202 = t117*x654; double t1203 = t118*x657; double t1204 = t122*x659; double t1205 = t123*x660; double t1206 = data10-x95; double t1207 = t564*t1206; double t124 = t1197+t1198+t1199+t1200+t1201+t1202+t1203+t1204+t1205+t1207; double t562 = exp(x613); double t1209 = t111*x622; double t1210 = t112*x630; double t1211 = t114*x637; double t1212 = t115*x643; double t1213 = t116*x648; double t1214 = t117*x652; double t1215 = t118*x655; double t1216 = t122*t562; double t125 = t1209+t1210+t1211+t1212+t1213+t1214+t1215+t1216; double t560 = exp(x611); double t1218 = t111*x620; double t1219 = t112*x628; double t1220 = t114*x635; double t1221 = t115*x641; double t1222 = t116*x646; double t1223 = t117*t560; double t126 = t1218+t1219+t1220+t1221+t1222+t1223; double t558 = exp(x609); double t1225 = t111*x618; double t1226 = t112*x626; double t1227 = t114*x633; double t1228 = t115*t558; double t127 = t1225+t1226+t1227+t1228; double t129 = data1-x96; double t130 = data2-x97; double t565 = exp(x662); double t1232 = t129*x671; double t1233 = t130*t565; double t128 = t1232+t1233; double t132 = data3-x98; double t133 = data4-x99; double t134 = data5-x100; double t135 = data6-x101; double t136 = data7-x102; double t140 = data8-x103; double t141 = data9-x104; double t572 = exp(x669); double t1235 = t129*x678; double t1236 = t130*x686; double t1237 = t132*x693; double t1238 = t133*x699; double t1239 = t134*x704; double t1240 = t135*x708; double t1241 = t136*x711; double t1242 = t140*x713; double t1243 = t141*t572; double t131 = t1235+t1236+t1237+t1238+t1239+t1240+t1241+t1242+t1243; double t570 = exp(x667); double t1245 = t129*x676; double t1246 = t130*x684; double t1247 = t132*x691; double t1248 = t133*x697; double t1249 = t134*x702; double t1250 = t135*x706; double t1251 = t136*t570; double t137 = t1245+t1246+t1247+t1248+t1249+t1250+t1251; double t568 = exp(x665); double t1253 = t129*x674; double t1254 = t130*x682; double t1255 = t132*x689; double t1256 = t133*x695; double t1257 = t134*t568; double t138 = t1253+t1254+t1255+t1256+t1257; double t566 = exp(x663); double t1259 = t129*x672; double t1260 = t130*x680; double t1261 = t132*t566; double t139 = t1259+t1260+t1261; double t573 = exp(x670); double t1264 = t129*x679; double t1265 = t130*x687; double t1266 = t132*x694; double t1267 = t133*x700; double t1268 = t134*x705; double t1269 = t135*x709; double t1270 = t136*x712; double t1271 = t140*x714; double t1272 = t141*x715; double t1273 = data10-x105; double t1274 = t573*t1273; double t142 = t1264+t1265+t1266+t1267+t1268+t1269+t1270+t1271+t1272+t1274; double t571 = exp(x668); double t1276 = t129*x677; double t1277 = t130*x685; double t1278 = t132*x692; double t1279 = t133*x698; double t1280 = t134*x703; double t1281 = t135*x707; double t1282 = t136*x710; double t1283 = t140*t571; double t143 = t1276+t1277+t1278+t1279+t1280+t1281+t1282+t1283; double t569 = exp(x666); double t1285 = t129*x675; double t1286 = t130*x683; double t1287 = t132*x690; double t1288 = t133*x696; double t1289 = t134*x701; double t1290 = t135*t569; double t144 = t1285+t1286+t1287+t1288+t1289+t1290; double t567 = exp(x664); double t1292 = t129*x673; double t1293 = t130*x681; double t1294 = t132*x688; double t1295 = t133*t567; double t145 = t1292+t1293+t1294+t1295; double t147 = data1-x106; double t148 = data2-x107; double t574 = exp(x717); double t1299 = t147*x726; double t1300 = t148*t574; double t146 = t1299+t1300; double t150 = data3-x108; double t151 = data4-x109; double t152 = data5-x110; double t153 = data6-x111; double t154 = data7-x112; double t158 = data8-x113; double t159 = data9-x114; double t581 = exp(x724); double t1302 = t147*x733; double t1303 = t148*x741; double t1304 = t150*x748; double t1305 = t151*x754; double t1306 = t152*x759; double t1307 = t153*x763; double t1308 = t154*x766; double t1309 = t158*x768; double t1310 = t159*t581; double t149 = t1302+t1303+t1304+t1305+t1306+t1307+t1308+t1309+t1310; double t579 = exp(x722); double t1312 = t147*x731; double t1313 = t148*x739; double t1314 = t150*x746; double t1315 = t151*x752; double t1316 = t152*x757; double t1317 = t153*x761; double t1318 = t154*t579; double t155 = t1312+t1313+t1314+t1315+t1316+t1317+t1318; double t577 = exp(x720); double t1320 = t147*x729; double t1321 = t148*x737; double t1322 = t150*x744; double t1323 = t151*x750; double t1324 = t152*t577; double t156 = t1320+t1321+t1322+t1323+t1324; double t575 = exp(x718); double t1326 = t147*x727; double t1327 = t148*x735; double t1328 = t150*t575; double t157 = t1326+t1327+t1328; double t582 = exp(x725); double t1331 = t147*x734; double t1332 = t148*x742; double t1333 = t150*x749; double t1334 = t151*x755; double t1335 = t152*x760; double t1336 = t153*x764; double t1337 = t154*x767; double t1338 = t158*x769; double t1339 = t159*x770; double t1340 = data10-x115; double t1341 = t582*t1340; double t160 = t1331+t1332+t1333+t1334+t1335+t1336+t1337+t1338+t1339+t1341; double t580 = exp(x723); double t1343 = t147*x732; double t1344 = t148*x740; double t1345 = t150*x747; double t1346 = t151*x753; double t1347 = t152*x758; double t1348 = t153*x762; double t1349 = t154*x765; double t1350 = t158*t580; double t161 = t1343+t1344+t1345+t1346+t1347+t1348+t1349+t1350; double t578 = exp(x721); double t1352 = t147*x730; double t1353 = t148*x738; double t1354 = t150*x745; double t1355 = t151*x751; double t1356 = t152*x756; double t1357 = t153*t578; double t162 = t1352+t1353+t1354+t1355+t1356+t1357; double t576 = exp(x719); double t1359 = t147*x728; double t1360 = t148*x736; double t1361 = t150*x743; double t1362 = t151*t576; double t163 = t1359+t1360+t1361+t1362; double t165 = data1-x116; double t166 = data2-x117; double t583 = exp(x772); double t1366 = t165*x781; double t1367 = t166*t583; double t164 = t1366+t1367; double t168 = data3-x118; double t169 = data4-x119; double t170 = data5-x120; double t171 = data6-x121; double t172 = data7-x122; double t176 = data8-x123; double t177 = data9-x124; double t590 = exp(x779); double t1369 = t165*x788; double t1370 = t166*x796; double t1371 = t168*x803; double t1372 = t169*x809; double t1373 = t170*x814; double t1374 = t171*x818; double t1375 = t172*x821; double t1376 = t176*x823; double t1377 = t177*t590; double t167 = t1369+t1370+t1371+t1372+t1373+t1374+t1375+t1376+t1377; double t588 = exp(x777); double t1379 = t165*x786; double t1380 = t166*x794; double t1381 = t168*x801; double t1382 = t169*x807; double t1383 = t170*x812; double t1384 = t171*x816; double t1385 = t172*t588; double t173 = t1379+t1380+t1381+t1382+t1383+t1384+t1385; double t586 = exp(x775); double t1387 = t165*x784; double t1388 = t166*x792; double t1389 = t168*x799; double t1390 = t169*x805; double t1391 = t170*t586; double t174 = t1387+t1388+t1389+t1390+t1391; double t584 = exp(x773); double t1393 = t165*x782; double t1394 = t166*x790; double t1395 = t168*t584; double t175 = t1393+t1394+t1395; double t591 = exp(x780); double t1398 = t165*x789; double t1399 = t166*x797; double t1400 = t168*x804; double t1401 = t169*x810; double t1402 = t170*x815; double t1403 = t171*x819; double t1404 = t172*x822; double t1405 = t176*x824; double t1406 = t177*x825; double t1407 = data10-x125; double t1408 = t591*t1407; double t178 = t1398+t1399+t1400+t1401+t1402+t1403+t1404+t1405+t1406+t1408; double t589 = exp(x778); double t1410 = t165*x787; double t1411 = t166*x795; double t1412 = t168*x802; double t1413 = t169*x808; double t1414 = t170*x813; double t1415 = t171*x817; double t1416 = t172*x820; double t1417 = t176*t589; double t179 = t1410+t1411+t1412+t1413+t1414+t1415+t1416+t1417; double t587 = exp(x776); double t1419 = t165*x785; double t1420 = t166*x793; double t1421 = t168*x800; double t1422 = t169*x806; double t1423 = t170*x811; double t1424 = t171*t587; double t180 = t1419+t1420+t1421+t1422+t1423+t1424; double t585 = exp(x774); double t1426 = t165*x783; double t1427 = t166*x791; double t1428 = t168*x798; double t1429 = t169*t585; double t181 = t1426+t1427+t1428+t1429; double t183 = data1-x126; double t184 = data2-x127; double t592 = exp(x827); double t1433 = t183*x836; double t1434 = t184*t592; double t182 = t1433+t1434; double t186 = data3-x128; double t187 = data4-x129; double t188 = data5-x130; double t189 = data6-x131; double t190 = data7-x132; double t194 = data8-x133; double t195 = data9-x134; double t599 = exp(x834); double t1436 = t183*x843; double t1437 = t184*x851; double t1438 = t186*x858; double t1439 = t187*x864; double t1440 = t188*x869; double t1441 = t189*x873; double t1442 = t190*x876; double t1443 = t194*x878; double t1444 = t195*t599; double t185 = t1436+t1437+t1438+t1439+t1440+t1441+t1442+t1443+t1444; double t597 = exp(x832); double t1446 = t183*x841; double t1447 = t184*x849; double t1448 = t186*x856; double t1449 = t187*x862; double t1450 = t188*x867; double t1451 = t189*x871; double t1452 = t190*t597; double t191 = t1446+t1447+t1448+t1449+t1450+t1451+t1452; double t595 = exp(x830); double t1454 = t183*x839; double t1455 = t184*x847; double t1456 = t186*x854; double t1457 = t187*x860; double t1458 = t188*t595; double t192 = t1454+t1455+t1456+t1457+t1458; double t593 = exp(x828); double t1460 = t183*x837; double t1461 = t184*x845; double t1462 = t186*t593; double t193 = t1460+t1461+t1462; double t600 = exp(x835); double t1465 = t183*x844; double t1466 = t184*x852; double t1467 = t186*x859; double t1468 = t187*x865; double t1469 = t188*x870; double t1470 = t189*x874; double t1471 = t190*x877; double t1472 = t194*x879; double t1473 = t195*x880; double t1474 = data10-x135; double t1475 = t600*t1474; double t196 = t1465+t1466+t1467+t1468+t1469+t1470+t1471+t1472+t1473+t1475; double t598 = exp(x833); double t1477 = t183*x842; double t1478 = t184*x850; double t1479 = t186*x857; double t1480 = t187*x863; double t1481 = t188*x868; double t1482 = t189*x872; double t1483 = t190*x875; double t1484 = t194*t598; double t197 = t1477+t1478+t1479+t1480+t1481+t1482+t1483+t1484; double t596 = exp(x831); double t1486 = t183*x840; double t1487 = t184*x848; double t1488 = t186*x855; double t1489 = t187*x861; double t1490 = t188*x866; double t1491 = t189*t596; double t198 = t1486+t1487+t1488+t1489+t1490+t1491; double t594 = exp(x829); double t1493 = t183*x838; double t1494 = t184*x846; double t1495 = t186*x853; double t1496 = t187*t594; double t199 = t1493+t1494+t1495+t1496; double t201 = data1-x136; double t202 = data2-x137; double t601 = exp(x882); double t1500 = t201*x891; double t1501 = t202*t601; double t200 = t1500+t1501; double t204 = data3-x138; double t205 = data4-x139; double t206 = data5-x140; double t207 = data6-x141; double t208 = data7-x142; double t212 = data8-x143; double t213 = data9-x144; double t608 = exp(x889); double t1503 = t201*x898; double t1504 = t202*x906; double t1505 = t204*x913; double t1506 = t205*x919; double t1507 = t206*x924; double t1508 = t207*x928; double t1509 = t208*x931; double t1510 = t212*x933; double t1511 = t213*t608; double t203 = t1503+t1504+t1505+t1506+t1507+t1508+t1509+t1510+t1511; double t606 = exp(x887); double t1513 = t201*x896; double t1514 = t202*x904; double t1515 = t204*x911; double t1516 = t205*x917; double t1517 = t206*x922; double t1518 = t207*x926; double t1519 = t208*t606; double t209 = t1513+t1514+t1515+t1516+t1517+t1518+t1519; double t604 = exp(x885); double t1521 = t201*x894; double t1522 = t202*x902; double t1523 = t204*x909; double t1524 = t205*x915; double t1525 = t206*t604; double t210 = t1521+t1522+t1523+t1524+t1525; double t602 = exp(x883); double t1527 = t201*x892; double t1528 = t202*x900; double t1529 = t204*t602; double t211 = t1527+t1528+t1529; double t609 = exp(x890); double t1532 = t201*x899; double t1533 = t202*x907; double t1534 = t204*x914; double t1535 = t205*x920; double t1536 = t206*x925; double t1537 = t207*x929; double t1538 = t208*x932; double t1539 = t212*x934; double t1540 = t213*x935; double t1541 = data10-x145; double t1542 = t609*t1541; double t214 = t1532+t1533+t1534+t1535+t1536+t1537+t1538+t1539+t1540+t1542; double t607 = exp(x888); double t1544 = t201*x897; double t1545 = t202*x905; double t1546 = t204*x912; double t1547 = t205*x918; double t1548 = t206*x923; double t1549 = t207*x927; double t1550 = t208*x930; double t1551 = t212*t607; double t215 = t1544+t1545+t1546+t1547+t1548+t1549+t1550+t1551; double t605 = exp(x886); double t1553 = t201*x895; double t1554 = t202*x903; double t1555 = t204*x910; double t1556 = t205*x916; double t1557 = t206*x921; double t1558 = t207*t605; double t216 = t1553+t1554+t1555+t1556+t1557+t1558; double t603 = exp(x884); double t1560 = t201*x893; double t1561 = t202*x901; double t1562 = t204*x908; double t1563 = t205*t603; double t217 = t1560+t1561+t1562+t1563; double t219 = data1-x146; double t220 = data2-x147; double t610 = exp(x937); double t1567 = t219*x946; double t1568 = t220*t610; double t218 = t1567+t1568; double t222 = data3-x148; double t223 = data4-x149; double t224 = data5-x150; double t225 = data6-x151; double t226 = data7-x152; double t230 = data8-x153; double t231 = data9-x154; double t617 = exp(x944); double t1570 = t219*x953; double t1571 = t220*x961; double t1572 = t222*x968; double t1573 = t223*x974; double t1574 = t224*x979; double t1575 = t225*x983; double t1576 = t226*x986; double t1577 = t230*x988; double t1578 = t231*t617; double t221 = t1570+t1571+t1572+t1573+t1574+t1575+t1576+t1577+t1578; double t615 = exp(x942); double t1580 = t219*x951; double t1581 = t220*x959; double t1582 = t222*x966; double t1583 = t223*x972; double t1584 = t224*x977; double t1585 = t225*x981; double t1586 = t226*t615; double t227 = t1580+t1581+t1582+t1583+t1584+t1585+t1586; double t613 = exp(x940); double t1588 = t219*x949; double t1589 = t220*x957; double t1590 = t222*x964; double t1591 = t223*x970; double t1592 = t224*t613; double t228 = t1588+t1589+t1590+t1591+t1592; double t611 = exp(x938); double t1594 = t219*x947; double t1595 = t220*x955; double t1596 = t222*t611; double t229 = t1594+t1595+t1596; double t618 = exp(x945); double t1599 = t219*x954; double t1600 = t220*x962; double t1601 = t222*x969; double t1602 = t223*x975; double t1603 = t224*x980; double t1604 = t225*x984; double t1605 = t226*x987; double t1606 = t230*x989; double t1607 = t231*x990; double t1608 = data10-x155; double t1609 = t618*t1608; double t232 = t1599+t1600+t1601+t1602+t1603+t1604+t1605+t1606+t1607+t1609; double t616 = exp(x943); double t1611 = t219*x952; double t1612 = t220*x960; double t1613 = t222*x967; double t1614 = t223*x973; double t1615 = t224*x978; double t1616 = t225*x982; double t1617 = t226*x985; double t1618 = t230*t616; double t233 = t1611+t1612+t1613+t1614+t1615+t1616+t1617+t1618; double t614 = exp(x941); double t1620 = t219*x950; double t1621 = t220*x958; double t1622 = t222*x965; double t1623 = t223*x971; double t1624 = t224*x976; double t1625 = t225*t614; double t234 = t1620+t1621+t1622+t1623+t1624+t1625; double t612 = exp(x939); double t1627 = t219*x948; double t1628 = t220*x956; double t1629 = t222*x963; double t1630 = t223*t612; double t235 = t1627+t1628+t1629+t1630; double t237 = data1-x156; double t238 = data2-x157; double t619 = exp(x992); double t1634 = t237*x1001; double t1635 = t238*t619; double t236 = t1634+t1635; double t240 = data3-x158; double t241 = data4-x159; double t242 = data5-x160; double t243 = data6-x161; double t244 = data7-x162; double t248 = data8-x163; double t249 = data9-x164; double t626 = exp(x999); double t1637 = t237*x1008; double t1638 = t238*x1016; double t1639 = t240*x1023; double t1640 = t241*x1029; double t1641 = t242*x1034; double t1642 = t243*x1038; double t1643 = t244*x1041; double t1644 = t248*x1043; double t1645 = t249*t626; double t239 = t1637+t1638+t1639+t1640+t1641+t1642+t1643+t1644+t1645; double t624 = exp(x997); double t1647 = t237*x1006; double t1648 = t238*x1014; double t1649 = t240*x1021; double t1650 = t241*x1027; double t1651 = t242*x1032; double t1652 = t243*x1036; double t1653 = t244*t624; double t245 = t1647+t1648+t1649+t1650+t1651+t1652+t1653; double t622 = exp(x995); double t1655 = t237*x1004; double t1656 = t238*x1012; double t1657 = t240*x1019; double t1658 = t241*x1025; double t1659 = t242*t622; double t246 = t1655+t1656+t1657+t1658+t1659; double t620 = exp(x993); double t1661 = t237*x1002; double t1662 = t238*x1010; double t1663 = t240*t620; double t247 = t1661+t1662+t1663; double t627 = exp(x1000); double t1666 = t237*x1009; double t1667 = t238*x1017; double t1668 = t240*x1024; double t1669 = t241*x1030; double t1670 = t242*x1035; double t1671 = t243*x1039; double t1672 = t244*x1042; double t1673 = t248*x1044; double t1674 = t249*x1045; double t1675 = data10-x165; double t1676 = t627*t1675; double t250 = t1666+t1667+t1668+t1669+t1670+t1671+t1672+t1673+t1674+t1676; double t625 = exp(x998); double t1678 = t237*x1007; double t1679 = t238*x1015; double t1680 = t240*x1022; double t1681 = t241*x1028; double t1682 = t242*x1033; double t1683 = t243*x1037; double t1684 = t244*x1040; double t1685 = t248*t625; double t251 = t1678+t1679+t1680+t1681+t1682+t1683+t1684+t1685; double t623 = exp(x996); double t1687 = t237*x1005; double t1688 = t238*x1013; double t1689 = t240*x1020; double t1690 = t241*x1026; double t1691 = t242*x1031; double t1692 = t243*t623; double t252 = t1687+t1688+t1689+t1690+t1691+t1692; double t621 = exp(x994); double t1694 = t237*x1003; double t1695 = t238*x1011; double t1696 = t240*x1018; double t1697 = t241*t621; double t253 = t1694+t1695+t1696+t1697; double t255 = data1-x166; double t256 = data2-x167; double t628 = exp(x1047); double t1701 = t255*x1056; double t1702 = t256*t628; double t254 = t1701+t1702; double t258 = data3-x168; double t259 = data4-x169; double t260 = data5-x170; double t261 = data6-x171; double t262 = data7-x172; double t266 = data8-x173; double t267 = data9-x174; double t635 = exp(x1054); double t1704 = t255*x1063; double t1705 = t256*x1071; double t1706 = t258*x1078; double t1707 = t259*x1084; double t1708 = t260*x1089; double t1709 = t261*x1093; double t1710 = t262*x1096; double t1711 = t266*x1098; double t1712 = t267*t635; double t257 = t1704+t1705+t1706+t1707+t1708+t1709+t1710+t1711+t1712; double t633 = exp(x1052); double t1714 = t255*x1061; double t1715 = t256*x1069; double t1716 = t258*x1076; double t1717 = t259*x1082; double t1718 = t260*x1087; double t1719 = t261*x1091; double t1720 = t262*t633; double t263 = t1714+t1715+t1716+t1717+t1718+t1719+t1720; double t631 = exp(x1050); double t1722 = t255*x1059; double t1723 = t256*x1067; double t1724 = t258*x1074; double t1725 = t259*x1080; double t1726 = t260*t631; double t264 = t1722+t1723+t1724+t1725+t1726; double t629 = exp(x1048); double t1728 = t255*x1057; double t1729 = t256*x1065; double t1730 = t258*t629; double t265 = t1728+t1729+t1730; double t636 = exp(x1055); double t1733 = t255*x1064; double t1734 = t256*x1072; double t1735 = t258*x1079; double t1736 = t259*x1085; double t1737 = t260*x1090; double t1738 = t261*x1094; double t1739 = t262*x1097; double t1740 = t266*x1099; double t1741 = t267*x1100; double t1742 = data10-x175; double t1743 = t636*t1742; double t268 = t1733+t1734+t1735+t1736+t1737+t1738+t1739+t1740+t1741+t1743; double t634 = exp(x1053); double t1745 = t255*x1062; double t1746 = t256*x1070; double t1747 = t258*x1077; double t1748 = t259*x1083; double t1749 = t260*x1088; double t1750 = t261*x1092; double t1751 = t262*x1095; double t1752 = t266*t634; double t269 = t1745+t1746+t1747+t1748+t1749+t1750+t1751+t1752; double t632 = exp(x1051); double t1754 = t255*x1060; double t1755 = t256*x1068; double t1756 = t258*x1075; double t1757 = t259*x1081; double t1758 = t260*x1086; double t1759 = t261*t632; double t270 = t1754+t1755+t1756+t1757+t1758+t1759; double t630 = exp(x1049); double t1761 = t255*x1058; double t1762 = t256*x1066; double t1763 = t258*x1073; double t1764 = t259*t630; double t271 = t1761+t1762+t1763+t1764; double t273 = data1-x176; double t274 = data2-x177; double t637 = exp(x1102); double t1768 = t273*x1111; double t1769 = t274*t637; double t272 = t1768+t1769; double t276 = data3-x178; double t277 = data4-x179; double t278 = data5-x180; double t279 = data6-x181; double t280 = data7-x182; double t284 = data8-x183; double t285 = data9-x184; double t644 = exp(x1109); double t1771 = t273*x1118; double t1772 = t274*x1126; double t1773 = t276*x1133; double t1774 = t277*x1139; double t1775 = t278*x1144; double t1776 = t279*x1148; double t1777 = t280*x1151; double t1778 = t284*x1153; double t1779 = t285*t644; double t275 = t1771+t1772+t1773+t1774+t1775+t1776+t1777+t1778+t1779; double t642 = exp(x1107); double t1781 = t273*x1116; double t1782 = t274*x1124; double t1783 = t276*x1131; double t1784 = t277*x1137; double t1785 = t278*x1142; double t1786 = t279*x1146; double t1787 = t280*t642; double t281 = t1781+t1782+t1783+t1784+t1785+t1786+t1787; double t640 = exp(x1105); double t1789 = t273*x1114; double t1790 = t274*x1122; double t1791 = t276*x1129; double t1792 = t277*x1135; double t1793 = t278*t640; double t282 = t1789+t1790+t1791+t1792+t1793; double t638 = exp(x1103); double t1795 = t273*x1112; double t1796 = t274*x1120; double t1797 = t276*t638; double t283 = t1795+t1796+t1797; double t645 = exp(x1110); double t1800 = t273*x1119; double t1801 = t274*x1127; double t1802 = t276*x1134; double t1803 = t277*x1140; double t1804 = t278*x1145; double t1805 = t279*x1149; double t1806 = t280*x1152; double t1807 = t284*x1154; double t1808 = t285*x1155; double t1809 = data10-x185; double t1810 = t645*t1809; double t286 = t1800+t1801+t1802+t1803+t1804+t1805+t1806+t1807+t1808+t1810; double t643 = exp(x1108); double t1812 = t273*x1117; double t1813 = t274*x1125; double t1814 = t276*x1132; double t1815 = t277*x1138; double t1816 = t278*x1143; double t1817 = t279*x1147; double t1818 = t280*x1150; double t1819 = t284*t643; double t287 = t1812+t1813+t1814+t1815+t1816+t1817+t1818+t1819; double t641 = exp(x1106); double t1821 = t273*x1115; double t1822 = t274*x1123; double t1823 = t276*x1130; double t1824 = t277*x1136; double t1825 = t278*x1141; double t1826 = t279*t641; double t288 = t1821+t1822+t1823+t1824+t1825+t1826; double t639 = exp(x1104); double t1828 = t273*x1113; double t1829 = t274*x1121; double t1830 = t276*x1128; double t1831 = t277*t639; double t289 = t1828+t1829+t1830+t1831; double t291 = data1-x186; double t292 = data2-x187; double t646 = exp(x1157); double t1835 = t291*x1166; double t1836 = t292*t646; double t290 = t1835+t1836; double t294 = data3-x188; double t295 = data4-x189; double t296 = data5-x190; double t297 = data6-x191; double t298 = data7-x192; double t302 = data8-x193; double t303 = data9-x194; double t653 = exp(x1164); double t1838 = t291*x1173; double t1839 = t292*x1181; double t1840 = t294*x1188; double t1841 = t295*x1194; double t1842 = t296*x1199; double t1843 = t297*x1203; double t1844 = t298*x1206; double t1845 = t302*x1208; double t1846 = t303*t653; double t293 = t1838+t1839+t1840+t1841+t1842+t1843+t1844+t1845+t1846; double t651 = exp(x1162); double t1848 = t291*x1171; double t1849 = t292*x1179; double t1850 = t294*x1186; double t1851 = t295*x1192; double t1852 = t296*x1197; double t1853 = t297*x1201; double t1854 = t298*t651; double t299 = t1848+t1849+t1850+t1851+t1852+t1853+t1854; double t649 = exp(x1160); double t1856 = t291*x1169; double t1857 = t292*x1177; double t1858 = t294*x1184; double t1859 = t295*x1190; double t1860 = t296*t649; double t300 = t1856+t1857+t1858+t1859+t1860; double t647 = exp(x1158); double t1862 = t291*x1167; double t1863 = t292*x1175; double t1864 = t294*t647; double t301 = t1862+t1863+t1864; double t654 = exp(x1165); double t1867 = t291*x1174; double t1868 = t292*x1182; double t1869 = t294*x1189; double t1870 = t295*x1195; double t1871 = t296*x1200; double t1872 = t297*x1204; double t1873 = t298*x1207; double t1874 = t302*x1209; double t1875 = t303*x1210; double t1876 = data10-x195; double t1877 = t654*t1876; double t304 = t1867+t1868+t1869+t1870+t1871+t1872+t1873+t1874+t1875+t1877; double t652 = exp(x1163); double t1879 = t291*x1172; double t1880 = t292*x1180; double t1881 = t294*x1187; double t1882 = t295*x1193; double t1883 = t296*x1198; double t1884 = t297*x1202; double t1885 = t298*x1205; double t1886 = t302*t652; double t305 = t1879+t1880+t1881+t1882+t1883+t1884+t1885+t1886; double t650 = exp(x1161); double t1888 = t291*x1170; double t1889 = t292*x1178; double t1890 = t294*x1185; double t1891 = t295*x1191; double t1892 = t296*x1196; double t1893 = t297*t650; double t306 = t1888+t1889+t1890+t1891+t1892+t1893; double t648 = exp(x1159); double t1895 = t291*x1168; double t1896 = t292*x1176; double t1897 = t294*x1183; double t1898 = t295*t648; double t307 = t1895+t1896+t1897+t1898; double t309 = data1-x196; double t310 = data2-x197; double t655 = exp(x1212); double t1902 = t309*x1221; double t1903 = t310*t655; double t308 = t1902+t1903; double t312 = data3-x198; double t313 = data4-x199; double t314 = data5-x200; double t315 = data6-x201; double t316 = data7-x202; double t320 = data8-x203; double t321 = data9-x204; double t662 = exp(x1219); double t1905 = t309*x1228; double t1906 = t310*x1236; double t1907 = t312*x1243; double t1908 = t313*x1249; double t1909 = t314*x1254; double t1910 = t315*x1258; double t1911 = t316*x1261; double t1912 = t320*x1263; double t1913 = t321*t662; double t311 = t1905+t1906+t1907+t1908+t1909+t1910+t1911+t1912+t1913; double t660 = exp(x1217); double t1915 = t309*x1226; double t1916 = t310*x1234; double t1917 = t312*x1241; double t1918 = t313*x1247; double t1919 = t314*x1252; double t1920 = t315*x1256; double t1921 = t316*t660; double t317 = t1915+t1916+t1917+t1918+t1919+t1920+t1921; double t658 = exp(x1215); double t1923 = t309*x1224; double t1924 = t310*x1232; double t1925 = t312*x1239; double t1926 = t313*x1245; double t1927 = t314*t658; double t318 = t1923+t1924+t1925+t1926+t1927; double t656 = exp(x1213); double t1929 = t309*x1222; double t1930 = t310*x1230; double t1931 = t312*t656; double t319 = t1929+t1930+t1931; double t663 = exp(x1220); double t1934 = t309*x1229; double t1935 = t310*x1237; double t1936 = t312*x1244; double t1937 = t313*x1250; double t1938 = t314*x1255; double t1939 = t315*x1259; double t1940 = t316*x1262; double t1941 = t320*x1264; double t1942 = t321*x1265; double t1943 = data10-x205; double t1944 = t663*t1943; double t322 = t1934+t1935+t1936+t1937+t1938+t1939+t1940+t1941+t1942+t1944; double t661 = exp(x1218); double t1946 = t309*x1227; double t1947 = t310*x1235; double t1948 = t312*x1242; double t1949 = t313*x1248; double t1950 = t314*x1253; double t1951 = t315*x1257; double t1952 = t316*x1260; double t1953 = t320*t661; double t323 = t1946+t1947+t1948+t1949+t1950+t1951+t1952+t1953; double t659 = exp(x1216); double t1955 = t309*x1225; double t1956 = t310*x1233; double t1957 = t312*x1240; double t1958 = t313*x1246; double t1959 = t314*x1251; double t1960 = t315*t659; double t324 = t1955+t1956+t1957+t1958+t1959+t1960; double t657 = exp(x1214); double t1962 = t309*x1223; double t1963 = t310*x1231; double t1964 = t312*x1238; double t1965 = t313*t657; double t325 = t1962+t1963+t1964+t1965; double t327 = data1-x206; double t328 = data2-x207; double t664 = exp(x1267); double t1969 = t327*x1276; double t1970 = t328*t664; double t326 = t1969+t1970; double t330 = data3-x208; double t331 = data4-x209; double t332 = data5-x210; double t333 = data6-x211; double t334 = data7-x212; double t338 = data8-x213; double t339 = data9-x214; double t671 = exp(x1274); double t1972 = t327*x1283; double t1973 = t328*x1291; double t1974 = t330*x1298; double t1975 = t331*x1304; double t1976 = t332*x1309; double t1977 = t333*x1313; double t1978 = t334*x1316; double t1979 = t338*x1318; double t1980 = t339*t671; double t329 = t1972+t1973+t1974+t1975+t1976+t1977+t1978+t1979+t1980; double t669 = exp(x1272); double t1982 = t327*x1281; double t1983 = t328*x1289; double t1984 = t330*x1296; double t1985 = t331*x1302; double t1986 = t332*x1307; double t1987 = t333*x1311; double t1988 = t334*t669; double t335 = t1982+t1983+t1984+t1985+t1986+t1987+t1988; double t667 = exp(x1270); double t1990 = t327*x1279; double t1991 = t328*x1287; double t1992 = t330*x1294; double t1993 = t331*x1300; double t1994 = t332*t667; double t336 = t1990+t1991+t1992+t1993+t1994; double t665 = exp(x1268); double t1996 = t327*x1277; double t1997 = t328*x1285; double t1998 = t330*t665; double t337 = t1996+t1997+t1998; double t672 = exp(x1275); double t2001 = t327*x1284; double t2002 = t328*x1292; double t2003 = t330*x1299; double t2004 = t331*x1305; double t2005 = t332*x1310; double t2006 = t333*x1314; double t2007 = t334*x1317; double t2008 = t338*x1319; double t2009 = t339*x1320; double t2010 = data10-x215; double t2011 = t672*t2010; double t340 = t2001+t2002+t2003+t2004+t2005+t2006+t2007+t2008+t2009+t2011; double t670 = exp(x1273); double t2013 = t327*x1282; double t2014 = t328*x1290; double t2015 = t330*x1297; double t2016 = t331*x1303; double t2017 = t332*x1308; double t2018 = t333*x1312; double t2019 = t334*x1315; double t2020 = t338*t670; double t341 = t2013+t2014+t2015+t2016+t2017+t2018+t2019+t2020; double t668 = exp(x1271); double t2022 = t327*x1280; double t2023 = t328*x1288; double t2024 = t330*x1295; double t2025 = t331*x1301; double t2026 = t332*x1306; double t2027 = t333*t668; double t342 = t2022+t2023+t2024+t2025+t2026+t2027; double t666 = exp(x1269); double t2029 = t327*x1278; double t2030 = t328*x1286; double t2031 = t330*x1293; double t2032 = t331*t666; double t343 = t2029+t2030+t2031+t2032; double t345 = data1-x216; double t346 = data2-x217; double t673 = exp(x1322); double t2036 = t345*x1331; double t2037 = t346*t673; double t344 = t2036+t2037; double t348 = data3-x218; double t349 = data4-x219; double t350 = data5-x220; double t351 = data6-x221; double t352 = data7-x222; double t356 = data8-x223; double t357 = data9-x224; double t680 = exp(x1329); double t2039 = t345*x1338; double t2040 = t346*x1346; double t2041 = t348*x1353; double t2042 = t349*x1359; double t2043 = t350*x1364; double t2044 = t351*x1368; double t2045 = t352*x1371; double t2046 = t356*x1373; double t2047 = t357*t680; double t347 = t2039+t2040+t2041+t2042+t2043+t2044+t2045+t2046+t2047; double t678 = exp(x1327); double t2049 = t345*x1336; double t2050 = t346*x1344; double t2051 = t348*x1351; double t2052 = t349*x1357; double t2053 = t350*x1362; double t2054 = t351*x1366; double t2055 = t352*t678; double t353 = t2049+t2050+t2051+t2052+t2053+t2054+t2055; double t676 = exp(x1325); double t2057 = t345*x1334; double t2058 = t346*x1342; double t2059 = t348*x1349; double t2060 = t349*x1355; double t2061 = t350*t676; double t354 = t2057+t2058+t2059+t2060+t2061; double t674 = exp(x1323); double t2063 = t345*x1332; double t2064 = t346*x1340; double t2065 = t348*t674; double t355 = t2063+t2064+t2065; double t681 = exp(x1330); double t2068 = t345*x1339; double t2069 = t346*x1347; double t2070 = t348*x1354; double t2071 = t349*x1360; double t2072 = t350*x1365; double t2073 = t351*x1369; double t2074 = t352*x1372; double t2075 = t356*x1374; double t2076 = t357*x1375; double t2077 = data10-x225; double t2078 = t681*t2077; double t358 = t2068+t2069+t2070+t2071+t2072+t2073+t2074+t2075+t2076+t2078; double t679 = exp(x1328); double t2080 = t345*x1337; double t2081 = t346*x1345; double t2082 = t348*x1352; double t2083 = t349*x1358; double t2084 = t350*x1363; double t2085 = t351*x1367; double t2086 = t352*x1370; double t2087 = t356*t679; double t359 = t2080+t2081+t2082+t2083+t2084+t2085+t2086+t2087; double t677 = exp(x1326); double t2089 = t345*x1335; double t2090 = t346*x1343; double t2091 = t348*x1350; double t2092 = t349*x1356; double t2093 = t350*x1361; double t2094 = t351*t677; double t360 = t2089+t2090+t2091+t2092+t2093+t2094; double t675 = exp(x1324); double t2096 = t345*x1333; double t2097 = t346*x1341; double t2098 = t348*x1348; double t2099 = t349*t675; double t361 = t2096+t2097+t2098+t2099; double t363 = data1-x226; double t364 = data2-x227; double t682 = exp(x1377); double t2103 = t363*x1386; double t2104 = t364*t682; double t362 = t2103+t2104; double t366 = data3-x228; double t367 = data4-x229; double t368 = data5-x230; double t369 = data6-x231; double t370 = data7-x232; double t374 = data8-x233; double t375 = data9-x234; double t689 = exp(x1384); double t2106 = t363*x1393; double t2107 = t364*x1401; double t2108 = t366*x1408; double t2109 = t367*x1414; double t2110 = t368*x1419; double t2111 = t369*x1423; double t2112 = t370*x1426; double t2113 = t374*x1428; double t2114 = t375*t689; double t365 = t2106+t2107+t2108+t2109+t2110+t2111+t2112+t2113+t2114; double t687 = exp(x1382); double t2116 = t363*x1391; double t2117 = t364*x1399; double t2118 = t366*x1406; double t2119 = t367*x1412; double t2120 = t368*x1417; double t2121 = t369*x1421; double t2122 = t370*t687; double t371 = t2116+t2117+t2118+t2119+t2120+t2121+t2122; double t685 = exp(x1380); double t2124 = t363*x1389; double t2125 = t364*x1397; double t2126 = t366*x1404; double t2127 = t367*x1410; double t2128 = t368*t685; double t372 = t2124+t2125+t2126+t2127+t2128; double t683 = exp(x1378); double t2130 = t363*x1387; double t2131 = t364*x1395; double t2132 = t366*t683; double t373 = t2130+t2131+t2132; double t690 = exp(x1385); double t2135 = t363*x1394; double t2136 = t364*x1402; double t2137 = t366*x1409; double t2138 = t367*x1415; double t2139 = t368*x1420; double t2140 = t369*x1424; double t2141 = t370*x1427; double t2142 = t374*x1429; double t2143 = t375*x1430; double t2144 = data10-x235; double t2145 = t690*t2144; double t376 = t2135+t2136+t2137+t2138+t2139+t2140+t2141+t2142+t2143+t2145; double t688 = exp(x1383); double t2147 = t363*x1392; double t2148 = t364*x1400; double t2149 = t366*x1407; double t2150 = t367*x1413; double t2151 = t368*x1418; double t2152 = t369*x1422; double t2153 = t370*x1425; double t2154 = t374*t688; double t377 = t2147+t2148+t2149+t2150+t2151+t2152+t2153+t2154; double t686 = exp(x1381); double t2156 = t363*x1390; double t2157 = t364*x1398; double t2158 = t366*x1405; double t2159 = t367*x1411; double t2160 = t368*x1416; double t2161 = t369*t686; double t378 = t2156+t2157+t2158+t2159+t2160+t2161; double t684 = exp(x1379); double t2163 = t363*x1388; double t2164 = t364*x1396; double t2165 = t366*x1403; double t2166 = t367*t684; double t379 = t2163+t2164+t2165+t2166; double t381 = data1-x236; double t382 = data2-x237; double t691 = exp(x1432); double t2170 = t381*x1441; double t2171 = t382*t691; double t380 = t2170+t2171; double t384 = data3-x238; double t385 = data4-x239; double t386 = data5-x240; double t387 = data6-x241; double t388 = data7-x242; double t392 = data8-x243; double t393 = data9-x244; double t698 = exp(x1439); double t2173 = t381*x1448; double t2174 = t382*x1456; double t2175 = t384*x1463; double t2176 = t385*x1469; double t2177 = t386*x1474; double t2178 = t387*x1478; double t2179 = t388*x1481; double t2180 = t392*x1483; double t2181 = t393*t698; double t383 = t2173+t2174+t2175+t2176+t2177+t2178+t2179+t2180+t2181; double t696 = exp(x1437); double t2183 = t381*x1446; double t2184 = t382*x1454; double t2185 = t384*x1461; double t2186 = t385*x1467; double t2187 = t386*x1472; double t2188 = t387*x1476; double t2189 = t388*t696; double t389 = t2183+t2184+t2185+t2186+t2187+t2188+t2189; double t694 = exp(x1435); double t2191 = t381*x1444; double t2192 = t382*x1452; double t2193 = t384*x1459; double t2194 = t385*x1465; double t2195 = t386*t694; double t390 = t2191+t2192+t2193+t2194+t2195; double t692 = exp(x1433); double t2197 = t381*x1442; double t2198 = t382*x1450; double t2199 = t384*t692; double t391 = t2197+t2198+t2199; double t699 = exp(x1440); double t2202 = t381*x1449; double t2203 = t382*x1457; double t2204 = t384*x1464; double t2205 = t385*x1470; double t2206 = t386*x1475; double t2207 = t387*x1479; double t2208 = t388*x1482; double t2209 = t392*x1484; double t2210 = t393*x1485; double t2211 = data10-x245; double t2212 = t699*t2211; double t394 = t2202+t2203+t2204+t2205+t2206+t2207+t2208+t2209+t2210+t2212; double t697 = exp(x1438); double t2214 = t381*x1447; double t2215 = t382*x1455; double t2216 = t384*x1462; double t2217 = t385*x1468; double t2218 = t386*x1473; double t2219 = t387*x1477; double t2220 = t388*x1480; double t2221 = t392*t697; double t395 = t2214+t2215+t2216+t2217+t2218+t2219+t2220+t2221; double t695 = exp(x1436); double t2223 = t381*x1445; double t2224 = t382*x1453; double t2225 = t384*x1460; double t2226 = t385*x1466; double t2227 = t386*x1471; double t2228 = t387*t695; double t396 = t2223+t2224+t2225+t2226+t2227+t2228; double t693 = exp(x1434); double t2230 = t381*x1443; double t2231 = t382*x1451; double t2232 = t384*x1458; double t2233 = t385*t693; double t397 = t2230+t2231+t2232+t2233; double t399 = data1-x246; double t400 = data2-x247; double t700 = exp(x1487); double t2237 = t399*x1496; double t2238 = t400*t700; double t398 = t2237+t2238; double t402 = data3-x248; double t403 = data4-x249; double t404 = data5-x250; double t405 = data6-x251; double t406 = data7-x252; double t410 = data8-x253; double t411 = data9-x254; double t707 = exp(x1494); double t2240 = t399*x1503; double t2241 = t400*x1511; double t2242 = t402*x1518; double t2243 = t403*x1524; double t2244 = t404*x1529; double t2245 = t405*x1533; double t2246 = t406*x1536; double t2247 = t410*x1538; double t2248 = t411*t707; double t401 = t2240+t2241+t2242+t2243+t2244+t2245+t2246+t2247+t2248; double t705 = exp(x1492); double t2250 = t399*x1501; double t2251 = t400*x1509; double t2252 = t402*x1516; double t2253 = t403*x1522; double t2254 = t404*x1527; double t2255 = t405*x1531; double t2256 = t406*t705; double t407 = t2250+t2251+t2252+t2253+t2254+t2255+t2256; double t703 = exp(x1490); double t2258 = t399*x1499; double t2259 = t400*x1507; double t2260 = t402*x1514; double t2261 = t403*x1520; double t2262 = t404*t703; double t408 = t2258+t2259+t2260+t2261+t2262; double t701 = exp(x1488); double t2264 = t399*x1497; double t2265 = t400*x1505; double t2266 = t402*t701; double t409 = t2264+t2265+t2266; double t708 = exp(x1495); double t2269 = t399*x1504; double t2270 = t400*x1512; double t2271 = t402*x1519; double t2272 = t403*x1525; double t2273 = t404*x1530; double t2274 = t405*x1534; double t2275 = t406*x1537; double t2276 = t410*x1539; double t2277 = t411*x1540; double t2278 = data10-x255; double t2279 = t708*t2278; double t412 = t2269+t2270+t2271+t2272+t2273+t2274+t2275+t2276+t2277+t2279; double t706 = exp(x1493); double t2281 = t399*x1502; double t2282 = t400*x1510; double t2283 = t402*x1517; double t2284 = t403*x1523; double t2285 = t404*x1528; double t2286 = t405*x1532; double t2287 = t406*x1535; double t2288 = t410*t706; double t413 = t2281+t2282+t2283+t2284+t2285+t2286+t2287+t2288; double t704 = exp(x1491); double t2290 = t399*x1500; double t2291 = t400*x1508; double t2292 = t402*x1515; double t2293 = t403*x1521; double t2294 = t404*x1526; double t2295 = t405*t704; double t414 = t2290+t2291+t2292+t2293+t2294+t2295; double t702 = exp(x1489); double t2297 = t399*x1498; double t2298 = t400*x1506; double t2299 = t402*x1513; double t2300 = t403*t702; double t415 = t2297+t2298+t2299+t2300; double t417 = data1-x256; double t418 = data2-x257; double t709 = exp(x1542); double t2304 = t417*x1551; double t2305 = t418*t709; double t416 = t2304+t2305; double t420 = data3-x258; double t421 = data4-x259; double t422 = data5-x260; double t423 = data6-x261; double t424 = data7-x262; double t428 = data8-x263; double t429 = data9-x264; double t716 = exp(x1549); double t2307 = t417*x1558; double t2308 = t418*x1566; double t2309 = t420*x1573; double t2310 = t421*x1579; double t2311 = t422*x1584; double t2312 = t423*x1588; double t2313 = t424*x1591; double t2314 = t428*x1593; double t2315 = t429*t716; double t419 = t2307+t2308+t2309+t2310+t2311+t2312+t2313+t2314+t2315; double t714 = exp(x1547); double t2317 = t417*x1556; double t2318 = t418*x1564; double t2319 = t420*x1571; double t2320 = t421*x1577; double t2321 = t422*x1582; double t2322 = t423*x1586; double t2323 = t424*t714; double t425 = t2317+t2318+t2319+t2320+t2321+t2322+t2323; double t712 = exp(x1545); double t2325 = t417*x1554; double t2326 = t418*x1562; double t2327 = t420*x1569; double t2328 = t421*x1575; double t2329 = t422*t712; double t426 = t2325+t2326+t2327+t2328+t2329; double t710 = exp(x1543); double t2331 = t417*x1552; double t2332 = t418*x1560; double t2333 = t420*t710; double t427 = t2331+t2332+t2333; double t717 = exp(x1550); double t2336 = t417*x1559; double t2337 = t418*x1567; double t2338 = t420*x1574; double t2339 = t421*x1580; double t2340 = t422*x1585; double t2341 = t423*x1589; double t2342 = t424*x1592; double t2343 = t428*x1594; double t2344 = t429*x1595; double t2345 = data10-x265; double t2346 = t717*t2345; double t430 = t2336+t2337+t2338+t2339+t2340+t2341+t2342+t2343+t2344+t2346; double t715 = exp(x1548); double t2348 = t417*x1557; double t2349 = t418*x1565; double t2350 = t420*x1572; double t2351 = t421*x1578; double t2352 = t422*x1583; double t2353 = t423*x1587; double t2354 = t424*x1590; double t2355 = t428*t715; double t431 = t2348+t2349+t2350+t2351+t2352+t2353+t2354+t2355; double t713 = exp(x1546); double t2357 = t417*x1555; double t2358 = t418*x1563; double t2359 = t420*x1570; double t2360 = t421*x1576; double t2361 = t422*x1581; double t2362 = t423*t713; double t432 = t2357+t2358+t2359+t2360+t2361+t2362; double t711 = exp(x1544); double t2364 = t417*x1553; double t2365 = t418*x1561; double t2366 = t420*x1568; double t2367 = t421*t711; double t433 = t2364+t2365+t2366+t2367; double t435 = data1-x266; double t436 = data2-x267; double t718 = exp(x1597); double t2371 = t435*x1606; double t2372 = t436*t718; double t434 = t2371+t2372; double t438 = data3-x268; double t439 = data4-x269; double t440 = data5-x270; double t441 = data6-x271; double t442 = data7-x272; double t446 = data8-x273; double t447 = data9-x274; double t725 = exp(x1604); double t2374 = t435*x1613; double t2375 = t436*x1621; double t2376 = t438*x1628; double t2377 = t439*x1634; double t2378 = t440*x1639; double t2379 = t441*x1643; double t2380 = t442*x1646; double t2381 = t446*x1648; double t2382 = t447*t725; double t437 = t2374+t2375+t2376+t2377+t2378+t2379+t2380+t2381+t2382; double t723 = exp(x1602); double t2384 = t435*x1611; double t2385 = t436*x1619; double t2386 = t438*x1626; double t2387 = t439*x1632; double t2388 = t440*x1637; double t2389 = t441*x1641; double t2390 = t442*t723; double t443 = t2384+t2385+t2386+t2387+t2388+t2389+t2390; double t721 = exp(x1600); double t2392 = t435*x1609; double t2393 = t436*x1617; double t2394 = t438*x1624; double t2395 = t439*x1630; double t2396 = t440*t721; double t444 = t2392+t2393+t2394+t2395+t2396; double t719 = exp(x1598); double t2398 = t435*x1607; double t2399 = t436*x1615; double t2400 = t438*t719; double t445 = t2398+t2399+t2400; double t726 = exp(x1605); double t2403 = t435*x1614; double t2404 = t436*x1622; double t2405 = t438*x1629; double t2406 = t439*x1635; double t2407 = t440*x1640; double t2408 = t441*x1644; double t2409 = t442*x1647; double t2410 = t446*x1649; double t2411 = t447*x1650; double t2412 = data10-x275; double t2413 = t726*t2412; double t448 = t2403+t2404+t2405+t2406+t2407+t2408+t2409+t2410+t2411+t2413; double t724 = exp(x1603); double t2415 = t435*x1612; double t2416 = t436*x1620; double t2417 = t438*x1627; double t2418 = t439*x1633; double t2419 = t440*x1638; double t2420 = t441*x1642; double t2421 = t442*x1645; double t2422 = t446*t724; double t449 = t2415+t2416+t2417+t2418+t2419+t2420+t2421+t2422; double t722 = exp(x1601); double t2424 = t435*x1610; double t2425 = t436*x1618; double t2426 = t438*x1625; double t2427 = t439*x1631; double t2428 = t440*x1636; double t2429 = t441*t722; double t450 = t2424+t2425+t2426+t2427+t2428+t2429; double t720 = exp(x1599); double t2431 = t435*x1608; double t2432 = t436*x1616; double t2433 = t438*x1623; double t2434 = t439*t720; double t451 = t2431+t2432+t2433+t2434; double t452 = x276*2.0; double t453 = exp(t452); double t454 = x331*2.0; double t455 = exp(t454); double t456 = x386*2.0; double t457 = exp(t456); double t458 = x441*2.0; double t459 = exp(t458); double t460 = x496*2.0; double t461 = exp(t460); double t462 = x551*2.0; double t463 = exp(t462); double t464 = x606*2.0; double t465 = exp(t464); double t466 = x661*2.0; double t467 = exp(t466); double t468 = x716*2.0; double t469 = exp(t468); double t470 = x771*2.0; double t471 = exp(t470); double t472 = x826*2.0; double t473 = exp(t472); double t474 = x881*2.0; double t475 = exp(t474); double t476 = x936*2.0; double t477 = exp(t476); double t478 = x991*2.0; double t479 = exp(t478); double t480 = x1046*2.0; double t481 = exp(t480); double t482 = x1101*2.0; double t483 = exp(t482); double t484 = x1156*2.0; double t485 = exp(t484); double t486 = x1211*2.0; double t487 = exp(t486); double t488 = x1266*2.0; double t489 = exp(t488); double t490 = x1321*2.0; double t491 = exp(t490); double t492 = x1376*2.0; double t493 = exp(t492); double t494 = x1431*2.0; double t495 = exp(t494); double t496 = x1486*2.0; double t497 = exp(t496); double t498 = x1541*2.0; double t499 = exp(t498); double t500 = x1596*2.0; double t501 = exp(t500); double t727 = exp(x1); double t728 = exp(x2); double t729 = exp(x3); double t730 = exp(x4); double t731 = exp(x5); double t732 = exp(x6); double t733 = exp(x7); double t734 = exp(x8); double t735 = exp(x9); double t736 = exp(x10); double t737 = exp(x11); double t738 = exp(x12); double t739 = exp(x13); double t740 = exp(x14); double t741 = exp(x15); double t742 = exp(x16); double t743 = exp(x17); double t744 = exp(x18); double t745 = exp(x19); double t746 = exp(x20); double t747 = exp(x21); double t748 = exp(x22); double t749 = exp(x23); double t750 = exp(x24); double t751 = exp(x25); double t752 = t727+t728+t729+t730+t731+t732+t733+t734+t735+t736+t737+t738+t739+t740+t741+t742+t743+t744+t745+t746+t747+t748+t749+t750+t751; double t755 = t2*t2; double t765 = t5*t5; double t773 = t11*t11; double t779 = t12*t12; double t783 = t13*t13; double t784 = t3*t3; double t796 = t16*t16; double t805 = t17*t17; double t812 = t18*t18; double t817 = t19*t19; double t820 = t755*(1.0/2.0); double t821 = t765*(1.0/2.0); double t822 = t773*(1.0/2.0); double t823 = t779*(1.0/2.0); double t824 = t783*(1.0/2.0); double t825 = t453*t784*(1.0/2.0); double t826 = t796*(1.0/2.0); double t827 = t805*(1.0/2.0); double t828 = t812*(1.0/2.0); double t829 = t817*(1.0/2.0); double t818 = -data11-t820-t821-t822-t823-t824-t825-t826-t827-t828-t829+x1+x276+x277+x278+x279+x280+x281+x282+x283+x284+x285; double t819 = exp(t818); double t832 = t20*t20; double t842 = t23*t23; double t850 = t29*t29; double t856 = t30*t30; double t860 = t31*t31; double t861 = t21*t21; double t873 = t34*t34; double t882 = t35*t35; double t889 = t36*t36; double t894 = t37*t37; double t2440 = t832*(1.0/2.0); double t2441 = t842*(1.0/2.0); double t2442 = t850*(1.0/2.0); double t2443 = t856*(1.0/2.0); double t2444 = t860*(1.0/2.0); double t2445 = t455*t861*(1.0/2.0); double t2446 = t873*(1.0/2.0); double t2447 = t882*(1.0/2.0); double t2448 = t889*(1.0/2.0); double t2449 = t894*(1.0/2.0); double t895 = -data11-t2440-t2441-t2442-t2443-t2444-t2445-t2446-t2447-t2448-t2449+x2+x331+x332+x333+x334+x335+x336+x337+x338+x339+x340; double t896 = exp(t895); double t899 = t38*t38; double t909 = t41*t41; double t917 = t47*t47; double t923 = t48*t48; double t927 = t49*t49; double t928 = t39*t39; double t940 = t52*t52; double t949 = t53*t53; double t956 = t54*t54; double t961 = t55*t55; double t2450 = t899*(1.0/2.0); double t2451 = t909*(1.0/2.0); double t2452 = t917*(1.0/2.0); double t2453 = t923*(1.0/2.0); double t2454 = t927*(1.0/2.0); double t2455 = t457*t928*(1.0/2.0); double t2456 = t940*(1.0/2.0); double t2457 = t949*(1.0/2.0); double t2458 = t956*(1.0/2.0); double t2459 = t961*(1.0/2.0); double t962 = -data11-t2450-t2451-t2452-t2453-t2454-t2455-t2456-t2457-t2458-t2459+x3+x386+x387+x388+x389+x390+x391+x392+x393+x394+x395; double t963 = exp(t962); double t966 = t56*t56; double t976 = t59*t59; double t984 = t65*t65; double t990 = t66*t66; double t994 = t67*t67; double t995 = t57*t57; double t1007 = t70*t70; double t1016 = t71*t71; double t1023 = t72*t72; double t1028 = t73*t73; double t2460 = t966*(1.0/2.0); double t2461 = t976*(1.0/2.0); double t2462 = t984*(1.0/2.0); double t2463 = t990*(1.0/2.0); double t2464 = t994*(1.0/2.0); double t2465 = t459*t995*(1.0/2.0); double t2466 = t1007*(1.0/2.0); double t2467 = t1016*(1.0/2.0); double t2468 = t1023*(1.0/2.0); double t2469 = t1028*(1.0/2.0); double t1029 = -data11-t2460-t2461-t2462-t2463-t2464-t2465-t2466-t2467-t2468-t2469+x4+x441+x442+x443+x444+x445+x446+x447+x448+x449+x450; double t1030 = exp(t1029); double t1033 = t74*t74; double t1043 = t77*t77; double t1051 = t83*t83; double t1057 = t84*t84; double t1061 = t85*t85; double t1062 = t75*t75; double t1074 = t88*t88; double t1083 = t89*t89; double t1090 = t90*t90; double t1095 = t91*t91; double t2470 = t1033*(1.0/2.0); double t2471 = t1043*(1.0/2.0); double t2472 = t1051*(1.0/2.0); double t2473 = t1057*(1.0/2.0); double t2474 = t1061*(1.0/2.0); double t2475 = t461*t1062*(1.0/2.0); double t2476 = t1074*(1.0/2.0); double t2477 = t1083*(1.0/2.0); double t2478 = t1090*(1.0/2.0); double t2479 = t1095*(1.0/2.0); double t1096 = -data11-t2470-t2471-t2472-t2473-t2474-t2475-t2476-t2477-t2478-t2479+x5+x496+x497+x498+x499+x500+x501+x502+x503+x504+x505; double t1097 = exp(t1096); double t1100 = t92*t92; double t1110 = t95*t95; double t1118 = t101*t101; double t1124 = t102*t102; double t1128 = t103*t103; double t1129 = t93*t93; double t1141 = t106*t106; double t1150 = t107*t107; double t1157 = t108*t108; double t1162 = t109*t109; double t2480 = t1100*(1.0/2.0); double t2481 = t1110*(1.0/2.0); double t2482 = t1118*(1.0/2.0); double t2483 = t1124*(1.0/2.0); double t2484 = t1128*(1.0/2.0); double t2485 = t463*t1129*(1.0/2.0); double t2486 = t1141*(1.0/2.0); double t2487 = t1150*(1.0/2.0); double t2488 = t1157*(1.0/2.0); double t2489 = t1162*(1.0/2.0); double t1163 = -data11-t2480-t2481-t2482-t2483-t2484-t2485-t2486-t2487-t2488-t2489+x6+x551+x552+x553+x554+x555+x556+x557+x558+x559+x560; double t1164 = exp(t1163); double t1167 = t110*t110; double t1177 = t113*t113; double t1185 = t119*t119; double t1191 = t120*t120; double t1195 = t121*t121; double t1196 = t111*t111; double t1208 = t124*t124; double t1217 = t125*t125; double t1224 = t126*t126; double t1229 = t127*t127; double t2490 = t1167*(1.0/2.0); double t2491 = t1177*(1.0/2.0); double t2492 = t1185*(1.0/2.0); double t2493 = t1191*(1.0/2.0); double t2494 = t1195*(1.0/2.0); double t2495 = t465*t1196*(1.0/2.0); double t2496 = t1208*(1.0/2.0); double t2497 = t1217*(1.0/2.0); double t2498 = t1224*(1.0/2.0); double t2499 = t1229*(1.0/2.0); double t1230 = -data11-t2490-t2491-t2492-t2493-t2494-t2495-t2496-t2497-t2498-t2499+x7+x606+x607+x608+x609+x610+x611+x612+x613+x614+x615; double t1231 = exp(t1230); double t1234 = t128*t128; double t1244 = t131*t131; double t1252 = t137*t137; double t1258 = t138*t138; double t1262 = t139*t139; double t1263 = t129*t129; double t1275 = t142*t142; double t1284 = t143*t143; double t1291 = t144*t144; double t1296 = t145*t145; double t2500 = t1234*(1.0/2.0); double t2501 = t1244*(1.0/2.0); double t2502 = t1252*(1.0/2.0); double t2503 = t1258*(1.0/2.0); double t2504 = t1262*(1.0/2.0); double t2505 = t467*t1263*(1.0/2.0); double t2506 = t1275*(1.0/2.0); double t2507 = t1284*(1.0/2.0); double t2508 = t1291*(1.0/2.0); double t2509 = t1296*(1.0/2.0); double t1297 = -data11-t2500-t2501-t2502-t2503-t2504-t2505-t2506-t2507-t2508-t2509+x8+x661+x662+x663+x664+x665+x666+x667+x668+x669+x670; double t1298 = exp(t1297); double t1301 = t146*t146; double t1311 = t149*t149; double t1319 = t155*t155; double t1325 = t156*t156; double t1329 = t157*t157; double t1330 = t147*t147; double t1342 = t160*t160; double t1351 = t161*t161; double t1358 = t162*t162; double t1363 = t163*t163; double t2510 = t1301*(1.0/2.0); double t2511 = t1311*(1.0/2.0); double t2512 = t1319*(1.0/2.0); double t2513 = t1325*(1.0/2.0); double t2514 = t1329*(1.0/2.0); double t2515 = t469*t1330*(1.0/2.0); double t2516 = t1342*(1.0/2.0); double t2517 = t1351*(1.0/2.0); double t2518 = t1358*(1.0/2.0); double t2519 = t1363*(1.0/2.0); double t1364 = -data11-t2510-t2511-t2512-t2513-t2514-t2515-t2516-t2517-t2518-t2519+x9+x716+x717+x718+x719+x720+x721+x722+x723+x724+x725; double t1365 = exp(t1364); double t1368 = t164*t164; double t1378 = t167*t167; double t1386 = t173*t173; double t1392 = t174*t174; double t1396 = t175*t175; double t1397 = t165*t165; double t1409 = t178*t178; double t1418 = t179*t179; double t1425 = t180*t180; double t1430 = t181*t181; double t2520 = t1368*(1.0/2.0); double t2521 = t1378*(1.0/2.0); double t2522 = t1386*(1.0/2.0); double t2523 = t1392*(1.0/2.0); double t2524 = t1396*(1.0/2.0); double t2525 = t471*t1397*(1.0/2.0); double t2526 = t1409*(1.0/2.0); double t2527 = t1418*(1.0/2.0); double t2528 = t1425*(1.0/2.0); double t2529 = t1430*(1.0/2.0); double t1431 = -data11-t2520-t2521-t2522-t2523-t2524-t2525-t2526-t2527-t2528-t2529+x10+x771+x772+x773+x774+x775+x776+x777+x778+x779+x780; double t1432 = exp(t1431); double t1435 = t182*t182; double t1445 = t185*t185; double t1453 = t191*t191; double t1459 = t192*t192; double t1463 = t193*t193; double t1464 = t183*t183; double t1476 = t196*t196; double t1485 = t197*t197; double t1492 = t198*t198; double t1497 = t199*t199; double t2530 = t1435*(1.0/2.0); double t2531 = t1445*(1.0/2.0); double t2532 = t1453*(1.0/2.0); double t2533 = t1459*(1.0/2.0); double t2534 = t1463*(1.0/2.0); double t2535 = t473*t1464*(1.0/2.0); double t2536 = t1476*(1.0/2.0); double t2537 = t1485*(1.0/2.0); double t2538 = t1492*(1.0/2.0); double t2539 = t1497*(1.0/2.0); double t1498 = -data11-t2530-t2531-t2532-t2533-t2534-t2535-t2536-t2537-t2538-t2539+x11+x826+x827+x828+x829+x830+x831+x832+x833+x834+x835; double t1499 = exp(t1498); double t1502 = t200*t200; double t1512 = t203*t203; double t1520 = t209*t209; double t1526 = t210*t210; double t1530 = t211*t211; double t1531 = t201*t201; double t1543 = t214*t214; double t1552 = t215*t215; double t1559 = t216*t216; double t1564 = t217*t217; double t2540 = t1502*(1.0/2.0); double t2541 = t1512*(1.0/2.0); double t2542 = t1520*(1.0/2.0); double t2543 = t1526*(1.0/2.0); double t2544 = t1530*(1.0/2.0); double t2545 = t475*t1531*(1.0/2.0); double t2546 = t1543*(1.0/2.0); double t2547 = t1552*(1.0/2.0); double t2548 = t1559*(1.0/2.0); double t2549 = t1564*(1.0/2.0); double t1565 = -data11-t2540-t2541-t2542-t2543-t2544-t2545-t2546-t2547-t2548-t2549+x12+x881+x882+x883+x884+x885+x886+x887+x888+x889+x890; double t1566 = exp(t1565); double t1569 = t218*t218; double t1579 = t221*t221; double t1587 = t227*t227; double t1593 = t228*t228; double t1597 = t229*t229; double t1598 = t219*t219; double t1610 = t232*t232; double t1619 = t233*t233; double t1626 = t234*t234; double t1631 = t235*t235; double t2550 = t1569*(1.0/2.0); double t2551 = t1579*(1.0/2.0); double t2552 = t1587*(1.0/2.0); double t2553 = t1593*(1.0/2.0); double t2554 = t1597*(1.0/2.0); double t2555 = t477*t1598*(1.0/2.0); double t2556 = t1610*(1.0/2.0); double t2557 = t1619*(1.0/2.0); double t2558 = t1626*(1.0/2.0); double t2559 = t1631*(1.0/2.0); double t1632 = -data11-t2550-t2551-t2552-t2553-t2554-t2555-t2556-t2557-t2558-t2559+x13+x936+x937+x938+x939+x940+x941+x942+x943+x944+x945; double t1633 = exp(t1632); double t1636 = t236*t236; double t1646 = t239*t239; double t1654 = t245*t245; double t1660 = t246*t246; double t1664 = t247*t247; double t1665 = t237*t237; double t1677 = t250*t250; double t1686 = t251*t251; double t1693 = t252*t252; double t1698 = t253*t253; double t2560 = t1636*(1.0/2.0); double t2561 = t1646*(1.0/2.0); double t2562 = t1654*(1.0/2.0); double t2563 = t1660*(1.0/2.0); double t2564 = t1664*(1.0/2.0); double t2565 = t479*t1665*(1.0/2.0); double t2566 = t1677*(1.0/2.0); double t2567 = t1686*(1.0/2.0); double t2568 = t1693*(1.0/2.0); double t2569 = t1698*(1.0/2.0); double t1699 = -data11-t2560-t2561-t2562-t2563-t2564-t2565-t2566-t2567-t2568-t2569+x14+x991+x992+x993+x994+x995+x996+x997+x998+x999+x1000; double t1700 = exp(t1699); double t1703 = t254*t254; double t1713 = t257*t257; double t1721 = t263*t263; double t1727 = t264*t264; double t1731 = t265*t265; double t1732 = t255*t255; double t1744 = t268*t268; double t1753 = t269*t269; double t1760 = t270*t270; double t1765 = t271*t271; double t2570 = t1703*(1.0/2.0); double t2571 = t1713*(1.0/2.0); double t2572 = t1721*(1.0/2.0); double t2573 = t1727*(1.0/2.0); double t2574 = t1731*(1.0/2.0); double t2575 = t481*t1732*(1.0/2.0); double t2576 = t1744*(1.0/2.0); double t2577 = t1753*(1.0/2.0); double t2578 = t1760*(1.0/2.0); double t2579 = t1765*(1.0/2.0); double t1766 = -data11-t2570-t2571-t2572-t2573-t2574-t2575-t2576-t2577-t2578-t2579+x15+x1046+x1047+x1048+x1049+x1050+x1051+x1052+x1053+x1054+x1055; double t1767 = exp(t1766); double t1770 = t272*t272; double t1780 = t275*t275; double t1788 = t281*t281; double t1794 = t282*t282; double t1798 = t283*t283; double t1799 = t273*t273; double t1811 = t286*t286; double t1820 = t287*t287; double t1827 = t288*t288; double t1832 = t289*t289; double t2580 = t1770*(1.0/2.0); double t2581 = t1780*(1.0/2.0); double t2582 = t1788*(1.0/2.0); double t2583 = t1794*(1.0/2.0); double t2584 = t1798*(1.0/2.0); double t2585 = t483*t1799*(1.0/2.0); double t2586 = t1811*(1.0/2.0); double t2587 = t1820*(1.0/2.0); double t2588 = t1827*(1.0/2.0); double t2589 = t1832*(1.0/2.0); double t1833 = -data11-t2580-t2581-t2582-t2583-t2584-t2585-t2586-t2587-t2588-t2589+x16+x1101+x1102+x1103+x1104+x1105+x1106+x1107+x1108+x1109+x1110; double t1834 = exp(t1833); double t1837 = t290*t290; double t1847 = t293*t293; double t1855 = t299*t299; double t1861 = t300*t300; double t1865 = t301*t301; double t1866 = t291*t291; double t1878 = t304*t304; double t1887 = t305*t305; double t1894 = t306*t306; double t1899 = t307*t307; double t2590 = t1837*(1.0/2.0); double t2591 = t1847*(1.0/2.0); double t2592 = t1855*(1.0/2.0); double t2593 = t1861*(1.0/2.0); double t2594 = t1865*(1.0/2.0); double t2595 = t485*t1866*(1.0/2.0); double t2596 = t1878*(1.0/2.0); double t2597 = t1887*(1.0/2.0); double t2598 = t1894*(1.0/2.0); double t2599 = t1899*(1.0/2.0); double t1900 = -data11-t2590-t2591-t2592-t2593-t2594-t2595-t2596-t2597-t2598-t2599+x17+x1156+x1157+x1158+x1159+x1160+x1161+x1162+x1163+x1164+x1165; double t1901 = exp(t1900); double t1904 = t308*t308; double t1914 = t311*t311; double t1922 = t317*t317; double t1928 = t318*t318; double t1932 = t319*t319; double t1933 = t309*t309; double t1945 = t322*t322; double t1954 = t323*t323; double t1961 = t324*t324; double t1966 = t325*t325; double t2600 = t1904*(1.0/2.0); double t2601 = t1914*(1.0/2.0); double t2602 = t1922*(1.0/2.0); double t2603 = t1928*(1.0/2.0); double t2604 = t1932*(1.0/2.0); double t2605 = t487*t1933*(1.0/2.0); double t2606 = t1945*(1.0/2.0); double t2607 = t1954*(1.0/2.0); double t2608 = t1961*(1.0/2.0); double t2609 = t1966*(1.0/2.0); double t1967 = -data11-t2600-t2601-t2602-t2603-t2604-t2605-t2606-t2607-t2608-t2609+x18+x1211+x1212+x1213+x1214+x1215+x1216+x1217+x1218+x1219+x1220; double t1968 = exp(t1967); double t1971 = t326*t326; double t1981 = t329*t329; double t1989 = t335*t335; double t1995 = t336*t336; double t1999 = t337*t337; double t2000 = t327*t327; double t2012 = t340*t340; double t2021 = t341*t341; double t2028 = t342*t342; double t2033 = t343*t343; double t2610 = t1971*(1.0/2.0); double t2611 = t1981*(1.0/2.0); double t2612 = t1989*(1.0/2.0); double t2613 = t1995*(1.0/2.0); double t2614 = t1999*(1.0/2.0); double t2615 = t489*t2000*(1.0/2.0); double t2616 = t2012*(1.0/2.0); double t2617 = t2021*(1.0/2.0); double t2618 = t2028*(1.0/2.0); double t2619 = t2033*(1.0/2.0); double t2034 = -data11-t2610-t2611-t2612-t2613-t2614-t2615-t2616-t2617-t2618-t2619+x19+x1266+x1267+x1268+x1269+x1270+x1271+x1272+x1273+x1274+x1275; double t2035 = exp(t2034); double t2038 = t344*t344; double t2048 = t347*t347; double t2056 = t353*t353; double t2062 = t354*t354; double t2066 = t355*t355; double t2067 = t345*t345; double t2079 = t358*t358; double t2088 = t359*t359; double t2095 = t360*t360; double t2100 = t361*t361; double t2620 = t2038*(1.0/2.0); double t2621 = t2048*(1.0/2.0); double t2622 = t2056*(1.0/2.0); double t2623 = t2062*(1.0/2.0); double t2624 = t2066*(1.0/2.0); double t2625 = t491*t2067*(1.0/2.0); double t2626 = t2079*(1.0/2.0); double t2627 = t2088*(1.0/2.0); double t2628 = t2095*(1.0/2.0); double t2629 = t2100*(1.0/2.0); double t2101 = -data11-t2620-t2621-t2622-t2623-t2624-t2625-t2626-t2627-t2628-t2629+x20+x1321+x1322+x1323+x1324+x1325+x1326+x1327+x1328+x1329+x1330; double t2102 = exp(t2101); double t2105 = t362*t362; double t2115 = t365*t365; double t2123 = t371*t371; double t2129 = t372*t372; double t2133 = t373*t373; double t2134 = t363*t363; double t2146 = t376*t376; double t2155 = t377*t377; double t2162 = t378*t378; double t2167 = t379*t379; double t2630 = t2105*(1.0/2.0); double t2631 = t2115*(1.0/2.0); double t2632 = t2123*(1.0/2.0); double t2633 = t2129*(1.0/2.0); double t2634 = t2133*(1.0/2.0); double t2635 = t493*t2134*(1.0/2.0); double t2636 = t2146*(1.0/2.0); double t2637 = t2155*(1.0/2.0); double t2638 = t2162*(1.0/2.0); double t2639 = t2167*(1.0/2.0); double t2168 = -data11-t2630-t2631-t2632-t2633-t2634-t2635-t2636-t2637-t2638-t2639+x21+x1376+x1377+x1378+x1379+x1380+x1381+x1382+x1383+x1384+x1385; double t2169 = exp(t2168); double t2172 = t380*t380; double t2182 = t383*t383; double t2190 = t389*t389; double t2196 = t390*t390; double t2200 = t391*t391; double t2201 = t381*t381; double t2213 = t394*t394; double t2222 = t395*t395; double t2229 = t396*t396; double t2234 = t397*t397; double t2640 = t2172*(1.0/2.0); double t2641 = t2182*(1.0/2.0); double t2642 = t2190*(1.0/2.0); double t2643 = t2196*(1.0/2.0); double t2644 = t2200*(1.0/2.0); double t2645 = t495*t2201*(1.0/2.0); double t2646 = t2213*(1.0/2.0); double t2647 = t2222*(1.0/2.0); double t2648 = t2229*(1.0/2.0); double t2649 = t2234*(1.0/2.0); double t2235 = -data11-t2640-t2641-t2642-t2643-t2644-t2645-t2646-t2647-t2648-t2649+x22+x1431+x1432+x1433+x1434+x1435+x1436+x1437+x1438+x1439+x1440; double t2236 = exp(t2235); double t2239 = t398*t398; double t2249 = t401*t401; double t2257 = t407*t407; double t2263 = t408*t408; double t2267 = t409*t409; double t2268 = t399*t399; double t2280 = t412*t412; double t2289 = t413*t413; double t2296 = t414*t414; double t2301 = t415*t415; double t2650 = t2239*(1.0/2.0); double t2651 = t2249*(1.0/2.0); double t2652 = t2257*(1.0/2.0); double t2653 = t2263*(1.0/2.0); double t2654 = t2267*(1.0/2.0); double t2655 = t497*t2268*(1.0/2.0); double t2656 = t2280*(1.0/2.0); double t2657 = t2289*(1.0/2.0); double t2658 = t2296*(1.0/2.0); double t2659 = t2301*(1.0/2.0); double t2302 = -data11-t2650-t2651-t2652-t2653-t2654-t2655-t2656-t2657-t2658-t2659+x23+x1486+x1487+x1488+x1489+x1490+x1491+x1492+x1493+x1494+x1495; double t2303 = exp(t2302); double t2306 = t416*t416; double t2316 = t419*t419; double t2324 = t425*t425; double t2330 = t426*t426; double t2334 = t427*t427; double t2335 = t417*t417; double t2347 = t430*t430; double t2356 = t431*t431; double t2363 = t432*t432; double t2368 = t433*t433; double t2660 = t2306*(1.0/2.0); double t2661 = t2316*(1.0/2.0); double t2662 = t2324*(1.0/2.0); double t2663 = t2330*(1.0/2.0); double t2664 = t2334*(1.0/2.0); double t2665 = t499*t2335*(1.0/2.0); double t2666 = t2347*(1.0/2.0); double t2667 = t2356*(1.0/2.0); double t2668 = t2363*(1.0/2.0); double t2669 = t2368*(1.0/2.0); double t2369 = -data11-t2660-t2661-t2662-t2663-t2664-t2665-t2666-t2667-t2668-t2669+x24+x1541+x1542+x1543+x1544+x1545+x1546+x1547+x1548+x1549+x1550; double t2370 = exp(t2369); double t2373 = t434*t434; double t2383 = t437*t437; double t2391 = t443*t443; double t2397 = t444*t444; double t2401 = t445*t445; double t2402 = t435*t435; double t2414 = t448*t448; double t2423 = t449*t449; double t2430 = t450*t450; double t2435 = t451*t451; double t2670 = t2373*(1.0/2.0); double t2671 = t2383*(1.0/2.0); double t2672 = t2391*(1.0/2.0); double t2673 = t2397*(1.0/2.0); double t2674 = t2401*(1.0/2.0); double t2675 = t501*t2402*(1.0/2.0); double t2676 = t2414*(1.0/2.0); double t2677 = t2423*(1.0/2.0); double t2678 = t2430*(1.0/2.0); double t2679 = t2435*(1.0/2.0); double t2436 = -data11-t2670-t2671-t2672-t2673-t2674-t2675-t2676-t2677-t2678-t2679+x25+x1596+x1597+x1598+x1599+x1600+x1601+x1602+x1603+x1604+x1605; double t2437 = exp(t2436); double t2438 = t819+t896+t963+t1030+t1097+t1164+t1231+t1298+t1365+t1432+t1499+t1566+t1633+t1700+t1767+t1834+t1901+t1968+t2035+t2102+t2169+t2236+t2303+t2370+t2437; double t2439 = 1.0/t752; double t2680 = 1.0/t2438; double t2681 = data1*2.0; double t2682 = exp(x276); double t2683 = x277*2.0; double t2684 = exp(t2683); double t2685 = x278*2.0; double t2686 = exp(t2685); double t2687 = x279*2.0; double t2688 = exp(t2687); double t2689 = x280*2.0; double t2690 = exp(t2689); double t2691 = x281*2.0; double t2692 = exp(t2691); double t2693 = x282*2.0; double t2694 = exp(t2693); double t2695 = x283*2.0; double t2696 = exp(t2695); double t2697 = x284*2.0; double t2698 = exp(t2697); double t2699 = x285*2.0; double t2700 = exp(t2699); double t2701 = exp(x331); double t2702 = x332*2.0; double t2703 = exp(t2702); double t2704 = x333*2.0; double t2705 = exp(t2704); double t2706 = x334*2.0; double t2707 = exp(t2706); double t2708 = x335*2.0; double t2709 = exp(t2708); double t2710 = x336*2.0; double t2711 = exp(t2710); double t2712 = x337*2.0; double t2713 = exp(t2712); double t2714 = x338*2.0; double t2715 = exp(t2714); double t2716 = x339*2.0; double t2717 = exp(t2716); double t2718 = x340*2.0; double t2719 = exp(t2718); double t2720 = exp(x386); double t2721 = x387*2.0; double t2722 = exp(t2721); double t2723 = x388*2.0; double t2724 = exp(t2723); double t2725 = x389*2.0; double t2726 = exp(t2725); double t2727 = x390*2.0; double t2728 = exp(t2727); double t2729 = x391*2.0; double t2730 = exp(t2729); double t2731 = x392*2.0; double t2732 = exp(t2731); double t2733 = x393*2.0; double t2734 = exp(t2733); double t2735 = x394*2.0; double t2736 = exp(t2735); double t2737 = x395*2.0; double t2738 = exp(t2737); double t2739 = exp(x441); double t2740 = x442*2.0; double t2741 = exp(t2740); double t2742 = x443*2.0; double t2743 = exp(t2742); double t2744 = x444*2.0; double t2745 = exp(t2744); double t2746 = x445*2.0; double t2747 = exp(t2746); double t2748 = x446*2.0; double t2749 = exp(t2748); double t2750 = x447*2.0; double t2751 = exp(t2750); double t2752 = x448*2.0; double t2753 = exp(t2752); double t2754 = x449*2.0; double t2755 = exp(t2754); double t2756 = x450*2.0; double t2757 = exp(t2756); double t2758 = exp(x496); double t2759 = x497*2.0; double t2760 = exp(t2759); double t2761 = x498*2.0; double t2762 = exp(t2761); double t2763 = x499*2.0; double t2764 = exp(t2763); double t2765 = x500*2.0; double t2766 = exp(t2765); double t2767 = x501*2.0; double t2768 = exp(t2767); double t2769 = x502*2.0; double t2770 = exp(t2769); double t2771 = x503*2.0; double t2772 = exp(t2771); double t2773 = x504*2.0; double t2774 = exp(t2773); double t2775 = x505*2.0; double t2776 = exp(t2775); double t2777 = exp(x551); double t2778 = x552*2.0; double t2779 = exp(t2778); double t2780 = x553*2.0; double t2781 = exp(t2780); double t2782 = x554*2.0; double t2783 = exp(t2782); double t2784 = x555*2.0; double t2785 = exp(t2784); double t2786 = x556*2.0; double t2787 = exp(t2786); double t2788 = x557*2.0; double t2789 = exp(t2788); double t2790 = x558*2.0; double t2791 = exp(t2790); double t2792 = x559*2.0; double t2793 = exp(t2792); double t2794 = x560*2.0; double t2795 = exp(t2794); double t2796 = exp(x606); double t2797 = x607*2.0; double t2798 = exp(t2797); double t2799 = x608*2.0; double t2800 = exp(t2799); double t2801 = x609*2.0; double t2802 = exp(t2801); double t2803 = x610*2.0; double t2804 = exp(t2803); double t2805 = x611*2.0; double t2806 = exp(t2805); double t2807 = x612*2.0; double t2808 = exp(t2807); double t2809 = x613*2.0; double t2810 = exp(t2809); double t2811 = x614*2.0; double t2812 = exp(t2811); double t2813 = x615*2.0; double t2814 = exp(t2813); double t2815 = exp(x661); double t2816 = x662*2.0; double t2817 = exp(t2816); double t2818 = x663*2.0; double t2819 = exp(t2818); double t2820 = x664*2.0; double t2821 = exp(t2820); double t2822 = x665*2.0; double t2823 = exp(t2822); double t2824 = x666*2.0; double t2825 = exp(t2824); double t2826 = x667*2.0; double t2827 = exp(t2826); double t2828 = x668*2.0; double t2829 = exp(t2828); double t2830 = x669*2.0; double t2831 = exp(t2830); double t2832 = x670*2.0; double t2833 = exp(t2832); double t2834 = exp(x716); double t2835 = x717*2.0; double t2836 = exp(t2835); double t2837 = x718*2.0; double t2838 = exp(t2837); double t2839 = x719*2.0; double t2840 = exp(t2839); double t2841 = x720*2.0; double t2842 = exp(t2841); double t2843 = x721*2.0; double t2844 = exp(t2843); double t2845 = x722*2.0; double t2846 = exp(t2845); double t2847 = x723*2.0; double t2848 = exp(t2847); double t2849 = x724*2.0; double t2850 = exp(t2849); double t2851 = x725*2.0; double t2852 = exp(t2851); double t2853 = exp(x771); double t2854 = x772*2.0; double t2855 = exp(t2854); double t2856 = x773*2.0; double t2857 = exp(t2856); double t2858 = x774*2.0; double t2859 = exp(t2858); double t2860 = x775*2.0; double t2861 = exp(t2860); double t2862 = x776*2.0; double t2863 = exp(t2862); double t2864 = x777*2.0; double t2865 = exp(t2864); double t2866 = x778*2.0; double t2867 = exp(t2866); double t2868 = x779*2.0; double t2869 = exp(t2868); double t2870 = x780*2.0; double t2871 = exp(t2870); double t2872 = exp(x826); double t2873 = x827*2.0; double t2874 = exp(t2873); double t2875 = x828*2.0; double t2876 = exp(t2875); double t2877 = x829*2.0; double t2878 = exp(t2877); double t2879 = x830*2.0; double t2880 = exp(t2879); double t2881 = x831*2.0; double t2882 = exp(t2881); double t2883 = x832*2.0; double t2884 = exp(t2883); double t2885 = x833*2.0; double t2886 = exp(t2885); double t2887 = x834*2.0; double t2888 = exp(t2887); double t2889 = x835*2.0; double t2890 = exp(t2889); double t2891 = exp(x881); double t2892 = x882*2.0; double t2893 = exp(t2892); double t2894 = x883*2.0; double t2895 = exp(t2894); double t2896 = x884*2.0; double t2897 = exp(t2896); double t2898 = x885*2.0; double t2899 = exp(t2898); double t2900 = x886*2.0; double t2901 = exp(t2900); double t2902 = x887*2.0; double t2903 = exp(t2902); double t2904 = x888*2.0; double t2905 = exp(t2904); double t2906 = x889*2.0; double t2907 = exp(t2906); double t2908 = x890*2.0; double t2909 = exp(t2908); double t2910 = exp(x936); double t2911 = x937*2.0; double t2912 = exp(t2911); double t2913 = x938*2.0; double t2914 = exp(t2913); double t2915 = x939*2.0; double t2916 = exp(t2915); double t2917 = x940*2.0; double t2918 = exp(t2917); double t2919 = x941*2.0; double t2920 = exp(t2919); double t2921 = x942*2.0; double t2922 = exp(t2921); double t2923 = x943*2.0; double t2924 = exp(t2923); double t2925 = x944*2.0; double t2926 = exp(t2925); double t2927 = x945*2.0; double t2928 = exp(t2927); double t2929 = exp(x991); double t2930 = x992*2.0; double t2931 = exp(t2930); double t2932 = x993*2.0; double t2933 = exp(t2932); double t2934 = x994*2.0; double t2935 = exp(t2934); double t2936 = x995*2.0; double t2937 = exp(t2936); double t2938 = x996*2.0; double t2939 = exp(t2938); double t2940 = x997*2.0; double t2941 = exp(t2940); double t2942 = x998*2.0; double t2943 = exp(t2942); double t2944 = x999*2.0; double t2945 = exp(t2944); double t2946 = x1000*2.0; double t2947 = exp(t2946); double t2948 = exp(x1046); double t2949 = x1047*2.0; double t2950 = exp(t2949); double t2951 = x1048*2.0; double t2952 = exp(t2951); double t2953 = x1049*2.0; double t2954 = exp(t2953); double t2955 = x1050*2.0; double t2956 = exp(t2955); double t2957 = x1051*2.0; double t2958 = exp(t2957); double t2959 = x1052*2.0; double t2960 = exp(t2959); double t2961 = x1053*2.0; double t2962 = exp(t2961); double t2963 = x1054*2.0; double t2964 = exp(t2963); double t2965 = x1055*2.0; double t2966 = exp(t2965); double t2967 = exp(x1101); double t2968 = x1102*2.0; double t2969 = exp(t2968); double t2970 = x1103*2.0; double t2971 = exp(t2970); double t2972 = x1104*2.0; double t2973 = exp(t2972); double t2974 = x1105*2.0; double t2975 = exp(t2974); double t2976 = x1106*2.0; double t2977 = exp(t2976); double t2978 = x1107*2.0; double t2979 = exp(t2978); double t2980 = x1108*2.0; double t2981 = exp(t2980); double t2982 = x1109*2.0; double t2983 = exp(t2982); double t2984 = x1110*2.0; double t2985 = exp(t2984); double t2986 = exp(x1156); double t2987 = x1157*2.0; double t2988 = exp(t2987); double t2989 = x1158*2.0; double t2990 = exp(t2989); double t2991 = x1159*2.0; double t2992 = exp(t2991); double t2993 = x1160*2.0; double t2994 = exp(t2993); double t2995 = x1161*2.0; double t2996 = exp(t2995); double t2997 = x1162*2.0; double t2998 = exp(t2997); double t2999 = x1163*2.0; double t3000 = exp(t2999); double t3001 = x1164*2.0; double t3002 = exp(t3001); double t3003 = x1165*2.0; double t3004 = exp(t3003); double t3005 = exp(x1211); double t3006 = x1212*2.0; double t3007 = exp(t3006); double t3008 = x1213*2.0; double t3009 = exp(t3008); double t3010 = x1214*2.0; double t3011 = exp(t3010); double t3012 = x1215*2.0; double t3013 = exp(t3012); double t3014 = x1216*2.0; double t3015 = exp(t3014); double t3016 = x1217*2.0; double t3017 = exp(t3016); double t3018 = x1218*2.0; double t3019 = exp(t3018); double t3020 = x1219*2.0; double t3021 = exp(t3020); double t3022 = x1220*2.0; double t3023 = exp(t3022); double t3024 = exp(x1266); double t3025 = x1267*2.0; double t3026 = exp(t3025); double t3027 = x1268*2.0; double t3028 = exp(t3027); double t3029 = x1269*2.0; double t3030 = exp(t3029); double t3031 = x1270*2.0; double t3032 = exp(t3031); double t3033 = x1271*2.0; double t3034 = exp(t3033); double t3035 = x1272*2.0; double t3036 = exp(t3035); double t3037 = x1273*2.0; double t3038 = exp(t3037); double t3039 = x1274*2.0; double t3040 = exp(t3039); double t3041 = x1275*2.0; double t3042 = exp(t3041); double t3043 = exp(x1321); double t3044 = x1322*2.0; double t3045 = exp(t3044); double t3046 = x1323*2.0; double t3047 = exp(t3046); double t3048 = x1324*2.0; double t3049 = exp(t3048); double t3050 = x1325*2.0; double t3051 = exp(t3050); double t3052 = x1326*2.0; double t3053 = exp(t3052); double t3054 = x1327*2.0; double t3055 = exp(t3054); double t3056 = x1328*2.0; double t3057 = exp(t3056); double t3058 = x1329*2.0; double t3059 = exp(t3058); double t3060 = x1330*2.0; double t3061 = exp(t3060); double t3062 = exp(x1376); double t3063 = x1377*2.0; double t3064 = exp(t3063); double t3065 = x1378*2.0; double t3066 = exp(t3065); double t3067 = x1379*2.0; double t3068 = exp(t3067); double t3069 = x1380*2.0; double t3070 = exp(t3069); double t3071 = x1381*2.0; double t3072 = exp(t3071); double t3073 = x1382*2.0; double t3074 = exp(t3073); double t3075 = x1383*2.0; double t3076 = exp(t3075); double t3077 = x1384*2.0; double t3078 = exp(t3077); double t3079 = x1385*2.0; double t3080 = exp(t3079); double t3081 = exp(x1431); double t3082 = x1432*2.0; double t3083 = exp(t3082); double t3084 = x1433*2.0; double t3085 = exp(t3084); double t3086 = x1434*2.0; double t3087 = exp(t3086); double t3088 = x1435*2.0; double t3089 = exp(t3088); double t3090 = x1436*2.0; double t3091 = exp(t3090); double t3092 = x1437*2.0; double t3093 = exp(t3092); double t3094 = x1438*2.0; double t3095 = exp(t3094); double t3096 = x1439*2.0; double t3097 = exp(t3096); double t3098 = x1440*2.0; double t3099 = exp(t3098); double t3100 = exp(x1486); double t3101 = x1487*2.0; double t3102 = exp(t3101); double t3103 = x1488*2.0; double t3104 = exp(t3103); double t3105 = x1489*2.0; double t3106 = exp(t3105); double t3107 = x1490*2.0; double t3108 = exp(t3107); double t3109 = x1491*2.0; double t3110 = exp(t3109); double t3111 = x1492*2.0; double t3112 = exp(t3111); double t3113 = x1493*2.0; double t3114 = exp(t3113); double t3115 = x1494*2.0; double t3116 = exp(t3115); double t3117 = x1495*2.0; double t3118 = exp(t3117); double t3119 = exp(x1541); double t3120 = x1542*2.0; double t3121 = exp(t3120); double t3122 = x1543*2.0; double t3123 = exp(t3122); double t3124 = x1544*2.0; double t3125 = exp(t3124); double t3126 = x1545*2.0; double t3127 = exp(t3126); double t3128 = x1546*2.0; double t3129 = exp(t3128); double t3130 = x1547*2.0; double t3131 = exp(t3130); double t3132 = x1548*2.0; double t3133 = exp(t3132); double t3134 = x1549*2.0; double t3135 = exp(t3134); double t3136 = x1550*2.0; double t3137 = exp(t3136); double t3138 = exp(x1596); double t3139 = x1597*2.0; double t3140 = exp(t3139); double t3141 = x1598*2.0; double t3142 = exp(t3141); double t3143 = x1599*2.0; double t3144 = exp(t3143); double t3145 = x1600*2.0; double t3146 = exp(t3145); double t3147 = x1601*2.0; double t3148 = exp(t3147); double t3149 = x1602*2.0; double t3150 = exp(t3149); double t3151 = x1603*2.0; double t3152 = exp(t3151); double t3153 = x1604*2.0; double t3154 = exp(t3153); double t3155 = x1605*2.0; double t3156 = exp(t3155); out_ptr[0] = data11-log(t752)+log(t2438)+data12*(t453+t2684+t2686+t2688+t2690+t2692+t2694+t2696+t2698+t2700+x286*x286+x287*x287+x288*x288+x289*x289+x290*x290+x291*x291+x292*x292+x293*x293+x294*x294+x295*x295+x296*x296+x297*x297+x298*x298+x299*x299+x300*x300+x301*x301+x302*x302+x303*x303+x304*x304+x305*x305+x306*x306+x307*x307+x308*x308+x309*x309+x310*x310+x311*x311+x312*x312+x313*x313+x314*x314+x315*x315+x316*x316+x317*x317+x318*x318+x319*x319+x320*x320+x321*x321+x322*x322+x323*x323+x324*x324+x325*x325+x326*x326+x327*x327+x328*x328+x329*x329+x330*x330)+data12*(t455+t2703+t2705+t2707+t2709+t2711+t2713+t2715+t2717+t2719+x341*x341+x342*x342+x343*x343+x344*x344+x345*x345+x346*x346+x347*x347+x348*x348+x349*x349+x350*x350+x351*x351+x352*x352+x353*x353+x354*x354+x355*x355+x356*x356+x357*x357+x358*x358+x359*x359+x360*x360+x361*x361+x362*x362+x363*x363+x364*x364+x365*x365+x366*x366+x367*x367+x368*x368+x369*x369+x370*x370+x371*x371+x372*x372+x373*x373+x374*x374+x375*x375+x376*x376+x377*x377+x378*x378+x379*x379+x380*x380+x381*x381+x382*x382+x383*x383+x384*x384+x385*x385)+data12*(t457+t2722+t2724+t2726+t2728+t2730+t2732+t2734+t2736+t2738+x396*x396+x397*x397+x398*x398+x399*x399+x400*x400+x401*x401+x402*x402+x403*x403+x404*x404+x405*x405+x406*x406+x407*x407+x408*x408+x409*x409+x410*x410+x411*x411+x412*x412+x413*x413+x414*x414+x415*x415+x416*x416+x417*x417+x418*x418+x419*x419+x420*x420+x421*x421+x422*x422+x423*x423+x424*x424+x425*x425+x426*x426+x427*x427+x428*x428+x429*x429+x430*x430+x431*x431+x432*x432+x433*x433+x434*x434+x435*x435+x436*x436+x437*x437+x438*x438+x439*x439+x440*x440)+data12*(t459+t2741+t2743+t2745+t2747+t2749+t2751+t2753+t2755+t2757+x451*x451+x452*x452+x453*x453+x454*x454+x455*x455+x456*x456+x457*x457+x458*x458+x459*x459+x460*x460+x461*x461+x462*x462+x463*x463+x464*x464+x465*x465+x466*x466+x467*x467+x468*x468+x469*x469+x470*x470+x471*x471+x472*x472+x473*x473+x474*x474+x475*x475+x476*x476+x477*x477+x478*x478+x479*x479+x480*x480+x481*x481+x482*x482+x483*x483+x484*x484+x485*x485+x486*x486+x487*x487+x488*x488+x489*x489+x490*x490+x491*x491+x492*x492+x493*x493+x494*x494+x495*x495)+data12*(t461+t2760+t2762+t2764+t2766+t2768+t2770+t2772+t2774+t2776+x506*x506+x507*x507+x508*x508+x509*x509+x510*x510+x511*x511+x512*x512+x513*x513+x514*x514+x515*x515+x516*x516+x517*x517+x518*x518+x519*x519+x520*x520+x521*x521+x522*x522+x523*x523+x524*x524+x525*x525+x526*x526+x527*x527+x528*x528+x529*x529+x530*x530+x531*x531+x532*x532+x533*x533+x534*x534+x535*x535+x536*x536+x537*x537+x538*x538+x539*x539+x540*x540+x541*x541+x542*x542+x543*x543+x544*x544+x545*x545+x546*x546+x547*x547+x548*x548+x549*x549+x550*x550)+data12*(t463+t2779+t2781+t2783+t2785+t2787+t2789+t2791+t2793+t2795+x561*x561+x562*x562+x563*x563+x564*x564+x565*x565+x566*x566+x567*x567+x568*x568+x569*x569+x570*x570+x571*x571+x572*x572+x573*x573+x574*x574+x575*x575+x576*x576+x577*x577+x578*x578+x579*x579+x580*x580+x581*x581+x582*x582+x583*x583+x584*x584+x585*x585+x586*x586+x587*x587+x588*x588+x589*x589+x590*x590+x591*x591+x592*x592+x593*x593+x594*x594+x595*x595+x596*x596+x597*x597+x598*x598+x599*x599+x600*x600+x601*x601+x602*x602+x603*x603+x604*x604+x605*x605)+data12*(t465+t2798+t2800+t2802+t2804+t2806+t2808+t2810+t2812+t2814+x616*x616+x617*x617+x618*x618+x619*x619+x620*x620+x621*x621+x622*x622+x623*x623+x624*x624+x625*x625+x626*x626+x627*x627+x628*x628+x629*x629+x630*x630+x631*x631+x632*x632+x633*x633+x634*x634+x635*x635+x636*x636+x637*x637+x638*x638+x639*x639+x640*x640+x641*x641+x642*x642+x643*x643+x644*x644+x645*x645+x646*x646+x647*x647+x648*x648+x649*x649+x650*x650+x651*x651+x652*x652+x653*x653+x654*x654+x655*x655+x656*x656+x657*x657+x658*x658+x659*x659+x660*x660)+data12*(t467+t2817+t2819+t2821+t2823+t2825+t2827+t2829+t2831+t2833+x671*x671+x672*x672+x673*x673+x674*x674+x675*x675+x676*x676+x677*x677+x678*x678+x679*x679+x680*x680+x681*x681+x682*x682+x683*x683+x684*x684+x685*x685+x686*x686+x687*x687+x688*x688+x689*x689+x690*x690+x691*x691+x692*x692+x693*x693+x694*x694+x695*x695+x696*x696+x697*x697+x698*x698+x699*x699+x700*x700+x701*x701+x702*x702+x703*x703+x704*x704+x705*x705+x706*x706+x707*x707+x708*x708+x709*x709+x710*x710+x711*x711+x712*x712+x713*x713+x714*x714+x715*x715)+data12*(t469+t2836+t2838+t2840+t2842+t2844+t2846+t2848+t2850+t2852+x726*x726+x727*x727+x728*x728+x729*x729+x730*x730+x731*x731+x732*x732+x733*x733+x734*x734+x735*x735+x736*x736+x737*x737+x738*x738+x739*x739+x740*x740+x741*x741+x742*x742+x743*x743+x744*x744+x745*x745+x746*x746+x747*x747+x748*x748+x749*x749+x750*x750+x751*x751+x752*x752+x753*x753+x754*x754+x755*x755+x756*x756+x757*x757+x758*x758+x759*x759+x760*x760+x761*x761+x762*x762+x763*x763+x764*x764+x765*x765+x766*x766+x767*x767+x768*x768+x769*x769+x770*x770)+data12*(t471+t2855+t2857+t2859+t2861+t2863+t2865+t2867+t2869+t2871+x781*x781+x782*x782+x783*x783+x784*x784+x785*x785+x786*x786+x787*x787+x788*x788+x789*x789+x790*x790+x791*x791+x792*x792+x793*x793+x794*x794+x795*x795+x796*x796+x797*x797+x798*x798+x799*x799+x800*x800+x801*x801+x802*x802+x803*x803+x804*x804+x805*x805+x806*x806+x807*x807+x808*x808+x809*x809+x810*x810+x811*x811+x812*x812+x813*x813+x814*x814+x815*x815+x816*x816+x817*x817+x818*x818+x819*x819+x820*x820+x821*x821+x822*x822+x823*x823+x824*x824+x825*x825)+data12*(t473+t2874+t2876+t2878+t2880+t2882+t2884+t2886+t2888+t2890+x836*x836+x837*x837+x838*x838+x839*x839+x840*x840+x841*x841+x842*x842+x843*x843+x844*x844+x845*x845+x846*x846+x847*x847+x848*x848+x849*x849+x850*x850+x851*x851+x852*x852+x853*x853+x854*x854+x855*x855+x856*x856+x857*x857+x858*x858+x859*x859+x860*x860+x861*x861+x862*x862+x863*x863+x864*x864+x865*x865+x866*x866+x867*x867+x868*x868+x869*x869+x870*x870+x871*x871+x872*x872+x873*x873+x874*x874+x875*x875+x876*x876+x877*x877+x878*x878+x879*x879+x880*x880)+data12*(t475+t2893+t2895+t2897+t2899+t2901+t2903+t2905+t2907+t2909+x891*x891+x892*x892+x893*x893+x894*x894+x895*x895+x896*x896+x897*x897+x898*x898+x899*x899+x900*x900+x901*x901+x902*x902+x903*x903+x904*x904+x905*x905+x906*x906+x907*x907+x908*x908+x909*x909+x910*x910+x911*x911+x912*x912+x913*x913+x914*x914+x915*x915+x916*x916+x917*x917+x918*x918+x919*x919+x920*x920+x921*x921+x922*x922+x923*x923+x924*x924+x925*x925+x926*x926+x927*x927+x928*x928+x929*x929+x930*x930+x931*x931+x932*x932+x933*x933+x934*x934+x935*x935)+data12*(t477+t2912+t2914+t2916+t2918+t2920+t2922+t2924+t2926+t2928+x946*x946+x947*x947+x948*x948+x949*x949+x950*x950+x951*x951+x952*x952+x953*x953+x954*x954+x955*x955+x956*x956+x957*x957+x958*x958+x959*x959+x960*x960+x961*x961+x962*x962+x963*x963+x964*x964+x965*x965+x966*x966+x967*x967+x968*x968+x969*x969+x970*x970+x971*x971+x972*x972+x973*x973+x974*x974+x975*x975+x976*x976+x977*x977+x978*x978+x979*x979+x980*x980+x981*x981+x982*x982+x983*x983+x984*x984+x985*x985+x986*x986+x987*x987+x988*x988+x989*x989+x990*x990)+data12*(t479+t2931+t2933+t2935+t2937+t2939+t2941+t2943+t2945+t2947+x1001*x1001+x1002*x1002+x1003*x1003+x1004*x1004+x1005*x1005+x1006*x1006+x1007*x1007+x1008*x1008+x1009*x1009+x1010*x1010+x1011*x1011+x1012*x1012+x1013*x1013+x1014*x1014+x1015*x1015+x1016*x1016+x1017*x1017+x1018*x1018+x1019*x1019+x1020*x1020+x1021*x1021+x1022*x1022+x1023*x1023+x1024*x1024+x1025*x1025+x1026*x1026+x1027*x1027+x1028*x1028+x1029*x1029+x1030*x1030+x1031*x1031+x1032*x1032+x1033*x1033+x1034*x1034+x1035*x1035+x1036*x1036+x1037*x1037+x1038*x1038+x1039*x1039+x1040*x1040+x1041*x1041+x1042*x1042+x1043*x1043+x1044*x1044+x1045*x1045)+data12*(t481+t2950+t2952+t2954+t2956+t2958+t2960+t2962+t2964+t2966+x1056*x1056+x1057*x1057+x1058*x1058+x1059*x1059+x1060*x1060+x1061*x1061+x1062*x1062+x1063*x1063+x1064*x1064+x1065*x1065+x1066*x1066+x1067*x1067+x1068*x1068+x1069*x1069+x1070*x1070+x1071*x1071+x1072*x1072+x1073*x1073+x1074*x1074+x1075*x1075+x1076*x1076+x1077*x1077+x1078*x1078+x1079*x1079+x1080*x1080+x1081*x1081+x1082*x1082+x1083*x1083+x1084*x1084+x1085*x1085+x1086*x1086+x1087*x1087+x1088*x1088+x1089*x1089+x1090*x1090+x1091*x1091+x1092*x1092+x1093*x1093+x1094*x1094+x1095*x1095+x1096*x1096+x1097*x1097+x1098*x1098+x1099*x1099+x1100*x1100)+data12*(t483+t2969+t2971+t2973+t2975+t2977+t2979+t2981+t2983+t2985+x1111*x1111+x1112*x1112+x1113*x1113+x1114*x1114+x1115*x1115+x1116*x1116+x1117*x1117+x1118*x1118+x1119*x1119+x1120*x1120+x1121*x1121+x1122*x1122+x1123*x1123+x1124*x1124+x1125*x1125+x1126*x1126+x1127*x1127+x1128*x1128+x1129*x1129+x1130*x1130+x1131*x1131+x1132*x1132+x1133*x1133+x1134*x1134+x1135*x1135+x1136*x1136+x1137*x1137+x1138*x1138+x1139*x1139+x1140*x1140+x1141*x1141+x1142*x1142+x1143*x1143+x1144*x1144+x1145*x1145+x1146*x1146+x1147*x1147+x1148*x1148+x1149*x1149+x1150*x1150+x1151*x1151+x1152*x1152+x1153*x1153+x1154*x1154+x1155*x1155)+data12*(t485+t2988+t2990+t2992+t2994+t2996+t2998+t3000+t3002+t3004+x1166*x1166+x1167*x1167+x1168*x1168+x1169*x1169+x1170*x1170+x1171*x1171+x1172*x1172+x1173*x1173+x1174*x1174+x1175*x1175+x1176*x1176+x1177*x1177+x1178*x1178+x1179*x1179+x1180*x1180+x1181*x1181+x1182*x1182+x1183*x1183+x1184*x1184+x1185*x1185+x1186*x1186+x1187*x1187+x1188*x1188+x1189*x1189+x1190*x1190+x1191*x1191+x1192*x1192+x1193*x1193+x1194*x1194+x1195*x1195+x1196*x1196+x1197*x1197+x1198*x1198+x1199*x1199+x1200*x1200+x1201*x1201+x1202*x1202+x1203*x1203+x1204*x1204+x1205*x1205+x1206*x1206+x1207*x1207+x1208*x1208+x1209*x1209+x1210*x1210)+data12*(t487+t3007+t3009+t3011+t3013+t3015+t3017+t3019+t3021+t3023+x1221*x1221+x1222*x1222+x1223*x1223+x1224*x1224+x1225*x1225+x1226*x1226+x1227*x1227+x1228*x1228+x1229*x1229+x1230*x1230+x1231*x1231+x1232*x1232+x1233*x1233+x1234*x1234+x1235*x1235+x1236*x1236+x1237*x1237+x1238*x1238+x1239*x1239+x1240*x1240+x1241*x1241+x1242*x1242+x1243*x1243+x1244*x1244+x1245*x1245+x1246*x1246+x1247*x1247+x1248*x1248+x1249*x1249+x1250*x1250+x1251*x1251+x1252*x1252+x1253*x1253+x1254*x1254+x1255*x1255+x1256*x1256+x1257*x1257+x1258*x1258+x1259*x1259+x1260*x1260+x1261*x1261+x1262*x1262+x1263*x1263+x1264*x1264+x1265*x1265)+data12*(t489+t3026+t3028+t3030+t3032+t3034+t3036+t3038+t3040+t3042+x1276*x1276+x1277*x1277+x1278*x1278+x1279*x1279+x1280*x1280+x1281*x1281+x1282*x1282+x1283*x1283+x1284*x1284+x1285*x1285+x1286*x1286+x1287*x1287+x1288*x1288+x1289*x1289+x1290*x1290+x1291*x1291+x1292*x1292+x1293*x1293+x1294*x1294+x1295*x1295+x1296*x1296+x1297*x1297+x1298*x1298+x1299*x1299+x1300*x1300+x1301*x1301+x1302*x1302+x1303*x1303+x1304*x1304+x1305*x1305+x1306*x1306+x1307*x1307+x1308*x1308+x1309*x1309+x1310*x1310+x1311*x1311+x1312*x1312+x1313*x1313+x1314*x1314+x1315*x1315+x1316*x1316+x1317*x1317+x1318*x1318+x1319*x1319+x1320*x1320)+data12*(t491+t3045+t3047+t3049+t3051+t3053+t3055+t3057+t3059+t3061+x1331*x1331+x1332*x1332+x1333*x1333+x1334*x1334+x1335*x1335+x1336*x1336+x1337*x1337+x1338*x1338+x1339*x1339+x1340*x1340+x1341*x1341+x1342*x1342+x1343*x1343+x1344*x1344+x1345*x1345+x1346*x1346+x1347*x1347+x1348*x1348+x1349*x1349+x1350*x1350+x1351*x1351+x1352*x1352+x1353*x1353+x1354*x1354+x1355*x1355+x1356*x1356+x1357*x1357+x1358*x1358+x1359*x1359+x1360*x1360+x1361*x1361+x1362*x1362+x1363*x1363+x1364*x1364+x1365*x1365+x1366*x1366+x1367*x1367+x1368*x1368+x1369*x1369+x1370*x1370+x1371*x1371+x1372*x1372+x1373*x1373+x1374*x1374+x1375*x1375)+data12*(t493+t3064+t3066+t3068+t3070+t3072+t3074+t3076+t3078+t3080+x1386*x1386+x1387*x1387+x1388*x1388+x1389*x1389+x1390*x1390+x1391*x1391+x1392*x1392+x1393*x1393+x1394*x1394+x1395*x1395+x1396*x1396+x1397*x1397+x1398*x1398+x1399*x1399+x1400*x1400+x1401*x1401+x1402*x1402+x1403*x1403+x1404*x1404+x1405*x1405+x1406*x1406+x1407*x1407+x1408*x1408+x1409*x1409+x1410*x1410+x1411*x1411+x1412*x1412+x1413*x1413+x1414*x1414+x1415*x1415+x1416*x1416+x1417*x1417+x1418*x1418+x1419*x1419+x1420*x1420+x1421*x1421+x1422*x1422+x1423*x1423+x1424*x1424+x1425*x1425+x1426*x1426+x1427*x1427+x1428*x1428+x1429*x1429+x1430*x1430)+data12*(t495+t3083+t3085+t3087+t3089+t3091+t3093+t3095+t3097+t3099+x1441*x1441+x1442*x1442+x1443*x1443+x1444*x1444+x1445*x1445+x1446*x1446+x1447*x1447+x1448*x1448+x1449*x1449+x1450*x1450+x1451*x1451+x1452*x1452+x1453*x1453+x1454*x1454+x1455*x1455+x1456*x1456+x1457*x1457+x1458*x1458+x1459*x1459+x1460*x1460+x1461*x1461+x1462*x1462+x1463*x1463+x1464*x1464+x1465*x1465+x1466*x1466+x1467*x1467+x1468*x1468+x1469*x1469+x1470*x1470+x1471*x1471+x1472*x1472+x1473*x1473+x1474*x1474+x1475*x1475+x1476*x1476+x1477*x1477+x1478*x1478+x1479*x1479+x1480*x1480+x1481*x1481+x1482*x1482+x1483*x1483+x1484*x1484+x1485*x1485)+data12*(t497+t3102+t3104+t3106+t3108+t3110+t3112+t3114+t3116+t3118+x1496*x1496+x1497*x1497+x1498*x1498+x1499*x1499+x1500*x1500+x1501*x1501+x1502*x1502+x1503*x1503+x1504*x1504+x1505*x1505+x1506*x1506+x1507*x1507+x1508*x1508+x1509*x1509+x1510*x1510+x1511*x1511+x1512*x1512+x1513*x1513+x1514*x1514+x1515*x1515+x1516*x1516+x1517*x1517+x1518*x1518+x1519*x1519+x1520*x1520+x1521*x1521+x1522*x1522+x1523*x1523+x1524*x1524+x1525*x1525+x1526*x1526+x1527*x1527+x1528*x1528+x1529*x1529+x1530*x1530+x1531*x1531+x1532*x1532+x1533*x1533+x1534*x1534+x1535*x1535+x1536*x1536+x1537*x1537+x1538*x1538+x1539*x1539+x1540*x1540)+data12*(t499+t3121+t3123+t3125+t3127+t3129+t3131+t3133+t3135+t3137+x1551*x1551+x1552*x1552+x1553*x1553+x1554*x1554+x1555*x1555+x1556*x1556+x1557*x1557+x1558*x1558+x1559*x1559+x1560*x1560+x1561*x1561+x1562*x1562+x1563*x1563+x1564*x1564+x1565*x1565+x1566*x1566+x1567*x1567+x1568*x1568+x1569*x1569+x1570*x1570+x1571*x1571+x1572*x1572+x1573*x1573+x1574*x1574+x1575*x1575+x1576*x1576+x1577*x1577+x1578*x1578+x1579*x1579+x1580*x1580+x1581*x1581+x1582*x1582+x1583*x1583+x1584*x1584+x1585*x1585+x1586*x1586+x1587*x1587+x1588*x1588+x1589*x1589+x1590*x1590+x1591*x1591+x1592*x1592+x1593*x1593+x1594*x1594+x1595*x1595)+data12*(t501+t3140+t3142+t3144+t3146+t3148+t3150+t3152+t3154+t3156+x1606*x1606+x1607*x1607+x1608*x1608+x1609*x1609+x1610*x1610+x1611*x1611+x1612*x1612+x1613*x1613+x1614*x1614+x1615*x1615+x1616*x1616+x1617*x1617+x1618*x1618+x1619*x1619+x1620*x1620+x1621*x1621+x1622*x1622+x1623*x1623+x1624*x1624+x1625*x1625+x1626*x1626+x1627*x1627+x1628*x1628+x1629*x1629+x1630*x1630+x1631*x1631+x1632*x1632+x1633*x1633+x1634*x1634+x1635*x1635+x1636*x1636+x1637*x1637+x1638*x1638+x1639*x1639+x1640*x1640+x1641*x1641+x1642*x1642+x1643*x1643+x1644*x1644+x1645*x1645+x1646*x1646+x1647*x1647+x1648*x1648+x1649*x1649+x1650*x1650)-data13*(t502+t503+t504+t505+t506+t507+t508+t509+t510+t2682)-data13*(t511+t512+t513+t514+t515+t516+t517+t518+t519+t2701)-data13*(t520+t521+t522+t523+t524+t525+t526+t527+t528+t2720)-data13*(t529+t530+t531+t532+t533+t534+t535+t536+t537+t2739)-data13*(t538+t539+t540+t541+t542+t543+t544+t545+t546+t2758)-data13*(t547+t548+t549+t550+t551+t552+t553+t554+t555+t2777)-data13*(t556+t557+t558+t559+t560+t561+t562+t563+t564+t2796)-data13*(t565+t566+t567+t568+t569+t570+t571+t572+t573+t2815)-data13*(t574+t575+t576+t577+t578+t579+t580+t581+t582+t2834)-data13*(t583+t584+t585+t586+t587+t588+t589+t590+t591+t2853)-data13*(t592+t593+t594+t595+t596+t597+t598+t599+t600+t2872)-data13*(t601+t602+t603+t604+t605+t606+t607+t608+t609+t2891)-data13*(t610+t611+t612+t613+t614+t615+t616+t617+t618+t2910)-data13*(t619+t620+t621+t622+t623+t624+t625+t626+t627+t2929)-data13*(t628+t629+t630+t631+t632+t633+t634+t635+t636+t2948)-data13*(t637+t638+t639+t640+t641+t642+t643+t644+t645+t2967)-data13*(t646+t647+t648+t649+t650+t651+t652+t653+t654+t2986)-data13*(t655+t656+t657+t658+t659+t660+t661+t662+t663+t3005)-data13*(t664+t665+t666+t667+t668+t669+t670+t671+t672+t3024)-data13*(t673+t674+t675+t676+t677+t678+t679+t680+t681+t3043)-data13*(t682+t683+t684+t685+t686+t687+t688+t689+t690+t3062)-data13*(t691+t692+t693+t694+t695+t696+t697+t698+t699+t3081)-data13*(t700+t701+t702+t703+t704+t705+t706+t707+t708+t3100)-data13*(t709+t710+t711+t712+t713+t714+t715+t716+t717+t3119)-data13*(t718+t719+t720+t721+t722+t723+t724+t725+t726+t3138); out_ptr[1] = -t727*t2439+t819*t2680; out_ptr[2] = -t728*t2439+t896*t2680; out_ptr[3] = -t729*t2439+t963*t2680; out_ptr[4] = -t730*t2439+t1030*t2680; out_ptr[5] = -t731*t2439+t1097*t2680; out_ptr[6] = -t732*t2439+t1164*t2680; out_ptr[7] = -t733*t2439+t1231*t2680; out_ptr[8] = -t734*t2439+t1298*t2680; out_ptr[9] = -t735*t2439+t1365*t2680; out_ptr[10] = -t736*t2439+t1432*t2680; out_ptr[11] = -t737*t2439+t1499*t2680; out_ptr[12] = -t738*t2439+t1566*t2680; out_ptr[13] = -t739*t2439+t1633*t2680; out_ptr[14] = -t740*t2439+t1700*t2680; out_ptr[15] = -t741*t2439+t1767*t2680; out_ptr[16] = -t742*t2439+t1834*t2680; out_ptr[17] = -t743*t2439+t1901*t2680; out_ptr[18] = -t744*t2439+t1968*t2680; out_ptr[19] = -t745*t2439+t2035*t2680; out_ptr[20] = -t746*t2439+t2102*t2680; out_ptr[21] = -t747*t2439+t2169*t2680; out_ptr[22] = -t748*t2439+t2236*t2680; out_ptr[23] = -t749*t2439+t2303*t2680; out_ptr[24] = -t750*t2439+t2370*t2680; out_ptr[25] = -t751*t2439+t2437*t2680; out_ptr[26] = t819*t2680*(t2*x286+t5*x293+t13*x287+t12*x289+t11*x291+t19*x288+t18*x290+t17*x292+t16*x294+t453*(t2681-x26*2.0)*(1.0/2.0)); out_ptr[27] = t819*t2680*(t2*t502+t5*x301+t13*x295+t12*x297+t11*x299+t19*x296+t18*x298+t17*x300+t16*x302); out_ptr[28] = t819*t2680*(t13*t503+t5*x308+t12*x304+t11*x306+t19*x303+t18*x305+t17*x307+t16*x309); out_ptr[29] = t819*t2680*(t19*t504+t5*x314+t12*x310+t11*x312+t18*x311+t17*x313+t16*x315); out_ptr[30] = t819*t2680*(t12*t505+t5*x319+t11*x317+t18*x316+t17*x318+t16*x320); out_ptr[31] = t819*t2680*(t18*t506+t5*x323+t11*x321+t17*x322+t16*x324); out_ptr[32] = t819*t2680*(t11*t507+t5*x326+t17*x325+t16*x327); out_ptr[33] = t819*t2680*(t17*t508+t5*x328+t16*x329); out_ptr[34] = t819*t2680*(t5*t509+t16*x330); out_ptr[35] = t16*t510*t819*t2680; out_ptr[36] = t896*t2680*(t20*x341+t23*x348+t31*x342+t30*x344+t29*x346+t37*x343+t36*x345+t35*x347+t34*x349+t455*(t2681-x36*2.0)*(1.0/2.0)); out_ptr[37] = t896*t2680*(t20*t511+t23*x356+t31*x350+t30*x352+t29*x354+t37*x351+t36*x353+t35*x355+t34*x357); out_ptr[38] = t896*t2680*(t31*t512+t23*x363+t30*x359+t29*x361+t37*x358+t36*x360+t35*x362+t34*x364); out_ptr[39] = t896*t2680*(t37*t513+t23*x369+t30*x365+t29*x367+t36*x366+t35*x368+t34*x370); out_ptr[40] = t896*t2680*(t30*t514+t23*x374+t29*x372+t36*x371+t35*x373+t34*x375); out_ptr[41] = t896*t2680*(t36*t515+t23*x378+t29*x376+t35*x377+t34*x379); out_ptr[42] = t896*t2680*(t29*t516+t23*x381+t35*x380+t34*x382); out_ptr[43] = t896*t2680*(t35*t517+t23*x383+t34*x384); out_ptr[44] = t896*t2680*(t23*t518+t34*x385); out_ptr[45] = t34*t519*t896*t2680; out_ptr[46] = t963*t2680*(t38*x396+t41*x403+t49*x397+t48*x399+t47*x401+t55*x398+t54*x400+t53*x402+t52*x404+t457*(t2681-x46*2.0)*(1.0/2.0)); out_ptr[47] = t963*t2680*(t38*t520+t41*x411+t49*x405+t48*x407+t47*x409+t55*x406+t54*x408+t53*x410+t52*x412); out_ptr[48] = t963*t2680*(t49*t521+t41*x418+t48*x414+t47*x416+t55*x413+t54*x415+t53*x417+t52*x419); out_ptr[49] = t963*t2680*(t55*t522+t41*x424+t48*x420+t47*x422+t54*x421+t53*x423+t52*x425); out_ptr[50] = t963*t2680*(t48*t523+t41*x429+t47*x427+t54*x426+t53*x428+t52*x430); out_ptr[51] = t963*t2680*(t54*t524+t41*x433+t47*x431+t53*x432+t52*x434); out_ptr[52] = t963*t2680*(t47*t525+t41*x436+t53*x435+t52*x437); out_ptr[53] = t963*t2680*(t53*t526+t41*x438+t52*x439); out_ptr[54] = t963*t2680*(t41*t527+t52*x440); out_ptr[55] = t52*t528*t963*t2680; out_ptr[56] = t1030*t2680*(t56*x451+t59*x458+t67*x452+t66*x454+t65*x456+t73*x453+t72*x455+t71*x457+t70*x459+t459*(t2681-x56*2.0)*(1.0/2.0)); out_ptr[57] = t1030*t2680*(t56*t529+t59*x466+t67*x460+t66*x462+t65*x464+t73*x461+t72*x463+t71*x465+t70*x467); out_ptr[58] = t1030*t2680*(t67*t530+t59*x473+t66*x469+t65*x471+t73*x468+t72*x470+t71*x472+t70*x474); out_ptr[59] = t1030*t2680*(t73*t531+t59*x479+t66*x475+t65*x477+t72*x476+t71*x478+t70*x480); out_ptr[60] = t1030*t2680*(t66*t532+t59*x484+t65*x482+t72*x481+t71*x483+t70*x485); out_ptr[61] = t1030*t2680*(t72*t533+t59*x488+t65*x486+t71*x487+t70*x489); out_ptr[62] = t1030*t2680*(t65*t534+t59*x491+t71*x490+t70*x492); out_ptr[63] = t1030*t2680*(t71*t535+t59*x493+t70*x494); out_ptr[64] = t1030*t2680*(t59*t536+t70*x495); out_ptr[65] = t70*t537*t1030*t2680; out_ptr[66] = t1097*t2680*(t74*x506+t77*x513+t85*x507+t84*x509+t83*x511+t91*x508+t90*x510+t89*x512+t88*x514+t461*(t2681-x66*2.0)*(1.0/2.0)); out_ptr[67] = t1097*t2680*(t74*t538+t77*x521+t85*x515+t84*x517+t83*x519+t91*x516+t90*x518+t89*x520+t88*x522); out_ptr[68] = t1097*t2680*(t85*t539+t77*x528+t84*x524+t83*x526+t91*x523+t90*x525+t89*x527+t88*x529); out_ptr[69] = t1097*t2680*(t91*t540+t77*x534+t84*x530+t83*x532+t90*x531+t89*x533+t88*x535); out_ptr[70] = t1097*t2680*(t84*t541+t77*x539+t83*x537+t90*x536+t89*x538+t88*x540); out_ptr[71] = t1097*t2680*(t90*t542+t77*x543+t83*x541+t89*x542+t88*x544); out_ptr[72] = t1097*t2680*(t83*t543+t77*x546+t89*x545+t88*x547); out_ptr[73] = t1097*t2680*(t89*t544+t77*x548+t88*x549); out_ptr[74] = t1097*t2680*(t77*t545+t88*x550); out_ptr[75] = t88*t546*t1097*t2680; out_ptr[76] = t1164*t2680*(t92*x561+t95*x568+t103*x562+t102*x564+t101*x566+t109*x563+t108*x565+t107*x567+t106*x569+t463*(t2681-x76*2.0)*(1.0/2.0)); out_ptr[77] = t1164*t2680*(t92*t547+t95*x576+t103*x570+t102*x572+t101*x574+t109*x571+t108*x573+t107*x575+t106*x577); out_ptr[78] = t1164*t2680*(t103*t548+t95*x583+t102*x579+t101*x581+t109*x578+t108*x580+t107*x582+t106*x584); out_ptr[79] = t1164*t2680*(t109*t549+t95*x589+t102*x585+t101*x587+t108*x586+t107*x588+t106*x590); out_ptr[80] = t1164*t2680*(t102*t550+t95*x594+t101*x592+t108*x591+t107*x593+t106*x595); out_ptr[81] = t1164*t2680*(t108*t551+t95*x598+t101*x596+t107*x597+t106*x599); out_ptr[82] = t1164*t2680*(t101*t552+t95*x601+t107*x600+t106*x602); out_ptr[83] = t1164*t2680*(t107*t553+t95*x603+t106*x604); out_ptr[84] = t1164*t2680*(t95*t554+t106*x605); out_ptr[85] = t106*t555*t1164*t2680; out_ptr[86] = t1231*t2680*(t110*x616+t113*x623+t121*x617+t120*x619+t119*x621+t127*x618+t126*x620+t125*x622+t124*x624+t465*(t2681-x86*2.0)*(1.0/2.0)); out_ptr[87] = t1231*t2680*(t110*t556+t113*x631+t121*x625+t120*x627+t119*x629+t127*x626+t126*x628+t125*x630+t124*x632); out_ptr[88] = t1231*t2680*(t121*t557+t113*x638+t120*x634+t119*x636+t127*x633+t126*x635+t125*x637+t124*x639); out_ptr[89] = t1231*t2680*(t127*t558+t113*x644+t120*x640+t119*x642+t126*x641+t125*x643+t124*x645); out_ptr[90] = t1231*t2680*(t120*t559+t113*x649+t119*x647+t126*x646+t125*x648+t124*x650); out_ptr[91] = t1231*t2680*(t126*t560+t113*x653+t119*x651+t125*x652+t124*x654); out_ptr[92] = t1231*t2680*(t119*t561+t113*x656+t125*x655+t124*x657); out_ptr[93] = t1231*t2680*(t125*t562+t113*x658+t124*x659); out_ptr[94] = t1231*t2680*(t113*t563+t124*x660); out_ptr[95] = t124*t564*t1231*t2680; out_ptr[96] = t1298*t2680*(t128*x671+t131*x678+t139*x672+t138*x674+t137*x676+t145*x673+t144*x675+t143*x677+t142*x679+t467*(t2681-x96*2.0)*(1.0/2.0)); out_ptr[97] = t1298*t2680*(t128*t565+t131*x686+t139*x680+t138*x682+t137*x684+t145*x681+t144*x683+t143*x685+t142*x687); out_ptr[98] = t1298*t2680*(t139*t566+t131*x693+t138*x689+t137*x691+t145*x688+t144*x690+t143*x692+t142*x694); out_ptr[99] = t1298*t2680*(t145*t567+t131*x699+t138*x695+t137*x697+t144*x696+t143*x698+t142*x700); out_ptr[100] = t1298*t2680*(t138*t568+t131*x704+t137*x702+t144*x701+t143*x703+t142*x705); out_ptr[101] = t1298*t2680*(t144*t569+t131*x708+t137*x706+t143*x707+t142*x709); out_ptr[102] = t1298*t2680*(t137*t570+t131*x711+t143*x710+t142*x712); out_ptr[103] = t1298*t2680*(t143*t571+t131*x713+t142*x714); out_ptr[104] = t1298*t2680*(t131*t572+t142*x715); out_ptr[105] = t142*t573*t1298*t2680; out_ptr[106] = t1365*t2680*(t146*x726+t149*x733+t157*x727+t156*x729+t155*x731+t163*x728+t162*x730+t161*x732+t160*x734+t469*(t2681-x106*2.0)*(1.0/2.0)); out_ptr[107] = t1365*t2680*(t146*t574+t149*x741+t157*x735+t156*x737+t155*x739+t163*x736+t162*x738+t161*x740+t160*x742); out_ptr[108] = t1365*t2680*(t157*t575+t149*x748+t156*x744+t155*x746+t163*x743+t162*x745+t161*x747+t160*x749); out_ptr[109] = t1365*t2680*(t163*t576+t149*x754+t156*x750+t155*x752+t162*x751+t161*x753+t160*x755); out_ptr[110] = t1365*t2680*(t156*t577+t149*x759+t155*x757+t162*x756+t161*x758+t160*x760); out_ptr[111] = t1365*t2680*(t162*t578+t149*x763+t155*x761+t161*x762+t160*x764); out_ptr[112] = t1365*t2680*(t155*t579+t149*x766+t161*x765+t160*x767); out_ptr[113] = t1365*t2680*(t161*t580+t149*x768+t160*x769); out_ptr[114] = t1365*t2680*(t149*t581+t160*x770); out_ptr[115] = t160*t582*t1365*t2680; out_ptr[116] = t1432*t2680*(t164*x781+t167*x788+t175*x782+t174*x784+t173*x786+t181*x783+t180*x785+t179*x787+t178*x789+t471*(t2681-x116*2.0)*(1.0/2.0)); out_ptr[117] = t1432*t2680*(t164*t583+t167*x796+t175*x790+t174*x792+t173*x794+t181*x791+t180*x793+t179*x795+t178*x797); out_ptr[118] = t1432*t2680*(t175*t584+t167*x803+t174*x799+t173*x801+t181*x798+t180*x800+t179*x802+t178*x804); out_ptr[119] = t1432*t2680*(t181*t585+t167*x809+t174*x805+t173*x807+t180*x806+t179*x808+t178*x810); out_ptr[120] = t1432*t2680*(t174*t586+t167*x814+t173*x812+t180*x811+t179*x813+t178*x815); out_ptr[121] = t1432*t2680*(t180*t587+t167*x818+t173*x816+t179*x817+t178*x819); out_ptr[122] = t1432*t2680*(t173*t588+t167*x821+t179*x820+t178*x822); out_ptr[123] = t1432*t2680*(t179*t589+t167*x823+t178*x824); out_ptr[124] = t1432*t2680*(t167*t590+t178*x825); out_ptr[125] = t178*t591*t1432*t2680; out_ptr[126] = t1499*t2680*(t182*x836+t185*x843+t193*x837+t192*x839+t191*x841+t199*x838+t198*x840+t197*x842+t196*x844+t473*(t2681-x126*2.0)*(1.0/2.0)); out_ptr[127] = t1499*t2680*(t182*t592+t185*x851+t193*x845+t192*x847+t191*x849+t199*x846+t198*x848+t197*x850+t196*x852); out_ptr[128] = t1499*t2680*(t193*t593+t185*x858+t192*x854+t191*x856+t199*x853+t198*x855+t197*x857+t196*x859); out_ptr[129] = t1499*t2680*(t199*t594+t185*x864+t192*x860+t191*x862+t198*x861+t197*x863+t196*x865); out_ptr[130] = t1499*t2680*(t192*t595+t185*x869+t191*x867+t198*x866+t197*x868+t196*x870); out_ptr[131] = t1499*t2680*(t198*t596+t185*x873+t191*x871+t197*x872+t196*x874); out_ptr[132] = t1499*t2680*(t191*t597+t185*x876+t197*x875+t196*x877); out_ptr[133] = t1499*t2680*(t197*t598+t185*x878+t196*x879); out_ptr[134] = t1499*t2680*(t185*t599+t196*x880); out_ptr[135] = t196*t600*t1499*t2680; out_ptr[136] = t1566*t2680*(t200*x891+t203*x898+t211*x892+t210*x894+t209*x896+t217*x893+t216*x895+t215*x897+t214*x899+t475*(t2681-x136*2.0)*(1.0/2.0)); out_ptr[137] = t1566*t2680*(t200*t601+t203*x906+t211*x900+t210*x902+t209*x904+t217*x901+t216*x903+t215*x905+t214*x907); out_ptr[138] = t1566*t2680*(t211*t602+t203*x913+t210*x909+t209*x911+t217*x908+t216*x910+t215*x912+t214*x914); out_ptr[139] = t1566*t2680*(t217*t603+t203*x919+t210*x915+t209*x917+t216*x916+t215*x918+t214*x920); out_ptr[140] = t1566*t2680*(t210*t604+t203*x924+t209*x922+t216*x921+t215*x923+t214*x925); out_ptr[141] = t1566*t2680*(t216*t605+t203*x928+t209*x926+t215*x927+t214*x929); out_ptr[142] = t1566*t2680*(t209*t606+t203*x931+t215*x930+t214*x932); out_ptr[143] = t1566*t2680*(t215*t607+t203*x933+t214*x934); out_ptr[144] = t1566*t2680*(t203*t608+t214*x935); out_ptr[145] = t214*t609*t1566*t2680; out_ptr[146] = t1633*t2680*(t218*x946+t221*x953+t229*x947+t228*x949+t227*x951+t235*x948+t234*x950+t233*x952+t232*x954+t477*(t2681-x146*2.0)*(1.0/2.0)); out_ptr[147] = t1633*t2680*(t218*t610+t221*x961+t229*x955+t228*x957+t227*x959+t235*x956+t234*x958+t233*x960+t232*x962); out_ptr[148] = t1633*t2680*(t229*t611+t221*x968+t228*x964+t227*x966+t235*x963+t234*x965+t233*x967+t232*x969); out_ptr[149] = t1633*t2680*(t235*t612+t221*x974+t228*x970+t227*x972+t234*x971+t233*x973+t232*x975); out_ptr[150] = t1633*t2680*(t228*t613+t221*x979+t227*x977+t234*x976+t233*x978+t232*x980); out_ptr[151] = t1633*t2680*(t234*t614+t221*x983+t227*x981+t233*x982+t232*x984); out_ptr[152] = t1633*t2680*(t227*t615+t221*x986+t233*x985+t232*x987); out_ptr[153] = t1633*t2680*(t233*t616+t221*x988+t232*x989); out_ptr[154] = t1633*t2680*(t221*t617+t232*x990); out_ptr[155] = t232*t618*t1633*t2680; out_ptr[156] = t1700*t2680*(t236*x1001+t239*x1008+t247*x1002+t246*x1004+t245*x1006+t253*x1003+t252*x1005+t251*x1007+t250*x1009+t479*(t2681-x156*2.0)*(1.0/2.0)); out_ptr[157] = t1700*t2680*(t236*t619+t239*x1016+t247*x1010+t246*x1012+t245*x1014+t253*x1011+t252*x1013+t251*x1015+t250*x1017); out_ptr[158] = t1700*t2680*(t247*t620+t239*x1023+t246*x1019+t245*x1021+t253*x1018+t252*x1020+t251*x1022+t250*x1024); out_ptr[159] = t1700*t2680*(t253*t621+t239*x1029+t246*x1025+t245*x1027+t252*x1026+t251*x1028+t250*x1030); out_ptr[160] = t1700*t2680*(t246*t622+t239*x1034+t245*x1032+t252*x1031+t251*x1033+t250*x1035); out_ptr[161] = t1700*t2680*(t252*t623+t239*x1038+t245*x1036+t251*x1037+t250*x1039); out_ptr[162] = t1700*t2680*(t245*t624+t239*x1041+t251*x1040+t250*x1042); out_ptr[163] = t1700*t2680*(t251*t625+t239*x1043+t250*x1044); out_ptr[164] = t1700*t2680*(t239*t626+t250*x1045); out_ptr[165] = t250*t627*t1700*t2680; out_ptr[166] = t1767*t2680*(t254*x1056+t257*x1063+t265*x1057+t264*x1059+t263*x1061+t271*x1058+t270*x1060+t269*x1062+t268*x1064+t481*(t2681-x166*2.0)*(1.0/2.0)); out_ptr[167] = t1767*t2680*(t254*t628+t257*x1071+t265*x1065+t264*x1067+t263*x1069+t271*x1066+t270*x1068+t269*x1070+t268*x1072); out_ptr[168] = t1767*t2680*(t265*t629+t257*x1078+t264*x1074+t263*x1076+t271*x1073+t270*x1075+t269*x1077+t268*x1079); out_ptr[169] = t1767*t2680*(t271*t630+t257*x1084+t264*x1080+t263*x1082+t270*x1081+t269*x1083+t268*x1085); out_ptr[170] = t1767*t2680*(t264*t631+t257*x1089+t263*x1087+t270*x1086+t269*x1088+t268*x1090); out_ptr[171] = t1767*t2680*(t270*t632+t257*x1093+t263*x1091+t269*x1092+t268*x1094); out_ptr[172] = t1767*t2680*(t263*t633+t257*x1096+t269*x1095+t268*x1097); out_ptr[173] = t1767*t2680*(t269*t634+t257*x1098+t268*x1099); out_ptr[174] = t1767*t2680*(t257*t635+t268*x1100); out_ptr[175] = t268*t636*t1767*t2680; out_ptr[176] = t1834*t2680*(t272*x1111+t275*x1118+t283*x1112+t282*x1114+t281*x1116+t289*x1113+t288*x1115+t287*x1117+t286*x1119+t483*(t2681-x176*2.0)*(1.0/2.0)); out_ptr[177] = t1834*t2680*(t272*t637+t275*x1126+t283*x1120+t282*x1122+t281*x1124+t289*x1121+t288*x1123+t287*x1125+t286*x1127); out_ptr[178] = t1834*t2680*(t283*t638+t275*x1133+t282*x1129+t281*x1131+t289*x1128+t288*x1130+t287*x1132+t286*x1134); out_ptr[179] = t1834*t2680*(t289*t639+t275*x1139+t282*x1135+t281*x1137+t288*x1136+t287*x1138+t286*x1140); out_ptr[180] = t1834*t2680*(t282*t640+t275*x1144+t281*x1142+t288*x1141+t287*x1143+t286*x1145); out_ptr[181] = t1834*t2680*(t288*t641+t275*x1148+t281*x1146+t287*x1147+t286*x1149); out_ptr[182] = t1834*t2680*(t281*t642+t275*x1151+t287*x1150+t286*x1152); out_ptr[183] = t1834*t2680*(t287*t643+t275*x1153+t286*x1154); out_ptr[184] = t1834*t2680*(t275*t644+t286*x1155); out_ptr[185] = t286*t645*t1834*t2680; out_ptr[186] = t1901*t2680*(t290*x1166+t293*x1173+t301*x1167+t300*x1169+t299*x1171+t307*x1168+t306*x1170+t305*x1172+t304*x1174+t485*(t2681-x186*2.0)*(1.0/2.0)); out_ptr[187] = t1901*t2680*(t290*t646+t293*x1181+t301*x1175+t300*x1177+t299*x1179+t307*x1176+t306*x1178+t305*x1180+t304*x1182); out_ptr[188] = t1901*t2680*(t301*t647+t293*x1188+t300*x1184+t299*x1186+t307*x1183+t306*x1185+t305*x1187+t304*x1189); out_ptr[189] = t1901*t2680*(t307*t648+t293*x1194+t300*x1190+t299*x1192+t306*x1191+t305*x1193+t304*x1195); out_ptr[190] = t1901*t2680*(t300*t649+t293*x1199+t299*x1197+t306*x1196+t305*x1198+t304*x1200); out_ptr[191] = t1901*t2680*(t306*t650+t293*x1203+t299*x1201+t305*x1202+t304*x1204); out_ptr[192] = t1901*t2680*(t299*t651+t293*x1206+t305*x1205+t304*x1207); out_ptr[193] = t1901*t2680*(t305*t652+t293*x1208+t304*x1209); out_ptr[194] = t1901*t2680*(t293*t653+t304*x1210); out_ptr[195] = t304*t654*t1901*t2680; out_ptr[196] = t1968*t2680*(t308*x1221+t311*x1228+t319*x1222+t318*x1224+t317*x1226+t325*x1223+t324*x1225+t323*x1227+t322*x1229+t487*(t2681-x196*2.0)*(1.0/2.0)); out_ptr[197] = t1968*t2680*(t308*t655+t311*x1236+t319*x1230+t318*x1232+t317*x1234+t325*x1231+t324*x1233+t323*x1235+t322*x1237); out_ptr[198] = t1968*t2680*(t319*t656+t311*x1243+t318*x1239+t317*x1241+t325*x1238+t324*x1240+t323*x1242+t322*x1244); out_ptr[199] = t1968*t2680*(t325*t657+t311*x1249+t318*x1245+t317*x1247+t324*x1246+t323*x1248+t322*x1250); out_ptr[200] = t1968*t2680*(t318*t658+t311*x1254+t317*x1252+t324*x1251+t323*x1253+t322*x1255); out_ptr[201] = t1968*t2680*(t324*t659+t311*x1258+t317*x1256+t323*x1257+t322*x1259); out_ptr[202] = t1968*t2680*(t317*t660+t311*x1261+t323*x1260+t322*x1262); out_ptr[203] = t1968*t2680*(t323*t661+t311*x1263+t322*x1264); out_ptr[204] = t1968*t2680*(t311*t662+t322*x1265); out_ptr[205] = t322*t663*t1968*t2680; out_ptr[206] = t2035*t2680*(t326*x1276+t329*x1283+t337*x1277+t336*x1279+t335*x1281+t343*x1278+t342*x1280+t341*x1282+t340*x1284+t489*(t2681-x206*2.0)*(1.0/2.0)); out_ptr[207] = t2035*t2680*(t326*t664+t329*x1291+t337*x1285+t336*x1287+t335*x1289+t343*x1286+t342*x1288+t341*x1290+t340*x1292); out_ptr[208] = t2035*t2680*(t337*t665+t329*x1298+t336*x1294+t335*x1296+t343*x1293+t342*x1295+t341*x1297+t340*x1299); out_ptr[209] = t2035*t2680*(t343*t666+t329*x1304+t336*x1300+t335*x1302+t342*x1301+t341*x1303+t340*x1305); out_ptr[210] = t2035*t2680*(t336*t667+t329*x1309+t335*x1307+t342*x1306+t341*x1308+t340*x1310); out_ptr[211] = t2035*t2680*(t342*t668+t329*x1313+t335*x1311+t341*x1312+t340*x1314); out_ptr[212] = t2035*t2680*(t335*t669+t329*x1316+t341*x1315+t340*x1317); out_ptr[213] = t2035*t2680*(t341*t670+t329*x1318+t340*x1319); out_ptr[214] = t2035*t2680*(t329*t671+t340*x1320); out_ptr[215] = t340*t672*t2035*t2680; out_ptr[216] = t2102*t2680*(t344*x1331+t347*x1338+t355*x1332+t354*x1334+t353*x1336+t361*x1333+t360*x1335+t359*x1337+t358*x1339+t491*(t2681-x216*2.0)*(1.0/2.0)); out_ptr[217] = t2102*t2680*(t344*t673+t347*x1346+t355*x1340+t354*x1342+t353*x1344+t361*x1341+t360*x1343+t359*x1345+t358*x1347); out_ptr[218] = t2102*t2680*(t355*t674+t347*x1353+t354*x1349+t353*x1351+t361*x1348+t360*x1350+t359*x1352+t358*x1354); out_ptr[219] = t2102*t2680*(t361*t675+t347*x1359+t354*x1355+t353*x1357+t360*x1356+t359*x1358+t358*x1360); out_ptr[220] = t2102*t2680*(t354*t676+t347*x1364+t353*x1362+t360*x1361+t359*x1363+t358*x1365); out_ptr[221] = t2102*t2680*(t360*t677+t347*x1368+t353*x1366+t359*x1367+t358*x1369); out_ptr[222] = t2102*t2680*(t353*t678+t347*x1371+t359*x1370+t358*x1372); out_ptr[223] = t2102*t2680*(t359*t679+t347*x1373+t358*x1374); out_ptr[224] = t2102*t2680*(t347*t680+t358*x1375); out_ptr[225] = t358*t681*t2102*t2680; out_ptr[226] = t2169*t2680*(t362*x1386+t365*x1393+t373*x1387+t372*x1389+t371*x1391+t379*x1388+t378*x1390+t377*x1392+t376*x1394+t493*(t2681-x226*2.0)*(1.0/2.0)); out_ptr[227] = t2169*t2680*(t362*t682+t365*x1401+t373*x1395+t372*x1397+t371*x1399+t379*x1396+t378*x1398+t377*x1400+t376*x1402); out_ptr[228] = t2169*t2680*(t373*t683+t365*x1408+t372*x1404+t371*x1406+t379*x1403+t378*x1405+t377*x1407+t376*x1409); out_ptr[229] = t2169*t2680*(t379*t684+t365*x1414+t372*x1410+t371*x1412+t378*x1411+t377*x1413+t376*x1415); out_ptr[230] = t2169*t2680*(t372*t685+t365*x1419+t371*x1417+t378*x1416+t377*x1418+t376*x1420); out_ptr[231] = t2169*t2680*(t378*t686+t365*x1423+t371*x1421+t377*x1422+t376*x1424); out_ptr[232] = t2169*t2680*(t371*t687+t365*x1426+t377*x1425+t376*x1427); out_ptr[233] = t2169*t2680*(t377*t688+t365*x1428+t376*x1429); out_ptr[234] = t2169*t2680*(t365*t689+t376*x1430); out_ptr[235] = t376*t690*t2169*t2680; out_ptr[236] = t2236*t2680*(t380*x1441+t383*x1448+t391*x1442+t390*x1444+t389*x1446+t397*x1443+t396*x1445+t395*x1447+t394*x1449+t495*(t2681-x236*2.0)*(1.0/2.0)); out_ptr[237] = t2236*t2680*(t380*t691+t383*x1456+t391*x1450+t390*x1452+t389*x1454+t397*x1451+t396*x1453+t395*x1455+t394*x1457); out_ptr[238] = t2236*t2680*(t391*t692+t383*x1463+t390*x1459+t389*x1461+t397*x1458+t396*x1460+t395*x1462+t394*x1464); out_ptr[239] = t2236*t2680*(t397*t693+t383*x1469+t390*x1465+t389*x1467+t396*x1466+t395*x1468+t394*x1470); out_ptr[240] = t2236*t2680*(t390*t694+t383*x1474+t389*x1472+t396*x1471+t395*x1473+t394*x1475); out_ptr[241] = t2236*t2680*(t396*t695+t383*x1478+t389*x1476+t395*x1477+t394*x1479); out_ptr[242] = t2236*t2680*(t389*t696+t383*x1481+t395*x1480+t394*x1482); out_ptr[243] = t2236*t2680*(t395*t697+t383*x1483+t394*x1484); out_ptr[244] = t2236*t2680*(t383*t698+t394*x1485); out_ptr[245] = t394*t699*t2236*t2680; out_ptr[246] = t2303*t2680*(t398*x1496+t401*x1503+t409*x1497+t408*x1499+t407*x1501+t415*x1498+t414*x1500+t413*x1502+t412*x1504+t497*(t2681-x246*2.0)*(1.0/2.0)); out_ptr[247] = t2303*t2680*(t398*t700+t401*x1511+t409*x1505+t408*x1507+t407*x1509+t415*x1506+t414*x1508+t413*x1510+t412*x1512); out_ptr[248] = t2303*t2680*(t409*t701+t401*x1518+t408*x1514+t407*x1516+t415*x1513+t414*x1515+t413*x1517+t412*x1519); out_ptr[249] = t2303*t2680*(t415*t702+t401*x1524+t408*x1520+t407*x1522+t414*x1521+t413*x1523+t412*x1525); out_ptr[250] = t2303*t2680*(t408*t703+t401*x1529+t407*x1527+t414*x1526+t413*x1528+t412*x1530); out_ptr[251] = t2303*t2680*(t414*t704+t401*x1533+t407*x1531+t413*x1532+t412*x1534); out_ptr[252] = t2303*t2680*(t407*t705+t401*x1536+t413*x1535+t412*x1537); out_ptr[253] = t2303*t2680*(t413*t706+t401*x1538+t412*x1539); out_ptr[254] = t2303*t2680*(t401*t707+t412*x1540); out_ptr[255] = t412*t708*t2303*t2680; out_ptr[256] = t2370*t2680*(t416*x1551+t419*x1558+t427*x1552+t426*x1554+t425*x1556+t433*x1553+t432*x1555+t431*x1557+t430*x1559+t499*(t2681-x256*2.0)*(1.0/2.0)); out_ptr[257] = t2370*t2680*(t416*t709+t419*x1566+t427*x1560+t426*x1562+t425*x1564+t433*x1561+t432*x1563+t431*x1565+t430*x1567); out_ptr[258] = t2370*t2680*(t427*t710+t419*x1573+t426*x1569+t425*x1571+t433*x1568+t432*x1570+t431*x1572+t430*x1574); out_ptr[259] = t2370*t2680*(t433*t711+t419*x1579+t426*x1575+t425*x1577+t432*x1576+t431*x1578+t430*x1580); out_ptr[260] = t2370*t2680*(t426*t712+t419*x1584+t425*x1582+t432*x1581+t431*x1583+t430*x1585); out_ptr[261] = t2370*t2680*(t432*t713+t419*x1588+t425*x1586+t431*x1587+t430*x1589); out_ptr[262] = t2370*t2680*(t425*t714+t419*x1591+t431*x1590+t430*x1592); out_ptr[263] = t2370*t2680*(t431*t715+t419*x1593+t430*x1594); out_ptr[264] = t2370*t2680*(t419*t716+t430*x1595); out_ptr[265] = t430*t717*t2370*t2680; out_ptr[266] = t2437*t2680*(t434*x1606+t437*x1613+t445*x1607+t444*x1609+t443*x1611+t451*x1608+t450*x1610+t449*x1612+t448*x1614+t501*(t2681-x266*2.0)*(1.0/2.0)); out_ptr[267] = t2437*t2680*(t434*t718+t437*x1621+t445*x1615+t444*x1617+t443*x1619+t451*x1616+t450*x1618+t449*x1620+t448*x1622); out_ptr[268] = t2437*t2680*(t445*t719+t437*x1628+t444*x1624+t443*x1626+t451*x1623+t450*x1625+t449*x1627+t448*x1629); out_ptr[269] = t2437*t2680*(t451*t720+t437*x1634+t444*x1630+t443*x1632+t450*x1631+t449*x1633+t448*x1635); out_ptr[270] = t2437*t2680*(t444*t721+t437*x1639+t443*x1637+t450*x1636+t449*x1638+t448*x1640); out_ptr[271] = t2437*t2680*(t450*t722+t437*x1643+t443*x1641+t449*x1642+t448*x1644); out_ptr[272] = t2437*t2680*(t443*t723+t437*x1646+t449*x1645+t448*x1647); out_ptr[273] = t2437*t2680*(t449*t724+t437*x1648+t448*x1649); out_ptr[274] = t2437*t2680*(t437*t725+t448*x1650); out_ptr[275] = t448*t726*t2437*t2680; out_ptr[276] = data12*t453*2.0-data13*t2682-t819*t2680*(t453*t784-1.0); out_ptr[277] = -data13*t502+data12*t2684*2.0-t819*t2680*(t2*t4*t502-1.0); out_ptr[278] = -data13*t503+data12*t2686*2.0-t819*t2680*(t6*t13*t503-1.0); out_ptr[279] = -data13*t504+data12*t2688*2.0-t819*t2680*(t7*t19*t504-1.0); out_ptr[280] = -data13*t505+data12*t2690*2.0-t819*t2680*(t8*t12*t505-1.0); out_ptr[281] = -data13*t506+data12*t2692*2.0-t819*t2680*(t9*t18*t506-1.0); out_ptr[282] = -data13*t507+data12*t2694*2.0-t819*t2680*(t10*t11*t507-1.0); out_ptr[283] = -data13*t508+data12*t2696*2.0-t819*t2680*(t14*t17*t508-1.0); out_ptr[284] = -data13*t509+data12*t2698*2.0-t819*t2680*(t5*t15*t509-1.0); out_ptr[285] = -data13*t510+data12*t2700*2.0-t819*t2680*(t16*t510*t794-1.0); out_ptr[286] = data12*x286*2.0-t2*t3*t819*t2680; out_ptr[287] = data12*x287*2.0-t3*t13*t819*t2680; out_ptr[288] = data12*x288*2.0-t3*t19*t819*t2680; out_ptr[289] = data12*x289*2.0-t3*t12*t819*t2680; out_ptr[290] = data12*x290*2.0-t3*t18*t819*t2680; out_ptr[291] = data12*x291*2.0-t3*t11*t819*t2680; out_ptr[292] = data12*x292*2.0-t3*t17*t819*t2680; out_ptr[293] = data12*x293*2.0-t3*t5*t819*t2680; out_ptr[294] = data12*x294*2.0-t3*t16*t819*t2680; out_ptr[295] = data12*x295*2.0-t4*t13*t819*t2680; out_ptr[296] = data12*x296*2.0-t4*t19*t819*t2680; out_ptr[297] = data12*x297*2.0-t4*t12*t819*t2680; out_ptr[298] = data12*x298*2.0-t4*t18*t819*t2680; out_ptr[299] = data12*x299*2.0-t4*t11*t819*t2680; out_ptr[300] = data12*x300*2.0-t4*t17*t819*t2680; out_ptr[301] = data12*x301*2.0-t4*t5*t819*t2680; out_ptr[302] = data12*x302*2.0-t4*t16*t819*t2680; out_ptr[303] = data12*x303*2.0-t6*t19*t819*t2680; out_ptr[304] = data12*x304*2.0-t6*t12*t819*t2680; out_ptr[305] = data12*x305*2.0-t6*t18*t819*t2680; out_ptr[306] = data12*x306*2.0-t6*t11*t819*t2680; out_ptr[307] = data12*x307*2.0-t6*t17*t819*t2680; out_ptr[308] = data12*x308*2.0-t5*t6*t819*t2680; out_ptr[309] = data12*x309*2.0-t6*t16*t819*t2680; out_ptr[310] = data12*x310*2.0-t7*t12*t819*t2680; out_ptr[311] = data12*x311*2.0-t7*t18*t819*t2680; out_ptr[312] = data12*x312*2.0-t7*t11*t819*t2680; out_ptr[313] = data12*x313*2.0-t7*t17*t819*t2680; out_ptr[314] = data12*x314*2.0-t5*t7*t819*t2680; out_ptr[315] = data12*x315*2.0-t7*t16*t819*t2680; out_ptr[316] = data12*x316*2.0-t8*t18*t819*t2680; out_ptr[317] = data12*x317*2.0-t8*t11*t819*t2680; out_ptr[318] = data12*x318*2.0-t8*t17*t819*t2680; out_ptr[319] = data12*x319*2.0-t5*t8*t819*t2680; out_ptr[320] = data12*x320*2.0-t8*t16*t819*t2680; out_ptr[321] = data12*x321*2.0-t9*t11*t819*t2680; out_ptr[322] = data12*x322*2.0-t9*t17*t819*t2680; out_ptr[323] = data12*x323*2.0-t5*t9*t819*t2680; out_ptr[324] = data12*x324*2.0-t9*t16*t819*t2680; out_ptr[325] = data12*x325*2.0-t10*t17*t819*t2680; out_ptr[326] = data12*x326*2.0-t5*t10*t819*t2680; out_ptr[327] = data12*x327*2.0-t10*t16*t819*t2680; out_ptr[328] = data12*x328*2.0-t5*t14*t819*t2680; out_ptr[329] = data12*x329*2.0-t14*t16*t819*t2680; out_ptr[330] = data12*x330*2.0-t15*t16*t819*t2680; out_ptr[331] = data12*t455*2.0-data13*t2701-t896*t2680*(t455*t861-1.0); out_ptr[332] = -data13*t511+data12*t2703*2.0-t896*t2680*(t20*t22*t511-1.0); out_ptr[333] = -data13*t512+data12*t2705*2.0-t896*t2680*(t24*t31*t512-1.0); out_ptr[334] = -data13*t513+data12*t2707*2.0-t896*t2680*(t25*t37*t513-1.0); out_ptr[335] = -data13*t514+data12*t2709*2.0-t896*t2680*(t26*t30*t514-1.0); out_ptr[336] = -data13*t515+data12*t2711*2.0-t896*t2680*(t27*t36*t515-1.0); out_ptr[337] = -data13*t516+data12*t2713*2.0-t896*t2680*(t28*t29*t516-1.0); out_ptr[338] = -data13*t517+data12*t2715*2.0-t896*t2680*(t32*t35*t517-1.0); out_ptr[339] = -data13*t518+data12*t2717*2.0-t896*t2680*(t23*t33*t518-1.0); out_ptr[340] = -data13*t519+data12*t2719*2.0-t896*t2680*(t34*t519*t871-1.0); out_ptr[341] = data12*x341*2.0-t20*t21*t896*t2680; out_ptr[342] = data12*x342*2.0-t21*t31*t896*t2680; out_ptr[343] = data12*x343*2.0-t21*t37*t896*t2680; out_ptr[344] = data12*x344*2.0-t21*t30*t896*t2680; out_ptr[345] = data12*x345*2.0-t21*t36*t896*t2680; out_ptr[346] = data12*x346*2.0-t21*t29*t896*t2680; out_ptr[347] = data12*x347*2.0-t21*t35*t896*t2680; out_ptr[348] = data12*x348*2.0-t21*t23*t896*t2680; out_ptr[349] = data12*x349*2.0-t21*t34*t896*t2680; out_ptr[350] = data12*x350*2.0-t22*t31*t896*t2680; out_ptr[351] = data12*x351*2.0-t22*t37*t896*t2680; out_ptr[352] = data12*x352*2.0-t22*t30*t896*t2680; out_ptr[353] = data12*x353*2.0-t22*t36*t896*t2680; out_ptr[354] = data12*x354*2.0-t22*t29*t896*t2680; out_ptr[355] = data12*x355*2.0-t22*t35*t896*t2680; out_ptr[356] = data12*x356*2.0-t22*t23*t896*t2680; out_ptr[357] = data12*x357*2.0-t22*t34*t896*t2680; out_ptr[358] = data12*x358*2.0-t24*t37*t896*t2680; out_ptr[359] = data12*x359*2.0-t24*t30*t896*t2680; out_ptr[360] = data12*x360*2.0-t24*t36*t896*t2680; out_ptr[361] = data12*x361*2.0-t24*t29*t896*t2680; out_ptr[362] = data12*x362*2.0-t24*t35*t896*t2680; out_ptr[363] = data12*x363*2.0-t23*t24*t896*t2680; out_ptr[364] = data12*x364*2.0-t24*t34*t896*t2680; out_ptr[365] = data12*x365*2.0-t25*t30*t896*t2680; out_ptr[366] = data12*x366*2.0-t25*t36*t896*t2680; out_ptr[367] = data12*x367*2.0-t25*t29*t896*t2680; out_ptr[368] = data12*x368*2.0-t25*t35*t896*t2680; out_ptr[369] = data12*x369*2.0-t23*t25*t896*t2680; out_ptr[370] = data12*x370*2.0-t25*t34*t896*t2680; out_ptr[371] = data12*x371*2.0-t26*t36*t896*t2680; out_ptr[372] = data12*x372*2.0-t26*t29*t896*t2680; out_ptr[373] = data12*x373*2.0-t26*t35*t896*t2680; out_ptr[374] = data12*x374*2.0-t23*t26*t896*t2680; out_ptr[375] = data12*x375*2.0-t26*t34*t896*t2680; out_ptr[376] = data12*x376*2.0-t27*t29*t896*t2680; out_ptr[377] = data12*x377*2.0-t27*t35*t896*t2680; out_ptr[378] = data12*x378*2.0-t23*t27*t896*t2680; out_ptr[379] = data12*x379*2.0-t27*t34*t896*t2680; out_ptr[380] = data12*x380*2.0-t28*t35*t896*t2680; out_ptr[381] = data12*x381*2.0-t23*t28*t896*t2680; out_ptr[382] = data12*x382*2.0-t28*t34*t896*t2680; out_ptr[383] = data12*x383*2.0-t23*t32*t896*t2680; out_ptr[384] = data12*x384*2.0-t32*t34*t896*t2680; out_ptr[385] = data12*x385*2.0-t33*t34*t896*t2680; out_ptr[386] = data12*t457*2.0-data13*t2720-t963*t2680*(t457*t928-1.0); out_ptr[387] = -data13*t520+data12*t2722*2.0-t963*t2680*(t38*t40*t520-1.0); out_ptr[388] = -data13*t521+data12*t2724*2.0-t963*t2680*(t42*t49*t521-1.0); out_ptr[389] = -data13*t522+data12*t2726*2.0-t963*t2680*(t43*t55*t522-1.0); out_ptr[390] = -data13*t523+data12*t2728*2.0-t963*t2680*(t44*t48*t523-1.0); out_ptr[391] = -data13*t524+data12*t2730*2.0-t963*t2680*(t45*t54*t524-1.0); out_ptr[392] = -data13*t525+data12*t2732*2.0-t963*t2680*(t46*t47*t525-1.0); out_ptr[393] = -data13*t526+data12*t2734*2.0-t963*t2680*(t50*t53*t526-1.0); out_ptr[394] = -data13*t527+data12*t2736*2.0-t963*t2680*(t41*t51*t527-1.0); out_ptr[395] = -data13*t528+data12*t2738*2.0-t963*t2680*(t52*t528*t938-1.0); out_ptr[396] = data12*x396*2.0-t38*t39*t963*t2680; out_ptr[397] = data12*x397*2.0-t39*t49*t963*t2680; out_ptr[398] = data12*x398*2.0-t39*t55*t963*t2680; out_ptr[399] = data12*x399*2.0-t39*t48*t963*t2680; out_ptr[400] = data12*x400*2.0-t39*t54*t963*t2680; out_ptr[401] = data12*x401*2.0-t39*t47*t963*t2680; out_ptr[402] = data12*x402*2.0-t39*t53*t963*t2680; out_ptr[403] = data12*x403*2.0-t39*t41*t963*t2680; out_ptr[404] = data12*x404*2.0-t39*t52*t963*t2680; out_ptr[405] = data12*x405*2.0-t40*t49*t963*t2680; out_ptr[406] = data12*x406*2.0-t40*t55*t963*t2680; out_ptr[407] = data12*x407*2.0-t40*t48*t963*t2680; out_ptr[408] = data12*x408*2.0-t40*t54*t963*t2680; out_ptr[409] = data12*x409*2.0-t40*t47*t963*t2680; out_ptr[410] = data12*x410*2.0-t40*t53*t963*t2680; out_ptr[411] = data12*x411*2.0-t40*t41*t963*t2680; out_ptr[412] = data12*x412*2.0-t40*t52*t963*t2680; out_ptr[413] = data12*x413*2.0-t42*t55*t963*t2680; out_ptr[414] = data12*x414*2.0-t42*t48*t963*t2680; out_ptr[415] = data12*x415*2.0-t42*t54*t963*t2680; out_ptr[416] = data12*x416*2.0-t42*t47*t963*t2680; out_ptr[417] = data12*x417*2.0-t42*t53*t963*t2680; out_ptr[418] = data12*x418*2.0-t41*t42*t963*t2680; out_ptr[419] = data12*x419*2.0-t42*t52*t963*t2680; out_ptr[420] = data12*x420*2.0-t43*t48*t963*t2680; out_ptr[421] = data12*x421*2.0-t43*t54*t963*t2680; out_ptr[422] = data12*x422*2.0-t43*t47*t963*t2680; out_ptr[423] = data12*x423*2.0-t43*t53*t963*t2680; out_ptr[424] = data12*x424*2.0-t41*t43*t963*t2680; out_ptr[425] = data12*x425*2.0-t43*t52*t963*t2680; out_ptr[426] = data12*x426*2.0-t44*t54*t963*t2680; out_ptr[427] = data12*x427*2.0-t44*t47*t963*t2680; out_ptr[428] = data12*x428*2.0-t44*t53*t963*t2680; out_ptr[429] = data12*x429*2.0-t41*t44*t963*t2680; out_ptr[430] = data12*x430*2.0-t44*t52*t963*t2680; out_ptr[431] = data12*x431*2.0-t45*t47*t963*t2680; out_ptr[432] = data12*x432*2.0-t45*t53*t963*t2680; out_ptr[433] = data12*x433*2.0-t41*t45*t963*t2680; out_ptr[434] = data12*x434*2.0-t45*t52*t963*t2680; out_ptr[435] = data12*x435*2.0-t46*t53*t963*t2680; out_ptr[436] = data12*x436*2.0-t41*t46*t963*t2680; out_ptr[437] = data12*x437*2.0-t46*t52*t963*t2680; out_ptr[438] = data12*x438*2.0-t41*t50*t963*t2680; out_ptr[439] = data12*x439*2.0-t50*t52*t963*t2680; out_ptr[440] = data12*x440*2.0-t51*t52*t963*t2680; out_ptr[441] = data12*t459*2.0-data13*t2739-t1030*t2680*(t459*t995-1.0); out_ptr[442] = -data13*t529+data12*t2741*2.0-t1030*t2680*(t56*t58*t529-1.0); out_ptr[443] = -data13*t530+data12*t2743*2.0-t1030*t2680*(t60*t67*t530-1.0); out_ptr[444] = -data13*t531+data12*t2745*2.0-t1030*t2680*(t61*t73*t531-1.0); out_ptr[445] = -data13*t532+data12*t2747*2.0-t1030*t2680*(t62*t66*t532-1.0); out_ptr[446] = -data13*t533+data12*t2749*2.0-t1030*t2680*(t63*t72*t533-1.0); out_ptr[447] = -data13*t534+data12*t2751*2.0-t1030*t2680*(t64*t65*t534-1.0); out_ptr[448] = -data13*t535+data12*t2753*2.0-t1030*t2680*(t68*t71*t535-1.0); out_ptr[449] = -data13*t536+data12*t2755*2.0-t1030*t2680*(t59*t69*t536-1.0); out_ptr[450] = -data13*t537+data12*t2757*2.0-t1030*t2680*(t70*t537*t1005-1.0); out_ptr[451] = data12*x451*2.0-t56*t57*t1030*t2680; out_ptr[452] = data12*x452*2.0-t57*t67*t1030*t2680; out_ptr[453] = data12*x453*2.0-t57*t73*t1030*t2680; out_ptr[454] = data12*x454*2.0-t57*t66*t1030*t2680; out_ptr[455] = data12*x455*2.0-t57*t72*t1030*t2680; out_ptr[456] = data12*x456*2.0-t57*t65*t1030*t2680; out_ptr[457] = data12*x457*2.0-t57*t71*t1030*t2680; out_ptr[458] = data12*x458*2.0-t57*t59*t1030*t2680; out_ptr[459] = data12*x459*2.0-t57*t70*t1030*t2680; out_ptr[460] = data12*x460*2.0-t58*t67*t1030*t2680; out_ptr[461] = data12*x461*2.0-t58*t73*t1030*t2680; out_ptr[462] = data12*x462*2.0-t58*t66*t1030*t2680; out_ptr[463] = data12*x463*2.0-t58*t72*t1030*t2680; out_ptr[464] = data12*x464*2.0-t58*t65*t1030*t2680; out_ptr[465] = data12*x465*2.0-t58*t71*t1030*t2680; out_ptr[466] = data12*x466*2.0-t58*t59*t1030*t2680; out_ptr[467] = data12*x467*2.0-t58*t70*t1030*t2680; out_ptr[468] = data12*x468*2.0-t60*t73*t1030*t2680; out_ptr[469] = data12*x469*2.0-t60*t66*t1030*t2680; out_ptr[470] = data12*x470*2.0-t60*t72*t1030*t2680; out_ptr[471] = data12*x471*2.0-t60*t65*t1030*t2680; out_ptr[472] = data12*x472*2.0-t60*t71*t1030*t2680; out_ptr[473] = data12*x473*2.0-t59*t60*t1030*t2680; out_ptr[474] = data12*x474*2.0-t60*t70*t1030*t2680; out_ptr[475] = data12*x475*2.0-t61*t66*t1030*t2680; out_ptr[476] = data12*x476*2.0-t61*t72*t1030*t2680; out_ptr[477] = data12*x477*2.0-t61*t65*t1030*t2680; out_ptr[478] = data12*x478*2.0-t61*t71*t1030*t2680; out_ptr[479] = data12*x479*2.0-t59*t61*t1030*t2680; out_ptr[480] = data12*x480*2.0-t61*t70*t1030*t2680; out_ptr[481] = data12*x481*2.0-t62*t72*t1030*t2680; out_ptr[482] = data12*x482*2.0-t62*t65*t1030*t2680; out_ptr[483] = data12*x483*2.0-t62*t71*t1030*t2680; out_ptr[484] = data12*x484*2.0-t59*t62*t1030*t2680; out_ptr[485] = data12*x485*2.0-t62*t70*t1030*t2680; out_ptr[486] = data12*x486*2.0-t63*t65*t1030*t2680; out_ptr[487] = data12*x487*2.0-t63*t71*t1030*t2680; out_ptr[488] = data12*x488*2.0-t59*t63*t1030*t2680; out_ptr[489] = data12*x489*2.0-t63*t70*t1030*t2680; out_ptr[490] = data12*x490*2.0-t64*t71*t1030*t2680; out_ptr[491] = data12*x491*2.0-t59*t64*t1030*t2680; out_ptr[492] = data12*x492*2.0-t64*t70*t1030*t2680; out_ptr[493] = data12*x493*2.0-t59*t68*t1030*t2680; out_ptr[494] = data12*x494*2.0-t68*t70*t1030*t2680; out_ptr[495] = data12*x495*2.0-t69*t70*t1030*t2680; out_ptr[496] = data12*t461*2.0-data13*t2758-t1097*t2680*(t461*t1062-1.0); out_ptr[497] = -data13*t538+data12*t2760*2.0-t1097*t2680*(t74*t76*t538-1.0); out_ptr[498] = -data13*t539+data12*t2762*2.0-t1097*t2680*(t78*t85*t539-1.0); out_ptr[499] = -data13*t540+data12*t2764*2.0-t1097*t2680*(t79*t91*t540-1.0); out_ptr[500] = -data13*t541+data12*t2766*2.0-t1097*t2680*(t80*t84*t541-1.0); out_ptr[501] = -data13*t542+data12*t2768*2.0-t1097*t2680*(t81*t90*t542-1.0); out_ptr[502] = -data13*t543+data12*t2770*2.0-t1097*t2680*(t82*t83*t543-1.0); out_ptr[503] = -data13*t544+data12*t2772*2.0-t1097*t2680*(t86*t89*t544-1.0); out_ptr[504] = -data13*t545+data12*t2774*2.0-t1097*t2680*(t77*t87*t545-1.0); out_ptr[505] = -data13*t546+data12*t2776*2.0-t1097*t2680*(t88*t546*t1072-1.0); out_ptr[506] = data12*x506*2.0-t74*t75*t1097*t2680; out_ptr[507] = data12*x507*2.0-t75*t85*t1097*t2680; out_ptr[508] = data12*x508*2.0-t75*t91*t1097*t2680; out_ptr[509] = data12*x509*2.0-t75*t84*t1097*t2680; out_ptr[510] = data12*x510*2.0-t75*t90*t1097*t2680; out_ptr[511] = data12*x511*2.0-t75*t83*t1097*t2680; out_ptr[512] = data12*x512*2.0-t75*t89*t1097*t2680; out_ptr[513] = data12*x513*2.0-t75*t77*t1097*t2680; out_ptr[514] = data12*x514*2.0-t75*t88*t1097*t2680; out_ptr[515] = data12*x515*2.0-t76*t85*t1097*t2680; out_ptr[516] = data12*x516*2.0-t76*t91*t1097*t2680; out_ptr[517] = data12*x517*2.0-t76*t84*t1097*t2680; out_ptr[518] = data12*x518*2.0-t76*t90*t1097*t2680; out_ptr[519] = data12*x519*2.0-t76*t83*t1097*t2680; out_ptr[520] = data12*x520*2.0-t76*t89*t1097*t2680; out_ptr[521] = data12*x521*2.0-t76*t77*t1097*t2680; out_ptr[522] = data12*x522*2.0-t76*t88*t1097*t2680; out_ptr[523] = data12*x523*2.0-t78*t91*t1097*t2680; out_ptr[524] = data12*x524*2.0-t78*t84*t1097*t2680; out_ptr[525] = data12*x525*2.0-t78*t90*t1097*t2680; out_ptr[526] = data12*x526*2.0-t78*t83*t1097*t2680; out_ptr[527] = data12*x527*2.0-t78*t89*t1097*t2680; out_ptr[528] = data12*x528*2.0-t77*t78*t1097*t2680; out_ptr[529] = data12*x529*2.0-t78*t88*t1097*t2680; out_ptr[530] = data12*x530*2.0-t79*t84*t1097*t2680; out_ptr[531] = data12*x531*2.0-t79*t90*t1097*t2680; out_ptr[532] = data12*x532*2.0-t79*t83*t1097*t2680; out_ptr[533] = data12*x533*2.0-t79*t89*t1097*t2680; out_ptr[534] = data12*x534*2.0-t77*t79*t1097*t2680; out_ptr[535] = data12*x535*2.0-t79*t88*t1097*t2680; out_ptr[536] = data12*x536*2.0-t80*t90*t1097*t2680; out_ptr[537] = data12*x537*2.0-t80*t83*t1097*t2680; out_ptr[538] = data12*x538*2.0-t80*t89*t1097*t2680; out_ptr[539] = data12*x539*2.0-t77*t80*t1097*t2680; out_ptr[540] = data12*x540*2.0-t80*t88*t1097*t2680; out_ptr[541] = data12*x541*2.0-t81*t83*t1097*t2680; out_ptr[542] = data12*x542*2.0-t81*t89*t1097*t2680; out_ptr[543] = data12*x543*2.0-t77*t81*t1097*t2680; out_ptr[544] = data12*x544*2.0-t81*t88*t1097*t2680; out_ptr[545] = data12*x545*2.0-t82*t89*t1097*t2680; out_ptr[546] = data12*x546*2.0-t77*t82*t1097*t2680; out_ptr[547] = data12*x547*2.0-t82*t88*t1097*t2680; out_ptr[548] = data12*x548*2.0-t77*t86*t1097*t2680; out_ptr[549] = data12*x549*2.0-t86*t88*t1097*t2680; out_ptr[550] = data12*x550*2.0-t87*t88*t1097*t2680; out_ptr[551] = data12*t463*2.0-data13*t2777-t1164*t2680*(t463*t1129-1.0); out_ptr[552] = -data13*t547+data12*t2779*2.0-t1164*t2680*(t92*t94*t547-1.0); out_ptr[553] = -data13*t548+data12*t2781*2.0-t1164*t2680*(t96*t103*t548-1.0); out_ptr[554] = -data13*t549+data12*t2783*2.0-t1164*t2680*(t97*t109*t549-1.0); out_ptr[555] = -data13*t550+data12*t2785*2.0-t1164*t2680*(t98*t102*t550-1.0); out_ptr[556] = -data13*t551+data12*t2787*2.0-t1164*t2680*(t99*t108*t551-1.0); out_ptr[557] = -data13*t552+data12*t2789*2.0-t1164*t2680*(t100*t101*t552-1.0); out_ptr[558] = -data13*t553+data12*t2791*2.0-t1164*t2680*(t104*t107*t553-1.0); out_ptr[559] = -data13*t554+data12*t2793*2.0-t1164*t2680*(t95*t105*t554-1.0); out_ptr[560] = -data13*t555+data12*t2795*2.0-t1164*t2680*(t106*t555*t1139-1.0); out_ptr[561] = data12*x561*2.0-t92*t93*t1164*t2680; out_ptr[562] = data12*x562*2.0-t93*t103*t1164*t2680; out_ptr[563] = data12*x563*2.0-t93*t109*t1164*t2680; out_ptr[564] = data12*x564*2.0-t93*t102*t1164*t2680; out_ptr[565] = data12*x565*2.0-t93*t108*t1164*t2680; out_ptr[566] = data12*x566*2.0-t93*t101*t1164*t2680; out_ptr[567] = data12*x567*2.0-t93*t107*t1164*t2680; out_ptr[568] = data12*x568*2.0-t93*t95*t1164*t2680; out_ptr[569] = data12*x569*2.0-t93*t106*t1164*t2680; out_ptr[570] = data12*x570*2.0-t94*t103*t1164*t2680; out_ptr[571] = data12*x571*2.0-t94*t109*t1164*t2680; out_ptr[572] = data12*x572*2.0-t94*t102*t1164*t2680; out_ptr[573] = data12*x573*2.0-t94*t108*t1164*t2680; out_ptr[574] = data12*x574*2.0-t94*t101*t1164*t2680; out_ptr[575] = data12*x575*2.0-t94*t107*t1164*t2680; out_ptr[576] = data12*x576*2.0-t94*t95*t1164*t2680; out_ptr[577] = data12*x577*2.0-t94*t106*t1164*t2680; out_ptr[578] = data12*x578*2.0-t96*t109*t1164*t2680; out_ptr[579] = data12*x579*2.0-t96*t102*t1164*t2680; out_ptr[580] = data12*x580*2.0-t96*t108*t1164*t2680; out_ptr[581] = data12*x581*2.0-t96*t101*t1164*t2680; out_ptr[582] = data12*x582*2.0-t96*t107*t1164*t2680; out_ptr[583] = data12*x583*2.0-t95*t96*t1164*t2680; out_ptr[584] = data12*x584*2.0-t96*t106*t1164*t2680; out_ptr[585] = data12*x585*2.0-t97*t102*t1164*t2680; out_ptr[586] = data12*x586*2.0-t97*t108*t1164*t2680; out_ptr[587] = data12*x587*2.0-t97*t101*t1164*t2680; out_ptr[588] = data12*x588*2.0-t97*t107*t1164*t2680; out_ptr[589] = data12*x589*2.0-t95*t97*t1164*t2680; out_ptr[590] = data12*x590*2.0-t97*t106*t1164*t2680; out_ptr[591] = data12*x591*2.0-t98*t108*t1164*t2680; out_ptr[592] = data12*x592*2.0-t98*t101*t1164*t2680; out_ptr[593] = data12*x593*2.0-t98*t107*t1164*t2680; out_ptr[594] = data12*x594*2.0-t95*t98*t1164*t2680; out_ptr[595] = data12*x595*2.0-t98*t106*t1164*t2680; out_ptr[596] = data12*x596*2.0-t99*t101*t1164*t2680; out_ptr[597] = data12*x597*2.0-t99*t107*t1164*t2680; out_ptr[598] = data12*x598*2.0-t95*t99*t1164*t2680; out_ptr[599] = data12*x599*2.0-t99*t106*t1164*t2680; out_ptr[600] = data12*x600*2.0-t100*t107*t1164*t2680; out_ptr[601] = data12*x601*2.0-t95*t100*t1164*t2680; out_ptr[602] = data12*x602*2.0-t100*t106*t1164*t2680; out_ptr[603] = data12*x603*2.0-t95*t104*t1164*t2680; out_ptr[604] = data12*x604*2.0-t104*t106*t1164*t2680; out_ptr[605] = data12*x605*2.0-t105*t106*t1164*t2680; out_ptr[606] = data12*t465*2.0-data13*t2796-t1231*t2680*(t465*t1196-1.0); out_ptr[607] = -data13*t556+data12*t2798*2.0-t1231*t2680*(t110*t112*t556-1.0); out_ptr[608] = -data13*t557+data12*t2800*2.0-t1231*t2680*(t114*t121*t557-1.0); out_ptr[609] = -data13*t558+data12*t2802*2.0-t1231*t2680*(t115*t127*t558-1.0); out_ptr[610] = -data13*t559+data12*t2804*2.0-t1231*t2680*(t116*t120*t559-1.0); out_ptr[611] = -data13*t560+data12*t2806*2.0-t1231*t2680*(t117*t126*t560-1.0); out_ptr[612] = -data13*t561+data12*t2808*2.0-t1231*t2680*(t118*t119*t561-1.0); out_ptr[613] = -data13*t562+data12*t2810*2.0-t1231*t2680*(t122*t125*t562-1.0); out_ptr[614] = -data13*t563+data12*t2812*2.0-t1231*t2680*(t113*t123*t563-1.0); out_ptr[615] = -data13*t564+data12*t2814*2.0-t1231*t2680*(t124*t564*t1206-1.0); out_ptr[616] = data12*x616*2.0-t110*t111*t1231*t2680; out_ptr[617] = data12*x617*2.0-t111*t121*t1231*t2680; out_ptr[618] = data12*x618*2.0-t111*t127*t1231*t2680; out_ptr[619] = data12*x619*2.0-t111*t120*t1231*t2680; out_ptr[620] = data12*x620*2.0-t111*t126*t1231*t2680; out_ptr[621] = data12*x621*2.0-t111*t119*t1231*t2680; out_ptr[622] = data12*x622*2.0-t111*t125*t1231*t2680; out_ptr[623] = data12*x623*2.0-t111*t113*t1231*t2680; out_ptr[624] = data12*x624*2.0-t111*t124*t1231*t2680; out_ptr[625] = data12*x625*2.0-t112*t121*t1231*t2680; out_ptr[626] = data12*x626*2.0-t112*t127*t1231*t2680; out_ptr[627] = data12*x627*2.0-t112*t120*t1231*t2680; out_ptr[628] = data12*x628*2.0-t112*t126*t1231*t2680; out_ptr[629] = data12*x629*2.0-t112*t119*t1231*t2680; out_ptr[630] = data12*x630*2.0-t112*t125*t1231*t2680; out_ptr[631] = data12*x631*2.0-t112*t113*t1231*t2680; out_ptr[632] = data12*x632*2.0-t112*t124*t1231*t2680; out_ptr[633] = data12*x633*2.0-t114*t127*t1231*t2680; out_ptr[634] = data12*x634*2.0-t114*t120*t1231*t2680; out_ptr[635] = data12*x635*2.0-t114*t126*t1231*t2680; out_ptr[636] = data12*x636*2.0-t114*t119*t1231*t2680; out_ptr[637] = data12*x637*2.0-t114*t125*t1231*t2680; out_ptr[638] = data12*x638*2.0-t113*t114*t1231*t2680; out_ptr[639] = data12*x639*2.0-t114*t124*t1231*t2680; out_ptr[640] = data12*x640*2.0-t115*t120*t1231*t2680; out_ptr[641] = data12*x641*2.0-t115*t126*t1231*t2680; out_ptr[642] = data12*x642*2.0-t115*t119*t1231*t2680; out_ptr[643] = data12*x643*2.0-t115*t125*t1231*t2680; out_ptr[644] = data12*x644*2.0-t113*t115*t1231*t2680; out_ptr[645] = data12*x645*2.0-t115*t124*t1231*t2680; out_ptr[646] = data12*x646*2.0-t116*t126*t1231*t2680; out_ptr[647] = data12*x647*2.0-t116*t119*t1231*t2680; out_ptr[648] = data12*x648*2.0-t116*t125*t1231*t2680; out_ptr[649] = data12*x649*2.0-t113*t116*t1231*t2680; out_ptr[650] = data12*x650*2.0-t116*t124*t1231*t2680; out_ptr[651] = data12*x651*2.0-t117*t119*t1231*t2680; out_ptr[652] = data12*x652*2.0-t117*t125*t1231*t2680; out_ptr[653] = data12*x653*2.0-t113*t117*t1231*t2680; out_ptr[654] = data12*x654*2.0-t117*t124*t1231*t2680; out_ptr[655] = data12*x655*2.0-t118*t125*t1231*t2680; out_ptr[656] = data12*x656*2.0-t113*t118*t1231*t2680; out_ptr[657] = data12*x657*2.0-t118*t124*t1231*t2680; out_ptr[658] = data12*x658*2.0-t113*t122*t1231*t2680; out_ptr[659] = data12*x659*2.0-t122*t124*t1231*t2680; out_ptr[660] = data12*x660*2.0-t123*t124*t1231*t2680; out_ptr[661] = data12*t467*2.0-data13*t2815-t1298*t2680*(t467*t1263-1.0); out_ptr[662] = -data13*t565+data12*t2817*2.0-t1298*t2680*(t128*t130*t565-1.0); out_ptr[663] = -data13*t566+data12*t2819*2.0-t1298*t2680*(t132*t139*t566-1.0); out_ptr[664] = -data13*t567+data12*t2821*2.0-t1298*t2680*(t133*t145*t567-1.0); out_ptr[665] = -data13*t568+data12*t2823*2.0-t1298*t2680*(t134*t138*t568-1.0); out_ptr[666] = -data13*t569+data12*t2825*2.0-t1298*t2680*(t135*t144*t569-1.0); out_ptr[667] = -data13*t570+data12*t2827*2.0-t1298*t2680*(t136*t137*t570-1.0); out_ptr[668] = -data13*t571+data12*t2829*2.0-t1298*t2680*(t140*t143*t571-1.0); out_ptr[669] = -data13*t572+data12*t2831*2.0-t1298*t2680*(t131*t141*t572-1.0); out_ptr[670] = -data13*t573+data12*t2833*2.0-t1298*t2680*(t142*t573*t1273-1.0); out_ptr[671] = data12*x671*2.0-t128*t129*t1298*t2680; out_ptr[672] = data12*x672*2.0-t129*t139*t1298*t2680; out_ptr[673] = data12*x673*2.0-t129*t145*t1298*t2680; out_ptr[674] = data12*x674*2.0-t129*t138*t1298*t2680; out_ptr[675] = data12*x675*2.0-t129*t144*t1298*t2680; out_ptr[676] = data12*x676*2.0-t129*t137*t1298*t2680; out_ptr[677] = data12*x677*2.0-t129*t143*t1298*t2680; out_ptr[678] = data12*x678*2.0-t129*t131*t1298*t2680; out_ptr[679] = data12*x679*2.0-t129*t142*t1298*t2680; out_ptr[680] = data12*x680*2.0-t130*t139*t1298*t2680; out_ptr[681] = data12*x681*2.0-t130*t145*t1298*t2680; out_ptr[682] = data12*x682*2.0-t130*t138*t1298*t2680; out_ptr[683] = data12*x683*2.0-t130*t144*t1298*t2680; out_ptr[684] = data12*x684*2.0-t130*t137*t1298*t2680; out_ptr[685] = data12*x685*2.0-t130*t143*t1298*t2680; out_ptr[686] = data12*x686*2.0-t130*t131*t1298*t2680; out_ptr[687] = data12*x687*2.0-t130*t142*t1298*t2680; out_ptr[688] = data12*x688*2.0-t132*t145*t1298*t2680; out_ptr[689] = data12*x689*2.0-t132*t138*t1298*t2680; out_ptr[690] = data12*x690*2.0-t132*t144*t1298*t2680; out_ptr[691] = data12*x691*2.0-t132*t137*t1298*t2680; out_ptr[692] = data12*x692*2.0-t132*t143*t1298*t2680; out_ptr[693] = data12*x693*2.0-t131*t132*t1298*t2680; out_ptr[694] = data12*x694*2.0-t132*t142*t1298*t2680; out_ptr[695] = data12*x695*2.0-t133*t138*t1298*t2680; out_ptr[696] = data12*x696*2.0-t133*t144*t1298*t2680; out_ptr[697] = data12*x697*2.0-t133*t137*t1298*t2680; out_ptr[698] = data12*x698*2.0-t133*t143*t1298*t2680; out_ptr[699] = data12*x699*2.0-t131*t133*t1298*t2680; out_ptr[700] = data12*x700*2.0-t133*t142*t1298*t2680; out_ptr[701] = data12*x701*2.0-t134*t144*t1298*t2680; out_ptr[702] = data12*x702*2.0-t134*t137*t1298*t2680; out_ptr[703] = data12*x703*2.0-t134*t143*t1298*t2680; out_ptr[704] = data12*x704*2.0-t131*t134*t1298*t2680; out_ptr[705] = data12*x705*2.0-t134*t142*t1298*t2680; out_ptr[706] = data12*x706*2.0-t135*t137*t1298*t2680; out_ptr[707] = data12*x707*2.0-t135*t143*t1298*t2680; out_ptr[708] = data12*x708*2.0-t131*t135*t1298*t2680; out_ptr[709] = data12*x709*2.0-t135*t142*t1298*t2680; out_ptr[710] = data12*x710*2.0-t136*t143*t1298*t2680; out_ptr[711] = data12*x711*2.0-t131*t136*t1298*t2680; out_ptr[712] = data12*x712*2.0-t136*t142*t1298*t2680; out_ptr[713] = data12*x713*2.0-t131*t140*t1298*t2680; out_ptr[714] = data12*x714*2.0-t140*t142*t1298*t2680; out_ptr[715] = data12*x715*2.0-t141*t142*t1298*t2680; out_ptr[716] = data12*t469*2.0-data13*t2834-t1365*t2680*(t469*t1330-1.0); out_ptr[717] = -data13*t574+data12*t2836*2.0-t1365*t2680*(t146*t148*t574-1.0); out_ptr[718] = -data13*t575+data12*t2838*2.0-t1365*t2680*(t150*t157*t575-1.0); out_ptr[719] = -data13*t576+data12*t2840*2.0-t1365*t2680*(t151*t163*t576-1.0); out_ptr[720] = -data13*t577+data12*t2842*2.0-t1365*t2680*(t152*t156*t577-1.0); out_ptr[721] = -data13*t578+data12*t2844*2.0-t1365*t2680*(t153*t162*t578-1.0); out_ptr[722] = -data13*t579+data12*t2846*2.0-t1365*t2680*(t154*t155*t579-1.0); out_ptr[723] = -data13*t580+data12*t2848*2.0-t1365*t2680*(t158*t161*t580-1.0); out_ptr[724] = -data13*t581+data12*t2850*2.0-t1365*t2680*(t149*t159*t581-1.0); out_ptr[725] = -data13*t582+data12*t2852*2.0-t1365*t2680*(t160*t582*t1340-1.0); out_ptr[726] = data12*x726*2.0-t146*t147*t1365*t2680; out_ptr[727] = data12*x727*2.0-t147*t157*t1365*t2680; out_ptr[728] = data12*x728*2.0-t147*t163*t1365*t2680; out_ptr[729] = data12*x729*2.0-t147*t156*t1365*t2680; out_ptr[730] = data12*x730*2.0-t147*t162*t1365*t2680; out_ptr[731] = data12*x731*2.0-t147*t155*t1365*t2680; out_ptr[732] = data12*x732*2.0-t147*t161*t1365*t2680; out_ptr[733] = data12*x733*2.0-t147*t149*t1365*t2680; out_ptr[734] = data12*x734*2.0-t147*t160*t1365*t2680; out_ptr[735] = data12*x735*2.0-t148*t157*t1365*t2680; out_ptr[736] = data12*x736*2.0-t148*t163*t1365*t2680; out_ptr[737] = data12*x737*2.0-t148*t156*t1365*t2680; out_ptr[738] = data12*x738*2.0-t148*t162*t1365*t2680; out_ptr[739] = data12*x739*2.0-t148*t155*t1365*t2680; out_ptr[740] = data12*x740*2.0-t148*t161*t1365*t2680; out_ptr[741] = data12*x741*2.0-t148*t149*t1365*t2680; out_ptr[742] = data12*x742*2.0-t148*t160*t1365*t2680; out_ptr[743] = data12*x743*2.0-t150*t163*t1365*t2680; out_ptr[744] = data12*x744*2.0-t150*t156*t1365*t2680; out_ptr[745] = data12*x745*2.0-t150*t162*t1365*t2680; out_ptr[746] = data12*x746*2.0-t150*t155*t1365*t2680; out_ptr[747] = data12*x747*2.0-t150*t161*t1365*t2680; out_ptr[748] = data12*x748*2.0-t149*t150*t1365*t2680; out_ptr[749] = data12*x749*2.0-t150*t160*t1365*t2680; out_ptr[750] = data12*x750*2.0-t151*t156*t1365*t2680; out_ptr[751] = data12*x751*2.0-t151*t162*t1365*t2680; out_ptr[752] = data12*x752*2.0-t151*t155*t1365*t2680; out_ptr[753] = data12*x753*2.0-t151*t161*t1365*t2680; out_ptr[754] = data12*x754*2.0-t149*t151*t1365*t2680; out_ptr[755] = data12*x755*2.0-t151*t160*t1365*t2680; out_ptr[756] = data12*x756*2.0-t152*t162*t1365*t2680; out_ptr[757] = data12*x757*2.0-t152*t155*t1365*t2680; out_ptr[758] = data12*x758*2.0-t152*t161*t1365*t2680; out_ptr[759] = data12*x759*2.0-t149*t152*t1365*t2680; out_ptr[760] = data12*x760*2.0-t152*t160*t1365*t2680; out_ptr[761] = data12*x761*2.0-t153*t155*t1365*t2680; out_ptr[762] = data12*x762*2.0-t153*t161*t1365*t2680; out_ptr[763] = data12*x763*2.0-t149*t153*t1365*t2680; out_ptr[764] = data12*x764*2.0-t153*t160*t1365*t2680; out_ptr[765] = data12*x765*2.0-t154*t161*t1365*t2680; out_ptr[766] = data12*x766*2.0-t149*t154*t1365*t2680; out_ptr[767] = data12*x767*2.0-t154*t160*t1365*t2680; out_ptr[768] = data12*x768*2.0-t149*t158*t1365*t2680; out_ptr[769] = data12*x769*2.0-t158*t160*t1365*t2680; out_ptr[770] = data12*x770*2.0-t159*t160*t1365*t2680; out_ptr[771] = data12*t471*2.0-data13*t2853-t1432*t2680*(t471*t1397-1.0); out_ptr[772] = -data13*t583+data12*t2855*2.0-t1432*t2680*(t164*t166*t583-1.0); out_ptr[773] = -data13*t584+data12*t2857*2.0-t1432*t2680*(t168*t175*t584-1.0); out_ptr[774] = -data13*t585+data12*t2859*2.0-t1432*t2680*(t169*t181*t585-1.0); out_ptr[775] = -data13*t586+data12*t2861*2.0-t1432*t2680*(t170*t174*t586-1.0); out_ptr[776] = -data13*t587+data12*t2863*2.0-t1432*t2680*(t171*t180*t587-1.0); out_ptr[777] = -data13*t588+data12*t2865*2.0-t1432*t2680*(t172*t173*t588-1.0); out_ptr[778] = -data13*t589+data12*t2867*2.0-t1432*t2680*(t176*t179*t589-1.0); out_ptr[779] = -data13*t590+data12*t2869*2.0-t1432*t2680*(t167*t177*t590-1.0); out_ptr[780] = -data13*t591+data12*t2871*2.0-t1432*t2680*(t178*t591*t1407-1.0); out_ptr[781] = data12*x781*2.0-t164*t165*t1432*t2680; out_ptr[782] = data12*x782*2.0-t165*t175*t1432*t2680; out_ptr[783] = data12*x783*2.0-t165*t181*t1432*t2680; out_ptr[784] = data12*x784*2.0-t165*t174*t1432*t2680; out_ptr[785] = data12*x785*2.0-t165*t180*t1432*t2680; out_ptr[786] = data12*x786*2.0-t165*t173*t1432*t2680; out_ptr[787] = data12*x787*2.0-t165*t179*t1432*t2680; out_ptr[788] = data12*x788*2.0-t165*t167*t1432*t2680; out_ptr[789] = data12*x789*2.0-t165*t178*t1432*t2680; out_ptr[790] = data12*x790*2.0-t166*t175*t1432*t2680; out_ptr[791] = data12*x791*2.0-t166*t181*t1432*t2680; out_ptr[792] = data12*x792*2.0-t166*t174*t1432*t2680; out_ptr[793] = data12*x793*2.0-t166*t180*t1432*t2680; out_ptr[794] = data12*x794*2.0-t166*t173*t1432*t2680; out_ptr[795] = data12*x795*2.0-t166*t179*t1432*t2680; out_ptr[796] = data12*x796*2.0-t166*t167*t1432*t2680; out_ptr[797] = data12*x797*2.0-t166*t178*t1432*t2680; out_ptr[798] = data12*x798*2.0-t168*t181*t1432*t2680; out_ptr[799] = data12*x799*2.0-t168*t174*t1432*t2680; out_ptr[800] = data12*x800*2.0-t168*t180*t1432*t2680; out_ptr[801] = data12*x801*2.0-t168*t173*t1432*t2680; out_ptr[802] = data12*x802*2.0-t168*t179*t1432*t2680; out_ptr[803] = data12*x803*2.0-t167*t168*t1432*t2680; out_ptr[804] = data12*x804*2.0-t168*t178*t1432*t2680; out_ptr[805] = data12*x805*2.0-t169*t174*t1432*t2680; out_ptr[806] = data12*x806*2.0-t169*t180*t1432*t2680; out_ptr[807] = data12*x807*2.0-t169*t173*t1432*t2680; out_ptr[808] = data12*x808*2.0-t169*t179*t1432*t2680; out_ptr[809] = data12*x809*2.0-t167*t169*t1432*t2680; out_ptr[810] = data12*x810*2.0-t169*t178*t1432*t2680; out_ptr[811] = data12*x811*2.0-t170*t180*t1432*t2680; out_ptr[812] = data12*x812*2.0-t170*t173*t1432*t2680; out_ptr[813] = data12*x813*2.0-t170*t179*t1432*t2680; out_ptr[814] = data12*x814*2.0-t167*t170*t1432*t2680; out_ptr[815] = data12*x815*2.0-t170*t178*t1432*t2680; out_ptr[816] = data12*x816*2.0-t171*t173*t1432*t2680; out_ptr[817] = data12*x817*2.0-t171*t179*t1432*t2680; out_ptr[818] = data12*x818*2.0-t167*t171*t1432*t2680; out_ptr[819] = data12*x819*2.0-t171*t178*t1432*t2680; out_ptr[820] = data12*x820*2.0-t172*t179*t1432*t2680; out_ptr[821] = data12*x821*2.0-t167*t172*t1432*t2680; out_ptr[822] = data12*x822*2.0-t172*t178*t1432*t2680; out_ptr[823] = data12*x823*2.0-t167*t176*t1432*t2680; out_ptr[824] = data12*x824*2.0-t176*t178*t1432*t2680; out_ptr[825] = data12*x825*2.0-t177*t178*t1432*t2680; out_ptr[826] = data12*t473*2.0-data13*t2872-t1499*t2680*(t473*t1464-1.0); out_ptr[827] = -data13*t592+data12*t2874*2.0-t1499*t2680*(t182*t184*t592-1.0); out_ptr[828] = -data13*t593+data12*t2876*2.0-t1499*t2680*(t186*t193*t593-1.0); out_ptr[829] = -data13*t594+data12*t2878*2.0-t1499*t2680*(t187*t199*t594-1.0); out_ptr[830] = -data13*t595+data12*t2880*2.0-t1499*t2680*(t188*t192*t595-1.0); out_ptr[831] = -data13*t596+data12*t2882*2.0-t1499*t2680*(t189*t198*t596-1.0); out_ptr[832] = -data13*t597+data12*t2884*2.0-t1499*t2680*(t190*t191*t597-1.0); out_ptr[833] = -data13*t598+data12*t2886*2.0-t1499*t2680*(t194*t197*t598-1.0); out_ptr[834] = -data13*t599+data12*t2888*2.0-t1499*t2680*(t185*t195*t599-1.0); out_ptr[835] = -data13*t600+data12*t2890*2.0-t1499*t2680*(t196*t600*t1474-1.0); out_ptr[836] = data12*x836*2.0-t182*t183*t1499*t2680; out_ptr[837] = data12*x837*2.0-t183*t193*t1499*t2680; out_ptr[838] = data12*x838*2.0-t183*t199*t1499*t2680; out_ptr[839] = data12*x839*2.0-t183*t192*t1499*t2680; out_ptr[840] = data12*x840*2.0-t183*t198*t1499*t2680; out_ptr[841] = data12*x841*2.0-t183*t191*t1499*t2680; out_ptr[842] = data12*x842*2.0-t183*t197*t1499*t2680; out_ptr[843] = data12*x843*2.0-t183*t185*t1499*t2680; out_ptr[844] = data12*x844*2.0-t183*t196*t1499*t2680; out_ptr[845] = data12*x845*2.0-t184*t193*t1499*t2680; out_ptr[846] = data12*x846*2.0-t184*t199*t1499*t2680; out_ptr[847] = data12*x847*2.0-t184*t192*t1499*t2680; out_ptr[848] = data12*x848*2.0-t184*t198*t1499*t2680; out_ptr[849] = data12*x849*2.0-t184*t191*t1499*t2680; out_ptr[850] = data12*x850*2.0-t184*t197*t1499*t2680; out_ptr[851] = data12*x851*2.0-t184*t185*t1499*t2680; out_ptr[852] = data12*x852*2.0-t184*t196*t1499*t2680; out_ptr[853] = data12*x853*2.0-t186*t199*t1499*t2680; out_ptr[854] = data12*x854*2.0-t186*t192*t1499*t2680; out_ptr[855] = data12*x855*2.0-t186*t198*t1499*t2680; out_ptr[856] = data12*x856*2.0-t186*t191*t1499*t2680; out_ptr[857] = data12*x857*2.0-t186*t197*t1499*t2680; out_ptr[858] = data12*x858*2.0-t185*t186*t1499*t2680; out_ptr[859] = data12*x859*2.0-t186*t196*t1499*t2680; out_ptr[860] = data12*x860*2.0-t187*t192*t1499*t2680; out_ptr[861] = data12*x861*2.0-t187*t198*t1499*t2680; out_ptr[862] = data12*x862*2.0-t187*t191*t1499*t2680; out_ptr[863] = data12*x863*2.0-t187*t197*t1499*t2680; out_ptr[864] = data12*x864*2.0-t185*t187*t1499*t2680; out_ptr[865] = data12*x865*2.0-t187*t196*t1499*t2680; out_ptr[866] = data12*x866*2.0-t188*t198*t1499*t2680; out_ptr[867] = data12*x867*2.0-t188*t191*t1499*t2680; out_ptr[868] = data12*x868*2.0-t188*t197*t1499*t2680; out_ptr[869] = data12*x869*2.0-t185*t188*t1499*t2680; out_ptr[870] = data12*x870*2.0-t188*t196*t1499*t2680; out_ptr[871] = data12*x871*2.0-t189*t191*t1499*t2680; out_ptr[872] = data12*x872*2.0-t189*t197*t1499*t2680; out_ptr[873] = data12*x873*2.0-t185*t189*t1499*t2680; out_ptr[874] = data12*x874*2.0-t189*t196*t1499*t2680; out_ptr[875] = data12*x875*2.0-t190*t197*t1499*t2680; out_ptr[876] = data12*x876*2.0-t185*t190*t1499*t2680; out_ptr[877] = data12*x877*2.0-t190*t196*t1499*t2680; out_ptr[878] = data12*x878*2.0-t185*t194*t1499*t2680; out_ptr[879] = data12*x879*2.0-t194*t196*t1499*t2680; out_ptr[880] = data12*x880*2.0-t195*t196*t1499*t2680; out_ptr[881] = data12*t475*2.0-data13*t2891-t1566*t2680*(t475*t1531-1.0); out_ptr[882] = -data13*t601+data12*t2893*2.0-t1566*t2680*(t200*t202*t601-1.0); out_ptr[883] = -data13*t602+data12*t2895*2.0-t1566*t2680*(t204*t211*t602-1.0); out_ptr[884] = -data13*t603+data12*t2897*2.0-t1566*t2680*(t205*t217*t603-1.0); out_ptr[885] = -data13*t604+data12*t2899*2.0-t1566*t2680*(t206*t210*t604-1.0); out_ptr[886] = -data13*t605+data12*t2901*2.0-t1566*t2680*(t207*t216*t605-1.0); out_ptr[887] = -data13*t606+data12*t2903*2.0-t1566*t2680*(t208*t209*t606-1.0); out_ptr[888] = -data13*t607+data12*t2905*2.0-t1566*t2680*(t212*t215*t607-1.0); out_ptr[889] = -data13*t608+data12*t2907*2.0-t1566*t2680*(t203*t213*t608-1.0); out_ptr[890] = -data13*t609+data12*t2909*2.0-t1566*t2680*(t214*t609*t1541-1.0); out_ptr[891] = data12*x891*2.0-t200*t201*t1566*t2680; out_ptr[892] = data12*x892*2.0-t201*t211*t1566*t2680; out_ptr[893] = data12*x893*2.0-t201*t217*t1566*t2680; out_ptr[894] = data12*x894*2.0-t201*t210*t1566*t2680; out_ptr[895] = data12*x895*2.0-t201*t216*t1566*t2680; out_ptr[896] = data12*x896*2.0-t201*t209*t1566*t2680; out_ptr[897] = data12*x897*2.0-t201*t215*t1566*t2680; out_ptr[898] = data12*x898*2.0-t201*t203*t1566*t2680; out_ptr[899] = data12*x899*2.0-t201*t214*t1566*t2680; out_ptr[900] = data12*x900*2.0-t202*t211*t1566*t2680; out_ptr[901] = data12*x901*2.0-t202*t217*t1566*t2680; out_ptr[902] = data12*x902*2.0-t202*t210*t1566*t2680; out_ptr[903] = data12*x903*2.0-t202*t216*t1566*t2680; out_ptr[904] = data12*x904*2.0-t202*t209*t1566*t2680; out_ptr[905] = data12*x905*2.0-t202*t215*t1566*t2680; out_ptr[906] = data12*x906*2.0-t202*t203*t1566*t2680; out_ptr[907] = data12*x907*2.0-t202*t214*t1566*t2680; out_ptr[908] = data12*x908*2.0-t204*t217*t1566*t2680; out_ptr[909] = data12*x909*2.0-t204*t210*t1566*t2680; out_ptr[910] = data12*x910*2.0-t204*t216*t1566*t2680; out_ptr[911] = data12*x911*2.0-t204*t209*t1566*t2680; out_ptr[912] = data12*x912*2.0-t204*t215*t1566*t2680; out_ptr[913] = data12*x913*2.0-t203*t204*t1566*t2680; out_ptr[914] = data12*x914*2.0-t204*t214*t1566*t2680; out_ptr[915] = data12*x915*2.0-t205*t210*t1566*t2680; out_ptr[916] = data12*x916*2.0-t205*t216*t1566*t2680; out_ptr[917] = data12*x917*2.0-t205*t209*t1566*t2680; out_ptr[918] = data12*x918*2.0-t205*t215*t1566*t2680; out_ptr[919] = data12*x919*2.0-t203*t205*t1566*t2680; out_ptr[920] = data12*x920*2.0-t205*t214*t1566*t2680; out_ptr[921] = data12*x921*2.0-t206*t216*t1566*t2680; out_ptr[922] = data12*x922*2.0-t206*t209*t1566*t2680; out_ptr[923] = data12*x923*2.0-t206*t215*t1566*t2680; out_ptr[924] = data12*x924*2.0-t203*t206*t1566*t2680; out_ptr[925] = data12*x925*2.0-t206*t214*t1566*t2680; out_ptr[926] = data12*x926*2.0-t207*t209*t1566*t2680; out_ptr[927] = data12*x927*2.0-t207*t215*t1566*t2680; out_ptr[928] = data12*x928*2.0-t203*t207*t1566*t2680; out_ptr[929] = data12*x929*2.0-t207*t214*t1566*t2680; out_ptr[930] = data12*x930*2.0-t208*t215*t1566*t2680; out_ptr[931] = data12*x931*2.0-t203*t208*t1566*t2680; out_ptr[932] = data12*x932*2.0-t208*t214*t1566*t2680; out_ptr[933] = data12*x933*2.0-t203*t212*t1566*t2680; out_ptr[934] = data12*x934*2.0-t212*t214*t1566*t2680; out_ptr[935] = data12*x935*2.0-t213*t214*t1566*t2680; out_ptr[936] = data12*t477*2.0-data13*t2910-t1633*t2680*(t477*t1598-1.0); out_ptr[937] = -data13*t610+data12*t2912*2.0-t1633*t2680*(t218*t220*t610-1.0); out_ptr[938] = -data13*t611+data12*t2914*2.0-t1633*t2680*(t222*t229*t611-1.0); out_ptr[939] = -data13*t612+data12*t2916*2.0-t1633*t2680*(t223*t235*t612-1.0); out_ptr[940] = -data13*t613+data12*t2918*2.0-t1633*t2680*(t224*t228*t613-1.0); out_ptr[941] = -data13*t614+data12*t2920*2.0-t1633*t2680*(t225*t234*t614-1.0); out_ptr[942] = -data13*t615+data12*t2922*2.0-t1633*t2680*(t226*t227*t615-1.0); out_ptr[943] = -data13*t616+data12*t2924*2.0-t1633*t2680*(t230*t233*t616-1.0); out_ptr[944] = -data13*t617+data12*t2926*2.0-t1633*t2680*(t221*t231*t617-1.0); out_ptr[945] = -data13*t618+data12*t2928*2.0-t1633*t2680*(t232*t618*t1608-1.0); out_ptr[946] = data12*x946*2.0-t218*t219*t1633*t2680; out_ptr[947] = data12*x947*2.0-t219*t229*t1633*t2680; out_ptr[948] = data12*x948*2.0-t219*t235*t1633*t2680; out_ptr[949] = data12*x949*2.0-t219*t228*t1633*t2680; out_ptr[950] = data12*x950*2.0-t219*t234*t1633*t2680; out_ptr[951] = data12*x951*2.0-t219*t227*t1633*t2680; out_ptr[952] = data12*x952*2.0-t219*t233*t1633*t2680; out_ptr[953] = data12*x953*2.0-t219*t221*t1633*t2680; out_ptr[954] = data12*x954*2.0-t219*t232*t1633*t2680; out_ptr[955] = data12*x955*2.0-t220*t229*t1633*t2680; out_ptr[956] = data12*x956*2.0-t220*t235*t1633*t2680; out_ptr[957] = data12*x957*2.0-t220*t228*t1633*t2680; out_ptr[958] = data12*x958*2.0-t220*t234*t1633*t2680; out_ptr[959] = data12*x959*2.0-t220*t227*t1633*t2680; out_ptr[960] = data12*x960*2.0-t220*t233*t1633*t2680; out_ptr[961] = data12*x961*2.0-t220*t221*t1633*t2680; out_ptr[962] = data12*x962*2.0-t220*t232*t1633*t2680; out_ptr[963] = data12*x963*2.0-t222*t235*t1633*t2680; out_ptr[964] = data12*x964*2.0-t222*t228*t1633*t2680; out_ptr[965] = data12*x965*2.0-t222*t234*t1633*t2680; out_ptr[966] = data12*x966*2.0-t222*t227*t1633*t2680; out_ptr[967] = data12*x967*2.0-t222*t233*t1633*t2680; out_ptr[968] = data12*x968*2.0-t221*t222*t1633*t2680; out_ptr[969] = data12*x969*2.0-t222*t232*t1633*t2680; out_ptr[970] = data12*x970*2.0-t223*t228*t1633*t2680; out_ptr[971] = data12*x971*2.0-t223*t234*t1633*t2680; out_ptr[972] = data12*x972*2.0-t223*t227*t1633*t2680; out_ptr[973] = data12*x973*2.0-t223*t233*t1633*t2680; out_ptr[974] = data12*x974*2.0-t221*t223*t1633*t2680; out_ptr[975] = data12*x975*2.0-t223*t232*t1633*t2680; out_ptr[976] = data12*x976*2.0-t224*t234*t1633*t2680; out_ptr[977] = data12*x977*2.0-t224*t227*t1633*t2680; out_ptr[978] = data12*x978*2.0-t224*t233*t1633*t2680; out_ptr[979] = data12*x979*2.0-t221*t224*t1633*t2680; out_ptr[980] = data12*x980*2.0-t224*t232*t1633*t2680; out_ptr[981] = data12*x981*2.0-t225*t227*t1633*t2680; out_ptr[982] = data12*x982*2.0-t225*t233*t1633*t2680; out_ptr[983] = data12*x983*2.0-t221*t225*t1633*t2680; out_ptr[984] = data12*x984*2.0-t225*t232*t1633*t2680; out_ptr[985] = data12*x985*2.0-t226*t233*t1633*t2680; out_ptr[986] = data12*x986*2.0-t221*t226*t1633*t2680; out_ptr[987] = data12*x987*2.0-t226*t232*t1633*t2680; out_ptr[988] = data12*x988*2.0-t221*t230*t1633*t2680; out_ptr[989] = data12*x989*2.0-t230*t232*t1633*t2680; out_ptr[990] = data12*x990*2.0-t231*t232*t1633*t2680; out_ptr[991] = data12*t479*2.0-data13*t2929-t1700*t2680*(t479*t1665-1.0); out_ptr[992] = -data13*t619+data12*t2931*2.0-t1700*t2680*(t236*t238*t619-1.0); out_ptr[993] = -data13*t620+data12*t2933*2.0-t1700*t2680*(t240*t247*t620-1.0); out_ptr[994] = -data13*t621+data12*t2935*2.0-t1700*t2680*(t241*t253*t621-1.0); out_ptr[995] = -data13*t622+data12*t2937*2.0-t1700*t2680*(t242*t246*t622-1.0); out_ptr[996] = -data13*t623+data12*t2939*2.0-t1700*t2680*(t243*t252*t623-1.0); out_ptr[997] = -data13*t624+data12*t2941*2.0-t1700*t2680*(t244*t245*t624-1.0); out_ptr[998] = -data13*t625+data12*t2943*2.0-t1700*t2680*(t248*t251*t625-1.0); out_ptr[999] = -data13*t626+data12*t2945*2.0-t1700*t2680*(t239*t249*t626-1.0); out_ptr[1000] = -data13*t627+data12*t2947*2.0-t1700*t2680*(t250*t627*t1675-1.0); out_ptr[1001] = data12*x1001*2.0-t236*t237*t1700*t2680; out_ptr[1002] = data12*x1002*2.0-t237*t247*t1700*t2680; out_ptr[1003] = data12*x1003*2.0-t237*t253*t1700*t2680; out_ptr[1004] = data12*x1004*2.0-t237*t246*t1700*t2680; out_ptr[1005] = data12*x1005*2.0-t237*t252*t1700*t2680; out_ptr[1006] = data12*x1006*2.0-t237*t245*t1700*t2680; out_ptr[1007] = data12*x1007*2.0-t237*t251*t1700*t2680; out_ptr[1008] = data12*x1008*2.0-t237*t239*t1700*t2680; out_ptr[1009] = data12*x1009*2.0-t237*t250*t1700*t2680; out_ptr[1010] = data12*x1010*2.0-t238*t247*t1700*t2680; out_ptr[1011] = data12*x1011*2.0-t238*t253*t1700*t2680; out_ptr[1012] = data12*x1012*2.0-t238*t246*t1700*t2680; out_ptr[1013] = data12*x1013*2.0-t238*t252*t1700*t2680; out_ptr[1014] = data12*x1014*2.0-t238*t245*t1700*t2680; out_ptr[1015] = data12*x1015*2.0-t238*t251*t1700*t2680; out_ptr[1016] = data12*x1016*2.0-t238*t239*t1700*t2680; out_ptr[1017] = data12*x1017*2.0-t238*t250*t1700*t2680; out_ptr[1018] = data12*x1018*2.0-t240*t253*t1700*t2680; out_ptr[1019] = data12*x1019*2.0-t240*t246*t1700*t2680; out_ptr[1020] = data12*x1020*2.0-t240*t252*t1700*t2680; out_ptr[1021] = data12*x1021*2.0-t240*t245*t1700*t2680; out_ptr[1022] = data12*x1022*2.0-t240*t251*t1700*t2680; out_ptr[1023] = data12*x1023*2.0-t239*t240*t1700*t2680; out_ptr[1024] = data12*x1024*2.0-t240*t250*t1700*t2680; out_ptr[1025] = data12*x1025*2.0-t241*t246*t1700*t2680; out_ptr[1026] = data12*x1026*2.0-t241*t252*t1700*t2680; out_ptr[1027] = data12*x1027*2.0-t241*t245*t1700*t2680; out_ptr[1028] = data12*x1028*2.0-t241*t251*t1700*t2680; out_ptr[1029] = data12*x1029*2.0-t239*t241*t1700*t2680; out_ptr[1030] = data12*x1030*2.0-t241*t250*t1700*t2680; out_ptr[1031] = data12*x1031*2.0-t242*t252*t1700*t2680; out_ptr[1032] = data12*x1032*2.0-t242*t245*t1700*t2680; out_ptr[1033] = data12*x1033*2.0-t242*t251*t1700*t2680; out_ptr[1034] = data12*x1034*2.0-t239*t242*t1700*t2680; out_ptr[1035] = data12*x1035*2.0-t242*t250*t1700*t2680; out_ptr[1036] = data12*x1036*2.0-t243*t245*t1700*t2680; out_ptr[1037] = data12*x1037*2.0-t243*t251*t1700*t2680; out_ptr[1038] = data12*x1038*2.0-t239*t243*t1700*t2680; out_ptr[1039] = data12*x1039*2.0-t243*t250*t1700*t2680; out_ptr[1040] = data12*x1040*2.0-t244*t251*t1700*t2680; out_ptr[1041] = data12*x1041*2.0-t239*t244*t1700*t2680; out_ptr[1042] = data12*x1042*2.0-t244*t250*t1700*t2680; out_ptr[1043] = data12*x1043*2.0-t239*t248*t1700*t2680; out_ptr[1044] = data12*x1044*2.0-t248*t250*t1700*t2680; out_ptr[1045] = data12*x1045*2.0-t249*t250*t1700*t2680; out_ptr[1046] = data12*t481*2.0-data13*t2948-t1767*t2680*(t481*t1732-1.0); out_ptr[1047] = -data13*t628+data12*t2950*2.0-t1767*t2680*(t254*t256*t628-1.0); out_ptr[1048] = -data13*t629+data12*t2952*2.0-t1767*t2680*(t258*t265*t629-1.0); out_ptr[1049] = -data13*t630+data12*t2954*2.0-t1767*t2680*(t259*t271*t630-1.0); out_ptr[1050] = -data13*t631+data12*t2956*2.0-t1767*t2680*(t260*t264*t631-1.0); out_ptr[1051] = -data13*t632+data12*t2958*2.0-t1767*t2680*(t261*t270*t632-1.0); out_ptr[1052] = -data13*t633+data12*t2960*2.0-t1767*t2680*(t262*t263*t633-1.0); out_ptr[1053] = -data13*t634+data12*t2962*2.0-t1767*t2680*(t266*t269*t634-1.0); out_ptr[1054] = -data13*t635+data12*t2964*2.0-t1767*t2680*(t257*t267*t635-1.0); out_ptr[1055] = -data13*t636+data12*t2966*2.0-t1767*t2680*(t268*t636*t1742-1.0); out_ptr[1056] = data12*x1056*2.0-t254*t255*t1767*t2680; out_ptr[1057] = data12*x1057*2.0-t255*t265*t1767*t2680; out_ptr[1058] = data12*x1058*2.0-t255*t271*t1767*t2680; out_ptr[1059] = data12*x1059*2.0-t255*t264*t1767*t2680; out_ptr[1060] = data12*x1060*2.0-t255*t270*t1767*t2680; out_ptr[1061] = data12*x1061*2.0-t255*t263*t1767*t2680; out_ptr[1062] = data12*x1062*2.0-t255*t269*t1767*t2680; out_ptr[1063] = data12*x1063*2.0-t255*t257*t1767*t2680; out_ptr[1064] = data12*x1064*2.0-t255*t268*t1767*t2680; out_ptr[1065] = data12*x1065*2.0-t256*t265*t1767*t2680; out_ptr[1066] = data12*x1066*2.0-t256*t271*t1767*t2680; out_ptr[1067] = data12*x1067*2.0-t256*t264*t1767*t2680; out_ptr[1068] = data12*x1068*2.0-t256*t270*t1767*t2680; out_ptr[1069] = data12*x1069*2.0-t256*t263*t1767*t2680; out_ptr[1070] = data12*x1070*2.0-t256*t269*t1767*t2680; out_ptr[1071] = data12*x1071*2.0-t256*t257*t1767*t2680; out_ptr[1072] = data12*x1072*2.0-t256*t268*t1767*t2680; out_ptr[1073] = data12*x1073*2.0-t258*t271*t1767*t2680; out_ptr[1074] = data12*x1074*2.0-t258*t264*t1767*t2680; out_ptr[1075] = data12*x1075*2.0-t258*t270*t1767*t2680; out_ptr[1076] = data12*x1076*2.0-t258*t263*t1767*t2680; out_ptr[1077] = data12*x1077*2.0-t258*t269*t1767*t2680; out_ptr[1078] = data12*x1078*2.0-t257*t258*t1767*t2680; out_ptr[1079] = data12*x1079*2.0-t258*t268*t1767*t2680; out_ptr[1080] = data12*x1080*2.0-t259*t264*t1767*t2680; out_ptr[1081] = data12*x1081*2.0-t259*t270*t1767*t2680; out_ptr[1082] = data12*x1082*2.0-t259*t263*t1767*t2680; out_ptr[1083] = data12*x1083*2.0-t259*t269*t1767*t2680; out_ptr[1084] = data12*x1084*2.0-t257*t259*t1767*t2680; out_ptr[1085] = data12*x1085*2.0-t259*t268*t1767*t2680; out_ptr[1086] = data12*x1086*2.0-t260*t270*t1767*t2680; out_ptr[1087] = data12*x1087*2.0-t260*t263*t1767*t2680; out_ptr[1088] = data12*x1088*2.0-t260*t269*t1767*t2680; out_ptr[1089] = data12*x1089*2.0-t257*t260*t1767*t2680; out_ptr[1090] = data12*x1090*2.0-t260*t268*t1767*t2680; out_ptr[1091] = data12*x1091*2.0-t261*t263*t1767*t2680; out_ptr[1092] = data12*x1092*2.0-t261*t269*t1767*t2680; out_ptr[1093] = data12*x1093*2.0-t257*t261*t1767*t2680; out_ptr[1094] = data12*x1094*2.0-t261*t268*t1767*t2680; out_ptr[1095] = data12*x1095*2.0-t262*t269*t1767*t2680; out_ptr[1096] = data12*x1096*2.0-t257*t262*t1767*t2680; out_ptr[1097] = data12*x1097*2.0-t262*t268*t1767*t2680; out_ptr[1098] = data12*x1098*2.0-t257*t266*t1767*t2680; out_ptr[1099] = data12*x1099*2.0-t266*t268*t1767*t2680; out_ptr[1100] = data12*x1100*2.0-t267*t268*t1767*t2680; out_ptr[1101] = data12*t483*2.0-data13*t2967-t1834*t2680*(t483*t1799-1.0); out_ptr[1102] = -data13*t637+data12*t2969*2.0-t1834*t2680*(t272*t274*t637-1.0); out_ptr[1103] = -data13*t638+data12*t2971*2.0-t1834*t2680*(t276*t283*t638-1.0); out_ptr[1104] = -data13*t639+data12*t2973*2.0-t1834*t2680*(t277*t289*t639-1.0); out_ptr[1105] = -data13*t640+data12*t2975*2.0-t1834*t2680*(t278*t282*t640-1.0); out_ptr[1106] = -data13*t641+data12*t2977*2.0-t1834*t2680*(t279*t288*t641-1.0); out_ptr[1107] = -data13*t642+data12*t2979*2.0-t1834*t2680*(t280*t281*t642-1.0); out_ptr[1108] = -data13*t643+data12*t2981*2.0-t1834*t2680*(t284*t287*t643-1.0); out_ptr[1109] = -data13*t644+data12*t2983*2.0-t1834*t2680*(t275*t285*t644-1.0); out_ptr[1110] = -data13*t645+data12*t2985*2.0-t1834*t2680*(t286*t645*t1809-1.0); out_ptr[1111] = data12*x1111*2.0-t272*t273*t1834*t2680; out_ptr[1112] = data12*x1112*2.0-t273*t283*t1834*t2680; out_ptr[1113] = data12*x1113*2.0-t273*t289*t1834*t2680; out_ptr[1114] = data12*x1114*2.0-t273*t282*t1834*t2680; out_ptr[1115] = data12*x1115*2.0-t273*t288*t1834*t2680; out_ptr[1116] = data12*x1116*2.0-t273*t281*t1834*t2680; out_ptr[1117] = data12*x1117*2.0-t273*t287*t1834*t2680; out_ptr[1118] = data12*x1118*2.0-t273*t275*t1834*t2680; out_ptr[1119] = data12*x1119*2.0-t273*t286*t1834*t2680; out_ptr[1120] = data12*x1120*2.0-t274*t283*t1834*t2680; out_ptr[1121] = data12*x1121*2.0-t274*t289*t1834*t2680; out_ptr[1122] = data12*x1122*2.0-t274*t282*t1834*t2680; out_ptr[1123] = data12*x1123*2.0-t274*t288*t1834*t2680; out_ptr[1124] = data12*x1124*2.0-t274*t281*t1834*t2680; out_ptr[1125] = data12*x1125*2.0-t274*t287*t1834*t2680; out_ptr[1126] = data12*x1126*2.0-t274*t275*t1834*t2680; out_ptr[1127] = data12*x1127*2.0-t274*t286*t1834*t2680; out_ptr[1128] = data12*x1128*2.0-t276*t289*t1834*t2680; out_ptr[1129] = data12*x1129*2.0-t276*t282*t1834*t2680; out_ptr[1130] = data12*x1130*2.0-t276*t288*t1834*t2680; out_ptr[1131] = data12*x1131*2.0-t276*t281*t1834*t2680; out_ptr[1132] = data12*x1132*2.0-t276*t287*t1834*t2680; out_ptr[1133] = data12*x1133*2.0-t275*t276*t1834*t2680; out_ptr[1134] = data12*x1134*2.0-t276*t286*t1834*t2680; out_ptr[1135] = data12*x1135*2.0-t277*t282*t1834*t2680; out_ptr[1136] = data12*x1136*2.0-t277*t288*t1834*t2680; out_ptr[1137] = data12*x1137*2.0-t277*t281*t1834*t2680; out_ptr[1138] = data12*x1138*2.0-t277*t287*t1834*t2680; out_ptr[1139] = data12*x1139*2.0-t275*t277*t1834*t2680; out_ptr[1140] = data12*x1140*2.0-t277*t286*t1834*t2680; out_ptr[1141] = data12*x1141*2.0-t278*t288*t1834*t2680; out_ptr[1142] = data12*x1142*2.0-t278*t281*t1834*t2680; out_ptr[1143] = data12*x1143*2.0-t278*t287*t1834*t2680; out_ptr[1144] = data12*x1144*2.0-t275*t278*t1834*t2680; out_ptr[1145] = data12*x1145*2.0-t278*t286*t1834*t2680; out_ptr[1146] = data12*x1146*2.0-t279*t281*t1834*t2680; out_ptr[1147] = data12*x1147*2.0-t279*t287*t1834*t2680; out_ptr[1148] = data12*x1148*2.0-t275*t279*t1834*t2680; out_ptr[1149] = data12*x1149*2.0-t279*t286*t1834*t2680; out_ptr[1150] = data12*x1150*2.0-t280*t287*t1834*t2680; out_ptr[1151] = data12*x1151*2.0-t275*t280*t1834*t2680; out_ptr[1152] = data12*x1152*2.0-t280*t286*t1834*t2680; out_ptr[1153] = data12*x1153*2.0-t275*t284*t1834*t2680; out_ptr[1154] = data12*x1154*2.0-t284*t286*t1834*t2680; out_ptr[1155] = data12*x1155*2.0-t285*t286*t1834*t2680; out_ptr[1156] = data12*t485*2.0-data13*t2986-t1901*t2680*(t485*t1866-1.0); out_ptr[1157] = -data13*t646+data12*t2988*2.0-t1901*t2680*(t290*t292*t646-1.0); out_ptr[1158] = -data13*t647+data12*t2990*2.0-t1901*t2680*(t294*t301*t647-1.0); out_ptr[1159] = -data13*t648+data12*t2992*2.0-t1901*t2680*(t295*t307*t648-1.0); out_ptr[1160] = -data13*t649+data12*t2994*2.0-t1901*t2680*(t296*t300*t649-1.0); out_ptr[1161] = -data13*t650+data12*t2996*2.0-t1901*t2680*(t297*t306*t650-1.0); out_ptr[1162] = -data13*t651+data12*t2998*2.0-t1901*t2680*(t298*t299*t651-1.0); out_ptr[1163] = -data13*t652+data12*t3000*2.0-t1901*t2680*(t302*t305*t652-1.0); out_ptr[1164] = -data13*t653+data12*t3002*2.0-t1901*t2680*(t293*t303*t653-1.0); out_ptr[1165] = -data13*t654+data12*t3004*2.0-t1901*t2680*(t304*t654*t1876-1.0); out_ptr[1166] = data12*x1166*2.0-t290*t291*t1901*t2680; out_ptr[1167] = data12*x1167*2.0-t291*t301*t1901*t2680; out_ptr[1168] = data12*x1168*2.0-t291*t307*t1901*t2680; out_ptr[1169] = data12*x1169*2.0-t291*t300*t1901*t2680; out_ptr[1170] = data12*x1170*2.0-t291*t306*t1901*t2680; out_ptr[1171] = data12*x1171*2.0-t291*t299*t1901*t2680; out_ptr[1172] = data12*x1172*2.0-t291*t305*t1901*t2680; out_ptr[1173] = data12*x1173*2.0-t291*t293*t1901*t2680; out_ptr[1174] = data12*x1174*2.0-t291*t304*t1901*t2680; out_ptr[1175] = data12*x1175*2.0-t292*t301*t1901*t2680; out_ptr[1176] = data12*x1176*2.0-t292*t307*t1901*t2680; out_ptr[1177] = data12*x1177*2.0-t292*t300*t1901*t2680; out_ptr[1178] = data12*x1178*2.0-t292*t306*t1901*t2680; out_ptr[1179] = data12*x1179*2.0-t292*t299*t1901*t2680; out_ptr[1180] = data12*x1180*2.0-t292*t305*t1901*t2680; out_ptr[1181] = data12*x1181*2.0-t292*t293*t1901*t2680; out_ptr[1182] = data12*x1182*2.0-t292*t304*t1901*t2680; out_ptr[1183] = data12*x1183*2.0-t294*t307*t1901*t2680; out_ptr[1184] = data12*x1184*2.0-t294*t300*t1901*t2680; out_ptr[1185] = data12*x1185*2.0-t294*t306*t1901*t2680; out_ptr[1186] = data12*x1186*2.0-t294*t299*t1901*t2680; out_ptr[1187] = data12*x1187*2.0-t294*t305*t1901*t2680; out_ptr[1188] = data12*x1188*2.0-t293*t294*t1901*t2680; out_ptr[1189] = data12*x1189*2.0-t294*t304*t1901*t2680; out_ptr[1190] = data12*x1190*2.0-t295*t300*t1901*t2680; out_ptr[1191] = data12*x1191*2.0-t295*t306*t1901*t2680; out_ptr[1192] = data12*x1192*2.0-t295*t299*t1901*t2680; out_ptr[1193] = data12*x1193*2.0-t295*t305*t1901*t2680; out_ptr[1194] = data12*x1194*2.0-t293*t295*t1901*t2680; out_ptr[1195] = data12*x1195*2.0-t295*t304*t1901*t2680; out_ptr[1196] = data12*x1196*2.0-t296*t306*t1901*t2680; out_ptr[1197] = data12*x1197*2.0-t296*t299*t1901*t2680; out_ptr[1198] = data12*x1198*2.0-t296*t305*t1901*t2680; out_ptr[1199] = data12*x1199*2.0-t293*t296*t1901*t2680; out_ptr[1200] = data12*x1200*2.0-t296*t304*t1901*t2680; out_ptr[1201] = data12*x1201*2.0-t297*t299*t1901*t2680; out_ptr[1202] = data12*x1202*2.0-t297*t305*t1901*t2680; out_ptr[1203] = data12*x1203*2.0-t293*t297*t1901*t2680; out_ptr[1204] = data12*x1204*2.0-t297*t304*t1901*t2680; out_ptr[1205] = data12*x1205*2.0-t298*t305*t1901*t2680; out_ptr[1206] = data12*x1206*2.0-t293*t298*t1901*t2680; out_ptr[1207] = data12*x1207*2.0-t298*t304*t1901*t2680; out_ptr[1208] = data12*x1208*2.0-t293*t302*t1901*t2680; out_ptr[1209] = data12*x1209*2.0-t302*t304*t1901*t2680; out_ptr[1210] = data12*x1210*2.0-t303*t304*t1901*t2680; out_ptr[1211] = data12*t487*2.0-data13*t3005-t1968*t2680*(t487*t1933-1.0); out_ptr[1212] = -data13*t655+data12*t3007*2.0-t1968*t2680*(t308*t310*t655-1.0); out_ptr[1213] = -data13*t656+data12*t3009*2.0-t1968*t2680*(t312*t319*t656-1.0); out_ptr[1214] = -data13*t657+data12*t3011*2.0-t1968*t2680*(t313*t325*t657-1.0); out_ptr[1215] = -data13*t658+data12*t3013*2.0-t1968*t2680*(t314*t318*t658-1.0); out_ptr[1216] = -data13*t659+data12*t3015*2.0-t1968*t2680*(t315*t324*t659-1.0); out_ptr[1217] = -data13*t660+data12*t3017*2.0-t1968*t2680*(t316*t317*t660-1.0); out_ptr[1218] = -data13*t661+data12*t3019*2.0-t1968*t2680*(t320*t323*t661-1.0); out_ptr[1219] = -data13*t662+data12*t3021*2.0-t1968*t2680*(t311*t321*t662-1.0); out_ptr[1220] = -data13*t663+data12*t3023*2.0-t1968*t2680*(t322*t663*t1943-1.0); out_ptr[1221] = data12*x1221*2.0-t308*t309*t1968*t2680; out_ptr[1222] = data12*x1222*2.0-t309*t319*t1968*t2680; out_ptr[1223] = data12*x1223*2.0-t309*t325*t1968*t2680; out_ptr[1224] = data12*x1224*2.0-t309*t318*t1968*t2680; out_ptr[1225] = data12*x1225*2.0-t309*t324*t1968*t2680; out_ptr[1226] = data12*x1226*2.0-t309*t317*t1968*t2680; out_ptr[1227] = data12*x1227*2.0-t309*t323*t1968*t2680; out_ptr[1228] = data12*x1228*2.0-t309*t311*t1968*t2680; out_ptr[1229] = data12*x1229*2.0-t309*t322*t1968*t2680; out_ptr[1230] = data12*x1230*2.0-t310*t319*t1968*t2680; out_ptr[1231] = data12*x1231*2.0-t310*t325*t1968*t2680; out_ptr[1232] = data12*x1232*2.0-t310*t318*t1968*t2680; out_ptr[1233] = data12*x1233*2.0-t310*t324*t1968*t2680; out_ptr[1234] = data12*x1234*2.0-t310*t317*t1968*t2680; out_ptr[1235] = data12*x1235*2.0-t310*t323*t1968*t2680; out_ptr[1236] = data12*x1236*2.0-t310*t311*t1968*t2680; out_ptr[1237] = data12*x1237*2.0-t310*t322*t1968*t2680; out_ptr[1238] = data12*x1238*2.0-t312*t325*t1968*t2680; out_ptr[1239] = data12*x1239*2.0-t312*t318*t1968*t2680; out_ptr[1240] = data12*x1240*2.0-t312*t324*t1968*t2680; out_ptr[1241] = data12*x1241*2.0-t312*t317*t1968*t2680; out_ptr[1242] = data12*x1242*2.0-t312*t323*t1968*t2680; out_ptr[1243] = data12*x1243*2.0-t311*t312*t1968*t2680; out_ptr[1244] = data12*x1244*2.0-t312*t322*t1968*t2680; out_ptr[1245] = data12*x1245*2.0-t313*t318*t1968*t2680; out_ptr[1246] = data12*x1246*2.0-t313*t324*t1968*t2680; out_ptr[1247] = data12*x1247*2.0-t313*t317*t1968*t2680; out_ptr[1248] = data12*x1248*2.0-t313*t323*t1968*t2680; out_ptr[1249] = data12*x1249*2.0-t311*t313*t1968*t2680; out_ptr[1250] = data12*x1250*2.0-t313*t322*t1968*t2680; out_ptr[1251] = data12*x1251*2.0-t314*t324*t1968*t2680; out_ptr[1252] = data12*x1252*2.0-t314*t317*t1968*t2680; out_ptr[1253] = data12*x1253*2.0-t314*t323*t1968*t2680; out_ptr[1254] = data12*x1254*2.0-t311*t314*t1968*t2680; out_ptr[1255] = data12*x1255*2.0-t314*t322*t1968*t2680; out_ptr[1256] = data12*x1256*2.0-t315*t317*t1968*t2680; out_ptr[1257] = data12*x1257*2.0-t315*t323*t1968*t2680; out_ptr[1258] = data12*x1258*2.0-t311*t315*t1968*t2680; out_ptr[1259] = data12*x1259*2.0-t315*t322*t1968*t2680; out_ptr[1260] = data12*x1260*2.0-t316*t323*t1968*t2680; out_ptr[1261] = data12*x1261*2.0-t311*t316*t1968*t2680; out_ptr[1262] = data12*x1262*2.0-t316*t322*t1968*t2680; out_ptr[1263] = data12*x1263*2.0-t311*t320*t1968*t2680; out_ptr[1264] = data12*x1264*2.0-t320*t322*t1968*t2680; out_ptr[1265] = data12*x1265*2.0-t321*t322*t1968*t2680; out_ptr[1266] = data12*t489*2.0-data13*t3024-t2035*t2680*(t489*t2000-1.0); out_ptr[1267] = -data13*t664+data12*t3026*2.0-t2035*t2680*(t326*t328*t664-1.0); out_ptr[1268] = -data13*t665+data12*t3028*2.0-t2035*t2680*(t330*t337*t665-1.0); out_ptr[1269] = -data13*t666+data12*t3030*2.0-t2035*t2680*(t331*t343*t666-1.0); out_ptr[1270] = -data13*t667+data12*t3032*2.0-t2035*t2680*(t332*t336*t667-1.0); out_ptr[1271] = -data13*t668+data12*t3034*2.0-t2035*t2680*(t333*t342*t668-1.0); out_ptr[1272] = -data13*t669+data12*t3036*2.0-t2035*t2680*(t334*t335*t669-1.0); out_ptr[1273] = -data13*t670+data12*t3038*2.0-t2035*t2680*(t338*t341*t670-1.0); out_ptr[1274] = -data13*t671+data12*t3040*2.0-t2035*t2680*(t329*t339*t671-1.0); out_ptr[1275] = -data13*t672+data12*t3042*2.0-t2035*t2680*(t340*t672*t2010-1.0); out_ptr[1276] = data12*x1276*2.0-t326*t327*t2035*t2680; out_ptr[1277] = data12*x1277*2.0-t327*t337*t2035*t2680; out_ptr[1278] = data12*x1278*2.0-t327*t343*t2035*t2680; out_ptr[1279] = data12*x1279*2.0-t327*t336*t2035*t2680; out_ptr[1280] = data12*x1280*2.0-t327*t342*t2035*t2680; out_ptr[1281] = data12*x1281*2.0-t327*t335*t2035*t2680; out_ptr[1282] = data12*x1282*2.0-t327*t341*t2035*t2680; out_ptr[1283] = data12*x1283*2.0-t327*t329*t2035*t2680; out_ptr[1284] = data12*x1284*2.0-t327*t340*t2035*t2680; out_ptr[1285] = data12*x1285*2.0-t328*t337*t2035*t2680; out_ptr[1286] = data12*x1286*2.0-t328*t343*t2035*t2680; out_ptr[1287] = data12*x1287*2.0-t328*t336*t2035*t2680; out_ptr[1288] = data12*x1288*2.0-t328*t342*t2035*t2680; out_ptr[1289] = data12*x1289*2.0-t328*t335*t2035*t2680; out_ptr[1290] = data12*x1290*2.0-t328*t341*t2035*t2680; out_ptr[1291] = data12*x1291*2.0-t328*t329*t2035*t2680; out_ptr[1292] = data12*x1292*2.0-t328*t340*t2035*t2680; out_ptr[1293] = data12*x1293*2.0-t330*t343*t2035*t2680; out_ptr[1294] = data12*x1294*2.0-t330*t336*t2035*t2680; out_ptr[1295] = data12*x1295*2.0-t330*t342*t2035*t2680; out_ptr[1296] = data12*x1296*2.0-t330*t335*t2035*t2680; out_ptr[1297] = data12*x1297*2.0-t330*t341*t2035*t2680; out_ptr[1298] = data12*x1298*2.0-t329*t330*t2035*t2680; out_ptr[1299] = data12*x1299*2.0-t330*t340*t2035*t2680; out_ptr[1300] = data12*x1300*2.0-t331*t336*t2035*t2680; out_ptr[1301] = data12*x1301*2.0-t331*t342*t2035*t2680; out_ptr[1302] = data12*x1302*2.0-t331*t335*t2035*t2680; out_ptr[1303] = data12*x1303*2.0-t331*t341*t2035*t2680; out_ptr[1304] = data12*x1304*2.0-t329*t331*t2035*t2680; out_ptr[1305] = data12*x1305*2.0-t331*t340*t2035*t2680; out_ptr[1306] = data12*x1306*2.0-t332*t342*t2035*t2680; out_ptr[1307] = data12*x1307*2.0-t332*t335*t2035*t2680; out_ptr[1308] = data12*x1308*2.0-t332*t341*t2035*t2680; out_ptr[1309] = data12*x1309*2.0-t329*t332*t2035*t2680; out_ptr[1310] = data12*x1310*2.0-t332*t340*t2035*t2680; out_ptr[1311] = data12*x1311*2.0-t333*t335*t2035*t2680; out_ptr[1312] = data12*x1312*2.0-t333*t341*t2035*t2680; out_ptr[1313] = data12*x1313*2.0-t329*t333*t2035*t2680; out_ptr[1314] = data12*x1314*2.0-t333*t340*t2035*t2680; out_ptr[1315] = data12*x1315*2.0-t334*t341*t2035*t2680; out_ptr[1316] = data12*x1316*2.0-t329*t334*t2035*t2680; out_ptr[1317] = data12*x1317*2.0-t334*t340*t2035*t2680; out_ptr[1318] = data12*x1318*2.0-t329*t338*t2035*t2680; out_ptr[1319] = data12*x1319*2.0-t338*t340*t2035*t2680; out_ptr[1320] = data12*x1320*2.0-t339*t340*t2035*t2680; out_ptr[1321] = data12*t491*2.0-data13*t3043-t2102*t2680*(t491*t2067-1.0); out_ptr[1322] = -data13*t673+data12*t3045*2.0-t2102*t2680*(t344*t346*t673-1.0); out_ptr[1323] = -data13*t674+data12*t3047*2.0-t2102*t2680*(t348*t355*t674-1.0); out_ptr[1324] = -data13*t675+data12*t3049*2.0-t2102*t2680*(t349*t361*t675-1.0); out_ptr[1325] = -data13*t676+data12*t3051*2.0-t2102*t2680*(t350*t354*t676-1.0); out_ptr[1326] = -data13*t677+data12*t3053*2.0-t2102*t2680*(t351*t360*t677-1.0); out_ptr[1327] = -data13*t678+data12*t3055*2.0-t2102*t2680*(t352*t353*t678-1.0); out_ptr[1328] = -data13*t679+data12*t3057*2.0-t2102*t2680*(t356*t359*t679-1.0); out_ptr[1329] = -data13*t680+data12*t3059*2.0-t2102*t2680*(t347*t357*t680-1.0); out_ptr[1330] = -data13*t681+data12*t3061*2.0-t2102*t2680*(t358*t681*t2077-1.0); out_ptr[1331] = data12*x1331*2.0-t344*t345*t2102*t2680; out_ptr[1332] = data12*x1332*2.0-t345*t355*t2102*t2680; out_ptr[1333] = data12*x1333*2.0-t345*t361*t2102*t2680; out_ptr[1334] = data12*x1334*2.0-t345*t354*t2102*t2680; out_ptr[1335] = data12*x1335*2.0-t345*t360*t2102*t2680; out_ptr[1336] = data12*x1336*2.0-t345*t353*t2102*t2680; out_ptr[1337] = data12*x1337*2.0-t345*t359*t2102*t2680; out_ptr[1338] = data12*x1338*2.0-t345*t347*t2102*t2680; out_ptr[1339] = data12*x1339*2.0-t345*t358*t2102*t2680; out_ptr[1340] = data12*x1340*2.0-t346*t355*t2102*t2680; out_ptr[1341] = data12*x1341*2.0-t346*t361*t2102*t2680; out_ptr[1342] = data12*x1342*2.0-t346*t354*t2102*t2680; out_ptr[1343] = data12*x1343*2.0-t346*t360*t2102*t2680; out_ptr[1344] = data12*x1344*2.0-t346*t353*t2102*t2680; out_ptr[1345] = data12*x1345*2.0-t346*t359*t2102*t2680; out_ptr[1346] = data12*x1346*2.0-t346*t347*t2102*t2680; out_ptr[1347] = data12*x1347*2.0-t346*t358*t2102*t2680; out_ptr[1348] = data12*x1348*2.0-t348*t361*t2102*t2680; out_ptr[1349] = data12*x1349*2.0-t348*t354*t2102*t2680; out_ptr[1350] = data12*x1350*2.0-t348*t360*t2102*t2680; out_ptr[1351] = data12*x1351*2.0-t348*t353*t2102*t2680; out_ptr[1352] = data12*x1352*2.0-t348*t359*t2102*t2680; out_ptr[1353] = data12*x1353*2.0-t347*t348*t2102*t2680; out_ptr[1354] = data12*x1354*2.0-t348*t358*t2102*t2680; out_ptr[1355] = data12*x1355*2.0-t349*t354*t2102*t2680; out_ptr[1356] = data12*x1356*2.0-t349*t360*t2102*t2680; out_ptr[1357] = data12*x1357*2.0-t349*t353*t2102*t2680; out_ptr[1358] = data12*x1358*2.0-t349*t359*t2102*t2680; out_ptr[1359] = data12*x1359*2.0-t347*t349*t2102*t2680; out_ptr[1360] = data12*x1360*2.0-t349*t358*t2102*t2680; out_ptr[1361] = data12*x1361*2.0-t350*t360*t2102*t2680; out_ptr[1362] = data12*x1362*2.0-t350*t353*t2102*t2680; out_ptr[1363] = data12*x1363*2.0-t350*t359*t2102*t2680; out_ptr[1364] = data12*x1364*2.0-t347*t350*t2102*t2680; out_ptr[1365] = data12*x1365*2.0-t350*t358*t2102*t2680; out_ptr[1366] = data12*x1366*2.0-t351*t353*t2102*t2680; out_ptr[1367] = data12*x1367*2.0-t351*t359*t2102*t2680; out_ptr[1368] = data12*x1368*2.0-t347*t351*t2102*t2680; out_ptr[1369] = data12*x1369*2.0-t351*t358*t2102*t2680; out_ptr[1370] = data12*x1370*2.0-t352*t359*t2102*t2680; out_ptr[1371] = data12*x1371*2.0-t347*t352*t2102*t2680; out_ptr[1372] = data12*x1372*2.0-t352*t358*t2102*t2680; out_ptr[1373] = data12*x1373*2.0-t347*t356*t2102*t2680; out_ptr[1374] = data12*x1374*2.0-t356*t358*t2102*t2680; out_ptr[1375] = data12*x1375*2.0-t357*t358*t2102*t2680; out_ptr[1376] = data12*t493*2.0-data13*t3062-t2169*t2680*(t493*t2134-1.0); out_ptr[1377] = -data13*t682+data12*t3064*2.0-t2169*t2680*(t362*t364*t682-1.0); out_ptr[1378] = -data13*t683+data12*t3066*2.0-t2169*t2680*(t366*t373*t683-1.0); out_ptr[1379] = -data13*t684+data12*t3068*2.0-t2169*t2680*(t367*t379*t684-1.0); out_ptr[1380] = -data13*t685+data12*t3070*2.0-t2169*t2680*(t368*t372*t685-1.0); out_ptr[1381] = -data13*t686+data12*t3072*2.0-t2169*t2680*(t369*t378*t686-1.0); out_ptr[1382] = -data13*t687+data12*t3074*2.0-t2169*t2680*(t370*t371*t687-1.0); out_ptr[1383] = -data13*t688+data12*t3076*2.0-t2169*t2680*(t374*t377*t688-1.0); out_ptr[1384] = -data13*t689+data12*t3078*2.0-t2169*t2680*(t365*t375*t689-1.0); out_ptr[1385] = -data13*t690+data12*t3080*2.0-t2169*t2680*(t376*t690*t2144-1.0); out_ptr[1386] = data12*x1386*2.0-t362*t363*t2169*t2680; out_ptr[1387] = data12*x1387*2.0-t363*t373*t2169*t2680; out_ptr[1388] = data12*x1388*2.0-t363*t379*t2169*t2680; out_ptr[1389] = data12*x1389*2.0-t363*t372*t2169*t2680; out_ptr[1390] = data12*x1390*2.0-t363*t378*t2169*t2680; out_ptr[1391] = data12*x1391*2.0-t363*t371*t2169*t2680; out_ptr[1392] = data12*x1392*2.0-t363*t377*t2169*t2680; out_ptr[1393] = data12*x1393*2.0-t363*t365*t2169*t2680; out_ptr[1394] = data12*x1394*2.0-t363*t376*t2169*t2680; out_ptr[1395] = data12*x1395*2.0-t364*t373*t2169*t2680; out_ptr[1396] = data12*x1396*2.0-t364*t379*t2169*t2680; out_ptr[1397] = data12*x1397*2.0-t364*t372*t2169*t2680; out_ptr[1398] = data12*x1398*2.0-t364*t378*t2169*t2680; out_ptr[1399] = data12*x1399*2.0-t364*t371*t2169*t2680; out_ptr[1400] = data12*x1400*2.0-t364*t377*t2169*t2680; out_ptr[1401] = data12*x1401*2.0-t364*t365*t2169*t2680; out_ptr[1402] = data12*x1402*2.0-t364*t376*t2169*t2680; out_ptr[1403] = data12*x1403*2.0-t366*t379*t2169*t2680; out_ptr[1404] = data12*x1404*2.0-t366*t372*t2169*t2680; out_ptr[1405] = data12*x1405*2.0-t366*t378*t2169*t2680; out_ptr[1406] = data12*x1406*2.0-t366*t371*t2169*t2680; out_ptr[1407] = data12*x1407*2.0-t366*t377*t2169*t2680; out_ptr[1408] = data12*x1408*2.0-t365*t366*t2169*t2680; out_ptr[1409] = data12*x1409*2.0-t366*t376*t2169*t2680; out_ptr[1410] = data12*x1410*2.0-t367*t372*t2169*t2680; out_ptr[1411] = data12*x1411*2.0-t367*t378*t2169*t2680; out_ptr[1412] = data12*x1412*2.0-t367*t371*t2169*t2680; out_ptr[1413] = data12*x1413*2.0-t367*t377*t2169*t2680; out_ptr[1414] = data12*x1414*2.0-t365*t367*t2169*t2680; out_ptr[1415] = data12*x1415*2.0-t367*t376*t2169*t2680; out_ptr[1416] = data12*x1416*2.0-t368*t378*t2169*t2680; out_ptr[1417] = data12*x1417*2.0-t368*t371*t2169*t2680; out_ptr[1418] = data12*x1418*2.0-t368*t377*t2169*t2680; out_ptr[1419] = data12*x1419*2.0-t365*t368*t2169*t2680; out_ptr[1420] = data12*x1420*2.0-t368*t376*t2169*t2680; out_ptr[1421] = data12*x1421*2.0-t369*t371*t2169*t2680; out_ptr[1422] = data12*x1422*2.0-t369*t377*t2169*t2680; out_ptr[1423] = data12*x1423*2.0-t365*t369*t2169*t2680; out_ptr[1424] = data12*x1424*2.0-t369*t376*t2169*t2680; out_ptr[1425] = data12*x1425*2.0-t370*t377*t2169*t2680; out_ptr[1426] = data12*x1426*2.0-t365*t370*t2169*t2680; out_ptr[1427] = data12*x1427*2.0-t370*t376*t2169*t2680; out_ptr[1428] = data12*x1428*2.0-t365*t374*t2169*t2680; out_ptr[1429] = data12*x1429*2.0-t374*t376*t2169*t2680; out_ptr[1430] = data12*x1430*2.0-t375*t376*t2169*t2680; out_ptr[1431] = data12*t495*2.0-data13*t3081-t2236*t2680*(t495*t2201-1.0); out_ptr[1432] = -data13*t691+data12*t3083*2.0-t2236*t2680*(t380*t382*t691-1.0); out_ptr[1433] = -data13*t692+data12*t3085*2.0-t2236*t2680*(t384*t391*t692-1.0); out_ptr[1434] = -data13*t693+data12*t3087*2.0-t2236*t2680*(t385*t397*t693-1.0); out_ptr[1435] = -data13*t694+data12*t3089*2.0-t2236*t2680*(t386*t390*t694-1.0); out_ptr[1436] = -data13*t695+data12*t3091*2.0-t2236*t2680*(t387*t396*t695-1.0); out_ptr[1437] = -data13*t696+data12*t3093*2.0-t2236*t2680*(t388*t389*t696-1.0); out_ptr[1438] = -data13*t697+data12*t3095*2.0-t2236*t2680*(t392*t395*t697-1.0); out_ptr[1439] = -data13*t698+data12*t3097*2.0-t2236*t2680*(t383*t393*t698-1.0); out_ptr[1440] = -data13*t699+data12*t3099*2.0-t2236*t2680*(t394*t699*t2211-1.0); out_ptr[1441] = data12*x1441*2.0-t380*t381*t2236*t2680; out_ptr[1442] = data12*x1442*2.0-t381*t391*t2236*t2680; out_ptr[1443] = data12*x1443*2.0-t381*t397*t2236*t2680; out_ptr[1444] = data12*x1444*2.0-t381*t390*t2236*t2680; out_ptr[1445] = data12*x1445*2.0-t381*t396*t2236*t2680; out_ptr[1446] = data12*x1446*2.0-t381*t389*t2236*t2680; out_ptr[1447] = data12*x1447*2.0-t381*t395*t2236*t2680; out_ptr[1448] = data12*x1448*2.0-t381*t383*t2236*t2680; out_ptr[1449] = data12*x1449*2.0-t381*t394*t2236*t2680; out_ptr[1450] = data12*x1450*2.0-t382*t391*t2236*t2680; out_ptr[1451] = data12*x1451*2.0-t382*t397*t2236*t2680; out_ptr[1452] = data12*x1452*2.0-t382*t390*t2236*t2680; out_ptr[1453] = data12*x1453*2.0-t382*t396*t2236*t2680; out_ptr[1454] = data12*x1454*2.0-t382*t389*t2236*t2680; out_ptr[1455] = data12*x1455*2.0-t382*t395*t2236*t2680; out_ptr[1456] = data12*x1456*2.0-t382*t383*t2236*t2680; out_ptr[1457] = data12*x1457*2.0-t382*t394*t2236*t2680; out_ptr[1458] = data12*x1458*2.0-t384*t397*t2236*t2680; out_ptr[1459] = data12*x1459*2.0-t384*t390*t2236*t2680; out_ptr[1460] = data12*x1460*2.0-t384*t396*t2236*t2680; out_ptr[1461] = data12*x1461*2.0-t384*t389*t2236*t2680; out_ptr[1462] = data12*x1462*2.0-t384*t395*t2236*t2680; out_ptr[1463] = data12*x1463*2.0-t383*t384*t2236*t2680; out_ptr[1464] = data12*x1464*2.0-t384*t394*t2236*t2680; out_ptr[1465] = data12*x1465*2.0-t385*t390*t2236*t2680; out_ptr[1466] = data12*x1466*2.0-t385*t396*t2236*t2680; out_ptr[1467] = data12*x1467*2.0-t385*t389*t2236*t2680; out_ptr[1468] = data12*x1468*2.0-t385*t395*t2236*t2680; out_ptr[1469] = data12*x1469*2.0-t383*t385*t2236*t2680; out_ptr[1470] = data12*x1470*2.0-t385*t394*t2236*t2680; out_ptr[1471] = data12*x1471*2.0-t386*t396*t2236*t2680; out_ptr[1472] = data12*x1472*2.0-t386*t389*t2236*t2680; out_ptr[1473] = data12*x1473*2.0-t386*t395*t2236*t2680; out_ptr[1474] = data12*x1474*2.0-t383*t386*t2236*t2680; out_ptr[1475] = data12*x1475*2.0-t386*t394*t2236*t2680; out_ptr[1476] = data12*x1476*2.0-t387*t389*t2236*t2680; out_ptr[1477] = data12*x1477*2.0-t387*t395*t2236*t2680; out_ptr[1478] = data12*x1478*2.0-t383*t387*t2236*t2680; out_ptr[1479] = data12*x1479*2.0-t387*t394*t2236*t2680; out_ptr[1480] = data12*x1480*2.0-t388*t395*t2236*t2680; out_ptr[1481] = data12*x1481*2.0-t383*t388*t2236*t2680; out_ptr[1482] = data12*x1482*2.0-t388*t394*t2236*t2680; out_ptr[1483] = data12*x1483*2.0-t383*t392*t2236*t2680; out_ptr[1484] = data12*x1484*2.0-t392*t394*t2236*t2680; out_ptr[1485] = data12*x1485*2.0-t393*t394*t2236*t2680; out_ptr[1486] = data12*t497*2.0-data13*t3100-t2303*t2680*(t497*t2268-1.0); out_ptr[1487] = -data13*t700+data12*t3102*2.0-t2303*t2680*(t398*t400*t700-1.0); out_ptr[1488] = -data13*t701+data12*t3104*2.0-t2303*t2680*(t402*t409*t701-1.0); out_ptr[1489] = -data13*t702+data12*t3106*2.0-t2303*t2680*(t403*t415*t702-1.0); out_ptr[1490] = -data13*t703+data12*t3108*2.0-t2303*t2680*(t404*t408*t703-1.0); out_ptr[1491] = -data13*t704+data12*t3110*2.0-t2303*t2680*(t405*t414*t704-1.0); out_ptr[1492] = -data13*t705+data12*t3112*2.0-t2303*t2680*(t406*t407*t705-1.0); out_ptr[1493] = -data13*t706+data12*t3114*2.0-t2303*t2680*(t410*t413*t706-1.0); out_ptr[1494] = -data13*t707+data12*t3116*2.0-t2303*t2680*(t401*t411*t707-1.0); out_ptr[1495] = -data13*t708+data12*t3118*2.0-t2303*t2680*(t412*t708*t2278-1.0); out_ptr[1496] = data12*x1496*2.0-t398*t399*t2303*t2680; out_ptr[1497] = data12*x1497*2.0-t399*t409*t2303*t2680; out_ptr[1498] = data12*x1498*2.0-t399*t415*t2303*t2680; out_ptr[1499] = data12*x1499*2.0-t399*t408*t2303*t2680; out_ptr[1500] = data12*x1500*2.0-t399*t414*t2303*t2680; out_ptr[1501] = data12*x1501*2.0-t399*t407*t2303*t2680; out_ptr[1502] = data12*x1502*2.0-t399*t413*t2303*t2680; out_ptr[1503] = data12*x1503*2.0-t399*t401*t2303*t2680; out_ptr[1504] = data12*x1504*2.0-t399*t412*t2303*t2680; out_ptr[1505] = data12*x1505*2.0-t400*t409*t2303*t2680; out_ptr[1506] = data12*x1506*2.0-t400*t415*t2303*t2680; out_ptr[1507] = data12*x1507*2.0-t400*t408*t2303*t2680; out_ptr[1508] = data12*x1508*2.0-t400*t414*t2303*t2680; out_ptr[1509] = data12*x1509*2.0-t400*t407*t2303*t2680; out_ptr[1510] = data12*x1510*2.0-t400*t413*t2303*t2680; out_ptr[1511] = data12*x1511*2.0-t400*t401*t2303*t2680; out_ptr[1512] = data12*x1512*2.0-t400*t412*t2303*t2680; out_ptr[1513] = data12*x1513*2.0-t402*t415*t2303*t2680; out_ptr[1514] = data12*x1514*2.0-t402*t408*t2303*t2680; out_ptr[1515] = data12*x1515*2.0-t402*t414*t2303*t2680; out_ptr[1516] = data12*x1516*2.0-t402*t407*t2303*t2680; out_ptr[1517] = data12*x1517*2.0-t402*t413*t2303*t2680; out_ptr[1518] = data12*x1518*2.0-t401*t402*t2303*t2680; out_ptr[1519] = data12*x1519*2.0-t402*t412*t2303*t2680; out_ptr[1520] = data12*x1520*2.0-t403*t408*t2303*t2680; out_ptr[1521] = data12*x1521*2.0-t403*t414*t2303*t2680; out_ptr[1522] = data12*x1522*2.0-t403*t407*t2303*t2680; out_ptr[1523] = data12*x1523*2.0-t403*t413*t2303*t2680; out_ptr[1524] = data12*x1524*2.0-t401*t403*t2303*t2680; out_ptr[1525] = data12*x1525*2.0-t403*t412*t2303*t2680; out_ptr[1526] = data12*x1526*2.0-t404*t414*t2303*t2680; out_ptr[1527] = data12*x1527*2.0-t404*t407*t2303*t2680; out_ptr[1528] = data12*x1528*2.0-t404*t413*t2303*t2680; out_ptr[1529] = data12*x1529*2.0-t401*t404*t2303*t2680; out_ptr[1530] = data12*x1530*2.0-t404*t412*t2303*t2680; out_ptr[1531] = data12*x1531*2.0-t405*t407*t2303*t2680; out_ptr[1532] = data12*x1532*2.0-t405*t413*t2303*t2680; out_ptr[1533] = data12*x1533*2.0-t401*t405*t2303*t2680; out_ptr[1534] = data12*x1534*2.0-t405*t412*t2303*t2680; out_ptr[1535] = data12*x1535*2.0-t406*t413*t2303*t2680; out_ptr[1536] = data12*x1536*2.0-t401*t406*t2303*t2680; out_ptr[1537] = data12*x1537*2.0-t406*t412*t2303*t2680; out_ptr[1538] = data12*x1538*2.0-t401*t410*t2303*t2680; out_ptr[1539] = data12*x1539*2.0-t410*t412*t2303*t2680; out_ptr[1540] = data12*x1540*2.0-t411*t412*t2303*t2680; out_ptr[1541] = data12*t499*2.0-data13*t3119-t2370*t2680*(t499*t2335-1.0); out_ptr[1542] = -data13*t709+data12*t3121*2.0-t2370*t2680*(t416*t418*t709-1.0); out_ptr[1543] = -data13*t710+data12*t3123*2.0-t2370*t2680*(t420*t427*t710-1.0); out_ptr[1544] = -data13*t711+data12*t3125*2.0-t2370*t2680*(t421*t433*t711-1.0); out_ptr[1545] = -data13*t712+data12*t3127*2.0-t2370*t2680*(t422*t426*t712-1.0); out_ptr[1546] = -data13*t713+data12*t3129*2.0-t2370*t2680*(t423*t432*t713-1.0); out_ptr[1547] = -data13*t714+data12*t3131*2.0-t2370*t2680*(t424*t425*t714-1.0); out_ptr[1548] = -data13*t715+data12*t3133*2.0-t2370*t2680*(t428*t431*t715-1.0); out_ptr[1549] = -data13*t716+data12*t3135*2.0-t2370*t2680*(t419*t429*t716-1.0); out_ptr[1550] = -data13*t717+data12*t3137*2.0-t2370*t2680*(t430*t717*t2345-1.0); out_ptr[1551] = data12*x1551*2.0-t416*t417*t2370*t2680; out_ptr[1552] = data12*x1552*2.0-t417*t427*t2370*t2680; out_ptr[1553] = data12*x1553*2.0-t417*t433*t2370*t2680; out_ptr[1554] = data12*x1554*2.0-t417*t426*t2370*t2680; out_ptr[1555] = data12*x1555*2.0-t417*t432*t2370*t2680; out_ptr[1556] = data12*x1556*2.0-t417*t425*t2370*t2680; out_ptr[1557] = data12*x1557*2.0-t417*t431*t2370*t2680; out_ptr[1558] = data12*x1558*2.0-t417*t419*t2370*t2680; out_ptr[1559] = data12*x1559*2.0-t417*t430*t2370*t2680; out_ptr[1560] = data12*x1560*2.0-t418*t427*t2370*t2680; out_ptr[1561] = data12*x1561*2.0-t418*t433*t2370*t2680; out_ptr[1562] = data12*x1562*2.0-t418*t426*t2370*t2680; out_ptr[1563] = data12*x1563*2.0-t418*t432*t2370*t2680; out_ptr[1564] = data12*x1564*2.0-t418*t425*t2370*t2680; out_ptr[1565] = data12*x1565*2.0-t418*t431*t2370*t2680; out_ptr[1566] = data12*x1566*2.0-t418*t419*t2370*t2680; out_ptr[1567] = data12*x1567*2.0-t418*t430*t2370*t2680; out_ptr[1568] = data12*x1568*2.0-t420*t433*t2370*t2680; out_ptr[1569] = data12*x1569*2.0-t420*t426*t2370*t2680; out_ptr[1570] = data12*x1570*2.0-t420*t432*t2370*t2680; out_ptr[1571] = data12*x1571*2.0-t420*t425*t2370*t2680; out_ptr[1572] = data12*x1572*2.0-t420*t431*t2370*t2680; out_ptr[1573] = data12*x1573*2.0-t419*t420*t2370*t2680; out_ptr[1574] = data12*x1574*2.0-t420*t430*t2370*t2680; out_ptr[1575] = data12*x1575*2.0-t421*t426*t2370*t2680; out_ptr[1576] = data12*x1576*2.0-t421*t432*t2370*t2680; out_ptr[1577] = data12*x1577*2.0-t421*t425*t2370*t2680; out_ptr[1578] = data12*x1578*2.0-t421*t431*t2370*t2680; out_ptr[1579] = data12*x1579*2.0-t419*t421*t2370*t2680; out_ptr[1580] = data12*x1580*2.0-t421*t430*t2370*t2680; out_ptr[1581] = data12*x1581*2.0-t422*t432*t2370*t2680; out_ptr[1582] = data12*x1582*2.0-t422*t425*t2370*t2680; out_ptr[1583] = data12*x1583*2.0-t422*t431*t2370*t2680; out_ptr[1584] = data12*x1584*2.0-t419*t422*t2370*t2680; out_ptr[1585] = data12*x1585*2.0-t422*t430*t2370*t2680; out_ptr[1586] = data12*x1586*2.0-t423*t425*t2370*t2680; out_ptr[1587] = data12*x1587*2.0-t423*t431*t2370*t2680; out_ptr[1588] = data12*x1588*2.0-t419*t423*t2370*t2680; out_ptr[1589] = data12*x1589*2.0-t423*t430*t2370*t2680; out_ptr[1590] = data12*x1590*2.0-t424*t431*t2370*t2680; out_ptr[1591] = data12*x1591*2.0-t419*t424*t2370*t2680; out_ptr[1592] = data12*x1592*2.0-t424*t430*t2370*t2680; out_ptr[1593] = data12*x1593*2.0-t419*t428*t2370*t2680; out_ptr[1594] = data12*x1594*2.0-t428*t430*t2370*t2680; out_ptr[1595] = data12*x1595*2.0-t429*t430*t2370*t2680; out_ptr[1596] = data12*t501*2.0-data13*t3138-t2437*t2680*(t501*t2402-1.0); out_ptr[1597] = -data13*t718+data12*t3140*2.0-t2437*t2680*(t434*t436*t718-1.0); out_ptr[1598] = -data13*t719+data12*t3142*2.0-t2437*t2680*(t438*t445*t719-1.0); out_ptr[1599] = -data13*t720+data12*t3144*2.0-t2437*t2680*(t439*t451*t720-1.0); out_ptr[1600] = -data13*t721+data12*t3146*2.0-t2437*t2680*(t440*t444*t721-1.0); out_ptr[1601] = -data13*t722+data12*t3148*2.0-t2437*t2680*(t441*t450*t722-1.0); out_ptr[1602] = -data13*t723+data12*t3150*2.0-t2437*t2680*(t442*t443*t723-1.0); out_ptr[1603] = -data13*t724+data12*t3152*2.0-t2437*t2680*(t446*t449*t724-1.0); out_ptr[1604] = -data13*t725+data12*t3154*2.0-t2437*t2680*(t437*t447*t725-1.0); out_ptr[1605] = -data13*t726+data12*t3156*2.0-t2437*t2680*(t448*t726*t2412-1.0); out_ptr[1606] = data12*x1606*2.0-t434*t435*t2437*t2680; out_ptr[1607] = data12*x1607*2.0-t435*t445*t2437*t2680; out_ptr[1608] = data12*x1608*2.0-t435*t451*t2437*t2680; out_ptr[1609] = data12*x1609*2.0-t435*t444*t2437*t2680; out_ptr[1610] = data12*x1610*2.0-t435*t450*t2437*t2680; out_ptr[1611] = data12*x1611*2.0-t435*t443*t2437*t2680; out_ptr[1612] = data12*x1612*2.0-t435*t449*t2437*t2680; out_ptr[1613] = data12*x1613*2.0-t435*t437*t2437*t2680; out_ptr[1614] = data12*x1614*2.0-t435*t448*t2437*t2680; out_ptr[1615] = data12*x1615*2.0-t436*t445*t2437*t2680; out_ptr[1616] = data12*x1616*2.0-t436*t451*t2437*t2680; out_ptr[1617] = data12*x1617*2.0-t436*t444*t2437*t2680; out_ptr[1618] = data12*x1618*2.0-t436*t450*t2437*t2680; out_ptr[1619] = data12*x1619*2.0-t436*t443*t2437*t2680; out_ptr[1620] = data12*x1620*2.0-t436*t449*t2437*t2680; out_ptr[1621] = data12*x1621*2.0-t436*t437*t2437*t2680; out_ptr[1622] = data12*x1622*2.0-t436*t448*t2437*t2680; out_ptr[1623] = data12*x1623*2.0-t438*t451*t2437*t2680; out_ptr[1624] = data12*x1624*2.0-t438*t444*t2437*t2680; out_ptr[1625] = data12*x1625*2.0-t438*t450*t2437*t2680; out_ptr[1626] = data12*x1626*2.0-t438*t443*t2437*t2680; out_ptr[1627] = data12*x1627*2.0-t438*t449*t2437*t2680; out_ptr[1628] = data12*x1628*2.0-t437*t438*t2437*t2680; out_ptr[1629] = data12*x1629*2.0-t438*t448*t2437*t2680; out_ptr[1630] = data12*x1630*2.0-t439*t444*t2437*t2680; out_ptr[1631] = data12*x1631*2.0-t439*t450*t2437*t2680; out_ptr[1632] = data12*x1632*2.0-t439*t443*t2437*t2680; out_ptr[1633] = data12*x1633*2.0-t439*t449*t2437*t2680; out_ptr[1634] = data12*x1634*2.0-t437*t439*t2437*t2680; out_ptr[1635] = data12*x1635*2.0-t439*t448*t2437*t2680; out_ptr[1636] = data12*x1636*2.0-t440*t450*t2437*t2680; out_ptr[1637] = data12*x1637*2.0-t440*t443*t2437*t2680; out_ptr[1638] = data12*x1638*2.0-t440*t449*t2437*t2680; out_ptr[1639] = data12*x1639*2.0-t437*t440*t2437*t2680; out_ptr[1640] = data12*x1640*2.0-t440*t448*t2437*t2680; out_ptr[1641] = data12*x1641*2.0-t441*t443*t2437*t2680; out_ptr[1642] = data12*x1642*2.0-t441*t449*t2437*t2680; out_ptr[1643] = data12*x1643*2.0-t437*t441*t2437*t2680; out_ptr[1644] = data12*x1644*2.0-t441*t448*t2437*t2680; out_ptr[1645] = data12*x1645*2.0-t442*t449*t2437*t2680; out_ptr[1646] = data12*x1646*2.0-t437*t442*t2437*t2680; out_ptr[1647] = data12*x1647*2.0-t442*t448*t2437*t2680; out_ptr[1648] = data12*x1648*2.0-t437*t446*t2437*t2680; out_ptr[1649] = data12*x1649*2.0-t446*t448*t2437*t2680; out_ptr[1650] = data12*x1650*2.0-t447*t448*t2437*t2680; #line 39 "au_autodiff_generate_template.cpp" } } else { const mwSize out_step = 1; for(mwSize c_in = 0; c_in < in.cols; ++c_in, in_ptr += in.rows, data_ptr += data.rows, out_ptr += out_step) { /* inner loop do_jac=0 */ double x1 = in_ptr[0]; double x2 = in_ptr[1]; double x3 = in_ptr[2]; double x4 = in_ptr[3]; double x5 = in_ptr[4]; double x6 = in_ptr[5]; double x7 = in_ptr[6]; double x8 = in_ptr[7]; double x9 = in_ptr[8]; double x10 = in_ptr[9]; double x11 = in_ptr[10]; double x12 = in_ptr[11]; double x13 = in_ptr[12]; double x14 = in_ptr[13]; double x15 = in_ptr[14]; double x16 = in_ptr[15]; double x17 = in_ptr[16]; double x18 = in_ptr[17]; double x19 = in_ptr[18]; double x20 = in_ptr[19]; double x21 = in_ptr[20]; double x22 = in_ptr[21]; double x23 = in_ptr[22]; double x24 = in_ptr[23]; double x25 = in_ptr[24]; double x26 = in_ptr[25]; double x27 = in_ptr[26]; double x28 = in_ptr[27]; double x29 = in_ptr[28]; double x30 = in_ptr[29]; double x31 = in_ptr[30]; double x32 = in_ptr[31]; double x33 = in_ptr[32]; double x34 = in_ptr[33]; double x35 = in_ptr[34]; double x36 = in_ptr[35]; double x37 = in_ptr[36]; double x38 = in_ptr[37]; double x39 = in_ptr[38]; double x40 = in_ptr[39]; double x41 = in_ptr[40]; double x42 = in_ptr[41]; double x43 = in_ptr[42]; double x44 = in_ptr[43]; double x45 = in_ptr[44]; double x46 = in_ptr[45]; double x47 = in_ptr[46]; double x48 = in_ptr[47]; double x49 = in_ptr[48]; double x50 = in_ptr[49]; double x51 = in_ptr[50]; double x52 = in_ptr[51]; double x53 = in_ptr[52]; double x54 = in_ptr[53]; double x55 = in_ptr[54]; double x56 = in_ptr[55]; double x57 = in_ptr[56]; double x58 = in_ptr[57]; double x59 = in_ptr[58]; double x60 = in_ptr[59]; double x61 = in_ptr[60]; double x62 = in_ptr[61]; double x63 = in_ptr[62]; double x64 = in_ptr[63]; double x65 = in_ptr[64]; double x66 = in_ptr[65]; double x67 = in_ptr[66]; double x68 = in_ptr[67]; double x69 = in_ptr[68]; double x70 = in_ptr[69]; double x71 = in_ptr[70]; double x72 = in_ptr[71]; double x73 = in_ptr[72]; double x74 = in_ptr[73]; double x75 = in_ptr[74]; double x76 = in_ptr[75]; double x77 = in_ptr[76]; double x78 = in_ptr[77]; double x79 = in_ptr[78]; double x80 = in_ptr[79]; double x81 = in_ptr[80]; double x82 = in_ptr[81]; double x83 = in_ptr[82]; double x84 = in_ptr[83]; double x85 = in_ptr[84]; double x86 = in_ptr[85]; double x87 = in_ptr[86]; double x88 = in_ptr[87]; double x89 = in_ptr[88]; double x90 = in_ptr[89]; double x91 = in_ptr[90]; double x92 = in_ptr[91]; double x93 = in_ptr[92]; double x94 = in_ptr[93]; double x95 = in_ptr[94]; double x96 = in_ptr[95]; double x97 = in_ptr[96]; double x98 = in_ptr[97]; double x99 = in_ptr[98]; double x100 = in_ptr[99]; double x101 = in_ptr[100]; double x102 = in_ptr[101]; double x103 = in_ptr[102]; double x104 = in_ptr[103]; double x105 = in_ptr[104]; double x106 = in_ptr[105]; double x107 = in_ptr[106]; double x108 = in_ptr[107]; double x109 = in_ptr[108]; double x110 = in_ptr[109]; double x111 = in_ptr[110]; double x112 = in_ptr[111]; double x113 = in_ptr[112]; double x114 = in_ptr[113]; double x115 = in_ptr[114]; double x116 = in_ptr[115]; double x117 = in_ptr[116]; double x118 = in_ptr[117]; double x119 = in_ptr[118]; double x120 = in_ptr[119]; double x121 = in_ptr[120]; double x122 = in_ptr[121]; double x123 = in_ptr[122]; double x124 = in_ptr[123]; double x125 = in_ptr[124]; double x126 = in_ptr[125]; double x127 = in_ptr[126]; double x128 = in_ptr[127]; double x129 = in_ptr[128]; double x130 = in_ptr[129]; double x131 = in_ptr[130]; double x132 = in_ptr[131]; double x133 = in_ptr[132]; double x134 = in_ptr[133]; double x135 = in_ptr[134]; double x136 = in_ptr[135]; double x137 = in_ptr[136]; double x138 = in_ptr[137]; double x139 = in_ptr[138]; double x140 = in_ptr[139]; double x141 = in_ptr[140]; double x142 = in_ptr[141]; double x143 = in_ptr[142]; double x144 = in_ptr[143]; double x145 = in_ptr[144]; double x146 = in_ptr[145]; double x147 = in_ptr[146]; double x148 = in_ptr[147]; double x149 = in_ptr[148]; double x150 = in_ptr[149]; double x151 = in_ptr[150]; double x152 = in_ptr[151]; double x153 = in_ptr[152]; double x154 = in_ptr[153]; double x155 = in_ptr[154]; double x156 = in_ptr[155]; double x157 = in_ptr[156]; double x158 = in_ptr[157]; double x159 = in_ptr[158]; double x160 = in_ptr[159]; double x161 = in_ptr[160]; double x162 = in_ptr[161]; double x163 = in_ptr[162]; double x164 = in_ptr[163]; double x165 = in_ptr[164]; double x166 = in_ptr[165]; double x167 = in_ptr[166]; double x168 = in_ptr[167]; double x169 = in_ptr[168]; double x170 = in_ptr[169]; double x171 = in_ptr[170]; double x172 = in_ptr[171]; double x173 = in_ptr[172]; double x174 = in_ptr[173]; double x175 = in_ptr[174]; double x176 = in_ptr[175]; double x177 = in_ptr[176]; double x178 = in_ptr[177]; double x179 = in_ptr[178]; double x180 = in_ptr[179]; double x181 = in_ptr[180]; double x182 = in_ptr[181]; double x183 = in_ptr[182]; double x184 = in_ptr[183]; double x185 = in_ptr[184]; double x186 = in_ptr[185]; double x187 = in_ptr[186]; double x188 = in_ptr[187]; double x189 = in_ptr[188]; double x190 = in_ptr[189]; double x191 = in_ptr[190]; double x192 = in_ptr[191]; double x193 = in_ptr[192]; double x194 = in_ptr[193]; double x195 = in_ptr[194]; double x196 = in_ptr[195]; double x197 = in_ptr[196]; double x198 = in_ptr[197]; double x199 = in_ptr[198]; double x200 = in_ptr[199]; double x201 = in_ptr[200]; double x202 = in_ptr[201]; double x203 = in_ptr[202]; double x204 = in_ptr[203]; double x205 = in_ptr[204]; double x206 = in_ptr[205]; double x207 = in_ptr[206]; double x208 = in_ptr[207]; double x209 = in_ptr[208]; double x210 = in_ptr[209]; double x211 = in_ptr[210]; double x212 = in_ptr[211]; double x213 = in_ptr[212]; double x214 = in_ptr[213]; double x215 = in_ptr[214]; double x216 = in_ptr[215]; double x217 = in_ptr[216]; double x218 = in_ptr[217]; double x219 = in_ptr[218]; double x220 = in_ptr[219]; double x221 = in_ptr[220]; double x222 = in_ptr[221]; double x223 = in_ptr[222]; double x224 = in_ptr[223]; double x225 = in_ptr[224]; double x226 = in_ptr[225]; double x227 = in_ptr[226]; double x228 = in_ptr[227]; double x229 = in_ptr[228]; double x230 = in_ptr[229]; double x231 = in_ptr[230]; double x232 = in_ptr[231]; double x233 = in_ptr[232]; double x234 = in_ptr[233]; double x235 = in_ptr[234]; double x236 = in_ptr[235]; double x237 = in_ptr[236]; double x238 = in_ptr[237]; double x239 = in_ptr[238]; double x240 = in_ptr[239]; double x241 = in_ptr[240]; double x242 = in_ptr[241]; double x243 = in_ptr[242]; double x244 = in_ptr[243]; double x245 = in_ptr[244]; double x246 = in_ptr[245]; double x247 = in_ptr[246]; double x248 = in_ptr[247]; double x249 = in_ptr[248]; double x250 = in_ptr[249]; double x251 = in_ptr[250]; double x252 = in_ptr[251]; double x253 = in_ptr[252]; double x254 = in_ptr[253]; double x255 = in_ptr[254]; double x256 = in_ptr[255]; double x257 = in_ptr[256]; double x258 = in_ptr[257]; double x259 = in_ptr[258]; double x260 = in_ptr[259]; double x261 = in_ptr[260]; double x262 = in_ptr[261]; double x263 = in_ptr[262]; double x264 = in_ptr[263]; double x265 = in_ptr[264]; double x266 = in_ptr[265]; double x267 = in_ptr[266]; double x268 = in_ptr[267]; double x269 = in_ptr[268]; double x270 = in_ptr[269]; double x271 = in_ptr[270]; double x272 = in_ptr[271]; double x273 = in_ptr[272]; double x274 = in_ptr[273]; double x275 = in_ptr[274]; double x276 = in_ptr[275]; double x277 = in_ptr[276]; double x278 = in_ptr[277]; double x279 = in_ptr[278]; double x280 = in_ptr[279]; double x281 = in_ptr[280]; double x282 = in_ptr[281]; double x283 = in_ptr[282]; double x284 = in_ptr[283]; double x285 = in_ptr[284]; double x286 = in_ptr[285]; double x287 = in_ptr[286]; double x288 = in_ptr[287]; double x289 = in_ptr[288]; double x290 = in_ptr[289]; double x291 = in_ptr[290]; double x292 = in_ptr[291]; double x293 = in_ptr[292]; double x294 = in_ptr[293]; double x295 = in_ptr[294]; double x296 = in_ptr[295]; double x297 = in_ptr[296]; double x298 = in_ptr[297]; double x299 = in_ptr[298]; double x300 = in_ptr[299]; double x301 = in_ptr[300]; double x302 = in_ptr[301]; double x303 = in_ptr[302]; double x304 = in_ptr[303]; double x305 = in_ptr[304]; double x306 = in_ptr[305]; double x307 = in_ptr[306]; double x308 = in_ptr[307]; double x309 = in_ptr[308]; double x310 = in_ptr[309]; double x311 = in_ptr[310]; double x312 = in_ptr[311]; double x313 = in_ptr[312]; double x314 = in_ptr[313]; double x315 = in_ptr[314]; double x316 = in_ptr[315]; double x317 = in_ptr[316]; double x318 = in_ptr[317]; double x319 = in_ptr[318]; double x320 = in_ptr[319]; double x321 = in_ptr[320]; double x322 = in_ptr[321]; double x323 = in_ptr[322]; double x324 = in_ptr[323]; double x325 = in_ptr[324]; double x326 = in_ptr[325]; double x327 = in_ptr[326]; double x328 = in_ptr[327]; double x329 = in_ptr[328]; double x330 = in_ptr[329]; double x331 = in_ptr[330]; double x332 = in_ptr[331]; double x333 = in_ptr[332]; double x334 = in_ptr[333]; double x335 = in_ptr[334]; double x336 = in_ptr[335]; double x337 = in_ptr[336]; double x338 = in_ptr[337]; double x339 = in_ptr[338]; double x340 = in_ptr[339]; double x341 = in_ptr[340]; double x342 = in_ptr[341]; double x343 = in_ptr[342]; double x344 = in_ptr[343]; double x345 = in_ptr[344]; double x346 = in_ptr[345]; double x347 = in_ptr[346]; double x348 = in_ptr[347]; double x349 = in_ptr[348]; double x350 = in_ptr[349]; double x351 = in_ptr[350]; double x352 = in_ptr[351]; double x353 = in_ptr[352]; double x354 = in_ptr[353]; double x355 = in_ptr[354]; double x356 = in_ptr[355]; double x357 = in_ptr[356]; double x358 = in_ptr[357]; double x359 = in_ptr[358]; double x360 = in_ptr[359]; double x361 = in_ptr[360]; double x362 = in_ptr[361]; double x363 = in_ptr[362]; double x364 = in_ptr[363]; double x365 = in_ptr[364]; double x366 = in_ptr[365]; double x367 = in_ptr[366]; double x368 = in_ptr[367]; double x369 = in_ptr[368]; double x370 = in_ptr[369]; double x371 = in_ptr[370]; double x372 = in_ptr[371]; double x373 = in_ptr[372]; double x374 = in_ptr[373]; double x375 = in_ptr[374]; double x376 = in_ptr[375]; double x377 = in_ptr[376]; double x378 = in_ptr[377]; double x379 = in_ptr[378]; double x380 = in_ptr[379]; double x381 = in_ptr[380]; double x382 = in_ptr[381]; double x383 = in_ptr[382]; double x384 = in_ptr[383]; double x385 = in_ptr[384]; double x386 = in_ptr[385]; double x387 = in_ptr[386]; double x388 = in_ptr[387]; double x389 = in_ptr[388]; double x390 = in_ptr[389]; double x391 = in_ptr[390]; double x392 = in_ptr[391]; double x393 = in_ptr[392]; double x394 = in_ptr[393]; double x395 = in_ptr[394]; double x396 = in_ptr[395]; double x397 = in_ptr[396]; double x398 = in_ptr[397]; double x399 = in_ptr[398]; double x400 = in_ptr[399]; double x401 = in_ptr[400]; double x402 = in_ptr[401]; double x403 = in_ptr[402]; double x404 = in_ptr[403]; double x405 = in_ptr[404]; double x406 = in_ptr[405]; double x407 = in_ptr[406]; double x408 = in_ptr[407]; double x409 = in_ptr[408]; double x410 = in_ptr[409]; double x411 = in_ptr[410]; double x412 = in_ptr[411]; double x413 = in_ptr[412]; double x414 = in_ptr[413]; double x415 = in_ptr[414]; double x416 = in_ptr[415]; double x417 = in_ptr[416]; double x418 = in_ptr[417]; double x419 = in_ptr[418]; double x420 = in_ptr[419]; double x421 = in_ptr[420]; double x422 = in_ptr[421]; double x423 = in_ptr[422]; double x424 = in_ptr[423]; double x425 = in_ptr[424]; double x426 = in_ptr[425]; double x427 = in_ptr[426]; double x428 = in_ptr[427]; double x429 = in_ptr[428]; double x430 = in_ptr[429]; double x431 = in_ptr[430]; double x432 = in_ptr[431]; double x433 = in_ptr[432]; double x434 = in_ptr[433]; double x435 = in_ptr[434]; double x436 = in_ptr[435]; double x437 = in_ptr[436]; double x438 = in_ptr[437]; double x439 = in_ptr[438]; double x440 = in_ptr[439]; double x441 = in_ptr[440]; double x442 = in_ptr[441]; double x443 = in_ptr[442]; double x444 = in_ptr[443]; double x445 = in_ptr[444]; double x446 = in_ptr[445]; double x447 = in_ptr[446]; double x448 = in_ptr[447]; double x449 = in_ptr[448]; double x450 = in_ptr[449]; double x451 = in_ptr[450]; double x452 = in_ptr[451]; double x453 = in_ptr[452]; double x454 = in_ptr[453]; double x455 = in_ptr[454]; double x456 = in_ptr[455]; double x457 = in_ptr[456]; double x458 = in_ptr[457]; double x459 = in_ptr[458]; double x460 = in_ptr[459]; double x461 = in_ptr[460]; double x462 = in_ptr[461]; double x463 = in_ptr[462]; double x464 = in_ptr[463]; double x465 = in_ptr[464]; double x466 = in_ptr[465]; double x467 = in_ptr[466]; double x468 = in_ptr[467]; double x469 = in_ptr[468]; double x470 = in_ptr[469]; double x471 = in_ptr[470]; double x472 = in_ptr[471]; double x473 = in_ptr[472]; double x474 = in_ptr[473]; double x475 = in_ptr[474]; double x476 = in_ptr[475]; double x477 = in_ptr[476]; double x478 = in_ptr[477]; double x479 = in_ptr[478]; double x480 = in_ptr[479]; double x481 = in_ptr[480]; double x482 = in_ptr[481]; double x483 = in_ptr[482]; double x484 = in_ptr[483]; double x485 = in_ptr[484]; double x486 = in_ptr[485]; double x487 = in_ptr[486]; double x488 = in_ptr[487]; double x489 = in_ptr[488]; double x490 = in_ptr[489]; double x491 = in_ptr[490]; double x492 = in_ptr[491]; double x493 = in_ptr[492]; double x494 = in_ptr[493]; double x495 = in_ptr[494]; double x496 = in_ptr[495]; double x497 = in_ptr[496]; double x498 = in_ptr[497]; double x499 = in_ptr[498]; double x500 = in_ptr[499]; double x501 = in_ptr[500]; double x502 = in_ptr[501]; double x503 = in_ptr[502]; double x504 = in_ptr[503]; double x505 = in_ptr[504]; double x506 = in_ptr[505]; double x507 = in_ptr[506]; double x508 = in_ptr[507]; double x509 = in_ptr[508]; double x510 = in_ptr[509]; double x511 = in_ptr[510]; double x512 = in_ptr[511]; double x513 = in_ptr[512]; double x514 = in_ptr[513]; double x515 = in_ptr[514]; double x516 = in_ptr[515]; double x517 = in_ptr[516]; double x518 = in_ptr[517]; double x519 = in_ptr[518]; double x520 = in_ptr[519]; double x521 = in_ptr[520]; double x522 = in_ptr[521]; double x523 = in_ptr[522]; double x524 = in_ptr[523]; double x525 = in_ptr[524]; double x526 = in_ptr[525]; double x527 = in_ptr[526]; double x528 = in_ptr[527]; double x529 = in_ptr[528]; double x530 = in_ptr[529]; double x531 = in_ptr[530]; double x532 = in_ptr[531]; double x533 = in_ptr[532]; double x534 = in_ptr[533]; double x535 = in_ptr[534]; double x536 = in_ptr[535]; double x537 = in_ptr[536]; double x538 = in_ptr[537]; double x539 = in_ptr[538]; double x540 = in_ptr[539]; double x541 = in_ptr[540]; double x542 = in_ptr[541]; double x543 = in_ptr[542]; double x544 = in_ptr[543]; double x545 = in_ptr[544]; double x546 = in_ptr[545]; double x547 = in_ptr[546]; double x548 = in_ptr[547]; double x549 = in_ptr[548]; double x550 = in_ptr[549]; double x551 = in_ptr[550]; double x552 = in_ptr[551]; double x553 = in_ptr[552]; double x554 = in_ptr[553]; double x555 = in_ptr[554]; double x556 = in_ptr[555]; double x557 = in_ptr[556]; double x558 = in_ptr[557]; double x559 = in_ptr[558]; double x560 = in_ptr[559]; double x561 = in_ptr[560]; double x562 = in_ptr[561]; double x563 = in_ptr[562]; double x564 = in_ptr[563]; double x565 = in_ptr[564]; double x566 = in_ptr[565]; double x567 = in_ptr[566]; double x568 = in_ptr[567]; double x569 = in_ptr[568]; double x570 = in_ptr[569]; double x571 = in_ptr[570]; double x572 = in_ptr[571]; double x573 = in_ptr[572]; double x574 = in_ptr[573]; double x575 = in_ptr[574]; double x576 = in_ptr[575]; double x577 = in_ptr[576]; double x578 = in_ptr[577]; double x579 = in_ptr[578]; double x580 = in_ptr[579]; double x581 = in_ptr[580]; double x582 = in_ptr[581]; double x583 = in_ptr[582]; double x584 = in_ptr[583]; double x585 = in_ptr[584]; double x586 = in_ptr[585]; double x587 = in_ptr[586]; double x588 = in_ptr[587]; double x589 = in_ptr[588]; double x590 = in_ptr[589]; double x591 = in_ptr[590]; double x592 = in_ptr[591]; double x593 = in_ptr[592]; double x594 = in_ptr[593]; double x595 = in_ptr[594]; double x596 = in_ptr[595]; double x597 = in_ptr[596]; double x598 = in_ptr[597]; double x599 = in_ptr[598]; double x600 = in_ptr[599]; double x601 = in_ptr[600]; double x602 = in_ptr[601]; double x603 = in_ptr[602]; double x604 = in_ptr[603]; double x605 = in_ptr[604]; double x606 = in_ptr[605]; double x607 = in_ptr[606]; double x608 = in_ptr[607]; double x609 = in_ptr[608]; double x610 = in_ptr[609]; double x611 = in_ptr[610]; double x612 = in_ptr[611]; double x613 = in_ptr[612]; double x614 = in_ptr[613]; double x615 = in_ptr[614]; double x616 = in_ptr[615]; double x617 = in_ptr[616]; double x618 = in_ptr[617]; double x619 = in_ptr[618]; double x620 = in_ptr[619]; double x621 = in_ptr[620]; double x622 = in_ptr[621]; double x623 = in_ptr[622]; double x624 = in_ptr[623]; double x625 = in_ptr[624]; double x626 = in_ptr[625]; double x627 = in_ptr[626]; double x628 = in_ptr[627]; double x629 = in_ptr[628]; double x630 = in_ptr[629]; double x631 = in_ptr[630]; double x632 = in_ptr[631]; double x633 = in_ptr[632]; double x634 = in_ptr[633]; double x635 = in_ptr[634]; double x636 = in_ptr[635]; double x637 = in_ptr[636]; double x638 = in_ptr[637]; double x639 = in_ptr[638]; double x640 = in_ptr[639]; double x641 = in_ptr[640]; double x642 = in_ptr[641]; double x643 = in_ptr[642]; double x644 = in_ptr[643]; double x645 = in_ptr[644]; double x646 = in_ptr[645]; double x647 = in_ptr[646]; double x648 = in_ptr[647]; double x649 = in_ptr[648]; double x650 = in_ptr[649]; double x651 = in_ptr[650]; double x652 = in_ptr[651]; double x653 = in_ptr[652]; double x654 = in_ptr[653]; double x655 = in_ptr[654]; double x656 = in_ptr[655]; double x657 = in_ptr[656]; double x658 = in_ptr[657]; double x659 = in_ptr[658]; double x660 = in_ptr[659]; double x661 = in_ptr[660]; double x662 = in_ptr[661]; double x663 = in_ptr[662]; double x664 = in_ptr[663]; double x665 = in_ptr[664]; double x666 = in_ptr[665]; double x667 = in_ptr[666]; double x668 = in_ptr[667]; double x669 = in_ptr[668]; double x670 = in_ptr[669]; double x671 = in_ptr[670]; double x672 = in_ptr[671]; double x673 = in_ptr[672]; double x674 = in_ptr[673]; double x675 = in_ptr[674]; double x676 = in_ptr[675]; double x677 = in_ptr[676]; double x678 = in_ptr[677]; double x679 = in_ptr[678]; double x680 = in_ptr[679]; double x681 = in_ptr[680]; double x682 = in_ptr[681]; double x683 = in_ptr[682]; double x684 = in_ptr[683]; double x685 = in_ptr[684]; double x686 = in_ptr[685]; double x687 = in_ptr[686]; double x688 = in_ptr[687]; double x689 = in_ptr[688]; double x690 = in_ptr[689]; double x691 = in_ptr[690]; double x692 = in_ptr[691]; double x693 = in_ptr[692]; double x694 = in_ptr[693]; double x695 = in_ptr[694]; double x696 = in_ptr[695]; double x697 = in_ptr[696]; double x698 = in_ptr[697]; double x699 = in_ptr[698]; double x700 = in_ptr[699]; double x701 = in_ptr[700]; double x702 = in_ptr[701]; double x703 = in_ptr[702]; double x704 = in_ptr[703]; double x705 = in_ptr[704]; double x706 = in_ptr[705]; double x707 = in_ptr[706]; double x708 = in_ptr[707]; double x709 = in_ptr[708]; double x710 = in_ptr[709]; double x711 = in_ptr[710]; double x712 = in_ptr[711]; double x713 = in_ptr[712]; double x714 = in_ptr[713]; double x715 = in_ptr[714]; double x716 = in_ptr[715]; double x717 = in_ptr[716]; double x718 = in_ptr[717]; double x719 = in_ptr[718]; double x720 = in_ptr[719]; double x721 = in_ptr[720]; double x722 = in_ptr[721]; double x723 = in_ptr[722]; double x724 = in_ptr[723]; double x725 = in_ptr[724]; double x726 = in_ptr[725]; double x727 = in_ptr[726]; double x728 = in_ptr[727]; double x729 = in_ptr[728]; double x730 = in_ptr[729]; double x731 = in_ptr[730]; double x732 = in_ptr[731]; double x733 = in_ptr[732]; double x734 = in_ptr[733]; double x735 = in_ptr[734]; double x736 = in_ptr[735]; double x737 = in_ptr[736]; double x738 = in_ptr[737]; double x739 = in_ptr[738]; double x740 = in_ptr[739]; double x741 = in_ptr[740]; double x742 = in_ptr[741]; double x743 = in_ptr[742]; double x744 = in_ptr[743]; double x745 = in_ptr[744]; double x746 = in_ptr[745]; double x747 = in_ptr[746]; double x748 = in_ptr[747]; double x749 = in_ptr[748]; double x750 = in_ptr[749]; double x751 = in_ptr[750]; double x752 = in_ptr[751]; double x753 = in_ptr[752]; double x754 = in_ptr[753]; double x755 = in_ptr[754]; double x756 = in_ptr[755]; double x757 = in_ptr[756]; double x758 = in_ptr[757]; double x759 = in_ptr[758]; double x760 = in_ptr[759]; double x761 = in_ptr[760]; double x762 = in_ptr[761]; double x763 = in_ptr[762]; double x764 = in_ptr[763]; double x765 = in_ptr[764]; double x766 = in_ptr[765]; double x767 = in_ptr[766]; double x768 = in_ptr[767]; double x769 = in_ptr[768]; double x770 = in_ptr[769]; double x771 = in_ptr[770]; double x772 = in_ptr[771]; double x773 = in_ptr[772]; double x774 = in_ptr[773]; double x775 = in_ptr[774]; double x776 = in_ptr[775]; double x777 = in_ptr[776]; double x778 = in_ptr[777]; double x779 = in_ptr[778]; double x780 = in_ptr[779]; double x781 = in_ptr[780]; double x782 = in_ptr[781]; double x783 = in_ptr[782]; double x784 = in_ptr[783]; double x785 = in_ptr[784]; double x786 = in_ptr[785]; double x787 = in_ptr[786]; double x788 = in_ptr[787]; double x789 = in_ptr[788]; double x790 = in_ptr[789]; double x791 = in_ptr[790]; double x792 = in_ptr[791]; double x793 = in_ptr[792]; double x794 = in_ptr[793]; double x795 = in_ptr[794]; double x796 = in_ptr[795]; double x797 = in_ptr[796]; double x798 = in_ptr[797]; double x799 = in_ptr[798]; double x800 = in_ptr[799]; double x801 = in_ptr[800]; double x802 = in_ptr[801]; double x803 = in_ptr[802]; double x804 = in_ptr[803]; double x805 = in_ptr[804]; double x806 = in_ptr[805]; double x807 = in_ptr[806]; double x808 = in_ptr[807]; double x809 = in_ptr[808]; double x810 = in_ptr[809]; double x811 = in_ptr[810]; double x812 = in_ptr[811]; double x813 = in_ptr[812]; double x814 = in_ptr[813]; double x815 = in_ptr[814]; double x816 = in_ptr[815]; double x817 = in_ptr[816]; double x818 = in_ptr[817]; double x819 = in_ptr[818]; double x820 = in_ptr[819]; double x821 = in_ptr[820]; double x822 = in_ptr[821]; double x823 = in_ptr[822]; double x824 = in_ptr[823]; double x825 = in_ptr[824]; double x826 = in_ptr[825]; double x827 = in_ptr[826]; double x828 = in_ptr[827]; double x829 = in_ptr[828]; double x830 = in_ptr[829]; double x831 = in_ptr[830]; double x832 = in_ptr[831]; double x833 = in_ptr[832]; double x834 = in_ptr[833]; double x835 = in_ptr[834]; double x836 = in_ptr[835]; double x837 = in_ptr[836]; double x838 = in_ptr[837]; double x839 = in_ptr[838]; double x840 = in_ptr[839]; double x841 = in_ptr[840]; double x842 = in_ptr[841]; double x843 = in_ptr[842]; double x844 = in_ptr[843]; double x845 = in_ptr[844]; double x846 = in_ptr[845]; double x847 = in_ptr[846]; double x848 = in_ptr[847]; double x849 = in_ptr[848]; double x850 = in_ptr[849]; double x851 = in_ptr[850]; double x852 = in_ptr[851]; double x853 = in_ptr[852]; double x854 = in_ptr[853]; double x855 = in_ptr[854]; double x856 = in_ptr[855]; double x857 = in_ptr[856]; double x858 = in_ptr[857]; double x859 = in_ptr[858]; double x860 = in_ptr[859]; double x861 = in_ptr[860]; double x862 = in_ptr[861]; double x863 = in_ptr[862]; double x864 = in_ptr[863]; double x865 = in_ptr[864]; double x866 = in_ptr[865]; double x867 = in_ptr[866]; double x868 = in_ptr[867]; double x869 = in_ptr[868]; double x870 = in_ptr[869]; double x871 = in_ptr[870]; double x872 = in_ptr[871]; double x873 = in_ptr[872]; double x874 = in_ptr[873]; double x875 = in_ptr[874]; double x876 = in_ptr[875]; double x877 = in_ptr[876]; double x878 = in_ptr[877]; double x879 = in_ptr[878]; double x880 = in_ptr[879]; double x881 = in_ptr[880]; double x882 = in_ptr[881]; double x883 = in_ptr[882]; double x884 = in_ptr[883]; double x885 = in_ptr[884]; double x886 = in_ptr[885]; double x887 = in_ptr[886]; double x888 = in_ptr[887]; double x889 = in_ptr[888]; double x890 = in_ptr[889]; double x891 = in_ptr[890]; double x892 = in_ptr[891]; double x893 = in_ptr[892]; double x894 = in_ptr[893]; double x895 = in_ptr[894]; double x896 = in_ptr[895]; double x897 = in_ptr[896]; double x898 = in_ptr[897]; double x899 = in_ptr[898]; double x900 = in_ptr[899]; double x901 = in_ptr[900]; double x902 = in_ptr[901]; double x903 = in_ptr[902]; double x904 = in_ptr[903]; double x905 = in_ptr[904]; double x906 = in_ptr[905]; double x907 = in_ptr[906]; double x908 = in_ptr[907]; double x909 = in_ptr[908]; double x910 = in_ptr[909]; double x911 = in_ptr[910]; double x912 = in_ptr[911]; double x913 = in_ptr[912]; double x914 = in_ptr[913]; double x915 = in_ptr[914]; double x916 = in_ptr[915]; double x917 = in_ptr[916]; double x918 = in_ptr[917]; double x919 = in_ptr[918]; double x920 = in_ptr[919]; double x921 = in_ptr[920]; double x922 = in_ptr[921]; double x923 = in_ptr[922]; double x924 = in_ptr[923]; double x925 = in_ptr[924]; double x926 = in_ptr[925]; double x927 = in_ptr[926]; double x928 = in_ptr[927]; double x929 = in_ptr[928]; double x930 = in_ptr[929]; double x931 = in_ptr[930]; double x932 = in_ptr[931]; double x933 = in_ptr[932]; double x934 = in_ptr[933]; double x935 = in_ptr[934]; double x936 = in_ptr[935]; double x937 = in_ptr[936]; double x938 = in_ptr[937]; double x939 = in_ptr[938]; double x940 = in_ptr[939]; double x941 = in_ptr[940]; double x942 = in_ptr[941]; double x943 = in_ptr[942]; double x944 = in_ptr[943]; double x945 = in_ptr[944]; double x946 = in_ptr[945]; double x947 = in_ptr[946]; double x948 = in_ptr[947]; double x949 = in_ptr[948]; double x950 = in_ptr[949]; double x951 = in_ptr[950]; double x952 = in_ptr[951]; double x953 = in_ptr[952]; double x954 = in_ptr[953]; double x955 = in_ptr[954]; double x956 = in_ptr[955]; double x957 = in_ptr[956]; double x958 = in_ptr[957]; double x959 = in_ptr[958]; double x960 = in_ptr[959]; double x961 = in_ptr[960]; double x962 = in_ptr[961]; double x963 = in_ptr[962]; double x964 = in_ptr[963]; double x965 = in_ptr[964]; double x966 = in_ptr[965]; double x967 = in_ptr[966]; double x968 = in_ptr[967]; double x969 = in_ptr[968]; double x970 = in_ptr[969]; double x971 = in_ptr[970]; double x972 = in_ptr[971]; double x973 = in_ptr[972]; double x974 = in_ptr[973]; double x975 = in_ptr[974]; double x976 = in_ptr[975]; double x977 = in_ptr[976]; double x978 = in_ptr[977]; double x979 = in_ptr[978]; double x980 = in_ptr[979]; double x981 = in_ptr[980]; double x982 = in_ptr[981]; double x983 = in_ptr[982]; double x984 = in_ptr[983]; double x985 = in_ptr[984]; double x986 = in_ptr[985]; double x987 = in_ptr[986]; double x988 = in_ptr[987]; double x989 = in_ptr[988]; double x990 = in_ptr[989]; double x991 = in_ptr[990]; double x992 = in_ptr[991]; double x993 = in_ptr[992]; double x994 = in_ptr[993]; double x995 = in_ptr[994]; double x996 = in_ptr[995]; double x997 = in_ptr[996]; double x998 = in_ptr[997]; double x999 = in_ptr[998]; double x1000 = in_ptr[999]; double x1001 = in_ptr[1000]; double x1002 = in_ptr[1001]; double x1003 = in_ptr[1002]; double x1004 = in_ptr[1003]; double x1005 = in_ptr[1004]; double x1006 = in_ptr[1005]; double x1007 = in_ptr[1006]; double x1008 = in_ptr[1007]; double x1009 = in_ptr[1008]; double x1010 = in_ptr[1009]; double x1011 = in_ptr[1010]; double x1012 = in_ptr[1011]; double x1013 = in_ptr[1012]; double x1014 = in_ptr[1013]; double x1015 = in_ptr[1014]; double x1016 = in_ptr[1015]; double x1017 = in_ptr[1016]; double x1018 = in_ptr[1017]; double x1019 = in_ptr[1018]; double x1020 = in_ptr[1019]; double x1021 = in_ptr[1020]; double x1022 = in_ptr[1021]; double x1023 = in_ptr[1022]; double x1024 = in_ptr[1023]; double x1025 = in_ptr[1024]; double x1026 = in_ptr[1025]; double x1027 = in_ptr[1026]; double x1028 = in_ptr[1027]; double x1029 = in_ptr[1028]; double x1030 = in_ptr[1029]; double x1031 = in_ptr[1030]; double x1032 = in_ptr[1031]; double x1033 = in_ptr[1032]; double x1034 = in_ptr[1033]; double x1035 = in_ptr[1034]; double x1036 = in_ptr[1035]; double x1037 = in_ptr[1036]; double x1038 = in_ptr[1037]; double x1039 = in_ptr[1038]; double x1040 = in_ptr[1039]; double x1041 = in_ptr[1040]; double x1042 = in_ptr[1041]; double x1043 = in_ptr[1042]; double x1044 = in_ptr[1043]; double x1045 = in_ptr[1044]; double x1046 = in_ptr[1045]; double x1047 = in_ptr[1046]; double x1048 = in_ptr[1047]; double x1049 = in_ptr[1048]; double x1050 = in_ptr[1049]; double x1051 = in_ptr[1050]; double x1052 = in_ptr[1051]; double x1053 = in_ptr[1052]; double x1054 = in_ptr[1053]; double x1055 = in_ptr[1054]; double x1056 = in_ptr[1055]; double x1057 = in_ptr[1056]; double x1058 = in_ptr[1057]; double x1059 = in_ptr[1058]; double x1060 = in_ptr[1059]; double x1061 = in_ptr[1060]; double x1062 = in_ptr[1061]; double x1063 = in_ptr[1062]; double x1064 = in_ptr[1063]; double x1065 = in_ptr[1064]; double x1066 = in_ptr[1065]; double x1067 = in_ptr[1066]; double x1068 = in_ptr[1067]; double x1069 = in_ptr[1068]; double x1070 = in_ptr[1069]; double x1071 = in_ptr[1070]; double x1072 = in_ptr[1071]; double x1073 = in_ptr[1072]; double x1074 = in_ptr[1073]; double x1075 = in_ptr[1074]; double x1076 = in_ptr[1075]; double x1077 = in_ptr[1076]; double x1078 = in_ptr[1077]; double x1079 = in_ptr[1078]; double x1080 = in_ptr[1079]; double x1081 = in_ptr[1080]; double x1082 = in_ptr[1081]; double x1083 = in_ptr[1082]; double x1084 = in_ptr[1083]; double x1085 = in_ptr[1084]; double x1086 = in_ptr[1085]; double x1087 = in_ptr[1086]; double x1088 = in_ptr[1087]; double x1089 = in_ptr[1088]; double x1090 = in_ptr[1089]; double x1091 = in_ptr[1090]; double x1092 = in_ptr[1091]; double x1093 = in_ptr[1092]; double x1094 = in_ptr[1093]; double x1095 = in_ptr[1094]; double x1096 = in_ptr[1095]; double x1097 = in_ptr[1096]; double x1098 = in_ptr[1097]; double x1099 = in_ptr[1098]; double x1100 = in_ptr[1099]; double x1101 = in_ptr[1100]; double x1102 = in_ptr[1101]; double x1103 = in_ptr[1102]; double x1104 = in_ptr[1103]; double x1105 = in_ptr[1104]; double x1106 = in_ptr[1105]; double x1107 = in_ptr[1106]; double x1108 = in_ptr[1107]; double x1109 = in_ptr[1108]; double x1110 = in_ptr[1109]; double x1111 = in_ptr[1110]; double x1112 = in_ptr[1111]; double x1113 = in_ptr[1112]; double x1114 = in_ptr[1113]; double x1115 = in_ptr[1114]; double x1116 = in_ptr[1115]; double x1117 = in_ptr[1116]; double x1118 = in_ptr[1117]; double x1119 = in_ptr[1118]; double x1120 = in_ptr[1119]; double x1121 = in_ptr[1120]; double x1122 = in_ptr[1121]; double x1123 = in_ptr[1122]; double x1124 = in_ptr[1123]; double x1125 = in_ptr[1124]; double x1126 = in_ptr[1125]; double x1127 = in_ptr[1126]; double x1128 = in_ptr[1127]; double x1129 = in_ptr[1128]; double x1130 = in_ptr[1129]; double x1131 = in_ptr[1130]; double x1132 = in_ptr[1131]; double x1133 = in_ptr[1132]; double x1134 = in_ptr[1133]; double x1135 = in_ptr[1134]; double x1136 = in_ptr[1135]; double x1137 = in_ptr[1136]; double x1138 = in_ptr[1137]; double x1139 = in_ptr[1138]; double x1140 = in_ptr[1139]; double x1141 = in_ptr[1140]; double x1142 = in_ptr[1141]; double x1143 = in_ptr[1142]; double x1144 = in_ptr[1143]; double x1145 = in_ptr[1144]; double x1146 = in_ptr[1145]; double x1147 = in_ptr[1146]; double x1148 = in_ptr[1147]; double x1149 = in_ptr[1148]; double x1150 = in_ptr[1149]; double x1151 = in_ptr[1150]; double x1152 = in_ptr[1151]; double x1153 = in_ptr[1152]; double x1154 = in_ptr[1153]; double x1155 = in_ptr[1154]; double x1156 = in_ptr[1155]; double x1157 = in_ptr[1156]; double x1158 = in_ptr[1157]; double x1159 = in_ptr[1158]; double x1160 = in_ptr[1159]; double x1161 = in_ptr[1160]; double x1162 = in_ptr[1161]; double x1163 = in_ptr[1162]; double x1164 = in_ptr[1163]; double x1165 = in_ptr[1164]; double x1166 = in_ptr[1165]; double x1167 = in_ptr[1166]; double x1168 = in_ptr[1167]; double x1169 = in_ptr[1168]; double x1170 = in_ptr[1169]; double x1171 = in_ptr[1170]; double x1172 = in_ptr[1171]; double x1173 = in_ptr[1172]; double x1174 = in_ptr[1173]; double x1175 = in_ptr[1174]; double x1176 = in_ptr[1175]; double x1177 = in_ptr[1176]; double x1178 = in_ptr[1177]; double x1179 = in_ptr[1178]; double x1180 = in_ptr[1179]; double x1181 = in_ptr[1180]; double x1182 = in_ptr[1181]; double x1183 = in_ptr[1182]; double x1184 = in_ptr[1183]; double x1185 = in_ptr[1184]; double x1186 = in_ptr[1185]; double x1187 = in_ptr[1186]; double x1188 = in_ptr[1187]; double x1189 = in_ptr[1188]; double x1190 = in_ptr[1189]; double x1191 = in_ptr[1190]; double x1192 = in_ptr[1191]; double x1193 = in_ptr[1192]; double x1194 = in_ptr[1193]; double x1195 = in_ptr[1194]; double x1196 = in_ptr[1195]; double x1197 = in_ptr[1196]; double x1198 = in_ptr[1197]; double x1199 = in_ptr[1198]; double x1200 = in_ptr[1199]; double x1201 = in_ptr[1200]; double x1202 = in_ptr[1201]; double x1203 = in_ptr[1202]; double x1204 = in_ptr[1203]; double x1205 = in_ptr[1204]; double x1206 = in_ptr[1205]; double x1207 = in_ptr[1206]; double x1208 = in_ptr[1207]; double x1209 = in_ptr[1208]; double x1210 = in_ptr[1209]; double x1211 = in_ptr[1210]; double x1212 = in_ptr[1211]; double x1213 = in_ptr[1212]; double x1214 = in_ptr[1213]; double x1215 = in_ptr[1214]; double x1216 = in_ptr[1215]; double x1217 = in_ptr[1216]; double x1218 = in_ptr[1217]; double x1219 = in_ptr[1218]; double x1220 = in_ptr[1219]; double x1221 = in_ptr[1220]; double x1222 = in_ptr[1221]; double x1223 = in_ptr[1222]; double x1224 = in_ptr[1223]; double x1225 = in_ptr[1224]; double x1226 = in_ptr[1225]; double x1227 = in_ptr[1226]; double x1228 = in_ptr[1227]; double x1229 = in_ptr[1228]; double x1230 = in_ptr[1229]; double x1231 = in_ptr[1230]; double x1232 = in_ptr[1231]; double x1233 = in_ptr[1232]; double x1234 = in_ptr[1233]; double x1235 = in_ptr[1234]; double x1236 = in_ptr[1235]; double x1237 = in_ptr[1236]; double x1238 = in_ptr[1237]; double x1239 = in_ptr[1238]; double x1240 = in_ptr[1239]; double x1241 = in_ptr[1240]; double x1242 = in_ptr[1241]; double x1243 = in_ptr[1242]; double x1244 = in_ptr[1243]; double x1245 = in_ptr[1244]; double x1246 = in_ptr[1245]; double x1247 = in_ptr[1246]; double x1248 = in_ptr[1247]; double x1249 = in_ptr[1248]; double x1250 = in_ptr[1249]; double x1251 = in_ptr[1250]; double x1252 = in_ptr[1251]; double x1253 = in_ptr[1252]; double x1254 = in_ptr[1253]; double x1255 = in_ptr[1254]; double x1256 = in_ptr[1255]; double x1257 = in_ptr[1256]; double x1258 = in_ptr[1257]; double x1259 = in_ptr[1258]; double x1260 = in_ptr[1259]; double x1261 = in_ptr[1260]; double x1262 = in_ptr[1261]; double x1263 = in_ptr[1262]; double x1264 = in_ptr[1263]; double x1265 = in_ptr[1264]; double x1266 = in_ptr[1265]; double x1267 = in_ptr[1266]; double x1268 = in_ptr[1267]; double x1269 = in_ptr[1268]; double x1270 = in_ptr[1269]; double x1271 = in_ptr[1270]; double x1272 = in_ptr[1271]; double x1273 = in_ptr[1272]; double x1274 = in_ptr[1273]; double x1275 = in_ptr[1274]; double x1276 = in_ptr[1275]; double x1277 = in_ptr[1276]; double x1278 = in_ptr[1277]; double x1279 = in_ptr[1278]; double x1280 = in_ptr[1279]; double x1281 = in_ptr[1280]; double x1282 = in_ptr[1281]; double x1283 = in_ptr[1282]; double x1284 = in_ptr[1283]; double x1285 = in_ptr[1284]; double x1286 = in_ptr[1285]; double x1287 = in_ptr[1286]; double x1288 = in_ptr[1287]; double x1289 = in_ptr[1288]; double x1290 = in_ptr[1289]; double x1291 = in_ptr[1290]; double x1292 = in_ptr[1291]; double x1293 = in_ptr[1292]; double x1294 = in_ptr[1293]; double x1295 = in_ptr[1294]; double x1296 = in_ptr[1295]; double x1297 = in_ptr[1296]; double x1298 = in_ptr[1297]; double x1299 = in_ptr[1298]; double x1300 = in_ptr[1299]; double x1301 = in_ptr[1300]; double x1302 = in_ptr[1301]; double x1303 = in_ptr[1302]; double x1304 = in_ptr[1303]; double x1305 = in_ptr[1304]; double x1306 = in_ptr[1305]; double x1307 = in_ptr[1306]; double x1308 = in_ptr[1307]; double x1309 = in_ptr[1308]; double x1310 = in_ptr[1309]; double x1311 = in_ptr[1310]; double x1312 = in_ptr[1311]; double x1313 = in_ptr[1312]; double x1314 = in_ptr[1313]; double x1315 = in_ptr[1314]; double x1316 = in_ptr[1315]; double x1317 = in_ptr[1316]; double x1318 = in_ptr[1317]; double x1319 = in_ptr[1318]; double x1320 = in_ptr[1319]; double x1321 = in_ptr[1320]; double x1322 = in_ptr[1321]; double x1323 = in_ptr[1322]; double x1324 = in_ptr[1323]; double x1325 = in_ptr[1324]; double x1326 = in_ptr[1325]; double x1327 = in_ptr[1326]; double x1328 = in_ptr[1327]; double x1329 = in_ptr[1328]; double x1330 = in_ptr[1329]; double x1331 = in_ptr[1330]; double x1332 = in_ptr[1331]; double x1333 = in_ptr[1332]; double x1334 = in_ptr[1333]; double x1335 = in_ptr[1334]; double x1336 = in_ptr[1335]; double x1337 = in_ptr[1336]; double x1338 = in_ptr[1337]; double x1339 = in_ptr[1338]; double x1340 = in_ptr[1339]; double x1341 = in_ptr[1340]; double x1342 = in_ptr[1341]; double x1343 = in_ptr[1342]; double x1344 = in_ptr[1343]; double x1345 = in_ptr[1344]; double x1346 = in_ptr[1345]; double x1347 = in_ptr[1346]; double x1348 = in_ptr[1347]; double x1349 = in_ptr[1348]; double x1350 = in_ptr[1349]; double x1351 = in_ptr[1350]; double x1352 = in_ptr[1351]; double x1353 = in_ptr[1352]; double x1354 = in_ptr[1353]; double x1355 = in_ptr[1354]; double x1356 = in_ptr[1355]; double x1357 = in_ptr[1356]; double x1358 = in_ptr[1357]; double x1359 = in_ptr[1358]; double x1360 = in_ptr[1359]; double x1361 = in_ptr[1360]; double x1362 = in_ptr[1361]; double x1363 = in_ptr[1362]; double x1364 = in_ptr[1363]; double x1365 = in_ptr[1364]; double x1366 = in_ptr[1365]; double x1367 = in_ptr[1366]; double x1368 = in_ptr[1367]; double x1369 = in_ptr[1368]; double x1370 = in_ptr[1369]; double x1371 = in_ptr[1370]; double x1372 = in_ptr[1371]; double x1373 = in_ptr[1372]; double x1374 = in_ptr[1373]; double x1375 = in_ptr[1374]; double x1376 = in_ptr[1375]; double x1377 = in_ptr[1376]; double x1378 = in_ptr[1377]; double x1379 = in_ptr[1378]; double x1380 = in_ptr[1379]; double x1381 = in_ptr[1380]; double x1382 = in_ptr[1381]; double x1383 = in_ptr[1382]; double x1384 = in_ptr[1383]; double x1385 = in_ptr[1384]; double x1386 = in_ptr[1385]; double x1387 = in_ptr[1386]; double x1388 = in_ptr[1387]; double x1389 = in_ptr[1388]; double x1390 = in_ptr[1389]; double x1391 = in_ptr[1390]; double x1392 = in_ptr[1391]; double x1393 = in_ptr[1392]; double x1394 = in_ptr[1393]; double x1395 = in_ptr[1394]; double x1396 = in_ptr[1395]; double x1397 = in_ptr[1396]; double x1398 = in_ptr[1397]; double x1399 = in_ptr[1398]; double x1400 = in_ptr[1399]; double x1401 = in_ptr[1400]; double x1402 = in_ptr[1401]; double x1403 = in_ptr[1402]; double x1404 = in_ptr[1403]; double x1405 = in_ptr[1404]; double x1406 = in_ptr[1405]; double x1407 = in_ptr[1406]; double x1408 = in_ptr[1407]; double x1409 = in_ptr[1408]; double x1410 = in_ptr[1409]; double x1411 = in_ptr[1410]; double x1412 = in_ptr[1411]; double x1413 = in_ptr[1412]; double x1414 = in_ptr[1413]; double x1415 = in_ptr[1414]; double x1416 = in_ptr[1415]; double x1417 = in_ptr[1416]; double x1418 = in_ptr[1417]; double x1419 = in_ptr[1418]; double x1420 = in_ptr[1419]; double x1421 = in_ptr[1420]; double x1422 = in_ptr[1421]; double x1423 = in_ptr[1422]; double x1424 = in_ptr[1423]; double x1425 = in_ptr[1424]; double x1426 = in_ptr[1425]; double x1427 = in_ptr[1426]; double x1428 = in_ptr[1427]; double x1429 = in_ptr[1428]; double x1430 = in_ptr[1429]; double x1431 = in_ptr[1430]; double x1432 = in_ptr[1431]; double x1433 = in_ptr[1432]; double x1434 = in_ptr[1433]; double x1435 = in_ptr[1434]; double x1436 = in_ptr[1435]; double x1437 = in_ptr[1436]; double x1438 = in_ptr[1437]; double x1439 = in_ptr[1438]; double x1440 = in_ptr[1439]; double x1441 = in_ptr[1440]; double x1442 = in_ptr[1441]; double x1443 = in_ptr[1442]; double x1444 = in_ptr[1443]; double x1445 = in_ptr[1444]; double x1446 = in_ptr[1445]; double x1447 = in_ptr[1446]; double x1448 = in_ptr[1447]; double x1449 = in_ptr[1448]; double x1450 = in_ptr[1449]; double x1451 = in_ptr[1450]; double x1452 = in_ptr[1451]; double x1453 = in_ptr[1452]; double x1454 = in_ptr[1453]; double x1455 = in_ptr[1454]; double x1456 = in_ptr[1455]; double x1457 = in_ptr[1456]; double x1458 = in_ptr[1457]; double x1459 = in_ptr[1458]; double x1460 = in_ptr[1459]; double x1461 = in_ptr[1460]; double x1462 = in_ptr[1461]; double x1463 = in_ptr[1462]; double x1464 = in_ptr[1463]; double x1465 = in_ptr[1464]; double x1466 = in_ptr[1465]; double x1467 = in_ptr[1466]; double x1468 = in_ptr[1467]; double x1469 = in_ptr[1468]; double x1470 = in_ptr[1469]; double x1471 = in_ptr[1470]; double x1472 = in_ptr[1471]; double x1473 = in_ptr[1472]; double x1474 = in_ptr[1473]; double x1475 = in_ptr[1474]; double x1476 = in_ptr[1475]; double x1477 = in_ptr[1476]; double x1478 = in_ptr[1477]; double x1479 = in_ptr[1478]; double x1480 = in_ptr[1479]; double x1481 = in_ptr[1480]; double x1482 = in_ptr[1481]; double x1483 = in_ptr[1482]; double x1484 = in_ptr[1483]; double x1485 = in_ptr[1484]; double x1486 = in_ptr[1485]; double x1487 = in_ptr[1486]; double x1488 = in_ptr[1487]; double x1489 = in_ptr[1488]; double x1490 = in_ptr[1489]; double x1491 = in_ptr[1490]; double x1492 = in_ptr[1491]; double x1493 = in_ptr[1492]; double x1494 = in_ptr[1493]; double x1495 = in_ptr[1494]; double x1496 = in_ptr[1495]; double x1497 = in_ptr[1496]; double x1498 = in_ptr[1497]; double x1499 = in_ptr[1498]; double x1500 = in_ptr[1499]; double x1501 = in_ptr[1500]; double x1502 = in_ptr[1501]; double x1503 = in_ptr[1502]; double x1504 = in_ptr[1503]; double x1505 = in_ptr[1504]; double x1506 = in_ptr[1505]; double x1507 = in_ptr[1506]; double x1508 = in_ptr[1507]; double x1509 = in_ptr[1508]; double x1510 = in_ptr[1509]; double x1511 = in_ptr[1510]; double x1512 = in_ptr[1511]; double x1513 = in_ptr[1512]; double x1514 = in_ptr[1513]; double x1515 = in_ptr[1514]; double x1516 = in_ptr[1515]; double x1517 = in_ptr[1516]; double x1518 = in_ptr[1517]; double x1519 = in_ptr[1518]; double x1520 = in_ptr[1519]; double x1521 = in_ptr[1520]; double x1522 = in_ptr[1521]; double x1523 = in_ptr[1522]; double x1524 = in_ptr[1523]; double x1525 = in_ptr[1524]; double x1526 = in_ptr[1525]; double x1527 = in_ptr[1526]; double x1528 = in_ptr[1527]; double x1529 = in_ptr[1528]; double x1530 = in_ptr[1529]; double x1531 = in_ptr[1530]; double x1532 = in_ptr[1531]; double x1533 = in_ptr[1532]; double x1534 = in_ptr[1533]; double x1535 = in_ptr[1534]; double x1536 = in_ptr[1535]; double x1537 = in_ptr[1536]; double x1538 = in_ptr[1537]; double x1539 = in_ptr[1538]; double x1540 = in_ptr[1539]; double x1541 = in_ptr[1540]; double x1542 = in_ptr[1541]; double x1543 = in_ptr[1542]; double x1544 = in_ptr[1543]; double x1545 = in_ptr[1544]; double x1546 = in_ptr[1545]; double x1547 = in_ptr[1546]; double x1548 = in_ptr[1547]; double x1549 = in_ptr[1548]; double x1550 = in_ptr[1549]; double x1551 = in_ptr[1550]; double x1552 = in_ptr[1551]; double x1553 = in_ptr[1552]; double x1554 = in_ptr[1553]; double x1555 = in_ptr[1554]; double x1556 = in_ptr[1555]; double x1557 = in_ptr[1556]; double x1558 = in_ptr[1557]; double x1559 = in_ptr[1558]; double x1560 = in_ptr[1559]; double x1561 = in_ptr[1560]; double x1562 = in_ptr[1561]; double x1563 = in_ptr[1562]; double x1564 = in_ptr[1563]; double x1565 = in_ptr[1564]; double x1566 = in_ptr[1565]; double x1567 = in_ptr[1566]; double x1568 = in_ptr[1567]; double x1569 = in_ptr[1568]; double x1570 = in_ptr[1569]; double x1571 = in_ptr[1570]; double x1572 = in_ptr[1571]; double x1573 = in_ptr[1572]; double x1574 = in_ptr[1573]; double x1575 = in_ptr[1574]; double x1576 = in_ptr[1575]; double x1577 = in_ptr[1576]; double x1578 = in_ptr[1577]; double x1579 = in_ptr[1578]; double x1580 = in_ptr[1579]; double x1581 = in_ptr[1580]; double x1582 = in_ptr[1581]; double x1583 = in_ptr[1582]; double x1584 = in_ptr[1583]; double x1585 = in_ptr[1584]; double x1586 = in_ptr[1585]; double x1587 = in_ptr[1586]; double x1588 = in_ptr[1587]; double x1589 = in_ptr[1588]; double x1590 = in_ptr[1589]; double x1591 = in_ptr[1590]; double x1592 = in_ptr[1591]; double x1593 = in_ptr[1592]; double x1594 = in_ptr[1593]; double x1595 = in_ptr[1594]; double x1596 = in_ptr[1595]; double x1597 = in_ptr[1596]; double x1598 = in_ptr[1597]; double x1599 = in_ptr[1598]; double x1600 = in_ptr[1599]; double x1601 = in_ptr[1600]; double x1602 = in_ptr[1601]; double x1603 = in_ptr[1602]; double x1604 = in_ptr[1603]; double x1605 = in_ptr[1604]; double x1606 = in_ptr[1605]; double x1607 = in_ptr[1606]; double x1608 = in_ptr[1607]; double x1609 = in_ptr[1608]; double x1610 = in_ptr[1609]; double x1611 = in_ptr[1610]; double x1612 = in_ptr[1611]; double x1613 = in_ptr[1612]; double x1614 = in_ptr[1613]; double x1615 = in_ptr[1614]; double x1616 = in_ptr[1615]; double x1617 = in_ptr[1616]; double x1618 = in_ptr[1617]; double x1619 = in_ptr[1618]; double x1620 = in_ptr[1619]; double x1621 = in_ptr[1620]; double x1622 = in_ptr[1621]; double x1623 = in_ptr[1622]; double x1624 = in_ptr[1623]; double x1625 = in_ptr[1624]; double x1626 = in_ptr[1625]; double x1627 = in_ptr[1626]; double x1628 = in_ptr[1627]; double x1629 = in_ptr[1628]; double x1630 = in_ptr[1629]; double x1631 = in_ptr[1630]; double x1632 = in_ptr[1631]; double x1633 = in_ptr[1632]; double x1634 = in_ptr[1633]; double x1635 = in_ptr[1634]; double x1636 = in_ptr[1635]; double x1637 = in_ptr[1636]; double x1638 = in_ptr[1637]; double x1639 = in_ptr[1638]; double x1640 = in_ptr[1639]; double x1641 = in_ptr[1640]; double x1642 = in_ptr[1641]; double x1643 = in_ptr[1642]; double x1644 = in_ptr[1643]; double x1645 = in_ptr[1644]; double x1646 = in_ptr[1645]; double x1647 = in_ptr[1646]; double x1648 = in_ptr[1647]; double x1649 = in_ptr[1648]; double x1650 = in_ptr[1649]; double data1 = data_ptr[0]; double data2 = data_ptr[1]; double data3 = data_ptr[2]; double data4 = data_ptr[3]; double data5 = data_ptr[4]; double data6 = data_ptr[5]; double data7 = data_ptr[6]; double data8 = data_ptr[7]; double data9 = data_ptr[8]; double data10 = data_ptr[9]; double data11 = data_ptr[10]; double data12 = data_ptr[11]; double data13 = data_ptr[12]; double t3 = data1-x26; double t4 = data2-x27; double t502 = exp(x277); double t2 = t4*t502+t3*x286; double t6 = data3-x28; double t7 = data4-x29; double t8 = data5-x30; double t9 = data6-x31; double t10 = data7-x32; double t14 = data8-x33; double t15 = data9-x34; double t509 = exp(x284); double t5 = t15*t509+t3*x293+t4*x301+t6*x308+t7*x314+t8*x319+t9*x323+t10*x326+t14*x328; double t507 = exp(x282); double t11 = t10*t507+t3*x291+t4*x299+t6*x306+t7*x312+t8*x317+t9*x321; double t505 = exp(x280); double t12 = t8*t505+t3*x289+t4*x297+t6*x304+t7*x310; double t503 = exp(x278); double t13 = t6*t503+t3*x287+t4*x295; double t510 = exp(x285); double t16 = t3*x294+t4*x302+t6*x309+t7*x315+t8*x320+t9*x324+t10*x327+t14*x329+t15*x330+t510*(data10-x35); double t508 = exp(x283); double t17 = t14*t508+t3*x292+t4*x300+t6*x307+t7*x313+t8*x318+t9*x322+t10*x325; double t506 = exp(x281); double t18 = t9*t506+t3*x290+t4*x298+t6*x305+t7*x311+t8*x316; double t504 = exp(x279); double t19 = t7*t504+t3*x288+t4*x296+t6*x303; double t21 = data1-x36; double t22 = data2-x37; double t511 = exp(x332); double t20 = t22*t511+t21*x341; double t24 = data3-x38; double t25 = data4-x39; double t26 = data5-x40; double t27 = data6-x41; double t28 = data7-x42; double t32 = data8-x43; double t33 = data9-x44; double t518 = exp(x339); double t23 = t33*t518+t21*x348+t22*x356+t24*x363+t25*x369+t26*x374+t27*x378+t28*x381+t32*x383; double t516 = exp(x337); double t29 = t28*t516+t21*x346+t22*x354+t24*x361+t25*x367+t26*x372+t27*x376; double t514 = exp(x335); double t30 = t26*t514+t21*x344+t22*x352+t24*x359+t25*x365; double t512 = exp(x333); double t31 = t24*t512+t21*x342+t22*x350; double t519 = exp(x340); double t34 = t21*x349+t22*x357+t24*x364+t25*x370+t26*x375+t27*x379+t28*x382+t32*x384+t33*x385+t519*(data10-x45); double t517 = exp(x338); double t35 = t32*t517+t21*x347+t22*x355+t24*x362+t25*x368+t26*x373+t27*x377+t28*x380; double t515 = exp(x336); double t36 = t27*t515+t21*x345+t22*x353+t24*x360+t25*x366+t26*x371; double t513 = exp(x334); double t37 = t25*t513+t21*x343+t22*x351+t24*x358; double t39 = data1-x46; double t40 = data2-x47; double t520 = exp(x387); double t38 = t40*t520+t39*x396; double t42 = data3-x48; double t43 = data4-x49; double t44 = data5-x50; double t45 = data6-x51; double t46 = data7-x52; double t50 = data8-x53; double t51 = data9-x54; double t527 = exp(x394); double t41 = t51*t527+t39*x403+t40*x411+t42*x418+t43*x424+t44*x429+t45*x433+t46*x436+t50*x438; double t525 = exp(x392); double t47 = t46*t525+t39*x401+t40*x409+t42*x416+t43*x422+t44*x427+t45*x431; double t523 = exp(x390); double t48 = t44*t523+t39*x399+t40*x407+t42*x414+t43*x420; double t521 = exp(x388); double t49 = t42*t521+t39*x397+t40*x405; double t528 = exp(x395); double t52 = t39*x404+t40*x412+t42*x419+t43*x425+t44*x430+t45*x434+t46*x437+t50*x439+t51*x440+t528*(data10-x55); double t526 = exp(x393); double t53 = t50*t526+t39*x402+t40*x410+t42*x417+t43*x423+t44*x428+t45*x432+t46*x435; double t524 = exp(x391); double t54 = t45*t524+t39*x400+t40*x408+t42*x415+t43*x421+t44*x426; double t522 = exp(x389); double t55 = t43*t522+t39*x398+t40*x406+t42*x413; double t57 = data1-x56; double t58 = data2-x57; double t529 = exp(x442); double t56 = t58*t529+t57*x451; double t60 = data3-x58; double t61 = data4-x59; double t62 = data5-x60; double t63 = data6-x61; double t64 = data7-x62; double t68 = data8-x63; double t69 = data9-x64; double t536 = exp(x449); double t59 = t69*t536+t57*x458+t58*x466+t60*x473+t61*x479+t62*x484+t63*x488+t64*x491+t68*x493; double t534 = exp(x447); double t65 = t64*t534+t57*x456+t58*x464+t60*x471+t61*x477+t62*x482+t63*x486; double t532 = exp(x445); double t66 = t62*t532+t57*x454+t58*x462+t60*x469+t61*x475; double t530 = exp(x443); double t67 = t60*t530+t57*x452+t58*x460; double t537 = exp(x450); double t70 = t57*x459+t58*x467+t60*x474+t61*x480+t62*x485+t63*x489+t64*x492+t68*x494+t69*x495+t537*(data10-x65); double t535 = exp(x448); double t71 = t68*t535+t57*x457+t58*x465+t60*x472+t61*x478+t62*x483+t63*x487+t64*x490; double t533 = exp(x446); double t72 = t63*t533+t57*x455+t58*x463+t60*x470+t61*x476+t62*x481; double t531 = exp(x444); double t73 = t61*t531+t57*x453+t58*x461+t60*x468; double t75 = data1-x66; double t76 = data2-x67; double t538 = exp(x497); double t74 = t76*t538+t75*x506; double t78 = data3-x68; double t79 = data4-x69; double t80 = data5-x70; double t81 = data6-x71; double t82 = data7-x72; double t86 = data8-x73; double t87 = data9-x74; double t545 = exp(x504); double t77 = t87*t545+t75*x513+t76*x521+t78*x528+t79*x534+t80*x539+t81*x543+t82*x546+t86*x548; double t543 = exp(x502); double t83 = t82*t543+t75*x511+t76*x519+t78*x526+t79*x532+t80*x537+t81*x541; double t541 = exp(x500); double t84 = t80*t541+t75*x509+t76*x517+t78*x524+t79*x530; double t539 = exp(x498); double t85 = t78*t539+t75*x507+t76*x515; double t546 = exp(x505); double t88 = t75*x514+t76*x522+t78*x529+t79*x535+t80*x540+t81*x544+t82*x547+t86*x549+t87*x550+t546*(data10-x75); double t544 = exp(x503); double t89 = t86*t544+t75*x512+t76*x520+t78*x527+t79*x533+t80*x538+t81*x542+t82*x545; double t542 = exp(x501); double t90 = t81*t542+t75*x510+t76*x518+t78*x525+t79*x531+t80*x536; double t540 = exp(x499); double t91 = t79*t540+t75*x508+t76*x516+t78*x523; double t93 = data1-x76; double t94 = data2-x77; double t547 = exp(x552); double t92 = t94*t547+t93*x561; double t96 = data3-x78; double t97 = data4-x79; double t98 = data5-x80; double t99 = data6-x81; double t100 = data7-x82; double t104 = data8-x83; double t105 = data9-x84; double t554 = exp(x559); double t95 = t105*t554+t93*x568+t94*x576+t96*x583+t97*x589+t98*x594+t99*x598+t100*x601+t104*x603; double t552 = exp(x557); double t101 = t100*t552+t93*x566+t94*x574+t96*x581+t97*x587+t98*x592+t99*x596; double t550 = exp(x555); double t102 = t98*t550+t93*x564+t94*x572+t96*x579+t97*x585; double t548 = exp(x553); double t103 = t96*t548+t93*x562+t94*x570; double t555 = exp(x560); double t106 = t93*x569+t94*x577+t96*x584+t97*x590+t98*x595+t99*x599+t100*x602+t104*x604+t105*x605+t555*(data10-x85); double t553 = exp(x558); double t107 = t104*t553+t93*x567+t94*x575+t96*x582+t97*x588+t98*x593+t99*x597+t100*x600; double t551 = exp(x556); double t108 = t99*t551+t93*x565+t94*x573+t96*x580+t97*x586+t98*x591; double t549 = exp(x554); double t109 = t97*t549+t93*x563+t94*x571+t96*x578; double t111 = data1-x86; double t112 = data2-x87; double t556 = exp(x607); double t110 = t112*t556+t111*x616; double t114 = data3-x88; double t115 = data4-x89; double t116 = data5-x90; double t117 = data6-x91; double t118 = data7-x92; double t122 = data8-x93; double t123 = data9-x94; double t563 = exp(x614); double t113 = t123*t563+t111*x623+t112*x631+t114*x638+t115*x644+t116*x649+t117*x653+t118*x656+t122*x658; double t561 = exp(x612); double t119 = t118*t561+t111*x621+t112*x629+t114*x636+t115*x642+t116*x647+t117*x651; double t559 = exp(x610); double t120 = t116*t559+t111*x619+t112*x627+t114*x634+t115*x640; double t557 = exp(x608); double t121 = t114*t557+t111*x617+t112*x625; double t564 = exp(x615); double t124 = t111*x624+t112*x632+t114*x639+t115*x645+t116*x650+t117*x654+t118*x657+t122*x659+t123*x660+t564*(data10-x95); double t562 = exp(x613); double t125 = t122*t562+t111*x622+t112*x630+t114*x637+t115*x643+t116*x648+t117*x652+t118*x655; double t560 = exp(x611); double t126 = t117*t560+t111*x620+t112*x628+t114*x635+t115*x641+t116*x646; double t558 = exp(x609); double t127 = t115*t558+t111*x618+t112*x626+t114*x633; double t129 = data1-x96; double t130 = data2-x97; double t565 = exp(x662); double t128 = t130*t565+t129*x671; double t132 = data3-x98; double t133 = data4-x99; double t134 = data5-x100; double t135 = data6-x101; double t136 = data7-x102; double t140 = data8-x103; double t141 = data9-x104; double t572 = exp(x669); double t131 = t141*t572+t129*x678+t130*x686+t132*x693+t133*x699+t134*x704+t135*x708+t136*x711+t140*x713; double t570 = exp(x667); double t137 = t136*t570+t129*x676+t130*x684+t132*x691+t133*x697+t134*x702+t135*x706; double t568 = exp(x665); double t138 = t134*t568+t129*x674+t130*x682+t132*x689+t133*x695; double t566 = exp(x663); double t139 = t132*t566+t129*x672+t130*x680; double t573 = exp(x670); double t142 = t129*x679+t130*x687+t132*x694+t133*x700+t134*x705+t135*x709+t136*x712+t140*x714+t141*x715+t573*(data10-x105); double t571 = exp(x668); double t143 = t140*t571+t129*x677+t130*x685+t132*x692+t133*x698+t134*x703+t135*x707+t136*x710; double t569 = exp(x666); double t144 = t135*t569+t129*x675+t130*x683+t132*x690+t133*x696+t134*x701; double t567 = exp(x664); double t145 = t133*t567+t129*x673+t130*x681+t132*x688; double t147 = data1-x106; double t148 = data2-x107; double t574 = exp(x717); double t146 = t148*t574+t147*x726; double t150 = data3-x108; double t151 = data4-x109; double t152 = data5-x110; double t153 = data6-x111; double t154 = data7-x112; double t158 = data8-x113; double t159 = data9-x114; double t581 = exp(x724); double t149 = t159*t581+t147*x733+t148*x741+t150*x748+t151*x754+t152*x759+t153*x763+t154*x766+t158*x768; double t579 = exp(x722); double t155 = t154*t579+t147*x731+t148*x739+t150*x746+t151*x752+t152*x757+t153*x761; double t577 = exp(x720); double t156 = t152*t577+t147*x729+t148*x737+t150*x744+t151*x750; double t575 = exp(x718); double t157 = t150*t575+t147*x727+t148*x735; double t582 = exp(x725); double t160 = t147*x734+t148*x742+t150*x749+t151*x755+t152*x760+t153*x764+t154*x767+t158*x769+t159*x770+t582*(data10-x115); double t580 = exp(x723); double t161 = t158*t580+t147*x732+t148*x740+t150*x747+t151*x753+t152*x758+t153*x762+t154*x765; double t578 = exp(x721); double t162 = t153*t578+t147*x730+t148*x738+t150*x745+t151*x751+t152*x756; double t576 = exp(x719); double t163 = t151*t576+t147*x728+t148*x736+t150*x743; double t165 = data1-x116; double t166 = data2-x117; double t583 = exp(x772); double t164 = t166*t583+t165*x781; double t168 = data3-x118; double t169 = data4-x119; double t170 = data5-x120; double t171 = data6-x121; double t172 = data7-x122; double t176 = data8-x123; double t177 = data9-x124; double t590 = exp(x779); double t167 = t177*t590+t165*x788+t166*x796+t168*x803+t169*x809+t170*x814+t171*x818+t172*x821+t176*x823; double t588 = exp(x777); double t173 = t172*t588+t165*x786+t166*x794+t168*x801+t169*x807+t170*x812+t171*x816; double t586 = exp(x775); double t174 = t170*t586+t165*x784+t166*x792+t168*x799+t169*x805; double t584 = exp(x773); double t175 = t168*t584+t165*x782+t166*x790; double t591 = exp(x780); double t178 = t165*x789+t166*x797+t168*x804+t169*x810+t170*x815+t171*x819+t172*x822+t176*x824+t177*x825+t591*(data10-x125); double t589 = exp(x778); double t179 = t176*t589+t165*x787+t166*x795+t168*x802+t169*x808+t170*x813+t171*x817+t172*x820; double t587 = exp(x776); double t180 = t171*t587+t165*x785+t166*x793+t168*x800+t169*x806+t170*x811; double t585 = exp(x774); double t181 = t169*t585+t165*x783+t166*x791+t168*x798; double t183 = data1-x126; double t184 = data2-x127; double t592 = exp(x827); double t182 = t184*t592+t183*x836; double t186 = data3-x128; double t187 = data4-x129; double t188 = data5-x130; double t189 = data6-x131; double t190 = data7-x132; double t194 = data8-x133; double t195 = data9-x134; double t599 = exp(x834); double t185 = t195*t599+t183*x843+t184*x851+t186*x858+t187*x864+t188*x869+t189*x873+t190*x876+t194*x878; double t597 = exp(x832); double t191 = t190*t597+t183*x841+t184*x849+t186*x856+t187*x862+t188*x867+t189*x871; double t595 = exp(x830); double t192 = t188*t595+t183*x839+t184*x847+t186*x854+t187*x860; double t593 = exp(x828); double t193 = t186*t593+t183*x837+t184*x845; double t600 = exp(x835); double t196 = t183*x844+t184*x852+t186*x859+t187*x865+t188*x870+t189*x874+t190*x877+t194*x879+t195*x880+t600*(data10-x135); double t598 = exp(x833); double t197 = t194*t598+t183*x842+t184*x850+t186*x857+t187*x863+t188*x868+t189*x872+t190*x875; double t596 = exp(x831); double t198 = t189*t596+t183*x840+t184*x848+t186*x855+t187*x861+t188*x866; double t594 = exp(x829); double t199 = t187*t594+t183*x838+t184*x846+t186*x853; double t201 = data1-x136; double t202 = data2-x137; double t601 = exp(x882); double t200 = t202*t601+t201*x891; double t204 = data3-x138; double t205 = data4-x139; double t206 = data5-x140; double t207 = data6-x141; double t208 = data7-x142; double t212 = data8-x143; double t213 = data9-x144; double t608 = exp(x889); double t203 = t213*t608+t201*x898+t202*x906+t204*x913+t205*x919+t206*x924+t207*x928+t208*x931+t212*x933; double t606 = exp(x887); double t209 = t208*t606+t201*x896+t202*x904+t204*x911+t205*x917+t206*x922+t207*x926; double t604 = exp(x885); double t210 = t206*t604+t201*x894+t202*x902+t204*x909+t205*x915; double t602 = exp(x883); double t211 = t204*t602+t201*x892+t202*x900; double t609 = exp(x890); double t214 = t201*x899+t202*x907+t204*x914+t205*x920+t206*x925+t207*x929+t208*x932+t212*x934+t213*x935+t609*(data10-x145); double t607 = exp(x888); double t215 = t212*t607+t201*x897+t202*x905+t204*x912+t205*x918+t206*x923+t207*x927+t208*x930; double t605 = exp(x886); double t216 = t207*t605+t201*x895+t202*x903+t204*x910+t205*x916+t206*x921; double t603 = exp(x884); double t217 = t205*t603+t201*x893+t202*x901+t204*x908; double t219 = data1-x146; double t220 = data2-x147; double t610 = exp(x937); double t218 = t220*t610+t219*x946; double t222 = data3-x148; double t223 = data4-x149; double t224 = data5-x150; double t225 = data6-x151; double t226 = data7-x152; double t230 = data8-x153; double t231 = data9-x154; double t617 = exp(x944); double t221 = t231*t617+t219*x953+t220*x961+t222*x968+t223*x974+t224*x979+t225*x983+t226*x986+t230*x988; double t615 = exp(x942); double t227 = t226*t615+t219*x951+t220*x959+t222*x966+t223*x972+t224*x977+t225*x981; double t613 = exp(x940); double t228 = t224*t613+t219*x949+t220*x957+t222*x964+t223*x970; double t611 = exp(x938); double t229 = t222*t611+t219*x947+t220*x955; double t618 = exp(x945); double t232 = t219*x954+t220*x962+t222*x969+t223*x975+t224*x980+t225*x984+t226*x987+t230*x989+t231*x990+t618*(data10-x155); double t616 = exp(x943); double t233 = t230*t616+t219*x952+t220*x960+t222*x967+t223*x973+t224*x978+t225*x982+t226*x985; double t614 = exp(x941); double t234 = t225*t614+t219*x950+t220*x958+t222*x965+t223*x971+t224*x976; double t612 = exp(x939); double t235 = t223*t612+t219*x948+t220*x956+t222*x963; double t237 = data1-x156; double t238 = data2-x157; double t619 = exp(x992); double t236 = t238*t619+t237*x1001; double t240 = data3-x158; double t241 = data4-x159; double t242 = data5-x160; double t243 = data6-x161; double t244 = data7-x162; double t248 = data8-x163; double t249 = data9-x164; double t626 = exp(x999); double t239 = t249*t626+t237*x1008+t238*x1016+t240*x1023+t241*x1029+t242*x1034+t243*x1038+t244*x1041+t248*x1043; double t624 = exp(x997); double t245 = t244*t624+t237*x1006+t238*x1014+t240*x1021+t241*x1027+t242*x1032+t243*x1036; double t622 = exp(x995); double t246 = t242*t622+t237*x1004+t238*x1012+t240*x1019+t241*x1025; double t620 = exp(x993); double t247 = t240*t620+t237*x1002+t238*x1010; double t627 = exp(x1000); double t250 = t237*x1009+t238*x1017+t240*x1024+t241*x1030+t242*x1035+t243*x1039+t244*x1042+t248*x1044+t249*x1045+t627*(data10-x165); double t625 = exp(x998); double t251 = t248*t625+t237*x1007+t238*x1015+t240*x1022+t241*x1028+t242*x1033+t243*x1037+t244*x1040; double t623 = exp(x996); double t252 = t243*t623+t237*x1005+t238*x1013+t240*x1020+t241*x1026+t242*x1031; double t621 = exp(x994); double t253 = t241*t621+t237*x1003+t238*x1011+t240*x1018; double t255 = data1-x166; double t256 = data2-x167; double t628 = exp(x1047); double t254 = t256*t628+t255*x1056; double t258 = data3-x168; double t259 = data4-x169; double t260 = data5-x170; double t261 = data6-x171; double t262 = data7-x172; double t266 = data8-x173; double t267 = data9-x174; double t635 = exp(x1054); double t257 = t267*t635+t255*x1063+t256*x1071+t258*x1078+t259*x1084+t260*x1089+t261*x1093+t262*x1096+t266*x1098; double t633 = exp(x1052); double t263 = t262*t633+t255*x1061+t256*x1069+t258*x1076+t259*x1082+t260*x1087+t261*x1091; double t631 = exp(x1050); double t264 = t260*t631+t255*x1059+t256*x1067+t258*x1074+t259*x1080; double t629 = exp(x1048); double t265 = t258*t629+t255*x1057+t256*x1065; double t636 = exp(x1055); double t268 = t255*x1064+t256*x1072+t258*x1079+t259*x1085+t260*x1090+t261*x1094+t262*x1097+t266*x1099+t267*x1100+t636*(data10-x175); double t634 = exp(x1053); double t269 = t266*t634+t255*x1062+t256*x1070+t258*x1077+t259*x1083+t260*x1088+t261*x1092+t262*x1095; double t632 = exp(x1051); double t270 = t261*t632+t255*x1060+t256*x1068+t258*x1075+t259*x1081+t260*x1086; double t630 = exp(x1049); double t271 = t259*t630+t255*x1058+t256*x1066+t258*x1073; double t273 = data1-x176; double t274 = data2-x177; double t637 = exp(x1102); double t272 = t274*t637+t273*x1111; double t276 = data3-x178; double t277 = data4-x179; double t278 = data5-x180; double t279 = data6-x181; double t280 = data7-x182; double t284 = data8-x183; double t285 = data9-x184; double t644 = exp(x1109); double t275 = t285*t644+t273*x1118+t274*x1126+t276*x1133+t277*x1139+t278*x1144+t279*x1148+t280*x1151+t284*x1153; double t642 = exp(x1107); double t281 = t280*t642+t273*x1116+t274*x1124+t276*x1131+t277*x1137+t278*x1142+t279*x1146; double t640 = exp(x1105); double t282 = t278*t640+t273*x1114+t274*x1122+t276*x1129+t277*x1135; double t638 = exp(x1103); double t283 = t276*t638+t273*x1112+t274*x1120; double t645 = exp(x1110); double t286 = t273*x1119+t274*x1127+t276*x1134+t277*x1140+t278*x1145+t279*x1149+t280*x1152+t284*x1154+t285*x1155+t645*(data10-x185); double t643 = exp(x1108); double t287 = t284*t643+t273*x1117+t274*x1125+t276*x1132+t277*x1138+t278*x1143+t279*x1147+t280*x1150; double t641 = exp(x1106); double t288 = t279*t641+t273*x1115+t274*x1123+t276*x1130+t277*x1136+t278*x1141; double t639 = exp(x1104); double t289 = t277*t639+t273*x1113+t274*x1121+t276*x1128; double t291 = data1-x186; double t292 = data2-x187; double t646 = exp(x1157); double t290 = t292*t646+t291*x1166; double t294 = data3-x188; double t295 = data4-x189; double t296 = data5-x190; double t297 = data6-x191; double t298 = data7-x192; double t302 = data8-x193; double t303 = data9-x194; double t653 = exp(x1164); double t293 = t303*t653+t291*x1173+t292*x1181+t294*x1188+t295*x1194+t296*x1199+t297*x1203+t298*x1206+t302*x1208; double t651 = exp(x1162); double t299 = t298*t651+t291*x1171+t292*x1179+t294*x1186+t295*x1192+t296*x1197+t297*x1201; double t649 = exp(x1160); double t300 = t296*t649+t291*x1169+t292*x1177+t294*x1184+t295*x1190; double t647 = exp(x1158); double t301 = t294*t647+t291*x1167+t292*x1175; double t654 = exp(x1165); double t304 = t291*x1174+t292*x1182+t294*x1189+t295*x1195+t296*x1200+t297*x1204+t298*x1207+t302*x1209+t303*x1210+t654*(data10-x195); double t652 = exp(x1163); double t305 = t302*t652+t291*x1172+t292*x1180+t294*x1187+t295*x1193+t296*x1198+t297*x1202+t298*x1205; double t650 = exp(x1161); double t306 = t297*t650+t291*x1170+t292*x1178+t294*x1185+t295*x1191+t296*x1196; double t648 = exp(x1159); double t307 = t295*t648+t291*x1168+t292*x1176+t294*x1183; double t309 = data1-x196; double t310 = data2-x197; double t655 = exp(x1212); double t308 = t310*t655+t309*x1221; double t312 = data3-x198; double t313 = data4-x199; double t314 = data5-x200; double t315 = data6-x201; double t316 = data7-x202; double t320 = data8-x203; double t321 = data9-x204; double t662 = exp(x1219); double t311 = t321*t662+t309*x1228+t310*x1236+t312*x1243+t313*x1249+t314*x1254+t315*x1258+t316*x1261+t320*x1263; double t660 = exp(x1217); double t317 = t316*t660+t309*x1226+t310*x1234+t312*x1241+t313*x1247+t314*x1252+t315*x1256; double t658 = exp(x1215); double t318 = t314*t658+t309*x1224+t310*x1232+t312*x1239+t313*x1245; double t656 = exp(x1213); double t319 = t312*t656+t309*x1222+t310*x1230; double t663 = exp(x1220); double t322 = t309*x1229+t310*x1237+t312*x1244+t313*x1250+t314*x1255+t315*x1259+t316*x1262+t320*x1264+t321*x1265+t663*(data10-x205); double t661 = exp(x1218); double t323 = t320*t661+t309*x1227+t310*x1235+t312*x1242+t313*x1248+t314*x1253+t315*x1257+t316*x1260; double t659 = exp(x1216); double t324 = t315*t659+t309*x1225+t310*x1233+t312*x1240+t313*x1246+t314*x1251; double t657 = exp(x1214); double t325 = t313*t657+t309*x1223+t310*x1231+t312*x1238; double t327 = data1-x206; double t328 = data2-x207; double t664 = exp(x1267); double t326 = t328*t664+t327*x1276; double t330 = data3-x208; double t331 = data4-x209; double t332 = data5-x210; double t333 = data6-x211; double t334 = data7-x212; double t338 = data8-x213; double t339 = data9-x214; double t671 = exp(x1274); double t329 = t339*t671+t327*x1283+t328*x1291+t330*x1298+t331*x1304+t332*x1309+t333*x1313+t334*x1316+t338*x1318; double t669 = exp(x1272); double t335 = t334*t669+t327*x1281+t328*x1289+t330*x1296+t331*x1302+t332*x1307+t333*x1311; double t667 = exp(x1270); double t336 = t332*t667+t327*x1279+t328*x1287+t330*x1294+t331*x1300; double t665 = exp(x1268); double t337 = t330*t665+t327*x1277+t328*x1285; double t672 = exp(x1275); double t340 = t327*x1284+t328*x1292+t330*x1299+t331*x1305+t332*x1310+t333*x1314+t334*x1317+t338*x1319+t339*x1320+t672*(data10-x215); double t670 = exp(x1273); double t341 = t338*t670+t327*x1282+t328*x1290+t330*x1297+t331*x1303+t332*x1308+t333*x1312+t334*x1315; double t668 = exp(x1271); double t342 = t333*t668+t327*x1280+t328*x1288+t330*x1295+t331*x1301+t332*x1306; double t666 = exp(x1269); double t343 = t331*t666+t327*x1278+t328*x1286+t330*x1293; double t345 = data1-x216; double t346 = data2-x217; double t673 = exp(x1322); double t344 = t346*t673+t345*x1331; double t348 = data3-x218; double t349 = data4-x219; double t350 = data5-x220; double t351 = data6-x221; double t352 = data7-x222; double t356 = data8-x223; double t357 = data9-x224; double t680 = exp(x1329); double t347 = t357*t680+t345*x1338+t346*x1346+t348*x1353+t349*x1359+t350*x1364+t351*x1368+t352*x1371+t356*x1373; double t678 = exp(x1327); double t353 = t352*t678+t345*x1336+t346*x1344+t348*x1351+t349*x1357+t350*x1362+t351*x1366; double t676 = exp(x1325); double t354 = t350*t676+t345*x1334+t346*x1342+t348*x1349+t349*x1355; double t674 = exp(x1323); double t355 = t348*t674+t345*x1332+t346*x1340; double t681 = exp(x1330); double t358 = t345*x1339+t346*x1347+t348*x1354+t349*x1360+t350*x1365+t351*x1369+t352*x1372+t356*x1374+t357*x1375+t681*(data10-x225); double t679 = exp(x1328); double t359 = t356*t679+t345*x1337+t346*x1345+t348*x1352+t349*x1358+t350*x1363+t351*x1367+t352*x1370; double t677 = exp(x1326); double t360 = t351*t677+t345*x1335+t346*x1343+t348*x1350+t349*x1356+t350*x1361; double t675 = exp(x1324); double t361 = t349*t675+t345*x1333+t346*x1341+t348*x1348; double t363 = data1-x226; double t364 = data2-x227; double t682 = exp(x1377); double t362 = t364*t682+t363*x1386; double t366 = data3-x228; double t367 = data4-x229; double t368 = data5-x230; double t369 = data6-x231; double t370 = data7-x232; double t374 = data8-x233; double t375 = data9-x234; double t689 = exp(x1384); double t365 = t375*t689+t363*x1393+t364*x1401+t366*x1408+t367*x1414+t368*x1419+t369*x1423+t370*x1426+t374*x1428; double t687 = exp(x1382); double t371 = t370*t687+t363*x1391+t364*x1399+t366*x1406+t367*x1412+t368*x1417+t369*x1421; double t685 = exp(x1380); double t372 = t368*t685+t363*x1389+t364*x1397+t366*x1404+t367*x1410; double t683 = exp(x1378); double t373 = t366*t683+t363*x1387+t364*x1395; double t690 = exp(x1385); double t376 = t363*x1394+t364*x1402+t366*x1409+t367*x1415+t368*x1420+t369*x1424+t370*x1427+t374*x1429+t375*x1430+t690*(data10-x235); double t688 = exp(x1383); double t377 = t374*t688+t363*x1392+t364*x1400+t366*x1407+t367*x1413+t368*x1418+t369*x1422+t370*x1425; double t686 = exp(x1381); double t378 = t369*t686+t363*x1390+t364*x1398+t366*x1405+t367*x1411+t368*x1416; double t684 = exp(x1379); double t379 = t367*t684+t363*x1388+t364*x1396+t366*x1403; double t381 = data1-x236; double t382 = data2-x237; double t691 = exp(x1432); double t380 = t382*t691+t381*x1441; double t384 = data3-x238; double t385 = data4-x239; double t386 = data5-x240; double t387 = data6-x241; double t388 = data7-x242; double t392 = data8-x243; double t393 = data9-x244; double t698 = exp(x1439); double t383 = t393*t698+t381*x1448+t382*x1456+t384*x1463+t385*x1469+t386*x1474+t387*x1478+t388*x1481+t392*x1483; double t696 = exp(x1437); double t389 = t388*t696+t381*x1446+t382*x1454+t384*x1461+t385*x1467+t386*x1472+t387*x1476; double t694 = exp(x1435); double t390 = t386*t694+t381*x1444+t382*x1452+t384*x1459+t385*x1465; double t692 = exp(x1433); double t391 = t384*t692+t381*x1442+t382*x1450; double t699 = exp(x1440); double t394 = t381*x1449+t382*x1457+t384*x1464+t385*x1470+t386*x1475+t387*x1479+t388*x1482+t392*x1484+t393*x1485+t699*(data10-x245); double t697 = exp(x1438); double t395 = t392*t697+t381*x1447+t382*x1455+t384*x1462+t385*x1468+t386*x1473+t387*x1477+t388*x1480; double t695 = exp(x1436); double t396 = t387*t695+t381*x1445+t382*x1453+t384*x1460+t385*x1466+t386*x1471; double t693 = exp(x1434); double t397 = t385*t693+t381*x1443+t382*x1451+t384*x1458; double t399 = data1-x246; double t400 = data2-x247; double t700 = exp(x1487); double t398 = t400*t700+t399*x1496; double t402 = data3-x248; double t403 = data4-x249; double t404 = data5-x250; double t405 = data6-x251; double t406 = data7-x252; double t410 = data8-x253; double t411 = data9-x254; double t707 = exp(x1494); double t401 = t411*t707+t399*x1503+t400*x1511+t402*x1518+t403*x1524+t404*x1529+t405*x1533+t406*x1536+t410*x1538; double t705 = exp(x1492); double t407 = t406*t705+t399*x1501+t400*x1509+t402*x1516+t403*x1522+t404*x1527+t405*x1531; double t703 = exp(x1490); double t408 = t404*t703+t399*x1499+t400*x1507+t402*x1514+t403*x1520; double t701 = exp(x1488); double t409 = t402*t701+t399*x1497+t400*x1505; double t708 = exp(x1495); double t412 = t399*x1504+t400*x1512+t402*x1519+t403*x1525+t404*x1530+t405*x1534+t406*x1537+t410*x1539+t411*x1540+t708*(data10-x255); double t706 = exp(x1493); double t413 = t410*t706+t399*x1502+t400*x1510+t402*x1517+t403*x1523+t404*x1528+t405*x1532+t406*x1535; double t704 = exp(x1491); double t414 = t405*t704+t399*x1500+t400*x1508+t402*x1515+t403*x1521+t404*x1526; double t702 = exp(x1489); double t415 = t403*t702+t399*x1498+t400*x1506+t402*x1513; double t417 = data1-x256; double t418 = data2-x257; double t709 = exp(x1542); double t416 = t418*t709+t417*x1551; double t420 = data3-x258; double t421 = data4-x259; double t422 = data5-x260; double t423 = data6-x261; double t424 = data7-x262; double t428 = data8-x263; double t429 = data9-x264; double t716 = exp(x1549); double t419 = t429*t716+t417*x1558+t418*x1566+t420*x1573+t421*x1579+t422*x1584+t423*x1588+t424*x1591+t428*x1593; double t714 = exp(x1547); double t425 = t424*t714+t417*x1556+t418*x1564+t420*x1571+t421*x1577+t422*x1582+t423*x1586; double t712 = exp(x1545); double t426 = t422*t712+t417*x1554+t418*x1562+t420*x1569+t421*x1575; double t710 = exp(x1543); double t427 = t420*t710+t417*x1552+t418*x1560; double t717 = exp(x1550); double t430 = t417*x1559+t418*x1567+t420*x1574+t421*x1580+t422*x1585+t423*x1589+t424*x1592+t428*x1594+t429*x1595+t717*(data10-x265); double t715 = exp(x1548); double t431 = t428*t715+t417*x1557+t418*x1565+t420*x1572+t421*x1578+t422*x1583+t423*x1587+t424*x1590; double t713 = exp(x1546); double t432 = t423*t713+t417*x1555+t418*x1563+t420*x1570+t421*x1576+t422*x1581; double t711 = exp(x1544); double t433 = t421*t711+t417*x1553+t418*x1561+t420*x1568; double t435 = data1-x266; double t436 = data2-x267; double t718 = exp(x1597); double t434 = t436*t718+t435*x1606; double t438 = data3-x268; double t439 = data4-x269; double t440 = data5-x270; double t441 = data6-x271; double t442 = data7-x272; double t446 = data8-x273; double t447 = data9-x274; double t725 = exp(x1604); double t437 = t447*t725+t435*x1613+t436*x1621+t438*x1628+t439*x1634+t440*x1639+t441*x1643+t442*x1646+t446*x1648; double t723 = exp(x1602); double t443 = t442*t723+t435*x1611+t436*x1619+t438*x1626+t439*x1632+t440*x1637+t441*x1641; double t721 = exp(x1600); double t444 = t440*t721+t435*x1609+t436*x1617+t438*x1624+t439*x1630; double t719 = exp(x1598); double t445 = t438*t719+t435*x1607+t436*x1615; double t726 = exp(x1605); double t448 = t435*x1614+t436*x1622+t438*x1629+t439*x1635+t440*x1640+t441*x1644+t442*x1647+t446*x1649+t447*x1650+t726*(data10-x275); double t724 = exp(x1603); double t449 = t446*t724+t435*x1612+t436*x1620+t438*x1627+t439*x1633+t440*x1638+t441*x1642+t442*x1645; double t722 = exp(x1601); double t450 = t441*t722+t435*x1610+t436*x1618+t438*x1625+t439*x1631+t440*x1636; double t720 = exp(x1599); double t451 = t439*t720+t435*x1608+t436*x1616+t438*x1623; double t452 = x276*2.0; double t453 = exp(t452); double t454 = x331*2.0; double t455 = exp(t454); double t456 = x386*2.0; double t457 = exp(t456); double t458 = x441*2.0; double t459 = exp(t458); double t460 = x496*2.0; double t461 = exp(t460); double t462 = x551*2.0; double t463 = exp(t462); double t464 = x606*2.0; double t465 = exp(t464); double t466 = x661*2.0; double t467 = exp(t466); double t468 = x716*2.0; double t469 = exp(t468); double t470 = x771*2.0; double t471 = exp(t470); double t472 = x826*2.0; double t473 = exp(t472); double t474 = x881*2.0; double t475 = exp(t474); double t476 = x936*2.0; double t477 = exp(t476); double t478 = x991*2.0; double t479 = exp(t478); double t480 = x1046*2.0; double t481 = exp(t480); double t482 = x1101*2.0; double t483 = exp(t482); double t484 = x1156*2.0; double t485 = exp(t484); double t486 = x1211*2.0; double t487 = exp(t486); double t488 = x1266*2.0; double t489 = exp(t488); double t490 = x1321*2.0; double t491 = exp(t490); double t492 = x1376*2.0; double t493 = exp(t492); double t494 = x1431*2.0; double t495 = exp(t494); double t496 = x1486*2.0; double t497 = exp(t496); double t498 = x1541*2.0; double t499 = exp(t498); double t500 = x1596*2.0; double t501 = exp(t500); out_ptr[0] = data11+log(exp(-data11+x1+x276+x277+x278+x279+x280+x281+x282+x283+x284+x285-(t3*t3)*t453*(1.0/2.0)-(t2*t2)*(1.0/2.0)-(t5*t5)*(1.0/2.0)-(t11*t11)*(1.0/2.0)-(t12*t12)*(1.0/2.0)-(t13*t13)*(1.0/2.0)-(t16*t16)*(1.0/2.0)-(t17*t17)*(1.0/2.0)-(t18*t18)*(1.0/2.0)-(t19*t19)*(1.0/2.0))+exp(-data11+x2+x331+x332+x333+x334+x335+x336+x337+x338+x339+x340-(t21*t21)*t455*(1.0/2.0)-(t20*t20)*(1.0/2.0)-(t23*t23)*(1.0/2.0)-(t29*t29)*(1.0/2.0)-(t30*t30)*(1.0/2.0)-(t31*t31)*(1.0/2.0)-(t34*t34)*(1.0/2.0)-(t35*t35)*(1.0/2.0)-(t36*t36)*(1.0/2.0)-(t37*t37)*(1.0/2.0))+exp(-data11+x3+x386+x387+x388+x389+x390+x391+x392+x393+x394+x395-(t39*t39)*t457*(1.0/2.0)-(t38*t38)*(1.0/2.0)-(t41*t41)*(1.0/2.0)-(t47*t47)*(1.0/2.0)-(t48*t48)*(1.0/2.0)-(t49*t49)*(1.0/2.0)-(t52*t52)*(1.0/2.0)-(t53*t53)*(1.0/2.0)-(t54*t54)*(1.0/2.0)-(t55*t55)*(1.0/2.0))+exp(-data11+x4+x441+x442+x443+x444+x445+x446+x447+x448+x449+x450-(t57*t57)*t459*(1.0/2.0)-(t56*t56)*(1.0/2.0)-(t59*t59)*(1.0/2.0)-(t65*t65)*(1.0/2.0)-(t66*t66)*(1.0/2.0)-(t67*t67)*(1.0/2.0)-(t70*t70)*(1.0/2.0)-(t71*t71)*(1.0/2.0)-(t72*t72)*(1.0/2.0)-(t73*t73)*(1.0/2.0))+exp(-data11+x5+x496+x497+x498+x499+x500+x501+x502+x503+x504+x505-(t75*t75)*t461*(1.0/2.0)-(t74*t74)*(1.0/2.0)-(t77*t77)*(1.0/2.0)-(t83*t83)*(1.0/2.0)-(t84*t84)*(1.0/2.0)-(t85*t85)*(1.0/2.0)-(t88*t88)*(1.0/2.0)-(t89*t89)*(1.0/2.0)-(t90*t90)*(1.0/2.0)-(t91*t91)*(1.0/2.0))+exp(-data11+x6+x551+x552+x553+x554+x555+x556+x557+x558+x559+x560-(t93*t93)*t463*(1.0/2.0)-(t92*t92)*(1.0/2.0)-(t95*t95)*(1.0/2.0)-(t101*t101)*(1.0/2.0)-(t102*t102)*(1.0/2.0)-(t103*t103)*(1.0/2.0)-(t106*t106)*(1.0/2.0)-(t107*t107)*(1.0/2.0)-(t108*t108)*(1.0/2.0)-(t109*t109)*(1.0/2.0))+exp(-data11+x7+x606+x607+x608+x609+x610+x611+x612+x613+x614+x615-(t111*t111)*t465*(1.0/2.0)-(t110*t110)*(1.0/2.0)-(t113*t113)*(1.0/2.0)-(t119*t119)*(1.0/2.0)-(t120*t120)*(1.0/2.0)-(t121*t121)*(1.0/2.0)-(t124*t124)*(1.0/2.0)-(t125*t125)*(1.0/2.0)-(t126*t126)*(1.0/2.0)-(t127*t127)*(1.0/2.0))+exp(-data11+x8+x661+x662+x663+x664+x665+x666+x667+x668+x669+x670-(t129*t129)*t467*(1.0/2.0)-(t128*t128)*(1.0/2.0)-(t131*t131)*(1.0/2.0)-(t137*t137)*(1.0/2.0)-(t138*t138)*(1.0/2.0)-(t139*t139)*(1.0/2.0)-(t142*t142)*(1.0/2.0)-(t143*t143)*(1.0/2.0)-(t144*t144)*(1.0/2.0)-(t145*t145)*(1.0/2.0))+exp(-data11+x9+x716+x717+x718+x719+x720+x721+x722+x723+x724+x725-(t147*t147)*t469*(1.0/2.0)-(t146*t146)*(1.0/2.0)-(t149*t149)*(1.0/2.0)-(t155*t155)*(1.0/2.0)-(t156*t156)*(1.0/2.0)-(t157*t157)*(1.0/2.0)-(t160*t160)*(1.0/2.0)-(t161*t161)*(1.0/2.0)-(t162*t162)*(1.0/2.0)-(t163*t163)*(1.0/2.0))+exp(-data11+x10+x771+x772+x773+x774+x775+x776+x777+x778+x779+x780-(t165*t165)*t471*(1.0/2.0)-(t164*t164)*(1.0/2.0)-(t167*t167)*(1.0/2.0)-(t173*t173)*(1.0/2.0)-(t174*t174)*(1.0/2.0)-(t175*t175)*(1.0/2.0)-(t178*t178)*(1.0/2.0)-(t179*t179)*(1.0/2.0)-(t180*t180)*(1.0/2.0)-(t181*t181)*(1.0/2.0))+exp(-data11+x11+x826+x827+x828+x829+x830+x831+x832+x833+x834+x835-(t183*t183)*t473*(1.0/2.0)-(t182*t182)*(1.0/2.0)-(t185*t185)*(1.0/2.0)-(t191*t191)*(1.0/2.0)-(t192*t192)*(1.0/2.0)-(t193*t193)*(1.0/2.0)-(t196*t196)*(1.0/2.0)-(t197*t197)*(1.0/2.0)-(t198*t198)*(1.0/2.0)-(t199*t199)*(1.0/2.0))+exp(-data11+x12+x881+x882+x883+x884+x885+x886+x887+x888+x889+x890-(t201*t201)*t475*(1.0/2.0)-(t200*t200)*(1.0/2.0)-(t203*t203)*(1.0/2.0)-(t209*t209)*(1.0/2.0)-(t210*t210)*(1.0/2.0)-(t211*t211)*(1.0/2.0)-(t214*t214)*(1.0/2.0)-(t215*t215)*(1.0/2.0)-(t216*t216)*(1.0/2.0)-(t217*t217)*(1.0/2.0))+exp(-data11+x13+x936+x937+x938+x939+x940+x941+x942+x943+x944+x945-(t219*t219)*t477*(1.0/2.0)-(t218*t218)*(1.0/2.0)-(t221*t221)*(1.0/2.0)-(t227*t227)*(1.0/2.0)-(t228*t228)*(1.0/2.0)-(t229*t229)*(1.0/2.0)-(t232*t232)*(1.0/2.0)-(t233*t233)*(1.0/2.0)-(t234*t234)*(1.0/2.0)-(t235*t235)*(1.0/2.0))+exp(-data11+x14+x991+x992+x993+x994+x995+x996+x997+x998+x999+x1000-(t237*t237)*t479*(1.0/2.0)-(t236*t236)*(1.0/2.0)-(t239*t239)*(1.0/2.0)-(t245*t245)*(1.0/2.0)-(t246*t246)*(1.0/2.0)-(t247*t247)*(1.0/2.0)-(t250*t250)*(1.0/2.0)-(t251*t251)*(1.0/2.0)-(t252*t252)*(1.0/2.0)-(t253*t253)*(1.0/2.0))+exp(-data11+x15+x1046+x1047+x1048+x1049+x1050+x1051+x1052+x1053+x1054+x1055-(t255*t255)*t481*(1.0/2.0)-(t254*t254)*(1.0/2.0)-(t257*t257)*(1.0/2.0)-(t263*t263)*(1.0/2.0)-(t264*t264)*(1.0/2.0)-(t265*t265)*(1.0/2.0)-(t268*t268)*(1.0/2.0)-(t269*t269)*(1.0/2.0)-(t270*t270)*(1.0/2.0)-(t271*t271)*(1.0/2.0))+exp(-data11+x16+x1101+x1102+x1103+x1104+x1105+x1106+x1107+x1108+x1109+x1110-(t273*t273)*t483*(1.0/2.0)-(t272*t272)*(1.0/2.0)-(t275*t275)*(1.0/2.0)-(t281*t281)*(1.0/2.0)-(t282*t282)*(1.0/2.0)-(t283*t283)*(1.0/2.0)-(t286*t286)*(1.0/2.0)-(t287*t287)*(1.0/2.0)-(t288*t288)*(1.0/2.0)-(t289*t289)*(1.0/2.0))+exp(-data11+x17+x1156+x1157+x1158+x1159+x1160+x1161+x1162+x1163+x1164+x1165-(t291*t291)*t485*(1.0/2.0)-(t290*t290)*(1.0/2.0)-(t293*t293)*(1.0/2.0)-(t299*t299)*(1.0/2.0)-(t300*t300)*(1.0/2.0)-(t301*t301)*(1.0/2.0)-(t304*t304)*(1.0/2.0)-(t305*t305)*(1.0/2.0)-(t306*t306)*(1.0/2.0)-(t307*t307)*(1.0/2.0))+exp(-data11+x18+x1211+x1212+x1213+x1214+x1215+x1216+x1217+x1218+x1219+x1220-(t309*t309)*t487*(1.0/2.0)-(t308*t308)*(1.0/2.0)-(t311*t311)*(1.0/2.0)-(t317*t317)*(1.0/2.0)-(t318*t318)*(1.0/2.0)-(t319*t319)*(1.0/2.0)-(t322*t322)*(1.0/2.0)-(t323*t323)*(1.0/2.0)-(t324*t324)*(1.0/2.0)-(t325*t325)*(1.0/2.0))+exp(-data11+x19+x1266+x1267+x1268+x1269+x1270+x1271+x1272+x1273+x1274+x1275-(t327*t327)*t489*(1.0/2.0)-(t326*t326)*(1.0/2.0)-(t329*t329)*(1.0/2.0)-(t335*t335)*(1.0/2.0)-(t336*t336)*(1.0/2.0)-(t337*t337)*(1.0/2.0)-(t340*t340)*(1.0/2.0)-(t341*t341)*(1.0/2.0)-(t342*t342)*(1.0/2.0)-(t343*t343)*(1.0/2.0))+exp(-data11+x20+x1321+x1322+x1323+x1324+x1325+x1326+x1327+x1328+x1329+x1330-(t345*t345)*t491*(1.0/2.0)-(t344*t344)*(1.0/2.0)-(t347*t347)*(1.0/2.0)-(t353*t353)*(1.0/2.0)-(t354*t354)*(1.0/2.0)-(t355*t355)*(1.0/2.0)-(t358*t358)*(1.0/2.0)-(t359*t359)*(1.0/2.0)-(t360*t360)*(1.0/2.0)-(t361*t361)*(1.0/2.0))+exp(-data11+x21+x1376+x1377+x1378+x1379+x1380+x1381+x1382+x1383+x1384+x1385-(t363*t363)*t493*(1.0/2.0)-(t362*t362)*(1.0/2.0)-(t365*t365)*(1.0/2.0)-(t371*t371)*(1.0/2.0)-(t372*t372)*(1.0/2.0)-(t373*t373)*(1.0/2.0)-(t376*t376)*(1.0/2.0)-(t377*t377)*(1.0/2.0)-(t378*t378)*(1.0/2.0)-(t379*t379)*(1.0/2.0))+exp(-data11+x22+x1431+x1432+x1433+x1434+x1435+x1436+x1437+x1438+x1439+x1440-(t381*t381)*t495*(1.0/2.0)-(t380*t380)*(1.0/2.0)-(t383*t383)*(1.0/2.0)-(t389*t389)*(1.0/2.0)-(t390*t390)*(1.0/2.0)-(t391*t391)*(1.0/2.0)-(t394*t394)*(1.0/2.0)-(t395*t395)*(1.0/2.0)-(t396*t396)*(1.0/2.0)-(t397*t397)*(1.0/2.0))+exp(-data11+x23+x1486+x1487+x1488+x1489+x1490+x1491+x1492+x1493+x1494+x1495-(t399*t399)*t497*(1.0/2.0)-(t398*t398)*(1.0/2.0)-(t401*t401)*(1.0/2.0)-(t407*t407)*(1.0/2.0)-(t408*t408)*(1.0/2.0)-(t409*t409)*(1.0/2.0)-(t412*t412)*(1.0/2.0)-(t413*t413)*(1.0/2.0)-(t414*t414)*(1.0/2.0)-(t415*t415)*(1.0/2.0))+exp(-data11+x24+x1541+x1542+x1543+x1544+x1545+x1546+x1547+x1548+x1549+x1550-(t417*t417)*t499*(1.0/2.0)-(t416*t416)*(1.0/2.0)-(t419*t419)*(1.0/2.0)-(t425*t425)*(1.0/2.0)-(t426*t426)*(1.0/2.0)-(t427*t427)*(1.0/2.0)-(t430*t430)*(1.0/2.0)-(t431*t431)*(1.0/2.0)-(t432*t432)*(1.0/2.0)-(t433*t433)*(1.0/2.0))+exp(-data11+x25+x1596+x1597+x1598+x1599+x1600+x1601+x1602+x1603+x1604+x1605-(t435*t435)*t501*(1.0/2.0)-(t434*t434)*(1.0/2.0)-(t437*t437)*(1.0/2.0)-(t443*t443)*(1.0/2.0)-(t444*t444)*(1.0/2.0)-(t445*t445)*(1.0/2.0)-(t448*t448)*(1.0/2.0)-(t449*t449)*(1.0/2.0)-(t450*t450)*(1.0/2.0)-(t451*t451)*(1.0/2.0)))-log(exp(x1)+exp(x2)+exp(x3)+exp(x4)+exp(x5)+exp(x6)+exp(x7)+exp(x8)+exp(x9)+exp(x10)+exp(x11)+exp(x12)+exp(x13)+exp(x14)+exp(x15)+exp(x16)+exp(x17)+exp(x18)+exp(x19)+exp(x20)+exp(x21)+exp(x22)+exp(x23)+exp(x24)+exp(x25))-data13*(t502+t503+t504+t505+t506+t507+t508+t509+t510+exp(x276))-data13*(t511+t512+t513+t514+t515+t516+t517+t518+t519+exp(x331))-data13*(t520+t521+t522+t523+t524+t525+t526+t527+t528+exp(x386))-data13*(t529+t530+t531+t532+t533+t534+t535+t536+t537+exp(x441))-data13*(t538+t539+t540+t541+t542+t543+t544+t545+t546+exp(x496))-data13*(t547+t548+t549+t550+t551+t552+t553+t554+t555+exp(x551))-data13*(t556+t557+t558+t559+t560+t561+t562+t563+t564+exp(x606))-data13*(t565+t566+t567+t568+t569+t570+t571+t572+t573+exp(x661))-data13*(t574+t575+t576+t577+t578+t579+t580+t581+t582+exp(x716))-data13*(t583+t584+t585+t586+t587+t588+t589+t590+t591+exp(x771))-data13*(t592+t593+t594+t595+t596+t597+t598+t599+t600+exp(x826))-data13*(t601+t602+t603+t604+t605+t606+t607+t608+t609+exp(x881))-data13*(t610+t611+t612+t613+t614+t615+t616+t617+t618+exp(x936))-data13*(t619+t620+t621+t622+t623+t624+t625+t626+t627+exp(x991))-data13*(t628+t629+t630+t631+t632+t633+t634+t635+t636+exp(x1046))-data13*(t637+t638+t639+t640+t641+t642+t643+t644+t645+exp(x1101))-data13*(t646+t647+t648+t649+t650+t651+t652+t653+t654+exp(x1156))-data13*(t655+t656+t657+t658+t659+t660+t661+t662+t663+exp(x1211))-data13*(t664+t665+t666+t667+t668+t669+t670+t671+t672+exp(x1266))-data13*(t673+t674+t675+t676+t677+t678+t679+t680+t681+exp(x1321))-data13*(t682+t683+t684+t685+t686+t687+t688+t689+t690+exp(x1376))-data13*(t691+t692+t693+t694+t695+t696+t697+t698+t699+exp(x1431))-data13*(t700+t701+t702+t703+t704+t705+t706+t707+t708+exp(x1486))-data13*(t709+t710+t711+t712+t713+t714+t715+t716+t717+exp(x1541))-data13*(t718+t719+t720+t721+t722+t723+t724+t725+t726+exp(x1596))+data12*(t453+exp(x277*2.0)+exp(x278*2.0)+exp(x279*2.0)+exp(x280*2.0)+exp(x281*2.0)+exp(x282*2.0)+exp(x283*2.0)+exp(x284*2.0)+exp(x285*2.0)+x286*x286+x287*x287+x288*x288+x289*x289+x290*x290+x291*x291+x292*x292+x293*x293+x294*x294+x295*x295+x296*x296+x297*x297+x298*x298+x299*x299+x300*x300+x301*x301+x302*x302+x303*x303+x304*x304+x305*x305+x306*x306+x307*x307+x308*x308+x309*x309+x310*x310+x311*x311+x312*x312+x313*x313+x314*x314+x315*x315+x316*x316+x317*x317+x318*x318+x319*x319+x320*x320+x321*x321+x322*x322+x323*x323+x324*x324+x325*x325+x326*x326+x327*x327+x328*x328+x329*x329+x330*x330)+data12*(t455+exp(x332*2.0)+exp(x333*2.0)+exp(x334*2.0)+exp(x335*2.0)+exp(x336*2.0)+exp(x337*2.0)+exp(x338*2.0)+exp(x339*2.0)+exp(x340*2.0)+x341*x341+x342*x342+x343*x343+x344*x344+x345*x345+x346*x346+x347*x347+x348*x348+x349*x349+x350*x350+x351*x351+x352*x352+x353*x353+x354*x354+x355*x355+x356*x356+x357*x357+x358*x358+x359*x359+x360*x360+x361*x361+x362*x362+x363*x363+x364*x364+x365*x365+x366*x366+x367*x367+x368*x368+x369*x369+x370*x370+x371*x371+x372*x372+x373*x373+x374*x374+x375*x375+x376*x376+x377*x377+x378*x378+x379*x379+x380*x380+x381*x381+x382*x382+x383*x383+x384*x384+x385*x385)+data12*(t457+exp(x387*2.0)+exp(x388*2.0)+exp(x389*2.0)+exp(x390*2.0)+exp(x391*2.0)+exp(x392*2.0)+exp(x393*2.0)+exp(x394*2.0)+exp(x395*2.0)+x396*x396+x397*x397+x398*x398+x399*x399+x400*x400+x401*x401+x402*x402+x403*x403+x404*x404+x405*x405+x406*x406+x407*x407+x408*x408+x409*x409+x410*x410+x411*x411+x412*x412+x413*x413+x414*x414+x415*x415+x416*x416+x417*x417+x418*x418+x419*x419+x420*x420+x421*x421+x422*x422+x423*x423+x424*x424+x425*x425+x426*x426+x427*x427+x428*x428+x429*x429+x430*x430+x431*x431+x432*x432+x433*x433+x434*x434+x435*x435+x436*x436+x437*x437+x438*x438+x439*x439+x440*x440)+data12*(t459+exp(x442*2.0)+exp(x443*2.0)+exp(x444*2.0)+exp(x445*2.0)+exp(x446*2.0)+exp(x447*2.0)+exp(x448*2.0)+exp(x449*2.0)+exp(x450*2.0)+x451*x451+x452*x452+x453*x453+x454*x454+x455*x455+x456*x456+x457*x457+x458*x458+x459*x459+x460*x460+x461*x461+x462*x462+x463*x463+x464*x464+x465*x465+x466*x466+x467*x467+x468*x468+x469*x469+x470*x470+x471*x471+x472*x472+x473*x473+x474*x474+x475*x475+x476*x476+x477*x477+x478*x478+x479*x479+x480*x480+x481*x481+x482*x482+x483*x483+x484*x484+x485*x485+x486*x486+x487*x487+x488*x488+x489*x489+x490*x490+x491*x491+x492*x492+x493*x493+x494*x494+x495*x495)+data12*(t461+exp(x497*2.0)+exp(x498*2.0)+exp(x499*2.0)+exp(x500*2.0)+exp(x501*2.0)+exp(x502*2.0)+exp(x503*2.0)+exp(x504*2.0)+exp(x505*2.0)+x506*x506+x507*x507+x508*x508+x509*x509+x510*x510+x511*x511+x512*x512+x513*x513+x514*x514+x515*x515+x516*x516+x517*x517+x518*x518+x519*x519+x520*x520+x521*x521+x522*x522+x523*x523+x524*x524+x525*x525+x526*x526+x527*x527+x528*x528+x529*x529+x530*x530+x531*x531+x532*x532+x533*x533+x534*x534+x535*x535+x536*x536+x537*x537+x538*x538+x539*x539+x540*x540+x541*x541+x542*x542+x543*x543+x544*x544+x545*x545+x546*x546+x547*x547+x548*x548+x549*x549+x550*x550)+data12*(t463+exp(x552*2.0)+exp(x553*2.0)+exp(x554*2.0)+exp(x555*2.0)+exp(x556*2.0)+exp(x557*2.0)+exp(x558*2.0)+exp(x559*2.0)+exp(x560*2.0)+x561*x561+x562*x562+x563*x563+x564*x564+x565*x565+x566*x566+x567*x567+x568*x568+x569*x569+x570*x570+x571*x571+x572*x572+x573*x573+x574*x574+x575*x575+x576*x576+x577*x577+x578*x578+x579*x579+x580*x580+x581*x581+x582*x582+x583*x583+x584*x584+x585*x585+x586*x586+x587*x587+x588*x588+x589*x589+x590*x590+x591*x591+x592*x592+x593*x593+x594*x594+x595*x595+x596*x596+x597*x597+x598*x598+x599*x599+x600*x600+x601*x601+x602*x602+x603*x603+x604*x604+x605*x605)+data12*(t465+exp(x607*2.0)+exp(x608*2.0)+exp(x609*2.0)+exp(x610*2.0)+exp(x611*2.0)+exp(x612*2.0)+exp(x613*2.0)+exp(x614*2.0)+exp(x615*2.0)+x616*x616+x617*x617+x618*x618+x619*x619+x620*x620+x621*x621+x622*x622+x623*x623+x624*x624+x625*x625+x626*x626+x627*x627+x628*x628+x629*x629+x630*x630+x631*x631+x632*x632+x633*x633+x634*x634+x635*x635+x636*x636+x637*x637+x638*x638+x639*x639+x640*x640+x641*x641+x642*x642+x643*x643+x644*x644+x645*x645+x646*x646+x647*x647+x648*x648+x649*x649+x650*x650+x651*x651+x652*x652+x653*x653+x654*x654+x655*x655+x656*x656+x657*x657+x658*x658+x659*x659+x660*x660)+data12*(t467+exp(x662*2.0)+exp(x663*2.0)+exp(x664*2.0)+exp(x665*2.0)+exp(x666*2.0)+exp(x667*2.0)+exp(x668*2.0)+exp(x669*2.0)+exp(x670*2.0)+x671*x671+x672*x672+x673*x673+x674*x674+x675*x675+x676*x676+x677*x677+x678*x678+x679*x679+x680*x680+x681*x681+x682*x682+x683*x683+x684*x684+x685*x685+x686*x686+x687*x687+x688*x688+x689*x689+x690*x690+x691*x691+x692*x692+x693*x693+x694*x694+x695*x695+x696*x696+x697*x697+x698*x698+x699*x699+x700*x700+x701*x701+x702*x702+x703*x703+x704*x704+x705*x705+x706*x706+x707*x707+x708*x708+x709*x709+x710*x710+x711*x711+x712*x712+x713*x713+x714*x714+x715*x715)+data12*(t469+exp(x717*2.0)+exp(x718*2.0)+exp(x719*2.0)+exp(x720*2.0)+exp(x721*2.0)+exp(x722*2.0)+exp(x723*2.0)+exp(x724*2.0)+exp(x725*2.0)+x726*x726+x727*x727+x728*x728+x729*x729+x730*x730+x731*x731+x732*x732+x733*x733+x734*x734+x735*x735+x736*x736+x737*x737+x738*x738+x739*x739+x740*x740+x741*x741+x742*x742+x743*x743+x744*x744+x745*x745+x746*x746+x747*x747+x748*x748+x749*x749+x750*x750+x751*x751+x752*x752+x753*x753+x754*x754+x755*x755+x756*x756+x757*x757+x758*x758+x759*x759+x760*x760+x761*x761+x762*x762+x763*x763+x764*x764+x765*x765+x766*x766+x767*x767+x768*x768+x769*x769+x770*x770)+data12*(t471+exp(x772*2.0)+exp(x773*2.0)+exp(x774*2.0)+exp(x775*2.0)+exp(x776*2.0)+exp(x777*2.0)+exp(x778*2.0)+exp(x779*2.0)+exp(x780*2.0)+x781*x781+x782*x782+x783*x783+x784*x784+x785*x785+x786*x786+x787*x787+x788*x788+x789*x789+x790*x790+x791*x791+x792*x792+x793*x793+x794*x794+x795*x795+x796*x796+x797*x797+x798*x798+x799*x799+x800*x800+x801*x801+x802*x802+x803*x803+x804*x804+x805*x805+x806*x806+x807*x807+x808*x808+x809*x809+x810*x810+x811*x811+x812*x812+x813*x813+x814*x814+x815*x815+x816*x816+x817*x817+x818*x818+x819*x819+x820*x820+x821*x821+x822*x822+x823*x823+x824*x824+x825*x825)+data12*(t473+exp(x827*2.0)+exp(x828*2.0)+exp(x829*2.0)+exp(x830*2.0)+exp(x831*2.0)+exp(x832*2.0)+exp(x833*2.0)+exp(x834*2.0)+exp(x835*2.0)+x836*x836+x837*x837+x838*x838+x839*x839+x840*x840+x841*x841+x842*x842+x843*x843+x844*x844+x845*x845+x846*x846+x847*x847+x848*x848+x849*x849+x850*x850+x851*x851+x852*x852+x853*x853+x854*x854+x855*x855+x856*x856+x857*x857+x858*x858+x859*x859+x860*x860+x861*x861+x862*x862+x863*x863+x864*x864+x865*x865+x866*x866+x867*x867+x868*x868+x869*x869+x870*x870+x871*x871+x872*x872+x873*x873+x874*x874+x875*x875+x876*x876+x877*x877+x878*x878+x879*x879+x880*x880)+data12*(t475+exp(x882*2.0)+exp(x883*2.0)+exp(x884*2.0)+exp(x885*2.0)+exp(x886*2.0)+exp(x887*2.0)+exp(x888*2.0)+exp(x889*2.0)+exp(x890*2.0)+x891*x891+x892*x892+x893*x893+x894*x894+x895*x895+x896*x896+x897*x897+x898*x898+x899*x899+x900*x900+x901*x901+x902*x902+x903*x903+x904*x904+x905*x905+x906*x906+x907*x907+x908*x908+x909*x909+x910*x910+x911*x911+x912*x912+x913*x913+x914*x914+x915*x915+x916*x916+x917*x917+x918*x918+x919*x919+x920*x920+x921*x921+x922*x922+x923*x923+x924*x924+x925*x925+x926*x926+x927*x927+x928*x928+x929*x929+x930*x930+x931*x931+x932*x932+x933*x933+x934*x934+x935*x935)+data12*(t477+exp(x937*2.0)+exp(x938*2.0)+exp(x939*2.0)+exp(x940*2.0)+exp(x941*2.0)+exp(x942*2.0)+exp(x943*2.0)+exp(x944*2.0)+exp(x945*2.0)+x946*x946+x947*x947+x948*x948+x949*x949+x950*x950+x951*x951+x952*x952+x953*x953+x954*x954+x955*x955+x956*x956+x957*x957+x958*x958+x959*x959+x960*x960+x961*x961+x962*x962+x963*x963+x964*x964+x965*x965+x966*x966+x967*x967+x968*x968+x969*x969+x970*x970+x971*x971+x972*x972+x973*x973+x974*x974+x975*x975+x976*x976+x977*x977+x978*x978+x979*x979+x980*x980+x981*x981+x982*x982+x983*x983+x984*x984+x985*x985+x986*x986+x987*x987+x988*x988+x989*x989+x990*x990)+data12*(t479+exp(x992*2.0)+exp(x993*2.0)+exp(x994*2.0)+exp(x995*2.0)+exp(x996*2.0)+exp(x997*2.0)+exp(x998*2.0)+exp(x999*2.0)+exp(x1000*2.0)+x1001*x1001+x1002*x1002+x1003*x1003+x1004*x1004+x1005*x1005+x1006*x1006+x1007*x1007+x1008*x1008+x1009*x1009+x1010*x1010+x1011*x1011+x1012*x1012+x1013*x1013+x1014*x1014+x1015*x1015+x1016*x1016+x1017*x1017+x1018*x1018+x1019*x1019+x1020*x1020+x1021*x1021+x1022*x1022+x1023*x1023+x1024*x1024+x1025*x1025+x1026*x1026+x1027*x1027+x1028*x1028+x1029*x1029+x1030*x1030+x1031*x1031+x1032*x1032+x1033*x1033+x1034*x1034+x1035*x1035+x1036*x1036+x1037*x1037+x1038*x1038+x1039*x1039+x1040*x1040+x1041*x1041+x1042*x1042+x1043*x1043+x1044*x1044+x1045*x1045)+data12*(t481+exp(x1047*2.0)+exp(x1048*2.0)+exp(x1049*2.0)+exp(x1050*2.0)+exp(x1051*2.0)+exp(x1052*2.0)+exp(x1053*2.0)+exp(x1054*2.0)+exp(x1055*2.0)+x1056*x1056+x1057*x1057+x1058*x1058+x1059*x1059+x1060*x1060+x1061*x1061+x1062*x1062+x1063*x1063+x1064*x1064+x1065*x1065+x1066*x1066+x1067*x1067+x1068*x1068+x1069*x1069+x1070*x1070+x1071*x1071+x1072*x1072+x1073*x1073+x1074*x1074+x1075*x1075+x1076*x1076+x1077*x1077+x1078*x1078+x1079*x1079+x1080*x1080+x1081*x1081+x1082*x1082+x1083*x1083+x1084*x1084+x1085*x1085+x1086*x1086+x1087*x1087+x1088*x1088+x1089*x1089+x1090*x1090+x1091*x1091+x1092*x1092+x1093*x1093+x1094*x1094+x1095*x1095+x1096*x1096+x1097*x1097+x1098*x1098+x1099*x1099+x1100*x1100)+data12*(t483+exp(x1102*2.0)+exp(x1103*2.0)+exp(x1104*2.0)+exp(x1105*2.0)+exp(x1106*2.0)+exp(x1107*2.0)+exp(x1108*2.0)+exp(x1109*2.0)+exp(x1110*2.0)+x1111*x1111+x1112*x1112+x1113*x1113+x1114*x1114+x1115*x1115+x1116*x1116+x1117*x1117+x1118*x1118+x1119*x1119+x1120*x1120+x1121*x1121+x1122*x1122+x1123*x1123+x1124*x1124+x1125*x1125+x1126*x1126+x1127*x1127+x1128*x1128+x1129*x1129+x1130*x1130+x1131*x1131+x1132*x1132+x1133*x1133+x1134*x1134+x1135*x1135+x1136*x1136+x1137*x1137+x1138*x1138+x1139*x1139+x1140*x1140+x1141*x1141+x1142*x1142+x1143*x1143+x1144*x1144+x1145*x1145+x1146*x1146+x1147*x1147+x1148*x1148+x1149*x1149+x1150*x1150+x1151*x1151+x1152*x1152+x1153*x1153+x1154*x1154+x1155*x1155)+data12*(t485+exp(x1157*2.0)+exp(x1158*2.0)+exp(x1159*2.0)+exp(x1160*2.0)+exp(x1161*2.0)+exp(x1162*2.0)+exp(x1163*2.0)+exp(x1164*2.0)+exp(x1165*2.0)+x1166*x1166+x1167*x1167+x1168*x1168+x1169*x1169+x1170*x1170+x1171*x1171+x1172*x1172+x1173*x1173+x1174*x1174+x1175*x1175+x1176*x1176+x1177*x1177+x1178*x1178+x1179*x1179+x1180*x1180+x1181*x1181+x1182*x1182+x1183*x1183+x1184*x1184+x1185*x1185+x1186*x1186+x1187*x1187+x1188*x1188+x1189*x1189+x1190*x1190+x1191*x1191+x1192*x1192+x1193*x1193+x1194*x1194+x1195*x1195+x1196*x1196+x1197*x1197+x1198*x1198+x1199*x1199+x1200*x1200+x1201*x1201+x1202*x1202+x1203*x1203+x1204*x1204+x1205*x1205+x1206*x1206+x1207*x1207+x1208*x1208+x1209*x1209+x1210*x1210)+data12*(t487+exp(x1212*2.0)+exp(x1213*2.0)+exp(x1214*2.0)+exp(x1215*2.0)+exp(x1216*2.0)+exp(x1217*2.0)+exp(x1218*2.0)+exp(x1219*2.0)+exp(x1220*2.0)+x1221*x1221+x1222*x1222+x1223*x1223+x1224*x1224+x1225*x1225+x1226*x1226+x1227*x1227+x1228*x1228+x1229*x1229+x1230*x1230+x1231*x1231+x1232*x1232+x1233*x1233+x1234*x1234+x1235*x1235+x1236*x1236+x1237*x1237+x1238*x1238+x1239*x1239+x1240*x1240+x1241*x1241+x1242*x1242+x1243*x1243+x1244*x1244+x1245*x1245+x1246*x1246+x1247*x1247+x1248*x1248+x1249*x1249+x1250*x1250+x1251*x1251+x1252*x1252+x1253*x1253+x1254*x1254+x1255*x1255+x1256*x1256+x1257*x1257+x1258*x1258+x1259*x1259+x1260*x1260+x1261*x1261+x1262*x1262+x1263*x1263+x1264*x1264+x1265*x1265)+data12*(t489+exp(x1267*2.0)+exp(x1268*2.0)+exp(x1269*2.0)+exp(x1270*2.0)+exp(x1271*2.0)+exp(x1272*2.0)+exp(x1273*2.0)+exp(x1274*2.0)+exp(x1275*2.0)+x1276*x1276+x1277*x1277+x1278*x1278+x1279*x1279+x1280*x1280+x1281*x1281+x1282*x1282+x1283*x1283+x1284*x1284+x1285*x1285+x1286*x1286+x1287*x1287+x1288*x1288+x1289*x1289+x1290*x1290+x1291*x1291+x1292*x1292+x1293*x1293+x1294*x1294+x1295*x1295+x1296*x1296+x1297*x1297+x1298*x1298+x1299*x1299+x1300*x1300+x1301*x1301+x1302*x1302+x1303*x1303+x1304*x1304+x1305*x1305+x1306*x1306+x1307*x1307+x1308*x1308+x1309*x1309+x1310*x1310+x1311*x1311+x1312*x1312+x1313*x1313+x1314*x1314+x1315*x1315+x1316*x1316+x1317*x1317+x1318*x1318+x1319*x1319+x1320*x1320)+data12*(t491+exp(x1322*2.0)+exp(x1323*2.0)+exp(x1324*2.0)+exp(x1325*2.0)+exp(x1326*2.0)+exp(x1327*2.0)+exp(x1328*2.0)+exp(x1329*2.0)+exp(x1330*2.0)+x1331*x1331+x1332*x1332+x1333*x1333+x1334*x1334+x1335*x1335+x1336*x1336+x1337*x1337+x1338*x1338+x1339*x1339+x1340*x1340+x1341*x1341+x1342*x1342+x1343*x1343+x1344*x1344+x1345*x1345+x1346*x1346+x1347*x1347+x1348*x1348+x1349*x1349+x1350*x1350+x1351*x1351+x1352*x1352+x1353*x1353+x1354*x1354+x1355*x1355+x1356*x1356+x1357*x1357+x1358*x1358+x1359*x1359+x1360*x1360+x1361*x1361+x1362*x1362+x1363*x1363+x1364*x1364+x1365*x1365+x1366*x1366+x1367*x1367+x1368*x1368+x1369*x1369+x1370*x1370+x1371*x1371+x1372*x1372+x1373*x1373+x1374*x1374+x1375*x1375)+data12*(t493+exp(x1377*2.0)+exp(x1378*2.0)+exp(x1379*2.0)+exp(x1380*2.0)+exp(x1381*2.0)+exp(x1382*2.0)+exp(x1383*2.0)+exp(x1384*2.0)+exp(x1385*2.0)+x1386*x1386+x1387*x1387+x1388*x1388+x1389*x1389+x1390*x1390+x1391*x1391+x1392*x1392+x1393*x1393+x1394*x1394+x1395*x1395+x1396*x1396+x1397*x1397+x1398*x1398+x1399*x1399+x1400*x1400+x1401*x1401+x1402*x1402+x1403*x1403+x1404*x1404+x1405*x1405+x1406*x1406+x1407*x1407+x1408*x1408+x1409*x1409+x1410*x1410+x1411*x1411+x1412*x1412+x1413*x1413+x1414*x1414+x1415*x1415+x1416*x1416+x1417*x1417+x1418*x1418+x1419*x1419+x1420*x1420+x1421*x1421+x1422*x1422+x1423*x1423+x1424*x1424+x1425*x1425+x1426*x1426+x1427*x1427+x1428*x1428+x1429*x1429+x1430*x1430)+data12*(t495+exp(x1432*2.0)+exp(x1433*2.0)+exp(x1434*2.0)+exp(x1435*2.0)+exp(x1436*2.0)+exp(x1437*2.0)+exp(x1438*2.0)+exp(x1439*2.0)+exp(x1440*2.0)+x1441*x1441+x1442*x1442+x1443*x1443+x1444*x1444+x1445*x1445+x1446*x1446+x1447*x1447+x1448*x1448+x1449*x1449+x1450*x1450+x1451*x1451+x1452*x1452+x1453*x1453+x1454*x1454+x1455*x1455+x1456*x1456+x1457*x1457+x1458*x1458+x1459*x1459+x1460*x1460+x1461*x1461+x1462*x1462+x1463*x1463+x1464*x1464+x1465*x1465+x1466*x1466+x1467*x1467+x1468*x1468+x1469*x1469+x1470*x1470+x1471*x1471+x1472*x1472+x1473*x1473+x1474*x1474+x1475*x1475+x1476*x1476+x1477*x1477+x1478*x1478+x1479*x1479+x1480*x1480+x1481*x1481+x1482*x1482+x1483*x1483+x1484*x1484+x1485*x1485)+data12*(t497+exp(x1487*2.0)+exp(x1488*2.0)+exp(x1489*2.0)+exp(x1490*2.0)+exp(x1491*2.0)+exp(x1492*2.0)+exp(x1493*2.0)+exp(x1494*2.0)+exp(x1495*2.0)+x1496*x1496+x1497*x1497+x1498*x1498+x1499*x1499+x1500*x1500+x1501*x1501+x1502*x1502+x1503*x1503+x1504*x1504+x1505*x1505+x1506*x1506+x1507*x1507+x1508*x1508+x1509*x1509+x1510*x1510+x1511*x1511+x1512*x1512+x1513*x1513+x1514*x1514+x1515*x1515+x1516*x1516+x1517*x1517+x1518*x1518+x1519*x1519+x1520*x1520+x1521*x1521+x1522*x1522+x1523*x1523+x1524*x1524+x1525*x1525+x1526*x1526+x1527*x1527+x1528*x1528+x1529*x1529+x1530*x1530+x1531*x1531+x1532*x1532+x1533*x1533+x1534*x1534+x1535*x1535+x1536*x1536+x1537*x1537+x1538*x1538+x1539*x1539+x1540*x1540)+data12*(t499+exp(x1542*2.0)+exp(x1543*2.0)+exp(x1544*2.0)+exp(x1545*2.0)+exp(x1546*2.0)+exp(x1547*2.0)+exp(x1548*2.0)+exp(x1549*2.0)+exp(x1550*2.0)+x1551*x1551+x1552*x1552+x1553*x1553+x1554*x1554+x1555*x1555+x1556*x1556+x1557*x1557+x1558*x1558+x1559*x1559+x1560*x1560+x1561*x1561+x1562*x1562+x1563*x1563+x1564*x1564+x1565*x1565+x1566*x1566+x1567*x1567+x1568*x1568+x1569*x1569+x1570*x1570+x1571*x1571+x1572*x1572+x1573*x1573+x1574*x1574+x1575*x1575+x1576*x1576+x1577*x1577+x1578*x1578+x1579*x1579+x1580*x1580+x1581*x1581+x1582*x1582+x1583*x1583+x1584*x1584+x1585*x1585+x1586*x1586+x1587*x1587+x1588*x1588+x1589*x1589+x1590*x1590+x1591*x1591+x1592*x1592+x1593*x1593+x1594*x1594+x1595*x1595)+data12*(t501+exp(x1597*2.0)+exp(x1598*2.0)+exp(x1599*2.0)+exp(x1600*2.0)+exp(x1601*2.0)+exp(x1602*2.0)+exp(x1603*2.0)+exp(x1604*2.0)+exp(x1605*2.0)+x1606*x1606+x1607*x1607+x1608*x1608+x1609*x1609+x1610*x1610+x1611*x1611+x1612*x1612+x1613*x1613+x1614*x1614+x1615*x1615+x1616*x1616+x1617*x1617+x1618*x1618+x1619*x1619+x1620*x1620+x1621*x1621+x1622*x1622+x1623*x1623+x1624*x1624+x1625*x1625+x1626*x1626+x1627*x1627+x1628*x1628+x1629*x1629+x1630*x1630+x1631*x1631+x1632*x1632+x1633*x1633+x1634*x1634+x1635*x1635+x1636*x1636+x1637*x1637+x1638*x1638+x1639*x1639+x1640*x1640+x1641*x1641+x1642*x1642+x1643*x1643+x1644*x1644+x1645*x1645+x1646*x1646+x1647*x1647+x1648*x1648+x1649*x1649+x1650*x1650); #line 48 "au_autodiff_generate_template.cpp" } } outs[0] = out; }
43.933603
25,081
0.669681
dsyme
35cd08b80a1bb8dc98393a6ba045867b13c82f21
20,924
cpp
C++
ZF/ZFCore/zfsrc/ZFCore/ZFObjectDef/ZFObjectObserver.cpp
ZFFrameworkDist/ZFFramework
6b498e7b95ee6d6aaa28d8369eef8c2ff94daaf7
[ "MIT" ]
57
2016-06-12T11:05:55.000Z
2021-05-22T13:12:17.000Z
ZF/ZFCore/zfsrc/ZFCore/ZFObjectDef/ZFObjectObserver.cpp
ZFFrameworkDist/ZFFramework
6b498e7b95ee6d6aaa28d8369eef8c2ff94daaf7
[ "MIT" ]
null
null
null
ZF/ZFCore/zfsrc/ZFCore/ZFObjectDef/ZFObjectObserver.cpp
ZFFrameworkDist/ZFFramework
6b498e7b95ee6d6aaa28d8369eef8c2ff94daaf7
[ "MIT" ]
20
2016-05-26T04:47:37.000Z
2020-12-13T01:39:39.000Z
#include "ZFObjectCore.h" #include "ZFObjectImpl.h" #include "ZFCore/ZFSTLWrapper/zfstl_string.h" #include "ZFCore/ZFSTLWrapper/zfstl_map.h" #include "ZFCore/ZFSTLWrapper/zfstl_deque.h" ZF_NAMESPACE_GLOBAL_BEGIN // ============================================================ // ZFListenerData void ZFListenerData::objectInfoT(ZF_IN_OUT zfstring &ret) const { ret += ZFTOKEN_ZFObjectInfoLeft; zfstringAppend(ret, "ZFListenerData(%p)", this); const zfchar *eventName = ZFIdMapNameForId(this->eventId()); if(eventName != zfnull) { ret += ", event: "; ret += eventName; } if(this->sender() != zfnull) { ret += ", sender: "; ZFObjectInfoT(ret, this->sender()); } if(this->param0() != zfnull) { ret += ", param0: "; ZFObjectInfoT(ret, this->param0()); } if(this->param1() != zfnull) { ret += ", param1: "; ZFObjectInfoT(ret, this->param1()); } if(this->eventFiltered()) { ret += ", filtered: "; ret += ZFTOKEN_zfbool_zftrue; } ret += ZFTOKEN_ZFObjectInfoRight; } // ============================================================ // ZFObserverHolder types zfclassLikePOD _ZFP_ZFObserverData { public: zfidentity taskId; zfidentity eventId; ZFListener observer; ZFObject *userData; // no auto retain, manually retain or release ZFObject *owner; ZFLevel observerLevel; zfbool autoRemoveAfterActivate; _ZFP_ZFObserverData *pPrev; _ZFP_ZFObserverData *pNext; public: explicit _ZFP_ZFObserverData(ZF_IN zfidentity taskId, ZF_IN zfidentity eventId, ZF_IN const ZFListener &observer, ZF_IN ZFObject *userData, ZF_IN ZFObject *owner, ZF_IN ZFLevel observerLevel, ZF_IN zfbool autoRemoveAfterActivate) : taskId(taskId) , eventId(eventId) , observer(observer) , userData(userData) , owner(owner) , observerLevel(observerLevel) , autoRemoveAfterActivate(autoRemoveAfterActivate) , pPrev(zfnull) , pNext(zfnull) { } ~_ZFP_ZFObserverData(void) { zflockfree_zfRelease(this->userData); } private: _ZFP_ZFObserverData(ZF_IN const _ZFP_ZFObserverData &ref); _ZFP_ZFObserverData &operator = (ZF_IN const _ZFP_ZFObserverData &ref); }; zfclassPOD _ZFP_ZFObserverHolderAttachState { public: zfuint *flag; zft_zfuint flagBit; }; typedef zfstlmap<zfidentity, zfstldeque<_ZFP_ZFObserverHolderAttachState> > _ZFP_ZFObserverHolderAttachStateMapType; zfclassNotPOD _ZFP_ZFObserverHolderPrivate { public: zfuint refCount; zfstlmap<zfidentity, _ZFP_ZFObserverData *> observerMap; // <eventId, pList> zfstlmap<zfidentity, _ZFP_ZFObserverData *> observerTaskIdMap; // <taskId, p> zfstlmap<ZFObject *, zfstlmap<_ZFP_ZFObserverData *, zfidentity> > observerOwnerMap; // <owner, <p, eventId> > ZFIdentityGenerator taskIdGenerator; _ZFP_ZFObserverHolderAttachStateMapType attachMap; public: _ZFP_ZFObserverHolderPrivate(void) : refCount(1) , observerMap() , observerTaskIdMap() , observerOwnerMap() , taskIdGenerator() , attachMap() { } public: void attachMapAttach(ZF_IN zfidentity eventId) { _ZFP_ZFObserverHolderAttachStateMapType::iterator it = this->attachMap.find(eventId); if(it != this->attachMap.end()) { for(zfstlsize i = 0; i < it->second.size(); ++i) { _ZFP_ZFObserverHolderAttachState &state = it->second[i]; ZFBitSet(*state.flag, state.flagBit); } } } void attachMapDetach(ZF_IN zfidentity eventId) { _ZFP_ZFObserverHolderAttachStateMapType::iterator it = this->attachMap.find(eventId); if(it != this->attachMap.end()) { for(zfstlsize i = 0; i < it->second.size(); ++i) { _ZFP_ZFObserverHolderAttachState &state = it->second[i]; ZFBitUnset(*state.flag, state.flagBit); } } } void observerNotifyPrepare(ZF_IN_OUT zfstldeque<_ZFP_ZFObserverData *> &toNotify, ZF_IN_OUT _ZFP_ZFObserverData *&toDelete, ZF_IN zfidentity eventId, ZF_IN ZFObject *observerOwner) { zfstlmap<zfidentity, _ZFP_ZFObserverData *>::iterator it = this->observerMap.find(eventId); if(it != this->observerMap.end()) { _ZFP_ZFObserverData *p = it->second; do { toNotify.push_back(p); if(p->autoRemoveAfterActivate) { this->observerDetach(it, p); if(toDelete == zfnull) { toDelete = p; toDelete->pPrev = toDelete->pNext = zfnull; } else { p->pPrev = zfnull; p->pNext = toDelete; toDelete->pPrev = p; toDelete = p; } } p = p->pNext; } while(p != zfnull); if(it->second == zfnull) { this->observerMap.erase(it); this->attachMapDetach(eventId); if(observerOwner) { observerOwner->observerOnRemove(eventId); } } } } void observerDetach(ZF_IN_OUT _ZFP_ZFObserverData *p) { this->taskIdGenerator.idRelease(p->taskId); this->observerTaskIdMap.erase(p->taskId); if(p->owner != zfnull) { zfstlmap<ZFObject *, zfstlmap<_ZFP_ZFObserverData *, zfidentity> >::iterator itTmp = this->observerOwnerMap.find(p->owner); itTmp->second.erase(p); if(itTmp->second.empty()) { this->observerOwnerMap.erase(itTmp); } } } void observerDetach(ZF_IN_OUT zfstlmap<zfidentity, _ZFP_ZFObserverData *>::iterator &it, ZF_IN_OUT _ZFP_ZFObserverData *p) { this->observerDetach(p); if(it->second == p) { it->second = p->pNext; } if(p->pPrev != zfnull) { p->pPrev->pNext = p->pNext; } if(p->pNext != zfnull) { p->pNext->pPrev = p->pPrev; } } }; // ============================================================ // ZFObserverHolder ZFObserverHolder::ZFObserverHolder(void) { d = zfpoolNew(_ZFP_ZFObserverHolderPrivate); _observerOwner = zfnull; } ZFObserverHolder::ZFObserverHolder(ZF_IN ZFObserverHolder const &ref) { d = ref.d; ++(d->refCount); _observerOwner = ref._observerOwner; } ZFObserverHolder::~ZFObserverHolder(void) { zfpoolDelete(d); } ZFObserverHolder &ZFObserverHolder::operator = (ZF_IN ZFObserverHolder const &ref) { ++(ref.d->refCount); --(d->refCount); if(d->refCount == 0) { zfpoolDelete(d); } d = ref.d; this->_observerOwner = ref._observerOwner; return *this; } zfbool ZFObserverHolder::operator == (ZF_IN ZFObserverHolder const &ref) const { return (d == ref.d); } zfidentity ZFObserverHolder::observerAdd(ZF_IN zfidentity eventId, ZF_IN const ZFListener &observer, ZF_IN_OPT ZFObject *userData /* = zfnull */, ZF_IN_OPT ZFObject *owner /* = zfnull */, ZF_IN_OPT zfbool autoRemoveAfterActivate /* = zffalse */, ZF_IN_OPT ZFLevel observerLevel /* = ZFLevelAppNormal */) const { zfCoreMutexLocker(); if(eventId == zfidentityInvalid() || !observer.callbackIsValid()) { return zfidentityInvalid(); } if(this->observerOwner() && ZFBitTest(this->observerOwner()->objectInstanceState(), ZFObjectInstanceStateOnDealloc)) { zfCoreCriticalMessageTrim("[ZFObject] you must not add observer while object is deallocating, class: %s, event: %s", this->observerOwner()->classData()->classNameFull(), ZFIdMapNameForId(eventId)); return zfidentityInvalid(); } d->attachMapAttach(eventId); zfidentity taskId = d->taskIdGenerator.idAcquire(); _ZFP_ZFObserverData *t = zfpoolNew(_ZFP_ZFObserverData , taskId , eventId , observer , zflockfree_zfRetain(userData) , owner , observerLevel , autoRemoveAfterActivate ); d->observerTaskIdMap[taskId] = t; if(owner != zfnull) { d->observerOwnerMap[owner][t] = eventId; } _ZFP_ZFObserverData *&head = d->observerMap[eventId]; if(head == zfnull || head->observerLevel > observerLevel) { t->pNext = head; if(head != zfnull) { head->pPrev = t; } head = t; if(this->observerOwner() != zfnull) { this->observerOwner()->observerOnAdd(eventId); } } else { _ZFP_ZFObserverData *p = head; while(p->pNext != zfnull && p->pNext->observerLevel <= observerLevel) { p = p->pNext; } if(p->pNext != zfnull) { p->pNext->pPrev = t; } t->pNext = p->pNext; t->pPrev = p; p->pNext = t; } return taskId; } zfidentity ZFObserverHolder::observerAdd(ZF_IN const ZFObserverAddParam &param) const { return this->observerAdd( param.eventId(), param.observer(), param.userData(), param.owner(), param.autoRemoveAfterActivate(), param.observerLevel()); } void ZFObserverHolder::observerMoveToFirst(ZF_IN zfidentity taskId) const { zfCoreMutexLocker(); zfstlmap<zfidentity, _ZFP_ZFObserverData *>::iterator itTaskId = d->observerTaskIdMap.find(taskId); if(itTaskId == d->observerTaskIdMap.end()) { return ; } _ZFP_ZFObserverData *p = itTaskId->second; _ZFP_ZFObserverData *pos = p; while(pos->pPrev != zfnull) { if(pos->pPrev->observerLevel == p->observerLevel) { pos = pos->pPrev; } else { break; } } if(pos == p) { return ; } p->pPrev->pNext = p->pNext; if(p->pNext != zfnull) { p->pNext->pPrev = p->pPrev; } if(pos->pPrev != zfnull) { pos->pPrev->pNext = p; } p->pPrev = pos->pPrev; pos->pPrev = p; p->pNext = pos; } void ZFObserverHolder::observerRemove(ZF_IN zfidentity eventId, ZF_IN const ZFListener &callback, ZF_IN_OPT ZFObject *userData /* = zfnull */, ZF_IN_OPT ZFComparer<ZFObject *>::Comparer userDataComparer /* = ZFComparerCheckEqual */) const { zfCoreMutexLocker(); zfstlmap<zfidentity, _ZFP_ZFObserverData *>::iterator it = d->observerMap.find(eventId); if(it != d->observerMap.end()) { _ZFP_ZFObserverData *p = it->second; do { if(p->observer.objectCompareByInstance(callback) == ZFCompareTheSame && (userData == zfnull || userDataComparer(userData, p->userData) == ZFCompareTheSame)) { d->observerDetach(it, p); if(it->second == zfnull) { d->observerMap.erase(it); d->attachMapDetach(eventId); if(this->observerOwner()) { this->observerOwner()->observerOnRemove(eventId); } } zfpoolDelete(p); break; } p = p->pNext; } while(p != zfnull); } } void ZFObserverHolder::observerRemoveByTaskId(ZF_IN zfidentity taskId) const { zfCoreMutexLocker(); zfstlmap<zfidentity, _ZFP_ZFObserverData *>::iterator itTaskId = d->observerTaskIdMap.find(taskId); if(itTaskId == d->observerTaskIdMap.end()) { return ; } _ZFP_ZFObserverData *p = itTaskId->second; zfstlmap<zfidentity, _ZFP_ZFObserverData *>::iterator it = d->observerMap.find(p->eventId); d->observerDetach(it, p); if(it->second == zfnull) { d->observerMap.erase(it); d->attachMapDetach(p->eventId); if(this->observerOwner()) { this->observerOwner()->observerOnRemove(p->taskId); } } zfpoolDelete(p); } void ZFObserverHolder::observerRemoveByOwner(ZF_IN ZFObject *owner) const { zfCoreMutexLocker(); zfstlmap<ZFObject *, zfstlmap<_ZFP_ZFObserverData *, zfidentity> >::iterator itOwner = d->observerOwnerMap.find(owner); if(itOwner == d->observerOwnerMap.end()) { return ; } zfstlmap<_ZFP_ZFObserverData *, zfidentity> toRemove = itOwner->second; for(zfstlmap<_ZFP_ZFObserverData *, zfidentity>::iterator itToRemove = toRemove.begin(); itToRemove != toRemove.end(); ++itToRemove) { zfidentity eventId = itToRemove->second; _ZFP_ZFObserverData *p = itToRemove->first; zfstlmap<zfidentity, _ZFP_ZFObserverData *>::iterator it = d->observerMap.find(eventId); if(it != d->observerMap.end()) { d->observerDetach(it, p); if(it->second == zfnull) { d->observerMap.erase(it); if(this->observerOwner()) { d->attachMapDetach(eventId); this->observerOwner()->observerOnRemove(eventId); } } } zfpoolDelete(p); } } void ZFObserverHolder::observerRemoveAll(ZF_IN zfidentity eventId) const { zfCoreMutexLocker(); zfstlmap<zfidentity, _ZFP_ZFObserverData *>::iterator it = d->observerMap.find(eventId); if(it == d->observerMap.end()) { return ; } zfstldeque<_ZFP_ZFObserverData *> toDelete; while(it->second != zfnull) { toDelete.push_back(it->second); d->observerDetach(it, it->second); } d->observerMap.erase(it); d->attachMapDetach(eventId); if(this->observerOwner()) { this->observerOwner()->observerOnRemove(eventId); } for(zfstlsize i = toDelete.size() - 1; i != (zfstlsize)-1; --i) { zfpoolDelete(toDelete[i]); } } void ZFObserverHolder::observerRemoveAll(void) const { if(d->observerMap.empty()) { return ; } zfCoreMutexLocker(); zfstlmap<zfidentity, _ZFP_ZFObserverData *> tmp; tmp.swap(d->observerMap); d->observerMap.clear(); d->observerTaskIdMap.clear(); d->observerOwnerMap.clear(); if(this->observerOwner()) { for(zfstlmap<zfidentity, _ZFP_ZFObserverData *>::iterator it = tmp.begin(); it != tmp.end(); ++it) { d->attachMapDetach(it->first); this->observerOwner()->observerOnRemove(it->first); } } else { for(zfstlmap<zfidentity, _ZFP_ZFObserverData *>::iterator it = tmp.begin(); it != tmp.end(); ++it) { d->attachMapDetach(it->first); } } for(zfstlmap<zfidentity, _ZFP_ZFObserverData *>::iterator it = tmp.begin(); it != tmp.end(); ++it) { _ZFP_ZFObserverData *p = it->second; do { _ZFP_ZFObserverData *t = p; p = p->pNext; zfpoolDelete(t); } while(p != zfnull); } } zfbool ZFObserverHolder::observerHasAdd(void) const { if(this->observerOwner() != zfnull) { return !d->observerMap.empty() || !ZFGlobalObserver().d->observerMap.empty(); } else { return !d->observerMap.empty(); } } zfbool ZFObserverHolder::observerHasAdd(ZF_IN zfidentity eventId) const { if(this->observerOwner() != zfnull) { zfstlmap<zfidentity, _ZFP_ZFObserverData *> &g = ZFGlobalObserver().d->observerMap; return (d->observerMap.find(eventId) != d->observerMap.end()) || (g.find(eventId) != g.end()); } else { return (d->observerMap.find(eventId) != d->observerMap.end()); } } void ZFObserverHolder::observerNotifyWithCustomSender(ZF_IN ZFObject *customSender, ZF_IN zfidentity eventId, ZF_IN_OPT ZFObject *param0 /* = zfnull */, ZF_IN_OPT ZFObject *param1 /* = zfnull */) const { if(eventId == zfidentityInvalid()) { return ; } zfCoreMutexLock(); zfstldeque<_ZFP_ZFObserverData *> toNotify; _ZFP_ZFObserverData *toDelete = zfnull; d->observerNotifyPrepare(toNotify, toDelete, eventId, this->observerOwner()); ZFListenerData listenerData(eventId, customSender, param0, param1); if(this->observerOwner() != zfnull) { this->observerOwner()->observerOnEvent(listenerData); ZFGlobalObserver().d->observerNotifyPrepare(toNotify, toDelete, eventId, this->observerOwner()); } zfCoreMutexUnlock(); if(!toNotify.empty()) { for(zfstlsize i = 0; i < toNotify.size() && !listenerData.eventFiltered(); ++i) { const _ZFP_ZFObserverData &observerData = *(toNotify[i]); observerData.observer.execute(listenerData, observerData.userData); } } if(toDelete != zfnull) { zfCoreMutexLock(); do { _ZFP_ZFObserverData *t = toDelete; toDelete = toDelete->pNext; zfpoolDelete(t); } while(toDelete != zfnull); zfCoreMutexUnlock(); } } void ZFObserverHolder::observerHasAddStateAttach(ZF_IN zfidentity eventId, ZF_IN_OUT zfuint *flag, ZF_IN_OUT zfuint flagBit) { _ZFP_ZFObserverHolderAttachState state; state.flag = flag; state.flagBit = flagBit; d->attachMap[eventId].push_back(state); } void ZFObserverHolder::observerHasAddStateDetach(ZF_IN zfidentity eventId, ZF_IN_OUT zfuint *flag, ZF_IN_OUT zfuint flagBit) { _ZFP_ZFObserverHolderAttachStateMapType::iterator it = d->attachMap.find(eventId); if(it != d->attachMap.end()) { for(zfstlsize i = 0; i < it->second.size(); ++i) { _ZFP_ZFObserverHolderAttachState &state = it->second[i]; if(state.flag == flag && state.flagBit == flagBit) { it->second.erase(it->second.begin() + i); break; } } } } void ZFObserverHolder::objectInfoT(ZF_OUT zfstring &ret) const { zfCoreMutexLocker(); ret += "<ZFObserverHolder"; if(this->observerOwner() != zfnull) { ret += " "; this->observerOwner()->objectInfoT(ret); } if(d->observerMap.empty()) { ret += ">"; } else { for(zfstlmap<zfidentity, _ZFP_ZFObserverData *>::iterator it = d->observerMap.begin(); it != d->observerMap.end(); ++it) { ret += "\n "; ret += ZFIdMapNameForId(it->first); ret += ":"; _ZFP_ZFObserverData *p = it->second; do { ret += "\n "; ret += p->observer.objectInfo(); p = p->pNext; } while(p != zfnull); } ret += "\n >"; } } void ZFObserverHolder::_ZFP_ZFObserverHolder_observerOwner(ZF_IN ZFObject *obj) const { /* * if observerOwner is not null, * means it belongs to a ZFObject, which would: * * also send all events to ZFGlobalObserver * * notify events to owner ZFObject, such as observerOnEvent */ const_cast<ZFObserverHolder *>(this)->_observerOwner = obj; } // ============================================================ ZFObserverHolder &ZFGlobalObserver(void) { static ZFObserverHolder d; return d; } ZF_NAMESPACE_BEGIN(ZFGlobalEvent) ZF_NAMESPACE_END_WITH_REGISTER(ZFGlobalEvent, ZF_NAMESPACE_GLOBAL) ZF_NAMESPACE_GLOBAL_END #if _ZFP_ZFOBJECT_METHOD_REG #include "../ZFObject.h" ZF_NAMESPACE_GLOBAL_BEGIN ZFMETHOD_FUNC_USER_REGISTER_FOR_FUNC_0(ZFObserverHolder &, ZFGlobalObserver) ZF_NAMESPACE_GLOBAL_END #endif
29.721591
136
0.554626
ZFFrameworkDist
35d2173ca2be59980e583a529b38a31d63fc9d25
341
cpp
C++
sheldon_behaviors/take_object_behavior/src/behavior_plugin.cpp
zwartepoester/sheldon
7001551b65cd5b595a0a93e58528198d3d1e5553
[ "Apache-2.0" ]
1
2021-01-02T18:17:52.000Z
2021-01-02T18:17:52.000Z
sheldon_behaviors/take_object_behavior/src/behavior_plugin.cpp
zwartepoester/sheldon
7001551b65cd5b595a0a93e58528198d3d1e5553
[ "Apache-2.0" ]
null
null
null
sheldon_behaviors/take_object_behavior/src/behavior_plugin.cpp
zwartepoester/sheldon
7001551b65cd5b595a0a93e58528198d3d1e5553
[ "Apache-2.0" ]
4
2017-09-16T03:56:01.000Z
2018-09-19T02:15:57.000Z
// License: Apache 2.0. See LICENSE file in root directory. // Copyright(c) 2017 Intel Corporation. All Rights Reserved #include <pluginlib/class_list_macros.h> #include <behavior_common/behavior.h> PYTHON_BEHAVIOR_PLUGIN(take_object_behavior, "TAKE_OBJECT"); PLUGINLIB_EXPORT_CLASS(take_object_behavior, behavior_common::BehaviorPlugin);
37.888889
78
0.821114
zwartepoester
35db1fde2e1f3b753bde44f9c864d80b8bd50157
28,340
cpp
C++
src/CamMonitor/CamMonitor/LiveTab.cpp
infinicam/infinicam-samples
47c9c0dd79e1991d17fbcff91f49ab15a69c519a
[ "MIT" ]
null
null
null
src/CamMonitor/CamMonitor/LiveTab.cpp
infinicam/infinicam-samples
47c9c0dd79e1991d17fbcff91f49ab15a69c519a
[ "MIT" ]
null
null
null
src/CamMonitor/CamMonitor/LiveTab.cpp
infinicam/infinicam-samples
47c9c0dd79e1991d17fbcff91f49ab15a69c519a
[ "MIT" ]
1
2020-12-23T04:38:56.000Z
2020-12-23T04:38:56.000Z
#include "stdafx.h" #include "LiveTab.h" #include "resource.h" #include "AppDefine.h" #include "CamMonitor.h" #include "cih.h" #include "ChildView.h" #include "SelectCameraDialog.h" #include "SaveLiveDialog.h" #include "Util.h" IMPLEMENT_DYNAMIC(CLiveTab, CBaseTab) CLiveTab::CLiveTab(CWnd* pParent) : CBaseTab(CLiveTab::IDD, _T("LIVE"), pParent) , m_lockTextInfo(sizeof(TEXTINFO)) , m_lockRec(sizeof(BOOL)) , m_nRecFrameCount(0) , m_xvAcqMode(ACQUISITION_MODE_SINGLE) , m_xvSyncIn(PUC_SYNC_INTERNAL) , m_xvSyncOutSignal(PUC_SIGNAL_POSI) , m_xvSyncOutDelay(0) , m_xvSyncOutWidth(0) , m_xvLEDMode(FALSE) , m_xvFanState(FALSE) , m_xvExposeOn(0) , m_xvExposeOff(0) , m_csvFile(nullptr) { } CLiveTab::~CLiveTab() { } void CLiveTab::DoDataExchange(CDataExchange* pDX) { CBaseTab::DoDataExchange(pDX); DDX_Radio(pDX, IDC_ACQUISITION_SINGLE, m_xvAcqMode); DDX_Control(pDX, IDC_REC, m_buttonRec); DDX_Control(pDX, IDC_FRAMERATE, m_comboFramerate); DDX_Control(pDX, IDC_SHUTTERFPS, m_comboShutterFps); DDX_Control(pDX, IDC_RESOLUTION, m_comboReso); DDX_Radio(pDX, IDC_SYNC_IN_INTERNAL, m_xvSyncIn); DDX_Radio(pDX, IDC_SYNC_OUT_SIGNAL_POSI, m_xvSyncOutSignal); DDX_Text(pDX, IDC_SYNC_OUT_DELAY, m_xvSyncOutDelay); DDX_Text(pDX, IDC_SYNC_OUT_WIDTH, m_xvSyncOutWidth); DDX_Control(pDX, IDC_SYNC_OUT_MAGNIFICATION, m_comboSyncOutMag); DDX_Check(pDX, IDC_LED_MODE, m_xvLEDMode); DDX_Check(pDX, IDC_FAN_CTRL, m_xvFanState); DDX_Control(pDX, IDC_QUANTIZATION, m_comboQuantization); DDX_Text(pDX, IDC_EXPOSE_ON, m_xvExposeOn); DDX_Text(pDX, IDC_EXPOSE_OFF, m_xvExposeOff); DDX_Text(pDX, IDC_DECODE_POS_X, m_xvDecodePos.x); DDX_Text(pDX, IDC_DECODE_POS_Y, m_xvDecodePos.y); DDX_Text(pDX, IDC_DECODE_POS_W, m_xvDecodeSize.cx); DDX_Text(pDX, IDC_DECODE_POS_H, m_xvDecodeSize.cy); } BOOL CLiveTab::OpenCamera(UINT32 nDeviceNo, UINT32 nSingleXferTimeOut, UINT32 nContinuousXferTimeOut, UINT32 nRingBufCount) { CString msg; PUCRESULT result; result = m_camera.OpenDevice(nDeviceNo, nSingleXferTimeOut, nContinuousXferTimeOut, nRingBufCount); if (PUC_CHK_FAILED(result)) { msg.FormatMessage(IDS_ERROR_CODE, _T("OpenDevice"), result); AfxMessageBox(msg, MB_OK | MB_ICONERROR); return FALSE; } m_camera.SetCallbackSingle(_SingleProc, this); m_camera.SetCallbackContinuous(_ContinuousProc, this); return TRUE; } void CLiveTab::CloseCamera() { StopRec(); StopLive(); m_camera.CloseDevice(); } void CLiveTab::StartLive() { CString msg; PUCRESULT result; result = m_camera.StartLive(); if (PUC_CHK_FAILED(result)) { msg.FormatMessage(IDS_ERROR_CODE, _T("StartLive"), result); AfxMessageBox(msg, MB_OK | MB_ICONERROR); } SetTimer(TIMER_ID_UPDATE_TEMP, UPDATE_TEMP_INTERVAL, NULL); } void CLiveTab::StopLive() { CString msg; PUCRESULT result; result = m_camera.StopLive(); if (PUC_CHK_FAILED(result)) { msg.FormatMessage(IDS_ERROR_CODE, _T("StopLive"), result); AfxMessageBox(msg, MB_OK | MB_ICONERROR); } KillTimer(TIMER_ID_UPDATE_TEMP); } void CLiveTab::StartRec() { UpdateData(); // ***Lock*** BOOL* pRec = (BOOL*)m_lockRec.GetLockData(); *pRec = TRUE; m_nRecFrameCount = 0; CDefaultParams& df = ((CCamMonitorApp*)AfxGetApp())->GetDefaultParams(); if (df.cameraSaveFileType == SAVE_FILE_TYPE_RAW) { CString filepath; filepath.Format(_T("%s\\%s.mdat"), (LPCTSTR)df.cameraSaveFolderPath, (LPCTSTR)df.cameraSaveFileName); FILE* fp = NULL; errno_t error = _tfopen_s(&fp, filepath, _T("wbS")); if (!fp || error != 0) { TRACE(_T("fopen error\n")); } else { m_mdatFile = fp; } } if (df.cameraSaveFileType == SAVE_FILE_TYPE_CSV) { CString filepath; filepath.Format(_T("%s\\%s.csv"), (LPCTSTR)df.cameraSaveFolderPath, (LPCTSTR)df.cameraSaveFileName); FILE* fp = NULL; errno_t error = _tfopen_s(&fp, filepath, _T("w")); if (!fp || error != 0) { TRACE(_T("fopen error\n")); } else { _ftprintf(fp, _T("Frame No,Sequence No,Difference from previous frame,Drop\n")); m_csvFile = fp; } } m_lockRec.Unlock(); // ***Unlock*** } void CLiveTab::StopRec() { // ***Lock*** BOOL* pRec = (BOOL*)m_lockRec.GetLockData(); if (*pRec) { *pRec = FALSE; m_lockRec.Unlock(); CDefaultParams& df = ((CCamMonitorApp*)AfxGetApp())->GetDefaultParams(); if (df.cameraSaveFileType == SAVE_FILE_TYPE_RAW) { WriteCIH(); } if (m_csvFile) { fclose(m_csvFile); m_csvFile = nullptr; } if (m_mdatFile) { fclose(m_mdatFile); m_mdatFile = nullptr; } } else { m_lockRec.Unlock(); } // ***Unlock*** } void CLiveTab::WriteCIH() { CIH cih; CDefaultParams& df = ((CCamMonitorApp*)AfxGetApp())->GetDefaultParams(); PUC_GetFramerateShutter(m_camera.GetHandle(), &cih.m_framerate, &cih.m_shutterFps); PUC_GetExposeTime(m_camera.GetHandle(), &cih.m_exposeOn, &cih.m_exposeOff); PUC_GetResolution(m_camera.GetHandle(), &cih.m_width, &cih.m_height); PUC_GetXferDataSize(m_camera.GetHandle(), PUC_DATA_COMPRESSED, &cih.m_frameSize); cih.m_frameCount = m_nRecFrameCount; memcpy(cih.m_quantization, m_camera.GetQuantization(), sizeof(cih.m_quantization)); cih.m_filetype = df.cameraSaveFileType; PUC_GetColorType(m_camera.GetHandle(), &cih.m_colortype); CString filepath; static INT64 n = 0; filepath.Format(_T("%s\\%s.cih"), (LPCTSTR)df.cameraSaveFolderPath, (LPCTSTR)df.cameraSaveFileName); cih.Write(filepath); } void CLiveTab::DecodeImage(PUCHAR pBuffer) { // ***Lock*** CBitmapImage* pImage = (CBitmapImage*)m_lockImage.GetLockData(); pImage->FillBlack(); PUC_DecodeData( pImage->GetBuffer() + (m_xvDecodePos.y * pImage->GetLineByte() + m_xvDecodePos.x), m_xvDecodePos.x, m_xvDecodePos.y, m_xvDecodeSize.cx, m_xvDecodeSize.cy, pImage->GetLineByte(), pBuffer, m_camera.GetQuantization()); m_lockImage.Unlock(); // ***Unlock*** } void CLiveTab::_SingleProc(PPUC_XFER_DATA_INFO pInfo, void* pArg) { CLiveTab* pObj = (CLiveTab*)pArg; pObj->SingleProc(pInfo); } void CLiveTab::SingleProc(PPUC_XFER_DATA_INFO pInfo) { // Update Live View PTEXTINFO pTextInfo = (PTEXTINFO)m_lockTextInfo.GetLockData(); pTextInfo->nSeqNo = pInfo->nSequenceNo; m_lockTextInfo.Unlock(); DecodeImage(pInfo->pData); ::PostMessage(GetSafeHwnd(), WM_USER_UPDATE_VIEW, (WPARAM)0, (LPARAM)0); } void CLiveTab::_ContinuousProc(PPUC_XFER_DATA_INFO pInfo, void* pArg) { CLiveTab* pObj = (CLiveTab*)pArg; pObj->ContinuousProc(pInfo); } void CLiveTab::ContinuousProc(PPUC_XFER_DATA_INFO pInfo) { // Save BOOL* pRec = (BOOL*)m_lockRec.GetLockData(); if (*pRec) { CDefaultParams& df = ((CCamMonitorApp*)AfxGetApp())->GetDefaultParams(); FILE* fp = NULL; errno_t error; static INT32 nPreSeqNo = 0; if (df.cameraSaveFileType == SAVE_FILE_TYPE_RAW) { fp = m_mdatFile; if (fp) { fwrite(pInfo->pData, pInfo->nDataSize, 1, fp); m_nRecFrameCount++; } } else if (df.cameraSaveFileType == SAVE_FILE_TYPE_CSV) { fp = m_csvFile; if (fp) { if ((pInfo->nSequenceNo - nPreSeqNo) == 0 || (pInfo->nSequenceNo - nPreSeqNo) == 1) _ftprintf(fp, _T("%lld,%d,%d\n"), m_nRecFrameCount, pInfo->nSequenceNo, pInfo->nSequenceNo - nPreSeqNo); else _ftprintf(fp, _T("%lld,%d,%d,*\n"), m_nRecFrameCount, pInfo->nSequenceNo, pInfo->nSequenceNo - nPreSeqNo); m_nRecFrameCount++; } } nPreSeqNo = pInfo->nSequenceNo; } m_lockRec.Unlock(); } void CLiveTab::UpdateBuffer() { m_camera.UpdateBuffer(); UINT32 w, h; PUC_COLOR_TYPE colorType; PUC_GetResolution(m_camera.GetHandle(), &w, &h); PUC_GetColorType(m_camera.GetHandle(), &colorType); m_lockImage.SetWidth(w); m_lockImage.SetHeight(h); m_lockImage.SetColor(colorType != PUC_COLOR_MONO); m_lockImage.Create(); } void CLiveTab::UpdateControlState() { CString s; BOOL bOpened = m_camera.IsOpened(); BOOL bContinuous = m_xvAcqMode == ACQUISITION_MODE_CONTINUOUS; BOOL bExternal = m_xvSyncIn == PUC_SYNC_EXTERNAL; // ***Lock*** BOOL bRecording = *(BOOL*)m_lockRec.GetLockData(); m_lockRec.Unlock(); // ***Unlock*** GetDlgItem(IDC_OPENCAMERA)->EnableWindow(!bRecording); m_buttonRec.EnableWindow(bOpened && bContinuous && !bRecording); GetDlgItem(IDC_STOP)->EnableWindow(bRecording); GetDlgItem(IDC_ACQUISITION_SINGLE)->EnableWindow(bOpened && !bRecording); GetDlgItem(IDC_ACQUISITION_CONTINUOUS)->EnableWindow(bOpened && !bRecording); m_comboFramerate.EnableWindow(bOpened && !bContinuous); m_comboShutterFps.EnableWindow(bOpened && !bContinuous); m_comboReso.EnableWindow(bOpened && !bContinuous); GetDlgItem(IDC_SYNC_IN_INTERNAL)->EnableWindow(bOpened && !bContinuous); GetDlgItem(IDC_SYNC_IN_EXTERNAL)->EnableWindow(bOpened && !bContinuous); GetDlgItem(IDC_SYNC_OUT_SIGNAL_POSI)->EnableWindow(bOpened && !bContinuous); GetDlgItem(IDC_SYNC_OUT_SIGNAL_NEGA)->EnableWindow(bOpened && !bContinuous); GetDlgItem(IDC_SYNC_OUT_DELAY)->EnableWindow(bOpened && !bContinuous); GetDlgItem(IDC_SYNC_OUT_WIDTH)->EnableWindow(bOpened && !bContinuous); GetDlgItem(IDC_SYNC_OUT_MAGNIFICATION)->EnableWindow(bOpened && !bContinuous && !bExternal); GetDlgItem(IDC_LED_MODE)->EnableWindow(bOpened && !bContinuous); GetDlgItem(IDC_FAN_CTRL)->EnableWindow(bOpened && !bContinuous); GetDlgItem(IDC_QUANTIZATION)->EnableWindow(FALSE); GetDlgItem(IDC_EXPOSE_ON)->EnableWindow(bOpened && !bContinuous); GetDlgItem(IDC_EXPOSE_OFF)->EnableWindow(bOpened && !bContinuous); GetDlgItem(IDC_DECODE_POS_X)->EnableWindow(bOpened && !bContinuous); GetDlgItem(IDC_DECODE_POS_Y)->EnableWindow(bOpened && !bContinuous); GetDlgItem(IDC_DECODE_POS_W)->EnableWindow(bOpened && !bContinuous); GetDlgItem(IDC_DECODE_POS_H)->EnableWindow(bOpened && !bContinuous); GetDlgItem(IDC_SNAPSHOT)->EnableWindow(bOpened && !bContinuous); GetDlgItem(IDC_SAVE_TO)->EnableWindow(bOpened && !bContinuous); // Record button color if (bRecording) { m_buttonRec.SetFaceColor(RGB(242, 121, 8), true); m_buttonRec.SetTextColor(RGB(255, 255, 255)); s.LoadString(IDS_RECORDING); m_buttonRec.SetWindowText(s); } else { m_buttonRec.SetFaceColor(RGB(94, 124, 146), true); m_buttonRec.SetTextColor(RGB(255, 255, 255)); s.LoadString(IDS_REC); m_buttonRec.SetWindowText(s); } Invalidate(); } void CLiveTab::UpdateCameraSerialNo() { UINT32 nName = 0; UINT32 nType = 0; UINT32 nVer = 0; UINT64 nSerialNo = 0; CString s; PUC_GetDeviceName(m_camera.GetHandle(), &nName); PUC_GetDeviceType(m_camera.GetHandle(), &nType); PUC_GetDeviceVersion(m_camera.GetHandle(), &nVer); PUC_GetSerialNo(m_camera.GetHandle(), &nSerialNo); s.Format(_T("NAME:%x TYPE:%x Ver:%u Ser:%llx"), nName, nType, nVer, nSerialNo); GetDlgItem(IDC_STATIC_SERIAL)->SetWindowText(s); } void CLiveTab::UpdateFramerateComboBox() { CString s; UINT32 nFramerate, nShutterFps; UINT32 nTmp; m_comboFramerate.ResetContent(); if (!IsCameraOpened()) return; PUC_GetFramerateShutter(m_camera.GetHandle(), &nFramerate, &nShutterFps); for (int i = 0; i < MAX_FRAMERATE_COUNT; i++) { nTmp = FramerateShutterTable[i].nFramerate; s.Format(_T("%u fps"), nTmp); m_comboFramerate.AddString(s); m_comboFramerate.SetItemData(m_comboFramerate.GetCount() - 1, nTmp); if (nTmp == nFramerate) m_comboFramerate.SetCurSel(m_comboFramerate.GetCount() - 1); } } void CLiveTab::UpdateShutterFpsComboBox() { CString s; UINT32 nCurrentFps = 0; UINT32 nFramerate, nShutterFps; m_comboShutterFps.ResetContent(); if (!IsCameraOpened()) return; PUC_GetFramerateShutter(m_camera.GetHandle(), &nFramerate, &nShutterFps); nCurrentFps = m_comboFramerate.GetItemData(m_comboFramerate.GetCurSel()); for (int i = 0; i < MAX_FRAMERATE_COUNT; i++) { if (nCurrentFps != FramerateShutterTable[i].nFramerate) continue; for (int j = 0; j < FramerateShutterTable[i].itemList.nSize; j++) { s.Format(_T("1/%u fps"), FramerateShutterTable[i].itemList.items[j]); m_comboShutterFps.AddString(s); m_comboShutterFps.SetItemData(m_comboShutterFps.GetCount() - 1, FramerateShutterTable[i].itemList.items[j]); if (FramerateShutterTable[i].itemList.items[j] == nShutterFps) m_comboShutterFps.SetCurSel(m_comboShutterFps.GetCount() - 1); } } } void CLiveTab::UpdateResoComboBox() { CString s; UINT32 w, h, nCurMaxW, nCurMaxH, n; PUC_RESO_LIMIT_INFO info = { 0 }; m_comboReso.ResetContent(); if (!IsCameraOpened()) return; PUC_GetResolution(m_camera.GetHandle(), &w, &h); PUC_GetMaxResolution(m_camera.GetHandle(), &nCurMaxW, &nCurMaxH); PUC_GetResolutionLimit(m_camera.GetHandle(), &info); n = nCurMaxH; while (1) { s.Format(_T("%u x %u"), nCurMaxW, n); m_comboReso.AddString(s); m_comboReso.SetItemData(m_comboReso.GetCount() - 1, MAKE_RESO(nCurMaxW, n)); if (n == h) m_comboReso.SetCurSel(m_comboReso.GetCount() - 1); n -= info.nUnitHeight; if (n < info.nMinHeight) break; } } void CLiveTab::UpdateSyncOutSignalRadio() { if (!IsCameraOpened()) return; PUC_GetSyncInMode(m_camera.GetHandle(), (PUC_SYNC_MODE*)&m_xvSyncIn); UpdateData(FALSE); } void CLiveTab::UpdateSyncInRadio() { if (!IsCameraOpened()) return; PUC_GetSyncOutSignal(m_camera.GetHandle(), (PUC_SIGNAL*)& m_xvSyncOutSignal); UpdateData(FALSE); } void CLiveTab::UpdateSyncOutDelayEdit() { if (!IsCameraOpened()) return; PUC_GetSyncOutDelay(m_camera.GetHandle(), (UINT32*)&m_xvSyncOutDelay); UpdateData(FALSE); } void CLiveTab::UpdateSyncOutWidthEdit() { if (!IsCameraOpened()) return; PUC_GetSyncOutWidth(m_camera.GetHandle(), (UINT32*)&m_xvSyncOutWidth); UpdateData(FALSE); } void CLiveTab::UpdateSyncOutMagComboBox() { CString s; UINT32 nMag; m_comboSyncOutMag.ResetContent(); if (!IsCameraOpened()) return; PUC_GetSyncOutMagnification(m_camera.GetHandle(), &nMag); s.Format(_T("x 0.5")); m_comboSyncOutMag.AddString(s); m_comboSyncOutMag.SetItemData(m_comboSyncOutMag.GetCount() - 1, PUC_SYNC_OUT_MAGNIFICATION_0_5); if (nMag == PUC_SYNC_OUT_MAGNIFICATION_0_5) m_comboSyncOutMag.SetCurSel(m_comboSyncOutMag.GetCount() - 1); s.Format(_T("x 1")); m_comboSyncOutMag.AddString(s); m_comboSyncOutMag.SetItemData(m_comboSyncOutMag.GetCount() - 1, 1); if (nMag == 1) m_comboSyncOutMag.SetCurSel(m_comboSyncOutMag.GetCount() - 1); s.Format(_T("x 2")); m_comboSyncOutMag.AddString(s); m_comboSyncOutMag.SetItemData(m_comboSyncOutMag.GetCount() - 1, 2); if (nMag == 2) m_comboSyncOutMag.SetCurSel(m_comboSyncOutMag.GetCount() - 1); s.Format(_T("x 4")); m_comboSyncOutMag.AddString(s); m_comboSyncOutMag.SetItemData(m_comboSyncOutMag.GetCount() - 1, 4); if (nMag == 4) m_comboSyncOutMag.SetCurSel(m_comboSyncOutMag.GetCount() - 1); s.Format(_T("x 10")); m_comboSyncOutMag.AddString(s); m_comboSyncOutMag.SetItemData(m_comboSyncOutMag.GetCount() - 1, 10); if (nMag == 10) m_comboSyncOutMag.SetCurSel(m_comboSyncOutMag.GetCount() - 1); } void CLiveTab::UpdateLEDModeCheckBox() { if (!IsCameraOpened()) return; PUC_GetLEDMode(m_camera.GetHandle(), (PUC_MODE*)&m_xvLEDMode); UpdateData(FALSE); } void CLiveTab::UpdateFANCtrlCheckBox() { if (!IsCameraOpened()) return; PUC_GetFanState(m_camera.GetHandle(), (PUC_MODE*)&m_xvFanState); UpdateData(FALSE); } void CLiveTab::UpdateQuantization() { CString s; int nCurSel = m_comboQuantization.GetCurSel(); if (nCurSel == CB_ERR) nCurSel = 0; m_comboQuantization.ResetContent(); if (!IsCameraOpened()) return; s.LoadString(IDS_QUALITY_NORMAL); m_comboQuantization.AddString(s); m_comboQuantization.SetItemData(m_comboQuantization.GetCount() - 1, IMAGE_QUALITY_NORMAL); s.LoadString(IDS_QUALITY_LOW); m_comboQuantization.AddString(s); m_comboQuantization.SetItemData(m_comboQuantization.GetCount() - 1, IMAGE_QUALITY_LOW); s.LoadString(IDS_QUALITY_HIGH); m_comboQuantization.AddString(s); m_comboQuantization.SetItemData(m_comboQuantization.GetCount() - 1, IMAGE_QUALITY_HIGH); m_comboQuantization.SetCurSel(m_comboQuantization.GetCount() - 1); } void CLiveTab::UpdateExposeTime() { if (!IsCameraOpened()) return; PUC_GetExposeTime(m_camera.GetHandle(), (UINT32*)&m_xvExposeOn, (UINT32*)&m_xvExposeOff); UpdateData(FALSE); } void CLiveTab::ResetDecodePos() { if (!IsCameraOpened()) return; UINT32 w, h; PUC_GetResolution(m_camera.GetHandle(), &w, &h); m_xvDecodePos.x = m_xvDecodePosBK.x = 0; m_xvDecodePos.y = m_xvDecodePosBK.y = 0; m_xvDecodeSize.cx = m_xvDecodeSizeBK.cx = w; m_xvDecodeSize.cy = m_xvDecodeSizeBK.cy = h; UpdateData(FALSE); } void CLiveTab::ConfirmDecodePos() { if (!IsCameraOpened()) return; UINT32 w, h; PUC_GetResolution(m_camera.GetHandle(), &w, &h); BOOL bIllegal = FALSE; if (m_xvDecodePos.x != 0 && (m_xvDecodePos.x % 8) != 0) bIllegal = TRUE; if (m_xvDecodePos.y != 0 && (m_xvDecodePos.y % 8) != 0) bIllegal = TRUE; if (m_xvDecodeSize.cx == 0) bIllegal = TRUE; if (m_xvDecodeSize.cy == 0) bIllegal = TRUE; if ((m_xvDecodePos.x + m_xvDecodeSize.cx) > w) bIllegal = TRUE; if ((m_xvDecodePos.x + m_xvDecodeSize.cy) > h) bIllegal = TRUE; if (bIllegal) { m_xvDecodePos.x = m_xvDecodePosBK.x; m_xvDecodePos.y = m_xvDecodePosBK.y; m_xvDecodeSize.cx = m_xvDecodeSizeBK.cx; m_xvDecodeSize.cy = m_xvDecodeSizeBK.cy; } else { m_xvDecodePosBK.x = m_xvDecodePos.x; m_xvDecodePosBK.y = m_xvDecodePos.y; m_xvDecodeSizeBK.cx = m_xvDecodeSize.cx; m_xvDecodeSizeBK.cy = m_xvDecodeSize.cy; } UpdateData(FALSE); } BEGIN_MESSAGE_MAP(CLiveTab, CBaseTab) ON_MESSAGE(WM_INITDIALOG, OnInitDialog) ON_WM_SHOWWINDOW() ON_WM_DESTROY() ON_WM_TIMER() ON_BN_CLICKED(IDC_OPENCAMERA, &CLiveTab::OnBnClickedOpencamera) ON_BN_CLICKED(IDC_REC, &CLiveTab::OnBnClickedRec) ON_BN_CLICKED(IDC_ACQUISITION_SINGLE, &CLiveTab::OnBnClickedAcquisitionSingle) ON_BN_CLICKED(IDC_ACQUISITION_CONTINUOUS, &CLiveTab::OnBnClickedAcquisitionContinuous) ON_BN_CLICKED(IDC_STOP, &CLiveTab::OnBnClickedStop) ON_CBN_SELCHANGE(IDC_FRAMERATE, &CLiveTab::OnCbnSelchangeFramerate) ON_CBN_SELCHANGE(IDC_SHUTTERFPS, &CLiveTab::OnCbnSelchangeShutterFps) ON_CBN_SELCHANGE(IDC_RESOLUTION, &CLiveTab::OnCbnSelchangeResolution) ON_BN_CLICKED(IDC_SYNC_IN_INTERNAL, &CLiveTab::OnBnClickedSyncIn) ON_BN_CLICKED(IDC_SYNC_IN_EXTERNAL, &CLiveTab::OnBnClickedSyncIn) ON_BN_CLICKED(IDC_SYNC_OUT_SIGNAL_POSI, &CLiveTab::OnBnClickedSyncOutSignal) ON_BN_CLICKED(IDC_SYNC_OUT_SIGNAL_NEGA, &CLiveTab::OnBnClickedSyncOutSignal) ON_EN_KILLFOCUS(IDC_SYNC_OUT_DELAY, &CLiveTab::OnEnKillfocusSyncOutDelay) ON_EN_KILLFOCUS(IDC_SYNC_OUT_WIDTH, &CLiveTab::OnEnKillfocusSyncOutWidth) ON_CBN_SELCHANGE(IDC_SYNC_OUT_MAGNIFICATION, &CLiveTab::OnCbnSelchangeSyncOutMag) ON_BN_CLICKED(IDC_LED_MODE, &CLiveTab::OnBnClickedLEDMode) ON_BN_CLICKED(IDC_FAN_CTRL, &CLiveTab::OnBnClickedFANCtrl) ON_CBN_SELCHANGE(IDC_QUANTIZATION, &CLiveTab::OnCbnSelchangeQuantization) ON_EN_KILLFOCUS(IDC_EXPOSE_ON, &CLiveTab::OnEnKillfocusExposeOn) ON_EN_KILLFOCUS(IDC_EXPOSE_OFF, &CLiveTab::OnEnKillfocusExposeOff) ON_EN_KILLFOCUS(IDC_DECODE_POS_X, &CLiveTab::OnEnKillfocusDecodePos) ON_EN_KILLFOCUS(IDC_DECODE_POS_Y, &CLiveTab::OnEnKillfocusDecodePos) ON_EN_KILLFOCUS(IDC_DECODE_POS_W, &CLiveTab::OnEnKillfocusDecodePos) ON_EN_KILLFOCUS(IDC_DECODE_POS_H, &CLiveTab::OnEnKillfocusDecodePos) ON_BN_CLICKED(IDC_SNAPSHOT, &CLiveTab::OnBnClickedSnapshot) ON_BN_CLICKED(IDC_SAVE_TO, &CLiveTab::OnBnClickedSaveTo) END_MESSAGE_MAP() LRESULT CLiveTab::OnInitDialog(WPARAM wParam, LPARAM lParam) { LRESULT ret = CBaseTab::OnInitDialog(wParam, lParam); if (!ret) return ret; UpdateControlState(); OnBnClickedAcquisitionSingle(); return FALSE; } void CLiveTab::OnShowWindow(BOOL bShow, UINT nStatus) { if (bShow) { UpdateControlState(); StartLive(); } else { StopRec(); StopLive(); } } void CLiveTab::OnDestroy() { CloseCamera(); } void CLiveTab::OnTimer(UINT_PTR nIDEvent) { if (nIDEvent == TIMER_ID_UPDATE_TEMP) { if (m_camera.IsOpened() && m_camera.GetAcquisitionMode() != ACQUISITION_MODE_CONTINUOUS) { PTEXTINFO pTextInfo = (PTEXTINFO)m_lockTextInfo.GetLockData(); PUC_GetSensorTemperature(m_camera.GetHandle(), &pTextInfo->nTemp); m_lockTextInfo.Unlock(); } } CBaseTab::OnTimer(nIDEvent); } void CLiveTab::OnBnClickedOpencamera() { CSelectCameraDialog dlg; PUCRESULT result; CString msg; if (dlg.DoModal() != IDOK) goto EXIT_LABEL; StopRec(); StopLive(); if (!OpenCamera(dlg.GetDeviceNo(), dlg.GetSingleXferTimeOut(), dlg.GetContinuousXferTimeOut(), dlg.GetRingBufCount())) goto EXIT_LABEL; UpdateBuffer(); EXIT_LABEL: UpdateCameraSerialNo(); UpdateFramerateComboBox(); UpdateShutterFpsComboBox(); UpdateResoComboBox(); UpdateSyncInRadio(); UpdateSyncOutSignalRadio(); UpdateSyncOutDelayEdit(); UpdateSyncOutWidthEdit(); UpdateSyncOutMagComboBox(); UpdateLEDModeCheckBox(); UpdateFANCtrlCheckBox(); UpdateQuantization(); UpdateExposeTime(); ResetDecodePos(); UpdateControlState(); StartLive(); } void CLiveTab::OnBnClickedRec() { StartRec(); UpdateControlState(); } void CLiveTab::OnBnClickedStop() { StopRec(); UpdateControlState(); } void CLiveTab::OnBnClickedAcquisitionSingle() { StopLive(); m_xvAcqMode = ACQUISITION_MODE_SINGLE; UpdateData(FALSE); m_camera.SetAcquisitionMode((ACQUISITION_MODE)m_xvAcqMode); StartLive(); UpdateControlState(); } void CLiveTab::OnBnClickedAcquisitionContinuous() { StopLive(); m_xvAcqMode = ACQUISITION_MODE_CONTINUOUS; UpdateData(FALSE); m_camera.SetAcquisitionMode((ACQUISITION_MODE)m_xvAcqMode); StartLive(); UpdateControlState(); } void CLiveTab::OnCbnSelchangeFramerate() { UINT32 nFramerate = m_comboFramerate.GetItemData(m_comboFramerate.GetCurSel()); PUCRESULT result; CString msg; StopLive(); result = PUC_SetFramerateShutter(m_camera.GetHandle(), nFramerate, nFramerate); if (PUC_CHK_FAILED(result)) { msg.FormatMessage(IDS_ERROR_CODE, _T("PUC_SetFramerateShutter"), result); AfxMessageBox(msg, MB_OK | MB_ICONERROR); } UpdateFramerateComboBox(); UpdateShutterFpsComboBox(); UpdateResoComboBox(); UpdateExposeTime(); UpdateSyncOutWidthEdit(); UpdateSyncOutMagComboBox(); UpdateBuffer(); ResetDecodePos(); StartLive(); UpdateControlState(); } void CLiveTab::OnCbnSelchangeShutterFps() { UINT32 nFramerate = m_comboFramerate.GetItemData(m_comboFramerate.GetCurSel()); UINT32 nShutterFps = m_comboShutterFps.GetItemData(m_comboShutterFps.GetCurSel()); PUCRESULT result; CString msg; StopLive(); result = PUC_SetFramerateShutter(m_camera.GetHandle(), nFramerate, nShutterFps); if (PUC_CHK_FAILED(result)) { msg.FormatMessage(IDS_ERROR_CODE, _T("PUC_SetFramerateShutter"), result); AfxMessageBox(msg, MB_OK | MB_ICONERROR); } UpdateFramerateComboBox(); UpdateShutterFpsComboBox(); UpdateResoComboBox(); UpdateExposeTime(); UpdateSyncOutWidthEdit(); UpdateSyncOutMagComboBox(); StartLive(); UpdateControlState(); } void CLiveTab::OnCbnSelchangeResolution() { UINT32 nResolution = m_comboReso.GetItemData(m_comboReso.GetCurSel()); PUCRESULT result; CString msg; StopLive(); result = PUC_SetResolution(m_camera.GetHandle(), RESO_W(nResolution), RESO_H(nResolution)); if (PUC_CHK_FAILED(result)) { msg.FormatMessage(IDS_ERROR_CODE, _T("PUC_SetResolution"), result); AfxMessageBox(msg, MB_OK | MB_ICONERROR); } UpdateResoComboBox(); UpdateBuffer(); ResetDecodePos(); StartLive(); UpdateControlState(); } void CLiveTab::OnBnClickedSyncIn() { PUCRESULT result; CString msg; StopLive(); UpdateData(TRUE); result = PUC_SetSyncInMode(m_camera.GetHandle(), (PUC_SYNC_MODE)m_xvSyncIn); if (PUC_CHK_FAILED(result)) { msg.FormatMessage(IDS_ERROR_CODE, _T("PUC_SetSyncInMode"), result); AfxMessageBox(msg, MB_OK | MB_ICONERROR); } UpdateFramerateComboBox(); UpdateShutterFpsComboBox(); UpdateResoComboBox(); UpdateExposeTime(); UpdateSyncOutMagComboBox(); UpdateBuffer(); ResetDecodePos(); StartLive(); UpdateControlState(); } void CLiveTab::OnBnClickedSyncOutSignal() { PUCRESULT result; CString msg; StopLive(); UpdateData(TRUE); result = PUC_SetSyncOutSignal(m_camera.GetHandle(), (PUC_SIGNAL)m_xvSyncOutSignal); if (PUC_CHK_FAILED(result)) { msg.FormatMessage(IDS_ERROR_CODE, _T("PUC_SetSyncOutSignal"), result); AfxMessageBox(msg, MB_OK | MB_ICONERROR); } StartLive(); UpdateControlState(); } void CLiveTab::OnEnKillfocusSyncOutDelay() { PUCRESULT result; CString msg; StopLive(); UpdateData(TRUE); result = PUC_SetSyncOutDelay(m_camera.GetHandle(), m_xvSyncOutDelay); if (PUC_CHK_FAILED(result)) { msg.FormatMessage(IDS_ERROR_CODE, _T("PUC_SetSyncOutDelay"), result); AfxMessageBox(msg, MB_OK | MB_ICONERROR); } StartLive(); UpdateControlState(); } void CLiveTab::OnEnKillfocusSyncOutWidth() { PUCRESULT result; CString msg; StopLive(); UpdateData(TRUE); result = PUC_SetSyncOutWidth(m_camera.GetHandle(), m_xvSyncOutWidth); if (PUC_CHK_FAILED(result)) { msg.FormatMessage(IDS_ERROR_CODE, _T("PUC_SetSyncOutWidth"), result); AfxMessageBox(msg, MB_OK | MB_ICONERROR); } UpdateSyncOutMagComboBox(); StartLive(); UpdateControlState(); } void CLiveTab::OnCbnSelchangeSyncOutMag() { UINT32 nMag = m_comboSyncOutMag.GetItemData(m_comboSyncOutMag.GetCurSel()); PUCRESULT result; CString msg; StopLive(); result = PUC_SetSyncOutMagnification(m_camera.GetHandle(), nMag); if (PUC_CHK_FAILED(result)) { msg.FormatMessage(IDS_ERROR_CODE, _T("PUC_SetSyncOutMagnification"), result); AfxMessageBox(msg, MB_OK | MB_ICONERROR); } UpdateSyncOutWidthEdit(); StartLive(); UpdateControlState(); } void CLiveTab::OnBnClickedLEDMode() { PUCRESULT result; CString msg; StopLive(); UpdateData(TRUE); result = PUC_SetLEDMode(m_camera.GetHandle(), (PUC_MODE)m_xvLEDMode); if (PUC_CHK_FAILED(result)) { msg.FormatMessage(IDS_ERROR_CODE, _T("PUC_SetLEDMode"), result); AfxMessageBox(msg, MB_OK | MB_ICONERROR); } StartLive(); UpdateControlState(); } void CLiveTab::OnBnClickedFANCtrl() { PUCRESULT result; CString msg; StopLive(); UpdateData(TRUE); result = PUC_SetFanState(m_camera.GetHandle(), (PUC_MODE)m_xvFanState); if (PUC_CHK_FAILED(result)) { msg.FormatMessage(IDS_ERROR_CODE, _T("PUC_SetFanCtrl"), result); AfxMessageBox(msg, MB_OK | MB_ICONERROR); } StartLive(); UpdateControlState(); } void CLiveTab::OnCbnSelchangeQuantization() { QUANTIZATION_MODE q = (QUANTIZATION_MODE)m_comboQuantization.GetItemData(m_comboQuantization.GetCurSel()); PUCRESULT result; CString msg; StopLive(); result = m_camera.SetQuantization(q); if (PUC_CHK_FAILED(result)) { msg.FormatMessage(IDS_ERROR_CODE, _T("PUC_SetQuantization"), result); AfxMessageBox(msg, MB_OK | MB_ICONERROR); } StartLive(); UpdateControlState(); } void CLiveTab::SetExposeTime() { PUCRESULT result; CString msg; StopLive(); result = PUC_SetExposeTime(m_camera.GetHandle(), m_xvExposeOn, m_xvExposeOff); if (PUC_CHK_FAILED(result)) { msg.FormatMessage(IDS_ERROR_CODE, _T("PUC_SetExposeTime"), result); AfxMessageBox(msg, MB_OK | MB_ICONERROR); } UpdateExposeTime(); UpdateResoComboBox(); UpdateSyncOutMagComboBox(); UpdateBuffer(); ResetDecodePos(); StartLive(); UpdateControlState(); } void CLiveTab::OnEnKillfocusExposeOn() { UpdateData(TRUE); SetExposeTime(); } void CLiveTab::OnEnKillfocusExposeOff() { UpdateData(TRUE); SetExposeTime(); } void CLiveTab::OnEnKillfocusDecodePos() { StopLive(); UpdateData(TRUE); ConfirmDecodePos(); StartLive(); } void CLiveTab::OnBnClickedSnapshot() { PUCRESULT result; CBitmapImage* pImage = NULL; CString filepath, sTmp; UINT64 nSerialNo; result = PUC_GetSerialNo(m_camera.GetHandle(), &nSerialNo); if (PUC_CHK_FAILED(result)) { AfxMessageBox(IDS_ERROR_SAVE, MB_OK | MB_ICONERROR); return; } sTmp.Format(_T("%llx"), nSerialNo); sTmp = MakeUpper(sTmp); pImage = m_camera.GetSingleImageStart(); if (!pImage) { m_camera.GetSingleImageEnd(); AfxMessageBox(IDS_ERROR_SAVE, MB_OK | MB_ICONERROR); return; } CDefaultParams& df = ((CCamMonitorApp*)AfxGetApp())->GetDefaultParams(); filepath.Format(_T("%s\\%s.bmp"), (LPCTSTR)df.cameraSaveFolderPath, (LPCTSTR)sTmp); if (!pImage->Save(filepath)) { m_camera.GetSingleImageEnd(); AfxMessageBox(IDS_ERROR_SAVE, MB_OK | MB_ICONERROR); return; } m_camera.GetSingleImageEnd(); AfxMessageBox(IDS_COMPLETED, MB_OK | MB_ICONINFORMATION); } void CLiveTab::OnBnClickedSaveTo() { CSaveLiveDialog dlg(this); if (dlg.DoModal() != IDOK) return; }
24.347079
123
0.749365
infinicam
e3028bc70fab84b4590d18f85286390ff3a83e29
1,797
hpp
C++
include/engine/utils/timing/Profiler.hpp
Ghabriel/CppGameArchitecture
1212cf1e140ba78d72f2aea2aff56ec8c3e23293
[ "Apache-2.0" ]
6
2018-08-05T21:45:23.000Z
2021-10-30T19:48:34.000Z
include/engine/utils/timing/Profiler.hpp
Ghabriel/CppGameArchitecture
1212cf1e140ba78d72f2aea2aff56ec8c3e23293
[ "Apache-2.0" ]
null
null
null
include/engine/utils/timing/Profiler.hpp
Ghabriel/CppGameArchitecture
1212cf1e140ba78d72f2aea2aff56ec8c3e23293
[ "Apache-2.0" ]
1
2021-11-01T20:15:38.000Z
2021-11-01T20:15:38.000Z
#ifndef UTILS_TIMING_PROFILER_HPP #define UTILS_TIMING_PROFILER_HPP #include <chrono> namespace engine::utils { /** * \brief Provides a simple way to profile arbitrary code. */ class Profiler { public: /** * \brief Starts a time measurement. */ void start() { startTime = std::chrono::steady_clock::now(); } /** * \brief Finishes a time measurement. The elapsed time can be obtained via * measure(), measureAsSeconds(), measureAsMilliseconds() or * measureAsMicroseconds(). */ void finish() { finishTime = std::chrono::steady_clock::now(); } /** * \brief Returns the elapsed time in an arbitrary time unit. */ template<typename T> intmax_t measure() const { return std::chrono::duration_cast<T>(finishTime - startTime).count(); } /** * \brief Returns the elapsed time in seconds, rounded down to * an integer. */ intmax_t measureAsSeconds() const { return measure<std::chrono::seconds>(); } /** * \brief Returns the elapsed time in milliseconds, rounded down to * an integer. */ intmax_t measureAsMilliseconds() const { return measure<std::chrono::milliseconds>(); } /** * \brief Returns the elapsed time in microseconds, rounded down to * an integer. */ intmax_t measureAsMicroseconds() const { return measure<std::chrono::microseconds>(); } private: std::chrono::steady_clock::time_point startTime; std::chrono::steady_clock::time_point finishTime; }; } #endif
26.820896
83
0.558152
Ghabriel
e30649c2f07dd51ddd50ac43a2e71ebf3206462c
1,176
cpp
C++
chapter12/StrBlob_VS2017/StrBlob/StrBlob.cpp
kingmax/cpp
b0c3abcfc77094421d906695a4ac167463a43b92
[ "Apache-2.0" ]
null
null
null
chapter12/StrBlob_VS2017/StrBlob/StrBlob.cpp
kingmax/cpp
b0c3abcfc77094421d906695a4ac167463a43b92
[ "Apache-2.0" ]
null
null
null
chapter12/StrBlob_VS2017/StrBlob/StrBlob.cpp
kingmax/cpp
b0c3abcfc77094421d906695a4ac167463a43b92
[ "Apache-2.0" ]
null
null
null
#include "StrBlob.h" StrBlob::StrBlob() : data(std::make_shared<std::vector<std::string>>()) {}; StrBlob::StrBlob(std::initializer_list<std::string> il) : data(std::make_shared<std::vector<std::string>>(il)) { } void StrBlob::check(StrBlob::size_type sz, const std::string &msg) const { if (sz >= data->size()) throw std::out_of_range(msg); } bool StrBlob::empty() const { return data->empty(); } StrBlob::size_type StrBlob::size() const { return data->size(); } std::string &StrBlob::front() { check(0, "front on empty StrBlob"); return data->front(); } const std::string &StrBlob::front() const { check(0, "const front on empty StrBlob"); return data->front(); } std::string &StrBlob::back() { check(0, "back on empty StrBlob"); return data->back(); } const std::string &StrBlob::back() const { check(0, "const back on empty StrBlob"); return data->back(); } void StrBlob::push_back(const std::string &s) { data->push_back(s); } void StrBlob::pop_back() { check(0, "pop_back on empty BlobStr"); data->pop_back(); } StrBlobPtr StrBlob::begin() { return StrBlobPtr(*this); } StrBlobPtr StrBlob::end() { return StrBlobPtr(*this, data->size()); }
17.043478
110
0.668367
kingmax
e309c1e95eee4987d9f7c0a8851787e62ea609c2
573
cpp
C++
AIPaddle.cpp
deviant-zairus/pong
ae76c13c5801212051749bfcc967d231c1821920
[ "Apache-2.0" ]
null
null
null
AIPaddle.cpp
deviant-zairus/pong
ae76c13c5801212051749bfcc967d231c1821920
[ "Apache-2.0" ]
null
null
null
AIPaddle.cpp
deviant-zairus/pong
ae76c13c5801212051749bfcc967d231c1821920
[ "Apache-2.0" ]
null
null
null
#include "AIPaddle.h" #include "Ball.h" AIPaddle::AIPaddle(Ball* ball) : Paddle(irr::core::vector3df(25.0f, 0.0f, 0.0f)) { this->_ball = ball; } AIPaddle::~AIPaddle() { } bool AIPaddle::Update(float deltaTime, InputHandler* ih) { irr::core::vector3df ballPos = this->_ball->GetPosition(); irr::core::vector3df myPos = this->_node->GetPosition(); if (ballPos.Y > myPos.Y) { this->_node->setPosition(myPos + (_velocity * deltaTime)); } else if (ballPos.Y < myPos.Y) { this->_nod->setPosition(myPos - (_velocity * deltaTime)); } Paddle::ValidatePosition(); }
21.222222
80
0.673647
deviant-zairus
e30afdc6cf6d5316ced351011cd5310134ba338e
465
cpp
C++
src/28-bucket-sort/cpp/main.cpp
MichaelZalla/data-structures-review
4ef1a70cf28031160eafc81fe3557791c58aed32
[ "MIT" ]
null
null
null
src/28-bucket-sort/cpp/main.cpp
MichaelZalla/data-structures-review
4ef1a70cf28031160eafc81fe3557791c58aed32
[ "MIT" ]
null
null
null
src/28-bucket-sort/cpp/main.cpp
MichaelZalla/data-structures-review
4ef1a70cf28031160eafc81fe3557791c58aed32
[ "MIT" ]
null
null
null
#include <vector> #include "../../utils/cpp/Assert.h" #include "../../utils/cpp/PrintVector.h" #include "./BucketSort.h" int main(int argc, char** argv) { int unsorted[] = { 5,5,1,2,4,5,1,4,2,4,2,3,1,2,4,5,1 }; int sorted[] = { 1,1,1,1,2,2,2,2,3,4,4,4,4,5,5,5,5 }; int n = sizeof(unsorted)/sizeof(int); std::vector<int> keys(unsorted, unsorted + n); bucketSort(keys); assert("Bucket sort", keys == std::vector<int>(sorted, sorted + n)); return 0; }
19.375
69
0.606452
MichaelZalla
e30f3f758f7d2715d8c7ab767c757482e7f5cd5c
852
cpp
C++
src/misaxx/core/misa_parameter_base.cpp
applied-systems-biology/misaxx-core
23d5523b75ef1a8870fba7a0363af2106924ca5f
[ "BSD-2-Clause" ]
null
null
null
src/misaxx/core/misa_parameter_base.cpp
applied-systems-biology/misaxx-core
23d5523b75ef1a8870fba7a0363af2106924ca5f
[ "BSD-2-Clause" ]
null
null
null
src/misaxx/core/misa_parameter_base.cpp
applied-systems-biology/misaxx-core
23d5523b75ef1a8870fba7a0363af2106924ca5f
[ "BSD-2-Clause" ]
null
null
null
/** * Copyright by Ruman Gerst * Research Group Applied Systems Biology - Head: Prof. Dr. Marc Thilo Figge * https://www.leibniz-hki.de/en/applied-systems-biology.html * HKI-Center for Systems Biology of Infection * Leibniz Institute for Natural Product Research and Infection Biology - Hans Knöll Insitute (HKI) * Adolf-Reichwein-Straße 23, 07745 Jena, Germany * * This code is licensed under BSD 2-Clause * See the LICENSE file provided with this code for the full license. */ #include <misaxx/core/misa_parameter_base.h> #include <misaxx/core/misa_json_schema_property.h> using namespace misaxx; misa_parameter_base::misa_parameter_base(misa_parameter_base::path t_location, std::shared_ptr<misa_json_schema_property> t_schema) : location(std::move(t_location)), schema(std::move(t_schema)) { }
40.571429
158
0.74061
applied-systems-biology
e3114210a4b46d76da8a8768405a17bd976435f6
407
hpp
C++
fts/fts_share/fts_define.hpp
iihiro/FHE-Table-Search
a035cf9af311a8cb123a08d5d1378acd739df4a4
[ "Apache-2.0" ]
2
2020-07-19T15:54:42.000Z
2020-08-20T06:35:05.000Z
fts/fts_share/fts_define.hpp
yamanalab/FHE-Table-Search
0104ace6e91409730cc6a58481a0f8459892d6dc
[ "Apache-2.0" ]
2
2020-07-09T01:41:40.000Z
2020-08-18T03:24:38.000Z
fts/fts_share/fts_define.hpp
iihiro/FHE-Table-Search
a035cf9af311a8cb123a08d5d1378acd739df4a4
[ "Apache-2.0" ]
1
2020-01-21T05:16:28.000Z
2020-01-21T05:16:28.000Z
#ifndef FTS_DEFINE_HPP #define FTS_DEFINE_HPP #define FTS_TIMEOUT_SEC (60) #define FTS_RETRY_INTERVAL_USEC (2000000) #define FTS_DEFAULT_MAX_CONCURRENT_QUERIES 128 #define FTS_DEFAULT_MAX_RESULTS 128 #define FTS_DEFAULT_MAX_RESULT_LIFETIME_SEC 50000 #define FTS_LUTFILE_EXT "csv" #define FTS_LUT_POSSIBLE_INPUT_NUM_ONE (819200) #define FTS_LUT_POSSIBLE_INPUT_NUM_TWO (4096) #endif /* FTS_DEFINE_HPP */
23.941176
49
0.847666
iihiro
e3136bb114d10a8599817c9a4b4a0b2273a949b4
1,288
cpp
C++
src/main/cpp/wpiliblua/dashboard.cpp
bvisness/FRCLuaTest
64fae7f258013af10d5d359fedf5c8902214730a
[ "BSD-3-Clause" ]
1
2021-11-11T23:18:58.000Z
2021-11-11T23:18:58.000Z
src/main/cpp/wpiliblua/dashboard.cpp
frc-2175/2021Lua
64fae7f258013af10d5d359fedf5c8902214730a
[ "BSD-3-Clause" ]
null
null
null
src/main/cpp/wpiliblua/dashboard.cpp
frc-2175/2021Lua
64fae7f258013af10d5d359fedf5c8902214730a
[ "BSD-3-Clause" ]
null
null
null
// Automatically generated by bindings.c. DO NOT EDIT. #include <wpi/StringRef.h> #include <wpi/ArrayRef.h> #include <frc/smartdashboard/SmartDashboard.h> #include "luadef.h" LUAFUNC void SmartDashboard_PutNumber(const char* keyName, double value) { frc::SmartDashboard::PutNumber((wpi::StringRef)keyName, value); } LUAFUNC void SmartDashboard_PutNumberArray( const char* keyName, double* value, size_t size) { frc::SmartDashboard::PutNumberArray((wpi::StringRef)keyName, wpi::ArrayRef(value, size)); } LUAFUNC void SmartDashboard_PutString(const char* keyName, const char* value) { frc::SmartDashboard::PutString((wpi::StringRef)keyName, (wpi::StringRef)value); } LUAFUNC void SmartDashboard_PutStringArray( const char* keyName, const char * * value, size_t size) { frc::SmartDashboard::PutStringArray((wpi::StringRef)keyName, wpi::ArrayRef(std::vector<std::string>(value, value + size))); } LUAFUNC void SmartDashboard_PutBoolean(const char* keyName, bool value) { frc::SmartDashboard::PutBoolean((wpi::StringRef)keyName, value); } LUAFUNC void SmartDashboard_PutBooleanArray( const char* keyName, int* value, size_t size) { frc::SmartDashboard::PutBooleanArray((wpi::StringRef)keyName, wpi::ArrayRef(value, size)); }
40.25
130
0.738354
bvisness
e31434cb7ae51ebbbc0295413f7cbdb6a0fda312
8,424
cpp
C++
src/argss/modules/akeys.cpp
cstrahan/argss
cc595bd9a1e4a2c079ea181ff26bdd58d9e65ace
[ "BSD-2-Clause" ]
1
2015-02-12T01:24:04.000Z
2015-02-12T01:24:04.000Z
src/argss/modules/akeys.cpp
cstrahan/argss
cc595bd9a1e4a2c079ea181ff26bdd58d9e65ace
[ "BSD-2-Clause" ]
null
null
null
src/argss/modules/akeys.cpp
cstrahan/argss
cc595bd9a1e4a2c079ea181ff26bdd58d9e65ace
[ "BSD-2-Clause" ]
null
null
null
///////////////////////////////////////////////////////////////////////////// // ARGSS - Copyright (c) 2009 - 2010, Alejandro Marzini (vgvgf) // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // // * Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// // Headers /////////////////////////////////////////////////////////// #include "argss/modules/akeys.h" /////////////////////////////////////////////////////////// // Global Variables /////////////////////////////////////////////////////////// VALUE ARGSS::AKeys::id; /////////////////////////////////////////////////////////// // ARGSS Keys initialize /////////////////////////////////////////////////////////// void ARGSS::AKeys::Init() { id = rb_define_module("Keys"); rb_define_const(id, "BACKSPACE", INT2FIX(1001)); rb_define_const(id, "TAB", INT2FIX(1002)); rb_define_const(id, "CLEAR", INT2FIX(1003)); rb_define_const(id, "RETURN", INT2FIX(1004)); rb_define_const(id, "PAUSE", INT2FIX(1005)); rb_define_const(id, "ESCAPE", INT2FIX(1006)); rb_define_const(id, "SPACE", INT2FIX(1007)); rb_define_const(id, "PGUP", INT2FIX(1008)); rb_define_const(id, "PGDN", INT2FIX(1009)); rb_define_const(id, "ENDS", INT2FIX(1010)); rb_define_const(id, "HOME", INT2FIX(1011)); rb_define_const(id, "LEFT", INT2FIX(1012)); rb_define_const(id, "UP", INT2FIX(1013)); rb_define_const(id, "RIGHT", INT2FIX(1014)); rb_define_const(id, "DOWN", INT2FIX(1015)); rb_define_const(id, "SNAPSHOT", INT2FIX(1016)); rb_define_const(id, "INSERT", INT2FIX(1017)); rb_define_const(id, "DEL", INT2FIX(1018)); rb_define_const(id, "SHIFT", INT2FIX(1019)); rb_define_const(id, "LSHIFT", INT2FIX(1020)); rb_define_const(id, "RSHIFT", INT2FIX(1021)); rb_define_const(id, "CTRL", INT2FIX(1022)); rb_define_const(id, "LCTRL", INT2FIX(1023)); rb_define_const(id, "RCTRL", INT2FIX(1024)); rb_define_const(id, "ALT", INT2FIX(1025)); rb_define_const(id, "LALT", INT2FIX(1026)); rb_define_const(id, "RALT", INT2FIX(1027)); rb_define_const(id, "N0", INT2FIX(1028)); rb_define_const(id, "N1", INT2FIX(1029)); rb_define_const(id, "N2", INT2FIX(1030)); rb_define_const(id, "N3", INT2FIX(1031)); rb_define_const(id, "N4", INT2FIX(1032)); rb_define_const(id, "N5", INT2FIX(1033)); rb_define_const(id, "N6", INT2FIX(1034)); rb_define_const(id, "N7", INT2FIX(1035)); rb_define_const(id, "N8", INT2FIX(1036)); rb_define_const(id, "N9", INT2FIX(1037)); rb_define_const(id, "A", INT2FIX(1038)); rb_define_const(id, "B", INT2FIX(1039)); rb_define_const(id, "C", INT2FIX(1040)); rb_define_const(id, "D", INT2FIX(1041)); rb_define_const(id, "E", INT2FIX(1042)); rb_define_const(id, "F", INT2FIX(1043)); rb_define_const(id, "G", INT2FIX(1044)); rb_define_const(id, "H", INT2FIX(1045)); rb_define_const(id, "I", INT2FIX(1046)); rb_define_const(id, "J", INT2FIX(1047)); rb_define_const(id, "K", INT2FIX(1048)); rb_define_const(id, "L", INT2FIX(1049)); rb_define_const(id, "M", INT2FIX(1050)); rb_define_const(id, "N", INT2FIX(1051)); rb_define_const(id, "O", INT2FIX(1052)); rb_define_const(id, "P", INT2FIX(1053)); rb_define_const(id, "Q", INT2FIX(1054)); rb_define_const(id, "R", INT2FIX(1055)); rb_define_const(id, "S", INT2FIX(1056)); rb_define_const(id, "T", INT2FIX(1057)); rb_define_const(id, "U", INT2FIX(1058)); rb_define_const(id, "V", INT2FIX(1059)); rb_define_const(id, "W", INT2FIX(1060)); rb_define_const(id, "X", INT2FIX(1061)); rb_define_const(id, "Y", INT2FIX(1062)); rb_define_const(id, "Z", INT2FIX(1063)); rb_define_const(id, "LOS", INT2FIX(1064)); rb_define_const(id, "ROS", INT2FIX(1065)); rb_define_const(id, "APPS", INT2FIX(1066)); rb_define_const(id, "KP0", INT2FIX(1067)); rb_define_const(id, "KP1", INT2FIX(1068)); rb_define_const(id, "KP2", INT2FIX(1069)); rb_define_const(id, "KP3", INT2FIX(1070)); rb_define_const(id, "KP4", INT2FIX(1071)); rb_define_const(id, "KP5", INT2FIX(1072)); rb_define_const(id, "KP6", INT2FIX(1073)); rb_define_const(id, "KP7", INT2FIX(1074)); rb_define_const(id, "KP8", INT2FIX(1075)); rb_define_const(id, "KP9", INT2FIX(1076)); rb_define_const(id, "MULTIPLY", INT2FIX(1077)); rb_define_const(id, "ADD", INT2FIX(1078)); rb_define_const(id, "SEPARATOR", INT2FIX(1079)); rb_define_const(id, "SUBTRACT", INT2FIX(1080)); rb_define_const(id, "DECIMAL", INT2FIX(1081)); rb_define_const(id, "DIVIDE", INT2FIX(1082)); rb_define_const(id, "F1", INT2FIX(1083)); rb_define_const(id, "F2", INT2FIX(1084)); rb_define_const(id, "F3", INT2FIX(1085)); rb_define_const(id, "F4", INT2FIX(1086)); rb_define_const(id, "F5", INT2FIX(1087)); rb_define_const(id, "F6", INT2FIX(1088)); rb_define_const(id, "F7", INT2FIX(1089)); rb_define_const(id, "F8", INT2FIX(1090)); rb_define_const(id, "F9", INT2FIX(1091)); rb_define_const(id, "F10", INT2FIX(1092)); rb_define_const(id, "F11", INT2FIX(1093)); rb_define_const(id, "F12", INT2FIX(1094)); rb_define_const(id, "CAPS_LOCK", INT2FIX(1095)); rb_define_const(id, "NUM_LOCK", INT2FIX(1096)); rb_define_const(id, "SCROLL_LOCK", INT2FIX(1097)); rb_define_const(id, "MOUSE_LEFT", INT2FIX(2001)); rb_define_const(id, "MOUSE_RIGHT", INT2FIX(2002)); rb_define_const(id, "MOUSE_MIDDLE", INT2FIX(2003)); rb_define_const(id, "MOUSE_XBUTTON1", INT2FIX(2004)); rb_define_const(id, "MOUSE_XBUTTON2", INT2FIX(2005)); rb_define_const(id, "JOY_1", INT2FIX(3001)); rb_define_const(id, "JOY_2", INT2FIX(3002)); rb_define_const(id, "JOY_3", INT2FIX(3003)); rb_define_const(id, "JOY_4", INT2FIX(3004)); rb_define_const(id, "JOY_5", INT2FIX(3005)); rb_define_const(id, "JOY_6", INT2FIX(3006)); rb_define_const(id, "JOY_7", INT2FIX(3007)); rb_define_const(id, "JOY_8", INT2FIX(3008)); rb_define_const(id, "JOY_9", INT2FIX(3009)); rb_define_const(id, "JOY_10", INT2FIX(3010)); rb_define_const(id, "JOY_11", INT2FIX(3011)); rb_define_const(id, "JOY_12", INT2FIX(3012)); rb_define_const(id, "JOY_13", INT2FIX(3013)); rb_define_const(id, "JOY_14", INT2FIX(3014)); rb_define_const(id, "JOY_15", INT2FIX(3015)); rb_define_const(id, "JOY_16", INT2FIX(3016)); rb_define_const(id, "JOY_17", INT2FIX(3017)); rb_define_const(id, "JOY_18", INT2FIX(3018)); rb_define_const(id, "JOY_19", INT2FIX(3019)); rb_define_const(id, "JOY_20", INT2FIX(3020)); rb_define_const(id, "JOY_21", INT2FIX(3021)); rb_define_const(id, "JOY_22", INT2FIX(3022)); rb_define_const(id, "JOY_23", INT2FIX(3023)); rb_define_const(id, "JOY_24", INT2FIX(3024)); rb_define_const(id, "JOY_25", INT2FIX(3025)); rb_define_const(id, "JOY_26", INT2FIX(3026)); rb_define_const(id, "JOY_27", INT2FIX(3027)); rb_define_const(id, "JOY_28", INT2FIX(3028)); rb_define_const(id, "JOY_29", INT2FIX(3029)); rb_define_const(id, "JOY_30", INT2FIX(3030)); rb_define_const(id, "JOY_31", INT2FIX(3031)); rb_define_const(id, "JOY_32", INT2FIX(3032)); }
47.061453
78
0.647317
cstrahan
e3150079d1432cceb4c51ea2bda9e1f9307372bf
520
hpp
C++
library/ATF/_pvp_order_view_end_zoclInfo.hpp
lemkova/Yorozuya
f445d800078d9aba5de28f122cedfa03f26a38e4
[ "MIT" ]
29
2017-07-01T23:08:31.000Z
2022-02-19T10:22:45.000Z
library/ATF/_pvp_order_view_end_zoclInfo.hpp
kotopes/Yorozuya
605c97d3a627a8f6545cc09f2a1b0a8afdedd33a
[ "MIT" ]
90
2017-10-18T21:24:51.000Z
2019-06-06T02:30:33.000Z
library/ATF/_pvp_order_view_end_zoclInfo.hpp
kotopes/Yorozuya
605c97d3a627a8f6545cc09f2a1b0a8afdedd33a
[ "MIT" ]
44
2017-12-19T08:02:59.000Z
2022-02-24T23:15:01.000Z
// This file auto generated by plugin for ida pro. Generated code only for x64. Please, dont change manually #pragma once #include <common/common.h> #include <_pvp_order_view_end_zocl.hpp> START_ATF_NAMESPACE namespace Info { using _pvp_order_view_end_zoclsize2_ptr = int (WINAPIV*)(struct _pvp_order_view_end_zocl*); using _pvp_order_view_end_zoclsize2_clbk = int (WINAPIV*)(struct _pvp_order_view_end_zocl*, _pvp_order_view_end_zoclsize2_ptr); }; // end namespace Info END_ATF_NAMESPACE
34.666667
135
0.776923
lemkova
e31570afb71316f7e4160f8369a6fe6a8f742191
1,457
cpp
C++
src/bullet.cpp
Harrand/Asteroids-Topaz
ce549802b0360f2554f4f6189d6ca0a486c4c928
[ "Apache-2.0" ]
null
null
null
src/bullet.cpp
Harrand/Asteroids-Topaz
ce549802b0360f2554f4f6189d6ca0a486c4c928
[ "Apache-2.0" ]
null
null
null
src/bullet.cpp
Harrand/Asteroids-Topaz
ce549802b0360f2554f4f6189d6ca0a486c4c928
[ "Apache-2.0" ]
null
null
null
// // Created by Harrand on 25/08/2018. // #include "bullet.hpp" #include "entity_manager.hpp" Bullet::Bullet(Vector2F position, Vector2F velocity, const Texture* bullet_texture, EntityManager& manager, DynamicSprite* shooter): DynamicSprite(1.0f, position, 0.0f, {Bullet::bullet_size, Bullet::bullet_size}, bullet_texture, velocity * Bullet::base_bullet_speed_multiplier), manager(manager), shooter(shooter) { if(this->shooter != nullptr) this->velocity += this->shooter->velocity; } void Bullet::on_collision(Asteroid& asteroid) { Player* player_component = dynamic_cast<Player*>(this->shooter); if(player_component != nullptr) { player_component->set_score(player_component->get_score() + Asteroid::get_score_on_kill(asteroid.get_type())); } this->manager.remove_sprite(*this); asteroid.explode(this->manager); Asteroid::play_explosion_sound(); } void Bullet::on_collision(Player& player) { // A player's own bullet cannot collide with itself. if(&player == this->shooter) return; std::cout << "bullet collided with player.\n"; } void Bullet::on_collision(PhysicsObject& other) { Asteroid* asteroid_component = dynamic_cast<Asteroid*>(&other); Player* player_component = dynamic_cast<Player*>(&other); if(asteroid_component != nullptr) this->on_collision(*asteroid_component); if(player_component != nullptr) this->on_collision(*player_component); }
34.690476
313
0.716541
Harrand
e319f162f2ac133c1961311e5cfbf7466a3f887a
8,669
cpp
C++
src/vertexcover.cpp
manighahrmani/PACE2017-min-fill
496fffc8b61b3507611ab118f211dc06457e0855
[ "MIT" ]
1
2020-05-29T15:47:16.000Z
2020-05-29T15:47:16.000Z
src/vertexcover.cpp
manighahrmani/PACE2017-min-fill
496fffc8b61b3507611ab118f211dc06457e0855
[ "MIT" ]
null
null
null
src/vertexcover.cpp
manighahrmani/PACE2017-min-fill
496fffc8b61b3507611ab118f211dc06457e0855
[ "MIT" ]
1
2020-05-29T15:47:21.000Z
2020-05-29T15:47:21.000Z
#include "vertexcover.hpp" #include "graph.hpp" #include "timer.hpp" #include "global.hpp" #include <vector> #include <queue> #include <cassert> #include <iostream> #include <cstring> #include <algorithm> #include <map> #define F first #define S second using namespace std; namespace VertexCover { int uu[maxN]; int u[maxN]; Timer VCtimer; int m1[maxN]; int m2[maxN]; int layer[2*maxN]; int bfs[2*maxN]; int z[2*maxN]; int v[2*maxN]; int dQ[maxN]; void findZ(const Graph& G, int x) { if (z[x]) return; z[x] = 1; assert(x%2 == 0); for (int nx : G.g[x/2]) { if (nx != m1[x/2]) { z[nx*2+1] = 1; if (m2[nx] != -1) findZ(G, m2[nx]*2); } } } int hkdfs(const Graph& G, int x) { int la = layer[x]; assert(la > 0); layer[x] = 0; assert(la%2 != x%2); if (x%2 == 1) { for (int nx : G.g[x/2]) { if (nx != m2[x/2] && layer[nx*2] == la-1) { int ff = hkdfs(G, nx*2); if (ff) { m2[x/2] = nx; m1[nx] = x/2; return 1; } } } return 0; } else { if (la == 1) { return 1; } if (m1[x/2] != -1 && layer[m1[x/2]*2+1] == la-1) { int ff = hkdfs(G, m1[x/2]*2+1); if (ff) return 1; } return 0; } } pair<int, vector<int> > LPVC(const Graph& G) { fill(m1, m1 + G.n, -1); fill(m2, m2 + G.n, -1); int iter = 0; while (1) { iter++; fill(layer, layer + G.n*2, 0); int bfsi1 = 0; int bfsi2 = 0; for (int i = 0; i < G.n; i++) { if (m1[i] == -1 && G.g[i].size() > 0) { layer[i*2] = 1; bfs[bfsi2++] = i*2; } } int f = 0; while (bfsi1 < bfsi2) { int x = bfs[bfsi1++]; if (x%2 == 1) { if (m2[x/2] == -1) { f = layer[x]; break; } else { if (layer[m2[x/2]*2] == 0) { layer[m2[x/2]*2] = layer[x]+1; bfs[bfsi2++] = m2[x/2]*2; } } } else { for (int nx : G.g[x/2]) { if (nx != m1[x/2] && layer[nx*2+1] == 0) { layer[nx*2+1] = layer[x]+1; bfs[bfsi2++] = nx*2+1; } } } } if (f == 0) break; assert(f>1); assert(f%2 == 0); int fo = 0; for (int i = 0; i < G.n; i++) { if (layer[i*2+1] == f && m2[i] == -1) { fo += hkdfs(G, i*2+1); } } assert(fo > 0); } assert(iter*iter <= 16*G.n); int val = 0; for (int i = 0; i < G.n; i++) { if (m1[i] != -1) val++; } fill(z, z + G.n*2, 0); for (int i = 0; i < G.n; i++) { if (m1[i] == -1) { findZ(G, i*2); } } fill(v, v + G.n*2, 0); for (int i = 0; i < 2*G.n; i++) { if (i%2 == 0) { if (!z[i]) { v[i] = 1; } } else { if (z[i]) { v[i] = 1; } } } int cval = 0; for (int i = 0; i < 2*G.n; i++) { cval += v[i]; if (v[i] == 0) { for (int nx : G.g[i/2]) { if (i%2 == 0) { assert(v[nx*2+1] == 1); } else { assert(v[nx*2] == 1); } } } } assert(cval == val); vector<int> ret; for (int i = 0; i < G.n; i++) { if (v[i*2] && v[i*2+1]) ret.push_back(i); } return {val, ret}; } int lowerBound2A(Graph G) { int bound = 0; queue<int> d1; for (int i = 0; i < G.n; i++) { assert(G.g[i].size() > 0); if (G.g[i].size() == 1) d1.push(i); } for (int i = 0; i < G.n; i++) { while (!d1.empty()) { int x = d1.front(); d1.pop(); if (G.g[x].size() == 0) continue; assert(G.g[x].size() == 1); int t = G.g[x][0]; bound++; for (int nx : G.g[t]) { if (G.g[nx].size() == 2) { d1.push(nx); } } G.remIncident(t); assert(G.g[x].size() == 0); assert(G.g[t].size() == 0); } if (G.g[i].size() == 0) continue; assert(G.g[i].size() > 1); int t = G.g[i][0]; for (int nx : G.g[i]) { if (G.g[nx].size() < G.g[t].size()) { t = nx; } } for (int nx : G.g[i]) { if (nx != t && G.g[nx].size() == 2) { d1.push(nx); } else if (nx != t && G.g[nx].size() == 3 && G.hasEdge(t, nx)) { d1.push(nx); } } for (int nx : G.g[t]) { if (nx != i && G.g[nx].size() == 2) { d1.push(nx); } } bound++; G.remIncident(t); G.remIncident(i); assert(G.g[t].size() == 0); assert(G.g[i].size() == 0); } return bound; } int dfs(const Graph& G, int x) { if (uu[x]) return 0; uu[x] = 1; int r = 1; for (int nx : G.g[x]) { r += dfs(G, nx); } return r; } void getCC(const Graph& G, int x, vector<pair<int, int> >& es) { if (u[x]) return; u[x] = 1; for (int nx : G.g[x]) { if (nx > x) es.push_back({x, nx}); getCC(G, nx, es); } } // find the best solution that is at most upperBound or report that it does not exist bool optSolve(Graph& G, int upperBound, vector<int>& sol) { if (upperBound < 0) return false; if (upperBound == 0 && G.m > 0) return false; if (G.m == 0) return true; assert(upperBound > 0); int dQ1 = 0; int dQ2 = 0; for (int i = 0; i < G.n; i++) { if (G.g[i].size() == 1) dQ[dQ2++] = G.g[i][0]; if ((int)G.g[i].size() > upperBound) dQ[dQ2++] = i; } bool fr = true; vector<pair<int, int> > remd; while (dQ1 < dQ2 || fr) { fr = false; while (dQ1 < dQ2) { while (dQ1 < dQ2) { int x = dQ[dQ1++]; if (G.g[x].size() == 0) continue; if (upperBound == 0) { G.addEdges(remd); return false; } sol.push_back(x); G.remIncident(x, remd); assert(G.g[x].size() == 0); upperBound--; } for (int i = 0; i < G.n; i++) { if (G.g[i].size() == 1) dQ[dQ2++] = G.g[i][0]; if ((int)G.g[i].size() > upperBound) dQ[dQ2++] = i; } } auto LPV = LPVC(G); if (LPV.F > 2*upperBound) { G.addEdges(remd); return false; } assert((int)LPV.S.size() <= upperBound); for (int x : LPV.S) { sol.push_back(x); assert(G.g[x].size() > 0); G.remIncident(x, remd); assert(G.g[x].size() == 0); upperBound--; } assert(upperBound >= 0); for (int i = 0; i < G.n; i++) { if (G.g[i].size() == 1) dQ[dQ2++] = G.g[i][0]; if ((int)G.g[i].size() > upperBound) dQ[dQ2++] = i; } } if (G.m == 0) { G.addEdges(remd); return true; } if (upperBound == 0) { G.addEdges(remd); return false; } assert(upperBound > 0); int maxD = 0; int maxDx = -1; int fo = 0; for (int i = 0; i < G.n; i++) { assert(G.g[i].size() != 1); if ((int)G.g[i].size() > maxD) { maxD = G.g[i].size(); maxDx = i; } if ((int)G.g[i].size() > 0) fo++; } assert(maxD <= upperBound); assert(maxD > 0); if (maxD == 2) { fill(uu, uu + G.n, 0); for (int i = 0; i < G.n; i++) { if (uu[i] == 0 && G.g[i].size() > 0) { int sz = dfs(G, i); assert(sz >= 3); upperBound -= (sz+1)/2; if (upperBound < 0) { G.addEdges(remd); return false; } } } for (int i = 0; i < G.n; i++) { if (uu[i] == 1) { assert(G.g[i].size() == 2); int sz = 0; int x = i; while (uu[x] == 1) { sz++; if (sz%2 == 1) { sol.push_back(x); } uu[x] = 2; for (int nx : G.g[x]) { if (uu[nx] == 1) { x = nx; break; } } } } } G.addEdges(remd); return true; } assert(maxD >= 3); vector<int> nb = G.g[maxDx]; vector<pair<int, int> > co1; memset(u, 0, sizeof(int)*G.n); for (int i = 0; i < G.n; i++) { if (G.g[i].size() > 0) { getCC(G, i, co1); assert(co1.size() > 0); break; } } assert((int)co1.size() <= G.m); if ((int)co1.size() < G.m || G.m*2 < G.n) { vector<vector<pair<int, int> > > cos = {co1}; for (int i = 0; i < G.n; i++) { if (G.g[i].size() > 0 && !u[i]) { cos.push_back(vector<pair<int, int> >()); getCC(G, i, cos.back()); assert(cos.back().size() > 0); } } G.addEdges(remd); vector<int> soltt; for (auto& co : cos) { Graph CC(co); vector<int> solt; bool s = optSolve(CC, upperBound - (int)soltt.size(), solt); if (!s) return false; solt = CC.mapBack(solt); soltt.insert(soltt.end(), solt.begin(), solt.end()); } sol.insert(sol.end(), soltt.begin(), soltt.end()); assert((int)soltt.size() <= upperBound); return true; } vector<int> sol1; G.remIncident(maxDx, remd); sol1.push_back(maxDx); bool s1 = optSolve(G, upperBound - (int)sol1.size(), sol1); if (s1) { assert((int)sol1.size() <= upperBound); upperBound = (int)sol1.size()-1; } vector<int> sol2; for (int x : nb) { sol2.push_back(x); G.remIncident(x, remd); } bool s2 = optSolve(G, upperBound - (int)sol2.size(), sol2); G.addEdges(remd); if (s2) { if (s1) assert(sol2.size() < sol1.size()); sol.insert(sol.end(), sol2.begin(), sol2.end()); return true; } else if (s1) { sol.insert(sol.end(), sol1.begin(), sol1.end()); return true; } else{ return false; } } vector<int> exactSol(const Graph& G) { if (G.m == 0) return {}; VCtimer.start(); vector<int> solv; Graph GG = G; bool ok = optSolve(GG, G.n-1, solv); assert(ok); VCtimer.stop(); return solv; } double getTimeUsed() { return VCtimer.getTime().count(); } }
20.160465
85
0.484139
manighahrmani
e31cc4ed04daf4742c02d2081185cffe9397ed0c
3,136
cpp
C++
src/DataTransmit.cpp
jellysheep/spheresim
8475371f987c3c68ade1116ee7824adcfe702d35
[ "BSD-3-Clause" ]
1
2015-03-20T15:09:53.000Z
2015-03-20T15:09:53.000Z
src/DataTransmit.cpp
jellysheep/spheresim
8475371f987c3c68ade1116ee7824adcfe702d35
[ "BSD-3-Clause" ]
null
null
null
src/DataTransmit.cpp
jellysheep/spheresim
8475371f987c3c68ade1116ee7824adcfe702d35
[ "BSD-3-Clause" ]
null
null
null
/** \file * \author Max Mertens <max.mail@dameweb.de> * \section LICENSE * Copyright (c) 2013, Max Mertens. * All rights reserved. * This file is licensed under the "BSD 3-Clause License". * Full license text is under the file "LICENSE" provided with this code. */ #include "Sphere.hpp" #include "DataTransmit.hpp" using namespace SphereSim; void SphereSim::writeBool(std::ostream& stream, bool b) { stream.write((char*)&b, 1); } bool SphereSim::readBool(std::istream& stream) { bool b; stream.read((char*)&b, 1); return b; } void SphereSim::writeChar(std::ostream& stream, unsigned char c) { stream.write((char*)&c, 1); } char SphereSim::readChar(std::istream& stream) { unsigned char c; stream.read((char*)&c, 1); return c; } void SphereSim::writeShort(std::ostream& stream, unsigned short s) { stream.write((char*)&s, 2); } unsigned short SphereSim::readShort(std::istream& stream) { unsigned short s; stream.read((char*)&s, 2); return s; } void SphereSim::writeInt(std::ostream& stream, unsigned int i) { stream.write((char*)&i, 4); } unsigned int SphereSim::readInt(std::istream& stream) { unsigned int i; stream.read((char*)&i, 4); return i; } void SphereSim::writeFloat(std::ostream& stream, float f) { stream.write((char*)&f, 4); } float SphereSim::readFloat(std::istream& stream) { float f; stream.read((char*)&f, 8); return f; } void SphereSim::writeDouble(std::ostream& stream, double d) { stream.write((char*)&d, 8); } double SphereSim::readDouble(std::istream& stream) { double d; stream.read((char*)&d, 8); return d; } void SphereSim::writeVector3(std::ostream& stream, Vector3 v) { writeDouble(stream, v(0)); writeDouble(stream, v(1)); writeDouble(stream, v(2)); } Vector3 SphereSim::readVector3(std::istream& stream) { Vector3 v; v(0) = readDouble(stream); v(1) = readDouble(stream); v(2) = readDouble(stream); return v; } void SphereSim::writeString(std::ostream& stream, std::string s) { writeShort(stream, s.size()); stream.write(s.c_str(), s.size()); } std::string SphereSim::readString(std::istream& stream) { unsigned short size = readShort(stream); char* c_str = new char[size]; stream.read(c_str, size); std::string s(c_str, size); delete[] c_str; return s; } void SphereSim::writeBasicSphereData(std::ostream& stream, Sphere& s) { writeDouble(stream, s.radius); writeVector3(stream, s.pos); } void SphereSim::readBasicSphereData(std::istream& stream, Sphere& s) { s.radius = readDouble(stream); s.pos = readVector3(stream); } void SphereSim::writeAllSphereData(std::ostream& stream, Sphere& s) { writeDouble(stream, s.radius); writeDouble(stream, s.mass); writeVector3(stream, s.pos); writeVector3(stream, s.speed); writeVector3(stream, s.acc); } void SphereSim::readAllSphereData(std::istream& stream, Sphere& s) { s.radius = readDouble(stream); s.mass = readDouble(stream); s.pos = readVector3(stream); s.speed = readVector3(stream); s.acc = readVector3(stream); }
21.333333
76
0.661352
jellysheep
e321181c29b25910e4fcaec2e4a55f7475ca0b53
6,706
cpp
C++
ecmascript/interpreter/frame_handler.cpp
openharmony-sig-ci/ark_js_runtime
72fcff4c114fd8323c9a5d1a835efeac043e9a72
[ "Apache-2.0" ]
null
null
null
ecmascript/interpreter/frame_handler.cpp
openharmony-sig-ci/ark_js_runtime
72fcff4c114fd8323c9a5d1a835efeac043e9a72
[ "Apache-2.0" ]
null
null
null
ecmascript/interpreter/frame_handler.cpp
openharmony-sig-ci/ark_js_runtime
72fcff4c114fd8323c9a5d1a835efeac043e9a72
[ "Apache-2.0" ]
1
2021-09-13T12:12:04.000Z
2021-09-13T12:12:04.000Z
/* * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "ecmascript/interpreter/frame_handler.h" #include "ecmascript/interpreter/interpreter.h" #include "ecmascript/js_thread.h" #include "libpandafile/bytecode_instruction-inl.h" namespace panda::ecmascript { EcmaFrameHandler::EcmaFrameHandler(const JSThread *thread) { sp_ = const_cast<JSTaggedType *>(thread->GetCurrentSPFrame()); } bool EcmaFrameHandler::HasFrame() const { if (sp_ == nullptr) { return false; } // Should not be a break frame return !IsBreakFrame(); } bool EcmaFrameHandler::IsBreakFrame() const { ASSERT(sp_ != nullptr); // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) FrameState *state = reinterpret_cast<FrameState *>(sp_) - 1; return state->sp == nullptr; } void EcmaFrameHandler::PrevFrame() { ASSERT(HasFrame()); // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) FrameState *state = reinterpret_cast<FrameState *>(sp_) - 1; sp_ = state->prev; } EcmaFrameHandler EcmaFrameHandler::GetPrevFrame() const { ASSERT(HasFrame()); // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) FrameState *state = reinterpret_cast<FrameState *>(sp_) - 1; return EcmaFrameHandler(state->prev); } JSTaggedValue EcmaFrameHandler::GetVRegValue(size_t index) const { ASSERT(HasFrame()); // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) return JSTaggedValue(sp_[index]); } void EcmaFrameHandler::SetVRegValue(size_t index, JSTaggedValue value) { ASSERT(HasFrame()); // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) sp_[index] = value.GetRawData(); } JSTaggedValue EcmaFrameHandler::GetAcc() const { ASSERT(HasFrame()); // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) FrameState *state = reinterpret_cast<FrameState *>(sp_) - 1; return state->acc; } uint32_t EcmaFrameHandler::GetSize() const { ASSERT(HasFrame()); // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) FrameState *state = reinterpret_cast<FrameState *>(sp_) - 1; JSTaggedType *prevSp = state->prev; ASSERT(prevSp != nullptr); auto size = (prevSp - sp_) - FRAME_STATE_SIZE; return static_cast<uint32_t>(size); } uint32_t EcmaFrameHandler::GetBytecodeOffset() const { ASSERT(HasFrame()); // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) FrameState *state = reinterpret_cast<FrameState *>(sp_) - 1; // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) auto offset = state->pc - JSMethod::Cast(state->method)->GetBytecodeArray(); return static_cast<uint32_t>(offset); } JSMethod *EcmaFrameHandler::GetMethod() const { ASSERT(HasFrame()); // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) FrameState *state = reinterpret_cast<FrameState *>(sp_) - 1; return state->method; } JSTaggedValue EcmaFrameHandler::GetFunction() const { ASSERT(HasFrame()); // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) FrameState *state = reinterpret_cast<FrameState *>(sp_) - 1; uint32_t numVregs = state->method->GetNumVregs(); // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) auto func = JSTaggedValue(sp_[numVregs]); return func; } const uint8_t *EcmaFrameHandler::GetPc() const { ASSERT(HasFrame()); // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) FrameState *state = reinterpret_cast<FrameState *>(sp_) - 1; return state->pc; } JSTaggedType *EcmaFrameHandler::GetSp() const { ASSERT(HasFrame()); // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) FrameState *state = reinterpret_cast<FrameState *>(sp_) - 1; return state->sp; } ConstantPool *EcmaFrameHandler::GetConstpool() const { ASSERT(HasFrame()); // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) FrameState *state = reinterpret_cast<FrameState *>(sp_) - 1; return state->constpool; } JSTaggedValue EcmaFrameHandler::GetEnv() const { ASSERT(HasFrame()); // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) FrameState *state = reinterpret_cast<FrameState *>(sp_) - 1; return state->env; } void EcmaFrameHandler::Iterate(const RootVisitor &v0, const RootRangeVisitor &v1) { JSTaggedType *current = sp_; while (current != nullptr) { // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) FrameState *state = reinterpret_cast<FrameState *>(current) - 1; if (state->sp != nullptr) { uintptr_t start = ToUintPtr(current); // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) FrameState *prev_state = reinterpret_cast<FrameState *>(state->prev) - 1; uintptr_t end = ToUintPtr(prev_state); v1(Root::ROOT_FRAME, ObjectSlot(start), ObjectSlot(end)); if (state->pc != nullptr) { // interpreter frame v0(Root::ROOT_FRAME, ObjectSlot(ToUintPtr(&state->acc))); v0(Root::ROOT_FRAME, ObjectSlot(ToUintPtr(&state->constpool))); v0(Root::ROOT_FRAME, ObjectSlot(ToUintPtr(&state->env))); v0(Root::ROOT_FRAME, ObjectSlot(ToUintPtr(&state->profileTypeInfo))); } } current = state->prev; } } void EcmaFrameHandler::DumpStack(std::ostream &os) const { size_t i = 0; EcmaFrameHandler frameHandler(sp_); for (; frameHandler.HasFrame(); frameHandler.PrevFrame()) { os << "[" << i++ << "]:" << frameHandler.GetMethod()->ParseFunctionName() << "\n"; } } void EcmaFrameHandler::DumpPC(std::ostream &os, const uint8_t *pc) const { EcmaFrameHandler frameHandler(sp_); ASSERT(frameHandler.HasFrame()); // NOLINTNEXTLINE(cppcoreguidelines-narrowing-conversions, bugprone-narrowing-conversions) int offset = pc - JSMethod::Cast(frameHandler.GetMethod())->GetBytecodeArray(); os << "offset: " << offset << "\n"; } } // namespace panda::ecmascript
33.19802
94
0.700268
openharmony-sig-ci
e3232cb7da6a0da1723a513c5499943d2cb043e1
1,277
hpp
C++
include/meevax/kernel/stack.hpp
yamacir-kit/meevax
ff9449a16380eac727c914a33449e9b3a7597b8e
[ "Apache-2.0" ]
13
2018-11-27T02:06:58.000Z
2022-01-01T16:07:12.000Z
include/meevax/kernel/stack.hpp
yamacir-kit/meevax
ff9449a16380eac727c914a33449e9b3a7597b8e
[ "Apache-2.0" ]
89
2017-11-24T23:58:06.000Z
2022-02-06T14:54:01.000Z
include/meevax/kernel/stack.hpp
yamacir-kit/meevax
ff9449a16380eac727c914a33449e9b3a7597b8e
[ "Apache-2.0" ]
4
2017-12-22T15:45:46.000Z
2020-01-12T19:50:45.000Z
/* Copyright 2018-2021 Tatsuya Yamasaki. 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 INCLUDED_MEEVAX_KERNEL_STACK_HPP #define INCLUDED_MEEVAX_KERNEL_STACK_HPP #include <meevax/kernel/list.hpp> namespace meevax { inline namespace kernel { template <typename T, typename... Ts> auto push(T&& stack, Ts&&... xs) -> decltype(auto) { return stack = cons(std::forward<decltype(xs)>(xs)..., stack); } template <std::size_t N, typename T> auto pop(T&& stack) -> decltype(auto) { return stack = std::next(std::begin(stack), N); } template <typename T> auto pop(T&& stack) { let const x = car(stack); pop<1>(stack); return x; } } // namespace kernel } // namespace meevax #endif // INCLUDED_MEEVAX_KERNEL_STACK_HPP
26.061224
75
0.703994
yamacir-kit
e326c9f13c30636263244c06e30fc48f88dbb966
1,716
cpp
C++
dialog.cpp
mguludag/QtIFW_Frontend
1f670e4e633ed5fc92412d523a7365c6b16ade58
[ "BSL-1.0" ]
11
2020-12-28T13:53:16.000Z
2022-03-29T04:19:32.000Z
dialog.cpp
mguludag/QtIFW_Frontend
1f670e4e633ed5fc92412d523a7365c6b16ade58
[ "BSL-1.0" ]
null
null
null
dialog.cpp
mguludag/QtIFW_Frontend
1f670e4e633ed5fc92412d523a7365c6b16ade58
[ "BSL-1.0" ]
1
2020-12-28T13:53:24.000Z
2020-12-28T13:53:24.000Z
/***************************************************************************** * dialog.cpp * * Created: 12/20/2020 2020 by mguludag * * Copyright 2020 mguludag. All rights reserved. * * This file may be distributed under the terms of GNU Public License version * 3 (GPL v3) as defined by the Free Software Foundation (FSF). A copy of the * license should have been included with this file, or the project in which * this file belongs to. You may also find the details of GPL v3 at: * http://www.gnu.org/licenses/gpl-3.0.txt * * If you have any questions regarding the use of this file, feel free to * contact the author of this file, or the owner of the project in which * this file belongs to. *****************************************************************************/ #include "dialog.hpp" #include "ui_dialog.h" Dialog::Dialog(QWidget *parent) : QDialog(parent), ui(new Ui::Dialog) { ui->setupUi(this); Settings::init(Settings::Format::iniFormat, "settings.ini"); ui->lineEdit_qtbinpath->setText( Settings::readSettings("Qt_IFW_Bins", "Path").toString()); ifw_path = ui->lineEdit_qtbinpath->text(); } Dialog::~Dialog() { delete ui; } void Dialog::on_buttonBox_accepted() { Settings::writeSettings("Qt_IFW_Bins", "Path", ui->lineEdit_qtbinpath->text()); } QString Dialog::getIfw_path() const { return ifw_path; } void Dialog::on_toolButton_qtifw_clicked() { ui->lineEdit_qtbinpath->setText(QFileDialog::getExistingDirectory( this, tr("Open Qt Bin Directory"), QDir::rootPath(), QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks)); ifw_path = ui->lineEdit_qtbinpath->text(); }
39
80
0.626457
mguludag
e327f8aaa69d6be9637dd6975423007026dd67e8
59
cpp
C++
src/base/shape.cpp
wzhhh123/SimpleRT
e2ff1a2773eecbc388568fdc2b5c20ead45d262d
[ "Apache-2.0" ]
null
null
null
src/base/shape.cpp
wzhhh123/SimpleRT
e2ff1a2773eecbc388568fdc2b5c20ead45d262d
[ "Apache-2.0" ]
null
null
null
src/base/shape.cpp
wzhhh123/SimpleRT
e2ff1a2773eecbc388568fdc2b5c20ead45d262d
[ "Apache-2.0" ]
null
null
null
#include "shape.h" FLOAT Shape::Area() { return 0; }
6.555556
33
0.576271
wzhhh123
e32921ab796018ed3107d779fbe74a96a7df96b3
5,673
cpp
C++
src/stream_transformer_payload_to_payload.cpp
luibass92/mqttraffic-warden
a421b04aff99927e92f0bda4c0543af91abef6c5
[ "MIT" ]
null
null
null
src/stream_transformer_payload_to_payload.cpp
luibass92/mqttraffic-warden
a421b04aff99927e92f0bda4c0543af91abef6c5
[ "MIT" ]
null
null
null
src/stream_transformer_payload_to_payload.cpp
luibass92/mqttraffic-warden
a421b04aff99927e92f0bda4c0543af91abef6c5
[ "MIT" ]
null
null
null
#include "stream_transformer_payload_to_payload.h" #include <iostream> #include "cast.h" #include "exceptions.h" #include "json_utilities.h" #include "spdlog/spdlog.h" #include "utilities.h" namespace tw { void StreamTransformerPayloadToPayload::setup(const nlohmann::json& p_json) { if (!is_valid_setup(p_json)) { spdlog::error("{} has an invalid setup", get_class_name()); throw StreamTransformerSetupException(); } // mandatory fields m_transformation.fromPayload = p_json[k_from].get<std::string>(); m_transformation.toPayload = p_json[k_to].get<std::string>(); // optional fields if (p_json.contains(k_as)) { if (k_typeNumber == p_json[k_as].get<std::string>()) { m_transformation.asType = JsonType::Number; } else if (k_typeString == p_json[k_as].get<std::string>()) { m_transformation.asType = JsonType::String; } else if (k_typeBoolean == p_json[k_as].get<std::string>()) { m_transformation.asType = JsonType::Boolean; } else { spdlog::error( "{} '{}' key must have one of the " "following values: {}", get_class_name(), k_as, fmt::join(k_types, ", ")); throw StreamTransformerSetupException(); } } else { m_transformation.asType = JsonType::JsonTypeUnknown; } if (p_json.contains(k_keep)) { m_transformation.keep = p_json[k_keep].get<bool>(); } else { m_transformation.keep = false; } } void StreamTransformerPayloadToPayload::execute( const std::string&, const nlohmann::json& p_inputPayload, std::string&, nlohmann::json& p_outputPayload) { if (m_transformation.asType == JsonType::JsonTypeUnknown) { // No type conversion p_outputPayload[m_transformation.toPayload] = p_inputPayload.at(m_transformation.fromPayload); } else { // Type conversion std::string l_inputPayloadStr = ""; if (p_inputPayload.at(m_transformation.fromPayload).is_string()) { l_inputPayloadStr = p_inputPayload.at(m_transformation.fromPayload); } else { l_inputPayloadStr = utilities::dump_json(p_inputPayload.at(m_transformation.fromPayload)); } switch (m_transformation.asType) { case JsonType::Number: if (utilities::isInt(l_inputPayloadStr)) { p_outputPayload[m_transformation.toPayload] = utilities::lexical_cast<long>(l_inputPayloadStr.c_str()); } else if (utilities::isFloat(l_inputPayloadStr)) { p_outputPayload[m_transformation.toPayload] = utilities::lexical_cast<float>(l_inputPayloadStr.c_str()); } else if (utilities::isDouble(l_inputPayloadStr)) { p_outputPayload[m_transformation.toPayload] = utilities::lexical_cast<double>(l_inputPayloadStr.c_str()); } else { spdlog::error( "The input payload is expected to be a number (integer or " "float), instead it is: '{}'", l_inputPayloadStr); throw StreamTransformerExecutionException(); } break; case JsonType::String: p_outputPayload[m_transformation.toPayload] = l_inputPayloadStr; break; case JsonType::Boolean: if (utilities::isBool(l_inputPayloadStr)) { p_outputPayload[m_transformation.toPayload] = utilities::lexical_cast<bool>(l_inputPayloadStr.c_str()); } else { spdlog::error( "The input payload is expected to be a boolean, instead it is: " "'{}'", l_inputPayloadStr); throw StreamTransformerExecutionException(); } break; default: spdlog::error("{} '{}' value must be one of the following: {}", get_class_name(), k_as, fmt::join(k_types, ", ")); throw StreamTransformerExecutionException(); break; } } if (!m_transformation.keep) { // If 'keep' is false, the original payload key-value pair must be deleted p_outputPayload.erase(m_transformation.fromPayload); } } bool StreamTransformerPayloadToPayload::is_valid_setup( const nlohmann::json& p_json) { if (!p_json.is_object()) { spdlog::error("{} is not a JSON object", get_class_name()); return false; } // mandatory fields else if (!p_json.contains(k_from)) { spdlog::error("{} must contain a '{}' key", get_class_name(), k_from); return false; } else if (!p_json[k_from].is_string()) { spdlog::error("{} '{}' value must be a string", get_class_name(), k_from); return false; } else if (!p_json.contains(k_to)) { spdlog::error("{} must contain a '{}' key", get_class_name(), k_to); return false; } else if (!p_json[k_to].is_string()) { spdlog::error("{} '{}' value must be a string", get_class_name(), k_to); return false; } // optional fields else if (p_json.contains(k_as)) { if (!p_json[k_as].is_string()) { spdlog::error("{} '{}' value must be a string", get_class_name(), k_as); return false; } else if (std::none_of(k_types.begin(), k_types.end(), [&p_json](std::string it_type) { return it_type == p_json.at(k_as).get<std::string>(); })) { spdlog::error( "{} '{}' key must have one of the " "following values: {}", get_class_name(), k_as, fmt::join(k_types, ", ")); return false; } } else if (p_json.contains(k_keep) && !p_json[k_keep].is_boolean()) { spdlog::error("{} '{}' value must be a boolean", get_class_name(), k_keep); return false; } return true; } } // namespace tw
36.365385
80
0.624008
luibass92
e32967d92a125756460bf2a3ea5989ca1e3dba94
285
cpp
C++
beaker/decl.cpp
thehexia/beaker2
ca6c563c51be4a08d78e4eda007967bc4ae812a2
[ "Apache-2.0" ]
null
null
null
beaker/decl.cpp
thehexia/beaker2
ca6c563c51be4a08d78e4eda007967bc4ae812a2
[ "Apache-2.0" ]
null
null
null
beaker/decl.cpp
thehexia/beaker2
ca6c563c51be4a08d78e4eda007967bc4ae812a2
[ "Apache-2.0" ]
null
null
null
// Copyright (c) 2015 Andrew Sutton // All rights reserved #include "decl.hpp" #include "type.hpp" Function_type const* Function_decl::type() const { return cast<Function_type>(Decl::type()); } Type const* Function_decl::return_type() const { return type()->return_type(); }
13.571429
43
0.705263
thehexia
e32c1ce60e57de950f6115d4dabe6096d7616f2a
382
cpp
C++
Lowercase villains/main.cpp
ThusharaX/Algothon-Entrance-Test-2021
f4e743286ed66b3b25dbfde16b6c418b4fe56c16
[ "MIT" ]
null
null
null
Lowercase villains/main.cpp
ThusharaX/Algothon-Entrance-Test-2021
f4e743286ed66b3b25dbfde16b6c418b4fe56c16
[ "MIT" ]
null
null
null
Lowercase villains/main.cpp
ThusharaX/Algothon-Entrance-Test-2021
f4e743286ed66b3b25dbfde16b6c418b4fe56c16
[ "MIT" ]
null
null
null
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; int main() { string word; int strLen = 0; int count = 0; getline (cin, word); strLen = word.length(); for (int i = 0; i < strLen+1; i++) { if (islower(word[i])) { count++; } } cout << count << endl; }
14.692308
40
0.526178
ThusharaX
e32d0195642344abdc5e1f7144acfba601f3fb66
8,475
cc
C++
src/ActProdXSecData.cc
UniversityofWarwick/ACTIVIA
bbd0dfa71337602f94d911fa5101a440e8c16606
[ "BSL-1.0" ]
1
2020-11-04T08:32:23.000Z
2020-11-04T08:32:23.000Z
src/ActProdXSecData.cc
UniversityofWarwick/ACTIVIA
bbd0dfa71337602f94d911fa5101a440e8c16606
[ "BSL-1.0" ]
null
null
null
src/ActProdXSecData.cc
UniversityofWarwick/ACTIVIA
bbd0dfa71337602f94d911fa5101a440e8c16606
[ "BSL-1.0" ]
1
2020-11-04T08:32:30.000Z
2020-11-04T08:32:30.000Z
// Class for defining the production cross-section data for // a specific target isotope. It stores a map of ActXSecGraphs // for the target isotope. #include "Activia/ActProdXSecData.hh" #include "Activia/ActBeamSpectrum.hh" #include "Activia/ActProdNuclideList.hh" #include "Activia/ActProdNuclide.hh" #include "Activia/ActNucleiData.hh" #include "Activia/ActAbsXSecAlgorithm.hh" #include "Activia/ActConstants.hh" #include "Activia/ActNuclideFactory.hh" #include "Activia/ActGraphPoint.hh" #include "Activia/ActAbsOutput.hh" #include "Activia/ActOutputSelection.hh" #include "Activia/ActTargetNuclide.hh" #include "Activia/ActAbsCalcStatus.hh" #include <vector> #include <iostream> using std::cout; using std::endl; ActProdXSecData::ActProdXSecData(ActTargetNuclide* targetIsotope, ActProdNuclideList* prodList, ActBeamSpectrum* inputBeam, ActAbsXSecAlgorithm* algorithm, ActAbsOutput* output) { // Constructor _targetIsotope = targetIsotope; _prodList = prodList; _inputBeam = inputBeam; _algorithm = algorithm; _xSecData.clear(); _output = output; } ActProdXSecData::~ActProdXSecData() { // Destructor _xSecData.clear(); } void ActProdXSecData::calculate() { // Calculate the target isotope - product cross-sections given the input beam // and calculation algorithm // Check for null pointers if (_prodList == 0 || _targetIsotope == 0) {return;} if (_inputBeam == 0 || _algorithm == 0) {return;} _xSecData.clear(); double EStart = _inputBeam->getEStart(); double dE = _inputBeam->getdE(); int nE = _inputBeam->getnE(); cout<<"E0 = "<<EStart<<", dE = "<<dE<<", nE = "<<nE<<endl; int nE1 = nE - 1; int nProducts = _prodList->getNProdNuclides(); int ip; // Create a nuclei data pointer that will store the beam, target and // product information, all in one object, that can be passed around // the various cross-section algorithm/models. ActNucleiData* data = new ActNucleiData(); ActNuclide* beamNuclide = _inputBeam->getNuclide(); data->setBeamData(beamNuclide); data->setTargetData(_targetIsotope); // Initialise the production rate normalisation factor double factor(0.0); double atgt = data->getat(); if (atgt > 1e-30) {factor = ActConstants::pps/atgt;} // Retrieve the abundance fraction for the selected target isotope. // This will be used to scale the production rate for all product isotopes. double fraction = data->getFraction(); // Load in any data tables for this target isotope // Use the list of product isotopes to store maps of // target-product tables. _algorithm->loadDataTables(_targetIsotope, _prodList); // Store energies in vector (same for all products) std::vector<double> energies; int iE; for (iE = 0; iE < nE; iE++) { double energy = iE*dE + EStart; energies.push_back(energy); } int levelOfDetail(0); bool outputEGraphs = false; if (_output != 0) { levelOfDetail = _output->getLevelOfDetail(); if (levelOfDetail > ActOutputSelection::Summary) {outputEGraphs = true;} } // Calculation status ActAbsCalcStatus* calcStatus = _output->getCalcStatus(); if (calcStatus != 0) {calcStatus->setNProductIsotopes(nProducts);} bool runCode(true); // calculation status can say "stop calculating" // Loop over products for (ip = 0; ip < nProducts; ip++) { cout<<"ActProdXSecData ip = "<<ip<<endl; // Set calculation status (if it exists) if (calcStatus != 0) { calcStatus->setProductIsotope(ip); calcStatus->xSecReport(); runCode = calcStatus->canRunCode(); } // Stop calculation if requested by the status if (runCode == false) {break;} ActProdNuclide* prodNuclide = _prodList->getProdNuclide(ip); double zNucl(0.0), aNucl(0.0), halfLife(0.0); int nSideBranches(0); if (prodNuclide != 0) { zNucl = prodNuclide->getfZ(); aNucl = prodNuclide->getA(); nSideBranches = prodNuclide->getNSideBranches(); halfLife = prodNuclide->getHalfLife(); } // Set the product data and check if we pass the selection criteria // for the beam, target and product set-up. data->setProductData(prodNuclide); if (_algorithm->passSelection(data) == false) { // We have failed the selection. // Continue to the next product within the (ip) loop. continue; } // Define the vector of graph points for the product nuclide. std::vector<ActGraphPoint> prodGraphPoints(nE); for (iE = 0; iE < nE; iE++) { prodGraphPoints[iE] = ActGraphPoint(energies[iE], 0.0, 0.0); } // Total sigma and production rate for the product (including side branches) double totalProdSigma(0.0), totalProdRate(0.0); // Loop over side branches, as well as the product isotope int iSB; for (iSB = 0; iSB < nSideBranches+1; iSB++) { // Total sigma and production rate for the individual side branches double totalSBSigma(0.0), totalSBProdRate(0.0); bool doCalc(true); bool sideBranch(false); double z(zNucl), a(aNucl), tHalf(halfLife); if (iSB != nSideBranches) { // We have a side-branch. ActNuclide* sbNuclide = prodNuclide->getSideBranch(iSB); if (sbNuclide != 0) { z = sbNuclide->getfZ(); a = sbNuclide->getA(); tHalf = 0.0; sideBranch = true; // Reset the product data to use the side-branch isotope. data->setProductData(sbNuclide); // Check whether the side-branch, together with the beam and target data, // passes the selection criteria. Set the doCalc flag using this check. doCalc = _algorithm->passSelection(data); } else { // sbNuclide pointer is null. Skip to the next in the loop. doCalc = false; } } else if (nSideBranches > 0) { // Reset the product data to the original product isotope data->setProductData(prodNuclide); } // Skip nuclide if earlier selections have failed if (doCalc == false) {continue;} // Also calculate the threshold energy and other quantities, since we now // have the target and product parameters data->setOtherQuantities(); // Set the nuclei data that the algorithm will use // Since the data is a pointer, this can be updated and the algorithm // will automatically know about the changes. _algorithm->setNucleiData(data); // Loop over the energy range, calculating the cross section value // and storing them in the graph. for (iE = 0; iE < nE; iE++) { double pfac(1.0); if (iE == 0 || iE == nE1) {pfac = 0.5;} double energy = energies[iE]; data->setEnergy(energy); bool passESelection = _algorithm->passESelection(data); if (passESelection == true) { // Calculate the cross-section based on the previously // given nuclei data pointer double sigma = _algorithm->calcCrossSection(); double dNdE = _inputBeam->fluxdE(energy); double prodRate = pfac*sigma*factor*fraction*dNdE*dE; totalSBSigma += sigma; totalSBProdRate += prodRate; totalProdSigma += sigma; totalProdRate += prodRate; // Also store the sigma and production rate vs energy // graph for the side branch/product isotope prodGraphPoints[iE].addYValues(sigma, prodRate); } // energy selection } // energy loop // Finished looping over all side branches. Store the side-branch summed // sigma/production rate vs energy for the product nuclide using graphs. ActNuclide* isotope = ActNuclideFactory::getInstance()->getNuclide((int) z, a, tHalf); // Only store the total sigma/production rate to save on RAM memory use! ActXSecGraph xSecGraph("xSecGraph"); if (sideBranch == true) { // Only store the total sigma/production rate xSecGraph.addPoint(0.0, totalSBSigma, totalSBProdRate); } else { // Store total sigma/production rate xSecGraph.addPoint(0.0, totalProdSigma, totalProdRate); // Print out sigma/production rate as function of energy to output class ActXSecGraph xSecEGraph("xSecEData"); xSecEGraph.addPoints(prodGraphPoints); if (outputEGraphs == true) { _output->outputGraph(*data, xSecEGraph); } } // Insert the graphs into the internal map for the given product nuclide //cout<<"Inserting cross-section and production rate vs energy graph into map"<<endl; _xSecData[isotope] = xSecGraph; } // side branch plus product loop } // product loop cout<<"Finished in ActProdXSecData"<<endl; delete data; }
30.706522
92
0.688732
UniversityofWarwick
e3326e1d70ba23df0af2595682eeb96335c58dd9
1,145
cpp
C++
tests/benchmark/src/main.cpp
typesAreSpaces/AXDInterpolator
e0759c806480ff54b7a4f878e007b534a71dad44
[ "MIT" ]
null
null
null
tests/benchmark/src/main.cpp
typesAreSpaces/AXDInterpolator
e0759c806480ff54b7a4f878e007b534a71dad44
[ "MIT" ]
1
2021-06-24T18:55:46.000Z
2021-06-24T18:55:46.000Z
tests/benchmark/src/main.cpp
typesAreSpaces/AXDInterpolator
e0759c806480ff54b7a4f878e007b534a71dad44
[ "MIT" ]
null
null
null
#include "UAutomizerFileReader.h" #include <sys/stat.h> inline bool exists_file (const std::string& name) { struct stat buffer; return (stat (name.c_str(), &buffer) == 0); } int main(int argc, char * argv[]){ if(argc != 6){ std::cerr << "Invalid number of inputs.\n"; return 0; } // argv[1] -> file path of smt file // argv[2] -> Solver Code // argv[3] -> file path of output file // argv[4] -> '0' -> test implementation // '1' -> test other interpolation engines char const * file = argv[1]; if(!exists_file(file)){ std::cout << argv[1] << std::endl; std::cerr << "File doesnt exists.\n"; return 0; } SMT_SOLVER curr_solver; switch(*argv[2]){ case '0': curr_solver = Z3; break; case '1': curr_solver = MATHSAT; break; case '2': curr_solver = SMTINTERPOL; break; default: curr_solver = MATHSAT; break; } UAutomizerFileReader reader( curr_solver, 500, argv[3], *argv[4] == '0', *argv[5] == '0'); #if SINGLE_FORMULA reader.processSingleFile(file); #else reader.process(file); #endif return 0; }
20.818182
67
0.583406
typesAreSpaces
e33317d73edf89d40fd046ce25f1f608f05a5438
2,754
cpp
C++
Board.cpp
ahmadabed1/messageboard-b
05b154801690250737f56a31b71359ae71c0cdbb
[ "MIT" ]
null
null
null
Board.cpp
ahmadabed1/messageboard-b
05b154801690250737f56a31b71359ae71c0cdbb
[ "MIT" ]
null
null
null
Board.cpp
ahmadabed1/messageboard-b
05b154801690250737f56a31b71359ae71c0cdbb
[ "MIT" ]
null
null
null
#include <iostream> #include "Board.hpp" using namespace std; using namespace ariel; const char defaultChar = '_'; namespace ariel { void Board::update(unsigned int row, unsigned int col, bool flag, unsigned int num){ if(this->maxR!=0 || this->minR!=INT32_MAX || this->maxC!=0 || this->minC!=INT32_MAX){ this->minC=min(this->minC, col); this->minR=min(this->minR, row); if(!flag){ this->maxC=max(this->maxC, col+1); this->maxR=max(this->maxR, row+num+1); } else{ this->maxC= max(this->maxC, col+num+1); this->maxR=max(this->maxR, row+1); } resizeBoard(this->maxR, this->maxC); } else{ if (!flag){ this->maxR=row+num; this->maxC=col+1; this->minR=row; this->minC=col; } else{ this->maxR=row+1; this->maxC=col+num; this->minR=row; this->minC=col; } resizeBoard(this->maxR, this->maxC); } } /* resize boeard */ void Board::resizeBoard(unsigned int row, unsigned int col){ this-> board.resize(row); for(unsigned int i=0; i < row; i++){ board.at(i).resize(col,defaultChar); } } /* write message to the board */ void Board::post(unsigned int row, unsigned int col, Direction d, string const &message){ unsigned int messageSize = message.length(); bool flag = (d == Direction::Horizontal); update(row,col,flag,messageSize); for (char ch: message){ board.at(row).at(col) = ch; flag? col++ : row++; } } /* read messages from board */ string Board::read(unsigned int row, unsigned int col, Direction d, unsigned int num){ string s; bool flag = (d == Direction::Horizontal); for(int i=0; i<num; i++){ try { s+=board.at(row).at(col); } catch(const std::exception& e) { s+="_"; } flag? col++ : row++; } return s; } /* print the board */ void Board::show(){ for (unsigned int i = this->minR; i < this->maxR; i++) { cout << i << ": "; for (unsigned int j = this->minC; j < this->maxC; j++) { cout << this->board[i][j]; } cout<< "\n"; } cout << "\n" << endl; } }
23.142857
93
0.439361
ahmadabed1
e3350eedf98cd11ade84d8706ee7ac6f3ac32187
346
cpp
C++
5659.删除字符串两端相同字符后的最短长度/minimumLength.cpp
YichengZhong/Top-Interview-Questions
124828d321f482a0eaa30012b3706267487bfd24
[ "MIT" ]
1
2019-10-21T14:40:39.000Z
2019-10-21T14:40:39.000Z
5659.删除字符串两端相同字符后的最短长度/minimumLength.cpp
YichengZhong/Top-Interview-Questions
124828d321f482a0eaa30012b3706267487bfd24
[ "MIT" ]
null
null
null
5659.删除字符串两端相同字符后的最短长度/minimumLength.cpp
YichengZhong/Top-Interview-Questions
124828d321f482a0eaa30012b3706267487bfd24
[ "MIT" ]
1
2020-11-04T07:33:34.000Z
2020-11-04T07:33:34.000Z
class Solution { public: int minimumLength(string s) { int l = 0, r = s.size() - 1; while(l < r) { if(s[l]!=s[r]) break; while(l<r-1 && s[l+1]==s[r])l++; while(r>l+1 && s[r-1]==s[l])r--; if(r-l+1>=2&&l<s.size()-1){l++;r--;} } return r-l+1; } };
21.625
48
0.358382
YichengZhong
e337577a783f4092f5d786c771233083f63ddc04
1,316
hpp
C++
src/time_advance.hpp
ckendrick/asgard
ed4fc90d240466e9ca0473071e8f64f84ad14462
[ "MIT" ]
null
null
null
src/time_advance.hpp
ckendrick/asgard
ed4fc90d240466e9ca0473071e8f64f84ad14462
[ "MIT" ]
null
null
null
src/time_advance.hpp
ckendrick/asgard
ed4fc90d240466e9ca0473071e8f64f84ad14462
[ "MIT" ]
null
null
null
#pragma once #include "batch.hpp" #include "boundary_conditions.hpp" #include "distribution.hpp" #include "kronmult.hpp" #include "program_options.hpp" #include "tensors.hpp" #include "timer.hpp" #include <mutex> // this function executes a time step using the current solution // vector x (in host_space). // on exit, the next solution vector is stored in x. template<typename P> fk::vector<P> explicit_time_advance(PDE<P> const &pde, elements::table const &table, options const &program_opts, std::vector<fk::vector<P>> const &unscaled_sources, std::array<unscaled_bc_parts<P>, 2> const &unscaled_parts, fk::vector<P> const &x, distribution_plan const &plan, int const workspace_size_MB, P const time); template<typename P> fk::vector<P> implicit_time_advance(PDE<P> const &pde, elements::table const &table, std::vector<fk::vector<P>> const &unscaled_sources, std::array<unscaled_bc_parts<P>, 2> const &unscaled_parts, fk::vector<P> const &x, distribution_plan const &plan, P const time, solve_opts const solver = solve_opts::direct, bool const update_system = true);
41.125
80
0.6231
ckendrick
e337c22c4c1c20ba19d6e4f5eb50e92950a8c5a7
8,818
cxx
C++
simplify/src/ModifySrc.cxx
kit-transue/software-emancipation-discover
bec6f4ef404d72f361d91de954eae9a3bd669ce3
[ "BSD-2-Clause" ]
2
2015-11-24T03:31:12.000Z
2015-11-24T16:01:57.000Z
simplify/src/ModifySrc.cxx
radtek/software-emancipation-discover
bec6f4ef404d72f361d91de954eae9a3bd669ce3
[ "BSD-2-Clause" ]
null
null
null
simplify/src/ModifySrc.cxx
radtek/software-emancipation-discover
bec6f4ef404d72f361d91de954eae9a3bd669ce3
[ "BSD-2-Clause" ]
1
2019-05-19T02:26:08.000Z
2019-05-19T02:26:08.000Z
/************************************************************************* * Copyright (c) 2015, Synopsys, Inc. * * All rights reserved. * * * * Redistribution and use in source and binary forms, with or without * * modification, are permitted provided that the following conditions are * * met: * * * * 1. Redistributions of source code must retain the above copyright * * notice, this list of conditions and the following disclaimer. * * * * 2. Redistributions in binary form must reproduce the above copyright * * notice, this list of conditions and the following disclaimer in the * * documentation and/or other materials provided with the distribution. * * * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * *************************************************************************/ #include <cstdio> #include <cstdlib> #include <cstring> #include <string> using namespace std; #include "simplify_globals.h" //#include "parray.h" const int MAXLINE = 8000; void GetRemoveIncludeLine(string& str, const char* buf) { str = "/* "; //check if there was a c style comment on that line to //avoid nested comments char* ptr = (char*) buf; while (ptr) { if (*(ptr + 1) == '*') // a comment break; ptr = strchr(ptr + 1, '/'); } if (ptr) { *ptr = '\0'; str += buf; *ptr = '/'; str += " SIMPLIFY REMOVED */ "; str += ptr; } else { str += buf; str += " SIMPLIFY REMOVED */"; } } //check whether this file is located in an include dir specified by -I int TryIncludeDirs(string& str, const char* file) { int ret = 0; int max_len = 0; int max_index = -1; int size = GetIncludeDirs().size(); for (int i = 0; i < size; ++i) { const char* dir = GetIncludeDirs()[i]; int len = strlen(dir); if (strncmp(dir, file, len) == 0) { if (len > max_len && file[len] == '/' || file[len] == '\\') { max_len = len; max_index = i; } } } if (max_index > -1) { const char* dir = GetIncludeDirs()[max_index]; int len = strlen(dir); str = "<"; str += file + len + 1; str += ">"; ret = 1; } return ret; } int TrySourceDirAndBelow(string& str, const char* file, const char* source) { int ret = 0; int len = strlen(source); if (strncmp(source, file, len) == 0 && file[len] == '/' || file[len] == '\\') { str = "\""; str += file + len + 1; str += '"'; ret = 1; } return ret; } //check "../anydir" directory relative to the source int TryOneLevelHigherSource(string& str, const char* file, const char* source) { int ret = 0; char* ptr = (char*) strrchr(source, '/'); char sep = '/'; if (!ptr) { ptr = (char*) strrchr(source, '\\'); sep = '\\'; } if (ptr) { *ptr = '\0'; int len = strlen(source); if (strncmp(source, file, len) == 0 && file[len] == '/' || file[len] == '\\') { str = "\""; str += ".."; str += file + len; str += '"'; ret = 1; } *ptr = sep; } return ret; } //check "../../anydir" directory relative to the source int TryTwoLevelsHigherSource(string& str, const char* file, const char* source) { int ret = 0; char* ptr = (char*) strrchr(source, '/'); char sep = '/'; if (!ptr) { ptr = (char*) strrchr(source, '\\'); sep = '\\'; } if (ptr) { *ptr = '\0'; char* ptr1 = (char*) strrchr(source, sep); if (ptr1) { *ptr1 = '\0'; int len = strlen(source); if (strncmp(source, file, len) == 0 && file[len] == '/' || file[len] == '\\') { str = "\""; str += ".."; str += sep; str += ".."; str += file + len; str += '"'; ret = 1; } *ptr1 = sep; } *ptr = sep; } return ret; } void GetShortName(string& str, const char* file) { const char* ptr = strrchr(file, '/'); if (!ptr) ptr = strrchr(file, '\\'); str = "<"; str += ptr + 1; str += ">"; } int GetIncludeName(string& str, const char* file, const char* source, int short_sub_names) { int ret = 0; //get source dir char* ptr = (char*)strrchr(source, '/'); char sep = '/'; if (!ptr) { ptr = (char*)strrchr(source, '\\'); sep = '\\'; } if (ptr) *ptr = '\0'; if (!ret) ret = TryIncludeDirs(str, file); if (!ret) ret = TrySourceDirAndBelow(str, file, source); if (!ret) ret = TryOneLevelHigherSource(str, file, source); if (!ret && short_sub_names) { ret = 1; GetShortName(str, file); } if (!ret) ret = TryTwoLevelsHigherSource(str, file, source); //last resort, use full file name if (!ret) { str = "\""; str += file; str += '"'; } if (ptr) *ptr = sep; return ret; } void GetSubIncludeLine(string& str, const char* file, const char* source, int nocomments, int short_sub_names) { str = "#include "; string incstr; GetIncludeName(incstr, file, source, short_sub_names); str += incstr; if (!nocomments) str += " /* SIMPLIFY SUBSTITUTED */"; } void ModifySrc(const char* file, vector<int>& remove, vector<SymLoc*>& subs, int nocomments, int short_sub_names) { FILE* fin = fopen(file, "rw"); if (!fin) return; // constructing a path to a temp directory char tmpPath[1024]; memset(tmpPath,0,1024); char* pathToTmp = getenv("TMP"); if(pathToTmp==NULL) pathToTmp = getenv("TEMP"); if(pathToTmp==NULL) pathToTmp = getenv("TMPDIR"); if(pathToTmp!=NULL) strcpy(tmpPath,pathToTmp); #ifndef _WIN32 char * tmpFile = tempnam(tmpPath, NULL); #else char * tmpFile = _tempnam(tmpPath, NULL); #endif FILE* fout = fopen(tmpFile, "w"); if (!fout) { fclose(fin); return; } char buf[MAXLINE]; // This is very bad, to use fixed length char array to copy strings. int line = 0; while(fgets(buf, MAXLINE, fin)) { ++line; // Remove newline, if present. int buflen = strlen(buf); int had_newline = (buf[buflen - 1] == '\n'); if (had_newline) buf[buflen - 1] = '\0'; int rem = 0; int size = remove.size(); for (int i = 0; i < size; ++i) { if (line == (int)remove[i]) { rem = 1; break; } } if (!rem) { if (had_newline) fprintf(fout, "%s\n", buf); else fprintf(fout, "%s", buf); } else { string str; // check if there is a comment on this line const char* ptr = strstr(buf, "/*"); if (!ptr) ptr = strstr(buf, "//"); if (!nocomments || ptr) { GetRemoveIncludeLine(str, buf); fprintf(fout, "%s\n", str.c_str()); } //check substitutions int size = subs.size(); for (int i = 0; i < size; ++i) { SymLoc* sub = subs[i]; if (sub->line == line) { GetSubIncludeLine(str, sub->file, file, nocomments, short_sub_names); fprintf(fout, "%s\n", str.c_str()); } } } } fclose(fin); fclose(fout); FileMove(tmpFile, file); }
23.961957
90
0.48934
kit-transue
e33862ce3570187180e966f9528856dfc2184844
926
cpp
C++
cpp/templates/25187583_single.cpp
berquist/eg
4c368b12eaaffcf0af8032f10348cf8bc1c3957a
[ "Unlicense" ]
null
null
null
cpp/templates/25187583_single.cpp
berquist/eg
4c368b12eaaffcf0af8032f10348cf8bc1c3957a
[ "Unlicense" ]
null
null
null
cpp/templates/25187583_single.cpp
berquist/eg
4c368b12eaaffcf0af8032f10348cf8bc1c3957a
[ "Unlicense" ]
null
null
null
#include <complex> #include <tuple> #include <type_traits> #include <vector> // Question: https://stackoverflow.com/questions/25187323/how-can-i-get-the-innermost-template-parameter-type // adapted from https://stackoverflow.com/a/25187583 template<typename T> struct inner_impl { using type = T; }; template<template<typename> class E, typename T> struct inner_impl<E<T>> { // using type = typename inner_impl<T>::type; using type = T; }; template<typename T> using inner = typename inner_impl<T>::type; template<class> struct X; static_assert(std::is_same<inner<X<X<X<int>>>>, X<X<int>>>::value, ""); static_assert(std::is_same<inner<std::complex<double>>, double>::value, ""); static_assert(std::is_same<inner<X<std::complex<double>>>, std::complex<double>>::value, ""); // static_assert(std::is_same<inner<std::vector<double>>, double>::value, ""); // static_assert(std::is_same<>, ""); int main() { }
24.368421
109
0.699784
berquist
e3393fcf86a950ee192dfa381e4be20d3f3dfb74
55
hpp
C++
misc/tower.hpp
reubn/symfonisk
559ae842a159734ab5f1dc33b80a394577b3b576
[ "MIT" ]
1
2020-05-14T20:52:56.000Z
2020-05-14T20:52:56.000Z
misc/tower.hpp
reubn/symfonisk
559ae842a159734ab5f1dc33b80a394577b3b576
[ "MIT" ]
null
null
null
misc/tower.hpp
reubn/symfonisk
559ae842a159734ab5f1dc33b80a394577b3b576
[ "MIT" ]
null
null
null
extern void loopTower(ConfigurableSettings& settings);
27.5
54
0.854545
reubn
e33ae9b05e963577dceb99300623f4577c4e1bc0
2,616
cc
C++
CalibPPS/ESProducers/plugins/PrintTotemDAQMapping.cc
Purva-Chaudhari/cmssw
32e5cbfe54c4d809d60022586cf200b7c3020bcf
[ "Apache-2.0" ]
852
2015-01-11T21:03:51.000Z
2022-03-25T21:14:00.000Z
CalibPPS/ESProducers/plugins/PrintTotemDAQMapping.cc
Purva-Chaudhari/cmssw
32e5cbfe54c4d809d60022586cf200b7c3020bcf
[ "Apache-2.0" ]
30,371
2015-01-02T00:14:40.000Z
2022-03-31T23:26:05.000Z
CalibPPS/ESProducers/plugins/PrintTotemDAQMapping.cc
Purva-Chaudhari/cmssw
32e5cbfe54c4d809d60022586cf200b7c3020bcf
[ "Apache-2.0" ]
3,240
2015-01-02T05:53:18.000Z
2022-03-31T17:24:21.000Z
/**************************************************************************** * * This is a part of TOTEM offline software. * Authors: * Jan Kašpar (jan.kaspar@gmail.com) * ****************************************************************************/ #include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/Framework/interface/ESHandle.h" #include "CondFormats/DataRecord/interface/TotemReadoutRcd.h" #include "CondFormats/PPSObjects/interface/TotemDAQMapping.h" #include "CondFormats/PPSObjects/interface/TotemAnalysisMask.h" //---------------------------------------------------------------------------------------------------- /** *\brief Prints the DAQ mapping loaded by TotemDAQMappingESSourceXML. **/ class PrintTotemDAQMapping : public edm::one::EDAnalyzer<> { public: PrintTotemDAQMapping(const edm::ParameterSet &ps); ~PrintTotemDAQMapping() override {} private: /// label of the CTPPS sub-system std::string subSystemName; edm::ESGetToken<TotemDAQMapping, TotemReadoutRcd> mappingToken_; edm::ESGetToken<TotemAnalysisMask, TotemReadoutRcd> maskToken_; void analyze(const edm::Event &e, const edm::EventSetup &es) override; }; PrintTotemDAQMapping::PrintTotemDAQMapping(const edm::ParameterSet &ps) : subSystemName(ps.getUntrackedParameter<std::string>("subSystem")), mappingToken_(esConsumes(edm::ESInputTag("", subSystemName))), maskToken_(esConsumes(edm::ESInputTag("", subSystemName))) {} //---------------------------------------------------------------------------------------------------- void PrintTotemDAQMapping::analyze(const edm::Event &, edm::EventSetup const &es) { // get mapping auto const &mapping = es.getData(mappingToken_); // get analysis mask to mask channels auto const &analysisMask = es.getData(maskToken_); // print mapping for (const auto &p : mapping.VFATMapping) edm::LogInfo("PrintTotemDAQMapping mapping") << " " << p.first << " -> " << p.second; // print mapping for (const auto &p : analysisMask.analysisMask) edm::LogInfo("PrintTotemDAQMapping mask") << " " << p.first << ": fullMask=" << p.second.fullMask << ", number of masked channels " << p.second.maskedChannels.size(); } //---------------------------------------------------------------------------------------------------- DEFINE_FWK_MODULE(PrintTotemDAQMapping);
40.246154
114
0.59633
Purva-Chaudhari
e33e420a4ac7ced8bdea543120a6f2f766a0d193
3,511
hpp
C++
generator/road_access_generator.hpp
vmihaylenko/omim
00087f340e723fc611cbc82e0ae898b9053b620a
[ "Apache-2.0" ]
null
null
null
generator/road_access_generator.hpp
vmihaylenko/omim
00087f340e723fc611cbc82e0ae898b9053b620a
[ "Apache-2.0" ]
1
2019-05-14T15:26:55.000Z
2019-05-16T11:00:33.000Z
generator/road_access_generator.hpp
vmihaylenko/omim
00087f340e723fc611cbc82e0ae898b9053b620a
[ "Apache-2.0" ]
null
null
null
#pragma once #include "generator/collector_interface.hpp" #include "generator/feature_builder.hpp" #include "generator/intermediate_elements.hpp" #include "generator/osm_element.hpp" #include "routing/road_access.hpp" #include "routing/vehicle_mask.hpp" #include <array> #include <cstdint> #include <fstream> #include <map> #include <memory> #include <ostream> #include <set> #include <sstream> #include <string> #include <unordered_map> #include <vector> struct OsmElement; class FeatureParams; namespace generator { namespace cache { class IntermediateDataReader; } // namespace cache } // namespace generator // The road accessibility information is collected in the same manner // as the restrictions are. // See generator/restriction_generator.hpp for details. namespace routing { class RoadAccessTagProcessor { public: using TagMapping = std::map<OsmElement::Tag, RoadAccess::Type>; explicit RoadAccessTagProcessor(VehicleType vehicleType); void Process(feature::FeatureBuilder const & fb, OsmElement const & elem); void Write(std::stringstream & stream); void Merge(RoadAccessTagProcessor const & roadAccessTagProcessor); private: bool ShouldIgnoreBarrierWithoutAccess(OsmElement const & osmElement) const; RoadAccess::Type GetAccessType(OsmElement const & elem) const; VehicleType m_vehicleType; std::vector<TagMapping const *> m_barrierMappings; // Order of tag mappings in m_tagMappings is from more to less specific. // e.g. for car: motorcar, motorvehicle, vehicle, general access tags. std::vector<TagMapping const *> m_accessMappings; // We decided to ignore some barriers without access on some type of highways // because we almost always do not need to add penalty for passes through such nodes. std::set<OsmElement::Tag> const * m_hwIgnoreBarriersWithoutAccess; std::unordered_map<uint64_t, RoadAccess::Type> m_barriers; std::unordered_map<uint64_t, RoadAccess::Type> m_wayToAccess; std::unordered_map<uint64_t, std::vector<uint64_t>> m_roads; }; class RoadAccessWriter : public generator::CollectorInterface { public: explicit RoadAccessWriter(std::string const & filename); // CollectorInterface overrides: std::shared_ptr<CollectorInterface> Clone(std::shared_ptr<generator::cache::IntermediateDataReader> const & = {}) const override; void CollectFeature(feature::FeatureBuilder const & fb, OsmElement const & elem) override; void Save() override; void Merge(generator::CollectorInterface const & collector) override; void MergeInto(RoadAccessWriter & collector) const override; private: std::ofstream m_stream; std::vector<RoadAccessTagProcessor> m_tagProcessors; }; class RoadAccessCollector { public: using RoadAccessByVehicleType = std::array<RoadAccess, static_cast<size_t>(VehicleType::Count)>; RoadAccessCollector(std::string const & dataFilePath, std::string const & roadAccessPath, std::string const & osmIdsToFeatureIdsPath); RoadAccessByVehicleType const & GetRoadAccessAllTypes() const { return m_roadAccessByVehicleType; } bool IsValid() const { return m_valid; } private: RoadAccessByVehicleType m_roadAccessByVehicleType; bool m_valid = true; }; // The generator tool's interface to writing the section with // road accessibility information for one mwm file. void BuildRoadAccessInfo(std::string const & dataFilePath, std::string const & roadAccessPath, std::string const & osmIdsToFeatureIdsPath); } // namespace routing
30.267241
98
0.767588
vmihaylenko
e33e59c48289d6f00ecb5a7a86acfab1568e6907
3,074
cpp
C++
src/base/Uri.cpp
webosose/com.webos.service.intent
5e10a5affe450f0bb1eea197c92c65c884874427
[ "Apache-2.0" ]
null
null
null
src/base/Uri.cpp
webosose/com.webos.service.intent
5e10a5affe450f0bb1eea197c92c65c884874427
[ "Apache-2.0" ]
null
null
null
src/base/Uri.cpp
webosose/com.webos.service.intent
5e10a5affe450f0bb1eea197c92c65c884874427
[ "Apache-2.0" ]
1
2021-06-19T14:46:13.000Z
2021-06-19T14:46:13.000Z
// Copyright (c) 2020-2021 LG Electronics, 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. // // SPDX-License-Identifier: Apache-2.0 #include "Uri.h" bool Uri::compare(const Uri& a, const Uri& b) { if (!a.m_scheme.empty() && a.m_scheme != b.m_scheme) return false; if (!a.m_host.empty() && a.m_host != b.m_host) return false; if (!a.m_path.empty() && a.m_path != b.m_path) return false; return true; } Uri::Uri() : m_uri(""), m_scheme(""), m_host(""), m_path(""), m_query(""), m_fragment(""), m_empty(true) { } Uri::Uri(const string& str) : Uri() { parse(str); } Uri::~Uri() { } bool Uri::parse(const string& str) { static const std::regex URL(R"(^(([^:\/?#]+):)?(//([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?)", std::regex::extended); // clear m_empty = true; m_uri = str; m_scheme = ""; m_host = ""; m_path = ""; m_query = ""; m_fragment = ""; // See : https://stackoverflow.com/questions/5620235/cpp-regular-expression-to-validate-url/31613265#31613265 std::smatch result; if (std::regex_match(m_uri, result, URL)) { unsigned counter = 0; for (const auto& res : result) { switch (counter) { case 2: m_scheme = res; break; case 4: m_host = res; break; case 5: m_path = res; break; case 7: m_query = res; break; case 9: m_fragment = res; break; default: break; } counter++; } // For debugging purpose. printf("[Source] %s\n", str.c_str()); printf("[Parsed] scheme(%s) host(%s) path(%s) query(%s) fragment(%s)\n", m_scheme.c_str(), m_host.c_str(), m_path.c_str(), m_query.c_str(), m_fragment.c_str()); // TODO should check dependency path --> host --> scheme m_empty = false; } return !m_empty; } bool Uri::toJson(JValue& json) { if (m_empty) return false; if (!m_scheme.empty()) json.put("scheme", m_scheme); if (!m_host.empty()) json.put("host", m_host); if (!m_path.empty()) json.put("path", m_path); if (!m_query.empty()) json.put("query", m_query); if (!m_fragment.empty()) json.put("fragment", m_fragment); return true; }
26.730435
120
0.52635
webosose
e34857efb9134554d767f7548f519dbb3a161ba2
8,179
cpp
C++
src/main.cpp
ak1211/m5stack-azure-iot
179a474acde159c689ab359dba804c886402794a
[ "MIT" ]
null
null
null
src/main.cpp
ak1211/m5stack-azure-iot
179a474acde159c689ab359dba804c886402794a
[ "MIT" ]
null
null
null
src/main.cpp
ak1211/m5stack-azure-iot
179a474acde159c689ab359dba804c886402794a
[ "MIT" ]
null
null
null
// Copyright (c) 2021 Akihiro Yamamoto. // Licensed under the MIT License <https://spdx.org/licenses/MIT.html> // See LICENSE file in the project root for full license information. // #include "credentials.h" #include "iothub_client.hpp" #include "peripherals.hpp" #include <ArduinoOTA.h> #include <M5Core2.h> #include <Wifi.h> #include <ctime> #include <lwip/apps/sntp.h> #include <LovyanGFX.hpp> constexpr static const char *TAG = "MainModule"; // // globals // constexpr static uint8_t IOTHUB_PUSH_MESSAGE_EVERY_MINUTES = 1; // 1 mimutes static_assert(IOTHUB_PUSH_MESSAGE_EVERY_MINUTES < 60, "IOTHUB_PUSH_MESSAGE_EVERY_MINUTES is lesser than 60 minutes."); constexpr static uint8_t IOTHUB_PUSH_STATE_EVERY_MINUTES = 15; // 15 minutes static_assert(IOTHUB_PUSH_STATE_EVERY_MINUTES < 60, "IOTHUB_PUSH_STATE_EVERY_MINUTES is lesser than 60 minutes."); // // callbacks // // void btnAEvent(Event &e) { Peripherals &peri = Peripherals::getInstance(); peri.screen.prev(); peri.screen.update(peri.ticktack.time()); } // void btnBEvent(Event &e) { Peripherals &peri = Peripherals::getInstance(); peri.screen.home(); peri.screen.update(peri.ticktack.time()); } // void btnCEvent(Event &e) { Peripherals &peri = Peripherals::getInstance(); peri.screen.next(); peri.screen.update(peri.ticktack.time()); } // void releaseEvent(Event &e) { Peripherals &peri = Peripherals::getInstance(); peri.screen.releaseEvent(e); } // // // void setup() { // // initializing M5Stack and UART, I2C, Touch, RTC, etc. peripherals. // M5.begin(true, true, true, true); Peripherals::begin(Credentials.wifi_ssid, Credentials.wifi_password, Credentials.connection_string); Peripherals &peri = Peripherals::getInstance(); // // register the button hook // M5.BtnA.addHandler(btnAEvent, E_RELEASE); M5.BtnB.addHandler(btnBEvent, E_RELEASE); M5.BtnC.addHandler(btnCEvent, E_RELEASE); M5.background.addHandler(releaseEvent, E_RELEASE); // // start up // peri.screen.repaint(peri.ticktack.time()); } // // // struct MeasurementSets { std::time_t measured_at; Bme280 bme280; Sgp30 sgp30; Scd30 scd30; }; static struct MeasurementSets periodical_measurement_sets(std::time_t measured_at) { Peripherals &peri = Peripherals::getInstance(); if (peri.bme280.readyToRead(measured_at)) { peri.bme280.read(measured_at); } if (peri.sgp30.readyToRead(measured_at)) { peri.sgp30.read(measured_at); } if (peri.scd30.readyToRead(measured_at)) { peri.scd30.read(measured_at); } return {.measured_at = measured_at, .bme280 = peri.bme280.calculateSMA(measured_at), .sgp30 = peri.sgp30.calculateSMA(measured_at), .scd30 = peri.scd30.calculateSMA(measured_at)}; } // // // static std::string & absolute_sensor_id_from_SensorDescriptor(std::string &output, SensorDescriptor descriptor) { std::string strDescriptor; descriptor.toString(strDescriptor); // output = Credentials.device_id; output.push_back('-'); output += strDescriptor; return output; } // // // static void periodical_push_message(const MeasurementSets &m) { Peripherals &peri = Peripherals::getInstance(); // BME280 sensor values. // Temperature, Relative Humidity, Pressure if (m.bme280.good()) { TempHumiPres temp_humi_pres = m.bme280.get(); // // calculate the Aboslute Humidity from Temperature and Relative Humidity MilligramPerCubicMetre absolute_humidity = calculateAbsoluteHumidity( temp_humi_pres.temperature, temp_humi_pres.relative_humidity); ESP_LOGI(TAG, "absolute humidity: %d", absolute_humidity.value); // set "Absolute Humidity" to the SGP30 sensor. if (!peri.sgp30.setHumidity(absolute_humidity)) { ESP_LOGE(TAG, "setHumidity error."); } std::string sensor_id; absolute_sensor_id_from_SensorDescriptor(sensor_id, temp_humi_pres.sensor_descriptor); if (peri.iothub_client.pushTempHumiPres(sensor_id, temp_humi_pres)) { ESP_LOGD(TAG, "pushTempHumiPres() success."); } else { ESP_LOGE(TAG, "pushTempHumiPres() failure."); peri.iothub_client.check(false); } } // SGP30 sensor values. // eCo2, TVOC if (m.sgp30.good()) { TvocEco2 tvoc_eco2 = m.sgp30.get(); std::string sensor_id; absolute_sensor_id_from_SensorDescriptor(sensor_id, tvoc_eco2.sensor_descriptor); if (peri.iothub_client.pushTvocEco2(sensor_id, tvoc_eco2)) { ESP_LOGD(TAG, "pushTvocEco2() success."); } else { ESP_LOGE(TAG, "pushTvocEco2() failure."); peri.iothub_client.check(false); } } // SCD30 sensor values. // co2, Temperature, Relative Humidity if (m.scd30.good()) { Co2TempHumi co2_temp_humi = m.scd30.get(); std::string sensor_id; absolute_sensor_id_from_SensorDescriptor(sensor_id, co2_temp_humi.sensor_descriptor); if (peri.iothub_client.pushCo2TempHumi(sensor_id, co2_temp_humi)) { ESP_LOGD(TAG, "pushCo2TempHumi() success."); } else { ESP_LOGE(TAG, "pushCo2TempHumi() failure."); peri.iothub_client.check(false); } } } // // // static void periodical_push_state() { Peripherals &peri = Peripherals::getInstance(); if (peri.system_power.needToUpdate()) { peri.system_power.update(); } DynamicJsonDocument json(IotHubClient::MESSAGE_MAX_LEN); if (json.capacity() == 0) { ESP_LOGE(TAG, "memory allocation error."); return; } char buf[10] = {'\0'}; snprintf(buf, 10, "%d%%", static_cast<int>(peri.system_power.getBatteryPercentage())); json["batteryLevel"] = buf; uint32_t upseconds = peri.ticktack.uptimeSeconds(); json["uptime"] = upseconds; if (peri.iothub_client.pushState(json)) { ESP_LOGD(TAG, "pushState() success."); } else { ESP_LOGE(TAG, "pushState() failure."); peri.iothub_client.check(false); } } // // // static void periodical_send_to_iothub(const MeasurementSets &m) { struct tm utc; gmtime_r(&m.measured_at, &utc); // bool allowToPushMessage = utc.tm_sec == 0 && utc.tm_min % IOTHUB_PUSH_MESSAGE_EVERY_MINUTES == 0; bool allowToPushState = utc.tm_sec == 0 && utc.tm_min % IOTHUB_PUSH_STATE_EVERY_MINUTES == 0; Peripherals &peri = Peripherals::getInstance(); // if (peri.wifi_launcher.hasWifiConnection()) { // // send to IoT Hub // if (allowToPushMessage) { periodical_push_message(m); } if (allowToPushState) { periodical_push_state(); } } // if (allowToPushMessage) { // // insert to local logging file // if (m.bme280.good() && m.sgp30.good() && m.scd30.good()) { peri.data_logging_file.write_data_to_log_file( m.measured_at, m.bme280.get(), m.sgp30.get(), m.scd30.get()); } // // insert to local database // if (m.bme280.good()) { peri.local_database.insert(m.bme280.get()); } if (m.sgp30.good()) { peri.local_database.insert(m.sgp30.get()); } if (m.scd30.good()) { peri.local_database.insert(m.scd30.get()); } } } // // // void loop() { ArduinoOTA.handle(); delay(1); Peripherals &peri = Peripherals::getInstance(); if (peri.wifi_launcher.hasWifiConnection()) { peri.iothub_client.check(true); } static clock_t before_clock = 0; clock_t now_clock = clock(); if ((now_clock - before_clock) >= CLOCKS_PER_SEC) { peri.ticktack.update(); MeasurementSets m = periodical_measurement_sets(peri.ticktack.time()); peri.screen.update(m.measured_at); if (m.scd30.good()) { Ppm co2 = m.scd30.get().co2; peri.led_signal.showSignal(co2); } periodical_send_to_iothub(m); before_clock = now_clock; } M5.update(); }
28.106529
80
0.643477
ak1211
e34bcf849e9e1153293bfc6d958987ee9d211b80
7,494
cc
C++
imglib/imgtrace.cc
gitter-badger/iulib
b2b66dbcbbbfcb4aac0784ea9f07db998077dbc1
[ "Apache-2.0" ]
19
2015-01-22T09:53:53.000Z
2019-05-16T09:01:23.000Z
imglib/imgtrace.cc
bygreencn/iulib
75072ef90585bdc503f66ef682a7a585e394298e
[ "Apache-2.0" ]
2
2016-10-20T00:56:10.000Z
2017-07-06T14:40:31.000Z
imglib/imgtrace.cc
bygreencn/iulib
75072ef90585bdc503f66ef682a7a585e394298e
[ "Apache-2.0" ]
14
2015-01-09T01:33:52.000Z
2019-02-03T03:58:41.000Z
// -*- C++ -*- // Copyright 2006-2007 Deutsches Forschungszentrum fuer Kuenstliche Intelligenz // or its licensors,as applicable. // Copyright 1995-2005 Thomas M. Breuel // // You may not use this file except under the terms of the accompanying license. // // 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. // // Project: iulib -- image understanding library // File: imgtrace.cc // Purpose: chain tracing and approximation // Responsible: tmb // Reviewer: // Primary Repository: // Web Sites: www.iupr.org,www.dfki.de extern "C" { #include <math.h> #include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <string.h> } #include "colib/colib.h" #include "imglib.h" using namespace colib; namespace colib { typedef narray<vec2> vec2array; template void reverse(vec2array &); } namespace iulib { inline float point_line_dist(vec2 p,vec2 a,vec2 b) { vec2 delta = b-a; float mag = delta.magnitude(); // if the distance is small,just return the point distance; // that's the right thing for approx_chain if(mag<1e-4) return a.distance(p); vec2 normal = delta.normal()/mag; float offset = normal * a; return fabs(normal * p - offset); } static void approx_chain(intarray &breaks,vec2array &chain,int i0, int i1,float maxdist) { float md = 0.0; int mi = -1; vec2 a = chain[i0]; vec2 b = chain[i1]; for(int i=i0; i<=i1; i++) { float d = point_line_dist(chain[i],a,b); //printf("%d %g %g %g\n",i,d,a.distance(chain[i]),b.distance(chain[i])); if(d<=md) continue; md = d; mi = i; } //printf("i0 %d i1 %d mi %d md %g maxdist %g\n",i0,i1,mi,md,maxdist); if(md<maxdist) return; ASSERT(mi!=i0 && mi!=i1); approx_chain(breaks,chain,i0,mi,maxdist); breaks.push(mi); approx_chain(breaks,chain,mi,i1,maxdist); } struct ChainTracer : IChainTracer { enum {OFF=0,ON=1,DONE=2}; bytearray bi; int sx,sy; int x,y; int w,h; int count_neighbors() { int nn=0; if(bi(x+1,y)) nn++; if(bi(x+1,y+1)) nn++; if(bi(x,y+1)) nn++; if(bi(x-1,y+1)) nn++; if(bi(x-1,y)) nn++; if(bi(x-1,y-1)) nn++; if(bi(x,y-1)) nn++; if(bi(x+1,y-1)) nn++; return nn; } bool nextpixel() { if(bi(x+1,y)==ON) { x=x+1; y=y; return true; } if(bi(x+1,y+1)==ON) { x=x+1; y=y+1; return true; } if(bi(x,y+1)==ON) { x=x; y=y+1; return true; } if(bi(x-1,y+1)==ON) { x=x-1; y=y+1; return true; } if(bi(x-1,y)==ON) { x=x-1; y=y; return true; } if(bi(x-1,y-1)==ON) { x=x-1; y=y-1; return true; } if(bi(x,y-1)==ON) { x=x; y=y-1; return true; } if(bi(x+1,y-1)==ON) { x=x+1; y=y-1; return true; } return false; } bool nextstart() { for(; sx<w; sx++) for(sy=0; sy<h; sy++) { if(!bi(sx,sy)) continue; if(bi(sx,sy)==DONE) continue; x = sx; y = sy; return true; } return false; } void set_image(bytearray &image) { w = image.dim(0); h = image.dim(1); x = 0; y = 0; sx = 0; sy = 0; bi.resize(w,h); for(int i=0,n=image.length1d(); i<n; i++) bi.at1d(i) = image.at1d(i) ? ON : OFF; for(int i=0; i<w; i++) bi(i,0)=bi(i,h-1)=OFF; for(int j=0; j<h; j++) bi(0,j)=bi(w-1,j)=OFF; w--; h--; } bool get_chain(vec2array &points,bool close=false) { points.clear(); if(!nextstart()) return false; do { points.push() = vec2(x,y); bi(x,y) = DONE; } while(nextpixel()); x = sx; y = sy; if(nextpixel()) { // sweep up the other direction (if any) colib::reverse(points); do { points.push() = vec2(x,y); bi(x,y) = DONE; } while(nextpixel()); } if(close && points[0].distance(points[points.length()-1])<2.0) { // close circular chains points.push(points[0]); } return true; } intarray breaks; vec2array chain; bool get_poly(vec2array &poly,float maxdist=1.0,bool close=false) { poly.clear(); breaks.clear(); if(!get_chain(chain,close)) return false; if(chain.length()<3) { for(int i=0; i<chain.length(); i++) poly.push(chain[i]); } else { breaks.push(0); approx_chain(breaks,chain,0,chain.length()-1,maxdist); breaks.push(chain.length()-1); for(int i=0; i<breaks.length(); i++) poly.push(chain[breaks[i]]); } return true; } bool get_chain(floatarray &points,bool close=false,int sample=1) { vec2array temp; bool result = get_chain(temp,close); if(!result) return false; int total = temp.length(); int n = int(total/sample); int offset = int((total-n*sample)/2); int reserve = int((total+sample-1)/sample); points.resize(reserve,2); fill(points,-1); for(int i=offset,j=0; i<total; i+=sample,j++) { points(j,0) = temp[i][0]; points(j,1) = temp[i][1]; } return true; } bool get_poly(floatarray &points,float maxdist=1.0,bool close=false) { vec2array temp; bool result = get_poly(temp,maxdist,close); if(!result) return false; points.resize(temp.length(),2); for(int i=0; i<temp.length(); i++) { points(i,0) = temp[i][0]; points(i,1) = temp[i][1]; } return true; } bool started() { return bi.dim(0)>0; } void clear() { bi.clear(); breaks.clear(); chain.clear(); } ~ChainTracer() { } }; IChainTracer::~IChainTracer() { } IChainTracer *chaintracer(bytearray &image) { IChainTracer *result = new ChainTracer(); result->set_image(image); return result; } }
29.976
84
0.475047
gitter-badger
e350dd64000e7be1b0395f4ca64d97228808c94b
2,518
cpp
C++
openbr/plugins/metadata/croprect.cpp
kassemitani/openbr
7b453f7abc6f997839a858f4b7686bc5e21ef7b2
[ "Apache-2.0" ]
1,883
2015-01-04T07:04:24.000Z
2022-03-30T13:33:37.000Z
openbr/plugins/metadata/croprect.cpp
kassemitani/openbr
7b453f7abc6f997839a858f4b7686bc5e21ef7b2
[ "Apache-2.0" ]
272
2015-01-02T09:53:20.000Z
2022-03-29T08:04:33.000Z
openbr/plugins/metadata/croprect.cpp
kassemitani/openbr
7b453f7abc6f997839a858f4b7686bc5e21ef7b2
[ "Apache-2.0" ]
718
2015-01-02T18:51:07.000Z
2022-03-29T08:10:53.000Z
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright 2012 The MITRE 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. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include <openbr/plugins/openbr_internal.h> #include <openbr/core/qtutils.h> namespace br { /*! * \ingroup transforms * \brief Crops the width and height of a Template's rects by input width and height factors. * \author Scott Klum \cite sklum */ class CropRectTransform : public UntrainableMetadataTransform { Q_OBJECT Q_PROPERTY(QString widthCrop READ get_widthCrop WRITE set_widthCrop RESET reset_widthCrop STORED false) Q_PROPERTY(QString heightCrop READ get_heightCrop WRITE set_heightCrop RESET reset_heightCrop STORED false) BR_PROPERTY(QString, widthCrop, QString()) BR_PROPERTY(QString, heightCrop, QString()) void projectMetadata(const File &src, File &dst) const { dst = src; QList<QRectF> rects = src.rects(); for (int i=0;i < rects.size(); i++) { rects[i].setX(rects[i].x() + rects[i].width() * QtUtils::toPoint(widthCrop).x()); rects[i].setY(rects[i].y() + rects[i].height() * QtUtils::toPoint(heightCrop).x()); rects[i].setWidth(rects[i].width() * (1-QtUtils::toPoint(widthCrop).y())); rects[i].setHeight(rects[i].height() * (1-QtUtils::toPoint(heightCrop).y())); } dst.setRects(rects); } }; BR_REGISTER(Transform, CropRectTransform) } // namespace br #include "metadata/croprect.moc"
44.964286
111
0.534154
kassemitani
e351892e77f867273d711f5895538a2bef0775de
2,133
hpp
C++
series2_workbench/hyp_sys_1d/include/ancse/boundary_condition.hpp
BeatHubmann/19H-AdvNCSE
3979f768da933de82bd6ab29bbf31ea9fc31e501
[ "MIT" ]
1
2020-01-05T22:38:47.000Z
2020-01-05T22:38:47.000Z
series2_handout/hyp_sys_1d/include/ancse/boundary_condition.hpp
BeatHubmann/19H-AdvNCSE
3979f768da933de82bd6ab29bbf31ea9fc31e501
[ "MIT" ]
null
null
null
series2_handout/hyp_sys_1d/include/ancse/boundary_condition.hpp
BeatHubmann/19H-AdvNCSE
3979f768da933de82bd6ab29bbf31ea9fc31e501
[ "MIT" ]
1
2019-12-08T20:43:27.000Z
2019-12-08T20:43:27.000Z
#ifndef HYPSYS1D_BOUNDARY_CONDITION_HPP #define HYPSYS1D_BOUNDARY_CONDITION_HPP #include <Eigen/Dense> #include <memory> /// Interface for enforcing boundary conditions through ghost-cells. class BoundaryCondition { public: // BoundaryCondition is an abstract base class. It needs a virtual // destructor. virtual ~BoundaryCondition() = default; /// Set the value of the ghost-cells in `u`. virtual void operator()(Eigen::MatrixXd &u) const = 0; }; /// Boundary conditions that mimic a periodic domain. class PeriodicBC : public BoundaryCondition { public: explicit PeriodicBC(int n_ghost) : n_ghost(n_ghost) {} virtual void operator()(Eigen::MatrixXd &u) const override { using index_t = Eigen::Index; index_t n_cells = u.cols(); for (index_t i = 0; i < n_ghost; ++i) { u.col(i) = u.col(n_cells - 2 * n_ghost + i); u.col(n_cells - n_ghost + i) = u.col(n_ghost + i); } } private: int n_ghost; }; /// These boundary conditions mimic a permeable surface. /** A very simple way of mimicing this is to say that the value of the * ghost-cells is the same as the value just inside the physical domain. */ class OutflowBC : public BoundaryCondition { public: explicit OutflowBC(int n_ghost) : n_ghost(n_ghost) {} virtual void operator()(Eigen::MatrixXd &u) const override { using index_t = Eigen::Index; index_t n_cells = u.cols(); for (index_t i = 0; i < n_ghost; ++i) { u.col(i) = u.col(n_ghost); u.col(n_cells - n_ghost + i) = u.col(n_cells - n_ghost - 1); } } private: int n_ghost; }; /// Create the requested boundary conditions. /** Note: This is a factory. * The purpose is to select a boundary condition at runtime, * e.g. through a configuration file such as `config.json`. * * @param n_ghost number of ghost cell. * @param bc_key name/identifies of the boundary condition */ std::shared_ptr<BoundaryCondition> make_boundary_condition(int n_ghost, const std::string &bc_key); #endif // HYPSYS1D_BOUNDARY_CONDITION_HPP
30.042254
73
0.662916
BeatHubmann
e352a93167800c714270a7844e7efbd780891caf
1,319
cc
C++
media/mojo/mojom/encoded_audio_buffer_traits.cc
zealoussnow/chromium
fd8a8914ca0183f0add65ae55f04e287543c7d4a
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
14,668
2015-01-01T01:57:10.000Z
2022-03-31T23:33:32.000Z
media/mojo/mojom/encoded_audio_buffer_traits.cc
zealoussnow/chromium
fd8a8914ca0183f0add65ae55f04e287543c7d4a
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
86
2015-10-21T13:02:42.000Z
2022-03-14T07:50:50.000Z
media/mojo/mojom/encoded_audio_buffer_traits.cc
zealoussnow/chromium
fd8a8914ca0183f0add65ae55f04e287543c7d4a
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
5,941
2015-01-02T11:32:21.000Z
2022-03-31T16:35:46.000Z
// Copyright 2021 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 "media/mojo/mojom/encoded_audio_buffer_traits.h" #include "mojo/public/cpp/base/time_mojom_traits.h" namespace mojo { // static bool StructTraits<media::mojom::EncodedAudioBufferDataView, media::EncodedAudioBuffer>:: Read(media::mojom::EncodedAudioBufferDataView input, media::EncodedAudioBuffer* output) { media::AudioParameters params; if (!input.ReadParams(&params)) return false; base::TimeDelta ts; if (!input.ReadTimestamp(&ts)) return false; base::TimeTicks timestamp = ts + base::TimeTicks(); base::TimeDelta duration; if (!input.ReadDuration(&duration)) return false; mojo::ArrayDataView<uint8_t> data_view; input.GetDataDataView(&data_view); if (data_view.is_null()) return false; size_t encoded_data_size = data_view.size(); std::unique_ptr<uint8_t[]> encoded_data(new uint8_t[encoded_data_size]); memcpy(encoded_data.get(), data_view.data(), encoded_data_size); *output = media::EncodedAudioBuffer(params, std::move(encoded_data), encoded_data_size, timestamp, duration); return true; } } // namespace mojo
29.977273
78
0.709629
zealoussnow
e358559a3caa8d098753bf701165bc2bc379231c
1,250
cpp
C++
BinarySearchTree/BinarySearchTree/BinarySearchTree.cpp
epoll31/DataStructuresCpp
bfd93bad226bb5175d6b74f8dd9beb60150bb055
[ "MIT" ]
null
null
null
BinarySearchTree/BinarySearchTree/BinarySearchTree.cpp
epoll31/DataStructuresCpp
bfd93bad226bb5175d6b74f8dd9beb60150bb055
[ "MIT" ]
null
null
null
BinarySearchTree/BinarySearchTree/BinarySearchTree.cpp
epoll31/DataStructuresCpp
bfd93bad226bb5175d6b74f8dd9beb60150bb055
[ "MIT" ]
null
null
null
#include <iostream> #include "BinarySearchTree.h" #include <vector> int main() { BinarySearchTree<int> tree; //tree.Add(4); //tree.Add(2); //tree.Add(6); //tree.Add(1); //tree.Add(3); //tree.Add(5); //tree.Add(7); tree.Add(25); tree.Add(15); tree.Add(50); tree.Add(10); tree.Add(22); tree.Add(35); tree.Add(70); tree.Add(4); tree.Add(12); tree.Add(18); tree.Add(24); tree.Add(31); tree.Add(44); tree.Add(66); tree.Add(90); std::vector<Node<int>*> preorder = tree.DepthFirstTraversalPreOrder(); for (auto i = preorder.begin(); i < preorder.end(); i++) { std::cout << (*i)->Value << " "; } std::cout << std::endl; std::vector<Node<int>*> inorder = tree.DepthFirstTraversalInOrder(); for (auto i = inorder.begin(); i < inorder.end(); i++) { std::cout << (*i)->Value << " "; } std::cout << std::endl; std::vector<Node<int>*> postorder = tree.DepthFirstTraversalPostOrder(); for (auto i = postorder.begin(); i < postorder.end(); i++) { std::cout << (*i)->Value << " "; } std::cout << std::endl; std::vector<Node<int>*> breadthfirst = tree.BreadthFirstTraversal(); for (auto i = breadthfirst.begin(); i < breadthfirst.end(); i++) { std::cout << (*i)->Value << " "; } std::cout << std::endl; }
19.230769
73
0.5936
epoll31
e358d037e97c4c009f282a6b167ec8697d69edf7
3,734
cc
C++
conf_crawler/url_dedup/static_dedup.cc
WinterW/crawler_cpp
e0c8dba77233005b1ab13731d1cbcce274b70778
[ "Apache-2.0" ]
null
null
null
conf_crawler/url_dedup/static_dedup.cc
WinterW/crawler_cpp
e0c8dba77233005b1ab13731d1cbcce274b70778
[ "Apache-2.0" ]
null
null
null
conf_crawler/url_dedup/static_dedup.cc
WinterW/crawler_cpp
e0c8dba77233005b1ab13731d1cbcce274b70778
[ "Apache-2.0" ]
2
2020-09-12T13:50:38.000Z
2020-09-16T15:55:14.000Z
/** * @Copyright 2011 GanJi Inc. * @file ganji/crawler/conf_crawler/url_dedup/static_dedup.cc * @namespace ganji::crawler::conf_crawler::dedup * @version 1.0 * @author lisizhong * @date 2012-03-31 * * 改动程序后, 请使用tools/cpplint/cpplint.py 检查代码是否符合编码规范! * 遵循的编码规范请参考: http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml * Change Log: */ #include "conf_crawler/url_dedup/static_dedup.h" #include <boost/regex.hpp> #include "util/log/thread_fast_log.h" #include "util/thread/sleep.h" #include "util/system/system.h" #include "conf_crawler/url_dedup/dedup_config.h" using std::string; using boost::smatch; using boost::regex; using boost::regex_search; using boost::regex_error; namespace FastLog = ::ganji::util::log::ThreadFastLog; using FastLog::WriteLog; using FastLog::kLogFatal; using FastLog::kLogDebug; using FastLog::kLogNotice; using FastLog::kLogWarning; using ganji::util::thread::Thread; namespace Sleep = ::ganji::util::thread::Sleep; namespace System = ::ganji::util::system::System; namespace ganji { namespace crawler { namespace conf_crawler { namespace dedup { StaticDedup::~StaticDedup() { Thread::FreeThread(p_timer_thread_); } int StaticDedup::Init(DedupConfig *p_config) { p_config_ = p_config; int bucket_count = p_config_->BucketCount(); url_set_.rehash(bucket_count); /// start timer thread p_timer_thread_ = Thread::CreateThread(TimerThread, this); p_timer_thread_->ResumeThread(); return 0; } bool StaticDedup::IsExists(const string &url) { url_lock_.RdLock(); StringHashSet::iterator it = url_set_.find(url); bool is_exists = (it != url_set_.end()); url_lock_.Unlock(); return is_exists; } bool StaticDedup::Insert(const string &url) { url_lock_.WrLock(); url_set_.insert(url); url_lock_.Unlock(); return true; } bool StaticDedup::TestExistsAndInsert(const string &url, bool *p_exists) { url_lock_.WrLock(); StringHashSet::iterator it = url_set_.find(url); if (it == url_set_.end()) { *p_exists = false; url_set_.insert(url); } else { *p_exists = true; } url_lock_.Unlock(); return true; } void StaticDedup::Rehash(int bucket_count) { if (bucket_count <= 0) { WriteLog(kLogWarning, "Rehash(),#bucket:%d invalid", bucket_count); return; } url_lock_.WrLock(); url_set_.rehash(bucket_count); url_lock_.Unlock(); } bool StaticDedup::Remove(const std::string &url) { bool found = true; url_lock_.WrLock(); StringHashSet::iterator it = url_set_.find(url); if (it == url_set_.end()) { found = false; } else { url_set_.erase(it); } url_lock_.Unlock(); return found; } int StaticDedup::BatchRemove(const std::string &url_pattern) { int count = 0; url_lock_.WrLock(); for (StringHashSet::iterator it = url_set_.begin(); it != url_set_.end();) { const string &url = *it; try { smatch what; regex url_regex = regex(url_pattern); if (regex_search(url.begin(), url.end(), what, url_regex)) { url_set_.erase(it++); count++; } else { ++it; } } catch(const regex_error &e) { WriteLog(kLogFatal, "regex error:%s", e.what()); count = -1; break; } } url_lock_.Unlock(); return count; } void *StaticDedup::TimerThread(void *arg) { StaticDedup *p_dedup = reinterpret_cast<StaticDedup *>(arg); while (true) { Sleep::DoSleep(60 * 1000); int mb = 0; if (System::GetMem(&mb) < 0) continue; p_dedup->url_lock_.RdLock(); int url_count = p_dedup->url_set_.size(); p_dedup->url_lock_.Unlock(); WriteLog(kLogNotice, "#url:%d mem:%dMB", url_count, mb); } return NULL; } }}}}; ///< end of namespace ganji::crawler::conf_crawler::dedup
23.192547
80
0.676219
WinterW
e35ace38829eb4a5af369c76826cb2dab3632292
12,095
cpp
C++
android/android_42/base/media/jni/android_media_Utils.cpp
yakuizhao/intel-vaapi-driver
b2bb0383352694941826543a171b557efac2219b
[ "MIT" ]
null
null
null
android/android_42/base/media/jni/android_media_Utils.cpp
yakuizhao/intel-vaapi-driver
b2bb0383352694941826543a171b557efac2219b
[ "MIT" ]
null
null
null
android/android_42/base/media/jni/android_media_Utils.cpp
yakuizhao/intel-vaapi-driver
b2bb0383352694941826543a171b557efac2219b
[ "MIT" ]
null
null
null
/* * Copyright 2011, The Android Open Source Project * * 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. */ // #define LOG_NDEBUG 0 #define LOG_TAG "AndroidMediaUtils" #include <utils/Log.h> #include "android_media_Utils.h" #include <media/stagefright/foundation/ADebug.h> #include <media/stagefright/foundation/ABuffer.h> #include <media/stagefright/foundation/AMessage.h> namespace android { bool ConvertKeyValueArraysToKeyedVector( JNIEnv *env, jobjectArray keys, jobjectArray values, KeyedVector<String8, String8>* keyedVector) { int nKeyValuePairs = 0; bool failed = false; if (keys != NULL && values != NULL) { nKeyValuePairs = env->GetArrayLength(keys); failed = (nKeyValuePairs != env->GetArrayLength(values)); } if (!failed) { failed = ((keys != NULL && values == NULL) || (keys == NULL && values != NULL)); } if (failed) { ALOGE("keys and values arrays have different length"); jniThrowException(env, "java/lang/IllegalArgumentException", NULL); return false; } for (int i = 0; i < nKeyValuePairs; ++i) { // No need to check on the ArrayIndexOutOfBoundsException, since // it won't happen here. jstring key = (jstring) env->GetObjectArrayElement(keys, i); jstring value = (jstring) env->GetObjectArrayElement(values, i); const char* keyStr = env->GetStringUTFChars(key, NULL); if (!keyStr) { // OutOfMemoryError return false; } const char* valueStr = env->GetStringUTFChars(value, NULL); if (!valueStr) { // OutOfMemoryError env->ReleaseStringUTFChars(key, keyStr); return false; } keyedVector->add(String8(keyStr), String8(valueStr)); env->ReleaseStringUTFChars(key, keyStr); env->ReleaseStringUTFChars(value, valueStr); env->DeleteLocalRef(key); env->DeleteLocalRef(value); } return true; } static jobject makeIntegerObject(JNIEnv *env, int32_t value) { jclass clazz = env->FindClass("java/lang/Integer"); CHECK(clazz != NULL); jmethodID integerConstructID = env->GetMethodID(clazz, "<init>", "(I)V"); CHECK(integerConstructID != NULL); return env->NewObject(clazz, integerConstructID, value); } static jobject makeLongObject(JNIEnv *env, int64_t value) { jclass clazz = env->FindClass("java/lang/Long"); CHECK(clazz != NULL); jmethodID longConstructID = env->GetMethodID(clazz, "<init>", "(J)V"); CHECK(longConstructID != NULL); return env->NewObject(clazz, longConstructID, value); } static jobject makeFloatObject(JNIEnv *env, float value) { jclass clazz = env->FindClass("java/lang/Float"); CHECK(clazz != NULL); jmethodID floatConstructID = env->GetMethodID(clazz, "<init>", "(F)V"); CHECK(floatConstructID != NULL); return env->NewObject(clazz, floatConstructID, value); } static jobject makeByteBufferObject( JNIEnv *env, const void *data, size_t size) { jbyteArray byteArrayObj = env->NewByteArray(size); env->SetByteArrayRegion(byteArrayObj, 0, size, (const jbyte *)data); jclass clazz = env->FindClass("java/nio/ByteBuffer"); CHECK(clazz != NULL); jmethodID byteBufWrapID = env->GetStaticMethodID(clazz, "wrap", "([B)Ljava/nio/ByteBuffer;"); CHECK(byteBufWrapID != NULL); jobject byteBufObj = env->CallStaticObjectMethod( clazz, byteBufWrapID, byteArrayObj); env->DeleteLocalRef(byteArrayObj); byteArrayObj = NULL; return byteBufObj; } static void SetMapInt32( JNIEnv *env, jobject hashMapObj, jmethodID hashMapPutID, const char *key, int32_t value) { jstring keyObj = env->NewStringUTF(key); jobject valueObj = makeIntegerObject(env, value); jobject res = env->CallObjectMethod( hashMapObj, hashMapPutID, keyObj, valueObj); env->DeleteLocalRef(valueObj); valueObj = NULL; env->DeleteLocalRef(keyObj); keyObj = NULL; } status_t ConvertMessageToMap( JNIEnv *env, const sp<AMessage> &msg, jobject *map) { jclass hashMapClazz = env->FindClass("java/util/HashMap"); if (hashMapClazz == NULL) { return -EINVAL; } jmethodID hashMapConstructID = env->GetMethodID(hashMapClazz, "<init>", "()V"); if (hashMapConstructID == NULL) { return -EINVAL; } jmethodID hashMapPutID = env->GetMethodID( hashMapClazz, "put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); if (hashMapPutID == NULL) { return -EINVAL; } jobject hashMap = env->NewObject(hashMapClazz, hashMapConstructID); for (size_t i = 0; i < msg->countEntries(); ++i) { AMessage::Type valueType; const char *key = msg->getEntryNameAt(i, &valueType); jobject valueObj = NULL; switch (valueType) { case AMessage::kTypeInt32: { int32_t val; CHECK(msg->findInt32(key, &val)); valueObj = makeIntegerObject(env, val); break; } case AMessage::kTypeInt64: { int64_t val; CHECK(msg->findInt64(key, &val)); valueObj = makeLongObject(env, val); break; } case AMessage::kTypeFloat: { float val; CHECK(msg->findFloat(key, &val)); valueObj = makeFloatObject(env, val); break; } case AMessage::kTypeString: { AString val; CHECK(msg->findString(key, &val)); valueObj = env->NewStringUTF(val.c_str()); break; } case AMessage::kTypeBuffer: { sp<ABuffer> buffer; CHECK(msg->findBuffer(key, &buffer)); valueObj = makeByteBufferObject( env, buffer->data(), buffer->size()); break; } case AMessage::kTypeRect: { int32_t left, top, right, bottom; CHECK(msg->findRect(key, &left, &top, &right, &bottom)); SetMapInt32( env, hashMap, hashMapPutID, StringPrintf("%s-left", key).c_str(), left); SetMapInt32( env, hashMap, hashMapPutID, StringPrintf("%s-top", key).c_str(), top); SetMapInt32( env, hashMap, hashMapPutID, StringPrintf("%s-right", key).c_str(), right); SetMapInt32( env, hashMap, hashMapPutID, StringPrintf("%s-bottom", key).c_str(), bottom); break; } default: break; } if (valueObj != NULL) { jstring keyObj = env->NewStringUTF(key); jobject res = env->CallObjectMethod( hashMap, hashMapPutID, keyObj, valueObj); env->DeleteLocalRef(keyObj); keyObj = NULL; env->DeleteLocalRef(valueObj); valueObj = NULL; } } *map = hashMap; return OK; } status_t ConvertKeyValueArraysToMessage( JNIEnv *env, jobjectArray keys, jobjectArray values, sp<AMessage> *out) { jclass stringClass = env->FindClass("java/lang/String"); CHECK(stringClass != NULL); jclass integerClass = env->FindClass("java/lang/Integer"); CHECK(integerClass != NULL); jclass floatClass = env->FindClass("java/lang/Float"); CHECK(floatClass != NULL); jclass byteBufClass = env->FindClass("java/nio/ByteBuffer"); CHECK(byteBufClass != NULL); sp<AMessage> msg = new AMessage; jsize numEntries = 0; if (keys != NULL) { if (values == NULL) { return -EINVAL; } numEntries = env->GetArrayLength(keys); if (numEntries != env->GetArrayLength(values)) { return -EINVAL; } } else if (values != NULL) { return -EINVAL; } for (jsize i = 0; i < numEntries; ++i) { jobject keyObj = env->GetObjectArrayElement(keys, i); if (!env->IsInstanceOf(keyObj, stringClass)) { return -EINVAL; } const char *tmp = env->GetStringUTFChars((jstring)keyObj, NULL); if (tmp == NULL) { return -ENOMEM; } AString key = tmp; env->ReleaseStringUTFChars((jstring)keyObj, tmp); tmp = NULL; jobject valueObj = env->GetObjectArrayElement(values, i); if (env->IsInstanceOf(valueObj, stringClass)) { const char *value = env->GetStringUTFChars((jstring)valueObj, NULL); if (value == NULL) { return -ENOMEM; } msg->setString(key.c_str(), value); env->ReleaseStringUTFChars((jstring)valueObj, value); value = NULL; } else if (env->IsInstanceOf(valueObj, integerClass)) { jmethodID intValueID = env->GetMethodID(integerClass, "intValue", "()I"); CHECK(intValueID != NULL); jint value = env->CallIntMethod(valueObj, intValueID); msg->setInt32(key.c_str(), value); } else if (env->IsInstanceOf(valueObj, floatClass)) { jmethodID floatValueID = env->GetMethodID(floatClass, "floatValue", "()F"); CHECK(floatValueID != NULL); jfloat value = env->CallFloatMethod(valueObj, floatValueID); msg->setFloat(key.c_str(), value); } else if (env->IsInstanceOf(valueObj, byteBufClass)) { jmethodID positionID = env->GetMethodID(byteBufClass, "position", "()I"); CHECK(positionID != NULL); jmethodID limitID = env->GetMethodID(byteBufClass, "limit", "()I"); CHECK(limitID != NULL); jint position = env->CallIntMethod(valueObj, positionID); jint limit = env->CallIntMethod(valueObj, limitID); sp<ABuffer> buffer = new ABuffer(limit - position); void *data = env->GetDirectBufferAddress(valueObj); if (data != NULL) { memcpy(buffer->data(), (const uint8_t *)data + position, buffer->size()); } else { jmethodID arrayID = env->GetMethodID(byteBufClass, "array", "()[B"); CHECK(arrayID != NULL); jbyteArray byteArray = (jbyteArray)env->CallObjectMethod(valueObj, arrayID); CHECK(byteArray != NULL); env->GetByteArrayRegion( byteArray, position, buffer->size(), (jbyte *)buffer->data()); env->DeleteLocalRef(byteArray); byteArray = NULL; } msg->setBuffer(key.c_str(), buffer); } } *out = msg; return OK; } } // namespace android
29.864198
80
0.553038
yakuizhao
e35dab71a80c6647065063a1917a3fd189f69d4f
685
cpp
C++
cpp/tests/RemoveDuplicatesFromSortedArrayIITest.cpp
qianbinbin/leetcode
915cecab0c940cd13847683ec55b17b77eb0f39b
[ "MIT" ]
4
2018-03-05T02:27:16.000Z
2021-03-15T14:19:44.000Z
cpp/tests/RemoveDuplicatesFromSortedArrayIITest.cpp
qianbinbin/leetcode
915cecab0c940cd13847683ec55b17b77eb0f39b
[ "MIT" ]
null
null
null
cpp/tests/RemoveDuplicatesFromSortedArrayIITest.cpp
qianbinbin/leetcode
915cecab0c940cd13847683ec55b17b77eb0f39b
[ "MIT" ]
2
2018-07-22T10:32:10.000Z
2018-10-20T03:14:28.000Z
#include "RemoveDuplicatesFromSortedArrayII.h" #include "gtest/gtest.h" using namespace lcpp; TEST(RemoveDuplicatesFromSortedArrayII, Solution81_1) { std::vector<int> Nums1{1, 1, 1, 2, 2, 3}; const int Size1 = 5; ASSERT_EQ(Size1, Solution80_1().removeDuplicates(Nums1)); const std::vector<int> Expected1{1, 1, 2, 2, 3}; EXPECT_EQ(Expected1, std::vector<int>(Nums1.begin(), Nums1.begin() + Size1)); std::vector<int> Nums2{0, 0, 1, 1, 1, 1, 2, 3, 3}; const int Size2 = 7; ASSERT_EQ(Size2, Solution80_1().removeDuplicates(Nums2)); const std::vector<int> Expected2{0, 0, 1, 1, 2, 3, 3}; EXPECT_EQ(Expected2, std::vector<int>(Nums2.begin(), Nums2.begin() + Size2)); }
38.055556
79
0.687591
qianbinbin
e3607de65830fbfb4162683c6b99e87abfd468f3
3,168
cpp
C++
cpp/src/opendnp3/LogTypes.cpp
cverges/adnp3
2a07f364bec8f1ad46e33cc8b6b8ef37b9005f3a
[ "MS-PL", "Naumen", "Condor-1.1", "Apache-1.1" ]
2
2016-08-31T23:03:06.000Z
2017-07-26T01:57:01.000Z
cpp/src/opendnp3/LogTypes.cpp
dupes/dnp3-automatak
08348d21738ae93e9a7f02ec46933934b6b463af
[ "Naumen", "Condor-1.1", "Apache-1.1", "MS-PL" ]
null
null
null
cpp/src/opendnp3/LogTypes.cpp
dupes/dnp3-automatak
08348d21738ae93e9a7f02ec46933934b6b463af
[ "Naumen", "Condor-1.1", "Apache-1.1", "MS-PL" ]
1
2020-01-20T08:23:27.000Z
2020-01-20T08:23:27.000Z
// // Licensed to Green Energy Corp (www.greenenergycorp.com) under one or // more contributor license agreements. See the NOTICE file distributed // with this work for additional information regarding copyright ownership. // Green Energy Corp licenses this file to you 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. // // This file was forked on 01/01/2013 by Automatak, LLC and modifications // have been made to this file. Automatak, LLC licenses these modifications to // you under the terms of the License. // #include <opendnp3/LogTypes.h> #include <opendnp3/Util.h> #include <sstream> namespace opendnp3 { #ifndef OPENDNP3_STRIP_LOG_MESSAGES const FilterAssoc LogTypes::filters[LogTypes::NUM_FILTER] = { {LEV_DEBUG, 'd'}, {LEV_COMM, 'c'}, {LEV_INTERPRET, 'p'}, {LEV_INFO, 'i'}, {LEV_WARNING, 'w'}, {LEV_ERROR, 'e'}, {LEV_EVENT, 'v'} }; #endif int LogTypes::FilterLevelToMask(FilterLevel aFilter) { //since FilterLevel is a power of 2 (single bit), subtracting 1 will //set all the bits below the set bit. //set the filter bit and all the bits below it return aFilter | (aFilter - 1); } FilterLevel LogTypes::ConvertIntToFilterLevel(int aLevel) { switch(aLevel) { case(LEV_DEBUG): return LEV_DEBUG; case(LEV_COMM): return LEV_COMM; case(LEV_INTERPRET): return LEV_INTERPRET; case(LEV_INFO): return LEV_INFO; case(LEV_WARNING):return LEV_WARNING; case(LEV_ERROR): return LEV_ERROR; case(LEV_EVENT): return LEV_EVENT; default: return LEV_DEBUG; } } #ifndef OPENDNP3_STRIP_LOG_MESSAGES int LogTypes::GetFilterMask(char c) { switch(c) { case('a'): return MASK_ALL_LEVELS; case('d'): return LEV_DEBUG; case('c'): return LEV_COMM; case('p'): return LEV_INTERPRET; case('i'): return LEV_INFO; case('w'): return LEV_WARNING; case('e'): return LEV_ERROR; case('v'): return LEV_EVENT; case('n'): return 0; default: return -1; } } int LogTypes::GetFilterMask(const std::string& arg) { std::string copy(arg); toLowerCase(copy); int ret = 0; for(auto c: copy) ret |= GetFilterMask(c); return ret; } std::string LogTypes::GetLevelString( FilterLevel aLevel ) { switch(aLevel) { case(LEV_DEBUG): return "DEBUG"; case(LEV_COMM): return "COMM"; case(LEV_INTERPRET): return "INTERPRET"; case(LEV_INFO): return "INFO"; case(LEV_WARNING):return "WARNING"; case(LEV_ERROR): return "ERROR"; case(LEV_EVENT): return "EVENT"; default: return "UNKNOWN"; } } std::string LogTypes::GetFilterString(int aLevel) { std::ostringstream oss; oss << "{"; for(size_t i = 0; i < LogTypes::NUM_FILTER; ++i) { oss << static_cast<uint8_t>((aLevel & filters[i].lev) ? filters[i].id : ' '); } oss << "}"; return oss.str(); } #endif }
25.344
79
0.718119
cverges
e3616c347f069bbae2093bca66d1b14e91cd1a34
565
cpp
C++
396.cpp
pengzhezhe/LeetCode
305ec0c5b4cb5ea7cd244b3308132dee778138bc
[ "Apache-2.0" ]
null
null
null
396.cpp
pengzhezhe/LeetCode
305ec0c5b4cb5ea7cd244b3308132dee778138bc
[ "Apache-2.0" ]
null
null
null
396.cpp
pengzhezhe/LeetCode
305ec0c5b4cb5ea7cd244b3308132dee778138bc
[ "Apache-2.0" ]
null
null
null
// // Created by pzz on 2022/4/22. // #include <iostream> #include <algorithm> #include <vector> using namespace std; class Solution { public: int maxRotateFunction(vector<int> &nums) { int n = nums.size(); int numSum = 0, f = 0; for (int i = 0; i < n; i++) { numSum += nums[i]; f += i * nums[i]; } int res = f; for (int i = 1; i < n; i++) { f += numSum - n * nums[n - i]; res = max(res, f); } return res; } }; int main() { return 0; }
17.121212
46
0.446018
pengzhezhe
e36299db653d094110285453e6f864c66fdce7fa
510
cpp
C++
usage/cl_11_array_no_exception_of_out_index.cpp
conncui/CProject
f2786e8cfad1b590154af9167cbc218332e4e71f
[ "Apache-2.0" ]
null
null
null
usage/cl_11_array_no_exception_of_out_index.cpp
conncui/CProject
f2786e8cfad1b590154af9167cbc218332e4e71f
[ "Apache-2.0" ]
null
null
null
usage/cl_11_array_no_exception_of_out_index.cpp
conncui/CProject
f2786e8cfad1b590154af9167cbc218332e4e71f
[ "Apache-2.0" ]
null
null
null
# include <iostream> using namespace std; void test_1(); void test_2(); int main() { // test_1(); test_2(); } void test_1(){ int a[2]; a[0] = 1; a[1] = 2; int i = 2; a[i] = 10; for (int i = 0; i <=2; i++){ cout << a[i] << " "; } cout << endl; for (int i = 0; i <=2; i++){ cout << &a[i] << " "; } } void test_2() { double d[3] = {0, 1, 2}; double dd = 9; int index = 3; d[index] = 0; std::cout << dd << std::endl; }
12.75
33
0.401961
conncui
e362d27fd7885d9acd562aac7fc0d89a0a335bb3
1,869
cpp
C++
kernel/kernel/worker.cpp
heatd/Onyx
404fce9c89a1d4ab561b5be63bd9bc68a6c9d91d
[ "MIT" ]
44
2017-02-16T20:48:09.000Z
2022-03-14T17:58:57.000Z
kernel/kernel/worker.cpp
heatd/Onyx
404fce9c89a1d4ab561b5be63bd9bc68a6c9d91d
[ "MIT" ]
72
2017-02-16T20:22:10.000Z
2022-03-31T21:17:06.000Z
kernel/kernel/worker.cpp
heatd/Onyx
404fce9c89a1d4ab561b5be63bd9bc68a6c9d91d
[ "MIT" ]
10
2017-04-07T19:20:14.000Z
2021-12-16T03:31:14.000Z
/* * Copyright (c) 2017 Pedro Falcato * This file is part of Onyx, and is released under the terms of the MIT License * check LICENSE at the root directory for more information */ #include <stdlib.h> #include <string.h> #include <errno.h> #include <onyx/worker.h> #include <onyx/scheduler.h> #include <onyx/thread.h> #include <onyx/mutex.h> #include <onyx/panic.h> #include <onyx/utils.h> #include <onyx/init.h> static thread_t *worker = NULL; DECLARE_MUTEX(work_queue_mutex); static struct work_request *work_queue = NULL; void work_do_work(void* context) { while(true) { mutex_lock(&work_queue_mutex); /* Do all the work needed */ while(work_queue) { struct work_request *work = work_queue; work->func(work->param); work_queue = work_queue->next; free(work); } mutex_unlock(&work_queue_mutex); /* Set the thread state to sleeping and yield */ set_current_state(THREAD_UNINTERRUPTIBLE); sched_yield(); } } void worker_init(void) { if(!(worker = sched_create_thread(work_do_work, 1, NULL))) panic("worker_init: Could not create the worker thread!\n"); worker->priority = 20; } INIT_LEVEL_CORE_AFTER_SCHED_ENTRY(worker_init); int worker_schedule(struct work_request *work, int priority) { /* Create a duplicate of work(so we're able to easily free things) */ work = (work_request *) memdup(work, sizeof(struct work_request)); if(!work) return errno = ENOMEM, -1; mutex_lock(&work_queue_mutex); if(!work_queue) { work_queue = work; work->priority = priority; work->next = NULL; } else { struct work_request *queue = work_queue; while(queue->next && queue->priority >= priority) { queue = queue->next; } struct work_request *next = queue->next; queue->next = work; work->next = next; work->priority = priority; } mutex_unlock(&work_queue_mutex); thread_wake_up(worker); return 0; }
22.25
79
0.708935
heatd
e365db498c6099afa4cad6311ab653c85460ca15
239
cpp
C++
chapter3/Proj325.cpp
basstal/CPPPrimer
6366965657f873ac62003cf0a30a3fdb26c09351
[ "MIT" ]
null
null
null
chapter3/Proj325.cpp
basstal/CPPPrimer
6366965657f873ac62003cf0a30a3fdb26c09351
[ "MIT" ]
null
null
null
chapter3/Proj325.cpp
basstal/CPPPrimer
6366965657f873ac62003cf0a30a3fdb26c09351
[ "MIT" ]
null
null
null
#include<vector> #include<iostream> using namespace::std; int main() { vector<unsigned> v(11,0); unsigned score; auto it = v.begin(); while(cin>>score) ++*(it + score/10); for(auto &w:v) cout<<w<<" "; cout<<endl; return 0; }
14.058824
26
0.610879
basstal
e3669fd03da8bba8f9fe97c2e9e0c35a0cca2e07
10,556
cpp
C++
lib/BitArray.cpp
kampersanda/cda-tries
9f372f4e004d7f91e387297dfc7a0d2798c82779
[ "MIT" ]
4
2017-09-15T23:53:19.000Z
2021-03-31T02:21:18.000Z
lib/BitArray.cpp
kampersanda/cda-tries
9f372f4e004d7f91e387297dfc7a0d2798c82779
[ "MIT" ]
null
null
null
lib/BitArray.cpp
kampersanda/cda-tries
9f372f4e004d7f91e387297dfc7a0d2798c82779
[ "MIT" ]
2
2020-04-22T23:24:12.000Z
2021-03-01T11:06:52.000Z
#include "BitArray.hpp" namespace { constexpr uint8_t SELECT_TABLE[9][256] = { { 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, 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, 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, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 8, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 5, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 6, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 5, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 7, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 5, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 6, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 5, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 8, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 5, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 6, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 5, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 7, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 5, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 6, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 5, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1 }, { 8, 8, 8, 2, 8, 3, 3, 2, 8, 4, 4, 2, 4, 3, 3, 2, 8, 5, 5, 2, 5, 3, 3, 2, 5, 4, 4, 2, 4, 3, 3, 2, 8, 6, 6, 2, 6, 3, 3, 2, 6, 4, 4, 2, 4, 3, 3, 2, 6, 5, 5, 2, 5, 3, 3, 2, 5, 4, 4, 2, 4, 3, 3, 2, 8, 7, 7, 2, 7, 3, 3, 2, 7, 4, 4, 2, 4, 3, 3, 2, 7, 5, 5, 2, 5, 3, 3, 2, 5, 4, 4, 2, 4, 3, 3, 2, 7, 6, 6, 2, 6, 3, 3, 2, 6, 4, 4, 2, 4, 3, 3, 2, 6, 5, 5, 2, 5, 3, 3, 2, 5, 4, 4, 2, 4, 3, 3, 2, 8, 8, 8, 2, 8, 3, 3, 2, 8, 4, 4, 2, 4, 3, 3, 2, 8, 5, 5, 2, 5, 3, 3, 2, 5, 4, 4, 2, 4, 3, 3, 2, 8, 6, 6, 2, 6, 3, 3, 2, 6, 4, 4, 2, 4, 3, 3, 2, 6, 5, 5, 2, 5, 3, 3, 2, 5, 4, 4, 2, 4, 3, 3, 2, 8, 7, 7, 2, 7, 3, 3, 2, 7, 4, 4, 2, 4, 3, 3, 2, 7, 5, 5, 2, 5, 3, 3, 2, 5, 4, 4, 2, 4, 3, 3, 2, 7, 6, 6, 2, 6, 3, 3, 2, 6, 4, 4, 2, 4, 3, 3, 2, 6, 5, 5, 2, 5, 3, 3, 2, 5, 4, 4, 2, 4, 3, 3, 2 }, { 8, 8, 8, 8, 8, 8, 8, 3, 8, 8, 8, 4, 8, 4, 4, 3, 8, 8, 8, 5, 8, 5, 5, 3, 8, 5, 5, 4, 5, 4, 4, 3, 8, 8, 8, 6, 8, 6, 6, 3, 8, 6, 6, 4, 6, 4, 4, 3, 8, 6, 6, 5, 6, 5, 5, 3, 6, 5, 5, 4, 5, 4, 4, 3, 8, 8, 8, 7, 8, 7, 7, 3, 8, 7, 7, 4, 7, 4, 4, 3, 8, 7, 7, 5, 7, 5, 5, 3, 7, 5, 5, 4, 5, 4, 4, 3, 8, 7, 7, 6, 7, 6, 6, 3, 7, 6, 6, 4, 6, 4, 4, 3, 7, 6, 6, 5, 6, 5, 5, 3, 6, 5, 5, 4, 5, 4, 4, 3, 8, 8, 8, 8, 8, 8, 8, 3, 8, 8, 8, 4, 8, 4, 4, 3, 8, 8, 8, 5, 8, 5, 5, 3, 8, 5, 5, 4, 5, 4, 4, 3, 8, 8, 8, 6, 8, 6, 6, 3, 8, 6, 6, 4, 6, 4, 4, 3, 8, 6, 6, 5, 6, 5, 5, 3, 6, 5, 5, 4, 5, 4, 4, 3, 8, 8, 8, 7, 8, 7, 7, 3, 8, 7, 7, 4, 7, 4, 4, 3, 8, 7, 7, 5, 7, 5, 5, 3, 7, 5, 5, 4, 5, 4, 4, 3, 8, 7, 7, 6, 7, 6, 6, 3, 7, 6, 6, 4, 6, 4, 4, 3, 7, 6, 6, 5, 6, 5, 5, 3, 6, 5, 5, 4, 5, 4, 4, 3 }, { 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 4, 8, 8, 8, 8, 8, 8, 8, 5, 8, 8, 8, 5, 8, 5, 5, 4, 8, 8, 8, 8, 8, 8, 8, 6, 8, 8, 8, 6, 8, 6, 6, 4, 8, 8, 8, 6, 8, 6, 6, 5, 8, 6, 6, 5, 6, 5, 5, 4, 8, 8, 8, 8, 8, 8, 8, 7, 8, 8, 8, 7, 8, 7, 7, 4, 8, 8, 8, 7, 8, 7, 7, 5, 8, 7, 7, 5, 7, 5, 5, 4, 8, 8, 8, 7, 8, 7, 7, 6, 8, 7, 7, 6, 7, 6, 6, 4, 8, 7, 7, 6, 7, 6, 6, 5, 7, 6, 6, 5, 6, 5, 5, 4, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 4, 8, 8, 8, 8, 8, 8, 8, 5, 8, 8, 8, 5, 8, 5, 5, 4, 8, 8, 8, 8, 8, 8, 8, 6, 8, 8, 8, 6, 8, 6, 6, 4, 8, 8, 8, 6, 8, 6, 6, 5, 8, 6, 6, 5, 6, 5, 5, 4, 8, 8, 8, 8, 8, 8, 8, 7, 8, 8, 8, 7, 8, 7, 7, 4, 8, 8, 8, 7, 8, 7, 7, 5, 8, 7, 7, 5, 7, 5, 5, 4, 8, 8, 8, 7, 8, 7, 7, 6, 8, 7, 7, 6, 7, 6, 6, 4, 8, 7, 7, 6, 7, 6, 6, 5, 7, 6, 6, 5, 6, 5, 5, 4 }, { 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 5, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 6, 8, 8, 8, 8, 8, 8, 8, 6, 8, 8, 8, 6, 8, 6, 6, 5, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 8, 8, 8, 8, 8, 8, 8, 7, 8, 8, 8, 7, 8, 7, 7, 5, 8, 8, 8, 8, 8, 8, 8, 7, 8, 8, 8, 7, 8, 7, 7, 6, 8, 8, 8, 7, 8, 7, 7, 6, 8, 7, 7, 6, 7, 6, 6, 5, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 5, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 6, 8, 8, 8, 8, 8, 8, 8, 6, 8, 8, 8, 6, 8, 6, 6, 5, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 8, 8, 8, 8, 8, 8, 8, 7, 8, 8, 8, 7, 8, 7, 7, 5, 8, 8, 8, 8, 8, 8, 8, 7, 8, 8, 8, 7, 8, 7, 7, 6, 8, 8, 8, 7, 8, 7, 7, 6, 8, 7, 7, 6, 7, 6, 6, 5 }, { 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 6, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 8, 8, 8, 8, 8, 8, 8, 7, 8, 8, 8, 7, 8, 7, 7, 6, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 6, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 8, 8, 8, 8, 8, 8, 8, 7, 8, 8, 8, 7, 8, 7, 7, 6 }, { 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7 }, { 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 } }; } // namespace namespace cda_tries { BitArray::BitArray() {} BitArray::~BitArray() {} void BitArray::build(const std::vector<bool> &bits) { size_ = bits.size(); bits_.reset(size_ / 32 + 1, 0); blocks_.reset(size_ / R1_SIZE + 1); for (uint32_t i = 0; i < size_; ++i) { if (bits[i]) { bits_[i / 32] |= (1U << (i % 32)); } } uint32_t sum = 0; for (uint32_t block_pos = 0; block_pos < blocks_.size(); ++block_pos) { auto &block = blocks_[block_pos]; block.rank_1st = sum; for (uint32_t offset = 0; offset < R1_PER_R2; ++offset) { block.rank_2nd[offset] = static_cast<uint8_t>(sum - block.rank_1st); auto pos_in_bits = block_pos * R1_PER_R2 + offset; if (pos_in_bits < bits_.size()) { sum += PopCount(bits_[pos_in_bits]); } } } num_1s_ = sum; } uint32_t BitArray::rank(uint32_t pos) const { auto &block = blocks_[pos / R1_SIZE]; return block.rank_1st + block.rank_2nd[pos / R2_SIZE % R1_PER_R2] + PopCount(bits_[pos / 32] & ((1U << (pos % 32)) - 1)); } uint32_t BitArray::select(uint32_t count) const { ++count; uint32_t left = 0; auto right = static_cast<uint32_t>(blocks_.size()); while (left + 1 < right) { auto middle = (left + right) / 2; if (count <= blocks_[middle].rank_1st) { right = middle; } else { left = middle; } } auto block_pos = left; count -= blocks_[block_pos].rank_1st; uint32_t offset = 1; for (; offset < R1_PER_R2; ++offset) { if (count <= blocks_[block_pos].rank_2nd[offset]) { break; } } count -= blocks_[block_pos].rank_2nd[--offset]; auto ret = (block_pos * R1_SIZE) + (offset * R2_SIZE); auto bits = bits_[ret / 32]; { auto _count = PopCount(bits % 65536); if (_count < count) { bits >>= 16; ret += 16; count -= _count; } } { auto _count = PopCount(bits % 256); if (_count < count) { bits >>= 8; ret += 8; count -= _count; } } ret += SELECT_TABLE[count][bits % 256]; return ret - 1; } size_t BitArray::size() const { return size_; } size_t BitArray::size_in_bytes() const { size_t size = 0; size += bits_.size_in_bytes(); size += blocks_.size_in_bytes(); return size; } size_t BitArray::num_1s() const { return num_1s_; } size_t BitArray::num_0s() const { return size_ - num_1s_; } void BitArray::write(std::ostream &os) const { bits_.write(os); blocks_.write(os); os.write(reinterpret_cast<const char *>(&size_), sizeof(size_)); os.write(reinterpret_cast<const char *>(&num_1s_), sizeof(num_1s_)); } void BitArray::read(std::istream &is) { bits_.read(is); blocks_.read(is); is.read(reinterpret_cast<char *>(&size_), sizeof(size_)); is.read(reinterpret_cast<char *>(&num_1s_), sizeof(num_1s_)); } void BitArray::clear() { bits_.clear(); blocks_.clear(); size_ = 0; num_1s_ = 0; } } // cda_tries
35.069767
74
0.390678
kampersanda
e36af33ce8839e9f0975f24dc9ad01e5b9f19012
7,772
cpp
C++
blast/src/util/transmissionrw.cpp
mycolab/ncbi-blast
e59746cec78044d2bf6d65de644717c42f80b098
[ "Apache-2.0" ]
null
null
null
blast/src/util/transmissionrw.cpp
mycolab/ncbi-blast
e59746cec78044d2bf6d65de644717c42f80b098
[ "Apache-2.0" ]
null
null
null
blast/src/util/transmissionrw.cpp
mycolab/ncbi-blast
e59746cec78044d2bf6d65de644717c42f80b098
[ "Apache-2.0" ]
null
null
null
/* $Id: transmissionrw.cpp 583834 2019-04-02 19:20:44Z sadyrovr $ * =========================================================================== * * PUBLIC DOMAIN NOTICE * National Center for Biotechnology Information * * This software/database is a "United States Government Work" under the * terms of the United States Copyright Act. It was written as part of * the author's official duties as a United States Government employee and * thus cannot be copyrighted. This software/database is freely available * to the public for use. The National Library of Medicine and the U.S. * Government have not placed any restriction on its use or reproduction. * * Although all reasonable efforts have been taken to ensure the accuracy * and reliability of the software and data, the NLM and the U.S. * Government do not and cannot warrant the performance or results that * may be obtained by using this software or data. The NLM and the U.S. * Government disclaim all warranties, express or implied, including * warranties of performance, merchantability or fitness for any particular * purpose. * * Please cite the author in any work or product based on this material. * * =========================================================================== * * Author: Anatoliy Kuznetsov * * File Description: Transmission control. * */ #include <ncbi_pch.hpp> #include <corelib/ncbidbg.hpp> #include <corelib/ncbi_bswap.hpp> #include <corelib/ncbistr.hpp> #include <util/util_exception.hpp> #include <util/transmissionrw.hpp> BEGIN_NCBI_SCOPE static const Uint4 sStartWord = 0x01020304; static const Uint4 sEndPacket = 0xFFFFFFFF; const size_t kLengthSize = sizeof(Uint4); CTransmissionWriter::CTransmissionWriter(IWriter* wrt, EOwnership own_writer, ESendEofPacket send_eof) : m_Wrt(wrt), m_OwnWrt(own_writer), m_SendEof(send_eof), m_PacketBytesToWrite(0) { _ASSERT(wrt); ERW_Result res = WriteUint4(sStartWord); if (res != eRW_Success) { NCBI_THROW(CIOException, eWrite, "Cannot write the byte order"); } } namespace { class CIOBytesCountGuard { public: size_t count; CIOBytesCountGuard(size_t* ret) : count(0), m_Ret(ret) {} ~CIOBytesCountGuard() { if (m_Ret) *m_Ret = count; } private: size_t* m_Ret; }; } // namespace ERW_Result CTransmissionWriter::Write(const void* buf, size_t count, size_t* bytes_written) { CIOBytesCountGuard wrt(bytes_written); if (count >= sEndPacket) { // The buffer cannot fit in one packet -- split it. count = (size_t) 0x80008000LU; } if (!m_PacketBytesToWrite) { Uint4 cnt = (Uint4) count; ERW_Result res = WriteUint4(cnt); if (res != eRW_Success) return res; m_PacketBytesToWrite = cnt; } ERW_Result res = m_Wrt->Write(buf, m_PacketBytesToWrite, &wrt.count); if (res == eRW_Success) m_PacketBytesToWrite -= wrt.count; return res; } ERW_Result CTransmissionWriter::Flush(void) { return m_Wrt->Flush(); } ERW_Result CTransmissionWriter::Close(void) { if (m_PacketBytesToWrite) { return eRW_Error; } if (m_SendEof != eSendEofPacket) return eRW_Success; m_SendEof = eDontSendEofPacket; return WriteUint4(sEndPacket); } CTransmissionWriter::~CTransmissionWriter() { Close(); if (m_OwnWrt) delete m_Wrt; } ERW_Result CTransmissionWriter::WriteUint4(const Uint4& value) { auto data = reinterpret_cast<const char*>(&value); size_t written; ERW_Result rv = eRW_Success; for (auto to_write = kLengthSize; (rv == eRW_Success) && to_write; to_write -= written) { rv = m_Wrt->Write(data, to_write, &written); data += written; } return rv; } template <typename TType> inline const TType* CTransmissionReader::SReadData::Data() const { return reinterpret_cast<const TType*>(data() + m_Start); } inline size_t CTransmissionReader::SReadData::DataSize() const { return m_End - m_Start; } inline char* CTransmissionReader::SReadData::Space() { return data() + m_End; } inline size_t CTransmissionReader::SReadData::SpaceSize() const { return size() - m_End; } inline void CTransmissionReader::SReadData::Add(size_t count) { m_End += count; _ASSERT(m_End <= size()); } inline void CTransmissionReader::SReadData::Remove(size_t count) { m_Start += count; if (DataSize() == 0) m_Start = m_End = 0; _ASSERT(m_Start < size()); } CTransmissionReader::CTransmissionReader(IReader* rdr, EOwnership own_reader) : m_Rdr(rdr), m_OwnRdr(own_reader), m_PacketBytesToRead(0), m_ByteSwap(false), m_StartRead(false) { } CTransmissionReader::~CTransmissionReader() { if (m_OwnRdr) { delete m_Rdr; } } ERW_Result CTransmissionReader::ReadData() { size_t read; auto res = m_Rdr->Read(m_ReadData.Space(), m_ReadData.SpaceSize(), &read); if (res == eRW_Success) m_ReadData.Add(read); return res; } ERW_Result CTransmissionReader::Read(void* buf, size_t count, size_t* bytes_read) { const size_t kMinReadSize = 32 * 1024; CIOBytesCountGuard read(bytes_read); if (!m_StartRead) { auto res = x_ReadStart(); if (res != eRW_Success) return res; } // read packet header while (m_PacketBytesToRead == 0) { auto res = ReadLength(m_PacketBytesToRead); if (res != eRW_Success) return res; } if (m_PacketBytesToRead == sEndPacket) return eRW_Eof; size_t to_read = count < m_PacketBytesToRead ? count : m_PacketBytesToRead; size_t already_read = m_ReadData.DataSize(); if (!already_read) { // If chunk to read is big enough, read directly in the buf if (to_read >= kMinReadSize) { auto res = m_Rdr->Read(buf, to_read, &read.count); if (res == eRW_Success) m_PacketBytesToRead -= static_cast<Uint4>(read.count); return res; } auto res = ReadData(); if (res != eRW_Success) return res; already_read = m_ReadData.DataSize(); } if (already_read) { read.count = min(to_read, already_read); copy_n(m_ReadData.Data(), read.count, static_cast<char*>(buf)); m_ReadData.Remove(read.count); } m_PacketBytesToRead -= static_cast<Uint4>(read.count); return eRW_Success; } ERW_Result CTransmissionReader::PendingCount(size_t* count) { return m_Rdr->PendingCount(count); } ERW_Result CTransmissionReader::x_ReadStart() { _ASSERT(!m_StartRead); m_StartRead = true; Uint4 start_word_coming; auto res = ReadLength(start_word_coming); if (res != eRW_Success) return res; m_ByteSwap = (start_word_coming != sStartWord); if (start_word_coming != sStartWord && start_word_coming != 0x04030201) NCBI_THROW(CUtilException, eWrongData, "Cannot determine the byte order. Got: " + NStr::UIntToString(start_word_coming, 0, 16)); return eRW_Success; } ERW_Result CTransmissionReader::ReadLength(Uint4& length) { while (m_ReadData.DataSize() < kLengthSize) { auto res = ReadData(); if (res != eRW_Success) return res; } if (m_ByteSwap) { length = CByteSwap::GetInt4(m_ReadData.Data<unsigned char>()); } else { length = *m_ReadData.Data<Uint4>(); } m_ReadData.Remove(kLengthSize); return eRW_Success; } END_NCBI_SCOPE
25.735099
93
0.636902
mycolab
e36cf94d6f0dfa569ccdf34744f802dd5b933c03
4,572
cpp
C++
src/multimedia/AudioOutObject.cpp
0of/WebOS-Magna
a0fe2c9708fd4dd07928c11fcb03fb29fdd2d511
[ "Apache-2.0" ]
1
2016-03-26T13:25:08.000Z
2016-03-26T13:25:08.000Z
src/multimedia/AudioOutObject.cpp
0of/WebOS-Magna
a0fe2c9708fd4dd07928c11fcb03fb29fdd2d511
[ "Apache-2.0" ]
null
null
null
src/multimedia/AudioOutObject.cpp
0of/WebOS-Magna
a0fe2c9708fd4dd07928c11fcb03fb29fdd2d511
[ "Apache-2.0" ]
null
null
null
#include "AudioOutObject.h" #include "AudioOutObject_p.h" namespace Magna{ namespace MultiMedia{ AudioOutObject & AudioOutObject::getAudioOutObject(){ static AudioOutObject o; return o; } AudioOutObject::AudioOutObject() :m_data( new PrivateData( *this ) ){ } AudioOutObject::~AudioOutObject(){ } void AudioOutObject::setMuted ( bool mute ){ if( !m_data.isNull() ){ m_data->m_outputDevice->setMuted( mute ); } } void AudioOutObject::setVolume ( double newVolume ){ if( !m_data.isNull() ){ m_data->m_outputDevice->setVolume( newVolume ); } } void AudioOutObject::setCurAt( uint32 at){ if( !m_data.isNull() ){ auto &_data = *m_data; if( at < _data.m_URLs.size() ){ if( at != _data.m_cur ){ _data.m_cur = at; auto &_current_URL = _data.m_URLs.at( _data.m_cur ); #ifdef _MSC_VER QString _URL = QString::fromUtf16( reinterpret_cast<const ushort *>( _current_URL.c_str() ), _current_URL.size() ); #else QString _URL = QString::fromStdWString( _current_URL ); #endif _data.m_manipulatorObject->setCurrentSource( _URL ); } } } } void AudioOutObject::setCurrentSourceURL( const String&url){ if( !m_data.isNull() ){ m_data->m_cur = m_data->m_URLs.size(); m_data->m_URLs .push_back( url ); #ifdef _MSC_VER QString _URL = QString::fromUtf16( reinterpret_cast<const ushort *>( url.c_str() ), url.size() ); #else QString _URL = QString::fromStdWString( url ); #endif m_data->m_manipulatorObject->setCurrentSource( _URL ); } } bool AudioOutObject::isMuted() const{ bool _ret_muted = false; if( !m_data.isNull() ){ _ret_muted = m_data->m_outputDevice->isMuted(); } return _ret_muted; } void AudioOutObject::appendNextSourceURL( const String& url){ if( !m_data.isNull() ){ m_data->m_URLs .push_back( url ); } } void AudioOutObject::play(){ if( !m_data.isNull() ){ auto &_data = *m_data; if( !_data.m_URLs.empty() ){ if( _data.m_cur < _data.m_URLs.size() ){ auto &_current_URL = _data.m_URLs.at( _data.m_cur ); #ifdef _MSC_VER QString _URL = QString::fromUtf16( reinterpret_cast<const ushort *>( _current_URL.c_str() ), _current_URL.size() ); #else QString _URL = QString::fromStdWString( _current_URL ); #endif _data.m_manipulatorObject->setCurrentSource( _URL ); _data.m_manipulatorObject->play(); } } } } void AudioOutObject::pause(){ if( !m_data.isNull() ){ auto &_data = *m_data; _data.m_manipulatorObject->pause(); } } void AudioOutObject::stop(){ if( !m_data.isNull() ){ auto &_data = *m_data; _data.m_manipulatorObject->stop(); } } void AudioOutObject::playPrevious(){ if( !m_data.isNull() ){ auto &_data = *m_data; if( !_data.m_URLs.empty() ){ if( _data.m_cur > 0 ){ --_data.m_cur; auto &_current_URL = _data.m_URLs.at( _data.m_cur ); #ifdef _MSC_VER QString _URL = QString::fromUtf16( reinterpret_cast<const ushort *>( _current_URL.c_str() ), _current_URL.size() ); #else QString _URL = QString::fromStdWString( _current_URL ); #endif _data.m_manipulatorObject->setCurrentSource( _URL ); _data.m_manipulatorObject->play(); } } } } void AudioOutObject::playNext(){ if( !m_data.isNull() ){ auto &_data = *m_data; if( !_data.m_URLs.empty() ){ if( _data.m_cur < (_data.m_URLs.size() - 1) ){ ++_data.m_cur; auto &_current_URL = _data.m_URLs.at( _data.m_cur ); #ifdef _MSC_VER QString _URL = QString::fromUtf16( reinterpret_cast<const ushort *>( _current_URL.c_str() ), _current_URL.size() ); #else QString _URL = QString::fromStdWString( _current_URL ); #endif _data.m_manipulatorObject->setCurrentSource( _URL ); _data.m_manipulatorObject->play(); } } } } }//namespace MultiMedia }//namespace Magna
27.709091
129
0.554243
0of
e3717fa7cf16cda5b6a3b951c2a5298affb407ec
5,617
cpp
C++
src/generic_cubic_gadget/generic_cubic_gadget.cpp
AntoineRondelet/libsnark-playground
a67e20379decf42ae4b6189900ff0001e3936fc9
[ "MIT" ]
8
2018-08-31T08:51:30.000Z
2021-05-10T17:30:34.000Z
src/generic_cubic_gadget/generic_cubic_gadget.cpp
AntoineRondelet/libsnark-playground
a67e20379decf42ae4b6189900ff0001e3936fc9
[ "MIT" ]
1
2018-09-03T20:57:49.000Z
2018-09-03T20:57:49.000Z
src/generic_cubic_gadget/generic_cubic_gadget.cpp
AntoineRondelet/libsnark-playground
a67e20379decf42ae4b6189900ff0001e3936fc9
[ "MIT" ]
4
2018-08-31T08:51:33.000Z
2021-04-04T01:56:33.000Z
/* * While the "cubic_gadget" aims to provide a circuit for the statement: * (E) x**3 + x + 5 = 35 * This gadget ("generic_cubic_gagdet") is more generic, and provides a circuit for the statement: * (E') A*x**3 + B*x**2 + C*x + D = E * where, A, B, C, D, and E are fields elements of the field we are working on (FieldT) * * As a consequence, to use this gadget, one has to provide the coefficients: * A, B, C, D, and E as public input (primary input) * The sol_x being the secret solution that is used to generate a valid witness * will still remain as a private input (auxiliary input). * * The set of constraints encoding (E') becomes: * x1 = A * x0 * x2 = x1 * x0 * x3 = x2 * x0 * x4 = B * x0 * x5 = x4 * x0 * x6 = C * x0 * x7 = x6 + D * x8 = x5 + x3 * x9 = x8 + x7 * x9 = E * **/ #include <libsnark/gadgetlib1/gadget.hpp> #include "utils.hpp" /* * This gadget is made to prove the knowledge of x such that: * A*x**3 + B*x**2 + C*x + D = E, where A, B, C, D, and E are given as primary input **/ template<typename FieldT> class generic_cubic_gadget : public libsnark::gadget<FieldT> { public: libsnark::protoboard<FieldT> &pb; const std::string annotation_prefix=""; // Solution x that satisfies: (E') A*x**3 + B*x**2 + C*x + D = E (auxiliary input) const libsnark::pb_variable<FieldT> &sol_x; // Array that contains the values of the coefficients of the polynomial (along with E) const libsnark::pb_variable_array<FieldT> &coefficients; // X = [x0, x1, x2, x3, x4, x5, x6, x7, x8, x9] variables allocated on the protoboard libsnark::pb_variable_array<FieldT> vars; generic_cubic_gadget( libsnark::protoboard<FieldT> &in_pb, const libsnark::pb_variable_array<FieldT> &in_coefficients, const libsnark::pb_variable<FieldT> &in_sol_x, const std::string &in_annotation_prefix="" ): libsnark::gadget<FieldT>(in_pb, FMT(in_annotation_prefix, " generic_cubic_equation")), pb(in_pb), sol_x(in_sol_x), coefficients(in_coefficients), vars(), annotation_prefix(in_annotation_prefix) { vars.allocate(pb, 10, FMT(this->annotation_prefix, " vars")); // size(X) = 10 (10 variables) } // Creates all constraints on the libsnark::protoboard void generate_r1cs_constraints() { // A * x0 = x1 libsnark::r1cs_constraint<FieldT> constraint1 = libsnark::r1cs_constraint<FieldT>( coefficients[0], vars[0], vars[1] ); // x1 * x0 = x2 libsnark::r1cs_constraint<FieldT> constraint2 = libsnark::r1cs_constraint<FieldT>( vars[1], vars[0], vars[2] ); // x2 * x0 = x3 libsnark::r1cs_constraint<FieldT> constraint3 = libsnark::r1cs_constraint<FieldT>( vars[2], vars[0], vars[3] ); // B * x0 = x4 libsnark::r1cs_constraint<FieldT> constraint4 = libsnark::r1cs_constraint<FieldT>( coefficients[1], vars[0], vars[4] ); // x4 * x0 = x5 libsnark::r1cs_constraint<FieldT> constraint5 = libsnark::r1cs_constraint<FieldT>( vars[4], vars[0], vars[5] ); // C * x0 = x6 libsnark::r1cs_constraint<FieldT> constraint6 = libsnark::r1cs_constraint<FieldT>( coefficients[2], vars[0], vars[6] ); // x6 + D = x7 libsnark::r1cs_constraint<FieldT> constraint7 = libsnark::r1cs_constraint<FieldT>( vars[6] + coefficients[3], FieldT::one(), vars[7] ); // x5 + x3 = x8 libsnark::r1cs_constraint<FieldT> constraint8 = libsnark::r1cs_constraint<FieldT>( vars[5] + vars[3], FieldT::one(), vars[8] ); // x8 + x7 = x9 libsnark::r1cs_constraint<FieldT> constraint9 = libsnark::r1cs_constraint<FieldT>( vars[8] + vars[7], FieldT::one(), vars[9] ); // E = x9 (constraint on the value of the output) libsnark::r1cs_constraint<FieldT> constraint10 = libsnark::r1cs_constraint<FieldT>( vars[9], FieldT::one(), coefficients[4] ); pb.add_r1cs_constraint(constraint1); pb.add_r1cs_constraint(constraint2); pb.add_r1cs_constraint(constraint3); pb.add_r1cs_constraint(constraint4); pb.add_r1cs_constraint(constraint5); pb.add_r1cs_constraint(constraint6); pb.add_r1cs_constraint(constraint7); pb.add_r1cs_constraint(constraint8); pb.add_r1cs_constraint(constraint9); pb.add_r1cs_constraint(constraint10); } void generate_r1cs_witness() { pb.val(vars[0]) = pb.val(sol_x); // Input variable // Generate an assignment for all non-input variables // (internal wires of the circuit) pb.val(vars[1]) = pb.val(coefficients[0]) * pb.val(vars[0]); pb.val(vars[2]) = pb.val(vars[1]) * pb.val(vars[0]); pb.val(vars[3]) = pb.val(vars[2]) * pb.val(vars[0]); pb.val(vars[4]) = pb.val(coefficients[1]) * pb.val(vars[0]); pb.val(vars[5]) = pb.val(vars[4]) * pb.val(vars[0]); pb.val(vars[6]) = pb.val(coefficients[2]) * pb.val(vars[0]); pb.val(vars[7]) = pb.val(vars[6]) + pb.val(coefficients[3]); pb.val(vars[8]) = pb.val(vars[5]) + pb.val(vars[3]); pb.val(vars[9]) = pb.val(vars[8]) + pb.val(vars[7]); } };
34.460123
100
0.582339
AntoineRondelet
e3728c5be08255e4dfa725d8da087daeb3de8b98
66,271
cpp
C++
B2G/gecko/js/src/ion/IonCaches.cpp
wilebeast/FireFox-OS
43067f28711d78c429a1d6d58c77130f6899135f
[ "Apache-2.0" ]
3
2015-08-31T15:24:31.000Z
2020-04-24T20:31:29.000Z
B2G/gecko/js/src/ion/IonCaches.cpp
wilebeast/FireFox-OS
43067f28711d78c429a1d6d58c77130f6899135f
[ "Apache-2.0" ]
null
null
null
B2G/gecko/js/src/ion/IonCaches.cpp
wilebeast/FireFox-OS
43067f28711d78c429a1d6d58c77130f6899135f
[ "Apache-2.0" ]
3
2015-07-29T07:17:15.000Z
2020-11-04T06:55:37.000Z
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- * vim: set ts=4 sw=4 et tw=99: * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "jsscope.h" #include "CodeGenerator.h" #include "Ion.h" #include "IonCaches.h" #include "IonLinker.h" #include "IonSpewer.h" #include "VMFunctions.h" #include "jsinterpinlines.h" #include "vm/Stack.h" #include "IonFrames-inl.h" using namespace js; using namespace js::ion; void CodeLocationJump::repoint(IonCode *code, MacroAssembler *masm) { JS_ASSERT(!absolute_); size_t new_off = (size_t)raw_; #ifdef JS_SMALL_BRANCH size_t jumpTableEntryOffset = reinterpret_cast<size_t>(jumpTableEntry_); #endif if (masm != NULL) { #ifdef JS_CPU_X64 JS_ASSERT((uint64_t)raw_ <= UINT32_MAX); #endif new_off = masm->actualOffset((uintptr_t)raw_); #ifdef JS_SMALL_BRANCH jumpTableEntryOffset = masm->actualIndex(jumpTableEntryOffset); #endif } raw_ = code->raw() + new_off; #ifdef JS_SMALL_BRANCH jumpTableEntry_ = Assembler::PatchableJumpAddress(code, (size_t) jumpTableEntryOffset); #endif absolute_ = true; } void CodeLocationLabel::repoint(IonCode *code, MacroAssembler *masm) { JS_ASSERT(!absolute_); size_t new_off = (size_t)raw_; if (masm != NULL) { #ifdef JS_CPU_X64 JS_ASSERT((uint64_t)raw_ <= UINT32_MAX); #endif new_off = masm->actualOffset((uintptr_t)raw_); } JS_ASSERT(new_off < code->instructionsSize()); raw_ = code->raw() + new_off; absolute_ = true; } void CodeOffsetLabel::fixup(MacroAssembler *masm) { offset_ = masm->actualOffset(offset_); } void CodeOffsetJump::fixup(MacroAssembler *masm) { offset_ = masm->actualOffset(offset_); #ifdef JS_SMALL_BRANCH jumpTableIndex_ = masm->actualIndex(jumpTableIndex_); #endif } static const size_t MAX_STUBS = 16; static bool IsCacheableListBase(JSObject *obj) { if (!obj->isProxy()) return false; BaseProxyHandler *handler = GetProxyHandler(obj); if (handler->family() != GetListBaseHandlerFamily()) return false; if (obj->numFixedSlots() <= GetListBaseExpandoSlot()) return false; return true; } static void GeneratePrototypeGuards(JSContext *cx, MacroAssembler &masm, JSObject *obj, JSObject *holder, Register objectReg, Register scratchReg, Label *failures) { JS_ASSERT(obj != holder); if (obj->hasUncacheableProto()) { // Note: objectReg and scratchReg may be the same register, so we cannot // use objectReg in the rest of this function. masm.loadPtr(Address(objectReg, JSObject::offsetOfType()), scratchReg); Address proto(scratchReg, offsetof(types::TypeObject, proto)); masm.branchPtr(Assembler::NotEqual, proto, ImmGCPtr(obj->getProto()), failures); } JSObject *pobj = IsCacheableListBase(obj) ? obj->getTaggedProto().toObjectOrNull() : obj->getProto(); if (!pobj) return; while (pobj != holder) { if (pobj->hasUncacheableProto()) { if (pobj->hasSingletonType()) { types::TypeObject *type = pobj->getType(cx); masm.movePtr(ImmGCPtr(type), scratchReg); Address proto(scratchReg, offsetof(types::TypeObject, proto)); masm.branchPtr(Assembler::NotEqual, proto, ImmGCPtr(obj->getProto()), failures); } else { masm.movePtr(ImmGCPtr(pobj), scratchReg); Address objType(scratchReg, JSObject::offsetOfType()); masm.branchPtr(Assembler::NotEqual, objType, ImmGCPtr(pobj->type()), failures); } } pobj = pobj->getProto(); } } static bool IsCacheableProtoChain(JSObject *obj, JSObject *holder) { while (obj != holder) { /* * We cannot assume that we find the holder object on the prototype * chain and must check for null proto. The prototype chain can be * altered during the lookupProperty call. */ JSObject *proto = IsCacheableListBase(obj) ? obj->getTaggedProto().toObjectOrNull() : obj->getProto(); if (!proto || !proto->isNative()) return false; obj = proto; } return true; } static bool IsCacheableGetPropReadSlot(JSObject *obj, JSObject *holder, const Shape *shape) { if (!shape || !IsCacheableProtoChain(obj, holder)) return false; if (!shape->hasSlot() || !shape->hasDefaultGetter()) return false; return true; } static bool IsCacheableNoProperty(JSObject *obj, JSObject *holder, const Shape *shape, jsbytecode *pc, const TypedOrValueRegister &output) { if (shape) return false; JS_ASSERT(!holder); // Just because we didn't find the property on the object doesn't mean it // won't magically appear through various engine hacks: if (obj->getClass()->getProperty && obj->getClass()->getProperty != JS_PropertyStub) return false; // Don't generate missing property ICs if we skipped a non-native object, as // lookups may extend beyond the prototype chain (e.g. for ListBase // proxies). JSObject *obj2 = obj; while (obj2) { if (!obj2->isNative()) return false; obj2 = obj2->getProto(); } // The pc is NULL if the cache is idempotent. We cannot share missing // properties between caches because TI can only try to prove that a type is // contained, but does not attempts to check if something does not exists. // So the infered type of getprop would be missing and would not contain // undefined, as expected for missing properties. if (!pc) return false; #if JS_HAS_NO_SUCH_METHOD // The __noSuchMethod__ hook may substitute in a valid method. Since, // if o.m is missing, o.m() will probably be an error, just mark all // missing callprops as uncacheable. if (JSOp(*pc) == JSOP_CALLPROP || JSOp(*pc) == JSOP_CALLELEM) { return false; } #endif // TI has not yet monitored an Undefined value. The fallback path will // monitor and invalidate the script. if (!output.hasValue()) return false; return true; } static bool IsCacheableGetPropCallNative(JSObject *obj, JSObject *holder, const Shape *shape) { if (!shape || !IsCacheableProtoChain(obj, holder)) return false; if (!shape->hasGetterValue() || !shape->getterValue().isObject()) return false; return shape->getterValue().toObject().isFunction() && shape->getterValue().toObject().toFunction()->isNative(); } static bool IsCacheableGetPropCallPropertyOp(JSObject *obj, JSObject *holder, const Shape *shape) { if (!shape || !IsCacheableProtoChain(obj, holder)) return false; if (shape->hasSlot() || shape->hasGetterValue() || shape->hasDefaultGetter()) return false; return true; } struct GetNativePropertyStub { CodeOffsetJump exitOffset; CodeOffsetJump rejoinOffset; CodeOffsetLabel stubCodePatchOffset; void generateReadSlot(JSContext *cx, MacroAssembler &masm, JSObject *obj, PropertyName *propName, JSObject *holder, const Shape *shape, Register object, TypedOrValueRegister output, RepatchLabel *failures, Label *nonRepatchFailures = NULL) { // If there's a single jump to |failures|, we can patch the shape guard // jump directly. Otherwise, jump to the end of the stub, so there's a // common point to patch. bool multipleFailureJumps = (nonRepatchFailures != NULL) && nonRepatchFailures->used(); exitOffset = masm.branchPtrWithPatch(Assembler::NotEqual, Address(object, JSObject::offsetOfShape()), ImmGCPtr(obj->lastProperty()), failures); bool restoreScratch = false; Register scratchReg = Register::FromCode(0); // Quell compiler warning. // If we need a scratch register, use either an output register or the object // register (and restore it afterwards). After this point, we cannot jump // directly to |failures| since we may still have to pop the object register. Label prototypeFailures; if (obj != holder || !holder->isFixedSlot(shape->slot())) { if (output.hasValue()) { scratchReg = output.valueReg().scratchReg(); } else if (output.type() == MIRType_Double) { scratchReg = object; masm.push(scratchReg); restoreScratch = true; } else { scratchReg = output.typedReg().gpr(); } } // Generate prototype guards. Register holderReg; if (obj != holder) { // Note: this may clobber the object register if it's used as scratch. GeneratePrototypeGuards(cx, masm, obj, holder, object, scratchReg, &prototypeFailures); if (holder) { // Guard on the holder's shape. holderReg = scratchReg; masm.movePtr(ImmGCPtr(holder), holderReg); masm.branchPtr(Assembler::NotEqual, Address(holderReg, JSObject::offsetOfShape()), ImmGCPtr(holder->lastProperty()), &prototypeFailures); } else { // The property does not exist. Guard on everything in the // prototype chain. JSObject *proto = obj->getTaggedProto().toObjectOrNull(); Register lastReg = object; JS_ASSERT(scratchReg != object); while (proto) { Address addrType(lastReg, JSObject::offsetOfType()); masm.loadPtr(addrType, scratchReg); Address addrProto(scratchReg, offsetof(types::TypeObject, proto)); masm.loadPtr(addrProto, scratchReg); Address addrShape(scratchReg, JSObject::offsetOfShape()); // Guard the shape of the current prototype. masm.branchPtr(Assembler::NotEqual, Address(scratchReg, JSObject::offsetOfShape()), ImmGCPtr(proto->lastProperty()), &prototypeFailures); proto = proto->getProto(); lastReg = scratchReg; } holderReg = InvalidReg; } } else { holderReg = object; } // Slot access. if (holder && holder->isFixedSlot(shape->slot())) { Address addr(holderReg, JSObject::getFixedSlotOffset(shape->slot())); masm.loadTypedOrValue(addr, output); } else if (holder) { masm.loadPtr(Address(holderReg, JSObject::offsetOfSlots()), scratchReg); Address addr(scratchReg, holder->dynamicSlotIndex(shape->slot()) * sizeof(Value)); masm.loadTypedOrValue(addr, output); } else { JS_ASSERT(!holder); masm.moveValue(UndefinedValue(), output.valueReg()); } if (restoreScratch) masm.pop(scratchReg); RepatchLabel rejoin_; rejoinOffset = masm.jumpWithPatch(&rejoin_); masm.bind(&rejoin_); if (obj != holder || multipleFailureJumps) { masm.bind(&prototypeFailures); if (restoreScratch) masm.pop(scratchReg); masm.bind(failures); if (multipleFailureJumps) masm.bind(nonRepatchFailures); RepatchLabel exit_; exitOffset = masm.jumpWithPatch(&exit_); masm.bind(&exit_); } else { masm.bind(failures); } } bool generateCallGetter(JSContext *cx, MacroAssembler &masm, JSObject *obj, PropertyName *propName, JSObject *holder, const Shape *shape, RegisterSet &liveRegs, Register object, TypedOrValueRegister output, void *returnAddr, jsbytecode *pc, RepatchLabel *failures, Label *nonRepatchFailures = NULL) { // Initial shape check. Label stubFailure; masm.branchPtr(Assembler::NotEqual, Address(object, JSObject::offsetOfShape()), ImmGCPtr(obj->lastProperty()), &stubFailure); // If this is a stub for a ListBase object, guard the following: // 1. The object is a ListBase. // 2. The object does not have expando properties, or has an expando // which is known to not have the desired property. if (IsCacheableListBase(obj)) { Address handlerAddr(object, JSObject::getFixedSlotOffset(JSSLOT_PROXY_HANDLER)); Address expandoAddr(object, JSObject::getFixedSlotOffset(GetListBaseExpandoSlot())); // Check that object is a ListBase. masm.branchPrivatePtr(Assembler::NotEqual, handlerAddr, ImmWord(GetProxyHandler(obj)), &stubFailure); // For the remaining code, we need to reserve some registers to load a value. // This is ugly, but unvaoidable. RegisterSet listBaseRegSet(RegisterSet::All()); listBaseRegSet.take(AnyRegister(object)); ValueOperand tempVal = listBaseRegSet.takeValueOperand(); masm.pushValue(tempVal); Label failListBaseCheck; Label listBaseOk; Value expandoVal = obj->getFixedSlot(GetListBaseExpandoSlot()); JSObject *expando = expandoVal.isObject() ? &(expandoVal.toObject()) : NULL; JS_ASSERT_IF(expando, expando->isNative() && expando->getProto() == NULL); masm.loadValue(expandoAddr, tempVal); if (expando && expando->nativeLookupNoAllocation(propName)) { // Reference object has an expando that doesn't define the name. // Check incoming object's expando and make sure it's an object. // If checkExpando is true, we'll temporarily use register(s) for a ValueOperand. // If we do that, we save the register(s) on stack before use and pop them // on both exit paths. masm.branchTestObject(Assembler::NotEqual, tempVal, &failListBaseCheck); masm.extractObject(tempVal, tempVal.scratchReg()); masm.branchPtr(Assembler::Equal, Address(tempVal.scratchReg(), JSObject::offsetOfShape()), ImmGCPtr(expando->lastProperty()), &listBaseOk); } else { // Reference object has no expando. Check incoming object and ensure // it has no expando. masm.branchTestUndefined(Assembler::Equal, tempVal, &listBaseOk); } // Failure case: restore the tempVal registers and jump to failures. masm.bind(&failListBaseCheck); masm.popValue(tempVal); masm.jump(&stubFailure); // Success case: restore the tempval and proceed. masm.bind(&listBaseOk); masm.popValue(tempVal); } // Reserve scratch register for prototype guards. bool restoreScratch = false; Register scratchReg = Register::FromCode(0); // Quell compiler warning. // If we need a scratch register, use either an output register or the object // register (and restore it afterwards). After this point, we cannot jump // directly to |stubFailure| since we may still have to pop the object register. Label prototypeFailures; JS_ASSERT(output.hasValue()); scratchReg = output.valueReg().scratchReg(); // Note: this may clobber the object register if it's used as scratch. if (obj != holder) GeneratePrototypeGuards(cx, masm, obj, holder, object, scratchReg, &prototypeFailures); // Guard on the holder's shape. Register holderReg = scratchReg; masm.movePtr(ImmGCPtr(holder), holderReg); masm.branchPtr(Assembler::NotEqual, Address(holderReg, JSObject::offsetOfShape()), ImmGCPtr(holder->lastProperty()), &prototypeFailures); if (restoreScratch) masm.pop(scratchReg); // Now we're good to go to invoke the native call. // saveLive() masm.PushRegsInMask(liveRegs); // Remaining registers should basically be free, but we need to use |object| still // so leave it alone. RegisterSet regSet(RegisterSet::All()); regSet.take(AnyRegister(object)); // This is a slower stub path, and we're going to be doing a call anyway. Don't need // to try so hard to not use the stack. Scratch regs are just taken from the register // set not including the input, current value saved on the stack, and restored when // we're done with it. scratchReg = regSet.takeGeneral(); Register argJSContextReg = regSet.takeGeneral(); Register argUintNReg = regSet.takeGeneral(); Register argVpReg = regSet.takeGeneral(); // Shape has a getter function. bool callNative = IsCacheableGetPropCallNative(obj, holder, shape); JS_ASSERT_IF(!callNative, IsCacheableGetPropCallPropertyOp(obj, holder, shape)); // TODO: ensure stack is aligned? DebugOnly<uint32> initialStack = masm.framePushed(); masm.checkStackAlignment(); Label success, exception; // Push the IonCode pointer for the stub we're generating. // WARNING: // WARNING: If IonCode ever becomes relocatable, the following code is incorrect. // WARNING: Note that we're not marking the pointer being pushed as an ImmGCPtr. // WARNING: This is not a marking issue since the stub IonCode won't be collected // WARNING: between the time it's called and when we get here, but it would fail // WARNING: if the IonCode object ever moved, since we'd be rooting a nonsense // WARNING: value here. // WARNING: stubCodePatchOffset = masm.PushWithPatch(ImmWord(uintptr_t(-1))); if (callNative) { JS_ASSERT(shape->hasGetterValue() && shape->getterValue().isObject() && shape->getterValue().toObject().isFunction()); JSFunction *target = shape->getterValue().toObject().toFunction(); JS_ASSERT(target); JS_ASSERT(target->isNative()); // Native functions have the signature: // bool (*)(JSContext *, unsigned, Value *vp) // Where vp[0] is space for an outparam, vp[1] is |this|, and vp[2] onward // are the function arguments. // Construct vp array: // Push object value for |this| masm.Push(TypedOrValueRegister(MIRType_Object, AnyRegister(object))); // Push callee/outparam. masm.Push(ObjectValue(*target)); // Preload arguments into registers. masm.loadJSContext(argJSContextReg); masm.move32(Imm32(0), argUintNReg); masm.movePtr(StackPointer, argVpReg); if (!masm.buildOOLFakeExitFrame(returnAddr)) return false; masm.enterFakeExitFrame(ION_FRAME_OOL_NATIVE_GETTER); // Construct and execute call. masm.setupUnalignedABICall(3, scratchReg); masm.passABIArg(argJSContextReg); masm.passABIArg(argUintNReg); masm.passABIArg(argVpReg); masm.callWithABI(JS_FUNC_TO_DATA_PTR(void *, target->native())); // Test for failure. masm.branchTest32(Assembler::Zero, ReturnReg, ReturnReg, &exception); // Load the outparam vp[0] into output register(s). masm.loadValue( Address(StackPointer, IonOOLNativeGetterExitFrameLayout::offsetOfResult()), JSReturnOperand); } else { Register argObjReg = argUintNReg; Register argIdReg = regSet.takeGeneral(); PropertyOp target = shape->getterOp(); JS_ASSERT(target); // JSPropertyOp: JSBool fn(JSContext *cx, JSHandleObject obj, JSHandleId id, JSMutableHandleValue vp) // Push args on stack first so we can take pointers to make handles. masm.Push(UndefinedValue()); masm.movePtr(StackPointer, argVpReg); // push canonical jsid from shape instead of propertyname. jsid propId; if (!shape->getUserId(cx, &propId)) return false; masm.Push(propId, scratchReg); masm.movePtr(StackPointer, argIdReg); masm.Push(object); masm.movePtr(StackPointer, argObjReg); masm.loadJSContext(argJSContextReg); if (!masm.buildOOLFakeExitFrame(returnAddr)) return false; masm.enterFakeExitFrame(ION_FRAME_OOL_PROPERTY_OP); // Make the call. masm.setupUnalignedABICall(4, scratchReg); masm.passABIArg(argJSContextReg); masm.passABIArg(argObjReg); masm.passABIArg(argIdReg); masm.passABIArg(argVpReg); masm.callWithABI(JS_FUNC_TO_DATA_PTR(void *, target)); // Test for failure. masm.branchTest32(Assembler::Zero, ReturnReg, ReturnReg, &exception); // Load the outparam vp[0] into output register(s). masm.loadValue( Address(StackPointer, IonOOLPropertyOpExitFrameLayout::offsetOfResult()), JSReturnOperand); } // If generating getter call stubs, then return type MUST have been generalized // to MIRType_Value. masm.jump(&success); // Handle exception case. masm.bind(&exception); masm.handleException(); // Handle success case. masm.bind(&success); masm.storeCallResultValue(output); // The next instruction is removing the footer of the exit frame, so there // is no need for leaveFakeExitFrame. // Move the StackPointer back to its original location, unwinding the native exit frame. if (callNative) masm.adjustStack(IonOOLNativeGetterExitFrameLayout::Size()); else masm.adjustStack(IonOOLPropertyOpExitFrameLayout::Size()); JS_ASSERT(masm.framePushed() == initialStack); // restoreLive() masm.PopRegsInMask(liveRegs); // Rejoin jump. RepatchLabel rejoin_; rejoinOffset = masm.jumpWithPatch(&rejoin_); masm.bind(&rejoin_); // Exit jump. masm.bind(&prototypeFailures); if (restoreScratch) masm.pop(scratchReg); masm.bind(&stubFailure); if (nonRepatchFailures) masm.bind(nonRepatchFailures); RepatchLabel exit_; exitOffset = masm.jumpWithPatch(&exit_); masm.bind(&exit_); return true; } }; bool IonCacheGetProperty::attachReadSlot(JSContext *cx, IonScript *ion, JSObject *obj, JSObject *holder, const Shape *shape) { MacroAssembler masm; RepatchLabel failures; GetNativePropertyStub getprop; getprop.generateReadSlot(cx, masm, obj, name(), holder, shape, object(), output(), &failures); Linker linker(masm); IonCode *code = linker.newCode(cx); if (!code) return false; getprop.rejoinOffset.fixup(&masm); getprop.exitOffset.fixup(&masm); if (ion->invalidated()) return true; CodeLocationJump rejoinJump(code, getprop.rejoinOffset); CodeLocationJump exitJump(code, getprop.exitOffset); CodeLocationJump lastJump_ = lastJump(); PatchJump(lastJump_, CodeLocationLabel(code)); PatchJump(rejoinJump, rejoinLabel()); PatchJump(exitJump, cacheLabel()); updateLastJump(exitJump); IonSpew(IonSpew_InlineCaches, "Generated native GETPROP stub at %p %s", code->raw(), idempotent() ? "(idempotent)" : "(not idempotent)"); return true; } bool IonCacheGetProperty::attachCallGetter(JSContext *cx, IonScript *ion, JSObject *obj, JSObject *holder, const Shape *shape, const SafepointIndex *safepointIndex, void *returnAddr) { MacroAssembler masm; RepatchLabel failures; JS_ASSERT(!idempotent()); JS_ASSERT(allowGetters()); // Need to set correct framePushed on the masm so that exit frame descriptors are // properly constructed. masm.setFramePushed(ion->frameSize()); GetNativePropertyStub getprop; if (!getprop.generateCallGetter(cx, masm, obj, name(), holder, shape, liveRegs, object(), output(), returnAddr, pc, &failures)) { return false; } Linker linker(masm); IonCode *code = linker.newCode(cx); if (!code) return false; getprop.rejoinOffset.fixup(&masm); getprop.exitOffset.fixup(&masm); getprop.stubCodePatchOffset.fixup(&masm); if (ion->invalidated()) return true; Assembler::patchDataWithValueCheck(CodeLocationLabel(code, getprop.stubCodePatchOffset), ImmWord(uintptr_t(code)), ImmWord(uintptr_t(-1))); CodeLocationJump rejoinJump(code, getprop.rejoinOffset); CodeLocationJump exitJump(code, getprop.exitOffset); CodeLocationJump lastJump_ = lastJump(); PatchJump(lastJump_, CodeLocationLabel(code)); PatchJump(rejoinJump, rejoinLabel()); PatchJump(exitJump, cacheLabel()); updateLastJump(exitJump); IonSpew(IonSpew_InlineCaches, "Generated native GETPROP stub at %p %s", code->raw(), idempotent() ? "(idempotent)" : "(not idempotent)"); return true; } static bool TryAttachNativeGetPropStub(JSContext *cx, IonScript *ion, IonCacheGetProperty &cache, HandleObject obj, HandlePropertyName name, const SafepointIndex *safepointIndex, void *returnAddr, bool *isCacheable) { JS_ASSERT(!*isCacheable); RootedObject checkObj(cx, obj); bool isListBase = IsCacheableListBase(obj); if (isListBase) checkObj = obj->getTaggedProto().toObjectOrNull(); if (!checkObj || !checkObj->isNative()) return true; // If the cache is idempotent, watch out for resolve hooks or non-native // objects on the proto chain. We check this before calling lookupProperty, // to make sure no effectful lookup hooks or resolve hooks are called. if (cache.idempotent() && !checkObj->hasIdempotentProtoChain()) return true; RootedShape shape(cx); RootedObject holder(cx); if (!JSObject::lookupProperty(cx, checkObj, name, &holder, &shape)) return false; // Check what kind of cache stub we can emit: either a slot read, // or a getter call. bool readSlot = false; bool callGetter = false; RootedScript script(cx); jsbytecode *pc; cache.getScriptedLocation(&script, &pc); if (IsCacheableGetPropReadSlot(obj, holder, shape) || IsCacheableNoProperty(obj, holder, shape, pc, cache.output())) { // With Proxies, we cannot garantee any property access as the proxy can // mask any property from the prototype chain. if (!obj->isProxy()) readSlot = true; } else if (IsCacheableGetPropCallNative(checkObj, holder, shape) || IsCacheableGetPropCallPropertyOp(checkObj, holder, shape)) { // Don't enable getter call if cache is idempotent, since // they can be effectful. if (!cache.idempotent() && cache.allowGetters()) callGetter = true; } // Only continue if one of the cache methods is viable. if (!readSlot && !callGetter) return true; // TI infers the possible types of native object properties. There's one // edge case though: for singleton objects it does not add the initial // "undefined" type, see the propertySet comment in jsinfer.h. We can't // monitor the return type inside an idempotent cache though, so we don't // handle this case. if (cache.idempotent() && holder && holder->hasSingletonType() && holder->getSlot(shape->slot()).isUndefined()) { return true; } *isCacheable = true; // readSlot and callGetter are mutually exclusive JS_ASSERT_IF(readSlot, !callGetter); JS_ASSERT_IF(callGetter, !readSlot); if (cache.stubCount() < MAX_STUBS) { cache.incrementStubCount(); if (readSlot) return cache.attachReadSlot(cx, ion, obj, holder, shape); else return cache.attachCallGetter(cx, ion, obj, holder, shape, safepointIndex, returnAddr); } return true; } bool js::ion::GetPropertyCache(JSContext *cx, size_t cacheIndex, HandleObject obj, MutableHandleValue vp) { AutoFlushCache afc ("GetPropertyCache"); const SafepointIndex *safepointIndex; void *returnAddr; JSScript *topScript = GetTopIonJSScript(cx, &safepointIndex, &returnAddr); IonScript *ion = topScript->ionScript(); IonCacheGetProperty &cache = ion->getCache(cacheIndex).toGetProperty(); RootedPropertyName name(cx, cache.name()); RootedScript script(cx); jsbytecode *pc; cache.getScriptedLocation(&script, &pc); // Override the return value if we are invalidated (bug 728188). AutoDetectInvalidation adi(cx, vp.address(), ion); // If the cache is idempotent, we will redo the op in the interpreter. if (cache.idempotent()) adi.disable(); // For now, just stop generating new stubs once we hit the stub count // limit. Once we can make calls from within generated stubs, a new call // stub will be generated instead and the previous stubs unlinked. bool isCacheable = false; if (!TryAttachNativeGetPropStub(cx, ion, cache, obj, name, safepointIndex, returnAddr, &isCacheable)) { return false; } if (cache.idempotent() && !isCacheable) { // Invalidate the cache if the property was not found, or was found on // a non-native object. This ensures: // 1) The property read has no observable side-effects. // 2) There's no need to dynamically monitor the return type. This would // be complicated since (due to GVN) there can be multiple pc's // associated with a single idempotent cache. IonSpew(IonSpew_InlineCaches, "Invalidating from idempotent cache %s:%d", topScript->filename, topScript->lineno); topScript->invalidatedIdempotentCache = true; // Do not re-invalidate if the lookup already caused invalidation. if (!topScript->hasIonScript()) return true; return Invalidate(cx, topScript); } RootedId id(cx, NameToId(name)); if (obj->getOps()->getProperty) { if (!GetPropertyGenericMaybeCallXML(cx, JSOp(*pc), obj, id, vp)) return false; } else { if (!GetPropertyHelper(cx, obj, id, 0, vp)) return false; } if (!cache.idempotent()) { // If the cache is idempotent, the property exists so we don't have to // call __noSuchMethod__. #if JS_HAS_NO_SUCH_METHOD // Handle objects with __noSuchMethod__. if (JSOp(*pc) == JSOP_CALLPROP && JS_UNLIKELY(vp.isPrimitive())) { if (!OnUnknownMethod(cx, obj, IdToValue(id), vp)) return false; } #endif // Monitor changes to cache entry. types::TypeScript::Monitor(cx, script, pc, vp); } return true; } void IonCache::updateBaseAddress(IonCode *code, MacroAssembler &masm) { initialJump_.repoint(code, &masm); lastJump_.repoint(code, &masm); cacheLabel_.repoint(code, &masm); } void IonCache::reset() { PatchJump(initialJump_, cacheLabel_); this->stubCount_ = 0; this->lastJump_ = initialJump_; } bool IonCacheSetProperty::attachNativeExisting(JSContext *cx, IonScript *ion, HandleObject obj, HandleShape shape) { MacroAssembler masm; RepatchLabel exit_; CodeOffsetJump exitOffset = masm.branchPtrWithPatch(Assembler::NotEqual, Address(object(), JSObject::offsetOfShape()), ImmGCPtr(obj->lastProperty()), &exit_); masm.bind(&exit_); if (obj->isFixedSlot(shape->slot())) { Address addr(object(), JSObject::getFixedSlotOffset(shape->slot())); if (cx->compartment->needsBarrier()) masm.callPreBarrier(addr, MIRType_Value); masm.storeConstantOrRegister(value(), addr); } else { Register slotsReg = object(); masm.loadPtr(Address(object(), JSObject::offsetOfSlots()), slotsReg); Address addr(slotsReg, obj->dynamicSlotIndex(shape->slot()) * sizeof(Value)); if (cx->compartment->needsBarrier()) masm.callPreBarrier(addr, MIRType_Value); masm.storeConstantOrRegister(value(), addr); } RepatchLabel rejoin_; CodeOffsetJump rejoinOffset = masm.jumpWithPatch(&rejoin_); masm.bind(&rejoin_); Linker linker(masm); IonCode *code = linker.newCode(cx); if (!code) return false; rejoinOffset.fixup(&masm); exitOffset.fixup(&masm); if (ion->invalidated()) return true; CodeLocationJump rejoinJump(code, rejoinOffset); CodeLocationJump exitJump(code, exitOffset); CodeLocationJump lastJump_ = lastJump(); PatchJump(lastJump_, CodeLocationLabel(code)); PatchJump(rejoinJump, rejoinLabel()); PatchJump(exitJump, cacheLabel()); updateLastJump(exitJump); IonSpew(IonSpew_InlineCaches, "Generated native SETPROP setting case stub at %p", code->raw()); return true; } bool IonCacheSetProperty::attachSetterCall(JSContext *cx, IonScript *ion, HandleObject obj, HandleObject holder, HandleShape shape, void *returnAddr) { MacroAssembler masm; // Need to set correct framePushed on the masm so that exit frame descriptors are // properly constructed. masm.setFramePushed(ion->frameSize()); Label failure; masm.branchPtr(Assembler::NotEqual, Address(object(), JSObject::offsetOfShape()), ImmGCPtr(obj->lastProperty()), &failure); // Generate prototype guards if needed. // Take a scratch register for use, save on stack. { RegisterSet regSet(RegisterSet::All()); regSet.take(AnyRegister(object())); if (!value().constant()) regSet.maybeTake(value().reg()); Register scratchReg = regSet.takeGeneral(); masm.push(scratchReg); Label protoFailure; Label protoSuccess; // Generate prototype/shape guards. if (obj != holder) GeneratePrototypeGuards(cx, masm, obj, holder, object(), scratchReg, &protoFailure); masm.movePtr(ImmGCPtr(holder), scratchReg); masm.branchPtr(Assembler::NotEqual, Address(scratchReg, JSObject::offsetOfShape()), ImmGCPtr(holder->lastProperty()), &protoFailure); masm.jump(&protoSuccess); masm.bind(&protoFailure); masm.pop(scratchReg); masm.jump(&failure); masm.bind(&protoSuccess); masm.pop(scratchReg); } // Good to go for invoking setter. // saveLive() masm.PushRegsInMask(liveRegs); // Remaining registers should basically be free, but we need to use |object| still // so leave it alone. RegisterSet regSet(RegisterSet::All()); regSet.take(AnyRegister(object())); // This is a slower stub path, and we're going to be doing a call anyway. Don't need // to try so hard to not use the stack. Scratch regs are just taken from the register // set not including the input, current value saved on the stack, and restored when // we're done with it. Register scratchReg = regSet.takeGeneral(); Register argJSContextReg = regSet.takeGeneral(); Register argObjReg = regSet.takeGeneral(); Register argIdReg = regSet.takeGeneral(); Register argStrictReg = regSet.takeGeneral(); Register argVpReg = regSet.takeGeneral(); // Ensure stack is aligned. DebugOnly<uint32> initialStack = masm.framePushed(); masm.checkStackAlignment(); Label success, exception; // Push the IonCode pointer for the stub we're generating. // WARNING: // WARNING: If IonCode ever becomes relocatable, the following code is incorrect. // WARNING: Note that we're not marking the pointer being pushed as an ImmGCPtr. // WARNING: This is not a marking issue since the stub IonCode won't be collected // WARNING: between the time it's called and when we get here, but it would fail // WARNING: if the IonCode object ever moved, since we'd be rooting a nonsense // WARNING: value here. // WARNING: CodeOffsetLabel stubCodePatchOffset = masm.PushWithPatch(ImmWord(uintptr_t(-1))); StrictPropertyOp target = shape->setterOp(); JS_ASSERT(target); // JSStrictPropertyOp: JSBool fn(JSContext *cx, JSHandleObject obj, // JSHandleId id, JSBool strict, JSMutableHandleValue vp); // Push args on stack first so we can take pointers to make handles. if (value().constant()) masm.Push(value().value()); else masm.Push(value().reg()); masm.movePtr(StackPointer, argVpReg); masm.move32(Imm32(strict() ? 1 : 0), argStrictReg); // push canonical jsid from shape instead of propertyname. jsid propId; if (!shape->getUserId(cx, &propId)) return false; masm.Push(propId, argIdReg); masm.movePtr(StackPointer, argIdReg); masm.Push(object()); masm.movePtr(StackPointer, argObjReg); masm.loadJSContext(argJSContextReg); if (!masm.buildOOLFakeExitFrame(returnAddr)) return false; masm.enterFakeExitFrame(ION_FRAME_OOL_PROPERTY_OP); // Make the call. masm.setupUnalignedABICall(5, scratchReg); masm.passABIArg(argJSContextReg); masm.passABIArg(argObjReg); masm.passABIArg(argIdReg); masm.passABIArg(argStrictReg); masm.passABIArg(argVpReg); masm.callWithABI(JS_FUNC_TO_DATA_PTR(void *, target)); // Test for failure. masm.branchTest32(Assembler::Zero, ReturnReg, ReturnReg, &exception); masm.jump(&success); // Handle exception case. masm.bind(&exception); masm.handleException(); // Handle success case. masm.bind(&success); // The next instruction is removing the footer of the exit frame, so there // is no need for leaveFakeExitFrame. // Move the StackPointer back to its original location, unwinding the exit frame. masm.adjustStack(IonOOLPropertyOpExitFrameLayout::Size()); JS_ASSERT(masm.framePushed() == initialStack); // restoreLive() masm.PopRegsInMask(liveRegs); // Rejoin jump. RepatchLabel rejoin; CodeOffsetJump rejoinOffset = masm.jumpWithPatch(&rejoin); masm.bind(&rejoin); // Exit jump. masm.bind(&failure); RepatchLabel exit; CodeOffsetJump exitOffset = masm.jumpWithPatch(&exit); masm.bind(&exit); Linker linker(masm); IonCode *code = linker.newCode(cx); if (!code) return false; rejoinOffset.fixup(&masm); exitOffset.fixup(&masm); stubCodePatchOffset.fixup(&masm); if (ion->invalidated()) return true; Assembler::patchDataWithValueCheck(CodeLocationLabel(code, stubCodePatchOffset), ImmWord(uintptr_t(code)), ImmWord(uintptr_t(-1))); CodeLocationJump rejoinJump(code, rejoinOffset); CodeLocationJump exitJump(code, exitOffset); CodeLocationJump lastJump_ = lastJump(); PatchJump(lastJump_, CodeLocationLabel(code)); PatchJump(rejoinJump, rejoinLabel()); PatchJump(exitJump, cacheLabel()); updateLastJump(exitJump); IonSpew(IonSpew_InlineCaches, "Generated SETPROP calling case stub at %p", code->raw()); return true; } bool IonCacheSetProperty::attachNativeAdding(JSContext *cx, IonScript *ion, JSObject *obj, const Shape *oldShape, const Shape *newShape, const Shape *propShape) { MacroAssembler masm; Label failures; /* Guard the type of the object */ masm.branchPtr(Assembler::NotEqual, Address(object(), JSObject::offsetOfType()), ImmGCPtr(obj->type()), &failures); /* Guard shapes along prototype chain. */ masm.branchTestObjShape(Assembler::NotEqual, object(), oldShape, &failures); Label protoFailures; masm.push(object()); // save object reg because we clobber it JSObject *proto = obj->getProto(); Register protoReg = object(); while (proto) { Shape *protoShape = proto->lastProperty(); // load next prototype masm.loadPtr(Address(protoReg, JSObject::offsetOfType()), protoReg); masm.loadPtr(Address(protoReg, offsetof(types::TypeObject, proto)), protoReg); // ensure that the prototype is not NULL and that its shape matches masm.branchTestPtr(Assembler::Zero, protoReg, protoReg, &protoFailures); masm.branchTestObjShape(Assembler::NotEqual, protoReg, protoShape, &protoFailures); proto = proto->getProto(); } masm.pop(object()); // restore object reg /* Changing object shape. Write the object's new shape. */ Address shapeAddr(object(), JSObject::offsetOfShape()); if (cx->compartment->needsBarrier()) masm.callPreBarrier(shapeAddr, MIRType_Shape); masm.storePtr(ImmGCPtr(newShape), shapeAddr); /* Set the value on the object. */ if (obj->isFixedSlot(propShape->slot())) { Address addr(object(), JSObject::getFixedSlotOffset(propShape->slot())); masm.storeConstantOrRegister(value(), addr); } else { Register slotsReg = object(); masm.loadPtr(Address(object(), JSObject::offsetOfSlots()), slotsReg); Address addr(slotsReg, obj->dynamicSlotIndex(propShape->slot()) * sizeof(Value)); masm.storeConstantOrRegister(value(), addr); } /* Success. */ RepatchLabel rejoin_; CodeOffsetJump rejoinOffset = masm.jumpWithPatch(&rejoin_); masm.bind(&rejoin_); /* Failure. */ masm.bind(&protoFailures); masm.pop(object()); masm.bind(&failures); RepatchLabel exit_; CodeOffsetJump exitOffset = masm.jumpWithPatch(&exit_); masm.bind(&exit_); Linker linker(masm); IonCode *code = linker.newCode(cx); if (!code) return false; rejoinOffset.fixup(&masm); exitOffset.fixup(&masm); if (ion->invalidated()) return true; CodeLocationJump rejoinJump(code, rejoinOffset); CodeLocationJump exitJump(code, exitOffset); CodeLocationJump lastJump_ = lastJump(); PatchJump(lastJump_, CodeLocationLabel(code)); PatchJump(rejoinJump, rejoinLabel()); PatchJump(exitJump, cacheLabel()); updateLastJump(exitJump); IonSpew(IonSpew_InlineCaches, "Generated native SETPROP adding case stub at %p", code->raw()); return true; } static bool IsPropertyInlineable(JSObject *obj, IonCacheSetProperty &cache) { // Stop generating new stubs once we hit the stub count limit, see // GetPropertyCache. if (cache.stubCount() >= MAX_STUBS) return false; if (!obj->isNative()) return false; if (obj->watched()) return false; return true; } static bool IsPropertySetInlineable(JSContext *cx, HandleObject obj, HandleId id, MutableHandleShape pshape) { Shape *shape = obj->nativeLookup(cx, id); if (!shape) return false; if (!shape->hasSlot()) return false; if (!shape->hasDefaultSetter()) return false; if (!shape->writable()) return false; pshape.set(shape); return true; } static bool IsPropertySetterCallInlineable(JSContext *cx, HandleObject obj, HandleObject holder, jsid id, HandleShape shape) { if (!shape) return false; if (shape->hasSlot()) return false; if (shape->hasDefaultSetter()) return false; // We only handle propertyOps for now, so fail if we have SetterValue // (which implies JSNative setter). if (shape->hasSetterValue()) return false; return true; } static bool IsPropertyAddInlineable(JSContext *cx, HandleObject obj, jsid id, uint32_t oldSlots, MutableHandleShape pShape) { // This is not a Add, the property exists. if (pShape.get()) return false; Shape *shape = obj->nativeLookup(cx, id); if (!shape || shape->inDictionary() || !shape->hasSlot() || !shape->hasDefaultSetter()) return false; // If object has a non-default resolve hook, don't inline if (obj->getClass()->resolve != JS_ResolveStub) return false; if (!obj->isExtensible() || !shape->writable()) return false; // walk up the object prototype chain and ensure that all prototypes // are native, and that all prototypes have no getter or setter // defined on the property for (JSObject *proto = obj->getProto(); proto; proto = proto->getProto()) { // if prototype is non-native, don't optimize if (!proto->isNative()) return false; // if prototype defines this property in a non-plain way, don't optimize const Shape *protoShape = proto->nativeLookup(cx, id); if (protoShape && !protoShape->hasDefaultSetter()) return false; // Otherise, if there's no such property, watch out for a resolve hook that would need // to be invoked and thus prevent inlining of property addition. if (proto->getClass()->resolve != JS_ResolveStub) return false; } // Only add a IC entry if the dynamic slots didn't change when the shapes // changed. Need to ensure that a shape change for a subsequent object // won't involve reallocating the slot array. if (obj->numDynamicSlots() != oldSlots) return false; pShape.set(shape); return true; } bool js::ion::SetPropertyCache(JSContext *cx, size_t cacheIndex, HandleObject obj, HandleValue value, bool isSetName) { AutoFlushCache afc ("SetPropertyCache"); void *returnAddr; const SafepointIndex *safepointIndex; JSScript *script = GetTopIonJSScript(cx, &safepointIndex, &returnAddr); IonScript *ion = script->ion; IonCacheSetProperty &cache = ion->getCache(cacheIndex).toSetProperty(); RootedPropertyName name(cx, cache.name()); RootedId id(cx, AtomToId(name)); RootedShape shape(cx); RootedObject holder(cx); bool inlinable = IsPropertyInlineable(obj, cache); if (inlinable) { RootedShape shape(cx); if (IsPropertySetInlineable(cx, obj, id, &shape)) { cache.incrementStubCount(); if (!cache.attachNativeExisting(cx, ion, obj, shape)) return false; } else { RootedObject holder(cx); if (!JSObject::lookupProperty(cx, obj, name, &holder, &shape)) return false; if (IsPropertySetterCallInlineable(cx, obj, holder, id, shape)) { cache.incrementStubCount(); if (!cache.attachSetterCall(cx, ion, obj, holder, shape, returnAddr)) return false; } } } uint32_t oldSlots = obj->numDynamicSlots(); const Shape *oldShape = obj->lastProperty(); // Set/Add the property on the object, the inlined cache are setup for the next execution. if (!SetProperty(cx, obj, name, value, cache.strict(), isSetName)) return false; // The property did not exists before, now we can try again to inline the // procedure which is adding the property. if (inlinable && IsPropertyAddInlineable(cx, obj, id, oldSlots, &shape)) { const Shape *newShape = obj->lastProperty(); cache.incrementStubCount(); if (!cache.attachNativeAdding(cx, ion, obj, oldShape, newShape, shape)) return false; } return true; } bool IonCacheGetElement::attachGetProp(JSContext *cx, IonScript *ion, HandleObject obj, const Value &idval, PropertyName *name) { RootedObject holder(cx); RootedShape shape(cx); if (!JSObject::lookupProperty(cx, obj, name, &holder, &shape)) return false; RootedScript script(cx); jsbytecode *pc; getScriptedLocation(&script, &pc); if (!IsCacheableGetPropReadSlot(obj, holder, shape) && !IsCacheableNoProperty(obj, holder, shape, pc, output())) { IonSpew(IonSpew_InlineCaches, "GETELEM uncacheable property"); return true; } JS_ASSERT(idval.isString()); RepatchLabel failures; Label nonRepatchFailures; MacroAssembler masm; // Guard on the index value. ValueOperand val = index().reg().valueReg(); masm.branchTestValue(Assembler::NotEqual, val, idval, &nonRepatchFailures); GetNativePropertyStub getprop; getprop.generateReadSlot(cx, masm, obj, name, holder, shape, object(), output(), &failures, &nonRepatchFailures); Linker linker(masm); IonCode *code = linker.newCode(cx); if (!code) return false; getprop.rejoinOffset.fixup(&masm); getprop.exitOffset.fixup(&masm); if (ion->invalidated()) return true; CodeLocationJump rejoinJump(code, getprop.rejoinOffset); CodeLocationJump exitJump(code, getprop.exitOffset); CodeLocationJump lastJump_ = lastJump(); PatchJump(lastJump_, CodeLocationLabel(code)); PatchJump(rejoinJump, rejoinLabel()); PatchJump(exitJump, cacheLabel()); updateLastJump(exitJump); IonSpew(IonSpew_InlineCaches, "Generated GETELEM property stub at %p", code->raw()); return true; } // Get the common shape used by all dense arrays with a prototype at globalObj. static inline Shape * GetDenseArrayShape(JSContext *cx, JSObject *globalObj) { JSObject *proto = globalObj->global().getOrCreateArrayPrototype(cx); if (!proto) return NULL; return EmptyShape::getInitialShape(cx, &ArrayClass, proto, proto->getParent(), gc::FINALIZE_OBJECT0); } bool IonCacheGetElement::attachDenseArray(JSContext *cx, IonScript *ion, JSObject *obj, const Value &idval) { JS_ASSERT(obj->isDenseArray()); JS_ASSERT(idval.isInt32()); Label failures; MacroAssembler masm; // Guard object is a dense array. RootedShape shape(cx, GetDenseArrayShape(cx, &script->global())); if (!shape) return false; masm.branchTestObjShape(Assembler::NotEqual, object(), shape, &failures); // Ensure the index is an int32 value. ValueOperand val = index().reg().valueReg(); masm.branchTestInt32(Assembler::NotEqual, val, &failures); // Load elements vector. masm.push(object()); masm.loadPtr(Address(object(), JSObject::offsetOfElements()), object()); // Unbox the index. ValueOperand out = output().valueReg(); Register scratchReg = out.scratchReg(); masm.unboxInt32(val, scratchReg); Label hole; // Guard on the initialized length. Address initLength(object(), ObjectElements::offsetOfInitializedLength()); masm.branch32(Assembler::BelowOrEqual, initLength, scratchReg, &hole); // Load the value. masm.loadValue(BaseIndex(object(), scratchReg, TimesEight), out); // Hole check. masm.branchTestMagic(Assembler::Equal, out, &hole); masm.pop(object()); RepatchLabel rejoin_; CodeOffsetJump rejoinOffset = masm.jumpWithPatch(&rejoin_); masm.bind(&rejoin_); // All failures flow to here. masm.bind(&hole); masm.pop(object()); masm.bind(&failures); RepatchLabel exit_; CodeOffsetJump exitOffset = masm.jumpWithPatch(&exit_); masm.bind(&exit_); Linker linker(masm); IonCode *code = linker.newCode(cx); if (!code) return false; rejoinOffset.fixup(&masm); exitOffset.fixup(&masm); if (ion->invalidated()) return true; CodeLocationJump rejoinJump(code, rejoinOffset); CodeLocationJump exitJump(code, exitOffset); CodeLocationJump lastJump_ = lastJump(); PatchJump(lastJump_, CodeLocationLabel(code)); PatchJump(rejoinJump, rejoinLabel()); PatchJump(exitJump, cacheLabel()); updateLastJump(exitJump); setHasDenseArrayStub(); IonSpew(IonSpew_InlineCaches, "Generated GETELEM dense array stub at %p", code->raw()); return true; } bool js::ion::GetElementCache(JSContext *cx, size_t cacheIndex, HandleObject obj, HandleValue idval, MutableHandleValue res) { AutoFlushCache afc ("GetElementCache"); IonScript *ion = GetTopIonJSScript(cx)->ionScript(); IonCacheGetElement &cache = ion->getCache(cacheIndex).toGetElement(); // Override the return value if we are invalidated (bug 728188). AutoDetectInvalidation adi(cx, res.address(), ion); RootedId id(cx); if (!FetchElementId(cx, obj, idval, id.address(), res)) return false; if (cache.stubCount() < MAX_STUBS) { if (obj->isNative() && cache.monitoredResult()) { cache.incrementStubCount(); uint32_t dummy; if (idval.isString() && JSID_IS_ATOM(id) && !JSID_TO_ATOM(id)->isIndex(&dummy)) { if (!cache.attachGetProp(cx, ion, obj, idval, JSID_TO_ATOM(id)->asPropertyName())) return false; } } else if (!cache.hasDenseArrayStub() && obj->isDenseArray() && idval.isInt32()) { // Generate at most one dense array stub. cache.incrementStubCount(); if (!cache.attachDenseArray(cx, ion, obj, idval)) return false; } } RootedScript script(cx); jsbytecode *pc; cache.getScriptedLocation(&script, &pc); RootedValue lval(cx, ObjectValue(*obj)); if (!GetElementOperation(cx, JSOp(*pc), lval, idval, res)) return false; types::TypeScript::Monitor(cx, script, pc, res); return true; } bool IonCacheBindName::attachGlobal(JSContext *cx, IonScript *ion, JSObject *scopeChain) { JS_ASSERT(scopeChain->isGlobal()); MacroAssembler masm; // Guard on the scope chain. RepatchLabel exit_; CodeOffsetJump exitOffset = masm.branchPtrWithPatch(Assembler::NotEqual, scopeChainReg(), ImmGCPtr(scopeChain), &exit_); masm.bind(&exit_); masm.movePtr(ImmGCPtr(scopeChain), outputReg()); RepatchLabel rejoin_; CodeOffsetJump rejoinOffset = masm.jumpWithPatch(&rejoin_); masm.bind(&rejoin_); Linker linker(masm); IonCode *code = linker.newCode(cx); if (!code) return false; rejoinOffset.fixup(&masm); exitOffset.fixup(&masm); if (ion->invalidated()) return true; CodeLocationJump rejoinJump(code, rejoinOffset); CodeLocationJump exitJump(code, exitOffset); CodeLocationJump lastJump_ = lastJump(); PatchJump(lastJump_, CodeLocationLabel(code)); PatchJump(rejoinJump, rejoinLabel()); PatchJump(exitJump, cacheLabel()); updateLastJump(exitJump); IonSpew(IonSpew_InlineCaches, "Generated BINDNAME global stub at %p", code->raw()); return true; } static inline void GenerateScopeChainGuard(MacroAssembler &masm, JSObject *scopeObj, Register scopeObjReg, Shape *shape, Label *failures) { if (scopeObj->isCall()) { // We can skip a guard on the call object if the script's bindings are // guaranteed to be immutable (and thus cannot introduce shadowing // variables). CallObject *callObj = &scopeObj->asCall(); if (!callObj->isForEval()) { JSFunction *fun = &callObj->callee(); JSScript *script = fun->script(); if (!script->funHasExtensibleScope) return; } } else if (scopeObj->isGlobal()) { // If this is the last object on the scope walk, and the property we've // found is not configurable, then we don't need a shape guard because // the shape cannot be removed. if (shape && !shape->configurable()) return; } Address shapeAddr(scopeObjReg, JSObject::offsetOfShape()); masm.branchPtr(Assembler::NotEqual, shapeAddr, ImmGCPtr(scopeObj->lastProperty()), failures); } static void GenerateScopeChainGuards(MacroAssembler &masm, JSObject *scopeChain, JSObject *holder, Register outputReg, Label *failures) { JSObject *tobj = scopeChain; // Walk up the scope chain. Note that IsCacheableScopeChain guarantees the // |tobj == holder| condition terminates the loop. while (true) { JS_ASSERT(IsCacheableNonGlobalScope(tobj) || tobj->isGlobal()); GenerateScopeChainGuard(masm, tobj, outputReg, NULL, failures); if (tobj == holder) break; // Load the next link. tobj = &tobj->asScope().enclosingScope(); masm.extractObject(Address(outputReg, ScopeObject::offsetOfEnclosingScope()), outputReg); } } bool IonCacheBindName::attachNonGlobal(JSContext *cx, IonScript *ion, JSObject *scopeChain, JSObject *holder) { JS_ASSERT(IsCacheableNonGlobalScope(scopeChain)); MacroAssembler masm; // Guard on the shape of the scope chain. RepatchLabel failures; Label nonRepatchFailures; CodeOffsetJump exitOffset = masm.branchPtrWithPatch(Assembler::NotEqual, Address(scopeChainReg(), JSObject::offsetOfShape()), ImmGCPtr(scopeChain->lastProperty()), &failures); if (holder != scopeChain) { JSObject *parent = &scopeChain->asScope().enclosingScope(); masm.extractObject(Address(scopeChainReg(), ScopeObject::offsetOfEnclosingScope()), outputReg()); GenerateScopeChainGuards(masm, parent, holder, outputReg(), &nonRepatchFailures); } else { masm.movePtr(scopeChainReg(), outputReg()); } // At this point outputReg holds the object on which the property // was found, so we're done. RepatchLabel rejoin_; CodeOffsetJump rejoinOffset = masm.jumpWithPatch(&rejoin_); masm.bind(&rejoin_); // All failures flow to here, so there is a common point to patch. masm.bind(&failures); masm.bind(&nonRepatchFailures); if (holder != scopeChain) { RepatchLabel exit_; exitOffset = masm.jumpWithPatch(&exit_); masm.bind(&exit_); } Linker linker(masm); IonCode *code = linker.newCode(cx); if (!code) return false; rejoinOffset.fixup(&masm); exitOffset.fixup(&masm); if (ion->invalidated()) return true; CodeLocationJump rejoinJump(code, rejoinOffset); CodeLocationJump exitJump(code, exitOffset); CodeLocationJump lastJump_ = lastJump(); PatchJump(lastJump_, CodeLocationLabel(code)); PatchJump(rejoinJump, rejoinLabel()); PatchJump(exitJump, cacheLabel()); updateLastJump(exitJump); IonSpew(IonSpew_InlineCaches, "Generated BINDNAME non-global stub at %p", code->raw()); return true; } static bool IsCacheableScopeChain(JSObject *scopeChain, JSObject *holder) { while (true) { if (!IsCacheableNonGlobalScope(scopeChain)) { IonSpew(IonSpew_InlineCaches, "Non-cacheable object on scope chain"); return false; } if (scopeChain == holder) return true; scopeChain = &scopeChain->asScope().enclosingScope(); if (!scopeChain) { IonSpew(IonSpew_InlineCaches, "Scope chain indirect hit"); return false; } } JS_NOT_REACHED("Shouldn't get here"); return false; } JSObject * js::ion::BindNameCache(JSContext *cx, size_t cacheIndex, HandleObject scopeChain) { AutoFlushCache afc ("BindNameCache"); IonScript *ion = GetTopIonJSScript(cx)->ionScript(); IonCacheBindName &cache = ion->getCache(cacheIndex).toBindName(); HandlePropertyName name = cache.name(); RootedObject holder(cx); if (scopeChain->isGlobal()) { holder = scopeChain; } else { if (!LookupNameWithGlobalDefault(cx, name, scopeChain, &holder)) return NULL; } // Stop generating new stubs once we hit the stub count limit, see // GetPropertyCache. if (cache.stubCount() < MAX_STUBS) { cache.incrementStubCount(); if (scopeChain->isGlobal()) { if (!cache.attachGlobal(cx, ion, scopeChain)) return NULL; } else if (IsCacheableScopeChain(scopeChain, holder)) { if (!cache.attachNonGlobal(cx, ion, scopeChain, holder)) return NULL; } else { IonSpew(IonSpew_InlineCaches, "BINDNAME uncacheable scope chain"); } } return holder; } bool IonCacheName::attach(JSContext *cx, IonScript *ion, HandleObject scopeChain, HandleObject holder, Shape *shape) { MacroAssembler masm; Label failures; Register scratchReg = outputReg().valueReg().scratchReg(); masm.mov(scopeChainReg(), scratchReg); GenerateScopeChainGuards(masm, scopeChain, holder, scratchReg, &failures); unsigned slot = shape->slot(); if (holder->isFixedSlot(slot)) { Address addr(scratchReg, JSObject::getFixedSlotOffset(slot)); masm.loadTypedOrValue(addr, outputReg()); } else { masm.loadPtr(Address(scratchReg, JSObject::offsetOfSlots()), scratchReg); Address addr(scratchReg, holder->dynamicSlotIndex(slot) * sizeof(Value)); masm.loadTypedOrValue(addr, outputReg()); } RepatchLabel rejoin; CodeOffsetJump rejoinOffset = masm.jumpWithPatch(&rejoin); masm.bind(&rejoin); CodeOffsetJump exitOffset; if (failures.used()) { masm.bind(&failures); RepatchLabel exit; exitOffset = masm.jumpWithPatch(&exit); masm.bind(&exit); } Linker linker(masm); IonCode *code = linker.newCode(cx); if (!code) return false; rejoinOffset.fixup(&masm); if (failures.bound()) exitOffset.fixup(&masm); if (ion->invalidated()) return true; CodeLocationJump rejoinJump(code, rejoinOffset); CodeLocationJump lastJump_ = lastJump(); PatchJump(lastJump_, CodeLocationLabel(code)); PatchJump(rejoinJump, rejoinLabel()); if (failures.bound()) { CodeLocationJump exitJump(code, exitOffset); PatchJump(exitJump, cacheLabel()); updateLastJump(exitJump); } IonSpew(IonSpew_InlineCaches, "Generated NAME stub at %p", code->raw()); return true; } static bool IsCacheableName(JSContext *cx, HandleObject scopeChain, HandleObject obj, HandleObject holder, HandleShape shape, jsbytecode *pc, const TypedOrValueRegister &output) { if (!shape) return false; if (!obj->isNative()) return false; if (obj != holder) return false; if (obj->isGlobal()) { // Support only simple property lookups. if (!IsCacheableGetPropReadSlot(obj, holder, shape) && !IsCacheableNoProperty(obj, holder, shape, pc, output)) return false; } else if (obj->isCall()) { if (!shape->hasDefaultGetter()) return false; } else { // We don't yet support lookups on Block or DeclEnv objects. return false; } RootedObject obj2(cx, scopeChain); while (obj2) { if (!IsCacheableNonGlobalScope(obj2) && !obj2->isGlobal()) return false; // Stop once we hit the global or target obj. if (obj2->isGlobal() || obj2 == obj) break; obj2 = obj2->enclosingScope(); } return obj == obj2; } bool js::ion::GetNameCache(JSContext *cx, size_t cacheIndex, HandleObject scopeChain, MutableHandleValue vp) { AutoFlushCache afc ("GetNameCache"); IonScript *ion = GetTopIonJSScript(cx)->ionScript(); IonCacheName &cache = ion->getCache(cacheIndex).toName(); RootedPropertyName name(cx, cache.name()); RootedScript script(cx); jsbytecode *pc; cache.getScriptedLocation(&script, &pc); RootedObject obj(cx); RootedObject holder(cx); RootedShape shape(cx); if (!LookupName(cx, name, scopeChain, &obj, &holder, &shape)) return false; if (cache.stubCount() < MAX_STUBS && IsCacheableName(cx, scopeChain, obj, holder, shape, pc, cache.outputReg())) { if (!cache.attach(cx, ion, scopeChain, obj, shape)) return false; cache.incrementStubCount(); } if (cache.isTypeOf()) { if (!FetchName<true>(cx, obj, holder, name, shape, vp)) return false; } else { if (!FetchName<false>(cx, obj, holder, name, shape, vp)) return false; } // Monitor changes to cache entry. types::TypeScript::Monitor(cx, script, pc, vp); return true; }
34.002565
117
0.630351
wilebeast
e3747249d8bc1d18aba1920d752546bc0aedd0ac
1,599
hpp
C++
components/scream/src/share/field/field_property_checks/field_upper_bound_check.hpp
ngam/scream
676f7469b9b33120cb0810c3ab8d9a214746286b
[ "BSD-3-Clause" ]
22
2018-12-12T17:44:55.000Z
2022-03-11T03:47:38.000Z
components/scream/src/share/field/field_property_checks/field_upper_bound_check.hpp
ngam/scream
676f7469b9b33120cb0810c3ab8d9a214746286b
[ "BSD-3-Clause" ]
1,440
2018-07-10T16:49:55.000Z
2022-03-31T22:41:25.000Z
components/scream/src/share/field/field_property_checks/field_upper_bound_check.hpp
ngam/scream
676f7469b9b33120cb0810c3ab8d9a214746286b
[ "BSD-3-Clause" ]
24
2018-11-12T15:43:53.000Z
2022-03-30T18:10:52.000Z
#ifndef SCREAM_FIELD_UPPER_BOUND_CHECK_HPP #define SCREAM_FIELD_UPPER_BOUND_CHECK_HPP #include "share/field/field_property_checks/field_within_interval_check.hpp" #include "ekat/util/ekat_math_utils.hpp" namespace scream { // This field property check returns true if all data in a given field are // bounded above by the given upper bound, and false if not. // It can repair a field that fails the check by clipping all unbounded values // to the upper bound. // Note: The upper bound check is a sub-class of the within interval check with // the upper bound set to the numeric limit. template<typename RealType> class FieldUpperBoundCheck: public FieldWithinIntervalCheck<RealType> { public: using const_RT = typename FieldPropertyCheck<RealType>::const_RT; // No default constructor -- we need an upper bound. FieldUpperBoundCheck () = delete; // Constructor with upper bound. By default, this property check // can repair fields that fail the check by overwriting nonpositive values // with the given upper bound. If can_repair is false, the check cannot // apply repairs to the field. explicit FieldUpperBoundCheck (const_RT upper_bound, bool can_repair = true) : FieldWithinIntervalCheck<RealType>(-std::numeric_limits<RealType>::max(), upper_bound, can_repair) { // Do Nothing } // Overrides. // The name of the field check std::string name () const override { return "Upper Bound Check of " + std::to_string(this->m_upper_bound); } }; } // namespace scream #endif // SCREAM_FIELD_UPPER_BOUND_CHECK_HPP
34.76087
110
0.74359
ngam
e3779febe31176a42fc57f1b3bd9031e6c082404
1,155
cpp
C++
Algo_Ds_Notes-master/Algo_Ds_Notes-master/Majority_Element/Majority_Element.cpp
rajatenzyme/Coding-Journey-
65a0570153b7e3393d78352e78fb2111223049f3
[ "MIT" ]
null
null
null
Algo_Ds_Notes-master/Algo_Ds_Notes-master/Majority_Element/Majority_Element.cpp
rajatenzyme/Coding-Journey-
65a0570153b7e3393d78352e78fb2111223049f3
[ "MIT" ]
null
null
null
Algo_Ds_Notes-master/Algo_Ds_Notes-master/Majority_Element/Majority_Element.cpp
rajatenzyme/Coding-Journey-
65a0570153b7e3393d78352e78fb2111223049f3
[ "MIT" ]
null
null
null
/* A majority element in an array arr of size n is an element that appears more than n/2 times. Example: N = 9, arr = {1, 2, 2, 2, 4, 2, 2, 1, 5} Majority Element = 2 as count[2] = 5 which is greater than n/2 i.e 4 */ #include<bits/stdc++.h> using namespace std; int checkMajorityElement(int arr[], int N) { map<int, int> mp; // Computing frequency of each element using Map for (int i = 0; i < N; i++) mp[arr[i]]++; map<int, int> :: iterator it; for (it = mp.begin(); it != mp.end(); it++) { if (it -> second > (N / 2)) return it -> first; } return -1; } int main() { int N; cout<<"Enter size of array:"<<endl; cin>>N; int arr[N]; cout<<"Enter elements of array:"<<endl; for (int i = 0; i < N; i++) cin>>arr[i]; int ans = checkMajorityElement(arr, N); if (ans != -1) cout<<"Majority Element is: "<<ans<<endl; else cout<<"No majority element in array"<<endl; return 0; } /* Input: N = 9 arr = {1, 2, 2, 2, 4, 2, 2, 1, 5} Output: Majority Element is: 2 Input: N = 5 arr = {1, 2, 3, 4, 5} Output: No majority element in array */
19.25
53
0.548052
rajatenzyme
e37a971eb35e30e821bbcf805c8b0f41d2501931
1,651
cpp
C++
string-test/main.cpp
tsmoreland/cpp-misc
a82b9206bafbf67b8b5bdddab54328e49dacadd6
[ "MIT" ]
null
null
null
string-test/main.cpp
tsmoreland/cpp-misc
a82b9206bafbf67b8b5bdddab54328e49dacadd6
[ "MIT" ]
null
null
null
string-test/main.cpp
tsmoreland/cpp-misc
a82b9206bafbf67b8b5bdddab54328e49dacadd6
[ "MIT" ]
null
null
null
#include <iostream> #include <string> #include <Windows.h> #include <processenv.h> #include <algorithm> #include <ranges> int main(int argc, char** argv) { if (argc < 2) { std::cout << "insufficient args\n"; } std::string const arg{argv[1]}; std::string env_path{}; env_path.reserve(2048); DWORD const size = static_cast<DWORD>(env_path.capacity() * sizeof(char)); DWORD result = GetEnvironmentVariableA(arg.c_str(), &env_path[0], size); // this works but the size of env_path is wrong so it doesn't really work, use a char[2048] and then pass that to a string if (0 != result) { std::cout << "Env Path: (" << result << ") " << env_path << "\n"; } else { std::cout << "Failed: (" << result << ") - " << GetLastError() << "\n"; } std::cout << std::flush; char buffer[2048]; result = GetEnvironmentVariableA(arg.c_str(), buffer, sizeof buffer); if (0 != result) { env_path = {buffer, result}; std::cout << "Env Path: (" << result << ") " << env_path.c_str() << "\n"; std::cout << "transformed: \n"; auto upper = env_path | std::views::transform([](char const& ch) { return static_cast<char>(toupper(ch)); }); for (char const& ch : upper) { std::cout << ch; } std::cout << "\n"; auto match = std::ranges::find(upper, ';'); if (match != upper.end()) { std::cout << "found ;, now to attempt a split string\n"; } } else { std::cout << "Failed: (" << result << ") - " << GetLastError() << "\n"; } std::cout << std::flush; return 0; }
31.75
126
0.540279
tsmoreland
e37c905fe4d4832904103614d131bce6ec4073b7
14,808
cpp
C++
src/tools.cpp
teamclouday/VkSelfLearn
da9ee713cedcbf9a7f6bb3ae8c8340817b56e2a1
[ "MIT" ]
null
null
null
src/tools.cpp
teamclouday/VkSelfLearn
da9ee713cedcbf9a7f6bb3ae8c8340817b56e2a1
[ "MIT" ]
null
null
null
src/tools.cpp
teamclouday/VkSelfLearn
da9ee713cedcbf9a7f6bb3ae8c8340817b56e2a1
[ "MIT" ]
null
null
null
#include "tools.hpp" extern GLOB_VARS globVar; bool isDeviceSuitable(VkPhysicalDevice device) { QueueFamilyIndices indices = findQueueFamilies(device); bool indiceComplete = indices.graphicsFamilyFound && indices.presentFamilyFound; bool extensionSupport = checkDeviceExtensionSupport(device); bool swapChainSupport = false; if(extensionSupport) { SwapChainSupportDetails swapChainDetails = querySwapChainSupport(device); swapChainSupport = !swapChainDetails.formats.empty() && !swapChainDetails.presentModes.empty(); } return indiceComplete && extensionSupport && swapChainSupport; } bool checkDeviceExtensionSupport(VkPhysicalDevice device) { uint32_t extensionCount = 0; vkEnumerateDeviceExtensionProperties(device, nullptr, &extensionCount, nullptr); std::vector<VkExtensionProperties> availableExtensions(extensionCount); vkEnumerateDeviceExtensionProperties(device, nullptr, &extensionCount, availableExtensions.data()); std::set<std::string> requiredExtensions(globVar.myDeviceExtensions.begin(), globVar.myDeviceExtensions.end()); for(std::vector<VkExtensionProperties>::iterator iter = availableExtensions.begin(); iter != availableExtensions.end(); iter++) { requiredExtensions.erase(iter->extensionName); } return requiredExtensions.empty(); } QueueFamilyIndices findQueueFamilies(VkPhysicalDevice device) { QueueFamilyIndices indices; uint32_t queueFamilyCount = 0; vkGetPhysicalDeviceQueueFamilyProperties(device, &queueFamilyCount, nullptr); std::vector<VkQueueFamilyProperties> queueFamilies(queueFamilyCount); vkGetPhysicalDeviceQueueFamilyProperties(device, &queueFamilyCount, queueFamilies.data()); uint32_t i = 0; for(std::vector<VkQueueFamilyProperties>::iterator iter = queueFamilies.begin(); iter != queueFamilies.end(); iter++) { // find one that support graphics queue if(iter->queueCount > 0 && iter->queueFlags & VK_QUEUE_GRAPHICS_BIT) { indices.graphicsFamily = i; indices.graphicsFamilyFound = true; } // find one that support present queue VkBool32 presentSupport = false; vkGetPhysicalDeviceSurfaceSupportKHR(device, i, globVar.myVkSurface, &presentSupport); if(iter->queueCount > 0 && presentSupport) { indices.presentFamily = i; indices.presentFamilyFound = true; } if(indices.graphicsFamilyFound && indices.presentFamilyFound) break; i++; } return indices; } SwapChainSupportDetails querySwapChainSupport(VkPhysicalDevice device) { SwapChainSupportDetails details; vkGetPhysicalDeviceSurfaceCapabilitiesKHR(device, globVar.myVkSurface, &details.capabilities); uint32_t formatCount = 0; vkGetPhysicalDeviceSurfaceFormatsKHR(device, globVar.myVkSurface, &formatCount, nullptr); if(formatCount) { details.formats.resize(formatCount); vkGetPhysicalDeviceSurfaceFormatsKHR(device, globVar.myVkSurface, &formatCount, details.formats.data()); } uint32_t presentModeCount = 0; vkGetPhysicalDeviceSurfacePresentModesKHR(device, globVar.myVkSurface, &presentModeCount, nullptr); if(presentModeCount) { details.presentModes.resize(presentModeCount); vkGetPhysicalDeviceSurfacePresentModesKHR(device, globVar.myVkSurface, &presentModeCount, details.presentModes.data()); } return details; } VkSurfaceFormatKHR chooseSwapSurfaceFormat(std::vector<VkSurfaceFormatKHR>& availableFormats) { for(std::vector<VkSurfaceFormatKHR>::iterator iter = availableFormats.begin(); iter != availableFormats.end(); iter++) { if(iter->format == VK_FORMAT_B8G8R8A8_UNORM && iter->colorSpace == VK_COLOR_SPACE_SRGB_NONLINEAR_KHR) { return *iter; } } return availableFormats[0]; } VkPresentModeKHR chooseSwapPresentMode(std::vector<VkPresentModeKHR>& availablePresentModes) { for(std::vector<VkPresentModeKHR>::iterator iter = availablePresentModes.begin(); iter != availablePresentModes.end(); iter++) { if(*iter == VK_PRESENT_MODE_MAILBOX_KHR) return *iter; } return VK_PRESENT_MODE_FIFO_KHR; } VkExtent2D chooseSwapExtent(VkSurfaceCapabilitiesKHR& capabilities) { if(capabilities.currentExtent.width != UINT32_MAX) return capabilities.currentExtent; VkExtent2D actualExtent = {WINDOW_W, WINDOW_H}; actualExtent.width = std::max(capabilities.minImageExtent.width, std::min(capabilities.maxImageExtent.width, actualExtent.width)); actualExtent.height = std::max(capabilities.minImageExtent.height, std::min(capabilities.maxImageExtent.height, actualExtent.height)); return actualExtent; } std::vector<char> readCompiledShader(const std::string& filename) { std::ifstream file(filename, std::ios::ate | std::ios::binary); if(!file.is_open()) { printf("Failed to open file: %s\n", filename.c_str()); return {}; } size_t fileSize = (size_t)file.tellg(); std::vector<char> buffer(fileSize); file.seekg(0); file.read(buffer.data(), fileSize); file.close(); return buffer; } VkShaderModule createShaderModule(const std::vector<char>& code) { VkShaderModuleCreateInfo createInfo = {}; createInfo.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO; createInfo.codeSize = code.size(); createInfo.pCode = reinterpret_cast<const uint32_t*>(code.data()); VkShaderModule shaderModule; if(vkCreateShaderModule(globVar.myVkLogicalDevice, &createInfo, nullptr, &shaderModule) != VK_SUCCESS) { printf("Error creating shader module\n"); return nullptr; } return shaderModule; } bool createGraphicsPipeline() { // Create Render Pass VkAttachmentDescription colorAttachment = {}; colorAttachment.format = globVar.myVkSwapChainFormat; colorAttachment.samples = VK_SAMPLE_COUNT_1_BIT; colorAttachment.loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR; colorAttachment.storeOp = VK_ATTACHMENT_STORE_OP_STORE; colorAttachment.stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE; colorAttachment.stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE; colorAttachment.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED; colorAttachment.finalLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR; VkAttachmentReference colorAttachmentRef = {}; colorAttachmentRef.attachment = 0; colorAttachmentRef.layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL; VkSubpassDescription subpass = {}; subpass.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS; subpass.colorAttachmentCount = 1; subpass.pColorAttachments = &colorAttachmentRef; VkSubpassDependency dependency = {}; dependency.srcSubpass = VK_SUBPASS_EXTERNAL; dependency.dstSubpass = 0; dependency.srcStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT; dependency.srcAccessMask = 0; dependency.dstStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT; dependency.dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT; VkRenderPassCreateInfo renderPassInfo = {}; renderPassInfo.sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO; renderPassInfo.attachmentCount = 1; renderPassInfo.pAttachments = &colorAttachment; renderPassInfo.subpassCount = 1; renderPassInfo.pSubpasses = &subpass; renderPassInfo.dependencyCount = 1; renderPassInfo.pDependencies = &dependency; if(vkCreateRenderPass(globVar.myVkLogicalDevice, &renderPassInfo, nullptr, &globVar.myVkRenderPass) != VK_SUCCESS) { printf("Failed to create Vulkan Render Pass\n"); return false; } std::vector<char> vertShaderCode = readCompiledShader(MY_ROOT_DIR + std::string("/shaders/basic/vert.spv")); std::vector<char> fragShaderCode = readCompiledShader(MY_ROOT_DIR + std::string("/shaders/basic/frag.spv")); if(vertShaderCode.empty() || fragShaderCode.empty()) return false; VkShaderModule vertShaderModule = createShaderModule(vertShaderCode); VkShaderModule fragShaderModule = createShaderModule(fragShaderCode); if(!vertShaderModule || !fragShaderModule) return false; VkPipelineShaderStageCreateInfo vertShaderStageInfo = {}; vertShaderStageInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO; vertShaderStageInfo.stage = VK_SHADER_STAGE_VERTEX_BIT; vertShaderStageInfo.module = vertShaderModule; vertShaderStageInfo.pName = "main"; // specifiy entry point function VkPipelineShaderStageCreateInfo fragShaderStageInfo = {}; fragShaderStageInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO; fragShaderStageInfo.stage = VK_SHADER_STAGE_FRAGMENT_BIT; fragShaderStageInfo.module = fragShaderModule; fragShaderStageInfo.pName = "main"; VkPipelineShaderStageCreateInfo shaderStages[] = {vertShaderStageInfo, fragShaderStageInfo}; // Set Vertex Shader Input VkPipelineVertexInputStateCreateInfo vertexInputInfo = {}; vertexInputInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO; vertexInputInfo.vertexBindingDescriptionCount = 0; vertexInputInfo.pVertexBindingDescriptions = nullptr; vertexInputInfo.vertexAttributeDescriptionCount = 0; vertexInputInfo.pVertexAttributeDescriptions = nullptr; // Set Input Assembly VkPipelineInputAssemblyStateCreateInfo inputAssembly = {}; inputAssembly.sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO; inputAssembly.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST; inputAssembly.primitiveRestartEnable = VK_FALSE; // Set Viewports and Scissors VkViewport viewport = {}; viewport.x = 0.0f; viewport.y = 0.0f; viewport.width = (float)globVar.myVkSwapChainExtent.width; viewport.height = (float)globVar.myVkSwapChainExtent.height; viewport.minDepth = 0.0f; viewport.maxDepth = 1.0f; VkRect2D scissor = {}; scissor.offset = {0, 0}; scissor.extent = globVar.myVkSwapChainExtent; VkPipelineViewportStateCreateInfo viewportState = {}; viewportState.sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO; viewportState.viewportCount = 1; viewportState.pViewports = &viewport; viewportState.scissorCount = 1; viewportState.pScissors = &scissor; // Setup Rasterizer VkPipelineRasterizationStateCreateInfo rasterizer = {}; rasterizer.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO; rasterizer.depthClampEnable = VK_FALSE; rasterizer.rasterizerDiscardEnable = VK_FALSE; rasterizer.polygonMode = VK_POLYGON_MODE_FILL; rasterizer.lineWidth = 1.0f; rasterizer.cullMode = VK_CULL_MODE_BACK_BIT; rasterizer.frontFace = VK_FRONT_FACE_CLOCKWISE; rasterizer.depthBiasEnable = VK_FALSE; rasterizer.depthBiasConstantFactor = 0.0f; rasterizer.depthBiasClamp = 0.0f; rasterizer.depthBiasSlopeFactor = 0.0f; VkPipelineMultisampleStateCreateInfo multisampling = {}; multisampling.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO; multisampling.sampleShadingEnable = VK_FALSE; multisampling.rasterizationSamples = VK_SAMPLE_COUNT_1_BIT; multisampling.minSampleShading = 1.0f; multisampling.pSampleMask = nullptr; multisampling.alphaToCoverageEnable = VK_FALSE; multisampling.alphaToOneEnable = VK_FALSE; VkPipelineColorBlendAttachmentState colorBlendAttachment = {}; colorBlendAttachment.colorWriteMask = VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_A_BIT; colorBlendAttachment.blendEnable = VK_FALSE; colorBlendAttachment.srcColorBlendFactor = VK_BLEND_FACTOR_ONE; colorBlendAttachment.dstColorBlendFactor = VK_BLEND_FACTOR_ZERO; colorBlendAttachment.colorBlendOp = VK_BLEND_OP_ADD; colorBlendAttachment.srcAlphaBlendFactor = VK_BLEND_FACTOR_ONE; colorBlendAttachment.dstAlphaBlendFactor = VK_BLEND_FACTOR_ZERO; colorBlendAttachment.alphaBlendOp = VK_BLEND_OP_ADD; VkPipelineColorBlendStateCreateInfo colorBlending = {}; colorBlending.sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO; colorBlending.logicOpEnable = VK_FALSE; colorBlending.logicOp = VK_LOGIC_OP_COPY; colorBlending.attachmentCount = 1; colorBlending.pAttachments = &colorBlendAttachment; colorBlending.blendConstants[0] = 0.0f; colorBlending.blendConstants[1] = 0.0f; colorBlending.blendConstants[2] = 0.0f; colorBlending.blendConstants[3] = 0.0f; VkDynamicState dynamicStates[] = { VK_DYNAMIC_STATE_VIEWPORT, VK_DYNAMIC_STATE_LINE_WIDTH, }; VkPipelineDynamicStateCreateInfo dynamicState = {}; dynamicState.sType = VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO; dynamicState.dynamicStateCount = 2; dynamicState.pDynamicStates = dynamicStates; VkPipelineLayoutCreateInfo pipelineLayoutInfo = {}; pipelineLayoutInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO; pipelineLayoutInfo.setLayoutCount = 0; pipelineLayoutInfo.pSetLayouts = nullptr; pipelineLayoutInfo.pushConstantRangeCount = 0; pipelineLayoutInfo.pPushConstantRanges = nullptr; if(vkCreatePipelineLayout(globVar.myVkLogicalDevice, &pipelineLayoutInfo, nullptr, &globVar.myVkPipelineLayout) != VK_SUCCESS) { printf("Failed to create Vulkan Pipeline Layout\n"); return false; } VkGraphicsPipelineCreateInfo pipelineInfo = {}; pipelineInfo.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO; pipelineInfo.stageCount = 2; pipelineInfo.pStages = shaderStages; pipelineInfo.pVertexInputState = &vertexInputInfo; pipelineInfo.pInputAssemblyState = &inputAssembly; pipelineInfo.pViewportState = &viewportState; pipelineInfo.pRasterizationState = &rasterizer; pipelineInfo.pMultisampleState = &multisampling; pipelineInfo.pDepthStencilState = nullptr; pipelineInfo.pColorBlendState = &colorBlending; pipelineInfo.pDynamicState = nullptr; pipelineInfo.layout = globVar.myVkPipelineLayout; pipelineInfo.renderPass = globVar.myVkRenderPass; pipelineInfo.subpass = 0; pipelineInfo.basePipelineHandle = VK_NULL_HANDLE; pipelineInfo.basePipelineIndex = -1; if(vkCreateGraphicsPipelines(globVar.myVkLogicalDevice, VK_NULL_HANDLE, 1, &pipelineInfo, nullptr, &globVar.myVkGraphicsPipeline) != VK_SUCCESS) { printf("Failed to create Vulkan Graphics Pipeline\n"); return false; } vkDestroyShaderModule(globVar.myVkLogicalDevice, fragShaderModule, nullptr); vkDestroyShaderModule(globVar.myVkLogicalDevice, vertShaderModule, nullptr); return true; }
42.188034
148
0.761345
teamclouday
e37d586f11df6440712c0b38140276ac072d136c
3,799
cpp
C++
17_2_FEB17/MAKETRI.cpp
parthlathiya/Codechef_Submissions
d404129e4a59c4df10eace61541f48263c32480c
[ "MIT" ]
null
null
null
17_2_FEB17/MAKETRI.cpp
parthlathiya/Codechef_Submissions
d404129e4a59c4df10eace61541f48263c32480c
[ "MIT" ]
null
null
null
17_2_FEB17/MAKETRI.cpp
parthlathiya/Codechef_Submissions
d404129e4a59c4df10eace61541f48263c32480c
[ "MIT" ]
null
null
null
#include <bits/stdc++.h> using namespace std; #define forall(i,a,b) for(int i=a;i<b;i++) #define miN(a,b) ( (a) < (b) ? (a) : (b)) #define maX(a,b) ( (a) > (b) ? (a) : (b)) #define ll long long int #define llu long long unsigned #define mod 1000000007 struct inte { ll s; ll e; }; bool mf1(ll i,ll j){return i<j;} bool mf2(inte i,inte j){return i.s<j.s;} int main() { #ifndef ONLINE_JUDGE freopen("MAKETRI_in.txt","r",stdin); #endif ll N,L,R; cin>>N>>L>>R; ll i; ll a[N]; forall(i,0,N) cin >> a[i]; sort(a,a+N,mf1); // forall(i,0,N) // cout << a[i]; // ll startp[N-1]; // ll endp[N-1]; // ll magic=0; // forall(i,0,N-1) // { // sp=a[i+1]-a[i]+1; // ep=a[i+1]+a[i]-1; // if(i==0) // { // startp[magic]=sp; // endp[magic]=ep; // magic++; // } // else // { // if(sp<=startp[magic-1]) // { // startp[magic-1]=sp; // endp[magic-1]=ep; // } // else if(sp>startp[magic-1] && sp<endp[magic-1]) // endp[magic-1]=ep; // else // { // startp[magic]=sp; // endp[magic]=ep; // magic++; // } // } // // } // // ll ans=0; // forall(i,L,R+1) // { // forall(j,0,N-1) // { // if(i>=startp[j] && i<=endp[j]) // { // ans++; // break; // } // } // } // cout << ans << endl; inte inter[N-1]; forall(i,0,N-1) { inter[i].s=a[i+1]-a[i]+1; inter[i].e=a[i+1]+a[i]-1; } // forall(i,0,N-1) // cout << "d"<<inter[i].s<<"l "<<inter[i].e<< endl; sort(inter,inter+N-1,mf2); // forall(i,0,N-1) // cout << "d"<<inter[i].s<<"l "<<inter[i].e<< endl; stack<inte> ss; ss.push(inter[0]); forall(i,1,N-1) { if((ss.top()).e>=inter[i].s) { inte temp=ss.top(); temp.e=maX(temp.e,inter[i].e); ss.pop(); ss.push(temp); } else ss.push(inter[i]); } ll ans=0; while(!ss.empty()) { inte tt=ss.top(); // cout<<tt.s<<" "<<tt.e<<endl; // cout<<L<<" "<<R<<endl; // if(tt.s<=L) // { // // if(tt.e>=L && tt.e<=R) // ans+=tt.e-L+1; // else if(tt.e>R) // ans+=R-L+1; // } // else if(tt.s<=R) // { // // if(tt.e>=L && tt.e<=R) // ans+=tt.e-tt.s+1; // else if(tt.e>R) // ans+=R-tt.s+1; // } ll start=maX(tt.s,L); ll end=miN(tt.e,R); if(start<=end) ans+=end-start+1; ss.pop(); } // ll ans=0; // forall(i,L,R+1) // { // for(int j=N-1;j>=0;j--) // { // if(i>=startp[j] && i<=endp[j]) // { // //cout << endp[j] << i << endl; // // ans= ans + miN(endp[j],R) - i + 1; // i=miN(endp[j],R); // //cout << ans << i << endl; // break; // } // } // } cout << ans << endl; return 0; }
21.833333
65
0.304817
parthlathiya
be6b6527f236cafe21149bc0329c3881d6c0c9c2
864
cpp
C++
EasyCppTest/BsonSerializer.cpp
Thalhammer/EasyCpp
6b9886fecf0aa363eaf03741426fd3462306c211
[ "MIT" ]
3
2018-02-06T05:12:41.000Z
2020-05-12T20:57:32.000Z
EasyCppTest/BsonSerializer.cpp
Thalhammer/EasyCpp
6b9886fecf0aa363eaf03741426fd3462306c211
[ "MIT" ]
41
2016-07-11T12:19:10.000Z
2017-08-08T07:43:12.000Z
EasyCppTest/BsonSerializer.cpp
Thalhammer/EasyCpp
6b9886fecf0aa363eaf03741426fd3462306c211
[ "MIT" ]
2
2019-08-02T10:24:36.000Z
2020-09-11T01:45:12.000Z
#include <gtest/gtest.h> #include <Serialize/BsonSerializer.h> using namespace EasyCpp; namespace EasyCppTest { TEST(BsonSerializer, BuildDocument) { Bundle b; b.set("hello", "world"); Serialize::BsonSerializer bson; auto result = bson.serialize(b); ASSERT_EQ(result.size(), 22); ASSERT_EQ(result, std::string({ 0x16,0x00,0x00,0x00,0x02,'h','e','l','l','o',0x00,0x06,0x00,0x00,0x00,'w','o','r','l','d',0x00,0x00 })); } TEST(BsonSerializer, ReadDocument) { std::string doc({ 0x16,0x00,0x00,0x00,0x02,'h','e','l','l','o',0x00,0x06,0x00,0x00,0x00,'w','o','r','l','d',0x00,0x00 }); Serialize::BsonSerializer bson; auto b = bson.deserialize(doc).as<Bundle>(); ASSERT_FALSE(b.isEmpty()); ASSERT_TRUE(b.isSet("hello")); ASSERT_TRUE(b.get("hello").isType<std::string>()); ASSERT_EQ(b.get<std::string>("hello"), std::string("world")); } }
30.857143
138
0.662037
Thalhammer
be6c4eaf37d60ba75fab79da7107d6dc40176665
1,330
cpp
C++
Hackerrank/Algorithms/Implementation/emas_supercomputer.cpp
ritwik1503/Competitive-Coding-1
ffefe5f8b299c623af1ef01bf024af339401de0b
[ "MIT" ]
29
2016-09-02T04:48:59.000Z
2016-09-08T18:13:05.000Z
Hackerrank/Algorithms/Implementation/emas_supercomputer.cpp
ritwik1503/Competitive-Coding-1
ffefe5f8b299c623af1ef01bf024af339401de0b
[ "MIT" ]
2
2016-09-02T05:20:02.000Z
2016-10-13T06:31:31.000Z
Hackerrank/Algorithms/Implementation/emas_supercomputer.cpp
ritwik1503/Competitive-Coding-1
ffefe5f8b299c623af1ef01bf024af339401de0b
[ "MIT" ]
7
2017-04-01T20:07:03.000Z
2020-10-16T12:28:54.000Z
#include "bits/stdc++.h" using namespace std; # define MOD 1000000007 int main() { int i,j,k,l,m,n,r=0,c=0,ans=0; scanf("%d %d",&n,&m); char a[20][20]; for(i=0;i<n;i++){ for(j=0;j<m;j++){ scanf(" %c",&a[i][j]); } } for (int x = 1; x <= n; x++) { for (int y = 1;y <= m; y++){ int r = 0; while (a[x + r][y] == 'G' && a[x - r][y] == 'G' && a[x][y + r] == 'G' && a[x][y - r] == 'G') { a[x + r][y] = a[x - r][y] = a[x][y + r] = a[x][y - r] = 'g'; for (int X = 1; X <= n; X++) { for (int Y = 1; Y <= m; Y++){ int R = 0; while (a[X + R][Y] == 'G' && a[X - R][Y] == 'G' && a[X][Y + R] == 'G' && a[X][Y - R] == 'G') { ans = max(ans, (1 + 4 * r) * (1 + 4 * R)); R++; } } } r++; } r = 0; while (a[x + r][y] == 'g' && a[x - r][y] == 'g' && a[x][y + r] == 'g' && a[x][y - r] == 'g') { a[x + r][y] = a[x - r][y] = a[x][y + r] = a[x][y - r] = 'G'; r++; } } } printf("%d\n",ans ); return 0; }
27.708333
76
0.240602
ritwik1503
be7344d2191bacb706b24cdc4ce662ada7cefe20
33,709
cc
C++
test/service_recorder_test.cc
epgdatacapbon/mirakc-arib
f50851ac1869599e95dcbefe115624b95e8274de
[ "Apache-2.0", "MIT" ]
null
null
null
test/service_recorder_test.cc
epgdatacapbon/mirakc-arib
f50851ac1869599e95dcbefe115624b95e8274de
[ "Apache-2.0", "MIT" ]
null
null
null
test/service_recorder_test.cc
epgdatacapbon/mirakc-arib
f50851ac1869599e95dcbefe115624b95e8274de
[ "Apache-2.0", "MIT" ]
null
null
null
#include <memory> #include <gmock/gmock.h> #include <gtest/gtest.h> #include <tsduck/tsduck.h> #include "ring_file_sink.hh" #include "service_recorder.hh" #include "test_helper.hh" namespace { constexpr size_t kNumBuffers = 2; constexpr size_t kNumChunks = 2; constexpr size_t kChunkSize = RingFileSink::kBufferSize * kNumBuffers; constexpr uint64_t kRingSize = kChunkSize * kNumChunks; const ServiceRecorderOption kOption { "/dev/null", 3, kChunkSize, kNumChunks }; } TEST(ServiceRecorderTest, NoPacket) { ServiceRecorderOption option = kOption; MockSource src; auto file = std::make_unique<MockFile>(); auto json_sink = std::make_unique<MockJsonlSink>(); { testing::InSequence seq; EXPECT_CALL(*json_sink, HandleDocument) .WillOnce([](const rapidjson::Document& doc) { EXPECT_EQ( R"({"type":"start"})", MockJsonlSink::Stringify(doc)); return true; }); EXPECT_CALL(*json_sink, HandleDocument) .WillOnce([](const rapidjson::Document& doc) { EXPECT_EQ( R"({"type":"stop","data":{"reset":false}})", MockJsonlSink::Stringify(doc)); return true; }); } EXPECT_CALL(src, GetNextPacket).WillOnce(testing::Return(false)); // EOF auto ring = std::make_unique<RingFileSink>( std::move(file), option.chunk_size, option.num_chunks); auto recorder = std::make_unique<ServiceRecorder>(kOption); recorder->ServiceRecorder::Connect(std::move(ring)); recorder->JsonlSource::Connect(std::move(json_sink)); src.Connect(std::move(recorder)); EXPECT_TRUE(src.FeedPackets()); } TEST(ServiceRecorderTest, EventStart) { ServiceRecorderOption option = kOption; TableSource src; auto file = std::make_unique<MockFile>(); auto json_sink = std::make_unique<MockJsonlSink>(); // TDT tables are used for emulating PES and PCR packets. src.LoadXml(R"( <?xml version="1.0" encoding="utf-8"?> <tsduck> <PAT version="1" current="true" transport_stream_id="0x0002" test-pid="0x0000"> <service service_id="0x0003" program_map_PID="0x0101" /> </PAT> <PMT version="1" current="true" service_id="0x0003" PCR_PID="0x901" test-pid="0x0101"> <component elementary_PID="0x0301" stream_type="0x02" /> </PMT> <TOT UTC_time="2021-01-01 00:00:00" test-pid="0x0014" /> <TDT UTC_time="1970-01-01 00:00:00" test-pid="0x0901" test-pcr="0" /> <EIT type="pf" version="1" current="true" actual="true" service_id="0x0003" transport_stream_id="0x0002" original_network_id="0x0001" last_table_id="0x4E" test-pid="0x0012"> <event event_id="4" start_time="2021-01-01 00:00:00" duration="00:00:01" running_status="undefined" CA_mode="true" /> <event event_id="5" start_time="2021-01-01 00:00:01" duration="01:00:00" running_status="undefined" CA_mode="true" /> </EIT> <TDT UTC_time="1970-01-01 00:00:00" test-pid="0x0301" /> </tsduck> )"); { testing::InSequence seq; EXPECT_CALL(*json_sink, HandleDocument) .WillOnce([](const rapidjson::Document& doc) { EXPECT_EQ( R"({"type":"start"})", MockJsonlSink::Stringify(doc)); return true; }); EXPECT_CALL(*json_sink, HandleDocument) .WillOnce([](const rapidjson::Document& doc) { EXPECT_EQ( R"({"type":"chunk","data":{"chunk":{)" R"("timestamp":1609426800000,"pos":0)" R"(}}})", MockJsonlSink::Stringify(doc)); return true; }); EXPECT_CALL(*json_sink, HandleDocument) .WillOnce([](const rapidjson::Document& doc) { EXPECT_EQ( R"({"type":"event-start","data":{)" R"("originalNetworkId":1,)" R"("transportStreamId":2,)" R"("serviceId":3,)" R"("event":{)" R"("eventId":4,)" R"("startTime":1609426800000,)" R"("duration":1000,)" R"("scrambled":true,)" R"("descriptors":[])" R"(},)" R"("record":{)" R"("timestamp":1609426800000,)" R"("pos":0)" R"(})" R"(}})", MockJsonlSink::Stringify(doc)); return true; }); EXPECT_CALL(*json_sink, HandleDocument) .WillOnce([](const rapidjson::Document& doc) { EXPECT_EQ( R"({"type":"stop","data":{"reset":false}})", MockJsonlSink::Stringify(doc)); return true; }); } EXPECT_CALL(*file, Write).WillRepeatedly(testing::Return(RingFileSink::kBufferSize)); EXPECT_CALL(*file, Sync).WillRepeatedly(testing::Return(true)); EXPECT_CALL(*file, Trunc).WillRepeatedly(testing::Return(true)); EXPECT_CALL(*file, Seek).WillRepeatedly(testing::Return(0)); auto ring = std::make_unique<RingFileSink>( std::move(file), option.chunk_size, option.num_chunks); auto recorder = std::make_unique<ServiceRecorder>(kOption); recorder->ServiceRecorder::Connect(std::move(ring)); recorder->JsonlSource::Connect(std::move(json_sink)); src.Connect(std::move(recorder)); EXPECT_TRUE(src.FeedPackets()); EXPECT_TRUE(src.IsEmpty()); } TEST(ServiceRecorderTest, EventProgress) { ServiceRecorderOption option = kOption; TableSource src; auto ring_sink = std::make_unique<MockRingSink>(option.chunk_size, option.num_chunks); auto json_sink = std::make_unique<MockJsonlSink>(); // TDT tables are used for emulating PES and PCR packets. src.LoadXml(R"( <?xml version="1.0" encoding="utf-8"?> <tsduck> <PAT version="1" current="true" transport_stream_id="0x0002" test-pid="0x0000"> <service service_id="0x0003" program_map_PID="0x0101" /> </PAT> <PMT version="1" current="true" service_id="0x0003" PCR_PID="0x901" test-pid="0x0101"> <component elementary_PID="0x0301" stream_type="0x02" /> </PMT> <TOT UTC_time="2021-01-01 00:00:00" test-pid="0x0014" /> <TDT UTC_time="1970-01-01 00:00:00" test-pid="0x0901" test-pcr="0" /> <EIT type="pf" version="1" current="true" actual="true" service_id="0x0003" transport_stream_id="0x0002" original_network_id="0x0001" last_table_id="0x4E" test-pid="0x0012"> <event event_id="4" start_time="2021-01-01 00:00:00" duration="00:00:01" running_status="undefined" CA_mode="true" /> <event event_id="5" start_time="2021-01-01 00:00:01" duration="01:00:00" running_status="undefined" CA_mode="true" /> </EIT> <TDT UTC_time="1970-01-01 00:00:00" test-pid="0x0FFD" /> <TDT UTC_time="1970-01-01 00:00:00" test-pid="0x0301" /> </tsduck> )"); { testing::InSequence seq; EXPECT_CALL(*ring_sink, Start) .WillOnce(testing::Return(true)); EXPECT_CALL(*json_sink, HandleDocument) .WillOnce([](const rapidjson::Document& doc) { EXPECT_EQ( R"({"type":"start"})", MockJsonlSink::Stringify(doc)); return true; }); EXPECT_CALL(*json_sink, HandleDocument) .WillOnce([](const rapidjson::Document& doc) { EXPECT_EQ( R"({"type":"chunk","data":{"chunk":{)" R"("timestamp":1609426800000,"pos":0)" R"(}}})", MockJsonlSink::Stringify(doc)); return true; }); EXPECT_CALL(*json_sink, HandleDocument) .WillOnce([](const rapidjson::Document& doc) { EXPECT_EQ( R"({"type":"event-start","data":{)" R"("originalNetworkId":1,)" R"("transportStreamId":2,)" R"("serviceId":3,)" R"("event":{)" R"("eventId":4,)" R"("startTime":1609426800000,)" R"("duration":1000,)" R"("scrambled":true,)" R"("descriptors":[])" R"(},)" R"("record":{)" R"("timestamp":1609426800000,)" R"("pos":0)" R"(})" R"(}})", MockJsonlSink::Stringify(doc)); return true; }); EXPECT_CALL(*json_sink, HandleDocument) .WillOnce([](const rapidjson::Document& doc) { EXPECT_EQ( R"({"type":"event-update","data":{)" R"("originalNetworkId":1,)" R"("transportStreamId":2,)" R"("serviceId":3,)" R"("event":{)" R"("eventId":4,)" R"("startTime":1609426800000,)" R"("duration":1000,)" R"("scrambled":true,)" R"("descriptors":[])" R"(},)" R"("record":{)" R"("timestamp":1609426800000,)" R"("pos":16384)" R"(})" R"(}})", MockJsonlSink::Stringify(doc)); return true; }); EXPECT_CALL(*json_sink, HandleDocument) .WillOnce([](const rapidjson::Document& doc) { EXPECT_EQ( R"({"type":"chunk","data":{"chunk":{)" R"("timestamp":1609426800000,"pos":16384)" R"(}}})", MockJsonlSink::Stringify(doc)); return true; }); EXPECT_CALL(*json_sink, HandleDocument) .WillOnce([](const rapidjson::Document& doc) { EXPECT_EQ( R"({"type":"event-update","data":{)" R"("originalNetworkId":1,)" R"("transportStreamId":2,)" R"("serviceId":3,)" R"("event":{)" R"("eventId":4,)" R"("startTime":1609426800000,)" R"("duration":1000,)" R"("scrambled":true,)" R"("descriptors":[])" R"(},)" R"("record":{)" R"("timestamp":1609426800000,)" R"("pos":0)" R"(})" R"(}})", MockJsonlSink::Stringify(doc)); return true; }); EXPECT_CALL(*json_sink, HandleDocument) .WillOnce([](const rapidjson::Document& doc) { EXPECT_EQ( R"({"type":"chunk","data":{"chunk":{)" R"("timestamp":1609426800000,"pos":0)" R"(}}})", MockJsonlSink::Stringify(doc)); return true; }); EXPECT_CALL(*ring_sink, End) .WillOnce(testing::Return(true)); EXPECT_CALL(*json_sink, HandleDocument) .WillOnce([](const rapidjson::Document& doc) { EXPECT_EQ( R"({"type":"stop","data":{"reset":false}})", MockJsonlSink::Stringify(doc)); return true; }); } auto recorder = std::make_unique<ServiceRecorder>(kOption); recorder->ServiceRecorder::Connect(std::move(ring_sink)); recorder->JsonlSource::Connect(std::move(json_sink)); src.Connect(std::move(recorder)); EXPECT_TRUE(src.FeedPackets()); EXPECT_TRUE(src.IsEmpty()); } TEST(ServiceRecorderTest, EventEnd) { ServiceRecorderOption option = kOption; TableSource src; auto file = std::make_unique<MockFile>(); auto json_sink = std::make_unique<MockJsonlSink>(); // TDT tables are used for emulating PES and PCR packets. src.LoadXml(R"( <?xml version="1.0" encoding="utf-8"?> <tsduck> <PAT version="1" current="true" transport_stream_id="0x0002" test-pid="0x0000"> <service service_id="0x0003" program_map_PID="0x0101" /> </PAT> <PMT version="1" current="true" service_id="0x0003" PCR_PID="0x901" test-pid="0x0101"> <component elementary_PID="0x0301" stream_type="0x02" /> </PMT> <TOT UTC_time="2021-01-01 00:00:00" test-pid="0x0014" /> <TDT UTC_time="1970-01-01 00:00:00" test-pid="0x0901" test-pcr="0" /> <EIT type="pf" version="1" current="true" actual="true" service_id="0x0003" transport_stream_id="0x0002" original_network_id="0x0001" last_table_id="0x4E" test-pid="0x0012"> <event event_id="4" start_time="2021-01-01 00:00:00" duration="00:00:01" running_status="undefined" CA_mode="true" /> <event event_id="5" start_time="2021-01-01 00:00:01" duration="00:00:01" running_status="undefined" CA_mode="true" /> </EIT> <TDT UTC_time="1970-01-01 00:00:00" test-pid="0x0901" test-pcr="1" /> <TDT UTC_time="1970-01-01 00:00:00" test-pid="0x0301" /> <TDT UTC_time="1970-01-01 00:00:00" test-pid="0x0901" test-pcr="27000000" /> <EIT type="pf" version="2" current="true" actual="true" service_id="0x0003" transport_stream_id="0x0002" original_network_id="0x0001" last_table_id="0x4E" test-pid="0x0012" test-cc="1"> <event event_id="5" start_time="2021-01-01 00:00:01" duration="00:00:01" running_status="undefined" CA_mode="true" /> <event event_id="6" start_time="2021-01-01 00:00:02" duration="00:00:01" running_status="undefined" CA_mode="true" /> </EIT> </tsduck> )"); { testing::InSequence seq; EXPECT_CALL(*json_sink, HandleDocument) .WillOnce([](const rapidjson::Document& doc) { EXPECT_EQ( R"({"type":"start"})", MockJsonlSink::Stringify(doc)); return true; }); EXPECT_CALL(*json_sink, HandleDocument) .WillOnce([](const rapidjson::Document& doc) { EXPECT_EQ( R"({"type":"chunk","data":{"chunk":{)" R"("timestamp":1609426800000,"pos":0)" R"(}}})", MockJsonlSink::Stringify(doc)); return true; }); EXPECT_CALL(*json_sink, HandleDocument) .WillOnce([](const rapidjson::Document& doc) { EXPECT_EQ( R"({"type":"event-start","data":{)" R"("originalNetworkId":1,)" R"("transportStreamId":2,)" R"("serviceId":3,)" R"("event":{)" R"("eventId":4,)" R"("startTime":1609426800000,)" R"("duration":1000,)" R"("scrambled":true,)" R"("descriptors":[])" R"(},)" R"("record":{)" R"("timestamp":1609426800000,)" R"("pos":0)" R"(})" R"(}})", MockJsonlSink::Stringify(doc)); return true; }); EXPECT_CALL(*json_sink, HandleDocument) .WillOnce([](const rapidjson::Document& doc) { EXPECT_EQ( R"({"type":"event-end","data":{)" R"("originalNetworkId":1,)" R"("transportStreamId":2,)" R"("serviceId":3,)" R"("event":{)" R"("eventId":4,)" R"("startTime":1609426800000,)" R"("duration":1000,)" R"("scrambled":true,)" R"("descriptors":[])" R"(},)" R"("record":{)" R"("timestamp":1609426801000,)" R"("pos":376)" R"(})" R"(}})", MockJsonlSink::Stringify(doc)); return true; }); EXPECT_CALL(*json_sink, HandleDocument) .WillOnce([](const rapidjson::Document& doc) { EXPECT_EQ( R"({"type":"event-start","data":{)" R"("originalNetworkId":1,)" R"("transportStreamId":2,)" R"("serviceId":3,)" R"("event":{)" R"("eventId":5,)" R"("startTime":1609426801000,)" R"("duration":1000,)" R"("scrambled":true,)" R"("descriptors":[])" R"(},)" R"("record":{)" R"("timestamp":1609426801000,)" R"("pos":376)" R"(})" R"(}})", MockJsonlSink::Stringify(doc)); return true; }); EXPECT_CALL(*json_sink, HandleDocument) .WillOnce([](const rapidjson::Document& doc) { EXPECT_EQ( R"({"type":"stop","data":{"reset":false}})", MockJsonlSink::Stringify(doc)); return true; }); } EXPECT_CALL(*file, Write).WillRepeatedly(testing::Return(RingFileSink::kBufferSize)); EXPECT_CALL(*file, Sync).WillRepeatedly(testing::Return(true)); EXPECT_CALL(*file, Trunc).WillRepeatedly(testing::Return(true)); EXPECT_CALL(*file, Seek).WillRepeatedly(testing::Return(0)); auto ring = std::make_unique<RingFileSink>( std::move(file), option.chunk_size, option.num_chunks); auto recorder = std::make_unique<ServiceRecorder>(kOption); recorder->ServiceRecorder::Connect(std::move(ring)); recorder->JsonlSource::Connect(std::move(json_sink)); src.Connect(std::move(recorder)); EXPECT_TRUE(src.FeedPackets()); EXPECT_TRUE(src.IsEmpty()); } TEST(ServiceRecorderTest, EventStartBeforeEventEnd) { ServiceRecorderOption option = kOption; TableSource src; auto file = std::make_unique<MockFile>(); auto json_sink = std::make_unique<MockJsonlSink>(); // TDT tables are used for emulating PES and PCR packets. src.LoadXml(R"( <?xml version="1.0" encoding="utf-8"?> <tsduck> <PAT version="1" current="true" transport_stream_id="0x0002" test-pid="0x0000"> <service service_id="0x0003" program_map_PID="0x0101" /> </PAT> <PMT version="1" current="true" service_id="0x0003" PCR_PID="0x901" test-pid="0x0101"> <component elementary_PID="0x0301" stream_type="0x02" /> </PMT> <TOT UTC_time="2021-01-01 00:00:00" test-pid="0x0014" /> <TDT UTC_time="1970-01-01 00:00:00" test-pid="0x0901" test-pcr="0" /> <EIT type="pf" version="1" current="true" actual="true" service_id="0x0003" transport_stream_id="0x0002" original_network_id="0x0001" last_table_id="0x4E" test-pid="0x0012"> <event event_id="4" start_time="2021-01-01 00:00:00" duration="00:00:01" running_status="undefined" CA_mode="true" /> <event event_id="5" start_time="2021-01-01 00:00:01" duration="01:00:00" running_status="undefined" CA_mode="true" /> </EIT> <TDT UTC_time="1970-01-01 00:00:00" test-pid="0x0301" /> <EIT type="pf" version="2" current="true" actual="true" service_id="0x0003" transport_stream_id="0x0002" original_network_id="0x0001" last_table_id="0x4E" test-pid="0x0012" test-cc="1"> <event event_id="6" start_time="2021-01-01 00:00:00" duration="00:00:01" running_status="undefined" CA_mode="true" /> <event event_id="7" start_time="2021-01-01 00:00:01" duration="01:00:00" running_status="undefined" CA_mode="true" /> </EIT> </tsduck> )"); { testing::InSequence seq; EXPECT_CALL(*json_sink, HandleDocument) .WillOnce([](const rapidjson::Document& doc) { EXPECT_EQ( R"({"type":"start"})", MockJsonlSink::Stringify(doc)); return true; }); EXPECT_CALL(*json_sink, HandleDocument) .WillOnce([](const rapidjson::Document& doc) { EXPECT_EQ( R"({"type":"chunk","data":{"chunk":{)" R"("timestamp":1609426800000,"pos":0)" R"(}}})", MockJsonlSink::Stringify(doc)); return true; }); EXPECT_CALL(*json_sink, HandleDocument) .WillOnce([](const rapidjson::Document& doc) { EXPECT_EQ( R"({"type":"event-start","data":{)" R"("originalNetworkId":1,)" R"("transportStreamId":2,)" R"("serviceId":3,)" R"("event":{)" R"("eventId":4,)" R"("startTime":1609426800000,)" R"("duration":1000,)" R"("scrambled":true,)" R"("descriptors":[])" R"(},)" R"("record":{)" R"("timestamp":1609426800000,)" R"("pos":0)" R"(})" R"(}})", MockJsonlSink::Stringify(doc)); return true; }); EXPECT_CALL(*json_sink, HandleDocument) .WillOnce([](const rapidjson::Document& doc) { EXPECT_EQ( R"({"type":"event-end","data":{)" R"("originalNetworkId":1,)" R"("transportStreamId":2,)" R"("serviceId":3,)" R"("event":{)" R"("eventId":4,)" R"("startTime":1609426800000,)" R"("duration":1000,)" R"("scrambled":true,)" R"("descriptors":[])" R"(},)" R"("record":{)" R"("timestamp":1609426800000,)" R"("pos":188)" R"(})" R"(}})", MockJsonlSink::Stringify(doc)); return true; }); EXPECT_CALL(*json_sink, HandleDocument) .WillOnce([](const rapidjson::Document& doc) { EXPECT_EQ( R"({"type":"event-start","data":{)" R"("originalNetworkId":1,)" R"("transportStreamId":2,)" R"("serviceId":3,)" R"("event":{)" R"("eventId":6,)" R"("startTime":1609426800000,)" R"("duration":1000,)" R"("scrambled":true,)" R"("descriptors":[])" R"(},)" R"("record":{)" R"("timestamp":1609426800000,)" R"("pos":188)" R"(})" R"(}})", MockJsonlSink::Stringify(doc)); return true; }); EXPECT_CALL(*json_sink, HandleDocument) .WillOnce([](const rapidjson::Document& doc) { EXPECT_EQ( R"({"type":"stop","data":{"reset":false}})", MockJsonlSink::Stringify(doc)); return true; }); } EXPECT_CALL(*file, Write).WillRepeatedly(testing::Return(RingFileSink::kBufferSize)); EXPECT_CALL(*file, Sync).WillRepeatedly(testing::Return(true)); EXPECT_CALL(*file, Trunc).WillRepeatedly(testing::Return(true)); EXPECT_CALL(*file, Seek).WillRepeatedly(testing::Return(0)); auto ring = std::make_unique<RingFileSink>( std::move(file), option.chunk_size, option.num_chunks); auto recorder = std::make_unique<ServiceRecorder>(kOption); recorder->ServiceRecorder::Connect(std::move(ring)); recorder->JsonlSource::Connect(std::move(json_sink)); src.Connect(std::move(recorder)); EXPECT_TRUE(src.FeedPackets()); EXPECT_TRUE(src.IsEmpty()); } TEST(ServiceRecorderTest, FirstEventAlreadyEnded) { ServiceRecorderOption option = kOption; TableSource src; auto file = std::make_unique<MockFile>(); auto json_sink = std::make_unique<MockJsonlSink>(); // TDT tables are used for emulating PES and PCR packets. src.LoadXml(R"( <?xml version="1.0" encoding="utf-8"?> <tsduck> <PAT version="1" current="true" transport_stream_id="0x0002" test-pid="0x0000"> <service service_id="0x0003" program_map_PID="0x0101" /> </PAT> <PMT version="1" current="true" service_id="0x0003" PCR_PID="0x901" test-pid="0x0101"> <component elementary_PID="0x0301" stream_type="0x02" /> </PMT> <TOT UTC_time="2021-01-01 00:00:01" test-pid="0x0014" /> <TDT UTC_time="1970-01-01 00:00:00" test-pid="0x0901" test-pcr="0" /> <EIT type="pf" version="1" current="true" actual="true" service_id="0x0003" transport_stream_id="0x0002" original_network_id="0x0001" last_table_id="0x4E" test-pid="0x0012"> <event event_id="4" start_time="2021-01-01 00:00:00" duration="00:00:01" running_status="undefined" CA_mode="true" /> <event event_id="5" start_time="2021-01-01 00:00:01" duration="00:00:01" running_status="undefined" CA_mode="true" /> </EIT> <TDT UTC_time="1970-01-01 00:00:00" test-pid="0x0301" /> <EIT type="pf" version="2" current="true" actual="true" service_id="0x0003" transport_stream_id="0x0002" original_network_id="0x0001" last_table_id="0x4E" test-pid="0x0012" test-cc="1"> <event event_id="5" start_time="2021-01-01 00:00:01" duration="00:00:01" running_status="undefined" CA_mode="true" /> <event event_id="6" start_time="2021-01-01 00:00:02" duration="00:00:01" running_status="undefined" CA_mode="true" /> </EIT> </tsduck> )"); { testing::InSequence seq; EXPECT_CALL(*json_sink, HandleDocument) .WillOnce([](const rapidjson::Document& doc) { EXPECT_EQ( R"({"type":"start"})", MockJsonlSink::Stringify(doc)); return true; }); EXPECT_CALL(*json_sink, HandleDocument) .WillOnce([](const rapidjson::Document& doc) { EXPECT_EQ( R"({"type":"chunk","data":{"chunk":{)" R"("timestamp":1609426801000,"pos":0)" R"(}}})", MockJsonlSink::Stringify(doc)); return true; }); EXPECT_CALL(*json_sink, HandleDocument) .WillOnce([](const rapidjson::Document& doc) { EXPECT_EQ( R"({"type":"event-start","data":{)" R"("originalNetworkId":1,)" R"("transportStreamId":2,)" R"("serviceId":3,)" R"("event":{)" R"("eventId":5,)" R"("startTime":1609426801000,)" R"("duration":1000,)" R"("scrambled":true,)" R"("descriptors":[])" R"(},)" R"("record":{)" R"("timestamp":1609426801000,)" R"("pos":0)" R"(})" R"(}})", MockJsonlSink::Stringify(doc)); return true; }); EXPECT_CALL(*json_sink, HandleDocument) .WillOnce([](const rapidjson::Document& doc) { EXPECT_EQ( R"({"type":"stop","data":{"reset":false}})", MockJsonlSink::Stringify(doc)); return true; }); } EXPECT_CALL(*file, Write).WillRepeatedly(testing::Return(RingFileSink::kBufferSize)); EXPECT_CALL(*file, Sync).WillRepeatedly(testing::Return(true)); EXPECT_CALL(*file, Trunc).WillRepeatedly(testing::Return(true)); EXPECT_CALL(*file, Seek).WillRepeatedly(testing::Return(0)); auto ring = std::make_unique<RingFileSink>( std::move(file), option.chunk_size, option.num_chunks); auto recorder = std::make_unique<ServiceRecorder>(kOption); recorder->ServiceRecorder::Connect(std::move(ring)); recorder->JsonlSource::Connect(std::move(json_sink)); src.Connect(std::move(recorder)); EXPECT_TRUE(src.FeedPackets()); EXPECT_TRUE(src.IsEmpty()); } TEST(ServiceRecorderTest, UnspecifiedEventEnd) { ServiceRecorderOption option = kOption; TableSource src; auto file = std::make_unique<MockFile>(); auto json_sink = std::make_unique<MockJsonlSink>(); // TDT tables are used for emulating PES and PCR packets. src.LoadXml(R"( <?xml version="1.0" encoding="utf-8"?> <tsduck> <PAT version="1" current="true" transport_stream_id="0x0002" test-pid="0x0000"> <service service_id="0x0003" program_map_PID="0x0101" /> </PAT> <PMT version="1" current="true" service_id="0x0003" PCR_PID="0x901" test-pid="0x0101"> <component elementary_PID="0x0301" stream_type="0x02" /> </PMT> <TOT UTC_time="2021-01-01 00:00:00" test-pid="0x0014" /> <TDT UTC_time="1970-01-01 00:00:00" test-pid="0x0901" test-pcr="0" /> <EIT type="pf" version="1" current="true" actual="true" service_id="0x0003" transport_stream_id="0x0002" original_network_id="0x0001" last_table_id="0x4E" test-pid="0x0012"> <event event_id="4" start_time="2021-01-01 00:00:00" duration="00:00:00" running_status="undefined" CA_mode="true" /> <event event_id="5" start_time="2021-01-01 00:00:00" duration="00:00:00" running_status="undefined" CA_mode="true" /> </EIT> <TDT UTC_time="1970-01-01 00:00:00" test-pid="0x0301" /> <TDT UTC_time="1970-01-01 00:00:00" test-pid="0x0901" test-pcr="27000000" test-cc="1" /> <TOT UTC_time="2021-01-01 00:00:01" test-pid="0x0014" test-cc="1" /> <TDT UTC_time="1970-01-01 00:00:00" test-pid="0x0301" test-cc="1" /> <EIT type="pf" version="2" current="true" actual="true" service_id="0x0003" transport_stream_id="0x0002" original_network_id="0x0001" last_table_id="0x4E" test-pid="0x0012" test-cc="1"> <event event_id="5" start_time="2021-01-01 00:00:00" duration="00:00:00" running_status="undefined" CA_mode="true" /> <event event_id="6" start_time="2021-01-01 00:00:00" duration="00:00:00" running_status="undefined" CA_mode="true" /> </EIT> </tsduck> )"); { testing::InSequence seq; EXPECT_CALL(*json_sink, HandleDocument) .WillOnce([](const rapidjson::Document& doc) { EXPECT_EQ( R"({"type":"start"})", MockJsonlSink::Stringify(doc)); return true; }); EXPECT_CALL(*json_sink, HandleDocument) .WillOnce([](const rapidjson::Document& doc) { EXPECT_EQ( R"({"type":"chunk","data":{"chunk":{)" R"("timestamp":1609426800000,"pos":0)" R"(}}})", MockJsonlSink::Stringify(doc)); return true; }); EXPECT_CALL(*json_sink, HandleDocument) .WillOnce([](const rapidjson::Document& doc) { EXPECT_EQ( R"({"type":"event-start","data":{)" R"("originalNetworkId":1,)" R"("transportStreamId":2,)" R"("serviceId":3,)" R"("event":{)" R"("eventId":4,)" R"("startTime":1609426800000,)" R"("duration":0,)" R"("scrambled":true,)" R"("descriptors":[])" R"(},)" R"("record":{)" R"("timestamp":1609426800000,)" R"("pos":0)" R"(})" R"(}})", MockJsonlSink::Stringify(doc)); return true; }); EXPECT_CALL(*json_sink, HandleDocument) .WillOnce([](const rapidjson::Document& doc) { EXPECT_EQ( R"({"type":"event-end","data":{)" R"("originalNetworkId":1,)" R"("transportStreamId":2,)" R"("serviceId":3,)" R"("event":{)" R"("eventId":4,)" R"("startTime":1609426800000,)" R"("duration":0,)" R"("scrambled":true,)" R"("descriptors":[])" R"(},)" R"("record":{)" R"("timestamp":1609426801000,)" R"("pos":752)" // 188 * 4 R"(})" R"(}})", MockJsonlSink::Stringify(doc)); return true; }); EXPECT_CALL(*json_sink, HandleDocument) .WillOnce([](const rapidjson::Document& doc) { EXPECT_EQ( R"({"type":"event-start","data":{)" R"("originalNetworkId":1,)" R"("transportStreamId":2,)" R"("serviceId":3,)" R"("event":{)" R"("eventId":5,)" R"("startTime":1609426800000,)" R"("duration":0,)" R"("scrambled":true,)" R"("descriptors":[])" R"(},)" R"("record":{)" R"("timestamp":1609426801000,)" R"("pos":752)" // 188 * 4 R"(})" R"(}})", MockJsonlSink::Stringify(doc)); return true; }); EXPECT_CALL(*json_sink, HandleDocument) .WillOnce([](const rapidjson::Document& doc) { EXPECT_EQ( R"({"type":"stop","data":{"reset":false}})", MockJsonlSink::Stringify(doc)); return true; }); } EXPECT_CALL(*file, Write).WillRepeatedly(testing::Return(RingFileSink::kBufferSize)); EXPECT_CALL(*file, Sync).WillRepeatedly(testing::Return(true)); EXPECT_CALL(*file, Trunc).WillRepeatedly(testing::Return(true)); EXPECT_CALL(*file, Seek).WillRepeatedly(testing::Return(0)); auto ring = std::make_unique<RingFileSink>( std::move(file), option.chunk_size, option.num_chunks); auto recorder = std::make_unique<ServiceRecorder>(kOption); recorder->ServiceRecorder::Connect(std::move(ring)); recorder->JsonlSource::Connect(std::move(json_sink)); src.Connect(std::move(recorder)); EXPECT_TRUE(src.FeedPackets()); EXPECT_TRUE(src.IsEmpty()); }
38.218821
88
0.531164
epgdatacapbon
be74d9f31957871c5ec0ed8e2688577af6d8c731
3,484
cpp
C++
src/core/parsing/ll1_definition_analyzer.cpp
cxc6922/vegetable_script
e6906cc7c733d217d33537d5d30a94f84f94e956
[ "MIT" ]
null
null
null
src/core/parsing/ll1_definition_analyzer.cpp
cxc6922/vegetable_script
e6906cc7c733d217d33537d5d30a94f84f94e956
[ "MIT" ]
null
null
null
src/core/parsing/ll1_definition_analyzer.cpp
cxc6922/vegetable_script
e6906cc7c733d217d33537d5d30a94f84f94e956
[ "MIT" ]
null
null
null
#include "./ll1_definition_analyzer.h" #include "./ll1_expression_analyzer.h" #include "./ll1_statement_analyzer.h" namespace vegetable_script { bool Ll1DefinitionAnalyzer::Parse(Lexer* lexer, Definition::Ptr* definition, Exception* exception) { return ParseDefinition(lexer, definition, exception); } bool Ll1DefinitionAnalyzer::ParseDefinition(Lexer* lexer, Definition::Ptr* definition, Exception* exception) { Token token; if (!lexer->LookCurrent(&token, exception)) { return false; } if (token.type == Token::Type::kKeywordFunc) { auto function_definition = std::make_shared<FunctionDefinition>(); if (!ParseFunctionDefinition(lexer, &function_definition, exception)) { return false; } *definition = function_definition; return true; } else if (token.type == Token::Type::kKeywordVar) { // return ParseVariableDefinition(lexer, definition, exception); return false; } else { *exception = { "it is not a begin of definition", token.row, token.column }; return false; } return false; } bool Ll1DefinitionAnalyzer::ParseFunctionDefinition( Lexer* lexer, FunctionDefinition::Ptr* function_definition, Exception* exception) { Token token; *function_definition = std::make_shared<FunctionDefinition>(); Ll1StatementAnalyzer statement_analyzer; if (!lexer->LookCurrent(&token, exception)) { return false; } if (token.type != Token::Type::kKeywordFunc) { *exception = { "function definition must begin with \"func\"", token.row, token.column }; return false; } lexer->MoveNext(); if (!lexer->LookCurrent(&token, exception)) { return false; } if (token.type != Token::Type::kIdentifier) { *exception = { "function name is incorrect, maybe a keyword", token.row, token.column }; return false; } (*function_definition)->name = token.string; lexer->MoveNext(); if (!lexer->LookCurrent(&token, exception)) { return false; } if (!token.MatchType({ Token::Type::kBracketSmall, Token::Type::kBracketLeft })) { *exception = { "missing \"(\"", token.row, token.column }; return false; } lexer->MoveNext(); while (true) { if (!lexer->LookCurrent(&token, exception)) { return false; } if (token.type != Token::Type::kIdentifier) { *exception = { "missing identifier of a parameter", token.row, token.column }; return false; } auto parameter = std::make_shared<VariableDefinition>(); parameter->name = token.string; (*function_definition)->parameter_list.push_back(parameter); lexer->MoveNext(); if (!lexer->LookCurrent(&token, exception)) { return false; } if (token.type == Token::Type::kOperatorComma) { lexer->MoveNext(); continue; } else if (token.MatchType({ Token::Type::kBracketRight, Token::Type::kBracketSmall })) { lexer->MoveNext(); break; } else { *exception = { "missing \")\" or \",\"", token.row, token.column }; return false; } } if (!statement_analyzer.ParseBlockStatement(lexer, &(*function_definition)->block_statement, exception)) { return false; } return true; } bool Ll1DefinitionAnalyzer::ParseVariableDefinition(Lexer* lexer, VariableDefinition::Ptr* statement, Exception* exception) { return false; } }
30.034483
124
0.641504
cxc6922
be7537cdbac94fb91e2b4b0ab7ef40b6bd78b3c4
1,643
cpp
C++
Algorithms/Dynamic Programming/The Longest Common Subsequence/solution.cpp
kitarp29/ds-algo-solutions
c06effdaec2ff014248ca399268934cd8a639b5a
[ "MIT" ]
48
2020-12-04T17:48:47.000Z
2022-02-26T17:56:52.000Z
Algorithms/Dynamic Programming/The Longest Common Subsequence/solution.cpp
kitarp29/ds-algo-solutions
c06effdaec2ff014248ca399268934cd8a639b5a
[ "MIT" ]
465
2020-12-04T02:12:56.000Z
2021-12-07T16:09:51.000Z
Algorithms/Dynamic Programming/The Longest Common Subsequence/solution.cpp
kitarp29/ds-algo-solutions
c06effdaec2ff014248ca399268934cd8a639b5a
[ "MIT" ]
199
2020-12-04T02:39:56.000Z
2021-12-07T10:10:50.000Z
#include <iostream> #include <algorithm> #include <iterator> #include <vector> using namespace std; #define N 111 // upper bound on n and m int A[N]; int B[N]; int f[N][N]; vector<int> res; //first we're going to create a table which calculates the length of the Largest Common Subsequence which is done in the main() function //we can extract the actual LCS by analyzing the f table, by simply inspecting which case we went into at any point. void reconstruct(int i, int j) { if (i == 0 || j == 0) { // LCS is the empty string. res.clear(); } else if (A[i] == B[j]) { reconstruct(i-1, j-1); res.push_back(A[i]); } else if (f[i][j] == f[i-1][j]) { reconstruct(i-1, j); } else { reconstruct(i, j-1); } } int main() { int n, m, v; cin >> n >> m; for (int i = 1; i <= n; i++) cin >> A[i]; for (int i = 1; i <= m; i++) cin >> B[i]; //f[i][j] stores the LCS of the given string till ith element in A and jth element in B for (int i = 0; i <= n; i++) { for (int j = 0; j <= m; j++) { if (i == 0 || j == 0) { f[i][j] = 0; } else if (A[i] == B[j]) { f[i][j] = 1 + f[i-1][j-1]; //each entry is exactly one more than the entry directly to its upper left. } else { f[i][j] = max(f[i-1][j], f[i][j-1]); //each entry is the larger between the entry to its left and the entry to its top. } } } //To extract the LCS, we simply call reconstruct(n, m) reconstruct(n, m); copy(res.begin(), res.end(), ostream_iterator<int>(cout, " ")); }
31
136
0.529519
kitarp29
be763134536426ecf7084093584e54cbce837787
343
hpp
C++
cpp/minsk/include/minsk/analysis/binding/nodes/expressions/unary/kind.hpp
Phytolizer/Minsk
5fb59f0d5d8cf1f0046471b91e2f5d0c41fc874c
[ "MIT" ]
null
null
null
cpp/minsk/include/minsk/analysis/binding/nodes/expressions/unary/kind.hpp
Phytolizer/Minsk
5fb59f0d5d8cf1f0046471b91e2f5d0c41fc874c
[ "MIT" ]
1
2022-03-23T03:34:48.000Z
2022-03-24T06:47:30.000Z
cpp/minsk/include/minsk/analysis/binding/nodes/expressions/unary/kind.hpp
Phytolizer/Minsk
5fb59f0d5d8cf1f0046471b91e2f5d0c41fc874c
[ "MIT" ]
null
null
null
#ifndef MINSK_ANALYSIS_BINDING_NODES_EXPRESSIONS_UNARY_KIND_HPP #define MINSK_ANALYSIS_BINDING_NODES_EXPRESSIONS_UNARY_KIND_HPP namespace minsk::analysis::binding { enum class bound_unary_operator_kind { identity, negation, logical_negation, bitwise_negation, }; } #endif // MINSK_ANALYSIS_BINDING_NODES_EXPRESSIONS_UNARY_KIND_HPP
21.4375
65
0.854227
Phytolizer
be76932b86247e733145e24159a40c3f80deeb2e
13,694
cxx
C++
graalvm/transactions/fork/narayana/blacktie/tx/src/main/cpp/HttpTxManager.cxx
nmcl/wfswarm-example-arjuna-old
c2344f4780cd59caf37dd806e492efe1973ad2ff
[ "Apache-2.0" ]
1
2019-05-23T18:19:26.000Z
2019-05-23T18:19:26.000Z
graalvm/transactions/fork/narayana/blacktie/tx/src/main/cpp/HttpTxManager.cxx
nmcl/scratch
2a068fa6eb2f14c5338a332d3b624d5c91c42c07
[ "Apache-2.0" ]
65
2016-01-24T19:44:46.000Z
2022-02-09T01:00:07.000Z
graalvm/transactions/fork/narayana/blacktie/tx/src/main/cpp/HttpTxManager.cxx
nmcl/wfswarm-example-arjuna
c2344f4780cd59caf37dd806e492efe1973ad2ff
[ "Apache-2.0" ]
1
2019-05-02T14:23:43.000Z
2019-05-02T14:23:43.000Z
/* * JBoss, Home of Professional Open Source * Copyright 2011, Red Hat, Inc., and others contributors as indicated * by the @authors tag. All rights reserved. * See the copyright.txt in the distribution for a * full listing of individual contributors. * This copyrighted material is made available to anyone wishing to use, * modify, copy, or redistribute it subject to the terms and conditions * of the GNU Lesser General Public License, v. 2.1. * This program is distributed in the hope that it will be useful, but WITHOUT A * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public License, * v.2.1 along with this distribution; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include "HttpTxManager.h" #include "HttpControl.h" #include "AtmiBrokerEnv.h" #include "apr_thread_proc.h" #include "apr_portable.h" #include "apr_strings.h" #include <stdio.h> #include <stdlib.h> #include <string.h> namespace atmibroker { namespace tx { #define BUFSZ 1024 static const char* HTTP_400 = (char *) "Bad Request"; static const char* HTTP_409 = (char *) "Conflict"; static const char* HTTP_412 = (char *) "Precondition Failed"; static const char XIDPAT[] = "/xid/"; static const char ENDPAT[] = "/terminate"; log4cxx::LoggerPtr httptxlogger(log4cxx::Logger::getLogger("TxHttpTxManager")); static char * parse_wid(HttpClient &wc, const char *s) { const char *b = strstr(s, XIDPAT); const char *e = strstr(s, ENDPAT); char *wid = 0; if (b && e && (b += sizeof (XIDPAT) - 1) < e) { wid = strndup(b, e - b); } return wid; } HttpTxManager::HttpTxManager(const char *txmUrl, const char *resUrl) : TxManager() { FTRACE(httptxlogger, "ENTER HttpTxManager constructor"); _txmUrl = strdup(txmUrl); _resUrl = strdup(resUrl); _ws = NULL; int rc = apr_pool_create(&_pool, NULL); if (rc != APR_SUCCESS) { LOG4CXX_WARN(httptxlogger, "can not create pool"); apr_pool_destroy(_pool); throw new std::exception(); } FTRACE(httptxlogger, "ENTER inst create " << this); } HttpTxManager::~HttpTxManager() { FTRACE(httptxlogger, "ENTER inst destroy " << this); if (_ws != NULL) { LOG4CXX_WARN(httptxlogger, "Close has not been called"); do_close(); } if(_pool != NULL) apr_pool_destroy(_pool); if (_txmUrl != NULL) free(_txmUrl); if (_resUrl != NULL) free(_resUrl); } TxManager* HttpTxManager::create(const char *txmUrl, const char *resUrl) { if (_instance == NULL) _instance = new HttpTxManager(txmUrl, resUrl); return _instance; } int HttpTxManager::associate_transaction(char* txn, long ttl) { FTRACE(httptxlogger, "ENTER" << txn); TxControl *tx = new HttpControl(txn, ttl, apr_os_thread_current()); int rc = tx_resume(tx, TMJOIN); if (rc != XA_OK) delete tx; return rc; } // return the transaction URL char *HttpTxManager::get_current(long* ttl) { return (char *) get_control(ttl); } void HttpTxManager::release_control(void *ctrl) { if (ctrl != NULL) free(ctrl); } TxControl* HttpTxManager::create_tx(long timeout) { HttpControl* tx = new HttpControl(timeout, apr_os_thread_current()); if (tx->start(_txmUrl) != TX_OK) { LOG4CXX_INFO(httptxlogger, "Unable to start a new txn on URI "); delete tx; return NULL; } return tx; } char *HttpTxManager::enlist(XAWrapper* resource, TxControl *tx, const char * xid) { if (guard(_isOpen) != TX_OK) return NULL; char *recUrl = NULL; HttpControl *httpTx = dynamic_cast<HttpControl*>(tx); const char *enlistUrl = httpTx->enlistUrl(); if (enlistUrl != NULL) { const char *host = _ws->get_host(); int port = _ws->get_port(); char hdr[BUFSZ]; char *hdrp[] = {hdr, 0}; const char *fmt = "Link: <http://%s:%d/xid/%s/terminate>;rel=\"%s\",<http://%s:%d/xid/%s/status>;rel=\"%s\""; http_request_info ri; (void) apr_snprintf(hdr, sizeof (hdr), fmt, host, port, xid, HttpControl::PARTICIPANT_TERMINATOR, host, port, xid, HttpControl::PARTICIPANT_RESOURCE); if (_wc.send(_pool, &ri, "POST", enlistUrl, HttpControl::POST_MEDIA_TYPE, (const char **)hdrp, NULL, 0, NULL, NULL) != 0) { LOG4CXX_DEBUG(httptxlogger, "enlist POST error"); return NULL; } const char *rurl = _wc.get_header(&ri, HttpControl::LOCATION); recUrl = (rurl == NULL ? NULL : strdup(rurl)); // for (int i = 0; i < ri.num_headers; i++) // LOG4CXX_DEBUG(httptxlogger, "Header: " << ri.http_headers[i].name << "=" << ri.http_headers[i].value); _wc.dispose(&ri); LOG4CXX_DEBUG(httptxlogger, "Enlisted with header: " << hdr); } else { LOG4CXX_WARN(httptxlogger, "Missing enlistment url for transaction " << httpTx->txnUrl()); } if (recUrl != NULL) { LOG4CXX_DEBUG(httptxlogger, "Enlisted branch " << resource->get_name() << " rec url: " << recUrl); _branches[resource->get_name()] = resource; } else { LOG4CXX_WARN(httptxlogger, "Enlistment of xid " << xid << " failed - missing recovery url"); } return recUrl; } bool HttpTxManager::recover(XAWrapper *resource) { /* * Tell the TM to complete this participant resource on the current endpoint: */ const char *host = _ws->get_host(); int port = _ws->get_port(); const char* xid = resource->get_name(); char hdr[BUFSZ]; char *hdrp[] = {hdr, 0}; const char *fmt = "Link: <http://%s:%d/xid/%s/terminate>;rel=\"%s\",<http://%s:%d/xid/%s/status>;rel=\"%s\""; http_request_info ri; (void) apr_snprintf(hdr, sizeof (hdr), fmt, host, port, xid, HttpControl::PARTICIPANT_TERMINATOR, host, port, xid, HttpControl::PARTICIPANT_RESOURCE); if (_wc.send(_pool, &ri, "PUT", resource->get_recovery_coordinator(), HttpControl::PLAIN_MEDIA_TYPE, (const char **)hdrp, NULL, 0, NULL, NULL) != 0) { LOG4CXX_INFO(httptxlogger, "recovery PUT error"); return false; } _wc.dispose(&ri); if (ri.status_code == 200) { LOG4CXX_DEBUG(httptxlogger, "recovery: told TM about participant " << resource->get_name() << " xid: " << xid); _branches.erase(resource->get_name()); return true; } else { // TODO what about the other HTTP codes // For some codes we need to periodically retry the request LOG4CXX_WARN(httptxlogger, "TM failed recovery request: " << ri.status_code << " for participant " << xid); _branches[resource->get_name()] = resource; } return false; } static apr_thread_t *thread; static apr_threadattr_t *thd_attr; static void* APR_THREAD_FUNC run_server(apr_thread_t *thd, void *data) { HttpServer* server = (HttpServer*)data; server->run(); return NULL; } int HttpTxManager::do_open(void) { char host[1025]; int port; (void) _wc.parse_url(_resUrl, host, &port); FTRACE(httptxlogger, "ENTER: opening HTTP server: host: " << host << " port: " << port << " handler: " << this); _ws = new HttpServer(host, port, _pool); _ws->add_request_handler(this); apr_threadattr_create(&thd_attr, _pool); apr_thread_create(&thread, thd_attr, run_server, (void*)_ws, _pool); if (_ws->wait_for_server_startup() == false) { LOG4CXX_WARN(httptxlogger, "http sever has not start"); } return TX_OK; } int HttpTxManager::do_close(void) { if (_ws != NULL) { FTRACE(httptxlogger, "ENTER: closing HTTP server: handler " << this); //_ws->remove(this); _ws->shutdown(); apr_status_t rv; if(thread) apr_thread_join(&rv, thread); delete _ws; _ws = NULL; } return TX_OK; } XAWrapper * HttpTxManager::locate_branch(const char * xid) { LOG4CXX_DEBUG(httptxlogger, "locating branch " << xid); for (XABranchMap::iterator iter = _branches.begin(); iter != _branches.end(); ++iter) { if ((*iter).first == xid) { return (*iter).second; } } return NULL; } static int http_printf(HttpClient &wc, http_conn_ctx *conn, const char *fmt, ...) { char buf[BUFSZ]; int len; va_list ap; va_start(ap, fmt); len = apr_vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); return wc.write(conn, buf, (size_t)len); } bool HttpTxManager::handle_request( http_conn_ctx *conn, const http_request_info *ri, const char *content, size_t len) { int code = 400; const char* codestr = HTTP_400; const char *status = ""; bool result = true; size_t plen = strlen(HttpControl::TXSTATUS); for (int i = 0; i < ri->num_headers; i++) LOG4CXX_DEBUG(httptxlogger, "\t" << ri->http_headers[i].name << "=" << ri->http_headers[i].value); if (plen < len) content += plen; int stat = HttpControl::http_to_tx_status(content); if (stat != -1) { char* wid = parse_wid(_wc, ri->uri); LOG4CXX_DEBUG(httptxlogger, "looking up branch " << wid); XAWrapper* branch = locate_branch(wid); if (wid != NULL) free(wid); LOG4CXX_DEBUG(httptxlogger, "branch: 0x" << branch << " content: " << content); if (branch) { // ? TODO should this logic be moved into a subclass of XAWrapper // TODO check that all possible XA codes are being mapped correctly int res = XAER_INVAL; int how = 0; if (stat == HttpControl::PREPARED_STATUS) { res = branch->do_prepare(); switch (res) { case XA_OK: code = 200; status = HttpControl::PREPARED; break; case XA_RDONLY: code = 200; status = HttpControl::READONLY; break; case XAER_PROTO: code = 412; codestr = HTTP_412; status = HttpControl::ABORTED; break; default: status = HttpControl::ABORTED; code = 409; codestr = HTTP_409; break; } } else if (stat == HttpControl::COMMITTED_STATUS) { res = branch->do_commit(); how = 1; status = HttpControl::COMMITTED; } else if (stat == HttpControl::COMMITTED_ONE_PHASE_STATUS) { res = branch->do_commit_one_phase(); how = 1; status = HttpControl::COMMITTED; } else if (stat == HttpControl::ABORTED_STATUS) { how = 2; res = branch->do_rollback(); status = HttpControl::ABORTED; } else { LOG4CXX_DEBUG(httptxlogger, "invalid request: " << stat); code = 400; codestr = HTTP_400; status = ""; } // If the operation fails, e.g., the participant cannot be prepared, then the implementation MUST // return 409. It is implementation dependant as to whether the participant-resource or related URIs // remain valid, i.e., an implementation MAY delete the resource as a result of a failure. Depending // upon the point in the two-phase commit protocol where such a failure occurs the transaction // MUST be rolled back. If the participant is not in the correct state for the requested operation, // eg Prepare when it has been already been prepared, then the implementation MUST return 412. // If the transaction coordinator receives any response other than 200 for Prepare then the // transaction MUST rollback. if (how != 0) { switch (res) { default: LOG4CXX_DEBUG(httptxlogger, "Return 200 OK with body: " << status << " XA status: " << res); code = 200; break; case XAER_PROTO: // TODO Do all PROTO errors mean rollback for example (at least with ORACLE) // committing without preparing generates XAER_PROTO and rolls back the branch status = HttpControl::ABORTED; code = 412; codestr = HTTP_412; break; case XA_HEURHAZ: status = HttpControl::H_HAZARD; code = 409; codestr = HTTP_409; break; case XA_HEURCOM: //status = HttpControl::H_COMMIT; status = (how == 0 ? HttpControl::COMMITTED : HttpControl::H_ROLLBACK); code = 409; codestr = HTTP_409; break; case XA_HEURRB: case XA_RBROLLBACK: // these codes may be returned only if the TMONEPHASE flag was set case XA_RBCOMMFAIL: case XA_RBDEADLOCK: case XA_RBINTEGRITY: case XA_RBOTHER: case XA_RBPROTO: case XA_RBTIMEOUT: case XA_RBTRANSIENT: //status = HttpControl::H_ROLLBACK; status = (how == 0 ? HttpControl::H_ROLLBACK : HttpControl::ABORTED); code = 409; codestr = HTTP_409; break; case XA_HEURMIX: status = HttpControl::H_MIXED; code = 409; codestr = HTTP_409; break; case -999: LOG4CXX_INFO(httptxlogger, "closing connection to TM"); //_wc.close_connection(conn); result = false; status = "GARBAGE"; codestr = HTTP_409; code = res; break; case XAER_INVAL: status = ""; code = 400; codestr = HTTP_400; break; } LOG4CXX_DEBUG(httptxlogger, "completion request " << content << " XA status: " << res << " RTS status: " << status << " http status: " << code); } } } else { LOG4CXX_DEBUG(httptxlogger, "either no content (" << content << ") or prefix (" << HttpControl::TXSTATUS << ") does not match"); } LOG4CXX_DEBUG(httptxlogger, "completion request returning " << " RTS status: " << status << " http status: " << code); if (code == -999) { LOG4CXX_DEBUG(httptxlogger, "skipping response"); } else if (code == 200 || code == 409) { http_printf(_wc, conn, "HTTP/1.1 %d %s\r\n" "Content-Length: %d\r\n" "Content-Type: application/txstatus\r\n\r\n" "%s%s", 200, "OK", strlen(status), HttpControl::TXSTATUS, status); } else { http_printf(_wc, conn, "HTTP/1.1 %d %s\r\n" "Content-Length: %d\r\n" "Content-Type: application/txstatus\r\n\r\n" // "Connection: %s\r\n\r\n" // "keep-alive" or "close" "%s%s", code, codestr, strlen(status), HttpControl::TXSTATUS, status); } LOG4CXX_DEBUG(httptxlogger, "handler_request return " << result); return result; } } }
29.13617
114
0.659997
nmcl
be7a877749ef68ad816e2b0d816e9dfc2b1451ee
5,384
cpp
C++
src/ProtocolCompat.cpp
zsalab/ilms7
7b64b450fcb0999f6f3d08c004017e0c3d81aa38
[ "BSD-3-Clause" ]
null
null
null
src/ProtocolCompat.cpp
zsalab/ilms7
7b64b450fcb0999f6f3d08c004017e0c3d81aa38
[ "BSD-3-Clause" ]
null
null
null
src/ProtocolCompat.cpp
zsalab/ilms7
7b64b450fcb0999f6f3d08c004017e0c3d81aa38
[ "BSD-3-Clause" ]
null
null
null
/******************************************************************************* * Copyright (C) 2004-2011 Intel Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * - Neither the name of Intel Corporation. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL Intel Corporation. OR THE CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <arpa/inet.h> #include <netinet/in.h> #include <cerrno> #include "Protocol.h" #include "LMS_if_compat.h" #include "Lock.h" #include "ATNetworkTool.h" void Protocol::_LmeReceiveCompat(char *buffer, unsigned int len, int *status) { int error = 0; PRINT("[Compat]MEI received %d bytes (msg type 0x%02x)\n", len, buffer[0]); *status = 0; switch (buffer[0]) { case LMS_MESSAGE_TYPE_OPEN_CONNECTION_EX: { SOCKET s_new = INVALID_SOCKET; LMS_OPEN_CONNECTION_EX_MESSAGE *msg = (LMS_OPEN_CONNECTION_EX_MESSAGE *)buffer; int type; switch (msg->Protocol) { case LMS_PROTOCOL_TYPE_UDP_IPV4: type = SOCK_DGRAM; break; case LMS_PROTOCOL_TYPE_TCP_IPV4: default: type = SOCK_STREAM; break; } if ((msg->Flags & HOSTNAME_BIT) != 0) { PRINT("[Compat]Got client connection request %d for host %s, port %d\n", msg->ConnectionId, msg->Host, ntohs(msg->HostPort)); s_new = ATNetworkTool::Connect( (const char *)msg->Host, ntohs(msg->HostPort), error, PF_INET, type); } else { PRINT("[Compat]Got client connection request %d for IP %s, port %d\n", msg->ConnectionId, inet_ntoa(*((struct in_addr *)msg->Host)), ntohs(msg->HostPort)); s_new = ATNetworkTool::Connect( inet_ntoa(*((struct in_addr *)msg->Host)), ntohs(msg->HostPort), error, PF_INET, type); } if (s_new == INVALID_SOCKET) { *status = 1; break; } Channel *c = new Channel(NULL, s_new); c->SetRecipientChannel(msg->ConnectionId); c->SetStatus(Channel::OPEN); c->AddBytesTxWindow(1024); { Lock l(_channelsLock); unsigned int newChannelID = _getNewChannel(); if (newChannelID == ILLEGAL_CHANNEL) { *status = 1; PRINT("Unable to open direct allocate a new channel.\n"); return; } c->SetSenderChannel(newChannelID); _socketToChannel[msg->ConnectionId] = c; _channelToSocket[newChannelID] = msg->ConnectionId; } _signalSelect(); } break; case LMS_MESSAGE_TYPE_CLOSE_CONNECTION: { LMS_CLOSE_CONNECTION_MESSAGE *msg = (LMS_CLOSE_CONNECTION_MESSAGE *)buffer; PRINT("[Compat]received close connection msg from MEI for connection %d\n", msg->ConnectionId); Lock l(_channelsLock); SocketToChannelMap::iterator it = _socketToChannel.find(msg->ConnectionId); if (it != _socketToChannel.end()) { Channel *c = it->second; _channelToSocket.erase(c->GetSenderChannel()); _socketToChannel.erase(msg->ConnectionId); _closeMChannel(c); } } break; case LMS_MESSAGE_TYPE_SEND_DATA: { LMS_SEND_DATA_MESSAGE *msg = (LMS_SEND_DATA_MESSAGE *)buffer; Lock l(_channelsLock); SocketToChannelMap::iterator it = _socketToChannel.find(msg->ConnectionId); if (it != _socketToChannel.end()) { PRINT("[Compat]sending %d bytes from MEI connection %d to socket %d\n", ntohs(msg->DataLength), msg->ConnectionId, it->second->GetSocket()); if (-1 == _send(it->second->GetSocket(), (char *)msg->Data, ntohs(msg->DataLength), error)) { if (EPIPE == error) { Channel *c = it->second; _channelToSocket.erase(c->GetSenderChannel()); _socketToChannel.erase(msg->ConnectionId); _closeMChannel(it->second); *status = 1; } } } } break; case LMS_MESSAGE_TYPE_IP_FQDN: if (_updateIPFQDN((const char *)((LMS_IP_FQDN_MESSAGE *)buffer)->FQDN) != 0) { ERROR("[Compat]Error: failed to update IP/FQDN info\n"); } break; default: *status = 1; break; } }
31.121387
144
0.664747
zsalab
be7c81fda2431801fa41313c1d4a8df4fecbe8bd
4,066
cpp
C++
dbms/src/Storages/MergeTree/SimpleMergeSelector.cpp
rudneff/ClickHouse
3cb59b92bccbeb888d136f7c6e14b622382c0434
[ "Apache-2.0" ]
null
null
null
dbms/src/Storages/MergeTree/SimpleMergeSelector.cpp
rudneff/ClickHouse
3cb59b92bccbeb888d136f7c6e14b622382c0434
[ "Apache-2.0" ]
null
null
null
dbms/src/Storages/MergeTree/SimpleMergeSelector.cpp
rudneff/ClickHouse
3cb59b92bccbeb888d136f7c6e14b622382c0434
[ "Apache-2.0" ]
null
null
null
#include <DB/Storages/MergeTree/SimpleMergeSelector.h> #include <DB/Common/interpolate.h> #include <cmath> namespace DB { namespace { /** Estimates best set of parts to merge within passed alternatives. */ struct Estimator { using Iterator = SimpleMergeSelector::PartsInPartition::const_iterator; void consider(Iterator begin, Iterator end, size_t sum_size, size_t size_next_at_left, size_t size_next_at_right) { double current_score = score(end - begin, sum_size); if (size_next_at_left > sum_size * 0.9) { double difference = std::abs(log2(static_cast<double>(sum_size) / size_next_at_left)); if (difference < 0.5) current_score *= 0.75 + difference * 0.5; } if (size_next_at_right == 0) current_score *= 0.9; if (size_next_at_right > sum_size * 0.9) { double difference = std::abs(log2(static_cast<double>(sum_size) / size_next_at_right)); if (difference < 0.5) current_score *= 0.75 + difference * 0.5; } if (!min_score || current_score < min_score) { min_score = current_score; best_begin = begin; best_end = end; } } SimpleMergeSelector::PartsInPartition getBest() { return SimpleMergeSelector::PartsInPartition(best_begin, best_end); } static double score(double count, double sum_size) { /** Consider we have two alternative ranges of data parts to merge. * Assume time to merge a range is proportional to sum size of its parts. * * Cost of query execution is proportional to total number of data parts in a moment of time. * Let define our target: to minimize average (in time) total number of data parts. * * Let calculate integral of total number of parts, if we are going to do merge of one or another range. * It must be lower, and thus we decide, what range is better to merge. * * The integral is lower iff the following formula is lower: */ return sum_size / (count - 1); } double min_score = 0; Iterator best_begin; Iterator best_end; }; void selectWithinPartition( const SimpleMergeSelector::PartsInPartition & parts, const size_t max_total_size_to_merge, const time_t current_min_part_age, Estimator & estimator, const SimpleMergeSelector::Settings & settings) { size_t parts_count = parts.size(); if (parts_count <= 1) return; double actual_base = std::max(1.0, std::min( settings.base, std::min( interpolateLinear(settings.base, 1.0, (static_cast<double>(parts_count) - settings.lower_base_after_num_parts_start) / (settings.lower_base_after_num_parts_end - settings.lower_base_after_num_parts_start)), interpolateLinear(settings.base, 1.0, (static_cast<double>(current_min_part_age) - settings.lower_base_after_seconds_start) / (settings.lower_base_after_seconds_end - settings.lower_base_after_seconds_start))))); for (size_t begin = 0; begin < parts_count; ++begin) { size_t sum_size = parts[begin].size; size_t max_size = parts[begin].size; for (size_t end = begin + 2; end <= parts_count; ++end) { if (settings.max_parts_to_merge_at_once && end - begin > settings.max_parts_to_merge_at_once) break; sum_size += parts[end - 1].size; if (parts[end - 1].size > max_size) max_size = parts[end - 1].size; if (max_total_size_to_merge && sum_size > max_total_size_to_merge) break; if (static_cast<double>(sum_size) / max_size >= actual_base) estimator.consider( parts.begin() + begin, parts.begin() + end, sum_size, begin == 0 ? 0 : parts[begin - 1].size, end == parts_count ? 0 : parts[end].size); } } } } SimpleMergeSelector::PartsInPartition SimpleMergeSelector::select( const Partitions & partitions, const size_t max_total_size_to_merge) { time_t min_age = -1; for (const auto & partition : partitions) for (const auto & part : partition) if (min_age == -1 || part.age < min_age) min_age = part.age; Estimator estimator; for (const auto & partition : partitions) selectWithinPartition(partition, max_total_size_to_merge, min_age, estimator, settings); return estimator.getBest(); } }
28.236111
126
0.715691
rudneff
be7df6dd1c4e64c658312aab616f39e541c3669d
571
hpp
C++
libs/plugin/include/sge/plugin/declare_iterator.hpp
cpreh/spacegameengine
313a1c34160b42a5135f8223ffaa3a31bc075a01
[ "BSL-1.0" ]
2
2016-01-27T13:18:14.000Z
2018-05-11T01:11:32.000Z
libs/plugin/include/sge/plugin/declare_iterator.hpp
cpreh/spacegameengine
313a1c34160b42a5135f8223ffaa3a31bc075a01
[ "BSL-1.0" ]
null
null
null
libs/plugin/include/sge/plugin/declare_iterator.hpp
cpreh/spacegameengine
313a1c34160b42a5135f8223ffaa3a31bc075a01
[ "BSL-1.0" ]
3
2018-05-11T01:11:34.000Z
2021-04-24T19:47:45.000Z
// Copyright Carl Philipp Reh 2006 - 2019. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef SGE_PLUGIN_DECLARE_ITERATOR_HPP_INCLUDED #define SGE_PLUGIN_DECLARE_ITERATOR_HPP_INCLUDED #include <sge/core/detail/export_class_declaration.hpp> #include <sge/plugin/iterator.hpp> #define SGE_PLUGIN_DECLARE_ITERATOR(plugin_type) \ extern template class SGE_CORE_DETAIL_EXPORT_CLASS_DECLARATION sge::plugin::iterator<plugin_type> #endif
35.6875
99
0.789842
cpreh
be7fb5335f3eda9c48d12d50908772b6474463c7
788
cpp
C++
2017.8.12/a.cpp
1980744819/ACM-code
a697242bc963e682e552e655e3d78527e044e854
[ "Apache-2.0" ]
null
null
null
2017.8.12/a.cpp
1980744819/ACM-code
a697242bc963e682e552e655e3d78527e044e854
[ "Apache-2.0" ]
null
null
null
2017.8.12/a.cpp
1980744819/ACM-code
a697242bc963e682e552e655e3d78527e044e854
[ "Apache-2.0" ]
null
null
null
#include<cstdio> #include<string> #include<cstring> #include<cstdlib> #include<cmath> #include<iostream> #include<algorithm> #include<vector> #include<queue> #include<map> #include<set> #include<stack> #define ll long long #define read(a) scanf("%d",&a); using namespace std; char s[1010]; int main(){ freopen("test.txt","r",stdin); int t,n; scanf("%d",&t); int ca=0; while(t--){ scanf("%s",s); int pos[26]; for(int i=0;i<26;i++) pos[i]=-1; int mini=99999999; int ans=-1; for(int i=0;i<strlen(s);i++){ int x=s[i]-'a'; if(pos[x]!=-1){ //ans=i-pos[x]; mini=min(mini,i-pos[x]); pos[x]=i; //break; } else{ pos[x]=i; } } printf("Case #%d: ",++ca); if(mini==99999999) printf("-1\n"); else printf("%d\n",mini); } return 0; }
16.416667
31
0.572335
1980744819
be86f72bd1f1212dee0c5a70f20d545ed6264096
4,366
cpp
C++
yasc/protector.cpp
ChanJLee/jni-protector
c2673e4ae8c54868f1673c511bb76d96e39dd354
[ "Apache-2.0" ]
null
null
null
yasc/protector.cpp
ChanJLee/jni-protector
c2673e4ae8c54868f1673c511bb76d96e39dd354
[ "Apache-2.0" ]
null
null
null
yasc/protector.cpp
ChanJLee/jni-protector
c2673e4ae8c54868f1673c511bb76d96e39dd354
[ "Apache-2.0" ]
1
2021-07-23T02:51:21.000Z
2021-07-23T02:51:21.000Z
#ifdef __cplusplus extern "C" { #endif const char SO_FILE_VERSION[] __attribute__((section(".bugly_version"))) = "<1.1.0>"; #ifdef __cplusplus } #endif #include <stdlib.h> #include <string.h> #include <jni.h> #include <stdio.h> #include <dirent.h> #include "protector.h" #include <sstream> #include <sys/types.h> #include <unistd.h> #include <dlfcn.h> #include "elf.h" #ifdef __cplusplus extern "C" { #endif #ifdef __cplusplus } #endif typedef void (*handle)(int); int register_all_func(JNIEnv *env); void *fetch_so(); bool is_usable_mem_info(const char *mem_info); jint JNI_OnLoad(JavaVM *vm, void *) { JNIEnv *env = NULL; if (vm->GetEnv(reinterpret_cast<void **>(&env), JNI_VERSION_1_6) != JNI_OK) { return -1; } LOGD("register func"); if (register_all_func(env) < 0) { return -1; } return JNI_VERSION_1_6; } int register_all_func(JNIEnv *env) { JNINativeMethod methods[] = { {"load", "()I", (void *)&JNI_FUNC(load)}}; int len = sizeof(methods) / sizeof(JNINativeMethod); DEFINE_REF(jclass, clazz, env, env->FindClass("com/chan/lib/Yasc")); return env->RegisterNatives(clazz, methods, len); } IMPL_FUNC(jint, load) { char *so = (char *)fetch_so(); if (so == NULL) { return ERROR_ADDRESS; } Elf32_Ehdr *header = (Elf32_Ehdr *)so; if (!IS_ELF(*header)) { LOGD("can not find so!"); return ERROR_INVALID_ELF; } LOGD("program count %d", header->e_phnum); Elf32_Phdr *it = (Elf32_Phdr *)(so + header->e_phoff); Elf32_Phdr *end = it + header->e_phnum; for (; it != end; ++it) { LOGD("programe type: %x", it->p_type); if (it->p_type == PT_LOAD) { LOGD("find first load segment"); break; } } if (it == end) { LOGD("can not find load segment"); return ERROR_INVALID_ELF; } if (it->p_memsz < sizeof(Elf32_Ehdr)) { LOGD("too small"); return ERROR_INVALID_ELF; } char *segment_start = so + it->p_paddr; char *segment_end = segment_start + it->p_memsz; LOGD("so address: 0x%x segment start 0x%x segment end 0x%x", (address)so, (address)segment_start, (address)segment_end); char *scanner = segment_end - sizeof(Elf32_Ehdr); for (; scanner > segment_start; --scanner) { if (scanner[EI_MAG0] == ELFMAG0 && scanner[EI_MAG1] == ELFMAG1 && scanner[EI_MAG2] == ELFMAG2 && scanner[EI_MAG3] == ELFMAG3) { LOGD("find payload"); break; } } if (scanner <= segment_start) { LOGD("find nothing"); return ERROR_INVALID_PAYLOAD; } return 0; } void *fetch_so() { pid_t pid = getpid(); LOGD("current pid: %d", pid); std::ostringstream maps_file_name_os; maps_file_name_os << "/proc/" << pid << "/maps"; std::string maps_file_name = maps_file_name_os.str(); FILE *maps_file = fopen(maps_file_name.c_str(), "r"); if (maps_file == NULL) { LOGI("open %s failed", maps_file_name.c_str()); return NULL; } char mem_file_line[1024]; while (fscanf(maps_file, "%[^\n]\n", mem_file_line) >= 0) { char mem_address_start_s[10] = {0}; char mem_address_end_s[10] = {0}; char mem_info[1024] = {0}; sscanf(mem_file_line, "%8[^-]-%8[^ ]%*s%*s%*s%*s%s", mem_address_start_s, mem_address_end_s, mem_info); if (!is_usable_mem_info(mem_info)) { continue; } LOGD("find so, start 0x%s end 0x%s", mem_address_start_s, mem_address_end_s); fclose(maps_file); return (void *)strtoul(mem_address_start_s, NULL, 16); } fclose(maps_file); return NULL; } bool is_usable_mem_info(const char *mem_info) { if (mem_info == NULL) { return false; } size_t mem_info_string_len = strlen(mem_info); if (mem_info_string_len == 0) { return false; } size_t dot_start_index = strlen(mem_info) - 1; for (; dot_start_index != 0; --dot_start_index) { if (mem_info[dot_start_index] == '/') { break; } } const char *suffix = mem_info + dot_start_index; return !strcmp(suffix, "/libyasc.so"); }
22.389744
124
0.579936
ChanJLee
be87cf60c0f5f5afdf4cd80fc26190f3f9fb351c
5,623
cpp
C++
config-window.cpp
kmzbrnoI/xn-lib-cpp-qt
176ef47adff3db81c745febb4c8c4d1549199762
[ "Apache-2.0" ]
null
null
null
config-window.cpp
kmzbrnoI/xn-lib-cpp-qt
176ef47adff3db81c745febb4c8c4d1549199762
[ "Apache-2.0" ]
10
2018-10-18T13:31:26.000Z
2021-02-23T20:28:16.000Z
config-window.cpp
kmzbrnoI/xn-lib-cpp-qt
176ef47adff3db81c745febb4c8c4d1549199762
[ "Apache-2.0" ]
null
null
null
#include <QSerialPortInfo> #include <QMessageBox> #include "lib-main.h" /* Implementations of GUI functions from lib-main.h */ namespace Xn { void LibMain::guiInit() { QObject::connect(form.ui.cb_interface_type, SIGNAL(currentIndexChanged(int)), this, SLOT(cb_interface_type_changed(int))); QObject::connect(form.ui.cb_serial_port, SIGNAL(currentIndexChanged(int)), this, SLOT(cb_connections_changed(int))); QObject::connect(form.ui.cb_serial_speed, SIGNAL(currentIndexChanged(int)), this, SLOT(cb_connections_changed(int))); QObject::connect(form.ui.cb_serial_flowcontrol, SIGNAL(currentIndexChanged(int)), this, SLOT(cb_connections_changed(int))); QObject::connect(form.ui.b_serial_refresh, SIGNAL(released()), this, SLOT(b_serial_refresh_handle())); QObject::connect(form.ui.b_info_update, SIGNAL(released()), this, SLOT(b_info_update_handle())); QObject::connect(form.ui.b_li_addr_set, SIGNAL(released()), this, SLOT(b_li_addr_set_handle())); this->fillConnectionsCbs(); QString text; text.asprintf("Nastavení XpressNET knihovny v%d.%d", VERSION_MAJOR, VERSION_MINOR); form.setWindowTitle(text); form.setFixedSize(form.size()); } void LibMain::cb_interface_type_changed(int arg) { this->cb_connections_changed(arg); if ((s["XN"]["port"].toString() == "auto") && (form.ui.cb_interface_type->currentText() != "uLI")) s["XN"]["port"] = ""; this->fillPortCb(); } void LibMain::cb_connections_changed(int) { if (this->gui_config_changing) return; s["XN"]["interface"] = form.ui.cb_interface_type->currentText(); s["XN"]["baudrate"] = form.ui.cb_serial_speed->currentText().toInt(); s["XN"]["flowcontrol"] = form.ui.cb_serial_flowcontrol->currentIndex(); const QString port = form.ui.cb_serial_port->currentText(); s["XN"]["port"] = (port.startsWith("Auto")) ? "auto" : port; } void LibMain::fillConnectionsCbs() { this->gui_config_changing = true; // Interface type form.ui.cb_interface_type->setCurrentText(s["XN"]["interface"].toString()); // Port this->fillPortCb(); this->gui_config_changing = true; // Speed form.ui.cb_serial_speed->clear(); bool is_item = false; const auto& baudRates = QSerialPortInfo::standardBaudRates(); for (const qint32 &br : baudRates) { form.ui.cb_serial_speed->addItem(QString::number(br)); if (br == s["XN"]["baudrate"].toInt()) is_item = true; } if (is_item) form.ui.cb_serial_speed->setCurrentText(s["XN"]["baudrate"].toString()); else form.ui.cb_serial_speed->setCurrentIndex(-1); // Flow control form.ui.cb_serial_flowcontrol->setCurrentIndex(s["XN"]["flowcontrol"].toInt()); this->gui_config_changing = false; } void LibMain::fillPortCb() { this->gui_config_changing = true; form.ui.cb_serial_port->clear(); bool is_item = false; if (form.ui.cb_interface_type->currentText() == "uLI") { form.ui.cb_serial_port->addItem("Automaticky detekovat port uLI"); if (s["XN"]["port"].toString() == "auto") { is_item = true; form.ui.cb_serial_port->setCurrentIndex(0); } } const auto& ports = QSerialPortInfo::availablePorts(); for (const QSerialPortInfo &port : ports) { form.ui.cb_serial_port->addItem(port.portName()); if (port.portName() == s["XN"]["port"].toString()) is_item = true; } if (s["XN"]["port"].toString() != "auto") { if (is_item) form.ui.cb_serial_port->setCurrentText(s["XN"]["port"].toString()); else form.ui.cb_serial_port->setCurrentIndex(-1); } this->gui_config_changing = false; } void LibMain::b_serial_refresh_handle() { this->fillPortCb(); } void LibMain::guiOnOpen() { form.ui.cb_interface_type->setEnabled(false); form.ui.cb_serial_port->setEnabled(false); form.ui.cb_serial_speed->setEnabled(false); form.ui.cb_serial_flowcontrol->setEnabled(false); form.ui.b_serial_refresh->setEnabled(false); form.ui.sb_li_addr->setEnabled(true); form.ui.b_li_addr_set->setEnabled(true); form.ui.b_info_update->setEnabled(true); } void LibMain::guiOnClose() { form.ui.cb_interface_type->setEnabled(true); form.ui.cb_serial_port->setEnabled(true); form.ui.cb_serial_speed->setEnabled(true); form.ui.cb_serial_flowcontrol->setEnabled(true); form.ui.b_serial_refresh->setEnabled(true); form.ui.l_cs_version->setText("???"); form.ui.l_cs_id->setText("???"); form.ui.l_li_version->setText("???"); form.ui.sb_li_addr->setEnabled(false); form.ui.sb_li_addr->setValue(0); form.ui.b_li_addr_set->setEnabled(false); form.ui.b_info_update->setEnabled(false); form.ui.l_info_datetime->setText("???"); } void LibMain::b_info_update_handle() { form.ui.l_cs_version->setText("???"); form.ui.l_cs_id->setText("???"); form.ui.l_li_version->setText("???"); form.ui.sb_li_addr->setValue(0); this->getLIVersion(); } void LibMain::userLiAddrSet() { QMessageBox::information(&form, "Info", "Adresa LI úspěšně změněna.", QMessageBox::Ok); } void LibMain::userLiAddrSetErr() { QMessageBox::warning(&form, "Chyba", "Nepodařilo se změnit adresu LI!", QMessageBox::Ok); } void LibMain::b_li_addr_set_handle() { int addr = form.ui.sb_li_addr->value(); QMessageBox::StandardButton reply = QMessageBox::question( &form, "Smazat?", "Skutečné změnit adresu LI na "+QString::number(addr)+"?", QMessageBox::Yes | QMessageBox::No ); if (reply != QMessageBox::Yes) return; try { xn.setLIAddress( addr, std::make_unique<Cb>([this](void *, void *) { userLiAddrSet(); }), std::make_unique<Cb>([this](void *, void *) { userLiAddrSetErr(); }) ); } catch (const QStrException &e) { userLiAddrSetErr(); } } } // namespace Xn
30.394595
99
0.699627
kmzbrnoI
be887f825a7bb0fc8afeb7845cdb25670b291458
4,320
cc
C++
m3/epoll.cc
Barkhausen-Institut/M3-musl
d57e48aa0f99349c8f6e56fdcaea4588c8e858e9
[ "MIT" ]
null
null
null
m3/epoll.cc
Barkhausen-Institut/M3-musl
d57e48aa0f99349c8f6e56fdcaea4588c8e858e9
[ "MIT" ]
null
null
null
m3/epoll.cc
Barkhausen-Institut/M3-musl
d57e48aa0f99349c8f6e56fdcaea4588c8e858e9
[ "MIT" ]
null
null
null
/* * Copyright (C) 2022 Nils Asmussen, Barkhausen Institut * * This file is part of M3 (Microkernel-based SysteM for Heterogeneous Manycores). * * M3 is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * M3 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 version 2 for more details. */ #include <base/Common.h> #include <m3/vfs/File.h> #include <m3/vfs/FileTable.h> #include <m3/vfs/Waiter.h> #include <errno.h> #include <sys/epoll.h> #include "base/time/Duration.h" #include "intern.h" constexpr size_t MAX_EPOLL_DESCS = 4; constexpr size_t MAX_EPOLL_FILES = 8; struct EPollDesc { explicit EPollDesc() : waiter(), data() { for(size_t i = 0; i < MAX_EPOLL_FILES; ++i) data[i].fd = -1; } m3::FileWaiter waiter; struct { fd_t fd; epoll_data data; } data[MAX_EPOLL_FILES]; }; static EPollDesc *descs[MAX_EPOLL_DESCS]; static EPollDesc *get_desc(int epfd) { if(epfd < m3::FileTable::MAX_FDS) return nullptr; epfd -= m3::FileTable::MAX_FDS; if(static_cast<size_t>(epfd) > MAX_EPOLL_DESCS) return nullptr; return descs[epfd]; } EXTERN_C int __m3_epoll_create(int) { for(size_t i = 0; i < MAX_EPOLL_DESCS; ++i) { if(descs[i] == nullptr) { descs[i] = new EPollDesc(); return static_cast<int>(m3::FileTable::MAX_FDS + i); } } return -ENOMEM; } EXTERN_C int __m3_epoll_ctl(int epfd, int op, int fd, struct epoll_event *event) { EPollDesc *desc = get_desc(epfd); if(!desc) return -EBADF; uint events = 0; // socket-close events (EPOLLRDHUP | EPOLLHUP) are input events if(event->events & (EPOLLIN | EPOLLRDHUP | EPOLLHUP)) events |= m3::File::INPUT; if(event->events & EPOLLOUT) events |= m3::File::OUTPUT; if(op != EPOLL_CTL_DEL) { size_t i = 0; for(; i < MAX_EPOLL_FILES; ++i) { if((op == EPOLL_CTL_MOD && desc->data[i].fd == fd) || (op == EPOLL_CTL_ADD && desc->data[i].fd == -1)) { desc->data[i].fd = fd; memcpy(&desc->data[i].data, &event->data, sizeof(epoll_data)); break; } } if(i == MAX_EPOLL_FILES) return -ENOMEM; } switch(op) { case EPOLL_CTL_ADD: desc->waiter.add(fd, events); break; case EPOLL_CTL_MOD: desc->waiter.set(fd, events); break; case EPOLL_CTL_DEL: desc->waiter.remove(fd); break; } return 0; } EXTERN_C int __m3_epoll_pwait(int epfd, struct epoll_event *events, int maxevents, int timeout, const sigset_t *) { EPollDesc *desc = get_desc(epfd); if(!desc) return -EBADF; if(timeout == -1) desc->waiter.wait(); else { // for 0 (= return immediately), we use a very short timeout to check once and count the // ready file descriptors auto m3_timeout = timeout == 0 ? m3::TimeDuration::from_nanos(1) : m3::TimeDuration::from_millis(static_cast<m3::TimeDuration::raw_t>(timeout)); desc->waiter.wait_for(m3_timeout); } int idx = 0; desc->waiter.foreach_ready([desc, events, &idx, maxevents](int fd, uint fdevs) { if(idx < maxevents) { events[idx].events = 0; if(fdevs & m3::File::INPUT) events[idx].events |= EPOLLIN; if(fdevs & m3::File::OUTPUT) events[idx].events |= EPOLLOUT; for(size_t i = 0; i < MAX_EPOLL_FILES; ++i) { if(desc->data[i].fd == fd) { memcpy(&events[idx].data, &desc->data[i].data, sizeof(epoll_data)); break; } } idx++; } }); return idx; } EXTERN_C int __m3_epoll_close(int epfd) { EPollDesc *desc = get_desc(epfd); if(!desc) return -EBADF; int idx = epfd - m3::FileTable::MAX_FDS; delete descs[idx]; descs[idx] = nullptr; return 0; }
28.993289
96
0.583102
Barkhausen-Institut
be8addff449010803fd33fbc107d3a0a7504c351
1,730
hpp
C++
apps/MatrixGenerator/TranslationObject.hpp
dekamps/miind
4b321c62c2bd27eb0d5d8336a16a9e840ba63856
[ "MIT" ]
13
2015-09-15T17:28:25.000Z
2022-03-22T20:26:47.000Z
apps/MatrixGenerator/TranslationObject.hpp
dekamps/miind
4b321c62c2bd27eb0d5d8336a16a9e840ba63856
[ "MIT" ]
41
2015-08-25T07:50:55.000Z
2022-03-21T16:20:37.000Z
apps/MatrixGenerator/TranslationObject.hpp
dekamps/miind
4b321c62c2bd27eb0d5d8336a16a9e840ba63856
[ "MIT" ]
9
2015-09-14T20:52:07.000Z
2022-03-08T12:18:18.000Z
/* * TranslationObject.hpp * * Created on: Apr 20, 2017 * Author: scsmdk */ #ifndef TRANSLATIONOBJECT_HPP_ #define TRANSLATIONOBJECT_HPP_ #include <vector> #include <iostream> #include "Coordinates.hpp" #include "Mesh.hpp" #include "pugixml.hpp" namespace TwoDLib { struct Translation { double _v; double _w; Translation():_v(0),_w(0){} Translation(double v, double w):_v(v),_w(w){} }; class TranslationObject { public: //! A translation object can either be instantiated by a double TranslationObject(double, double); //! Or by a jump file TranslationObject(std::istream&); //! Must be called before the translation list can be used. Returns false if the Mesh is incompatible with the existing information, //! e.g. as read from a jump file. bool GenerateTranslationList(const Mesh&); //! There is always an efficacy associated with a TransitionMatrix, even if the individual jumps per cell may be different. //! This efficacy is written into the matrix file and used by the framework to pick the right transition matrix Translation Efficacy() const { return _efficacy; } //! Provides access to the list of translations const std::vector< std::vector<Translation> > TranslationList () const {return _translation_list; } private: pugi::xml_document _doc; Translation EfficacyFromJumpFile(std::istream&); // this function has as a side effect that the XML document will be loaded std::vector< std::vector<Translation> > ListFromDoc(); // uses the fact that the doc has been read const double _v; const double _w; const Translation _efficacy; std::vector< std::vector<Translation> > _translation_list; }; } #endif /* TRANSLATIONOBJECT_HPP_ */
26.615385
135
0.726012
dekamps
be8decd271b23fec17ea31015c559bfd90c1b25d
4,135
cc
C++
c++-stl/random-number-engines.cc
deyuan/coding-practice
82bdf719397507601e582ab6d5693e4e50e96a3a
[ "MIT" ]
null
null
null
c++-stl/random-number-engines.cc
deyuan/coding-practice
82bdf719397507601e582ab6d5693e4e50e96a3a
[ "MIT" ]
null
null
null
c++-stl/random-number-engines.cc
deyuan/coding-practice
82bdf719397507601e582ab6d5693e4e50e96a3a
[ "MIT" ]
null
null
null
// Copyright (c) 2018 Deyuan Guo. All rights reserved. // This file is subject to the terms and conditions defined // in file 'LICENSE' in this source code package. #include <iostream> #include <random> // Engine: std::random_device // Algorithm: True-RNG if entropy() is non-zero, pseudo-RNG otherwise // Note: Non-deterministic. May throw an exception if not available void TestRandomDevice() { std::cout << "# RNG Engine Test: std::random_devide" << std::endl; std::random_device rd; std::cout << " Range: [" << rd.min() << ", " << rd.max() << "]" << std::endl; std::cout << " Entropy: " << rd.entropy() << (rd.entropy() ? " (True RNG)" : " (Pseudo RNG)") << std::endl; unsigned int randVal = rd(); std::cout << " Random Value: " << randVal << std::endl; std::cout << std::endl; } // Template for testing a pseudo random number engine template <class T> void TestPrngEngine(const std::string &name, unsigned int seed) { std::cout << "# RNG Engine Test: " << name << " (seed " << seed << ")\n"; T rng(seed); std::cout << " Range: [" << rng.min() << ", " << rng.max() << "]\n"; std::cout << " Random Values: "; std::cout << rng() << ", "; std::cout << rng() << ", "; std::cout << rng() << ", "; rng.seed(seed); // reset seed std::cout << "RESET-SEED\n"; std::cout << " Random Values: " << rng() << ", "; rng.discard(1); // discard 1 value std::cout << "DISCARDED, "; std::cout << rng() << "\n"; std::cout << std::endl; } void RandomNumberEngines() { // Note: RNG engines below generate uniformly-distributed unsigned int values // Note: Implementation-defined, true-RNG or pseudo-RNG, non-deterministic TestRandomDevice(); // Note: Implementation-defined, implemented as one PRNG engine below TestPrngEngine<std::default_random_engine>("std::default_random_engine", 0); //////////////////////////////////////////////////////////////////////////// // std::linear_congruential_engine // Algorithm: x = (a * x + c) mod m, period = m // // Engine Adaptors: // std::shuffle_order_engine: table_size k, shuffle k elements // minstd_rand: a = 48271 (prime), c = 0, m = 2^31 - 1, return uint_fast32_t TestPrngEngine<std::minstd_rand>("std::minstd_rand", 0); // minstd_rand0: a = 16807 (prime), c = 0, m = 2^31 - 1, return uint_fast32_t TestPrngEngine<std::minstd_rand0>("std::minstd_rand0", 0); // knuth_b: minstd_rand0 + shuffle_order_engine with k = 256, uint_fast32_t TestPrngEngine<std::knuth_b>("std::knuth_b", 0); //////////////////////////////////////////////////////////////////////////// // std::mersenne_twister_engine // Algorithm: word_size w, state_size n, shift_size m, mask_bits r // range = [0, 2^w - 1], period = 2^((n - 1) * w) - 1 // mt19937: (w, n, m, r) = (32, 624, 397, 31), return uint_fast32_t TestPrngEngine<std::mt19937>("std::mt19937", 0); // mt19937: (w, n, m, r) = (64, 312, 156, 31), return uint_fast64_t TestPrngEngine<std::mt19937_64>("std::mt19937_64", 0); //////////////////////////////////////////////////////////////////////////// // std::subtract_with_carry_engine // Algorithm: lagged fibonacci generator (LFG/LFib) // word_size w, short_lag s, long_lag r // // Engine Adaptors: // std::discard_block_engine: block_size p, used_block r // discard p - r elements // ranlux24_base: (w, s, r) = (24, 10, 24), return uint_fast32_t TestPrngEngine<std::ranlux24_base>("std::ranlux24_base", 0); // ranlux48_base: (w, s, r) = (48, 5, 12), return uint_fast64_t TestPrngEngine<std::ranlux48_base>("std::ranlux48_base", 0); // ranlux24_base + discard_block_engine (p, r) = (223, 23), uint_fast32_t TestPrngEngine<std::ranlux24>("std::ranlux24", 0); // ranlux48_base + discard_block_engine (p, r) = (389, 11), uint_fast64_t TestPrngEngine<std::ranlux48>("std::ranlux48", 0); //////////////////////////////////////////////////////////////////////////// // Engine Adaptors: // std::independent_bits_engine: work_size w, fixed w bits of each number } int main() { RandomNumberEngines(); return 0; }
40.539216
80
0.58549
deyuan
be9382e0028be1e8abf2be05a94625d75b012b59
1,972
cpp
C++
src/plugins/monocle/plugins/postrus/postrus.cpp
Maledictus/leechcraft
79ec64824de11780b8e8bdfd5d8a2f3514158b12
[ "BSL-1.0" ]
120
2015-01-22T14:10:39.000Z
2021-11-25T12:57:16.000Z
src/plugins/monocle/plugins/postrus/postrus.cpp
Maledictus/leechcraft
79ec64824de11780b8e8bdfd5d8a2f3514158b12
[ "BSL-1.0" ]
8
2015-02-07T19:38:19.000Z
2017-11-30T20:18:28.000Z
src/plugins/monocle/plugins/postrus/postrus.cpp
Maledictus/leechcraft
79ec64824de11780b8e8bdfd5d8a2f3514158b12
[ "BSL-1.0" ]
33
2015-02-07T16:59:55.000Z
2021-10-12T00:36:40.000Z
/********************************************************************** * LeechCraft - modular cross-platform feature rich internet client. * Copyright (C) 2006-2014 Georg Rudoy * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt) **********************************************************************/ #include "postrus.h" #include <QIcon> #include <util/sys/mimedetector.h> #include <util/util.h> #include "redirector.h" namespace LC { namespace Monocle { namespace Postrus { void Plugin::Init (ICoreProxy_ptr) { Util::InstallTranslator ("monocle_postrus"); } void Plugin::SecondInit () { } QByteArray Plugin::GetUniqueID () const { return "org.LeechCraft.Monocle.Postrus"; } void Plugin::Release () { } QString Plugin::GetName () const { return "Monocle Postrus"; } QString Plugin::GetInfo () const { return tr ("PostScript backend for Monocle."); } QIcon Plugin::GetIcon () const { return QIcon (); } QSet<QByteArray> Plugin::GetPluginClasses () const { QSet<QByteArray> result; result << "org.LeechCraft.Monocle.IBackendPlugin"; return result; } auto Plugin::CanLoadDocument (const QString& file) -> LoadCheckResult { const auto& mime = Util::MimeDetector {} (file); return mime == "application/postscript" ? LoadCheckResult::Redirect : LoadCheckResult::Cannot; } IDocument_ptr Plugin::LoadDocument (const QString&) { return {}; } IRedirectProxy_ptr Plugin::GetRedirection (const QString& filename) { return std::make_shared<Redirector> (filename); } QStringList Plugin::GetSupportedMimes () const { return { "application/postscript" }; } QList<IKnowFileExtensions::ExtInfo> Plugin::GetKnownFileExtensions () const { return { { tr ("PostScript files"), { "ps", "eps" } } }; } } } } LC_EXPORT_PLUGIN (leechcraft_monocle_postrus, LC::Monocle::Postrus::Plugin);
19.919192
83
0.646552
Maledictus
be9aea33c1dd3e5e41e625280ea311c225213135
752
cpp
C++
engine/calculators/source/RangedPhysicalDamageCalculator.cpp
sidav/shadow-of-the-wyrm
747afdeebed885b1a4f7ab42f04f9f756afd3e52
[ "MIT" ]
60
2019-08-21T04:08:41.000Z
2022-03-10T13:48:04.000Z
engine/calculators/source/RangedPhysicalDamageCalculator.cpp
cleancoindev/shadow-of-the-wyrm
51b23e98285ecb8336324bfd41ebf00f67b30389
[ "MIT" ]
3
2021-03-18T15:11:14.000Z
2021-10-20T12:13:07.000Z
engine/calculators/source/RangedPhysicalDamageCalculator.cpp
cleancoindev/shadow-of-the-wyrm
51b23e98285ecb8336324bfd41ebf00f67b30389
[ "MIT" ]
8
2019-11-16T06:29:05.000Z
2022-01-23T17:33:43.000Z
#include "RangedPhysicalDamageCalculator.hpp" RangedPhysicalDamageCalculator::RangedPhysicalDamageCalculator(const PhaseOfMoonType new_pom) : PhysicalDamageCalculator(AttackType::ATTACK_TYPE_RANGED, new_pom) { } int RangedPhysicalDamageCalculator::get_statistic_based_damage_modifier(CreaturePtr attacking_creature) { int modifier = 0; if (attacking_creature) { int current_dex = attacking_creature->get_dexterity().get_current(); if (current_dex > DAMAGE_STAT_BASELINE) { current_dex -= DAMAGE_STAT_BASELINE; modifier = current_dex / DAMAGE_STAT_DIVISOR; } } return modifier; } SkillType RangedPhysicalDamageCalculator::get_general_combat_skill() const { return SkillType::SKILL_GENERAL_ARCHERY; }
25.931034
103
0.785904
sidav
be9c5052b288578c0fc376c780e021103f05883e
285
hpp
C++
include/flexui/Layout/TextLayoutObject.hpp
mlomb/flexui
242790aa13b057e25b276b6a3df79a30735c2548
[ "MIT" ]
23
2020-12-20T01:41:56.000Z
2021-11-14T20:26:40.000Z
include/flexui/Layout/TextLayoutObject.hpp
mlomb/flexui
242790aa13b057e25b276b6a3df79a30735c2548
[ "MIT" ]
2
2020-12-23T16:29:55.000Z
2021-11-29T05:35:12.000Z
include/flexui/Layout/TextLayoutObject.hpp
mlomb/flexui
242790aa13b057e25b276b6a3df79a30735c2548
[ "MIT" ]
4
2020-12-23T16:02:25.000Z
2021-09-30T08:37:51.000Z
#pragma once #include "flexui/Layout/LayoutObject.hpp" namespace flexui { class Text; class TextLayoutObject : public LayoutObject { public: TextLayoutObject(Text* text); ~TextLayoutObject(); Text* getTextNode() const { return m_Text; } private: Text* m_Text; }; }
13.571429
47
0.708772
mlomb
be9fe7b42a35e45684e70f7b6325144722d5bcf5
967
hpp
C++
algorithms/p475/475.hpp
baishuai/leetcode_go
440ff08cf15e03ee64b3aa18370af1f75e958d18
[ "Apache-2.0" ]
9
2017-06-05T15:10:35.000Z
2021-06-08T03:10:46.000Z
algorithms/p475/475.hpp
baishuai/leetcode
440ff08cf15e03ee64b3aa18370af1f75e958d18
[ "Apache-2.0" ]
3
2017-07-12T14:08:39.000Z
2017-10-11T03:08:15.000Z
algorithms/p475/475.hpp
baishuai/leetcode_go
440ff08cf15e03ee64b3aa18370af1f75e958d18
[ "Apache-2.0" ]
1
2017-07-21T03:51:51.000Z
2017-07-21T03:51:51.000Z
#ifndef LEETCODE_475_HPP #define LEETCODE_475_HPP #include <iostream> #include <queue> #include <algorithm> #include <vector> #include <unordered_map> #include <unordered_set> #include <set> #include <numeric> #include <stack> #include <string> using namespace std; class Solution { public: int findRadius(vector<int> &houses, vector<int> &heaters) { int radius = 0; sort(heaters.begin(), heaters.end()); for (auto house : houses) { auto iter = lower_bound(heaters.begin(), heaters.end(), house); if (iter == heaters.end()) { radius = max(radius, house - heaters.back()); } else if (iter == heaters.begin()) { radius = max(radius, heaters.front() - house); } else { int r = min(*iter - house, house - *(iter - 1)); radius = max(r, radius); } } return radius; } }; #endif //LEETCODE_475_HPP
24.794872
75
0.567735
baishuai
bea22392664416aacba57e1ec2c161350ba0766a
2,751
hpp
C++
back/project2/include/ast_terminal.hpp
wht-github/CS323-Compilers
d49c8e61f17b18503504d11e0eca58b1f89997c4
[ "MIT" ]
null
null
null
back/project2/include/ast_terminal.hpp
wht-github/CS323-Compilers
d49c8e61f17b18503504d11e0eca58b1f89997c4
[ "MIT" ]
null
null
null
back/project2/include/ast_terminal.hpp
wht-github/CS323-Compilers
d49c8e61f17b18503504d11e0eca58b1f89997c4
[ "MIT" ]
null
null
null
#ifndef AST_TERMINAL_HPP #define AST_TERMINAL_HPP #include "ast.hpp" #include <string> #include <iostream> class Terminal : public Base { public: std::string symbol; Terminal(const std::string &_symbol) : symbol(_symbol) {} virtual void print(int idt = 0) const { for (int i = 0; i < idt; i++) std::cout << " "; std::cout << symbol << std::endl; } virtual void push(const Base *_base) const { std::cerr << "Can't call this function for terminal" << std::endl; (void)_base; } }; class ValInt : public Base { public: unsigned int val; ValInt(unsigned int _val) : val(_val) {} virtual void print(int idt = 0) const { for (int i = 0; i < idt; i++) std::cout << " "; std::cout << "INT: " << val << std::endl; } virtual void push(const Base *_base) const { std::cerr << "Can't call this function for int" << std::endl; (void)_base; } }; class ValFloat : public Base { public: float val; ValFloat(float _val) : val(_val) {} virtual void print(int idt = 0) const { for (int i = 0; i < idt; i++) std::cout << " "; std::cout << "FLOAT: " << val << std::endl; } virtual void push(const Base *_base) const { std::cerr << "Can't call this function for float" << std::endl; (void)_base; } }; class ValChar : public Base { public: std::string val; ValChar(std::string &_val) : val(_val) {} virtual void print(int idt = 0) const { for (int i = 0; i < idt; i++) std::cout << " "; std::cout << "CHAR: " << val << std::endl; } virtual void push(const Base *_base) const { std::cerr << "Can't call this function for char" << std::endl; (void)_base; } }; class ValType : public Base { public: std::string val; ValType(std::string &_val) : val(_val) {} virtual void print(int idt = 0) const { for (int i = 0; i < idt; i++) std::cout << " "; std::cout << "TYPE: " << val << std::endl; } virtual void push(const Base *_base) const { std::cerr << "Can't call this function for type" << std::endl; (void)_base; } }; class ValId : public Base { public: std::string val; ValId(std::string &_val) : val(_val) {} virtual void print(int idt = 0) const { for (int i = 0; i < idt; i++) std::cout << " "; std::cout << "ID: " << val << std::endl; } virtual void push(const Base *_base) const { std::cerr << "Can't call this function for identifier" << std::endl; (void)_base; } }; #endif
20.377778
76
0.519084
wht-github
bea449ef8b9f73d67cc1795b47b70625c93d379d
2,361
cpp
C++
src/common.cpp
psg-mit/leto
e39312e33a309df6dd01c70a170926aa4ecaabfb
[ "MIT" ]
null
null
null
src/common.cpp
psg-mit/leto
e39312e33a309df6dd01c70a170926aa4ecaabfb
[ "MIT" ]
null
null
null
src/common.cpp
psg-mit/leto
e39312e33a309df6dd01c70a170926aa4ecaabfb
[ "MIT" ]
null
null
null
#include "common.h" z3::expr* binop(z3::context* context, operator_t op, type_t type, z3::expr* lhs, z3::expr* rhs) { Z3_ast rm = Z3_mk_fpa_rne(*context); z3::expr *res = nullptr; switch (op) { case RPLUS: case OPLUS: switch (type) { case INT: case REAL: case UINT: res = new z3::expr(*lhs + *rhs); break; case FLOAT: { Z3_ast prim = Z3_mk_fpa_add(*context, rm, *lhs, *rhs); res = new z3::expr(z3::to_expr(*context, prim)); } break; case BOOL: assert(false); break; } break; case RMINUS: case OMINUS: switch (type) { case INT: case REAL: case UINT: res = new z3::expr(*lhs - *rhs); break; case FLOAT: { Z3_ast prim = Z3_mk_fpa_sub(*context, rm, *lhs, *rhs); res = new z3::expr(z3::to_expr(*context, prim)); } break; case BOOL: assert(false); break; } break; case RTIMES: case OTIMES: switch (type) { case INT: case REAL: case UINT: res = new z3::expr(*lhs * *rhs); break; case FLOAT: { Z3_ast prim = Z3_mk_fpa_mul(*context, rm, *lhs, *rhs); res = new z3::expr(z3::to_expr(*context, prim)); } break; case BOOL: assert(false); break; } break; case RDIV: case ODIV: switch(type) { case INT: case REAL: case UINT: res = new z3::expr(*lhs / *rhs); break; case FLOAT: { Z3_ast prim = Z3_mk_fpa_div(*context, rm, *lhs, *rhs); res = new z3::expr(z3::to_expr(*context, prim)); } break; case BOOL: assert(false); break; } break; case FREAD: case FWRITE: assert(false); break; } assert(res); return res; } z3::expr* float_val(z3::context* context, float val) { Z3_sort fl = Z3_mk_fpa_sort_single(*context); Z3_ast float_val = Z3_mk_fpa_numeral_float(*context, val, fl); return new z3::expr(z3::to_expr(*context, float_val)); }
23.147059
66
0.466751
psg-mit
bea5412932ae445664a243bc6db51fb808638852
616
hpp
C++
Code/Engine/Math/RigidBodyBucket.hpp
pronaypeddiraju/Engine
0ca9720a00f51340c6eb6bba07d70972489663e8
[ "Unlicense" ]
1
2021-01-25T23:53:44.000Z
2021-01-25T23:53:44.000Z
Code/Engine/Math/RigidBodyBucket.hpp
pronaypeddiraju/Engine
0ca9720a00f51340c6eb6bba07d70972489663e8
[ "Unlicense" ]
null
null
null
Code/Engine/Math/RigidBodyBucket.hpp
pronaypeddiraju/Engine
0ca9720a00f51340c6eb6bba07d70972489663e8
[ "Unlicense" ]
1
2021-01-25T23:53:46.000Z
2021-01-25T23:53:46.000Z
//------------------------------------------------------------------------------------------------------------------------------ #pragma once #include <vector> #include "Engine/Math/PhysicsTypes.hpp" //------------------------------------------------------------------------------------------------------------------------------ class Rigidbody2D; //------------------------------------------------------------------------------------------------------------------------------ class RigidBodyBucket { public: RigidBodyBucket(); ~RigidBodyBucket(); std::vector<Rigidbody2D*> m_RbBucket[NUM_SIMULATION_TYPES]; };
36.235294
128
0.287338
pronaypeddiraju
bea5eee63b0ceec1509be64925c74c24d88fb744
1,964
cpp
C++
toonz/sources/tnztools/inputstate.cpp
morevnaproject-org/opentoonz
3335715599092c3f173c2ffd015f09b1a0b3cb91
[ "BSD-3-Clause" ]
36
2020-05-18T22:26:35.000Z
2022-02-19T00:09:25.000Z
toonz/sources/tnztools/inputstate.cpp
morevnaproject-org/opentoonz
3335715599092c3f173c2ffd015f09b1a0b3cb91
[ "BSD-3-Clause" ]
16
2020-05-14T17:51:08.000Z
2022-02-11T01:49:38.000Z
toonz/sources/tnztools/inputstate.cpp
morevnaproject-org/opentoonz
3335715599092c3f173c2ffd015f09b1a0b3cb91
[ "BSD-3-Clause" ]
8
2020-06-12T17:01:20.000Z
2021-09-15T07:03:12.000Z
#include <tools/inputstate.h> //***************************************************************************************** // TKey static members //***************************************************************************************** const TKey TKey::shift(Qt::Key_Shift, true); const TKey TKey::control(Qt::Key_Control, true); const TKey TKey::alt(Qt::Key_Alt, true); const TKey TKey::meta(Qt::Key_Meta, true); Qt::Key TKey::mapKey(Qt::Key key) { switch (key) { case Qt::Key_AltGr: return Qt::Key_Alt; default: break; } return key; } bool TKey::isModifier(Qt::Key key) { key = mapKey(key); return key == Qt::Key_Shift || key == Qt::Key_Control || key == Qt::Key_Alt || key == Qt::Key_AltGr || key == Qt::Key_Meta; } bool TKey::isNumber(Qt::Key key) { key = mapKey(key); return key >= Qt::Key_0 && key <= Qt::Key_9; } //***************************************************************************************** // TInputState implementation //***************************************************************************************** TInputState::TInputState() : m_ticks(), m_keyHistory(new KeyHistory()) {} TInputState::~TInputState() {} void TInputState::touch(TTimerTicks ticks) { if (m_ticks < ticks) m_ticks = ticks; else ++m_ticks; } TInputState::ButtonHistory::Pointer TInputState::buttonHistory( DeviceId device) const { ButtonHistory::Pointer &history = m_buttonHistories[device]; if (!history) history = new ButtonHistory(); return history; } TInputState::ButtonState::Pointer TInputState::buttonFindAny( Button button, DeviceId &outDevice) { for (ButtonHistoryMap::const_iterator i = m_buttonHistories.begin(); i != m_buttonHistories.end(); ++i) { ButtonState::Pointer state = i->second->current()->find(button); if (state) { outDevice = i->first; return state; } } outDevice = DeviceId(); return ButtonState::Pointer(); }
28.057143
91
0.535642
morevnaproject-org
bea71ffa482ff76d6c4ef7897f0d4ce830dc5fa1
34,635
cc
C++
test/TestStratum.cc
vpashka/btcpool
dab18b2bc90b3db2fb30698fc04e7e21a06acd11
[ "MIT" ]
null
null
null
test/TestStratum.cc
vpashka/btcpool
dab18b2bc90b3db2fb30698fc04e7e21a06acd11
[ "MIT" ]
null
null
null
test/TestStratum.cc
vpashka/btcpool
dab18b2bc90b3db2fb30698fc04e7e21a06acd11
[ "MIT" ]
1
2021-11-05T08:36:28.000Z
2021-11-05T08:36:28.000Z
/* The MIT License (MIT) Copyright (c) [2016] [BTC.COM] Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "gtest/gtest.h" #include "Common.h" #include "Utils.h" #include "Stratum.h" #include "bitcoin/BitcoinUtils.h" #include "bitcoin/StratumBitcoin.h" #include "rsk/RskWork.h" #include <chainparams.h> #include <hash.h> #include <script/script.h> #include <uint256.h> #include <util.h> #ifdef INCLUDE_BTC_KEY_IO_H #include <key_io.h> // IsValidDestinationString for bch is not in this file. #endif #include <stdint.h> TEST(Stratum, jobId2Time) { uint64_t jobId; // jobId: timestamp + gbtHash // ---------- ---------- // uint32_t uint32_t // const string jobIdStr = Strings::Format("%08x%s", (uint32_t)time(nullptr), // gbtHash.ToString().substr(0, // 8).c_str()); jobId = (1469002809ull << 32) | 0x00000000FFFFFFFFull; ASSERT_EQ(jobId2Time(jobId), 1469002809u); jobId = (1469002809ull << 32) | 0x0000000000000000ull; ASSERT_EQ(jobId2Time(jobId), 1469002809u); } TEST(Stratum, Share) { ShareBitcoin s; ASSERT_EQ(s.isValid(), false); ASSERT_EQ(s.score(), 0); ASSERT_EQ( s.toString(), "share(jobId: 0, ip: 0.0.0.0, userId: 0, workerId: 0, " "time: 0/1970-01-01 00:00:00, height: 0, blkBits: 00000000/inf, " "shareDiff: 0, status: 0/Share rejected)"); IpAddress ip; ip.fromIpv4Int(htonl(167772161)); s.set_ip(ip.toString()); // 167772161 : 10.0.0.1 ASSERT_EQ( s.toString(), "share(jobId: 0, ip: 10.0.0.1, userId: 0, workerId: 0, " "time: 0/1970-01-01 00:00:00, height: 0, blkBits: 00000000/inf, " "shareDiff: 0, status: 0/Share rejected)"); } TEST(Stratum, Share2) { ShareBitcoin s; s.set_blkbits(0x1d00ffffu); s.set_sharediff(1ll); ASSERT_EQ(s.score(), 1ll); s.set_blkbits(0x18050edcu); s.set_sharediff(UINT32_MAX); // double will be: 0.0197583 ASSERT_EQ(score2Str(s.score()), "0.0197582875516673"); } TEST(Stratum, StratumWorker) { StratumWorker w; uint64_t u; int64_t workerId; ASSERT_EQ(w.getUserName("abcd"), "abcd"); ASSERT_EQ( w.getUserName("abcdabcdabcdabcdabcdabcdabcd"), "abcdabcdabcdabcdabcdabcdabcd"); ASSERT_EQ(w.getUserName("abcd."), "abcd"); ASSERT_EQ(w.getUserName("abcd.123"), "abcd"); ASSERT_EQ(w.getUserName("abcd.123.456"), "abcd"); // // echo -n '123' |openssl dgst -sha256 -binary |openssl dgst -sha256 // w.setUserIDAndNames(INT32_MAX, "abcd.123"); ASSERT_EQ(w.fullName_, "abcd.123"); ASSERT_EQ(w.userId_, INT32_MAX); ASSERT_EQ(w.userName_, "abcd"); ASSERT_EQ(w.workerName_, "123"); // '123' dsha256 : // 5a77d1e9612d350b3734f6282259b7ff0a3f87d62cfef5f35e91a5604c0490a3 // uint256 : // a390044c60a5915ef3f5fe2cd6873f0affb7592228f634370b352d61e9d1775a u = strtoull("a390044c60a5915e", nullptr, 16); memcpy((uint8_t *)&workerId, (uint8_t *)&u, 8); ASSERT_EQ(w.workerHashId_, workerId); w.setUserIDAndNames(0, "abcdefg"); ASSERT_EQ(w.fullName_, "abcdefg.__default__"); ASSERT_EQ(w.userId_, 0); ASSERT_EQ(w.userName_, "abcdefg"); ASSERT_EQ(w.workerName_, "__default__"); // '__default__' dsha256 : // e00f302bc411fde77d954283be6904911742f2ac76c8e79abef5dff4e6a19770 // uint256 : 7097a1e6f4dff5be u = strtoull("7097a1e6f4dff5be", nullptr, 16); memcpy((uint8_t *)&workerId, (uint8_t *)&u, 8); ASSERT_EQ(w.workerHashId_, workerId); // check allow chars w.setUserIDAndNames(0, "abcdefg.azAZ09-._:|^/"); ASSERT_EQ(w.workerName_, "azAZ09-._:|^/"); ASSERT_EQ(w.fullName_, "abcdefg.azAZ09-._:|^/"); // some of them are bad chars w.setUserIDAndNames(0, "abcdefg.~!@#$%^&*()+={}|[]\\<>?,./"); ASSERT_EQ(w.workerName_, "^|./"); ASSERT_EQ(w.fullName_, "abcdefg.^|./"); // all bad chars w.setUserIDAndNames(0, "abcdefg.~!@#$%&*()+={}[]\\<>?,"); ASSERT_EQ(w.workerName_, "__default__"); ASSERT_EQ(w.fullName_, "abcdefg.__default__"); } TEST(JobMaker, BitcoinAddress) { // main net SelectParams(CBaseChainParams::MAIN); ASSERT_EQ( BitcoinUtils::IsValidDestinationString( "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"), true); ASSERT_EQ( BitcoinUtils::IsValidDestinationString( "1A1zP1eP5QGefi2DMPPfTL5SLmv7DivfNa"), false); #ifdef CHAIN_TYPE_BTC ASSERT_EQ( BitcoinUtils::IsValidDestinationString( "bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4"), true); ASSERT_EQ( BitcoinUtils::IsValidDestinationString( "bc1qw508c6qejxtdg4y5r3zarvary4c5xw7kv8f3t4"), false); ASSERT_EQ( BitcoinUtils::IsValidDestinationString( "bc1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qccfmv3"), true); ASSERT_EQ( BitcoinUtils::IsValidDestinationString( "bc1qrp33g0q5c5txsp8arysrx4k6zdkfs4nde4xj0gdcccefvpysxf3qccfmv3"), false); #endif #ifdef CHAIN_TYPE_BCH ASSERT_EQ( BitcoinUtils::IsValidDestinationString( "bitcoincash:qp3wjpa3tjlj042z2wv7hahsldgwhwy0rq9sywjpyy"), true); ASSERT_EQ( BitcoinUtils::IsValidDestinationString( "bitcoincash:qp3wjpa3tjlj142z2wv7hahsldgwhwy0rq9sywjpyy"), false); #endif // test net SelectParams(CBaseChainParams::TESTNET); ASSERT_EQ( BitcoinUtils::IsValidDestinationString( "myxopLJB19oFtNBdrAxD5Z34Aw6P8o9P8U"), true); ASSERT_EQ( BitcoinUtils::IsValidDestinationString( "myxopLJB19oFtNBdrADD5Z34Aw6P8o9P8U"), false); #ifdef CHAIN_TYPE_BTC ASSERT_EQ( BitcoinUtils::IsValidDestinationString( "tb1qw508d6qejxtdg4y5r3zarvary0c5xw7kxpjzsx"), true); ASSERT_EQ( BitcoinUtils::IsValidDestinationString( "tb1qw508d6qejxtdg6y5r3zarvary0c5xw7kxpjzsx"), false); ASSERT_EQ( BitcoinUtils::IsValidDestinationString( "tb1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3q0sl5k7"), true); ASSERT_EQ( BitcoinUtils::IsValidDestinationString( "tb1qrp33g0q5c5txsp9arysrx4k6zdkgs4nce4xj0gdcccefvpysxf3q0sl5k7"), false); #endif #ifdef CHAIN_TYPE_BCH ASSERT_EQ( BitcoinUtils::IsValidDestinationString( "bchtest:qr99vqygcra4umcz374pzzz7vslrgw50ts58trd220"), true); ASSERT_EQ( BitcoinUtils::IsValidDestinationString( "bchtest:qr99vqygcra5umcz374pzzz7vslrgw50ts58trd220"), false); #endif } TEST(Stratum, StratumJobBitcoin) { StratumJobBitcoin sjob; string poolCoinbaseInfo = "/BTC.COM/"; uint32_t blockVersion = 0; bool res; { string gbt; gbt += "{\"result\":{"; gbt += " \"capabilities\": ["; gbt += " \"proposal\""; gbt += " ],"; gbt += " \"version\": 536870912,"; gbt += " \"previousblockhash\": " "\"000000004f2ea239532b2e77bb46c03b86643caac3fe92959a31fd2d03979c34\","; gbt += " \"transactions\": ["; gbt += " {"; gbt += " \"data\": " "\"01000000010291939c5ae8191c2e7d4ce8eba7d6616a66482e3200037cb8b8c2d0af" "45b445000000006a47304402204df709d9e149804e358de4b082e41d8bb21b3c9d3472" "41b728b1362aafcb153602200d06d9b6f2eca899f43dcd62ec2efb2d9ce2e10adf0273" "8bb908420d7db93ede012103cae98ab925e20dd6ae1f76e767e9e99bc47b3844095c68" "600af9c775104fb36cffffffff0290f1770b000000001976a91400dc5fd62f6ee48eb8" "ecda749eaec6824a780fdd88aca08601000000000017a914eb65573e5dd52d3d950396" "ccbe1a47daf8f400338700000000\","; gbt += " \"hash\": " "\"bd36bd4fff574b573152e7d4f64adf2bb1c9ab0080a12f8544c351f65aca79ff\","; gbt += " \"depends\": ["; gbt += " ],"; gbt += " \"fee\": 10000,"; gbt += " \"sigops\": 1"; gbt += " }"; gbt += " ],"; gbt += " \"coinbaseaux\": {"; gbt += " \"flags\": \"\""; gbt += " },"; gbt += " \"coinbasevalue\": 312659655,"; gbt += " \"longpollid\": " "\"000000004f2ea239532b2e77bb46c03b86643caac3fe92959a31fd2d03979c341911" "\","; gbt += " \"target\": " "\"000000000000018ae20000000000000000000000000000000000000000000000\","; gbt += " \"mintime\": 1469001544,"; gbt += " \"mutable\": ["; gbt += " \"time\","; gbt += " \"transactions\","; gbt += " \"prevblock\""; gbt += " ],"; gbt += " \"noncerange\": \"00000000ffffffff\","; gbt += " \"sigoplimit\": 20000,"; gbt += " \"sizelimit\": 1000000,"; gbt += " \"curtime\": 1469006933,"; gbt += " \"bits\": \"1a018ae2\","; gbt += " \"height\": 898487"; gbt += "}}"; blockVersion = 0; SelectParams(CBaseChainParams::TESTNET); ASSERT_EQ( BitcoinUtils::IsValidDestinationString( "myxopLJB19oFtNBdrAxD5Z34Aw6P8o9P8U"), true); CTxDestination poolPayoutAddrTestnet = BitcoinUtils::DecodeDestination("myxopLJB19oFtNBdrAxD5Z34Aw6P8o9P8U"); res = sjob.initFromGbt( gbt.c_str(), poolCoinbaseInfo, poolPayoutAddrTestnet, blockVersion, "", RskWork(), 1, false); ASSERT_EQ(res, true); const string jsonStr = sjob.serializeToJson(); StratumJobBitcoin sjob2; res = sjob2.unserializeFromJson(jsonStr.c_str(), jsonStr.length()); ASSERT_EQ(res, true); ASSERT_EQ( sjob2.prevHash_, uint256S("000000004f2ea239532b2e77bb46c03b86643caac3fe92959a31fd2d03979" "c34")); ASSERT_EQ( sjob2.prevHashBeStr_, "03979c349a31fd2dc3fe929586643caabb46c03b532b2e774f2ea23900000000"); ASSERT_EQ(sjob2.height_, 898487); // 46 bytes, 5 bytes (timestamp), 9 bytes (poolCoinbaseInfo) // 02000000010000000000000000000000000000000000000000000000000000000000000000ffffffff1e03b7b50d // 0402363d58 2f4254432e434f4d2f ASSERT_EQ( sjob2.coinbase1_.substr(0, 92), "0200000001000000000000000000000000000000000000000000000000000000000000" "0000ffffffff1e03b7b50d"); ASSERT_EQ(sjob2.coinbase1_.substr(102, 18), "2f4254432e434f4d2f"); // 0402363d58 -> 0x583d3602 = 1480406530 = 2016-11-29 16:02:10 uint32_t ts = (uint32_t)strtoull(sjob2.coinbase1_.substr(94, 8).c_str(), nullptr, 16); ts = HToBe(ts); ASSERT_EQ(ts == time(nullptr) || ts + 1 == time(nullptr), true); ASSERT_EQ( sjob2.coinbase2_, "ffffffff" // sequence "01" // 1 output // c7cea21200000000 -> 0000000012a2cec7 -> 312659655 "c7cea21200000000" // 0x19 -> 25 bytes "1976a914ca560088c0fb5e6f028faa11085e643e343a8f5c88ac" // lock_time "00000000"); ASSERT_EQ(sjob2.merkleBranch_.size(), 1U); ASSERT_EQ( sjob2.merkleBranch_[0], uint256S("bd36bd4fff574b573152e7d4f64adf2bb1c9ab0080a12f8544c351f65aca7" "9ff")); ASSERT_EQ(sjob2.nVersion_, 536870912); ASSERT_EQ(sjob2.nBits_, 436308706U); ASSERT_EQ(sjob2.nTime_, 1469006933U); ASSERT_EQ(sjob2.minTime_, 1469001544U); ASSERT_EQ(sjob2.coinbaseValue_, 312659655); ASSERT_GE(time(nullptr), jobId2Time(sjob2.jobId_)); } } #ifdef CHAIN_TYPE_BTC TEST(Stratum, StratumJobWithWitnessCommitment) { StratumJobBitcoin sjob; string poolCoinbaseInfo = "/BTC.COM/"; uint32_t blockVersion = 0; bool res; { string gbt; gbt += "{\"result\":"; gbt += "{"; gbt += " \"capabilities\": ["; gbt += " \"proposal\""; gbt += " ],"; gbt += " \"version\": 536870912,"; gbt += " \"rules\": ["; gbt += " \"csv\","; gbt += " \"!segwit\""; gbt += " ],"; gbt += " \"vbavailable\": {"; gbt += " },"; gbt += " \"vbrequired\": 0,"; gbt += " \"previousblockhash\": " "\"0000000000000047e5bda122407654b25d52e0f3eeb00c152f631f70e9803772\","; gbt += " \"transactions\": ["; gbt += " {"; gbt += " \"data\": " "\"0100000002449f651247d5c09d3020c30616cb1807c268e2c2346d1de28442b89ef3" "4c976d000000006a47304402203eae3868946a312ba712f9c9a259738fee6e3163b05d" "206e0f5b6c7980"; gbt += "161756022017827f248432f7313769f120fb3b7a65137bf93496a1ae7d6a775879fbdf" "b8cd0121027d7b71dab3bb16582c97fc0ccedeacd8f75ebee62fa9c388290294ee3bc3" "e935feffffffcbc82a21497f8db"; gbt += "8d57d054fefea52aba502a074ed984efc81ec2ef211194aa6010000006a47304402207" "f5462295e52fb4213f1e63802d8fe9ec020ac8b760535800564694ea87566a802205ee" "01096fc9268eac483136ce08250"; gbt += "6ac951a7dbc9e4ae24dca07ca2a1fdf2f30121023b86e60ef66fe8ace403a0d77d27c8" "0ba9ba5404ee796c47c03c73748e59d125feffffff0286c35b00000000001976a914ab" "29f668d284fd2d65cec5f098432"; gbt += "c4ece01055488ac8093dc14000000001976a914ac19d3fd17710e6b9a331022fe92c69" "3fdf6659588ac8dd70f00\","; gbt += " \"txid\": " "\"c284853b65e7887c5fd9b635a932e2e0594d19849b22914a8e6fb180fea0954f\","; gbt += " \"hash\": " "\"c284853b65e7887c5fd9b635a932e2e0594d19849b22914a8e6fb180fea0954f\","; gbt += " \"depends\": ["; gbt += " ],"; gbt += " \"fee\": 37400,"; gbt += " \"sigops\": 8,"; gbt += " \"weight\": 1488"; gbt += " },"; gbt += " {"; gbt += " \"data\": " "\"0100000001043f5e73755b5c6919b4e361f4cae84c8805452de3df265a6e2d3d71cb" "cb385501000000da0047304402202b14552521cd689556d2e44d914caf2195da37b80d" "e4f8cd0fad9adf"; gbt += "7ef768ef022026fcddd992f447c39c48c3ce50c5960e2f086ebad455159ffc3e36a562" "4af2f501483045022100f2b893e495f41b22cd83df6908c2fa4f917fd7bce9f8da14e6" "ab362042e11f7d022075bc2451e"; gbt += "1cf2ae2daec0f109a3aceb6558418863070f5e84c94526201850324014752210263217" "8d046673c9729d828cfee388e121f497707f810c131e0d3fc0fe0bd66d62103a0951ec" "7d3a9da9de171617026442fcd30"; gbt += "f34d66100fab539853b43f508787d452aeffffffff0240420f000000000017a9143e9a" "6b79be836762c8ef591cf16b76af1327ced58790dfdf8c0000000017a9148ce5408cfe" "addb7ccb2545ded41ef47810945"; gbt += "4848700000000\","; gbt += " \"txid\": " "\"28b1a5c2f0bb667aea38e760b6d55163abc9be9f1f830d9969edfab902d17a0f\","; gbt += " \"hash\": " "\"28b1a5c2f0bb667aea38e760b6d55163abc9be9f1f830d9969edfab902d17a0f\","; gbt += " \"depends\": ["; gbt += " ],"; gbt += " \"fee\": 20000,"; gbt += " \"sigops\": 8,"; gbt += " \"weight\": 1332"; gbt += " },"; gbt += " {"; gbt += " \"data\": " "\"01000000013faf73481d6b96c2385b9a4300f8974b1b30c34be30000c7dcef11f686" "62de4501000000db00483045022100f9881f4c867b5545f6d7a730ae26f598107171d0" "f68b860bd973db"; gbt += "b855e073a002207b511ead1f8be8a55c542ce5d7e91acfb697c7fa2acd2f322b47f177" "875bffc901483045022100a37aa9998b9867633ab6484ad08b299de738a86ae997133d" "827717e7ed73d953022011e3f99"; gbt += "d1bd1856f6a7dc0bf611de6d1b2efb60c14fc5931ba09da01558757f60147522102632" "178d046673c9729d828cfee388e121f497707f810c131e0d3fc0fe0bd66d62103a0951" "ec7d3a9da9de171617026442fcd"; gbt += "30f34d66100fab539853b43f508787d452aeffffffff0240420f000000000017a9148d" "57003ecbaa310a365f8422602cc507a702197e87806868a90000000017a9148ce5408c" "feaddb7ccb2545ded41ef478109"; gbt += "454848700000000\","; gbt += " \"txid\": " "\"67878210e268d87b4e6587db8c6e367457cea04820f33f01d626adbe5619b3dd\","; gbt += " \"hash\": " "\"67878210e268d87b4e6587db8c6e367457cea04820f33f01d626adbe5619b3dd\","; gbt += " \"depends\": ["; gbt += " ],"; gbt += " \"fee\": 20000,"; gbt += " \"sigops\": 8,"; gbt += " \"weight\": 1336"; gbt += " },"; gbt += " ],"; gbt += " \"coinbaseaux\": {"; gbt += " \"flags\": \"\""; gbt += " },"; gbt += " \"coinbasevalue\": 319367518,"; gbt += " \"longpollid\": " "\"0000000000000047e5bda122407654b25d52e0f3eeb00c152f631f70e98037726045" "97\","; gbt += " \"target\": " "\"0000000000001714480000000000000000000000000000000000000000000000\","; gbt += " \"mintime\": 1480831053,"; gbt += " \"mutable\": ["; gbt += " \"time\","; gbt += " \"transactions\","; gbt += " \"prevblock\""; gbt += " ],"; gbt += " \"noncerange\": \"00000000ffffffff\","; gbt += " \"sigoplimit\": 80000,"; gbt += " \"sizelimit\": 4000000,"; gbt += " \"weightlimit\": 4000000,"; gbt += " \"curtime\": 1480834892,"; gbt += " \"bits\": \"1a171448\","; gbt += " \"height\": 1038222,"; gbt += " \"default_witness_commitment\": " "\"6a24aa21a9ed842a6d6672504c2b7abb796fdd7cfbd7262977b71b945452e17fbac6" "9ed22bf8\""; gbt += "}}"; blockVersion = 0; SelectParams(CBaseChainParams::TESTNET); ASSERT_EQ( BitcoinUtils::IsValidDestinationString( "myxopLJB19oFtNBdrAxD5Z34Aw6P8o9P8U"), true); CTxDestination poolPayoutAddrTestnet = BitcoinUtils::DecodeDestination("myxopLJB19oFtNBdrAxD5Z34Aw6P8o9P8U"); res = sjob.initFromGbt( gbt.c_str(), poolCoinbaseInfo, poolPayoutAddrTestnet, blockVersion, "", RskWork(), 1, false); ASSERT_EQ(res, true); const string jsonStr = sjob.serializeToJson(); StratumJobBitcoin sjob2; res = sjob2.unserializeFromJson(jsonStr.c_str(), jsonStr.length()); ASSERT_EQ(res, true); ASSERT_EQ( sjob2.prevHash_, uint256S("0000000000000047e5bda122407654b25d52e0f3eeb00c152f631f70e9803" "772")); ASSERT_EQ( sjob2.prevHashBeStr_, "e98037722f631f70eeb00c155d52e0f3407654b2e5bda1220000004700000000"); ASSERT_EQ(sjob2.height_, 1038222); ASSERT_EQ( sjob2.coinbase2_, "ffffffff" // sequence "02" // 2 outputs // 5e29091300000000 -> 000000001309295e -> 319367518 "5e29091300000000" // 0x19 -> 25 bytes "1976a914ca560088c0fb5e6f028faa11085e643e343a8f5c88ac" // "0000000000000000" // 0x26 -> 38 bytes "266a24aa21a9ed842a6d6672504c2b7abb796fdd7cfbd7262977b71b945452e17fbac6" "9ed22bf8" // lock_time "00000000"); ASSERT_EQ(sjob2.nVersion_, 536870912); ASSERT_EQ(sjob2.nBits_, 0x1a171448U); ASSERT_EQ(sjob2.nTime_, 1480834892U); ASSERT_EQ(sjob2.minTime_, 1480831053U); ASSERT_EQ(sjob2.coinbaseValue_, 319367518); ASSERT_GE(time(nullptr), jobId2Time(sjob2.jobId_)); } } #endif #ifdef CHAIN_TYPE_BTC TEST(Stratum, StratumJobWithSegwitPayoutAddr) { StratumJobBitcoin sjob; string poolCoinbaseInfo = "/BTC.COM/"; uint32_t blockVersion = 0; bool res; { string gbt; gbt += "{\"result\":"; gbt += "{"; gbt += " \"capabilities\": ["; gbt += " \"proposal\""; gbt += " ],"; gbt += " \"version\": 536870912,"; gbt += " \"rules\": ["; gbt += " \"csv\","; gbt += " \"!segwit\""; gbt += " ],"; gbt += " \"vbavailable\": {"; gbt += " },"; gbt += " \"vbrequired\": 0,"; gbt += " \"previousblockhash\": " "\"0000000000000047e5bda122407654b25d52e0f3eeb00c152f631f70e9803772\","; gbt += " \"transactions\": ["; gbt += " {"; gbt += " \"data\": " "\"0100000002449f651247d5c09d3020c30616cb1807c268e2c2346d1de28442b89ef3" "4c976d000000006a47304402203eae3868946a312ba712f9c9a259738fee6e3163b05d" "206e0f5b6c7980"; gbt += "161756022017827f248432f7313769f120fb3b7a65137bf93496a1ae7d6a775879fbdf" "b8cd0121027d7b71dab3bb16582c97fc0ccedeacd8f75ebee62fa9c388290294ee3bc3" "e935feffffffcbc82a21497f8db"; gbt += "8d57d054fefea52aba502a074ed984efc81ec2ef211194aa6010000006a47304402207" "f5462295e52fb4213f1e63802d8fe9ec020ac8b760535800564694ea87566a802205ee" "01096fc9268eac483136ce08250"; gbt += "6ac951a7dbc9e4ae24dca07ca2a1fdf2f30121023b86e60ef66fe8ace403a0d77d27c8" "0ba9ba5404ee796c47c03c73748e59d125feffffff0286c35b00000000001976a914ab" "29f668d284fd2d65cec5f098432"; gbt += "c4ece01055488ac8093dc14000000001976a914ac19d3fd17710e6b9a331022fe92c69" "3fdf6659588ac8dd70f00\","; gbt += " \"txid\": " "\"c284853b65e7887c5fd9b635a932e2e0594d19849b22914a8e6fb180fea0954f\","; gbt += " \"hash\": " "\"c284853b65e7887c5fd9b635a932e2e0594d19849b22914a8e6fb180fea0954f\","; gbt += " \"depends\": ["; gbt += " ],"; gbt += " \"fee\": 37400,"; gbt += " \"sigops\": 8,"; gbt += " \"weight\": 1488"; gbt += " },"; gbt += " {"; gbt += " \"data\": " "\"0100000001043f5e73755b5c6919b4e361f4cae84c8805452de3df265a6e2d3d71cb" "cb385501000000da0047304402202b14552521cd689556d2e44d914caf2195da37b80d" "e4f8cd0fad9adf"; gbt += "7ef768ef022026fcddd992f447c39c48c3ce50c5960e2f086ebad455159ffc3e36a562" "4af2f501483045022100f2b893e495f41b22cd83df6908c2fa4f917fd7bce9f8da14e6" "ab362042e11f7d022075bc2451e"; gbt += "1cf2ae2daec0f109a3aceb6558418863070f5e84c94526201850324014752210263217" "8d046673c9729d828cfee388e121f497707f810c131e0d3fc0fe0bd66d62103a0951ec" "7d3a9da9de171617026442fcd30"; gbt += "f34d66100fab539853b43f508787d452aeffffffff0240420f000000000017a9143e9a" "6b79be836762c8ef591cf16b76af1327ced58790dfdf8c0000000017a9148ce5408cfe" "addb7ccb2545ded41ef47810945"; gbt += "4848700000000\","; gbt += " \"txid\": " "\"28b1a5c2f0bb667aea38e760b6d55163abc9be9f1f830d9969edfab902d17a0f\","; gbt += " \"hash\": " "\"28b1a5c2f0bb667aea38e760b6d55163abc9be9f1f830d9969edfab902d17a0f\","; gbt += " \"depends\": ["; gbt += " ],"; gbt += " \"fee\": 20000,"; gbt += " \"sigops\": 8,"; gbt += " \"weight\": 1332"; gbt += " },"; gbt += " {"; gbt += " \"data\": " "\"01000000013faf73481d6b96c2385b9a4300f8974b1b30c34be30000c7dcef11f686" "62de4501000000db00483045022100f9881f4c867b5545f6d7a730ae26f598107171d0" "f68b860bd973db"; gbt += "b855e073a002207b511ead1f8be8a55c542ce5d7e91acfb697c7fa2acd2f322b47f177" "875bffc901483045022100a37aa9998b9867633ab6484ad08b299de738a86ae997133d" "827717e7ed73d953022011e3f99"; gbt += "d1bd1856f6a7dc0bf611de6d1b2efb60c14fc5931ba09da01558757f60147522102632" "178d046673c9729d828cfee388e121f497707f810c131e0d3fc0fe0bd66d62103a0951" "ec7d3a9da9de171617026442fcd"; gbt += "30f34d66100fab539853b43f508787d452aeffffffff0240420f000000000017a9148d" "57003ecbaa310a365f8422602cc507a702197e87806868a90000000017a9148ce5408c" "feaddb7ccb2545ded41ef478109"; gbt += "454848700000000\","; gbt += " \"txid\": " "\"67878210e268d87b4e6587db8c6e367457cea04820f33f01d626adbe5619b3dd\","; gbt += " \"hash\": " "\"67878210e268d87b4e6587db8c6e367457cea04820f33f01d626adbe5619b3dd\","; gbt += " \"depends\": ["; gbt += " ],"; gbt += " \"fee\": 20000,"; gbt += " \"sigops\": 8,"; gbt += " \"weight\": 1336"; gbt += " },"; gbt += " ],"; gbt += " \"coinbaseaux\": {"; gbt += " \"flags\": \"\""; gbt += " },"; gbt += " \"coinbasevalue\": 319367518,"; gbt += " \"longpollid\": " "\"0000000000000047e5bda122407654b25d52e0f3eeb00c152f631f70e98037726045" "97\","; gbt += " \"target\": " "\"0000000000001714480000000000000000000000000000000000000000000000\","; gbt += " \"mintime\": 1480831053,"; gbt += " \"mutable\": ["; gbt += " \"time\","; gbt += " \"transactions\","; gbt += " \"prevblock\""; gbt += " ],"; gbt += " \"noncerange\": \"00000000ffffffff\","; gbt += " \"sigoplimit\": 80000,"; gbt += " \"sizelimit\": 4000000,"; gbt += " \"weightlimit\": 4000000,"; gbt += " \"curtime\": 1480834892,"; gbt += " \"bits\": \"1a171448\","; gbt += " \"height\": 1038222,"; gbt += " \"default_witness_commitment\": " "\"6a24aa21a9ed842a6d6672504c2b7abb796fdd7cfbd7262977b71b945452e17fbac6" "9ed22bf8\""; gbt += "}}"; blockVersion = 0; SelectParams(CBaseChainParams::TESTNET); ASSERT_EQ( BitcoinUtils::IsValidDestinationString( "tb1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3q0sl5k7"), true); CTxDestination poolPayoutAddrTestnet = BitcoinUtils::DecodeDestination( "tb1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3q0sl5k7"); res = sjob.initFromGbt( gbt.c_str(), poolCoinbaseInfo, poolPayoutAddrTestnet, blockVersion, "", RskWork(), 1, false); ASSERT_EQ(res, true); const string jsonStr = sjob.serializeToJson(); StratumJobBitcoin sjob2; res = sjob2.unserializeFromJson(jsonStr.c_str(), jsonStr.length()); ASSERT_EQ(res, true); ASSERT_EQ( sjob2.prevHash_, uint256S("0000000000000047e5bda122407654b25d52e0f3eeb00c152f631f70e9803" "772")); ASSERT_EQ( sjob2.prevHashBeStr_, "e98037722f631f70eeb00c155d52e0f3407654b2e5bda1220000004700000000"); ASSERT_EQ(sjob2.height_, 1038222); ASSERT_EQ( sjob2.coinbase2_, "ffffffff" // sequence "02" // 2 outputs // 5e29091300000000 -> 000000001309295e -> 319367518 "5e29091300000000" // 0x22 -> 34 bytes "2200201863143c14c5166804bd19203356da136c985678cd4d27a1b8c6329604903262" // "0000000000000000" // 0x26 -> 38 bytes "266a24aa21a9ed842a6d6672504c2b7abb796fdd7cfbd7262977b71b945452e17fbac6" "9ed22bf8" // lock_time "00000000"); ASSERT_EQ(sjob2.nVersion_, 536870912); ASSERT_EQ(sjob2.nBits_, 0x1a171448U); ASSERT_EQ(sjob2.nTime_, 1480834892U); ASSERT_EQ(sjob2.minTime_, 1480831053U); ASSERT_EQ(sjob2.coinbaseValue_, 319367518); ASSERT_GE(time(nullptr), jobId2Time(sjob2.jobId_)); } } #endif #ifdef CHAIN_TYPE_BTC TEST(Stratum, StratumJobWithRskWork) { StratumJobBitcoin sjob; RskWork rskWork; string poolCoinbaseInfo = "/BTC.COM/"; uint32_t blockVersion = 0; { string gbt; gbt += "{\"result\":{"; gbt += " \"capabilities\": ["; gbt += " \"proposal\""; gbt += " ],"; gbt += " \"version\": 536870912,"; gbt += " \"previousblockhash\": " "\"000000004f2ea239532b2e77bb46c03b86643caac3fe92959a31fd2d03979c34\","; gbt += " \"transactions\": ["; gbt += " {"; gbt += " \"data\": " "\"01000000010291939c5ae8191c2e7d4ce8eba7d6616a66482e3200037cb8b8c2d0af" "45b445000000006a47304402204df709d9e149804e358de4b082e41d8bb21b3c9d3472" "41b728b1362aafcb153602200d06d9b6f2eca899f43dcd62ec2efb2d9ce2e10adf0273" "8bb908420d7db93ede012103cae98ab925e20dd6ae1f76e767e9e99bc47b3844095c68" "600af9c775104fb36cffffffff0290f1770b000000001976a91400dc5fd62f6ee48eb8" "ecda749eaec6824a780fdd88aca08601000000000017a914eb65573e5dd52d3d950396" "ccbe1a47daf8f400338700000000\","; gbt += " \"hash\": " "\"bd36bd4fff574b573152e7d4f64adf2bb1c9ab0080a12f8544c351f65aca79ff\","; gbt += " \"depends\": ["; gbt += " ],"; gbt += " \"fee\": 10000,"; gbt += " \"sigops\": 1"; gbt += " }"; gbt += " ],"; gbt += " \"coinbaseaux\": {"; gbt += " \"flags\": \"\""; gbt += " },"; gbt += " \"coinbasevalue\": 312659655,"; gbt += " \"longpollid\": " "\"000000004f2ea239532b2e77bb46c03b86643caac3fe92959a31fd2d03979c341911" "\","; gbt += " \"target\": " "\"000000000000018ae20000000000000000000000000000000000000000000000\","; gbt += " \"mintime\": 1469001544,"; gbt += " \"mutable\": ["; gbt += " \"time\","; gbt += " \"transactions\","; gbt += " \"prevblock\""; gbt += " ],"; gbt += " \"noncerange\": \"00000000ffffffff\","; gbt += " \"sigoplimit\": 20000,"; gbt += " \"sizelimit\": 1000000,"; gbt += " \"curtime\": 1469006933,"; gbt += " \"bits\": \"1a018ae2\","; gbt += " \"height\": 898487"; gbt += "}}"; uint32_t creationTime = (uint32_t)time(nullptr); string rawgw; rawgw = Strings::Format( "{\"created_at_ts\": %u," "\"rskdRpcAddress\":\"http://10.0.2.2:4444\"," "\"rskdRpcUserPwd\":\"user:pass\"," "\"target\":" "\"0x5555555555555555555555555555555555555555555555555555555555555555\"" "," "\"parentBlockHash\":" "\"0x13532f616f89e3ac2e0a9ef7363be28e7f2ca39764684995fb30c0d96e664ae4\"" "," "\"blockHashForMergedMining\":" "\"0xe6b0a8e84e0ce68471ca28db4f51b71139b0ab78ae1c3e0ae8364604e9f8a15d\"" "," "\"feesPaidToMiner\":\"0\"," "\"notify\":\"true\"}", creationTime); blockVersion = 0; SelectParams(CBaseChainParams::TESTNET); bool resInitRskWork = rskWork.initFromGw(rawgw); ASSERT_TRUE(resInitRskWork); ASSERT_EQ(rskWork.isInitialized(), true); ASSERT_EQ(rskWork.getCreatedAt(), creationTime); ASSERT_EQ( rskWork.getBlockHash(), "0xe6b0a8e84e0ce68471ca28db4f51b71139b0ab78ae1c3e0ae8364604e9f8a15d"); ASSERT_EQ( rskWork.getTarget(), "0x5555555555555555555555555555555555555555555555555555555555555555"); ASSERT_EQ(rskWork.getFees(), "0"); ASSERT_EQ(rskWork.getRpcAddress(), "http://10.0.2.2:4444"); ASSERT_EQ(rskWork.getRpcUserPwd(), "user:pass"); ASSERT_EQ(rskWork.getNotifyFlag(), true); CTxDestination poolPayoutAddrTestnet = BitcoinUtils::DecodeDestination("myxopLJB19oFtNBdrAxD5Z34Aw6P8o9P8U"); sjob.initFromGbt( gbt.c_str(), poolCoinbaseInfo, poolPayoutAddrTestnet, blockVersion, "", rskWork, 1, true); // check rsk required data copied properly to the stratum job ASSERT_EQ( sjob.blockHashForMergedMining_, "0xe6b0a8e84e0ce68471ca28db4f51b71139b0ab78ae1c3e0ae8364604e9f8a15d"); ASSERT_EQ( sjob.rskNetworkTarget_, uint256S("0x55555555555555555555555555555555555555555555555555555555555" "55555")); ASSERT_EQ(sjob.feesForMiner_, "0"); ASSERT_EQ(sjob.rskdRpcAddress_, "http://10.0.2.2:4444"); ASSERT_EQ(sjob.rskdRpcUserPwd_, "user:pass"); ASSERT_EQ(sjob.isMergedMiningCleanJob_, true); // check rsk merged mining tag present in the coinbase // Hex("RSKBLOCK:") = 0x52534b424c4f434b3a string rskTagHex = "52534b424c4f434b3ae6b0a8e84e0ce68471ca28db4f51b71139b0ab78ae1c3e0ae836" "4604e9f8a15d"; size_t rskTagPos = sjob.coinbase2_.find(rskTagHex); ASSERT_NE(rskTagPos, string::npos); ASSERT_EQ( sjob.prevHash_, uint256S("000000004f2ea239532b2e77bb46c03b86643caac3fe92959a31fd2d03979" "c34")); ASSERT_EQ( sjob.prevHashBeStr_, "03979c349a31fd2dc3fe929586643caabb46c03b532b2e774f2ea23900000000"); ASSERT_EQ(sjob.height_, 898487); // 46 bytes, 5 bytes (timestamp), 9 bytes (poolCoinbaseInfo) // 02000000010000000000000000000000000000000000000000000000000000000000000000ffffffff1e03b7b50d // 0402363d58 2f4254432e434f4d2f ASSERT_EQ( sjob.coinbase1_.substr(0, 92), "0200000001000000000000000000000000000000000000000000000000000000000000" "0000ffffffff1e03b7b50d"); ASSERT_EQ(sjob.coinbase1_.substr(102, 18), "2f4254432e434f4d2f"); // 0402363d58 -> 0x583d3602 = 1480406530 = 2016-11-29 16:02:10 uint32_t ts = (uint32_t)strtoull(sjob.coinbase1_.substr(94, 8).c_str(), nullptr, 16); ts = HToBe(ts); ASSERT_EQ(ts == time(nullptr) || ts + 1 == time(nullptr), true); ASSERT_EQ( sjob.coinbase2_, "ffffffff" // sequence "02" // 2 outputs. Rsk tag is stored in an additional CTxOut besides the // cb's standard output // c7cea21200000000 -> 0000000012a2cec7 -> 312659655 "c7cea21200000000" // 0x19 -> 25 bytes of first output script "1976a914ca560088c0fb5e6f028faa11085e643e343a8f5c88ac" // rsk tx out value "0000000000000000" // 0x29 = 41 bytes of second output script containing the rsk merged // mining tag "2952534b424c4f434b3ae6b0a8e84e0ce68471ca28db4f51b71139b0ab78ae1c3e0ae8" "364604e9f8a15d" // lock_time "00000000"); ASSERT_EQ(sjob.merkleBranch_.size(), 1U); ASSERT_EQ( sjob.merkleBranch_[0], uint256S("bd36bd4fff574b573152e7d4f64adf2bb1c9ab0080a12f8544c351f65aca7" "9ff")); ASSERT_EQ(sjob.nVersion_, 536870912); ASSERT_EQ(sjob.nBits_, 436308706U); ASSERT_EQ(sjob.nTime_, 1469006933U); ASSERT_EQ(sjob.minTime_, 1469001544U); ASSERT_EQ(sjob.coinbaseValue_, 312659655); ASSERT_GE(time(nullptr), jobId2Time(sjob.jobId_)); } } #endif
35.269857
99
0.640739
vpashka
beb0d6ff680cac5f823633fd8fed15abceef505f
1,556
cc
C++
physicalrobots/player/client_libs/libplayerc++/test/test_speech.cc
parasol-ppl/PPL_utils
92728bb89692fda1705a0dee436592d97922a6cb
[ "BSD-3-Clause" ]
null
null
null
physicalrobots/player/client_libs/libplayerc++/test/test_speech.cc
parasol-ppl/PPL_utils
92728bb89692fda1705a0dee436592d97922a6cb
[ "BSD-3-Clause" ]
null
null
null
physicalrobots/player/client_libs/libplayerc++/test/test_speech.cc
parasol-ppl/PPL_utils
92728bb89692fda1705a0dee436592d97922a6cb
[ "BSD-3-Clause" ]
null
null
null
/* * Player - One Hell of a Robot Server * Copyright (C) Andrew Howard 2003 * * * This library is free software; you can 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. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * Testing the Speech Proxy. Alexis Maldonado. May 4 2007. */ #include "test.h" #if !defined (WIN32) #include <unistd.h> #endif #include <string> #include <playerconfig.h> #if !HAVE_USLEEP #include <replace.h> #endif using namespace std; using namespace PlayerCc; int test_speech(PlayerClient* client, int index) { TEST("speech"); SpeechProxy sp(client,index); TEST("speech: saying something"); string hello("Hello World!"); string numbers("12345678901234567890123456789012345678901234567890"); TEST1("writing data (attempt %d)", 1); sp.Say(hello.c_str()); PASS(); usleep(1000000); TEST1("writing data (attempt %d)", 2); sp.Say(numbers.c_str()); PASS(); return(0); }
23.223881
77
0.705013
parasol-ppl
beb0e6d6183bbf6bb8da617438c661f83e3ccafe
1,691
cpp
C++
BZOJ/4896.cpp
sshockwave/Online-Judge-Solutions
9d0bc7fd68c3d1f661622929c1cb3752601881d3
[ "MIT" ]
6
2019-09-30T16:11:00.000Z
2021-11-01T11:42:33.000Z
BZOJ/4896.cpp
sshockwave/Online-Judge-Solutions
9d0bc7fd68c3d1f661622929c1cb3752601881d3
[ "MIT" ]
4
2017-11-21T08:17:42.000Z
2020-07-28T12:09:52.000Z
BZOJ/4896.cpp
sshockwave/Online-Judge-Solutions
9d0bc7fd68c3d1f661622929c1cb3752601881d3
[ "MIT" ]
4
2017-07-26T05:54:06.000Z
2020-09-30T13:35:38.000Z
#include <iostream> #include <cstdio> #include <cstring> #include <cassert> #include <cctype> #include <vector> using namespace std; typedef long long lint; #define ni (next_num<int>()) #define nl (next_num<lint>()) template<class T>inline T next_num(){ T i=0;char c; while(!isdigit(c=getchar())&&c!='-'); bool flag=c=='-'; flag?(c=getchar()):0; while(i=i*10-'0'+c,isdigit(c=getchar())); return flag?-i:i; } template<class T1,class T2>inline void apmax(T1 &a,const T2 &b){ if(a<b){ a=b; } } template<class T1,class T2>inline void apmin(T1 &a,const T2 &b){ if(a>b){ a=b; } } inline int abs(int x){ return x>=0?x:-x; } const int L=65,SIGMA=26,N=100010; char s[L]; struct Trie{ typedef Trie* node; int val; vector<int>q; node son[SIGMA]; Trie(){ memset(son,0,sizeof(son)); q.push_back(0); val=0; } inline void update(int id){ val++; if(val==q.size()){ q.push_back(id); assert(q[val]==id); } } inline node go(int c){ c-='a'; if(son[c]==0){ son[c]=new Trie(); } return son[c]; } inline void insert(char *s,int id){ for(node pt=this;pt->update(id),*s;pt=pt->go(*s),s++); } inline void del(char *s){ for(node pt=this;pt->val--,*s;pt=pt->son[(*s)-'a'],s++); } inline node find(char *s){ node pt=this; for(;*s;pt=pt->son[(*s)-'a'],s++); return pt; } }trie; inline int work(Trie *pt,int ans){ lint a=nl,b=nl,c=nl; lint x=(a*abs(ans)+b)%c+1; if(pt->q.size()<=x){ return -1; } return pt->q[x]; } int main(){ int ans=0; for(int i=1,n=ni;i<=n;i++){ int k=ni; scanf("%s",s); if(k==1){ trie.insert(s,i); }else if(k==2){ trie.del(s); }else{ assert(k==3); printf("%d\n",ans=work(trie.find(s),ans)); } } }
18.182796
64
0.583678
sshockwave
beb86b042dc547fbe7ac9c8cc6a4a39888c5251a
6,646
cpp
C++
Common/utils/iStyle/ASResource.cpp
testdrive-profiling-master/profiles
6e3854874366530f4e7ae130000000812eda5ff7
[ "BSD-3-Clause" ]
null
null
null
Common/utils/iStyle/ASResource.cpp
testdrive-profiling-master/profiles
6e3854874366530f4e7ae130000000812eda5ff7
[ "BSD-3-Clause" ]
null
null
null
Common/utils/iStyle/ASResource.cpp
testdrive-profiling-master/profiles
6e3854874366530f4e7ae130000000812eda5ff7
[ "BSD-3-Clause" ]
null
null
null
// $Id: ASResource.cpp,v 1.2 2004/02/04 07:35:10 devsolar Exp $ // -------------------------------------------------------------------------- // // Copyright (c) 1998,1999,2000,2001,2002 Tal Davidson. All rights reserved. // // compiler_defines.h // by Tal Davidson (davidsont@bigfoot.com) // // This file is a part of "Artistic Style" - an indentater and reformatter // of C, C++, C# and Java source files. // // -------------------------------------------------------------------------- // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // -------------------------------------------------------------------------- #include "compiler_defines.h" #include "astyle.h" #include <string> #ifdef USES_NAMESPACE using namespace std; namespace astyle { #endif const string ASResource::AS_IF = string("if"); const string ASResource::AS_ELSE = string ("else"); const string ASResource::AS_FOR = string("for"); const string ASResource::AS_WHILE = string("while"); const string ASResource::AS_SWITCH = string ("switch"); const string ASResource::AS_DEFAULT = string("default"); const string ASResource::PRO_CELLDEFINE = string("`celldefine"); const string ASResource::PRO_DEFAULT_NETTYPE = string("`default_nettype"); const string ASResource::PRO_DEFINE = string("`define"); const string ASResource::PRO_ELSE = string("`else"); const string ASResource::PRO_ENDCELLDEFINE = string("`endcelldefine"); const string ASResource::PRO_ENDIF = string("`endif"); const string ASResource::PRO_IFDEF = string("`ifdef"); const string ASResource::PRO_INCLUDE = string("`include"); const string ASResource::PRO_NOUNCONNECTED_DRIVE = string("`nounconnected_drive"); const string ASResource::PRO_RESETALL = string("`resetall"); const string ASResource::PRO_TIMESCALE = string("`timescale"); const string ASResource::PRO_UNCONNECTED_DRIVE = string("`unconnected_drive"); const string ASResource::PRO_UNDEF = string("`undef"); const string ASResource::PRO_IMPORT = string("import"); const string ASResource::AS_OPEN_BRACKET = string("{"); const string ASResource::AS_CLOSE_BRACKET = string("}"); const string ASResource::AS_OPEN_LINE_COMMENT = string("//"); const string ASResource::AS_OPEN_COMMENT = string("/*"); const string ASResource::AS_CLOSE_COMMENT = string("*/"); const string ASResource::AS_ASSIGN = string("="); const string ASResource::AS_LS_ASSIGN = string("<="); const string ASResource::AS_EQUAL = string("=="); const string ASResource::AS_NOT_EQUAL = string("!="); const string ASResource::AS_EQUAL_EQUAL = string("==="); const string ASResource::AS_NOT_EQUAL_EQUAL = string("!=="); const string ASResource::AS_BITNOT_AND = string("~&"); const string ASResource::AS_BITNOT_OR = string("~|"); const string ASResource::AS_BITNOT_XNOR = string("~^"); const string ASResource::AS_NOT_XNOR = string("^~"); const string ASResource::AS_GR_EQUAL = string(">="); const string ASResource::AS_GR_GR = string(">>"); const string ASResource::AS_LS_EQUAL = string("<="); const string ASResource::AS_LS_LS = string("<<"); const string ASResource::AS_AND = string("&&"); const string ASResource::AS_OR = string("||"); const string ASResource::AS_PAREN_PAREN = string("()"); const string ASResource::AS_BLPAREN_BLPAREN = string("[]"); const string ASResource::AS_PLUS = string("+"); const string ASResource::AS_MINUS = string("-"); const string ASResource::AS_MULT = string("*"); const string ASResource::AS_DIV = string("/"); const string ASResource::AS_MOD = string("%"); const string ASResource::AS_GR = string(">"); const string ASResource::AS_LS = string("<"); const string ASResource::AS_NOT = string("!"); const string ASResource::AS_BIT_OR = string("|"); const string ASResource::AS_BIT_AND = string("&"); const string ASResource::AS_BIT_NOT = string("~"); const string ASResource::AS_BIT_XOR = string("^"); const string ASResource::AS_QUESTION = string("?"); const string ASResource::AS_COLON = string(":"); const string ASResource::AS_COMMA = string(","); const string ASResource::AS_SEMICOLON = string(";"); const string ASResource::AS_INITIAL = string("initial"); const string ASResource::AS_FOREVER = string("forever"); const string ASResource::AS_ALWAYS = string("always"); const string ASResource::AS_REPEAT = string("repeat"); const string ASResource::AS_CASE = string("case" ); const string ASResource::AS_CASEX = string("casex" ); const string ASResource::AS_CASEZ = string("casez" ); const string ASResource::AS_FUNCTION = string("function" ); const string ASResource::AS_GENERATE = string("generate" ); const string ASResource::AS_FORK = string("fork" ); const string ASResource::AS_TABLE = string("table" ); const string ASResource::AS_TASK = string("task" ); const string ASResource::AS_SPECIFY = string("specify" ); const string ASResource::AS_PRIMITIVE = string("primitive"); //const string ASResource::AS_MODULE = string("module" ); const string ASResource::AS_BEGIN = string("begin" ); const string ASResource::AS_ENDCASE = string("endcase" ); const string ASResource::AS_ENDFUNCTION = string("endfunction" ); const string ASResource::AS_ENDGENERATE = string("endgenerate" ); const string ASResource::AS_JOIN = string("join" ); const string ASResource::AS_ENDTASK = string("endtask" ); const string ASResource::AS_ENDTABLE = string("endtable" ); const string ASResource::AS_ENDSPECIFY = string("endspecify" ); const string ASResource::AS_ENDPRIMITIVE = string("endprimitive" ); //const string ASResource::AS_ENDMODULE = string("endmodule" ); const string ASResource::AS_END = string("end" ); const char ASResource::PREPROCESSOR_CHAR ='`'; #ifdef USES_NAMESPACE } #endif
43.437908
84
0.671532
testdrive-profiling-master
beb879e76be433f8d05e2a88d7fabb47b17c7273
13,202
cpp
C++
example/FieldContainer/example_01.cpp
Sandia2014/intrepid
9a310ddc033da1dda162a09bf80cca6c2dde2d6b
[ "MIT" ]
null
null
null
example/FieldContainer/example_01.cpp
Sandia2014/intrepid
9a310ddc033da1dda162a09bf80cca6c2dde2d6b
[ "MIT" ]
null
null
null
example/FieldContainer/example_01.cpp
Sandia2014/intrepid
9a310ddc033da1dda162a09bf80cca6c2dde2d6b
[ "MIT" ]
null
null
null
// @HEADER // ************************************************************************ // // Intrepid Package // Copyright (2007) Sandia Corporation // // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive // license for use of this work by or on behalf of the U.S. Government. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // 3. Neither the name of the Corporation nor the names of the // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Questions? Contact Pavel Bochev (pbboche@sandia.gov) // Denis Ridzal (dridzal@sandia.gov), or // Kara Peterson (kjpeter@sandia.gov) // // ************************************************************************ // @HEADER /** \file \brief Illustrates use of the FieldContainer class. \author Created by P. Bochev and D. Ridzal */ #include "Intrepid_FieldContainer.hpp" #include "Teuchos_Time.hpp" #include "Teuchos_GlobalMPISession.hpp" using namespace std; using namespace Intrepid; int main(int argc, char *argv[]) { Teuchos::GlobalMPISession mpiSession(&argc, &argv); std::cout \ << "===============================================================================\n" \ << "| |\n" \ << "| Example use of the FieldContainer class |\n" \ << "| |\n" \ << "| 1) Creating and filling FieldContainer objects |\n" \ << "| 2) Accessing elements in FieldContainer objects |\n" \ << "| |\n" \ << "| Questions? Contact Pavel Bochev (pbboche@sandia.gov) or |\n" \ << "| Denis Ridzal (dridzal@sandia.gov). |\n" \ << "| |\n" \ << "| Intrepid's website: http://trilinos.sandia.gov/packages/intrepid |\n" \ << "| Trilinos website: http://trilinos.sandia.gov |\n" \ << "| |\n" \ << "===============================================================================\n\n"; // Define variables to create and use FieldContainers Teuchos::Array<int> dimension; Teuchos::Array<int> multiIndex; std::cout \ << "===============================================================================\n"\ << "| EXAMPLE 1: rank 2 multi-index: {u(p,i) | 0 <= p < 5; 0 <= i < 3 } |\n"\ << "===============================================================================\n\n"; // This rank 2 multi-indexed value can be used to store values of 3D vector field // evaluated at 5 points, or values of gradient of scalar field evaluated at the points // Resize dimension and multiIndex for rank-2 multi-indexed value dimension.resize(2); multiIndex.resize(2); // Load upper ranges for the two indices in the multi-indexed value dimension[0] = 5; dimension[1] = 3; // Create FieldContainer that can hold the rank-2 multi-indexed value FieldContainer<double> myContainer(dimension); // Fill with some data: leftmost index changes last, rightmost index changes first! for(int p = 0; p < dimension[0]; p++){ multiIndex[0] = p; for(int i = 0; i < dimension[1]; i++){ multiIndex[1] = i; // Load value with multi-index {p,i} to container myContainer.setValue((double)(i+p), multiIndex); } } // Show container contents std::cout << myContainer; // Access by overloaded (), multiindex and []: multiIndex[0] = 3; multiIndex[1] = 1; int enumeration = myContainer.getEnumeration(multiIndex); std::cout << "Access by (): myContainer(" << 3 <<"," << 1 << ") = " << myContainer(3,1) << "\n"; std::cout << "Access by multi-index: myContainer{" << multiIndex[0] << multiIndex[1] << "} = "<< myContainer.getValue(multiIndex) <<"\n"; std::cout << "Access by enumeration: myContainer[" << enumeration << "] = " << myContainer[enumeration] <<"\n"; std::cout << "Assigning value by (): \n old value at (3,1) = " << myContainer(3,1) <<"\n"; myContainer(3,1) = 999.99; std::cout << " new value at (3,1) = " << myContainer(3,1) <<"\n"; std::cout << "\n" \ << "===============================================================================\n"\ << "| EXAMPLE 2: rank 3 multi-index: {u(p,i,j) | 0 <=p< 5; 0 <= i<2, 0<=j<3 |\n"\ << "===============================================================================\n\n"; // This rank-3 value can be used to store subset of second partial derivatives values // of a scalar function at p points. // Resize dimension and multiIndex for rank-3 multi-indexed value dimension.resize(3); multiIndex.resize(3); // Define upper ranges for the three indices in the multi-indexed value dimension[0] = 5; dimension[1] = 2; dimension[2] = 3; // Reset the existing container to accept rank-3 value with the specified index ranges myContainer.resize(dimension); // Fill with some data for(int p = 0; p < dimension[0]; p++){ multiIndex[0] = p; for(int i = 0; i < dimension[1]; i++){ multiIndex[1] = i; for(int j = 0; j < dimension[2]; j++){ multiIndex[2] = j; // Load value with multi-index {p,i} to container myContainer.setValue((double)(p+i+j), multiIndex); } } } // Display contents std::cout << myContainer; // Access by overloaded (), multiindex and []: multiIndex[0] = 3; multiIndex[1] = 1; multiIndex[2] = 2; enumeration = myContainer.getEnumeration(multiIndex); std::cout << "Access by (): myContainer(" << 3 <<"," << 1 << "," << 2 << ") = " << myContainer(3,1,2) << "\n"; std::cout << "Access by multi-index: myContainer{" << multiIndex[0] << multiIndex[1] << multiIndex[2] << "} = "<< myContainer.getValue(multiIndex) <<"\n"; std::cout << "Access by enumeration: myContainer[" << enumeration << "] = " << myContainer[enumeration] <<"\n"; std::cout << "Assigning value by (): \n old value at (3,1,2) = " << myContainer(3,1,2) <<"\n"; myContainer(3,1,2) = -999.999; std::cout << " new value at (3,1,2) = " << myContainer(3,1,2) <<"\n"; std::cout << "\n" \ << "===============================================================================\n"\ << "| EXAMPLE 4: making rank-5 FieldContainer from data array and index range array |\n"\ << "===============================================================================\n\n"; // Initialize dimension for rank-5 multi-index value dimension.resize(5); dimension[0] = 5; dimension[1] = 2; dimension[2] = 3; dimension[3] = 4; dimension[4] = 6; // Define Teuchos::Array to store values with dimension equal to the number of multi-indexed values Teuchos::Array<double> dataTeuchosArray(5*2*3*4*6); // Fill with data int counter = 0; for(int i=0; i < dimension[0]; i++){ for(int j=0; j < dimension[1]; j++){ for(int k=0; k < dimension[2]; k++){ for(int l = 0; l < dimension[3]; l++){ for(int m = 0; m < dimension[4]; m++){ dataTeuchosArray[counter] = (double)counter; counter++; } } } } } // Create FieldContainer from data array and index array and show it FieldContainer<double> myNewContainer(dimension, dataTeuchosArray); std::cout << myNewContainer; // Access by overloaded (), multiindex and []: multiIndex.resize(myNewContainer.rank()); multiIndex[0] = 3; multiIndex[1] = 1; multiIndex[2] = 2; multiIndex[3] = 2; multiIndex[4] = 5; enumeration = myNewContainer.getEnumeration(multiIndex); std::cout << "Access by (): myNewContainer(" << 3 <<"," << 1 << "," << 2 << "," << 2 << "," << 5 << ") = " << myNewContainer(3,1,2,2,5) << "\n"; std::cout << "Access by multi-index: myNewContainer{" << multiIndex[0] << multiIndex[1] << multiIndex[2] << multiIndex[3] << multiIndex[4] << "} = "<< myNewContainer.getValue(multiIndex) <<"\n"; std::cout << "Access by enumeration: myNewContainer[" << enumeration << "] = " << myNewContainer[enumeration] <<"\n"; std::cout << "Assigning value by (): \n old value at (3,1,2,2,5) = " << myNewContainer(3,1,2,2,5) <<"\n"; myNewContainer(3,1,2,2,5) = -888.888; std::cout << " new value at (3,1,2,2,5) = " << myNewContainer(3,1,2,2,5) <<"\n"; std::cout << "\n" \ << "===============================================================================\n"\ << "| EXAMPLE 5: making trivial FieldContainers and storing a single zero |\n"\ << "===============================================================================\n\n"; // Make trivial container by resetting the index range to zero rank (no indices) and then // using resize method dimension.resize(0); myContainer.resize(dimension); std::cout << myContainer; // Make trivial container by using clear method: myNewContainer.clear(); std::cout << myNewContainer; // Now use initialize() to reset the container to hold a single zero myNewContainer.initialize(); std::cout << myNewContainer; std::cout << "\n" \ << "===============================================================================\n"\ << "| EXAMPLE 6: Timing read and write operations using () and getValue |\n"\ << "===============================================================================\n\n"; // Initialize dimensions for rank-5 multi-index value int dim0 = 10; // number of cells int dim1 = 50; // number of points int dim2 = 27; // number of functions int dim3 = 3; // 1st space dim int dim4 = 3; // 2nd space dim FieldContainer<double> myTensorContainer(dim0, dim1, dim2, dim3, dim4); multiIndex.resize(myTensorContainer.rank()); double aValue; Teuchos::Time timerGetValue("Reading and writing from rank-5 container using getValue"); timerGetValue.start(); for(int i0 = 0; i0 < dim0; i0++){ multiIndex[0] = i0; for(int i1 = 0; i1 < dim1; i1++){ multiIndex[1] = i1; for(int i2 = 0; i2 < dim2; i2++) { multiIndex[2] = i2; for(int i3 = 0; i3 < dim3; i3++) { multiIndex[3] = i3; for(int i4 =0; i4 < dim4; i4++) { multiIndex[4] = i4; aValue = myTensorContainer.getValue(multiIndex); myTensorContainer.setValue(999.999,multiIndex); } } } } } timerGetValue.stop(); std::cout << " Time to read and write from container using getValue: " << timerGetValue.totalElapsedTime() <<"\n"; Teuchos::Time timerRound("Reading and writing from rank-5 container using ()"); timerRound.start(); for(int i0 = 0; i0 < dim0; i0++){ for(int i1 = 0; i1 < dim1; i1++) { for(int i2 = 0; i2 < dim2; i2++) { for(int i3 = 0; i3 < dim3; i3++) { for(int i4 =0; i4 < dim4; i4++) { aValue = myTensorContainer(i0,i1,i2,i3,i4); myTensorContainer(i0,i1,i2,i3,i4) = 999.999; } } } } } timerRound.stop(); std::cout << " Time to read and write from container using (): " << timerRound.totalElapsedTime() <<"\n"; std::cout << "\n" \ << "===============================================================================\n"\ << "| EXAMPLE 6: Specialized methods of FieldContainer |\n"\ << "===============================================================================\n\n"; return 0; }
41.127726
196
0.522269
Sandia2014
beba7f22985606f3d10d46aa8181f390f0d1d17c
6,940
hpp
C++
src/si_derived.hpp
DarthPigrum/TypeSI
3505cad5113c1c6c907c48b3bd71e24e9ddb32bc
[ "BSL-1.0" ]
null
null
null
src/si_derived.hpp
DarthPigrum/TypeSI
3505cad5113c1c6c907c48b3bd71e24e9ddb32bc
[ "BSL-1.0" ]
null
null
null
src/si_derived.hpp
DarthPigrum/TypeSI
3505cad5113c1c6c907c48b3bd71e24e9ddb32bc
[ "BSL-1.0" ]
null
null
null
#pragma once /// @file si_derived.hpp /// @brief Derived SI units #include "si_base.hpp" #include <utility> namespace Si { /// @brief Derived SI units namespace Derived { /// @tparam T Any number type such as float, double or long double used as a /// container template <typename T> using Hertz = decltype(std::declval<Internal::Dimensionless<T>>() / std::declval<Base::Second<T>>()); /// @tparam T Any number type such as float, double or long double used as a /// container template <typename T> using Newton = decltype( std::declval<Base::Kilogram<T>>() * std::declval<Base::Meter<T>>() / (std::declval<Base::Second<T>>() * std::declval<Base::Second<T>>())); /// @tparam T Any number type such as float, double or long double used as a /// container template <typename T> using Pascal = decltype(std::declval<Newton<T>>() / (std::declval<Base::Meter<T>>() * std::declval<Base::Meter<T>>())); /// @tparam T Any number type such as float, double or long double used as a /// container template <typename T> using Joule = decltype(std::declval<Base::Meter<T>>() * std::declval<Newton<T>>()); /// @tparam T Any number type such as float, double or long double used as a /// container template <typename T> using Watt = decltype(std::declval<Joule<T>>() / std::declval<Base::Second<T>>()); /// @tparam T Any number type such as float, double or long double used as a /// container template <typename T> using Coulomb = decltype(std::declval<Base::Second<T>>() * std::declval<Base::Ampere<T>>()); /// @tparam T Any number type such as float, double or long double used as a /// container template <typename T> using Volt = decltype(std::declval<Watt<T>>() / std::declval<Base::Ampere<T>>()); /// @tparam T Any number type such as float, double or long double used as a /// container template <typename T> using Farad = decltype(std::declval<Coulomb<T>>() / std::declval<Volt<T>>()); /// @tparam T Any number type such as float, double or long double used as a /// container template <typename T> using Ohm = decltype(std::declval<Volt<T>>() / std::declval<Base::Ampere<T>>()); /// @tparam T Any number type such as float, double or long double used as a /// container template <typename T> using Siemens = decltype(std::declval<Base::Ampere<T>>() / std::declval<Volt<T>>()); /// @tparam T Any number type such as float, double or long double used as a /// container template <typename T> using Weber = decltype(std::declval<Joule<T>>() / std::declval<Base::Ampere<T>>()); /// @tparam T Any number type such as float, double or long double used as a /// container template <typename T> using Tesla = decltype(std::declval<Newton<T>>() / (std::declval<Base::Ampere<T>>() * std::declval<Base::Meter<T>>())); /// @tparam T Any number type such as float, double or long double used as a /// container template <typename T> using Henry = decltype(std::declval<Weber<T>>() / std::declval<Base::Ampere<T>>()); /// @tparam T Any number type such as float, double or long double used as a /// container template <typename T> using Lumen = Base::Candela<T>; /// @tparam T Any number type such as float, double or long double used as a /// container template <typename T> using Lux = decltype(std::declval<Lumen<T>>() / (std::declval<Base::Meter<T>>() * std::declval<Base::Meter<T>>())); /// @tparam T Any number type such as float, double or long double used as a /// container template <typename T> using Becquerel = Hertz<T>; /// @tparam T Any number type such as float, double or long double used as a /// container template <typename T> using Gray = decltype(std::declval<Joule<T>>() / std::declval<Base::Kilogram<T>>()); /// @tparam T Any number type such as float, double or long double used as a /// container template <typename T> using Sievert = Gray<T>; /// @tparam T Any number type such as float, double or long double used as a /// container template <typename T> using Katal = decltype(std::declval<Base::Mole<T>>() / std::declval<Base::Second<T>>()); /// @brief Use this namespace to enable literals for base units namespace Literals { /// @brief _m long double literal for hertz Hertz<long double> operator"" _Hz(long double value) { return Hertz<long double>(value); } /// @brief _kg long double literal for newton Newton<long double> operator"" _N(long double value) { return Newton<long double>(value); } /// @brief _s long double literal for pascal Pascal<long double> operator"" _Pa(long double value) { return Pascal<long double>(value); } /// @brief _A long double literal for joule Joule<long double> operator"" _J(long double value) { return Joule<long double>(value); } /// @brief _K long double literal for watt Watt<long double> operator"" _W(long double value) { return Watt<long double>(value); } /// @brief _mol long double literal for coulomb Coulomb<long double> operator"" _C(long double value) { return Coulomb<long double>(value); } /// @brief _cd long double literal for volt Volt<long double> operator"" _V(long double value) { return Volt<long double>(value); } /// @brief _cd long double literal for farad Farad<long double> operator"" _F(long double value) { return Farad<long double>(value); } /// @brief _cd long double literal for ohm(not as defined by standard because of /// non-ASCII symbol) Ohm<long double> operator"" _Ohm(long double value) { return Ohm<long double>(value); } /// @brief _cd long double literal for siemens Siemens<long double> operator"" _S(long double value) { return Siemens<long double>(value); } /// @brief _cd long double literal for weber Weber<long double> operator"" _Wb(long double value) { return Weber<long double>(value); } /// @brief _cd long double literal for tesla Tesla<long double> operator"" _T(long double value) { return Tesla<long double>(value); } /// @brief _cd long double literal for henry Henry<long double> operator"" _H(long double value) { return Henry<long double>(value); } /// @brief _cd long double literal for lumen Lumen<long double> operator"" _lm(long double value) { return Lumen<long double>(value); } /// @brief _cd long double literal for lux Lux<long double> operator"" _lx(long double value) { return Lux<long double>(value); } /// @brief _cd long double literal for becquerel Becquerel<long double> operator"" _Bq(long double value) { return Becquerel<long double>(value); } /// @brief _cd long double literal for gray Gray<long double> operator"" _Gy(long double value) { return Gray<long double>(value); } /// @brief _cd long double literal for sievert Sievert<long double> operator"" _Sv(long double value) { return Sievert<long double>(value); } /// @brief _cd long double literal for katal Katal<long double> operator"" _kat(long double value) { return Katal<long double>(value); } } // namespace Literals } // namespace Derived } // namespace Si
38.131868
80
0.692507
DarthPigrum
bebb061abaa5720627f10a235f9cc4065b56a1fb
4,500
cpp
C++
rviz-groovy-devel/src/test/fun_display.cpp
tuw-cpsg/dynamic_mapping
12c5c9a9e66e16cb451c457d46a4d6cab5e2213b
[ "CC0-1.0" ]
9
2017-12-17T07:43:15.000Z
2021-10-10T15:03:39.000Z
rviz-groovy-devel/src/test/fun_display.cpp
tuw-cpsg/dynamic_mapping
12c5c9a9e66e16cb451c457d46a4d6cab5e2213b
[ "CC0-1.0" ]
null
null
null
rviz-groovy-devel/src/test/fun_display.cpp
tuw-cpsg/dynamic_mapping
12c5c9a9e66e16cb451c457d46a4d6cab5e2213b
[ "CC0-1.0" ]
6
2016-01-27T03:40:58.000Z
2021-06-15T08:12:14.000Z
/* * Copyright (c) 2012, Willow Garage, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the Willow Garage, Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #include <stdlib.h> // for random #include <stdio.h> // for printf #include <QTimer> #include "fun_display.h" // static member FunDisplay* FunDisplay::previous_fun_ = NULL; FunDisplay::FunDisplay() : count_( 0 ) { size_ = new Property( "Size", 10, "How big, in units", this ); connect( size_, SIGNAL( changed() ), this, SLOT( onSizeChanged() )); master_ = new Property( "Master", "chunky", "Type of butter.", this ); connect( master_, SIGNAL( changed() ), this, SLOT( onMasterChanged() )); if( previous_fun_ ) { connect( previous_fun_->master_, SIGNAL( changed() ), this, SLOT( onMasterChanged() )); } previous_fun_ = this; new Property( "Double", 1.0, "double", this ); new Property( "Float", 1.0f, "float", this ); slave_ = new Property( "Slave", "chunky", "Slave to the butter.", this ); mood_ = new EnumProperty( "Mood", "sad", "Feelings, nothing more than feelings...", this ); mood_->addOption( "sad", 0 ); mood_->addOption( "happy", 1 ); mood_->addOption( "angry", 2 ); mood_->addOption( "jumpy", 3 ); mood_->addOption( "squirmy", 4 ); connect( mood_, SIGNAL( changed() ), this, SLOT( onMoodChanged() )); dance_ = new EditableEnumProperty( "Dance", "clown", "Stomple stomple", this ); connect( dance_, SIGNAL( requestOptions( EditableEnumProperty* )), this, SLOT( makeDances( EditableEnumProperty* ))); QTimer* timer = new QTimer( this ); connect( timer, SIGNAL( timeout() ), this, SLOT( onTimerTick() )); timer->start( 1000 ); } void FunDisplay::onTimerTick() { count_++; slave_->setValue( count_ ); if( (count_ / 10) % 2 ) { setStatus( StatusProperty::Warn, "Slave", "Too odd." ); } else { setStatus( StatusProperty::Ok, "Slave", "Even enough." ); } } void FunDisplay::onMasterChanged() { slave_->setValue( master_->getValue() ); } void FunDisplay::onSizeChanged() { if( size_->getValue().toInt() > 10 ) { setStatus( StatusProperty::Error, "Size", "Too large." ); } else if( size_->getValue().toInt() < 5 ) { setStatus( StatusProperty::Warn, "Size", "Too small." ); } else { setStatus( StatusProperty::Ok, "Size", "Just fine." ); } } void FunDisplay::onMoodChanged() { printf( "Mood is now %d.\n", mood_->getOptionInt() ); } void FunDisplay::makeDances( EditableEnumProperty* prop ) { QStringList dances; dances.push_back( "Robot/Turtlebot" ); dances.push_back( "Robot/PR2" ); dances.push_back( "Macarena/Fast" ); dances.push_back( "Macarena/Slow" ); dances.push_back( "Twist" ); dances.push_back( "Tango" ); dances.push_back( "Swing/Lindy" ); dances.push_back( "Swing/Hop/Small" ); dances.push_back( "Swing/Hop/Big" ); dances.push_back( "Stumble" ); dances.push_back( "Stomple" ); prop->clearOptions(); for( int i = 0; i < 9; i++ ) { int index = random() % dances.size(); prop->addOption( dances[ index ]); } }
32.608696
119
0.677778
tuw-cpsg
bebcf0902de4b69fe2a506c8136d4c024ee247d5
3,274
cpp
C++
Source/Array-1-RemoveDups.cpp
KarateSnoopy/LeetCodeSubmissions
6da0c71e4104a43aea7a5029597685739b9f31b2
[ "MIT" ]
null
null
null
Source/Array-1-RemoveDups.cpp
KarateSnoopy/LeetCodeSubmissions
6da0c71e4104a43aea7a5029597685739b9f31b2
[ "MIT" ]
null
null
null
Source/Array-1-RemoveDups.cpp
KarateSnoopy/LeetCodeSubmissions
6da0c71e4104a43aea7a5029597685739b9f31b2
[ "MIT" ]
null
null
null
// LeetCode.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include "pch.h" #include <iostream> //int x = input[inputSize - 1]; //for (int i = inputSize - 1; i > 0; i--) //{ // input[i] = input[i - 1]; //} //input[0] = x; //while (numsSize > 0) //{ // numsSize -= 1; //} // nums = { 2, 2, 3, 4 }. numSize = 4; int removeDuplicates(int* nums, int numsSize) { int x = 1; int y = 2; while( y < numsSize && x < numsSize ) { if (nums[x] == nums[y]) { y++; } else { nums[x] = nums[y]; x++; y++; } } int length = 0; return length; } // // //int removeDuplicates(int* nums, int numsSize) //{ // if (numsSize <= 1 || nums == NULL) // { // return numsSize; // } // // int oldLength = numsSize; // int* p1 = nums + 0; // int* p2 = nums + 0; // int newLength = 1; // // while (p2 < nums + numsSize) // p2 < nums[1] if numsSize == 2 // { // if (*p1 == *p2) // { // p2++; // } // else // { // p1++; // *p1 = *p2; // newLength++; // if (p2 == nums + numsSize - 1) // { // break; // } // p2++; // } // } // // return newLength; //} bool VerifyResult( std::vector<int> input, std::vector<int> expectedOutput ) { //std::cout << "Input: "; for (size_t i = 0; i < input.size(); i++) { std::cout << input[i] << ", "; } std::cout << std::endl; int newLength = removeDuplicates(input.data(), (int)input.size()); std::cout << "Output: "; for (int i = 0; i < newLength; i++) { std::cout << input[i] << ", "; } std::cout << std::endl; if( newLength != expectedOutput.size() ) { return false; } for (int i = 0; i < newLength; i++) { if( input[i] != expectedOutput[i] ) { return false; } } return true; } void TestArray1() { int nums[6] = { 7,1,5,3,9,4 }; int length = 6; int biggestIndexSoFar = 0; int smallestIndexSoFar = 0; for (int i = 1; i < length; i++) { if (nums[biggestIndexSoFar] < nums[i]) { biggestIndexSoFar = i; } if (nums[smallestIndexSoFar] > nums[i]) { smallestIndexSoFar = i; } } bool failed = false; if (!VerifyResult({ 2,2,3,4 }, { 2,3,4 })) { std::cout << "Failed!"; failed = true; } //if (!VerifyResult({ }, { })) { std::cout << "Failed!"; failed = true; } //if (!VerifyResult({ 1 }, { 1 })) { std::cout << "Failed!"; failed = true; } //if (!VerifyResult({ 10,10 }, { 10 })) { std::cout << "Failed!"; failed = true; } //if (!VerifyResult({ 1,1,1 }, { 1 })) { std::cout << "Failed!"; failed = true; } //if (!VerifyResult({ 2,5,9 }, { 2,5,9 })) { std::cout << "Failed!"; failed = true; } //if (!VerifyResult({ -10,-10,5,9 }, { -10,5,9 })) { std::cout << "Failed!"; failed = true; } //if (!VerifyResult({ 1,1,2,2,3,3,5,5 }, { 1,2,3,5 })) { std::cout << "Failed!"; failed = true; } if( !failed ) std::cout << "Success!"; }
21.682119
101
0.442578
KarateSnoopy
bec3cdfdc085fb7a2f2997c3cc209c5ba9794212
410
cc
C++
src/tools/hot_backup/sync_fault_state.cc
jdisearch/isearch1
272bd4ab0dc82d9e33c8543474b1294569947bb3
[ "Apache-2.0" ]
3
2021-08-18T09:59:42.000Z
2021-09-07T03:11:28.000Z
src/tools/hot_backup/sync_fault_state.cc
jdisearch/isearch1
272bd4ab0dc82d9e33c8543474b1294569947bb3
[ "Apache-2.0" ]
null
null
null
src/tools/hot_backup/sync_fault_state.cc
jdisearch/isearch1
272bd4ab0dc82d9e33c8543474b1294569947bb3
[ "Apache-2.0" ]
null
null
null
#include "sync_fault_state.h" FaultState::FaultState(SyncStateManager* pSyncStateManager) : SyncStateBase() { m_pSyncStateManager = pSyncStateManager; } FaultState::~FaultState() { } void FaultState::Enter() { log_error("Here is ErrorState"); } void FaultState::Exit() { // do nothing } void FaultState::HandleEvent() { // 简单处理,程序结束 log_info("GoodBye hot_backup."); exit(0); }
14.137931
59
0.682927
jdisearch
bec528bdccaf409b043f71101ac596fdadec3888
1,431
hpp
C++
nd-coursework/books/cpp/C++MoveSemantics/basics/card.hpp
crdrisko/nd-grad
f1765e4f24d7a4b1b3a76c64eb8d88bcca0eaa44
[ "MIT" ]
1
2020-09-26T12:38:55.000Z
2020-09-26T12:38:55.000Z
nd-coursework/books/cpp/C++MoveSemantics/basics/card.hpp
crdrisko/nd-research
f1765e4f24d7a4b1b3a76c64eb8d88bcca0eaa44
[ "MIT" ]
null
null
null
nd-coursework/books/cpp/C++MoveSemantics/basics/card.hpp
crdrisko/nd-research
f1765e4f24d7a4b1b3a76c64eb8d88bcca0eaa44
[ "MIT" ]
null
null
null
// Copyright (c) 2020 by Nicolai Josuttis. All rights reserved. // Licensed under the CCA-4.0 International License. See the LICENSE file in the project root for more information. // // Name: card.hpp // Author: crdrisko // Date: 08/08/2021-07:22:39 // Description: A class for the cards of a card game where each object is a valid card #ifndef CARD_HPP #define CARD_HPP #include <cassert> #include <iostream> #include <string> void assertValidCard(const std::string& val) { assert(val.find("seven") != std::string::npos || val.find("eight") != std::string::npos || val.find("nine") != std::string::npos || val.find("ten") != std::string::npos || val.find("jack") != std::string::npos || val.find("queen") != std::string::npos || val.find("king") != std::string::npos || val.find("ace") != std::string::npos); assert(val.find("clubs") != std::string::npos || val.find("spades") != std::string::npos || val.find("hearts") != std::string::npos || val.find("diamonds") != std::string::npos); } class Card { private: std::string value; // rank + "-of-" + suit public: Card(const std::string& val) : value {val} { assertValidCard(value); // ensure the value is always valid } // ... std::string getValue() const { return value; } friend std::ostream& operator<<(std::ostream& strm, const Card& c) { return strm << c.value; } }; #endif
31.8
115
0.621244
crdrisko
bec673d7073fe18807d852a87afb6c56bc84cb75
2,024
hpp
C++
code/source/util/parallel_buffer.hpp
crafn/clover
586acdbcdb34c3550858af125e9bb4a6300343fe
[ "MIT" ]
12
2015-01-12T00:19:20.000Z
2021-08-05T10:47:20.000Z
code/source/util/parallel_buffer.hpp
crafn/clover
586acdbcdb34c3550858af125e9bb4a6300343fe
[ "MIT" ]
null
null
null
code/source/util/parallel_buffer.hpp
crafn/clover
586acdbcdb34c3550858af125e9bb4a6300343fe
[ "MIT" ]
null
null
null
#ifndef CLOVER_UTIL_PARALLEL_BUFFER_HPP #define CLOVER_UTIL_PARALLEL_BUFFER_HPP #include "build.hpp" #include "hardware/clstate.hpp" namespace clover { namespace visual { /// @todo Shouldn't be in util >:( class BaseVertexArrayObject; class Framebuffer; class Texture; } // visual namespace util { class ParallelQueue; /// @note Destroying/resetting can cause blocking if using kernel is running class ParallelBuffer { public: ParallelBuffer(); ParallelBuffer(ParallelBuffer&&); ParallelBuffer(const ParallelBuffer&)= delete; virtual ~ParallelBuffer(); ParallelBuffer& operator=(ParallelBuffer&&); ParallelBuffer& operator=(const ParallelBuffer&)= delete; template <typename T> void create(hardware::ClState::BufferFlag flags, T& first, uint32 element_count=1); /// @note After aliasing, modifying state of GL object through GL API is UB! void alias(hardware::ClState::BufferFlag flags, const visual::BaseVertexArrayObject& vao); void alias(hardware::ClState::BufferFlag flags, const visual::Framebuffer& fbo); void alias(hardware::ClState::BufferFlag flags, const visual::Texture& tex); void aliasTex(hardware::ClState::BufferFlag flags, uint32 tex_target, uint32 tex_id); void attachToQueue(util::ParallelQueue& q){ attachedQueue= &q; } /// Reads data back to elements specified in create(..) void read(); void acquire(); void release(); cl_mem getDId() const { return buffer.id; } void reset(); private: util::ParallelQueue* attachedQueue; hardware::ClState::Buffer buffer; void* hostData; SizeType hostDataSize; }; template <typename T> void ParallelBuffer::create(hardware::ClState::BufferFlag flags, T& first, uint32 element_count){ ensure(hardware::gClState); hostData= &first; hostDataSize= sizeof(T)*element_count; ensure(buffer.id == 0); buffer= hardware::gClState->createBuffer<T>( hardware::gClState->getDefaultContext(), (hardware::ClState::BufferFlag)flags, first, element_count); } } // util } // clover #endif // CLOVER_UTIL_PARALLEL_BUFFER_HPP
25.620253
97
0.755435
crafn
bec90fa1a37ccc0f1313f73c188b4b4ca7998b28
328
cpp
C++
crack project/Keygen/1.2.cpp
IceIce1ce/Crack-project
4bb3b35aad9efa5ff6f41886dc0f5efc169a44de
[ "MIT" ]
null
null
null
crack project/Keygen/1.2.cpp
IceIce1ce/Crack-project
4bb3b35aad9efa5ff6f41886dc0f5efc169a44de
[ "MIT" ]
null
null
null
crack project/Keygen/1.2.cpp
IceIce1ce/Crack-project
4bb3b35aad9efa5ff6f41886dc0f5efc169a44de
[ "MIT" ]
null
null
null
#include<iostream> using namespace std; int main() { int id; cout << "Enter number from 0 to 9999: "; cin >> id; int serial = 0; serial += id + 76 + 1 + 907; serial += serial; serial *= 3; serial -= 1; cout << "Serial: "<< serial << endl; system("pause"); return 0; }
19.294118
45
0.496951
IceIce1ce
bed3fd7ab77b0348ee635ae3c37007cd43ebd1be
920
cpp
C++
FFmpegMediaCodecDemo/app/src/main/cpp/player_main.cpp
xhunmon/AFPlayer
ded67bb09e1606e7b105b5d1a8cec1e6ccda9b75
[ "Apache-2.0" ]
11
2021-01-30T01:52:20.000Z
2022-01-23T19:19:03.000Z
FFmpegMediaCodecDemo/app/src/main/cpp/player_main.cpp
xhunmon/AFPlayer
ded67bb09e1606e7b105b5d1a8cec1e6ccda9b75
[ "Apache-2.0" ]
null
null
null
FFmpegMediaCodecDemo/app/src/main/cpp/player_main.cpp
xhunmon/AFPlayer
ded67bb09e1606e7b105b5d1a8cec1e6ccda9b75
[ "Apache-2.0" ]
3
2021-07-24T16:17:27.000Z
2021-12-14T08:43:55.000Z
#include <jni.h> #include <string> extern "C"{ #include "libavcodec/jni.h" } #include "core/hw_mediacodec.h" extern "C" JNIEXPORT jstring JNICALL Java_com_xhunmon_ffmpegmediacodecdemo_core_Player_getFFVersion(JNIEnv *env, jobject type) { return env->NewStringUTF(av_version_info()); } extern "C" JNIEXPORT void JNICALL Java_com_xhunmon_ffmpegmediacodecdemo_core_Player_decode_1file(JNIEnv *env, jobject thiz, jstring in_path, jstring out_path) { const char *inPath = env->GetStringUTFChars(in_path, NULL); const char *outPath = env->GetStringUTFChars(out_path, NULL); new HWMediaCodec(inPath, outPath); env->ReleaseStringUTFChars(in_path, inPath); env->ReleaseStringUTFChars(out_path, outPath); } extern "C" JNIEXPORT jint JNI_OnLoad(JavaVM *vm, void *res) { av_jni_set_java_vm(vm, 0); // 返回jni版本 return JNI_VERSION_1_4; }
29.677419
106
0.711957
xhunmon
bed523490f6d089862452166226f5b9b085e44cc
2,691
cpp
C++
cpp/cpp_libs/src/pcl_icp.cpp
maximilianharr/code_snippets
8b271e6fa9174e24200e88be59e417abd5f2f59a
[ "BSD-3-Clause" ]
null
null
null
cpp/cpp_libs/src/pcl_icp.cpp
maximilianharr/code_snippets
8b271e6fa9174e24200e88be59e417abd5f2f59a
[ "BSD-3-Clause" ]
null
null
null
cpp/cpp_libs/src/pcl_icp.cpp
maximilianharr/code_snippets
8b271e6fa9174e24200e88be59e417abd5f2f59a
[ "BSD-3-Clause" ]
null
null
null
/** * @file pcl_icp.cpp * @author Maximilian Harr <maximilian.harr@daimler.com> * @date 22.04.2017 * * @brief Point cloud library [http://www.pointclouds.org/] * Comes with ROS [http://wiki.ros.org/pcl/] * ICP (Iterative Closest Point) Tutorial [ http://pointclouds.org/documentation/tutorials/iterative_closest_point.php ] * * Coding Standard: * wiki.ros.org/CppStyleGuide * https://google.github.io/styleguide/cppguide.html * * * @bug * * * @todo Plot data in Gnuplot (visualize GNSS data) see "int main()" * * */ #include <iostream> #include <pcl/io/pcd_io.h> #include <pcl/point_types.h> #include <pcl/registration/icp.h> #include <pcl/features/feature.h> #include <pcl/features/impl/feature.hpp> #include <pcl/search/impl/kdtree.hpp> #include <pcl/kdtree/impl/kdtree_flann.hpp> #include <pcl/features/impl/shot_omp.hpp> int main (int argc, char** argv) { pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_in (new pcl::PointCloud<pcl::PointXYZ>); pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_out (new pcl::PointCloud<pcl::PointXYZ>); // Fill in the CloudIn data cloud_in->width = 5; cloud_in->height = 1; cloud_in->is_dense = false; cloud_in->points.resize (cloud_in->width * cloud_in->height); for (size_t i = 0; i < cloud_in->points.size (); ++i) { cloud_in->points[i].x = 1024 * rand () / (RAND_MAX + 1.0f); cloud_in->points[i].y = 1024 * rand () / (RAND_MAX + 1.0f); cloud_in->points[i].z = 1024 * rand () / (RAND_MAX + 1.0f); } std::cout << "Saved " << cloud_in->points.size () << " data points to input:" << std::endl; for (size_t i = 0; i < cloud_in->points.size (); ++i) std::cout << " " << cloud_in->points[i].x << " " << cloud_in->points[i].y << " " << cloud_in->points[i].z << std::endl; *cloud_out = *cloud_in; std::cout << "size:" << cloud_out->points.size() << std::endl; for (size_t i = 0; i < cloud_in->points.size (); ++i) cloud_out->points[i].x = cloud_in->points[i].x + 0.7f; std::cout << "Transformed " << cloud_in->points.size () << " data points:" << std::endl; for (size_t i = 0; i < cloud_out->points.size (); ++i) std::cout << " " << cloud_out->points[i].x << " " << cloud_out->points[i].y << " " << cloud_out->points[i].z << std::endl; pcl::IterativeClosestPoint<pcl::PointXYZ, pcl::PointXYZ> icp; icp.setInputCloud(cloud_in); icp.setInputTarget(cloud_out); pcl::PointCloud<pcl::PointXYZ> Final; icp.align(Final); std::cout << "has converged:" << icp.hasConverged() << " score: " << icp.getFitnessScore() << std::endl; std::cout << icp.getFinalTransformation() << std::endl; return (0); }
35.407895
128
0.622445
maximilianharr
bede311bcd84c89fdf5538666aed61f014d642c4
5,855
cpp
C++
source/lib/memory/mmu_factory.cpp
olduf/gb-emu
37a2195fa67a2656cc11541eb75b1f7a548057b2
[ "Unlicense" ]
null
null
null
source/lib/memory/mmu_factory.cpp
olduf/gb-emu
37a2195fa67a2656cc11541eb75b1f7a548057b2
[ "Unlicense" ]
null
null
null
source/lib/memory/mmu_factory.cpp
olduf/gb-emu
37a2195fa67a2656cc11541eb75b1f7a548057b2
[ "Unlicense" ]
null
null
null
#include "lib/memory/mmu_factory.hpp" // Initial values come from the Gambatte source code // https://github.com/sinamas/gambatte/blob/master/libgambatte/src/initstate.cpp namespace gb_lib { MMU* MMUFactory::create(uint8_t* rom, uint32_t romSize, DMAMediator* dmaMediator, DMAMediator* hdmaMediator, MemorySpace* timerHandler, InterruptMediator* interruptMediator, bool isCGB) { MemorySpace* cartridge = this->cartridgeFactory.create(rom, romSize); MemorySpace* highRam = this->createHighRam(isCGB); MemorySpace* ioRegisters = this->createIORegisters(dmaMediator, hdmaMediator, timerHandler, interruptMediator, isCGB); MemorySpace* oam = new OAM(ioRegisters); MemorySpace* unusedMemoryFEA0_FEFF = nullptr; MemorySpace* videoRam = nullptr; MemorySpace* workingRam = nullptr; if (isCGB) { unusedMemoryFEA0_FEFF = new CGBUnusedMemoryFEA0_FEFF(); videoRam = new CGBVideoRam(ioRegisters); workingRam = new CGBWorkingRam(ioRegisters); } else { unusedMemoryFEA0_FEFF = new UnusedMemoryFEA0_FEFF(); videoRam = new VideoRam(ioRegisters); workingRam = new WorkingRam(); } return new MMU(cartridge, highRam, ioRegisters, oam, unusedMemoryFEA0_FEFF, videoRam, workingRam); } MemorySpace* MMUFactory::createHighRam(bool isCGB) { MemorySpace* highRam = new HighRam(); if (isCGB) { uint8_t initialValues[0x80] = { 0xCE, 0xED, 0x66, 0x66, 0xCC, 0x0D, 0x00, 0x0B, 0x03, 0x73, 0x00, 0x83, 0x00, 0x0C, 0x00, 0x0D, 0x00, 0x08, 0x11, 0x1F, 0x88, 0x89, 0x00, 0x0E, 0xDC, 0xCC, 0x6E, 0xE6, 0xDD, 0xDD, 0xD9, 0x99, 0xBB, 0xBB, 0x67, 0x63, 0x6E, 0x0E, 0xEC, 0xCC, 0xDD, 0xDC, 0x99, 0x9F, 0xBB, 0xB9, 0x33, 0x3E, 0x45, 0xEC, 0x42, 0xFA, 0x08, 0xB7, 0x07, 0x5D, 0x01, 0xF5, 0xC0, 0xFF, 0x08, 0xFC, 0x00, 0xE5, 0x0B, 0xF8, 0xC2, 0xCA, 0xF4, 0xF9, 0x0D, 0x7F, 0x44, 0x6D, 0x19, 0xFE, 0x46, 0x97, 0x33, 0x5E, 0x08, 0xFF, 0xD1, 0xFF, 0xC6, 0x8B, 0x24, 0x74, 0x12, 0xFC, 0x00, 0x9F, 0x94, 0xB7, 0x06, 0xD5, 0x40, 0x7A, 0x20, 0x9E, 0x04, 0x5F, 0x41, 0x2F, 0x3D, 0x77, 0x36, 0x75, 0x81, 0x8A, 0x70, 0x3A, 0x98, 0xD1, 0x71, 0x02, 0x4D, 0x01, 0xC1, 0xFF, 0x0D, 0x00, 0xD3, 0x05, 0xF9, 0x00, 0x0B, 0x00 }; for (uint16_t i = 0; i < 0x80; i++) { highRam->setByteInternal(0xFF80 + i, initialValues[i]); } } else { uint8_t initialValues[0x80] = { 0x2B, 0x0B, 0x64, 0x2F, 0xAF, 0x15, 0x60, 0x6D, 0x61, 0x4E, 0xAC, 0x45, 0x0F, 0xDA, 0x92, 0xF3, 0x83, 0x38, 0xE4, 0x4E, 0xA7, 0x6C, 0x38, 0x58, 0xBE, 0xEA, 0xE5, 0x81, 0xB4, 0xCB, 0xBF, 0x7B, 0x59, 0xAD, 0x50, 0x13, 0x5E, 0xF6, 0xB3, 0xC1, 0xDC, 0xDF, 0x9E, 0x68, 0xD7, 0x59, 0x26, 0xF3, 0x62, 0x54, 0xF8, 0x36, 0xB7, 0x78, 0x6A, 0x22, 0xA7, 0xDD, 0x88, 0x15, 0xCA, 0x96, 0x39, 0xD3, 0xE6, 0x55, 0x6E, 0xEA, 0x90, 0x76, 0xB8, 0xFF, 0x50, 0xCD, 0xB5, 0x1B, 0x1F, 0xA5, 0x4D, 0x2E, 0xB4, 0x09, 0x47, 0x8A, 0xC4, 0x5A, 0x8C, 0x4E, 0xE7, 0x29, 0x50, 0x88, 0xA8, 0x66, 0x85, 0x4B, 0xAA, 0x38, 0xE7, 0x6B, 0x45, 0x3E, 0x30, 0x37, 0xBA, 0xC5, 0x31, 0xF2, 0x71, 0xB4, 0xCF, 0x29, 0xBC, 0x7F, 0x7E, 0xD0, 0xC7, 0xC3, 0xBD, 0xCF, 0x59, 0xEA, 0x39, 0x01, 0x2E, 0x00, 0x69, 0x00 }; for (uint16_t i = 0; i < 0x80; i++) { highRam->setByteInternal(0xFF80 + i, initialValues[i]); } } return highRam; } MemorySpace* MMUFactory::createIORegisters(DMAMediator* dmaMediator, DMAMediator* hdmaMediator, MemorySpace* timerHandler, InterruptMediator* interruptMediator, bool isCGB) { MemorySpace* ioRegisters = new IORegisters(dmaMediator, hdmaMediator, timerHandler, interruptMediator, isCGB); ioRegisters->setByteInternal(0xFF05, 0x00); // TIMA ioRegisters->setByteInternal(0xFF06, 0x00); // TMA ioRegisters->setByteInternal(0xFF07, 0x00); // TAC ioRegisters->setByteInternal(0xFF10, 0x80); // NR10 ioRegisters->setByteInternal(0xFF11, 0xBF); // NR11 ioRegisters->setByteInternal(0xFF12, 0xF3); // NR12 ioRegisters->setByteInternal(0xFF14, 0xBF); // NR14 ioRegisters->setByteInternal(0xFF16, 0x3F); // NR21 ioRegisters->setByteInternal(0xFF17, 0x00); // NR22 ioRegisters->setByteInternal(0xFF19, 0xBF); // NR24 ioRegisters->setByteInternal(0xFF1A, 0x7F); // NR30 ioRegisters->setByteInternal(0xFF1B, 0xFF); // NR31 ioRegisters->setByteInternal(0xFF1C, 0x9F); // NR32 ioRegisters->setByteInternal(0xFF1E, 0xBF); // NR33 ioRegisters->setByteInternal(0xFF20, 0xFF); // NR41 ioRegisters->setByteInternal(0xFF21, 0x00); // NR42 ioRegisters->setByteInternal(0xFF22, 0x00); // NR43 ioRegisters->setByteInternal(0xFF23, 0xBF); // NR30 ioRegisters->setByteInternal(0xFF24, 0x77); // NR50 ioRegisters->setByteInternal(0xFF25, 0xF3); // NR51 ioRegisters->setByteInternal(0xFF26, 0xF1); // NR52 ioRegisters->setByteInternal(0xFF40, 0x91); // LCDC ioRegisters->setByteInternal(0xFF42, 0x00); // SCY ioRegisters->setByteInternal(0xFF43, 0x00); // SCX ioRegisters->setByteInternal(0xFF45, 0x00); // LYC ioRegisters->setByteInternal(0xFF47, 0xFC); // BGP ioRegisters->setByteInternal(0xFF48, 0xFF); // OBP0 ioRegisters->setByteInternal(0xFF49, 0xFF); // OBP1 ioRegisters->setByteInternal(0xFF4A, 0x00); // WY ioRegisters->setByteInternal(0xFF4B, 0x00); // WX if (isCGB) { // unsure, pandocs states it should be for SGB ioRegisters->setByteInternal(0xFF26, 0xF0); // NR52 } return ioRegisters; } }
42.122302
186
0.641674
olduf