blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 3 264 | content_id stringlengths 40 40 | detected_licenses listlengths 0 85 | license_type stringclasses 2 values | repo_name stringlengths 5 140 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 986 values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 3.89k 681M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 23 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 145 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 10.4M | extension stringclasses 122 values | content stringlengths 3 10.4M | authors listlengths 1 1 | author_id stringlengths 0 158 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
10056277c671484918fd6c52c108309f6842a8bc | 96d5d9c30f1c519c128668daaab1b6a36254f927 | /apps/lulzyframe/ViewApp.cpp | 3d59a1eb7ff451ee0d14452c7aa579da0f09ff2f | [] | no_license | htruong/lulzyframe | cdecb8a98af2262c4986a14bdc749904cf3980b5 | ec3f839b671bf0cb951ac329c4d66ae3de50ec68 | refs/heads/master | 2021-01-19T05:53:32.411643 | 2011-09-07T21:19:02 | 2011-09-07T21:19:02 | 2,344,607 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,738 | cpp |
/* Copyright (c) 2010, Peter Barrett
**
** Permission to use, copy, modify, and/or distribute this software for
** any purpose with or without fee is hereby granted, provided that the
** above copyright notice and this permission notice appear in all copies.
**
** THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
** WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
** WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
** BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
** OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
** WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
** ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
** SOFTWARE.
*/
//#include <stdlib.h>
#include "Platform.h"
#include "Scroller.h"
#define _SHAKE_LIMIT 9
#define _PICS_W 320
class ViewState
{
enum FileType
{
UNKNOWN,
IM2,
BLB,
PNG,
MP3,
JPG,
TXT
};
char _name[16];
FileType _type;
File _file;
Scroller _scroller;
int _height;
int _sillycounter;
int _pics_count;
int _current_pic;
char _buffer [10];
signed char _xyz[3];
signed char _last_reading;
void Draw(long scroll, int y, int height)
{
switch (_type)
{
case IM2:
_file.SetPos(0);
Graphics.DrawImage(_file,0,y,scroll,height);
break;
default:
Graphics.Rectangle(0,y,240,height,0xFFFF);
Graphics.DrawString(_name,10,10,0);
//TRACE("s: %ld, y:%ld\n",scroll,y);
break;
}
}
static void OnDraw(long scroll, int y, int height, void* ref)
{
((ViewState*)ref)->Draw(scroll,y,height);
}
void OpenIM2()
{
Img2 hdr;
if (!_file.Read(&hdr,sizeof(Img2)) || hdr.sig[0] != 'i' || hdr.sig[3] != '2')
return;
_height = hdr.height;
}
void DrawUnknown()
{
Graphics.DrawString(_name,10,10,0);
_height = 320;
}
public:
int OnEvent(Event* e)
{
// _scroller.OnEvent(e);
switch (e->Type)
{
case Event::OpenApp:
{
Graphics.Clear(0xFFFF);
const char* name = "INIT.IM2";
_file.Init();
_file.Open(name);
strcpy(_name,name);
_height = 320;
_current_pic = 0;
Hardware.GetAccelerometer(_xyz);
_last_reading = _xyz[2];
const char* ext = name;
while (*ext && *ext != '.')
ext++;
// Determine file type
_type = UNKNOWN;
if (ext[0] == '.')
{
if (ext[1] == 'I' && ext[2] == 'M' && ext[3] == '2')
_type = IM2;
else if (ext[1] == 'B' && ext[2] == 'L' && ext[3] == 'B')
_type = BLB;
//else if (ext[1] == 'J' && ext[2] == 'P' && ext[3] == 'G')
// _type = JPG;
}
switch (_type)
{
case IM2:
OpenIM2();
break;
default:;
}
// Init scroller, do initial draw
_scroller.Init(_height,OnDraw,this,320);
_pics_count = (_height / _PICS_W);
}
break;
case Event::TouchDown:
{
TouchData* t = e->Touch;
if (t->y >= 320)
return -1; // touched black bar quit
}
break;
case Event::TouchMove:
break;
case Event::TouchUp:
break;
case Event::None:
Hardware.GetAccelerometer(_xyz);
if ((_last_reading - _xyz[2] > _SHAKE_LIMIT) || (_xyz[2] - _last_reading > _SHAKE_LIMIT)) {
// Tiem to scroll
_current_pic += 1;
if (_current_pic < _pics_count) {
_scroller.ScrollBy(-_PICS_W);
} else {
_current_pic = 0;
_scroller.ScrollBy(_height - _PICS_W);
}
delay(500);
Hardware.GetAccelerometer(_xyz);
_last_reading = _xyz[2];
_sillycounter = 0;
} else {
_last_reading = _xyz[2];
_sillycounter = (_sillycounter + 1) % 5000;
if (!_sillycounter) {
// Tiem to scroll
_current_pic += 1;
if (_current_pic < _pics_count) {
_scroller.ScrollBy(-_PICS_W);
} else {
_current_pic = 0;
_scroller.ScrollBy(_height - _PICS_W);
}
}
//Graphics.Rectangle(0,0,240,10,0xFFFF);
//itoa (_sillycounter,_buffer,10);
//Graphics.DrawString(_buffer,0,0,0);
}
break;
default:;
}
return 0;
}
};
INSTALL_APP(shell,ViewState); | [
"htruong@tnhh.net"
] | htruong@tnhh.net |
079437e68eb5cb1f902535882a7987d684cbf032 | f6c595b7ec9100ee89d3b110bfd68044d098d74e | /TowerDefenseX/TowerDefense/RCGameScene.cpp | 6533687d7bd1afe9896db54744c82db1da7b8bfa | [] | no_license | xuzepei/game_practice | 89cd80d592890a13a6cd961feaf35edb42f6616e | dee39a0b05aff9c8c032de69bb6c2e48fd787f8a | refs/heads/master | 2020-12-24T14:18:40.830709 | 2014-06-14T10:01:28 | 2014-06-14T10:01:28 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,165 | cpp | //
// RCGameScene.cpp
// TowerDefense
//
// Created by xuzepei on 7/25/13.
//
//
#include "RCGameScene.h"
#include "RCTower.h"
#include "RCWaypoint.h"
#include "RCEnemy.h"
#include "SimpleAudioEngine.h"
using namespace CocosDenshion;
RCGameScene::RCGameScene(void)
{
_towerBaseArray = NULL;
_towers = NULL;
_waypoints = NULL;
_waveNum = 0;
}
RCGameScene::~RCGameScene(void)
{
CCLog("%s,%s",__FUNCTION__,__FILE__);
if(_towerBaseArray)
{
_towerBaseArray->release();
_towerBaseArray = NULL;
}
CC_SAFE_RELEASE_NULL(_towers);
CC_SAFE_RELEASE_NULL(_waypoints);
CC_SAFE_RELEASE_NULL(_enemies);
}
CCScene* RCGameScene::scene()
{
// 'scene' is an autorelease object
CCScene *scene = CCScene::create();
// 'layer' is an autorelease object
RCGameScene *layer = RCGameScene::create();
// add layer as a child to scene
scene->addChild(layer);
// return the scene
return scene;
}
// on "init" you need to initialize your instance
bool RCGameScene::init()
{
if(!CCLayer::init())
{
return false;
}
this->setTouchEnabled(true);
CCSize winSize = WIN_SIZE;
//创建保存炮塔得数组
_towers = CCArray::create();
_towers->retain();//引用计数加1
//设置背景
CCSprite* bg = CCSprite::create("bg.png");
bg->setPosition(ccp(winSize.width/2.0, winSize.height/2.0));
this->addChild(bg);
//创建炮塔底座
this->initTowerBases();
//初始化路径
this->initWaypoints();
_waveLabel = CCLabelTTF::create(CCString::createWithFormat("WAVE: %d", _waveNum)->getCString(), "Helvetica", 14);
_waveLabel->setPosition(ccp(400, winSize.height - 12));
_waveLabel->setAnchorPoint(ccp(0, 0.5));
this->addChild(_waveLabel, 10);
_enemies = CCArray::create();
_enemies->retain();
this->loadWave();
SimpleAudioEngine::sharedEngine()->playBackgroundMusic("bg.mp3",true);
return true;
}
void RCGameScene::initWaypoints()
{
if(NULL == _waypoints)
{
CCArray* tempArray = CCArray::createWithContentsOfFile("waypoints.plist");
_waypoints = CCArray::createWithCapacity(tempArray->count());
_waypoints->retain();
CCObject *pObject = NULL;
CCARRAY_FOREACH(tempArray, pObject)
{
CCDictionary* position = (CCDictionary*)pObject;
float x = ((CCString*)position->objectForKey("x"))->floatValue();
float y = ((CCString*)position->objectForKey("y"))->floatValue();
RCWaypoint* waypoint = RCWaypoint::waypoint(ccp(x,y));
this->addChild(waypoint);
_waypoints->addObject(waypoint);
}
//设置路点间的连接关系
int j = 0;
for(int i = 0; i < _waypoints->count() - 1; i++)
{
j = i + 1;
if(j >= _waypoints->count())
break;
RCWaypoint* waypoint = (RCWaypoint*)_waypoints->objectAtIndex(i);
RCWaypoint* nextWaypoint = (RCWaypoint*)_waypoints->objectAtIndex(j);
waypoint->setNextWaypoint(nextWaypoint);
}
}
}
void RCGameScene::initTowerBases()
{
if(NULL == _towerBaseArray)
{
CCArray* tempArray = CCArray::createWithContentsOfFile("towers_position.plist");
_towerBaseArray = CCArray::createWithCapacity(tempArray->count());
_towerBaseArray->retain();
CCObject *pObject = NULL;
CCARRAY_FOREACH(tempArray, pObject)//遍历数组
{
CCDictionary* position = (CCDictionary*)pObject;
CCSprite* towerBase = CCSprite::create("tower_base.png");
float x = ((CCString*)position->objectForKey("x"))->floatValue();
float y = ((CCString*)position->objectForKey("y"))->floatValue();
towerBase->setPosition(ccp(x,y));
this->addChild(towerBase);
_towerBaseArray->addObject(towerBase);
}
}
}
bool RCGameScene::loadWave()
{
CCArray* waveData = CCArray::createWithContentsOfFile("waves.plist");
if (_waveNum >= waveData->count())
{
return false;
}
CCArray* currentWaveData = (CCArray*)waveData->objectAtIndex(_waveNum);
CCObject *pObject = NULL;
CCARRAY_FOREACH(currentWaveData, pObject)
{
CCDictionary* enemyData = (CCDictionary*)pObject;
RCEnemy *enemy = RCEnemy::enemy(this);
this->addChild(enemy);
_enemies->addObject(enemy);
enemy->schedule(schedule_selector(RCEnemy::activate), ((CCString*)enemyData->objectForKey("spawnTime"))->floatValue());
}
_waveNum++;
_waveLabel->setString(CCString::createWithFormat("WAVE: %d", _waveNum)->getCString());
return true;
}
void RCGameScene::enemyGotKilled()
{
if(_enemies->count() <= 0)
{
if(!this->loadWave())
{
CCLog("You win!");
}
}
}
#pragma mark - Touch Event
void RCGameScene::ccTouchesBegan(CCSet *pTouches, CCEvent *pEvent)
{
if(NULL == _towerBaseArray || 0 == _towerBaseArray->count())
return;
CCSetIterator iter = pTouches->begin();
for (; iter != pTouches->end(); iter++)
{
CCTouch* pTouch = (CCTouch*)(*iter);
CCPoint location = pTouch->getLocation();
CCObject *pObject = NULL;
CCARRAY_FOREACH(_towerBaseArray, pObject)
{
CCSprite* towerBase = (CCSprite*)pObject;
if (towerBase->boundingBox().containsPoint(location) && !towerBase->getUserData())
{
RCTower* tower = RCTower::tower(towerBase->getPosition(),this);
if(tower)
{
SimpleAudioEngine::sharedEngine()->playEffect("tower_place.wav");
this->addChild(tower);
_towers->addObject(tower);
towerBase->setUserData(tower);
}
}
}
}
}
| [
"xuzepei@gmail.com"
] | xuzepei@gmail.com |
3e516683fa6b563cc42300c432c99fc0afd72cf2 | fd0ec8fb76dbe136b948779c791f279fd3dbbd35 | /src/util/String_test.cpp | b8f10e6de188688e85a5db98298a0e8d60fe386d | [] | no_license | Senevri/jeshmup | 68ec2aadb3d81433418e348080044255792ce569 | d6002b4624a224df2e0cb753b4965d4b3a814148 | refs/heads/master | 2021-01-13T01:40:55.189490 | 2017-01-16T18:43:43 | 2017-01-16T18:43:43 | 32,265,143 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,293 | cpp | #include "String.h"
#include "SharedData.h"
class StringPrivate{
StringPrivate& operator=(const StringPrivate &rhs);
public:
StringPrivate() : m_length(0), m_string(0)
{}
StringPrivate(const char *string) : m_length(0), m_string(0)
{
copyFrom(string);
}
StringPrivate(const StringPrivate &other)
{
copyFrom(other.m_string);
}
private:
void copyFrom(const char *string)
{
if( !string )
{
return;
}
//maybe this should/can be non-copying....
m_length = strlen(string) +1;
m_string = static_cast<char*>(malloc(m_length));
memcpy(m_string, string, m_length);
}
public:
size_t m_length;
char *m_string;
};
String::String() : m_d(new SharedData<StringPrivate>(new StringPrivate()))
{
}
String::String(const char* string) : m_d(new SharedData<StringPrivate>(new StringPrivate(string)))
{
}
String::String(const String& other)
{
if( this == &other )
{
return;
}
else
{
m_d = other.m_d;
m_d->ref();
}
}
String::~String(void)
{
}
std::string String::toStd() const
{
return std::string(m_d->data()->m_string);
}
void String::detach()
{
SharedData<StringPrivate> *temp = new SharedData<StringPrivate>(m_d);
if( m_d->deRef() )
{
delete m_d;
}
m_d = temp;
}
| [
"jari.tauriainen@abe21748-ea51-0410-af0e-c35c4496dcea"
] | jari.tauriainen@abe21748-ea51-0410-af0e-c35c4496dcea |
9bc7f225a5dd5d7582de4ceafc57743819dca5dc | 09c3350c89c337e53dfd7c2e65c34cf8252fe9bb | /abi_tool/abi-tool-3.0w/rootstraps_to_copy/usr/include/dali-toolkit/devel-api/transition-effects/cube-transition-fold-effect.h | 0543d27ef90157bb5cb8f2589b4cf69b19469527 | [] | no_license | gkayas/srbd_random | ee58a0def2f2e08c6be08624de0dde6c563d6672 | 078801911eb1928ef41a46f3dbe9a4a8fa0c2e86 | refs/heads/master | 2023-03-05T10:01:47.434761 | 2023-02-21T05:50:02 | 2023-02-21T05:50:02 | 97,911,130 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,230 | h | #ifndef __DALI_TOOLKIT_CUBE_TRANSITION_FOLD_EFFECT_H__
#define __DALI_TOOLKIT_CUBE_TRANSITION_FOLD_EFFECT_H__
/*
* Copyright (c) 2015 Samsung Electronics 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.
*
*/
// INTERNAL INCLUDES
#include <dali-toolkit/devel-api/transition-effects/cube-transition-effect.h>
namespace Dali
{
namespace Toolkit
{
namespace Internal DALI_INTERNAL
{
/**
* CubeTransitionFoldEffectimplementation class
*/
class CubeTransitionFoldEffect;
} // namespace Internal
/**
* SubClass of CubeTransitionEffect
* Rotate the neighboring cubes in opposite directions to transition from one image to another
*/
class DALI_IMPORT_API CubeTransitionFoldEffect : public CubeTransitionEffect
{
public:
/**
* Create an initialized CubeTransitionFoldEffect
* @param[in] numRows How many rows of cubes
* @param[in] numColumns How many columns of cubes
* @return The initialized CubeTransitionFoldEffect object
*/
static CubeTransitionFoldEffect New( unsigned int numRows, unsigned int numColumns );
public: // Not intended for developer use
/**
* Creates a handle using the Toolkit::Internal implementation.
* @param[in] implementation The Control implementation.
*/
DALI_INTERNAL CubeTransitionFoldEffect( Internal::CubeTransitionFoldEffect& implementation );
/**
* Allows the creation of this Control from an Internal::CustomActor pointer.
* @param[in] internal A pointer to the internal CustomActor.
*/
DALI_INTERNAL CubeTransitionFoldEffect( Dali::Internal::CustomActor* internal );
}; // class CubeTransitionFoldEffect
} // namespace Toolkit
} // namespace Dali
#endif /* __DALI_TOOLKIT_CUBE_TRANSITION_FOLD_EFFECT_H__ */
| [
"g.kayes@samsung.com"
] | g.kayes@samsung.com |
8a5ae2c4dcb2524cd8cbef6104b8d36e348d5c51 | b243484c252a0be6bba3f7d821deffa5648a6944 | /c++/051-100/069_Sqrt(x).cpp | 71fcfe58e1896c0c168ed56cc32473052e8ac57b | [] | no_license | lqryo/leetcode | a3e913ad15b2d2e5d99e03845dd505c4cf9f37a2 | cf13de4958e4b4c2fb8fc79cf98d7035d23f83c3 | refs/heads/master | 2020-05-15T20:10:27.415993 | 2020-01-16T07:51:13 | 2020-01-16T07:51:13 | 182,472,085 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 865 | cpp | // 参考:https://leetcode-cn.com/problems/sqrtx/solution/niu-dun-die-dai-fa-by-loafer/
#include <vector>
#include <array>
#include <algorithm>
#include <iostream>
#include <string>
#include <unordered_set>
using namespace std;
class Solution {
public:
int a;
// static int time;
//牛顿迭代法
int mySqrt(int x) {
a = x;
if (x == 0) return 0;
return (int)sqrts(x);
}
double sqrts(double x) {
double res = (x + a / x) / 2;
// cout << "time is " << time++ <<"; res is " << res <<endl;
if (res == x) {
return x;
}
else {
return sqrts(res);
}
}
};
//int Solution::time = 0;
int main()
{
Solution s;
//cout << s.mySqrt(4) << endl;
cout << s.mySqrt(10) << endl;
//cout << s.mySqrt(100) << endl;
//cout << s.mySqrt(101) << endl;
//cout << s.mySqrt(20) << endl;
//cout << s.mySqrt(70) << endl;
cin.get();
return 0;
} | [
"liangqi1995@gmail.com"
] | liangqi1995@gmail.com |
f03d4805efa447196457370447f0b3467cd7cbdc | 84f278d69ea69d44aba2dd83b17ce9173b9ad9cb | /src/ViewFrustumCulling.cpp | 3aba768e6c862bb812e5e15439a865e0d9a6f240 | [] | no_license | DougNoGit/the-game-this-aint | d9839def14cd33c7de7112efe01170542ac491c9 | 65a2fe40bef92283e458929b509e707fffe1ac93 | refs/heads/master | 2020-08-02T00:11:06.052739 | 2019-06-14T04:35:56 | 2019-06-14T04:35:56 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,674 | cpp | //
// Created by Caroline Cullen on 2019-05-27.
//
#include "ViewFrustumCulling.h"
int ViewFrustumCulling::ViewFrustCull(glm::vec3 center, float radius) {
float dist;
for (int i=0; i < 6; i++) {
dist = DistToPlane(planes[i].x, planes[i].y, planes[i].z, planes[i].w, center);
//test against each plane
if(dist<radius)
return 1;
}
return 0;
}
void ViewFrustumCulling::ExtractVFPlanes(glm::mat4 P, glm::mat4 V) {
/* composite matrix */
glm::mat4 comp = P*V;
glm::vec3 n; //use to pull out normal
float l; //length of normal for plane normalization
Left.x = comp[0][3] + comp[0][0];
Left.y = comp[1][3] + comp[1][0];
Left.z = comp[2][3] + comp[2][0];
Left.w = comp[3][3] + comp[3][0];
n = glm::vec3(Left.x, Left.y, Left.z);
l = length(n);
planes[0] = Left/l;
// std::cout << "Left' " << Left.x << " " << Left.y << " " <<Left.z << " " << Left.w << std::endl;
Right.x = comp[0][3] - comp[0][0];
Right.y = comp[1][3] - comp[1][0];
Right.z = comp[2][3] - comp[2][0];
Right.w = comp[3][3] - comp[3][0];
n = glm::vec3(Right.x, Right.y, Right.z);
l = length(n);
planes[1] = Right/l;
// std::cout << "Right " << Right.x << " " << Right.y << " " <<Right.z << " " << Right.w << std::endl;
Bottom.x = comp[0][3] + comp[0][1];
Bottom.y = comp[1][3] + comp[1][1];
Bottom.z = comp[2][3] + comp[2][1];
Bottom.w = comp[3][3] + comp[3][1];
n = glm::vec3(Bottom.x, Bottom.y, Bottom.z);
l = length(n);
planes[2] = Bottom/l;
// std::cout << "Bottom " << Bottom.x << " " << Bottom.y << " " <<Bottom.z << " " << Bottom.w << std::endl;
Top.x = comp[0][3] - comp[0][1];
Top.y = comp[1][3] - comp[1][1];
Top.z = comp[2][3] - comp[2][1];
Top.w = comp[3][3] - comp[3][1];
n = glm::vec3(Top.x, Top.y, Top.z);
l = length(n);
planes[3] = Top/l;
// std::cout << "Top " << Top.x << " " << Top.y << " " <<Top.z << " " << Top.w << std::endl;
Near.x = comp[0][3] + comp[0][2];
Near.y = comp[1][3] + comp[1][2];
Near.z = comp[2][3] + comp[2][2];
Near.w = comp[3][3] + comp[3][2];
n = glm::vec3(Near.x, Near.y, Near.z);
l = length(n);
planes[4] = Near/l;
// std::cout << "Near " << Near.x << " " << Near.y << " " <<Near.z << " " << Near.w << std::endl;
Far.x = comp[0][3] - comp[0][2];
Far.y = comp[1][3] - comp[1][2];
Far.z = comp[2][3] - comp[2][2];
Far.w = comp[3][3] - comp[3][2];
n = glm::vec3(Far.x, Far.y, Far.z);
l = length(n);
planes[5] = Far/l;
// std::cout << "Far " << Far.x << " " << Far.y << " " <<Far.z << " " << Far.w << std::endl;
} | [
"cullen.caroline@gmail.com"
] | cullen.caroline@gmail.com |
91cf3b61f0f0329d020d9db846f13711251e43c5 | e1136e691dbfb5cbdf3f689e5e0a3e7fa1a49475 | /Pinion Studios Game Engine/Pinion Studios Game Engine/Creatures.cpp | af107a47f2bb8c99035c763e107c13688a9fd5aa | [] | no_license | finalgega/pinion-game-engine | 7461a061acaa05fff5db8c6974494e5c62434424 | 5909f060a56753d4422b314ce0d46a8e89189b36 | refs/heads/master | 2020-05-20T00:38:18.763581 | 2013-05-31T21:12:11 | 2013-05-31T21:12:11 | 33,353,844 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,111 | cpp | //
// Creatures.cpp
// PinionEngine
//
// Created by Aaron Goy on 26/7/12.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#include <iostream>
#include "Creature.h"
#include "Difficulty.h"
using namespace std;
PinionEngine::Creature::Creature()
{
set_health(0.0);
set_defense(0.0);
set_mana(0.0);
set_offense(0.0);
set_speed(0.0);
}
PinionEngine::Creature::Creature(string name,double health,double defense,double offense,double speed,double mana)
{
int factor = 1;
// if(Difficulty::get_difficulty() != NULL){
// factor = Difficulty::get_difficulty();}
this->name = name;
this->health = health * factor;
this->defense = defense * factor;
this->offense = offense * factor;
this->speed = speed * factor;
this->mana = mana * factor;
}
PinionEngine::Creature::~Creature()
{
}
void PinionEngine::Creature::set_name(string name)
{
this->name = name;
}
void PinionEngine::Creature::set_health(double health)
{
this->health = health;
}
void PinionEngine::Creature::set_defense(double defense)
{
this->defense = defense;
}
void PinionEngine::Creature::set_offense(double offense)
{
this->offense = offense;
}
void PinionEngine::Creature::set_speed(double speed)
{
this->speed = speed;
}
void PinionEngine::Creature::set_mana(double mana)
{
this->mana = mana;
}
string PinionEngine::Creature::get_name() const
{
return name;
}
double PinionEngine::Creature::get_health() const
{
return health;
}
double PinionEngine::Creature::get_defense() const
{
return defense;
}
double PinionEngine::Creature::get_offense() const
{
return offense;
}
double PinionEngine::Creature::get_speed() const
{
return speed;
}
double PinionEngine::Creature::get_mana()const
{
return mana;
}
void PinionEngine::Creature::display_creature_info() const
{
cout << get_name() << " stats are : " << endl << "Health : " << get_health() << endl << "Defense : " << get_defense() << endl << "Offense : " << get_offense() << endl << "Speed : " << get_speed() << endl << "Mana : " << get_mana() << endl;
}
| [
"finalgega@gmail.com@8f8b8528-1727-a522-fa71-3c2351a890a6"
] | finalgega@gmail.com@8f8b8528-1727-a522-fa71-3c2351a890a6 |
f178db4d9498f3ee61a793ce597ebd2e69d2a4a1 | 154ad9b7b26b5c52536bbd83cdaf0a359e6125c3 | /chrome/browser/usb/web_usb_detector.cc | 3687fdb3ab6a16241854811fa1b2ce2c1a477e26 | [
"BSD-3-Clause"
] | permissive | bopopescu/jstrace | 6cc239d57e3a954295b67fa6b8875aabeb64f3e2 | 2069a7b0a2e507a07cd9aacec4d9290a3178b815 | refs/heads/master | 2021-06-14T09:08:34.738245 | 2017-05-03T23:17:06 | 2017-05-03T23:17:06 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,004 | cc | // Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/usb/web_usb_detector.h"
#include <utility>
#include "base/macros.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/net/referrer.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/scoped_tabbed_browser_displayer.h"
#include "chrome/grit/generated_resources.h"
#include "chrome/grit/theme_resources.h"
#include "content/public/common/origin_util.h"
#include "device/core/device_client.h"
#include "device/usb/usb_device.h"
#include "device/usb/usb_ids.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/page_transition_types.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/window_open_disposition.h"
#include "ui/gfx/image/image.h"
#include "ui/message_center/message_center.h"
#include "ui/message_center/notification.h"
#include "ui/message_center/notification_delegate.h"
#include "url/gurl.h"
#if defined(OS_CHROMEOS)
#include "ash/common/system/system_notifier.h" // nogncheck
#endif
namespace {
// The WebUSB notification should be displayed for all profiles. On ChromeOS
// that requires its notifier ID to be known by Ash so that it is not blocked in
// multi-profile mode.
#if defined(OS_CHROMEOS)
#define kNotifierWebUsb ash::system_notifier::kNotifierWebUsb
#else
const char kNotifierWebUsb[] = "webusb.connected";
#endif
// Reasons the notification may be closed. These are used in histograms so do
// not remove/reorder entries. Only add at the end just before
// WEBUSB_NOTIFICATION_CLOSED_MAX. Also remember to update the enum listing in
// tools/metrics/histograms/histograms.xml.
enum WebUsbNotificationClosed {
// The notification was dismissed but not by the user (either automatically
// or because the device was unplugged).
WEBUSB_NOTIFICATION_CLOSED,
// The user closed the notification.
WEBUSB_NOTIFICATION_CLOSED_BY_USER,
// The user clicked on the notification.
WEBUSB_NOTIFICATION_CLOSED_CLICKED,
// Maximum value for the enum.
WEBUSB_NOTIFICATION_CLOSED_MAX
};
void RecordNotificationClosure(WebUsbNotificationClosed disposition) {
UMA_HISTOGRAM_ENUMERATION("WebUsb.NotificationClosed", disposition,
WEBUSB_NOTIFICATION_CLOSED_MAX);
}
Browser* GetBrowser() {
chrome::ScopedTabbedBrowserDisplayer browser_displayer(
ProfileManager::GetActiveUserProfile());
DCHECK(browser_displayer.browser());
return browser_displayer.browser();
}
void OpenURL(const GURL& url) {
GetBrowser()->OpenURL(content::OpenURLParams(
url, content::Referrer(), NEW_FOREGROUND_TAB,
ui::PAGE_TRANSITION_AUTO_TOPLEVEL, false /* is_renderer_initialized */));
}
// Delegate for webusb notification
class WebUsbNotificationDelegate : public message_center::NotificationDelegate {
public:
WebUsbNotificationDelegate(const GURL& landing_page,
const std::string& notification_id)
: landing_page_(landing_page), notification_id_(notification_id) {}
void Click() override {
clicked_ = true;
OpenURL(landing_page_);
message_center::MessageCenter::Get()->RemoveNotification(
notification_id_, false /* by_user */);
}
void Close(bool by_user) override {
if (clicked_)
RecordNotificationClosure(WEBUSB_NOTIFICATION_CLOSED_CLICKED);
else if (by_user)
RecordNotificationClosure(WEBUSB_NOTIFICATION_CLOSED_BY_USER);
else
RecordNotificationClosure(WEBUSB_NOTIFICATION_CLOSED);
}
private:
~WebUsbNotificationDelegate() override = default;
GURL landing_page_;
std::string notification_id_;
bool clicked_ = false;
DISALLOW_COPY_AND_ASSIGN(WebUsbNotificationDelegate);
};
} // namespace
WebUsbDetector::WebUsbDetector() : observer_(this) {
Initialize();
}
WebUsbDetector::~WebUsbDetector() {}
void WebUsbDetector::Initialize() {
device::UsbService* usb_service =
device::DeviceClient::Get()->GetUsbService();
if (!usb_service)
return;
observer_.Add(usb_service);
}
void WebUsbDetector::OnDeviceAdded(scoped_refptr<device::UsbDevice> device) {
const base::string16& product_name = device->product_string();
if (product_name.empty()) {
return;
}
const GURL& landing_page = device->webusb_landing_page();
if (!landing_page.is_valid() || !content::IsOriginSecure(landing_page)) {
return;
}
std::string notification_id = device->guid();
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
message_center::RichNotificationData rich_notification_data;
std::unique_ptr<message_center::Notification> notification(
new message_center::Notification(
message_center::NOTIFICATION_TYPE_SIMPLE, notification_id,
l10n_util::GetStringFUTF16(
IDS_WEBUSB_DEVICE_DETECTED_NOTIFICATION_TITLE, product_name),
l10n_util::GetStringFUTF16(
IDS_WEBUSB_DEVICE_DETECTED_NOTIFICATION,
base::UTF8ToUTF16(landing_page.GetContent())),
rb.GetNativeImageNamed(IDR_USB_NOTIFICATION_ICON), base::string16(),
GURL(),
message_center::NotifierId(
message_center::NotifierId::SYSTEM_COMPONENT, kNotifierWebUsb),
rich_notification_data,
new WebUsbNotificationDelegate(landing_page, notification_id)));
notification->SetSystemPriority();
message_center::MessageCenter::Get()->AddNotification(
std::move(notification));
}
void WebUsbDetector::OnDeviceRemoved(scoped_refptr<device::UsbDevice> device) {
std::string notification_id = device->guid();
message_center::MessageCenter* message_center =
message_center::MessageCenter::Get();
if (message_center->FindVisibleNotificationById(notification_id)) {
message_center->RemoveNotification(notification_id, false /* by_user */);
}
}
| [
"zzbthechaos@gmail.com"
] | zzbthechaos@gmail.com |
c0700bae2a3765ab46408a65dabe7ff02f515831 | a2d4ea5f6ddf1198a9e6f0a9f977da5ae9593b84 | /components/RdUtils/test/jsmnr_test.cpp | e0e0d9c424a8705d0b03e1805eba785e3615c112 | [
"MIT"
] | permissive | robdobsn/RdUtils | a3f22b1a4fc43cdb15f3e2918097ef2b6368fcdc | 366986f45e286ac33e11cca2eab47a31a33b71ce | refs/heads/main | 2023-08-29T09:49:50.247150 | 2021-11-07T22:24:02 | 2021-11-07T22:24:02 | 425,602,904 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 18,148 | cpp | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Unit tests of JSON parser
// Original https://github.com/zserge/jsmn
//
// Rob Dobson 2017-2020
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <jsmnR.h>
#include <Logger.h>
#include "unity.h"
static const char* MODULE_PREFIX = "ExprUnitTest";
static const int ERROR_PARSE_RESULT_ERROR = 10;
static const int ERROR_TOKEN_TYPE_ERROR = 11;
static const int ERROR_TOKEN_START_ERROR = 12;
static const int ERROR_TOKEN_END_ERROR = 13;
static const int ERROR_TOKEN_SIZE_ERROR = 14;
static const int ERROR_TOKEN_VALUE_ERROR = 15;
static int vtokeq(const char *s, jsmntok_t *t, unsigned long numtok,
va_list ap) {
if (numtok > 0) {
unsigned long i;
int start, end, size;
jsmntype_t type;
char *value;
size = -1;
value = NULL;
for (i = 0; i < numtok; i++) {
type = (jsmntype_t)va_arg(ap, int);
if (type == JSMN_STRING) {
value = va_arg(ap, char *);
size = va_arg(ap, int);
start = end = -1;
} else if (type == JSMN_PRIMITIVE) {
value = va_arg(ap, char *);
start = end = size = -1;
} else {
start = va_arg(ap, int);
end = va_arg(ap, int);
size = va_arg(ap, int);
value = NULL;
}
if (t[i].type != type) {
LOG_I(MODULE_PREFIX, "token %lu type is %d, not %d", i, t[i].type, type);
return ERROR_TOKEN_TYPE_ERROR;
}
if (start != -1 && end != -1) {
if (t[i].start != start) {
LOG_I(MODULE_PREFIX, "token %lu start is %d, not %d", i, t[i].start, start);
return ERROR_TOKEN_START_ERROR;
}
if (t[i].end != end) {
LOG_I(MODULE_PREFIX, "token %lu end is %d, not %d", i, t[i].end, end);
return ERROR_TOKEN_END_ERROR;
}
}
if (size != -1 && t[i].size != size) {
LOG_I(MODULE_PREFIX, "token %lu size is %d, not %d", i, t[i].size, size);
return ERROR_TOKEN_SIZE_ERROR;
}
if (s != NULL && value != NULL) {
const char *p = s + t[i].start;
if (strlen(value) != (unsigned long)(t[i].end - t[i].start) ||
strncmp(p, value, t[i].end - t[i].start) != 0) {
LOG_I(MODULE_PREFIX, "token %lu value is %.*s, not %s\n", i, t[i].end - t[i].start,
s + t[i].start, value);
return ERROR_TOKEN_VALUE_ERROR;
}
}
}
}
return JSMN_SUCCESS;
}
static int tokeq(const char *s, jsmntok_t *tokens, unsigned long numtok, ...) {
int ok;
va_list args;
va_start(args, numtok);
ok = vtokeq(s, tokens, numtok, args);
va_end(args);
return ok;
}
static int parse(const char *s, int status, unsigned long numtok, ...) {
jsmntok_t *t = (jsmntok_t*)malloc(numtok * sizeof(jsmntok_t));
jsmn_parser p;
jsmn_init(&p);
int r = jsmn_parse(&p, s, strlen(s), t, numtok);
if (r != status) {
LOG_I(MODULE_PREFIX, "status is %d, not %d\n", r, status);
return ERROR_PARSE_RESULT_ERROR;
}
jsmnerr_t rslt = JSMN_SUCCESS;
if (status >= 0) {
va_list args;
va_start(args, numtok);
rslt = (jsmnerr_t) vtokeq(s, t, numtok, args);
va_end(args);
}
free(t);
return rslt;
}
TEST_CASE("test_empty", "[jsmnr]")
{
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("{}", 1, 1, JSMN_OBJECT, 0, 2, 0), "empty object");
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("[]", 1, 1, JSMN_ARRAY, 0, 2, 0), "empty array");
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("[{},{}]", 3, 3, JSMN_ARRAY, 0, 7, 2, JSMN_OBJECT, 1, 3, 0,
JSMN_OBJECT, 4, 6, 0), "empty array of empty objects");
}
TEST_CASE("test_object", "[jsmnr]")
{
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("{\"a\":0}", 3, 3, JSMN_OBJECT, 0, 7, 1, JSMN_STRING, "a", 1,
JSMN_PRIMITIVE, "0"), "member primitive");
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("{\"a\":[]}", 3, 3, JSMN_OBJECT, 0, 8, 1, JSMN_STRING, "a", 1,
JSMN_ARRAY, 5, 7, 0), "member array");
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("{\"a\":{},\"b\":{}}", 5, 5, JSMN_OBJECT, -1, -1, 2, JSMN_STRING,
"a", 1, JSMN_OBJECT, -1, -1, 0, JSMN_STRING, "b", 1, JSMN_OBJECT,
-1, -1, 0), "member object");
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("{\n \"Day\": 26,\n \"Month\": 9,\n \"Year\": 12\n }", 7, 7,
JSMN_OBJECT, -1, -1, 3, JSMN_STRING, "Day", 1, JSMN_PRIMITIVE,
"26", JSMN_STRING, "Month", 1, JSMN_PRIMITIVE, "9", JSMN_STRING,
"Year", 1, JSMN_PRIMITIVE, "12"), "member primitives");
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("{\"a\": 0, \"b\": \"c\"}", 5, 5, JSMN_OBJECT, -1, -1, 2,
JSMN_STRING, "a", 1, JSMN_PRIMITIVE, "0", JSMN_STRING, "b", 1,
JSMN_STRING, "c", 0), "member mixed");
}
TEST_CASE("test_strict", "[jsmnr]")
{
#ifdef JSMNR_STRICT
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("{\"a\"\n0}", JSMN_ERROR_INVAL, 3), "strict1");
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("{\"a\", 0}", JSMN_ERROR_INVAL, 3), "strict2");
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("{\"a\": {2}}", JSMN_ERROR_INVAL, 3), "strict3");
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("{\"a\": {2: 3}}", JSMN_ERROR_INVAL, 3), "strict4");
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("{\"a\": {\"a\": 2 3}}", JSMN_ERROR_INVAL, 5), "strict5");
/* FIXME */
/*TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("{\"a\"}", JSMN_ERROR_INVAL, 2));*/
/*TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("{\"a\": 1, \"b\"}", JSMN_ERROR_INVAL, 4));*/
/*TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("{\"a\",\"b\":1}", JSMN_ERROR_INVAL, 4));*/
/*TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("{\"a\":1,}", JSMN_ERROR_INVAL, 4));*/
/*TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("{\"a\":\"b\":\"c\"}", JSMN_ERROR_INVAL, 4));*/
/*TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("{,}", JSMN_ERROR_INVAL, 4));*/
#endif
}
TEST_CASE("test_array", "[jsmnr]")
{
/* FIXME */
/*TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("[10}", JSMN_ERROR_INVAL, 3));*/
/*TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("[1,,3]", JSMN_ERROR_INVAL, 3)*/
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("[10]", 2, 2, JSMN_ARRAY, -1, -1, 1, JSMN_PRIMITIVE, "10"), "array of primitive");
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("{\"a\": 1]", JSMN_ERROR_INVAL, 3), "unmatched brackets");
/* FIXME */
/*TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("[\"a\": 1]", JSMN_ERROR_INVAL, 3));*/
}
TEST_CASE("test_primitives", "[jsmnr]")
{
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("{\"boolVar\" : true }", 3, 3, JSMN_OBJECT, -1, -1, 1,
JSMN_STRING, "boolVar", 1, JSMN_PRIMITIVE, "true"), "boolVar true");
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("{\"boolVar\" : false }", 3, 3, JSMN_OBJECT, -1, -1, 1,
JSMN_STRING, "boolVar", 1, JSMN_PRIMITIVE, "false"), "boolVar false");
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("{\"nullVar\" : null }", 3, 3, JSMN_OBJECT, -1, -1, 1,
JSMN_STRING, "nullVar", 1, JSMN_PRIMITIVE, "null"), "nullVar");
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("{\"intVar\" : 12}", 3, 3, JSMN_OBJECT, -1, -1, 1, JSMN_STRING,
"intVar", 1, JSMN_PRIMITIVE, "12"), "intVar 12");
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("{\"floatVar\" : 12.345}", 3, 3, JSMN_OBJECT, -1, -1, 1,
JSMN_STRING, "floatVar", 1, JSMN_PRIMITIVE, "12.345"), "floatVar 12.345");
}
TEST_CASE("test_strings", "[jsmnr]")
{
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("{\"strVar\" : \"hello world\"}", 3, 3, JSMN_OBJECT, -1, -1, 1,
JSMN_STRING, "strVar", 1, JSMN_STRING, "hello world", 0), "strVar hello world");
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("{\"strVar\" : \"escapes: \\/\\r\\n\\t\\b\\f\\\"\\\\\"}", 3, 3,
JSMN_OBJECT, -1, -1, 1, JSMN_STRING, "strVar", 1, JSMN_STRING,
"escapes: \\/\\r\\n\\t\\b\\f\\\"\\\\", 0), "strVar escapes");
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("{\"strVar\": \"\"}", 3, 3, JSMN_OBJECT, -1, -1, 1, JSMN_STRING,
"strVar", 1, JSMN_STRING, "", 0), "strVar empty");
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("{\"a\":\"\\uAbcD\"}", 3, 3, JSMN_OBJECT, -1, -1, 1, JSMN_STRING,
"a", 1, JSMN_STRING, "\\uAbcD", 0), "strVar backslashU");
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("{\"a\":\"str\\u0000\"}", 3, 3, JSMN_OBJECT, -1, -1, 1,
JSMN_STRING, "a", 1, JSMN_STRING, "str\\u0000", 0), "strVar nullterminated");
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("{\"a\":\"\\uFFFFstr\"}", 3, 3, JSMN_OBJECT, -1, -1, 1,
JSMN_STRING, "a", 1, JSMN_STRING, "\\uFFFFstr", 0), "strVar maxUshort");
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("{\"a\":[\"\\u0280\"]}", 4, 4, JSMN_OBJECT, -1, -1, 1,
JSMN_STRING, "a", 1, JSMN_ARRAY, -1, -1, 1, JSMN_STRING,
"\\u0280", 0), "strVar backslashU280");
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("{\"a\":\"str\\uFFGFstr\"}", JSMN_ERROR_INVAL, 3), "strVar muckedup1");
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("{\"a\":\"str\\u@FfF\"}", JSMN_ERROR_INVAL, 3), "strVar muckedup2");
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse("{{\"a\":[\"\\u028\"]}", JSMN_ERROR_INVAL, 4), "strVar muckedup3");
}
TEST_CASE("test_partial_string", "[jsmnr]")
{
int r;
unsigned long i;
jsmn_parser p;
jsmntok_t tok[5];
const char *js = "{\"x\": \"va\\\\ue\", \"y\": \"value y\"}";
jsmn_init(&p);
for (i = 1; i <= strlen(js); i++) {
r = jsmn_parse(&p, js, i, tok, sizeof(tok) / sizeof(tok[0]));
if (i == strlen(js)) {
TEST_ASSERT_MESSAGE(r == 5, "strlen fail 5");
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == tokeq(js, tok, 5, JSMN_OBJECT, -1, -1, 2, JSMN_STRING, "x", 1,
JSMN_STRING, "va\\\\ue", 0, JSMN_STRING, "y", 1, JSMN_STRING,
"value y", 0), "weirdstring");
} else {
TEST_ASSERT_MESSAGE(r == JSMN_ERROR_PART,"strlen fail other");
}
}
}
TEST_CASE("test_partial_array", "[jsmnr]")
{
#ifdef JSMNR_STRICT
int r;
unsigned long i;
jsmn_parser p;
jsmntok_t tok[10];
const char *js = "[ 1, true, [123, \"hello\"]]";
jsmn_init(&p);
for (i = 1; i <= strlen(js); i++) {
r = jsmn_parse(&p, js, i, tok, sizeof(tok) / sizeof(tok[0]));
if (i == strlen(js)) {
TEST_ASSERT_MESSAGE(r == 6, "strlen 6");
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == tokeq(js, tok, 6, JSMN_ARRAY, -1, -1, 3, JSMN_PRIMITIVE, "1",
JSMN_PRIMITIVE, "true", JSMN_ARRAY, -1, -1, 2, JSMN_PRIMITIVE,
"123", JSMN_STRING, "hello", 0), "not hello");
} else {
TEST_ASSERT_MESSAGE(r == JSMN_ERROR_PART, "strlen other 6");
}
}
#endif
}
TEST_CASE("test_array_nomem", "[jsmnr]")
{
int i;
int r;
jsmn_parser p;
jsmntok_t toksmall[10], toklarge[10];
const char *js;
js = " [ 1, true, [123, \"hello\"]]";
for (i = 0; i < 6; i++) {
jsmn_init(&p);
memset(toksmall, 0, sizeof(toksmall));
memset(toklarge, 0, sizeof(toklarge));
r = jsmn_parse(&p, js, strlen(js), toksmall, i);
TEST_ASSERT_MESSAGE(r == JSMN_ERROR_NOMEM, "nomem");
memcpy(toklarge, toksmall, sizeof(toksmall));
r = jsmn_parse(&p, js, strlen(js), toklarge, 10);
TEST_ASSERT_MESSAGE(r >= 0, "parse result > 0");
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == tokeq(js, toklarge, 4, JSMN_ARRAY, -1, -1, 3, JSMN_PRIMITIVE, "1",
JSMN_PRIMITIVE, "true", JSMN_ARRAY, -1, -1, 2, JSMN_PRIMITIVE,
"123", JSMN_STRING, "hello", 0), "gotok");
}
}
TEST_CASE("test_unquoted_keys", "[jsmnr]")
{
#ifndef JSMNR_STRICT
int r;
jsmn_parser p;
jsmntok_t tok[10];
const char *js;
jsmn_init(&p);
js = "key1: \"value\"\nkey2 : 123";
r = jsmn_parse(&p, js, strlen(js), tok, 10);
TEST_ASSERT_MESSAGE(r >= 0, "parse unquoted fail");
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == tokeq(js, tok, 4, JSMN_PRIMITIVE, "key1", JSMN_STRING, "value", 0,
JSMN_PRIMITIVE, "key2", JSMN_PRIMITIVE, "123"), "parse unquoted fail2");
#endif
}
TEST_CASE("test_issue_22", "[jsmnr]")
{
int r;
jsmn_parser p;
jsmntok_t tokens[128];
const char *js;
js =
"{ \"height\":10, \"layers\":[ { \"data\":[6,6], \"height\":10, "
"\"name\":\"Calque de Tile 1\", \"opacity\":1, \"type\":\"tilelayer\", "
"\"visible\":true, \"width\":10, \"x\":0, \"y\":0 }], "
"\"orientation\":\"orthogonal\", \"properties\": { }, \"tileheight\":32, "
"\"tilesets\":[ { \"firstgid\":1, \"image\":\"..\\/images\\/tiles.png\", "
"\"imageheight\":64, \"imagewidth\":160, \"margin\":0, "
"\"name\":\"Tiles\", "
"\"properties\":{}, \"spacing\":0, \"tileheight\":32, \"tilewidth\":32 "
"}], "
"\"tilewidth\":32, \"version\":1, \"width\":10 }";
jsmn_init(&p);
r = jsmn_parse(&p, js, strlen(js), tokens, 128);
TEST_ASSERT_MESSAGE(r >= 0, "issue22");
}
TEST_CASE("test_issue_27", "[jsmnr]")
{
const char *js =
"{ \"name\" : \"Jack\", \"age\" : 27 } { \"name\" : \"Anna\", ";
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse(js, JSMN_ERROR_PART, 8), "issue27");
}
TEST_CASE("test_input_length", "[jsmnr]")
{
const char *js;
int r;
jsmn_parser p;
jsmntok_t tokens[10];
js = "{\"a\": 0}garbage";
jsmn_init(&p);
r = jsmn_parse(&p, js, 8, tokens, 10);
TEST_ASSERT_MESSAGE(r == 3, "garbage1");
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == tokeq(js, tokens, 3, JSMN_OBJECT, -1, -1, 1, JSMN_STRING, "a", 1,
JSMN_PRIMITIVE, "0"), "garbage2");
}
TEST_CASE("test_count", "[jsmnr]")
{
jsmn_parser p;
const char *js;
js = "{}";
jsmn_init(&p);
TEST_ASSERT_MESSAGE(jsmn_parse(&p, js, strlen(js), NULL, 0) == 1, "count1");
js = "[]";
jsmn_init(&p);
TEST_ASSERT_MESSAGE(jsmn_parse(&p, js, strlen(js), NULL, 0) == 1, "count2");
js = "[[]]";
jsmn_init(&p);
TEST_ASSERT_MESSAGE(jsmn_parse(&p, js, strlen(js), NULL, 0) == 2, "count3");
js = "[[], []]";
jsmn_init(&p);
TEST_ASSERT_MESSAGE(jsmn_parse(&p, js, strlen(js), NULL, 0) == 3, "count4");
js = "[[], []]";
jsmn_init(&p);
TEST_ASSERT_MESSAGE(jsmn_parse(&p, js, strlen(js), NULL, 0) == 3, "count5");
js = "[[], [[]], [[], []]]";
jsmn_init(&p);
TEST_ASSERT_MESSAGE(jsmn_parse(&p, js, strlen(js), NULL, 0) == 7, "count6");
js = "[\"a\", [[], []]]";
jsmn_init(&p);
TEST_ASSERT_MESSAGE(jsmn_parse(&p, js, strlen(js), NULL, 0) == 5, "count7");
js = "[[], \"[], [[]]\", [[]]]";
jsmn_init(&p);
TEST_ASSERT_MESSAGE(jsmn_parse(&p, js, strlen(js), NULL, 0) == 5, "count8");
js = "[1, 2, 3]";
jsmn_init(&p);
TEST_ASSERT_MESSAGE(jsmn_parse(&p, js, strlen(js), NULL, 0) == 4, "count9");
js = "[1, 2, [3, \"a\"], null]";
jsmn_init(&p);
TEST_ASSERT_MESSAGE(jsmn_parse(&p, js, strlen(js), NULL, 0) == 7, "count10");
}
TEST_CASE("test_nonstrict", "[jsmnr]")
{
#ifndef JSMNR_STRICT
const char *js;
js = "a: 0garbage";
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse(js, 2, 2, JSMN_PRIMITIVE, "a", JSMN_PRIMITIVE, "0garbage"), "nonstrict garbage");
js = "Day : 26\nMonth : Sep\n\nYear: 12";
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse(js, 6, 6, JSMN_PRIMITIVE, "Day", JSMN_PRIMITIVE, "26",
JSMN_PRIMITIVE, "Month", JSMN_PRIMITIVE, "Sep", JSMN_PRIMITIVE,
"Year", JSMN_PRIMITIVE, "12"), "nonstrict sep");
/* nested {s don't cause a parse error. */
js = "\"key {1\": 1234";
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse(js, 2, 2, JSMN_STRING, "key {1", 1, JSMN_PRIMITIVE, "1234"), "nonstrict keyerr");
#endif
}
TEST_CASE("test_unmatched_brackets", "[jsmnr]")
{
const char *js;
js = "\"key 1\": 1234}";
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse(js, JSMN_ERROR_INVAL, 2), "unmatched 1");
js = "{\"key 1\": 1234";
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse(js, JSMN_ERROR_PART, 3), "unmatched 2");
js = "{\"key 1\": 1234}}";
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse(js, JSMN_ERROR_INVAL, 3), "unmatched 3");
js = "\"key 1\"}: 1234";
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse(js, JSMN_ERROR_INVAL, 3), "unmatched 4");
js = "{\"key {1\": 1234}";
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse(js, 3, 3, JSMN_OBJECT, 0, 16, 1, JSMN_STRING, "key {1", 1,
JSMN_PRIMITIVE, "1234"), "unmatched 5");
js = "{\"key 1\":{\"key 2\": 1234}";
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse(js, JSMN_ERROR_PART, 5), "unmatched 6");
}
TEST_CASE("test_object2", "[jsmnr]")
{
const char *js;
js = "{\"key\": 1}";
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse(js, 3, 3, JSMN_OBJECT, 0, 10, 1, JSMN_STRING, "key", 1,
JSMN_PRIMITIVE, "1"), "object1");
#ifdef JSMNR_STRICT
js = "{true: 1}";
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse(js, JSMN_ERROR_INVAL, 3), "object2");
js = "{1: 1}";
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse(js, JSMN_ERROR_INVAL, 3), "object3");
js = "{{\"key\": 1}: 2}";
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse(js, JSMN_ERROR_INVAL, 5), "object4");
js = "{[1,2]: 2}";
TEST_ASSERT_MESSAGE(JSMN_SUCCESS == parse(js, JSMN_ERROR_INVAL, 5), "object5");
#endif
}
// int main(void) {
// test(test_empty, "test for a empty JSON objects/arrays");
// test(test_object, "test for a JSON objects");
// test(test_array, "test for a JSON arrays");
// test(test_primitive, "test primitive JSON data types");
// test(test_string, "test string JSON data types");
// test(test_partial_string, "test partial JSON string parsing");
// test(test_partial_array, "test partial array reading");
// test(test_array_nomem, "test array reading with a smaller number of tokens");
// test(test_unquoted_keys, "test unquoted keys (like in JavaScript)");
// test(test_input_length, "test strings that are not null-terminated");
// test(test_issue_22, "test issue #22");
// test(test_issue_27, "test issue #27");
// test(test_count, "test tokens count estimation");
// test(test_nonstrict, "test for non-strict mode");
// test(test_unmatched_brackets, "test for unmatched brackets");
// test(test_object_key, "test for key type");
// printf("\nPASSED: %d\nFAILED: %d\n", test_passed, test_failed);
// return (test_failed > 0);
// } | [
"rob@dobson.com"
] | rob@dobson.com |
2a741749ad187f630ff57e43e6109a75875d5dc4 | f26833e0ab0f0b40fea94122cfc2186402893902 | /src/main.cc | 7ca4fd96839090c5dd826dd0aa60969019bc841a | [] | no_license | quentin-dev/microengine | ba2d3bf52c9f7da9ac72cc7d8e889e5044b4459f | 24514cb20f1de6a4b9bab4c687868bde88ec5f60 | refs/heads/master | 2022-09-06T21:59:31.944562 | 2020-05-29T22:43:13 | 2020-05-29T22:43:13 | 266,643,833 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 869 | cc | #include "Engine/Engine.hh"
#include "Engine/Options/Cli.hh"
#include <iostream>
#include "Engine/Settings/EngineSettings.hh"
namespace boostpo = boost::program_options;
int main(int argc, const char *argv[])
{
options::Cli cli;
cli.setUp();
try
{
cli.parse(argc, argv);
}
catch(const std::exception& e)
{
std::cerr << e.what() << '\n';
return 1;
}
cli.execute();
settings::EngineSettings settings;
settings.settingsFile = cli.vm["settings-file"].as<const std::string>();
settings.settingsFormat = cli.vm["settings-format"].as<const std::string>();
settings.disableGraphics = cli.vm["disable-graphics"].as<bool>();
engine::Engine engine;
engine.setUp(settings);
if (!cli.vm["dry-run"].as<bool>())
{
engine.run();
}
engine.tearDown();
return 0;
} | [
"quentin.barbarat@epita.fr"
] | quentin.barbarat@epita.fr |
056b7e1ff343e8920e7b555afaafc5e060403bd9 | c73b0429349dc635717f98f2d7f8ab2ddda7e05b | /Public/ManagedPipeline.h | e90e13f6e3a36cf4f4d0c29600da0b75394cc518 | [
"BSD-2-Clause"
] | permissive | cyj0912/RHI | 557f3e10e72eb4945fb69cd67c88e689e5f3e7c8 | 70205931d4bdf716acaec02389b9933f72ab6c58 | refs/heads/master | 2020-05-09T00:15:08.975128 | 2019-05-29T05:51:05 | 2019-05-29T05:51:05 | 180,974,324 | 19 | 3 | BSD-2-Clause | 2019-04-26T08:40:21 | 2019-04-12T09:17:45 | C++ | UTF-8 | C++ | false | false | 1,030 | h | #pragma once
#include "DescriptorSet.h"
#include "Pipeline.h"
#include "RenderContext.h"
#include "ShaderModule.h"
#include <array>
#include <map>
namespace RHI
{
// Basically the same thing as CPipeline, except you don't have to manually manage descriptor sets
// anymore
class CManagedPipeline
{
public:
typedef std::shared_ptr<CManagedPipeline> Ref;
CManagedPipeline(CDevice& device, CPipelineDesc& desc);
CManagedPipeline(CDevice& device, CComputePipelineDesc& desc);
CPipeline::Ref Get() const { return Pipeline; }
CDescriptorSet::Ref CreateDescriptorSet(uint32_t set) const;
std::vector<CDescriptorSet::Ref> CreateDescriptorSets() const;
private:
void InitLayouts(CDevice& device);
void ReflectShaderModule(const CShaderModule::Ref& shaderModule);
// Reflection data
std::map<std::pair<uint32_t, uint32_t>, CPipelineResource> ResourceByBinding;
std::vector<CDescriptorSetLayout::Ref> SetLayouts;
CPipelineLayout::Ref PipelineLayout;
CPipeline::Ref Pipeline;
};
}
| [
"chenyanjun912@hotmail.com"
] | chenyanjun912@hotmail.com |
1ff01c78389209711bcf5691fb09a26a646b3c0f | b68d2605ab88242f2bd5f2dce0462899e0f995ae | /ImpGears/PipelineES3/GlError.h | 19f04b4b4c90a2daa3e33a80ada74bcf51c1345f | [
"MIT"
] | permissive | Lut1n/IGBarkAndLeafEditor | 388e68257813bfb632db76e1bb86f535cab95f52 | bbda30f6f4510da4184dc6f6d9db698f81dea519 | refs/heads/master | 2021-03-19T05:23:59.704792 | 2020-03-14T09:13:07 | 2020-03-14T09:13:07 | 247,136,355 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,542 | h | #ifndef GLCOMMON_H_INCLUDED
#define GLCOMMON_H_INCLUDED
// #define GLEW_STATIC
// #include <GL/glew.h>
// #include <GL/gl.h>
#include <QOpenGLFunctions>
#include <QOpenGLExtraFunctions>
#include <GLES3/gl3.h>
#include <iostream>
#include <QDebug>
#define GL_CHECKERROR(msg) GLcheckError(msg, __FILE__, __LINE__)
#define ENUM_TO_STR(enumVar, testVal, str) if(enumVar == testVal) str = #testVal ;
inline void glErrToString(GLenum error, std::string& string)
{
string = "opengl unknown error.";
ENUM_TO_STR(error, GL_NO_ERROR, string)
ENUM_TO_STR(error, GL_INVALID_ENUM, string)
ENUM_TO_STR(error, GL_INVALID_VALUE, string)
ENUM_TO_STR(error, GL_INVALID_OPERATION, string)
ENUM_TO_STR(error, GL_INVALID_FRAMEBUFFER_OPERATION, string)
ENUM_TO_STR(error, GL_OUT_OF_MEMORY, string)
// ENUM_TO_STR(error, GL_STACK_UNDERFLOW, string)
// ENUM_TO_STR(error, GL_STACK_OVERFLOW, string)
}
inline bool GLcheckError(const std::string& debugMsg, const char* file, int line)
{
bool res = true;
GLenum error = glGetError();
if(error != GL_NO_ERROR)
{
res = false;
std::string strErr;
glErrToString(error, strErr);
// std::cout << "[impError] " << debugMsg << " - GL error in " << file << " at line " << line << std::endl;
// std::cout << strErr << std::endl;
qDebug() << "[impError] " << debugMsg.c_str() << " - GL error in " << file << " at line " << line;
qDebug() << strErr.c_str();
}
return res;
}
#endif // GLCOMMON_H_INCLUDED
| [
"mathieu.boulet.44@gmail.com"
] | mathieu.boulet.44@gmail.com |
b7b2936361ed70e62eb08cc6aee746b262a86bf4 | 3b1c89d1bdd1c39763bc015c7862579d16ba8b96 | /lib/io/io.cpp | 5af5da1d69c76a1b29fd266e8b0b104b85ec833b | [] | no_license | caandewiel/PVK-Engine-Reloaded | f1b47436df4454fdaa7b54178d0b0986309110fc | 2c6741018e3229461356bc28a93eaec823baf413 | refs/heads/main | 2023-06-18T03:30:02.545958 | 2021-07-18T12:50:46 | 2021-07-18T12:50:46 | 373,639,436 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 680 | cpp | #include "io.hpp"
#include <memory>
#include <string.h>
namespace pvk::io
{
std::vector<uint32_t> readFile(const std::string &filename)
{
std::ifstream file(filename, std::ios::ate | std::ios::binary);
if (!file.is_open())
{
throw std::runtime_error("Could not open file.");
}
size_t fileSize = static_cast<size_t>(file.tellg());
std::vector<char> buffer(fileSize);
file.seekg(0);
file.read(buffer.data(), fileSize);
file.close();
std::vector<uint32_t> convertedBuffer(buffer.size() / sizeof(uint32_t));
memcpy(convertedBuffer.data(), buffer.data(), buffer.size());
return convertedBuffer;
}
} // namespace pvk::io
| [
"m.c.aandewiel@gmail.com"
] | m.c.aandewiel@gmail.com |
9d2d0b5b5af8c833eef9e9a201a2ced43263e262 | ecf360502e223b234807c0a693db91737337df29 | /C++/14/stacktp1.h | 8488812d1159f808639f3ac7b0dd112f650538c9 | [] | no_license | daveleung/DL | 7007ad7d970ed26b0a2ef4d9ce4c15836a009cd8 | d5e712909fc73bc9d42fcb5e640a7c9156b5d34f | refs/heads/master | 2021-09-11T21:07:28.461835 | 2018-01-22T03:16:29 | 2018-01-22T03:16:29 | 108,968,136 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,304 | h | #ifndef STACKTP_H_
#define STACKTP_H_
template <class Type>
class Stack
{
private:
enum {MAX = 10};
int stacksize;
Type *items;
int top;
public:
explicit Stack(int ss = 10);
Stack(const Stack & st);
~Stack() { delete [] items;}
bool isempty() {return top == 0;}
bool isfull() {return top == stacksize;}
bool push(const Type & item);
bool pop(Type & item);
Stack & operator=(const Stack & st);
};
template <class Type>
Stack<Type>::Stack(int ss) : stacksize(ss), top(0)
{
items = new Type [stacksize];
}
template <class Type>
Stack<Type>::Stack(const Stack & st)
{
stacksize = st.stacksize;
top = st.top;
items = new Type [stacksize];
for (int i = 0; i < top; i++)
items[i] = st.items[i];
}
template <class Type>
bool Stack<Type>::push(const Type & item)
{
if (top < stacksize)
{
items[top++] = item;
return true;
}
else
return false;
}
template <class Type>
bool Stack<Type>::pop(Type & item)
{
if (top > 0)
{
item = items[--top];
return true;
}
else
return false;
}
template <class Type>
Stack<Type> & Stack<Type>::operator=(const Stack<Type> & st)
{
if (this == &st)
return *this;
delete [] items;
stacksize = st.stacksize;
top = st.top;
items = new Type [stacksize];
for (int i = 0; i < top; i++)
items[i] = st.items[i];
return *this;
}
#endif | [
"leungdavid989@gmail.com"
] | leungdavid989@gmail.com |
352fc01bb87988ca840fbbd768a782c9a7a8720d | 09f596ad590ace740ed556e8d4de9875cd4af1b6 | /AudioSynthesisAndSpeech/mario_song_on_pin_8/mario_song_on_pin_8.ino | 2b365c2251348724fb8e4f8ab4a07a0e6ec70d68 | [] | no_license | zoomx/ArduinoHome | 8d1f8946cf241e9f57f9a28402b6c563e281841b | 163cc52a85bab2fa80c4d121fe4ba57aaa70bc81 | refs/heads/master | 2021-01-18T15:08:15.736644 | 2016-03-05T18:07:30 | 2016-03-05T18:07:30 | 53,214,744 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,643 | ino | // Video available here http://www.youtube.com/watch?v=vm04Z1-EFeI
void setup()
{
}
void loop()
{
tone(8, 660, 100);
delay(75); tone(8, 660, 100);
delay(150); tone(8, 660, 100);
delay(150); tone(8, 510, 100);
delay(50); tone(8, 660, 100);
delay(150); tone(8, 770, 100);
delay(275); tone(8, 380, 100);
delay(287); tone(8, 510, 100);
delay(225); tone(8, 380, 100);
delay(200); tone(8, 320, 100);
delay(250); tone(8, 440, 100);
delay(150); tone(8, 480, 80);
delay(165); tone(8, 450, 100);
delay(75); tone(8, 430, 100);
delay(150); tone(8, 380, 100);
delay(100); tone(8, 660, 80);
delay(100); tone(8, 760, 50);
delay(75); tone(8, 860, 100);
delay(150); tone(8, 700, 80);
delay(75); tone(8, 760, 50);
delay(175); tone(8, 660, 80);
delay(150); tone(8, 520, 80);
delay(75); tone(8, 580, 80);
delay(75); tone(8, 480, 80);
delay(175); tone(8, 510, 100);
delay(275); tone(8, 380, 100);
delay(200); tone(8, 320, 100);
delay(250); tone(8, 440, 100);
delay(150); tone(8, 480, 80);
delay(165); tone(8, 450, 100);
delay(75); tone(8, 430, 100);
delay(150); tone(8, 380, 100);
delay(100); tone(8, 660, 80);
delay(100); tone(8, 760, 50);
delay(75); tone(8, 860, 100);
delay(150); tone(8, 700, 80);
delay(75); tone(8, 760, 50);
delay(175); tone(8, 660, 80);
delay(150); tone(8, 520, 80);
delay(75); tone(8, 580, 80);
delay(75); tone(8, 480, 80);
delay(250); tone(8, 500, 100);
delay(150); tone(8, 760, 100);
delay(50); tone(8, 720, 100);
delay(75); tone(8, 680, 100);
delay(75); tone(8, 620, 150);
delay(150); tone(8, 650, 150);
delay(150); tone(8, 380, 100);
delay(75); tone(8, 430, 100);
delay(75); tone(8, 500, 100);
delay(150); tone(8, 430, 100);
delay(75); tone(8, 500, 100);
delay(50); tone(8, 570, 100);
delay(110); tone(8, 500, 100);
delay(150); tone(8, 760, 100);
delay(50); tone(8, 720, 100);
delay(75); tone(8, 680, 100);
delay(75); tone(8, 620, 150);
delay(150); tone(8, 650, 200);
delay(150); tone(8, 1020, 80);
delay(150); tone(8, 1020, 80);
delay(75); tone(8, 1020, 80);
delay(150); tone(8, 380, 100);
delay(150); tone(8, 500, 100);
delay(150); tone(8, 760, 100);
delay(50); tone(8, 720, 100);
delay(75); tone(8, 680, 100);
delay(75); tone(8, 620, 150);
delay(150); tone(8, 650, 150);
delay(150); tone(8, 380, 100);
delay(75); tone(8, 430, 100);
delay(75); tone(8, 500, 100);
delay(150); tone(8, 430, 100);
delay(75); tone(8, 500, 100);
delay(50); tone(8, 570, 100);
delay(110); tone(8, 500, 100);
delay(150); tone(8, 760, 100);
delay(50); tone(8, 720, 100);
delay(75); tone(8, 680, 100);
delay(75); tone(8, 620, 150);
delay(150); tone(8, 650, 200);
delay(150); tone(8, 1020, 80);
delay(150); tone(8, 1020, 80);
delay(75); tone(8, 1020, 80);
delay(150); tone(8, 380, 100);
delay(150); tone(8, 500, 100);
delay(150); tone(8, 760, 100);
delay(50); tone(8, 720, 100);
delay(75); tone(8, 680, 100);
delay(75); tone(8, 620, 150);
delay(150); tone(8, 650, 150);
delay(150); tone(8, 380, 100);
delay(75); tone(8, 430, 100);
delay(75); tone(8, 500, 100);
delay(150); tone(8, 430, 100);
delay(75); tone(8, 500, 100);
delay(50); tone(8, 570, 100);
delay(210); tone(8, 585, 100);
delay(275); tone(8, 550, 100);
delay(210); tone(8, 500, 100);
delay(180); tone(8, 380, 100);
delay(150); tone(8, 500, 100);
delay(150); tone(8, 500, 100);
delay(75); tone(8, 500, 100);
delay(150); tone(8, 500, 60);
delay(75); tone(8, 500, 80);
delay(150); tone(8, 500, 60);
delay(175); tone(8, 500, 80);
delay(75); tone(8, 580, 80);
delay(175); tone(8, 660, 80);
delay(75); tone(8, 500, 80);
delay(150); tone(8, 430, 80);
delay(75); tone(8, 380, 80);
delay(300); tone(8, 500, 60);
delay(75); tone(8, 500, 80);
delay(150); tone(8, 500, 60);
delay(175); tone(8, 500, 80);
delay(75); tone(8, 580, 80);
delay(75); tone(8, 660, 80);
delay(225); tone(8, 870, 80);
delay(162); tone(8, 760, 80);
delay(300); tone(8, 500, 60);
delay(75); tone(8, 500, 80);
delay(150); tone(8, 500, 60);
delay(175); tone(8, 500, 80);
delay(75); tone(8, 580, 80);
delay(175); tone(8, 660, 80);
delay(75); tone(8, 500, 80);
delay(150); tone(8, 430, 80);
delay(75); tone(8, 380, 80);
delay(300); tone(8, 660, 100);
delay(75); tone(8, 660, 100);
delay(150); tone(8, 660, 100);
delay(150); tone(8, 510, 100);
delay(50); tone(8, 660, 100);
delay(150); tone(8, 770, 100);
delay(225); tone(8, 380, 100);
delay(1000);
tone(8, 440, 200);
delay(200);
delay(200);
tone(8, 440, 400);
delay(200);
delay(200);
delay(5000);
}
| [
"zoomx@tiscalinet.it"
] | zoomx@tiscalinet.it |
bd1ef393871d0cb286f3e10647111a17ca9d135b | 44327cc9db417736b5dd41f36c5977f9e69f531d | /src/version.cpp | c291340ce23bd9273bec3514527686722e6405c8 | [
"MIT"
] | permissive | ZumyTeam/zumy | d0e859c0ccda2b0fb7560dd3600782ddbb5bd379 | fe4267a1672ee7a28e872207329df3cc4631a4b3 | refs/heads/master | 2020-03-30T02:13:04.011409 | 2018-09-27T16:10:49 | 2018-09-27T16:10:49 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,652 | cpp | // Copyright (c) 2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <string>
#include "version.h"
// Name of client reported in the 'version' message. Report the same name
// for both bitcoind and bitcoin-qt, to make it harder for attackers to
// target servers or GUI users specifically.
const std::string CLIENT_NAME("Zumy-core-Launch-Wallet");
// Client version number
#define CLIENT_VERSION_SUFFIX ""
// The following part of the code determines the CLIENT_BUILD variable.
// Several mechanisms are used for this:
// * first, if HAVE_BUILD_INFO is defined, include build.h, a file that is
// generated by the build environment, possibly containing the output
// of git-describe in a macro called BUILD_DESC
// * secondly, if this is an exported version of the code, GIT_ARCHIVE will
// be defined (automatically using the export-subst git attribute), and
// GIT_COMMIT will contain the commit id.
// * then, three options exist for determining CLIENT_BUILD:
// * if BUILD_DESC is defined, use that literally (output of git-describe)
// * if not, but GIT_COMMIT is defined, use v[maj].[min].[rev].[build]-g[commit]
// * otherwise, use v[maj].[min].[rev].[build]-unk
// finally CLIENT_VERSION_SUFFIX is added
// First, include build.h if requested
#ifdef HAVE_BUILD_INFO
# include "build.h"
#endif
// git will put "#define GIT_ARCHIVE 1" on the next line inside archives.
#define GIT_ARCHIVE 1
#ifdef GIT_ARCHIVE
# define GIT_COMMIT_ID "Zumy-Coin-Launch-Wallet"
# define GIT_COMMIT_DATE "OCT 1, 2018" //$Format:%cD
#endif
#define BUILD_DESC_FROM_COMMIT(maj,min,rev,build,commit) \
"v" DO_STRINGIZE(maj) "." DO_STRINGIZE(min) "." DO_STRINGIZE(rev) "." DO_STRINGIZE(build) "-" commit
#define BUILD_DESC_FROM_UNKNOWN(maj,min,rev,build) \
"v" DO_STRINGIZE(maj) "." DO_STRINGIZE(min) "." DO_STRINGIZE(rev) "." DO_STRINGIZE(build) "-"
#ifndef BUILD_DESC
# ifdef GIT_COMMIT_ID
# define BUILD_DESC BUILD_DESC_FROM_COMMIT(CLIENT_VERSION_MAJOR, CLIENT_VERSION_MINOR, CLIENT_VERSION_REVISION, CLIENT_VERSION_BUILD, GIT_COMMIT_ID)
# else
# define BUILD_DESC BUILD_DESC_FROM_UNKNOWN(CLIENT_VERSION_MAJOR, CLIENT_VERSION_MINOR, CLIENT_VERSION_REVISION, CLIENT_VERSION_BUILD)
# endif
#endif
#ifndef BUILD_DATE
# ifdef GIT_COMMIT_DATE
# define BUILD_DATE GIT_COMMIT_DATE
# else
# define BUILD_DATE __DATE__ ", " __TIME__
# endif
#endif
const std::string CLIENT_BUILD(BUILD_DESC CLIENT_VERSION_SUFFIX);
const std::string CLIENT_DATE(BUILD_DATE);
| [
"dev@zumy.co"
] | dev@zumy.co |
473f42bea300b074378a93a73ea2a21d9d1f643e | 6b2a8dd202fdce77c971c412717e305e1caaac51 | /solutions_1673486_0/C++/lxhgww/1.cpp | 9058052cb4ccacbbe4b65b0cd9a2b6f74ba8addd | [] | no_license | alexandraback/datacollection | 0bc67a9ace00abbc843f4912562f3a064992e0e9 | 076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf | refs/heads/master | 2021-01-24T18:27:24.417992 | 2017-05-23T09:23:38 | 2017-05-23T09:23:38 | 84,313,442 | 2 | 4 | null | null | null | null | UTF-8 | C++ | false | false | 652 | cpp | #include<stdio.h>
double a[100001];
int main()
{
int t,p;
int n,m;
int i,j;
double mm;
double s1;
freopen("A-small-attempt0.in","r",stdin);
freopen("A-small-attempt0.out","w",stdout);
scanf("%d",&t);
for (p=1;p<=t;p++)
{
scanf("%d%d",&n,&m);
for (i=1;i<=n;i++)
scanf("%lf",&a[i]);
mm=m+2;
s1=1;
for (i=1;i<=n;i++)
s1=s1*a[i];
if (s1*(m-n+1)+(1-s1)*(m-n+1+m+1)<mm) mm=s1*(m-n+1)+(1-s1)*(m-n+1+m+1);
for (i=n-1;i>=0;i--)
{
s1=s1/a[i+1];
if (s1*(n-i+m-i+1)+(1-s1)*(n-i+m-i+1+m+1)<mm) mm=s1*(n-i+m-i+1)+(1-s1)*(n-i+m-i+1+m+1);
}
printf("Case #%d: %.6lf\n",p,mm);
}
return 0;
}
| [
"eewestman@gmail.com"
] | eewestman@gmail.com |
859128364f6eee1bf36144cccece4e464a40fde0 | 928bd6a1f0a580cc0c27d1e06864091f0fdf6863 | /main.cpp | abb38b3a1e9a95f9a08737b43fba7a42705eeec3 | [] | no_license | GPoleto27/APS_TC | 57f3d5874b5468a0f5745d12c2ee52ed66e08b53 | 461a25ce652b9b0334c3962053ce697944d6db91 | refs/heads/master | 2020-05-25T06:35:53.889637 | 2019-07-08T05:43:13 | 2019-07-08T05:43:13 | 187,670,308 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 9,168 | cpp | #include "Automato.h"
int main() {
register int i, j, k;
int nEstados, nElementos, nFinais, nTransicoes, nPalavras, nEstadosEquivalentes = 0;
char palavra[16], c;
bool flag;
int *finais, *naoFinais;
vector<char> alfabeto;
bool *estadosAcessiveis;
transicao *transicoes;
// Parte 1
cin >> nEstados;
if (nEstados > 10 || nEstados < 1) // Se o número de estados é inválido retorna erro de código 1
return 1;
cin >> nElementos;
if (nElementos > 10 || nElementos < 0) // Se o número de elementos é inválido retorna erro de código 2
return 2;
for (i = 0; i < nElementos; i++) { // Insere os elementos do alfabeto
cin >> c;
alfabeto.push_back(c);
}
cin >> nFinais;
if (nFinais < 1 || nFinais > nEstados - 1) // Se o número de estados finais é inválido retorna erro de código 3
return 3;
finais = (int*)malloc(nFinais * sizeof(int)); // Aloca o vetor de estados com o número de estados finais
for (i = 0; i < nFinais; i++) { // Recebe os estados finais
cin >> finais[i];
if (finais[i] < 0 || finais[i] > nEstados - 1) // Se o elemento inserido é inválido retorna erro de código 4
return 4;
}
cin >> nTransicoes;
if (nTransicoes > 50 || nTransicoes < nEstados - 1) // Se o número de transições é inválido retorna erro de código 5
return 5;
transicoes = (transicao*)malloc(nTransicoes * sizeof(transicao));
for (i = 0; i < nTransicoes; i++) { // Recebe as transições
cin >> transicoes[i].inicial;
if (transicoes[i].inicial > nEstados - 1 || transicoes[i].inicial < 0) // Se o estado inicial da transição é inválido retorna erro de código 6
return 6;
cin >> transicoes[i].cons;
for(j = 0; j < nElementos; j++) {
if (transicoes[i].cons == alfabeto[j])
break;
else if (j == nElementos - 1) // Se o caracter a ser consumido da transiçãoo não pertencer ao alfabeto retorna erro de código 7
return 7;
}
cin >> transicoes[i].final;
if (transicoes[i].final > nEstados - 1 || transicoes[i].final < 0) // Se o estado final da transição é inválido retorna erro de código 8
return 8;
}
cin >> nPalavras;
if (nPalavras > 10) // Se o número de palavras é inválido retorna erro de código 9
return 9;
vector<estado*> automato = inicializaEstados(nEstados, finais, nFinais); // Inicializa o automato (grafo)
populaTransicoes(automato, transicoes, nTransicoes); // Popula as transições do automato (vector de estado*)
for (i = 0; i < nPalavras; i++) {
cin >> palavra; // Recebe a palavra
if (testarPalavra(palavra, automato[0])) // Verifica a palavra
cout << "Aceita.\n";
else cout << "Rejeita.\n";
}
// Parte 2
// Verifica se a função programa é total
estado* aux;
vector<char> auxAlfa = alfabeto; // Alfabeto auxiliar (para verificar se todos os elementos possuem no mínimo uma transição)
for (j = 0; j < nEstados; j++) { // Passar pelos estados
aux = automato[j]; // Auxiliar para caminhar pelos estados
for(i = 0; i < auxAlfa.size(); i++) { // Todo o alfabeto a ser verificado
if(aux->transicoes[ auxAlfa[i] ] != NULL) { // Se existe uma transição para aquele elemento
auxAlfa.erase(auxAlfa.begin()+(i--)); // Remove o elemento, pois já foi encontrada uma transição para ele
}
}
if(!auxAlfa.size()) // Se todo o alfabeto já foi encontrado
break; // Não precisa verificar os outros estados
else if(j == nEstados-1) { // Se foi passado por todos os estados
cout << "Esse AFD nao pode ser minimizado por não ser total\n";
return 10; // Retorna código de erro 10
}
}
// Verifica se tem estados inacessíveis
estadosAcessiveis = (bool*)calloc(nEstados, sizeof(bool)); // Aloca o vetor que representa se o estado é acessível (inicializa false)
for(i = 0; i < nTransicoes; i++) { // Passa por todas as transições
estadosAcessiveis[ transicoes[i].final ] = true; // Define como acessível o estado final da transição
}
for (i = 1; i < nEstados; i++) { // Passa por todos os estados
if(!estadosAcessiveis[i]) { // Se algum estado não está marcado
cout << "Esse AFD nao pode ser minimizado pois o estado q" << i << " não é acessível\n";
return 11; // Retorna erro de código 11
}
}
naoFinais = (int*)malloc( (nEstados - nFinais) * sizeof(int) ); // Gera vetor de estados não-finais
j = 0;
for(i = 0; i < nEstados; i++) { // Passa por todos os estados
if(!automato[i]->final) // Se aquele estado não é final
naoFinais[j++] = automato[i]->n; // Adiciona em naoFinais e incremeta o contador
}
bool equivalencia[nEstados][nEstados]; // Inicializa o vetor de equivalências
memset(equivalencia, (int)false, nEstados*nEstados*sizeof(bool)); // Inicializa todos como falso
// Vodka e magia eslava
for ( i = 0; i < nFinais; i++ ) { // Passa por todas as combinações de estados finais
for( j = i + 1; j < nFinais; j++) {
flag = false; // Flag representa se um par de estados é distinguivel
for( k = 0; k < nElementos; k++) { // Passa por todos os elementos do alfabeto
// Se encontrar alguma transição distinguivel
if( automato[ finais[i] ]->transicoes[ (int)alfabeto[k] ] == NULL || automato[ finais[j] ]->transicoes[ (int)alfabeto[k] ] == NULL ||
!( (automato[ finais[i] ]->transicoes[ (int)alfabeto[k] ]->final && automato[ finais[j] ]->transicoes[ (int)alfabeto[k] ]->final) || (!automato[ finais[i] ]->transicoes[ (int)alfabeto[k] ]->final && !automato[ finais[j] ]->transicoes[ (int)alfabeto[k] ]->final) ) ) {
flag = true; // Então o par é distinguivel
nEstadosEquivalentes--;
break; // Avança, não compara com outros elementos
}
}
equivalencia[ finais[i] ][ finais[j] ] = !flag; // Define o vetor de equivalencia dos estados i e j como a negação de distinguivel
}
}
for ( i = 0; i < nEstados - nFinais; i++) { // Passa por todas as combinações de estados não-finais
for ( j = i + 1; j < nEstados - nFinais; j++) {
flag = false; // Flag representa se um par de estados é distinguivel
for( k = 0; k < nElementos; k++) { // Passa por todos os elementos do alfabeto
// Se encontrar alguma transição distinguivel
if( automato[ naoFinais[i] ]->transicoes[ (int)alfabeto[k] ] == NULL || automato[ naoFinais[j] ]->transicoes[ (int)alfabeto[k] ] == NULL ||
!( (automato[ naoFinais[i] ]->transicoes[ (int)alfabeto[k] ]->final && automato[ naoFinais[j] ]->transicoes[ (int)alfabeto[k] ]->final) || (!automato[ naoFinais[i] ]->transicoes[ (int)alfabeto[k] ]->final && !automato[ naoFinais[j] ]->transicoes[ (int)alfabeto[k] ]->final) ) ) {
flag = true; // Então o par é distinguivel
break; // Avança, não compara com outros elementos
}
}
equivalencia[ naoFinais[i] ][ naoFinais[j] ] = !flag; // Define o vetor de equivalencia dos estados i e j como a negação de distinguivel
}
}
cout << "Estados equivalentes:\n";
for(i = 0; i < nEstados; i++) {
for(j = 0; j < nEstados; j++) {
if(equivalencia[i][j]) {
nEstadosEquivalentes++;
cout << i << " e " << j << "\n"; // Imprime os estados equivalentes
if (i < j) { // Se i < j
for(k = 0; k < nTransicoes; k++) { // Altera as ocorrências de j na lista de transições por i
if (transicoes[k].inicial == j)
transicoes[k].inicial = i;
if (transicoes[k].final == j)
transicoes[k].final = i;
}
for(k = 0; k < nFinais; k++) { // Altera as ocorrências de j na lista de estados finais por i
if(finais[k] == j)
finais[k] = i;
}
}
else { // Se j < i
for(k = 0; k < nTransicoes; k++) { // Altera as ocorrências de i na lista de transições por j
if (transicoes[k].inicial == i)
transicoes[k].inicial = j;
if (transicoes[k].final == i)
transicoes[k].final = j;
}
for(k = 0; k < nFinais; k++) { // Altera as ocorrências de i na lista de estados finais por j
if(finais[k] == i)
finais[k] = j;
}
}
}
}
}
if(!nEstadosEquivalentes) {
cout << "Esse AFD nao pode ser minimizado pois nao tem estados equivalentes\n";
return 12;
}
vector<estado*> minimizado = inicializaEstados(nEstados, finais, nFinais); // Inicializa o automato minimizado com o mesmo número de estados, porém com a nova lista de finais
populaTransicoes(minimizado, transicoes, nTransicoes); // Popula as transições com a nova lista de transições
minimizado = excluirInuteis(minimizado); // Exclui estados sem transições (o que inclui um estado de cada par de estados equivalentes já que um deles são vai ter transições)
imprimeFormalizacao(minimizado, alfabeto); // Imprime a formalização do automato minimizado
return 0;
}
| [
"noreply@github.com"
] | GPoleto27.noreply@github.com |
e07f5d20d70883cabccdb19eb50231a9c3ecbfb5 | 24012fe02dd87c7ba3016f7ea0a5b9d2398a7fe1 | /TBGame/Bullet.h | fc519ddbec25c74c7a81c6cceaf6103ecdde3fa7 | [
"Apache-2.0"
] | permissive | Alexander3006/TBGame | 81c8f5fd95d8c8ecbe2bc22eb3a1c842427d7657 | d4a73d0e76d3ef1bf894a325840a4d16c507d574 | refs/heads/master | 2022-03-11T10:19:47.849347 | 2019-12-11T16:15:23 | 2019-12-11T16:15:23 | 227,394,041 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 293 | h | #pragma once
#include "GameObject.h"
class Bullet: public GameObject
{
private:
void Collision(bool, std::vector<std::string>) override;
void Animation(float) override;
public:
Bullet(sf::Texture&, int, int, int, int);
void Update(float, std::vector<std::string>, sf::RenderWindow*);
};
| [
"ukrpresident3006@gmail.com"
] | ukrpresident3006@gmail.com |
cdf7758159401043efe1ef6d18ac023b90767cea | ba444c530390b369d92d2a446b2667ed10674ac4 | /problems/10161.cpp | cdd47e53d5ab701fece6c693ed740f852c0d262d | [] | no_license | mkroflin/UVa | 62c00eede8b803487fa96c6f34dc089b7ea80df5 | aa9815f710db094fb67ceafb485b139de58e9745 | refs/heads/master | 2022-03-21T05:04:32.445579 | 2018-11-15T19:44:19 | 2018-11-15T19:44:19 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 472 | cpp | #include <iostream>
#include <cmath>
using namespace std;
int main()
{
int n, s, f, x, y;
while (cin >> n, n)
{
s = sqrt(n);
n -= s * s;
f = s % 2;
(f? x : y) = 1;
(f? y : x) = s;
if (n > 0)
n--, (f? y : x)++;
if (n > 0)
(f? x : y) += min(s, n), n -= min(s, n);
if (n > 0)
(f? y : x) -= n;
cout << x << ' ' << y << endl;
}
}
| [
"matej.kroflin@gmail.com"
] | matej.kroflin@gmail.com |
3172de6484a478e71be81be79a49e57e3817c7ac | 82317a604ae195d04308a6ee609ea124ed4bef79 | /src/impro_util.cpp | 91e15f3e15248f6e9b01037d742c477f9f650443 | [] | no_license | improdevteam/ImProConsole_Test | 391dd62e2e62e313210665214ac2c4ee93d0273a | c28bac7347bcfa7d31b24c9b06c50278755cb65e | refs/heads/master | 2020-05-09T12:13:29.500399 | 2019-05-09T01:32:30 | 2019-05-09T01:32:30 | 181,105,908 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 72,366 | cpp | #include "impro_util.h"
#include <vector>
#include <opencv2/opencv.hpp>
#include <cmath>
#include <iostream>
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
#include <Windows.h> // for OPENFILENAME, GetOpenFileName
#include <shlobj_core.h>
#include <atlstr.h>
#endif
#include "matchTemplateWithRotPyr.h"
#include "enhancedCorrelationWithReference.h"
using namespace std;
using namespace cv;
vector<double> linspace(double a, double b, int n) {
vector<double> array;
if (n == 1)
array.push_back((a + b) * .5);
else if (n > 1) {
double step = (b - a) / (n - 1);
int count = 0;
while (count < n) {
array.push_back(a + count*step);
++count;
}
}
return array;
}
vector<float> linspace(float a, float b, int n) {
vector<float> array;
if (n == 1)
array.push_back((a + b) * .5f);
else if (n > 1) {
float step = (b - a) / (n - 1);
int count = 0;
while (count < n) {
array.push_back(a + count*step);
++count;
}
}
return array;
}
cv::Mat linspaceMat(double a, double b, int n)
{
cv::Mat array;
if (n > 0) array = cv::Mat(cv::Size(n, 1), CV_64F);
if (n == 1)
array.at<double>(0, 0) = (a + b) * .5;
else if (n > 1) {
double step = (b - a) / (n - 1);
int count = 0;
while (count < n) {
array.at<double>(0, count) = a + count * step;
++count;
}
}
return array;
}
cv::Mat linspaceMat(float a, float b, int n)
{
cv::Mat array;
if (n > 0) array = cv::Mat(cv::Size(n, 1), CV_32F);
if (n == 1)
array.at<float>(0, 0) = (a + b) * .5f;
else if (n > 1) {
float step = (b - a) / (n - 1);
int count = 0;
while (count < n) {
array.at<float>(0, count) = a + count * step;
++count;
}
}
return array;
}
bool fileExist(const std::string& name) {
errno_t err;
FILE * file;
// if (FILE *file = fopen(name.c_str(), "r")) {
err = fopen_s(&file, name.c_str(), "r");
if (err == 0) {
fclose(file);
return true;
}
else {
return false;
}
}
void meshgrid(float xa, float xb, int nx, float ya, float yb, int ny, cv::Mat & X, cv::Mat & Y)
{
if (nx <= 0 || ny <= 0) {
cerr << "Warning: meshgrid() got nx <= 0 or ny <= 0. Check it.\n";
X.release();
Y.release();
return;
}
X.create(ny, nx, CV_32F);
Y.create(ny, nx, CV_32F);
float dx = nx > 1 ? (xb - xa) / (nx - 1) : 0.0f;
float dy = ny > 1 ? (yb - ya) / (ny - 1) : 0.0f;
for (int i = 0; i < ny; i++) {
for (int j = 0; j < nx; j++)
{
X.at<float>(i, j) = xa + j * dx;
Y.at<float>(i, j) = ya + i * dy;
}
}
}
void meshgrid(double xa, double xb, int nx, double ya, double yb, int ny, cv::Mat & X, cv::Mat & Y)
{
if (nx <= 0 || ny <= 0) {
cerr << "Warning: meshgrid() got nx <= 0 or ny <= 0. Check it.\n";
X.release();
Y.release();
return;
}
X.create(ny, nx, CV_64F);
Y.create(ny, nx, CV_64F);
double dx = nx > 1 ? (xb - xa) / (nx - 1) : 0.0;
double dy = ny > 1 ? (yb - ya) / (ny - 1) : 0.0;
for (int i = 0; i < ny; i++) {
for (int j = 0; j < nx; j++)
{
X.at<double>(i, j) = xa + j * dx;
Y.at<double>(i, j) = ya + i * dy;
}
}
}
bool findChessboardCornersSubpix(cv::Mat image, Size patternSize, vector<Point2f> & corners,
int flags, TermCriteria criteria)
{
// variables
bool bres;
if (image.channels() != 1) cv::cvtColor(image, image, cv::COLOR_BGR2GRAY);
bres = cv::findChessboardCorners(image, patternSize, corners, flags);
if (bres == false)
return false;
// subpix
cv::cornerSubPix(image, corners, cv::Size(5, 5), cv::Size(0, 0), criteria);
// check ordering. Convert to left-to-right ordering. If not, reverse points.
if (corners[0].x > corners[corners.size() - 1].x)
std::reverse(corners.begin(), corners.end());
return bres;
}
bool findChessboardCornersSubpix(cv::Mat image, cv::Size patternSize, cv::Mat & corners, int flags, cv::TermCriteria criteria)
{
// variables
bool bres;
if (image.channels() != 1) cv::cvtColor(image, image, cv::COLOR_BGR2GRAY);
bres = cv::findChessboardCorners(image, patternSize, corners, flags);
if (bres == false)
return false;
// subpix
cv::cornerSubPix(image, corners, cv::Size(5, 5), cv::Size(0, 0), criteria);
// check ordering. Convert to left-to-right ordering. If not, reverse points.
if (corners.at<cv::Point2f>(0, 0).x > corners.at<cv::Point2f>(corners.rows - 1, 0).x)
{
cv::Mat clone; corners.copyTo(clone);
for (int i = 0; i < corners.rows; i++)
corners.at<cv::Point2f>(i, 0) = clone.at<cv::Point2f>(corners.rows - i - 1, 0);
}
return bres;
}
std::vector<cv::Point3f> create3DChessboardCorners(cv::Size bsize, float squareSize_w, float squareSize_h)
{
std::vector<cv::Point3f> corners3d;
for (int i = 0; i < bsize.height; i++)
for (int j = 0; j < bsize.width; j++)
corners3d.push_back(cv::Point3f(float(j*squareSize_w),
float(i*squareSize_h), 0));
return corners3d;
}
cv::Mat create3DChessboardCornersMat(cv::Size bsize, float squareSize_w, float squareSize_h)
{
cv::Mat corners3d(bsize, CV_32FC2);
for (int i = 0; i < bsize.height; i++)
for (int j = 0; j < bsize.width; j++)
corners3d.at<cv::Point3f>(i, j) = cv::Point3f(float(j*squareSize_w),
float(i*squareSize_h), 0);
return corners3d;
}
double calibrateCameraFromChessboardImages(
const std::vector<cv::Mat> & imgs,
cv::Size imageSize,
cv::Size bsize,
float squareSize_w, float squareSize_h,
cv::Mat & cmat,
cv::Mat & dmat,
std::vector<cv::Mat> & rmats,
std::vector<cv::Mat> & tmats,
cv::TermCriteria criteria,
int flags // flag of calibrateCamera()
)
{
// variables
int nimg;
std::vector<std::vector<cv::Point2f> > corners;
std::vector<std::vector<Point3f> > objectPoints;
bool bres;
// find number of pairs of the calibration photos
nimg = (int)imgs.size();
if (nimg <= 0) {
// cerr << "calibrateCameraChessboard() error: No photos input.\n";
return -1;
}
// Convert to gray level image
corners.resize(nimg);
for (int iimg = 0; iimg < nimg; iimg++)
{
cv::Mat img_m;
if (imgs[iimg].channels() == 1)
img_m = imgs[iimg];
else if (imgs[iimg].channels() == 3)
cv::cvtColor(imgs[iimg], img_m, cv::COLOR_BGR2GRAY);
// Find chessboard corner
bres = cv::findChessboardCorners(img_m, bsize, corners[iimg]);
if (bres == false) {
// cerr << "Calibration error: Cannot find chessboard corners in calib image.\n";
return -1;
}
cv::cornerSubPix(img_m, corners[iimg], cv::Size(5, 5), cv::Size(0, 0), criteria);
// check ordering. Convert to left-to-right ordering. If not, reverse points.
if (corners[iimg][0].x > corners[iimg][corners[iimg].size() - 1].x)
std::reverse(corners[iimg].begin(), corners[iimg].end());
}
// generate object points
objectPoints = vector<vector<Point3f> >(nimg, create3DChessboardCorners(bsize, squareSize_w, squareSize_h));
// stereo calib
if (cmat.cols != 3 || cmat.rows != 3 ||
(flags & cv::CALIB_USE_INTRINSIC_GUESS) == false) {
cmat = initCameraMatrix2D(objectPoints, corners, imageSize, 0);
dmat = Mat::zeros(1, 8, CV_32F);
}
double rms = calibrateCamera(objectPoints, corners, imageSize,
cmat, dmat,
rmats, tmats,
flags,
// CALIB_FIX_ASPECT_RATIO +
// CALIB_ZERO_TANGENT_DIST +
// CALIB_USE_INTRINSIC_GUESS +
// CALIB_SAME_FOCAL_LENGTH +
// CALIB_RATIONAL_MODEL +
// CALIB_FIX_K2 + CALIB_FIX_K3 + CALIB_FIX_K5 + CALIB_FIX_K6,
// CALIB_FIX_K3 + CALIB_FIX_K6,
// CALIB_FIX_K3 + CALIB_FIX_K4 + CALIB_FIX_K5,
criteria);
return rms;
}
double stereoCalibrateChessboard(
const std::vector<cv::Mat> & imgs_L,
const std::vector<cv::Mat> & imgs_R,
cv::Size imageSize,
cv::Size bsize,
float squareSize_w, float squareSize_h,
cv::Mat & cmat_L,
cv::Mat & cmat_R,
cv::Mat & dmat_L,
cv::Mat & dmat_R,
cv::Mat & rmat,
cv::Mat & tmat,
cv::Mat & emat,
cv::Mat & fmat,
cv::TermCriteria criteria,
int flags
)
{
// variables
int npair;
std::vector<std::vector<cv::Point2f> > corners_L, corners_R;
std::vector<std::vector<Point3f> > objectPoints;
bool bres;
// find number of pairs of the calibration photos
npair = (int)imgs_L.size();
if (npair <= 0) {
// cerr << "stereoCalibrateChessboard() error: No photos input.\n";
return -1;
}
if (npair != imgs_R.size()) {
// cerr << "stereoCalibrateChessboard() error: Left and right photos should have the same number of photos.\n";
return -1;
}
// Convert to gray level image
corners_L.resize(npair);
corners_R.resize(npair);
for (int ipair = 0; ipair < npair; ipair++)
{
cv::Mat img_Lm, img_Rm;
if (imgs_L[ipair].channels() == 1)
img_Lm = imgs_L[ipair];
else if (imgs_L[ipair].channels() == 3)
cv::cvtColor(imgs_L[ipair], img_Lm, cv::COLOR_BGR2GRAY);
if (imgs_R[ipair].channels() == 1)
img_Rm = imgs_R[ipair];
else if (imgs_R[ipair].channels() == 3)
cv::cvtColor(imgs_R[ipair], img_Rm, cv::COLOR_BGR2GRAY);
// Find chessboard color
// left
bres = cv::findChessboardCorners(img_Lm, bsize, corners_L[ipair]);
if (bres == false) {
// cerr << "Calibration error: Cannot find chessboard corners in left image.\n";
return -1;
}
cv::cornerSubPix(img_Lm, corners_L[ipair], cv::Size(5, 5), cv::Size(0, 0), criteria);
// right
bres = cv::findChessboardCorners(img_Rm, bsize, corners_R[ipair]);
if (bres == false) {
// cerr << "Calibration error: Cannot find chessboard corners in right image.\n";
return -1;
}
cv::cornerSubPix(img_Rm, corners_R[ipair], cv::Size(5, 5), cv::Size(0, 0), criteria);
// check ordering. Convert to left-to-right ordering. If not, reverse points.
if (corners_L[ipair][0].x > corners_L[ipair][corners_L[ipair].size() - 1].x)
std::reverse(corners_L[ipair].begin(), corners_L[ipair].end());
if (corners_R[ipair][0].x > corners_R[ipair][corners_R[ipair].size() - 1].x)
std::reverse(corners_R[ipair].begin(), corners_R[ipair].end());
}
// generate object points
objectPoints.resize(npair);
for (int i = 0; i < npair; i++)
{
for (int j = 0; j < bsize.height; j++)
for (int k = 0; k < bsize.width; k++)
objectPoints[i].push_back(cv::Point3f(k*squareSize_w, j*squareSize_h, 0));
}
// stereo calib
#define _INIT_CAMERA_MATRIX_2D_
#ifdef _INIT_CAMERA_MATRIX_2D_
cmat_L = initCameraMatrix2D(objectPoints, corners_L, imageSize, 0);
cmat_R = initCameraMatrix2D(objectPoints, corners_R, imageSize, 0);
dmat_L = Mat::zeros(1, 8, CV_32F);
dmat_R = Mat::zeros(1, 8, CV_32F);
#else
std::vector<cv::Mat> rmats, tmats;
double rms_L = calibrateCamera(objectPoints, corners_L, imageSize,
cmat_L, dmat_L, rmats, tmats);
double rms_R = calibrateCamera(objectPoints, corners_R, imageSize,
cmat_R, dmat_R, rmats, tmats);
#endif
double rms = stereoCalibrate(objectPoints, corners_L, corners_R,
cmat_L, dmat_L,
cmat_R, dmat_R,
imageSize, rmat, tmat, emat, fmat,
// CALIB_FIX_ASPECT_RATIO +
// CALIB_ZERO_TANGENT_DIST +
CALIB_USE_INTRINSIC_GUESS +
// CALIB_SAME_FOCAL_LENGTH +
CALIB_RATIONAL_MODEL +
CALIB_FIX_K2 + CALIB_FIX_K3 + CALIB_FIX_K5 + CALIB_FIX_K6,
// CALIB_FIX_K3 + CALIB_FIX_K6,
// CALIB_FIX_K3 + CALIB_FIX_K4 + CALIB_FIX_K5,
criteria);
return rms;
}
cv::Mat Rvec2R4(const cv::Mat & rvec, const cv::Mat & tvec)
{
cv::Mat R3, R4, T;
// rvec is a column vector
if ((rvec.cols == 1 && rvec.rows == 3 && tvec.cols == 1 && tvec.rows == 3))
{
R4 = cv::Mat::eye(4, 4, rvec.type());
R3 = R4(Rect(0, 0, 3, 3));
T = R4(Rect(3, 0, 1, 3));
Rodrigues(rvec, R3);
tvec.copyTo(T);
}
if ((rvec.cols == 3 && rvec.rows == 3 && tvec.cols == 1 && tvec.rows == 3))
{
R4 = cv::Mat::eye(4, 4, rvec.type());
R3 = R4(Rect(0, 0, 3, 3));
T = R4(Rect(3, 0, 1, 3));
rvec.copyTo(R3);
tvec.copyTo(T);
}
return R4;
}
int getTmpltFromImage(const cv::Mat & img, const cv::Point2f & pnt, const cv::Size & tmpltSize, cv::Mat & tmplt, cv::Point2f & ref)
{
int ret = 0;
cv::Rect tmplt_rect;
// tmplt size
tmplt_rect.width = tmpltSize.width;
tmplt_rect.height = tmpltSize.height;
// tmplt upper-left position
tmplt_rect.x = (int)(pnt.x - tmpltSize.width / 2 + 0.5);
if (tmplt_rect.x < 0)
tmplt_rect.x = 0;
tmplt_rect.y = (int)(pnt.y - tmpltSize.height / 2 + 0.5);
if (tmplt_rect.y < 0)
tmplt_rect.y = 0;
// check tmplt lower-right position
if (tmplt_rect.x + tmpltSize.width > img.cols)
tmplt_rect.x = img.cols - tmpltSize.width;
if (tmplt_rect.y + tmpltSize.height > img.rows)
tmplt_rect.y = img.rows - tmpltSize.height;
// crop by copying
if (tmpltSize.width <= img.cols && tmpltSize.height <= img.rows) {
tmplt = cv::Mat::zeros(tmpltSize, img.type());
img(tmplt_rect).copyTo(tmplt);
ref.x = pnt.x - tmplt_rect.x;
ref.y = pnt.y - tmplt_rect.y;
// cout << "Rect: \n" << tmplt_rect << endl;
// cout << "Ref: \n" << ref << endl;
}
else {
img.copyTo(tmplt);
ref = pnt;
return 0;
}
return ret;
}
cv::Rect getTmpltRectFromImageSize(
const cv::Size & imgSize,
const cv::Point2f & pnt,
const cv::Size & tmpltSize,
cv::Point2f & ref)
{
cv::Rect tmplt_rect;
// tmplt size
tmplt_rect.width = tmpltSize.width;
tmplt_rect.height = tmpltSize.height;
// tmplt upper-left position
tmplt_rect.x = (int)(pnt.x - tmpltSize.width / 2 + 0.5);
if (tmplt_rect.x < 0)
tmplt_rect.x = 0;
tmplt_rect.y = (int)(pnt.y - tmpltSize.height / 2 + 0.5);
if (tmplt_rect.y < 0)
tmplt_rect.y = 0;
// check tmplt lower-right position
if (tmplt_rect.x + tmpltSize.width > imgSize.width)
tmplt_rect.x = imgSize.width - tmpltSize.width;
if (tmplt_rect.y + tmpltSize.height > imgSize.height)
tmplt_rect.y = imgSize.height - tmpltSize.height;
// crop by copying
if (tmpltSize.width <= imgSize.width && tmpltSize.height <= imgSize.height) {
ref.x = pnt.x - tmplt_rect.x;
ref.y = pnt.y - tmplt_rect.y;
}
else {
ref = pnt;
tmplt_rect = cv::Rect(0, 0, imgSize.width, imgSize.height);
}
return tmplt_rect;
}
cv::Rect getTmpltRectFromImageSizeWithPreferredRef(
const cv::Size & imgSize,
const cv::Point2f & pnt,
const cv::Size & tmpltSize,
cv::Point2f & ref)
{
cv::Rect tmplt_rect;
// tmplt size
tmplt_rect.width = tmpltSize.width;
tmplt_rect.height = tmpltSize.height;
// tmplt upper-left position
tmplt_rect.x = (int)(pnt.x - ref.x);
if (tmplt_rect.x < 0)
tmplt_rect.x = 0;
tmplt_rect.y = (int)(pnt.y - ref.y);
if (tmplt_rect.y < 0)
tmplt_rect.y = 0;
// check tmplt lower-right position
if (tmplt_rect.x + tmpltSize.width > imgSize.width)
tmplt_rect.x = imgSize.width - tmpltSize.width;
if (tmplt_rect.y + tmpltSize.height > imgSize.height)
tmplt_rect.y = imgSize.height - tmpltSize.height;
// crop by copying
if (tmpltSize.width <= imgSize.width && tmpltSize.height <= imgSize.height) {
ref.x = pnt.x - tmplt_rect.x;
ref.y = pnt.y - tmplt_rect.y;
}
else {
ref = pnt;
tmplt_rect = cv::Rect(0, 0, imgSize.width, imgSize.height);
}
return tmplt_rect;
}
cv::Rect getTmpltRectFromImage(
const cv::Mat & img,
const cv::Point2f & pnt,
const cv::Size & tmpltSize,
cv::Point2f & ref)
{
cv::Rect tmplt_rect;
// tmplt size
tmplt_rect.width = tmpltSize.width;
tmplt_rect.height = tmpltSize.height;
// tmplt upper-left position
tmplt_rect.x = (int)(pnt.x - tmpltSize.width / 2 + 0.5);
if (tmplt_rect.x < 0)
tmplt_rect.x = 0;
tmplt_rect.y = (int)(pnt.y - tmpltSize.height / 2 + 0.5);
if (tmplt_rect.y < 0)
tmplt_rect.y = 0;
// check tmplt lower-right position
if (tmplt_rect.x + tmpltSize.width > img.cols)
tmplt_rect.x = img.cols - tmpltSize.width;
if (tmplt_rect.y + tmpltSize.height > img.rows)
tmplt_rect.y = img.rows - tmpltSize.height;
// crop by copying
if (tmpltSize.width <= img.cols && tmpltSize.height <= img.rows) {
ref.x = pnt.x - tmplt_rect.x;
ref.y = pnt.y - tmplt_rect.y;
// cout << "Rect: \n" << tmplt_rect << endl;
// cout << "Ref: \n" << ref << endl;
}
else {
// img.copyTo(tmplt);
ref = pnt;
tmplt_rect = cv::Rect(0, 0, img.cols, img.rows);
}
return tmplt_rect;
}
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
std::string uigetfile(void)
{
std::string stdstring;
static char filename[1024];
OPENFILENAME ofn;
ZeroMemory(&filename, sizeof(filename));
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = NULL; // If you have a window to center over, put its HANDLE here
ofn.lpstrFilter = "Any Files\0*.*\0";
ofn.lpstrFile = filename;
ofn.nMaxFile = MAX_PATH;
ofn.nMaxFile = sizeof(filename);
ofn.lpstrTitle = "Select Files";
ofn.Flags = OFN_DONTADDTORECENT | OFN_FILEMUSTEXIST | OFN_EXPLORER;
if (GetOpenFileName(&ofn))
{
stdstring = std::string(ofn.lpstrFile);
}
return stdstring;
}
std::vector<std::string> uigetfiles(void)
{
std::vector<std::string> filenames;
static char filename[256 * 32768]; // allocate 2 MB for file names (allowing about 30,000 files with average filename length of 64 characters)
OPENFILENAME ofn;
ZeroMemory(&filename, sizeof(filename));
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = NULL; // If you have a window to center over, put its HANDLE here
ofn.lpstrFilter = "Any Files\0*.*\0";
ofn.lpstrFile = filename;
ofn.nMaxFile = MAX_PATH;
ofn.nMaxFile = sizeof(filename);
ofn.lpstrTitle = "Select Files";
ofn.Flags = OFN_DONTADDTORECENT | OFN_FILEMUSTEXIST | OFN_ALLOWMULTISELECT | OFN_EXPLORER;
if (GetOpenFileName(&ofn))
{
int idx = 0;
while (true) {
LPSTR str = ofn.lpstrFile + idx;
if (strlen(str) > 0)
filenames.push_back(std::string(str));
else
break;
idx += (int)strlen(str) + 1;
}
if (filenames.size() == 1) {
// separate directory and file name
std::string directory, filename;
for (int i = (int) filenames[0].length() - 1; i >= 0; i--) {
if (filenames[0][i] == '\\' || filenames[0][i] == '/') {
directory = filenames[0].substr(0, i + 1);
filename = filenames[0].substr(i + 1);
filenames[0] = directory;
filenames.push_back(filename);
break;
}
}
}
else {
filenames[0] += "\\";
}
}
// cout << filenames[0] << endl;
// cout << filenames[1] << endl;
return filenames;
}
std::string uigetdir(void)
{
// CString initPath = "d:\\";
std::string spath("");
BROWSEINFO bi = { 0 };
bi.hwndOwner = NULL;
// bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_NEWDIALOGSTYLE;
bi.lpszTitle = "Select folder";
// bi.lParam = (long)(LPCTSTR) initPath;
LPITEMIDLIST pIIL = SHBrowseForFolder(&bi);
if (pIIL) {
CString path;
SHGetPathFromIDList(pIIL, path.GetBuffer(1024));
path.ReleaseBuffer();
IMalloc *pmal = 0;
if (SHGetMalloc(&pmal) == S_OK) {
pmal->Free(pIIL);
pmal->Release();
}
spath = std::string((LPCTSTR)path);
}
return spath;
}
std::string uiputfile(void)
{
std::string stdstring;
static char filename[1024];
OPENFILENAME ofn;
ZeroMemory(&filename, sizeof(filename));
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = NULL; // If you have a window to center over, put its HANDLE here
ofn.lpstrFilter = "Any Files\0*.*\0";
ofn.lpstrFile = filename;
ofn.nMaxFile = MAX_PATH;
ofn.nMaxFile = sizeof(filename);
ofn.lpstrTitle = "Select Files";
ofn.Flags = OFN_DONTADDTORECENT | OFN_FILEMUSTEXIST | OFN_EXPLORER;
if (GetSaveFileName(&ofn))
{
stdstring = std::string(ofn.lpstrFile);
}
return stdstring;
}
#endif
// Windows
#ifdef _WIN32
#include <Windows.h>
double getWallTime() {
LARGE_INTEGER time, freq;
if (!QueryPerformanceFrequency(&freq)) {
// Handle error
return 0;
}
if (!QueryPerformanceCounter(&time)) {
// Handle error
return 0;
}
return (double)time.QuadPart / freq.QuadPart;
}
double getCpusTime() {
FILETIME a, b, c, d;
if (GetProcessTimes(GetCurrentProcess(), &a, &b, &c, &d) != 0) {
// Returns total user time.
// Can be tweaked to include kernel times as well.
return
(double)(d.dwLowDateTime |
((unsigned long long)d.dwHighDateTime << 32)) * 0.0000001;
}
else {
// Handle error
return 0;
}
}
// Posix/Linux
#else
#include <time.h>
#include <sys/time.h>
double getWallTime() {
struct timeval time;
if (gettimeofday(&time, 0)) {
// Handle error
return 0;
}
return (double)time.tv_sec + (double)time.tv_usec * .000001;
}
double getCpusTime() {
return (double)clock() / CLOCKS_PER_SEC;
}
#endif
std::string appendSubstringBeforeLastDot(std::string fname, std::string substr)
{
int pos = (int)fname.find_last_of(".");
if (pos < 0) // no dot (i.e., no extension) in the file name
return fname + substr;
return fname.substr(0, pos) + substr + fname.substr(pos);
}
int mtm_ecc(cv::InputArray _imgSrch, cv::InputArray _imgInit, cv::Point2f tPoint,
cv::Size tSize, vector<double>& result, cv::Point2f tGuess, float rotGuess,
float xMin, float xMax, float yMin, float yMax, float rotMin, float rotMax,
cv::Size largeWinSize)
{
double totalCpusTime = getCpusTime();
double totalWallTime = getWallTime();
// Check
if (_imgSrch.getMat().rows <= 0 || _imgSrch.getMat().cols <= 0 ||
_imgInit.getMat().rows <= 0 || _imgInit.getMat().cols <= 0 ||
tPoint.x < 0. || tPoint.y < 0. ||
tPoint.x > _imgInit.getMat().cols || tPoint.y > _imgInit.getMat().rows)
{
return -1;
}
// Default values
if (result.size() < 12)
result.resize(12, 0.0);
if (isnan(tGuess.x) || isnan(tGuess.y))
tGuess = tPoint;
if (isnan(rotGuess))
rotGuess = 0.0f;
if (isnan(xMin))
xMin = tGuess.x - 2 * tSize.width;
if (isnan(xMax))
xMax = tGuess.x + 2 * tSize.width;
if (isnan(yMin))
yMin = tGuess.y - 2 * tSize.height;
if (isnan(yMax))
yMax = tGuess.y + 2 * tSize.height;
if (rotMin == 0.0f || isnan(rotMin))
rotMin = 0.0f;
if (rotMax == 0.0f || isnan(rotMax))
rotMax = 0.0f;
if (largeWinSize.width <= 0 || largeWinSize.height <= 0)
largeWinSize = cv::Size(2 * tSize.width, 2 * tSize.height);
// Making sure images are gray scaled.
cv::Mat imgSrch_gray, imgInit_gray;
if (_imgSrch.channels() != 1)
cv::cvtColor(_imgSrch, imgSrch_gray, cv::COLOR_BGR2GRAY);
else
imgSrch_gray = _imgSrch.getMat();
if (_imgInit.channels() != 1)
cv::cvtColor(_imgInit, imgInit_gray, cv::COLOR_BGR2GRAY);
else
imgInit_gray = _imgInit.getMat();
// Estimate large-window movement
// The precision sets to 1/4 of template size, assuring
// enough precision that is near template, avoiding possible
// similar pattern around.
vector<double> largeWinResult(8, 0.0);
cv::Mat largeWinResultMat(largeWinResult);
cv::Point2f refLargeWinPoint;
cv::Rect largeWinRect = getTmpltRectFromImage(
imgInit_gray, tPoint, largeWinSize, refLargeWinPoint);
double largeWinCpusTime = getCpusTime();
double largeWinWallTime = getWallTime();
float largeWin_xMin = xMin;
float largeWin_xMax = xMax;
float largeWin_yMin = yMin;
float largeWin_yMax = yMax;
float largeWin_xPcn = tSize.width * 0.25f;
float largeWin_yPcn = tSize.height * 0.25f;
float largeWin_rMin = rotMin;
float largeWin_rMax = rotMax;
float largeWin_rPcn = (float) (rotMax - rotMin) / 4.f;
matchTemplateWithRotPyr(imgSrch_gray, imgInit_gray(largeWinRect),
refLargeWinPoint.x, refLargeWinPoint.y,
largeWin_xMin, largeWin_xMax, largeWin_xPcn,
largeWin_yMin, largeWin_yMax, largeWin_yPcn,
largeWin_rMin, largeWin_rMax, largeWin_rPcn,
largeWinResult);
largeWinCpusTime = getCpusTime() - largeWinCpusTime;
largeWinWallTime = getWallTime() - largeWinWallTime;
// cout << "Large-win:\n" << largeWinResultMat << endl;
result[6] = largeWinCpusTime;
result[7] = largeWinWallTime;
// refined match
double smallWinCpusTime = getCpusTime();
double smallWinWallTime = getWallTime();
vector<double> smallWinResult(8, 0.0);
cv::Mat smallWinResultMat(smallWinResult);
cv::Point2f refSmallWinPoint;
cv::Rect smallWinRect = getTmpltRectFromImage(
imgInit_gray, tPoint, tSize, refSmallWinPoint);
float smallWin_xMin = (float) largeWinResult[0] - 2 * largeWin_xPcn;
float smallWin_xMax = (float) largeWinResult[0] + 2 * largeWin_xPcn;
float smallWin_yMin = (float) largeWinResult[1] - 2 * largeWin_yPcn;
float smallWin_yMax = (float) largeWinResult[1] + 2 * largeWin_yPcn;
float smallWin_xPcn = (float) 1.f;
float smallWin_yPcn = (float) 1.f;
float smallWin_rMin = (float) largeWinResult[2] - 2 * largeWin_rPcn;
float smallWin_rMax = (float) largeWinResult[2] + 2 * largeWin_rPcn;
float smallWin_rPcn = 5.f;
matchTemplateWithRotPyr(imgSrch_gray, imgInit_gray(smallWinRect),
refSmallWinPoint.x, refSmallWinPoint.y,
smallWin_xMin, smallWin_xMax, smallWin_xPcn,
smallWin_yMin, smallWin_yMax, smallWin_yPcn,
smallWin_rMin, smallWin_rMax, smallWin_rPcn,
smallWinResult);
smallWinCpusTime = getCpusTime() - smallWinCpusTime;
smallWinWallTime = getWallTime() - smallWinWallTime;
// cout << "Small-win:\n" << smallWinResultMat << endl;
result[8] = smallWinCpusTime;
result[9] = smallWinWallTime;
// ecc
double eccCpusTime = getCpusTime();
double eccWallTime = getWallTime();
vector<double> eccResult(8, 0.0);
cv::Mat eccResultMat(eccResult);
cv::Point2f refEccPoint;
cv::Rect eccRect = getTmpltRectFromImage(
imgInit_gray, tPoint, tSize, refEccPoint);
float ecc_guessX = (float) smallWinResult[0];
float ecc_guessY = (float) smallWinResult[1];
float ecc_guessR = (float) smallWinResult[2];
int ecc_motionType;
if (abs(rotMax - rotMin) < 1e-3)
ecc_motionType = cv::MOTION_TRANSLATION;
else
ecc_motionType = cv::MOTION_EUCLIDEAN;
enhancedCorrelationWithReference(imgSrch_gray, imgInit_gray(eccRect),
refEccPoint.x, refEccPoint.y, ecc_guessX, ecc_guessY, ecc_guessR,
eccResult, ecc_motionType,
cv::TermCriteria((TermCriteria::COUNT) + (TermCriteria::EPS), 30, 0.01));
eccCpusTime = getCpusTime() - eccCpusTime;
eccWallTime = getWallTime() - eccWallTime;
// cout << "Ecc:\n" << eccResultMat << endl;
result[10] = eccCpusTime;
result[11] = eccWallTime;
totalCpusTime = getCpusTime() - totalCpusTime;
totalWallTime = getWallTime() - totalWallTime;
result[4] = totalCpusTime;
result[5] = totalWallTime;
result[0] = eccResult[0];
result[1] = eccResult[1];
result[2] = eccResult[2];
result[3] = eccResult[3];
cv::Mat resultMat(result);
// cout << "Total result: \n" << resultMat << endl;
// cv::Point3f initGuess;
return 0;
}
//int mtm_opf(cv::InputArray _imgSrch, cv::InputArray _imgInit, cv::Point2f tPoint,
// cv::Size tSize, vector<double>& result, cv::Point2f tGuess, float rotGuess,
// float xMin, float xMax, float yMin, float yMax, float rotMin, float rotMax,
// cv::Size largeWinSize)
//{
// double totalCpusTime = getCpusTime();
// double totalWallTime = getWallTime();
// // Check
// if (_imgSrch.getMat().rows <= 0 || _imgSrch.getMat().cols <= 0 ||
// _imgInit.getMat().rows <= 0 || _imgInit.getMat().cols <= 0 ||
// tPoint.x < 0. || tPoint.y < 0. ||
// tPoint.x > _imgInit.getMat().cols || tPoint.y > _imgInit.getMat().rows)
// {
// return -1;
// }
// // Default values
// if (result.size() < 12)
// result.resize(12, 0.0);
// if (isnan(tGuess.x) || isnan(tGuess.y))
// tGuess = tPoint;
// if (isnan(rotGuess))
// rotGuess = 0.0f;
// if (isnan(xMin))
// xMin = tGuess.x - 2 * tSize.width;
// if (isnan(xMax))
// xMax = tGuess.x + 2 * tSize.width;
// if (isnan(yMin))
// yMin = tGuess.y - 2 * tSize.height;
// if (isnan(yMax))
// yMax = tGuess.y + 2 * tSize.height;
// if (rotMin == 0.0f || isnan(rotMin))
// rotMin = 0.0f;
// if (rotMax == 0.0f || isnan(rotMax))
// rotMax = 0.0f;
// if (largeWinSize.width <= 0 || largeWinSize.height <= 0)
// largeWinSize = cv::Size(2 * tSize.width, 2 * tSize.height);
//
// // Making sure images are gray scaled.
// cv::Mat imgSrch_gray, imgInit_gray;
// if (_imgSrch.channels() != 1)
// cv::cvtColor(_imgSrch, imgSrch_gray, cv::COLOR_BGR2GRAY);
// else
// imgSrch_gray = _imgSrch.getMat();
// if (_imgInit.channels() != 1)
// cv::cvtColor(_imgInit, imgInit_gray, cv::COLOR_BGR2GRAY);
// else
// imgInit_gray = _imgInit.getMat();
//
// // Estimate large-window movement
// // The precision sets to 1/4 of template size, assuring
// // enough precision that is near template, avoiding possible
// // similar pattern around.
// vector<double> largeWinResult(8, 0.0);
// cv::Mat largeWinResultMat(largeWinResult);
// cv::Point2f refLargeWinPoint;
// cv::Rect largeWinRect = getTmpltRectFromImage(
// imgInit_gray, tPoint, largeWinSize, refLargeWinPoint);
// double largeWinCpusTime = getCpusTime();
// double largeWinWallTime = getWallTime();
// float largeWin_xMin = xMin;
// float largeWin_xMax = xMax;
// float largeWin_yMin = yMin;
// float largeWin_yMax = yMax;
// float largeWin_xPcn = tSize.width * 0.25f;
// float largeWin_yPcn = tSize.height * 0.25f;
// float largeWin_rMin = rotMin;
// float largeWin_rMax = rotMax;
// float largeWin_rPcn = (float)(rotMax - rotMin) / 4.f;
// matchTemplateWithRotPyr(imgSrch_gray, imgInit_gray(largeWinRect),
// refLargeWinPoint.x, refLargeWinPoint.y,
// largeWin_xMin, largeWin_xMax, largeWin_xPcn,
// largeWin_yMin, largeWin_yMax, largeWin_yPcn,
// largeWin_rMin, largeWin_rMax, largeWin_rPcn,
// largeWinResult);
// largeWinCpusTime = getCpusTime() - largeWinCpusTime;
// largeWinWallTime = getWallTime() - largeWinWallTime;
// // cout << "Large-win:\n" << largeWinResultMat << endl;
// result[6] = largeWinCpusTime;
// result[7] = largeWinWallTime;
// // refined match
// double smallWinCpusTime = getCpusTime();
// double smallWinWallTime = getWallTime();
// vector<double> smallWinResult(8, 0.0);
// cv::Mat smallWinResultMat(smallWinResult);
// cv::Point2f refSmallWinPoint;
// cv::Rect smallWinRect = getTmpltRectFromImage(
// imgInit_gray, tPoint, tSize, refSmallWinPoint);
// float smallWin_xMin = (float)largeWinResult[0] - 2 * largeWin_xPcn;
// float smallWin_xMax = (float)largeWinResult[0] + 2 * largeWin_xPcn;
// float smallWin_yMin = (float)largeWinResult[1] - 2 * largeWin_yPcn;
// float smallWin_yMax = (float)largeWinResult[1] + 2 * largeWin_yPcn;
// float smallWin_xPcn = (float) 1.f;
// float smallWin_yPcn = (float) 1.f;
// float smallWin_rMin = (float)largeWinResult[2] - 2 * largeWin_rPcn;
// float smallWin_rMax = (float)largeWinResult[2] + 2 * largeWin_rPcn;
// float smallWin_rPcn = 5.f;
// matchTemplateWithRotPyr(imgSrch_gray, imgInit_gray(smallWinRect),
// refSmallWinPoint.x, refSmallWinPoint.y,
// smallWin_xMin, smallWin_xMax, smallWin_xPcn,
// smallWin_yMin, smallWin_yMax, smallWin_yPcn,
// smallWin_rMin, smallWin_rMax, smallWin_rPcn,
// smallWinResult);
// smallWinCpusTime = getCpusTime() - smallWinCpusTime;
// smallWinWallTime = getWallTime() - smallWinWallTime;
// // cout << "Small-win:\n" << smallWinResultMat << endl;
// result[8] = smallWinCpusTime;
// result[9] = smallWinWallTime;
//
// // optical flow
// double opfCpusTime = getCpusTime();
// double opfWallTime = getWallTime();
// vector<double> opfResult(4, 0.0);
// cv::Mat opfResultMat(opfResult);
// cv::Point2f refOpfPoint;
// cv::Rect opfRect = getTmpltRectFromImage(
// imgInit_gray, tPoint,
// cv::Size((int)(tSize.width * 1.5), (int)(tSize.height)),
// refOpfPoint);
// float opf_guessX = (float)smallWinResult[0];
// float opf_guessY = (float)smallWinResult[1];
// float opf_guessR = (float)smallWinResult[2];
// int opf_maxLevel = 1;
// vector<cv::Point2f> tPointVec(1); tPointVec[0] = tPoint; // 1-point vector
// vector<cv::Point2f> tPointAfterVec(1);
// tPointAfterVec[0].x = opf_guessX; // initial guess
// tPointAfterVec[0].y = opf_guessY; // initial guess
// vector<uchar> opf_status(1);
// vector<float> opf_err(1);
// if (abs(opf_guessR) > 1e-3) { // has a rotation
// cv::Mat rotTmplt = imgInit_gray(opfRect);
// cv::Mat noRotBackup; // backup the template before rotation
// rotTmplt.copyTo(noRotBackup);
// cv::Mat r33 = getRotationMatrix2D(refOpfPoint, (double)opf_guessR, 1);
// cv::warpAffine(noRotBackup, rotTmplt, r33, rotTmplt.size(), cv::INTER_CUBIC);
// cv::calcOpticalFlowPyrLK(imgInit_gray, imgSrch_gray,
// tPointVec, tPointAfterVec, opf_status, opf_err,
// tSize, opf_maxLevel,
// cv::TermCriteria((TermCriteria::COUNT) + (TermCriteria::EPS), 30, 0.01),
// cv::OPTFLOW_USE_INITIAL_FLOW);
// noRotBackup.copyTo(rotTmplt); // recover the imgInit_gray from being locally rotated
// }
// else { // has no rotation
// cv::calcOpticalFlowPyrLK(imgInit_gray, imgSrch_gray,
// tPointVec, tPointAfterVec, opf_status, opf_err,
// tSize, opf_maxLevel,
// cv::TermCriteria((TermCriteria::COUNT) + (TermCriteria::EPS), 30, 0.01),
// cv::OPTFLOW_USE_INITIAL_FLOW);
// }
// opfResult[0] = tPointAfterVec[0].x;
// opfResult[1] = tPointAfterVec[0].y;
// opfResult[2] = opf_guessR;
// opfResult[3] = 1. - opf_err[0];
// opfCpusTime = getCpusTime() - opfCpusTime;
// opfWallTime = getWallTime() - opfWallTime;
// result[10] = opfCpusTime;
// result[11] = opfWallTime;
// totalCpusTime = getCpusTime() - totalCpusTime;
// totalWallTime = getWallTime() - totalWallTime;
// result[4] = totalCpusTime;
// result[5] = totalWallTime;
//
// result[0] = opfResult[0];
// result[1] = opfResult[1];
// result[2] = opfResult[2];
// result[3] = opfResult[3];
//
// return 0;
//}
int mtm_opfs(cv::Mat imgInit, cv::Mat imgSrch,
const std::vector<cv::Point2f> & tPointsInit,
std::vector<cv::Point3f> & tPointsSrch,
const std::vector<float> & maxMove,
std::vector<uchar> & status,
std::vector<float> & error,
std::vector<float> & timing,
cv::Size winSize,
int maxLevel,
cv::TermCriteria criteria,
int flags)
{
double totalCpusTime = getCpusTime();
double totalWallTime = getWallTime();
// Check
if (imgSrch.rows <= 0 || imgSrch.cols <= 0 ||
imgInit.rows <= 0 || imgInit.cols <= 0)
{
return -1; // imgInit or imgSrch is empty
}
if (timing.size() < 8)
timing.resize(8, 0.f);
if (tPointsSrch.size() < tPointsInit.size()) {
int tPointsSrchOriSize = (int)tPointsSrch.size();
tPointsSrch.resize(tPointsInit.size());
for (int i = tPointsSrchOriSize; i < tPointsInit.size(); i++) {
tPointsSrch[i].x = tPointsInit[i].x;
tPointsSrch[i].y = tPointsInit[i].y;
tPointsSrch[i].z = 0.f;
}
}
if (status.size() < tPointsInit.size())
status.resize(tPointsInit.size());
if (error.size() < tPointsInit.size())
error.resize(tPointsInit.size());
// clone tPointsInit to tPointsInitValid (points of nanf to remove)
// clone tPointsSrch to tPointsSrchValid
// build vector<int> mappingValid
// E.g., If tPointsInit[3].x or .y is nan, then
// tPointsInitValid[3] = tPointsInitValid[4],
// o2n[4] = 3, n2o[3] = 4
std::vector<int> o2n, n2o;
std::vector<cv::Point2f> tPointsInitValid;
std::vector<cv::Point3f> tPointsSrchValid;
points2fVecValid(tPointsInit, tPointsInitValid, o2n, n2o,
0.f, (float) imgInit.cols, 0.f, (float) imgInit.rows);
tPointsSrchValid.resize(tPointsInitValid.size());
std::vector<uchar> statusValid(tPointsInitValid.size(), 0);
std::vector<float> errorValid(tPointsInitValid.size(), -1.f);
for (int i = 0; i < tPointsInitValid.size(); i++) {
tPointsInitValid[i] = tPointsInit[n2o[i]];
tPointsSrchValid[i] = tPointsSrch[n2o[i]];
}
// vector<int> mapv(tPointsInit.size(), -1);
// vector<int> invm(tPointsInit.size(), -1);
// int nValid = 0;
// for (int i = 0; i < tPointsInit.size(); i++) {
// if (isnan(tPointsInit[i].x) == false &&
// isnan(tPointsInit[i].y) == false &&
// tPointsInit[i].x >= 0 &&
// tPointsInit[i].y >= 0 &&
// tPointsInit[i].x < imgInit.cols &&
// tPointsInit[i].y < imgInit.rows) {
// mapv[i] = nValid;
// invm[nValid] = i;
// nValid++;
// }
// }
// if (nValid == 0) return -2;
//
// // build vectors for function calcOpticalFlowPyr()
// std::vector<cv::Point2f> tPointsInitValid(nValid);
// std::vector<cv::Point3f> tPointsSrchValid(nValid);
// std::vector<uchar> statusValid(nValid, 0);
// std::vector<float> errorValid(nValid, -1.f);
// for (int i = 0; i < tPointsInitValid.size(); i++) {
// tPointsInitValid[i] = tPointsInit[invm[i]];
// tPointsSrchValid[i] = tPointsSrch[invm[i]];
// }
// Default values
// Initialize tPointsSrchValid if flags OPTFLOW_USE_INITIAL_FLOW is off
if ((flags & OPTFLOW_USE_INITIAL_FLOW) == 0) {
for (int i = 0; i < tPointsInitValid.size(); i++) {
tPointsSrchValid[i].x = tPointsInitValid[i].x;
tPointsSrchValid[i].y = tPointsInitValid[i].y;
tPointsSrchValid[i].z = 0.f;
}
}
// Making sure images are gray scaled.
cv::Mat imgSrch_gray, imgInit_gray;
if (imgSrch.channels() != 1)
cv::cvtColor(imgSrch, imgSrch_gray, cv::COLOR_BGR2GRAY);
else
imgSrch_gray = imgSrch;
if (imgInit.channels() != 1)
cv::cvtColor(imgInit, imgInit_gray, cv::COLOR_BGR2GRAY); // imgInit_gray is a clone
else if (maxMove[2] > 1e-6) // if rotation is possible, clone imgInit to imgInit_gray
imgInit.copyTo(imgInit_gray);
else
imgInit_gray = imgInit;
// Estimate large-window movement
// The precision sets to 1/4 of template size, assuring
// enough precision that is near template, avoiding possible
// similar pattern around.
double largeWinCpusTime = getCpusTime();
double largeWinWallTime = getWallTime();
int largeWinScale = (int)(std::pow(2, maxLevel) + 0.1f); // largeWinScale = 2^maxLevel
cv::Size largeWinSize(winSize.width * largeWinScale, winSize.height * largeWinScale);
std::vector<double> largeWinResult(8, 0.0);
cv::Mat largeWinResultMat(largeWinResult);
for (int iPoint = 0; iPoint < tPointsInitValid.size(); iPoint++) {
cv::Point2f refLargeWinPoint;
cv::Rect largeWinRect = getTmpltRectFromImage(
imgInit_gray, tPointsInitValid[iPoint], largeWinSize, refLargeWinPoint);
float largeWin_xMin = tPointsSrchValid[iPoint].x - maxMove[0];
float largeWin_xMax = tPointsSrchValid[iPoint].x + maxMove[0];
float largeWin_yMin = tPointsSrchValid[iPoint].y - maxMove[1];
float largeWin_yMax = tPointsSrchValid[iPoint].y + maxMove[1];
float largeWin_xPcn = winSize.width * 0.25f;
float largeWin_yPcn = winSize.height * 0.25f;
float largeWin_rMin = tPointsSrchValid[iPoint].z - maxMove[2];
float largeWin_rMax = tPointsSrchValid[iPoint].z + maxMove[2];
float largeWin_rPcn = (float)(maxMove[2]) / 2.f;
matchTemplateWithRotPyr(imgSrch_gray, imgInit_gray(largeWinRect),
refLargeWinPoint.x, refLargeWinPoint.y,
largeWin_xMin, largeWin_xMax, largeWin_xPcn,
largeWin_yMin, largeWin_yMax, largeWin_yPcn,
largeWin_rMin, largeWin_rMax, largeWin_rPcn,
largeWinResult);
tPointsSrchValid[iPoint].x = (float) largeWinResult[0];
tPointsSrchValid[iPoint].y = (float) largeWinResult[1];
if (maxMove[2] > 1e-6)
tPointsSrchValid[iPoint].z = (float) largeWinResult[2];
}
largeWinCpusTime = getCpusTime() - largeWinCpusTime;
largeWinWallTime = getWallTime() - largeWinWallTime;
// cout << "Large-win:\n" << largeWinResultMat << endl;
timing[2] = (float) largeWinCpusTime;
timing[3] = (float) largeWinWallTime;
// refined match. assuming tPointsSrch are close to final result (less than 1/2 of window size)
double smallWinCpusTime = getCpusTime();
double smallWinWallTime = getWallTime();
vector<double> smallWinResult(8, 0.0);
cv::Mat smallWinResultMat(smallWinResult);
for (int iPoint = 0; iPoint < tPointsInitValid.size(); iPoint++) {
cv::Point2f refSmallWinPoint;
cv::Rect smallWinRect = getTmpltRectFromImage(
imgInit_gray, tPointsInitValid[iPoint], winSize, refSmallWinPoint);
float smallWin_xMin = tPointsSrchValid[iPoint].x - winSize.width / 2;
float smallWin_xMax = tPointsSrchValid[iPoint].x + winSize.width / 2;
float smallWin_yMin = tPointsSrchValid[iPoint].y - winSize.height / 2;
float smallWin_yMax = tPointsSrchValid[iPoint].y + winSize.height / 2;
float smallWin_xPcn = winSize.width * 0.25f;
float smallWin_yPcn = winSize.height * 0.25f;
float smallWin_rMin = tPointsSrch[iPoint].z - maxMove[2];
float smallWin_rMax = tPointsSrch[iPoint].z + maxMove[2];
float smallWin_rPcn = (float) 1.0f;
matchTemplateWithRotPyr(imgSrch_gray, imgInit_gray(smallWinRect),
refSmallWinPoint.x, refSmallWinPoint.y,
smallWin_xMin, smallWin_xMax, smallWin_xPcn,
smallWin_yMin, smallWin_yMax, smallWin_yPcn,
smallWin_rMin, smallWin_rMax, smallWin_rPcn,
smallWinResult);
tPointsSrchValid[iPoint].x = (float) smallWinResult[0];
tPointsSrchValid[iPoint].y = (float) smallWinResult[1];
if (maxMove[2] > 1e-6)
tPointsSrchValid[iPoint].z = (float) largeWinResult[2];
}
smallWinCpusTime = getCpusTime() - smallWinCpusTime;
smallWinWallTime = getWallTime() - smallWinWallTime;
// cout << "Small-win:\n" << smallWinResultMat << endl;
timing[4] = (float)smallWinCpusTime;
timing[5] = (float)smallWinWallTime;
// optical flow
double opfCpusTime = getCpusTime();
double opfWallTime = getWallTime();
vector<cv::Point2f> refOpfPoint;
// Find max winSize factor induced by rotations and new (larger) winSize
float maxWinFactorByRot = 1.f;
for (int iPoint = 0; iPoint < tPointsInitValid.size(); iPoint++) {
float iFactor;
if (abs(tPointsSrchValid[iPoint].z) < 1e-6)
iFactor = 1.f;
else
iFactor = 1.f + 0.415f *
(float) sin(2 * tPointsSrchValid[iPoint].z * 3.1416 / 180.f);
if (maxWinFactorByRot < iFactor)
maxWinFactorByRot = iFactor;
}
cv::Size rotWinSize;
if (maxWinFactorByRot == 1.f)
rotWinSize = winSize;
else {
rotWinSize.width = (int)(winSize.width * maxWinFactorByRot + .5f);
rotWinSize.height = (int)(winSize.height * maxWinFactorByRot + .5f);
}
// rotate sub-image of targets in imgInit_gray if necessary
for (int iPoint = 0; iPoint < tPointsInitValid.size(); iPoint++) {
if (abs(tPointsSrchValid[iPoint].z) > 1e-3) {
cv::Point2f refOpfPoint;
cv::Rect opfRect = getTmpltRectFromImage(
imgInit_gray, tPointsInitValid[iPoint],
rotWinSize,
refOpfPoint);
cv::Mat rotTmplt = imgInit_gray(opfRect);
cv::Mat r33 = getRotationMatrix2D(refOpfPoint,
(double)tPointsSrchValid[iPoint].z, 1);
cv::warpAffine(rotTmplt, rotTmplt, r33,
rotTmplt.size(), cv::INTER_CUBIC);
}
}
// copy tPointsSrch.x/y to tPointsSrch2f.x/y (as tPointsSrch has additional .z for rotation)
vector<cv::Point2f> tPointsSrchValid2f(tPointsSrchValid.size());
for (int iPoint = 0; iPoint < tPointsSrchValid.size(); iPoint++) {
tPointsSrchValid2f[iPoint].x = tPointsSrchValid[iPoint].x;
tPointsSrchValid2f[iPoint].y = tPointsSrchValid[iPoint].y;
}
// optical flow
cv::calcOpticalFlowPyrLK(imgInit_gray, imgSrch_gray,
tPointsInitValid, tPointsSrchValid2f, statusValid, errorValid,
rotWinSize, maxLevel,
criteria, cv::OPTFLOW_USE_INITIAL_FLOW);
for (int iPoint = 0; iPoint < tPointsSrchValid.size(); iPoint++) {
tPointsSrchValid[iPoint].x = tPointsSrchValid2f[iPoint].x;
tPointsSrchValid[iPoint].y = tPointsSrchValid2f[iPoint].y;
}
// copy tPointsSrchValid to valid tPointsSrch
for (int iPoint = 0; iPoint < tPointsSrchValid.size(); iPoint++) {
tPointsSrch[n2o[iPoint]] = tPointsSrchValid[iPoint];
status[n2o[iPoint]] = statusValid[iPoint];
error[n2o[iPoint]] = errorValid[iPoint];
}
opfCpusTime = getCpusTime() - opfCpusTime;
opfWallTime = getWallTime() - opfWallTime;
timing[6] = (float)opfCpusTime;
timing[7] = (float)opfWallTime;
totalCpusTime = getCpusTime() - totalCpusTime;
totalWallTime = getWallTime() - totalWallTime;
timing[0] = (float)totalCpusTime;
timing[1] = (float)totalWallTime;
return 0;
}
int points2fVecValid(const std::vector<cv::Point2f>& oldVec,
std::vector<cv::Point2f>& newVec,
std::vector<int>& o2n, std::vector<int>& n2o,
float xMin, float xMax, float yMin, float yMax)
{
o2n.resize(oldVec.size(), -1);
n2o.resize(oldVec.size(), -1);
int nValid = 0;
for (int i = 0; i < oldVec.size(); i++) {
if (isnan(oldVec[i].x) == false &&
isnan(oldVec[i].y) == false &&
oldVec[i].x >= xMin &&
oldVec[i].y >= yMin &&
oldVec[i].x <= xMax &&
oldVec[i].y <= yMax) {
o2n[i] = nValid;
n2o[nValid] = i;
nValid++;
}
}
if (nValid == 0) return -1;
newVec.resize(nValid);
for (int i = 0; i < nValid; i++)
newVec[i] = oldVec[n2o[i]];
return 0;
}
int points3fVecValid(const std::vector<cv::Point3f>& oldVec,
std::vector<cv::Point3f>& newVec,
std::vector<int>& o2n, std::vector<int>& n2o,
float xMin, float xMax, float yMin, float yMax,
float zMin, float zMax)
{
o2n.resize(oldVec.size(), -1);
n2o.resize(oldVec.size(), -1);
int nValid = 0;
for (int i = 0; i < oldVec.size(); i++) {
if (isnan(oldVec[i].x) == false &&
isnan(oldVec[i].y) == false &&
isnan(oldVec[i].z) == false &&
oldVec[i].x >= xMin &&
oldVec[i].y >= yMin &&
oldVec[i].z >= zMin &&
oldVec[i].x <= xMax &&
oldVec[i].y <= yMax &&
oldVec[i].z <= zMax) {
o2n[i] = nValid;
n2o[nValid] = i;
nValid++;
}
}
if (nValid == 0) return -1;
newVec.resize(nValid);
for (int i = 0; i < nValid; i++)
newVec[i] = oldVec[n2o[i]];
return 0;
}
bool isValid(cv::Point2f p) {
return (isnan(p.x) == false && isnan(p.y) == false);
}
bool isValid(cv::Point3f p) {
return (isnan(p.x) == false && isnan(p.y) == false
&& isnan(p.z) == false);
}
bool isValid(const std::vector<cv::Point2f> & vp) {
bool valid = true;
for (int i = 0; i < vp.size(); i++) {
if (isValid(vp[i]) == false)
return false;
}
return true;
}
std::string appendSlashOrBackslashAfterDirectoryIfNecessary(std::string dir)
{
string appended = dir;
if (appended.length() <= 0 ||
appended[appended.length() - 1] == '/' ||
appended[appended.length() - 1] == '\\')
return dir;
// count '/' and '\\' in the dir string
size_t n_slash = std::count(appended.begin(), appended.end(), '/');
size_t n_bslash = std::count(appended.begin(), appended.end(), '\\');
if (n_slash > n_bslash)
appended += "/";
else
appended += "\\";
return appended;
}
std::string extFilenameRemoved(std::string f)
{
int dotPosition = -1;
for (int i = (int) f.length() - 1; i >= 1; i--) {
if (f[i] == '.')
dotPosition = i;
if (f[i] == '\\' || f[i] == '/')
break;
}
if (dotPosition == -1)
return f;
else
return f.substr(0, dotPosition);
}
std::string directoryOfFullPathFile(std::string f)
{
int slashPosition = -1;
for (int i = (int)f.length() - 1; i >= 1; i--) {
if (f[i] == '\\' || f[i] == '/') {
slashPosition = i;
break;
}
}
if (slashPosition == -1)
return std::string("");
else
return f.substr(0, slashPosition + 1);
}
std::string fileOfFullPathFile(std::string f)
{
int slashPosition = -1;
for (int i = (int)f.length() - 1; i >= 1; i--) {
if (f[i] == '\\' || f[i] == '/') {
slashPosition = i;
break;
}
}
if (slashPosition == -1)
return f;
else
return f.substr(slashPosition + 1);
}
std::vector<cv::Point2f> interpQ4(const std::vector<cv::Point2f> & inPoints, int n12, int n23)
{
std::vector<cv::Point2f> outPoints;
vector<Point2f> objPoints(4);
objPoints[0] = Point2f(0, 0); objPoints[1] = Point2f(1, 0);
objPoints[2] = Point2f(1, 1); objPoints[3] = Point2f(0, 1);
cv::Mat homoMat = findHomography(objPoints, inPoints);
cv::Mat inManyPoints;
cv::Mat objManyPoints(3, n12 * n23, CV_64F); // matrix: 3 x (n12*n23)
for (int i = 0; i < n23; i++) {
for (int j = 0; j < n12; j++) {
objManyPoints.at<double>(0, j + i * n12) = j / (n12 - 1.);
objManyPoints.at<double>(1, j + i * n12) = i / (n23 - 1.);
objManyPoints.at<double>(2, j + i * n12) = 1.;
}
}
inManyPoints = homoMat * objManyPoints;
outPoints.resize(n12 * n23);
for (int i = 0; i < n23; i++) {
for (int j = 0; j < n12; j++) {
outPoints[j + i * n12].x
= (float)inManyPoints.at<double>(0, j + i * n12) / (float)inManyPoints.at<double>(2, j + i * n12);
outPoints[j + i * n12].y
= (float)inManyPoints.at<double>(1, j + i * n12) / (float)inManyPoints.at<double>(2, j + i * n12);
}
}
return outPoints;
}
std::vector<cv::Point3d> interpQ43d(const std::vector<cv::Point3d>& inPoints, int n12, int n23)
{
std::vector<cv::Point2f> p2f4(4);
p2f4[0] = cv::Point2f(0.f, 0.f);
p2f4[1] = cv::Point2f(1.f, 0.f);
p2f4[2] = cv::Point2f(1.f, 1.f);
p2f4[3] = cv::Point2f(0.f, 1.f);
std::vector<cv::Point2f> p2f = interpQ4(p2f4, n12, n23);
std::vector<cv::Point3d> p3d(n12 * n23);
for (int i = 0; i < n12 * n23; i++) {
p3d[i] = inPoints[0] * (1.f - p2f[i].x) * (1.f - p2f[i].y)
+ inPoints[1] * (0.f + p2f[i].x) * (1.f - p2f[i].y)
+ inPoints[2] * (0.f + p2f[i].x) * (0.f + p2f[i].y)
+ inPoints[3] * (1.f - p2f[i].x) * (0.f + p2f[i].y);
}
return p3d;
}
int paintMarkersOnPointsInImage(
const cv::Mat & inImg, cv::Mat & outImg,
const std::vector<Point2f> & points,
int draw_type, int mark_size)
{
// Check
if (points.size() <= 0)
return -1;
if (inImg.cols <= 0 || inImg.rows <= 0)
return -1;
// paint
inImg.copyTo(outImg);
for (int iPoint = 0; iPoint < points.size(); iPoint++) {
int shift = 6; // for drawing sub-pixel accuracy
if (draw_type == 1) {
int radius = mark_size / 2 * (1 << shift);
int thickness = mark_size / 6;
cv::Point pi((int)(points[iPoint].x * (1 << shift) + 0.5f),
(int)(points[iPoint].y * (1 << shift) + 0.5f));
cv::circle(outImg, pi, radius, Scalar(0, 0, 255), thickness, LINE_8, 6);
}
else if (draw_type == 2) {
int cross_size = mark_size;
int thickness = mark_size / 6;
cv::Point pi, pj;
pi = cv::Point((int)(points[iPoint].x * (1 << shift) + 0.5f),
(int)(points[iPoint].y * (1 << shift) + 0.5f));
pj = cv::Point((int)((points[iPoint].x + cross_size / 2) * (1 << shift) + 0.5f),
(int)(points[iPoint].y * (1 << shift) + 0.5f));
cv::line(outImg, pi, pj, Scalar(0, 0, 255), thickness, LINE_8, 6);
pj = cv::Point((int)((points[iPoint].x - cross_size / 2) * (1 << shift) + 0.5f),
(int)(points[iPoint].y * (1 << shift) + 0.5f));
cv::line(outImg, pi, pj, Scalar(0, 0, 255), thickness, LINE_8, 6);
pj = cv::Point((int)(points[iPoint].x * (1 << shift) + 0.5f),
(int)((points[iPoint].y + cross_size / 2) * (1 << shift) + 0.5f));
cv::line(outImg, pi, pj, Scalar(0, 0, 255), thickness, LINE_8, 6);
pj = cv::Point((int)(points[iPoint].x * (1 << shift) + 0.5f),
(int)((points[iPoint].y - cross_size / 2) * (1 << shift) + 0.5f));
cv::line(outImg, pi, pj, Scalar(0, 0, 255), thickness, LINE_8, 6);
}
// add text
char strbuf[100];
int fontFace = FONT_HERSHEY_DUPLEX;
double fontScale = mark_size / 8.0;
cv::Scalar color = Scalar(0, 0, 255); // Blue, Green, Red
int thickness = mark_size / 6;
int lineType = 8;
bool bottomLeftOri = false;
sprintf_s(strbuf, "%d", iPoint + 1);
cv::putText(outImg, string(strbuf),
cv::Point((int)(points[iPoint].x + 0.5f), (int)(points[iPoint].y + 0.5f)),
fontFace, fontScale, color, thickness, lineType, bottomLeftOri);
}
// do transparency
outImg = inImg / 2 + outImg / 2;
return 0;
}
int readIntFromCin(int lb, int hb)
{
return readIntFromIstream(cin, lb, hb);
}
double readDoubleFromCin(double lb, double hb)
{
return readDoubleFromIstream(cin, lb, hb);
}
string readStringFromCin()
{
return readStringFromIstream(cin);
}
string readStringLineFromCin()
{
return readStringLineFromIstream(cin);
}
int readIntFromIstream(istream & sin, int lb, int hb)
{
int theInt;
while (true) {
string strbuf; sin >> strbuf;
if (sin.eof()) return INT_MIN; // to be modified.
if (strbuf.length() <= 0 || strbuf[0] == '#') {
getline(sin, strbuf); // skip the rest of this line
continue;
}
try {
theInt = stoi(strbuf);
if (theInt < lb || theInt > hb) continue;
break;
}
catch (...) {
continue;
}
}
return theInt;
}
double readDoubleFromIstream(istream & sin, double lb, double hb)
{
double theDouble;
while (true) {
string strbuf; sin >> strbuf;
if (sin.eof()) return nan("");
if (strbuf.length() <= 0 || strbuf[0] == '#')
{
getline(sin, strbuf); // skip the rest of this line
continue;
}
try {
theDouble = stod(strbuf);
if (theDouble < lb || theDouble > hb) continue;
break;
}
catch (...) {
continue;
}
}
return theDouble;
}
string readStringFromIstream(istream & sin)
{
string strbuf;
while (true) {
sin >> strbuf;
if (sin.eof()) return strbuf;
if (strbuf.length() <= 0 || strbuf[0] == '#')
{
getline(sin, strbuf); // skip the rest of this line
continue;
}
break;
}
return strbuf;
}
string readStringLineFromIstream(istream & sin)
{
string strbuf;
while (true) {
getline(sin, strbuf);
if (sin.eof()) return strbuf;
if (strbuf.length() <= 0 || strbuf[0] == '#') continue;
break;
}
// remove everything after '#' if any
int foundPunc = (int) strbuf.find('#');
if (foundPunc > 0)
return strbuf.substr(0, foundPunc);
return strbuf;
}
std::vector<std::string> readStringsFromStringLine(std::string stringLine)
{
std::vector<std::string> strings;
stringstream ss(stringLine);
std::string temp;
while (ss >> temp)
strings.push_back(temp);
return strings;
}
int preferredFourcc()
{
int f = 0;
cv::VideoWriter tv;
string fn("VideoWriterTesting.mp4");
if (!tv.isOpened()) {f = cv::VideoWriter::fourcc('m', 'p', '4', 'v'); tv.open(fn, f, 30.0, cv::Size(1920, 1080)); }
if (!tv.isOpened()) {f = cv::VideoWriter::fourcc('h', '2', '6', '5'); tv.open(fn, f, 30.0, cv::Size(1920,1080)); }
if (!tv.isOpened()) {f = cv::VideoWriter::fourcc('h', '2', '6', '4'); tv.open(fn, f, 30.0, cv::Size(1920,1080)); }
if (!tv.isOpened()) {f = cv::VideoWriter::fourcc('m', '4', 's', '2'); tv.open(fn, f, 30.0, cv::Size(1920,1080)); }
if (!tv.isOpened()) {f = cv::VideoWriter::fourcc('m', 'p', '4', 's'); tv.open(fn, f, 30.0, cv::Size(1920,1080)); }
if (!tv.isOpened()) {f = cv::VideoWriter::fourcc('w', 'm', 'v', '3'); tv.open(fn, f, 30.0, cv::Size(1920,1080)); }
if (!tv.isOpened()) {f = cv::VideoWriter::fourcc('w', 'm', 'p', 'v'); tv.open(fn, f, 30.0, cv::Size(1920,1080)); }
if (!tv.isOpened()) {f = cv::VideoWriter::fourcc('w', 'm', 'v', '3'); tv.open(fn, f, 30.0, cv::Size(1920,1080)); }
if (!tv.isOpened()) {f = cv::VideoWriter::fourcc('w', 'v', 'c', '1'); tv.open(fn, f, 30.0, cv::Size(1920,1080)); }
if (!tv.isOpened()) {f = cv::VideoWriter::fourcc('w', 'v', 'p', '2'); tv.open(fn, f, 30.0, cv::Size(1920,1080)); }
if (!tv.isOpened()) {f = cv::VideoWriter::fourcc('i', '4', '2', '0'); tv.open(fn, f, 30.0, cv::Size(1920,1080)); }
if (!tv.isOpened()) {f = cv::VideoWriter::fourcc('i', 'y', 'u', 'v'); tv.open(fn, f, 30.0, cv::Size(1920,1080)); }
if (!tv.isOpened()) {f = cv::VideoWriter::fourcc('m', 'p', 'g', '1'); tv.open(fn, f, 30.0, cv::Size(1920,1080)); }
if (!tv.isOpened()) {f = cv::VideoWriter::fourcc('m', 's', 's', '1'); tv.open(fn, f, 30.0, cv::Size(1920,1080)); }
if (!tv.isOpened()) {f = cv::VideoWriter::fourcc('m', 's', 's', '2'); tv.open(fn, f, 30.0, cv::Size(1920,1080)); }
if (!tv.isOpened()) {f = cv::VideoWriter::fourcc('u', 'y', 'v', 'y'); tv.open(fn, f, 30.0, cv::Size(1920,1080)); }
if (!tv.isOpened()) {f = cv::VideoWriter::fourcc('w', 'm', 'v', '1'); tv.open(fn, f, 30.0, cv::Size(1920,1080)); }
if (!tv.isOpened()) {f = cv::VideoWriter::fourcc('w', 'm', 'v', '2'); tv.open(fn, f, 30.0, cv::Size(1920,1080)); }
if (!tv.isOpened()) {f = cv::VideoWriter::fourcc('w', 'm', 'v', '3'); tv.open(fn, f, 30.0, cv::Size(1920,1080)); }
if (!tv.isOpened()) {f = cv::VideoWriter::fourcc('w', 'm', 'v', 'a'); tv.open(fn, f, 30.0, cv::Size(1920,1080)); }
if (!tv.isOpened()) {f = cv::VideoWriter::fourcc('y', 'u', 'y', '2'); tv.open(fn, f, 30.0, cv::Size(1920,1080)); }
if (!tv.isOpened()) {f = cv::VideoWriter::fourcc('y', 'v', '1', '2'); tv.open(fn, f, 30.0, cv::Size(1920,1080)); }
if (!tv.isOpened()) {f = cv::VideoWriter::fourcc('y', 'v', 'u', '9'); tv.open(fn, f, 30.0, cv::Size(1920,1080)); }
if (!tv.isOpened()) {f = cv::VideoWriter::fourcc('y', 'v', 'y', 'u'); tv.open(fn, f, 30.0, cv::Size(1920,1080)); }
if (!tv.isOpened()) f = 0;
return f;
}
/*!
\param img the image to be drawn
\param points points positions in format of Mat(N,2,CV_32F)
\param symbol symbol of markers, can be "+", "x", "o", "square"
\param size the size of the markers (in pixels)
\param color cv::Scalar(blue,green,red)
\param alpha alpha of markers (0:invisible, 1:opaque)
*/
int drawPointsOnImage(cv::Mat & img, cv::Mat points, std::string symbol,
int size, int thickness,
cv::Scalar color, float alpha, int putText, int shift)
{
cv::Mat imgCpy; img.copyTo(imgCpy);
int i = 0;
for (i = 0; i < points.rows; i++) {
// circle
if (symbol.compare("o") == 0) {
int radius = size / 2 * (1 << shift);
cv::Point pi(
(int)(points.at<float>(i, 0) * (1 << shift) + 0.5f),
(int)(points.at<float>(i, 1) * (1 << shift) + 0.5f));
cv::circle(img, pi, radius, color, thickness, LINE_8, shift);
}
// '+'
else if (symbol.compare("+") == 0) {
int d = size / 2 * (1 << shift);
cv::Point pi, pj;
pi = cv::Point(
(int)((points.at<float>(i, 0) - d) * (1 << shift) + 0.5f),
(int)((points.at<float>(i, 1) - 0) * (1 << shift) + 0.5f));
pj = cv::Point(
(int)((points.at<float>(i, 0) + d) * (1 << shift) + 0.5f),
(int)((points.at<float>(i, 1) - 0) * (1 << shift) + 0.5f));
cv::line(img, pi, pj, color, thickness, LINE_8, shift);
pi = cv::Point(
(int)((points.at<float>(i, 0) - 0) * (1 << shift) + 0.5f),
(int)((points.at<float>(i, 1) - d) * (1 << shift) + 0.5f));
pj = cv::Point(
(int)((points.at<float>(i, 0) + 0) * (1 << shift) + 0.5f),
(int)((points.at<float>(i, 1) + d) * (1 << shift) + 0.5f));
cv::line(img, pi, pj, color, thickness, LINE_8, shift);
}
// 'x'
else if (symbol.compare("x") == 0 || symbol.compare("X") == 0) {
int d = size / 2 * (1 << shift);
cv::Point pi, pj;
pi = cv::Point(
(int)((points.at<float>(i, 0) - d) * (1 << shift) + 0.5f),
(int)((points.at<float>(i, 1) - d) * (1 << shift) + 0.5f));
pj = cv::Point(
(int)((points.at<float>(i, 0) + d) * (1 << shift) + 0.5f),
(int)((points.at<float>(i, 1) + d) * (1 << shift) + 0.5f));
cv::line(img, pi, pj, color, thickness, LINE_8, shift);
pi = cv::Point(
(int)((points.at<float>(i, 0) - d) * (1 << shift) + 0.5f),
(int)((points.at<float>(i, 1) + d) * (1 << shift) + 0.5f));
pj = cv::Point(
(int)((points.at<float>(i, 0) + d) * (1 << shift) + 0.5f),
(int)((points.at<float>(i, 1) - d) * (1 << shift) + 0.5f));
cv::line(img, pi, pj, color, thickness, LINE_8, shift);
}
// 'square'
else if (symbol.compare("square") == 0) {
int d = size / 2 * (1 << shift);
cv::Point pi, pj;
pi = cv::Point(
(int)((points.at<float>(i, 0) - d) * (1 << shift) + 0.5f),
(int)((points.at<float>(i, 1) - d) * (1 << shift) + 0.5f));
pj = cv::Point(
(int)((points.at<float>(i, 0) + d) * (1 << shift) + 0.5f),
(int)((points.at<float>(i, 1) + d) * (1 << shift) + 0.5f));
cv::rectangle(img, pi, pj, color, thickness, LINE_8, shift);
}
// add text
if (putText >= 0) {
char strbuf[10];
int fontFace = FONT_HERSHEY_DUPLEX;
double fontScale = size / 8.0;
int thickness = max(size / 6, 1);
int lineType = 8;
bool bottomLeftOri = false;
sprintf_s(strbuf, "%d", i + 1);
cv::putText(img, string(strbuf),
cv::Point((int)(points.at<float>(i, 0) + 0.5f), (int)(points.at<float>(i, 1) + 0.5f)),
fontFace, fontScale, color, thickness, lineType, bottomLeftOri);
}
} // end of loop of each point
// do transparency
cv::addWeighted(img, alpha, imgCpy, 1 - alpha, 0, img);
return 0;
}
int drawPointOnImage(cv::Mat & img, cv::Point2f point, std::string symbol,
int size, int thickness,
cv::Scalar color, float alpha, int putText, int shift)
{
cv::Mat points(1, 2, CV_32F);
points.at<float>(0, 0) = point.x;
points.at<float>(0, 1) = point.y;
return drawPointsOnImage(img, points, symbol, size, thickness,
color, alpha, putText, shift);
}
//! uToCrack() calculates crack opening or sliding according to given displacement fields.
/*!
\details This function calculates crack opening or sliding according to given displacement fields.
The displacement fields are normally analyzed by template match, ECC, optical flow, or other methods.
\param u displacement field. Type:CV_32FC2 in unit of pixel. Right-ward positive. (image coordinate)
\param crack_opn crack opening field. Type:CV_32F, in unit of pixel.
\param crack_sld crack sliding field. Type:CV_32F, in unit of pixel.
\param angle assumed crack direction (0, 45, 90, 135 for specific direction, or 999 for max. of all above)
\param oper if oper (operator) is 0, crack_opn/sld = calculated value.
if oper is 1 and crack_opn/sld is allocated in corrected sizes, crack_opn/sld = max(crack_opn/sld, calculated values)
\return 0.
*/
int uToCrack(const cv::Mat & u, cv::Mat & crack_opn, cv::Mat & crack_sld,
int angle, int oper)
{
// if angle == 999, pick max of angle = 0, 45, 90, and 135
if (angle >= 999 || angle <= -999)
{
uToCrack(u, crack_opn, crack_sld, 0, 0); // initialize by angle = 0
uToCrack(u, crack_opn, crack_sld, 45, 1); // update by max( which angle = 0, which angle = 45)
uToCrack(u, crack_opn, crack_sld, 90, 1); // update by max( current value, which angle = 90)
uToCrack(u, crack_opn, crack_sld, 135, 1); // update by max( current value, which angle = 135)
return 0;
}
// variables
float theta;
// check
if (u.rows <= 0 || u.cols <= 0 || u.type() != CV_32FC2)
{
cerr << "uToCrack error: Input u cannot be empty and needs to be CV_32FC2 (i.e., 13).\n";
cerr << " but sized " << u.rows << "-by-" << u.cols << " typed " << u.type() << endl;
return -1;
}
// reallocate
if (crack_opn.rows != u.rows || crack_opn.cols != u.cols || crack_opn.type() != CV_32F)
crack_opn = cv::Mat::zeros(u.rows, u.cols, CV_32F) - 100; // assuming -100 is minimum
if (crack_sld.rows != u.rows || crack_sld.cols != u.cols || crack_sld.type() != CV_32F)
crack_sld = cv::Mat::zeros(u.rows, u.cols, CV_32F) - 100; // assuming -100 is minimum
// convert angle to range[0,180)
while (angle < 0) angle += 180;
while (angle >= 180) angle -= 180;
theta = (float) (angle * M_PI / 180.);
// crack field
cv::Point2f ua, ub, u_up, u_dn, u_lf, u_rt;
cv::Mat cr(2, 1, CV_32F), uab(2, 1, CV_32F);
float cos_theta = cos(theta), sin_theta = sin(theta);
cv::Mat c22(2, 2, CV_32F), c22_inv(2, 2, CV_32F);
c22.at<float>(0, 0) = (float) cos(theta + M_PI / 2.);
c22.at<float>(0, 1) = (float) cos(theta);
c22.at<float>(1, 0) = (float) sin(theta + M_PI / 2.);
c22.at<float>(1, 1) = (float) sin(theta);
c22_inv = c22.inv();
for (int i = 0; i < u.rows; i++)
{
for (int j = 0; j < u.cols; j++)
{
// calculate U_up, U_down, U_left, U_right
int I = max(1, min(u.rows - 2, i)); // I = i but must be between 1 ~ (u.rows - 2)
int J = max(1, min(u.cols - 2, j)); // J = j but must be between 1 ~ (u.cols - 2)
u_up = u.at<cv::Point2f>(I - 1, j);
u_dn = u.at<cv::Point2f>(I + 1, j);
u_lf = u.at<cv::Point2f>(i, J - 1);
u_rt = u.at<cv::Point2f>(i, J + 1);
// calculate UA and UB
if (angle < 90)
{
ua = (-u_up * cos_theta + u_lf * sin_theta) / (cos_theta + sin_theta);
ub = (-u_dn * cos_theta + u_rt * sin_theta) / (cos_theta + sin_theta);
}
else {
ua = (u_dn * cos_theta + u_lf * sin_theta) / (-cos_theta + sin_theta);
ub = (u_up * cos_theta + u_rt * sin_theta) / (-cos_theta + sin_theta);
}
// Solve the 2x2 linear system
uab.at<float>(0, 0) = ua.x - ub.x;
uab.at<float>(1, 0) = ua.y - ub.y;
// cr = c22_inv * uab;
cr.at<float>(0, 0) = c22_inv.at<float>(0, 0) * uab.at<float>(0, 0) + c22_inv.at<float>(0, 1) * uab.at<float>(1, 0);
cr.at<float>(1, 0) = c22_inv.at<float>(1, 0) * uab.at<float>(0, 0) + c22_inv.at<float>(1, 1) * uab.at<float>(1, 0);
// fill-in crack opening and sliding to Mat crack_opn and crack_sld
if (oper == 0) {
crack_opn.at<float>(i, j) = cr.at<float>(0, 0);
crack_sld.at<float>(i, j) = cr.at<float>(1, 0);
}
else if (oper == 1) {
crack_opn.at<float>(i, j) = max(crack_opn.at<float>(i, j), cr.at<float>(0, 0));
crack_sld.at<float>(i, j) = max(crack_sld.at<float>(i, j), cr.at<float>(1, 0));
}
}
}
return 0;
}
//! uToCrack() calculates strain fields according to given displacement fields.
/*!
\details This function calculates strain fields according to given displacement fields.
The displacement fields are normally analyzed by template match, ECC, optical flow, or other methods.
\param u displacement field. Type:CV_32FC2 in unit of pixel. Right-ward/down-ward positive. (image coordinate)
\param exx strain field exx. Type:CV_32F, dimensionless.
\param exx strain field eyy. Type:CV_32F, dimensionless.
\param exx strain field exy. Type:CV_32F, dimensionless.
\return 0.
*/
int uToStrain(const cv::Mat & u, cv::Mat & exx, cv::Mat & eyy, cv::Mat & exy)
{
// check
if (u.rows <= 0 || u.cols <= 0 || u.type() != CV_32FC2)
{
cerr << "uToStrain error: Input u cannot be empty and needs to be CV_32FC2 (i.e., 13).\n";
cerr << " but sized " << u.rows << "-by-" << u.cols << " typed " << u.type() << endl;
return -1;
}
// reallocate
if (exx.rows != u.rows || exx.cols != u.cols || exx.type() != CV_32F)
exx = cv::Mat::zeros(u.rows, u.cols, CV_32F);
if (eyy.rows != u.rows || eyy.cols != u.cols || eyy.type() != CV_32F)
eyy = cv::Mat::zeros(u.rows, u.cols, CV_32F);
if (exy.rows != u.rows || exy.cols != u.cols || exy.type() != CV_32F)
exy = cv::Mat::zeros(u.rows, u.cols, CV_32F);
// strain field
cv::Point2f u_up, u_dn, u_lf, u_rt;
for (int i = 0; i < u.rows; i++)
{
for (int j = 0; j < u.cols; j++)
{
// calculate U_up, U_down, U_left, U_right
int I = max(1, min(u.rows - 2, i)); // I = i but must be between 1 ~ (u.rows - 2)
int J = max(1, min(u.cols - 2, j)); // J = j but must be between 1 ~ (u.cols - 2)
u_up = u.at<cv::Point2f>(I - 1, j);
u_dn = u.at<cv::Point2f>(I + 1, j);
u_lf = u.at<cv::Point2f>(i, J - 1);
u_rt = u.at<cv::Point2f>(i, J + 1);
// calculate strain
exx.at<float>(i, j) = (u_rt.x - u_lf.x) / 2.0f;
eyy.at<float>(i, j) = (u_dn.y - u_up.y) / 2.0f;
exy.at<float>(i, j) = (u_rt.y - u_lf.y) / 2.0f + (u_dn.x - u_up.x) / 2.0f;
}
}
return 0;
}
cv::Mat sobel_xy(const cv::Mat & src)
{
cv::Mat src_gray;
cv::Mat grad;
int scale = 1;
int delta = 0;
int ddepth = CV_16S;
if (!src.data)
{
return cv::Mat();
}
/// Convert it to gray
if (src.channels() > 1)
cv::cvtColor(src, src_gray, cv::COLOR_BGR2GRAY);
else
src_gray = src;
/// Generate grad_x and grad_y
cv::Mat grad_x, grad_y;
cv::Mat abs_grad_x, abs_grad_y;
/// Gradient X
//Scharr( src_gray, grad_x, ddepth, 1, 0, scale, delta, BORDER_DEFAULT );
cv::Sobel(src_gray, grad_x, ddepth, 1, 0, 3, scale, delta, BORDER_DEFAULT);
convertScaleAbs(grad_x, abs_grad_x);
/// Gradient Y
//Scharr( src_gray, grad_y, ddepth, 0, 1, scale, delta, BORDER_DEFAULT );
Sobel(src_gray, grad_y, ddepth, 0, 1, 3, scale, delta, BORDER_DEFAULT);
convertScaleAbs(grad_y, abs_grad_y);
/// Total Gradient (approximate)
addWeighted(abs_grad_x, 0.5, abs_grad_y, 0.5, 0, grad);
return grad;
}
void imshow_resize(string winname, cv::Mat img, double factor)
{
cv::Mat tmp;
cv::resize(img, tmp, cv::Size(0, 0), factor, factor);
cv::imshow(winname, tmp);
}
//! tryOpcvCapFocusExposureGain() allows user to find the best focus/exposure/gain values
// by trial and error interactively (thruogh keyboard)
/*!
\detail
hotkey: 0~9 - set active camera id
hotkey: a - increase focus value by 0.01
hotkey: z - decrease focus value by 0.01
hotkey: s - increase exposure value by 0.01
hotkey: x - decrease exposure value by 0.01
hotkey: r - trial resolution by console interaction
hotkey: t - set region of imshow (as a cv::Rect: x0 y0 width height) through console interaction
hotkey: ijkl - movement of showing zoom window
hotkey: p - save current image to file
hotkey: b - switch sobel on/off
hotkey: o - switch continuous imshow on/off
hotkey:
\param result adjusted value by user. [0]:cam_id, [1]:focus, [2]:exposure, [3] width, [4] height
\return 0.
*/
int tryOpcvCapFocusExposure(std::vector<double> & result)
{
int cam_id = 0;
double focus = 0.0, exposure = 0.0;
int width = 1920, height = 1080;
int zoom_w = 640, zoom_h = 480;
int full_w = 800; // height is calculated based on actual aspect ratio
cv::Rect imshowRect(0, 0, zoom_w, zoom_h);
cv::VideoCapture cam;
bool cam_opened = false;
bool img_ok = false;
bool sobel = false;
int my_waitKeyTime = 0; // 0: waiting for key, 200: refresh every 0.2 sec.
while (true)
{
cv::Mat img = cv::Mat::zeros(imshowRect.height, imshowRect.width, CV_8UC3);
// Set camera
if (cam.isOpened() == false)
cam_opened = cam.open(cam_id, cv::CAP_DSHOW);
if (cam_opened == false)
{
printf("Failed to open camera %d.\n", cam_id);
}
if (cam_opened == true)
{
cam.set(cv::CAP_PROP_AUTOFOCUS, 0.0); // disable autofocus
cam.set(cv::CAP_PROP_AUTO_EXPOSURE, 0.0); // disable auto-exposure
cam.set(cv::CAP_PROP_FOCUS, focus);
cam.set(cv::CAP_PROP_EXPOSURE, exposure);
if (height != (int)cam.get(cv::CAP_PROP_FRAME_HEIGHT))
cam.set(cv::CAP_PROP_FRAME_HEIGHT, (double)height);
if (width != (int)cam.get(cv::CAP_PROP_FRAME_WIDTH))
cam.set(cv::CAP_PROP_FRAME_WIDTH, (double)width);
}
// grab image
if (cam_opened == true && cam.isOpened() == true)
{
img_ok = cam.grab();
if (img_ok)
img_ok = cam.retrieve(img);
if (img_ok && sobel)
img = sobel_xy(img);
}
// show image
if (img_ok == true)
{
cv::imshow("Zoom Camera", img(imshowRect));
int full_h = (int)(full_w * img.rows * 1.0 / img.cols + .5);
cv::Mat imgSmall;
cv::resize(img, imgSmall, cv::Size(full_w, full_h));
cv::imshow("Overall view", imgSmall);
}
// get info from camera (assuring properties are actual properties)
// print information on console
printf("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");
printf("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");
printf("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");
printf("Camera %d: Focus:%7.2f, Exposure:%7.2f, Width:%4d, Height:%4d. Rect(%4d,%4d,%4d,%4d)",
cam_id,
cam.get(cv::CAP_PROP_FOCUS),
cam.get(cv::CAP_PROP_EXPOSURE),
(int) cam.get(cv::CAP_PROP_FRAME_WIDTH),
(int) cam.get(cv::CAP_PROP_FRAME_HEIGHT),
imshowRect.x, imshowRect.y, imshowRect.width, imshowRect.height);
// waiting for user key-in
int ukey = cv::waitKey(my_waitKeyTime);
if (ukey > 0) printf("\nYou pressed %d\n", ukey);
// if change camera
if (ukey >= (int) '0' && ukey <= (int) '9')
{
cam_id = ukey - (int)'0';
printf("Reset camera ID to %d\n", cam_id);
cam.release();
}
// if change focus
if (ukey == (int)'a')
{
focus += 1;
printf("Set trial focus to %7.2f\n", focus);
}
if (ukey == (int)'z')
{
focus -= 1;
printf("Set trial focus to %7.2f\n", focus);
}
// if change exposure
if (ukey == (int)'s')
{
exposure += 1;
printf("Set trial exposure to %7.2f\n", exposure);
}
if (ukey == (int)'x')
{
exposure -= 1;
printf("Set trial exposure to %7.2f\n", exposure);
}
// if moving zoom window
if (ukey == (int)'i') {
imshowRect.y -= 20;
if (imshowRect.y < 0) imshowRect.y = 0;
}
if (ukey == (int)'j') {
imshowRect.x -= 20;
if (imshowRect.x < 0) imshowRect.x = 0;
}
if (ukey == (int)'k') {
imshowRect.y += 20;
if (imshowRect.y > img.rows - imshowRect.height) imshowRect.y = img.rows - imshowRect.height;
}
if (ukey == (int)'l') {
imshowRect.x += 20;
if (imshowRect.x > img.cols - imshowRect.width) imshowRect.x = img.cols - imshowRect.width;
}
// if change trial camera resolution
if (ukey == (int)'r')
{
printf("Input your preferred resolution (current: %d %d): ", width, height);
std::cin.clear();
cin >> width >> height;
std::cin.clear();
}
// if change imshow range (rect)
if (ukey == (int) 't')
{
printf("Input your preferred showing rect (current: %d %d %d %d): ", imshowRect.x, imshowRect.y, imshowRect.width, imshowRect.height);
std::cin.clear();
cin >> imshowRect.x >> imshowRect.y >> imshowRect.width >> imshowRect.height;
std::cin.clear();
}
if (ukey == (int) 'b')
{
sobel = !sobel;
printf("Switch sobel to %d.\n", sobel);
}
if (ukey == (int) 'p')
{
std::string fname;
printf("Enter file name to save the current photo: ");
fname = readStringLineFromCin();
cv::imwrite(fname, img);
}
if (ukey == (int) 'o')
{
if (my_waitKeyTime == 0)
my_waitKeyTime = 200;
else
my_waitKeyTime = 0;
}
// if ok and quit .
if (ukey == (int)'q')
{
if (result.size() < 5) result.resize(5);
result[0] = (double)cam_id;
result[1] = focus;
result[2] = exposure;
result[3] = (double)width;
result[4] = (double)height;
cv::destroyWindow("Zoom Camera");
cv::destroyWindow("Overall view");
return 0;
}
}
return 0;
} | [
"improdevteam@gmail.com"
] | improdevteam@gmail.com |
171b40c5cd70870c1ce7e4cd7da7d18027408524 | 73d1d64ec50c7e6ccf87c73130b8917c67009cab | /src/Pegasus/WebServer/WebRequest.h | 48e1bc8a9989448da239a5adbc761bc61b6b5097 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | deleisha/neopegasus | 21a960a5664f2074d9ab176e80b023eba2bebe79 | f051727e7fa587e97d3d75f6f3865b27c7c68377 | refs/heads/master | 2021-01-18T22:32:39.786216 | 2017-08-01T15:38:38 | 2017-08-01T15:38:38 | 38,531,497 | 3 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 3,348 | h | //%LICENSE////////////////////////////////////////////////////////////////
//
// Licensed to The Open Group (TOG) under one or more contributor license
// agreements. Refer to the OpenPegasusNOTICE.txt file distributed with
// this work for additional information regarding copyright ownership.
// Each contributor licenses this file to you under the OpenPegasus Open
// Source License; you may not use this file except in compliance with the
// License.
//
// 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.
//
//////////////////////////////////////////////////////////////////////////
//
//%/////////////////////////////////////////////////////////////////////////////
#ifndef Pegasus_WebRequest_h
#define Pegasus_WebRequest_h
#include <Pegasus/Common/HTTPMessage.h>
PEGASUS_NAMESPACE_BEGIN
/**
* Container for the request values of interest for the WebProcessor.
*/
class PEGASUS_WEBSERVER_LINKAGE WebRequest
{
public:
/**
* Constructor.
*
* @param queueId
* Request's queueId required for generation of the response
* for a successful delivery back to the requester.
*/
WebRequest(Uint32 queueId)
:_queueId(queueId)
{
}
/**
* Destructor.
*/
~WebRequest()
{
}
Uint32 getQueueId() const
{
return _queueId;
}
/**
* URI of the request.
*/
String requestURI;
/**
* HTTP version.
*/
String httpVersion;
/**
* Method of the request.
*/
HttpMethod httpMethod;
/*
* HTTP-header: Accept
*/
String mimeTypes;
/*
* HTTP-header: Accept-Charset
*/
String charSets;
/*
* HTTP-header: Accept-Encoding
*/
String encodings;
/*
* Type of user-authentication, currently not used.
*/
String authType;
/*
* Username/requester, currently not used.
*/
String userName;
/*
* List of languages acceptable for a response, currently not used
*/
AcceptLanguageList acceptLanguages;
/**
* IP-Address, currently not used.
*/
String ipAddress;
private:
/**
* QueueID of request, required for a successful delivery of the response.
*/
Uint32 _queueId;
};
PEGASUS_NAMESPACE_END
#endif /* Pegasus_WebRequest_h */
| [
"lawrence.luo"
] | lawrence.luo |
1e41ee74c621ec0fe6f361f31218585cb484d0f5 | c776476e9d06b3779d744641e758ac3a2c15cddc | /examples/litmus/c/run-scripts/tmp_5/Z6.2+dmb.st+dmb.st+addr.c.cbmc_out.cpp | cd323add2e06f31455df1e9737967a3bc0858dad | [] | no_license | ashutosh0gupta/llvm_bmc | aaac7961c723ba6f7ffd77a39559e0e52432eade | 0287c4fb180244e6b3c599a9902507f05c8a7234 | refs/heads/master | 2023-08-02T17:14:06.178723 | 2023-07-31T10:46:53 | 2023-07-31T10:46:53 | 143,100,825 | 3 | 4 | null | 2023-05-25T05:50:55 | 2018-08-01T03:47:00 | C++ | UTF-8 | C++ | false | false | 40,252 | cpp | // Global variabls:
// 0:vars:3
// 3:atom_1_X0_1:1
// 4:atom_2_X0_1:1
// Local global variabls:
// 0:thr0:1
// 1:thr1:1
// 2:thr2:1
#define ADDRSIZE 5
#define LOCALADDRSIZE 3
#define NTHREAD 4
#define NCONTEXT 5
#define ASSUME(stmt) __CPROVER_assume(stmt)
#define ASSERT(stmt) __CPROVER_assert(stmt, "error")
#define max(a,b) (a>b?a:b)
char __get_rng();
char get_rng( char from, char to ) {
char ret = __get_rng();
ASSUME(ret >= from && ret <= to);
return ret;
}
char get_rng_th( char from, char to ) {
char ret = __get_rng();
ASSUME(ret >= from && ret <= to);
return ret;
}
int main(int argc, char **argv) {
// Declare arrays for intial value version in contexts
int local_mem[LOCALADDRSIZE];
// Dumping initializations
local_mem[0+0] = 0;
local_mem[1+0] = 0;
local_mem[2+0] = 0;
int cstart[NTHREAD];
int creturn[NTHREAD];
// declare arrays for contexts activity
int active[NCONTEXT];
int ctx_used[NCONTEXT];
// declare arrays for intial value version in contexts
int meminit_[ADDRSIZE*NCONTEXT];
#define meminit(x,k) meminit_[(x)*NCONTEXT+k]
int coinit_[ADDRSIZE*NCONTEXT];
#define coinit(x,k) coinit_[(x)*NCONTEXT+k]
int deltainit_[ADDRSIZE*NCONTEXT];
#define deltainit(x,k) deltainit_[(x)*NCONTEXT+k]
// declare arrays for running value version in contexts
int mem_[ADDRSIZE*NCONTEXT];
#define mem(x,k) mem_[(x)*NCONTEXT+k]
int co_[ADDRSIZE*NCONTEXT];
#define co(x,k) co_[(x)*NCONTEXT+k]
int delta_[ADDRSIZE*NCONTEXT];
#define delta(x,k) delta_[(x)*NCONTEXT+k]
// declare arrays for local buffer and observed writes
int buff_[NTHREAD*ADDRSIZE];
#define buff(x,k) buff_[(x)*ADDRSIZE+k]
int pw_[NTHREAD*ADDRSIZE];
#define pw(x,k) pw_[(x)*ADDRSIZE+k]
// declare arrays for context stamps
char cr_[NTHREAD*ADDRSIZE];
#define cr(x,k) cr_[(x)*ADDRSIZE+k]
char iw_[NTHREAD*ADDRSIZE];
#define iw(x,k) iw_[(x)*ADDRSIZE+k]
char cw_[NTHREAD*ADDRSIZE];
#define cw(x,k) cw_[(x)*ADDRSIZE+k]
char cx_[NTHREAD*ADDRSIZE];
#define cx(x,k) cx_[(x)*ADDRSIZE+k]
char is_[NTHREAD*ADDRSIZE];
#define is(x,k) is_[(x)*ADDRSIZE+k]
char cs_[NTHREAD*ADDRSIZE];
#define cs(x,k) cs_[(x)*ADDRSIZE+k]
char crmax_[NTHREAD*ADDRSIZE];
#define crmax(x,k) crmax_[(x)*ADDRSIZE+k]
char sforbid_[ADDRSIZE*NCONTEXT];
#define sforbid(x,k) sforbid_[(x)*NCONTEXT+k]
// declare arrays for synchronizations
int cl[NTHREAD];
int cdy[NTHREAD];
int cds[NTHREAD];
int cdl[NTHREAD];
int cisb[NTHREAD];
int caddr[NTHREAD];
int cctrl[NTHREAD];
int r0= 0;
char creg_r0;
char creg__r0__1_;
int r1= 0;
char creg_r1;
int r2= 0;
char creg_r2;
int r3= 0;
char creg_r3;
int r4= 0;
char creg_r4;
char creg__r1__1_;
int r5= 0;
char creg_r5;
int r6= 0;
char creg_r6;
int r7= 0;
char creg_r7;
int r8= 0;
char creg_r8;
int r9= 0;
char creg_r9;
char creg__r9__2_;
int r10= 0;
char creg_r10;
int r11= 0;
char creg_r11;
int r12= 0;
char creg_r12;
int r13= 0;
char creg_r13;
char creg__r13__1_;
int r14= 0;
char creg_r14;
char old_cctrl= 0;
char old_cr= 0;
char old_cdy= 0;
char old_cw= 0;
char new_creg= 0;
buff(0,0) = 0;
pw(0,0) = 0;
cr(0,0) = 0;
iw(0,0) = 0;
cw(0,0) = 0;
cx(0,0) = 0;
is(0,0) = 0;
cs(0,0) = 0;
crmax(0,0) = 0;
buff(0,1) = 0;
pw(0,1) = 0;
cr(0,1) = 0;
iw(0,1) = 0;
cw(0,1) = 0;
cx(0,1) = 0;
is(0,1) = 0;
cs(0,1) = 0;
crmax(0,1) = 0;
buff(0,2) = 0;
pw(0,2) = 0;
cr(0,2) = 0;
iw(0,2) = 0;
cw(0,2) = 0;
cx(0,2) = 0;
is(0,2) = 0;
cs(0,2) = 0;
crmax(0,2) = 0;
buff(0,3) = 0;
pw(0,3) = 0;
cr(0,3) = 0;
iw(0,3) = 0;
cw(0,3) = 0;
cx(0,3) = 0;
is(0,3) = 0;
cs(0,3) = 0;
crmax(0,3) = 0;
buff(0,4) = 0;
pw(0,4) = 0;
cr(0,4) = 0;
iw(0,4) = 0;
cw(0,4) = 0;
cx(0,4) = 0;
is(0,4) = 0;
cs(0,4) = 0;
crmax(0,4) = 0;
cl[0] = 0;
cdy[0] = 0;
cds[0] = 0;
cdl[0] = 0;
cisb[0] = 0;
caddr[0] = 0;
cctrl[0] = 0;
cstart[0] = get_rng(0,NCONTEXT-1);
creturn[0] = get_rng(0,NCONTEXT-1);
buff(1,0) = 0;
pw(1,0) = 0;
cr(1,0) = 0;
iw(1,0) = 0;
cw(1,0) = 0;
cx(1,0) = 0;
is(1,0) = 0;
cs(1,0) = 0;
crmax(1,0) = 0;
buff(1,1) = 0;
pw(1,1) = 0;
cr(1,1) = 0;
iw(1,1) = 0;
cw(1,1) = 0;
cx(1,1) = 0;
is(1,1) = 0;
cs(1,1) = 0;
crmax(1,1) = 0;
buff(1,2) = 0;
pw(1,2) = 0;
cr(1,2) = 0;
iw(1,2) = 0;
cw(1,2) = 0;
cx(1,2) = 0;
is(1,2) = 0;
cs(1,2) = 0;
crmax(1,2) = 0;
buff(1,3) = 0;
pw(1,3) = 0;
cr(1,3) = 0;
iw(1,3) = 0;
cw(1,3) = 0;
cx(1,3) = 0;
is(1,3) = 0;
cs(1,3) = 0;
crmax(1,3) = 0;
buff(1,4) = 0;
pw(1,4) = 0;
cr(1,4) = 0;
iw(1,4) = 0;
cw(1,4) = 0;
cx(1,4) = 0;
is(1,4) = 0;
cs(1,4) = 0;
crmax(1,4) = 0;
cl[1] = 0;
cdy[1] = 0;
cds[1] = 0;
cdl[1] = 0;
cisb[1] = 0;
caddr[1] = 0;
cctrl[1] = 0;
cstart[1] = get_rng(0,NCONTEXT-1);
creturn[1] = get_rng(0,NCONTEXT-1);
buff(2,0) = 0;
pw(2,0) = 0;
cr(2,0) = 0;
iw(2,0) = 0;
cw(2,0) = 0;
cx(2,0) = 0;
is(2,0) = 0;
cs(2,0) = 0;
crmax(2,0) = 0;
buff(2,1) = 0;
pw(2,1) = 0;
cr(2,1) = 0;
iw(2,1) = 0;
cw(2,1) = 0;
cx(2,1) = 0;
is(2,1) = 0;
cs(2,1) = 0;
crmax(2,1) = 0;
buff(2,2) = 0;
pw(2,2) = 0;
cr(2,2) = 0;
iw(2,2) = 0;
cw(2,2) = 0;
cx(2,2) = 0;
is(2,2) = 0;
cs(2,2) = 0;
crmax(2,2) = 0;
buff(2,3) = 0;
pw(2,3) = 0;
cr(2,3) = 0;
iw(2,3) = 0;
cw(2,3) = 0;
cx(2,3) = 0;
is(2,3) = 0;
cs(2,3) = 0;
crmax(2,3) = 0;
buff(2,4) = 0;
pw(2,4) = 0;
cr(2,4) = 0;
iw(2,4) = 0;
cw(2,4) = 0;
cx(2,4) = 0;
is(2,4) = 0;
cs(2,4) = 0;
crmax(2,4) = 0;
cl[2] = 0;
cdy[2] = 0;
cds[2] = 0;
cdl[2] = 0;
cisb[2] = 0;
caddr[2] = 0;
cctrl[2] = 0;
cstart[2] = get_rng(0,NCONTEXT-1);
creturn[2] = get_rng(0,NCONTEXT-1);
buff(3,0) = 0;
pw(3,0) = 0;
cr(3,0) = 0;
iw(3,0) = 0;
cw(3,0) = 0;
cx(3,0) = 0;
is(3,0) = 0;
cs(3,0) = 0;
crmax(3,0) = 0;
buff(3,1) = 0;
pw(3,1) = 0;
cr(3,1) = 0;
iw(3,1) = 0;
cw(3,1) = 0;
cx(3,1) = 0;
is(3,1) = 0;
cs(3,1) = 0;
crmax(3,1) = 0;
buff(3,2) = 0;
pw(3,2) = 0;
cr(3,2) = 0;
iw(3,2) = 0;
cw(3,2) = 0;
cx(3,2) = 0;
is(3,2) = 0;
cs(3,2) = 0;
crmax(3,2) = 0;
buff(3,3) = 0;
pw(3,3) = 0;
cr(3,3) = 0;
iw(3,3) = 0;
cw(3,3) = 0;
cx(3,3) = 0;
is(3,3) = 0;
cs(3,3) = 0;
crmax(3,3) = 0;
buff(3,4) = 0;
pw(3,4) = 0;
cr(3,4) = 0;
iw(3,4) = 0;
cw(3,4) = 0;
cx(3,4) = 0;
is(3,4) = 0;
cs(3,4) = 0;
crmax(3,4) = 0;
cl[3] = 0;
cdy[3] = 0;
cds[3] = 0;
cdl[3] = 0;
cisb[3] = 0;
caddr[3] = 0;
cctrl[3] = 0;
cstart[3] = get_rng(0,NCONTEXT-1);
creturn[3] = get_rng(0,NCONTEXT-1);
// Dumping initializations
mem(0+0,0) = 0;
mem(0+1,0) = 0;
mem(0+2,0) = 0;
mem(3+0,0) = 0;
mem(4+0,0) = 0;
// Dumping context matching equalities
co(0,0) = 0;
delta(0,0) = -1;
mem(0,1) = meminit(0,1);
co(0,1) = coinit(0,1);
delta(0,1) = deltainit(0,1);
mem(0,2) = meminit(0,2);
co(0,2) = coinit(0,2);
delta(0,2) = deltainit(0,2);
mem(0,3) = meminit(0,3);
co(0,3) = coinit(0,3);
delta(0,3) = deltainit(0,3);
mem(0,4) = meminit(0,4);
co(0,4) = coinit(0,4);
delta(0,4) = deltainit(0,4);
co(1,0) = 0;
delta(1,0) = -1;
mem(1,1) = meminit(1,1);
co(1,1) = coinit(1,1);
delta(1,1) = deltainit(1,1);
mem(1,2) = meminit(1,2);
co(1,2) = coinit(1,2);
delta(1,2) = deltainit(1,2);
mem(1,3) = meminit(1,3);
co(1,3) = coinit(1,3);
delta(1,3) = deltainit(1,3);
mem(1,4) = meminit(1,4);
co(1,4) = coinit(1,4);
delta(1,4) = deltainit(1,4);
co(2,0) = 0;
delta(2,0) = -1;
mem(2,1) = meminit(2,1);
co(2,1) = coinit(2,1);
delta(2,1) = deltainit(2,1);
mem(2,2) = meminit(2,2);
co(2,2) = coinit(2,2);
delta(2,2) = deltainit(2,2);
mem(2,3) = meminit(2,3);
co(2,3) = coinit(2,3);
delta(2,3) = deltainit(2,3);
mem(2,4) = meminit(2,4);
co(2,4) = coinit(2,4);
delta(2,4) = deltainit(2,4);
co(3,0) = 0;
delta(3,0) = -1;
mem(3,1) = meminit(3,1);
co(3,1) = coinit(3,1);
delta(3,1) = deltainit(3,1);
mem(3,2) = meminit(3,2);
co(3,2) = coinit(3,2);
delta(3,2) = deltainit(3,2);
mem(3,3) = meminit(3,3);
co(3,3) = coinit(3,3);
delta(3,3) = deltainit(3,3);
mem(3,4) = meminit(3,4);
co(3,4) = coinit(3,4);
delta(3,4) = deltainit(3,4);
co(4,0) = 0;
delta(4,0) = -1;
mem(4,1) = meminit(4,1);
co(4,1) = coinit(4,1);
delta(4,1) = deltainit(4,1);
mem(4,2) = meminit(4,2);
co(4,2) = coinit(4,2);
delta(4,2) = deltainit(4,2);
mem(4,3) = meminit(4,3);
co(4,3) = coinit(4,3);
delta(4,3) = deltainit(4,3);
mem(4,4) = meminit(4,4);
co(4,4) = coinit(4,4);
delta(4,4) = deltainit(4,4);
// Dumping thread 1
int ret_thread_1 = 0;
cdy[1] = get_rng(0,NCONTEXT-1);
ASSUME(cdy[1] >= cstart[1]);
T1BLOCK0:
// call void @llvm.dbg.value(metadata i8* %arg, metadata !36, metadata !DIExpression()), !dbg !45
// br label %label_1, !dbg !46
goto T1BLOCK1;
T1BLOCK1:
// call void @llvm.dbg.label(metadata !44), !dbg !47
// call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 0), metadata !37, metadata !DIExpression()), !dbg !48
// call void @llvm.dbg.value(metadata i64 2, metadata !40, metadata !DIExpression()), !dbg !48
// store atomic i64 2, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 0) monotonic, align 8, !dbg !49
// ST: Guess
iw(1,0) = get_rng(0,NCONTEXT-1);// 1 ASSIGN STIW _l20_c3
old_cw = cw(1,0);
cw(1,0) = get_rng(0,NCONTEXT-1);// 1 ASSIGN STCOM _l20_c3
// Check
ASSUME(active[iw(1,0)] == 1);
ASSUME(active[cw(1,0)] == 1);
ASSUME(sforbid(0,cw(1,0))== 0);
ASSUME(iw(1,0) >= 0);
ASSUME(iw(1,0) >= 0);
ASSUME(cw(1,0) >= iw(1,0));
ASSUME(cw(1,0) >= old_cw);
ASSUME(cw(1,0) >= cr(1,0));
ASSUME(cw(1,0) >= cl[1]);
ASSUME(cw(1,0) >= cisb[1]);
ASSUME(cw(1,0) >= cdy[1]);
ASSUME(cw(1,0) >= cdl[1]);
ASSUME(cw(1,0) >= cds[1]);
ASSUME(cw(1,0) >= cctrl[1]);
ASSUME(cw(1,0) >= caddr[1]);
// Update
caddr[1] = max(caddr[1],0);
buff(1,0) = 2;
mem(0,cw(1,0)) = 2;
co(0,cw(1,0))+=1;
delta(0,cw(1,0)) = -1;
ASSUME(creturn[1] >= cw(1,0));
// call void (...) @dmbst(), !dbg !50
// dumbst: Guess
cds[1] = get_rng(0,NCONTEXT-1);
// Check
ASSUME(cds[1] >= cdy[1]);
ASSUME(cds[1] >= cw(1,0+0));
ASSUME(cds[1] >= cw(1,0+1));
ASSUME(cds[1] >= cw(1,0+2));
ASSUME(cds[1] >= cw(1,3+0));
ASSUME(cds[1] >= cw(1,4+0));
ASSUME(creturn[1] >= cds[1]);
// call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 1), metadata !41, metadata !DIExpression()), !dbg !51
// call void @llvm.dbg.value(metadata i64 1, metadata !43, metadata !DIExpression()), !dbg !51
// store atomic i64 1, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 1) monotonic, align 8, !dbg !52
// ST: Guess
iw(1,0+1*1) = get_rng(0,NCONTEXT-1);// 1 ASSIGN STIW _l22_c3
old_cw = cw(1,0+1*1);
cw(1,0+1*1) = get_rng(0,NCONTEXT-1);// 1 ASSIGN STCOM _l22_c3
// Check
ASSUME(active[iw(1,0+1*1)] == 1);
ASSUME(active[cw(1,0+1*1)] == 1);
ASSUME(sforbid(0+1*1,cw(1,0+1*1))== 0);
ASSUME(iw(1,0+1*1) >= 0);
ASSUME(iw(1,0+1*1) >= 0);
ASSUME(cw(1,0+1*1) >= iw(1,0+1*1));
ASSUME(cw(1,0+1*1) >= old_cw);
ASSUME(cw(1,0+1*1) >= cr(1,0+1*1));
ASSUME(cw(1,0+1*1) >= cl[1]);
ASSUME(cw(1,0+1*1) >= cisb[1]);
ASSUME(cw(1,0+1*1) >= cdy[1]);
ASSUME(cw(1,0+1*1) >= cdl[1]);
ASSUME(cw(1,0+1*1) >= cds[1]);
ASSUME(cw(1,0+1*1) >= cctrl[1]);
ASSUME(cw(1,0+1*1) >= caddr[1]);
// Update
caddr[1] = max(caddr[1],0);
buff(1,0+1*1) = 1;
mem(0+1*1,cw(1,0+1*1)) = 1;
co(0+1*1,cw(1,0+1*1))+=1;
delta(0+1*1,cw(1,0+1*1)) = -1;
ASSUME(creturn[1] >= cw(1,0+1*1));
// ret i8* null, !dbg !53
ret_thread_1 = (- 1);
goto T1BLOCK_END;
T1BLOCK_END:
// Dumping thread 2
int ret_thread_2 = 0;
cdy[2] = get_rng(0,NCONTEXT-1);
ASSUME(cdy[2] >= cstart[2]);
T2BLOCK0:
// call void @llvm.dbg.value(metadata i8* %arg, metadata !56, metadata !DIExpression()), !dbg !66
// br label %label_2, !dbg !48
goto T2BLOCK1;
T2BLOCK1:
// call void @llvm.dbg.label(metadata !65), !dbg !68
// call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 1), metadata !58, metadata !DIExpression()), !dbg !69
// %0 = load atomic i64, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 1) monotonic, align 8, !dbg !51
// LD: Guess
old_cr = cr(2,0+1*1);
cr(2,0+1*1) = get_rng(0,NCONTEXT-1);// 2 ASSIGN LDCOM _l28_c15
// Check
ASSUME(active[cr(2,0+1*1)] == 2);
ASSUME(cr(2,0+1*1) >= iw(2,0+1*1));
ASSUME(cr(2,0+1*1) >= 0);
ASSUME(cr(2,0+1*1) >= cdy[2]);
ASSUME(cr(2,0+1*1) >= cisb[2]);
ASSUME(cr(2,0+1*1) >= cdl[2]);
ASSUME(cr(2,0+1*1) >= cl[2]);
// Update
creg_r0 = cr(2,0+1*1);
crmax(2,0+1*1) = max(crmax(2,0+1*1),cr(2,0+1*1));
caddr[2] = max(caddr[2],0);
if(cr(2,0+1*1) < cw(2,0+1*1)) {
r0 = buff(2,0+1*1);
ASSUME((!(( (cw(2,0+1*1) < 1) && (1 < crmax(2,0+1*1)) )))||(sforbid(0+1*1,1)> 0));
ASSUME((!(( (cw(2,0+1*1) < 2) && (2 < crmax(2,0+1*1)) )))||(sforbid(0+1*1,2)> 0));
ASSUME((!(( (cw(2,0+1*1) < 3) && (3 < crmax(2,0+1*1)) )))||(sforbid(0+1*1,3)> 0));
ASSUME((!(( (cw(2,0+1*1) < 4) && (4 < crmax(2,0+1*1)) )))||(sforbid(0+1*1,4)> 0));
} else {
if(pw(2,0+1*1) != co(0+1*1,cr(2,0+1*1))) {
ASSUME(cr(2,0+1*1) >= old_cr);
}
pw(2,0+1*1) = co(0+1*1,cr(2,0+1*1));
r0 = mem(0+1*1,cr(2,0+1*1));
}
ASSUME(creturn[2] >= cr(2,0+1*1));
// call void @llvm.dbg.value(metadata i64 %0, metadata !60, metadata !DIExpression()), !dbg !69
// %conv = trunc i64 %0 to i32, !dbg !52
// call void @llvm.dbg.value(metadata i32 %conv, metadata !57, metadata !DIExpression()), !dbg !66
// call void (...) @dmbst(), !dbg !53
// dumbst: Guess
cds[2] = get_rng(0,NCONTEXT-1);
// Check
ASSUME(cds[2] >= cdy[2]);
ASSUME(cds[2] >= cw(2,0+0));
ASSUME(cds[2] >= cw(2,0+1));
ASSUME(cds[2] >= cw(2,0+2));
ASSUME(cds[2] >= cw(2,3+0));
ASSUME(cds[2] >= cw(2,4+0));
ASSUME(creturn[2] >= cds[2]);
// call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 2), metadata !61, metadata !DIExpression()), !dbg !73
// call void @llvm.dbg.value(metadata i64 1, metadata !63, metadata !DIExpression()), !dbg !73
// store atomic i64 1, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 2) monotonic, align 8, !dbg !55
// ST: Guess
iw(2,0+2*1) = get_rng(0,NCONTEXT-1);// 2 ASSIGN STIW _l30_c3
old_cw = cw(2,0+2*1);
cw(2,0+2*1) = get_rng(0,NCONTEXT-1);// 2 ASSIGN STCOM _l30_c3
// Check
ASSUME(active[iw(2,0+2*1)] == 2);
ASSUME(active[cw(2,0+2*1)] == 2);
ASSUME(sforbid(0+2*1,cw(2,0+2*1))== 0);
ASSUME(iw(2,0+2*1) >= 0);
ASSUME(iw(2,0+2*1) >= 0);
ASSUME(cw(2,0+2*1) >= iw(2,0+2*1));
ASSUME(cw(2,0+2*1) >= old_cw);
ASSUME(cw(2,0+2*1) >= cr(2,0+2*1));
ASSUME(cw(2,0+2*1) >= cl[2]);
ASSUME(cw(2,0+2*1) >= cisb[2]);
ASSUME(cw(2,0+2*1) >= cdy[2]);
ASSUME(cw(2,0+2*1) >= cdl[2]);
ASSUME(cw(2,0+2*1) >= cds[2]);
ASSUME(cw(2,0+2*1) >= cctrl[2]);
ASSUME(cw(2,0+2*1) >= caddr[2]);
// Update
caddr[2] = max(caddr[2],0);
buff(2,0+2*1) = 1;
mem(0+2*1,cw(2,0+2*1)) = 1;
co(0+2*1,cw(2,0+2*1))+=1;
delta(0+2*1,cw(2,0+2*1)) = -1;
ASSUME(creturn[2] >= cw(2,0+2*1));
// %cmp = icmp eq i32 %conv, 1, !dbg !56
creg__r0__1_ = max(0,creg_r0);
// %conv1 = zext i1 %cmp to i32, !dbg !56
// call void @llvm.dbg.value(metadata i32 %conv1, metadata !64, metadata !DIExpression()), !dbg !66
// store i32 %conv1, i32* @atom_1_X0_1, align 4, !dbg !57, !tbaa !58
// ST: Guess
iw(2,3) = get_rng(0,NCONTEXT-1);// 2 ASSIGN STIW _l32_c15
old_cw = cw(2,3);
cw(2,3) = get_rng(0,NCONTEXT-1);// 2 ASSIGN STCOM _l32_c15
// Check
ASSUME(active[iw(2,3)] == 2);
ASSUME(active[cw(2,3)] == 2);
ASSUME(sforbid(3,cw(2,3))== 0);
ASSUME(iw(2,3) >= creg__r0__1_);
ASSUME(iw(2,3) >= 0);
ASSUME(cw(2,3) >= iw(2,3));
ASSUME(cw(2,3) >= old_cw);
ASSUME(cw(2,3) >= cr(2,3));
ASSUME(cw(2,3) >= cl[2]);
ASSUME(cw(2,3) >= cisb[2]);
ASSUME(cw(2,3) >= cdy[2]);
ASSUME(cw(2,3) >= cdl[2]);
ASSUME(cw(2,3) >= cds[2]);
ASSUME(cw(2,3) >= cctrl[2]);
ASSUME(cw(2,3) >= caddr[2]);
// Update
caddr[2] = max(caddr[2],0);
buff(2,3) = (r0==1);
mem(3,cw(2,3)) = (r0==1);
co(3,cw(2,3))+=1;
delta(3,cw(2,3)) = -1;
ASSUME(creturn[2] >= cw(2,3));
// ret i8* null, !dbg !62
ret_thread_2 = (- 1);
goto T2BLOCK_END;
T2BLOCK_END:
// Dumping thread 3
int ret_thread_3 = 0;
cdy[3] = get_rng(0,NCONTEXT-1);
ASSUME(cdy[3] >= cstart[3]);
T3BLOCK0:
// call void @llvm.dbg.value(metadata i8* %arg, metadata !84, metadata !DIExpression()), !dbg !95
// br label %label_3, !dbg !49
goto T3BLOCK1;
T3BLOCK1:
// call void @llvm.dbg.label(metadata !94), !dbg !97
// call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 2), metadata !86, metadata !DIExpression()), !dbg !98
// %0 = load atomic i64, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 2) monotonic, align 8, !dbg !52
// LD: Guess
old_cr = cr(3,0+2*1);
cr(3,0+2*1) = get_rng(0,NCONTEXT-1);// 3 ASSIGN LDCOM _l38_c15
// Check
ASSUME(active[cr(3,0+2*1)] == 3);
ASSUME(cr(3,0+2*1) >= iw(3,0+2*1));
ASSUME(cr(3,0+2*1) >= 0);
ASSUME(cr(3,0+2*1) >= cdy[3]);
ASSUME(cr(3,0+2*1) >= cisb[3]);
ASSUME(cr(3,0+2*1) >= cdl[3]);
ASSUME(cr(3,0+2*1) >= cl[3]);
// Update
creg_r1 = cr(3,0+2*1);
crmax(3,0+2*1) = max(crmax(3,0+2*1),cr(3,0+2*1));
caddr[3] = max(caddr[3],0);
if(cr(3,0+2*1) < cw(3,0+2*1)) {
r1 = buff(3,0+2*1);
ASSUME((!(( (cw(3,0+2*1) < 1) && (1 < crmax(3,0+2*1)) )))||(sforbid(0+2*1,1)> 0));
ASSUME((!(( (cw(3,0+2*1) < 2) && (2 < crmax(3,0+2*1)) )))||(sforbid(0+2*1,2)> 0));
ASSUME((!(( (cw(3,0+2*1) < 3) && (3 < crmax(3,0+2*1)) )))||(sforbid(0+2*1,3)> 0));
ASSUME((!(( (cw(3,0+2*1) < 4) && (4 < crmax(3,0+2*1)) )))||(sforbid(0+2*1,4)> 0));
} else {
if(pw(3,0+2*1) != co(0+2*1,cr(3,0+2*1))) {
ASSUME(cr(3,0+2*1) >= old_cr);
}
pw(3,0+2*1) = co(0+2*1,cr(3,0+2*1));
r1 = mem(0+2*1,cr(3,0+2*1));
}
ASSUME(creturn[3] >= cr(3,0+2*1));
// call void @llvm.dbg.value(metadata i64 %0, metadata !88, metadata !DIExpression()), !dbg !98
// %conv = trunc i64 %0 to i32, !dbg !53
// call void @llvm.dbg.value(metadata i32 %conv, metadata !85, metadata !DIExpression()), !dbg !95
// %xor = xor i32 %conv, %conv, !dbg !54
creg_r2 = creg_r1;
r2 = r1 ^ r1;
// call void @llvm.dbg.value(metadata i32 %xor, metadata !89, metadata !DIExpression()), !dbg !95
// %add = add nsw i32 0, %xor, !dbg !55
creg_r3 = max(0,creg_r2);
r3 = 0 + r2;
// %idxprom = sext i32 %add to i64, !dbg !55
// %arrayidx = getelementptr inbounds [3 x i64], [3 x i64]* @vars, i64 0, i64 %idxprom, !dbg !55
r4 = 0+r3*1;
creg_r4 = creg_r3;
// call void @llvm.dbg.value(metadata i64* %arrayidx, metadata !90, metadata !DIExpression()), !dbg !103
// call void @llvm.dbg.value(metadata i64 1, metadata !92, metadata !DIExpression()), !dbg !103
// store atomic i64 1, i64* %arrayidx monotonic, align 8, !dbg !55
// ST: Guess
iw(3,r4) = get_rng(0,NCONTEXT-1);// 3 ASSIGN STIW _l40_c3
old_cw = cw(3,r4);
cw(3,r4) = get_rng(0,NCONTEXT-1);// 3 ASSIGN STCOM _l40_c3
// Check
ASSUME(active[iw(3,r4)] == 3);
ASSUME(active[cw(3,r4)] == 3);
ASSUME(sforbid(r4,cw(3,r4))== 0);
ASSUME(iw(3,r4) >= 0);
ASSUME(iw(3,r4) >= creg_r4);
ASSUME(cw(3,r4) >= iw(3,r4));
ASSUME(cw(3,r4) >= old_cw);
ASSUME(cw(3,r4) >= cr(3,r4));
ASSUME(cw(3,r4) >= cl[3]);
ASSUME(cw(3,r4) >= cisb[3]);
ASSUME(cw(3,r4) >= cdy[3]);
ASSUME(cw(3,r4) >= cdl[3]);
ASSUME(cw(3,r4) >= cds[3]);
ASSUME(cw(3,r4) >= cctrl[3]);
ASSUME(cw(3,r4) >= caddr[3]);
// Update
caddr[3] = max(caddr[3],creg_r4);
buff(3,r4) = 1;
mem(r4,cw(3,r4)) = 1;
co(r4,cw(3,r4))+=1;
delta(r4,cw(3,r4)) = -1;
ASSUME(creturn[3] >= cw(3,r4));
// %cmp = icmp eq i32 %conv, 1, !dbg !57
creg__r1__1_ = max(0,creg_r1);
// %conv1 = zext i1 %cmp to i32, !dbg !57
// call void @llvm.dbg.value(metadata i32 %conv1, metadata !93, metadata !DIExpression()), !dbg !95
// store i32 %conv1, i32* @atom_2_X0_1, align 4, !dbg !58, !tbaa !59
// ST: Guess
iw(3,4) = get_rng(0,NCONTEXT-1);// 3 ASSIGN STIW _l42_c15
old_cw = cw(3,4);
cw(3,4) = get_rng(0,NCONTEXT-1);// 3 ASSIGN STCOM _l42_c15
// Check
ASSUME(active[iw(3,4)] == 3);
ASSUME(active[cw(3,4)] == 3);
ASSUME(sforbid(4,cw(3,4))== 0);
ASSUME(iw(3,4) >= creg__r1__1_);
ASSUME(iw(3,4) >= 0);
ASSUME(cw(3,4) >= iw(3,4));
ASSUME(cw(3,4) >= old_cw);
ASSUME(cw(3,4) >= cr(3,4));
ASSUME(cw(3,4) >= cl[3]);
ASSUME(cw(3,4) >= cisb[3]);
ASSUME(cw(3,4) >= cdy[3]);
ASSUME(cw(3,4) >= cdl[3]);
ASSUME(cw(3,4) >= cds[3]);
ASSUME(cw(3,4) >= cctrl[3]);
ASSUME(cw(3,4) >= caddr[3]);
// Update
caddr[3] = max(caddr[3],0);
buff(3,4) = (r1==1);
mem(4,cw(3,4)) = (r1==1);
co(4,cw(3,4))+=1;
delta(4,cw(3,4)) = -1;
ASSUME(creturn[3] >= cw(3,4));
// ret i8* null, !dbg !63
ret_thread_3 = (- 1);
goto T3BLOCK_END;
T3BLOCK_END:
// Dumping thread 0
int ret_thread_0 = 0;
cdy[0] = get_rng(0,NCONTEXT-1);
ASSUME(cdy[0] >= cstart[0]);
T0BLOCK0:
// %thr0 = alloca i64, align 8
// %thr1 = alloca i64, align 8
// %thr2 = alloca i64, align 8
// call void @llvm.dbg.value(metadata i32 %argc, metadata !114, metadata !DIExpression()), !dbg !140
// call void @llvm.dbg.value(metadata i8** %argv, metadata !115, metadata !DIExpression()), !dbg !140
// %0 = bitcast i64* %thr0 to i8*, !dbg !67
// call void @llvm.lifetime.start.p0i8(i64 8, i8* %0) #7, !dbg !67
// call void @llvm.dbg.declare(metadata i64* %thr0, metadata !116, metadata !DIExpression()), !dbg !142
// %1 = bitcast i64* %thr1 to i8*, !dbg !69
// call void @llvm.lifetime.start.p0i8(i64 8, i8* %1) #7, !dbg !69
// call void @llvm.dbg.declare(metadata i64* %thr1, metadata !120, metadata !DIExpression()), !dbg !144
// %2 = bitcast i64* %thr2 to i8*, !dbg !71
// call void @llvm.lifetime.start.p0i8(i64 8, i8* %2) #7, !dbg !71
// call void @llvm.dbg.declare(metadata i64* %thr2, metadata !121, metadata !DIExpression()), !dbg !146
// call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 2), metadata !122, metadata !DIExpression()), !dbg !147
// call void @llvm.dbg.value(metadata i64 0, metadata !124, metadata !DIExpression()), !dbg !147
// store atomic i64 0, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 2) monotonic, align 8, !dbg !74
// ST: Guess
iw(0,0+2*1) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STIW _l51_c3
old_cw = cw(0,0+2*1);
cw(0,0+2*1) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STCOM _l51_c3
// Check
ASSUME(active[iw(0,0+2*1)] == 0);
ASSUME(active[cw(0,0+2*1)] == 0);
ASSUME(sforbid(0+2*1,cw(0,0+2*1))== 0);
ASSUME(iw(0,0+2*1) >= 0);
ASSUME(iw(0,0+2*1) >= 0);
ASSUME(cw(0,0+2*1) >= iw(0,0+2*1));
ASSUME(cw(0,0+2*1) >= old_cw);
ASSUME(cw(0,0+2*1) >= cr(0,0+2*1));
ASSUME(cw(0,0+2*1) >= cl[0]);
ASSUME(cw(0,0+2*1) >= cisb[0]);
ASSUME(cw(0,0+2*1) >= cdy[0]);
ASSUME(cw(0,0+2*1) >= cdl[0]);
ASSUME(cw(0,0+2*1) >= cds[0]);
ASSUME(cw(0,0+2*1) >= cctrl[0]);
ASSUME(cw(0,0+2*1) >= caddr[0]);
// Update
caddr[0] = max(caddr[0],0);
buff(0,0+2*1) = 0;
mem(0+2*1,cw(0,0+2*1)) = 0;
co(0+2*1,cw(0,0+2*1))+=1;
delta(0+2*1,cw(0,0+2*1)) = -1;
ASSUME(creturn[0] >= cw(0,0+2*1));
// call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 1), metadata !125, metadata !DIExpression()), !dbg !149
// call void @llvm.dbg.value(metadata i64 0, metadata !127, metadata !DIExpression()), !dbg !149
// store atomic i64 0, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 1) monotonic, align 8, !dbg !76
// ST: Guess
iw(0,0+1*1) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STIW _l52_c3
old_cw = cw(0,0+1*1);
cw(0,0+1*1) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STCOM _l52_c3
// Check
ASSUME(active[iw(0,0+1*1)] == 0);
ASSUME(active[cw(0,0+1*1)] == 0);
ASSUME(sforbid(0+1*1,cw(0,0+1*1))== 0);
ASSUME(iw(0,0+1*1) >= 0);
ASSUME(iw(0,0+1*1) >= 0);
ASSUME(cw(0,0+1*1) >= iw(0,0+1*1));
ASSUME(cw(0,0+1*1) >= old_cw);
ASSUME(cw(0,0+1*1) >= cr(0,0+1*1));
ASSUME(cw(0,0+1*1) >= cl[0]);
ASSUME(cw(0,0+1*1) >= cisb[0]);
ASSUME(cw(0,0+1*1) >= cdy[0]);
ASSUME(cw(0,0+1*1) >= cdl[0]);
ASSUME(cw(0,0+1*1) >= cds[0]);
ASSUME(cw(0,0+1*1) >= cctrl[0]);
ASSUME(cw(0,0+1*1) >= caddr[0]);
// Update
caddr[0] = max(caddr[0],0);
buff(0,0+1*1) = 0;
mem(0+1*1,cw(0,0+1*1)) = 0;
co(0+1*1,cw(0,0+1*1))+=1;
delta(0+1*1,cw(0,0+1*1)) = -1;
ASSUME(creturn[0] >= cw(0,0+1*1));
// call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 0), metadata !128, metadata !DIExpression()), !dbg !151
// call void @llvm.dbg.value(metadata i64 0, metadata !130, metadata !DIExpression()), !dbg !151
// store atomic i64 0, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 0) monotonic, align 8, !dbg !78
// ST: Guess
iw(0,0) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STIW _l53_c3
old_cw = cw(0,0);
cw(0,0) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STCOM _l53_c3
// Check
ASSUME(active[iw(0,0)] == 0);
ASSUME(active[cw(0,0)] == 0);
ASSUME(sforbid(0,cw(0,0))== 0);
ASSUME(iw(0,0) >= 0);
ASSUME(iw(0,0) >= 0);
ASSUME(cw(0,0) >= iw(0,0));
ASSUME(cw(0,0) >= old_cw);
ASSUME(cw(0,0) >= cr(0,0));
ASSUME(cw(0,0) >= cl[0]);
ASSUME(cw(0,0) >= cisb[0]);
ASSUME(cw(0,0) >= cdy[0]);
ASSUME(cw(0,0) >= cdl[0]);
ASSUME(cw(0,0) >= cds[0]);
ASSUME(cw(0,0) >= cctrl[0]);
ASSUME(cw(0,0) >= caddr[0]);
// Update
caddr[0] = max(caddr[0],0);
buff(0,0) = 0;
mem(0,cw(0,0)) = 0;
co(0,cw(0,0))+=1;
delta(0,cw(0,0)) = -1;
ASSUME(creturn[0] >= cw(0,0));
// store i32 0, i32* @atom_1_X0_1, align 4, !dbg !79, !tbaa !80
// ST: Guess
iw(0,3) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STIW _l54_c15
old_cw = cw(0,3);
cw(0,3) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STCOM _l54_c15
// Check
ASSUME(active[iw(0,3)] == 0);
ASSUME(active[cw(0,3)] == 0);
ASSUME(sforbid(3,cw(0,3))== 0);
ASSUME(iw(0,3) >= 0);
ASSUME(iw(0,3) >= 0);
ASSUME(cw(0,3) >= iw(0,3));
ASSUME(cw(0,3) >= old_cw);
ASSUME(cw(0,3) >= cr(0,3));
ASSUME(cw(0,3) >= cl[0]);
ASSUME(cw(0,3) >= cisb[0]);
ASSUME(cw(0,3) >= cdy[0]);
ASSUME(cw(0,3) >= cdl[0]);
ASSUME(cw(0,3) >= cds[0]);
ASSUME(cw(0,3) >= cctrl[0]);
ASSUME(cw(0,3) >= caddr[0]);
// Update
caddr[0] = max(caddr[0],0);
buff(0,3) = 0;
mem(3,cw(0,3)) = 0;
co(3,cw(0,3))+=1;
delta(3,cw(0,3)) = -1;
ASSUME(creturn[0] >= cw(0,3));
// store i32 0, i32* @atom_2_X0_1, align 4, !dbg !84, !tbaa !80
// ST: Guess
iw(0,4) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STIW _l55_c15
old_cw = cw(0,4);
cw(0,4) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STCOM _l55_c15
// Check
ASSUME(active[iw(0,4)] == 0);
ASSUME(active[cw(0,4)] == 0);
ASSUME(sforbid(4,cw(0,4))== 0);
ASSUME(iw(0,4) >= 0);
ASSUME(iw(0,4) >= 0);
ASSUME(cw(0,4) >= iw(0,4));
ASSUME(cw(0,4) >= old_cw);
ASSUME(cw(0,4) >= cr(0,4));
ASSUME(cw(0,4) >= cl[0]);
ASSUME(cw(0,4) >= cisb[0]);
ASSUME(cw(0,4) >= cdy[0]);
ASSUME(cw(0,4) >= cdl[0]);
ASSUME(cw(0,4) >= cds[0]);
ASSUME(cw(0,4) >= cctrl[0]);
ASSUME(cw(0,4) >= caddr[0]);
// Update
caddr[0] = max(caddr[0],0);
buff(0,4) = 0;
mem(4,cw(0,4)) = 0;
co(4,cw(0,4))+=1;
delta(4,cw(0,4)) = -1;
ASSUME(creturn[0] >= cw(0,4));
// %call = call i32 @pthread_create(i64* noundef %thr0, %union.pthread_attr_t* noundef null, i8* (i8*)* noundef @t0, i8* noundef null) #7, !dbg !85
// dumbsy: Guess
old_cdy = cdy[0];
cdy[0] = get_rng(0,NCONTEXT-1);
// Check
ASSUME(cdy[0] >= old_cdy);
ASSUME(cdy[0] >= cisb[0]);
ASSUME(cdy[0] >= cdl[0]);
ASSUME(cdy[0] >= cds[0]);
ASSUME(cdy[0] >= cctrl[0]);
ASSUME(cdy[0] >= cw(0,0+0));
ASSUME(cdy[0] >= cw(0,0+1));
ASSUME(cdy[0] >= cw(0,0+2));
ASSUME(cdy[0] >= cw(0,3+0));
ASSUME(cdy[0] >= cw(0,4+0));
ASSUME(cdy[0] >= cr(0,0+0));
ASSUME(cdy[0] >= cr(0,0+1));
ASSUME(cdy[0] >= cr(0,0+2));
ASSUME(cdy[0] >= cr(0,3+0));
ASSUME(cdy[0] >= cr(0,4+0));
ASSUME(creturn[0] >= cdy[0]);
ASSUME(cstart[1] >= cdy[0]);
// %call5 = call i32 @pthread_create(i64* noundef %thr1, %union.pthread_attr_t* noundef null, i8* (i8*)* noundef @t1, i8* noundef null) #7, !dbg !86
// dumbsy: Guess
old_cdy = cdy[0];
cdy[0] = get_rng(0,NCONTEXT-1);
// Check
ASSUME(cdy[0] >= old_cdy);
ASSUME(cdy[0] >= cisb[0]);
ASSUME(cdy[0] >= cdl[0]);
ASSUME(cdy[0] >= cds[0]);
ASSUME(cdy[0] >= cctrl[0]);
ASSUME(cdy[0] >= cw(0,0+0));
ASSUME(cdy[0] >= cw(0,0+1));
ASSUME(cdy[0] >= cw(0,0+2));
ASSUME(cdy[0] >= cw(0,3+0));
ASSUME(cdy[0] >= cw(0,4+0));
ASSUME(cdy[0] >= cr(0,0+0));
ASSUME(cdy[0] >= cr(0,0+1));
ASSUME(cdy[0] >= cr(0,0+2));
ASSUME(cdy[0] >= cr(0,3+0));
ASSUME(cdy[0] >= cr(0,4+0));
ASSUME(creturn[0] >= cdy[0]);
ASSUME(cstart[2] >= cdy[0]);
// %call6 = call i32 @pthread_create(i64* noundef %thr2, %union.pthread_attr_t* noundef null, i8* (i8*)* noundef @t2, i8* noundef null) #7, !dbg !87
// dumbsy: Guess
old_cdy = cdy[0];
cdy[0] = get_rng(0,NCONTEXT-1);
// Check
ASSUME(cdy[0] >= old_cdy);
ASSUME(cdy[0] >= cisb[0]);
ASSUME(cdy[0] >= cdl[0]);
ASSUME(cdy[0] >= cds[0]);
ASSUME(cdy[0] >= cctrl[0]);
ASSUME(cdy[0] >= cw(0,0+0));
ASSUME(cdy[0] >= cw(0,0+1));
ASSUME(cdy[0] >= cw(0,0+2));
ASSUME(cdy[0] >= cw(0,3+0));
ASSUME(cdy[0] >= cw(0,4+0));
ASSUME(cdy[0] >= cr(0,0+0));
ASSUME(cdy[0] >= cr(0,0+1));
ASSUME(cdy[0] >= cr(0,0+2));
ASSUME(cdy[0] >= cr(0,3+0));
ASSUME(cdy[0] >= cr(0,4+0));
ASSUME(creturn[0] >= cdy[0]);
ASSUME(cstart[3] >= cdy[0]);
// %3 = load i64, i64* %thr0, align 8, !dbg !88, !tbaa !89
r6 = local_mem[0];
// %call7 = call i32 @pthread_join(i64 noundef %3, i8** noundef null), !dbg !91
// dumbsy: Guess
old_cdy = cdy[0];
cdy[0] = get_rng(0,NCONTEXT-1);
// Check
ASSUME(cdy[0] >= old_cdy);
ASSUME(cdy[0] >= cisb[0]);
ASSUME(cdy[0] >= cdl[0]);
ASSUME(cdy[0] >= cds[0]);
ASSUME(cdy[0] >= cctrl[0]);
ASSUME(cdy[0] >= cw(0,0+0));
ASSUME(cdy[0] >= cw(0,0+1));
ASSUME(cdy[0] >= cw(0,0+2));
ASSUME(cdy[0] >= cw(0,3+0));
ASSUME(cdy[0] >= cw(0,4+0));
ASSUME(cdy[0] >= cr(0,0+0));
ASSUME(cdy[0] >= cr(0,0+1));
ASSUME(cdy[0] >= cr(0,0+2));
ASSUME(cdy[0] >= cr(0,3+0));
ASSUME(cdy[0] >= cr(0,4+0));
ASSUME(creturn[0] >= cdy[0]);
ASSUME(cdy[0] >= creturn[1]);
// %4 = load i64, i64* %thr1, align 8, !dbg !92, !tbaa !89
r7 = local_mem[1];
// %call8 = call i32 @pthread_join(i64 noundef %4, i8** noundef null), !dbg !93
// dumbsy: Guess
old_cdy = cdy[0];
cdy[0] = get_rng(0,NCONTEXT-1);
// Check
ASSUME(cdy[0] >= old_cdy);
ASSUME(cdy[0] >= cisb[0]);
ASSUME(cdy[0] >= cdl[0]);
ASSUME(cdy[0] >= cds[0]);
ASSUME(cdy[0] >= cctrl[0]);
ASSUME(cdy[0] >= cw(0,0+0));
ASSUME(cdy[0] >= cw(0,0+1));
ASSUME(cdy[0] >= cw(0,0+2));
ASSUME(cdy[0] >= cw(0,3+0));
ASSUME(cdy[0] >= cw(0,4+0));
ASSUME(cdy[0] >= cr(0,0+0));
ASSUME(cdy[0] >= cr(0,0+1));
ASSUME(cdy[0] >= cr(0,0+2));
ASSUME(cdy[0] >= cr(0,3+0));
ASSUME(cdy[0] >= cr(0,4+0));
ASSUME(creturn[0] >= cdy[0]);
ASSUME(cdy[0] >= creturn[2]);
// %5 = load i64, i64* %thr2, align 8, !dbg !94, !tbaa !89
r8 = local_mem[2];
// %call9 = call i32 @pthread_join(i64 noundef %5, i8** noundef null), !dbg !95
// dumbsy: Guess
old_cdy = cdy[0];
cdy[0] = get_rng(0,NCONTEXT-1);
// Check
ASSUME(cdy[0] >= old_cdy);
ASSUME(cdy[0] >= cisb[0]);
ASSUME(cdy[0] >= cdl[0]);
ASSUME(cdy[0] >= cds[0]);
ASSUME(cdy[0] >= cctrl[0]);
ASSUME(cdy[0] >= cw(0,0+0));
ASSUME(cdy[0] >= cw(0,0+1));
ASSUME(cdy[0] >= cw(0,0+2));
ASSUME(cdy[0] >= cw(0,3+0));
ASSUME(cdy[0] >= cw(0,4+0));
ASSUME(cdy[0] >= cr(0,0+0));
ASSUME(cdy[0] >= cr(0,0+1));
ASSUME(cdy[0] >= cr(0,0+2));
ASSUME(cdy[0] >= cr(0,3+0));
ASSUME(cdy[0] >= cr(0,4+0));
ASSUME(creturn[0] >= cdy[0]);
ASSUME(cdy[0] >= creturn[3]);
// call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 0), metadata !132, metadata !DIExpression()), !dbg !166
// %6 = load atomic i64, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 0) monotonic, align 8, !dbg !97
// LD: Guess
old_cr = cr(0,0);
cr(0,0) = get_rng(0,NCONTEXT-1);// 0 ASSIGN LDCOM _l65_c12
// Check
ASSUME(active[cr(0,0)] == 0);
ASSUME(cr(0,0) >= iw(0,0));
ASSUME(cr(0,0) >= 0);
ASSUME(cr(0,0) >= cdy[0]);
ASSUME(cr(0,0) >= cisb[0]);
ASSUME(cr(0,0) >= cdl[0]);
ASSUME(cr(0,0) >= cl[0]);
// Update
creg_r9 = cr(0,0);
crmax(0,0) = max(crmax(0,0),cr(0,0));
caddr[0] = max(caddr[0],0);
if(cr(0,0) < cw(0,0)) {
r9 = buff(0,0);
ASSUME((!(( (cw(0,0) < 1) && (1 < crmax(0,0)) )))||(sforbid(0,1)> 0));
ASSUME((!(( (cw(0,0) < 2) && (2 < crmax(0,0)) )))||(sforbid(0,2)> 0));
ASSUME((!(( (cw(0,0) < 3) && (3 < crmax(0,0)) )))||(sforbid(0,3)> 0));
ASSUME((!(( (cw(0,0) < 4) && (4 < crmax(0,0)) )))||(sforbid(0,4)> 0));
} else {
if(pw(0,0) != co(0,cr(0,0))) {
ASSUME(cr(0,0) >= old_cr);
}
pw(0,0) = co(0,cr(0,0));
r9 = mem(0,cr(0,0));
}
ASSUME(creturn[0] >= cr(0,0));
// call void @llvm.dbg.value(metadata i64 %6, metadata !134, metadata !DIExpression()), !dbg !166
// %conv = trunc i64 %6 to i32, !dbg !98
// call void @llvm.dbg.value(metadata i32 %conv, metadata !131, metadata !DIExpression()), !dbg !140
// %cmp = icmp eq i32 %conv, 2, !dbg !99
creg__r9__2_ = max(0,creg_r9);
// %conv10 = zext i1 %cmp to i32, !dbg !99
// call void @llvm.dbg.value(metadata i32 %conv10, metadata !135, metadata !DIExpression()), !dbg !140
// %7 = load i32, i32* @atom_1_X0_1, align 4, !dbg !100, !tbaa !80
// LD: Guess
old_cr = cr(0,3);
cr(0,3) = get_rng(0,NCONTEXT-1);// 0 ASSIGN LDCOM _l67_c13
// Check
ASSUME(active[cr(0,3)] == 0);
ASSUME(cr(0,3) >= iw(0,3));
ASSUME(cr(0,3) >= 0);
ASSUME(cr(0,3) >= cdy[0]);
ASSUME(cr(0,3) >= cisb[0]);
ASSUME(cr(0,3) >= cdl[0]);
ASSUME(cr(0,3) >= cl[0]);
// Update
creg_r10 = cr(0,3);
crmax(0,3) = max(crmax(0,3),cr(0,3));
caddr[0] = max(caddr[0],0);
if(cr(0,3) < cw(0,3)) {
r10 = buff(0,3);
ASSUME((!(( (cw(0,3) < 1) && (1 < crmax(0,3)) )))||(sforbid(3,1)> 0));
ASSUME((!(( (cw(0,3) < 2) && (2 < crmax(0,3)) )))||(sforbid(3,2)> 0));
ASSUME((!(( (cw(0,3) < 3) && (3 < crmax(0,3)) )))||(sforbid(3,3)> 0));
ASSUME((!(( (cw(0,3) < 4) && (4 < crmax(0,3)) )))||(sforbid(3,4)> 0));
} else {
if(pw(0,3) != co(3,cr(0,3))) {
ASSUME(cr(0,3) >= old_cr);
}
pw(0,3) = co(3,cr(0,3));
r10 = mem(3,cr(0,3));
}
ASSUME(creturn[0] >= cr(0,3));
// call void @llvm.dbg.value(metadata i32 %7, metadata !136, metadata !DIExpression()), !dbg !140
// %8 = load i32, i32* @atom_2_X0_1, align 4, !dbg !101, !tbaa !80
// LD: Guess
old_cr = cr(0,4);
cr(0,4) = get_rng(0,NCONTEXT-1);// 0 ASSIGN LDCOM _l68_c13
// Check
ASSUME(active[cr(0,4)] == 0);
ASSUME(cr(0,4) >= iw(0,4));
ASSUME(cr(0,4) >= 0);
ASSUME(cr(0,4) >= cdy[0]);
ASSUME(cr(0,4) >= cisb[0]);
ASSUME(cr(0,4) >= cdl[0]);
ASSUME(cr(0,4) >= cl[0]);
// Update
creg_r11 = cr(0,4);
crmax(0,4) = max(crmax(0,4),cr(0,4));
caddr[0] = max(caddr[0],0);
if(cr(0,4) < cw(0,4)) {
r11 = buff(0,4);
ASSUME((!(( (cw(0,4) < 1) && (1 < crmax(0,4)) )))||(sforbid(4,1)> 0));
ASSUME((!(( (cw(0,4) < 2) && (2 < crmax(0,4)) )))||(sforbid(4,2)> 0));
ASSUME((!(( (cw(0,4) < 3) && (3 < crmax(0,4)) )))||(sforbid(4,3)> 0));
ASSUME((!(( (cw(0,4) < 4) && (4 < crmax(0,4)) )))||(sforbid(4,4)> 0));
} else {
if(pw(0,4) != co(4,cr(0,4))) {
ASSUME(cr(0,4) >= old_cr);
}
pw(0,4) = co(4,cr(0,4));
r11 = mem(4,cr(0,4));
}
ASSUME(creturn[0] >= cr(0,4));
// call void @llvm.dbg.value(metadata i32 %8, metadata !137, metadata !DIExpression()), !dbg !140
// %and = and i32 %7, %8, !dbg !102
creg_r12 = max(creg_r10,creg_r11);
r12 = r10 & r11;
// call void @llvm.dbg.value(metadata i32 %and, metadata !138, metadata !DIExpression()), !dbg !140
// %and11 = and i32 %conv10, %and, !dbg !103
creg_r13 = max(creg__r9__2_,creg_r12);
r13 = (r9==2) & r12;
// call void @llvm.dbg.value(metadata i32 %and11, metadata !139, metadata !DIExpression()), !dbg !140
// %cmp12 = icmp eq i32 %and11, 1, !dbg !104
creg__r13__1_ = max(0,creg_r13);
// br i1 %cmp12, label %if.then, label %if.end, !dbg !106
old_cctrl = cctrl[0];
cctrl[0] = get_rng(0,NCONTEXT-1);
ASSUME(cctrl[0] >= old_cctrl);
ASSUME(cctrl[0] >= creg__r13__1_);
if((r13==1)) {
goto T0BLOCK1;
} else {
goto T0BLOCK2;
}
T0BLOCK1:
// call void @__assert_fail(i8* noundef getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* noundef getelementptr inbounds ([108 x i8], [108 x i8]* @.str.1, i64 0, i64 0), i32 noundef 71, i8* noundef getelementptr inbounds ([23 x i8], [23 x i8]* @__PRETTY_FUNCTION__.main, i64 0, i64 0)) #8, !dbg !107
// unreachable, !dbg !107
r14 = 1;
goto T0BLOCK_END;
T0BLOCK2:
// %9 = bitcast i64* %thr2 to i8*, !dbg !110
// call void @llvm.lifetime.end.p0i8(i64 8, i8* %9) #7, !dbg !110
// %10 = bitcast i64* %thr1 to i8*, !dbg !110
// call void @llvm.lifetime.end.p0i8(i64 8, i8* %10) #7, !dbg !110
// %11 = bitcast i64* %thr0 to i8*, !dbg !110
// call void @llvm.lifetime.end.p0i8(i64 8, i8* %11) #7, !dbg !110
// ret i32 0, !dbg !111
ret_thread_0 = 0;
goto T0BLOCK_END;
T0BLOCK_END:
ASSUME(meminit(0,1) == mem(0,0));
ASSUME(coinit(0,1) == co(0,0));
ASSUME(deltainit(0,1) == delta(0,0));
ASSUME(meminit(0,2) == mem(0,1));
ASSUME(coinit(0,2) == co(0,1));
ASSUME(deltainit(0,2) == delta(0,1));
ASSUME(meminit(0,3) == mem(0,2));
ASSUME(coinit(0,3) == co(0,2));
ASSUME(deltainit(0,3) == delta(0,2));
ASSUME(meminit(0,4) == mem(0,3));
ASSUME(coinit(0,4) == co(0,3));
ASSUME(deltainit(0,4) == delta(0,3));
ASSUME(meminit(1,1) == mem(1,0));
ASSUME(coinit(1,1) == co(1,0));
ASSUME(deltainit(1,1) == delta(1,0));
ASSUME(meminit(1,2) == mem(1,1));
ASSUME(coinit(1,2) == co(1,1));
ASSUME(deltainit(1,2) == delta(1,1));
ASSUME(meminit(1,3) == mem(1,2));
ASSUME(coinit(1,3) == co(1,2));
ASSUME(deltainit(1,3) == delta(1,2));
ASSUME(meminit(1,4) == mem(1,3));
ASSUME(coinit(1,4) == co(1,3));
ASSUME(deltainit(1,4) == delta(1,3));
ASSUME(meminit(2,1) == mem(2,0));
ASSUME(coinit(2,1) == co(2,0));
ASSUME(deltainit(2,1) == delta(2,0));
ASSUME(meminit(2,2) == mem(2,1));
ASSUME(coinit(2,2) == co(2,1));
ASSUME(deltainit(2,2) == delta(2,1));
ASSUME(meminit(2,3) == mem(2,2));
ASSUME(coinit(2,3) == co(2,2));
ASSUME(deltainit(2,3) == delta(2,2));
ASSUME(meminit(2,4) == mem(2,3));
ASSUME(coinit(2,4) == co(2,3));
ASSUME(deltainit(2,4) == delta(2,3));
ASSUME(meminit(3,1) == mem(3,0));
ASSUME(coinit(3,1) == co(3,0));
ASSUME(deltainit(3,1) == delta(3,0));
ASSUME(meminit(3,2) == mem(3,1));
ASSUME(coinit(3,2) == co(3,1));
ASSUME(deltainit(3,2) == delta(3,1));
ASSUME(meminit(3,3) == mem(3,2));
ASSUME(coinit(3,3) == co(3,2));
ASSUME(deltainit(3,3) == delta(3,2));
ASSUME(meminit(3,4) == mem(3,3));
ASSUME(coinit(3,4) == co(3,3));
ASSUME(deltainit(3,4) == delta(3,3));
ASSUME(meminit(4,1) == mem(4,0));
ASSUME(coinit(4,1) == co(4,0));
ASSUME(deltainit(4,1) == delta(4,0));
ASSUME(meminit(4,2) == mem(4,1));
ASSUME(coinit(4,2) == co(4,1));
ASSUME(deltainit(4,2) == delta(4,1));
ASSUME(meminit(4,3) == mem(4,2));
ASSUME(coinit(4,3) == co(4,2));
ASSUME(deltainit(4,3) == delta(4,2));
ASSUME(meminit(4,4) == mem(4,3));
ASSUME(coinit(4,4) == co(4,3));
ASSUME(deltainit(4,4) == delta(4,3));
ASSERT(r14== 0);
}
| [
"tuan-phong.ngo@it.uu.se"
] | tuan-phong.ngo@it.uu.se |
83af02794552b50d7769070c6aecd9cf08b42734 | c29a0a69e82182067ff7b37614d73f429113336a | /filtration_generator.cpp | 5d192dfb4347a44f23aa89611c22e4a09711a142 | [] | no_license | vovanhuy/non_top | d8728b0fd817ff65b024fd1ffaa26c9ad1246c00 | 407139f83cf272bfe0dbe53f036a1bb82b41529e | refs/heads/master | 2020-12-31T00:40:39.170856 | 2017-02-07T23:07:56 | 2017-02-07T23:07:56 | 80,609,729 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,551 | cpp | #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <sstream>
using namespace std;
vector<vector<int> > simplices;
int d;
int dimension;
string s;
int current_position = 0;
vector<int> copy_vec(vector<int> v){
vector<int> v_copy(v.size());
for(int i = 0; i < v.size(); i++){
v_copy[i] = v[i];
}
return v_copy;
}
void build_simplices(){
// d is the dimension of simplices
for(int i = 1; i <= dimension + 1; i++){
simplices.push_back(vector<int>{i});
}
for(int dim = 1; dim <= dimension; dim++){
while(simplices[current_position].size() == dim){
vector<int> v_copy = copy_vec(simplices[current_position++]);
v_copy.push_back(0);
for(int vertice = v_copy[v_copy.size() - 2] + 1; vertice <= dimension+1; vertice++){
v_copy[v_copy.size() - 1] = vertice;
simplices.push_back(copy_vec(v_copy));
}
}
}
}
int main(int argc,char *argv[]){
if(argc != 3){
cout << "Please enter input and output files" << endl;
return 1;
}
stringstream ss(argv[1]);
ss >> dimension;
dimension++;
s = string(argv[2]);
build_simplices();
int end_position = 0;
if(s.compare("ball") == 0) end_position = simplices.size();
else if(s.compare("sphere") == 0) end_position = simplices.size() - 1;
for(int i = 0; i < end_position; i++){
cout << fixed << setprecision(1) << simplices[i].size() * 1.0 << " " << simplices[i].size() - 1 << " ";
for(int j = 0; j < simplices[i].size(); j++){
cout << simplices[i][j];
if(j == simplices[i].size() - 1) cout << endl;
else cout << " ";
}
}
} | [
"vovanhuyworkspace@gmail.com"
] | vovanhuyworkspace@gmail.com |
86c4ba438e60d0308d8e18045c0382740e7e5b26 | 53977fa2b058fbe99e1d9a7e0ad37aae5f47e0d8 | /No_SQL_DB/No_SQL_DB_LL.cpp | 58a0eb330273ce1cb482136e65b4babf26bed7b8 | [] | no_license | aditya-b/MissionRnD_Summer_Systems_NoSQLDB | 61242308750c8e5c2b9cb6db3e60dd7af851f27d | 5372a40de50fa074fde83a0d7a538d0c0f1927c7 | refs/heads/master | 2020-03-19T02:11:39.937706 | 2018-05-31T16:17:34 | 2018-05-31T16:17:34 | 135,607,919 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 19,035 | cpp | // No_SQL_DB.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include<stdlib.h>
#include<string.h>
#include<conio.h>
struct json
{
char **params;
char **values;
int cols;
int version;
json *next;
};
struct row
{
int commit_version;
int current_version;
int id;
json *records;
json *display_record;
row *next;
};
struct table
{
int id;
char *name;
struct row *rows;
struct row *last;
};
struct hash
{
int key;
int value;
}**hash_table;
json* version_exists(row *start, int version)
{
json *head = start->records;
while (head)
{
if (head->version == version)
return head;
head = head->next;
}
return NULL;
}
int get_column(char **params, char *param, int cols)
{
int i;
for (i = 0; i < cols; i++)
if (!strcmp(params[i], param))
return i;
return -1;
}
row* get_row(table *tables, int row_id)
{
row *start = tables->rows;
while (start)
{
if (start->id == row_id)
return start;
start = start->next;
}
return NULL;
}
int get_row_index(table *tables, int row_id)
{
row *start = tables->rows;
int q = 0;
while (start)
{
if (start->id == row_id)
return q;
start = start->next;
q++;
}
return -1;
}
int put(table **table, int row_id, int version, json data)
{
int i;
row* position = get_row(*table, row_id);
row *dummy;
if (position == NULL)
{
if ((*table)->rows == NULL)
{
(*table)->rows = (row*)malloc(sizeof(row));
dummy = (*table)->rows;
}
else
{
dummy = (*table)->rows->next;
row *link = (*table)->rows;
while (dummy)
{
link = dummy;
dummy = dummy->next;
}
dummy = (row*)malloc(sizeof(row));
link->next = dummy;
}
dummy->commit_version = version;
dummy->current_version = version;
dummy->id = row_id;
dummy->next = NULL;
dummy->records = (json*)malloc(sizeof(json));
dummy->display_record = dummy->records;
dummy->records->cols = data.cols;
dummy->records->next = NULL;
dummy->records->version = 1;
dummy->records->params = (char**)malloc(sizeof(char*)*(data.cols));
dummy->records->values = (char**)malloc(sizeof(char*)*(data.cols));
for (i = 0; i < data.cols; i++)
{
dummy->records->params[i] = (char*)malloc(sizeof(char)*strlen(data.params[i]));
dummy->records->values[i] = (char*)malloc(sizeof(char)*strlen(data.values[i]));
strcpy(dummy->records->params[i], data.params[i]);
strcpy(dummy->records->values[i], data.values[i]);
}
return 1;
}
else if(version == position->commit_version)
{
position->commit_version = position->commit_version + 1;
position->current_version = position->current_version + 1;
json *cell = position->display_record;
position->display_record = (json*)malloc(sizeof(json));
position->display_record->cols = cell->cols;
position->display_record->next = NULL;
position->display_record->version = cell->version + 1;
position->display_record->params = (char**)malloc(sizeof(char*)*cell->cols);
position->display_record->values = (char**)malloc(sizeof(char*)*cell->cols);
for (i = 0; i < cell->cols; i++)
{
position->display_record->params[i] = (char*)malloc(sizeof(char)*strlen(cell->params[i]));
position->display_record->values[i] = (char*)malloc(sizeof(char)*strlen(cell->values[i]));
strcpy(position->display_record->params[i], cell->params[i]);
strcpy(position->display_record->values[i], cell->values[i]);
}
int cols = cell->cols;
json *d = position->records;
position->records = (json*)malloc(sizeof(json));
position->records->cols = data.cols;
position->records->next = d;
position->records->version = cell->version + 1;
position->records->params = (char**)malloc(sizeof(char*)*data.cols);
position->records->values = (char**)malloc(sizeof(char*)*data.cols);
for (i = 0; i < data.cols; i++)
{
position->records->params[i] = (char*)malloc(sizeof(char)*30);
position->records->values[i] = (char*)malloc(sizeof(char)*30);
strcpy(position->records->params[i], data.params[i]);
strcpy(position->records->values[i], data.values[i]);
int p = get_column(position->display_record->params, data.params[i], position->display_record->cols);
if (p == -1)
{
position->display_record->params = (char**)realloc(position->display_record->params, sizeof(char*)*(cols + 1));
position->display_record->values = (char**)realloc(position->display_record->values, sizeof(char*)*(cols + 1));
position->display_record->params[cols] = (char*)malloc(sizeof(char)*strlen(data.params[i]));
position->display_record->values[cols] = (char*)malloc(sizeof(char)*strlen(data.values[i]));
strcpy(position->display_record->params[cols], data.params[i]);
strcpy(position->display_record->values[cols], data.values[i]);
cols++;
}
else
{
position->display_record->params[p] = (char*)realloc(position->display_record->params[p], sizeof(char)* strlen(data.params[i]));
position->display_record->values[p] = (char*)realloc(position->display_record->values[p], sizeof(char)* strlen(data.values[i]));
strcpy(position->display_record->params[p], data.params[i]);
strcpy(position->display_record->values[p], data.values[i]);
}
}
position->display_record->cols = cols;
return position->commit_version;
}
return -1;
}
json* get_data_json(char *filename, int *id, int start)
{
int row_id = 0;
int cols = 0;
int x = start;
char dat[60];
int y = 0;
json *data = (json*)malloc(sizeof(json));
data->params = (char**)malloc(sizeof(char*));
data->values = (char**)malloc(sizeof(char*));
data->version = 1;
while (filename[x] != ' '&&filename[x] != '\0'&&filename[x] != '\n')
row_id = row_id * 10 + (filename[x++] - 48);
x++;
while (1)
{
y = 0;
while (filename[x] != ' '&&filename[x] != '\0'&&filename[x] != '\n')
dat[y++] = filename[x++];
dat[y] = '\0';
x++;
(*data).params = (char**)realloc((*data).params, sizeof(char*)*(cols + 1));
(*data).values = (char**)realloc((*data).values, sizeof(char*)*(cols + 1));
data->params[cols] = (char*)malloc(sizeof(char)*30);
data->values[cols] = (char*)malloc(sizeof(char)*30);
int k = 0;
y = 0;
char d[30];
while (dat[y] != ':')
d[k++] = dat[y++];
d[k] = '\0';
strcpy(data->params[cols], d);
y++;
k = 0;
while (dat[y] != '\0')
d[k++] = dat[y++];
d[k] = '\0';
strcpy(data->values[cols], d);
if (filename[x - 1] == '\0' || filename[x - 1] == '\n')
break;
cols++;
}
data->cols = cols + 1;
*id = row_id;
return data;
}
void flush_to_file(table **tables, int table_no)
{
char filename[50];
FILE *fp;
int i, j, k, l;
for (i = 0; i < table_no; i++)
{
row *row_head = tables[i]->rows;
while (row_head)
{
json *data_head = row_head->records;
while (data_head)
{
for (j = 0; j < data_head->cols; j++)
{
sprintf(filename, "DataFiles/%s_%s.txt", tables[i]->name, data_head->params[j]);
fp=fopen(filename, "a");
fprintf(fp, "%d %s %d\n", row_head->id, data_head->values[j], data_head->version);
fclose(fp);
}
data_head = data_head->next;
}
row_head = row_head->next;
}
}
for (i = 0; i < table_no; i++)
{
sprintf(filename, "%s_meta_data.txt", tables[i]->name);
fp=fopen(filename, "a");
row *row_head = tables[i]->rows;
while (row_head)
{
fprintf(fp, "%d %d\n", row_head->id, row_head->commit_version);
row_head = row_head->next;
}
fclose(fp);
}
}
int get_table(table **tables, char *table_name, int table_length)
{
int i;
for (i = 0; i < table_length; i++)
if (!_strcmpi(tables[i]->name, table_name))
return i;
return -1;
}
void load_from_files(table **tables, char *column_name, char *filename, int *rows)
{
FILE *fp = fopen(filename, "r");
char row_data[60];
if (fp == NULL)
printf("Error: File not found!\n\n");
else
{
while (fgets(row_data, 60, fp))
{
int row_id = 0;
char data[40];
int version = 0;
int i = 0, x = 0;
while (row_data[i] != ' ')
row_id = row_id * 10 + (row_data[i++] - 48);
i++;
while (row_data[i] != ' ')
data[x++] = row_data[i++];
data[x] = '\0';
i++;
while (row_data[i] != '\0' && row_data[i] != '\n')
version = version * 10 + (row_data[i++] - 48);
row *id = get_row(*tables, row_id);
if (id == NULL)
{
row *dummy;
if ((*tables)->rows == NULL)
{
(*tables)->rows = (row*)malloc(sizeof(row));
dummy = (*tables)->rows;
}
else
{
dummy = (*tables)->rows->next;
row *link = (*tables)->rows;
while (dummy)
{
link = dummy;
dummy = dummy->next;
}
dummy= (row*)malloc(sizeof(row));
link->next = dummy;
}
dummy->next = NULL;
dummy->commit_version = version;
dummy->current_version = version;
dummy->id = row_id;
dummy->records = (json*)malloc(sizeof(json));
dummy->display_record = (json*)malloc(sizeof(json));
dummy->display_record->cols = 1;
dummy->display_record->next = NULL;
dummy->display_record->version = version;
dummy->display_record->params = (char**)malloc(sizeof(char*));
dummy->display_record->values = (char**)malloc(sizeof(char*));
dummy->display_record->params[0] = (char*)malloc(sizeof(char)*strlen(column_name));
dummy->display_record->values[0] = (char*)malloc(sizeof(char)*strlen(data));
strcpy(dummy->display_record->params[0], column_name);
strcpy(dummy->display_record->values[0], data);
dummy->records->cols = 1;
dummy->records->next = NULL;
dummy->records->version = version;
dummy->records->params = (char**)malloc(sizeof(char*));
dummy->records->values = (char**)malloc(sizeof(char*));
dummy->records->params[0] = (char*)malloc(sizeof(char)*strlen(column_name));
dummy->records->values[0] = (char*)malloc(sizeof(char)*strlen(data));
strcpy(dummy->records->params[0], column_name);
strcpy(dummy->records->values[0], data);
}
else
{
json *json_data = version_exists(id, version);
if (json_data == NULL)
{
json *offset = id->records;
if (id->commit_version < version)
{
id->records= (json*)malloc(sizeof(json));
id->records->cols = 1;
id->records->next = offset;
id->records->version = version;
id->records->params = (char**)malloc(sizeof(char*));
id->records->values = (char**)malloc(sizeof(char*));
id->records->params[0] = (char*)malloc(sizeof(char)*strlen(column_name));
id->records->values[0] = (char*)malloc(sizeof(char)*strlen(data));
strcpy(id->records->params[0], column_name);
strcpy(id->records->values[0], data);
id->commit_version = version;
id->current_version = version;
}
else
{
json *orig;
while (offset->next != NULL && offset->version > version)
{
offset = offset->next;
orig = offset;
}
if (offset->next == NULL)
{
offset->next = (json*)malloc(sizeof(json));
orig = offset->next;
orig->next = NULL;
}
else
{
orig->next = (json*)malloc(sizeof(json));
orig->next->next = offset;
orig = orig->next;
}
orig->cols = 1;
orig->version = version;
if (id->commit_version < version)
id->commit_version = version;
if (id->current_version < version)
id->current_version = version;
orig->params = (char**)malloc(sizeof(char*));
orig->values = (char**)malloc(sizeof(char*));
orig->params[0] = (char*)malloc(sizeof(char)*strlen(column_name));
orig->values[0] = (char*)malloc(sizeof(char)*strlen(data));
strcpy(orig->params[0], column_name);
strcpy(orig->values[0], data);
}
int i = get_column(id->display_record->params, column_name, id->display_record->cols);
if (i == -1)
{
id->display_record->cols += 1;
int col = id->display_record->cols - 1;
id->display_record->params = (char**)realloc(id->display_record->params, sizeof(char*)*id->display_record->cols);
id->display_record->values = (char**)realloc(id->display_record->values, sizeof(char*)*id->display_record->cols);
id->display_record->params[col] = (char*)malloc(sizeof(char)*strlen(column_name));
id->display_record->values[col] = (char*)malloc(sizeof(char)*strlen(data));
id->display_record->next = NULL;
strcpy(id->display_record->params[col], column_name);
strcpy(id->display_record->values[col], data);
if (version > id->display_record->version)
id->display_record->version = version;
}
else if(id->commit_version<=version)
{
json_data->params[i] = (char*)realloc(json_data->params[i], sizeof(char)*strlen(column_name));
json_data->values[i] = (char*)realloc(json_data->values[i], sizeof(char)*strlen(data));
strcpy(json_data->params[i], column_name);
strcpy(json_data->values[i], data);
}
}
else
{
int i = get_column(json_data->params, column_name, json_data->cols);
if (i == -1)
{
json_data->cols += 1;
json_data->params = (char**)realloc(json_data->params, sizeof(char*)*json_data->cols);
json_data->values = (char**)realloc(json_data->values, sizeof(char*)*json_data->cols);
int col = json_data->cols - 1;
json_data->params[col] = (char*)malloc(sizeof(char)*strlen(column_name));
json_data->values[col] = (char*)malloc(sizeof(char)*strlen(data));
strcpy(json_data->params[col], column_name);
strcpy(json_data->values[col], data);
id->display_record->cols += 1;
col = id->display_record->cols - 1;
id->display_record->params = (char**)realloc(id->display_record->params, sizeof(char*)*id->display_record->cols);
id->display_record->values = (char**)realloc(id->display_record->values, sizeof(char*)*id->display_record->cols);
id->display_record->params[col] = (char*)malloc(sizeof(char)*strlen(column_name));
id->display_record->values[col] = (char*)malloc(sizeof(char)*strlen(data));
strcpy(id->display_record->params[col], column_name);
strcpy(id->display_record->values[col], data);
}
else
{
json_data->params[i] = (char*)realloc(json_data->params[i],sizeof(char)*strlen(column_name));
json_data->values[i] = (char*)realloc(json_data->values[i],sizeof(char)*strlen(data));
strcpy(json_data->params[i], column_name);
strcpy(json_data->values[i], data);
}
}
}
}
}
fclose(fp);
}
int main()
{
char query[150];
int table_no = 0;
table **tables = (table**)malloc(sizeof(table));
int *rows = (int*)malloc(sizeof(int));
int **versions = (int**)malloc(sizeof(int));
while (1)
{
printf("\nDBQUERY> ");
_getch;
gets_s(query);
char op[10];
char table_name[20];
int i = 0;
while (query[i] != ' '&&query[i] != '\0')
op[i] = query[i++];
op[i] = '\0';
if (query[i])
i++;
int x = 0;
while (query[i] != '\0'&&query[i] != ' ')
table_name[x++] = query[i++];
table_name[x] = '\0';
if (query[i])
i++;
if (!_stricmp(op, "CREATE"))
{
tables = (table**)realloc(tables, sizeof(table)*(table_no + 1));
versions = (int**)realloc(versions, sizeof(int*)*(table_no + 1));
versions[table_no] = (int*)malloc(sizeof(int));
rows = (int*)realloc(rows, sizeof(int)*(table_no + 1));
rows[table_no] = 0;
tables[table_no] = (table*)malloc(sizeof(table));
tables[table_no]->rows = NULL;
tables[table_no]->name = (char*)malloc(sizeof(char*));
strcpy(tables[table_no]->name, table_name);
table_no++;
printf("Table '%s' created successfully!\n", table_name);
}
else if (!_stricmp(op, "PUT"))
{
int pos = get_table(tables, table_name, table_no);
if (pos == -1)
printf("Error: Table '%s' not found!", table_name);
else
{
versions[pos] = (int*)realloc(versions[pos], sizeof(int)*(rows[pos] + 1));
versions[pos][rows[pos]] = 0;
int row_id = 0;
json *data = get_data_json(query, &row_id, i);
int p = get_row_index(tables[pos], row_id);
if (p == -1)
p = rows[pos];
int a = put(&tables[pos], row_id, versions[pos][p]+1, *data);
if (a != -1)
{
versions[pos][p] = a;
if (a == 1)
rows[pos] += 1;
printf("PUT for row_id '%d' successful!\n", row_id);
}
else
printf("Error: Commit conflict!\n");
}
}
else if (!_stricmp(op, "GET"))
{
int pos = get_table(tables, table_name, table_no);
if (pos == -1)
printf("Error: Table '%s' not found!", table_name);
else
{
int row_id = 0;
while (query[i] != '\0')
row_id = row_id * 10 + (query[i++] - 48);
row* p = get_row(tables[pos], row_id);
int x = get_row_index(tables[pos], row_id);
if (p == NULL)
printf("Error: Row_ID not found!\n");
else
{
printf("Data for row_id- %d:\n{\n\t'row_id':%d\n", row_id,row_id);
int i = 0;
for (i = 0; i < p->display_record->cols; i++)
printf("\t'%s':'%s'\n", p->display_record->params[i], p->display_record->values[i]);
printf("\t'version':'%d'\n}\n", p->display_record->version);
versions[pos][x] = p->display_record->version;
}
}
}
else if (!_stricmp(op, "DELETE"))
{
int pos = get_table(tables, table_name, table_no);
if (pos == -1)
printf("Error: Table '%s' not found!", table_name);
else
{
int row_id = 0;
while (query[i] != '\0')
row_id = row_id * 10 + (query[i++] - 48);
int p = get_row_index(tables[pos], row_id);
if (p == -1)
printf("Error: Row_ID not found!\n");
else
{
row *dummy = tables[pos]->rows;
row *link;
int q = 0;
while (q < p)
{
link = dummy;
dummy = dummy->next;
q++;
}
if (dummy->next == NULL)
link->next = NULL;
else
link->next = dummy->next;
free(dummy);
for (i = p; i < rows[pos] - 1; i++)
versions[pos][i] = versions[pos][i + 1];
rows[pos] -= 1;
versions[pos] = (int*)realloc(versions[pos], sizeof(int)*rows[pos]);
printf("Record successfully deleted!\n");
}
}
}
else if (!_strcmpi("FLUSH", op))
flush_to_file(tables, table_no);
else if (!_strcmpi("EXIT", op))
exit(0);
else if (!_strcmpi("LOAD", op))
{
int ch;
printf("Warning: Any existing data with a version conflict might be overwritten! Proceed(1/0)?: ");
scanf("%d", &ch);
if (ch)
{
int pos = get_table(tables, table_name, table_no);
if (pos == -1)
printf("Error: Table not found! Create table before you flush!\n\n");
else
{
char column[20];
x = 0;
while (query[i] != ' '&&query[i] != '\0')
column[x++] = query[i++];
column[x] = '\0';
if (query[i])
i++;
else
{
printf("Error: Filename not entered\n\n");
continue;
}
char filename[40];
x = 0;
while (query[i] != '\0')
filename[x++] = query[i++];
filename[x] = '\0';
load_from_files(&tables[pos], column, filename,&rows[pos]);
printf("Load successful!\n");
}
}
else
printf("Load cancelled\n\n");
continue;
}
else
printf("Error: Invalid Command!\n\n");
}
return 0;
}
| [
"aditya.bulusu168@gmail.com"
] | aditya.bulusu168@gmail.com |
db31d565d97cffcab906de82a3b0f85d6b5501f1 | f19896ff3a1016d4ae63db6e9345cfcc4d0a2967 | /Topics/Topic/Data Structures and Alogrithms (Topic)/AlgoMonster/68(Lowest Common Ancestor of Binary Search Tree).cpp | ae078506148399de8ca1f38874cf4183414efced | [] | no_license | Akshay199456/100DaysOfCode | 079800b77a44abe560866cf4750dfc6c7fe01a59 | b4ed8a6793c17bcb71c56686d98fcd683af64841 | refs/heads/master | 2023-08-08T07:59:02.723675 | 2023-08-01T03:44:15 | 2023-08-01T03:44:15 | 226,718,143 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 11,340 | cpp | /*
Problem statement:
Given a binary search tree (BST), find the lowest common ancestor (LCA) node of two given nodes in the BST.
According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two nodes p and q as the lowest node in T that has both p and q as descendants (where we allow a node to be a descendant of itself).”
Input
bst: a binary tree representing the existing BST.
p: the value of node p as described in the question
q: the value of node q as described in the question
Output
The value of the LCA between nodes p and q
Examples
Example 1:
Input:
bst = [6,2,8,0,4,7,9,x,x,3,5]
p = 2
q = 8
Output: 6
Explanation:
The ancestors of node p with value 2 are node 2 and node 6. The ancestors of node q with value 8 are node 8 and node 6.
The lowest common ancestors between these two nodes is 6.
*/
/*
------------------------- My Approaches:
1. DFS + BST
We can use the DFS approach in order to solve this problem. since he poblem is a bst, we can divide this approach into two steps.
first step is to get the path for each value. since it is a bst, we can accomplish this in O(h) time which in the worst case would be O(n) time.
Once wwe get hte path for each node, the second path si to compare the two paths from the eginning.
the point at which the two lists deviate from each other is the lowest common ancestor. this is because, since it is a bst, we can easily get the path through making comparision with the root value.
this path will be unique for that node.. so when we get the interesection of the tw nodes, the point at which they deviate will be the answer.
Time complexity: O(n)
Space complexity: O(n)
2. Same as Other Approaches(1)
we just wanted to make sure we understood the approach that was provided in Other Approaches(1). as a result, worte down the code
to comfinrm we understood the logic
*/
/*
------------------------- Other Approaches
1.
Time complexity: O()
Space complexity: O()
*/
/*
------------------------- Notes
the idea behind this problem is to use the property of binary search trees
as a quick recap, a BST is a type of binary tree where for any given node with value a, the values in its left subtree
are all less than a and the values in its right subtree are all greater than a.
the tree on the left is a VST because every node holds this property whereas the right tree is not a BST because there is a 2 on the right subtree of the node
with value 3. since 2 < 3, the property that the values on the rightide is greater than the current node does not hold
original problerm
Trees are naturally recurisve data structures and as such we will use recursion to find our answer. for binary search trees, specifically, we often break down each recursive call into
cases. the reason we do this is because for every node we can decide whether to traverse down the left subtree or right substree based on the value of the
current node.
to find the lowest common ancestor of two nodes in a BST, we break our search into 3 common cases:
1. if nodes p and q are on the left of the current node, the continue search the left side
2. if nodes p and q are the right of the current node, then continue search the right side
3. f nodes p and q are split (one is on the left, the other is on the right), then we can return the current node
as the LCA.
Note that there is a special case when either p == cur.val or q == curr.val, since we have definted that a node can be its
own descendatnt, this falls in case 3.
Time complexity: O(h)
since we dont need to traverse the entire tree for our search and on each level, we only visit a single node, the final time
complexity is O(h) wwhere h is the height of the tree. in the worst case, the tree is not balanced and h is n.
Space complexity: O()
if we count stack memory as space usage, then our space complexity is O(h) where h is the height of the tree because in the worst case
we have a line graph where nodes p and q are at thje end, which leads to O(n) stack memory
*/
// My approaches(1)
#include <algorithm> // copy
#include <iostream> // boolalpha, cin, cout, streamsize
#include <iterator> // back_inserter, istream_iterator
#include <limits> // numeric_limits
#include <sstream> // istringstream
#include <string> // getline, stoi, string
#include <vector> // vector
template <typename T>
struct Node {
T val;
Node<T>* left;
Node<T>* right;
explicit Node(T val, Node<T>* left = nullptr, Node<T>* right = nullptr)
: val{val}, left{left}, right{right} {}
~Node() {
delete left;
delete right;
}
};
bool getPath(Node<int>* bst, int val, std::vector<int> & list){
if(!bst)
return false;
else{
list.push_back(bst->val);
if(bst->val == val)
return true;
else if(val < bst->val)
return getPath(bst->left, val, list);
else
return getPath(bst->right, val, list);
}
}
void printPath(std::vector<int> & list){
std::cout<<"printing list: "<<std::endl;
for(int i=0; i<list.size(); i++){
std::cout<<list[i]<<" ";
}
std::cout<<std::endl;
}
int findLowestAncestor(std::vector<int> & pList, std::vector<int> & qList){
int index = 0, lowestAncestor = 0;
while(index < pList.size() && index < qList.size()){
if(pList[index] == qList[index]){
lowestAncestor = pList[index];
index++;
}
else
return lowestAncestor;
}
return lowestAncestor;
}
int lca_on_bst(Node<int>* bst, int p, int q) {
// WRITE YOUR BRILLIANT CODE HERE
if(!bst)
return 0;
std::vector<int> pList;
std::vector<int> qList;
bool pFound = getPath(bst, p, pList);
bool qFound = getPath(bst, q, qList);
// printPath(pList);
// printPath(qList);
if(!pFound || !qFound)
return 0;
return findLowestAncestor(pList, qList);
}
// this function builds a tree from input
// learn more about how trees are encoded in https://algo.monster/problems/serializing_tree
template<typename T, typename Iter, typename F>
Node<T>* build_tree(Iter& it, F f) {
std::string val = *it;
++it;
if (val == "x") return nullptr;
Node<T>* left = build_tree<T>(it, f);
Node<T>* right = build_tree<T>(it, f);
return new Node<T>{f(val), left, right};
}
template<typename T>
std::vector<T> get_words() {
std::string line;
std::getline(std::cin, line);
std::istringstream ss{line};
ss >> std::boolalpha;
std::vector<T> v;
std::copy(std::istream_iterator<T>{ss}, std::istream_iterator<T>{}, std::back_inserter(v));
return v;
}
void ignore_line() {
std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
}
int main() {
std::vector<std::string> bst_vec = get_words<std::string>();
auto bst_it = bst_vec.begin();
Node<int>* bst = build_tree<int>(bst_it, [](auto s) { return std::stoi(s); });
int p;
std::cin >> p;
ignore_line();
int q;
std::cin >> q;
ignore_line();
int res = lca_on_bst(bst, p, q);
std::cout << res << '\n';
}
// My Approaches(2)
#include <algorithm> // copy
#include <iostream> // boolalpha, cin, cout, streamsize
#include <iterator> // back_inserter, istream_iterator
#include <limits> // numeric_limits
#include <sstream> // istringstream
#include <string> // getline, stoi, string
#include <vector> // vector
template <typename T>
struct Node {
T val;
Node<T>* left;
Node<T>* right;
explicit Node(T val, Node<T>* left = nullptr, Node<T>* right = nullptr)
: val{val}, left{left}, right{right} {}
~Node() {
delete left;
delete right;
}
};
int lca_on_bst(Node<int>* bst, int p, int q) {
// WRITE YOUR BRILLIANT CODE HERE
if(p<bst->val && q<bst->val)
return lca_on_bst(bst->left,p,q);
else if(p>bst->val && q>bst->val)
return lca_on_bst(bst->right,p,q);
else
return bst->val;
return 0;
}
// this function builds a tree from input
// learn more about how trees are encoded in https://algo.monster/problems/serializing_tree
template<typename T, typename Iter, typename F>
Node<T>* build_tree(Iter& it, F f) {
std::string val = *it;
++it;
if (val == "x") return nullptr;
Node<T>* left = build_tree<T>(it, f);
Node<T>* right = build_tree<T>(it, f);
return new Node<T>{f(val), left, right};
}
template<typename T>
std::vector<T> get_words() {
std::string line;
std::getline(std::cin, line);
std::istringstream ss{line};
ss >> std::boolalpha;
std::vector<T> v;
std::copy(std::istream_iterator<T>{ss}, std::istream_iterator<T>{}, std::back_inserter(v));
return v;
}
void ignore_line() {
std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
}
int main() {
std::vector<std::string> bst_vec = get_words<std::string>();
auto bst_it = bst_vec.begin();
Node<int>* bst = build_tree<int>(bst_it, [](auto s) { return std::stoi(s); });
int p;
std::cin >> p;
ignore_line();
int q;
std::cin >> q;
ignore_line();
int res = lca_on_bst(bst, p, q);
std::cout << res << '\n';
}
// Other Approaches(1)
#include <algorithm> // copy
#include <iostream> // boolalpha, cin, cout, streamsize
#include <iterator> // back_inserter, istream_iterator
#include <limits> // numeric_limits
#include <sstream> // istringstream
#include <string> // getline, stoi, string
#include <vector> // vector
template <typename T>
struct Node {
T val;
Node<T>* left;
Node<T>* right;
explicit Node(T val, Node<T>* left = nullptr, Node<T>* right = nullptr)
: val{val}, left{left}, right{right} {}
~Node() {
delete left;
delete right;
}
};
int lca_on_bst(Node<int>* bst, int p, int q) {
if (p < bst->val && q < bst->val) {
return lca_on_bst(bst->left, p, q);
} else if (p > bst->val && q > bst->val) {
return lca_on_bst(bst->right, p, q);
} else {
return bst->val;
}
}
// this function builds a tree from input
// learn more about how trees are encoded in https://algo.monster/problems/serializing_tree
template<typename T, typename Iter, typename F>
Node<T>* build_tree(Iter& it, F f) {
std::string val = *it;
++it;
if (val == "x") return nullptr;
Node<T>* left = build_tree<T>(it, f);
Node<T>* right = build_tree<T>(it, f);
return new Node<T>{f(val), left, right};
}
template<typename T>
std::vector<T> get_words() {
std::string line;
std::getline(std::cin, line);
std::istringstream ss{line};
ss >> std::boolalpha;
std::vector<T> v;
std::copy(std::istream_iterator<T>{ss}, std::istream_iterator<T>{}, std::back_inserter(v));
return v;
}
void ignore_line() {
std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
}
int main() {
std::vector<std::string> bst_vec = get_words<std::string>();
auto bst_it = bst_vec.begin();
Node<int>* bst = build_tree<int>(bst_it, [](auto s) { return std::stoi(s); });
int p;
std::cin >> p;
ignore_line();
int q;
std::cin >> q;
ignore_line();
int res = lca_on_bst(bst, p, q);
std::cout << res << '\n';
} | [
"akshay.kum94@gmail.com"
] | akshay.kum94@gmail.com |
54232fdc8ae75bc32d3589869ae0a3a62e89f9fd | a538a3889a61c2a069b5207b689b2b3558d45330 | /kratos/geometries/triangle_3d_6.h | 17092dfda543167c972e1e1518fdf61791175e79 | [] | no_license | rwilliams01/kratos_bcn2 | c82b3cd508002bff24b8a5e303f097b978f50ee4 | 0bd4fb4ae82905cf5a0969649e684336086806c8 | refs/heads/master | 2023-05-01T22:03:44.447740 | 2021-04-23T21:04:03 | 2021-04-23T21:04:03 | 290,202,915 | 0 | 0 | null | 2020-08-25T11:59:46 | 2020-08-25T11:59:45 | null | UTF-8 | C++ | false | false | 60,623 | h | //
// Project Name: Kratos
// Last Modified by: $Author: JMCarbonell $
// Date: $Date: December 2015 $
// Revision: $Revision: 1.7 $
//
//
#if !defined(KRATOS_TRIANGLE_3D_6_H_INCLUDED )
#define KRATOS_TRIANGLE_3D_6_H_INCLUDED
// System includes
// External includes
// Project includes
#include "geometries/line_3d_3.h"
#include "integration/triangle_gauss_legendre_integration_points.h"
namespace Kratos
{
///@name Kratos Globals
///@{
///@}
///@name Type Definitions
///@{
///@}
///@name Enum's
///@{
///@}
///@name Functions
///@{
///@}
///@name Kratos Classes
///@{
/**
* A four node quadrilateral geometry. While the shape functions are only defined in
* 2D it is possible to define an arbitrary orientation in space. Thus it can be used for
* defining surfaces on 3D elements.
*/
template<class TPointType> class Triangle3D6
: public Geometry<TPointType>
{
public:
///@}
///@name Type Definitions
///@{
/**
* Geometry as base class.
*/
typedef Geometry<TPointType> BaseType;
/**
* Type of edge geometry
*/
typedef Line3D3<TPointType> EdgeType;
/**
* Pointer definition of Triangle3D6
*/
KRATOS_CLASS_POINTER_DEFINITION( Triangle3D6 );
/**
* Integration methods implemented in geometry.
*/
typedef GeometryData::IntegrationMethod IntegrationMethod;
/**
* A Vector of counted pointers to Geometries.
* Used for returning edges of the geometry.
*/
typedef typename BaseType::GeometriesArrayType GeometriesArrayType;
/**
* Redefinition of template parameter TPointType.
*/
typedef TPointType PointType;
/**
* Type used for indexing in geometry class.
* std::size_t used for indexing
* point or integration point access methods and also all other
* methods which need point or integration point index.
*/
typedef typename BaseType::IndexType IndexType;
/**
* This type is used to return size or dimension in
* geometry. Dimension, WorkingDimension, PointsNumber and
* ... return this type as their results.
*/
typedef typename BaseType::SizeType SizeType;
/**
* Array of counted pointers to point.
* This type used to hold geometry's points.
*/
typedef typename BaseType::PointsArrayType PointsArrayType;
/**
* Array of coordinates. Can be Nodes, Points or IntegrationPoints
*/
typedef typename BaseType::CoordinatesArrayType CoordinatesArrayType;
/**
* This type used for representing an integration point in geometry.
* This integration point is a point with an additional weight component.
*/
typedef typename BaseType::IntegrationPointType IntegrationPointType;
/**
* A Vector of IntegrationPointType which used to hold
* integration points related to an integration
* method.
* IntegrationPoints functions used this type to return
* their results.
*/
typedef typename BaseType::IntegrationPointsArrayType IntegrationPointsArrayType;
/**
* A Vector of IntegrationPointsArrayType which used to hold
* integration points related to different integration method
* implemented in geometry.
*/
typedef typename BaseType::IntegrationPointsContainerType IntegrationPointsContainerType;
/**
* A third order tensor used as shape functions' values
* container.
*/
typedef typename BaseType::ShapeFunctionsValuesContainerType ShapeFunctionsValuesContainerType;
/**
* A fourth order tensor used as shape functions' local
* gradients container in geometry.
*/
typedef typename BaseType::ShapeFunctionsLocalGradientsContainerType ShapeFunctionsLocalGradientsContainerType;
/**
* A third order tensor to hold jacobian matrices evaluated at
* integration points. Jacobian and InverseOfJacobian functions
* return this type as their result.
*/
typedef typename BaseType::JacobiansType JacobiansType;
/**
* A third order tensor to hold shape functions' local
* gradients. ShapefunctionsLocalGradients function return this
* type as its result.
*/
typedef typename BaseType::ShapeFunctionsGradientsType ShapeFunctionsGradientsType;
/**
* A third order tensor to hold shape functions' local second derivatives.
* ShapefunctionsLocalGradients function return this
* type as its result.
*/
typedef typename BaseType::ShapeFunctionsSecondDerivativesType
ShapeFunctionsSecondDerivativesType;
/**
* A third order tensor to hold shape functions' local third derivatives.
* ShapefunctionsLocalGradients function return this
* type as its result.
*/
typedef typename BaseType::ShapeFunctionsThirdDerivativesType
ShapeFunctionsThirdDerivativesType;
/**
* Type of the normal vector used for normal to edges in geomety.
*/
typedef typename BaseType::NormalType NormalType;
///@}
///@name Life Cycle
///@{
Triangle3D6( const PointType& FirstPoint,
const PointType& SecondPoint,
const PointType& ThirdPoint,
const PointType& FourthPoint,
const PointType& FifthPoint,
const PointType& SixthPoint
)
: BaseType( PointsArrayType(), &msGeometryData )
{
this->Points().push_back( typename PointType::Pointer( new PointType( FirstPoint ) ) );
this->Points().push_back( typename PointType::Pointer( new PointType( SecondPoint ) ) );
this->Points().push_back( typename PointType::Pointer( new PointType( ThirdPoint ) ) );
this->Points().push_back( typename PointType::Pointer( new PointType( FourthPoint ) ) );
this->Points().push_back( typename PointType::Pointer( new PointType( FifthPoint ) ) );
this->Points().push_back( typename PointType::Pointer( new PointType( SixthPoint ) ) );
}
Triangle3D6( typename PointType::Pointer pFirstPoint,
typename PointType::Pointer pSecondPoint,
typename PointType::Pointer pThirdPoint,
typename PointType::Pointer pFourthPoint,
typename PointType::Pointer pFifthPoint,
typename PointType::Pointer pSixthPoint
)
: BaseType( PointsArrayType(), &msGeometryData )
{
this->Points().push_back( pFirstPoint );
this->Points().push_back( pSecondPoint );
this->Points().push_back( pThirdPoint );
this->Points().push_back( pFourthPoint );
this->Points().push_back( pFifthPoint );
this->Points().push_back( pSixthPoint );
}
Triangle3D6( const PointsArrayType& ThisPoints )
: BaseType( ThisPoints, &msGeometryData )
{
if ( this->PointsNumber() != 6 )
KRATOS_THROW_ERROR( std::invalid_argument,
"Invalid points number. Expected 6, given " , this->PointsNumber() );
}
/**
* Copy constructor.
* Construct this geometry as a copy of given geometry.
*
* @note This copy constructor does not copy the points and new
* geometry shares points with given source geometry. It is
* obvious that any change to this new geometry's point affect
* source geometry's points too.
*/
Triangle3D6( Triangle3D6 const& rOther )
: BaseType( rOther )
{
}
/**
* Copy constructor from a geometry with other point type.
* Construct this geometry as a copy of given geometry which
* has different type of points. The given goemetry's
* TOtherPointType* must be implicity convertible to this
* geometry PointType.
*
* @note This copy constructor does not copy the points and new
* geometry shares points with given source geometry. It is
* obvious that any change to this new geometry's point affect
* source geometry's points too.
*/
template<class TOtherPointType> Triangle3D6( Triangle3D6<TOtherPointType> const& rOther )
: BaseType( rOther )
{
}
/**
* Destructor. Does nothing!!!
*/
virtual ~Triangle3D6() {}
GeometryData::KratosGeometryFamily GetGeometryFamily() const final
{
return GeometryData::Kratos_Triangle;
}
GeometryData::KratosGeometryType GetGeometryType() const final
{
return GeometryData::Kratos_Triangle3D6;
}
///@}
///@name Operators
///@{
/**
* Assignment operator.
*
* @note This operator don't copy the points and this
* geometry shares points with given source geometry. It's
* obvious that any change to this geometry's point affect
* source geometry's points too.
*
* @see Clone
* @see ClonePoints
*/
Triangle3D6& operator=( const Triangle3D6& rOther )
{
BaseType::operator=( rOther );
return *this;
}
/**
* Assignment operator for geometries with different point type.
*
* @note This operator don't copy the points and this
* geometry shares points with given source geometry. It's
* obvious that any change to this geometry's point affect
* source geometry's points too.
*
* @see Clone
* @see ClonePoints
*/
template<class TOtherPointType>
Triangle3D6& operator=( Triangle3D6<TOtherPointType> const & rOther )
{
BaseType::operator=( rOther );
return *this;
}
///@}
///@name Operations
///@{
typename BaseType::Pointer Create( PointsArrayType const& ThisPoints ) const
{
return typename BaseType::Pointer( new Triangle3D6( ThisPoints ) );
}
virtual Geometry< Point<3> >::Pointer Clone() const
{
Geometry< Point<3> >::PointsArrayType NewPoints;
//making a copy of the nodes TO POINTS (not Nodes!!!)
for ( IndexType i = 0 ; i < this->Points().size() ; i++ )
NewPoints.push_back( this->Points()[i] );
//creating a geometry with the new points
Geometry< Point<3> >::Pointer p_clone( new Triangle3D6< Point<3> >( NewPoints ) );
p_clone->ClonePoints();
return p_clone;
}
/**
* returns the local coordinates of all nodes of the current geometry
* @param rResult a Matrix object that will be overwritten by the result
* @return the local coordinates of all nodes
*/
virtual Matrix& PointsLocalCoordinates( Matrix& rResult ) const
{
rResult.resize( 6, 2 );
noalias( rResult ) = ZeroMatrix( 6, 2 );
rResult( 0, 0 ) = 0.0;
rResult( 0, 1 ) = 0.0;
rResult( 1, 0 ) = 1.0;
rResult( 1, 1 ) = 0.0;
rResult( 2, 0 ) = 0.0;
rResult( 2, 1 ) = 1.0;
rResult( 3, 0 ) = 0.5;
rResult( 3, 1 ) = 0.0;
rResult( 4, 0 ) = 0.5;
rResult( 4, 1 ) = 0.5;
rResult( 5, 0 ) = 0.0;
rResult( 5, 1 ) = 0.5;
return rResult;
}
//lumping factors for the calculation of the lumped mass matrix
virtual Vector& LumpingFactors( Vector& rResult ) const
{
if(rResult.size() != 6)
rResult.resize( 6, false );
std::fill( rResult.begin(), rResult.end(), 1.00 / 6.00 );
return rResult;
}
///@}
///@name Information
///@{
/**
* This method calculates and returns Length or charactereistic
* length of this geometry depending on it's dimension.
* For one dimensional geometry for example Line it returns
* length of it and for the other geometries it gives Characteristic
* length otherwise.
* In the current geometry this function returns the determinant of
* jacobian
*
* @return double value contains length or Characteristic
* length
* @see Area()
* @see Volume()
* @see DomainSize()
*/
/**
* :TODO: could be replaced by something more suitable
* (comment by janosch)
*/
virtual double Length() const
{
// return sqrt( fabs( DeterminantOfJacobian( PointType() ) ) );
// Approximation to avoid errors. Can be improved.
array_1d<double, 3> p0 = BaseType::GetPoint( 0 );
array_1d<double, 3> p1 = BaseType::GetPoint( 1 );
array_1d<double, 3> vx( p1 - p0 );
return MathUtils<double>::Norm3(vx);
}
/** This method calculates and returns area or surface area of
* this geometry depending to it's dimension. For one dimensional
* geometry it returns zero, for two dimensional it gives area
* and for three dimensional geometries it gives surface area.
*
* @return double value contains area or surface
* area.
* @see Length()
* @see Volume()
* @see DomainSize()
*/
/**
* :TODO: could be replaced by something more suitable
* (comment by janosch)
*/
virtual double Area() const
{
//return fabs( DeterminantOfJacobian( PointType() ) ) * 0.5;
// Approximation to avoid errors. Can be improved.
array_1d<double, 3> p0 = BaseType::GetPoint( 0 );
array_1d<double, 3> p1 = BaseType::GetPoint( 1 );
array_1d<double, 3> p2 = BaseType::GetPoint( 2 );
array_1d<double, 3> p3 = BaseType::GetPoint( 3 );
array_1d<double, 3> vx( p1 - p0 );
array_1d<double, 3> vy( p2 - p3 );
double base = MathUtils<double>::Norm3(vx);
double length = MathUtils<double>::Norm3(vy);
return base*length*0.5;
}
/** This method calculates and returns length, area or volume of
* this geometry depending to it's dimension. For one dimensional
* geometry it returns its length, for two dimensional it gives area
* and for three dimensional geometries it gives its volume.
*
* @return double value contains length, area or volume.
* @see Length()
* @see Area()
* @see Volume()
*/
/**
* :TODO: could be replaced by something more suitable
* (comment by janosch)
*/
virtual double DomainSize() const
{
return Area();
}
/**
* Returns whether given local point is inside the Geometry
*/
virtual bool IsInside( const CoordinatesArrayType& rPoint )
{
const double zero = 1E-8;
if( ( rPoint[0] >= (0.0-zero) ) && ( rPoint[0] <= 1.0 + zero ) )
if( ( rPoint[1] >= 0.0-zero ) && (rPoint[1] <= 1.0 + zero ) )
if(((1.0-(rPoint[0] + rPoint[1])) >= 0.0-zero) && ((1.0-(rPoint[0] + rPoint[1])) <= 1.0 + zero))
return true;
return false;
}
virtual CoordinatesArrayType& PointLocalCoordinates( CoordinatesArrayType& rResult,
const CoordinatesArrayType& rPoint )
{
boost::numeric::ublas::bounded_matrix<double,3,3> X;
boost::numeric::ublas::bounded_matrix<double,3,2> DN;
for(unsigned int i=0; i<this->size();i++)
{
X(0,i ) = this->GetPoint( i ).X();
X(1,i ) = this->GetPoint( i ).Y();
X(2,i ) = this->GetPoint( i ).Z();
}
double tol = 1.0e-8;
int maxiter = 1000;
Matrix J = ZeroMatrix( 2, 2 );
Matrix invJ = ZeroMatrix( 2, 2 );
//starting with xi = 0
rResult = ZeroVector( 3 );
Vector DeltaXi = ZeroVector( 2 );
array_1d<double,3> CurrentGlobalCoords;
//Newton iteration:
for ( int k = 0; k < maxiter; k++ )
{
noalias(CurrentGlobalCoords) = ZeroVector( 3 );
this->GlobalCoordinates( CurrentGlobalCoords, rResult );
noalias( CurrentGlobalCoords ) = rPoint - CurrentGlobalCoords;
//derivatives of shape functions
Matrix shape_functions_gradients;
shape_functions_gradients = ShapeFunctionsLocalGradients(shape_functions_gradients, rResult );
noalias(DN) = prod(X,shape_functions_gradients);
noalias(J) = prod(trans(DN),DN);
Vector res = prod(trans(DN),CurrentGlobalCoords);
//deteminant of Jacobian
double det_j = J( 0, 0 ) * J( 1, 1 ) - J( 0, 1 ) * J( 1, 0 );
//filling matrix
invJ( 0, 0 ) = ( J( 1, 1 ) ) / ( det_j );
invJ( 1, 0 ) = -( J( 1, 0 ) ) / ( det_j );
invJ( 0, 1 ) = -( J( 0, 1 ) ) / ( det_j );
invJ( 1, 1 ) = ( J( 0, 0 ) ) / ( det_j );
DeltaXi( 0 ) = invJ( 0, 0 ) * res[0] + invJ( 0, 1 ) * res[1];
DeltaXi( 1 ) = invJ( 1, 0 ) * res[0] + invJ( 1, 1 ) * res[1];
rResult[0] += DeltaXi[0];
rResult[1] += DeltaXi[1];
rResult[2] = 0.0;
if ( k>0 && norm_2( DeltaXi ) > 30 )
{
KRATOS_THROW_ERROR(std::logic_error,"computation of local coordinates failed at iteration",k)
}
if ( norm_2( DeltaXi ) < tol )
{
break;
}
}
return( rResult );
}
virtual CoordinatesArrayType& PointLocalCoordinates( CoordinatesArrayType& rResult,
const CoordinatesArrayType& rPoint, Matrix& DeltaPosition )
{
boost::numeric::ublas::bounded_matrix<double,3,3> X;
boost::numeric::ublas::bounded_matrix<double,3,2> DN;
for(unsigned int i=0; i<this->size();i++)
{
X(0,i ) = this->GetPoint( i ).X() - DeltaPosition( i, 0 );
X(1,i ) = this->GetPoint( i ).Y() - DeltaPosition( i, 1 );
X(2,i ) = this->GetPoint( i ).Z() - DeltaPosition( i, 2 );
}
double tol = 1.0e-8;
int maxiter = 1000;
Matrix J = ZeroMatrix( 2, 2 );
Matrix invJ = ZeroMatrix( 2, 2 );
//starting with xi = 0
rResult = ZeroVector( 3 );
Vector DeltaXi = ZeroVector( 2 );
array_1d<double,3> CurrentGlobalCoords;
//Newton iteration:
for ( int k = 0; k < maxiter; k++ )
{
noalias(CurrentGlobalCoords) = ZeroVector( 3 );
this->GlobalCoordinates( CurrentGlobalCoords, rResult, DeltaPosition );
noalias( CurrentGlobalCoords ) = rPoint - CurrentGlobalCoords;
//derivatives of shape functions
Matrix shape_functions_gradients;
shape_functions_gradients = ShapeFunctionsLocalGradients(shape_functions_gradients, rResult );
noalias(DN) = prod(X,shape_functions_gradients);
noalias(J) = prod(trans(DN),DN);
Vector res = prod(trans(DN),CurrentGlobalCoords);
//deteminant of Jacobian
double det_j = J( 0, 0 ) * J( 1, 1 ) - J( 0, 1 ) * J( 1, 0 );
//filling matrix
invJ( 0, 0 ) = ( J( 1, 1 ) ) / ( det_j );
invJ( 1, 0 ) = -( J( 1, 0 ) ) / ( det_j );
invJ( 0, 1 ) = -( J( 0, 1 ) ) / ( det_j );
invJ( 1, 1 ) = ( J( 0, 0 ) ) / ( det_j );
DeltaXi( 0 ) = invJ( 0, 0 ) * res[0] + invJ( 0, 1 ) * res[1];
DeltaXi( 1 ) = invJ( 1, 0 ) * res[0] + invJ( 1, 1 ) * res[1];
rResult[0] += DeltaXi[0];
rResult[1] += DeltaXi[1];
rResult[2] = 0.0;
if ( k>0 && norm_2( DeltaXi ) > 30 )
{
KRATOS_THROW_ERROR(std::logic_error,"computation of local coordinates failed at iteration",k)
}
if ( norm_2( DeltaXi ) < tol )
{
break;
}
}
return( rResult );
}
///@}
///@name Jacobian
///@{
/**
* TODO: implemented but not yet tested
*/
/**
* Jacobians for given method.
* This method calculates jacobians matrices in all
* integrations points of given integration method.
*
* @param ThisMethod integration method which jacobians has to
* be calculated in its integration points.
*
* @return JacobiansType a Vector of jacobian
* matrices \f$ J_i \f$ where \f$ i=1,2,...,n \f$ is the integration
* point index of given integration method.
*
* @see DeterminantOfJacobian
* @see InverseOfJacobian
*/
virtual JacobiansType& Jacobian( JacobiansType& rResult, IntegrationMethod ThisMethod ) const
{
ShapeFunctionsGradientsType shape_functions_gradients =
CalculateShapeFunctionsIntegrationPointsLocalGradients( ThisMethod );
//getting values of shape functions
Matrix shape_functions_values =
CalculateShapeFunctionsIntegrationPointsValues( ThisMethod );
//workaround by riccardo...
if ( rResult.size() != this->IntegrationPointsNumber( ThisMethod ) )
{
// KLUDGE: While there is a bug in ublas
// vector resize, I have to put this beside resizing!!
JacobiansType temp( this->IntegrationPointsNumber( ThisMethod ) );
rResult.swap( temp );
}
//loop over all integration points
for ( unsigned int pnt = 0; pnt < this->IntegrationPointsNumber( ThisMethod ); pnt++ )
{
//defining single jacobian matrix
Matrix jacobian = ZeroMatrix( 3, 2 );
//loop over all nodes
for ( unsigned int i = 0; i < this->PointsNumber(); i++ )
{
jacobian( 0, 0 ) += ( this->GetPoint( i ).X() ) * ( shape_functions_gradients[pnt]( i, 0 ) );
jacobian( 0, 1 ) += ( this->GetPoint( i ).X() ) * ( shape_functions_gradients[pnt]( i, 1 ) );
jacobian( 1, 0 ) += ( this->GetPoint( i ).Y() ) * ( shape_functions_gradients[pnt]( i, 0 ) );
jacobian( 1, 1 ) += ( this->GetPoint( i ).Y() ) * ( shape_functions_gradients[pnt]( i, 1 ) );
jacobian( 2, 0 ) += ( this->GetPoint( i ).Z() ) * ( shape_functions_gradients[pnt]( i, 0 ) );
jacobian( 2, 1 ) += ( this->GetPoint( i ).Z() ) * ( shape_functions_gradients[pnt]( i, 1 ) );
}
rResult[pnt] = jacobian;
}//end of loop over all integration points
return rResult;
}
/**
* Jacobians for given method.
* This method calculates jacobians matrices in all
* integrations points of given integration method.
*
* @param ThisMethod integration method which jacobians has to
* be calculated in its integration points.
*
* @return JacobiansType a Vector of jacobian
* matrices \f$ J_i \f$ where \f$ i=1,2,...,n \f$ is the integration
* point index of given integration method.
*
* @param DeltaPosition Matrix with the nodes position increment which describes
* the configuration where the jacobian has to be calculated.
*
* @see DeterminantOfJacobian
* @see InverseOfJacobian
*/
virtual JacobiansType& Jacobian( JacobiansType& rResult, IntegrationMethod ThisMethod, Matrix & DeltaPosition ) const
{
ShapeFunctionsGradientsType shape_functions_gradients =
CalculateShapeFunctionsIntegrationPointsLocalGradients( ThisMethod );
//getting values of shape functions
Matrix shape_functions_values =
CalculateShapeFunctionsIntegrationPointsValues( ThisMethod );
//workaround by riccardo...
if ( rResult.size() != this->IntegrationPointsNumber( ThisMethod ) )
{
// KLUDGE: While there is a bug in ublas
// vector resize, I have to put this beside resizing!!
JacobiansType temp( this->IntegrationPointsNumber( ThisMethod ) );
rResult.swap( temp );
}
//loop over all integration points
for ( unsigned int pnt = 0; pnt < this->IntegrationPointsNumber( ThisMethod ); pnt++ )
{
//defining single jacobian matrix
Matrix jacobian = ZeroMatrix( 3, 2 );
//loop over all nodes
for ( unsigned int i = 0; i < this->PointsNumber(); i++ )
{
jacobian( 0, 0 ) += ( this->GetPoint( i ).X() - DeltaPosition(i,0) ) * ( shape_functions_gradients[pnt]( i, 0 ) );
jacobian( 0, 1 ) += ( this->GetPoint( i ).X() - DeltaPosition(i,0) ) * ( shape_functions_gradients[pnt]( i, 1 ) );
jacobian( 1, 0 ) += ( this->GetPoint( i ).Y() - DeltaPosition(i,1) ) * ( shape_functions_gradients[pnt]( i, 0 ) );
jacobian( 1, 1 ) += ( this->GetPoint( i ).Y() - DeltaPosition(i,1) ) * ( shape_functions_gradients[pnt]( i, 1 ) );
jacobian( 2, 0 ) += ( this->GetPoint( i ).Z() - DeltaPosition(i,2) ) * ( shape_functions_gradients[pnt]( i, 0 ) );
jacobian( 2, 1 ) += ( this->GetPoint( i ).Z() - DeltaPosition(i,2) ) * ( shape_functions_gradients[pnt]( i, 1 ) );
}
rResult[pnt] = jacobian;
}//end of loop over all integration points
return rResult;
}
/* virtual JacobiansType& Jacobian( JacobiansType& rResult,
IntegrationMethod ThisMethod) const
{
//getting derivatives of shape functions
ShapeFunctionsGradientsType shape_functions_gradients =
CalculateShapeFunctionsIntegrationPointsLocalGradients(ThisMethod);
//getting values of shape functions
Matrix shape_functions_values =
CalculateShapeFunctionsIntegrationPointsValues(ThisMethod);
//workaround by riccardo...
if(rResult.size() != this->IntegrationPointsNumber(ThisMethod))
{
// KLUDGE: While there is a bug in ublas
// vector resize, I have to put this beside resizing!!
JacobiansType temp(this->IntegrationPointsNumber(ThisMethod));
rResult.swap(temp);
}
//loop over all integration points
for( int pnt=0; pnt < this->IntegrationPointsNumber(ThisMethod); pnt++ )
{
//defining single jacobian matrix
Matrix jacobian = ZeroMatrix(2,2);
//loop over all nodes
for( int i=0; i<this->PointsNumber(); i++ )
{
jacobian(0,0) +=
(this->GetPoint(i).X())*(shape_functions_gradients[pnt](i,0));
jacobian(0,1) +=
(this->GetPoint(i).Y())*(shape_functions_gradients[pnt](i,0));
jacobian(1,0) +=
(this->GetPoint(i).X())*(shape_functions_gradients[pnt](i,1));
jacobian(1,1) +=
(this->GetPoint(i).Y())*(shape_functions_gradients[pnt](i,1));
}
rResult[pnt] = jacobian;
}//end of loop over all integration points
return rResult;
}*/
/**
* TODO: implemented but not yet tested
*/
/**
* Jacobian in specific integration point of given integration
* method. This method calculate jacobian matrix in given
* integration point of given integration method.
*
* @param IntegrationPointIndex index of integration point which jacobians has to
* be calculated in it.
*
* @param ThisMethod integration method which jacobians has to
* be calculated in its integration points.
*
* @return Matrix<double> Jacobian matrix \f$ J_i \f$ where \f$
* i \f$ is the given integration point index of given
* integration method.
*
* @see DeterminantOfJacobian
* @see InverseOfJacobian
*/
virtual Matrix& Jacobian( Matrix& rResult, IndexType IntegrationPointIndex, IntegrationMethod ThisMethod ) const
{
//setting up size of jacobian matrix
rResult.resize( 3, 2 );
//derivatives of shape functions
const ShapeFunctionsGradientsType& shape_functions_gradients =
CalculateShapeFunctionsIntegrationPointsLocalGradients( ThisMethod );
const Matrix& ShapeFunctionsGradientInIntegrationPoint =
shape_functions_gradients( IntegrationPointIndex );
//Elements of jacobian matrix (e.g. J(1,1) = dX1/dXi1)
//loop over all nodes
for ( unsigned int i = 0; i < this->PointsNumber(); i++ )
{
rResult( 0, 0 ) += ( this->GetPoint( i ).X() ) * ( ShapeFunctionsGradientInIntegrationPoint( i, 0 ) );
rResult( 0, 1 ) += ( this->GetPoint( i ).X() ) * ( ShapeFunctionsGradientInIntegrationPoint( i, 1 ) );
rResult( 1, 0 ) += ( this->GetPoint( i ).Y() ) * ( ShapeFunctionsGradientInIntegrationPoint( i, 0 ) );
rResult( 1, 1 ) += ( this->GetPoint( i ).Y() ) * ( ShapeFunctionsGradientInIntegrationPoint( i, 1 ) );
rResult( 2, 0 ) += ( this->GetPoint( i ).Z() ) * ( ShapeFunctionsGradientInIntegrationPoint( i, 0 ) );
rResult( 2, 1 ) += ( this->GetPoint( i ).Z() ) * ( ShapeFunctionsGradientInIntegrationPoint( i, 1 ) );
}
return rResult;
}
/*virtual Matrix& Jacobian( Matrix& rResult,
IndexType IntegrationPointIndex,
IntegrationMethod ThisMethod) const
{
//setting up size of jacobian matrix
rResult.resize(2,2);
//derivatives of shape functions
ShapeFunctionsGradientsType shape_functions_gradients =
CalculateShapeFunctionsIntegrationPointsLocalGradients(ThisMethod);
Matrix ShapeFunctionsGradientInIntegrationPoint =
shape_functions_gradients(IntegrationPointIndex);
//values of shape functions in integration points
vector<double> ShapeFunctionValuesInIntegrationPoint = row(
CalculateShapeFunctionsIntegrationPointsValues(
ThisMethod ), IntegrationPointIndex);
//Elements of jacobian matrix (e.g. J(1,1) = dX1/dXi1)
//loop over all nodes
for( int i=0; i<this->PointsNumber(); i++ )
{
rResult(0,0) +=
(this->GetPoint(i).X())*(ShapeFunctionsGradientInIntegrationPoint(i,0));
rResult(0,1) +=
(this->GetPoint(i).Y())*(ShapeFunctionsGradientInIntegrationPoint(i,0));
rResult(1,0) +=
(this->GetPoint(i).X())*(ShapeFunctionsGradientInIntegrationPoint(i,1));
rResult(1,1) +=
(this->GetPoint(i).Y())*(ShapeFunctionsGradientInIntegrationPoint(i,1));
}
return rResult;
}*/
/**
* TODO: implemented but not yet tested
*/
/**
* Jacobian in given point. This method calculate jacobian
* matrix in given point.
*
* @param rPoint point which jacobians has to
* be calculated in it.
*
* @return Matrix of double which is jacobian matrix \f$ J \f$ in given point.
*
* @see DeterminantOfJacobian
* @see InverseOfJacobian
*/
virtual Matrix& Jacobian( Matrix& rResult, const CoordinatesArrayType& rPoint ) const
{
//setting up size of jacobian matrix
rResult.resize( 3, 2 );
//derivatives of shape functions
Matrix shape_functions_gradients;
shape_functions_gradients = ShapeFunctionsLocalGradients(
shape_functions_gradients, rPoint );
//Elements of jacobian matrix (e.g. J(1,1) = dX1/dXi1)
//loop over all nodes
for ( unsigned int i = 0; i < this->PointsNumber(); i++ )
{
rResult( 0, 0 ) += ( this->GetPoint( i ).X() ) * ( shape_functions_gradients( i, 0 ) );
rResult( 0, 1 ) += ( this->GetPoint( i ).X() ) * ( shape_functions_gradients( i, 1 ) );
rResult( 1, 0 ) += ( this->GetPoint( i ).Y() ) * ( shape_functions_gradients( i, 0 ) );
rResult( 1, 1 ) += ( this->GetPoint( i ).Y() ) * ( shape_functions_gradients( i, 1 ) );
rResult( 2, 0 ) += ( this->GetPoint( i ).Z() ) * ( shape_functions_gradients( i, 0 ) );
rResult( 2, 1 ) += ( this->GetPoint( i ).Z() ) * ( shape_functions_gradients( i, 1 ) );
}
return rResult;
}
/**
* TODO: implemented but not yet tested
*/
/**
* Determinant of jacobians for given integration method.
* This method calculates determinant of jacobian in all
* integrations points of given integration method.
*
* @return Vector of double which is vector of determinants of
* jacobians \f$ |J|_i \f$ where \f$ i=1,2,...,n \f$ is the
* integration point index of given integration method.
*
* @see Jacobian
* @see InverseOfJacobian
*/
virtual Vector& DeterminantOfJacobian( Vector& rResult,
IntegrationMethod ThisMethod ) const
{
KRATOS_THROW_ERROR( std::logic_error, "Triangle3D6::DeterminantOfJacobian", "Jacobian is not square" );
return rResult;
}
/**
* TODO: implemented but not yet tested
*/
/**
* Determinant of jacobian in specific integration point of
* given integration method. This method calculate determinant
* of jacobian in given integration point of given integration
* method.
*
* @param IntegrationPointIndex index of integration point which jacobians has to
* be calculated in it.
*
* @param IntegrationPointIndex index of integration point
* which determinant of jacobians has to be calculated in it.
*
* @return Determinamt of jacobian matrix \f$ |J|_i \f$ where \f$
* i \f$ is the given integration point index of given
* integration method.
*
* @see Jacobian
* @see InverseOfJacobian
*/
virtual double DeterminantOfJacobian( IndexType IntegrationPointIndex,
IntegrationMethod ThisMethod ) const
{
KRATOS_THROW_ERROR( std::logic_error, "Triangle3D6::DeterminantOfJacobian", "Jacobian is not square" );
return 0.0;
}
/**
* TODO: implemented but not yet tested
*/
/**
* Determinant of jacobian in given point.
* This method calculate determinant of jacobian
* matrix in given point.
* @param rPoint point which determinant of jacobians has to
* be calculated in it.
*
* @return Determinamt of jacobian matrix \f$ |J| \f$ in given
* point.
*
* @see DeterminantOfJacobian
* @see InverseOfJacobian
*
* KLUDGE: PointType needed for proper functionality
* KLUDGE: works only with explicitly generated Matrix object
*/
/**
* :TODO: needs to be changed to Point<3> again. As PointType can
* be a Node with unique ID or an IntegrationPoint or any arbitrary
* point in space this needs to be reviewed
* (comment by janosch)
*/
virtual double DeterminantOfJacobian( const CoordinatesArrayType& rPoint ) const
{
KRATOS_THROW_ERROR( std::logic_error, "Triangle3D6::DeterminantOfJacobian", "Jacobian is not square" );
return 0.0;
}
/**
* TODO: implemented but not yet tested
*/
/**
* Inverse of jacobians for given integration method.
* This method calculates inverse of jacobians matrices
* in all integrations points of
* given integration method.
*
* @param ThisMethod integration method which inverse of jacobians has to
* be calculated in its integration points.
*
* @return Inverse of jacobian
* matrices \f$ J^{-1}_i \f$ where \f$ i=1,2,...,n \f$ is the integration
* point index of given integration method.
*
* @see Jacobian
* @see DeterminantOfJacobian
*
* KLUDGE: works only with explicitly generated Matrix object
*/
virtual JacobiansType& InverseOfJacobian( JacobiansType& rResult,
IntegrationMethod ThisMethod ) const
{
KRATOS_THROW_ERROR( std::logic_error, "Triangle3D6::DeterminantOfJacobian", "Jacobian is not square" );
return rResult;
}
/**
* TODO: implemented but not yet tested
*/
/**
* Inverse of jacobian in specific integration point of given integration
* method. This method calculate Inverse of jacobian matrix in given
* integration point of given integration method.
*
* @param IntegrationPointIndex index of integration point
* which inverse of jacobians has to
* be calculated in it.
* @param ThisMethod integration method which inverse of jacobians has to
* be calculated in its integration points.
*
* @return Inverse of jacobian matrix \f$ J^{-1}_i \f$ where \f$
* i \f$ is the given integration point index of given
* integration method.
*
* @see Jacobian
* @see DeterminantOfJacobian
*
* KLUDGE: works only with explicitly generated Matrix object
*/
virtual Matrix& InverseOfJacobian( Matrix& rResult,
IndexType IntegrationPointIndex,
IntegrationMethod ThisMethod ) const
{
KRATOS_THROW_ERROR( std::logic_error, "Triangle3D6::DeterminantOfJacobian", "Jacobian is not square" );
return rResult;
}
/**
* TODO: implemented but not yet tested
*/
/**
* Inverse of jacobian in given point.
* This method calculates inverse of jacobian
* matrix in given point.
* @param rPoint point which inverse of jacobians has to
* be calculated in it.
* @return Inverse of jacobian matrix \f$ J^{-1} \f$ in given point.
*
* @see DeterminantOfJacobian
* @see InverseOfJacobian
*
* KLUDGE: works only with explicitly generated Matrix object
*/
virtual Matrix& InverseOfJacobian( Matrix& rResult,
const CoordinatesArrayType& rPoint ) const
{
KRATOS_THROW_ERROR( std::logic_error, "Triangle3D6::DeterminantOfJacobian", "Jacobian is not square" );
return rResult;
}
///@}
///@name Shape Function
///@{
/**
* TODO: implemented but not yet tested
*/
/**
* Calculates the value of a given shape function at a given point.
*
* @param ShapeFunctionIndex The number of the desired shape function
* @param rPoint the given point in local coordinates at which the value of the shape
* function is calculated
*
* @return the value of the shape function at the given point
*/
virtual double ShapeFunctionValue( IndexType ShapeFunctionIndex,
const CoordinatesArrayType& rPoint ) const
{
double thirdCoord = 1 - rPoint[0] - rPoint[1];
switch ( ShapeFunctionIndex )
{
case 0:
return( thirdCoord*( 2*thirdCoord - 1 ) );
case 1:
return( rPoint[0]*( 2*rPoint[0] - 1 ) );
case 2:
return( rPoint[1]*( 2*rPoint[1] - 1 ) );
case 3:
return( 4*thirdCoord*rPoint[0] );
case 4:
return( 4*rPoint[0]*rPoint[1] );
case 5:
return( 4*rPoint[1]*thirdCoord );
default:
KRATOS_THROW_ERROR( std::logic_error,
"Wrong index of shape function!" ,
*this );
}
return 0;
}
/**
* TODO: implemented but not yet tested
*/
/**
* Calculates the Gradients of the shape functions.
* Calculates the gradients of the shape functions with regard to
* the global coordinates in all
* integration points (\f$ \frac{\partial N^i}{\partial X_j} \f$)
*
* @param rResult a container which takes the calculated gradients
* @param ThisMethod the given IntegrationMethod
*
* @return the gradients of all shape functions with regard to the global coordinates
* KLUDGE: method call only works with explicit JacobiansType rather than creating
* JacobiansType within argument list
*/
virtual ShapeFunctionsGradientsType& ShapeFunctionsIntegrationPointsGradients(
ShapeFunctionsGradientsType& rResult,
IntegrationMethod ThisMethod ) const
{
const unsigned int integration_points_number =
msGeometryData.IntegrationPointsNumber( ThisMethod );
if ( integration_points_number == 0 )
KRATOS_THROW_ERROR( std::logic_error,
"This integration method is not supported" , *this );
//workaround by riccardo
if ( rResult.size() != integration_points_number )
{
// KLUDGE: While there is a bug in ublas
// vector resize, I have to put this beside resizing!!
ShapeFunctionsGradientsType temp( integration_points_number );
rResult.swap( temp );
}
//calculating the local gradients
ShapeFunctionsGradientsType locG =
CalculateShapeFunctionsIntegrationPointsLocalGradients( ThisMethod );
//getting the inverse jacobian matrices
JacobiansType temp( integration_points_number );
JacobiansType invJ = InverseOfJacobian( temp, ThisMethod );
//loop over all integration points
for ( unsigned int pnt = 0; pnt < integration_points_number; pnt++ )
{
rResult[pnt].resize( 6, 2 );
for ( int i = 0; i < 6; i++ )
{
for ( int j = 0; j < 2; j++ )
{
rResult[pnt]( i, j ) =
( locG[pnt]( i, 0 ) * invJ[pnt]( j, 0 ) )
+ ( locG[pnt]( i, 1 ) * invJ[pnt]( j, 1 ) );
}
}
}//end of loop over integration points
return rResult;
}
///@}
///@name Input and output
///@{
/**
* Turn back information as a string.
*
* @return String contains information about this geometry.
* @see PrintData()
* @see PrintInfo()
*/
virtual std::string Info() const
{
return "2 dimensional triangle with six nodes in 2D space";
}
/**
* Print information about this object.
* @param rOStream Stream to print into it.
* @see PrintData()
* @see Info()
*/
virtual void PrintInfo( std::ostream& rOStream ) const
{
rOStream << "2 dimensional triangle with six nodes in 2D space";
}
/**
* Print geometry's data into given stream.
* Prints it's points
* by the order they stored in the geometry and then center
* point of geometry.
*
* @param rOStream Stream to print into it.
* @see PrintInfo()
* @see Info()
*/
/**
* :TODO: needs to be reviewed because it is not properly implemented yet
* (comment by janosch)
*/
virtual void PrintData( std::ostream& rOStream ) const
{
PrintInfo( rOStream );
BaseType::PrintData( rOStream );
std::cout << std::endl;
Matrix jacobian;
Jacobian( jacobian, PointType() );
rOStream << " Jacobian in the origin\t : " << jacobian;
}
/** This method gives you number of all edges of this
geometry. This method will gives you number of all the edges
with one dimension less than this geometry. for example a
triangle would return three or a tetrahedral would return
four but won't return nine related to its six edge lines.
@return SizeType containes number of this geometry edges.
@see Edges()
@see Edge()
*/
virtual SizeType EdgesNumber() const
{
return 3;
}
/** This method gives you all edges of this geometry. This
method will gives you all the edges with one dimension less
than this geometry. for example a triangle would return
three lines as its edges or a tetrahedral would return four
triangle as its edges but won't return its six edge
lines by this method.
@return GeometriesArrayType containes this geometry edges.
@see EdgesNumber()
@see Edge()
*/
virtual GeometriesArrayType Edges( void )
{
GeometriesArrayType edges = GeometriesArrayType();
edges.push_back( EdgeType( this->pGetPoint( 0 ), this->pGetPoint( 3 ), this->pGetPoint( 1 ) ) );
edges.push_back( EdgeType( this->pGetPoint( 1 ), this->pGetPoint( 4 ), this->pGetPoint( 2 ) ) );
edges.push_back( EdgeType( this->pGetPoint( 2 ), this->pGetPoint( 5 ), this->pGetPoint( 0 ) ) );
return edges;
}
/**
* Calculates the local gradients for all integration points for
* given integration method
*/
virtual ShapeFunctionsGradientsType ShapeFunctionsLocalGradients(
IntegrationMethod ThisMethod )
{
ShapeFunctionsGradientsType localGradients
= CalculateShapeFunctionsIntegrationPointsLocalGradients( ThisMethod );
const int integration_points_number
= msGeometryData.IntegrationPointsNumber( ThisMethod );
ShapeFunctionsGradientsType Result( integration_points_number );
for ( int pnt = 0; pnt < integration_points_number; pnt++ )
{
Result[pnt] = localGradients[pnt];
}
return Result;
}
/**
* Calculates the local gradients for all integration points for the
* default integration method
*/
virtual ShapeFunctionsGradientsType ShapeFunctionsLocalGradients()
{
IntegrationMethod ThisMethod = msGeometryData.DefaultIntegrationMethod();
ShapeFunctionsGradientsType localGradients
= CalculateShapeFunctionsIntegrationPointsLocalGradients( ThisMethod );
const int integration_points_number
= msGeometryData.IntegrationPointsNumber( ThisMethod );
ShapeFunctionsGradientsType Result( integration_points_number );
for ( int pnt = 0; pnt < integration_points_number; pnt++ )
{
Result[pnt] = localGradients[pnt];
}
return Result;
}
/**
* Calculates the gradients in terms of local coordinates
* of all shape functions in a given point.
*
* @param rPoint the current point at which the gradients are calculated in local
* coordinates
* @return the gradients of all shape functions
* \f$ \frac{\partial N^i}{\partial \xi_j} \f$
*/
virtual Matrix& ShapeFunctionsLocalGradients( Matrix& rResult,
const CoordinatesArrayType& rPoint ) const
{
rResult.resize( 6, 2 );
double thirdCoord = 1 - rPoint[0] - rPoint[1];
double thirdCoord_DX = -1;
double thirdCoord_DY = -1;
noalias( rResult ) = ZeroMatrix( 6, 2 );
rResult( 0, 0 ) = ( 4 * thirdCoord - 1 ) * thirdCoord_DX;
rResult( 0, 1 ) = ( 4 * thirdCoord - 1 ) * thirdCoord_DY;
rResult( 1, 0 ) = 4 * rPoint[0] - 1;
rResult( 1, 1 ) = 0;
rResult( 2, 0 ) = 0;
rResult( 2, 1 ) = 4 * rPoint[1] - 1;
rResult( 3, 0 ) = 4 * thirdCoord_DX * rPoint[0] + 4 * thirdCoord;
rResult( 3, 1 ) = 4 * thirdCoord_DY * rPoint[0];
rResult( 4, 0 ) = 4 * rPoint[1];
rResult( 4, 1 ) = 4 * rPoint[0];
rResult( 5, 0 ) = 4 * rPoint[1] * thirdCoord_DX;
rResult( 5, 1 ) = 4 * rPoint[1] * thirdCoord_DY + 4 * thirdCoord;
return rResult;
}
/**
* returns the shape function gradients in an arbitrary point,
* given in local coordinates
*
* @param rResult the matrix of gradients,
* will be overwritten with the gradients for all
* shape functions in given point
* @param rPoint the given point the gradients are calculated in
*/
virtual Matrix& ShapeFunctionsGradients( Matrix& rResult, CoordinatesArrayType& rPoint )
{
rResult.resize( 6, 2 );
double thirdCoord = 1 - rPoint[0] - rPoint[1];
double thirdCoord_DX = -1;
double thirdCoord_DY = -1;
noalias( rResult ) = ZeroMatrix( 6, 2 );
rResult( 0, 0 ) = ( 4 * thirdCoord - 1 ) * thirdCoord_DX;
rResult( 0, 1 ) = ( 4 * thirdCoord - 1 ) * thirdCoord_DY;
rResult( 1, 0 ) = 4 * rPoint[0] - 1;
rResult( 1, 1 ) = 0;
rResult( 2, 0 ) = 0;
rResult( 2, 1 ) = 4 * rPoint[1] - 1;
rResult( 3, 0 ) = 4 * thirdCoord_DX * rPoint[0] + 4 * thirdCoord;
rResult( 3, 1 ) = 4 * thirdCoord_DY * rPoint[0];
rResult( 4, 0 ) = 4 * rPoint[1];
rResult( 4, 1 ) = 4 * rPoint[0];
rResult( 5, 0 ) = 4 * rPoint[1] * thirdCoord_DX;
rResult( 5, 1 ) = 4 * rPoint[1] * thirdCoord_DY + 4 * thirdCoord;
return rResult;
}
/**
* returns the second order derivatives of all shape functions
* in given arbitrary pointers
* @param rResult a third order tensor which contains the second derivatives
* @param rPoint the given point the second order derivatives are calculated in
*/
virtual ShapeFunctionsSecondDerivativesType& ShapeFunctionsSecondDerivatives( ShapeFunctionsSecondDerivativesType& rResult, const CoordinatesArrayType& rPoint ) const
{
if ( rResult.size() != this->PointsNumber() )
{
// KLUDGE: While there is a bug in
// ublas vector resize, I have to put this beside resizing!!
ShapeFunctionsGradientsType temp( this->PointsNumber() );
rResult.swap( temp );
}
rResult[0].resize( 2, 2 );
rResult[1].resize( 2, 2 );
rResult[2].resize( 2, 2 );
rResult[3].resize( 2, 2 );
rResult[4].resize( 2, 2 );
rResult[5].resize( 2, 2 );
rResult[0]( 0, 0 ) = 4.0;
rResult[0]( 0, 1 ) = 4.0;
rResult[0]( 1, 0 ) = 4.0;
rResult[0]( 1, 1 ) = 4.0;
rResult[1]( 0, 0 ) = 4.0;
rResult[1]( 0, 1 ) = 0.0;
rResult[1]( 1, 0 ) = 0.0;
rResult[1]( 1, 1 ) = 0.0;
rResult[2]( 0, 0 ) = 0.0;
rResult[2]( 0, 1 ) = 0.0;
rResult[2]( 1, 0 ) = 0.0;
rResult[2]( 1, 1 ) = 4.0;
rResult[3]( 0, 0 ) = -8.0;
rResult[3]( 0, 1 ) = -4.0;
rResult[3]( 1, 0 ) = -4.0;
rResult[3]( 1, 1 ) = 0.0;
rResult[4]( 0, 0 ) = 0.0;
rResult[4]( 0, 1 ) = 4.0;
rResult[4]( 1, 0 ) = 4.0;
rResult[4]( 1, 1 ) = 0.0;
rResult[5]( 0, 0 ) = 0.0;
rResult[5]( 0, 1 ) = -4.0;
rResult[5]( 1, 0 ) = -4.0;
rResult[5]( 1, 1 ) = -8.0;
return rResult;
}
/**
* returns the third order derivatives of all shape functions
* in given arbitrary pointers
* @param rResult a fourth order tensor which contains the third derivatives
* @param rPoint the given point the third order derivatives are calculated in
*/
virtual ShapeFunctionsThirdDerivativesType& ShapeFunctionsThirdDerivatives( ShapeFunctionsThirdDerivativesType& rResult, const CoordinatesArrayType& rPoint ) const
{
if ( rResult.size() != this->PointsNumber() )
{
rResult.resize( this->PointsNumber() );
}
for ( IndexType i = 0; i < rResult.size(); i++ )
{
rResult[i].resize( this->PointsNumber() );
}
rResult[0][0].resize( 2, 2 );
rResult[0][1].resize( 2, 2 );
rResult[1][0].resize( 2, 2 );
rResult[1][1].resize( 2, 2 );
rResult[2][0].resize( 2, 2 );
rResult[2][1].resize( 2, 2 );
rResult[3][0].resize( 2, 2 );
rResult[3][1].resize( 2, 2 );
rResult[4][0].resize( 2, 2 );
rResult[4][1].resize( 2, 2 );
rResult[5][0].resize( 2, 2 );
rResult[5][1].resize( 2, 2 );
for ( int i = 0; i < 6; i++ )
{
rResult[i][0]( 0, 0 ) = 0.0;
rResult[i][0]( 0, 1 ) = 0.0;
rResult[i][0]( 1, 0 ) = 0.0;
rResult[i][0]( 1, 1 ) = 0.0;
rResult[i][1]( 0, 0 ) = 0.0;
rResult[i][1]( 0, 1 ) = 0.0;
rResult[i][1]( 1, 0 ) = 0.0;
rResult[i][1]( 1, 1 ) = 0.0;
}
return rResult;
}
///@}
///@name Friends
///@{
///@}
protected:
/**
* There are no protected members in class Triangle3D6
*/
private:
///@name Static Member Variables
///@{
static const GeometryData msGeometryData;
///@}
///@name Serialization
///@{
friend class Serializer;
virtual void save( Serializer& rSerializer ) const
{
KRATOS_SERIALIZE_SAVE_BASE_CLASS( rSerializer, PointsArrayType );
}
virtual void load( Serializer& rSerializer )
{
KRATOS_SERIALIZE_LOAD_BASE_CLASS( rSerializer, PointsArrayType );
}
Triangle3D6(): BaseType( PointsArrayType(), &msGeometryData ) {}
///@}
///@name Member Variables
///@{
///@}
///@name Private Operators
///@{
///@}
///@name Private Operations
///@{
/**
* TODO: implemented but not yet tested
*/
/**
* Calculates the values of all shape function in all integration points.
* Integration points are expected to be given in local coordinates
* @param ThisMethod the current integration method
* @return the matrix of values of every shape function in each integration point
* :KLUDGE: number of points is hard-coded -> be careful if you want to copy and paste!
*/
static Matrix CalculateShapeFunctionsIntegrationPointsValues(
typename BaseType::IntegrationMethod ThisMethod )
{
IntegrationPointsContainerType all_integration_points =
AllIntegrationPoints();
IntegrationPointsArrayType integration_points =
all_integration_points[ThisMethod];
//number of integration points
const int integration_points_number = integration_points.size();
//number of nodes in current geometry
const int points_number = 6;
//setting up return matrix
Matrix shape_function_values( integration_points_number, points_number );
//loop over all integration points
for ( int pnt = 0; pnt < integration_points_number; pnt++ )
{
double thirdCoord = 1 - integration_points[pnt].X() - integration_points[pnt].Y();
shape_function_values( pnt, 0 ) = thirdCoord * ( 2 * thirdCoord - 1 ) ;
shape_function_values( pnt, 1 ) = integration_points[pnt].X() * ( 2 * integration_points[pnt].X() - 1 ) ;
shape_function_values( pnt, 2 ) = integration_points[pnt].Y() * ( 2 * integration_points[pnt].Y() - 1 ) ;
shape_function_values( pnt, 3 ) = 4 * thirdCoord * integration_points[pnt].X();
shape_function_values( pnt, 4 ) = 4 * integration_points[pnt].X() * integration_points[pnt].Y();
shape_function_values( pnt, 5 ) = 4 * integration_points[pnt].Y() * thirdCoord;
}
return shape_function_values;
}
/**
* TODO: implemented but not yet tested
*/
/**
* Calculates the local gradients of all shape functions
* in all integration points.
* Integration points are expected to be given in local coordinates
*
* @param ThisMethod the current integration method
* @return the vector of the gradients of all shape functions
* in each integration point
*/
static ShapeFunctionsGradientsType
CalculateShapeFunctionsIntegrationPointsLocalGradients(
typename BaseType::IntegrationMethod ThisMethod )
{
IntegrationPointsContainerType all_integration_points =
AllIntegrationPoints();
IntegrationPointsArrayType integration_points =
all_integration_points[ThisMethod];
//number of integration points
const int integration_points_number = integration_points.size();
ShapeFunctionsGradientsType d_shape_f_values( integration_points_number );
//initialising container
//std::fill(d_shape_f_values.begin(), d_shape_f_values.end(), Matrix(4,2));
//loop over all integration points
for ( int pnt = 0; pnt < integration_points_number; pnt++ )
{
Matrix result( 6, 2 );
double thirdCoord = 1 - integration_points[pnt].X() - integration_points[pnt].Y();
double thirdCoord_DX = -1;
double thirdCoord_DY = -1;
noalias( result ) = ZeroMatrix( 6, 2 );
result( 0, 0 ) = ( 4 * thirdCoord - 1 ) * thirdCoord_DX;
result( 0, 1 ) = ( 4 * thirdCoord - 1 ) * thirdCoord_DY;
result( 1, 0 ) = 4 * integration_points[pnt].X() - 1;
result( 1, 1 ) = 0;
result( 2, 0 ) = 0;
result( 2, 1 ) = 4 * integration_points[pnt].Y() - 1;
result( 3, 0 ) = 4 * thirdCoord_DX * integration_points[pnt].X() + 4 * thirdCoord;
result( 3, 1 ) = 4 * thirdCoord_DY * integration_points[pnt].X();
result( 4, 0 ) = 4 * integration_points[pnt].Y();
result( 4, 1 ) = 4 * integration_points[pnt].X();
result( 5, 0 ) = 4 * integration_points[pnt].Y() * thirdCoord_DX;
result( 5, 1 ) = 4 * integration_points[pnt].Y() * thirdCoord_DY + 4 * thirdCoord;
d_shape_f_values[pnt] = result;
}
return d_shape_f_values;
}
/**
* TODO: testing
*/
static const IntegrationPointsContainerType AllIntegrationPoints()
{
IntegrationPointsContainerType integration_points =
{
{
Quadrature<TriangleGaussLegendreIntegrationPoints1, 2, IntegrationPoint<3> >::GenerateIntegrationPoints(),
Quadrature<TriangleGaussLegendreIntegrationPoints2, 2, IntegrationPoint<3> >::GenerateIntegrationPoints(),
Quadrature<TriangleGaussLegendreIntegrationPoints3, 2, IntegrationPoint<3> >::GenerateIntegrationPoints()
}
};
return integration_points;
}
/**
* TODO: testing
*/
static const ShapeFunctionsValuesContainerType AllShapeFunctionsValues()
{
ShapeFunctionsValuesContainerType shape_functions_values =
{
{
Triangle3D6<TPointType>::CalculateShapeFunctionsIntegrationPointsValues(
GeometryData::GI_GAUSS_1 ),
Triangle3D6<TPointType>::CalculateShapeFunctionsIntegrationPointsValues(
GeometryData::GI_GAUSS_2 ),
Triangle3D6<TPointType>::CalculateShapeFunctionsIntegrationPointsValues(
GeometryData::GI_GAUSS_3 )
}
};
return shape_functions_values;
}
/**
* TODO: testing
*/
static const ShapeFunctionsLocalGradientsContainerType
AllShapeFunctionsLocalGradients()
{
ShapeFunctionsLocalGradientsContainerType shape_functions_local_gradients =
{
{
Triangle3D6<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::GI_GAUSS_1 ),
Triangle3D6<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::GI_GAUSS_2 ),
Triangle3D6<TPointType>::CalculateShapeFunctionsIntegrationPointsLocalGradients( GeometryData::GI_GAUSS_3 )
}
};
return shape_functions_local_gradients;
}
///@}
///@name Private Access
///@{
///@}
///@name Private Inquiry
///@{
///@}
///@name Private Friends
///@{
template<class TOtherPointType> friend class Triangle3D6;
///@}
///@name Un accessible methods
///@{
///@}
}; // Class Geometry
///@}
///@name Type Definitions
///@{
///@}
///@name Input and output
///@{
/**
* input stream functions
*/
template<class TPointType> inline std::istream& operator >> (
std::istream& rIStream,
Triangle3D6<TPointType>& rThis );
/**
* output stream functions
*/
template<class TPointType> inline std::ostream& operator << (
std::ostream& rOStream,
const Triangle3D6<TPointType>& rThis )
{
rThis.PrintInfo( rOStream );
rOStream << std::endl;
rThis.PrintData( rOStream );
return rOStream;
}
///@}
template<class TPointType> const
GeometryData Triangle3D6<TPointType>::msGeometryData(
2, 3, 2,
GeometryData::GI_GAUSS_2,
Triangle3D6<TPointType>::AllIntegrationPoints(),
Triangle3D6<TPointType>::AllShapeFunctionsValues(),
AllShapeFunctionsLocalGradients()
);
}// namespace Kratos.
#endif // KRATOS_TRIANGLE_3D_6_H_INCLUDED defined
| [
"hgbk2008@gmail.com"
] | hgbk2008@gmail.com |
e865e9c419b10abfbd6e6f8265ba7c6f7e80a642 | 28cfde0aa9fec3023e9bcc6abf3f9ddc2b4a33a4 | /chomiki oi17 100pkt.cpp | d7b1acda07cf2fa72131341ad66b5c4c1d93897d | [] | no_license | wziel/Wzielin3.Private.OlimpiadaInformatyczna | 79f6a91158bd4a5f0c55a2af271d12b223f565c6 | 91dd5754ee6b85d76e306508e674609b059692ee | refs/heads/master | 2016-09-06T19:38:00.944316 | 2015-07-05T15:32:57 | 2015-07-05T15:32:57 | 38,573,945 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,709 | cpp | #include<iostream>
#include<string.h>
#include<stack>
using namespace std;
int n,m,kmptab[100000];
string s[200];
long long int KIJ[30][200][200],wynik[2][200][200];
int KMP(string slowo,string nakladka)
{
string s=nakladka+'#'+slowo+'*';
kmptab[0]=0;
int i,a;
for(i=1; s[i]!='*'; i++)
{
a=kmptab[i-1];
while(s[i]!=s[a] && a>0) a=kmptab[a-1];
if(s[i]==s[a]) kmptab[i]=a+1;
else kmptab[i]=0;
}
a=0;
while(s[a]!='#')a++;
if(a==kmptab[i-1])return a;
return a-kmptab[i-1];
}
int main()
{
ios_base::sync_with_stdio(0);
cin>>n>>m; m--;
stack<int>st; //
long long int a=1073741824; //
while(m<a)a=a/2; //
while(a>0) //licze binarnie m
{ //zeby wiedziec potem
if(a>m) st.push(0); //jakie tablice dodawac
else { st.push(1); m-=a; } //
a=a/2; //
} //
for(int i=0;i<n;i++) cin>>s[i];
for(int i=0;i<n;i++)for(int j=0;j<n;j++)KIJ[0][i][j]=KMP(s[i],s[j]);
for(int r=1;r<st.size();r++)
{
for(int i=0;i<n;i++)for(int j=0;j<n;j++)KIJ[r][i][j]=KIJ[r-1][i][i]+KIJ[r-1][i][j]; //wypelniam zeby nie bylo puste i rowne 0
for(int k=0;k<n;k++)
{
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
KIJ[r][i][j]=min(KIJ[r][i][j],KIJ[r-1][i][k]+KIJ[r-1][k][j]);
}
}
}
}
int nr=0;
for(int p=0; !st.empty(); p++)
{
a=st.top(); st.pop();
if(a==0)continue;
nr++;
for(int i=0;i<n;i++)for(int j=0;j<n;j++)wynik[nr%2][i][j]=KIJ[p][i][i]+wynik[(nr+1)%2][i][j];
for(int k=0;k<n;k++)
{
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
wynik[nr%2][i][j]=min(wynik[nr%2][i][j],KIJ[p][i][k]+wynik[(nr+1)%2][k][j]);
}
}
}
}
nr=nr%2;
long long int minimum=KIJ[0][0][0]+wynik[nr][0][0];
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
minimum=min(minimum,KIJ[0][i][i]+wynik[nr][i][j]);
}
}
cout<<minimum;
return 0;
}
| [
"zielinski.w.t@gmail.com"
] | zielinski.w.t@gmail.com |
3a4731f6e74cd01363567af6b078bd71d6733782 | 2a10f352ee335c6b0dc3959be294f14db0584616 | /src/readrs.cpp | 5dbafc0b2e3d3bc0d519b304d65cf8240b392003 | [] | no_license | osinoyan/plys2sens | 3e2ce56db419997bff80df840e2edc7cca3ca48f | 43c1cdc9f4218da497d9abd092468b3294909bf2 | refs/heads/master | 2023-07-06T19:12:51.963212 | 2021-08-11T07:59:39 | 2021-08-11T07:59:39 | 347,884,764 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 9,358 | cpp | // ------------ CREATED AT 2021/07/21 BY LYWANG ---------------------
#include <omp.h>
#include "sensorData.h"
#include <dirent.h>
#include <string>
#include <vector>
#define _MSC_ ml::SensorData::CalibrationData
#define _MS_ ml::SensorData
#define PAUSE printf("Press Enter key to continue..."); fgetc(stdin);
using namespace std;
const int width = 450;
const int height = 350;
// const int width = 512;
// const int height = 384;
const double fx = 500;
const double fy = 500;
const double cx = 225;
const double cy = 175;
class CloudPoint {
public:
CloudPoint(){
x = 0;
y = 0;
z = 0;
a = 0;
}
CloudPoint(double x, double y, double z, double amp)
:x(x), y(y), z(z), a(amp){}
struct
{
double x, y, z;
double a; // amplitude
};
};
bool pointCompare(CloudPoint a, CloudPoint b);
void readPly(string inFile, vector<CloudPoint> &points);
void histogramEq(ml::vec3uc *colorMap);
void convertToRGBDFrame(ml::SensorData& sd, vector<CloudPoint> &points);
void convertPlyToSens(vector<string>& inFiles, string outFile, ml::SensorData& sd);
// MAIN ----------------------------------------------------
int main(int argc, char* argv[])
{
#ifdef WIN32
#if defined(DEBUG) | defined(_DEBUG)
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
#endif
#endif
try {
//non-cached read
std::string inPath = "scene_00.ply";
std::string outFile = "scene_00.sens";
if (argc >= 2) inPath = std::string(argv[1]);
else {
std::cout << "run ./readrs <path/to/plys>";
std::cout << "type in path manually: ";
std::cin >> inPath;
}
if (argc == 3) {
outFile = std::string(argv[2]);
}
if (inPath[inPath.size()-1] != '/') inPath += '/';
std::cout << "inPath =\t" << inPath << std::endl;
std::cout << "outFile =\t" << outFile << std::endl;
/////////////////////////////////////////////////////////////////////////
// Get all .ply files
DIR *dir;
struct dirent *ent;
vector<string> files;
if ((dir = opendir (inPath.c_str())) != NULL) {
/* print all the files and directories within directory */
while ((ent = readdir (dir)) != NULL) {
if(ent->d_name[0] != '.'){
string file_path = inPath + ent->d_name;
files.push_back(file_path);
}
}
closedir (dir);
} else {
/* could not open directory */
perror ("");
return EXIT_FAILURE;
}
// for(int i=0; i<files.size(); i++){
// string file = files[i];
// printf("%s\n", file.c_str());
// }
/////////////////////////////////////////////////////////////////////////
sort(files.begin(), files.end());
std::cout << "loading from files... \n";
ml::SensorData sd = ml::SensorData();
convertPlyToSens(files, outFile, sd);
//////////////////////////////////////////////////////////////////////
std::cout << "done!" << std::endl;
std::cout << sd << std::endl;
std::cout << std::endl;
}
catch (const std::exception& e)
{
#ifdef WIN32
MessageBoxA(NULL, e.what(), "Exception caught", MB_ICONERROR);
#else
std::cout << "Exception caught! " << e.what() << std::endl;
#endif
exit(EXIT_FAILURE);
}
catch (...)
{
#ifdef WIN32
MessageBoxA(NULL, "UNKNOWN EXCEPTION", "Exception caught", MB_ICONERROR);
#else
std::cout << "Exception caught! (unknown)";
#endif
exit(EXIT_FAILURE);
}
std::cout << "All done :)" << std::endl;
#ifdef WIN32
std::cout << "<press key to continue>" << std::endl;
getchar();
#endif
return 0;
}
// FUNCTIONS -----------------------------------------------
bool pointCompare(CloudPoint a, CloudPoint b){
if (a.x == b.x) return a.y < b.y;
return a.x < b.x;
}
void readPly(string inFile, vector<CloudPoint> &points){
ifstream ifs(inFile, ifstream::in);
while (ifs.good()){
string s;
ifs >> s;
if (s == "end_header") break;
}
// parsing payload
int counter = 0;
double fx = 500;
double fy = 500;
// double k1 = 0.000001;
while (ifs.good()) {
string s;
ifs >> s;
if (s == "") break;
double x, y, z, red;
if (counter == 0){
x = atof(s.c_str());
} else if (counter == 1){
y = atof(s.c_str());
} else if (counter == 2){
z = atof(s.c_str());
} else if (counter == 3){
if (x == 0 && y == 0 && z == 0){
// exclude the outlier
} else {
// amp = atof(s.c_str());
// points.push_back(CloudPoint(x, y, z, amp));
}
} else if (counter == 4){
if (x == 0 && y == 0 && z == 0){
// exclude the outlier
} else {
red = atof(s.c_str());
points.push_back(CloudPoint(x, y, z, red));
}
}
counter = (counter + 1) % 7;
}
sort(points.begin(), points.end(), pointCompare);
ifs.close();
}
void histogramEq(ml::vec3uc *colorMap){
const int MN = width*height;
int nk[255] = {0};
for (int i=0; i<MN; i++){
unsigned char color[3];
memcpy(&color, colorMap+i, sizeof(ml::vec3uc));
nk[color[0]]++;
}
int nk_acc[255] = {0};
nk_acc[0] = nk[0];
unsigned char target[255] = {0}; // 對照表
for (int i=1; i<255; i++){
nk_acc[i] = nk_acc[i-1] + nk[i];
double pk = (double)(nk_acc[i]) * 255/MN;
int pk_round = (int)(pk + 0.5);
target[i] = (unsigned char)pk_round;
// printf("%d\n", pk_round);
}
// printf("-----------------------\n");
// PAUSE
for (int i=0; i<MN; i++){
unsigned char color[3];
memcpy(&color, colorMap+i, sizeof(ml::vec3uc));
unsigned char n_color = target[color[0]];
color[0] = color[1] = color[2] = n_color;
memcpy(colorMap+i, &color, sizeof(ml::vec3uc));
}
// PAUSE
}
void convertToRGBDFrame(ml::SensorData& sd, vector<CloudPoint> &points){
// compressDepth(const unsigned short* depth, unsigned int width, unsigned int height, COMPRESSION_TYPE_DEPTH type)
// RGBDFrame& addFrame(const vec3uc* color, const unsigned short* depth, const mat4f& cameraToWorld = mat4f::identity(), UINT64 timeStampColor = 0, UINT64 timeStampDepth = 0)
vector<CloudPoint> projectedPoints; // project 3D points to a 2D plane
for (int i=0; i<points.size(); i++){
CloudPoint tp = points[i];
double tx = tp.x;
double ty = tp.y;
double tz = tp.z;
// perspective
tx = tx*fx / tz;
ty = ty*fy / tz;
// for drawing png
tx = (tx + cx);
ty = (ty + cy);
// ty = height - (ty + cy);
// printf("(%lf, %lf, %lf, %lf)\n", tx, ty, tz, tp.a);
CloudPoint px = CloudPoint(tx, ty, tz, tp.a);
projectedPoints.push_back(px);
}
// nearest neighbor // unsigned short 0~65535
unsigned short *depthMap = new unsigned short [width*height];
ml::vec3uc *colorMap = new ml::vec3uc [width*height];
double gr = 2; // grid radius
// FIND POINTS NEAR THE CENTER OF EACH EACH PIXEL
vector<int> *neighborPointIds = new vector<int>[width*height];
for (int i=0; i<projectedPoints.size(); i++){
CloudPoint p = projectedPoints[i];
// which pixels are the neighbors of this point
int lower_x = floor(p.x - gr);
int upper_x = ceil(p.x + gr);
int lower_y = floor(p.y - gr);
int upper_y = ceil(p.y + gr);
for (int ix=lower_x; ix<=upper_x; ix++){
for (int iy=lower_y; iy<=upper_y; iy++){
if (ix < 0 || ix >= width || iy < 0 || iy >= height) continue;
neighborPointIds[iy*width + ix].push_back(i);
}
}
}
#pragma omp parallel for
for (int iw=0; iw<width; iw++){ // w=450
for (int ih=0; ih<height; ih++){ // h=350
// printf("[%d][%d]\n", iw, ih);
CloudPoint nearestPoint = CloudPoint();
double maxSqrDist = gr*gr*2 + 1; // out of a grid
vector<int> candiPointIds = neighborPointIds[ih*width + iw];
// neighor points of this pixel
for (auto& pointId : candiPointIds){
CloudPoint p = projectedPoints[pointId];
// whether the point in 2x2 grid
if (p.x > iw - gr && p.x < iw + gr &&
p.y > ih - gr && p.y < ih + gr){
// printf("\t(%.3lf, %.3lf)\n", p.x, p.y);
double sqrDistToCenter =
(p.x-iw)*(p.x-iw) + (p.y-ih)*(p.y-ih) ;
if (sqrDistToCenter < maxSqrDist){
maxSqrDist = sqrDistToCenter;
nearestPoint = p;
}
}
}
if(maxSqrDist == gr*gr*2 + 1){
// POINT NOT FOUND
depthMap[ih*width + iw] = 65535;
unsigned char zeroColor[3] = {0, 0, 0};
ml::vec3uc *pc = (ml::vec3uc*)std::malloc(sizeof(ml::vec3uc));
memcpy(pc, &zeroColor, sizeof(ml::vec3uc));
colorMap[ih*width + iw] = *pc;
} else {
depthMap[ih*width + iw] = (unsigned short)(nearestPoint.z * 1000);
double a = nearestPoint.a;
int i_a = (int)a;
i_a = (i_a > 255) ? 225 : i_a;
i_a = (i_a < 0) ? 0 : i_a;
unsigned char ass = (unsigned char)(i_a);
unsigned char assColor[3] = {ass, ass, ass};
ml::vec3uc pc;
memcpy(&pc, &assColor, sizeof(ml::vec3uc));
colorMap[ih*width + iw] = pc;
}
}
}
histogramEq(colorMap);
sd.addFrame(colorMap, depthMap);
delete [] colorMap, depthMap;
}
void convertPlyToSens(vector<string>& inFiles, string outFile, ml::SensorData& sd){
unsigned int colorWidth = width;
unsigned int colorHeight = height;
unsigned int depthWidth = width;
unsigned int depthHeight = height;
const _MSC_ calibrationColor;
const _MSC_ calibrationDepth;
sd.initDefault(
colorWidth, colorHeight, depthWidth, depthHeight,
calibrationColor, calibrationDepth
);
for(int i=0; i<inFiles.size(); i++){
string file = inFiles[i];
printf("\rConverting [%s] ... [%d/%d]", file.c_str(), i, (int)(inFiles.size())-1);
fflush(stdout);
vector<CloudPoint> points;
readPly(file, points);
convertToRGBDFrame(sd, points);
}
printf("\n");
sd.saveToFile(outFile);
}
| [
"chopsticks1515@gmail.com"
] | chopsticks1515@gmail.com |
5335b8f76ffce9ffd366bf4ef82f355165ab8cf5 | 58487e81ace0cbe57228024c0c651d23061e705b | /Bullet.cpp | 2cd9989aa48c406ff49aca0771dd376a0de55ecf | [] | no_license | thanhchungbtc/BattleCity1990CPP | 70b3ec647f29c2c94da9308858337e2563bc5b87 | bdd393acf1689e1203fc8243da4dc5884968b005 | refs/heads/master | 2021-01-10T03:00:21.975006 | 2015-11-24T09:59:00 | 2015-11-24T09:59:00 | 46,782,160 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,453 | cpp | #include "Bullet.h"
#include "SDL.h"
#include "Collision.h"
#include "Game.h"
#include "SoundManager.h"
Bullet::Bullet(ShooterObject* owner):
ShooterObject()
{
m_owner = owner;
pLevel = owner->getLevel();
m_width = 11;
m_height = 11;
m_currentFrame = 0;
m_currentRow = 0;
m_textureID = "bullet1";
m_moveSpeed = owner->getBulletSpeed();
m_direction = owner->getDirection();
m_health = 1;
m_dyingTime = 1;
m_dyingCounter = 0;
// determine appear position of bullet
if (m_direction == UP)
{
m_velocity.setY(-m_moveSpeed);
m_position.setY(owner->getPosition().getY());
m_position.setX(owner->getPosition().getX() + (owner->getWidth()-m_width)/2);
}
else if(m_direction == RIGHT)
{
m_velocity.setX(m_moveSpeed);
m_position.setY(owner->getPosition().getY() + (owner->getHeight() - m_height)/2);
m_position.setX(owner->getPosition().getX() + owner->getWidth());
}
else if(m_direction == DOWN)
{
m_velocity.setY(m_moveSpeed);
m_position.setY(owner->getPosition().getY() + owner->getHeight());
m_position.setX(owner->getPosition().getX() + (owner->getWidth() - m_width)/2);
}
else if(m_direction == LEFT)
{
m_velocity.setX(-m_moveSpeed);
m_position.setY(owner->getPosition().getY() + (owner->getHeight() - m_height)/2);
m_position.setX(owner->getPosition().getX());
}
}
void Bullet::update()
{
checkBulletsObjectsCollision();
checkMapCollision();
if (!m_bDying)
{
move();
}
else
{
doDyingAnimation();
}
}
void Bullet::draw()
{
ShooterObject::draw();
}
void Bullet::collision()
{
m_health--;
if (m_health == 0)
{
m_textureID = "smallexplosion";
m_width = 11;
m_height = 11;
m_numFrames = 4;
m_currentRow = 0;
m_bDying = true;
}
}
void Bullet::move()
{
checkMovePosible();
if (m_canMove)
{
m_position += m_velocity;
}
else
{
collision();
}
}
void Bullet::shot()
{
// do nothing
}
void Bullet::doDyingAnimation()
{
// explosion frame
m_currentFrame = int(((SDL_GetTicks() / (1000/ 10)) % m_numFrames));
// m_currentFrame = int(((SDL_GetTicks() / (1000/ 10)) % 9));
if (m_dyingCounter == m_dyingTime) // dying finished
{
m_bDying = false;
m_bDead = true;
}
m_dyingCounter++;
}
void Bullet::checkMapCollision()
{
std::vector<std::vector<int>>* tilesIDs = pLevel->getTileIDs();
Vector2D newPosition = m_position + m_velocity;
SDL_Rect rect1;
rect1.x = newPosition.getX();
rect1.y = newPosition.getY();
rect1.w = m_width;
rect1.h = m_height;
if (rect1.x < 0){rect1.x = 0;}
if (rect1.y < 0){rect1.y = 0;}
if (rect1.x + rect1.w >= Game::Instance()->getGameWidth()){rect1.x = Game::Instance()->getGameWidth() - rect1.w -1;}
if (rect1.y + rect1.h >= Game::Instance()->getGameHeight()){rect1.y = Game::Instance()->getGameHeight() - rect1.h -1;}
// get tile id at rect1's area
if (m_direction == UP)
{
int r, c1, c2;
r = (rect1.y)/16;
c1 = (rect1.x)/16;
c2 = (rect1.x + rect1.w - 1)/16;
for (int i = c1; i<=c2; ++i)
{
// no collidable tile
if ((*tilesIDs)[r][i] == 0 ||(*tilesIDs)[r][i] == 10 || (*tilesIDs)[r][i] == 11 || (*tilesIDs)[r][i] == 13 || (*tilesIDs)[r][i] == 14 ||(*tilesIDs)[r][i] == 15||(*tilesIDs)[r][i] == 9)
{
continue;
}
if ((*tilesIDs)[r][i] != 0)
{
m_position.setY((r+1)*16 );
m_canMove = false;
if (!m_bDying)
{
killTileMap(UP, &(*tilesIDs)[r][i]);
}
}
}
}
else if (m_direction == RIGHT)
{
int c, r1, r2;
c = (rect1.x)/16;
r1 = rect1.y/16;
r2 = (rect1.y + rect1.h - 1)/16;
for (int i = r1; i <= r2; ++i)
{
// no collidable tile
if ((*tilesIDs)[i][c] == 0 ||(*tilesIDs)[i][c] == 10 || (*tilesIDs)[i][c] == 11 || (*tilesIDs)[i][c] == 14 ||(*tilesIDs)[i][c] == 15||(*tilesIDs)[i][c] == 13||(*tilesIDs)[i][c] == 9)
{
continue;
}
if ((*tilesIDs)[i][c] != 0)
{
m_position.setX((c)*16 - m_width);
m_canMove = false;
if (!m_bDying)
{
killTileMap(RIGHT, &(*tilesIDs)[i][c]);
}
}
}
}
else if (m_direction == DOWN)
{
int r, c1, c2;
r = (rect1.y)/16;
c1 = (rect1.x)/16;
c2 = (rect1.x + rect1.w - 1)/16;
for (int i = c1; i<=c2; ++i)
{
// no collidable tile
if ((*tilesIDs)[r][i] == 0 ||(*tilesIDs)[r][i] == 10 || (*tilesIDs)[r][i] == 11 || (*tilesIDs)[r][i] == 14 ||(*tilesIDs)[r][i] == 15||(*tilesIDs)[r][i] == 13||(*tilesIDs)[r][i] == 9)
{
continue;
}
if ((*tilesIDs)[r][i] != 0)
{
m_position.setY((r)*16 - m_height);
m_canMove = false;
if (!m_bDying)
{
killTileMap(DOWN, &(*tilesIDs)[r][i]);
}
}
}
}
else if (m_direction == LEFT)
{
int c, r1, r2;
c = (rect1.x)/16;
r1 = rect1.y/16;
r2 = (rect1.y + rect1.h - 1)/16;
for (int i = r1; i <= r2; ++i)
{
// no collidable tile
if ((*tilesIDs)[i][c] == 0 ||(*tilesIDs)[i][c] == 10 || (*tilesIDs)[i][c] == 11 || (*tilesIDs)[i][c] == 14 ||(*tilesIDs)[i][c] == 15 ||(*tilesIDs)[i][c] == 13||(*tilesIDs)[i][c] == 9)
{
continue;
}
if ((*tilesIDs)[i][c] != 0)
{
m_position.setX((c + 1)*16);
m_canMove = false;
if (!m_bDying)
{
killTileMap(LEFT, &(*tilesIDs)[i][c]);
}
}
}
}
if (!m_canMove)
{
collision();
}
}
void Bullet::killTileMap(Direction direction, int *tileID)
{
switch(*tileID)
{
case 1: // brick
if (type()=="PlayerBullet")
{
SoundManager::Instance()->playSound("brickhit", 0);
}
switch(direction)
{
case UP:
(*tileID) = 6;
break;
case RIGHT:
*tileID = 7;
break;
case DOWN:
*tileID = 2;
break;
case LEFT:
*tileID = 3;
break;
}
break;
case 5: // stone
if (type()=="PlayerBullet")
{
SoundManager::Instance()->playSound("steelhit", 0);
}
break;
case 10: // glass
break;
default:
*tileID = 0;
break;
}
}
void PlayerBullet::checkBulletsObjectsCollision()
{
if (m_bDying)
{
return;
}
SDL_Rect rect1;
rect1.x = m_position.getX();
rect1.y = m_position.getY();
rect1.w = m_width;
rect1.h = m_height;
for (int j = 0; j<pLevel->getShooterObjects()->size(); ++j)
{
ShooterObject* pObject = (*pLevel->getShooterObjects())[j];
if (pObject->type() == std::string("Player") || pObject->dying() || pObject->appearing())
{
continue;
}
SDL_Rect rect2;
rect2.x = pObject->getPosition().getX();
rect2.y = pObject->getPosition().getY();
rect2.w = pObject->getWidth();
rect2.h = pObject->getHeight();
// check collision with enemy bullet
if (!pObject->getBullets()->empty())
{
for (int k = 0; k<pObject->getBullets()->size(); ++k)
{
Bullet* pBullet = (*pObject->getBullets())[k];
// bug here
if (pBullet->dying())
{
continue;
}
SDL_Rect rectBullet;
rectBullet.x = pBullet->getPosition().getX();
rectBullet.y = pBullet->getPosition().getY();
rectBullet.w = pBullet->getWidth();
rectBullet.h = pBullet->getHeight();
if (RectRect(&rect1, &rectBullet))
{
collision();
pBullet->collision();
break;
}
}
}
// check collision with object
if (!m_bDying)
{
if (RectRect(&rect1, &rect2))
{
collision();
pObject->collision();
break;
}
}
}
}
void EnemyBullet::checkBulletsObjectsCollision()
{
if (m_bDying)
{
return;
}
SDL_Rect rect1;
rect1.x = m_position.getX();
rect1.y = m_position.getY();
rect1.w = m_width;
rect1.h = m_height;
for (int j = 0; j<pLevel->getPlayerObjects()->size(); ++j)
{
ShooterObject* pObject = (*pLevel->getPlayerObjects())[j];
if (pObject->dying() || pObject->appearing())
{
continue;
}
SDL_Rect rect2;
rect2.x = pObject->getPosition().getX();
rect2.y = pObject->getPosition().getY();
rect2.w = pObject->getWidth();
rect2.h = pObject->getHeight();
// check collision with player bullet
if (!pObject->getBullets()->empty())
{
for (int k = 0; k<pObject->getBullets()->size(); ++k)
{
Bullet* pBullet = (*pObject->getBullets())[k];
if (pBullet->dying())
{
continue;
}
SDL_Rect rectBullet;
rectBullet.x = pBullet->getPosition().getX();
rectBullet.y = pBullet->getPosition().getY();
rectBullet.w = pBullet->getWidth();
rectBullet.h = pBullet->getHeight();
if (RectRect(&rect1, &rectBullet))
{
collision();
pBullet->collision();
break;
}
}
}
// check collision with object
if (!m_bDying)
{
if (RectRect(&rect1, &rect2))
{
collision();
pObject->collision();
break;
}
}
}
} | [
"thanhchungbtc@gmail.com"
] | thanhchungbtc@gmail.com |
267f8d02e142a907a19b410fda379183b82a7f82 | 3ea34c23f90326359c3c64281680a7ee237ff0f2 | /Data/1320/E | 37c2da7c765f85a195ff2c156eb20d36430c2523 | [] | no_license | lcnbr/EM | c6b90c02ba08422809e94882917c87ae81b501a2 | aec19cb6e07e6659786e92db0ccbe4f3d0b6c317 | refs/heads/master | 2023-04-28T20:25:40.955518 | 2020-02-16T23:14:07 | 2020-02-16T23:14:07 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 80,899 | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 4.0 |
| \\ / A nd | Web: http://www.foam-extend.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "Data/1320";
object E;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField nonuniform List<vector>
4096
(
(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,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,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)
(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,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,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)
(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,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,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)
(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)
(-125174.407237592,66591.552981588,58582.8542560035)
(-132347.001564851,63828.3033237418,127101.552497113)
(-149042.313777518,58110.75931891,218033.106955721)
(-180663.100689472,49139.4468604958,349556.760784699)
(-237630.719510552,37030.2955670624,550157.184728195)
(-339807.165864946,23047.9700928912,866916.380500236)
(-524835.60485816,10314.9684196647,1381437.01693877)
(-859250.557574431,2489.79671933982,2238197.77779385)
(-1417319.12620969,-103.795428216555,3655620.69943181)
(-1974861.31885285,-270.746069976087,5630752.76435464)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-132369.312136069,143092.628356468,55868.2367611888)
(-139638.654027137,137885.819071761,121449.37504031)
(-156598.423734976,127004.235481007,209154.322613186)
(-188945.702415775,109680.628073435,337558.843816026)
(-247477.790715661,85708.784646757,536358.14545199)
(-352108.123628748,57098.8585728514,854415.380600784)
(-539182.359274422,30033.7264234956,1373878.98187134)
(-872364.643065593,12883.578062817,2235849.84359343)
(-1426065.08613474,6166.94337547726,3655644.19092454)
(-1978937.9159601,3130.63901074171,5631180.72180384)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-148826.753367783,241179.599642952,50739.7820812984)
(-156234.239353,234203.819355731,110656.02115033)
(-173727.190272903,219436.858117925,191950.588786319)
(-207663.077950417,195503.951552905,313790.343257268)
(-269948.542646411,161336.001571144,508111.668979293)
(-381097.856854791,118581.793066025,827726.591340911)
(-574630.31672727,75312.0909885379,1357078.54350314)
(-905052.204488527,45602.5071545129,2229411.81889994)
(-1447132.48308917,29941.8340005362,3652769.41136414)
(-1988485.11829426,16205.8200757891,5628179.34859331)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-179611.964518156,376916.869255147,43874.6949059627)
(-187159.560707339,369189.202817356,96048.8721516782)
(-205321.202342003,352631.04745568,168175.88515592)
(-241581.177524113,325428.568095017,279832.446137916)
(-310024.415359987,285545.271501347,465647.591567703)
(-433630.646214154,233126.889313,784733.141534874)
(-642530.026834187,174955.019466234,1327620.23989138)
(-968209.329005706,127477.799730053,2213954.27632151)
(-1485676.96575601,90500.0120415303,3639073.06403649)
(-2005308.15488507,48657.9047185143,5611929.13427892)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-234826.19484152,575574.436624228,36168.6274724369)
(-242327.863834354,568084.495149744,79601.1989744018)
(-260840.118274594,552004.378898137,141067.985806539)
(-299074.17099042,525486.214441839,240084.510450141)
(-373879.478623697,486136.554954066,413372.705621125)
(-512894.44406718,432723.488091786,726670.550909505)
(-745941.461563948,367324.148159082,1280242.88378061)
(-1064353.52059988,295015.955121387,2177058.24898918)
(-1541665.78595711,212019.851626612,3597204.19536126)
(-2029602.83723569,112345.363186003,5563119.57412946)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-334517.720194431,881417.857325899,28674.2994927616)
(-341615.274254723,874770.546849992,63603.5220472343)
(-359525.216005816,860475.840994724,114657.275956463)
(-397390.028450616,836630.277136757,200903.241712157)
(-472982.305391003,800008.650733622,360013.451323605)
(-614621.095516529,746132.045633281,661225.989298645)
(-848352.382688274,669036.572845323,1207865.9473007)
(-1152292.47609463,561197.730460711,2093976.648056)
(-1602287.98244072,410911.364172282,3497373.11795109)
(-2060149.26202976,219349.425716789,5450518.31744998)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-517505.932155627,1376951.69361083,21972.0958707018)
(-523797.060567303,1371233.12766055,49306.5756274496)
(-539876.371373102,1358825.72743857,90833.0605567103)
(-574451.316508787,1337538.94763846,164375.706563801)
(-644660.019482186,1302874.69450375,306169.68227586)
(-777737.346983057,1245962.0120231,584077.062869087)
(-997062.673285539,1150266.57735613,1099909.73164382)
(-1273426.63521845,991044.344620268,1943489.75270271)
(-1692685.5559303,741552.665983068,3305534.00682217)
(-2110010.26494968,404074.259108976,5230819.43837971)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-852148.625223548,2212958.17719659,16142.1416377725)
(-857206.315277773,2207791.75898447,36789.8255916201)
(-870163.687094527,2196271.04328311,69508.1968416133)
(-898269.123203631,2175578.14342079,129738.124262896)
(-955956.863871257,2139340.8402437,249228.842394195)
(-1066561.73683114,2073459.78291489,488292.808333551)
(-1250210.11454316,1948277.33174676,940492.168486068)
(-1473972.30945879,1711846.32791789,1693662.49464724)
(-1856855.30513696,1324411.6534584,2967658.81230887)
(-2205380.26710343,750751.762933951,4826361.57558727)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-1412494.20141509,3614610.41309431,10841.9655173607)
(-1415957.27739827,3609464.41755602,25126.5843440985)
(-1424761.75140354,3597485.27486032,48674.1041703958)
(-1443646.72139836,3574569.02810454,93329.9408850036)
(-1481741.73510386,3531246.75537729,183165.760855292)
(-1553297.99771127,3447008.71984925,362914.821632186)
(-1673499.437228,3280874.27518198,703817.315424961)
(-1852233.78754637,2962027.08086276,1305870.35002646)
(-2159649.80344656,2396398.28710749,2393533.51982391)
(-2371752.49324146,1440915.70883651,4075122.06716282)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-1972640.79364507,5581683.13477764,5568.07196172461)
(-1974362.80024443,5576384.52054009,13010.7692220922)
(-1978744.29716577,5563662.42173264,25577.9195155506)
(-1988024.96350457,5538372.3195851,49799.5915395745)
(-2006465.03284192,5488774.55705744,98736.8227013662)
(-2040924.67211534,5390157.06448707,196513.150178872)
(-2101085.18844199,5193801.99954462,384670.614258201)
(-2202533.41475488,4809367.37610632,739863.733769489)
(-2371221.1260614,4069922.98114427,1437560.1657941)
(-2388083.95056017,2632954.28075657,2633605.54443421)
(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,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)
(18521818.8841596,59289.861470493,51337.5017756481)
(18509759.0548117,56479.2465969381,110372.853445513)
(18481977.1096611,50520.5310834937,186453.553566741)
(18429992.1508991,40810.1583826843,292608.798238793)
(18337550.0950197,27106.2628844626,447942.375467416)
(18173183.9890145,10680.0646145,681891.810616751)
(17871674.3903583,-4078.39369784356,1047080.86374144)
(17275812.3410868,-10607.198704993,1680245.81842844)
(15931235.4867076,-8835.80802813345,3098147.66818256)
(12279645.9867711,-4369.18496722624,7605630.20216912)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(18509530.2864062,126465.480922477,48545.4366490783)
(18497425.8269679,121150.494306722,104430.36258761)
(18469417.2873166,109752.267667415,176803.569595412)
(18416474.784162,90810.7268615788,279003.169182068)
(18321495.7062805,63086.7046285872,431669.885085084)
(18152501.904013,28024.8735266891,667335.703174456)
(17846354.5224952,-5432.70578459353,1040773.78813499)
(17252922.0642283,-19730.4123592485,1682230.94913868)
(15916986.333994,-14830.3985105561,3102794.7741356)
(12273409.0422304,-6405.44924085936,7610104.73486195)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(18481665.5865567,210285.969414915,43307.8262264271)
(18469520.9595817,203204.451097177,93119.3251446073)
(18440987.2720436,187780.796720936,157996.988417929)
(18385769.0230016,161497.893217983,251498.375752907)
(18284185.6564179,121145.710440925,396925.825519513)
(18101312.3358167,65960.3988596933,634200.762158313)
(17777598.9434475,7385.26814879725,1026774.18269352)
(17189745.916834,-17546.1390184292,1687412.44267367)
(15880213.6441924,-8567.71997811561,3111424.29150292)
(12258139.4215873,-608.435991022057,7616623.3930149)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(18430362.678976,321616.660730961,36315.3198331283)
(18418213.3142593,313921.400885349,77846.1497216851)
(18388992.0359125,297017.227885769,131917.134945663)
(18330186.6033289,267858.623943856,211409.278010182)
(18216499.4617311,221627.899023971,342023.866979384)
(18002317.8559687,153814.489406324,575841.928893226)
(17624755.124295,71522.1801764337,1002040.52037976)
(17046026.1153747,31308.8629216519,1696570.72870266)
(15805977.1840943,34518.1340766082,3119451.37944094)
(12229604.358281,24368.916388669,7617182.16853859)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(18339945.4765854,475827.258870178,28638.3850771553)
(18328098.8045859,468720.094014491,61033.6781711283)
(18298721.5323577,453256.471550963,102853.438517073)
(18236819.4280167,427132.545602119,165306.572495043)
(18109297.6525312,387044.169668639,274333.825338856)
(17848222.5505888,331027.322978277,493624.651754262)
(17349989.6907491,264936.709831734,961899.624429234)
(16779597.6460031,207056.302848951,1699821.67254231)
(15689656.8823197,151376.858155203,3109260.93483018)
(12187198.3229898,81777.2335426207,7592672.11209411)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(18179007.7136962,698404.027909173,21518.4517137039)
(18168012.3277483,692602.654077668,45628.9442907753)
(18140019.4236155,680149.332396134,76812.098467664)
(18079236.7916556,659594.24161652,125344.236990463)
(17950268.1431516,628396.346229879,218362.266529985)
(17681782.6878514,583105.745161014,427500.715622671)
(17177348.5492086,520411.253013692,903945.895187258)
(16632205.3255505,440091.89928017,1644033.15175423)
(15590725.1579547,320514.349584969,3039503.17457244)
(12138657.6226921,169468.594858207,7510625.58317839)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(17880519.7699852,1042348.82769744,15650.1527142303)
(17870957.0464691,1037925.40975943,33193.9446393848)
(17846157.5624123,1028642.85565331,56287.1422402181)
(17791008.3057375,1013818.33152517,94224.0847286681)
(17670785.5389358,991686.573038462,173108.954145498)
(17414089.5508085,957256.857678686,364751.598479621)
(16924933.2002692,897250.68838523,823536.94419666)
(16432931.457447,790603.511991672,1524287.89346311)
(15444118.9858774,577418.737880522,2888199.61800321)
(12055791.8828536,308686.146720141,7340800.57298145)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(17284032.9103349,1652681.85868985,11106.0880926052)
(17276468.7182572,1649138.3881735,23838.7307869155)
(17256723.0275296,1641779.35522497,41436.1712344766)
(17212198.7868052,1630287.48453283,72119.7628614217)
(17113176.0203208,1613638.21052443,138655.895826648)
(16895504.0797684,1586818.70724013,304648.884309047)
(16467481.2225071,1525080.32896805,716748.561319252)
(16146511.4718272,1333652.74775591,1310836.19891233)
(15148293.8967371,1021635.88153526,2619090.50802685)
(11863930.3677957,584381.011097279,7031705.66339393)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(15935928.7930972,3054458.56123232,7420.9575885525)
(15930820.7182895,3051051.23985528,16350.7648624134)
(15917644.2678021,3043529.37500761,29815.3805175111)
(15888555.484498,3030224.57294378,55296.7408534944)
(15826604.3829318,3006568.69742483,111640.790560768)
(15700608.3757195,2959462.81806221,242710.960951252)
(15473397.5758288,2853393.26343624,525121.66806961)
(15153852.5716772,2611805.87985124,998502.831394079)
(14251886.3775444,2184860.6063619,2181362.58021984)
(11280189.9530258,1424622.73889934,6446799.06079378)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(12281331.0733118,7554260.87033443,3846.47858435782)
(12278817.1915958,7550700.08249073,8638.29875197648)
(12272350.8504028,7542378.78243366,16314.3984006793)
(12258373.1825478,7526363.98527142,31397.4946640982)
(12229574.5795235,7495242.27365018,64304.9607166753)
(12172965.7995041,7431121.67966287,136376.282140035)
(12068081.2886345,7294953.44124185,283270.281901283)
(11867016.8523148,7011941.80443259,571204.744893584)
(11280653.0880092,6441159.66191171,1420652.12991657)
(9172142.67185502,5021047.2214043,5021621.67963972)
(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,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)
(-322023.967538404,46983.7128755584,39238.4841791139)
(-335363.08945812,44128.7773255536,82611.1964800243)
(-365513.615544859,37894.0183742035,134587.248668438)
(-420467.440105224,27186.0768887599,200240.108140697)
(-514440.130197347,10954.5126935021,283655.166020906)
(-671145.643575724,-10068.1892931072,380432.333260944)
(-927333.310671492,-29435.5798709959,451254.959518416)
(-1332823.13076575,-33465.0957340494,335734.872461771)
(-1914272.67327241,-23032.3109045516,-553345.311297001)
(-2346760.90482105,-10584.6700260611,-4673974.40432205)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-336086.182485306,98549.5694352001,36429.9576885334)
(-349207.668339011,93169.3692056107,76402.2064720347)
(-379026.489482892,81173.5702612644,123945.776741165)
(-434010.214303158,59892.1691895024,184104.028262252)
(-529421.75698567,25599.3108069272,262756.038771705)
(-690399.550804058,-23267.492359644,361236.142011982)
(-952623.524783417,-74230.5179165409,447388.472692755)
(-1354241.64657871,-82864.9504760223,346331.383598403)
(-1925043.28582052,-51541.0038524011,-540750.958282451)
(-2350584.91888457,-21635.6895582115,-4663326.63227867)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-367482.911542398,158932.418944904,31144.9939460443)
(-380170.788926395,151858.521882594,64526.9351338181)
(-409440.614317597,135704.050295001,102803.686817927)
(-464914.222089097,105775.313749904,149983.132704823)
(-565272.007751393,53314.5323761208,214104.920661659)
(-742865.620576074,-33128.6904617661,310523.420513253)
(-1037238.47602172,-145492.136174797,439001.803597374)
(-1428382.05164345,-161262.411143621,377906.578098922)
(-1957628.70921634,-82743.8634384864,-510668.863549495)
(-2361069.5404214,-29084.6893029311,-4641631.55643943)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-423671.015957954,231189.006091304,24156.4531442234)
(-435719.960575207,223769.411053467,48558.1841644919)
(-464170.768079507,206706.288504878,73098.0953033097)
(-520759.984062295,174443.695828824,97755.6459721787)
(-632281.609893892,114363.686210363,127866.90911959)
(-858558.572436226,-328.740385463447,198322.732804897)
(-1300203.92584563,-203242.831755848,423411.823883234)
(-1670948.80363347,-235078.770822093,456582.4479265)
(-2039187.79371726,-81699.195959073,-456917.896384693)
(-2383505.54622913,-17963.4239147714,-4612549.91190611)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-518209.414251217,314948.788583027,16774.4537015987)
(-529248.750123029,308643.38185233,31627.3829682896)
(-556133.982991462,294588.294185655,40980.237993241)
(-612776.32809997,269579.366390924,37819.6689044598)
(-737466.193531419,228060.309102019,13266.2374320452)
(-1056541.00042206,164658.906058307,-4578.51264419783)
(-2099404.13615838,92369.5670291256,391582.260834979)
(-2491209.30225883,59735.4769919042,609954.306639562)
(-2199023.12133376,52512.1467291264,-393197.68703847)
(-2420194.18947754,33257.9553322305,-4594647.20846139)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-674124.467889341,400006.440002186,10453.8755230541)
(-683761.225157283,395638.368380494,17611.7872572047)
(-707870.737765244,386396.779319211,16072.8088610202)
(-760579.761097853,371442.089220836,-3594.01585885128)
(-881780.957182875,349021.921165007,-50127.1822307296)
(-1199959.08802976,315580.813358471,-76927.9682930766)
(-2191794.05596306,268189.830677595,358773.718586671)
(-2550415.39410159,240931.424956607,602577.835630729)
(-2273178.86433847,173973.061597396,-412599.711587804)
(-2456729.97629409,86606.9651238016,-4628181.77703647)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-929029.106346902,445928.685778389,6005.97591256772)
(-936950.441490186,443569.696103184,8361.48150583931)
(-957226.147830619,439352.242663369,1169.07376117955)
(-1003152.82930603,435111.196321516,-25959.5529393595)
(-1114397.97805255,434187.808072079,-83562.5775014754)
(-1425925.52584565,438792.270752728,-124379.612884921)
(-2460340.30022207,439923.825432332,331539.238208302)
(-2792020.71560571,504283.999876047,535518.18169818)
(-2385478.21624575,281646.890804911,-500179.10002955)
(-2517060.17577993,116824.053647871,-4715164.7845635)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-1335776.90298405,304614.472025147,3503.37242873201)
(-1341748.46502268,303596.260253521,4073.3369149203)
(-1357228.14634533,302825.381635921,-3069.28282603888)
(-1393225.23761974,306720.566327829,-26875.2830508555)
(-1485236.96444761,327117.959674379,-79013.1045280119)
(-1770932.68889377,391960.244305298,-123364.964061776)
(-2900384.22666882,531015.606189969,395788.049713226)
(-2364733.38420936,341039.92311261,312656.327869902)
(-2474962.73206347,125279.631666611,-665340.438834537)
(-2610484.47251884,674.569999817471,-4832396.76951523)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-1919179.88580962,-600186.087446146,2288.58373479092)
(-1923068.11661178,-600994.721562423,3147.74580858827)
(-1932987.34891872,-601747.993259538,732.082781478541)
(-1955086.66816955,-599921.571893935,-6604.28097251232)
(-2005722.86819246,-590442.198118592,-14337.5266986191)
(-2126767.71962359,-568140.049133878,15518.2074402889)
(-2391434.01266203,-551870.820185142,205615.567662887)
(-2478749.81804297,-674947.433578243,96584.6594305396)
(-2707189.90639064,-786299.215961296,-790380.86364991)
(-2750209.04230132,-683378.647231948,-4833549.30573428)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-2350565.37362275,-4727179.31379069,1269.01863574192)
(-2352434.63053968,-4728222.73926269,2128.20382813539)
(-2357176.38365397,-4730051.9583244,2338.74830650084)
(-2367395.98044137,-4732082.48979238,2648.17455069501)
(-2389144.47653193,-4734414.9327727,7719.31061692426)
(-2434716.80116675,-4741881.07567683,31522.2831873175)
(-2518999.52758022,-4773141.55428866,82253.1788622626)
(-2613072.55032896,-4855088.0772291,-15137.4294864727)
(-2750975.95289289,-4839540.17437581,-687888.08481324)
(-2654909.80821322,-4151178.27746476,-4150656.62915548)
(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,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)
(-380844.8212645,32890.2988365135,25930.5548895835)
(-392178.671243429,30235.548283257,52510.5883916348)
(-417072.286341081,24288.9250780134,79780.3341098461)
(-460630.498986109,13514.1831976421,106429.209793085)
(-530941.85861004,-4128.96599250304,127059.904198286)
(-638954.903909549,-29394.2227650126,124263.387297124)
(-794105.088039438,-54758.2474384255,45793.4121034973)
(-986512.452555479,-54860.2152556041,-245657.050851169)
(-1140428.99884552,-33756.7154628196,-985744.009815225)
(-991075.668573803,-14360.8481443131,-2327068.39791817)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-393598.797351558,67047.6709963408,23355.2427064247)
(-404304.01412569,62082.1014165501,46605.0353598074)
(-427820.597281063,50613.1424371927,69074.9257987997)
(-469048.411207482,28784.2004478786,88843.1054528863)
(-536160.761903539,-10421.9547666045,101875.099144856)
(-641104.168021521,-75846.4309004732,99031.9244977863)
(-795290.835858006,-158883.503199917,45824.4913338737)
(-981889.422261289,-156981.357133591,-224406.591105547)
(-1132917.3701882,-84067.2431041947,-966221.979096491)
(-986454.58709707,-32044.021180477,-2312669.13784785)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-421522.783779428,102601.828803999,18485.7144293753)
(-431012.523189406,96183.3102165888,35226.2398923443)
(-451816.230430576,80861.2708152098,47353.7276273039)
(-488289.973111765,49796.7545399713,49716.9245578826)
(-548726.935603017,-13800.2904682732,36550.1881111724)
(-649439.001002158,-148866.375030792,16143.5126675658)
(-819436.890818095,-408451.986206325,47910.4104703511)
(-982335.353886459,-403810.22755867,-151307.41686156)
(-1114687.76203139,-164220.002788256,-914095.604362457)
(-975178.198326196,-51420.8382678636,-2280610.12937029)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-469819.980144798,136593.655364443,12157.1376264056)
(-477610.247761392,130157.171325364,20073.5637038189)
(-494415.198920087,114701.411565651,16477.8537939597)
(-523200.508439576,82444.8412608117,-13729.7085496006)
(-570611.571845011,9194.33783196722,-98394.3748987164)
(-664183.823933561,-198317.501860902,-243317.996571278)
(-1002311.6962083,-1002421.36395838,52759.1515434466)
(-1055141.6850605,-1055280.06835098,88421.8737627868)
(-1072319.38608836,-241449.469060347,-801217.067594016)
(-952408.633998511,-54590.9657067481,-2229143.85238575)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-546465.890435565,159081.722774824,5768.40877396736)
(-552191.485562881,154136.622786804,4731.69275237945)
(-563966.171117339,142914.965506429,-15649.6730625209)
(-581008.414912149,121876.089752785,-86848.8347423151)
(-593140.327632415,83846.3629521839,-305826.725761539)
(-534589.201546659,21322.722113377,-1047418.74861122)
(-8.49312466401714e-05,-2.26855645911065e-05,5.5106498553383e-05)
(109.853127056101,592.590307543235,902286.762592712)
(-902268.785399418,-21583.4420486845,-614333.600353303)
(-911324.922831149,-3240.95379490012,-2174552.87891156)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-661093.289137437,145251.490523763,799.053499159539)
(-664876.034076592,142556.545152324,-6506.05994705075)
(-672035.031664585,137178.803854783,-36605.6043960635)
(-679484.48741295,128973.592710119,-124798.381038301)
(-670881.755397591,116509.069321255,-368360.289192656)
(-567977.227730438,89783.8621340394,-1068803.28951264)
(-7.71546171906791e-05,-2.96068856961005e-05,4.29169401195331e-05)
(-450.099853291631,-566.860406894266,879897.121124921)
(-880480.883456612,61753.6145982598,-596137.916403882)
(-910874.157862326,26321.5127652528,-2171556.20139575)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-821116.942807014,39297.2848344003,-1957.95785052439)
(-823299.05678668,38874.6396808251,-11927.4370825357)
(-826720.76067383,39464.8328582425,-44718.8532427785)
(-826805.262466938,45101.1659746831,-137193.993346428)
(-803358.628302853,63383.3857790591,-395107.659553927)
(-666327.801323914,93837.4603180616,-1158758.98225968)
(-0.000209405901684066,7.63851206028706e-05,5.76317085613324e-05)
(227.448489863539,931589.570832699,942155.222285501)
(-941965.653946701,192177.105037927,-631780.830453227)
(-947694.786619497,23407.3232404065,-2198232.03008879)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-1015282.7781312,-278712.84895256,-2483.99106589241)
(-1016325.42146333,-277635.325955177,-11397.0689892327)
(-1017287.04751339,-272847.759327067,-39025.5756358738)
(-1013150.07786559,-255123.669667971,-118875.899747373)
(-982610.865706406,-193400.680866562,-364717.931842956)
(-825113.999398894,36086.5388040469,-1252785.69982382)
(298.103520906687,1039924.6099917,931486.380823136)
(-931159.053042919,227000.925263682,202500.695225709)
(-1172442.28724448,-106952.640347182,-800890.004208173)
(-1026877.88580566,-139043.038551074,-2222046.22912986)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-1164765.10731924,-1031536.98347007,-1590.64397286861)
(-1165195.11389218,-1030354.84607014,-6744.12657750272)
(-1165276.77959411,-1025952.96025857,-21349.4949705939)
(-1162087.1970493,-1012246.21249651,-57226.4232622966)
(-1147075.17838946,-973896.349765852,-135378.444165992)
(-1100803.14633874,-876139.827269497,-249116.651377294)
(-1039482.04097908,-679483.163229964,118339.150161409)
(-1192336.16846902,-809273.76076185,-131799.813387003)
(-1282456.22341377,-830084.641688945,-833401.495022103)
(-1051124.57972067,-588082.748071518,-2083446.24808231)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-1004831.75234899,-2376651.44488181,-619.159862012493)
(-1004979.33569065,-2375820.74201764,-2608.5587635448)
(-1004953.74726871,-2372922.57716978,-7861.57823759133)
(-1003685.35312672,-2364743.86463822,-19074.5534105301)
(-998940.738367515,-2345325.0799108,-37849.5614299977)
(-988758.643596221,-2307208.00365445,-52739.5426155854)
(-985262.761056778,-2254169.1325524,-11790.3398165728)
(-1039077.40382587,-2242030.47855782,-153028.768523684)
(-1053675.00606306,-2088592.17262104,-591822.184421414)
(-842648.999654085,-1496331.92965804,-1495833.81139401)
(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,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)
(-415533.203853365,20060.4857795653,14627.8968092979)
(-423198.041678519,18046.8752868091,27600.3919575815)
(-439306.357206464,13485.5738563477,36348.888966616)
(-465634.843545625,5013.72522993311,36339.508296201)
(-504356.962396739,-9436.99485451333,19191.6069374058)
(-557301.791616033,-31598.5909173711,-30862.9144387393)
(-622458.862696256,-55957.0991239261,-146552.040657994)
(-683366.856161895,-50220.9788668184,-399476.658184761)
(-677421.394469527,-26196.2109562473,-836288.051604502)
(-481803.02995272,-9689.89655219861,-1335870.79367336)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-425172.202698801,38950.5958232338,12683.2953035712)
(-431872.040514203,35213.1489979624,23085.0479809324)
(-445693.148221617,26497.0804688406,27946.0923089957)
(-467426.23596775,9414.94885759054,21922.6934416085)
(-497648.664925265,-23114.91639254,-2911.4819986404)
(-536226.820034383,-84260.195121246,-55127.2257819024)
(-582606.610664649,-183031.316214452,-140737.233884739)
(-640071.749939011,-157397.250262492,-375378.63481135)
(-649043.98295123,-65749.7661217564,-819698.466882814)
(-469016.863882848,-20676.8496034737,-1326149.23704574)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-445822.275761548,54218.707370458,9031.38043489464)
(-450695.176725707,49496.9388935722,14430.2440755888)
(-460019.488186749,38196.0401688107,10934.5421317912)
(-472225.164151931,14850.0057363651,-10565.3237068182)
(-482694.652212027,-35706.7676667178,-64005.7558236293)
(-480318.724971542,-163579.144810111,-153807.08216537)
(-450066.902472649,-591240.145184492,-114968.241540781)
(-494536.225886642,-476535.906269828,-283628.713533265)
(-567790.748566519,-121726.836826737,-774548.656293156)
(-436438.97345759,-28551.8875817844,-1305412.84318346)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-480137.796755284,60111.142384145,4425.38159679547)
(-482620.893659797,55646.3139486056,3286.65244016577)
(-485846.074802608,45191.4840213471,-12277.9155298487)
(-484343.351728269,24751.7655611197,-61036.8320659099)
(-462332.020145679,-13198.3982812567,-191824.753150708)
(-369578.30304542,-68643.2954185194,-581366.123430442)
(-4.04941109487579e-05,-6.49640101597214e-06,1.97051331015625e-05)
(340.357411889605,62.2865085699729,71273.2298720213)
(-370157.615589818,-71302.3144608335,-681313.062992419)
(-372035.212741901,-13449.9327515414,-1276788.43907929)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-531029.094957742,44633.6384734843,40.7084328398612)
(-531046.081367897,41576.1740614785,-7034.55587501782)
(-528151.353996942,34958.7208872696,-32616.6098613391)
(-513517.500387153,23556.4932465248,-98912.2520717388)
(-464298.319345259,6276.35069982534,-247229.009339974)
(-325762.184466511,-11962.3372699385,-512736.984568698)
(5.92072274082097e-06,-2.05904409562908e-06,-0.000101514642103688)
(-9.4891322876035e-05,-1.23521542103433e-05,4.91765090234741e-06)
(146.328662346273,236.129004950446,-623406.492548233)
(-282114.801643162,-2749.27133406982,-1263317.27515366)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-598932.849752858,-14512.8586790116,-3013.94223208295)
(-597017.554204893,-15650.3810286985,-13645.8670136053)
(-589472.416898381,-17310.9641878903,-43938.7967046488)
(-565570.924079192,-18182.619108145,-116113.247683737)
(-499411.020616179,-15864.097975529,-265443.533789789)
(-336110.04292152,-8498.51550933393,-500774.54035931)
(-3.73063361746617e-07,-7.30381655019738e-06,-7.78097452895558e-05)
(-7.02055891518149e-05,-2.33839613233257e-05,2.9490444963757e-06)
(283.358059345196,293.686085608682,-626524.955461545)
(-268948.514978879,-10456.6798363426,-1260743.18984273)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-676801.752992921,-154661.926691517,-4166.12180158562)
(-673768.091976475,-154018.655074306,-15328.8125661774)
(-663657.538568339,-150998.242138519,-44704.756721049)
(-634817.539695884,-141188.185799486,-113686.912800765)
(-558973.942454279,-115877.385269771,-258058.3113551)
(-375557.690289389,-64994.8795504988,-492332.058348464)
(-1.06751092275005e-05,-0.000120937146770888,-9.14462258786713e-05)
(-0.00012071656093476,2.47312138993123e-06,2.82712363453046e-06)
(124.371475271963,-38317.7061613656,-637509.572250426)
(-289332.627634362,-55760.2697688348,-1250568.14130306)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-738412.997285697,-427988.592903837,-3543.11463317714)
(-735181.394105551,-426379.268364951,-12326.5287003208)
(-725020.418407869,-420775.562432438,-34815.83751192)
(-696762.73150436,-404087.437891144,-88303.9317814879)
(-621630.500614743,-357955.609699052,-207206.072443865)
(-430237.205394607,-239712.593973297,-427365.152025358)
(-0.00014427511809868,8.27257362752142e-06,8.9027867681278e-06)
(-19.3116663010725,-34246.6851551506,-38748.2501234365)
(-377239.37839826,-216971.136990369,-655297.728140652)
(-379473.868590669,-163279.430441317,-1195182.58468316)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-719360.859505308,-871372.243071762,-2020.59764600102)
(-716826.456709003,-869988.871157702,-6779.65203642097)
(-709143.154630989,-865565.908309839,-18122.9311221437)
(-688233.790553858,-853861.056105627,-42202.7194031069)
(-632324.127477058,-825833.725023818,-89075.6549907398)
(-477597.086157837,-764211.785348639,-187782.523796302)
(64.8482528726119,-625357.130498261,-34530.4298484257)
(-383164.344090478,-656058.610117094,-221890.329265025)
(-517954.34207057,-601335.472452488,-602027.875146103)
(-404455.885156852,-379635.822438081,-1032340.17771316)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-503770.46268097,-1371662.18980083,-771.342938960914)
(-502457.4226552,-1370716.52738936,-2565.59974277036)
(-498596.027254187,-1367904.21717414,-6585.01089301053)
(-488709.957472022,-1361090.37085078,-14331.0918025481)
(-464989.618314446,-1346470.26468926,-27645.6721901639)
(-412840.242076325,-1318545.1311893,-49230.7278693967)
(-325317.813536371,-1268930.36144054,-65602.4444475348)
(-390185.629721585,-1202932.55336998,-167620.275298933)
(-406959.252725999,-1034904.46419808,-380767.036890417)
(-296133.889537011,-653712.246383156,-653205.723062423)
(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,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)
(-432902.591319898,10314.4410835343,7054.94638300249)
(-436981.311381578,9268.90000888038,11569.3160771811)
(-444942.819552097,7023.04727802149,10182.7311447917)
(-456389.349418257,3151.84078504284,-2214.60376761908)
(-470206.580367443,-2793.26871082102,-33571.7170860949)
(-484402.340659531,-10572.5992736938,-95898.5687689011)
(-494848.76407774,-16141.5603771493,-207367.10701027)
(-490298.099180646,-6953.83760603147,-393482.026385487)
(-432520.980639201,2188.83307920518,-640571.273295007)
(-271483.993933498,3098.18289519403,-853988.492209442)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-438998.929823525,18105.7912892308,6035.37691903202)
(-442098.430783932,16201.2606617523,9329.40653588751)
(-447689.994248619,12027.9054971907,6321.39434371993)
(-454295.105823343,4515.28317362687,-8173.17818927365)
(-459048.545076662,-8239.58362029431,-41326.9831284025)
(-458294.227423701,-28408.8809620814,-101423.2940507)
(-451511.855082547,-50495.8180956945,-198163.791914252)
(-448991.046516158,-11857.7931098237,-384340.53983331)
(-407117.121112831,15547.1757564603,-639625.744348957)
(-260393.245620771,11919.6401426124,-857070.819858456)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-451685.892059369,19804.0650226897,4165.34256436321)
(-452961.36788652,17487.2699495623,5145.52443736799)
(-453986.197363874,12332.2649214389,-1192.12580975118)
(-450722.375841305,2730.70206009953,-20910.3330068531)
(-435008.849339549,-15362.0399329998,-61473.679566624)
(-393889.131110277,-52832.936215794,-123479.218174183)
(-323538.726665331,-141017.265360556,-159485.946716638)
(-327447.472346527,18464.4346204509,-356896.927987028)
(-341987.56710074,76025.6443872514,-643178.578083602)
(-234716.978862733,35915.2666832392,-868896.199219079)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-471654.6610682,9391.16352007972,1929.76581552608)
(-470631.054084339,7353.95149217952,73.2446974532671)
(-465745.778625535,3021.9968512336,-10716.7834094156)
(-449135.415019336,-4246.35214031673,-38947.6659179341)
(-402718.140473734,-14990.1557863807,-98933.4297364978)
(-284951.460808215,-24753.9082022942,-211639.299987204)
(-3.45507978446748e-05,-5.9594351776311e-06,-3.95565094509551e-06)
(-168.067539772264,-126.054380373643,-299319.507552499)
(-209319.517660014,299113.967005748,-683245.928100802)
(-191173.954528437,76556.4445473989,-904748.364178432)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-498584.517992439,-23019.2527694519,-34.1606757688669)
(-495420.797623561,-24164.8431352597,-4140.64979266465)
(-485214.698266219,-26160.1499029917,-17895.158769162)
(-457721.301573811,-28285.6478685124,-49652.0618543078)
(-391628.750559425,-28625.5504386583,-108686.235987864)
(-250098.454834093,-22208.7991108897,-186895.074711687)
(5.68899423284281e-06,-5.06526576773268e-07,-7.26116577232232e-06)
(-8.35707861309263e-05,-3.35582536891186e-06,-1.52091648734446e-05)
(115.566674407838,420.072027622836,-905736.032460697)
(-140546.532967368,10495.0366543957,-981242.893243488)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-528775.522613057,-92040.0213531028,-1136.55855615256)
(-524159.955523199,-92087.8889756041,-6071.11139750354)
(-510533.494975972,-91245.6630512038,-19924.5201717056)
(-476668.674183307,-87217.7563114503,-49894.6616246517)
(-400456.454993227,-75281.2165020612,-102193.561184201)
(-247962.709134329,-47885.8171113426,-164663.876970939)
(3.18055160718503e-07,-3.24871802909122e-06,-1.5143502895471e-11)
(-5.86842825588312e-05,-2.51487198194281e-06,-1.23622751234559e-05)
(179.158224032465,182.753525095621,-895820.742681742)
(-131633.83734037,-30789.0000972184,-991851.383568635)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-551729.91113327,-215963.865202164,-1147.99801059534)
(-546634.808480926,-215195.575491298,-5173.59499045506)
(-532095.913688237,-212201.164684737,-15779.718237022)
(-496974.301763447,-203019.583239656,-37821.1292412543)
(-418880.291845197,-178483.359602553,-74712.6367498429)
(-261664.796750121,-119666.7768488,-116824.570551653)
(-7.78575837811971e-06,-7.6528499476698e-06,-1.78794211632173e-11)
(-0.00010134828267357,-5.03648530701147e-06,-1.68466828155428e-05)
(-13.9270144398883,-415626.884954727,-927020.709852189)
(-139983.590201925,-145855.353867684,-961303.393514175)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-545426.343989114,-408605.893156966,-344.625341781698)
(-540850.598429232,-407760.674451256,-2110.32205813815)
(-528094.534536059,-404743.017999528,-6494.35261515784)
(-497598.583885797,-395494.632221973,-13183.4512514009)
(-428774.585845551,-368644.822356424,-15877.903266722)
(-281451.922131751,-287102.503444792,2772.54006641405)
(-0.000125639943889529,-2.0665484023094e-05,-5.6410422993095e-06)
(-51.2380953800258,-417391.292735593,-416017.120680002)
(-193650.957276081,-357648.951880347,-657583.474876561)
(-178896.00195904,-188227.766129334,-815788.929246541)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-473029.4805225,-655420.646205934,483.374066156679)
(-469774.859997346,-655278.402369211,949.505272448095)
(-460934.201657315,-654808.880779746,2806.41507899013)
(-440360.848746721,-654236.318954587,13675.160004467)
(-394479.470024734,-658456.526946824,65642.2071425402)
(-289397.676737145,-699476.673217724,289816.967494776)
(-180.280267587689,-950769.539722314,-417800.089651822)
(-198536.500571372,-663100.693224511,-356718.532682008)
(-253365.194041331,-490372.093823303,-488584.538768296)
(-181966.331141947,-271329.688083148,-627972.170829385)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-292222.666767651,-867517.318363233,548.876243986516)
(-290612.090831993,-867898.635181456,1323.77723302072)
(-286307.902399134,-869074.702986072,3301.47458429666)
(-276751.84760499,-872250.449978228,9357.49574090771)
(-257205.566285043,-881396.223988918,24513.1407536109)
(-220398.731282645,-905672.336242269,38267.2929844735)
(-163756.365950317,-943568.850622849,-130494.843701046)
(-186658.907699829,-812704.28802201,-184417.970925306)
(-183852.962692325,-627929.65970492,-269966.695077354)
(-122754.569661321,-357567.677767989,-357108.025268211)
(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,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)
(-439874.433251497,4019.47193994417,2952.36999165017)
(-441524.720332286,3964.03573486778,3531.74320748821)
(-444250.068477932,4128.64414192091,-1289.65200859825)
(-446770.230446143,5137.63787151375,-16046.4088522237)
(-446821.742464509,8311.97197596804,-47743.2187311236)
(-441249.520659854,15501.9272421222,-106397.96597292)
(-425543.470365051,27169.820282044,-202873.079967651)
(-391753.754438295,34334.6283140634,-335752.053024069)
(-316399.551784929,27590.6891876947,-479464.171066034)
(-182649.873373941,14172.4383180761,-582470.729943677)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-442984.508098361,5099.03052985223,2906.01968492616)
(-443985.81463692,5067.30250989247,3690.13676289088)
(-445120.547849914,5541.99198273633,-292.657476628371)
(-444488.149167186,7961.99011236777,-12923.9663736386)
(-438874.80327063,15752.8884223997,-40538.6246261043)
(-424601.067056188,35957.7697556371,-94687.6275071319)
(-400802.010980239,77456.728975527,-195684.380302927)
(-377515.979342395,109660.210478793,-342485.029641428)
(-309824.657360066,80670.4267840585,-492857.230990565)
(-180010.961678898,37571.5634516648,-596638.640066027)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-449071.356646392,-366.066020102671,2850.56113697646)
(-448842.663092792,-324.363003304849,4123.52185644207)
(-446929.822144658,520.421434517668,2088.71718544225)
(-439801.161527244,4304.64681651338,-5175.153832762)
(-421014.969948368,16908.0142422125,-20324.1590437555)
(-381170.021596125,56065.9077304583,-53151.4065327267)
(-318321.4468979,182514.57606829,-163426.533392922)
(-355588.29608905,345812.010750181,-371437.509921789)
(-305615.78283803,208743.697297714,-535882.564698152)
(-178359.983891737,79459.7239080296,-634127.72012552)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-457486.03574343,-17454.4127141835,2919.7213693105)
(-455714.426193017,-17310.6021486763,4989.33262335596)
(-449857.052116711,-16279.7289062352,5900.75645528394)
(-433726.060659534,-12648.0199517667,7444.06886376309)
(-393483.38542107,-3738.14528234307,18855.473335661)
(-293567.39218365,10185.772488059,73351.5399534969)
(-2.52584533920344e-05,9.28358539646298e-06,-1.48286430910968e-05)
(-412059.448321113,167.592641379051,-508474.989333223)
(-352536.602211233,508622.682868858,-665136.890353154)
(-190526.739322864,127234.337819611,-713558.719470289)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-466220.048731882,-52924.7247985422,3105.84282379822)
(-463102.419013503,-52619.5634820179,6096.42554708446)
(-453776.595894045,-51230.9452739161,9609.53954259061)
(-430141.081728737,-47018.5992144016,16399.8989601477)
(-374512.590052473,-37267.7230408921,32813.316211745)
(-250342.640660285,-19977.4522487865,63220.7267747839)
(1.19178020352669e-05,1.61627719031828e-06,2.52996700568435e-06)
(-5.83027791509896e-05,3.36790998782881e-06,-2.58339132507667e-05)
(-642618.002327622,538.244884702332,-1046475.7184955)
(-238523.97038905,19455.8290930357,-840719.772347256)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-470516.127688317,-114672.908045195,3488.78832191225)
(-466640.552159188,-114251.465868294,7601.28734418035)
(-455560.057950487,-112552.148337069,13949.0533818508)
(-428731.527683407,-107295.080806598,26288.3884741483)
(-368147.234889432,-93513.0348358748,50224.4801653388)
(-239445.838137298,-61482.169582669,83212.3265021887)
(2.09163606940641e-06,1.00144880977008e-06,1.15824353027242e-12)
(-4.16550840140526e-05,8.30245537324344e-06,-2.196374277195e-05)
(-609127.217131544,44.9933617576076,-1027714.78637124)
(-240510.477964342,-39114.6665116603,-860267.650142577)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-461039.31915,-209321.774560123,3958.27453166147)
(-457215.42682727,-209120.96413526,9408.39114496988)
(-446610.07429097,-207976.41100766,19346.8144182922)
(-421711.540292851,-203442.12269056,40231.0948316605)
(-366371.546811544,-188201.798659179,82411.1136213101)
(-246085.459912427,-139346.362463784,144695.969664728)
(-3.69621920975746e-06,-1.22644046917947e-06,-1.27344161534493e-12)
(-5.60906051913011e-05,-8.41994049101823e-06,-2.85352828914486e-05)
(-667850.613091389,-609178.055891914,-1067025.95767664)
(-240048.714279403,-184716.378757731,-821359.121353093)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-423141.912331881,-335829.657016489,4223.45079913529)
(-420083.836037534,-336358.287099177,10694.0113713541)
(-412058.142784792,-337351.459725721,24032.6683381486)
(-394515.598403441,-338091.834893756,55599.395058987)
(-358540.231287651,-334202.745443401,131365.987285307)
(-278606.234483037,-294893.502247556,284067.439420363)
(-7.54637610995291e-05,-3.56834091793877e-05,-1.22751311955343e-05)
(-491977.674076595,-615754.736368941,-609625.489452943)
(-352312.347257892,-417288.242592202,-642853.912770855)
(-178258.563065589,-191265.326442499,-636942.403979533)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-338434.654685824,-474159.014554072,3734.53170090401)
(-336525.847168518,-475695.183407546,9822.41518044586)
(-331971.074087835,-479882.682369175,23390.5102544157)
(-324173.516822762,-490406.517507115,59517.8609438121)
(-318841.681729583,-521015.33122227,170692.65842753)
(-362233.281369263,-630333.975842681,578968.736654775)
(-749877.93137106,-1114215.97223997,-616169.40669074)
(-367765.206502866,-651145.638118485,-411549.799009695)
(-244112.128337158,-420857.667244746,-417233.440061335)
(-132237.100581309,-212143.256425793,-446084.740638673)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-193764.714960602,-574803.520104706,2186.55374358495)
(-192905.700159549,-576871.116483365,5656.09614696308)
(-190929.183415798,-582462.227556814,12856.9223512659)
(-187932.059018999,-595226.680937227,28857.29719539)
(-186687.210279697,-623964.433955666,61288.0439234339)
(-199231.346935192,-685091.576006702,94878.2597400028)
(-250017.767782847,-779676.517877069,-153399.792790371)
(-183647.968212978,-625957.818502647,-181598.551893063)
(-133365.663408192,-444057.896667187,-208885.62175475)
(-74595.7898043118,-234822.277377761,-234365.380659792)
(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,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)
(-441798.483303335,741.624874598776,1182.4251772425)
(-442332.385971143,1363.70334873928,626.387467361614)
(-442793.551361909,3138.21151902168,-3968.34116768739)
(-441827.337497525,7331.02972246993,-16242.2638387767)
(-437096.794427788,16223.731215637,-42190.9430911336)
(-424929.345658605,32165.8077105947,-90676.9258029812)
(-399156.059445642,51949.9146501759,-169014.251372564)
(-349066.034369243,48608.2808460584,-260310.252287675)
(-265306.758596566,34177.6671023998,-345580.712578439)
(-145316.7663959,16806.4599117049,-399720.279468181)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-442845.553492543,-1241.51293075793,1844.18319953775)
(-443243.220744223,8.14831058221937,2457.14434500093)
(-443390.308084706,3588.77216815053,276.343930663883)
(-442047.989246575,12543.9559523797,-7376.74221985661)
(-437372.01777717,33584.7804730205,-26240.5769706978)
(-427220.483331928,79401.7050088635,-70857.0579932265)
(-407368.799748776,159989.254536065,-172329.609110579)
(-358159.811387924,131621.232628799,-274698.728847789)
(-272332.821224252,84913.6676482831,-362926.565529484)
(-148839.803857366,39235.2706419584,-416526.53408127)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-444408.008270397,-8966.70709254632,3061.8457857939)
(-444505.666432534,-7323.35847681418,6056.35591293242)
(-444072.225698518,-2454.06027494533,9241.59190989054)
(-442015.827280493,10388.3733871293,13611.8402283894)
(-437861.617685656,44475.0891491648,19568.1792895321)
(-435683.683628838,143725.361409716,9758.18492139036)
(-448861.390447656,500942.455407595,-200655.07240038)
(-392683.77678133,289442.918690782,-321381.277770078)
(-295434.084245697,161896.822680589,-408546.131394715)
(-159287.793349534,67324.6266865006,-455707.677981457)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-444978.023742185,-26174.5793033651,4699.86020957589)
(-444680.218004374,-24607.4981659791,10949.7917101017)
(-443423.503768184,-20054.7401707053,22116.9232573364)
(-440041.810730937,-8886.32978746132,47707.3765033255)
(-435532.834174459,15413.8584154897,118818.055990386)
(-451619.482185277,53611.5634763699,366983.943925358)
(-665855.562379967,294.909114853832,-412093.441276575)
(-498165.908631807,412398.138852628,-448942.201127734)
(-355059.107160394,218606.076253582,-503128.949751559)
(-182594.309588818,79275.5803844249,-523012.333183534)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-441725.648556765,-56948.1157272113,6279.13624872988)
(-441120.131327625,-55859.0512732073,15548.4016700783)
(-438915.148641121,-52708.4550760205,33340.6693224677)
(-432412.905974044,-45341.0951189299,72067.2588992431)
(-413387.612256372,-30679.3936974393,157035.533216071)
(-344465.937431547,-8895.3811268287,313665.774590529)
(-4.09932720800375e-05,2.06591235707343e-05,3.65490807117528e-05)
(-658912.10313081,167.243500512452,-642800.684691392)
(-458445.996209633,34105.6627737463,-642472.277329538)
(-217020.571477375,17521.2087988878,-602221.304655676)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-430032.720660951,-104867.275770072,7435.75301549704)
(-429352.220959703,-104492.501564827,18780.8721076307)
(-427022.885833148,-103263.584621624,40798.8295358947)
(-420164.429590383,-99963.9607441626,86854.5970681021)
(-399391.015953214,-91491.308140567,178910.292575012)
(-324098.916428621,-67926.0427692787,322594.03250878)
(-3.27141759520977e-05,3.41868139156031e-05,2.56038177827e-05)
(-619812.714914339,200.141555855638,-609098.030767913)
(-466355.624777472,-58571.0380198075,-659192.922328439)
(-223778.03287961,-38589.6338596965,-619814.524754587)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-402714.965660753,-171048.530721186,7856.90146186704)
(-402286.665146479,-171668.920450262,20104.5586665091)
(-400887.716555873,-173124.375352388,44242.991662179)
(-396977.543568537,-175964.713138122,95509.7473318201)
(-384868.112170412,-180124.59669643,202639.60124655)
(-330354.421722616,-171668.948879567,390651.469167034)
(-4.28692351031134e-05,4.48149974343135e-05,3.34622989650031e-05)
(-683184.170510118,-491707.349905455,-668015.430207584)
(-461628.828541716,-293469.670266407,-639338.582510659)
(-213769.700444288,-122824.054827943,-581383.175377527)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-350771.61441496,-250739.912446407,7321.08380829669)
(-350771.289301008,-252470.002889087,18809.6195105974)
(-351001.880845889,-256981.493341854,41610.4755611564)
(-352889.549636395,-267514.585544758,91534.2992007453)
(-364084.636572147,-294272.095988963,211226.203777779)
(-423324.061247028,-378222.051357592,562497.133019801)
(-765163.61965162,-749401.04845965,-492024.26963297)
(-514425.617241861,-491274.50576915,-470009.170604)
(-337957.918786783,-308959.356381606,-468873.912959904)
(-166002.732233365,-145185.79504789,-458768.003572192)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-265821.011397207,-329026.547229006,5672.99149398184)
(-266102.518673209,-331661.592009288,14441.2521188752)
(-267233.304033789,-338498.630625498,31220.6193484778)
(-271454.175803507,-353860.945102222,64847.6378866891)
(-286926.82682454,-388592.046382299,127252.733374981)
(-337418.696830562,-467044.039102959,191260.136581645)
(-459847.171455759,-614074.53517237,-234097.136620935)
(-338397.868333673,-466831.436826096,-287907.54373319)
(-225547.86056808,-310042.007031984,-305389.160851887)
(-114381.685002324,-154508.470343591,-313921.901135168)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-145378.856999741,-380479.24702271,3066.84183284571)
(-145624.567472552,-383519.669792436,7643.78692899579)
(-146457.785025908,-391175.554094876,15849.3120084806)
(-149105.395064794,-406932.024657959,30093.7276100171)
(-156955.22209866,-436951.404720526,48721.0977672099)
(-176079.96868322,-485559.603804258,44085.2842165372)
(-203520.258902832,-529445.676771278,-87041.0830645783)
(-164037.77035377,-442161.939063705,-131320.778686178)
(-113954.729717663,-310643.599139393,-150130.120269298)
(-59188.7700585225,-160243.684123864,-159801.926234817)
(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,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)
(-441872.845603207,-500.375568013725,574.737867882071)
(-442119.188050564,309.165934897371,52.3740124065818)
(-442039.539250297,2434.79185665843,-3136.4299558586)
(-440373.963988352,7055.84398601017,-11645.6474510438)
(-434601.235067427,15931.5829159412,-30072.7897273492)
(-420056.734411553,29907.5477606397,-64852.948735039)
(-388969.70421578,43787.5772489725,-118826.881213873)
(-331046.029106457,39577.2484908176,-176424.134967473)
(-243537.874181772,27206.1459470971,-225399.165329368)
(-129787.205994846,13306.2621809473,-254234.987911367)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-441728.43093315,-3028.02854949966,1410.53042209431)
(-442282.402649728,-1455.29352825779,2214.17179075004)
(-443027.029935434,2778.1803141851,1507.50518394967)
(-443204.435664193,12528.9884244646,-2809.19283688493)
(-441259.793534315,33124.5211152185,-16114.3552790185)
(-433480.277183833,71012.7078659489,-50959.7215324236)
(-410074.439626397,118577.973916574,-123044.478322402)
(-350035.760794368,97184.2493278061,-188775.529752947)
(-256519.786798493,61901.557976145,-239283.976207757)
(-136098.971335464,28834.2470717809,-267552.793620496)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-440650.504787032,-9741.58400096849,2956.05196810204)
(-441766.873618654,-7697.49986784062,6459.46549380469)
(-444149.180082995,-1927.38263565265,11241.9828281194)
(-448316.678185425,12350.9465701814,17720.8755873332)
(-455656.716816701,46891.9625529299,21748.533280666)
(-467473.382005446,127943.494694508,-3392.55517128413)
(-473352.136054387,284115.699677541,-144439.535325518)
(-400009.573128215,184116.665242983,-224046.154893818)
(-287673.141770303,102385.761406375,-272291.300799436)
(-150418.276422685,44054.9820103932,-296381.552664898)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-436690.672474215,-23025.893212646,4996.95794370809)
(-438532.90287447,-21088.7621877046,12240.9051336674)
(-443125.665326222,-15517.991348644,25533.6754046957)
(-453243.056491221,-1163.70367272696,52249.5714078927)
(-476879.84880876,37722.3842784705,102766.164316655)
(-534623.915669686,160977.196844052,152736.895651521)
(-650989.668893368,666424.686430704,-244437.984588235)
(-504548.683172778,251869.735687652,-305808.280491927)
(-343191.587662421,115337.463984572,-330627.502568097)
(-173608.236016123,44880.1889027611,-340438.783033162)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-426619.095633679,-45092.1688646948,6959.72272896261)
(-429208.74898,-43903.6925528161,17863.2707464492)
(-435930.5788628,-40584.2941529876,39945.0037724749)
(-451936.472957843,-32872.1290526267,91176.9961361718)
(-494035.484206318,-16460.1847691947,226007.437133785)
(-627311.734552182,11692.8307538408,658137.600344638)
(-1157774.19019566,94.9879890047981,-659040.590745887)
(-663158.599550948,39468.7270370321,-442393.085675125)
(-410733.883952085,26318.5569060148,-401086.290854117)
(-198782.690419683,10814.3585705511,-385258.341579603)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-406079.355410596,-77252.0321278906,8206.49801284371)
(-409166.09714141,-77125.1014424016,21241.7830841384)
(-417283.208544116,-76808.9536866753,47726.7653287941)
(-436502.833731014,-76476.7473571549,107669.787773951)
(-485706.729952945,-76664.7929743496,254190.109978834)
(-630904.372225005,-73839.9443982282,646528.340927292)
(-1134029.27235137,452.523596748961,-619736.450347934)
(-681549.227612684,-62897.0458197873,-455634.164792767)
(-425308.837192802,-53706.5430254408,-416655.852445976)
(-205008.934854201,-28514.4594765862,-396096.132424242)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-369586.044703353,-118769.499325188,8388.54623989676)
(-372827.01674407,-119828.660745494,21632.4571405828)
(-381345.833891321,-122896.196708111,48177.8174974691)
(-401358.07267426,-131523.423649436,107605.022895477)
(-452093.23896258,-158942.74660634,257108.103319634)
(-603711.596863249,-264214.342856589,720839.676918633)
(-1180014.90411773,-764530.022008873,-683154.648724416)
(-660155.334618763,-322592.725347351,-446487.805088216)
(-400747.329565048,-169566.122895204,-391509.724195118)
(-191233.313462704,-74909.9304148054,-367650.640238483)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-311542.689639556,-165389.554507961,7391.13040736987)
(-314498.111769031,-167399.897866618,18689.1899965155)
(-322145.74294508,-172818.071603126,39754.9269907229)
(-339301.522182095,-185704.929122148,80348.4050091347)
(-377917.492200021,-216710.218221568,151948.732252236)
(-464284.502742261,-291887.557407613,220582.388298495)
(-624167.965022508,-443638.475475847,-241304.812863645)
(-469835.574748321,-314934.10651202,-293553.474192519)
(-307777.90585997,-196342.554718648,-296957.055295892)
(-151584.700907569,-93441.0818389866,-292843.935197497)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-228498.804469998,-208140.540766912,5428.77933174311)
(-230715.23696907,-210741.325332157,13382.925093144)
(-236370.070370531,-217319.812566943,27021.432393702)
(-248425.936399042,-231127.535387301,49415.7992543882)
(-272712.639413383,-258262.165669916,76753.5592915774)
(-315993.806787438,-305350.112815457,68791.2246562968)
(-364579.954473765,-357425.574704729,-112688.893096817)
(-298728.19559096,-292216.047649513,-175076.624702035)
(-204412.213639548,-198297.786139101,-194257.040210108)
(-103186.047496669,-99240.454778657,-199653.304776095)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-121745.293603766,-234609.521593558,2835.4174306721)
(-122931.332374793,-237424.887061114,6825.7440618683)
(-125879.025543178,-244280.34407773,13207.5160899271)
(-131880.831840947,-257419.014029645,22274.4315084219)
(-142876.723968052,-279668.789989653,29602.5576975484)
(-159276.810873752,-309174.371695703,16623.6587683234)
(-171060.112031693,-325653.262646408,-47608.8001611368)
(-144700.707459306,-277880.639027786,-81281.2716773284)
(-101615.439515648,-196529.224090211,-95389.1239282338)
(-52123.0971969246,-100985.435883853,-100709.815684635)
(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,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)
(-441621.223746084,-526.16287779455,274.541020671811)
(-441861.900123872,1.39426851847318,15.8588254625761)
(-441798.171891034,1351.47444071436,-1576.98297451392)
(-440168.337989965,4168.15639699336,-5950.76536989494)
(-434155.348605266,9236.17577940818,-15632.8276114603)
(-418391.16260228,16496.4620044708,-33794.861425203)
(-384600.550302678,22713.0063163759,-60877.0216546843)
(-323791.343099834,20644.3281096394,-88776.0357709458)
(-235178.533797568,14290.1934064314,-111425.56956158)
(-123981.534305396,7032.49540036669,-124263.736651398)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-440943.70549577,-2112.13385557842,801.245540402648)
(-441737.469877535,-1106.58219418943,1364.28923091769)
(-443095.78707094,1558.28381481356,1226.23699232752)
(-444293.526526131,7403.97185575769,-920.48760450164)
(-443343.086252982,18783.3809241643,-8384.40003058857)
(-434905.834241254,37113.1418025838,-27575.5227712797)
(-407373.579345145,55391.6682807428,-62955.0450168993)
(-344517.294384767,47298.417031458,-95127.6003483168)
(-249523.719984613,30843.8274707968,-118677.301226558)
(-131033.128961054,14587.845367545,-131298.493568143)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-438676.641075388,-5885.72129648893,1799.72372926835)
(-440504.752613547,-4591.94406489373,4022.96459486819)
(-444624.508954972,-981.130737823534,7037.70801948276)
(-451731.819862213,7449.2250653346,10407.5964866965)
(-462197.755473273,25794.3213830061,9937.69468443049)
(-472127.804925158,60994.4359646055,-9289.17655787888)
(-462883.951425574,106679.990665271,-71045.6835712194)
(-391924.333586262,79733.7538441083,-111566.259925821)
(-280459.880167667,46945.6047215476,-134881.298779213)
(-145708.08285208,20872.2277598388,-145875.87474211)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-432669.022575165,-13025.0690372825,3117.69784174373)
(-435829.212219919,-11808.862906027,7630.92602832403)
(-443622.905400347,-8314.42874389042,15461.4641085174)
(-459282.292128449,226.39733339803,28723.5274776809)
(-488174.393523745,20714.5737626472,45097.819813027)
(-533373.401303639,68477.0987940404,36364.6426175434)
(-569811.119724708,159852.941649566,-97986.8575354133)
(-471862.932074977,93433.0889492395,-144371.943738346)
(-327530.782681104,47871.0922934556,-160958.236291574)
(-166637.711157186,19701.7697443499,-166758.30313502)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-419586.711894252,-24461.0850401367,4403.63226342672)
(-424049.83375371,-23749.0251682195,11184.8792993282)
(-435377.069847881,-21743.73426079,24060.6758013085)
(-459659.755524582,-17216.8759925501,49227.2316939948)
(-509065.150146393,-7876.70726877808,92848.1786654937)
(-602058.062837875,8353.38485379419,127718.220891431)
(-729846.726672815,24062.2857327501,-164418.586714603)
(-565449.806378097,21256.0719563967,-189950.362894602)
(-375518.850656211,11839.3426780271,-189133.646575052)
(-186394.969964312,4614.91452188254,-186434.511807953)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-395192.858245153,-40534.4932468934,5186.91104131007)
(-400437.195366792,-40538.3097899803,13247.2938884525)
(-413841.589589802,-40581.3863625566,28643.3270359037)
(-442653.682784801,-41018.8207568795,58596.1208540185)
(-501388.012383608,-42696.1711608044,109096.867176709)
(-610603.156127712,-46296.2721937654,143445.308126972)
(-754070.531615135,-45226.7261703641,-167224.420706134)
(-586816.0719813,-41319.6823787641,-199381.822002354)
(-387411.212584481,-29050.220510773,-196389.88342188)
(-191020.164097108,-14687.085893404,-191076.65376369)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-354849.364649327,-60513.1568396821,5241.98353876281)
(-360126.697564275,-61260.6762976487,13264.0308666368)
(-373514.710198156,-63422.089427947,28273.6102388592)
(-401910.302614296,-69145.8258882464,56952.845310263)
(-458982.492534186,-84387.3691396732,105533.296860736)
(-564582.745688269,-124415.068118134,144523.241610121)
(-709066.030229672,-208326.638924616,-163325.719523669)
(-545633.00594775,-132049.760199645,-187117.970373807)
(-358435.884391383,-76432.2024014504,-182047.433656791)
(-176376.568710809,-35151.3521091116,-176439.912192979)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-294516.642188615,-82058.9813594413,4519.77706881825)
(-299068.541437978,-83333.0857151147,11162.6161552314)
(-310327.435474397,-86746.6657633989,22668.8850199997)
(-333058.882749422,-94514.1729221943,41794.5926212749)
(-374916.507868311,-111173.597714004,65579.8368638966)
(-440499.787340246,-143269.668171058,60649.7215148025)
(-501034.902707385,-183748.168048115,-87061.8116768178)
(-413807.172535986,-143585.53515325,-131554.438935541)
(-282173.200341169,-92768.4004619903,-140822.946393805)
(-141327.554747856,-44905.2059273352,-141326.238735294)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-212764.591904688,-101042.56056894,3249.36664418769)
(-215993.265734336,-102597.999220207,7792.30891454608)
(-223843.63102439,-106476.197281027,14995.4010860329)
(-238874.699022364,-114244.362768746,25174.3535559059)
(-264082.444915706,-128111.33318726,33481.8945314846)
(-297577.327451598,-148355.423672661,20151.1706972469)
(-317592.12892533,-163650.768762864,-46934.0541364406)
(-270496.00769817,-137946.024752236,-80805.7524302465)
(-189632.16379356,-95290.6572206577,-93063.5455175708)
(-96564.0845033279,-48037.3169826696,-96553.3974555786)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-112033.341756817,-112435.409522062,1680.89710617198)
(-113706.218893725,-114063.348310719,3921.1327156174)
(-117690.343865168,-117984.603939676,7240.85769625669)
(-124986.532606996,-125211.877375941,11314.0730695016)
(-136326.248602771,-136551.21716125,13203.4816782112)
(-149521.60817914,-149698.046595489,4790.90190642868)
(-154202.925556023,-154391.481144298,-21325.5721878082)
(-132785.104319764,-132957.411817512,-38229.7882620739)
(-94538.7909170801,-94702.7060169237,-45894.3880643747)
(-48662.0282782168,-48742.2330227825,-48650.5409429701)
(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,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,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)
(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,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,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)
(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,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,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)
(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)
)
;
boundaryField
{
fuel
{
type fixedValue;
value uniform (0.1 0 0);
}
air
{
type fixedValue;
value uniform (-0.1 0 0);
}
outlet
{
type zeroGradient;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //
| [
"huberlulu@gmail.com"
] | huberlulu@gmail.com | |
8e2e193a61148565e284c62a480eed579dd12df0 | e5a00cbfbf112f59c55896aa64bda0818c84172a | /dogbot_pkg/src/dogBotServer.cc | 11745114c735dc690411eb6527c89f1c7d9e6e3b | [] | no_license | eborghi10/dogbot_tc | c614f0d9faa5b91e2481af76b8c967b89f334f39 | 3a268ebee641ef9841c76605dd5996b961afab3e | refs/heads/master | 2020-09-28T11:37:43.790503 | 2019-12-09T02:53:21 | 2019-12-09T02:53:21 | 226,770,816 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 3,657 | cc |
#include <iostream>
#include <unistd.h>
#include <getopt.h>
#include "dogbot/ComsSerial.hh"
#include "dogbot/DogBotAPI.hh"
#include "dogbot/ComsZMQServer.hh"
#include "dogbot/ComsRecorder.hh"
#include "dogbot/ComsRoute.hh"
#include "dogbot/PlatformManager.hh"
#include "cxxopts.hpp"
#include <sched.h>
#define DODEBUG 0
#if DODEBUG
#define ONDEBUG(x) x
#else
#define ONDEBUG(x)
#endif
// This provides a network interface for controlling the servos via ZMQ.
int main(int argc,char **argv)
{
std::string devFilename = "usb";
std::string devIMUFilename = ""; //"/dev/ttyUSB1";
std::string configFile = DogBotN::DogBotAPIC::DefaultConfigFile();
std::string logFile;
std::string zmqAddress = "tcp://*";
bool managerMode = true;
auto logger = spdlog::stdout_logger_mt("console");
struct sched_param params;
params.sched_priority = 50;
// This should
#if defined(__APPLE__)
#elif defined(__linux__)
int ret;
if((ret = sched_setscheduler(0,SCHED_RR,¶ms)) < 0) {
logger->warn("Failed to set priority. Error:{} ",strerror(errno));
}
#endif
try
{
cxxopts::Options options(argv[0], "DogBot hardware manager");
options
.positional_help("[optional args]")
.show_positional_help();
options.add_options()
("m,manager", "Manager mode, allowing allocation of device ids", cxxopts::value<bool>(managerMode))
("c,config", "Configuration file", cxxopts::value<std::string>(configFile))
("d,device", "Device to use for communication ", cxxopts::value<std::string>(devFilename))
("i,imu", "Device to use for IMU communication ", cxxopts::value<std::string>(devIMUFilename))
("l,log" , "File to use for communication log ", cxxopts::value<std::string>(logFile))
("n,net" , "Address to offer service on ", cxxopts::value<std::string>(zmqAddress))
("h,help", "Print help")
;
auto result = options.parse(argc, argv);
if (result.count("help"))
{
std::cout << options.help({""}) << std::endl;
exit(0);
}
} catch (const cxxopts::OptionException& e)
{
std::cout << "error parsing options: " << e.what() << std::endl;
exit(1);
}
ONDEBUG(logger->info("Starting dogBotServer"));
logger->info("Manager mode: {}",managerMode);
logger->info("Using config file: '{}'",configFile);
logger->info("Using communication type: '{}'",devFilename);
logger->info("Communication log: '{}'",logFile);
std::shared_ptr<DogBotN::ComsRouteC> coms = std::make_shared<DogBotN::ComsRouteC>();
if(!coms->Open(devFilename)) {
logger->error("Failed to open {} ",devFilename);
return 1;
}
if(!devIMUFilename.empty()) {
if(!coms->Open(devIMUFilename)) {
logger->error("Failed to open {} ",devIMUFilename);
return 1;
}
}
std::shared_ptr<DogBotN::ComsC> pureComs(coms);
std::shared_ptr<DogBotN::DogBotAPIC> dogbot = std::make_shared<DogBotN::DogBotAPIC>(
pureComs,
DogBotN::DogBotAPIC::DefaultConfigFile(),
logger,
false,
managerMode ? DogBotN::DogBotAPIC::DMM_DeviceManager : DogBotN::DogBotAPIC::DMM_ClientOnly
);
if(1) {
std::shared_ptr<DogBotN::PlatformManagerC> platformManager = std::make_shared<DogBotN::PlatformManagerC>(dogbot);
coms->AddComs(platformManager);
platformManager->Init();
}
DogBotN::ComsZMQServerC server(pureComs,logger);
std::shared_ptr<DogBotN::ComsRecorderC> logRecorder;
if(!logFile.empty()) {
logRecorder = std::make_shared<DogBotN::ComsRecorderC>(pureComs,logger,logFile);
logRecorder->Start();
}
ONDEBUG(logger->info("Setup and ready. "));
server.Run(zmqAddress);
return 0;
}
| [
"duckfrost@gmail.com"
] | duckfrost@gmail.com |
40de8ffec80bb7c62fda0b44c520e8e4c27ae990 | 86bc88eafbce6f933c42910c1ba43eac926c0534 | /shield.h | c229f53a88761c519e7193e674befe9deb8c515e | [] | no_license | gagrigoryan/qt_practice | fe3709cbc27ca79a420fee82bd4d56d9ae659622 | 850e6f77c42979192d5d2702e365a889fafdafa3 | refs/heads/master | 2022-11-18T09:18:28.392287 | 2020-06-28T17:54:47 | 2020-06-28T17:54:47 | 275,585,814 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 311 | h | #ifndef SHIELD_H
#define SHIELD_H
#include "item.h"
class Shield : public Item
{
public:
Shield(QString name, QString description, int price, int shiledLevel);
bool useOnce() override;
void consume(Hero *hero) override;
int getShield();
private:
int shiledLevel;
};
#endif // SHIELD_H
| [
"grigoryang085@gmail.com"
] | grigoryang085@gmail.com |
78307c92f9df9a44a1b7836c89b724d56fbb2d08 | b6926a3e90d5f2322cf96e3819415d50a58097e2 | /hackerrank_quicksort_partition.cpp | bb6d9bea787b02649fbe682e13a1609971565198 | [] | no_license | AbhJ/some-cp-files-1 | 67c6814037e6cbc552119f3d2aa4077616b88667 | 04e7e62ac7d211bb38dd77dc44558a631805c501 | refs/heads/master | 2023-07-05T16:36:56.770787 | 2021-09-03T12:50:13 | 2021-09-03T12:50:13 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,103 | cpp | #include <bits/stdc++.h>
#define ll long long int
#define pb push_back
#define ibs ios_base::sync_with_stdio(false)
#define cti cin.tie(0)
#define bp __builtin_popcount
using namespace std;//coded by abhijay mitra
const int N=2e7+3;
const int M = 1000000007; // modulo
// ll dp[1000][1000];
ll powM(ll b, int p) {
ll r=1;
for(; p; b=b*b%M, p/=2)
if(p&1)
r=r*b%M;
return r;
}
vector<int> fact(int n)
{
vector<int> v;
for(int i=1;i<=sqrt(n);++i)
{
if(n%i==0)
{
v.push_back(i);
if(i*i!=n)
v.push_back(n/i);
}
}
sort(v.begin(),v.end());
reverse(v.begin(),v.end());
return v;
}
//using manacher's algorithm
void solve(){
int n;cin>>n;std::vector<int> v(n);
for (int i = 0; i < n; ++i)cin>>v[i];
int x=v[0];int i=n-1;
for (int j = n-1; j > 0; --j)
{
if(v[j]>=x)swap(v[i],v[j]),i--;
}
swap(v[i],v[0]);
for (int i = 0; i < n; ++i)
{
cout<<v[i]<<" ";
}
}
int main()
{
ibs;cti;
solve();
cout<<"\n";
return 0;
} | [
"abhijay.mitra@iitkgp.ac.in"
] | abhijay.mitra@iitkgp.ac.in |
797f13f39285cbe3114ffc0ed2045ef5c692c4a2 | 037d518773420f21d74079ee492827212ba6e434 | /blazetest/src/mathtest/dvecdveccross/VHbV3a.cpp | 26bf295f61f6674d47d8f390d317030271618c93 | [
"BSD-3-Clause"
] | permissive | chkob/forked-blaze | 8d228f3e8d1f305a9cf43ceaba9d5fcd603ecca8 | b0ce91c821608e498b3c861e956951afc55c31eb | refs/heads/master | 2021-09-05T11:52:03.715469 | 2018-01-27T02:31:51 | 2018-01-27T02:31:51 | 112,014,398 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,714 | cpp | //=================================================================================================
/*!
// \file src/mathtest/dvecdveccross/VHbV3a.cpp
// \brief Source file for the VHbV3a dense vector/dense vector cross product math test
//
// Copyright (C) 2012-2018 Klaus Iglberger - All Rights Reserved
//
// This file is part of the Blaze library. You can redistribute it and/or modify it under
// the terms of the New (Revised) BSD License. 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 names of the Blaze development group nor the names of its contributors
// may be used to endorse or promote products derived from this software without specific
// prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
// SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
// DAMAGE.
*/
//=================================================================================================
//*************************************************************************************************
// Includes
//*************************************************************************************************
#include <cstdlib>
#include <iostream>
#include <blaze/math/HybridVector.h>
#include <blaze/math/StaticVector.h>
#include <blazetest/mathtest/Creator.h>
#include <blazetest/mathtest/dvecdveccross/OperationTest.h>
#include <blazetest/system/MathTest.h>
//=================================================================================================
//
// MAIN FUNCTION
//
//=================================================================================================
//*************************************************************************************************
int main()
{
std::cout << " Running 'VHbV3a'..." << std::endl;
using blazetest::mathtest::TypeA;
using blazetest::mathtest::TypeB;
try
{
// Vector type definitions
typedef blaze::HybridVector<TypeB,3UL> VHb;
typedef blaze::StaticVector<TypeA,3UL> V3a;
// Creator type definitions
typedef blazetest::Creator<VHb> CVHb;
typedef blazetest::Creator<V3a> CV3a;
// Running the tests
RUN_DVECDVECCROSS_OPERATION_TEST( CVHb( 3UL ), CV3a() );
}
catch( std::exception& ex ) {
std::cerr << "\n\n ERROR DETECTED during dense vector/dense vector cross product:\n"
<< ex.what() << "\n";
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
//*************************************************************************************************
| [
"klaus.iglberger@gmail.com"
] | klaus.iglberger@gmail.com |
12493525fa3abcf7a63492c6e65f2517b7bcc5d2 | ed26e4b990a614534f2ee3d4b736ff98e09d2333 | /UJ/DX3D220201022/DX3D/cDeviceManager.cpp | b5b244fe5da722a79b397cdaa67e12c84e342964 | [] | no_license | wnddpd01/InhaDirectXTeam | f0b629a055b87fe0d9c14f7ba524ae9ee5a367c9 | 07a8e10d608e51e0f5f352e9878152a8639b427a | refs/heads/master | 2023-03-09T04:51:27.880194 | 2021-03-04T08:43:38 | 2021-03-04T08:43:38 | 298,210,936 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,080 | cpp | #include "stdafx.h"
#include "cDeviceManager.h"
cDeviceManager::cDeviceManager()
: m_pD3D(NULL)
, m_pD3DDevice(NULL)
{
m_pD3D = Direct3DCreate9(D3D_SDK_VERSION);
D3DCAPS9 stCaps;
int nVertexProcessing;
m_pD3D->GetDeviceCaps(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &stCaps);
if (stCaps.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT)
{
nVertexProcessing = D3DCREATE_HARDWARE_VERTEXPROCESSING;
}
else
{
nVertexProcessing = D3DCREATE_SOFTWARE_VERTEXPROCESSING;
}
D3DPRESENT_PARAMETERS stD3DPP;
ZeroMemory(&stD3DPP, sizeof(D3DPRESENT_PARAMETERS));
stD3DPP.SwapEffect = D3DSWAPEFFECT_DISCARD;
stD3DPP.Windowed = TRUE;
stD3DPP.BackBufferFormat = D3DFMT_UNKNOWN;
stD3DPP.EnableAutoDepthStencil = TRUE;
stD3DPP.AutoDepthStencilFormat = D3DFMT_D16;
m_pD3D->CreateDevice(D3DADAPTER_DEFAULT,
D3DDEVTYPE_HAL, g_hWnd,
nVertexProcessing, &stD3DPP,
&m_pD3DDevice);
}
cDeviceManager::~cDeviceManager()
{
}
LPDIRECT3DDEVICE9 cDeviceManager::GetDevice()
{
return m_pD3DDevice;
}
void cDeviceManager::Destroy()
{
SafeRelease(m_pD3D);
SafeRelease(m_pD3DDevice);
}
| [
"kmj2942@naver.com"
] | kmj2942@naver.com |
fd5ec299ec85f6292d0cdf52bbf40d1e99786884 | 30ab1090ba15c433f08bbff0a795bcca5817c023 | /jni/game/TrackSelectScene.cpp | e7a2af690eee0072fd0af71a04b111be539632c0 | [] | no_license | dnuffer/redneckracer | 0c8e2efea148057bfbb81c689f0c81f5f430526b | f298e0fcda169829ffc7002165d38613eafc6ee8 | refs/heads/master | 2021-01-01T06:11:42.520020 | 2012-07-06T04:42:21 | 2012-07-06T04:42:21 | 4,918,963 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,515 | cpp | // Copyright 2011 Nuffer Brothers Software LLC. All Rights Reserved.
#include "RRConfig.hpp"
#include "RRFwd.hpp"
#include "TrackSelectScene.hpp"
#include "RaceTracks.hpp"
#include "RaceScene.hpp"
#include "Globals.hpp"
#include "BestTimes.hpp"
#include "boost/foreach.hpp"
#define foreach BOOST_FOREACH
#include "engine/Rectangle.hpp"
#include "engine/DrawableRectangle.hpp"
#include "engine/Log.hpp"
#include "engine/Label.hpp"
namespace rr
{
TrackSelectScene::TrackSelectScene(GameLibrary& gameLibrary, const BestTimesPtr& bestTimes)
: gameLibrary(gameLibrary)
, m_bestTimes(bestTimes)
{
drawBackground();
loadButtons();
}
TrackSelectScene::~TrackSelectScene() {}
void TrackSelectScene::update(const DateTime& thisFrameStartTime, const TimeDuration& deltaTime)
{
Scene::update(thisFrameStartTime, deltaTime);
}
void TrackSelectScene::handleTouchEvent(const TouchEvent& touchEvent)
{
foreach(TouchButtonPtr button, touchButtons)
{
if (button->checkHit(touchEvent.x, touchEvent.y) &&
(touchEvent.action == 0 || touchEvent.action == 2))
{
button->setState(TouchHandler::Touched);
}
else if (button->getState() == TouchHandler::Touched)
{
button->setState(TouchHandler::Untouched);
}
}
}
void TrackSelectScene::handleActivated()
{
removeAllChildren();
drawBackground();
loadButtons();
}
void TrackSelectScene::drawBackground()
{
//background
SpritePtr background = gameLibrary.loadingSprite("MainBackground");
addChild(background, backgroundZOrder);
background->setPositionInterpretation(Drawable::E_SCREEN);
//faded background mask
dimmedBackground = new DrawableRectangle(480.0, 800.0);
dimmedBackground->setColor(0.1, 0.1, 0.1, 0.7);
dimmedBackground->setPosition(Point(DefaultScreenLeft, DefaultScreenBottom));
dimmedBackground->setPositionInterpretation(Drawable::E_SCREEN);
addChild(dimmedBackground, backgroundZOrder);
}
void TrackSelectScene::loadButtons()
{
gameLibrary.loadTrackSelectButtons();
// Title
title = gameLibrary.loadingSprite("TrackSelectMenuTitle");
title->setPosition(Point(0, DefaultScreenTop - (title->size().height() / 2) - 15));
addChild(title, backgroundZOrder);
title->setPositionInterpretation(Drawable::E_SCREEN);
// Yankee Shot
yankeeShotButton = gameLibrary.trackSelectButton(GameLibrary::E_YANKEE_SHOT);
Rectangle rect = yankeeShotButton->getBoundingRect();
float leftPos = -(rect.right - rect.left) / 2;
yankeeShotButton->setPosition(Point(leftPos + (rect.right - rect.left) / 2 - 40, DefaultScreenTop/2));
yankeeShotButton->getUnTouchedEvent().connect(boost::bind(&TrackSelectScene::yankeeShotButtonActionUp, this, _1));
prepareButton(yankeeShotButton);
addBestTimeLabel(RaceTracks::YANKEESHOT, yankeeShotButton->getBoundingRect().bottom);
// Everwhichaways
everwhichawaysButton = gameLibrary.trackSelectButton(GameLibrary::E_EVERWHICHAWAYS);
rect = everwhichawaysButton->getBoundingRect();
everwhichawaysButton->setPosition(Point(leftPos + (rect.right - rect.left) / 2 - 40, yankeeShotButton->getBoundingRect().bottom-(rect.top-rect.bottom)/2 - 55));
everwhichawaysButton->getUnTouchedEvent().connect(boost::bind(&TrackSelectScene::everwhichawaysButtonActionUp, this, _1));
prepareButton(everwhichawaysButton);
addBestTimeLabel(RaceTracks::EVERWHICHAWAYS, everwhichawaysButton->getBoundingRect().bottom);
// Uhmurkin
uhmurkinButton = gameLibrary.trackSelectButton(GameLibrary::E_UHMURKIN);
rect = uhmurkinButton->getBoundingRect();
uhmurkinButton->setPosition(Point(leftPos + (rect.right - rect.left) / 2 - 40, everwhichawaysButton->getBoundingRect().bottom-(rect.top-rect.bottom)/2 - 55));
uhmurkinButton->getUnTouchedEvent().connect(boost::bind(&TrackSelectScene::uhmurkinButtonActionUp, this, _1));
prepareButton(uhmurkinButton);
addBestTimeLabel(RaceTracks::UHMURKIN, uhmurkinButton->getBoundingRect().bottom);
// Dadgum Trakturs
dadgumTraktursButton = gameLibrary.trackSelectButton(GameLibrary::E_DADGUM_TRAKTURS);
rect = dadgumTraktursButton->getBoundingRect();
dadgumTraktursButton->setPosition(Point(leftPos + (rect.right - rect.left) / 2 - 40, uhmurkinButton->getBoundingRect().bottom-(rect.top-rect.bottom)/2 - 55));
dadgumTraktursButton->getUnTouchedEvent().connect(boost::bind(&TrackSelectScene::dadgumTraktursButtonActionUp, this, _1));
prepareButton(dadgumTraktursButton);
addBestTimeLabel(RaceTracks::DADGUMTRAKTURS, dadgumTraktursButton->getBoundingRect().bottom);
// Real Bammer
realBammerButton = gameLibrary.trackSelectButton(GameLibrary::E_REAL_BAMMER);
rect = realBammerButton->getBoundingRect();
realBammerButton->setPosition(Point(leftPos + (rect.right - rect.left) / 2 - 40, dadgumTraktursButton->getBoundingRect().bottom-(rect.top-rect.bottom)/2 - 55));
realBammerButton->getUnTouchedEvent().connect(boost::bind(&TrackSelectScene::realBammerButtonActionUp, this, _1));
prepareButton(realBammerButton);
addBestTimeLabel(RaceTracks::REALBAMMER, realBammerButton->getBoundingRect().bottom);
// Wijadidja
wijadidjaButton = gameLibrary.trackSelectButton(GameLibrary::E_WIJADIDJA);
rect = wijadidjaButton->getBoundingRect();
wijadidjaButton->setPosition(Point(leftPos + (rect.right - rect.left) / 2 - 40, realBammerButton->getBoundingRect().bottom-(rect.top-rect.bottom)/2 - 55));
wijadidjaButton->getUnTouchedEvent().connect(boost::bind(&TrackSelectScene::wijadidjaButtonActionUp, this, _1));
prepareButton(wijadidjaButton);
addBestTimeLabel(RaceTracks::WIJADIDJA, wijadidjaButton->getBoundingRect().bottom);
// Back Button
backButton = gameLibrary.button(GameLibrary::Menu);
rect = backButton->getBoundingRect();
backButton->setPosition(Point(DefaultScreenRightPad - rect.width() / 2, DefaultScreenTopPad - rect.height() / 2));
backButton->getUnTouchedEvent().connect(boost::bind(&TrackSelectScene::backButtonActionUp, this, _1));
prepareButton(backButton);
}
void TrackSelectScene::prepareButton(TouchButtonPtr button)
{
button->setPositionInterpretation(Drawable::E_SCREEN);
touchButtons.push_back(button);
addChild(button, hudZOrder);
}
void TrackSelectScene::addBestTimeLabel(RaceTracks::Races trackType, float yUpper)
{
if (m_bestTimes->getTime(trackType) != INT_MAX)
{
LabelPtr bestTime(new Label(gameLibrary.theMilkmanConspiracyFont()));
bestTime->setText(Format("Best Time: %1 seconds", m_bestTimes->getTime(trackType)));
Size textSize = bestTime->size();
bestTime->setPosition(Point(-150 + textSize.width() / 2, yUpper - textSize.height() / 2 - 10));
addChild(bestTime, hudZOrder);
}
}
// Action Buttons
void TrackSelectScene::backButtonActionUp(const TouchHandler&)
{
game().activeScene = game()._MainMenuScene;
}
void TrackSelectScene::yankeeShotButtonActionUp(const TouchHandler&)
{
game().startRace(RaceTracks::YANKEESHOT);
}
void TrackSelectScene::everwhichawaysButtonActionUp(const TouchHandler&)
{
game().startRace(RaceTracks::EVERWHICHAWAYS);
}
void TrackSelectScene::uhmurkinButtonActionUp(const TouchHandler&)
{
game().startRace(RaceTracks::UHMURKIN);
}
void TrackSelectScene::dadgumTraktursButtonActionUp(const TouchHandler&)
{
game().startRace(RaceTracks::DADGUMTRAKTURS);
}
void TrackSelectScene::realBammerButtonActionUp(const TouchHandler&)
{
game().startRace(RaceTracks::REALBAMMER);
}
void TrackSelectScene::wijadidjaButtonActionUp(const TouchHandler&)
{
game().startRace(RaceTracks::WIJADIDJA);
}
}
| [
"danielnuffer@gmail.com"
] | danielnuffer@gmail.com |
79b747d3e1e2a6c8675af5c127fbb0941745f4e9 | acfbf5aa22d8a7a5ef0dbd0f6440e3a7d6ec006b | /include/sysresLogger.h | 93f0b5915ac9afa98bb73a4de30fafab640d593a | [
"Apache-2.0"
] | permissive | rdkcmf/rdk-sys_mon_tools-sys_resource | cc4ea1204d875c31b52f5af557f76532b0d7b8db | 97210ea784675bcb60b11ff9c0f5fa1d40fca33c | refs/heads/master | 2023-02-05T12:42:42.517147 | 2012-08-21T16:28:17 | 2018-05-14T09:24:17 | 77,068,520 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,193 | h | /*
* If not stated otherwise in this file or this component's Licenses.txt file the
* following copyright and licenses apply:
*
* Copyright 2016 RDK Management
*
* 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 SYSRES_LOGGER_H
#define SYSRES_LOGGER_H
#include <stdlib.h>
#include "zmalloc.h"
class SysResLogger
{
public:
SysResLogger(size_t bufferLength, char *filename=0);
~SysResLogger() { zfree(logBuffer); zfree(filename); }
void SetFilename(const char *postfix, const char *ext);
void Log(size_t length, char *filename=0);
protected:
char *logBuffer;
size_t bufferLength;
char *filename;
private:
static int counter;
};
#endif // SYSRES_LOGGER_H
| [
"jim.lawton@accenture.com"
] | jim.lawton@accenture.com |
764085961460a8c13cf93da014d635a5aea73041 | 5a8bf8d140fa5aa3acc6a8e335f4f2f0974931fc | /uva/124 - Following Orders.cpp | e4c3dfb86623fb6b9de9f27d563f8c55ad5a8e8c | [
"MIT"
] | permissive | taufique71/sports-programming | 72dbec005f790d8f6b55d1fb030cc3d50ffe7df2 | c29a92b5e5424c7de6f94e302fc6783561de9b3d | refs/heads/master | 2020-03-25T04:43:54.418420 | 2019-10-10T19:51:40 | 2019-10-10T19:51:40 | 134,890,558 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,949 | cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#define MAX 30
using namespace std;
bool graph[MAX][MAX];
bool color[150];
char res[MAX];
int n_res;
char nodes[MAX];
int n_nodes;
void backtrack(int n)
{
if(n >= n_nodes)
{
res[n_res] = '\0';
for(int i =0 ; i < n_res ; i++) cout << res[i];
cout << endl;
return;
}
int i,j;
bool flag;
for(i = 0 ; i < n_nodes ; i++)
{
if(color[nodes[i]] == true)
{
flag = true;
for(j = 0 ; j < MAX ; j++)
{
if(graph[j][nodes[i]-'a'] == true && color[j+'a'] == true)
{
flag = false;
break;
}
}
if(flag == true)
{
res[n_res] = nodes[i];
n_res++;
color[nodes[i]] = false;
backtrack(n+1);
color[nodes[i]] = true;
n_res--;
}
}
}
}
int main()
{
int i,j;
char input[100];
char order[500];
bool flag = false;
while(gets(input))
{
gets(order);
memset(color,false,sizeof(color));
memset(graph,false,sizeof(graph));
n_nodes = 0;
for(i = 0 ; input[i] ; i++)
{
if(input[i]!=' ')
{
nodes[n_nodes] = input[i];
color[input[i]] = true;
n_nodes++;
}
}
sort(nodes,nodes+n_nodes);
int len = strlen(order);
for(j = 0; (j < len)&&(j+2 < len) ; j+=4)
{
if((order[j]-'a' >= 0) && (order[j+2]-'a' >= 0)) graph[order[j]-'a'][order[j+2]-'a'] = true;
}
if(flag) cout << endl;
backtrack(0);
flag = true;
}
return 0;
}
| [
"taufique71@gmail.com"
] | taufique71@gmail.com |
3d87a9c2f041f28d1be47572711d565c8719f170 | 53dca6f1339a6a4f0714c0d08a45264e495378a6 | /Clove/include/Clove/Graphics/OpenGL/GLGraphicsFactory.hpp | 9a7aaf7727f8f4bfc5e3fe851eeb79de4be8a9d5 | [
"MIT"
] | permissive | MORTAL2000/Garlic | c477b1823a1a788dfb2f5751d4a5f9a15ec14964 | abce2dccd2284e179d912442fceefb989199d8ac | refs/heads/master | 2021-01-08T23:07:04.770709 | 2020-02-21T08:59:28 | 2020-02-21T08:59:28 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,335 | hpp | #pragma once
#include "Clove/Graphics/Core/GraphicsFactory.hpp"
namespace clv::gfx::ogl{
class GLGraphicsFactory : public GraphicsFactory{
//FUNCTIONS
public:
GLGraphicsFactory();
GLGraphicsFactory(const GLGraphicsFactory& other) = delete;
GLGraphicsFactory(GLGraphicsFactory&& other) = delete;
GLGraphicsFactory& operator=(const GLGraphicsFactory& other) = delete;
GLGraphicsFactory& operator=(GLGraphicsFactory&& other) = delete;
virtual ~GLGraphicsFactory();
virtual std::shared_ptr<CommandBuffer> createCommandBuffer() override;
virtual std::shared_ptr<Buffer> createBuffer(const BufferDescriptor& descriptor, const void* data) override;
virtual std::shared_ptr<Texture> createTexture(const TextureDescriptor& descriptor, const std::string& pathToTexture) override;
virtual std::shared_ptr<Texture> createTexture(const TextureDescriptor& descriptor, const void* data, int32_t BPP) override;
virtual std::shared_ptr<PipelineObject> createPipelineObject() override;
virtual std::shared_ptr<RenderTarget> createRenderTarget(Texture* colourTexture, Texture* depthStencilTexture) override;
virtual std::shared_ptr<Shader> createShader(const ShaderDescriptor& descriptor, std::string_view pathToShader) override;
virtual std::shared_ptr<Surface> createSurface(void* windowData) override;
};
} | [
"wolfplayeral@yahoo.co.uk"
] | wolfplayeral@yahoo.co.uk |
31f6f43b82f60fb04c6aa1bb322f0871693ff4ff | 8021a7cfcfb153ad26068b23c50ab42803ee20e0 | /8th_task/throw_div0.cpp | 4a7398c420b1faec9be415de7609d40bf0ffa040 | [] | no_license | BasilSut/GBcpp | 4129a5e00dc3654b62d9d2ea809e1b6374f26d98 | 1345e0389140d1a4a85fedc08775deafc71d8bb3 | refs/heads/main | 2023-04-06T07:42:36.187720 | 2021-04-12T02:19:55 | 2021-04-12T02:19:55 | 346,154,620 | 0 | 0 | null | 2021-04-08T14:50:13 | 2021-03-09T21:54:26 | C++ | UTF-8 | C++ | false | false | 515 | cpp | #include <iostream>
#include <string>
using std::string;
using std::cout;
using std::endl;
using std::cerr;
template <typename T>
T divi(T x, T y)
{
string thr = "DivisionByZero";
if (y == 0)
{
throw thr;
}
return (x / y);
}
int main () {
double dividend = 12;
double divisor = 0;
double quotient = 0;
try
{
quotient = divi(dividend, divisor);
cout << quotient << endl;
} catch (string div0) {
cerr << div0 << endl;
}
return 0;
} | [
"basilsut@gmail.com"
] | basilsut@gmail.com |
1fa943fa7cdd92090752f1e8369e91059c3ed8df | 948f4e13af6b3014582909cc6d762606f2a43365 | /testcases/juliet_test_suite/testcases/CWE23_Relative_Path_Traversal/s04/CWE23_Relative_Path_Traversal__wchar_t_environment_ifstream_67b.cpp | ce81b15426102dbdc2a788650638ba7ca9a70824 | [] | no_license | junxzm1990/ASAN-- | 0056a341b8537142e10373c8417f27d7825ad89b | ca96e46422407a55bed4aa551a6ad28ec1eeef4e | refs/heads/master | 2022-08-02T15:38:56.286555 | 2022-06-16T22:19:54 | 2022-06-16T22:19:54 | 408,238,453 | 74 | 13 | null | 2022-06-16T22:19:55 | 2021-09-19T21:14:59 | null | UTF-8 | C++ | false | false | 1,805 | cpp | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE23_Relative_Path_Traversal__wchar_t_environment_ifstream_67b.cpp
Label Definition File: CWE23_Relative_Path_Traversal.label.xml
Template File: sources-sink-67b.tmpl.cpp
*/
/*
* @description
* CWE: 23 Relative Path Traversal
* BadSource: environment Read input from an environment variable
* GoodSource: Use a fixed file name
* Sinks: ifstream
* BadSink : Open the file named in data using ifstream::open()
* Flow Variant: 67 Data flow: data passed in a struct from one function to another in different source files
*
* */
#include "std_testcase.h"
#ifdef _WIN32
#define BASEPATH L"c:\\temp\\"
#else
#include <wchar.h>
#define BASEPATH L"/tmp/"
#endif
#define ENV_VARIABLE L"ADD"
#ifdef _WIN32
#define GETENV _wgetenv
#else
#define GETENV getenv
#endif
#include <fstream>
using namespace std;
namespace CWE23_Relative_Path_Traversal__wchar_t_environment_ifstream_67
{
typedef struct _structType
{
wchar_t * structFirst;
} structType;
#ifndef OMITBAD
void badSink(structType myStruct)
{
wchar_t * data = myStruct.structFirst;
{
ifstream inputFile;
/* POTENTIAL FLAW: Possibly opening a file without validating the file name or path */
inputFile.open((char *)data);
inputFile.close();
}
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodG2B uses the GoodSource with the BadSink */
void goodG2BSink(structType myStruct)
{
wchar_t * data = myStruct.structFirst;
{
ifstream inputFile;
/* POTENTIAL FLAW: Possibly opening a file without validating the file name or path */
inputFile.open((char *)data);
inputFile.close();
}
}
#endif /* OMITGOOD */
} /* close namespace */
| [
"yzhang0701@gmail.com"
] | yzhang0701@gmail.com |
921a3f82d3d4af0ee1ad79bdd2c46fb1700650c4 | cbb13131ab998bdb28459f7bbea9eef3097d1cf1 | /MainMenu.cpp | 0a6422d306efa098e688bd0f03abd092876dea73 | [] | no_license | WWPandemic/Project-FInal | af4596152b201d408aead9e281d7f0fd11381b55 | 95a1362d33b4c7ec75f7f49c193d9aa0df676e63 | refs/heads/master | 2020-03-18T10:53:48.295368 | 2018-06-20T10:55:20 | 2018-06-20T10:55:20 | 134,639,193 | 0 | 0 | null | 2018-06-18T09:04:24 | 2018-05-24T00:16:27 | C++ | UTF-8 | C++ | false | false | 1,182 | cpp | #define _CRT_SECURE_NO_WARNINGS
#include "MainMenu.h"
#include "Report.h"
#include "CashRegister.h"
#include "Inventory.h"
void MainMenu::getInput()
{
do
{
std::cout << "What would you like to do?" << std::endl;
std::string input;
getline(std::cin, input);
try {
chosenOption = std::stoi(input);
}
catch (...)
{
chosenOption = -1;
}
if (chosenOption < 0 || chosenOption > 4)
{
std::cout << "Enter a valid number" << std::endl;
}
} while (chosenOption < 0 || chosenOption > 4);
clearScreen();
}
void MainMenu::runOptions()
{
switch (chosenOption)
{
case 1:
useInventoryModule(&menuBooks);
break;
case 2:
useCashierModule(menuBooks);
break;
case 3:
useReportModule(Bundle(menuBooks));
break;
default:
isUsingMenu = false;
break;
}
}
void MainMenu::useReportModule(Bundle b)
{
Report reportMenu = Report(b);
reportMenu.runMenu();
}
void MainMenu::useCashierModule(Bundle &b)
{
CashRegister cashRegister = CashRegister(b);
cashRegister.runMenu();
}
void MainMenu::useInventoryModule(Bundle *b)
{
Inventory inventory = Inventory(b);
inventory.runMenu();
} | [
"noreply@github.com"
] | WWPandemic.noreply@github.com |
aa9018f52f1cbfda1d060cab8618e7dcdf2734d6 | 142ddd4c42dc7ff65fd9b531cfd0adbfe2a1dd34 | /export/editor/plugins/tile_set_editor_plugin.cpp | 14397ce9eace0f5f6c0d63caa556526e2eb64e21 | [
"LicenseRef-scancode-free-unknown",
"MIT",
"BSL-1.0",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"CC0-1.0",
"OFL-1.1",
"LicenseRef-scancode-unknown-license-reference",
"Unlicense",
"FTL",
"BSD-3-Clause",
"Bitstream-Vera",
"MPL-2.0",
"Zlib",
"CC-BY-4.0"
] | permissive | GhostWalker562/godot-admob-iOS-precompiled | 3fa99080f224d1b4c2dacac31e3786cebc034e2d | 18668d2fd7ea4bc5a7e84ddba36481fb20ee4095 | refs/heads/master | 2023-04-03T23:31:36.023618 | 2021-07-29T04:46:45 | 2021-07-29T04:46:45 | 195,341,087 | 24 | 2 | MIT | 2023-03-06T07:20:25 | 2019-07-05T04:55:50 | C++ | UTF-8 | C++ | false | false | 145,427 | cpp | /*************************************************************************/
/* tile_set_editor_plugin.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* 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 "tile_set_editor_plugin.h"
#include "core/os/input.h"
#include "core/os/keyboard.h"
#include "editor/editor_scale.h"
#include "editor/plugins/canvas_item_editor_plugin.h"
#include "scene/2d/physics_body_2d.h"
#include "scene/2d/sprite.h"
void TileSetEditor::edit(const Ref<TileSet> &p_tileset) {
tileset = p_tileset;
tileset->add_change_receptor(this);
texture_list->clear();
texture_map.clear();
update_texture_list();
}
void TileSetEditor::_import_node(Node *p_node, Ref<TileSet> p_library) {
for (int i = 0; i < p_node->get_child_count(); i++) {
Node *child = p_node->get_child(i);
if (!Object::cast_to<Sprite>(child)) {
if (child->get_child_count() > 0) {
_import_node(child, p_library);
}
continue;
}
Sprite *mi = Object::cast_to<Sprite>(child);
Ref<Texture> texture = mi->get_texture();
Ref<Texture> normal_map = mi->get_normal_map();
Ref<ShaderMaterial> material = mi->get_material();
if (texture.is_null())
continue;
int id = p_library->find_tile_by_name(mi->get_name());
if (id < 0) {
id = p_library->get_last_unused_tile_id();
p_library->create_tile(id);
p_library->tile_set_name(id, mi->get_name());
}
p_library->tile_set_texture(id, texture);
p_library->tile_set_normal_map(id, normal_map);
p_library->tile_set_material(id, material);
p_library->tile_set_modulate(id, mi->get_modulate());
Vector2 phys_offset;
Size2 s;
if (mi->is_region()) {
s = mi->get_region_rect().size;
p_library->tile_set_region(id, mi->get_region_rect());
} else {
const int frame = mi->get_frame();
const int hframes = mi->get_hframes();
s = texture->get_size() / Size2(hframes, mi->get_vframes());
p_library->tile_set_region(id, Rect2(Vector2(frame % hframes, frame / hframes) * s, s));
}
if (mi->is_centered()) {
phys_offset += -s / 2;
}
Vector<TileSet::ShapeData> collisions;
Ref<NavigationPolygon> nav_poly;
Ref<OccluderPolygon2D> occluder;
bool found_collisions = false;
for (int j = 0; j < mi->get_child_count(); j++) {
Node *child2 = mi->get_child(j);
if (Object::cast_to<NavigationPolygonInstance>(child2))
nav_poly = Object::cast_to<NavigationPolygonInstance>(child2)->get_navigation_polygon();
if (Object::cast_to<LightOccluder2D>(child2))
occluder = Object::cast_to<LightOccluder2D>(child2)->get_occluder_polygon();
if (!Object::cast_to<StaticBody2D>(child2))
continue;
found_collisions = true;
StaticBody2D *sb = Object::cast_to<StaticBody2D>(child2);
List<uint32_t> shapes;
sb->get_shape_owners(&shapes);
for (List<uint32_t>::Element *E = shapes.front(); E; E = E->next()) {
if (sb->is_shape_owner_disabled(E->get())) continue;
Transform2D shape_transform = sb->get_transform() * sb->shape_owner_get_transform(E->get());
bool one_way = sb->is_shape_owner_one_way_collision_enabled(E->get());
shape_transform[2] -= phys_offset;
for (int k = 0; k < sb->shape_owner_get_shape_count(E->get()); k++) {
Ref<Shape2D> shape = sb->shape_owner_get_shape(E->get(), k);
TileSet::ShapeData shape_data;
shape_data.shape = shape;
shape_data.shape_transform = shape_transform;
shape_data.one_way_collision = one_way;
collisions.push_back(shape_data);
}
}
}
if (found_collisions) {
p_library->tile_set_shapes(id, collisions);
}
p_library->tile_set_texture_offset(id, mi->get_offset());
p_library->tile_set_navigation_polygon(id, nav_poly);
p_library->tile_set_light_occluder(id, occluder);
p_library->tile_set_occluder_offset(id, -phys_offset);
p_library->tile_set_navigation_polygon_offset(id, -phys_offset);
p_library->tile_set_z_index(id, mi->get_z_index());
}
}
void TileSetEditor::_import_scene(Node *p_scene, Ref<TileSet> p_library, bool p_merge) {
if (!p_merge)
p_library->clear();
_import_node(p_scene, p_library);
}
void TileSetEditor::_undo_redo_import_scene(Node *p_scene, bool p_merge) {
_import_scene(p_scene, tileset, p_merge);
}
Error TileSetEditor::update_library_file(Node *p_base_scene, Ref<TileSet> ml, bool p_merge) {
_import_scene(p_base_scene, ml, p_merge);
return OK;
}
Variant TileSetEditor::get_drag_data_fw(const Point2 &p_point, Control *p_from) {
return false;
}
bool TileSetEditor::can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const {
Dictionary d = p_data;
if (!d.has("type"))
return false;
if (d.has("from") && (Object *)(d["from"]) == texture_list)
return false;
if (String(d["type"]) == "resource" && d.has("resource")) {
RES r = d["resource"];
Ref<Texture> texture = r;
if (texture.is_valid()) {
return true;
}
}
if (String(d["type"]) == "files") {
Vector<String> files = d["files"];
if (files.size() == 0)
return false;
for (int i = 0; i < files.size(); i++) {
String file = files[i];
String ftype = EditorFileSystem::get_singleton()->get_file_type(file);
if (!ClassDB::is_parent_class(ftype, "Texture")) {
return false;
}
}
return true;
}
return false;
}
void TileSetEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) {
if (!can_drop_data_fw(p_point, p_data, p_from))
return;
Dictionary d = p_data;
if (!d.has("type"))
return;
if (String(d["type"]) == "resource" && d.has("resource")) {
RES r = d["resource"];
Ref<Texture> texture = r;
if (texture.is_valid())
add_texture(texture);
if (texture_list->get_item_count() > 0) {
update_texture_list_icon();
texture_list->select(texture_list->get_item_count() - 1);
_on_texture_list_selected(texture_list->get_item_count() - 1);
}
}
if (String(d["type"]) == "files") {
PoolVector<String> files = d["files"];
_on_textures_added(files);
}
}
void TileSetEditor::_bind_methods() {
ClassDB::bind_method("_undo_redo_import_scene", &TileSetEditor::_undo_redo_import_scene);
ClassDB::bind_method("_on_tileset_toolbar_button_pressed", &TileSetEditor::_on_tileset_toolbar_button_pressed);
ClassDB::bind_method("_on_textures_added", &TileSetEditor::_on_textures_added);
ClassDB::bind_method("_on_tileset_toolbar_confirm", &TileSetEditor::_on_tileset_toolbar_confirm);
ClassDB::bind_method("_on_texture_list_selected", &TileSetEditor::_on_texture_list_selected);
ClassDB::bind_method("_on_edit_mode_changed", &TileSetEditor::_on_edit_mode_changed);
ClassDB::bind_method("_on_scroll_container_input", &TileSetEditor::_on_scroll_container_input);
ClassDB::bind_method("_on_workspace_mode_changed", &TileSetEditor::_on_workspace_mode_changed);
ClassDB::bind_method("_on_workspace_overlay_draw", &TileSetEditor::_on_workspace_overlay_draw);
ClassDB::bind_method("_on_workspace_process", &TileSetEditor::_on_workspace_process);
ClassDB::bind_method("_on_workspace_draw", &TileSetEditor::_on_workspace_draw);
ClassDB::bind_method("_on_workspace_input", &TileSetEditor::_on_workspace_input);
ClassDB::bind_method("_on_tool_clicked", &TileSetEditor::_on_tool_clicked);
ClassDB::bind_method("_on_priority_changed", &TileSetEditor::_on_priority_changed);
ClassDB::bind_method("_on_z_index_changed", &TileSetEditor::_on_z_index_changed);
ClassDB::bind_method("_on_grid_snap_toggled", &TileSetEditor::_on_grid_snap_toggled);
ClassDB::bind_method("_set_snap_step", &TileSetEditor::_set_snap_step);
ClassDB::bind_method("_set_snap_off", &TileSetEditor::_set_snap_off);
ClassDB::bind_method("_set_snap_sep", &TileSetEditor::_set_snap_sep);
ClassDB::bind_method("_validate_current_tile_id", &TileSetEditor::_validate_current_tile_id);
ClassDB::bind_method("_zoom_in", &TileSetEditor::_zoom_in);
ClassDB::bind_method("_zoom_out", &TileSetEditor::_zoom_out);
ClassDB::bind_method("_zoom_reset", &TileSetEditor::_zoom_reset);
ClassDB::bind_method("_select_edited_shape_coord", &TileSetEditor::_select_edited_shape_coord);
ClassDB::bind_method("_sort_tiles", &TileSetEditor::_sort_tiles);
ClassDB::bind_method(D_METHOD("get_drag_data_fw"), &TileSetEditor::get_drag_data_fw);
ClassDB::bind_method(D_METHOD("can_drop_data_fw"), &TileSetEditor::can_drop_data_fw);
ClassDB::bind_method(D_METHOD("drop_data_fw"), &TileSetEditor::drop_data_fw);
ClassDB::bind_method("edit", &TileSetEditor::edit);
ClassDB::bind_method("add_texture", &TileSetEditor::add_texture);
ClassDB::bind_method("remove_texture", &TileSetEditor::remove_texture);
ClassDB::bind_method("update_texture_list_icon", &TileSetEditor::update_texture_list_icon);
ClassDB::bind_method("update_workspace_minsize", &TileSetEditor::update_workspace_minsize);
}
void TileSetEditor::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_READY: {
add_constant_override("autohide", 1); // Fixes the dragger always showing up.
} break;
case NOTIFICATION_ENTER_TREE:
case NOTIFICATION_THEME_CHANGED: {
tileset_toolbar_buttons[TOOL_TILESET_ADD_TEXTURE]->set_icon(get_icon("ToolAddNode", "EditorIcons"));
tileset_toolbar_buttons[TOOL_TILESET_REMOVE_TEXTURE]->set_icon(get_icon("Remove", "EditorIcons"));
tileset_toolbar_tools->set_icon(get_icon("Tools", "EditorIcons"));
tool_workspacemode[WORKSPACE_EDIT]->set_icon(get_icon("Edit", "EditorIcons"));
tool_workspacemode[WORKSPACE_CREATE_SINGLE]->set_icon(get_icon("AddSingleTile", "EditorIcons"));
tool_workspacemode[WORKSPACE_CREATE_AUTOTILE]->set_icon(get_icon("AddAutotile", "EditorIcons"));
tool_workspacemode[WORKSPACE_CREATE_ATLAS]->set_icon(get_icon("AddAtlasTile", "EditorIcons"));
tools[TOOL_SELECT]->set_icon(get_icon("ToolSelect", "EditorIcons"));
tools[BITMASK_COPY]->set_icon(get_icon("Duplicate", "EditorIcons"));
tools[BITMASK_PASTE]->set_icon(get_icon("Override", "EditorIcons"));
tools[BITMASK_CLEAR]->set_icon(get_icon("Clear", "EditorIcons"));
tools[SHAPE_NEW_POLYGON]->set_icon(get_icon("CollisionPolygon2D", "EditorIcons"));
tools[SHAPE_NEW_RECTANGLE]->set_icon(get_icon("CollisionShape2D", "EditorIcons"));
tools[SELECT_PREVIOUS]->set_icon(get_icon("ArrowLeft", "EditorIcons"));
tools[SELECT_NEXT]->set_icon(get_icon("ArrowRight", "EditorIcons"));
tools[SHAPE_DELETE]->set_icon(get_icon("Remove", "EditorIcons"));
tools[SHAPE_KEEP_INSIDE_TILE]->set_icon(get_icon("Snap", "EditorIcons"));
tools[TOOL_GRID_SNAP]->set_icon(get_icon("SnapGrid", "EditorIcons"));
tools[ZOOM_OUT]->set_icon(get_icon("ZoomLess", "EditorIcons"));
tools[ZOOM_1]->set_icon(get_icon("ZoomReset", "EditorIcons"));
tools[ZOOM_IN]->set_icon(get_icon("ZoomMore", "EditorIcons"));
tools[VISIBLE_INFO]->set_icon(get_icon("InformationSign", "EditorIcons"));
_update_toggle_shape_button();
tool_editmode[EDITMODE_REGION]->set_icon(get_icon("RegionEdit", "EditorIcons"));
tool_editmode[EDITMODE_COLLISION]->set_icon(get_icon("StaticBody2D", "EditorIcons"));
tool_editmode[EDITMODE_OCCLUSION]->set_icon(get_icon("LightOccluder2D", "EditorIcons"));
tool_editmode[EDITMODE_NAVIGATION]->set_icon(get_icon("Navigation2D", "EditorIcons"));
tool_editmode[EDITMODE_BITMASK]->set_icon(get_icon("PackedDataContainer", "EditorIcons"));
tool_editmode[EDITMODE_PRIORITY]->set_icon(get_icon("MaterialPreviewLight1", "EditorIcons"));
tool_editmode[EDITMODE_ICON]->set_icon(get_icon("LargeTexture", "EditorIcons"));
tool_editmode[EDITMODE_Z_INDEX]->set_icon(get_icon("Sort", "EditorIcons"));
scroll->add_style_override("bg", get_stylebox("bg", "Tree"));
} break;
}
}
TileSetEditor::TileSetEditor(EditorNode *p_editor) {
editor = p_editor;
undo_redo = EditorNode::get_undo_redo();
current_tile = -1;
VBoxContainer *left_container = memnew(VBoxContainer);
add_child(left_container);
texture_list = memnew(ItemList);
left_container->add_child(texture_list);
texture_list->set_v_size_flags(SIZE_EXPAND_FILL);
texture_list->set_custom_minimum_size(Size2(200, 0));
texture_list->connect("item_selected", this, "_on_texture_list_selected");
texture_list->set_drag_forwarding(this);
HBoxContainer *tileset_toolbar_container = memnew(HBoxContainer);
left_container->add_child(tileset_toolbar_container);
tileset_toolbar_buttons[TOOL_TILESET_ADD_TEXTURE] = memnew(ToolButton);
tileset_toolbar_buttons[TOOL_TILESET_ADD_TEXTURE]->connect("pressed", this, "_on_tileset_toolbar_button_pressed", varray(TOOL_TILESET_ADD_TEXTURE));
tileset_toolbar_container->add_child(tileset_toolbar_buttons[TOOL_TILESET_ADD_TEXTURE]);
tileset_toolbar_buttons[TOOL_TILESET_ADD_TEXTURE]->set_tooltip(TTR("Add Texture(s) to TileSet."));
tileset_toolbar_buttons[TOOL_TILESET_REMOVE_TEXTURE] = memnew(ToolButton);
tileset_toolbar_buttons[TOOL_TILESET_REMOVE_TEXTURE]->connect("pressed", this, "_on_tileset_toolbar_button_pressed", varray(TOOL_TILESET_REMOVE_TEXTURE));
tileset_toolbar_container->add_child(tileset_toolbar_buttons[TOOL_TILESET_REMOVE_TEXTURE]);
tileset_toolbar_buttons[TOOL_TILESET_REMOVE_TEXTURE]->set_tooltip(TTR("Remove selected Texture from TileSet."));
Control *toolbar_separator = memnew(Control);
toolbar_separator->set_h_size_flags(Control::SIZE_EXPAND_FILL);
tileset_toolbar_container->add_child(toolbar_separator);
tileset_toolbar_tools = memnew(MenuButton);
tileset_toolbar_tools->set_text(TTR("Tools"));
tileset_toolbar_tools->get_popup()->add_item(TTR("Create from Scene"), TOOL_TILESET_CREATE_SCENE);
tileset_toolbar_tools->get_popup()->add_item(TTR("Merge from Scene"), TOOL_TILESET_MERGE_SCENE);
tileset_toolbar_tools->get_popup()->connect("id_pressed", this, "_on_tileset_toolbar_button_pressed");
tileset_toolbar_container->add_child(tileset_toolbar_tools);
//---------------
VBoxContainer *right_container = memnew(VBoxContainer);
right_container->set_v_size_flags(SIZE_EXPAND_FILL);
add_child(right_container);
dragging_point = -1;
creating_shape = false;
snap_step = Vector2(32, 32);
snap_offset = WORKSPACE_MARGIN;
set_custom_minimum_size(Size2(0, 150));
VBoxContainer *main_vb = memnew(VBoxContainer);
right_container->add_child(main_vb);
main_vb->set_v_size_flags(SIZE_EXPAND_FILL);
HBoxContainer *tool_hb = memnew(HBoxContainer);
Ref<ButtonGroup> g(memnew(ButtonGroup));
String workspace_label[WORKSPACE_MODE_MAX] = {
TTR("Edit"),
TTR("New Single Tile"),
TTR("New Autotile"),
TTR("New Atlas")
};
for (int i = 0; i < (int)WORKSPACE_MODE_MAX; i++) {
tool_workspacemode[i] = memnew(Button);
tool_workspacemode[i]->set_text(workspace_label[i]);
tool_workspacemode[i]->set_toggle_mode(true);
tool_workspacemode[i]->set_button_group(g);
tool_workspacemode[i]->connect("pressed", this, "_on_workspace_mode_changed", varray(i));
tool_hb->add_child(tool_workspacemode[i]);
}
Control *spacer = memnew(Control);
spacer->set_h_size_flags(Control::SIZE_EXPAND_FILL);
tool_hb->add_child(spacer);
tool_hb->move_child(spacer, WORKSPACE_CREATE_SINGLE);
tools[SELECT_NEXT] = memnew(ToolButton);
tool_hb->add_child(tools[SELECT_NEXT]);
tool_hb->move_child(tools[SELECT_NEXT], WORKSPACE_CREATE_SINGLE);
tools[SELECT_NEXT]->set_shortcut(ED_SHORTCUT("tileset_editor/next_shape", TTR("Next Coordinate"), KEY_PAGEDOWN));
tools[SELECT_NEXT]->connect("pressed", this, "_on_tool_clicked", varray(SELECT_NEXT));
tools[SELECT_NEXT]->set_tooltip(TTR("Select the next shape, subtile, or Tile."));
tools[SELECT_PREVIOUS] = memnew(ToolButton);
tool_hb->add_child(tools[SELECT_PREVIOUS]);
tool_hb->move_child(tools[SELECT_PREVIOUS], WORKSPACE_CREATE_SINGLE);
tools[SELECT_PREVIOUS]->set_shortcut(ED_SHORTCUT("tileset_editor/previous_shape", TTR("Previous Coordinate"), KEY_PAGEUP));
tools[SELECT_PREVIOUS]->set_tooltip(TTR("Select the previous shape, subtile, or Tile."));
tools[SELECT_PREVIOUS]->connect("pressed", this, "_on_tool_clicked", varray(SELECT_PREVIOUS));
VSeparator *separator_shape_selection = memnew(VSeparator);
tool_hb->add_child(separator_shape_selection);
tool_hb->move_child(separator_shape_selection, WORKSPACE_CREATE_SINGLE);
tool_workspacemode[WORKSPACE_EDIT]->set_pressed(true);
workspace_mode = WORKSPACE_EDIT;
main_vb->add_child(tool_hb);
main_vb->add_child(memnew(HSeparator));
tool_hb = memnew(HBoxContainer);
g = Ref<ButtonGroup>(memnew(ButtonGroup));
String label[EDITMODE_MAX] = {
TTR("Region"),
TTR("Collision"),
TTR("Occlusion"),
TTR("Navigation"),
TTR("Bitmask"),
TTR("Priority"),
TTR("Icon"),
TTR("Z Index")
};
for (int i = 0; i < (int)EDITMODE_MAX; i++) {
tool_editmode[i] = memnew(Button);
tool_editmode[i]->set_text(label[i]);
tool_editmode[i]->set_toggle_mode(true);
tool_editmode[i]->set_button_group(g);
tool_editmode[i]->connect("pressed", this, "_on_edit_mode_changed", varray(i));
tool_hb->add_child(tool_editmode[i]);
}
tool_editmode[EDITMODE_COLLISION]->set_pressed(true);
edit_mode = EDITMODE_COLLISION;
tool_editmode[EDITMODE_REGION]->set_shortcut(ED_SHORTCUT("tileset_editor/editmode_region", TTR("Region Mode"), KEY_1));
tool_editmode[EDITMODE_COLLISION]->set_shortcut(ED_SHORTCUT("tileset_editor/editmode_collision", TTR("Collision Mode"), KEY_2));
tool_editmode[EDITMODE_OCCLUSION]->set_shortcut(ED_SHORTCUT("tileset_editor/editmode_occlusion", TTR("Occlusion Mode"), KEY_3));
tool_editmode[EDITMODE_NAVIGATION]->set_shortcut(ED_SHORTCUT("tileset_editor/editmode_navigation", TTR("Navigation Mode"), KEY_4));
tool_editmode[EDITMODE_BITMASK]->set_shortcut(ED_SHORTCUT("tileset_editor/editmode_bitmask", TTR("Bitmask Mode"), KEY_5));
tool_editmode[EDITMODE_PRIORITY]->set_shortcut(ED_SHORTCUT("tileset_editor/editmode_priority", TTR("Priority Mode"), KEY_6));
tool_editmode[EDITMODE_ICON]->set_shortcut(ED_SHORTCUT("tileset_editor/editmode_icon", TTR("Icon Mode"), KEY_7));
tool_editmode[EDITMODE_Z_INDEX]->set_shortcut(ED_SHORTCUT("tileset_editor/editmode_z_index", TTR("Z Index Mode"), KEY_8));
main_vb->add_child(tool_hb);
separator_editmode = memnew(HSeparator);
main_vb->add_child(separator_editmode);
toolbar = memnew(HBoxContainer);
Ref<ButtonGroup> tg(memnew(ButtonGroup));
tools[TOOL_SELECT] = memnew(ToolButton);
toolbar->add_child(tools[TOOL_SELECT]);
tools[TOOL_SELECT]->set_toggle_mode(true);
tools[TOOL_SELECT]->set_button_group(tg);
tools[TOOL_SELECT]->set_pressed(true);
tools[TOOL_SELECT]->connect("pressed", this, "_on_tool_clicked", varray(TOOL_SELECT));
separator_bitmask = memnew(VSeparator);
toolbar->add_child(separator_bitmask);
tools[BITMASK_COPY] = memnew(ToolButton);
tools[BITMASK_COPY]->set_tooltip(TTR("Copy bitmask."));
tools[BITMASK_COPY]->connect("pressed", this, "_on_tool_clicked", varray(BITMASK_COPY));
toolbar->add_child(tools[BITMASK_COPY]);
tools[BITMASK_PASTE] = memnew(ToolButton);
tools[BITMASK_PASTE]->set_tooltip(TTR("Paste bitmask."));
tools[BITMASK_PASTE]->connect("pressed", this, "_on_tool_clicked", varray(BITMASK_PASTE));
toolbar->add_child(tools[BITMASK_PASTE]);
tools[BITMASK_CLEAR] = memnew(ToolButton);
tools[BITMASK_CLEAR]->set_tooltip(TTR("Erase bitmask."));
tools[BITMASK_CLEAR]->connect("pressed", this, "_on_tool_clicked", varray(BITMASK_CLEAR));
toolbar->add_child(tools[BITMASK_CLEAR]);
tools[SHAPE_NEW_RECTANGLE] = memnew(ToolButton);
toolbar->add_child(tools[SHAPE_NEW_RECTANGLE]);
tools[SHAPE_NEW_RECTANGLE]->set_toggle_mode(true);
tools[SHAPE_NEW_RECTANGLE]->set_button_group(tg);
tools[SHAPE_NEW_RECTANGLE]->set_tooltip(TTR("Create a new rectangle."));
tools[SHAPE_NEW_RECTANGLE]->connect("pressed", this, "_on_tool_clicked", varray(SHAPE_NEW_RECTANGLE));
tools[SHAPE_NEW_RECTANGLE]->set_shortcut(ED_SHORTCUT("tileset_editor/shape_new_rectangle", TTR("New Rectangle"), KEY_MASK_SHIFT | KEY_R));
tools[SHAPE_NEW_POLYGON] = memnew(ToolButton);
toolbar->add_child(tools[SHAPE_NEW_POLYGON]);
tools[SHAPE_NEW_POLYGON]->set_toggle_mode(true);
tools[SHAPE_NEW_POLYGON]->set_button_group(tg);
tools[SHAPE_NEW_POLYGON]->set_tooltip(TTR("Create a new polygon."));
tools[SHAPE_NEW_POLYGON]->connect("pressed", this, "_on_tool_clicked", varray(SHAPE_NEW_POLYGON));
tools[SHAPE_NEW_POLYGON]->set_shortcut(ED_SHORTCUT("tileset_editor/shape_new_polygon", TTR("New Polygon"), KEY_MASK_SHIFT | KEY_P));
separator_shape_toggle = memnew(VSeparator);
toolbar->add_child(separator_shape_toggle);
tools[SHAPE_TOGGLE_TYPE] = memnew(ToolButton);
tools[SHAPE_TOGGLE_TYPE]->connect("pressed", this, "_on_tool_clicked", varray(SHAPE_TOGGLE_TYPE));
toolbar->add_child(tools[SHAPE_TOGGLE_TYPE]);
separator_delete = memnew(VSeparator);
toolbar->add_child(separator_delete);
tools[SHAPE_DELETE] = memnew(ToolButton);
tools[SHAPE_DELETE]->connect("pressed", this, "_on_tool_clicked", varray(SHAPE_DELETE));
tools[SHAPE_DELETE]->set_shortcut(ED_SHORTCUT("tileset_editor/shape_delete", TTR("Delete Selected Shape"), KEY_MASK_SHIFT | KEY_BACKSPACE));
toolbar->add_child(tools[SHAPE_DELETE]);
spin_priority = memnew(SpinBox);
spin_priority->set_min(1);
spin_priority->set_max(255);
spin_priority->set_step(1);
spin_priority->set_custom_minimum_size(Size2(100, 0));
spin_priority->connect("value_changed", this, "_on_priority_changed");
spin_priority->hide();
toolbar->add_child(spin_priority);
spin_z_index = memnew(SpinBox);
spin_z_index->set_min(VS::CANVAS_ITEM_Z_MIN);
spin_z_index->set_max(VS::CANVAS_ITEM_Z_MAX);
spin_z_index->set_step(1);
spin_z_index->set_custom_minimum_size(Size2(100, 0));
spin_z_index->connect("value_changed", this, "_on_z_index_changed");
spin_z_index->hide();
toolbar->add_child(spin_z_index);
separator_grid = memnew(VSeparator);
toolbar->add_child(separator_grid);
tools[SHAPE_KEEP_INSIDE_TILE] = memnew(ToolButton);
tools[SHAPE_KEEP_INSIDE_TILE]->set_toggle_mode(true);
tools[SHAPE_KEEP_INSIDE_TILE]->set_pressed(true);
tools[SHAPE_KEEP_INSIDE_TILE]->set_tooltip(TTR("Keep polygon inside region Rect."));
toolbar->add_child(tools[SHAPE_KEEP_INSIDE_TILE]);
tools[TOOL_GRID_SNAP] = memnew(ToolButton);
tools[TOOL_GRID_SNAP]->set_toggle_mode(true);
tools[TOOL_GRID_SNAP]->set_tooltip(TTR("Enable snap and show grid (configurable via the Inspector)."));
tools[TOOL_GRID_SNAP]->connect("toggled", this, "_on_grid_snap_toggled");
toolbar->add_child(tools[TOOL_GRID_SNAP]);
Control *separator = memnew(Control);
separator->set_h_size_flags(SIZE_EXPAND_FILL);
toolbar->add_child(separator);
tools[ZOOM_OUT] = memnew(ToolButton);
tools[ZOOM_OUT]->connect("pressed", this, "_zoom_out");
toolbar->add_child(tools[ZOOM_OUT]);
tools[ZOOM_OUT]->set_tooltip(TTR("Zoom Out"));
tools[ZOOM_1] = memnew(ToolButton);
tools[ZOOM_1]->connect("pressed", this, "_zoom_reset");
toolbar->add_child(tools[ZOOM_1]);
tools[ZOOM_1]->set_tooltip(TTR("Zoom Reset"));
tools[ZOOM_IN] = memnew(ToolButton);
tools[ZOOM_IN]->connect("pressed", this, "_zoom_in");
toolbar->add_child(tools[ZOOM_IN]);
tools[ZOOM_IN]->set_tooltip(TTR("Zoom In"));
tools[VISIBLE_INFO] = memnew(ToolButton);
tools[VISIBLE_INFO]->set_toggle_mode(true);
tools[VISIBLE_INFO]->set_tooltip(TTR("Display Tile Names (Hold Alt Key)"));
toolbar->add_child(tools[VISIBLE_INFO]);
main_vb->add_child(toolbar);
scroll = memnew(ScrollContainer);
main_vb->add_child(scroll);
scroll->set_v_size_flags(SIZE_EXPAND_FILL);
scroll->connect("gui_input", this, "_on_scroll_container_input");
scroll->set_clip_contents(true);
empty_message = memnew(Label);
empty_message->set_text(TTR("Add or select a texture on the left panel to edit the tiles bound to it."));
empty_message->set_valign(Label::VALIGN_CENTER);
empty_message->set_align(Label::ALIGN_CENTER);
empty_message->set_autowrap(true);
empty_message->set_custom_minimum_size(Size2(100 * EDSCALE, 0));
empty_message->set_v_size_flags(SIZE_EXPAND_FILL);
main_vb->add_child(empty_message);
workspace_container = memnew(Control);
scroll->add_child(workspace_container);
workspace_overlay = memnew(Control);
workspace_overlay->connect("draw", this, "_on_workspace_overlay_draw");
workspace_container->add_child(workspace_overlay);
workspace = memnew(Control);
workspace->set_focus_mode(FOCUS_ALL);
workspace->connect("draw", this, "_on_workspace_draw");
workspace->connect("gui_input", this, "_on_workspace_input");
workspace->set_draw_behind_parent(true);
workspace_overlay->add_child(workspace);
preview = memnew(Sprite);
workspace->add_child(preview);
preview->set_centered(false);
preview->set_draw_behind_parent(true);
preview->set_position(WORKSPACE_MARGIN);
//---------------
cd = memnew(ConfirmationDialog);
add_child(cd);
cd->connect("confirmed", this, "_on_tileset_toolbar_confirm");
//---------------
err_dialog = memnew(AcceptDialog);
add_child(err_dialog);
//---------------
texture_dialog = memnew(EditorFileDialog);
texture_dialog->set_access(EditorFileDialog::ACCESS_RESOURCES);
texture_dialog->set_mode(EditorFileDialog::MODE_OPEN_FILES);
texture_dialog->clear_filters();
List<String> extensions;
ResourceLoader::get_recognized_extensions_for_type("Texture", &extensions);
for (List<String>::Element *E = extensions.front(); E; E = E->next()) {
texture_dialog->add_filter("*." + E->get() + " ; " + E->get().to_upper());
}
add_child(texture_dialog);
texture_dialog->connect("files_selected", this, "_on_textures_added");
//---------------
helper = memnew(TilesetEditorContext(this));
tile_names_visible = false;
// Config scale.
max_scale = 16.0f;
min_scale = 0.01f;
scale_ratio = 1.2f;
}
TileSetEditor::~TileSetEditor() {
if (helper)
memdelete(helper);
}
void TileSetEditor::_on_tileset_toolbar_button_pressed(int p_index) {
option = p_index;
switch (option) {
case TOOL_TILESET_ADD_TEXTURE: {
texture_dialog->popup_centered_ratio();
} break;
case TOOL_TILESET_REMOVE_TEXTURE: {
if (get_current_texture().is_valid()) {
cd->set_text(TTR("Remove selected texture? This will remove all tiles which use it."));
cd->popup_centered(Size2(300, 60));
} else {
err_dialog->set_text(TTR("You haven't selected a texture to remove."));
err_dialog->popup_centered(Size2(300, 60));
}
} break;
case TOOL_TILESET_CREATE_SCENE: {
cd->set_text(TTR("Create from scene? This will overwrite all current tiles."));
cd->popup_centered(Size2(300, 60));
} break;
case TOOL_TILESET_MERGE_SCENE: {
cd->set_text(TTR("Merge from scene?"));
cd->popup_centered(Size2(300, 60));
} break;
}
}
void TileSetEditor::_on_tileset_toolbar_confirm() {
switch (option) {
case TOOL_TILESET_REMOVE_TEXTURE: {
String current_texture_path = get_current_texture()->get_path();
List<int> ids;
tileset->get_tile_list(&ids);
undo_redo->create_action(TTR("Remove Texture"));
for (List<int>::Element *E = ids.front(); E; E = E->next()) {
if (tileset->tile_get_texture(E->get())->get_path() == current_texture_path) {
undo_redo->add_do_method(tileset.ptr(), "remove_tile", E->get());
_undo_tile_removal(E->get());
}
}
undo_redo->add_do_method(this, "remove_texture", get_current_texture());
undo_redo->add_undo_method(this, "add_texture", get_current_texture());
undo_redo->add_undo_method(this, "update_texture_list_icon");
undo_redo->commit_action();
} break;
case TOOL_TILESET_MERGE_SCENE:
case TOOL_TILESET_CREATE_SCENE: {
EditorNode *en = editor;
Node *scene = en->get_edited_scene();
if (!scene)
break;
List<int> ids;
tileset->get_tile_list(&ids);
undo_redo->create_action(TTR(option == TOOL_TILESET_MERGE_SCENE ? "Merge Tileset from Scene" : "Create Tileset from Scene"));
undo_redo->add_do_method(this, "_undo_redo_import_scene", scene, option == TOOL_TILESET_MERGE_SCENE);
undo_redo->add_undo_method(tileset.ptr(), "clear");
for (List<int>::Element *E = ids.front(); E; E = E->next()) {
_undo_tile_removal(E->get());
}
undo_redo->add_do_method(this, "edit", tileset);
undo_redo->add_undo_method(this, "edit", tileset);
undo_redo->commit_action();
} break;
}
}
void TileSetEditor::_on_texture_list_selected(int p_index) {
if (get_current_texture().is_valid()) {
current_item_index = p_index;
preview->set_texture(get_current_texture());
update_workspace_tile_mode();
update_workspace_minsize();
} else {
current_item_index = -1;
preview->set_texture(NULL);
workspace->set_custom_minimum_size(Size2i());
update_workspace_tile_mode();
}
set_current_tile(-1);
workspace->update();
}
void TileSetEditor::_on_textures_added(const PoolStringArray &p_paths) {
int invalid_count = 0;
for (int i = 0; i < p_paths.size(); i++) {
Ref<Texture> t = Ref<Texture>(ResourceLoader::load(p_paths[i]));
ERR_CONTINUE_MSG(!t.is_valid(), "'" + p_paths[i] + "' is not a valid texture.");
if (texture_map.has(t->get_path())) {
invalid_count++;
} else {
add_texture(t);
}
}
if (texture_list->get_item_count() > 0) {
update_texture_list_icon();
texture_list->select(texture_list->get_item_count() - 1);
_on_texture_list_selected(texture_list->get_item_count() - 1);
}
if (invalid_count > 0) {
err_dialog->set_text(vformat(TTR("%s file(s) were not added because was already on the list."), String::num(invalid_count, 0)));
err_dialog->popup_centered(Size2(300, 60));
}
}
void TileSetEditor::_on_edit_mode_changed(int p_edit_mode) {
draw_handles = false;
creating_shape = false;
edit_mode = (EditMode)p_edit_mode;
switch (edit_mode) {
case EDITMODE_REGION: {
tools[TOOL_SELECT]->show();
separator_bitmask->hide();
tools[BITMASK_COPY]->hide();
tools[BITMASK_PASTE]->hide();
tools[BITMASK_CLEAR]->hide();
tools[SHAPE_NEW_POLYGON]->hide();
tools[SHAPE_NEW_RECTANGLE]->hide();
if (workspace_mode == WORKSPACE_EDIT) {
separator_delete->show();
tools[SHAPE_DELETE]->show();
} else {
separator_delete->hide();
tools[SHAPE_DELETE]->hide();
}
separator_grid->show();
tools[SHAPE_KEEP_INSIDE_TILE]->hide();
tools[TOOL_GRID_SNAP]->show();
tools[TOOL_SELECT]->set_pressed(true);
tools[TOOL_SELECT]->set_tooltip(TTR("Drag handles to edit Rect.\nClick on another Tile to edit it."));
tools[SHAPE_DELETE]->set_tooltip(TTR("Delete selected Rect."));
spin_priority->hide();
spin_z_index->hide();
} break;
case EDITMODE_COLLISION:
case EDITMODE_OCCLUSION:
case EDITMODE_NAVIGATION: {
tools[TOOL_SELECT]->show();
separator_bitmask->hide();
tools[BITMASK_COPY]->hide();
tools[BITMASK_PASTE]->hide();
tools[BITMASK_CLEAR]->hide();
tools[SHAPE_NEW_POLYGON]->show();
tools[SHAPE_NEW_RECTANGLE]->show();
separator_delete->show();
tools[SHAPE_DELETE]->show();
separator_grid->show();
tools[SHAPE_KEEP_INSIDE_TILE]->show();
tools[TOOL_GRID_SNAP]->show();
tools[TOOL_SELECT]->set_tooltip(TTR("Select current edited sub-tile.\nClick on another Tile to edit it."));
tools[SHAPE_DELETE]->set_tooltip(TTR("Delete polygon."));
spin_priority->hide();
spin_z_index->hide();
_select_edited_shape_coord();
} break;
case EDITMODE_BITMASK: {
tools[TOOL_SELECT]->show();
separator_bitmask->show();
tools[BITMASK_COPY]->show();
tools[BITMASK_PASTE]->show();
tools[BITMASK_CLEAR]->show();
tools[SHAPE_NEW_POLYGON]->hide();
tools[SHAPE_NEW_RECTANGLE]->hide();
separator_delete->hide();
tools[SHAPE_DELETE]->hide();
tools[SHAPE_KEEP_INSIDE_TILE]->hide();
tools[TOOL_SELECT]->set_pressed(true);
tools[TOOL_SELECT]->set_tooltip(TTR("LMB: Set bit on.\nRMB: Set bit off.\nShift+LMB: Set wildcard bit.\nClick on another Tile to edit it."));
spin_priority->hide();
} break;
case EDITMODE_Z_INDEX:
case EDITMODE_PRIORITY:
case EDITMODE_ICON: {
tools[TOOL_SELECT]->show();
separator_bitmask->hide();
tools[BITMASK_COPY]->hide();
tools[BITMASK_PASTE]->hide();
tools[BITMASK_CLEAR]->hide();
tools[SHAPE_NEW_POLYGON]->hide();
tools[SHAPE_NEW_RECTANGLE]->hide();
separator_delete->hide();
tools[SHAPE_DELETE]->hide();
separator_grid->show();
tools[SHAPE_KEEP_INSIDE_TILE]->hide();
tools[TOOL_GRID_SNAP]->show();
if (edit_mode == EDITMODE_ICON) {
tools[TOOL_SELECT]->set_tooltip(TTR("Select sub-tile to use as icon, this will be also used on invalid autotile bindings.\nClick on another Tile to edit it."));
spin_priority->hide();
spin_z_index->hide();
} else if (edit_mode == EDITMODE_PRIORITY) {
tools[TOOL_SELECT]->set_tooltip(TTR("Select sub-tile to change its priority.\nClick on another Tile to edit it."));
spin_priority->show();
spin_z_index->hide();
} else {
tools[TOOL_SELECT]->set_tooltip(TTR("Select sub-tile to change its z index.\nClick on another Tile to edit it."));
spin_priority->hide();
spin_z_index->show();
}
} break;
default: {
}
}
_update_toggle_shape_button();
workspace->update();
}
void TileSetEditor::_on_workspace_mode_changed(int p_workspace_mode) {
workspace_mode = (WorkspaceMode)p_workspace_mode;
if (p_workspace_mode == WORKSPACE_EDIT) {
update_workspace_tile_mode();
} else {
for (int i = 0; i < EDITMODE_MAX; i++) {
tool_editmode[i]->hide();
}
tool_editmode[EDITMODE_REGION]->show();
tool_editmode[EDITMODE_REGION]->set_pressed(true);
_on_edit_mode_changed(EDITMODE_REGION);
separator_editmode->show();
}
}
void TileSetEditor::_on_workspace_draw() {
if (tileset.is_null() || !get_current_texture().is_valid())
return;
const Color COLOR_AUTOTILE = Color(0.3, 0.6, 1);
const Color COLOR_SINGLE = Color(1, 1, 0.3);
const Color COLOR_ATLAS = Color(0.8, 0.8, 0.8);
const Color COLOR_SUBDIVISION = Color(0.3, 0.7, 0.6);
draw_handles = false;
draw_highlight_current_tile();
draw_grid_snap();
if (get_current_tile() >= 0) {
int spacing = tileset->autotile_get_spacing(get_current_tile());
Vector2 size = tileset->autotile_get_size(get_current_tile());
Rect2i region = tileset->tile_get_region(get_current_tile());
switch (edit_mode) {
case EDITMODE_ICON: {
Vector2 coord = tileset->autotile_get_icon_coordinate(get_current_tile());
draw_highlight_subtile(coord);
} break;
case EDITMODE_BITMASK: {
Color c(1, 0, 0, 0.5);
Color ci(0.3, 0.6, 1, 0.5);
for (int x = 0; x < region.size.x / (spacing + size.x); x++) {
for (int y = 0; y < region.size.y / (spacing + size.y); y++) {
Vector2 coord(x, y);
Point2 anchor(coord.x * (spacing + size.x), coord.y * (spacing + size.y));
anchor += WORKSPACE_MARGIN;
anchor += region.position;
uint32_t mask = tileset->autotile_get_bitmask(get_current_tile(), coord);
if (tileset->autotile_get_bitmask_mode(get_current_tile()) == TileSet::BITMASK_2X2) {
if (mask & TileSet::BIND_IGNORE_TOPLEFT) {
workspace->draw_rect(Rect2(anchor, size / 4), ci);
workspace->draw_rect(Rect2(anchor + size / 4, size / 4), ci);
} else if (mask & TileSet::BIND_TOPLEFT) {
workspace->draw_rect(Rect2(anchor, size / 2), c);
}
if (mask & TileSet::BIND_IGNORE_TOPRIGHT) {
workspace->draw_rect(Rect2(anchor + Vector2(size.x / 2, 0), size / 4), ci);
workspace->draw_rect(Rect2(anchor + Vector2(size.x * 3 / 4, size.y / 4), size / 4), ci);
} else if (mask & TileSet::BIND_TOPRIGHT) {
workspace->draw_rect(Rect2(anchor + Vector2(size.x / 2, 0), size / 2), c);
}
if (mask & TileSet::BIND_IGNORE_BOTTOMLEFT) {
workspace->draw_rect(Rect2(anchor + Vector2(0, size.y / 2), size / 4), ci);
workspace->draw_rect(Rect2(anchor + Vector2(size.x / 4, size.y * 3 / 4), size / 4), ci);
} else if (mask & TileSet::BIND_BOTTOMLEFT) {
workspace->draw_rect(Rect2(anchor + Vector2(0, size.y / 2), size / 2), c);
}
if (mask & TileSet::BIND_IGNORE_BOTTOMRIGHT) {
workspace->draw_rect(Rect2(anchor + size / 2, size / 4), ci);
workspace->draw_rect(Rect2(anchor + size * 3 / 4, size / 4), ci);
} else if (mask & TileSet::BIND_BOTTOMRIGHT) {
workspace->draw_rect(Rect2(anchor + size / 2, size / 2), c);
}
} else {
if (mask & TileSet::BIND_IGNORE_TOPLEFT) {
workspace->draw_rect(Rect2(anchor, size / 6), ci);
workspace->draw_rect(Rect2(anchor + size / 6, size / 6), ci);
} else if (mask & TileSet::BIND_TOPLEFT) {
workspace->draw_rect(Rect2(anchor, size / 3), c);
}
if (mask & TileSet::BIND_IGNORE_TOP) {
workspace->draw_rect(Rect2(anchor + Vector2(size.x / 3, 0), size / 6), ci);
workspace->draw_rect(Rect2(anchor + Vector2(size.x / 2, size.y / 6), size / 6), ci);
} else if (mask & TileSet::BIND_TOP) {
workspace->draw_rect(Rect2(anchor + Vector2(size.x / 3, 0), size / 3), c);
}
if (mask & TileSet::BIND_IGNORE_TOPRIGHT) {
workspace->draw_rect(Rect2(anchor + Vector2(size.x * 4 / 6, 0), size / 6), ci);
workspace->draw_rect(Rect2(anchor + Vector2(size.x * 5 / 6, size.y / 6), size / 6), ci);
} else if (mask & TileSet::BIND_TOPRIGHT) {
workspace->draw_rect(Rect2(anchor + Vector2((size.x / 3) * 2, 0), size / 3), c);
}
if (mask & TileSet::BIND_IGNORE_LEFT) {
workspace->draw_rect(Rect2(anchor + Vector2(0, size.y / 3), size / 6), ci);
workspace->draw_rect(Rect2(anchor + Vector2(size.x / 6, size.y / 2), size / 6), ci);
} else if (mask & TileSet::BIND_LEFT) {
workspace->draw_rect(Rect2(anchor + Vector2(0, size.y / 3), size / 3), c);
}
if (mask & TileSet::BIND_IGNORE_CENTER) {
workspace->draw_rect(Rect2(anchor + size / 3, size / 6), ci);
workspace->draw_rect(Rect2(anchor + size / 2, size / 6), ci);
} else if (mask & TileSet::BIND_CENTER) {
workspace->draw_rect(Rect2(anchor + Vector2(size.x / 3, size.y / 3), size / 3), c);
}
if (mask & TileSet::BIND_IGNORE_RIGHT) {
workspace->draw_rect(Rect2(anchor + Vector2(size.x * 4 / 6, size.y / 3), size / 6), ci);
workspace->draw_rect(Rect2(anchor + Vector2(size.x * 5 / 6, size.y / 2), size / 6), ci);
} else if (mask & TileSet::BIND_RIGHT) {
workspace->draw_rect(Rect2(anchor + Vector2((size.x / 3) * 2, size.y / 3), size / 3), c);
}
if (mask & TileSet::BIND_IGNORE_BOTTOMLEFT) {
workspace->draw_rect(Rect2(anchor + Vector2(0, size.y * 4 / 6), size / 6), ci);
workspace->draw_rect(Rect2(anchor + Vector2(size.x / 6, size.y * 5 / 6), size / 6), ci);
} else if (mask & TileSet::BIND_BOTTOMLEFT) {
workspace->draw_rect(Rect2(anchor + Vector2(0, (size.y / 3) * 2), size / 3), c);
}
if (mask & TileSet::BIND_IGNORE_BOTTOM) {
workspace->draw_rect(Rect2(anchor + Vector2(size.x / 3, size.y * 4 / 6), size / 6), ci);
workspace->draw_rect(Rect2(anchor + Vector2(size.x / 2, size.y * 5 / 6), size / 6), ci);
} else if (mask & TileSet::BIND_BOTTOM) {
workspace->draw_rect(Rect2(anchor + Vector2(size.x / 3, (size.y / 3) * 2), size / 3), c);
}
if (mask & TileSet::BIND_IGNORE_BOTTOMRIGHT) {
workspace->draw_rect(Rect2(anchor + size * 4 / 6, size / 6), ci);
workspace->draw_rect(Rect2(anchor + size * 5 / 6, size / 6), ci);
} else if (mask & TileSet::BIND_BOTTOMRIGHT) {
workspace->draw_rect(Rect2(anchor + (size / 3) * 2, size / 3), c);
}
}
}
}
} break;
case EDITMODE_COLLISION:
case EDITMODE_OCCLUSION:
case EDITMODE_NAVIGATION: {
if (tileset->tile_get_tile_mode(get_current_tile()) == TileSet::AUTO_TILE || tileset->tile_get_tile_mode(get_current_tile()) == TileSet::ATLAS_TILE) {
draw_highlight_subtile(edited_shape_coord);
}
draw_polygon_shapes();
draw_grid_snap();
} break;
case EDITMODE_PRIORITY: {
spin_priority->set_value(tileset->autotile_get_subtile_priority(get_current_tile(), edited_shape_coord));
uint32_t mask = tileset->autotile_get_bitmask(get_current_tile(), edited_shape_coord);
Vector<Vector2> queue_others;
int total = 0;
for (Map<Vector2, uint32_t>::Element *E = tileset->autotile_get_bitmask_map(get_current_tile()).front(); E; E = E->next()) {
if (E->value() == mask) {
total += tileset->autotile_get_subtile_priority(get_current_tile(), E->key());
if (E->key() != edited_shape_coord) {
queue_others.push_back(E->key());
}
}
}
spin_priority->set_suffix(" / " + String::num(total, 0));
draw_highlight_subtile(edited_shape_coord, queue_others);
} break;
case EDITMODE_Z_INDEX: {
spin_z_index->set_value(tileset->autotile_get_z_index(get_current_tile(), edited_shape_coord));
draw_highlight_subtile(edited_shape_coord);
} break;
default: {
}
}
}
String current_texture_path = get_current_texture()->get_path();
List<int> tiles;
tileset->get_tile_list(&tiles);
for (List<int>::Element *E = tiles.front(); E; E = E->next()) {
int t_id = E->get();
if (tileset->tile_get_texture(t_id)->get_path() == current_texture_path && (t_id != get_current_tile() || edit_mode != EDITMODE_REGION || workspace_mode != WORKSPACE_EDIT)) {
Rect2i region = tileset->tile_get_region(t_id);
region.position += WORKSPACE_MARGIN;
Color c;
if (tileset->tile_get_tile_mode(t_id) == TileSet::SINGLE_TILE)
c = COLOR_SINGLE;
else if (tileset->tile_get_tile_mode(t_id) == TileSet::AUTO_TILE)
c = COLOR_AUTOTILE;
else if (tileset->tile_get_tile_mode(t_id) == TileSet::ATLAS_TILE)
c = COLOR_ATLAS;
draw_tile_subdivision(t_id, COLOR_SUBDIVISION);
workspace->draw_rect(region, c, false);
}
}
if (edit_mode == EDITMODE_REGION) {
if (workspace_mode != WORKSPACE_EDIT) {
Rect2i region = edited_region;
Color c;
if (workspace_mode == WORKSPACE_CREATE_SINGLE)
c = COLOR_SINGLE;
else if (workspace_mode == WORKSPACE_CREATE_AUTOTILE)
c = COLOR_AUTOTILE;
else if (workspace_mode == WORKSPACE_CREATE_ATLAS)
c = COLOR_ATLAS;
workspace->draw_rect(region, c, false);
draw_edited_region_subdivision();
} else {
int t_id = get_current_tile();
if (t_id < 0)
return;
Rect2i region;
if (draw_edited_region)
region = edited_region;
else {
region = tileset->tile_get_region(t_id);
region.position += WORKSPACE_MARGIN;
}
if (draw_edited_region)
draw_edited_region_subdivision();
else
draw_tile_subdivision(t_id, COLOR_SUBDIVISION);
Color c;
if (tileset->tile_get_tile_mode(t_id) == TileSet::SINGLE_TILE)
c = COLOR_SINGLE;
else if (tileset->tile_get_tile_mode(t_id) == TileSet::AUTO_TILE)
c = COLOR_AUTOTILE;
else if (tileset->tile_get_tile_mode(t_id) == TileSet::ATLAS_TILE)
c = COLOR_ATLAS;
workspace->draw_rect(region, c, false);
}
}
workspace_overlay->update();
}
void TileSetEditor::_on_workspace_process() {
if (Input::get_singleton()->is_key_pressed(KEY_ALT) || tools[VISIBLE_INFO]->is_pressed()) {
if (!tile_names_visible) {
tile_names_visible = true;
workspace_overlay->update();
}
} else if (tile_names_visible) {
tile_names_visible = false;
workspace_overlay->update();
}
}
void TileSetEditor::_on_workspace_overlay_draw() {
if (!tileset.is_valid() || !get_current_texture().is_valid())
return;
const Color COLOR_AUTOTILE = Color(0.266373, 0.565288, 0.988281);
const Color COLOR_SINGLE = Color(0.988281, 0.909323, 0.266373);
const Color COLOR_ATLAS = Color(0.78653, 0.812835, 0.832031);
if (tile_names_visible) {
String current_texture_path = get_current_texture()->get_path();
List<int> tiles;
tileset->get_tile_list(&tiles);
for (List<int>::Element *E = tiles.front(); E; E = E->next()) {
int t_id = E->get();
if (tileset->tile_get_texture(t_id)->get_path() != current_texture_path)
continue;
Rect2 region = tileset->tile_get_region(t_id);
region.position += WORKSPACE_MARGIN;
region.position *= workspace->get_scale().x;
Color c;
if (tileset->tile_get_tile_mode(t_id) == TileSet::SINGLE_TILE)
c = COLOR_SINGLE;
else if (tileset->tile_get_tile_mode(t_id) == TileSet::AUTO_TILE)
c = COLOR_AUTOTILE;
else if (tileset->tile_get_tile_mode(t_id) == TileSet::ATLAS_TILE)
c = COLOR_ATLAS;
String tile_id_name = String::num(t_id, 0) + ": " + tileset->tile_get_name(t_id);
Ref<Font> font = get_font("font", "Label");
region.set_size(font->get_string_size(tile_id_name));
workspace_overlay->draw_rect(region, c);
region.position.y += region.size.y - 2;
c = Color(0.1, 0.1, 0.1);
workspace_overlay->draw_string(font, region.position, tile_id_name, c);
}
}
int t_id = get_current_tile();
if (t_id < 0)
return;
Ref<Texture> handle = get_icon("EditorHandle", "EditorIcons");
if (draw_handles) {
for (int i = 0; i < current_shape.size(); i++) {
workspace_overlay->draw_texture(handle, current_shape[i] * workspace->get_scale().x - handle->get_size() * 0.5);
}
}
}
int TileSetEditor::get_grabbed_point(const Vector2 &p_mouse_pos, real_t p_grab_threshold) {
Transform2D xform = workspace->get_transform();
int grabbed_point = -1;
real_t min_distance = 1e10;
for (int i = 0; i < current_shape.size(); i++) {
const real_t distance = xform.xform(current_shape[i]).distance_to(xform.xform(p_mouse_pos));
if (distance < p_grab_threshold && distance < min_distance) {
min_distance = distance;
grabbed_point = i;
}
}
return grabbed_point;
}
bool TileSetEditor::is_within_grabbing_distance_of_first_point(const Vector2 &p_pos, real_t p_grab_threshold) {
Transform2D xform = workspace->get_transform();
const real_t distance = xform.xform(current_shape[0]).distance_to(xform.xform(p_pos));
return distance < p_grab_threshold;
}
void TileSetEditor::_on_scroll_container_input(const Ref<InputEvent> &p_event) {
const Ref<InputEventMouseButton> mb = p_event;
if (mb.is_valid()) {
// Zoom in/out using Ctrl + mouse wheel. This is done on the ScrollContainer
// to allow performing this action anywhere, even if the cursor isn't
// hovering the texture in the workspace.
if (mb->get_button_index() == BUTTON_WHEEL_UP && mb->is_pressed() && mb->get_control()) {
print_line("zooming in");
_zoom_in();
// Don't scroll up after zooming in.
accept_event();
} else if (mb->get_button_index() == BUTTON_WHEEL_DOWN && mb->is_pressed() && mb->get_control()) {
print_line("zooming out");
_zoom_out();
// Don't scroll down after zooming out.
accept_event();
}
}
}
void TileSetEditor::_on_workspace_input(const Ref<InputEvent> &p_ie) {
if (tileset.is_null() || !get_current_texture().is_valid())
return;
static bool dragging;
static bool erasing;
static bool alternative;
draw_edited_region = false;
Rect2 current_tile_region = Rect2();
if (get_current_tile() >= 0) {
current_tile_region = tileset->tile_get_region(get_current_tile());
}
current_tile_region.position += WORKSPACE_MARGIN;
const Ref<InputEventMouseButton> mb = p_ie;
const Ref<InputEventMouseMotion> mm = p_ie;
if (mb.is_valid()) {
if (mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT && !creating_shape) {
if (!current_tile_region.has_point(mb->get_position())) {
String current_texture_path = get_current_texture()->get_path();
List<int> tiles;
tileset->get_tile_list(&tiles);
for (List<int>::Element *E = tiles.front(); E; E = E->next()) {
int t_id = E->get();
if (tileset->tile_get_texture(t_id)->get_path() == current_texture_path) {
Rect2 r = tileset->tile_get_region(t_id);
r.position += WORKSPACE_MARGIN;
if (r.has_point(mb->get_position())) {
set_current_tile(t_id);
workspace->update();
workspace_overlay->update();
return;
}
}
}
}
}
}
// Drag Middle Mouse
if (mm.is_valid()) {
if (mm->get_button_mask() & BUTTON_MASK_MIDDLE) {
Vector2 dragged(mm->get_relative().x, mm->get_relative().y);
scroll->set_h_scroll(scroll->get_h_scroll() - dragged.x * workspace->get_scale().x);
scroll->set_v_scroll(scroll->get_v_scroll() - dragged.y * workspace->get_scale().x);
}
}
if (edit_mode == EDITMODE_REGION) {
if (mb.is_valid()) {
if (mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) {
if (get_current_tile() >= 0 || workspace_mode != WORKSPACE_EDIT) {
dragging = true;
region_from = mb->get_position();
edited_region = Rect2(region_from, Size2());
workspace->update();
workspace_overlay->update();
return;
}
} else if (dragging && mb->is_pressed() && mb->get_button_index() == BUTTON_RIGHT) {
dragging = false;
edited_region = Rect2();
workspace->update();
workspace_overlay->update();
return;
} else if (dragging && !mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) {
dragging = false;
update_edited_region(mb->get_position());
edited_region.position -= WORKSPACE_MARGIN;
if (!edited_region.has_no_area()) {
if (get_current_tile() >= 0 && workspace_mode == WORKSPACE_EDIT) {
undo_redo->create_action(TTR("Set Tile Region"));
undo_redo->add_do_method(tileset.ptr(), "tile_set_region", get_current_tile(), edited_region);
undo_redo->add_undo_method(tileset.ptr(), "tile_set_region", get_current_tile(), tileset->tile_get_region(get_current_tile()));
Size2 tile_workspace_size = edited_region.position + edited_region.size + WORKSPACE_MARGIN * 2;
Size2 workspace_minsize = workspace->get_custom_minimum_size();
// If the new region is bigger, just directly change the workspace size to avoid checking all other tiles.
if (tile_workspace_size.x > workspace_minsize.x || tile_workspace_size.y > workspace_minsize.y) {
Size2 max_workspace_size = Size2(MAX(tile_workspace_size.x, workspace_minsize.x), MAX(tile_workspace_size.y, workspace_minsize.y));
undo_redo->add_do_method(workspace, "set_custom_minimum_size", max_workspace_size);
undo_redo->add_undo_method(workspace, "set_custom_minimum_size", workspace_minsize);
undo_redo->add_do_method(workspace_container, "set_custom_minimum_size", max_workspace_size);
undo_redo->add_undo_method(workspace_container, "set_custom_minimum_size", workspace_minsize);
undo_redo->add_do_method(workspace_overlay, "set_custom_minimum_size", max_workspace_size);
undo_redo->add_undo_method(workspace_overlay, "set_custom_minimum_size", workspace_minsize);
} else if (workspace_minsize.x > get_current_texture()->get_size().x + WORKSPACE_MARGIN.x * 2 || workspace_minsize.y > get_current_texture()->get_size().y + WORKSPACE_MARGIN.y * 2) {
undo_redo->add_do_method(this, "update_workspace_minsize");
undo_redo->add_undo_method(this, "update_workspace_minsize");
}
edited_region = Rect2();
undo_redo->add_do_method(workspace, "update");
undo_redo->add_undo_method(workspace, "update");
undo_redo->add_do_method(workspace_overlay, "update");
undo_redo->add_undo_method(workspace_overlay, "update");
undo_redo->commit_action();
} else {
int t_id = tileset->get_last_unused_tile_id();
undo_redo->create_action(TTR("Create Tile"));
undo_redo->add_do_method(tileset.ptr(), "create_tile", t_id);
undo_redo->add_undo_method(tileset.ptr(), "remove_tile", t_id);
undo_redo->add_undo_method(this, "_validate_current_tile_id");
undo_redo->add_do_method(tileset.ptr(), "tile_set_texture", t_id, get_current_texture());
undo_redo->add_do_method(tileset.ptr(), "tile_set_region", t_id, edited_region);
undo_redo->add_do_method(tileset.ptr(), "tile_set_name", t_id, get_current_texture()->get_path().get_file() + " " + String::num(t_id, 0));
if (workspace_mode != WORKSPACE_CREATE_SINGLE) {
undo_redo->add_do_method(tileset.ptr(), "autotile_set_size", t_id, snap_step);
undo_redo->add_do_method(tileset.ptr(), "autotile_set_spacing", t_id, snap_separation.x);
undo_redo->add_do_method(tileset.ptr(), "tile_set_tile_mode", t_id, workspace_mode == WORKSPACE_CREATE_AUTOTILE ? TileSet::AUTO_TILE : TileSet::ATLAS_TILE);
}
tool_workspacemode[WORKSPACE_EDIT]->set_pressed(true);
tool_editmode[EDITMODE_COLLISION]->set_pressed(true);
edit_mode = EDITMODE_COLLISION;
Size2 tile_workspace_size = edited_region.position + edited_region.size + WORKSPACE_MARGIN * 2;
Size2 workspace_minsize = workspace->get_custom_minimum_size();
if (tile_workspace_size.x > workspace_minsize.x || tile_workspace_size.y > workspace_minsize.y) {
Size2 new_workspace_minsize = Size2(MAX(tile_workspace_size.x, workspace_minsize.x), MAX(tile_workspace_size.y, workspace_minsize.y));
undo_redo->add_do_method(workspace, "set_custom_minimum_size", new_workspace_minsize);
undo_redo->add_undo_method(workspace, "set_custom_minimum_size", workspace_minsize);
undo_redo->add_do_method(workspace_container, "set_custom_minimum_size", new_workspace_minsize);
undo_redo->add_undo_method(workspace_container, "set_custom_minimum_size", workspace_minsize);
undo_redo->add_do_method(workspace_overlay, "set_custom_minimum_size", new_workspace_minsize);
undo_redo->add_undo_method(workspace_overlay, "set_custom_minimum_size", workspace_minsize);
}
edited_region = Rect2();
undo_redo->add_do_method(workspace, "update");
undo_redo->add_undo_method(workspace, "update");
undo_redo->add_do_method(workspace_overlay, "update");
undo_redo->add_undo_method(workspace_overlay, "update");
undo_redo->commit_action();
set_current_tile(t_id);
_on_workspace_mode_changed(WORKSPACE_EDIT);
}
} else {
edited_region = Rect2();
workspace->update();
workspace_overlay->update();
}
return;
}
} else if (mm.is_valid()) {
if (dragging) {
update_edited_region(mm->get_position());
draw_edited_region = true;
workspace->update();
workspace_overlay->update();
return;
}
}
}
if (workspace_mode == WORKSPACE_EDIT) {
if (get_current_tile() >= 0) {
int spacing = tileset->autotile_get_spacing(get_current_tile());
Vector2 size = tileset->autotile_get_size(get_current_tile());
switch (edit_mode) {
case EDITMODE_ICON: {
if (mb.is_valid()) {
if (mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT && current_tile_region.has_point(mb->get_position())) {
Vector2 coord((int)((mb->get_position().x - current_tile_region.position.x) / (spacing + size.x)), (int)((mb->get_position().y - current_tile_region.position.y) / (spacing + size.y)));
undo_redo->create_action(TTR("Set Tile Icon"));
undo_redo->add_do_method(tileset.ptr(), "autotile_set_icon_coordinate", get_current_tile(), coord);
undo_redo->add_undo_method(tileset.ptr(), "autotile_set_icon_coordinate", get_current_tile(), tileset->autotile_get_icon_coordinate(get_current_tile()));
undo_redo->add_do_method(workspace, "update");
undo_redo->add_undo_method(workspace, "update");
undo_redo->commit_action();
}
}
} break;
case EDITMODE_BITMASK: {
if (mb.is_valid()) {
if (mb->is_pressed()) {
if (dragging) {
return;
}
if ((mb->get_button_index() == BUTTON_RIGHT || mb->get_button_index() == BUTTON_LEFT) && current_tile_region.has_point(mb->get_position())) {
dragging = true;
erasing = (mb->get_button_index() == BUTTON_RIGHT);
alternative = Input::get_singleton()->is_key_pressed(KEY_SHIFT);
Vector2 coord((int)((mb->get_position().x - current_tile_region.position.x) / (spacing + size.x)), (int)((mb->get_position().y - current_tile_region.position.y) / (spacing + size.y)));
Vector2 pos(coord.x * (spacing + size.x), coord.y * (spacing + size.y));
pos = mb->get_position() - (pos + current_tile_region.position);
uint32_t bit = 0;
if (tileset->autotile_get_bitmask_mode(get_current_tile()) == TileSet::BITMASK_2X2) {
if (pos.x < size.x / 2) {
if (pos.y < size.y / 2) {
bit = TileSet::BIND_TOPLEFT;
} else {
bit = TileSet::BIND_BOTTOMLEFT;
}
} else {
if (pos.y < size.y / 2) {
bit = TileSet::BIND_TOPRIGHT;
} else {
bit = TileSet::BIND_BOTTOMRIGHT;
}
}
} else {
if (pos.x < size.x / 3) {
if (pos.y < size.y / 3) {
bit = TileSet::BIND_TOPLEFT;
} else if (pos.y > (size.y / 3) * 2) {
bit = TileSet::BIND_BOTTOMLEFT;
} else {
bit = TileSet::BIND_LEFT;
}
} else if (pos.x > (size.x / 3) * 2) {
if (pos.y < size.y / 3) {
bit = TileSet::BIND_TOPRIGHT;
} else if (pos.y > (size.y / 3) * 2) {
bit = TileSet::BIND_BOTTOMRIGHT;
} else {
bit = TileSet::BIND_RIGHT;
}
} else {
if (pos.y < size.y / 3) {
bit = TileSet::BIND_TOP;
} else if (pos.y > (size.y / 3) * 2) {
bit = TileSet::BIND_BOTTOM;
} else {
bit = TileSet::BIND_CENTER;
}
}
}
uint32_t old_mask = tileset->autotile_get_bitmask(get_current_tile(), coord);
uint32_t new_mask = old_mask;
if (alternative) {
new_mask &= ~bit;
new_mask |= (bit << 16);
} else if (erasing) {
new_mask &= ~bit;
new_mask &= ~(bit << 16);
} else {
new_mask |= bit;
new_mask &= ~(bit << 16);
}
if (old_mask != new_mask) {
undo_redo->create_action(TTR("Edit Tile Bitmask"));
undo_redo->add_do_method(tileset.ptr(), "autotile_set_bitmask", get_current_tile(), coord, new_mask);
undo_redo->add_undo_method(tileset.ptr(), "autotile_set_bitmask", get_current_tile(), coord, old_mask);
undo_redo->add_do_method(workspace, "update");
undo_redo->add_undo_method(workspace, "update");
undo_redo->commit_action();
}
}
} else {
if ((erasing && mb->get_button_index() == BUTTON_RIGHT) || (!erasing && mb->get_button_index() == BUTTON_LEFT)) {
dragging = false;
erasing = false;
alternative = false;
}
}
}
if (mm.is_valid()) {
if (dragging && current_tile_region.has_point(mm->get_position())) {
Vector2 coord((int)((mm->get_position().x - current_tile_region.position.x) / (spacing + size.x)), (int)((mm->get_position().y - current_tile_region.position.y) / (spacing + size.y)));
Vector2 pos(coord.x * (spacing + size.x), coord.y * (spacing + size.y));
pos = mm->get_position() - (pos + current_tile_region.position);
uint32_t bit = 0;
if (tileset->autotile_get_bitmask_mode(get_current_tile()) == TileSet::BITMASK_2X2) {
if (pos.x < size.x / 2) {
if (pos.y < size.y / 2) {
bit = TileSet::BIND_TOPLEFT;
} else {
bit = TileSet::BIND_BOTTOMLEFT;
}
} else {
if (pos.y < size.y / 2) {
bit = TileSet::BIND_TOPRIGHT;
} else {
bit = TileSet::BIND_BOTTOMRIGHT;
}
}
} else {
if (pos.x < size.x / 3) {
if (pos.y < size.y / 3) {
bit = TileSet::BIND_TOPLEFT;
} else if (pos.y > (size.y / 3) * 2) {
bit = TileSet::BIND_BOTTOMLEFT;
} else {
bit = TileSet::BIND_LEFT;
}
} else if (pos.x > (size.x / 3) * 2) {
if (pos.y < size.y / 3) {
bit = TileSet::BIND_TOPRIGHT;
} else if (pos.y > (size.y / 3) * 2) {
bit = TileSet::BIND_BOTTOMRIGHT;
} else {
bit = TileSet::BIND_RIGHT;
}
} else {
if (pos.y < size.y / 3) {
bit = TileSet::BIND_TOP;
} else if (pos.y > (size.y / 3) * 2) {
bit = TileSet::BIND_BOTTOM;
} else {
bit = TileSet::BIND_CENTER;
}
}
}
uint32_t old_mask = tileset->autotile_get_bitmask(get_current_tile(), coord);
uint32_t new_mask = old_mask;
if (alternative) {
new_mask &= ~bit;
new_mask |= (bit << 16);
} else if (erasing) {
new_mask &= ~bit;
new_mask &= ~(bit << 16);
} else {
new_mask |= bit;
new_mask &= ~(bit << 16);
}
if (old_mask != new_mask) {
undo_redo->create_action(TTR("Edit Tile Bitmask"));
undo_redo->add_do_method(tileset.ptr(), "autotile_set_bitmask", get_current_tile(), coord, new_mask);
undo_redo->add_undo_method(tileset.ptr(), "autotile_set_bitmask", get_current_tile(), coord, old_mask);
undo_redo->add_do_method(workspace, "update");
undo_redo->add_undo_method(workspace, "update");
undo_redo->commit_action();
}
}
}
} break;
case EDITMODE_COLLISION:
case EDITMODE_OCCLUSION:
case EDITMODE_NAVIGATION:
case EDITMODE_PRIORITY:
case EDITMODE_Z_INDEX: {
Vector2 shape_anchor = Vector2(0, 0);
if (tileset->tile_get_tile_mode(get_current_tile()) == TileSet::AUTO_TILE || tileset->tile_get_tile_mode(get_current_tile()) == TileSet::ATLAS_TILE) {
shape_anchor = edited_shape_coord;
shape_anchor.x *= (size.x + spacing);
shape_anchor.y *= (size.y + spacing);
}
const real_t grab_threshold = EDITOR_GET("editors/poly_editor/point_grab_radius");
shape_anchor += current_tile_region.position;
if (tools[TOOL_SELECT]->is_pressed()) {
if (mb.is_valid()) {
if (mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) {
if (edit_mode != EDITMODE_PRIORITY && current_shape.size() > 0) {
int grabbed_point = get_grabbed_point(mb->get_position(), grab_threshold);
if (grabbed_point >= 0) {
dragging_point = grabbed_point;
workspace->update();
return;
}
}
if ((tileset->tile_get_tile_mode(get_current_tile()) == TileSet::AUTO_TILE || tileset->tile_get_tile_mode(get_current_tile()) == TileSet::ATLAS_TILE) && current_tile_region.has_point(mb->get_position())) {
Vector2 coord((int)((mb->get_position().x - current_tile_region.position.x) / (spacing + size.x)), (int)((mb->get_position().y - current_tile_region.position.y) / (spacing + size.y)));
if (edited_shape_coord != coord) {
edited_shape_coord = coord;
_select_edited_shape_coord();
}
}
workspace->update();
} else if (!mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) {
if (edit_mode == EDITMODE_COLLISION) {
if (dragging_point >= 0) {
dragging_point = -1;
Vector<Vector2> points;
for (int i = 0; i < current_shape.size(); i++) {
Vector2 p = current_shape[i];
if (tools[TOOL_GRID_SNAP]->is_pressed() || tools[SHAPE_KEEP_INSIDE_TILE]->is_pressed()) {
p = snap_point(p);
}
points.push_back(p - shape_anchor);
}
undo_redo->create_action(TTR("Edit Collision Polygon"));
_set_edited_shape_points(points);
undo_redo->add_do_method(this, "_select_edited_shape_coord");
undo_redo->add_undo_method(this, "_select_edited_shape_coord");
undo_redo->commit_action();
}
} else if (edit_mode == EDITMODE_OCCLUSION) {
if (dragging_point >= 0) {
dragging_point = -1;
PoolVector<Vector2> polygon;
polygon.resize(current_shape.size());
PoolVector<Vector2>::Write w = polygon.write();
for (int i = 0; i < current_shape.size(); i++) {
w[i] = current_shape[i] - shape_anchor;
}
w.release();
undo_redo->create_action(TTR("Edit Occlusion Polygon"));
undo_redo->add_do_method(edited_occlusion_shape.ptr(), "set_polygon", polygon);
undo_redo->add_undo_method(edited_occlusion_shape.ptr(), "set_polygon", edited_occlusion_shape->get_polygon());
undo_redo->add_do_method(this, "_select_edited_shape_coord");
undo_redo->add_undo_method(this, "_select_edited_shape_coord");
undo_redo->commit_action();
}
} else if (edit_mode == EDITMODE_NAVIGATION) {
if (dragging_point >= 0) {
dragging_point = -1;
PoolVector<Vector2> polygon;
Vector<int> indices;
polygon.resize(current_shape.size());
PoolVector<Vector2>::Write w = polygon.write();
for (int i = 0; i < current_shape.size(); i++) {
w[i] = current_shape[i] - shape_anchor;
indices.push_back(i);
}
w.release();
undo_redo->create_action(TTR("Edit Navigation Polygon"));
undo_redo->add_do_method(edited_navigation_shape.ptr(), "set_vertices", polygon);
undo_redo->add_undo_method(edited_navigation_shape.ptr(), "set_vertices", edited_navigation_shape->get_vertices());
undo_redo->add_do_method(edited_navigation_shape.ptr(), "clear_polygons");
undo_redo->add_undo_method(edited_navigation_shape.ptr(), "clear_polygons");
undo_redo->add_do_method(edited_navigation_shape.ptr(), "add_polygon", indices);
undo_redo->add_undo_method(edited_navigation_shape.ptr(), "add_polygon", edited_navigation_shape->get_polygon(0));
undo_redo->add_do_method(this, "_select_edited_shape_coord");
undo_redo->add_undo_method(this, "_select_edited_shape_coord");
undo_redo->commit_action();
}
}
}
} else if (mm.is_valid()) {
if (dragging_point >= 0) {
current_shape.set(dragging_point, snap_point(mm->get_position()));
workspace->update();
}
}
} else if (tools[SHAPE_NEW_POLYGON]->is_pressed()) {
if (mb.is_valid()) {
if (mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) {
Vector2 pos = mb->get_position();
pos = snap_point(pos);
if (creating_shape) {
if (current_shape.size() > 2) {
if (is_within_grabbing_distance_of_first_point(mb->get_position(), grab_threshold)) {
close_shape(shape_anchor);
workspace->update();
return;
}
}
current_shape.push_back(pos);
workspace->update();
} else {
creating_shape = true;
_set_edited_collision_shape(Ref<ConvexPolygonShape2D>());
current_shape.resize(0);
current_shape.push_back(snap_point(pos));
workspace->update();
}
} else if (mb->is_pressed() && mb->get_button_index() == BUTTON_RIGHT) {
if (creating_shape) {
creating_shape = false;
_select_edited_shape_coord();
workspace->update();
}
}
} else if (mm.is_valid()) {
if (creating_shape) {
workspace->update();
}
}
} else if (tools[SHAPE_NEW_RECTANGLE]->is_pressed()) {
if (mb.is_valid()) {
if (mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) {
_set_edited_collision_shape(Ref<ConvexPolygonShape2D>());
current_shape.resize(0);
Vector2 pos = mb->get_position();
pos = snap_point(pos);
current_shape.push_back(pos);
current_shape.push_back(pos);
current_shape.push_back(pos);
current_shape.push_back(pos);
creating_shape = true;
workspace->update();
return;
} else if (mb->is_pressed() && mb->get_button_index() == BUTTON_RIGHT) {
if (creating_shape) {
creating_shape = false;
_select_edited_shape_coord();
workspace->update();
}
} else if (!mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) {
if (creating_shape) {
// if the first two corners are within grabbing distance of one another, expand the rect to fill the tile
if (is_within_grabbing_distance_of_first_point(current_shape[1], grab_threshold)) {
current_shape.set(0, snap_point(shape_anchor));
current_shape.set(1, snap_point(shape_anchor + Vector2(current_tile_region.size.x, 0)));
current_shape.set(2, snap_point(shape_anchor + current_tile_region.size));
current_shape.set(3, snap_point(shape_anchor + Vector2(0, current_tile_region.size.y)));
}
close_shape(shape_anchor);
workspace->update();
return;
}
}
} else if (mm.is_valid()) {
if (creating_shape) {
Vector2 pos = mm->get_position();
pos = snap_point(pos);
Vector2 p = current_shape[2];
current_shape.set(3, snap_point(Vector2(pos.x, p.y)));
current_shape.set(0, snap_point(pos));
current_shape.set(1, snap_point(Vector2(p.x, pos.y)));
workspace->update();
}
}
}
} break;
default: {
}
}
}
}
}
void TileSetEditor::_on_tool_clicked(int p_tool) {
if (p_tool == BITMASK_COPY) {
bitmask_map_copy = tileset->autotile_get_bitmask_map(get_current_tile());
} else if (p_tool == BITMASK_PASTE) {
undo_redo->create_action(TTR("Paste Tile Bitmask"));
undo_redo->add_do_method(tileset.ptr(), "autotile_clear_bitmask_map", get_current_tile());
undo_redo->add_undo_method(tileset.ptr(), "autotile_clear_bitmask_map", get_current_tile());
for (Map<Vector2, uint32_t>::Element *E = bitmask_map_copy.front(); E; E = E->next()) {
undo_redo->add_do_method(tileset.ptr(), "autotile_set_bitmask", get_current_tile(), E->key(), E->value());
}
for (Map<Vector2, uint32_t>::Element *E = tileset->autotile_get_bitmask_map(get_current_tile()).front(); E; E = E->next()) {
undo_redo->add_undo_method(tileset.ptr(), "autotile_set_bitmask", get_current_tile(), E->key(), E->value());
}
undo_redo->add_do_method(workspace, "update");
undo_redo->add_undo_method(workspace, "update");
undo_redo->commit_action();
} else if (p_tool == BITMASK_CLEAR) {
undo_redo->create_action(TTR("Clear Tile Bitmask"));
undo_redo->add_do_method(tileset.ptr(), "autotile_clear_bitmask_map", get_current_tile());
for (Map<Vector2, uint32_t>::Element *E = tileset->autotile_get_bitmask_map(get_current_tile()).front(); E; E = E->next()) {
undo_redo->add_undo_method(tileset.ptr(), "autotile_set_bitmask", get_current_tile(), E->key(), E->value());
}
undo_redo->add_do_method(workspace, "update");
undo_redo->add_undo_method(workspace, "update");
undo_redo->commit_action();
} else if (p_tool == SHAPE_TOGGLE_TYPE) {
if (edited_collision_shape.is_valid()) {
Ref<ConvexPolygonShape2D> convex = edited_collision_shape;
Ref<ConcavePolygonShape2D> concave = edited_collision_shape;
Ref<Shape2D> previous_shape = edited_collision_shape;
Array sd = tileset->call("tile_get_shapes", get_current_tile());
if (convex.is_valid()) {
// Make concave.
undo_redo->create_action(TTR("Make Polygon Concave"));
Ref<ConcavePolygonShape2D> _concave = memnew(ConcavePolygonShape2D);
edited_collision_shape = _concave;
_set_edited_shape_points(_get_collision_shape_points(convex));
} else if (concave.is_valid()) {
// Make convex.
undo_redo->create_action(TTR("Make Polygon Convex"));
Ref<ConvexPolygonShape2D> _convex = memnew(ConvexPolygonShape2D);
edited_collision_shape = _convex;
_set_edited_shape_points(_get_collision_shape_points(concave));
}
for (int i = 0; i < sd.size(); i++) {
if (sd[i].get("shape") == previous_shape) {
undo_redo->add_undo_method(tileset.ptr(), "tile_set_shapes", get_current_tile(), sd.duplicate());
sd.remove(i);
break;
}
}
undo_redo->add_do_method(tileset.ptr(), "tile_set_shapes", get_current_tile(), sd);
if (tileset->tile_get_tile_mode(get_current_tile()) == TileSet::AUTO_TILE || tileset->tile_get_tile_mode(get_current_tile()) == TileSet::ATLAS_TILE) {
undo_redo->add_do_method(tileset.ptr(), "tile_add_shape", get_current_tile(), edited_collision_shape, Transform2D(), false, edited_shape_coord);
} else {
undo_redo->add_do_method(tileset.ptr(), "tile_add_shape", get_current_tile(), edited_collision_shape, Transform2D());
}
undo_redo->add_do_method(this, "_select_edited_shape_coord");
undo_redo->add_undo_method(this, "_select_edited_shape_coord");
undo_redo->commit_action();
_update_toggle_shape_button();
workspace->update();
workspace_container->update();
helper->_change_notify("");
}
} else if (p_tool == SELECT_NEXT) {
_select_next_shape();
} else if (p_tool == SELECT_PREVIOUS) {
_select_previous_shape();
} else if (p_tool == SHAPE_DELETE) {
if (creating_shape) {
creating_shape = false;
current_shape.resize(0);
workspace->update();
} else {
switch (edit_mode) {
case EDITMODE_REGION: {
int t_id = get_current_tile();
if (workspace_mode == WORKSPACE_EDIT && t_id >= 0) {
undo_redo->create_action(TTR("Remove Tile"));
undo_redo->add_do_method(tileset.ptr(), "remove_tile", t_id);
_undo_tile_removal(t_id);
undo_redo->add_do_method(this, "_validate_current_tile_id");
Rect2 tile_region = tileset->tile_get_region(get_current_tile());
Size2 tile_workspace_size = tile_region.position + tile_region.size;
if (tile_workspace_size.x > get_current_texture()->get_size().x || tile_workspace_size.y > get_current_texture()->get_size().y) {
undo_redo->add_do_method(this, "update_workspace_minsize");
undo_redo->add_undo_method(this, "update_workspace_minsize");
}
undo_redo->add_do_method(workspace, "update");
undo_redo->add_undo_method(workspace, "update");
undo_redo->add_do_method(workspace_overlay, "update");
undo_redo->add_undo_method(workspace_overlay, "update");
undo_redo->commit_action();
}
tool_workspacemode[WORKSPACE_EDIT]->set_pressed(true);
workspace_mode = WORKSPACE_EDIT;
update_workspace_tile_mode();
} break;
case EDITMODE_COLLISION: {
if (!edited_collision_shape.is_null()) {
// Necessary to get the version that returns a Array instead of a Vector.
Array sd = tileset->call("tile_get_shapes", get_current_tile());
for (int i = 0; i < sd.size(); i++) {
if (sd[i].get("shape") == edited_collision_shape) {
undo_redo->create_action(TTR("Remove Collision Polygon"));
undo_redo->add_undo_method(tileset.ptr(), "tile_set_shapes", get_current_tile(), sd.duplicate());
sd.remove(i);
undo_redo->add_do_method(tileset.ptr(), "tile_set_shapes", get_current_tile(), sd);
undo_redo->add_do_method(this, "_select_edited_shape_coord");
undo_redo->add_undo_method(this, "_select_edited_shape_coord");
undo_redo->commit_action();
break;
}
}
}
} break;
case EDITMODE_OCCLUSION: {
if (!edited_occlusion_shape.is_null()) {
undo_redo->create_action(TTR("Remove Occlusion Polygon"));
if (tileset->tile_get_tile_mode(get_current_tile()) == TileSet::SINGLE_TILE) {
undo_redo->add_do_method(tileset.ptr(), "tile_set_light_occluder", get_current_tile(), Ref<OccluderPolygon2D>());
undo_redo->add_undo_method(tileset.ptr(), "tile_set_light_occluder", get_current_tile(), tileset->tile_get_light_occluder(get_current_tile()));
} else {
undo_redo->add_do_method(tileset.ptr(), "autotile_set_light_occluder", get_current_tile(), Ref<OccluderPolygon2D>(), edited_shape_coord);
undo_redo->add_undo_method(tileset.ptr(), "autotile_set_light_occluder", get_current_tile(), tileset->autotile_get_light_occluder(get_current_tile(), edited_shape_coord), edited_shape_coord);
}
undo_redo->add_do_method(this, "_select_edited_shape_coord");
undo_redo->add_undo_method(this, "_select_edited_shape_coord");
undo_redo->commit_action();
}
} break;
case EDITMODE_NAVIGATION: {
if (!edited_navigation_shape.is_null()) {
undo_redo->create_action(TTR("Remove Navigation Polygon"));
if (tileset->tile_get_tile_mode(get_current_tile()) == TileSet::SINGLE_TILE) {
undo_redo->add_do_method(tileset.ptr(), "tile_set_navigation_polygon", get_current_tile(), Ref<NavigationPolygon>());
undo_redo->add_undo_method(tileset.ptr(), "tile_set_navigation_polygon", get_current_tile(), tileset->tile_get_navigation_polygon(get_current_tile()));
} else {
undo_redo->add_do_method(tileset.ptr(), "autotile_set_navigation_polygon", get_current_tile(), Ref<NavigationPolygon>(), edited_shape_coord);
undo_redo->add_undo_method(tileset.ptr(), "autotile_set_navigation_polygon", get_current_tile(), tileset->autotile_get_navigation_polygon(get_current_tile(), edited_shape_coord), edited_shape_coord);
}
undo_redo->add_do_method(this, "_select_edited_shape_coord");
undo_redo->add_undo_method(this, "_select_edited_shape_coord");
undo_redo->commit_action();
}
} break;
default: {
}
}
}
} else if (p_tool == TOOL_SELECT || p_tool == SHAPE_NEW_POLYGON || p_tool == SHAPE_NEW_RECTANGLE) {
if (creating_shape) {
// Cancel Creation
creating_shape = false;
current_shape.resize(0);
workspace->update();
}
}
}
void TileSetEditor::_on_priority_changed(float val) {
if ((int)val == tileset->autotile_get_subtile_priority(get_current_tile(), edited_shape_coord))
return;
undo_redo->create_action(TTR("Edit Tile Priority"));
undo_redo->add_do_method(tileset.ptr(), "autotile_set_subtile_priority", get_current_tile(), edited_shape_coord, (int)val);
undo_redo->add_undo_method(tileset.ptr(), "autotile_set_subtile_priority", get_current_tile(), edited_shape_coord, tileset->autotile_get_subtile_priority(get_current_tile(), edited_shape_coord));
undo_redo->add_do_method(workspace, "update");
undo_redo->add_undo_method(workspace, "update");
undo_redo->commit_action();
}
void TileSetEditor::_on_z_index_changed(float val) {
if ((int)val == tileset->autotile_get_z_index(get_current_tile(), edited_shape_coord))
return;
undo_redo->create_action(TTR("Edit Tile Z Index"));
undo_redo->add_do_method(tileset.ptr(), "autotile_set_z_index", get_current_tile(), edited_shape_coord, (int)val);
undo_redo->add_undo_method(tileset.ptr(), "autotile_set_z_index", get_current_tile(), edited_shape_coord, tileset->autotile_get_z_index(get_current_tile(), edited_shape_coord));
undo_redo->add_do_method(workspace, "update");
undo_redo->add_undo_method(workspace, "update");
undo_redo->commit_action();
}
void TileSetEditor::_on_grid_snap_toggled(bool p_val) {
helper->set_snap_options_visible(p_val);
workspace->update();
}
Vector<Vector2> TileSetEditor::_get_collision_shape_points(const Ref<Shape2D> &p_shape) {
Ref<ConvexPolygonShape2D> convex = p_shape;
Ref<ConcavePolygonShape2D> concave = p_shape;
if (convex.is_valid()) {
return convex->get_points();
} else if (concave.is_valid()) {
Vector<Vector2> points;
for (int i = 0; i < concave->get_segments().size(); i += 2) {
points.push_back(concave->get_segments()[i]);
}
return points;
} else {
return Vector<Vector2>();
}
}
Vector<Vector2> TileSetEditor::_get_edited_shape_points() {
return _get_collision_shape_points(edited_collision_shape);
}
void TileSetEditor::_set_edited_shape_points(const Vector<Vector2> &points) {
Ref<ConvexPolygonShape2D> convex = edited_collision_shape;
Ref<ConcavePolygonShape2D> concave = edited_collision_shape;
if (convex.is_valid()) {
undo_redo->add_do_method(convex.ptr(), "set_points", points);
undo_redo->add_undo_method(convex.ptr(), "set_points", _get_edited_shape_points());
} else if (concave.is_valid() && points.size() > 1) {
PoolVector2Array segments;
for (int i = 0; i < points.size() - 1; i++) {
segments.push_back(points[i]);
segments.push_back(points[i + 1]);
}
segments.push_back(points[points.size() - 1]);
segments.push_back(points[0]);
undo_redo->add_do_method(concave.ptr(), "set_segments", segments);
undo_redo->add_undo_method(concave.ptr(), "set_segments", concave->get_segments());
}
}
void TileSetEditor::_update_tile_data() {
current_tile_data.clear();
if (get_current_tile() < 0)
return;
Vector<TileSet::ShapeData> sd = tileset->tile_get_shapes(get_current_tile());
if (tileset->tile_get_tile_mode(get_current_tile()) == TileSet::SINGLE_TILE) {
SubtileData data;
for (int i = 0; i < sd.size(); i++) {
data.collisions.push_back(sd[i].shape);
}
data.navigation_shape = tileset->tile_get_navigation_polygon(get_current_tile());
data.occlusion_shape = tileset->tile_get_light_occluder(get_current_tile());
current_tile_data[Vector2i()] = data;
} else {
int spacing = tileset->autotile_get_spacing(get_current_tile());
Vector2 size = tileset->tile_get_region(get_current_tile()).size;
Vector2 cell_count = (size / (tileset->autotile_get_size(get_current_tile()) + Vector2(spacing, spacing))).floor();
for (int y = 0; y < cell_count.y; y++) {
for (int x = 0; x < cell_count.x; x++) {
SubtileData data;
Vector2i coord(x, y);
for (int i = 0; i < sd.size(); i++) {
if (sd[i].autotile_coord == coord) {
data.collisions.push_back(sd[i].shape);
}
}
data.navigation_shape = tileset->autotile_get_navigation_polygon(get_current_tile(), coord);
data.occlusion_shape = tileset->tile_get_light_occluder(get_current_tile());
current_tile_data[coord] = data;
}
}
}
}
void TileSetEditor::_update_toggle_shape_button() {
Ref<ConvexPolygonShape2D> convex = edited_collision_shape;
Ref<ConcavePolygonShape2D> concave = edited_collision_shape;
separator_shape_toggle->show();
tools[SHAPE_TOGGLE_TYPE]->show();
if (edit_mode != EDITMODE_COLLISION || !edited_collision_shape.is_valid()) {
separator_shape_toggle->hide();
tools[SHAPE_TOGGLE_TYPE]->hide();
} else if (concave.is_valid()) {
tools[SHAPE_TOGGLE_TYPE]->set_icon(get_icon("ConvexPolygonShape2D", "EditorIcons"));
tools[SHAPE_TOGGLE_TYPE]->set_text(TTR("Make Convex"));
} else if (convex.is_valid()) {
tools[SHAPE_TOGGLE_TYPE]->set_icon(get_icon("ConcavePolygonShape2D", "EditorIcons"));
tools[SHAPE_TOGGLE_TYPE]->set_text(TTR("Make Concave"));
} else {
// Shouldn't happen
separator_shape_toggle->hide();
tools[SHAPE_TOGGLE_TYPE]->hide();
}
}
void TileSetEditor::_select_next_tile() {
Array tiles = _get_tiles_in_current_texture(true);
if (tiles.size() == 0) {
set_current_tile(-1);
} else if (get_current_tile() == -1) {
set_current_tile(tiles[0]);
} else {
int index = tiles.find(get_current_tile());
if (index < 0) {
set_current_tile(tiles[0]);
} else if (index == tiles.size() - 1) {
set_current_tile(tiles[0]);
} else {
set_current_tile(tiles[index + 1]);
}
}
if (get_current_tile() == -1) {
return;
} else if (tileset->tile_get_tile_mode(get_current_tile()) == TileSet::SINGLE_TILE) {
return;
} else {
switch (edit_mode) {
case EDITMODE_COLLISION:
case EDITMODE_OCCLUSION:
case EDITMODE_NAVIGATION:
case EDITMODE_PRIORITY:
case EDITMODE_Z_INDEX: {
edited_shape_coord = Vector2();
_select_edited_shape_coord();
} break;
default: {
}
}
}
}
void TileSetEditor::_select_previous_tile() {
Array tiles = _get_tiles_in_current_texture(true);
if (tiles.size() == 0) {
set_current_tile(-1);
} else if (get_current_tile() == -1) {
set_current_tile(tiles[tiles.size() - 1]);
} else {
int index = tiles.find(get_current_tile());
if (index <= 0) {
set_current_tile(tiles[tiles.size() - 1]);
} else {
set_current_tile(tiles[index - 1]);
}
}
if (get_current_tile() == -1) {
return;
} else if (tileset->tile_get_tile_mode(get_current_tile()) == TileSet::SINGLE_TILE) {
return;
} else {
switch (edit_mode) {
case EDITMODE_COLLISION:
case EDITMODE_OCCLUSION:
case EDITMODE_NAVIGATION:
case EDITMODE_PRIORITY:
case EDITMODE_Z_INDEX: {
int spacing = tileset->autotile_get_spacing(get_current_tile());
Vector2 size = tileset->tile_get_region(get_current_tile()).size;
Vector2 cell_count = (size / (tileset->autotile_get_size(get_current_tile()) + Vector2(spacing, spacing))).floor();
edited_shape_coord = cell_count;
_select_edited_shape_coord();
} break;
default: {
}
}
}
}
Array TileSetEditor::_get_tiles_in_current_texture(bool sorted) {
Array a;
List<int> all_tiles;
if (!get_current_texture().is_valid()) {
return a;
}
tileset->get_tile_list(&all_tiles);
for (int i = 0; i < all_tiles.size(); i++) {
if (tileset->tile_get_texture(all_tiles[i]) == get_current_texture()) {
a.push_back(all_tiles[i]);
}
}
if (sorted) {
a.sort_custom(this, "_sort_tiles");
}
return a;
}
bool TileSetEditor::_sort_tiles(Variant p_a, Variant p_b) {
int a = p_a;
int b = p_b;
Vector2 pos_a = tileset->tile_get_region(a).position;
Vector2 pos_b = tileset->tile_get_region(b).position;
if (pos_a.y < pos_b.y) {
return true;
} else if (pos_a.y == pos_b.y) {
return (pos_a.x < pos_b.x);
} else {
return false;
}
}
void TileSetEditor::_select_next_subtile() {
if (get_current_tile() == -1) {
_select_next_tile();
return;
}
if (tileset->tile_get_tile_mode(get_current_tile()) == TileSet::SINGLE_TILE) {
_select_next_tile();
} else if (edit_mode == EDITMODE_REGION || edit_mode == EDITMODE_BITMASK || edit_mode == EDITMODE_ICON) {
_select_next_tile();
} else {
int spacing = tileset->autotile_get_spacing(get_current_tile());
Vector2 size = tileset->tile_get_region(get_current_tile()).size;
Vector2 cell_count = (size / (tileset->autotile_get_size(get_current_tile()) + Vector2(spacing, spacing))).floor();
if (edited_shape_coord.x > cell_count.x - 1 && edited_shape_coord.y > cell_count.y - 1) {
_select_next_tile();
} else {
edited_shape_coord.x++;
if (edited_shape_coord.x > cell_count.x) {
edited_shape_coord.x = 0;
edited_shape_coord.y++;
}
_select_edited_shape_coord();
}
}
}
void TileSetEditor::_select_previous_subtile() {
if (get_current_tile() == -1) {
_select_previous_tile();
return;
}
if (tileset->tile_get_tile_mode(get_current_tile()) == TileSet::SINGLE_TILE) {
_select_previous_tile();
} else if (edit_mode == EDITMODE_REGION || edit_mode == EDITMODE_BITMASK || edit_mode == EDITMODE_ICON) {
_select_previous_tile();
} else {
int spacing = tileset->autotile_get_spacing(get_current_tile());
Vector2 size = tileset->tile_get_region(get_current_tile()).size;
Vector2 cell_count = (size / (tileset->autotile_get_size(get_current_tile()) + Vector2(spacing, spacing))).floor();
if (edited_shape_coord.x <= 0 && edited_shape_coord.y <= 0) {
_select_previous_tile();
} else {
edited_shape_coord.x--;
if (edited_shape_coord.x == -1) {
edited_shape_coord.x = cell_count.x;
edited_shape_coord.y--;
}
_select_edited_shape_coord();
}
}
}
void TileSetEditor::_select_next_shape() {
if (get_current_tile() == -1) {
_select_next_subtile();
} else if (edit_mode != EDITMODE_COLLISION) {
_select_next_subtile();
} else {
Vector2i edited_coord = Vector2i();
if (tileset->tile_get_tile_mode(get_current_tile()) != TileSet::SINGLE_TILE) {
edited_coord = Vector2i(edited_shape_coord);
}
SubtileData data = current_tile_data[edited_coord];
if (data.collisions.size() == 0) {
_select_next_subtile();
} else {
int index = data.collisions.find(edited_collision_shape);
if (index < 0) {
_set_edited_collision_shape(data.collisions[0]);
} else if (index == data.collisions.size() - 1) {
_select_next_subtile();
} else {
_set_edited_collision_shape(data.collisions[index + 1]);
}
}
current_shape.resize(0);
Rect2 current_tile_region = tileset->tile_get_region(get_current_tile());
current_tile_region.position += WORKSPACE_MARGIN;
int spacing = tileset->autotile_get_spacing(get_current_tile());
Vector2 size = tileset->autotile_get_size(get_current_tile());
Vector2 shape_anchor = edited_shape_coord;
shape_anchor.x *= (size.x + spacing);
shape_anchor.y *= (size.y + spacing);
current_tile_region.position += shape_anchor;
if (edited_collision_shape.is_valid()) {
for (int i = 0; i < _get_edited_shape_points().size(); i++) {
current_shape.push_back(_get_edited_shape_points()[i] + current_tile_region.position);
}
}
workspace->update();
workspace_container->update();
helper->_change_notify("");
}
}
void TileSetEditor::_select_previous_shape() {
if (get_current_tile() == -1) {
_select_previous_subtile();
if (get_current_tile() != -1 && edit_mode == EDITMODE_COLLISION) {
SubtileData data = current_tile_data[Vector2i(edited_shape_coord)];
if (data.collisions.size() > 1) {
_set_edited_collision_shape(data.collisions[data.collisions.size() - 1]);
}
} else {
return;
}
} else if (edit_mode != EDITMODE_COLLISION) {
_select_previous_subtile();
} else {
Vector2i edited_coord = Vector2i();
if (tileset->tile_get_tile_mode(get_current_tile()) != TileSet::SINGLE_TILE) {
edited_coord = Vector2i(edited_shape_coord);
}
SubtileData data = current_tile_data[edited_coord];
if (data.collisions.size() == 0) {
_select_previous_subtile();
data = current_tile_data[Vector2i(edited_shape_coord)];
if (data.collisions.size() > 1) {
_set_edited_collision_shape(data.collisions[data.collisions.size() - 1]);
}
} else {
int index = data.collisions.find(edited_collision_shape);
if (index < 0) {
_set_edited_collision_shape(data.collisions[data.collisions.size() - 1]);
} else if (index == 0) {
_select_previous_subtile();
data = current_tile_data[Vector2i(edited_shape_coord)];
if (data.collisions.size() > 1) {
_set_edited_collision_shape(data.collisions[data.collisions.size() - 1]);
}
} else {
_set_edited_collision_shape(data.collisions[index - 1]);
}
}
current_shape.resize(0);
Rect2 current_tile_region = tileset->tile_get_region(get_current_tile());
current_tile_region.position += WORKSPACE_MARGIN;
int spacing = tileset->autotile_get_spacing(get_current_tile());
Vector2 size = tileset->autotile_get_size(get_current_tile());
Vector2 shape_anchor = edited_shape_coord;
shape_anchor.x *= (size.x + spacing);
shape_anchor.y *= (size.y + spacing);
current_tile_region.position += shape_anchor;
if (edited_collision_shape.is_valid()) {
for (int i = 0; i < _get_edited_shape_points().size(); i++) {
current_shape.push_back(_get_edited_shape_points()[i] + current_tile_region.position);
}
}
workspace->update();
workspace_container->update();
helper->_change_notify("");
}
}
void TileSetEditor::_set_edited_collision_shape(const Ref<Shape2D> &p_shape) {
edited_collision_shape = p_shape;
_update_toggle_shape_button();
}
void TileSetEditor::_set_snap_step(Vector2 p_val) {
snap_step.x = CLAMP(p_val.x, 1, 1024);
snap_step.y = CLAMP(p_val.y, 1, 1024);
workspace->update();
}
void TileSetEditor::_set_snap_off(Vector2 p_val) {
snap_offset.x = CLAMP(p_val.x, 0, 1024 + WORKSPACE_MARGIN.x);
snap_offset.y = CLAMP(p_val.y, 0, 1024 + WORKSPACE_MARGIN.y);
workspace->update();
}
void TileSetEditor::_set_snap_sep(Vector2 p_val) {
snap_separation.x = CLAMP(p_val.x, 0, 1024);
snap_separation.y = CLAMP(p_val.y, 0, 1024);
workspace->update();
}
void TileSetEditor::_validate_current_tile_id() {
if (get_current_tile() >= 0 && !tileset->has_tile(get_current_tile()))
set_current_tile(-1);
}
void TileSetEditor::_select_edited_shape_coord() {
select_coord(edited_shape_coord);
}
void TileSetEditor::_undo_tile_removal(int p_id) {
undo_redo->add_undo_method(tileset.ptr(), "create_tile", p_id);
undo_redo->add_undo_method(tileset.ptr(), "tile_set_name", p_id, tileset->tile_get_name(p_id));
undo_redo->add_undo_method(tileset.ptr(), "tile_set_normal_map", p_id, tileset->tile_get_normal_map(p_id));
undo_redo->add_undo_method(tileset.ptr(), "tile_set_texture_offset", p_id, tileset->tile_get_texture_offset(p_id));
undo_redo->add_undo_method(tileset.ptr(), "tile_set_material", p_id, tileset->tile_get_material(p_id));
undo_redo->add_undo_method(tileset.ptr(), "tile_set_modulate", p_id, tileset->tile_get_modulate(p_id));
undo_redo->add_undo_method(tileset.ptr(), "tile_set_occluder_offset", p_id, tileset->tile_get_occluder_offset(p_id));
undo_redo->add_undo_method(tileset.ptr(), "tile_set_navigation_polygon_offset", p_id, tileset->tile_get_navigation_polygon_offset(p_id));
undo_redo->add_undo_method(tileset.ptr(), "tile_set_shape_offset", p_id, 0, tileset->tile_get_shape_offset(p_id, 0));
undo_redo->add_undo_method(tileset.ptr(), "tile_set_shape_transform", p_id, 0, tileset->tile_get_shape_transform(p_id, 0));
undo_redo->add_undo_method(tileset.ptr(), "tile_set_z_index", p_id, tileset->tile_get_z_index(p_id));
undo_redo->add_undo_method(tileset.ptr(), "tile_set_texture", p_id, tileset->tile_get_texture(p_id));
undo_redo->add_undo_method(tileset.ptr(), "tile_set_region", p_id, tileset->tile_get_region(p_id));
// Necessary to get the version that returns a Array instead of a Vector.
undo_redo->add_undo_method(tileset.ptr(), "tile_set_shapes", p_id, tileset->call("tile_get_shapes", p_id));
if (tileset->tile_get_tile_mode(p_id) == TileSet::SINGLE_TILE) {
undo_redo->add_undo_method(tileset.ptr(), "tile_set_light_occluder", p_id, tileset->tile_get_light_occluder(p_id));
undo_redo->add_undo_method(tileset.ptr(), "tile_set_navigation_polygon", p_id, tileset->tile_get_navigation_polygon(p_id));
} else {
Map<Vector2, Ref<OccluderPolygon2D> > oclusion_map = tileset->autotile_get_light_oclusion_map(p_id);
for (Map<Vector2, Ref<OccluderPolygon2D> >::Element *E = oclusion_map.front(); E; E = E->next()) {
undo_redo->add_undo_method(tileset.ptr(), "autotile_set_light_occluder", p_id, E->value(), E->key());
}
Map<Vector2, Ref<NavigationPolygon> > navigation_map = tileset->autotile_get_navigation_map(p_id);
for (Map<Vector2, Ref<NavigationPolygon> >::Element *E = navigation_map.front(); E; E = E->next()) {
undo_redo->add_undo_method(tileset.ptr(), "autotile_set_navigation_polygon", p_id, E->value(), E->key());
}
Map<Vector2, uint32_t> bitmask_map = tileset->autotile_get_bitmask_map(p_id);
for (Map<Vector2, uint32_t>::Element *E = bitmask_map.front(); E; E = E->next()) {
undo_redo->add_undo_method(tileset.ptr(), "autotile_set_bitmask", p_id, E->key(), E->value());
}
Map<Vector2, int> priority_map = tileset->autotile_get_priority_map(p_id);
for (Map<Vector2, int>::Element *E = priority_map.front(); E; E = E->next()) {
undo_redo->add_undo_method(tileset.ptr(), "autotile_set_subtile_priority", p_id, E->key(), E->value());
}
undo_redo->add_undo_method(tileset.ptr(), "autotile_set_icon_coordinate", p_id, tileset->autotile_get_icon_coordinate(p_id));
Map<Vector2, int> z_map = tileset->autotile_get_z_index_map(p_id);
for (Map<Vector2, int>::Element *E = z_map.front(); E; E = E->next()) {
undo_redo->add_undo_method(tileset.ptr(), "autotile_set_z_index", p_id, E->key(), E->value());
}
undo_redo->add_undo_method(tileset.ptr(), "tile_set_tile_mode", p_id, tileset->tile_get_tile_mode(p_id));
undo_redo->add_undo_method(tileset.ptr(), "autotile_set_size", p_id, tileset->autotile_get_size(p_id));
undo_redo->add_undo_method(tileset.ptr(), "autotile_set_spacing", p_id, tileset->autotile_get_spacing(p_id));
undo_redo->add_undo_method(tileset.ptr(), "autotile_set_bitmask_mode", p_id, tileset->autotile_get_bitmask_mode(p_id));
}
}
void TileSetEditor::_zoom_in() {
float scale = workspace->get_scale().x;
if (scale < max_scale) {
scale *= scale_ratio;
workspace->set_scale(Vector2(scale, scale));
workspace_container->set_custom_minimum_size(workspace->get_rect().size * scale);
workspace_overlay->set_custom_minimum_size(workspace->get_rect().size * scale);
}
}
void TileSetEditor::_zoom_out() {
float scale = workspace->get_scale().x;
if (scale > min_scale) {
scale /= scale_ratio;
workspace->set_scale(Vector2(scale, scale));
workspace_container->set_custom_minimum_size(workspace->get_rect().size * scale);
workspace_overlay->set_custom_minimum_size(workspace->get_rect().size * scale);
}
}
void TileSetEditor::_zoom_reset() {
workspace->set_scale(Vector2(1, 1));
workspace_container->set_custom_minimum_size(workspace->get_rect().size);
workspace_overlay->set_custom_minimum_size(workspace->get_rect().size);
}
void TileSetEditor::draw_highlight_current_tile() {
Color shadow_color = Color(0.3, 0.3, 0.3, 0.3);
if ((workspace_mode == WORKSPACE_EDIT && get_current_tile() >= 0) || !edited_region.has_no_area()) {
Rect2 region;
if (edited_region.has_no_area()) {
region = tileset->tile_get_region(get_current_tile());
region.position += WORKSPACE_MARGIN;
} else {
region = edited_region;
}
if (region.position.y >= 0)
workspace->draw_rect(Rect2(0, 0, workspace->get_rect().size.x, region.position.y), shadow_color);
if (region.position.x >= 0)
workspace->draw_rect(Rect2(0, MAX(0, region.position.y), region.position.x, MIN(workspace->get_rect().size.y - region.position.y, MIN(region.size.y, region.position.y + region.size.y))), shadow_color);
if (region.position.x + region.size.x <= workspace->get_rect().size.x)
workspace->draw_rect(Rect2(region.position.x + region.size.x, MAX(0, region.position.y), workspace->get_rect().size.x - region.position.x - region.size.x, MIN(workspace->get_rect().size.y - region.position.y, MIN(region.size.y, region.position.y + region.size.y))), shadow_color);
if (region.position.y + region.size.y <= workspace->get_rect().size.y)
workspace->draw_rect(Rect2(0, region.position.y + region.size.y, workspace->get_rect().size.x, workspace->get_rect().size.y - region.size.y - region.position.y), shadow_color);
} else {
workspace->draw_rect(Rect2(Point2(0, 0), workspace->get_rect().size), shadow_color);
}
}
void TileSetEditor::draw_highlight_subtile(Vector2 coord, const Vector<Vector2> &other_highlighted) {
Color shadow_color = Color(0.3, 0.3, 0.3, 0.3);
Vector2 size = tileset->autotile_get_size(get_current_tile());
int spacing = tileset->autotile_get_spacing(get_current_tile());
Rect2 region = tileset->tile_get_region(get_current_tile());
coord.x *= (size.x + spacing);
coord.y *= (size.y + spacing);
coord += region.position;
coord += WORKSPACE_MARGIN;
if (coord.y >= 0)
workspace->draw_rect(Rect2(0, 0, workspace->get_rect().size.x, coord.y), shadow_color);
if (coord.x >= 0)
workspace->draw_rect(Rect2(0, MAX(0, coord.y), coord.x, MIN(workspace->get_rect().size.y - coord.y, MIN(size.y, coord.y + size.y))), shadow_color);
if (coord.x + size.x <= workspace->get_rect().size.x)
workspace->draw_rect(Rect2(coord.x + size.x, MAX(0, coord.y), workspace->get_rect().size.x - coord.x - size.x, MIN(workspace->get_rect().size.y - coord.y, MIN(size.y, coord.y + size.y))), shadow_color);
if (coord.y + size.y <= workspace->get_rect().size.y)
workspace->draw_rect(Rect2(0, coord.y + size.y, workspace->get_rect().size.x, workspace->get_rect().size.y - size.y - coord.y), shadow_color);
coord += Vector2(1, 1) / workspace->get_scale().x;
workspace->draw_rect(Rect2(coord, size - Vector2(2, 2) / workspace->get_scale().x), Color(1, 0, 0), false);
for (int i = 0; i < other_highlighted.size(); i++) {
coord = other_highlighted[i];
coord.x *= (size.x + spacing);
coord.y *= (size.y + spacing);
coord += region.position;
coord += WORKSPACE_MARGIN;
coord += Vector2(1, 1) / workspace->get_scale().x;
workspace->draw_rect(Rect2(coord, size - Vector2(2, 2) / workspace->get_scale().x), Color(1, 0.5, 0.5), false);
}
}
void TileSetEditor::draw_tile_subdivision(int p_id, Color p_color) const {
Color c = p_color;
if (tileset->tile_get_tile_mode(p_id) == TileSet::AUTO_TILE || tileset->tile_get_tile_mode(p_id) == TileSet::ATLAS_TILE) {
Rect2 region = tileset->tile_get_region(p_id);
Size2 size = tileset->autotile_get_size(p_id);
int spacing = tileset->autotile_get_spacing(p_id);
float j = size.x;
while (j < region.size.x) {
if (spacing <= 0) {
workspace->draw_line(region.position + WORKSPACE_MARGIN + Point2(j, 0), region.position + WORKSPACE_MARGIN + Point2(j, region.size.y), c);
} else {
workspace->draw_rect(Rect2(region.position + WORKSPACE_MARGIN + Point2(j, 0), Size2(spacing, region.size.y)), c);
}
j += spacing + size.x;
}
j = size.y;
while (j < region.size.y) {
if (spacing <= 0) {
workspace->draw_line(region.position + WORKSPACE_MARGIN + Point2(0, j), region.position + WORKSPACE_MARGIN + Point2(region.size.x, j), c);
} else {
workspace->draw_rect(Rect2(region.position + WORKSPACE_MARGIN + Point2(0, j), Size2(region.size.x, spacing)), c);
}
j += spacing + size.y;
}
}
}
void TileSetEditor::draw_edited_region_subdivision() const {
Color c = Color(0.3, 0.7, 0.6);
Rect2 region = edited_region;
Size2 size;
int spacing;
bool draw;
if (workspace_mode == WORKSPACE_EDIT) {
int p_id = get_current_tile();
size = tileset->autotile_get_size(p_id);
spacing = tileset->autotile_get_spacing(p_id);
draw = tileset->tile_get_tile_mode(p_id) == TileSet::AUTO_TILE || tileset->tile_get_tile_mode(p_id) == TileSet::ATLAS_TILE;
} else {
size = snap_step;
spacing = snap_separation.x;
draw = workspace_mode != WORKSPACE_CREATE_SINGLE;
}
if (draw) {
float j = size.x;
while (j < region.size.x) {
if (spacing <= 0) {
workspace->draw_line(region.position + Point2(j, 0), region.position + Point2(j, region.size.y), c);
} else {
workspace->draw_rect(Rect2(region.position + Point2(j, 0), Size2(spacing, region.size.y)), c);
}
j += spacing + size.x;
}
j = size.y;
while (j < region.size.y) {
if (spacing <= 0) {
workspace->draw_line(region.position + Point2(0, j), region.position + Point2(region.size.x, j), c);
} else {
workspace->draw_rect(Rect2(region.position + Point2(0, j), Size2(region.size.x, spacing)), c);
}
j += spacing + size.y;
}
}
}
void TileSetEditor::draw_grid_snap() {
if (tools[TOOL_GRID_SNAP]->is_pressed()) {
Color grid_color = Color(0.4, 0, 1);
Size2 s = workspace->get_size();
int width_count = Math::floor((s.width - WORKSPACE_MARGIN.x) / (snap_step.x + snap_separation.x));
int height_count = Math::floor((s.height - WORKSPACE_MARGIN.y) / (snap_step.y + snap_separation.y));
int last_p = 0;
if (snap_step.x != 0) {
for (int i = 0; i <= width_count; i++) {
if (i == 0 && snap_offset.x != 0) {
last_p = snap_offset.x;
}
if (snap_separation.x != 0) {
if (i != 0) {
workspace->draw_rect(Rect2(last_p, 0, snap_separation.x, s.height), grid_color);
last_p += snap_separation.x;
} else {
workspace->draw_rect(Rect2(last_p, 0, -snap_separation.x, s.height), grid_color);
}
} else {
workspace->draw_line(Point2(last_p, 0), Point2(last_p, s.height), grid_color);
}
last_p += snap_step.x;
}
}
last_p = 0;
if (snap_step.y != 0) {
for (int i = 0; i <= height_count; i++) {
if (i == 0 && snap_offset.y != 0) {
last_p = snap_offset.y;
}
if (snap_separation.y != 0) {
if (i != 0) {
workspace->draw_rect(Rect2(0, last_p, s.width, snap_separation.y), grid_color);
last_p += snap_separation.y;
} else {
workspace->draw_rect(Rect2(0, last_p, s.width, -snap_separation.y), grid_color);
}
} else {
workspace->draw_line(Point2(0, last_p), Point2(s.width, last_p), grid_color);
}
last_p += snap_step.y;
}
}
}
}
void TileSetEditor::draw_polygon_shapes() {
int t_id = get_current_tile();
if (t_id < 0)
return;
switch (edit_mode) {
case EDITMODE_COLLISION: {
Vector<TileSet::ShapeData> sd = tileset->tile_get_shapes(t_id);
for (int i = 0; i < sd.size(); i++) {
Vector2 coord = Vector2(0, 0);
Vector2 anchor = Vector2(0, 0);
if (tileset->tile_get_tile_mode(get_current_tile()) == TileSet::AUTO_TILE || tileset->tile_get_tile_mode(get_current_tile()) == TileSet::ATLAS_TILE) {
coord = sd[i].autotile_coord;
anchor = tileset->autotile_get_size(t_id);
anchor.x += tileset->autotile_get_spacing(t_id);
anchor.y += tileset->autotile_get_spacing(t_id);
anchor.x *= coord.x;
anchor.y *= coord.y;
}
anchor += WORKSPACE_MARGIN;
anchor += tileset->tile_get_region(t_id).position;
Ref<Shape2D> shape = sd[i].shape;
if (shape.is_valid()) {
Color c_bg;
Color c_border;
Ref<ConvexPolygonShape2D> convex = shape;
bool is_convex = convex.is_valid();
if ((tileset->tile_get_tile_mode(get_current_tile()) == TileSet::SINGLE_TILE || coord == edited_shape_coord) && sd[i].shape == edited_collision_shape) {
if (is_convex) {
c_bg = Color(0, 1, 1, 0.5);
c_border = Color(0, 1, 1);
} else {
c_bg = Color(0.8, 0, 1, 0.5);
c_border = Color(0.8, 0, 1);
}
} else {
if (is_convex) {
c_bg = Color(0.9, 0.7, 0.07, 0.5);
c_border = Color(0.9, 0.7, 0.07, 1);
} else {
c_bg = Color(0.9, 0.45, 0.075, 0.5);
c_border = Color(0.9, 0.45, 0.075);
}
}
Vector<Vector2> polygon;
Vector<Color> colors;
if (!creating_shape && shape == edited_collision_shape && current_shape.size() > 2) {
for (int j = 0; j < current_shape.size(); j++) {
polygon.push_back(current_shape[j]);
colors.push_back(c_bg);
}
} else {
for (int j = 0; j < _get_collision_shape_points(shape).size(); j++) {
polygon.push_back(_get_collision_shape_points(shape)[j] + anchor);
colors.push_back(c_bg);
}
}
if (polygon.size() < 3)
continue;
workspace->draw_polygon(polygon, colors);
if (coord == edited_shape_coord || tileset->tile_get_tile_mode(get_current_tile()) == TileSet::SINGLE_TILE) {
if (!creating_shape && polygon.size() > 1) {
for (int j = 0; j < polygon.size() - 1; j++) {
workspace->draw_line(polygon[j], polygon[j + 1], c_border, 1, true);
}
workspace->draw_line(polygon[polygon.size() - 1], polygon[0], c_border, 1, true);
}
if (shape == edited_collision_shape) {
draw_handles = true;
}
}
}
}
} break;
case EDITMODE_OCCLUSION: {
if (tileset->tile_get_tile_mode(get_current_tile()) == TileSet::SINGLE_TILE) {
Ref<OccluderPolygon2D> shape = edited_occlusion_shape;
if (shape.is_valid()) {
Color c_bg = Color(0, 1, 1, 0.5);
Color c_border = Color(0, 1, 1);
Vector<Vector2> polygon;
Vector<Color> colors;
Vector2 anchor = WORKSPACE_MARGIN;
anchor += tileset->tile_get_region(get_current_tile()).position;
if (!creating_shape && shape == edited_occlusion_shape && current_shape.size() > 2) {
for (int j = 0; j < current_shape.size(); j++) {
polygon.push_back(current_shape[j]);
colors.push_back(c_bg);
}
} else {
for (int j = 0; j < shape->get_polygon().size(); j++) {
polygon.push_back(shape->get_polygon()[j] + anchor);
colors.push_back(c_bg);
}
}
workspace->draw_polygon(polygon, colors);
if (!creating_shape && polygon.size() > 1) {
for (int j = 0; j < polygon.size() - 1; j++) {
workspace->draw_line(polygon[j], polygon[j + 1], c_border, 1, true);
}
workspace->draw_line(polygon[polygon.size() - 1], polygon[0], c_border, 1, true);
}
if (shape == edited_occlusion_shape) {
draw_handles = true;
}
}
} else {
Map<Vector2, Ref<OccluderPolygon2D> > map = tileset->autotile_get_light_oclusion_map(t_id);
for (Map<Vector2, Ref<OccluderPolygon2D> >::Element *E = map.front(); E; E = E->next()) {
Vector2 coord = E->key();
Vector2 anchor = tileset->autotile_get_size(t_id);
anchor.x += tileset->autotile_get_spacing(t_id);
anchor.y += tileset->autotile_get_spacing(t_id);
anchor.x *= coord.x;
anchor.y *= coord.y;
anchor += WORKSPACE_MARGIN;
anchor += tileset->tile_get_region(t_id).position;
Ref<OccluderPolygon2D> shape = E->value();
if (shape.is_valid()) {
Color c_bg;
Color c_border;
if (coord == edited_shape_coord && shape == edited_occlusion_shape) {
c_bg = Color(0, 1, 1, 0.5);
c_border = Color(0, 1, 1);
} else {
c_bg = Color(0.9, 0.7, 0.07, 0.5);
c_border = Color(0.9, 0.7, 0.07, 1);
}
Vector<Vector2> polygon;
Vector<Color> colors;
if (!creating_shape && shape == edited_occlusion_shape && current_shape.size() > 2) {
for (int j = 0; j < current_shape.size(); j++) {
polygon.push_back(current_shape[j]);
colors.push_back(c_bg);
}
} else {
for (int j = 0; j < shape->get_polygon().size(); j++) {
polygon.push_back(shape->get_polygon()[j] + anchor);
colors.push_back(c_bg);
}
}
workspace->draw_polygon(polygon, colors);
if (coord == edited_shape_coord) {
if (!creating_shape && polygon.size() > 1) {
for (int j = 0; j < polygon.size() - 1; j++) {
workspace->draw_line(polygon[j], polygon[j + 1], c_border, 1, true);
}
workspace->draw_line(polygon[polygon.size() - 1], polygon[0], c_border, 1, true);
}
if (shape == edited_occlusion_shape) {
draw_handles = true;
}
}
}
}
}
} break;
case EDITMODE_NAVIGATION: {
if (tileset->tile_get_tile_mode(get_current_tile()) == TileSet::SINGLE_TILE) {
Ref<NavigationPolygon> shape = edited_navigation_shape;
if (shape.is_valid()) {
Color c_bg = Color(0, 1, 1, 0.5);
Color c_border = Color(0, 1, 1);
Vector<Vector2> polygon;
Vector<Color> colors;
Vector2 anchor = WORKSPACE_MARGIN;
anchor += tileset->tile_get_region(get_current_tile()).position;
if (!creating_shape && shape == edited_navigation_shape && current_shape.size() > 2) {
for (int j = 0; j < current_shape.size(); j++) {
polygon.push_back(current_shape[j]);
colors.push_back(c_bg);
}
} else {
PoolVector<Vector2> vertices = shape->get_vertices();
for (int j = 0; j < shape->get_polygon(0).size(); j++) {
polygon.push_back(vertices[shape->get_polygon(0)[j]] + anchor);
colors.push_back(c_bg);
}
}
workspace->draw_polygon(polygon, colors);
if (!creating_shape && polygon.size() > 1) {
for (int j = 0; j < polygon.size() - 1; j++) {
workspace->draw_line(polygon[j], polygon[j + 1], c_border, 1, true);
}
workspace->draw_line(polygon[polygon.size() - 1], polygon[0], c_border, 1, true);
}
if (shape == edited_navigation_shape) {
draw_handles = true;
}
}
} else {
Map<Vector2, Ref<NavigationPolygon> > map = tileset->autotile_get_navigation_map(t_id);
for (Map<Vector2, Ref<NavigationPolygon> >::Element *E = map.front(); E; E = E->next()) {
Vector2 coord = E->key();
Vector2 anchor = tileset->autotile_get_size(t_id);
anchor.x += tileset->autotile_get_spacing(t_id);
anchor.y += tileset->autotile_get_spacing(t_id);
anchor.x *= coord.x;
anchor.y *= coord.y;
anchor += WORKSPACE_MARGIN;
anchor += tileset->tile_get_region(t_id).position;
Ref<NavigationPolygon> shape = E->value();
if (shape.is_valid()) {
Color c_bg;
Color c_border;
if (coord == edited_shape_coord && shape == edited_navigation_shape) {
c_bg = Color(0, 1, 1, 0.5);
c_border = Color(0, 1, 1);
} else {
c_bg = Color(0.9, 0.7, 0.07, 0.5);
c_border = Color(0.9, 0.7, 0.07, 1);
}
Vector<Vector2> polygon;
Vector<Color> colors;
if (!creating_shape && shape == edited_navigation_shape && current_shape.size() > 2) {
for (int j = 0; j < current_shape.size(); j++) {
polygon.push_back(current_shape[j]);
colors.push_back(c_bg);
}
} else {
PoolVector<Vector2> vertices = shape->get_vertices();
for (int j = 0; j < shape->get_polygon(0).size(); j++) {
polygon.push_back(vertices[shape->get_polygon(0)[j]] + anchor);
colors.push_back(c_bg);
}
}
workspace->draw_polygon(polygon, colors);
if (coord == edited_shape_coord) {
if (!creating_shape && polygon.size() > 1) {
for (int j = 0; j < polygon.size() - 1; j++) {
workspace->draw_line(polygon[j], polygon[j + 1], c_border, 1, true);
}
workspace->draw_line(polygon[polygon.size() - 1], polygon[0], c_border, 1, true);
}
if (shape == edited_navigation_shape) {
draw_handles = true;
}
}
}
}
}
} break;
default: {
}
}
if (creating_shape && current_shape.size() > 1) {
for (int j = 0; j < current_shape.size() - 1; j++) {
workspace->draw_line(current_shape[j], current_shape[j + 1], Color(0, 1, 1), 1, true);
}
workspace->draw_line(current_shape[current_shape.size() - 1], snap_point(workspace->get_local_mouse_position()), Color(0, 1, 1), 1, true);
draw_handles = true;
}
}
void TileSetEditor::close_shape(const Vector2 &shape_anchor) {
creating_shape = false;
if (edit_mode == EDITMODE_COLLISION) {
if (current_shape.size() >= 3) {
Ref<ConvexPolygonShape2D> shape = memnew(ConvexPolygonShape2D);
Vector<Vector2> points;
float p_total = 0;
for (int i = 0; i < current_shape.size(); i++) {
points.push_back(current_shape[i] - shape_anchor);
if (i != current_shape.size() - 1)
p_total += ((current_shape[i + 1].x - current_shape[i].x) * (-current_shape[i + 1].y + (-current_shape[i].y)));
else
p_total += ((current_shape[0].x - current_shape[i].x) * (-current_shape[0].y + (-current_shape[i].y)));
}
if (p_total < 0)
points.invert();
shape->set_points(points);
undo_redo->create_action(TTR("Create Collision Polygon"));
// Necessary to get the version that returns a Array instead of a Vector.
Array sd = tileset->call("tile_get_shapes", get_current_tile());
undo_redo->add_undo_method(tileset.ptr(), "tile_set_shapes", get_current_tile(), sd.duplicate());
for (int i = 0; i < sd.size(); i++) {
if (sd[i].get("shape") == edited_collision_shape) {
sd.remove(i);
break;
}
}
undo_redo->add_do_method(tileset.ptr(), "tile_set_shapes", get_current_tile(), sd);
if (tileset->tile_get_tile_mode(get_current_tile()) == TileSet::AUTO_TILE || tileset->tile_get_tile_mode(get_current_tile()) == TileSet::ATLAS_TILE)
undo_redo->add_do_method(tileset.ptr(), "tile_add_shape", get_current_tile(), shape, Transform2D(), false, edited_shape_coord);
else
undo_redo->add_do_method(tileset.ptr(), "tile_add_shape", get_current_tile(), shape, Transform2D());
tools[TOOL_SELECT]->set_pressed(true);
undo_redo->add_do_method(this, "_select_edited_shape_coord");
undo_redo->add_undo_method(this, "_select_edited_shape_coord");
undo_redo->commit_action();
} else {
tools[TOOL_SELECT]->set_pressed(true);
workspace->update();
}
} else if (edit_mode == EDITMODE_OCCLUSION) {
Ref<OccluderPolygon2D> shape = memnew(OccluderPolygon2D);
PoolVector<Vector2> polygon;
polygon.resize(current_shape.size());
PoolVector<Vector2>::Write w = polygon.write();
for (int i = 0; i < current_shape.size(); i++) {
w[i] = current_shape[i] - shape_anchor;
}
w.release();
shape->set_polygon(polygon);
undo_redo->create_action(TTR("Create Occlusion Polygon"));
if (tileset->tile_get_tile_mode(get_current_tile()) == TileSet::AUTO_TILE || tileset->tile_get_tile_mode(get_current_tile()) == TileSet::ATLAS_TILE) {
undo_redo->add_do_method(tileset.ptr(), "autotile_set_light_occluder", get_current_tile(), shape, edited_shape_coord);
undo_redo->add_undo_method(tileset.ptr(), "autotile_set_light_occluder", get_current_tile(), tileset->autotile_get_light_occluder(get_current_tile(), edited_shape_coord), edited_shape_coord);
} else {
undo_redo->add_do_method(tileset.ptr(), "tile_set_light_occluder", get_current_tile(), shape);
undo_redo->add_undo_method(tileset.ptr(), "tile_set_light_occluder", get_current_tile(), tileset->tile_get_light_occluder(get_current_tile()));
}
tools[TOOL_SELECT]->set_pressed(true);
undo_redo->add_do_method(this, "_select_edited_shape_coord");
undo_redo->add_undo_method(this, "_select_edited_shape_coord");
undo_redo->commit_action();
} else if (edit_mode == EDITMODE_NAVIGATION) {
Ref<NavigationPolygon> shape = memnew(NavigationPolygon);
PoolVector<Vector2> polygon;
Vector<int> indices;
polygon.resize(current_shape.size());
PoolVector<Vector2>::Write w = polygon.write();
for (int i = 0; i < current_shape.size(); i++) {
w[i] = current_shape[i] - shape_anchor;
indices.push_back(i);
}
w.release();
shape->set_vertices(polygon);
shape->add_polygon(indices);
undo_redo->create_action(TTR("Create Navigation Polygon"));
if (tileset->tile_get_tile_mode(get_current_tile()) == TileSet::AUTO_TILE || tileset->tile_get_tile_mode(get_current_tile()) == TileSet::ATLAS_TILE) {
undo_redo->add_do_method(tileset.ptr(), "autotile_set_navigation_polygon", get_current_tile(), shape, edited_shape_coord);
undo_redo->add_undo_method(tileset.ptr(), "autotile_set_navigation_polygon", get_current_tile(), tileset->autotile_get_navigation_polygon(get_current_tile(), edited_shape_coord), edited_shape_coord);
} else {
undo_redo->add_do_method(tileset.ptr(), "tile_set_navigation_polygon", get_current_tile(), shape);
undo_redo->add_undo_method(tileset.ptr(), "tile_set_navigation_polygon", get_current_tile(), tileset->tile_get_navigation_polygon(get_current_tile()));
}
tools[TOOL_SELECT]->set_pressed(true);
undo_redo->add_do_method(this, "_select_edited_shape_coord");
undo_redo->add_undo_method(this, "_select_edited_shape_coord");
undo_redo->commit_action();
}
tileset->_change_notify("");
}
void TileSetEditor::select_coord(const Vector2 &coord) {
_update_tile_data();
current_shape = PoolVector2Array();
if (get_current_tile() == -1)
return;
Rect2 current_tile_region = tileset->tile_get_region(get_current_tile());
current_tile_region.position += WORKSPACE_MARGIN;
if (tileset->tile_get_tile_mode(get_current_tile()) == TileSet::SINGLE_TILE) {
if (edited_collision_shape != tileset->tile_get_shape(get_current_tile(), 0))
_set_edited_collision_shape(tileset->tile_get_shape(get_current_tile(), 0));
if (edited_occlusion_shape != tileset->tile_get_light_occluder(get_current_tile()))
edited_occlusion_shape = tileset->tile_get_light_occluder(get_current_tile());
if (edited_navigation_shape != tileset->tile_get_navigation_polygon(get_current_tile()))
edited_navigation_shape = tileset->tile_get_navigation_polygon(get_current_tile());
if (edit_mode == EDITMODE_COLLISION) {
current_shape.resize(0);
if (edited_collision_shape.is_valid()) {
for (int i = 0; i < _get_edited_shape_points().size(); i++) {
current_shape.push_back(_get_edited_shape_points()[i] + current_tile_region.position);
}
}
} else if (edit_mode == EDITMODE_OCCLUSION) {
current_shape.resize(0);
if (edited_occlusion_shape.is_valid()) {
for (int i = 0; i < edited_occlusion_shape->get_polygon().size(); i++) {
current_shape.push_back(edited_occlusion_shape->get_polygon()[i] + current_tile_region.position);
}
}
} else if (edit_mode == EDITMODE_NAVIGATION) {
current_shape.resize(0);
if (edited_navigation_shape.is_valid()) {
if (edited_navigation_shape->get_polygon_count() > 0) {
PoolVector<Vector2> vertices = edited_navigation_shape->get_vertices();
for (int i = 0; i < edited_navigation_shape->get_polygon(0).size(); i++) {
current_shape.push_back(vertices[edited_navigation_shape->get_polygon(0)[i]] + current_tile_region.position);
}
}
}
}
} else {
Vector<TileSet::ShapeData> sd = tileset->tile_get_shapes(get_current_tile());
bool found_collision_shape = false;
for (int i = 0; i < sd.size(); i++) {
if (sd[i].autotile_coord == coord) {
if (edited_collision_shape != sd[i].shape)
_set_edited_collision_shape(sd[i].shape);
found_collision_shape = true;
break;
}
}
if (!found_collision_shape)
_set_edited_collision_shape(Ref<ConvexPolygonShape2D>(NULL));
if (edited_occlusion_shape != tileset->autotile_get_light_occluder(get_current_tile(), coord))
edited_occlusion_shape = tileset->autotile_get_light_occluder(get_current_tile(), coord);
if (edited_navigation_shape != tileset->autotile_get_navigation_polygon(get_current_tile(), coord))
edited_navigation_shape = tileset->autotile_get_navigation_polygon(get_current_tile(), coord);
int spacing = tileset->autotile_get_spacing(get_current_tile());
Vector2 size = tileset->autotile_get_size(get_current_tile());
Vector2 shape_anchor = coord;
shape_anchor.x *= (size.x + spacing);
shape_anchor.y *= (size.y + spacing);
shape_anchor += current_tile_region.position;
if (edit_mode == EDITMODE_COLLISION) {
current_shape.resize(0);
if (edited_collision_shape.is_valid()) {
for (int j = 0; j < _get_edited_shape_points().size(); j++) {
current_shape.push_back(_get_edited_shape_points()[j] + shape_anchor);
}
}
} else if (edit_mode == EDITMODE_OCCLUSION) {
current_shape.resize(0);
if (edited_occlusion_shape.is_valid()) {
for (int i = 0; i < edited_occlusion_shape->get_polygon().size(); i++) {
current_shape.push_back(edited_occlusion_shape->get_polygon()[i] + shape_anchor);
}
}
} else if (edit_mode == EDITMODE_NAVIGATION) {
current_shape.resize(0);
if (edited_navigation_shape.is_valid()) {
if (edited_navigation_shape->get_polygon_count() > 0) {
PoolVector<Vector2> vertices = edited_navigation_shape->get_vertices();
for (int i = 0; i < edited_navigation_shape->get_polygon(0).size(); i++) {
current_shape.push_back(vertices[edited_navigation_shape->get_polygon(0)[i]] + shape_anchor);
}
}
}
}
}
workspace->update();
workspace_container->update();
helper->_change_notify("");
}
Vector2 TileSetEditor::snap_point(const Vector2 &point) {
Vector2 p = point;
Vector2 coord = edited_shape_coord;
Vector2 tile_size = tileset->autotile_get_size(get_current_tile());
int spacing = tileset->autotile_get_spacing(get_current_tile());
Vector2 anchor = coord;
anchor.x *= (tile_size.x + spacing);
anchor.y *= (tile_size.y + spacing);
anchor += tileset->tile_get_region(get_current_tile()).position;
anchor += WORKSPACE_MARGIN;
Rect2 region(anchor, tile_size);
Rect2 tile_region(tileset->tile_get_region(get_current_tile()).position + WORKSPACE_MARGIN, tileset->tile_get_region(get_current_tile()).size);
if (tileset->tile_get_tile_mode(get_current_tile()) == TileSet::SINGLE_TILE) {
region.position = tileset->tile_get_region(get_current_tile()).position + WORKSPACE_MARGIN;
region.size = tileset->tile_get_region(get_current_tile()).size;
}
if (tools[TOOL_GRID_SNAP]->is_pressed()) {
p.x = Math::snap_scalar_separation(snap_offset.x, snap_step.x, p.x, snap_separation.x);
p.y = Math::snap_scalar_separation(snap_offset.y, snap_step.y, p.y, snap_separation.y);
}
if (tools[SHAPE_KEEP_INSIDE_TILE]->is_pressed()) {
if (p.x < region.position.x)
p.x = region.position.x;
if (p.y < region.position.y)
p.y = region.position.y;
if (p.x > region.position.x + region.size.x)
p.x = region.position.x + region.size.x;
if (p.y > region.position.y + region.size.y)
p.y = region.position.y + region.size.y;
}
if (p.x < tile_region.position.x) {
p.x = tile_region.position.x;
}
if (p.y < tile_region.position.y) {
p.y = tile_region.position.y;
}
if (p.x > (tile_region.position.x + tile_region.size.x)) {
p.x = (tile_region.position.x + tile_region.size.x);
}
if (p.y > (tile_region.position.y + tile_region.size.y)) {
p.y = (tile_region.position.y + tile_region.size.y);
}
return p;
}
void TileSetEditor::add_texture(Ref<Texture> p_texture) {
texture_list->add_item(p_texture->get_path().get_file());
texture_map.insert(p_texture->get_path(), p_texture);
texture_list->set_item_metadata(texture_list->get_item_count() - 1, p_texture->get_path());
}
void TileSetEditor::remove_texture(Ref<Texture> p_texture) {
texture_list->remove_item(texture_list->find_metadata(p_texture->get_path()));
texture_map.erase(p_texture->get_path());
_validate_current_tile_id();
if (!get_current_texture().is_valid()) {
_on_texture_list_selected(-1);
workspace_overlay->update();
}
}
void TileSetEditor::update_texture_list() {
Ref<Texture> selected_texture = get_current_texture();
helper->set_tileset(tileset);
List<int> ids;
tileset->get_tile_list(&ids);
Vector<int> ids_to_remove;
for (List<int>::Element *E = ids.front(); E; E = E->next()) {
// Clear tiles referencing gone textures (user has been already given the chance to fix broken deps)
if (!tileset->tile_get_texture(E->get()).is_valid()) {
ids_to_remove.push_back(E->get());
ERR_CONTINUE(!tileset->tile_get_texture(E->get()).is_valid());
}
if (!texture_map.has(tileset->tile_get_texture(E->get())->get_path())) {
add_texture(tileset->tile_get_texture(E->get()));
}
}
for (int i = 0; i < ids_to_remove.size(); i++) {
tileset->remove_tile(ids_to_remove[i]);
}
if (texture_list->get_item_count() > 0 && selected_texture.is_valid()) {
texture_list->select(texture_list->find_metadata(selected_texture->get_path()));
if (texture_list->get_selected_items().size() > 0)
_on_texture_list_selected(texture_list->get_selected_items()[0]);
} else if (get_current_texture().is_valid()) {
_on_texture_list_selected(texture_list->find_metadata(get_current_texture()->get_path()));
} else {
_validate_current_tile_id();
_on_texture_list_selected(-1);
workspace_overlay->update();
}
update_texture_list_icon();
helper->_change_notify("");
}
void TileSetEditor::update_texture_list_icon() {
for (int current_idx = 0; current_idx < texture_list->get_item_count(); current_idx++) {
String path = texture_list->get_item_metadata(current_idx);
texture_list->set_item_icon(current_idx, texture_map[path]);
Size2 texture_size = texture_map[path]->get_size();
texture_list->set_item_icon_region(current_idx, Rect2(0, 0, MIN(texture_size.x, 150), MIN(texture_size.y, 100)));
}
texture_list->update();
}
void TileSetEditor::update_workspace_tile_mode() {
if (!get_current_texture().is_valid()) {
tool_workspacemode[WORKSPACE_EDIT]->set_pressed(true);
workspace_mode = WORKSPACE_EDIT;
for (int i = 1; i < WORKSPACE_MODE_MAX; i++) {
tool_workspacemode[i]->set_disabled(true);
}
tools[SELECT_NEXT]->set_disabled(true);
tools[SELECT_PREVIOUS]->set_disabled(true);
tools[ZOOM_OUT]->hide();
tools[ZOOM_1]->hide();
tools[ZOOM_IN]->hide();
tools[VISIBLE_INFO]->hide();
scroll->hide();
empty_message->show();
} else {
for (int i = 1; i < WORKSPACE_MODE_MAX; i++) {
tool_workspacemode[i]->set_disabled(false);
}
tools[SELECT_NEXT]->set_disabled(false);
tools[SELECT_PREVIOUS]->set_disabled(false);
tools[ZOOM_OUT]->show();
tools[ZOOM_1]->show();
tools[ZOOM_IN]->show();
tools[VISIBLE_INFO]->show();
scroll->show();
empty_message->hide();
}
if (workspace_mode != WORKSPACE_EDIT) {
for (int i = 0; i < EDITMODE_MAX; i++) {
tool_editmode[i]->hide();
}
tool_editmode[EDITMODE_REGION]->show();
tool_editmode[EDITMODE_REGION]->set_pressed(true);
_on_edit_mode_changed(EDITMODE_REGION);
separator_editmode->show();
return;
}
if (get_current_tile() < 0) {
for (int i = 0; i < EDITMODE_MAX; i++) {
tool_editmode[i]->hide();
}
for (int i = TOOL_SELECT; i < ZOOM_OUT; i++) {
tools[i]->hide();
}
separator_editmode->hide();
separator_bitmask->hide();
separator_delete->hide();
separator_grid->hide();
return;
}
for (int i = 0; i < EDITMODE_MAX; i++) {
tool_editmode[i]->show();
}
separator_editmode->show();
if (tileset->tile_get_tile_mode(get_current_tile()) == TileSet::SINGLE_TILE) {
if (tool_editmode[EDITMODE_ICON]->is_pressed() || tool_editmode[EDITMODE_PRIORITY]->is_pressed() || tool_editmode[EDITMODE_BITMASK]->is_pressed() || tool_editmode[EDITMODE_Z_INDEX]->is_pressed()) {
tool_editmode[EDITMODE_COLLISION]->set_pressed(true);
edit_mode = EDITMODE_COLLISION;
}
select_coord(Vector2(0, 0));
tool_editmode[EDITMODE_ICON]->hide();
tool_editmode[EDITMODE_BITMASK]->hide();
tool_editmode[EDITMODE_PRIORITY]->hide();
tool_editmode[EDITMODE_Z_INDEX]->hide();
} else if (tileset->tile_get_tile_mode(get_current_tile()) == TileSet::AUTO_TILE) {
if (edit_mode == EDITMODE_ICON)
select_coord(tileset->autotile_get_icon_coordinate(get_current_tile()));
else
_select_edited_shape_coord();
} else if (tileset->tile_get_tile_mode(get_current_tile()) == TileSet::ATLAS_TILE) {
if (tool_editmode[EDITMODE_PRIORITY]->is_pressed() || tool_editmode[EDITMODE_BITMASK]->is_pressed()) {
tool_editmode[EDITMODE_COLLISION]->set_pressed(true);
edit_mode = EDITMODE_COLLISION;
}
if (edit_mode == EDITMODE_ICON)
select_coord(tileset->autotile_get_icon_coordinate(get_current_tile()));
else
_select_edited_shape_coord();
tool_editmode[EDITMODE_BITMASK]->hide();
}
_on_edit_mode_changed(edit_mode);
}
void TileSetEditor::update_workspace_minsize() {
Size2 workspace_min_size = get_current_texture()->get_size();
String current_texture_path = get_current_texture()->get_path();
List<int> tiles;
tileset->get_tile_list(&tiles);
for (List<int>::Element *E = tiles.front(); E; E = E->next()) {
if (tileset->tile_get_texture(E->get())->get_path() != current_texture_path) {
continue;
}
Rect2i region = tileset->tile_get_region(E->get());
if (region.position.x + region.size.x > workspace_min_size.x) {
workspace_min_size.x = region.position.x + region.size.x;
}
if (region.position.y + region.size.y > workspace_min_size.y) {
workspace_min_size.y = region.position.y + region.size.y;
}
}
workspace->set_custom_minimum_size(workspace_min_size + WORKSPACE_MARGIN * 2);
workspace_container->set_custom_minimum_size(workspace_min_size * workspace->get_scale() + WORKSPACE_MARGIN * 2);
workspace_overlay->set_custom_minimum_size(workspace_min_size * workspace->get_scale() + WORKSPACE_MARGIN * 2);
}
void TileSetEditor::update_edited_region(const Vector2 &end_point) {
edited_region = Rect2(region_from, Size2());
if (tools[TOOL_GRID_SNAP]->is_pressed()) {
Vector2 grid_coord;
grid_coord = ((region_from - snap_offset) / (snap_step + snap_separation)).floor();
grid_coord *= (snap_step + snap_separation);
grid_coord += snap_offset;
edited_region.expand_to(grid_coord);
grid_coord += snap_step;
edited_region.expand_to(grid_coord);
grid_coord = ((end_point - snap_offset) / (snap_step + snap_separation)).floor();
grid_coord *= (snap_step + snap_separation);
grid_coord += snap_offset;
edited_region.expand_to(grid_coord);
grid_coord += snap_step;
edited_region.expand_to(grid_coord);
} else {
edited_region.expand_to(end_point);
}
}
int TileSetEditor::get_current_tile() const {
return current_tile;
}
void TileSetEditor::set_current_tile(int p_id) {
if (current_tile != p_id) {
current_tile = p_id;
helper->_change_notify("");
select_coord(Vector2(0, 0));
update_workspace_tile_mode();
if (p_id == -1) {
editor->get_inspector()->edit(tileset.ptr());
} else {
editor->get_inspector()->edit(helper);
}
}
}
Ref<Texture> TileSetEditor::get_current_texture() {
if (texture_list->get_selected_items().size() == 0)
return Ref<Texture>();
else
return texture_map[texture_list->get_item_metadata(texture_list->get_selected_items()[0])];
}
void TilesetEditorContext::set_tileset(const Ref<TileSet> &p_tileset) {
tileset = p_tileset;
}
void TilesetEditorContext::set_snap_options_visible(bool p_visible) {
snap_options_visible = p_visible;
_change_notify("");
}
bool TilesetEditorContext::_set(const StringName &p_name, const Variant &p_value) {
String name = p_name.operator String();
if (name == "options_offset") {
Vector2 snap = p_value;
tileset_editor->_set_snap_off(snap + WORKSPACE_MARGIN);
return true;
} else if (name == "options_step") {
Vector2 snap = p_value;
tileset_editor->_set_snap_step(snap);
return true;
} else if (name == "options_separation") {
Vector2 snap = p_value;
tileset_editor->_set_snap_sep(snap);
return true;
} else if (p_name.operator String().left(5) == "tile_") {
String name2 = p_name.operator String().right(5);
bool v = false;
if (tileset_editor->get_current_tile() < 0 || tileset.is_null())
return false;
if (name2 == "autotile_bitmask_mode") {
tileset->set(String::num(tileset_editor->get_current_tile(), 0) + "/autotile/bitmask_mode", p_value, &v);
} else if (name2 == "subtile_size") {
tileset->set(String::num(tileset_editor->get_current_tile(), 0) + "/autotile/tile_size", p_value, &v);
} else if (name2 == "subtile_spacing") {
tileset->set(String::num(tileset_editor->get_current_tile(), 0) + "/autotile/spacing", p_value, &v);
} else {
tileset->set(String::num(tileset_editor->get_current_tile(), 0) + "/" + name2, p_value, &v);
}
if (v) {
tileset->_change_notify("");
tileset_editor->workspace->update();
tileset_editor->workspace_overlay->update();
}
return v;
} else if (name == "tileset_script") {
tileset->set_script(p_value);
return true;
} else if (name == "selected_collision_one_way") {
Vector<TileSet::ShapeData> sd = tileset->tile_get_shapes(tileset_editor->get_current_tile());
for (int index = 0; index < sd.size(); index++) {
if (sd[index].shape == tileset_editor->edited_collision_shape) {
tileset->tile_set_shape_one_way(tileset_editor->get_current_tile(), index, p_value);
return true;
}
}
return false;
} else if (name == "selected_collision_one_way_margin") {
Vector<TileSet::ShapeData> sd = tileset->tile_get_shapes(tileset_editor->get_current_tile());
for (int index = 0; index < sd.size(); index++) {
if (sd[index].shape == tileset_editor->edited_collision_shape) {
tileset->tile_set_shape_one_way_margin(tileset_editor->get_current_tile(), index, p_value);
return true;
}
}
return false;
}
tileset_editor->err_dialog->set_text(TTR("This property can't be changed."));
tileset_editor->err_dialog->popup_centered(Size2(300, 60));
return false;
}
bool TilesetEditorContext::_get(const StringName &p_name, Variant &r_ret) const {
String name = p_name.operator String();
bool v = false;
if (name == "options_offset") {
r_ret = tileset_editor->snap_offset - WORKSPACE_MARGIN;
v = true;
} else if (name == "options_step") {
r_ret = tileset_editor->snap_step;
v = true;
} else if (name == "options_separation") {
r_ret = tileset_editor->snap_separation;
v = true;
} else if (name.left(5) == "tile_") {
name = name.right(5);
if (tileset_editor->get_current_tile() < 0 || tileset.is_null())
return false;
if (!tileset->has_tile(tileset_editor->get_current_tile()))
return false;
if (name == "autotile_bitmask_mode") {
r_ret = tileset->get(String::num(tileset_editor->get_current_tile(), 0) + "/autotile/bitmask_mode", &v);
} else if (name == "subtile_size") {
r_ret = tileset->get(String::num(tileset_editor->get_current_tile(), 0) + "/autotile/tile_size", &v);
} else if (name == "subtile_spacing") {
r_ret = tileset->get(String::num(tileset_editor->get_current_tile(), 0) + "/autotile/spacing", &v);
} else {
r_ret = tileset->get(String::num(tileset_editor->get_current_tile(), 0) + "/" + name, &v);
}
return v;
} else if (name == "selected_collision") {
r_ret = tileset_editor->edited_collision_shape;
v = true;
} else if (name == "selected_collision_one_way") {
Vector<TileSet::ShapeData> sd = tileset->tile_get_shapes(tileset_editor->get_current_tile());
for (int index = 0; index < sd.size(); index++) {
if (sd[index].shape == tileset_editor->edited_collision_shape) {
r_ret = sd[index].one_way_collision;
v = true;
break;
}
}
} else if (name == "selected_collision_one_way_margin") {
Vector<TileSet::ShapeData> sd = tileset->tile_get_shapes(tileset_editor->get_current_tile());
for (int index = 0; index < sd.size(); index++) {
if (sd[index].shape == tileset_editor->edited_collision_shape) {
r_ret = sd[index].one_way_collision_margin;
v = true;
break;
}
}
} else if (name == "selected_navigation") {
r_ret = tileset_editor->edited_navigation_shape;
v = true;
} else if (name == "selected_occlusion") {
r_ret = tileset_editor->edited_occlusion_shape;
v = true;
} else if (name == "tileset_script") {
r_ret = tileset->get_script();
v = true;
}
return v;
}
void TilesetEditorContext::_get_property_list(List<PropertyInfo> *p_list) const {
if (snap_options_visible) {
p_list->push_back(PropertyInfo(Variant::NIL, "Snap Options", PROPERTY_HINT_NONE, "options_", PROPERTY_USAGE_GROUP));
p_list->push_back(PropertyInfo(Variant::VECTOR2, "options_offset"));
p_list->push_back(PropertyInfo(Variant::VECTOR2, "options_step"));
p_list->push_back(PropertyInfo(Variant::VECTOR2, "options_separation"));
}
if (tileset_editor->get_current_tile() >= 0 && !tileset.is_null()) {
int id = tileset_editor->get_current_tile();
p_list->push_back(PropertyInfo(Variant::NIL, "Selected Tile", PROPERTY_HINT_NONE, "tile_", PROPERTY_USAGE_GROUP));
p_list->push_back(PropertyInfo(Variant::STRING, "tile_name"));
p_list->push_back(PropertyInfo(Variant::OBJECT, "tile_normal_map", PROPERTY_HINT_RESOURCE_TYPE, "Texture"));
p_list->push_back(PropertyInfo(Variant::VECTOR2, "tile_tex_offset"));
p_list->push_back(PropertyInfo(Variant::OBJECT, "tile_material", PROPERTY_HINT_RESOURCE_TYPE, "ShaderMaterial"));
p_list->push_back(PropertyInfo(Variant::COLOR, "tile_modulate"));
p_list->push_back(PropertyInfo(Variant::INT, "tile_tile_mode", PROPERTY_HINT_ENUM, "SINGLE_TILE,AUTO_TILE,ATLAS_TILE"));
if (tileset->tile_get_tile_mode(id) == TileSet::AUTO_TILE) {
p_list->push_back(PropertyInfo(Variant::INT, "tile_autotile_bitmask_mode", PROPERTY_HINT_ENUM, "2x2,3x3 (minimal),3x3"));
p_list->push_back(PropertyInfo(Variant::VECTOR2, "tile_subtile_size"));
p_list->push_back(PropertyInfo(Variant::INT, "tile_subtile_spacing", PROPERTY_HINT_RANGE, "0, 1024, 1"));
} else if (tileset->tile_get_tile_mode(id) == TileSet::ATLAS_TILE) {
p_list->push_back(PropertyInfo(Variant::VECTOR2, "tile_subtile_size"));
p_list->push_back(PropertyInfo(Variant::INT, "tile_subtile_spacing", PROPERTY_HINT_RANGE, "0, 1024, 1"));
}
p_list->push_back(PropertyInfo(Variant::VECTOR2, "tile_occluder_offset"));
p_list->push_back(PropertyInfo(Variant::VECTOR2, "tile_navigation_offset"));
p_list->push_back(PropertyInfo(Variant::VECTOR2, "tile_shape_offset", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR));
p_list->push_back(PropertyInfo(Variant::VECTOR2, "tile_shape_transform", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR));
p_list->push_back(PropertyInfo(Variant::INT, "tile_z_index", PROPERTY_HINT_RANGE, itos(VS::CANVAS_ITEM_Z_MIN) + "," + itos(VS::CANVAS_ITEM_Z_MAX) + ",1"));
}
if (tileset_editor->edit_mode == TileSetEditor::EDITMODE_COLLISION && tileset_editor->edited_collision_shape.is_valid()) {
p_list->push_back(PropertyInfo(Variant::OBJECT, "selected_collision", PROPERTY_HINT_RESOURCE_TYPE, tileset_editor->edited_collision_shape->get_class()));
if (tileset_editor->edited_collision_shape.is_valid()) {
p_list->push_back(PropertyInfo(Variant::BOOL, "selected_collision_one_way", PROPERTY_HINT_NONE));
p_list->push_back(PropertyInfo(Variant::REAL, "selected_collision_one_way_margin", PROPERTY_HINT_NONE));
}
}
if (tileset_editor->edit_mode == TileSetEditor::EDITMODE_NAVIGATION && tileset_editor->edited_navigation_shape.is_valid()) {
p_list->push_back(PropertyInfo(Variant::OBJECT, "selected_navigation", PROPERTY_HINT_RESOURCE_TYPE, tileset_editor->edited_navigation_shape->get_class()));
}
if (tileset_editor->edit_mode == TileSetEditor::EDITMODE_OCCLUSION && tileset_editor->edited_occlusion_shape.is_valid()) {
p_list->push_back(PropertyInfo(Variant::OBJECT, "selected_occlusion", PROPERTY_HINT_RESOURCE_TYPE, tileset_editor->edited_occlusion_shape->get_class()));
}
if (!tileset.is_null()) {
p_list->push_back(PropertyInfo(Variant::OBJECT, "tileset_script", PROPERTY_HINT_RESOURCE_TYPE, "Script"));
}
}
void TilesetEditorContext::_bind_methods() {
ClassDB::bind_method("_hide_script_from_inspector", &TilesetEditorContext::_hide_script_from_inspector);
}
TilesetEditorContext::TilesetEditorContext(TileSetEditor *p_tileset_editor) {
tileset_editor = p_tileset_editor;
snap_options_visible = false;
}
void TileSetEditorPlugin::edit(Object *p_node) {
if (Object::cast_to<TileSet>(p_node)) {
tileset_editor->edit(Object::cast_to<TileSet>(p_node));
}
}
bool TileSetEditorPlugin::handles(Object *p_node) const {
return p_node->is_class("TileSet") || p_node->is_class("TilesetEditorContext");
}
void TileSetEditorPlugin::make_visible(bool p_visible) {
if (p_visible) {
tileset_editor_button->show();
editor->make_bottom_panel_item_visible(tileset_editor);
if (!get_tree()->is_connected("idle_frame", tileset_editor, "_on_workspace_process")) {
get_tree()->connect("idle_frame", tileset_editor, "_on_workspace_process");
}
} else {
editor->hide_bottom_panel();
tileset_editor_button->hide();
if (get_tree()->is_connected("idle_frame", tileset_editor, "_on_workspace_process")) {
get_tree()->disconnect("idle_frame", tileset_editor, "_on_workspace_process");
}
}
}
Dictionary TileSetEditorPlugin::get_state() const {
Dictionary state;
state["snap_offset"] = tileset_editor->snap_offset;
state["snap_step"] = tileset_editor->snap_step;
state["snap_separation"] = tileset_editor->snap_separation;
state["snap_enabled"] = tileset_editor->tools[TileSetEditor::TOOL_GRID_SNAP]->is_pressed();
state["keep_inside_tile"] = tileset_editor->tools[TileSetEditor::SHAPE_KEEP_INSIDE_TILE]->is_pressed();
state["show_information"] = tileset_editor->tools[TileSetEditor::VISIBLE_INFO]->is_pressed();
return state;
}
void TileSetEditorPlugin::set_state(const Dictionary &p_state) {
Dictionary state = p_state;
if (state.has("snap_step")) {
tileset_editor->_set_snap_step(state["snap_step"]);
}
if (state.has("snap_offset")) {
tileset_editor->_set_snap_off(state["snap_offset"]);
}
if (state.has("snap_separation")) {
tileset_editor->_set_snap_sep(state["snap_separation"]);
}
if (state.has("snap_enabled")) {
tileset_editor->tools[TileSetEditor::TOOL_GRID_SNAP]->set_pressed(state["snap_enabled"]);
if (tileset_editor->helper) {
tileset_editor->_on_grid_snap_toggled(state["snap_enabled"]);
}
}
if (state.has("keep_inside_tile")) {
tileset_editor->tools[TileSetEditor::SHAPE_KEEP_INSIDE_TILE]->set_pressed(state["keep_inside_tile"]);
}
if (state.has("show_information")) {
tileset_editor->tools[TileSetEditor::VISIBLE_INFO]->set_pressed(state["show_information"]);
}
}
TileSetEditorPlugin::TileSetEditorPlugin(EditorNode *p_node) {
editor = p_node;
tileset_editor = memnew(TileSetEditor(p_node));
tileset_editor->set_custom_minimum_size(Size2(0, 200) * EDSCALE);
tileset_editor->hide();
tileset_editor_button = p_node->add_bottom_panel_item(TTR("TileSet"), tileset_editor);
tileset_editor_button->hide();
}
| [
"pvu2002@outlook.com"
] | pvu2002@outlook.com |
01bdddd09e79058335145ab8f7e88debeadf78a3 | fbe68d84e97262d6d26dd65c704a7b50af2b3943 | /third_party/virtualbox/src/VBox/HostDrivers/Support/SUPR3HardenedNoCrt.cpp | 551247a8bbe8138ac2a500d7eeb791828ce2fb52 | [
"GPL-2.0-only",
"LicenseRef-scancode-unknown-license-reference",
"CDDL-1.0",
"LicenseRef-scancode-warranty-disclaimer",
"GPL-1.0-or-later",
"LGPL-2.1-or-later",
"GPL-2.0-or-later",
"MPL-1.0",
"LicenseRef-scancode-generic-exception",
"Apache-2.0",
"OpenSSL",
"MIT"
] | permissive | thalium/icebox | c4e6573f2b4f0973b6c7bb0bf068fe9e795fdcfb | 6f78952d58da52ea4f0e55b2ab297f28e80c1160 | refs/heads/master | 2022-08-14T00:19:36.984579 | 2022-02-22T13:10:31 | 2022-02-22T13:10:31 | 190,019,914 | 585 | 109 | MIT | 2022-01-13T20:58:15 | 2019-06-03T14:18:12 | C++ | UTF-8 | C++ | false | false | 4,459 | cpp | /* $Id: SUPR3HardenedNoCrt.cpp $ */
/** @file
* VirtualBox Support Library - Hardened main() no-crt routines.
*/
/*
* Copyright (C) 2006-2017 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* you can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*/
/*********************************************************************************************************************************
* Header Files *
*********************************************************************************************************************************/
#if RT_OS_WINDOWS
# include <iprt/win/windows.h>
#endif
#include <VBox/sup.h>
#include "SUPLibInternal.h"
#ifdef SUP_HARDENED_NEED_CRT_FUNCTIONS /** @todo this crap is obsolete. */
/** memcmp */
DECLHIDDEN(int) suplibHardenedMemComp(void const *pvDst, const void *pvSrc, size_t cbToComp)
{
size_t const *puDst = (size_t const *)pvDst;
size_t const *puSrc = (size_t const *)pvSrc;
while (cbToComp >= sizeof(size_t))
{
if (*puDst != *puSrc)
break;
puDst++;
puSrc++;
cbToComp -= sizeof(size_t);
}
uint8_t const *pbDst = (uint8_t const *)puDst;
uint8_t const *pbSrc = (uint8_t const *)puSrc;
while (cbToComp > 0)
{
if (*pbDst != *pbSrc)
{
if (*pbDst < *pbSrc)
return -1;
return 1;
}
pbDst++;
pbSrc++;
cbToComp--;
}
return 0;
}
/** memcpy */
DECLHIDDEN(void *) suplibHardenedMemCopy(void *pvDst, const void *pvSrc, size_t cbToCopy)
{
size_t *puDst = (size_t *)pvDst;
size_t const *puSrc = (size_t const *)pvSrc;
while (cbToCopy >= sizeof(size_t))
{
*puDst++ = *puSrc++;
cbToCopy -= sizeof(size_t);
}
uint8_t *pbDst = (uint8_t *)puDst;
uint8_t const *pbSrc = (uint8_t const *)puSrc;
while (cbToCopy > 0)
{
*pbDst++ = *pbSrc++;
cbToCopy--;
}
return pvDst;
}
/** memset */
DECLHIDDEN(void *) suplibHardenedMemSet(void *pvDst, int ch, size_t cbToSet)
{
uint8_t *pbDst = (uint8_t *)pvDst;
while (cbToSet > 0)
{
*pbDst++ = (uint8_t)ch;
cbToSet--;
}
return pvDst;
}
/** strcpy */
DECLHIDDEN(char *) suplibHardenedStrCopy(char *pszDst, const char *pszSrc)
{
char *pszRet = pszDst;
char ch;
do
{
ch = *pszSrc++;
*pszDst++ = ch;
} while (ch);
return pszRet;
}
/** strlen */
DECLHIDDEN(size_t) suplibHardenedStrLen(const char *psz)
{
const char *pszStart = psz;
while (*psz)
psz++;
return psz - pszStart;
}
/** strcat */
DECLHIDDEN(char *) suplibHardenedStrCat(char *pszDst, const char *pszSrc)
{
char *pszRet = pszDst;
while (*pszDst)
pszDst++;
suplibHardenedStrCopy(pszDst, pszSrc);
return pszRet;
}
/** strcmp */
DECLHIDDEN(int) suplibHardenedStrCmp(const char *psz1, const char *psz2)
{
for (;;)
{
char ch1 = *psz1++;
char ch2 = *psz2++;
if (ch1 != ch2)
return ch1 < ch2 ? -1 : 1;
if (ch1 == 0)
return 0;
}
}
/** strncmp */
DECLHIDDEN(int) suplibHardenedStrNCmp(const char *psz1, const char *psz2, size_t cchMax)
{
while (cchMax-- > 0)
{
char ch1 = *psz1++;
char ch2 = *psz2++;
if (ch1 != ch2)
return ch1 < ch2 ? -1 : 1;
if (ch1 == 0)
break;
}
return 0;
}
#endif /* SUP_HARDENED_NEED_CRT_FUNCTIONS */
| [
"benoit.amiaux@gmail.com"
] | benoit.amiaux@gmail.com |
c029800204943de4d8c9872ec45919198d0d8acd | f81124e4a52878ceeb3e4b85afca44431ce68af2 | /re20_2/processor21/70/phi | 5a7f02eead53ae6c0fdb1d86f53a0fa76a7223c7 | [] | no_license | chaseguy15/coe-of2 | 7f47a72987638e60fd7491ee1310ee6a153a5c10 | dc09e8d5f172489eaa32610e08e1ee7fc665068c | refs/heads/master | 2023-03-29T16:59:14.421456 | 2021-04-06T23:26:52 | 2021-04-06T23:26:52 | 355,040,336 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 13,070 | /*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 7
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class surfaceScalarField;
location "70";
object phi;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 3 -1 0 0 0 0];
internalField nonuniform List<scalar>
600
(
-1.48521e-06
-6.35363e-14
-3.29561e-06
1.8104e-06
-1.11582e-13
-5.79486e-06
2.49925e-06
-1.6401e-13
-8.95738e-06
3.16253e-06
-2.20341e-13
3.7933e-06
-2.80157e-13
-3.25195e-06
3.59614e-06
-5.71532e-06
4.96262e-06
-8.82981e-06
6.27701e-06
7.5253e-06
-3.16505e-06
5.33279e-06
-5.55699e-06
7.35456e-06
-8.57578e-06
9.2958e-06
1.11352e-05
-3.03572e-06
6.99636e-06
-5.32126e-06
9.6401e-06
-8.19747e-06
1.2172e-05
1.45632e-05
-2.8651e-06
8.56345e-06
-5.01012e-06
1.17851e-05
-7.69794e-06
1.48598e-05
1.77506e-05
-2.65459e-06
1.00115e-05
-4.62601e-06
1.37565e-05
-7.08095e-06
1.73148e-05
-9.97093e-06
2.06405e-05
2.36878e-05
-2.40575e-06
-4.17164e-06
1.55224e-05
-6.35069e-06
1.94938e-05
-8.88813e-06
2.3178e-05
2.65193e-05
-3.64978e-06
1.70521e-05
-5.51147e-06
2.13555e-05
-7.64318e-06
2.53097e-05
2.88487e-05
-3.06309e-06
-4.56741e-06
2.28598e-05
-6.24205e-06
2.69843e-05
3.06124e-05
-3.52217e-06
2.39681e-05
-4.69005e-06
2.81522e-05
-5.82627e-06
3.17486e-05
3.46661e-05
-2.37864e-06
-2.99146e-06
2.8765e-05
-3.44036e-06
3.21975e-05
3.48353e-05
-1.14923e-06
2.87755e-05
-8.52201e-07
3.19004e-05
-1.19269e-07
3.41024e-05
3.52588e-05
8.35079e-07
1.93588e-06
3.07996e-05
3.64073e-06
3.23976e-05
3.27911e-05
4.92333e-06
2.88375e-05
7.66943e-06
2.96515e-05
1.13737e-05
2.90868e-05
2.69812e-05
8.11093e-06
1.19677e-05
2.57947e-05
1.69905e-05
2.4064e-05
2.0581e-05
1.65371e-05
2.29609e-05
1.76401e-05
3.10008e-05
1.25412e-05
5.24762e-06
2.92862e-05
9.73238e-06
3.90626e-05
2.76472e-06
5.09812e-05
-6.67097e-06
-1.88218e-05
3.59638e-05
4.75739e-05
-8.84531e-06
6.16144e-05
-2.07116e-05
-3.5616e-05
5.6524e-05
7.27984e-05
-3.6986e-05
9.21549e-05
-5.49725e-05
-7.66609e-05
8.45053e-05
0.000106551
-7.70179e-05
0.00013243
-0.000102541
-0.000132531
0.000121536
0.000150618
-0.000131623
0.0001844
-0.000166314
-0.000206349
0.000169416
0.000206974
-0.000203872
-0.000249606
0.000230087
0.000277748
-0.000297267
-0.000356199
0.000305553
0.000365141
-0.000415787
-0.000490432
0.000397703
0.000471196
-0.000563925
-0.000657321
0.000507881
0.000597132
-0.000746573
-0.000862418
0.000636207
0.000742246
0.000861704
-0.00111084
-0.00126969
0.000903149
0.00103891
-0.00140546
-0.00159769
0.00107418
0.00122176
-0.00174526
-0.00197116
0.00124893
0.00140284
-0.00238078
0.00156241
0.00157716
0.00238078
0.00157716
0.00124893
0.00174526
0.00140284
0.00197116
0.00156241
0.00107418
0.00140546
0.00122176
0.00159769
0.000903149
0.00111084
0.00103891
0.00126969
0.000636207
0.000746573
0.000742246
0.000862418
0.000861704
0.000507881
0.000563925
0.000597132
0.000657321
0.000397703
0.000415787
0.000471196
0.000490432
0.000305553
0.000297267
0.000365141
0.000356199
0.000230087
0.000203872
0.000277748
0.000249606
0.000169416
0.000131623
0.000206974
0.000166314
0.000206349
0.000121536
7.70179e-05
0.000150618
0.000102541
0.0001844
0.000132531
8.45053e-05
3.6986e-05
0.000106551
5.49725e-05
0.00013243
7.66609e-05
5.6524e-05
8.84531e-06
7.27984e-05
2.07116e-05
9.21549e-05
3.5616e-05
3.59638e-05
-9.73238e-06
4.75739e-05
-2.76472e-06
6.16144e-05
6.67097e-06
1.88218e-05
2.92862e-05
-1.76401e-05
3.90626e-05
-1.25412e-05
5.09812e-05
-5.24762e-06
1.65371e-05
-2.57947e-05
2.29609e-05
-2.4064e-05
3.10008e-05
-2.0581e-05
8.11093e-06
-2.88375e-05
1.19677e-05
-2.96515e-05
1.69905e-05
-2.90868e-05
-2.69812e-05
4.92333e-06
-3.07996e-05
7.66943e-06
-3.23976e-05
1.13737e-05
-3.27911e-05
8.35079e-07
-2.87755e-05
1.93588e-06
-3.19004e-05
3.64073e-06
-3.41024e-05
-3.52588e-05
-1.14923e-06
-2.8765e-05
-8.52201e-07
-3.21975e-05
-1.19269e-07
-3.48353e-05
-2.37864e-06
-2.39681e-05
-2.99146e-06
-2.81522e-05
-3.44036e-06
-3.17486e-05
-3.46661e-05
-3.52217e-06
-2.28598e-05
-4.69005e-06
-2.69843e-05
-5.82627e-06
-3.06124e-05
-3.06309e-06
-1.70521e-05
-4.56741e-06
-2.13555e-05
-6.24205e-06
-2.53097e-05
-2.88487e-05
-3.64978e-06
-1.55224e-05
-5.51147e-06
-1.94938e-05
-7.64318e-06
-2.3178e-05
-2.65193e-05
-2.40575e-06
-1.00115e-05
-4.17164e-06
-1.37565e-05
-6.35069e-06
-1.73148e-05
-8.88813e-06
-2.06405e-05
-2.36878e-05
-2.65459e-06
-8.56345e-06
-4.62601e-06
-1.17851e-05
-7.08095e-06
-1.48598e-05
-9.97093e-06
-1.77506e-05
-2.8651e-06
-6.99636e-06
-5.01012e-06
-9.6401e-06
-7.69794e-06
-1.2172e-05
-1.45632e-05
-3.03572e-06
-5.33279e-06
-5.32126e-06
-7.35456e-06
-8.19747e-06
-9.2958e-06
-1.11352e-05
-3.16505e-06
-3.59614e-06
-5.55699e-06
-4.96262e-06
-8.57578e-06
-6.27701e-06
-7.5253e-06
-3.25195e-06
-1.8104e-06
-5.71532e-06
-2.49925e-06
-8.82981e-06
-3.16252e-06
-3.7933e-06
-1.48521e-06
-3.29561e-06
-5.79486e-06
-8.95738e-06
0.000471343
-0.00934908
0.000403466
-0.00933409
0.000335864
-0.00932124
0.00026848
-0.0093105
0.000201257
-0.00930186
0.000134137
-0.00929531
6.70682e-05
-0.00929088
-0.00928858
0.00182377
-0.00736259
0.00203277
-0.00829729
0.00218652
-0.00900539
0.0022864
-0.00953356
0.00233776
-0.00989841
0.00234833
-0.0101286
0.00232689
-0.010255
0.00228192
-0.0103061
0.00222075
-0.0103061
0.00214921
-0.0102736
0.00207158
-0.0102222
0.00199081
-0.0101609
0.00190882
-0.0100955
0.0018268
-0.0100296
0.00174542
-0.00996506
0.00166504
-0.00990296
0.00158583
-0.0098438
0.00150786
-0.00978777
0.00143112
-0.00973492
0.00135558
-0.00968521
0.00128117
-0.00963854
0.00120785
-0.00959482
0.00113555
-0.00955396
0.00106419
-0.00951585
0.000993709
-0.00948039
0.000924045
-0.00944751
0.000855128
-0.00941711
0.000786896
-0.00938913
0.000719287
-0.0093635
0.000652238
-0.00934016
0.000585691
-0.00931905
0.000519588
-0.00930013
0.000453871
0.000388484
0.000323372
0.000258478
0.000193748
0.000129126
6.45596e-05
0.00182808
0.00202365
0.00216322
0.00224941
0.00228876
0.00228972
0.00226128
0.00221179
0.00214822
0.00207594
0.00199878
0.00191934
0.00183924
0.00175946
0.00168053
0.00160272
0.00152615
0.00145084
0.00137678
0.00130391
0.00123218
0.00116151
0.00109185
0.00102312
0.000955264
0.000888205
0.000821882
0.000756233
0.000691197
0.000626714
0.000562725
0.00182808
0.00736259
0.00202365
0.00829729
0.00216322
0.00900539
0.00224941
0.00953356
0.00228876
0.00989841
0.00228972
0.0101286
0.00226128
0.010255
0.00221179
0.0103061
0.00214822
0.0103061
0.00207594
0.0102736
0.00199878
0.0102222
0.00191934
0.0101609
0.00183924
0.0100955
0.00175946
0.0100296
0.00168053
0.00996506
0.00160272
0.00990296
0.00152615
0.0098438
0.00145084
0.00978777
0.00137678
0.00973492
0.00130391
0.00968521
0.00123218
0.00963854
0.00116151
0.00959482
0.00109185
0.00955396
0.00102312
0.00951585
0.000955264
0.00948039
0.000888205
0.00944751
0.000821882
0.00941711
0.000756233
0.00938913
0.000691197
0.0093635
0.000626714
0.00934016
0.000562725
0.00931905
0.000499174
0.00930013
0.000436006
0.00928336
0.000373166
0.00926871
0.000310599
0.00925613
0.000248252
0.00924561
0.000186071
0.00923713
0.000124003
0.00923069
6.19952e-05
0.00922632
0.00922402
0.00182377
0.00203277
0.00218652
0.0022864
0.00233776
0.00234833
0.00232689
0.00228192
0.00222075
0.00214921
0.00207158
0.00199081
0.00190882
0.0018268
0.00174542
0.00166504
0.00158583
0.00150786
0.00143112
0.00135558
0.00128117
0.00120785
0.00113555
0.00106419
0.000993709
0.000924045
0.000855128
0.000786896
0.000719287
0.000652238
0.000585691
0.000519588
0.000453871
0.000388484
0.000323372
0.000258478
0.000193748
0.000129126
6.45596e-05
)
;
boundaryField
{
inlet
{
type calculated;
value nonuniform 0();
}
outlet
{
type calculated;
value nonuniform 0();
}
cylinder
{
type calculated;
value nonuniform 0();
}
top
{
type symmetryPlane;
value uniform 0;
}
bottom
{
type symmetryPlane;
value uniform 0;
}
defaultFaces
{
type empty;
value nonuniform 0();
}
procBoundary21to20
{
type processor;
value nonuniform List<scalar>
189
(
3.82443e-07
1.10277e-06
1.46621e-06
1.4284e-06
1.37215e-06
1.298e-06
1.20658e-06
1.09861e-06
1.13186e-05
2.12016e-06
1.79934e-06
1.83158e-05
2.4139e-06
1.70402e-06
2.46427e-05
1.13879e-06
-1.96401e-07
2.81368e-05
-2.96121e-06
-5.22988e-06
2.59565e-05
-1.15e-05
2.07575e-05
-2.13784e-05
-2.64896e-05
2.58175e-07
-4.29849e-05
-2.23844e-05
-6.58896e-05
-5.56017e-05
-9.66852e-05
-0.000101869
-0.000137014
-0.000164024
-0.000188652
-0.000245306
-0.000253444
-0.000349376
-0.000333161
-0.000480328
-0.000429218
-0.000642588
-0.000542221
-0.000840559
-0.000968457
-0.000780943
-0.00123304
-0.000938406
-0.00154123
-0.00110361
-0.00189059
-0.00212508
-0.0014217
-0.00253624
-0.00253624
-0.00189059
-0.0014217
-0.00212508
-0.00110361
-0.00154123
-0.000938406
-0.00123304
-0.000840559
-0.000780943
-0.000968457
-0.000542221
-0.000642588
-0.000429218
-0.000480328
-0.000333161
-0.000349376
-0.000253444
-0.000245306
-0.000188652
-0.000164024
-0.000137014
-0.000101869
-9.66852e-05
-5.56017e-05
-6.58896e-05
-2.23844e-05
-4.29849e-05
2.58174e-07
-2.64896e-05
-2.13784e-05
2.07575e-05
-1.15e-05
2.59565e-05
-5.22988e-06
-2.96121e-06
2.81368e-05
-1.96401e-07
1.13879e-06
2.46427e-05
1.70402e-06
2.4139e-06
1.83158e-05
1.79934e-06
2.12016e-06
1.13186e-05
1.09861e-06
1.20658e-06
1.298e-06
1.37215e-06
1.4284e-06
1.46621e-06
1.10277e-06
3.82443e-07
-0.00928336
-0.00926871
-0.00925613
-0.00924561
-0.00923713
-0.00923069
-0.00922632
-0.00922402
-0.00761351
-0.00849286
-0.00914496
-0.00961974
-0.00993776
-0.0101295
-0.0102265
-0.0102566
-0.0102425
-0.0102014
-0.010145
-0.0100815
-0.0100154
-0.00994982
-0.00988613
-0.00982515
-0.00976723
-0.00971247
-0.00966086
-0.00961234
-0.0095668
-0.00952416
-0.0094843
-0.00944712
-0.00941253
-0.00938045
-0.00935079
-0.00932348
-0.00929846
-0.00927567
-0.00925506
0.000499174
-0.00923658
-0.00761351
-0.00849286
-0.00914496
-0.00961974
-0.00993776
-0.0101295
-0.0102265
-0.0102566
-0.0102425
-0.0102014
-0.010145
-0.0100815
-0.0100154
-0.00994982
-0.00988613
-0.00982515
-0.00976723
-0.00971247
-0.00966086
-0.00961234
-0.0095668
-0.00952416
-0.0094843
-0.00944712
-0.00941253
-0.00938045
-0.00935079
-0.00932348
-0.00929846
-0.00927567
-0.00925506
-0.00923658
-0.0092202
-0.00920586
-0.00919356
-0.00918326
-0.00917495
-0.00916862
-0.00916431
-0.00916202
)
;
}
procBoundary21to22
{
type processor;
value nonuniform List<scalar>
175
(
-1.27507e-05
-1.25618e-05
-1.21857e-05
-1.16254e-05
-1.08854e-05
-2.042e-05
-1.32386e-05
-1.17197e-05
-9.9726e-06
-8.00568e-06
-3.36655e-05
-6.82691e-06
-3.6096e-06
-3.65719e-05
1.19376e-06
6.10846e-06
-3.18375e-05
1.62301e-05
2.33907e-05
-1.51569e-05
4.09101e-05
4.4601e-06
6.53429e-05
7.84086e-05
5.38443e-05
0.000114972
0.000102379
0.000162583
0.000167364
0.000223386
0.00025023
0.000301678
0.000332269
0.000422596
0.000432976
0.000573867
0.00055465
0.000761267
0.000698283
0.000991379
0.00113529
0.000996109
0.00144804
0.00118856
0.00181335
0.00137958
0.00222121
0.00222121
0.00137958
0.00181335
0.00118856
0.00144804
0.000991379
0.000996109
0.00113529
0.000698283
0.000761267
0.00055465
0.000573867
0.000432976
0.000422596
0.000332269
0.000301678
0.00025023
0.000223386
0.000167364
0.000162583
0.000102379
0.000114972
5.38443e-05
7.84086e-05
6.53429e-05
4.4601e-06
4.09101e-05
-1.51569e-05
2.33907e-05
1.62301e-05
-3.18375e-05
6.10846e-06
1.19376e-06
-3.65719e-05
-3.6096e-06
-6.82691e-06
-3.36655e-05
-8.00568e-06
-9.9726e-06
-1.17197e-05
-1.32386e-05
-2.042e-05
-1.08854e-05
-1.16254e-05
-1.21857e-05
-1.25618e-05
-1.27507e-05
0.00941729
0.00940197
0.00938884
0.00937788
0.00936908
0.00936243
0.00935795
0.00935565
0.00710124
0.00808829
0.00885164
0.00943368
0.00984704
0.010118
0.0102764
0.0103511
0.0103673
0.0103452
0.0102998
0.0102417
0.0101775
0.0101116
0.0100464
0.00998334
0.009923
0.00986574
0.00981166
0.00976075
0.00971294
0.00966814
0.00962627
0.00958721
0.00955087
0.00951717
0.00948603
0.00945736
0.00943111
0.00940721
0.0093856
-0.000539552
0.00936624
0.00710124
0.00808829
0.00885164
0.00943368
0.00984704
0.010118
0.0102764
0.0103511
0.0103673
0.0103452
0.0102998
0.0102417
0.0101775
0.0101116
0.0100464
0.00998334
0.009923
0.00986574
0.00981166
0.00976075
0.00971294
0.00966814
0.00962627
0.00958721
0.00955087
0.00951717
0.00948603
0.00945736
0.00943111
0.00940721
0.0093856
0.00936624
0.00934908
0.00933409
0.00932124
0.0093105
0.00930186
0.00929531
0.00929088
0.00928858
)
;
}
}
// ************************************************************************* //
| [
"chaseh13@login4.stampede2.tacc.utexas.edu"
] | chaseh13@login4.stampede2.tacc.utexas.edu | |
9b06dbeb2ebcb3e030e67241d77dfbe397fa619b | fc987ace8516d4d5dfcb5444ed7cb905008c6147 | /chrome/browser/chrome_security_exploit_browsertest.cc | 16a0df3f412eac1596b776e7ea9c43256c3a668c | [
"BSD-3-Clause"
] | permissive | nfschina/nfs-browser | 3c366cedbdbe995739717d9f61e451bcf7b565ce | b6670ba13beb8ab57003f3ba2c755dc368de3967 | refs/heads/master | 2022-10-28T01:18:08.229807 | 2020-09-07T11:45:28 | 2020-09-07T11:45:28 | 145,939,440 | 2 | 4 | BSD-3-Clause | 2022-10-13T14:59:54 | 2018-08-24T03:47:46 | null | UTF-8 | C++ | false | false | 5,365 | cc | // Copyright (c) 2013 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 "base/command_line.h"
#include "base/macros.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/singleton_tabs.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/extensions/extension_process_policy.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/common/fileapi/webblob_messages.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/resource_request_details.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/browser_test_utils.h"
#include "ipc/ipc_security_test_util.h"
#include "net/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
// The goal of these tests is to "simulate" exploited renderer processes, which
// can send arbitrary IPC messages and confuse browser process internal state,
// leading to security bugs. We are trying to verify that the browser doesn't
// perform any dangerous operations in such cases.
// This is similar to the security_exploit_browsertest.cc tests, but also
// includes chrome/ layer concepts such as extensions.
class ChromeSecurityExploitBrowserTest : public InProcessBrowserTest {
public:
ChromeSecurityExploitBrowserTest() {}
~ChromeSecurityExploitBrowserTest() override {}
void SetUpOnMainThread() override {
ASSERT_TRUE(embedded_test_server()->Start());
host_resolver()->AddRule("*", "127.0.0.1");
}
void SetUpCommandLine(base::CommandLine* command_line) override {
// Since we assume exploited renderer process, it can bypass the same origin
// policy at will. Simulate that by passing the disable-web-security flag.
command_line->AppendSwitch(switches::kDisableWebSecurity);
}
private:
DISALLOW_COPY_AND_ASSIGN(ChromeSecurityExploitBrowserTest);
};
IN_PROC_BROWSER_TEST_F(ChromeSecurityExploitBrowserTest,
ChromeExtensionResources) {
// Load a page that requests a chrome-extension:// image through XHR. We
// expect this load to fail, as it is an illegal request.
GURL foo = embedded_test_server()->GetURL("foo.com",
"/chrome_extension_resource.html");
content::DOMMessageQueue msg_queue;
ui_test_utils::NavigateToURL(browser(), foo);
std::string status;
std::string expected_status("0");
EXPECT_TRUE(msg_queue.WaitForMessage(&status));
EXPECT_STREQ(status.c_str(), expected_status.c_str());
}
IN_PROC_BROWSER_TEST_F(ChromeSecurityExploitBrowserTest,
CreateBlobInExtensionOrigin) {
// This test relies on extensions documents running in extension processes,
// which is guaranteed with --isolate-extensions. Without it, the checks are
// not enforced and this test will time out waiting for the process to be
// killed.
if (!extensions::IsIsolateExtensionsEnabled())
return;
ui_test_utils::NavigateToURL(
browser(),
embedded_test_server()->GetURL("a.root-servers.net", "/title1.html"));
content::RenderFrameHost* rfh =
browser()->tab_strip_model()->GetActiveWebContents()->GetMainFrame();
// All these are attacker controlled values. The UUID is arbitrary.
std::string blob_id = "2ce53a26-0409-45a3-86e5-f8fb9f5566d8";
std::string blob_type = "text/html";
std::string blob_contents = "<script>chrome.extensions</script>";
std::string blob_path = "5881f76e-10d2-410d-8c61-ef210502acfd";
// Target the bookmark manager extension.
std::string target_origin =
"chrome-extension://eemcgdkfndhakfknompkggombfjjjeno";
std::vector<storage::DataElement> data_elements(1);
data_elements[0].SetToBytes(blob_contents.c_str(), blob_contents.size());
// Set up a blob ID and populate it with attacker-controlled value. These two
// messages are allowed, because this data is not in any origin.
IPC::IpcSecurityTestUtil::PwnMessageReceived(
rfh->GetProcess()->GetChannel(),
BlobStorageMsg_RegisterBlobUUID(blob_id, blob_type, "",
std::set<std::string>()));
IPC::IpcSecurityTestUtil::PwnMessageReceived(
rfh->GetProcess()->GetChannel(),
BlobStorageMsg_StartBuildingBlob(blob_id, data_elements));
// This IPC should result in a kill because |target_origin| is not commitable
// in |rfh->GetProcess()|.
content::RenderProcessHostWatcher crash_observer(
rfh->GetProcess(),
content::RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT);
IPC::IpcSecurityTestUtil::PwnMessageReceived(
rfh->GetProcess()->GetChannel(),
BlobHostMsg_RegisterPublicURL(
GURL("blob:" + target_origin + "/" + blob_path), blob_id));
crash_observer.Wait(); // If the process is killed, this test passes.
}
| [
"hukun@nfschina.com"
] | hukun@nfschina.com |
85eec8a21f8102eed21cab4dbcda74509505adff | 329f5564b39b6138e4e3a78b05bccd068412e78b | /p007/p007.cpp | c19238a729c354e5f7b06f44ff3d90234792ce7f | [] | no_license | hythof/project-euler | 34b5cfed551bb69c501cf24cb0a6c353e6b1707e | c3246dd2661554231e2f3d7c366899e11d3af1a9 | refs/heads/master | 2016-09-06T16:50:21.167472 | 2014-08-12T06:11:26 | 2014-08-12T06:11:26 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 801 | cpp | #include <iostream>
#include <vector>
using namespace std;
void sieveOfEratostenes(int start, int end, vector<int> *xs) {
vector<int>::iterator it;
for(int i=start; i<=end; i+=2) {
bool isPrime = true;
for(it=xs->begin(); it!=xs->end(); ++it) {
int v = *it;
if(i % v == 0) {
isPrime = false;
break;
}
}
if(isPrime) {
xs->push_back(i);
}
}
}
int prime(int n) {
vector<int> xs;
xs.push_back(2);
int start = 3;
int end = n * 2;
while(xs.size() <= n) {
sieveOfEratostenes(start, end, &xs);
start = *(xs.end() - 1) + 2;
end = start * 2;
}
return xs[n];
}
int main() {
cout << prime(10000) << endl;
return 0;
}
| [
"hiroshi.tadokoro@gu3.co.jp"
] | hiroshi.tadokoro@gu3.co.jp |
b79d4e964c362b926e8c6df015357aa2c64dccbc | c51febc209233a9160f41913d895415704d2391f | /library/ATF/PMONITOR_INFO_1A.hpp | 6054f1e20416d0db00a83718ea23074ccdf829aa | [
"MIT"
] | permissive | roussukke/Yorozuya | 81f81e5e759ecae02c793e65d6c3acc504091bc3 | d9a44592b0714da1aebf492b64fdcb3fa072afe5 | refs/heads/master | 2023-07-08T03:23:00.584855 | 2023-06-29T08:20:25 | 2023-06-29T08:20:25 | 463,330,454 | 0 | 0 | MIT | 2022-02-24T23:15:01 | 2022-02-24T23:15:00 | null | UTF-8 | C++ | false | false | 270 | hpp | // 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 <_MONITOR_INFO_1A.hpp>
START_ATF_NAMESPACE
typedef _MONITOR_INFO_1A *PMONITOR_INFO_1A;
END_ATF_NAMESPACE
| [
"b1ll.cipher@yandex.ru"
] | b1ll.cipher@yandex.ru |
730906708fde36e858cfd8ed3f1619a0e9746b30 | 1701dc02cea7de6ca190fda8314af40bfe296a48 | /src/naboris_stereo/src/naboris_stereo/naboris_stereo.cpp | 6e5a350a597f5cff21557b0b31195c9212ed3161 | [] | no_license | Woz4tetra/NaborisROS | 1a00a900a6b4b78deb9cd92d51653bbf79f68aa4 | 6fdd4393993cf7a4d3a5cc94d2ee5746e2491fa6 | refs/heads/master | 2021-05-09T21:15:15.352831 | 2018-02-25T19:38:17 | 2018-02-25T19:38:17 | 118,722,334 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,085 | cpp |
#include "naboris_stereo/naboris_stereo.h"
const string NaborisStereo::NODE_NAME = "naboris_stereo";
const double NaborisStereo::MIN_ALLOWED_TIME_DIFF = 0.3;
NaborisStereo::NaborisStereo(ros::NodeHandle* nodehandle):
nh(*nodehandle),
img_transport(nh)
{
ROS_INFO("Stereo node starting...");
nh.param<string>("right_cam_sub_topic", right_cam_sub_topic, "/naboris_ip_cam/image_raw");
nh.param<string>("left_cam_sub_topic", left_cam_sub_topic, "/raspicam_node/image");
nh.param<double>("fps", fps, 5.0);
ROS_INFO("right_cam_sub_topic: %s", right_cam_sub_topic.c_str());
ROS_INFO("left_cam_sub_topic: %s", left_cam_sub_topic.c_str());
ROS_INFO("output fps: %f", fps);
nh.param<string>("right_cam_pub_topic", right_cam_pub_topic, "/naboris_stereo/right/image_raw");
nh.param<string>("left_cam_pub_topic", left_cam_pub_topic, "/naboris_stereo/left/image_raw");
ROS_INFO("right_cam_pub_topic: %s", right_cam_pub_topic.c_str());
ROS_INFO("left_cam_pub_topic: %s", left_cam_pub_topic.c_str());
right_image_sub = img_transport.subscribeCamera(
right_cam_sub_topic,
1,
boost::bind(
&NaborisStereo::right_image_callback,
this,
_1, _2
)
);
left_image_sub = img_transport.subscribeCamera(
left_cam_sub_topic,
1,
boost::bind(
&NaborisStereo::left_image_callback,
this,
_1, _2
),
ros::VoidPtr(),
image_transport::TransportHints("compressed")
);
right_image_pub = img_transport.advertiseCamera(right_cam_pub_topic, 1);
left_image_pub = img_transport.advertiseCamera(left_cam_pub_topic, 1);
bool left_cam_ready = false;
right_cam_in_sync = false;
right_cam_in_sync_prev = false;
time_diff_sum = 0.0;
time_diff_count = 0;
prev_pub_time = ros::Time::now();
pub_duration = ros::Duration(1 / fps);
tf::Quaternion q;
q.setRPY(0, 0, 0);
static_stereo_to_base_link.setOrigin(tf::Vector3(0.0, 0.0, 0.0));
static_stereo_to_base_link.setRotation(q);
ROS_INFO("Stereo node init done");
}
void NaborisStereo::right_image_callback(const ImageConstPtr& right_image_msg, const sensor_msgs::CameraInfoConstPtr& right_info_msg)
{
if (!left_cam_ready) {
left_cam_ready = true;
ROS_INFO("Left image ready");
}
right_saved_image.reset(new sensor_msgs::Image(*right_image_msg));
right_saved_info.reset(new sensor_msgs::CameraInfo(*right_info_msg));
right_saved_timestamp = right_image_msg->header.stamp.toSec();
}
void NaborisStereo::left_image_callback(const ImageConstPtr& left_image_msg, const sensor_msgs::CameraInfoConstPtr& left_info_msg)
{
static tf::TransformBroadcaster br;
ros::Time current_time = ros::Time::now();
if ((current_time - prev_pub_time) < pub_duration) {
return;
}
prev_pub_time = current_time;
sensor_msgs::ImagePtr left_saved_msg(new sensor_msgs::Image(*left_image_msg));
left_image_vector.push_back(left_saved_msg);
sensor_msgs::CameraInfoPtr left_saved_info(new sensor_msgs::CameraInfo(*left_info_msg));
left_info_vector.push_back(left_saved_info);
left_stamp_vector.push_back(left_image_msg->header.stamp.toSec());
double min_time_diff = std::numeric_limits<double>::infinity();
size_t min_time_diff_index = 0;
for (size_t index = 0; index < left_stamp_vector.size(); index++) {
double time_diff = abs(left_stamp_vector.at(index) - right_saved_timestamp);
if (time_diff < min_time_diff) {
min_time_diff = time_diff;
min_time_diff_index = index;
}
}
right_cam_in_sync_prev = right_cam_in_sync;
if (min_time_diff > MIN_ALLOWED_TIME_DIFF) {
right_cam_in_sync = false;
if (right_cam_in_sync != right_cam_in_sync_prev) {
ROS_INFO("Right image out of sync! Will keep checking for images.");
}
return;
}
right_cam_in_sync = true;
if (right_cam_in_sync != right_cam_in_sync_prev) {
ROS_INFO("Right image in sync.");
}
time_diff_sum += min_time_diff;
time_diff_count++;
if (time_diff_count % 100 == 0) {
ROS_INFO("Average stereo image time diff: %f. Num synced images: %d", time_diff_sum / (double)(time_diff_count), time_diff_count);
}
if (min_time_diff_index > 0) {
ERASE_UPTO_MIN_INDEX(left_image_vector);
ERASE_UPTO_MIN_INDEX(left_info_vector);
ERASE_UPTO_MIN_INDEX(left_stamp_vector);
}
std_msgs::Header header;
header.stamp = ros::Time::now();
header.frame_id = "stereo";
left_image_vector.at(0)->header = header;
left_info_vector.at(0)->header = header;
right_saved_image->header = header;
right_saved_info->header = header;
left_image_pub.publish(left_image_vector.at(0), left_info_vector.at(0));
right_image_pub.publish(right_saved_image, right_saved_info);
br.sendTransform(tf::StampedTransform(static_stereo_to_base_link, ros::Time::now(), "/base_link", "stereo"));
}
| [
"woz4tetra@gmail.com"
] | woz4tetra@gmail.com |
8004462bdd7a19c50a7702023bb0d0bfa107b3b0 | ae74b85b3e6a585c9d5cb82e939ba79c62dc8943 | /Introduction to Programming in C++/bmi_imperial_lab/bmiimperial.cpp | ed74f207bf80cb192646aba29eb60f0a936f7b1b | [] | no_license | nazimorhan/Edx-Cpp-Exercises | 1d55fb590c4b17a3d7fecb9e4042b8ef3274d05c | 375b0d35f70c5b320e3f6d852da6878ed965ce67 | refs/heads/master | 2023-07-16T05:03:37.898897 | 2021-08-23T17:20:10 | 2021-08-23T17:20:10 | 393,640,531 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 568 | cpp | #include <iostream>
#include <math.h>
#include <iomanip> // std::setprecision
using namespace std;
#define pounds 0.453592 //kilograms
#define inch 0.0254 // meters
int main(){
double weight, height, bmi;
cout<<"Please enter weight in pounds: ";
cin>>weight;
weight *= pounds;
cout<<"Please enter height in inches: ";
cin>>height;
height *= inch;
// Calculate BMI.
bmi = weight/pow(height, 2);
// Make BMI precision as 2 decimal places
cout<<"BMI is: ";
printf("%.2f", bmi);
cout<<endl;
return 0;
} | [
"nazim.orhan@pirireis.com.tr"
] | nazim.orhan@pirireis.com.tr |
2d5c57f8349200e217bcef1bc80d1b8bdcc21fa1 | ae35abc9cf5d27d736782c6d0ef849c27aa3fd2e | /C++/include/mscl/MicroStrain/Inertial/Commands/InertialCmdResponse.h | 3c0efd927f7ea702e7955b100f1664f9a3901dd6 | [] | no_license | SnowmanTackler/Microstrain | ca4351f05e032d0e1afae2e972dcb28aadbfc07c | 1f43cb787febfe7cae56cbc02f232721f672850d | refs/heads/master | 2021-01-10T15:45:49.062736 | 2015-10-06T17:12:10 | 2015-10-06T17:12:10 | 43,765,398 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,644 | h | /*******************************************************************************
Copyright(c) 2015 LORD Corporation. All rights reserved.
MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License.
*******************************************************************************/
//PUBLIC_HEADER
#pragma once
#include "mscl/MicroStrain/ResponsePattern.h"
#include "mscl/MicroStrain/Inertial/Packets/InertialPacket.h"
namespace mscl
{
//API Class: InertialCmdResponse
// Represents the response to a generic InertialNode command
class InertialCmdResponse
{
public:
//Constructor: InertialCmdResponse
// Creates an InertialCmdResponse with default values
InertialCmdResponse();
virtual ~InertialCmdResponse(){}; //virtual destructor
protected:
//Constructor: InertialCmdResponse
// Creates an InertialCmdResponse with the given parameters
//
//Parameters:
// state - The state of the response
// success - Whether or not the response was a success
// errorCode - The MIP Ack/Nack error code received
// cmdName - The name of the command that this response corresponds to
InertialCmdResponse(ResponsePattern::State state, bool success, InertialPacket::MipAckNack errorCode, std::string cmdName);
protected:
//Variable: m_responseState
// The state of the response, which determines which exceptions are thrown, if any
ResponsePattern::State m_responseState;
//Variable: m_success
// Whether or not the response was a success
bool m_success;
//Variable: m_ackNack
// The MIP ack/nack that was received with the packet
InertialPacket::MipAckNack m_ackNack;
//Variable: m_commandName
// The name of the command that this response corresponds to (to be used in error descriptions)
std::string m_commandName;
public:
//Function: throwIfFailed
// Throws an exeption if the response was a failure.
//
//Exceptions:
// - <Error_Timeout>: There was no response to the command. The command timed out.
// - <Error_InertialCmdFailed>: The command has failed. Check the error code for more details.
void throwIfFailed();
//API Function: success
// Gets whether or not the command was a success.
//
//Returns:
// true if the command was a success, false otherwise
//
//Exceptions:
// - <Error>: The function was called before there was a response to the command (uninitialized)
virtual bool success() const;
//API Function: errorCode
// Gets the MIP ack/nack error code that was returned
//
//Returns:
// The MIP ack/nack error code as a <InertialPacket::MipAckNack>
virtual InertialPacket::MipAckNack errorCode() const;
};
} | [
"seifes1@gmail.com"
] | seifes1@gmail.com |
4670b5e47889825b4167352d7309fbef97da1a55 | 9d090627ce1b4875f39fd5e23f5cf75c2072e963 | /first_part/MPI/main.cpp | b0b49b636cf44e0c14b15dcf49904504870174d8 | [] | no_license | irina-rud/Parallel-and-distributed-computing.-MIPT | c2105bea02335620f982415dc795395b5c75d786 | 87cdfd9814f04821d101006d32deaee01459fb22 | refs/heads/master | 2022-10-20T21:43:11.987654 | 2017-02-10T13:18:27 | 2017-02-10T13:18:27 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,732 | cpp | #include <iostream>
#include <stdio.h>
#include <mpi.h>
#include <fstream>
#include <vector>
#include <cstdlib>
#include <iomanip>
#include "CGameBoard.h"
void masterTr(int my_rank, int num_workers, int one_block_hight, int length, CGameBoard* result_board) {
std::vector<MPI_Request> reqs(num_workers);
std::vector<MPI_Status> stats(num_workers);
MPI_Status status;
srand(time(NULL));
std::vector<std::vector<int> > parts;
parts.resize(size_t(num_workers));
for (int rank = 0; rank < num_workers; ++rank) {
parts[rank].reserve(size_t(one_block_hight * length));
for (int i = 1; i < one_block_hight + 1; ++i) {
for (int j = 0; j < length; ++j) {
int node = rand() % 2;
if (node == 0) {
parts[rank].push_back(settled);
} else if (node == 1) {
parts[rank].push_back(empty);
} else {
throw new std::exception();
}
}
}
}
for (int i = 0; i < num_workers; ++i) {
MPI_Isend(parts[i].data(), int(parts[i].size()), MPI_INT, (i + 1), 0, MPI_COMM_WORLD, &reqs[i]);
}
MPI_Waitall(num_workers, reqs.data(), stats.data());
for (int i = 0; i < num_workers; i++) {
//std::cout << "reciving from " << i + 1 << std::endl;
MPI_Recv(parts[i].data(), int(parts[i].size()),
MPI_INT, (i+1), 0, MPI_COMM_WORLD, &status);
//std::cout << "recived " << i << std::endl;
}
std::vector<int> result;
//std::cout << "recived" << std::endl;
result.reserve(num_workers*one_block_hight*length);
for (int i = 0 ; i < parts.size(); ++i) {
result.insert(result.end(), parts[i].begin(), parts[i].end());
}
// result_board->setNewNow(result);
// result_board->printPrevTorus();
}
void worker(int my_rank, int num_workers, int block_hight, int length, int iterations) {
MPI_Status status;
std::vector<int> my_part;
my_part.resize(size_t(length * (block_hight + 2)));
for (int i = 0; i < length *(block_hight + 2) ; ++i){
my_part[i] = notchanged;
}
std::vector<int> data;
data.resize(length * block_hight);
MPI_Recv(data.data(),int(length * block_hight), MPI_INT, 0, 0, MPI_COMM_WORLD, &status);
my_part.insert(my_part.begin()+length, data.begin(), data.end());
int left_rank = (my_rank - 1 ) % (num_workers + 1);
if (left_rank == 0){
left_rank = num_workers;
}
int right_rank = (my_rank + 1) % (num_workers +1);
if (right_rank == 0){
right_rank = 1;
}
//std::cout <<"left:"<<left_rank<< " me:" <<my_rank <<" right:" << right_rank <<std::endl;
CGameBoard board(length,block_hight + 2);
board.setNewNow(my_part);
//board.printPrevTorus();
std::vector<int> send_left_line, send_right_line;
std::vector<int> recv_left_line, recv_right_line;
send_left_line.reserve(length);
send_right_line.reserve(length);
recv_left_line.resize(length);
recv_right_line.resize(length);
MPI_Request reqs[4];
MPI_Status stats[4];
for (int i = 0; i < iterations; ++i) {
send_left_line.clear();
send_right_line.clear();
recv_left_line.clear();
recv_right_line.clear();
send_left_line.reserve(length);
send_right_line.reserve(length);
recv_left_line.resize(length);
recv_right_line.resize(length);
board.upperBound(send_left_line);
board.lowerBound(send_right_line);
// for (int i = 0; i < length; ++i){
// std::cout << send_right_line[i] <<' ';
// }
// std::cout << std::endl;
MPI_Sendrecv(send_left_line.data(), send_left_line.size(), MPI_INT, left_rank, 0,
recv_right_line.data(), recv_right_line.size(), MPI_INT, right_rank, 0,
MPI_COMM_WORLD, &stats[0]);
//std::cout << "done1" << std::endl;
MPI_Sendrecv(send_right_line.data(), send_left_line.size(), MPI_INT, right_rank, 0,
recv_left_line.data(), recv_left_line.size(), MPI_INT, left_rank, 0,
MPI_COMM_WORLD, &stats[1]);
//std::cout << "done" << std::endl;
board.setLowerBound(recv_right_line);
board.setUpperBound(recv_left_line);
//board.printPrevTorus();
for (int y = 1; y <= block_hight; ++y) {
for (int x = 0; x < length; ++x) {
board.countCell(x + length * y);
}
}
board.changeMode();
}
// board.printPrevTorus();
std::vector<int> res_part;
res_part.reserve(size_t(length * block_hight));
board.getTorus(res_part);
// for (int i = 0; i < res_part.size(); ++i){
// std::cout << res_part[i] <<' ';
// }
// std::cout << std::endl;
MPI_Send(res_part.data(), res_part.size(), MPI_INT, 0, 0, MPI_COMM_WORLD);
}
int main(int argc, char **argv) {
int heigth_all = 10000, kernels = 30
;
int iterations = 200, length = 100;
int higth = (int)(heigth_all / kernels);
MPI_Status status;
int st = MPI_Init(&argc, &argv);
if (st != 0) {
std::cout << "MPI error\n";
return -1;
}
int rank, num_nodes;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &num_nodes);
CGameBoard result(length,(num_nodes-1)*higth);
if (rank != 0) {
worker(rank, num_nodes - 1, higth, length, iterations);
} else {
double t0 = MPI_Wtime();
masterTr(0, num_nodes - 1, higth, length, &result);
printf("Time: %lf\n", MPI_Wtime() - t0);
// result.printTorus();
}
MPI_Finalize();
} | [
"roller145@yandex.ru"
] | roller145@yandex.ru |
38265588d6f23642f6e3f3ac8fc8bd192295dc50 | 4c5988da041cfd2283af959ecb75746788fbd3d6 | /API/hermes/TracingRuntime.cpp | 6ce45f01e4dc763d392760d585b2042b78438b2e | [
"MIT"
] | permissive | test123-123test/hermes | 9ba681f78d22da94695af876448c015c081aea76 | 6fd712cdd16380abf363f18cf32e64af2a7a12c2 | refs/heads/master | 2023-03-04T06:39:06.965638 | 2021-02-11T14:10:56 | 2021-02-11T14:12:25 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 25,751 | cpp | /*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#ifdef HERMESVM_API_TRACE
#include "TracingRuntime.h"
#include <hermes/Platform/Logging.h>
#include <hermes/Support/Algorithms.h>
#include <hermes/Support/JSONEmitter.h>
#include <llvh/Support/raw_ostream.h>
#include "llvh/Support/FileSystem.h"
#include "llvh/Support/SHA1.h"
namespace facebook {
namespace hermes {
namespace tracing {
TracingRuntime::TracingRuntime(
std::unique_ptr<jsi::Runtime> runtime,
uint64_t globalID,
const ::hermes::vm::RuntimeConfig &conf,
std::unique_ptr<llvh::raw_ostream> traceStream)
: RuntimeDecorator<jsi::Runtime>(*runtime),
runtime_(std::move(runtime)),
trace_(globalID, conf, std::move(traceStream)) {}
jsi::Value TracingRuntime::evaluateJavaScript(
const std::shared_ptr<const jsi::Buffer> &buffer,
const std::string &sourceURL) {
::hermes::SHA1 sourceHash{};
bool sourceIsBytecode = false;
if (HermesRuntime::isHermesBytecode(buffer->data(), buffer->size())) {
sourceHash = ::hermes::hbc::BCProviderFromBuffer::getSourceHashFromBytecode(
llvh::makeArrayRef(buffer->data(), buffer->size()));
sourceIsBytecode = true;
} else {
sourceHash =
llvh::SHA1::hash(llvh::makeArrayRef(buffer->data(), buffer->size()));
}
trace_.emplace_back<SynthTrace::BeginExecJSRecord>(
getTimeSinceStart(), sourceURL, sourceHash, sourceIsBytecode);
auto res = RD::evaluateJavaScript(buffer, sourceURL);
trace_.emplace_back<SynthTrace::EndExecJSRecord>(
getTimeSinceStart(), toTraceValue(res));
return res;
}
jsi::Object TracingRuntime::createObject() {
auto obj = RD::createObject();
trace_.emplace_back<SynthTrace::CreateObjectRecord>(
getTimeSinceStart(), getUniqueID(obj));
return obj;
}
jsi::Object TracingRuntime::createObject(std::shared_ptr<jsi::HostObject> ho) {
class TracingHostObject : public jsi::DecoratedHostObject {
public:
using jsi::DecoratedHostObject::DecoratedHostObject;
jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &name) override {
TracingRuntime &trt = tracingRuntime();
trt.trace_.emplace_back<SynthTrace::GetPropertyNativeRecord>(
trt.getTimeSinceStart(),
objID_,
trt.getUniqueID(name),
name.utf8(rt));
try {
// Note that this ignores the "rt" argument, passing the
// DHO's cached decoratedRuntime() to the underlying HostObject's get.
// In this case, that will be a TracingRuntime.
auto ret = DecoratedHostObject::get(rt, name);
trt.trace_.emplace_back<SynthTrace::GetPropertyNativeReturnRecord>(
trt.getTimeSinceStart(), trt.toTraceValue(ret));
return ret;
} catch (...) {
// TODO(T28293178): The trace currently has no way to model
// exceptions thrown from C++ code.
::hermes::hermes_fatal(
"Exception happened in native code during trace");
}
}
void set(
jsi::Runtime &rt,
const jsi::PropNameID &name,
const jsi::Value &value) override {
TracingRuntime &trt = tracingRuntime();
trt.trace_.emplace_back<SynthTrace::SetPropertyNativeRecord>(
trt.getTimeSinceStart(),
objID_,
trt.getUniqueID(name),
name.utf8(rt),
trt.toTraceValue(value));
try {
// Note that this ignores the "rt" argument, passing the
// DHO's cached decoratedRuntime() to the underlying HostObject's set.
// In this case, that will be a TracingRuntime.
DecoratedHostObject::set(rt, name, value);
} catch (...) {
// TODO(T28293178): The trace currently has no way to model
// exceptions thrown from C++ code.
::hermes::hermes_fatal(
"Exception happened in native code during trace");
}
trt.trace_.emplace_back<SynthTrace::SetPropertyNativeReturnRecord>(
trt.getTimeSinceStart());
}
std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime &rt) override {
TracingRuntime &trt = tracingRuntime();
trt.trace_.emplace_back<SynthTrace::GetNativePropertyNamesRecord>(
trt.getTimeSinceStart(), objID_);
std::vector<jsi::PropNameID> props;
try {
// Note that this ignores the "rt" argument, passing the
// DHO's cached decoratedRuntime() to the underlying HostObject's
// getProprtyNames. In this case, that will be a TracingRuntime.
props = DecoratedHostObject::getPropertyNames(rt);
} catch (...) {
// TODO(T28293178): The trace currently has no way to model
// exceptions thrown from C++ code.
::hermes::hermes_fatal(
"Exception happened in native code during trace");
}
std::vector<std::string> names;
names.reserve(props.size());
for (const jsi::PropNameID &prop : props) {
names.emplace_back(prop.utf8(rt));
}
trt.trace_.emplace_back<SynthTrace::GetNativePropertyNamesReturnRecord>(
trt.getTimeSinceStart(), names);
return props;
}
void setObjectID(SynthTrace::ObjectID id) {
objID_ = id;
}
private:
/// The TracingRuntime used when the TracingHostObject was created.
TracingRuntime &tracingRuntime() {
// A TracingHostObject is always created with a TracingRuntime,
// so this cast is safe.
return static_cast<TracingRuntime &>(decoratedRuntime());
}
/// The object id of the host object that this is attached to.
SynthTrace::ObjectID objID_;
};
// These next two lines are very similar to the body of
// RD::createObject:
// return plain_.createObject(
// std::make_shared<DecoratedHostObject>(*this, std::move(ho)));
// but (a) using the TracingHostObject subtype of
// DecoratedHostObject, and (b) using createFromHostObject, because
// createObject is protected, and is thus inaccessible here.
auto tracer = std::make_shared<TracingHostObject>(*this, ho);
auto obj = jsi::Object::createFromHostObject(plain(), tracer);
tracer->setObjectID(getUniqueID(obj));
trace_.emplace_back<SynthTrace::CreateHostObjectRecord>(
getTimeSinceStart(), getUniqueID(obj));
return obj;
}
jsi::String TracingRuntime::createStringFromAscii(
const char *str,
size_t length) {
jsi::String res = RD::createStringFromAscii(str, length);
trace_.emplace_back<SynthTrace::CreateStringRecord>(
getTimeSinceStart(), getUniqueID(res), str, length);
return res;
};
jsi::String TracingRuntime::createStringFromUtf8(
const uint8_t *utf8,
size_t length) {
jsi::String res = RD::createStringFromUtf8(utf8, length);
trace_.emplace_back<SynthTrace::CreateStringRecord>(
getTimeSinceStart(), getUniqueID(res), utf8, length);
return res;
};
jsi::PropNameID TracingRuntime::createPropNameIDFromAscii(
const char *str,
size_t length) {
jsi::PropNameID res = RD::createPropNameIDFromAscii(str, length);
trace_.emplace_back<SynthTrace::CreatePropNameIDRecord>(
getTimeSinceStart(), getUniqueID(res), str, length);
return res;
}
jsi::PropNameID TracingRuntime::createPropNameIDFromUtf8(
const uint8_t *utf8,
size_t length) {
jsi::PropNameID res = RD::createPropNameIDFromUtf8(utf8, length);
trace_.emplace_back<SynthTrace::CreatePropNameIDRecord>(
getTimeSinceStart(), getUniqueID(res), utf8, length);
return res;
}
jsi::PropNameID TracingRuntime::createPropNameIDFromString(
const jsi::String &str) {
std::string s = str.utf8(*this);
jsi::PropNameID res = RD::createPropNameIDFromString(str);
trace_.emplace_back<SynthTrace::CreatePropNameIDRecord>(
getTimeSinceStart(), getUniqueID(res), std::move(s), /* isAscii */ false);
return res;
}
jsi::Value TracingRuntime::getProperty(
const jsi::Object &obj,
const jsi::String &name) {
auto value = RD::getProperty(obj, name);
trace_.emplace_back<SynthTrace::GetPropertyRecord>(
getTimeSinceStart(),
getUniqueID(obj),
getUniqueID(name),
#ifdef HERMESVM_API_TRACE_DEBUG
name.utf8(*this),
#endif
toTraceValue(value));
return value;
}
jsi::Value TracingRuntime::getProperty(
const jsi::Object &obj,
const jsi::PropNameID &name) {
auto value = RD::getProperty(obj, name);
trace_.emplace_back<SynthTrace::GetPropertyRecord>(
getTimeSinceStart(),
getUniqueID(obj),
getUniqueID(name),
#ifdef HERMESVM_API_TRACE_DEBUG
name.utf8(*this),
#endif
toTraceValue(value));
return value;
}
bool TracingRuntime::hasProperty(
const jsi::Object &obj,
const jsi::String &name) {
trace_.emplace_back<SynthTrace::HasPropertyRecord>(
getTimeSinceStart(),
getUniqueID(obj),
getUniqueID(name)
#ifdef HERMESVM_API_TRACE_DEBUG
,
name.utf8(*this)
#endif
);
return RD::hasProperty(obj, name);
}
bool TracingRuntime::hasProperty(
const jsi::Object &obj,
const jsi::PropNameID &name) {
trace_.emplace_back<SynthTrace::HasPropertyRecord>(
getTimeSinceStart(),
getUniqueID(obj),
getUniqueID(name)
#ifdef HERMESVM_API_TRACE_DEBUG
,
name.utf8(*this)
#endif
);
return RD::hasProperty(obj, name);
}
void TracingRuntime::setPropertyValue(
jsi::Object &obj,
const jsi::String &name,
const jsi::Value &value) {
trace_.emplace_back<SynthTrace::SetPropertyRecord>(
getTimeSinceStart(),
getUniqueID(obj),
getUniqueID(name),
#ifdef HERMESVM_API_TRACE_DEBUG
name.utf8(*this),
#endif
toTraceValue(value));
RD::setPropertyValue(obj, name, value);
}
void TracingRuntime::setPropertyValue(
jsi::Object &obj,
const jsi::PropNameID &name,
const jsi::Value &value) {
trace_.emplace_back<SynthTrace::SetPropertyRecord>(
getTimeSinceStart(),
getUniqueID(obj),
getUniqueID(name),
#ifdef HERMESVM_API_TRACE_DEBUG
name.utf8(*this),
#endif
toTraceValue(value));
RD::setPropertyValue(obj, name, value);
}
jsi::Array TracingRuntime::getPropertyNames(const jsi::Object &o) {
jsi::Array arr = RD::getPropertyNames(o);
trace_.emplace_back<SynthTrace::GetPropertyNamesRecord>(
getTimeSinceStart(), getUniqueID(o), getUniqueID(arr));
return arr;
}
jsi::WeakObject TracingRuntime::createWeakObject(const jsi::Object &o) {
// WeakObject is not traced for two reasons:
// It has no effect on the correctness of replay:
// Say an object that is created, then a WeakObject created for
// that object. At some point in the future, lockWeakObject is called. At
// that point, either the original object was dead, and lockWeakObject
// returns an undefined value; else, the original object is still alive, and
// it returns the object reference. For an undefined return, there will be no
// further operations on the object, and the replay will delete it. If that
// returned object is then used for some operation such as getProperty, the
// trace will see that and record that the object was alive for at least that
// long. So it doesn't matter that the WeakObject was created at all, the
// lifetime is unaffected.
// lockWeakObject can have a non-deterministic return value:
// Because the return value of lockWeakObject is non-deterministic, there's
// no guarantee that replaying lockWeakObject will have the same return
// value. The GC may have run at different times on replay then it originally
// did. Making this deterministic would require adding the GC schedule to
// synth traces, which might not even be possible for a concurrent GC. So
// tracing lockWeakObject would not guarantee correct replay of WeakObject
// operations.
return RD::createWeakObject(o);
}
jsi::Value TracingRuntime::lockWeakObject(jsi::WeakObject &wo) {
// See comment in TracingRuntime::createWeakObject for why this function isn't
// traced.
return RD::lockWeakObject(wo);
}
jsi::Array TracingRuntime::createArray(size_t length) {
auto arr = RD::createArray(length);
trace_.emplace_back<SynthTrace::CreateArrayRecord>(
getTimeSinceStart(), getUniqueID(arr), length);
return arr;
}
size_t TracingRuntime::size(const jsi::Array &arr) {
// Array size inquiries read from the length property, which is
// non-configurable and thus cannot have side effects.
return RD::size(arr);
}
size_t TracingRuntime::size(const jsi::ArrayBuffer &buf) {
// ArrayBuffer size inquiries read from the byteLength property, which is
// non-configurable and thus cannot have side effects.
return RD::size(buf);
}
uint8_t *TracingRuntime::data(const jsi::ArrayBuffer &buf) {
throw std::logic_error(
"Cannot write raw bytes into an ArrayBuffer in trace mode");
}
jsi::Value TracingRuntime::getValueAtIndex(const jsi::Array &arr, size_t i) {
auto value = RD::getValueAtIndex(arr, i);
trace_.emplace_back<SynthTrace::ArrayReadRecord>(
getTimeSinceStart(), getUniqueID(arr), i, toTraceValue(value));
return value;
}
void TracingRuntime::setValueAtIndexImpl(
jsi::Array &arr,
size_t i,
const jsi::Value &value) {
trace_.emplace_back<SynthTrace::ArrayWriteRecord>(
getTimeSinceStart(), getUniqueID(arr), i, toTraceValue(value));
return RD::setValueAtIndexImpl(arr, i, value);
}
jsi::Function TracingRuntime::createFunctionFromHostFunction(
const jsi::PropNameID &name,
unsigned int paramCount,
jsi::HostFunctionType func) {
class TracingHostFunction : public jsi::DecoratedHostFunction {
public:
using jsi::DecoratedHostFunction::DecoratedHostFunction;
jsi::Value operator()(
jsi::Runtime &rt,
const jsi::Value &thisVal,
const jsi::Value *args,
size_t count) {
TracingRuntime &trt = static_cast<TracingRuntime &>(rt);
trt.trace_.emplace_back<SynthTrace::CallToNativeRecord>(
trt.getTimeSinceStart(),
functionID_,
// A host function does not have a this.
SynthTrace::encodeUndefined(),
trt.argStringifyer(args, count));
try {
auto ret =
jsi::DecoratedHostFunction::operator()(rt, thisVal, args, count);
trt.trace_.emplace_back<SynthTrace::ReturnFromNativeRecord>(
trt.getTimeSinceStart(), trt.toTraceValue(ret));
return ret;
} catch (...) {
// TODO(T28293178): The trace currently has no way to model
// exceptions thrown from C++ code.
::hermes::hermes_fatal(
"Exception happened in native code during trace");
}
}
void setFunctionID(SynthTrace::ObjectID functionID) {
functionID_ = functionID;
}
private:
/// The object id of the function that this is attached to.
SynthTrace::ObjectID functionID_;
};
auto tracer = TracingHostFunction(*this, func);
auto tfunc =
RD::createFunctionFromHostFunction(name, paramCount, std::move(tracer));
const auto funcID = getUniqueID(tfunc);
RD::getHostFunction(tfunc).target<TracingHostFunction>()->setFunctionID(
funcID);
trace_.emplace_back<SynthTrace::CreateHostFunctionRecord>(
getTimeSinceStart(),
funcID,
getUniqueID(name),
#ifdef HERMESVM_API_TRACE_DEBUG
name.utf8(*this),
#endif
paramCount);
return tfunc;
}
jsi::Value TracingRuntime::call(
const jsi::Function &func,
const jsi::Value &jsThis,
const jsi::Value *args,
size_t count) {
trace_.emplace_back<SynthTrace::CallFromNativeRecord>(
getTimeSinceStart(),
getUniqueID(func),
toTraceValue(jsThis),
argStringifyer(args, count));
auto retval = RD::call(func, jsThis, args, count);
trace_.emplace_back<SynthTrace::ReturnToNativeRecord>(
getTimeSinceStart(), toTraceValue(retval));
return retval;
}
jsi::Value TracingRuntime::callAsConstructor(
const jsi::Function &func,
const jsi::Value *args,
size_t count) {
trace_.emplace_back<SynthTrace::ConstructFromNativeRecord>(
getTimeSinceStart(),
getUniqueID(func),
// A construct call always has an undefined this.
// The ReturnToNativeRecord will contain the object that was either
// created by the new keyword, or the objec that's returned from the
// function.
SynthTrace::encodeUndefined(),
argStringifyer(args, count));
auto retval = RD::callAsConstructor(func, args, count);
trace_.emplace_back<SynthTrace::ReturnToNativeRecord>(
getTimeSinceStart(), toTraceValue(retval));
return retval;
}
void TracingRuntime::addMarker(const std::string &marker) {
trace_.emplace_back<SynthTrace::MarkerRecord>(getTimeSinceStart(), marker);
}
std::vector<SynthTrace::TraceValue> TracingRuntime::argStringifyer(
const jsi::Value *args,
size_t count) {
std::vector<SynthTrace::TraceValue> stringifiedArgs;
stringifiedArgs.reserve(count);
for (size_t i = 0; i < count; ++i) {
stringifiedArgs.emplace_back(toTraceValue(args[i]));
}
return stringifiedArgs;
}
SynthTrace::TraceValue TracingRuntime::toTraceValue(const jsi::Value &value) {
if (value.isUndefined()) {
return SynthTrace::encodeUndefined();
} else if (value.isNull()) {
return SynthTrace::encodeNull();
} else if (value.isBool()) {
return SynthTrace::encodeBool(value.getBool());
} else if (value.isNumber()) {
return SynthTrace::encodeNumber(value.getNumber());
} else if (value.isString()) {
return trace_.encodeString(getUniqueID(value.getString(*this)));
} else if (value.isObject()) {
// Get a unique identifier from the object, and use that instead. This is
// so that object identity is tracked.
return SynthTrace::encodeObject(getUniqueID(value.getObject(*this)));
} else {
throw std::logic_error("Unsupported value reached");
}
}
SynthTrace::TimeSinceStart TracingRuntime::getTimeSinceStart() const {
return std::chrono::duration_cast<SynthTrace::TimeSinceStart>(
std::chrono::steady_clock::now() - startTime_);
}
TracingHermesRuntime::TracingHermesRuntime(
std::unique_ptr<HermesRuntime> runtime,
const ::hermes::vm::RuntimeConfig &runtimeConfig,
std::unique_ptr<llvh::raw_ostream> traceStream,
std::function<std::string()> commitAction,
std::function<void()> rollbackAction)
: TracingHermesRuntime(
runtime,
runtime->getUniqueID(runtime->global()),
runtimeConfig,
std::move(traceStream),
std::move(commitAction),
std::move(rollbackAction)) {}
TracingHermesRuntime::~TracingHermesRuntime() {
if (crashCallbackKey_) {
conf_.getCrashMgr()->unregisterCallback(*crashCallbackKey_);
}
if (flushedAndDisabled_) {
// If the trace is not flushed and disabled, flush the trace and
// run rollback action (e.g. delete the in-progress trace)
flushAndDisableTrace();
rollbackAction_();
}
}
TracingHermesRuntime::TracingHermesRuntime(
std::unique_ptr<HermesRuntime> &runtime,
uint64_t globalID,
const ::hermes::vm::RuntimeConfig &runtimeConfig,
std::unique_ptr<llvh::raw_ostream> traceStream,
std::function<std::string()> commitAction,
std::function<void()> rollbackAction)
: TracingRuntime(
std::move(runtime),
globalID,
runtimeConfig,
std::move(traceStream)),
conf_(runtimeConfig),
commitAction_(std::move(commitAction)),
rollbackAction_(std::move(rollbackAction)),
crashCallbackKey_(
conf_.getCrashMgr()
? llvh::Optional<::hermes::vm::CrashManager::CallbackKey>(
conf_.getCrashMgr()->registerCallback(
[this](int fd) { crashCallback(fd); }))
: llvh::None) {}
void TracingHermesRuntime::flushAndDisableTrace() {
(void)flushAndDisableBridgeTrafficTrace();
}
std::string TracingHermesRuntime::flushAndDisableBridgeTrafficTrace() {
if (flushedAndDisabled_) {
return committedTraceFilename_;
}
trace().flushAndDisable(
hermesRuntime().getMockedEnvironment(), hermesRuntime().getGCExecTrace());
flushedAndDisabled_ = true;
committedTraceFilename_ = commitAction_();
return committedTraceFilename_;
}
jsi::Value TracingHermesRuntime::evaluateJavaScript(
const std::shared_ptr<const jsi::Buffer> &buffer,
const std::string &sourceURL) {
return TracingRuntime::evaluateJavaScript(buffer, sourceURL);
}
void TracingHermesRuntime::crashCallback(int fd) {
if (flushedAndDisabled_) {
// The trace is disabled prior to the crash.
// As a result, this trace will likely not re-produce the crash.
return;
}
llvh::raw_fd_ostream jsonStream(fd, false);
::hermes::JSONEmitter json(jsonStream);
json.openDict();
json.emitKeyValue("type", "tracing");
std::string status = "Failed to flush";
try {
flushAndDisableBridgeTrafficTrace();
status = "Completed";
} catch (std::exception &ex) {
::hermes::hermesLog("Hermes", "Failed to flush trace: %s", ex.what());
// suppress; we're in a crash handler
} catch (...) {
// suppress; we're in a crash handler
}
json.emitKeyValue("status", status);
json.emitKeyValue("fileName", committedTraceFilename_);
json.closeDict();
}
namespace {
void addRecordMarker(TracingRuntime &tracingRuntime) {
jsi::Runtime &rt = tracingRuntime.plain();
const char *funcName = "__nativeRecordTraceMarker";
const auto funcProp = jsi::PropNameID::forAscii(tracingRuntime, funcName);
if (tracingRuntime.global().hasProperty(tracingRuntime, funcProp)) {
// If this function is already defined, throw.
throw jsi::JSINativeException(
std::string("global.") + funcName +
" already exists, won't overwrite it");
}
rt.global().setProperty(
tracingRuntime,
funcProp,
jsi::Function::createFromHostFunction(
tracingRuntime,
funcProp,
0,
[funcName, &tracingRuntime](
jsi::Runtime &rt,
const jsi::Value &,
const jsi::Value *args,
size_t argc) -> jsi::Value {
if (argc < 1) {
throw jsi::JSINativeException(
std::string(funcName) + " requires a single string argument");
}
tracingRuntime.addMarker(args[0].asString(rt).utf8(rt));
return jsi::Value::undefined();
}));
}
} // namespace
static std::unique_ptr<TracingHermesRuntime> makeTracingHermesRuntimeImpl(
std::unique_ptr<HermesRuntime> hermesRuntime,
const ::hermes::vm::RuntimeConfig &runtimeConfig,
std::unique_ptr<llvh::raw_ostream> traceStream,
std::function<std::string()> commitAction,
std::function<void()> rollbackAction,
bool forReplay) {
::hermes::hermesLog("Hermes", "Creating TracingHermesRuntime.");
auto ret = std::make_unique<TracingHermesRuntime>(
std::move(hermesRuntime),
runtimeConfig,
std::move(traceStream),
commitAction,
rollbackAction);
// In non-replay executions, add the __nativeRecordTraceMarker function.
// In replay executions, this will be simulated from the trace.
if (!forReplay) {
addRecordMarker(*ret);
}
return ret;
}
std::unique_ptr<TracingHermesRuntime> makeTracingHermesRuntime(
std::unique_ptr<HermesRuntime> hermesRuntime,
const ::hermes::vm::RuntimeConfig &runtimeConfig,
const std::string &traceScratchPath,
const std::string &traceResultPath,
std::function<bool()> traceCompletionCallback) {
std::error_code ec;
std::unique_ptr<llvh::raw_ostream> traceStream =
std::make_unique<llvh::raw_fd_ostream>(
traceScratchPath, ec, llvh::sys::fs::F_Text);
if (ec) {
::hermes::hermesLog(
"Hermes",
"Failed to open file %s for tracing: %s",
traceScratchPath.c_str(),
ec.message().c_str());
return makeTracingHermesRuntime(
std::move(hermesRuntime), runtimeConfig, nullptr, "");
}
return makeTracingHermesRuntimeImpl(
std::move(hermesRuntime),
runtimeConfig,
std::move(traceStream),
[traceCompletionCallback, traceScratchPath, traceResultPath]() {
if (traceScratchPath != traceResultPath) {
std::error_code ec =
llvh::sys::fs::rename(traceScratchPath, traceResultPath);
if (ec) {
::hermes::hermesLog(
"Hermes",
"Failed to rename tracing file from %s to %s: %s",
traceScratchPath.c_str(),
traceResultPath.c_str(),
ec.message().c_str());
return std::string();
}
}
bool success = traceCompletionCallback();
if (!success) {
::hermes::hermesLog(
"Hermes",
"Failed to invoke completion callback for tracing file %s",
traceResultPath.c_str());
return std::string();
}
::hermes::hermesLog(
"Hermes", "Completed tracing file at %s", traceResultPath.c_str());
return traceResultPath;
},
[traceScratchPath]() {
// Delete the in-progress trace
llvh::sys::fs::remove(traceScratchPath);
},
false);
}
std::unique_ptr<TracingHermesRuntime> makeTracingHermesRuntime(
std::unique_ptr<HermesRuntime> hermesRuntime,
const ::hermes::vm::RuntimeConfig &runtimeConfig,
std::unique_ptr<llvh::raw_ostream> traceStream,
bool forReplay) {
return makeTracingHermesRuntimeImpl(
std::move(hermesRuntime),
runtimeConfig,
std::move(traceStream),
[]() { return std::string(); },
[]() {},
forReplay);
}
} // namespace tracing
} // namespace hermes
} // namespace facebook
#endif
| [
"facebook-github-bot@users.noreply.github.com"
] | facebook-github-bot@users.noreply.github.com |
f9c2cdb2f59c9c022b922bea0b7cbaa48b63d5ce | 8e0a330a200ef787da914c0dc2d7c4e083d9e165 | /RenderManager.h | 590d6871737cf50779844781f5d9e66a44a1a740 | [] | no_license | OctEats/Pokemon-Go-Bot | 7624a97054785e796d211078473691659ece96d2 | 982182416dcd9399e2d788f4603811236feb58f8 | refs/heads/master | 2021-04-25T16:26:25.973787 | 2018-08-27T02:13:47 | 2018-08-27T02:13:47 | 121,453,793 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,449 | h | #pragma once
#include "Interfaces.h"
#include "Vector2D.h"
namespace Render
{
void Initialise();
// Normal Drawing functions
void Clear(int x, int y, int w, int h, Color color);
void Outline(int x, int y, int w, int h, Color color);
void Line(int x, int y, int x2, int y2, Color color);
void PolyLine(int *x, int *y, int count, Color color);
void GradientHDarker(int x, int y, int w, int h, Color c1, Color c2);
void Polygon(int count, Vertex_t* Vertexs, Color color);
void PolygonOutline(int count, Vertex_t* Vertexs, Color color, Color colorLine);
void PolyLine(int count, Vertex_t* Vertexs, Color colorLine);
// Gradient Functions
void GradientV(int x, int y, int w, int h, Color c1, Color c2);
void GradientH(int x, int y, int w, int h, Color c1, Color c2);
void LoopedBrick(int x, int y, int w, int h, Color c1, Color c2);
// Text functions
namespace Fonts
{
extern DWORD Default;
extern DWORD Menu;
extern DWORD MenuBold;
extern DWORD ESP;
extern DWORD MenuText;
extern DWORD TabIcon;
};
void Text(int x, int y, Color color, DWORD font, const char* text);
void Textf(int x, int y, Color color, DWORD font, const char* fmt, ...);
void Text(int x, int y, Color color, DWORD font, const wchar_t* text);
RECT get_text_size(const char * _Input, int font);
RECT GetTextSize(DWORD font, const char* text);
// Other rendering functions
bool WorldToScreen(Vector &in, Vector &out);
RECT GetViewport();
};
| [
"36461849+OctEats@users.noreply.github.com"
] | 36461849+OctEats@users.noreply.github.com |
3bcf0475f6b07d1b5a18e217aaf246c57e466641 | 5d8c71b1b580517fb807efdfd673a46944b9957b | /znIntfs/Application.h | 6fdd0087bbda92488d1a53a0f65e773bb5fedeef | [] | no_license | bmjoy/ZenonEngine | abe2c4c47d1930f343dadcaed7d3c360660aa1bf | c7d1564246157abfa84b7028817bedff6993693b | refs/heads/master | 2020-05-23T03:12:21.586899 | 2019-04-22T10:52:31 | 2019-04-22T10:52:31 | 186,611,748 | 1 | 1 | null | 2019-05-14T11:51:37 | 2019-05-14T11:51:37 | null | UTF-8 | C++ | false | false | 752 | h | #pragma once
// Forward BEGIN
class IRenderDevice;
class RenderWindow;
class CLoader;
// Forward END
struct IApplication
{
virtual ~IApplication() = 0 {};
virtual void DoBeforeRun() = 0;
virtual int DoRun() = 0;
virtual void DoAfterRun() = 0;
virtual std::shared_ptr<IRenderDevice> GetRenderDevice() const = 0;
virtual void SetRenderDevice(std::shared_ptr<IRenderDevice> RenderDevice) = 0;
virtual std::shared_ptr<RenderWindow> GetRenderWindow() const = 0;
virtual void SetRenderWindow(std::shared_ptr<RenderWindow> RenderDevice) = 0;
virtual CLoader* GetLoader() = 0;
};
| [
"alexstenfard@gmail.com"
] | alexstenfard@gmail.com |
fca382a2e754faa7e481cb318a38875a1c0ccf8c | db4fbf3f7456c0dd9fafd0cfe9a017c6042d37f7 | /Hmwk/Review2_V2/main.cpp | 17c57576278714a1bb4b40c9909fc2406bb8faf3 | [] | no_license | Joseph-Scuiletti/Joseph_Scuiletti_CIS17C_42345 | 9e6b03f492bc20444c002776bf7ec656d7be58ae | e58edc4c2ea30a5c620590da73ec57478105a8ea | refs/heads/master | 2021-04-18T19:32:21.279385 | 2018-03-22T01:29:49 | 2018-03-22T01:29:49 | 126,261,286 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,346 | cpp | /*
* Author: Adrian Lopez
* Created on February 25, 2018, 8:54 AM
* Purpose: Abstraction, Operator Overloading,
* Copy Construction and Polymorphism
*/
//User Libraries
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <iomanip>
using namespace std;
//User Libraries
#include "PlusTab.h"
//Global Constants
//Function Prototype
void prntTab(const Table &);
//Execution Begins Here!
int main(int argc, char** argv) {
//Initialize the random seed
srand(static_cast<unsigned int>(time(0)));
//Declare Variables
int rows=3,cols=4;
//Test out the Tables
PlusTab tab1(rows,cols);
PlusTab tab2(tab1);
PlusTab tab3=tab1+tab2;
//Print the tables
cout<<"Abstracted and Polymorphic Print Table 1 size is [row,col] = ["
<<rows<<","<<cols<<"]";
prntTab(tab1);
cout<<"Copy Constructed Table 2 size is [row,col] = ["
<<rows<<","<<cols<<"]";
prntTab(tab2);
cout<<"Operator Overloaded Table 3 size is [row,col] = ["
<<rows<<","<<cols<<"]";
prntTab(tab3);
//Exit Stage Right
return 0;
}
void prntTab(const Table &a){
cout<<endl;
for(int row=0;row<a.getSzRow();row++){
for(int col=0;col<a.getSzCol();col++){
cout<<setw(4)<<a.getData(row,col);
}
cout<<endl;
}
cout<<endl;
} | [
"Joseph.Scuiletti@gmail.com"
] | Joseph.Scuiletti@gmail.com |
d8c07282af5fa22b827917f8f974db98cc9e330e | fd2ac550f46299619abdc0af4738ea8a7d414182 | /tictactoe_OnInit.cpp | 6d99f8829512b509a9e14e4e50a12f6ef75310f8 | [] | no_license | sayoder/tictactoe | 1114aa09d7df3b66848230ea2333e8ddc3563d32 | 159e35a0f721a82122d994ffeb35ffc4012abb10 | refs/heads/master | 2021-05-28T06:41:26.132858 | 2012-12-31T18:32:51 | 2012-12-31T18:32:51 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 775 | cpp | #include "tictactoe.h"
#include "CSurface.h"
bool CApp::OnInit()
{
if(SDL_Init(SDL_INIT_EVERYTHING) < 0)
{
return false;
}
if((Surf_Display = SDL_SetVideoMode(600, 600, 32, SDL_HWSURFACE | SDL_DOUBLEBUF)) == NULL)
{
return false;
}
if((Surf_Grid = CSurface::OnLoad((char *)"images/grid.bmp")) == NULL)
{
cout<<"nope1";
return false;
}
if((Surf_X = CSurface::OnLoad((char *)"images/x.bmp")) == NULL)
{
cout<<"nope2";
return false;
}
if((Surf_O = CSurface::OnLoad((char *)"images/o.bmp")) == NULL)
{
cout<<"nope3";
return false;
}
CSurface::Transparent(Surf_X, 255, 0, 255);
CSurface::Transparent(Surf_O, 255, 0, 255);
return true;
}
| [
"seth.a.yoder@gmail.com"
] | seth.a.yoder@gmail.com |
c9321c40025d09b57497476fbe93e5d6ec233638 | a2e3ed314ac40f7054a6aa75d20a85c5e0c761f8 | /functions.cpp | 8a101bf549f2f014eb6471dc776b762bc21308ac | [] | no_license | Sukhov-Dmitriy/TASK1 | aec4e25f14e840a92a0de1ea89ad16f8b6211ebf | 9919100f7eb5dc5ecad032f7c683adee194f40e2 | refs/heads/master | 2022-09-27T21:50:43.329916 | 2020-05-30T11:02:45 | 2020-05-30T11:02:45 | 267,544,112 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,749 | cpp | #include <iostream>
#include <fstream>
#include <string>
#include "functions.h"
using namespace std;
CRat *CreateData(ifstream &input, CRatFactory** f){
int I;
int d = 2;
string filename;
CRat *rat = NULL;
input >> I;
input >> filename;
input >> d;
rat = f[I]->create_dat(d);
for(int j = 0; j < d*2; j++){
input >> rat->data[j];
if(j%2 == 1 && rat->data[j]== 0){
cout <<"Warning! You try to divide by zero!";
}
}
rat->dim = d;
rat->outfile = filename;
return rat;
}
CRat1 operator + (const CRat &A, const CRat &B){
CRat1 rat(B.dim);
for(int i = 0; i< (B.dim*2);i+=2){
if(B.data[i+1] == A.data[i+1]){
rat.data[i] = A.data[i]+B.data[i];
rat.data[i+1] = A.data[i+1];
}
else{
rat.data[i] = ((A.data[i])*(B.data[i+1]))+((B.data[i])*(A.data[i+1]));
rat.data[i+1] = A.data[i+1]*B.data[i+1];
}
}
rat.dim = B.dim;
return rat;
}
CRat1 operator - (const CRat &A, const CRat &B){
CRat1 rat(B.dim);
for(int i = 0; i< (B.dim*2);i+=2){
if(B.data[i+1] == A.data[i+1]){
rat.data[i] = A.data[i]+B.data[i];
rat.data[i+1] = A.data[i+1];
}
else{
rat.data[i] = ((A.data[i])*(B.data[i+1]))+((B.data[i])*(A.data[i+1]));
rat.data[i+1] = A.data[i+1]*B.data[i+1];
}
}
rat.dim = B.dim;
return rat;
}
void test1(){//оператор присваивания
CRat0 k(2);
for(int i = 0; i < 4; i++)
k.data[i] = i;
CRat0 p(2);
p = k;
k.data[1] = 20;
if(p.data[1] == 1){
cout<< "Test 1 passed saccessfully"<<endl;
}
}
void test2(){// оператор сложения
CRat0 k(2);
CRat1 l(2);
for(int i = 0; i < k.dim*2; i++){
k.data[i] = i+1;
l.data[i] = i+2;
}
CRat1 p(2);
p = k + l;
p.show();
if(p.data[2] == 31 && p.data[3] == 20){
cout<< "Test 2 passed saccessfully"<<endl;
}
}
void test3(){// оператор скалярного умножения
CRat1 k(2);
double p = 0;
for(int i = 0; i < 4; i++)
k.data[i] = i+1;
k.data[2] = 4;
p = k*k;
if(p == 1.25){
cout<< "Test 3 passed saccessfully"<<endl;
}
}
void test4(){//конструктор копирования
CRat0 k(2);
for(int i = 0; i < 4; i++)
k.data[i] = i;
CRat0 p = k;
k.data[1] = 20;
if(p.data[1] == 1){
cout<< "Test 4 passed saccessfully"<<endl;
}
}
| [
"noreply@github.com"
] | Sukhov-Dmitriy.noreply@github.com |
2e88c52ac5528ee87c47d353386b8caa6090a313 | 8cf32b4cbca07bd39341e1d0a29428e420b492a6 | /externals/magic_get/include/boost/pfr/flat/functions_for.hpp | 174fa803f0973e6bf161b67cc6db84787f83ad7f | [
"MIT",
"LicenseRef-scancode-unknown-license-reference",
"BSL-1.0"
] | permissive | cubetrain/CubeTrain | e1cd516d5dbca77082258948d3c7fc70ebd50fdc | b930a3e88e941225c2c54219267f743c790e388f | refs/heads/master | 2020-04-11T23:00:50.245442 | 2018-12-17T16:07:16 | 2018-12-17T16:07:16 | 156,970,178 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,973 | hpp | // Copyright (c) 2016-2017 Antony Polukhin
//
// 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 BOOST_PFR_FLAT_FUNCTIONS_FOR_HPP
#define BOOST_PFR_FLAT_FUNCTIONS_FOR_HPP
#pragma once
#include <boost/pfr/detail/config.hpp>
#include <boost/pfr/flat/functors.hpp>
#include <boost/pfr/flat/io.hpp>
/// \def BOOST_PFR_FLAT_FUNCTIONS_FOR(T)
/// Defines comparison operators and stream operators for T.
/// If POD is comparable or streamable using it's own operator (but not it's conversion operator), then the original operator is used.
///
/// \b Example:
/// \code
/// #include <boost/pfr/flat/functions_for.hpp>
/// struct comparable_struct { // No operators defined for that structure
/// int i; short s; char data[7]; bool bl; int a,b,c,d,e,f;
/// };
/// BOOST_PFR_FLAT_FUNCTIONS_FOR(comparable_struct)
/// // ...
///
/// comparable_struct s1 {0, 1, "Hello", false, 6,7,8,9,10,11};
/// comparable_struct s2 {0, 1, "Hello", false, 6,7,8,9,10,11111};
/// assert(s1 < s2);
/// std::cout << s1 << std::endl; // Outputs: {0, 1, H, e, l, l, o, , , 0, 6, 7, 8, 9, 10, 11}
/// \endcode
///
/// \rcast
///
/// \podops for other ways to define operators and more details.
///
/// \b Defines \b following \b for \b T:
/// \code
/// bool operator==(const T& lhs, const T& rhs) noexcept;
/// bool operator!=(const T& lhs, const T& rhs) noexcept;
/// bool operator< (const T& lhs, const T& rhs) noexcept;
/// bool operator> (const T& lhs, const T& rhs) noexcept;
/// bool operator<=(const T& lhs, const T& rhs) noexcept;
/// bool operator>=(const T& lhs, const T& rhs) noexcept;
///
/// template <class Char, class Traits>
/// std::basic_ostream<Char, Traits>& operator<<(std::basic_ostream<Char, Traits>& out, const T& value);
///
/// template <class Char, class Traits>
/// std::basic_istream<Char, Traits>& operator>>(std::basic_istream<Char, Traits>& in, T& value);
///
/// // helper function for Boost unordered containers and boost::hash<>.
/// std::size_t hash_value(const T& value) noexcept;
/// \endcode
#define BOOST_PFR_FLAT_FUNCTIONS_FOR(T) \
static inline bool operator==(const T& lhs, const T& rhs) noexcept { return ::boost::pfr::flat_equal_to<T>{}(lhs, rhs); } \
static inline bool operator!=(const T& lhs, const T& rhs) noexcept { return ::boost::pfr::flat_not_equal<T>{}(lhs, rhs); } \
static inline bool operator< (const T& lhs, const T& rhs) noexcept { return ::boost::pfr::flat_less<T>{}(lhs, rhs); } \
static inline bool operator> (const T& lhs, const T& rhs) noexcept { return ::boost::pfr::flat_greater<T>{}(lhs, rhs); } \
static inline bool operator<=(const T& lhs, const T& rhs) noexcept { return ::boost::pfr::flat_less_equal<T>{}(lhs, rhs); } \
static inline bool operator>=(const T& lhs, const T& rhs) noexcept { return ::boost::pfr::flat_greater_equal<T>{}(lhs, rhs); } \
template <class Char, class Traits> \
static ::std::basic_ostream<Char, Traits>& operator<<(::std::basic_ostream<Char, Traits>& out, const T& value) { \
::boost::pfr::flat_write(out, value); \
return out; \
} \
template <class Char, class Traits> \
static ::std::basic_istream<Char, Traits>& operator>>(::std::basic_istream<Char, Traits>& in, T& value) { \
::boost::pfr::flat_read(in, value); \
return in; \
} \
static inline std::size_t hash_value(const T& v) noexcept { \
return ::boost::pfr::flat_hash<T>{}(v); \
} \
/**/
#endif // BOOST_PFR_FLAT_FUNCTIONS_FOR_HPP
| [
"1848@shanchain.com"
] | 1848@shanchain.com |
ff017beeab2f158785304b0dffda2af3afa91d44 | 5b7e69802b8075da18dc14b94ea968a4a2a275ad | /DRG-SDK/SDK/DRG_BP_DownedState_classes.hpp | 45a39d789b824d4aea715a369527dc01ac091f96 | [] | no_license | ue4sdk/DRG-SDK | 7effecf98a08282e07d5190467c71b1021732a00 | 15cc1f8507ccab588480528c65b9623390643abd | refs/heads/master | 2022-07-13T15:34:38.499953 | 2019-03-16T19:29:44 | 2019-03-16T19:29:44 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 685 | hpp | #pragma once
// Deep Rock Galactic (0.22) SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
#include "DRG_BP_DownedState_structs.hpp"
namespace SDK
{
//---------------------------------------------------------------------------
//Classes
//---------------------------------------------------------------------------
// BlueprintGeneratedClass BP_DownedState.BP_DownedState_C
// 0x0000 (0x0148 - 0x0148)
class UBP_DownedState_C : public UDownedStateComponent
{
public:
static UClass* StaticClass()
{
static auto ptr = UObject::FindObject<UClass>("BlueprintGeneratedClass BP_DownedState.BP_DownedState_C");
return ptr;
}
};
}
#ifdef _MSC_VER
#pragma pack(pop)
#endif
| [
"igromanru@yahoo.de"
] | igromanru@yahoo.de |
d13f7ee5a8f0e6f4a13f0f31df4aca5211a3d605 | 6f368f32d3b57c9c154e1b90bd2771fd382cb969 | /datos/src/Conserje.cpp | c4e491d32a7571eeaced9e2dec9988ba2c8b8f40 | [] | no_license | alexa1999/ciencia1 | 6014ce39f446a16f60f274c886c6126af8d3e021 | 2b85fcad78301775825d3435c87a06a48ce31ffb | refs/heads/master | 2021-01-22T20:35:19.885674 | 2017-06-22T21:02:59 | 2017-06-22T21:02:59 | 85,333,618 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 112 | cpp | #include "Conserje.h"
/*
Conserje::Conserje()
{
//ctor
}
Conserje::~Conserje()
{
//dtor
}*/
| [
"noreply@github.com"
] | alexa1999.noreply@github.com |
3cd2bf0a15b092ba6c121b320591cde7ca4b3d4c | 18a3f93e4b94f4f24ff17280c2820497e019b3db | /geant4/G4OpticalPhoton.hh | 5c0993c8d561a386e082875fbc54cac38e996fef | [] | no_license | jjzhang166/BOSS_ExternalLibs | 0e381d8420cea17e549d5cae5b04a216fc8a01d7 | 9b3b30f7874ed00a582aa9526c23ca89678bf796 | refs/heads/master | 2023-03-15T22:24:21.249109 | 2020-11-22T15:11:45 | 2020-11-22T15:11:45 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,873 | hh | //
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4OpticalPhoton.hh,v 1.12 2006/06/29 19:14:41 gunter Exp $
// GEANT4 tag $Name: geant4-09-03-patch-01 $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
// History: first implementation, based on object model of
// 4-th April 1996, G.Cosmo
// ****************************************************************
// New impelemenataion as an utility class H.Kurashige, 14 July 2004
// ----------------------------------------------------------------
#ifndef G4OpticalPhoton_h
#define G4OpticalPhoton_h 1
#include "globals.hh"
#include "G4ios.hh"
#include "G4ParticleDefinition.hh"
// ######################################################################
// ### OPTICAL PHOTON ###
// ######################################################################
class G4OpticalPhoton : public G4ParticleDefinition
{
private:
static G4OpticalPhoton* theInstance;
private:
G4OpticalPhoton () {}
public:
~G4OpticalPhoton (){}
static G4OpticalPhoton* Definition();
static G4OpticalPhoton* OpticalPhotonDefinition();
static G4OpticalPhoton* OpticalPhoton();
};
#endif
| [
"r.e.deboer@students.uu.nl"
] | r.e.deboer@students.uu.nl |
d9d2558ce9687921194972b2cd0892d0b38b6b8a | 6217d4f626845b0aed65d470f572faff6977e4fd | /汇编/014_无符号数条件转移指令JB JNAE JC(小于)/014_无符号数条件转移指令JB JNAE JC(小于).cpp | c44906658ace9082bc6fae8787580d783f7a0476 | [] | no_license | JohnGoods/assembly | 93ded89e542d2653a0d720b84d61e6ef71df2295 | 2cfc0aff4218202c643eb05edb9eecb7690103ad | refs/heads/master | 2021-09-03T10:55:39.324024 | 2018-01-08T13:41:11 | 2018-01-08T13:41:11 | 115,529,349 | 0 | 1 | null | null | null | null | GB18030 | C++ | false | false | 411 | cpp | // 014_无符号数条件转移指令JB JNAE JC(小于).cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
printf("begin\n");
int a = 3, b = -5;
unsigned int a2 = a, b2 = b;
if (a2 >= b2)//无符号的生成JAE JNB 不够减借位
if (a >= b) ///<时不跳转>时跳转带符号的生成JGE JNL指令
{
printf("do if\n");
}
return 0;
}
| [
"469672930@qq.com"
] | 469672930@qq.com |
1bcb31f87a6dbe2e653da6aec776f751ff91cc2e | f798e5955febcbb5e053604dde0056225954e956 | /InterviewBIT/FindPermutation.cpp | b3ef21f5bdcd724816fc6b77ce8f1a003c0dc447 | [] | no_license | atulRanaa/problem-solving-directory | bd129da93f205602fd1b596a80d98ca3c164020f | 3c261a7a57591203d0fb502859a0e388f9b09ae1 | refs/heads/master | 2022-09-02T00:22:02.199595 | 2022-08-22T07:14:56 | 2022-08-22T07:15:41 | 177,447,829 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 489 | cpp | vector<int> Solution::findPerm(const string A, int B) {
vector<int> ans(A.size() + 1);
int len = A.size();
ans[0] = 1;
for(int i=0;i<len;i++) {
if(A[i] == 'D') ans[i+1] = ans[i]-1;
if(A[i] == 'I') ans[i+1] = ans[i]+1;
}
int minEle = *min_element(ans.begin(), ans.end());
if(minEle <= 0) {
for(int i=0;i<len+1;i++) ans[i] += (abs(minEle) + 1);
}
// for(int e: ans) cout << e << " "; cout << "\n";
return ans;
}
| [
"atul.rana@go-mmt.com"
] | atul.rana@go-mmt.com |
ecb1df6c8926f4a4c304fdebc5b7f6ca52c0a93e | f77c4ec541e90cdb6363a399f3076111355ffc36 | /codeforces/round611/c.cpp | 859cc9042155c9333da5536bd738b94c1c0ef8eb | [] | no_license | mattagar6/Programming-Contests | c569dd8be4e8cf57424b0785f5636c028fcd883b | 7a969ac893d10dfb861dae1cdeb536dc3203df77 | refs/heads/master | 2021-06-20T09:19:25.905243 | 2021-06-15T15:44:25 | 2021-06-15T15:44:25 | 219,605,800 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,482 | cpp | #include <bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define nav(...) "[ " << #__VA_ARGS__ ": " << (__VA_ARGS__) << " ] "
using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long long ll;
template<class T> struct rge { T b, e; };
template<class T> rge<T> range(T i, T j) { return rge<T>{i, j}; }
struct debug {
~debug() {cout<<endl;}
template<class T> debug& operator<<(T x) {cout<<boolalpha<<x; return *this;}
template<class B, class C> debug& operator<< (pair<B, C> x){return *this<<"("<<x.first<<", "<<x.second<<")";}
template<class T> debug& operator<<(rge<T> x) {
*this<<"[";for(auto it=x.b;it!=x.e;it++){*this<<", "+2*(it==x.b)<<*it;}return *this<<"]";}
template<class T> debug& operator<<(vector<T> x){ return *this<<range(all(x));}
};
#define MAXN 200123
int f[MAXN];
void solve(void) {
int n;
scanf("%d", &n);
set<int> needs;
vi give;
for(int i = 1; i <= n; i++) {
needs.insert(i);
}
for(int i = 1; i <= n; i++) {
scanf("%d", &f[i]);
if(f[i]) needs.erase(f[i]);
else give.pb(i);
}
for(int x : give) {
if(needs.find(x) != needs.end()) {
auto it = needs.begin();
while(*it == x) it++;
f[x] = *it;
needs.erase(*it);
}
}
for(int i = 1; i <= n; i++) {
if(f[i] == 0) {
f[i] = *needs.begin();
needs.erase(*needs.begin());
}
cout << " " + (i==1) << f[i];
}
puts("");
}
int main(void) {
solve();
return 0;
}
| [
"noreply@github.com"
] | mattagar6.noreply@github.com |
432f6f11762a65aa700650f594873d4e86980b0c | 9c4f48b6e8c71a0989f04bceb3f223a43d031c15 | /moderate/predict_the_number.cpp | 939baaf6c985e5e940f064113316e6913cecce12 | [] | no_license | joeyuan19/CodeEval | c1c696cc7ad4f00e67e788cc6b707fe859aad70d | cf85c8665a6d1b541be7d5aae7d66ce76c32c37b | refs/heads/master | 2020-04-04T22:24:18.680053 | 2018-11-06T03:53:05 | 2018-11-06T03:53:05 | 156,322,997 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 779 | cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <string>
using namespace std;
long long nearestPow2(long long n) {
int c = 0;
while (n > 1) {
n = n >> 1;
c++;
}
n = 1;
for (int i = 0; i < c; i++) {
n = n << 1;
}
return n;
}
char cycle(char c) {
return (c == '0' ? '1' : (c == '1' ? '2' : (c == '2' ? '0' : '#')));
}
void process(string line) {
long long n;
stringstream(line) >> n;
char c = '0';
while (n > 0) {
n = n - nearestPow2(n);
c = cycle(c);
}
cout << c << endl;
}
int main(int argc, char *argv[]) {
ifstream f (argv[1]);
string line;
long long n;
while (getline(f,line)) {
process(line);
}
f.close();
return 0;
}
| [
"joe.yuan19@gmail.com"
] | joe.yuan19@gmail.com |
118e64ef7216ba09729a06ed6dc3c617587e5788 | af757d873c431a899438f66220027ae4f10c59e6 | /node_modules/marionette-client/node_modules/sockit-to-me/externals/v8/src/factory.h | cde84325dcf755c059618672157427a97dc97c7e | [
"bzip2-1.0.6",
"BSD-3-Clause",
"Apache-2.0"
] | permissive | a-os/gaia-node-modules | fb57372d1b2b0dc1ae6e0cb650b0c3ef9f69d74b | 43c434626a862bc092f825175bc88d11988c4d6a | refs/heads/master | 2021-01-22T00:51:10.683335 | 2015-07-03T23:02:03 | 2015-07-03T23:02:37 | 38,414,532 | 0 | 0 | null | 2015-07-02T06:06:26 | 2015-07-02T06:06:26 | null | UTF-8 | C++ | false | false | 22,284 | h | // Copyright 2012 the V8 project authors. 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 Google 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.
#ifndef V8_FACTORY_H_
#define V8_FACTORY_H_
#include "globals.h"
#include "handles.h"
#include "heap.h"
namespace v8 {
namespace internal {
// Interface for handle based allocation.
class Factory {
public:
// Allocate a new boxed value.
Handle<Box> NewBox(
Handle<Object> value,
PretenureFlag pretenure = NOT_TENURED);
// Allocate a new uninitialized fixed array.
Handle<FixedArray> NewFixedArray(
int size,
PretenureFlag pretenure = NOT_TENURED);
// Allocate a new fixed array with non-existing entries (the hole).
Handle<FixedArray> NewFixedArrayWithHoles(
int size,
PretenureFlag pretenure = NOT_TENURED);
// Allocate a new uninitialized fixed double array.
Handle<FixedDoubleArray> NewFixedDoubleArray(
int size,
PretenureFlag pretenure = NOT_TENURED);
Handle<SeededNumberDictionary> NewSeededNumberDictionary(
int at_least_space_for);
Handle<UnseededNumberDictionary> NewUnseededNumberDictionary(
int at_least_space_for);
Handle<NameDictionary> NewNameDictionary(int at_least_space_for);
Handle<ObjectHashSet> NewObjectHashSet(int at_least_space_for);
Handle<ObjectHashTable> NewObjectHashTable(int at_least_space_for);
Handle<DescriptorArray> NewDescriptorArray(int number_of_descriptors,
int slack = 0);
Handle<DeoptimizationInputData> NewDeoptimizationInputData(
int deopt_entry_count,
PretenureFlag pretenure);
Handle<DeoptimizationOutputData> NewDeoptimizationOutputData(
int deopt_entry_count,
PretenureFlag pretenure);
// Allocates a pre-tenured empty AccessorPair.
Handle<AccessorPair> NewAccessorPair();
Handle<TypeFeedbackInfo> NewTypeFeedbackInfo();
Handle<String> InternalizeUtf8String(Vector<const char> str);
Handle<String> InternalizeUtf8String(const char* str) {
return InternalizeUtf8String(CStrVector(str));
}
Handle<String> InternalizeString(Handle<String> str);
Handle<String> InternalizeOneByteString(Vector<const uint8_t> str);
Handle<String> InternalizeOneByteString(Handle<SeqOneByteString>,
int from,
int length);
Handle<String> InternalizeTwoByteString(Vector<const uc16> str);
// String creation functions. Most of the string creation functions take
// a Heap::PretenureFlag argument to optionally request that they be
// allocated in the old generation. The pretenure flag defaults to
// DONT_TENURE.
//
// Creates a new String object. There are two String encodings: ASCII and
// two byte. One should choose between the three string factory functions
// based on the encoding of the string buffer that the string is
// initialized from.
// - ...FromAscii initializes the string from a buffer that is ASCII
// encoded (it does not check that the buffer is ASCII encoded) and
// the result will be ASCII encoded.
// - ...FromUtf8 initializes the string from a buffer that is UTF-8
// encoded. If the characters are all single-byte characters, the
// result will be ASCII encoded, otherwise it will converted to two
// byte.
// - ...FromTwoByte initializes the string from a buffer that is two
// byte encoded. If the characters are all single-byte characters,
// the result will be converted to ASCII, otherwise it will be left as
// two byte.
//
// ASCII strings are pretenured when used as keys in the SourceCodeCache.
Handle<String> NewStringFromOneByte(
Vector<const uint8_t> str,
PretenureFlag pretenure = NOT_TENURED);
// TODO(dcarney): remove this function.
inline Handle<String> NewStringFromAscii(
Vector<const char> str,
PretenureFlag pretenure = NOT_TENURED) {
return NewStringFromOneByte(Vector<const uint8_t>::cast(str), pretenure);
}
// UTF8 strings are pretenured when used for regexp literal patterns and
// flags in the parser.
Handle<String> NewStringFromUtf8(
Vector<const char> str,
PretenureFlag pretenure = NOT_TENURED);
Handle<String> NewStringFromTwoByte(
Vector<const uc16> str,
PretenureFlag pretenure = NOT_TENURED);
// Allocates and partially initializes an ASCII or TwoByte String. The
// characters of the string are uninitialized. Currently used in regexp code
// only, where they are pretenured.
Handle<SeqOneByteString> NewRawOneByteString(
int length,
PretenureFlag pretenure = NOT_TENURED);
Handle<SeqTwoByteString> NewRawTwoByteString(
int length,
PretenureFlag pretenure = NOT_TENURED);
// Create a new cons string object which consists of a pair of strings.
Handle<String> NewConsString(Handle<String> first,
Handle<String> second);
// Create a new string object which holds a substring of a string.
Handle<String> NewSubString(Handle<String> str,
int begin,
int end);
// Create a new string object which holds a proper substring of a string.
Handle<String> NewProperSubString(Handle<String> str,
int begin,
int end);
// Creates a new external String object. There are two String encodings
// in the system: ASCII and two byte. Unlike other String types, it does
// not make sense to have a UTF-8 factory function for external strings,
// because we cannot change the underlying buffer.
Handle<String> NewExternalStringFromAscii(
const ExternalAsciiString::Resource* resource);
Handle<String> NewExternalStringFromTwoByte(
const ExternalTwoByteString::Resource* resource);
// Create a symbol.
Handle<Symbol> NewSymbol();
// Create a global (but otherwise uninitialized) context.
Handle<Context> NewNativeContext();
// Create a global context.
Handle<Context> NewGlobalContext(Handle<JSFunction> function,
Handle<ScopeInfo> scope_info);
// Create a module context.
Handle<Context> NewModuleContext(Handle<ScopeInfo> scope_info);
// Create a function context.
Handle<Context> NewFunctionContext(int length, Handle<JSFunction> function);
// Create a catch context.
Handle<Context> NewCatchContext(Handle<JSFunction> function,
Handle<Context> previous,
Handle<String> name,
Handle<Object> thrown_object);
// Create a 'with' context.
Handle<Context> NewWithContext(Handle<JSFunction> function,
Handle<Context> previous,
Handle<JSObject> extension);
// Create a block context.
Handle<Context> NewBlockContext(Handle<JSFunction> function,
Handle<Context> previous,
Handle<ScopeInfo> scope_info);
// Return the internalized version of the passed in string.
Handle<String> InternalizedStringFromString(Handle<String> value);
// Allocate a new struct. The struct is pretenured (allocated directly in
// the old generation).
Handle<Struct> NewStruct(InstanceType type);
Handle<DeclaredAccessorDescriptor> NewDeclaredAccessorDescriptor();
Handle<DeclaredAccessorInfo> NewDeclaredAccessorInfo();
Handle<ExecutableAccessorInfo> NewExecutableAccessorInfo();
Handle<Script> NewScript(Handle<String> source);
// Foreign objects are pretenured when allocated by the bootstrapper.
Handle<Foreign> NewForeign(Address addr,
PretenureFlag pretenure = NOT_TENURED);
// Allocate a new foreign object. The foreign is pretenured (allocated
// directly in the old generation).
Handle<Foreign> NewForeign(const AccessorDescriptor* foreign);
Handle<ByteArray> NewByteArray(int length,
PretenureFlag pretenure = NOT_TENURED);
Handle<ExternalArray> NewExternalArray(
int length,
ExternalArrayType array_type,
void* external_pointer,
PretenureFlag pretenure = NOT_TENURED);
Handle<Cell> NewCell(Handle<Object> value);
Handle<PropertyCell> NewPropertyCell(Handle<Object> value);
Handle<Map> NewMap(
InstanceType type,
int instance_size,
ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND);
Handle<JSObject> NewFunctionPrototype(Handle<JSFunction> function);
Handle<Map> CopyWithPreallocatedFieldDescriptors(Handle<Map> map);
// Copy the map adding more inobject properties if possible without
// overflowing the instance size.
Handle<Map> CopyMap(Handle<Map> map, int extra_inobject_props);
Handle<Map> CopyMap(Handle<Map> map);
Handle<Map> GetElementsTransitionMap(Handle<JSObject> object,
ElementsKind elements_kind);
Handle<FixedArray> CopyFixedArray(Handle<FixedArray> array);
Handle<FixedArray> CopySizeFixedArray(Handle<FixedArray> array,
int new_length);
Handle<FixedDoubleArray> CopyFixedDoubleArray(
Handle<FixedDoubleArray> array);
// Numbers (e.g. literals) are pretenured by the parser.
Handle<Object> NewNumber(double value,
PretenureFlag pretenure = NOT_TENURED);
Handle<Object> NewNumberFromInt(int32_t value,
PretenureFlag pretenure = NOT_TENURED);
Handle<Object> NewNumberFromUint(uint32_t value,
PretenureFlag pretenure = NOT_TENURED);
inline Handle<Object> NewNumberFromSize(size_t value,
PretenureFlag pretenure = NOT_TENURED);
Handle<HeapNumber> NewHeapNumber(double value,
PretenureFlag pretenure = NOT_TENURED);
// These objects are used by the api to create env-independent data
// structures in the heap.
Handle<JSObject> NewNeanderObject();
Handle<JSObject> NewArgumentsObject(Handle<Object> callee, int length);
// JS objects are pretenured when allocated by the bootstrapper and
// runtime.
Handle<JSObject> NewJSObject(Handle<JSFunction> constructor,
PretenureFlag pretenure = NOT_TENURED);
// Global objects are pretenured.
Handle<GlobalObject> NewGlobalObject(Handle<JSFunction> constructor);
// JS objects are pretenured when allocated by the bootstrapper and
// runtime.
Handle<JSObject> NewJSObjectFromMap(Handle<Map> map,
PretenureFlag pretenure = NOT_TENURED);
// JS modules are pretenured.
Handle<JSModule> NewJSModule(Handle<Context> context,
Handle<ScopeInfo> scope_info);
// JS arrays are pretenured when allocated by the parser.
Handle<JSArray> NewJSArray(
int capacity,
ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND,
PretenureFlag pretenure = NOT_TENURED);
Handle<JSArray> NewJSArrayWithElements(
Handle<FixedArrayBase> elements,
ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND,
PretenureFlag pretenure = NOT_TENURED);
void SetElementsCapacityAndLength(Handle<JSArray> array,
int capacity,
int length);
void SetContent(Handle<JSArray> array, Handle<FixedArrayBase> elements);
void EnsureCanContainHeapObjectElements(Handle<JSArray> array);
void EnsureCanContainElements(Handle<JSArray> array,
Handle<FixedArrayBase> elements,
uint32_t length,
EnsureElementsMode mode);
Handle<JSArrayBuffer> NewJSArrayBuffer();
Handle<JSTypedArray> NewJSTypedArray(ExternalArrayType type);
Handle<JSProxy> NewJSProxy(Handle<Object> handler, Handle<Object> prototype);
// Change the type of the argument into a JS object/function and reinitialize.
void BecomeJSObject(Handle<JSReceiver> object);
void BecomeJSFunction(Handle<JSReceiver> object);
void SetIdentityHash(Handle<JSObject> object, Smi* hash);
Handle<JSFunction> NewFunction(Handle<String> name,
Handle<Object> prototype);
Handle<JSFunction> NewFunctionWithoutPrototype(
Handle<String> name,
LanguageMode language_mode);
Handle<JSFunction> NewFunction(Handle<Object> super, bool is_global);
Handle<JSFunction> BaseNewFunctionFromSharedFunctionInfo(
Handle<SharedFunctionInfo> function_info,
Handle<Map> function_map,
PretenureFlag pretenure);
Handle<JSFunction> NewFunctionFromSharedFunctionInfo(
Handle<SharedFunctionInfo> function_info,
Handle<Context> context,
PretenureFlag pretenure = TENURED);
Handle<ScopeInfo> NewScopeInfo(int length);
Handle<JSObject> NewExternal(void* value);
Handle<Code> NewCode(const CodeDesc& desc,
Code::Flags flags,
Handle<Object> self_reference,
bool immovable = false,
bool crankshafted = false);
Handle<Code> CopyCode(Handle<Code> code);
Handle<Code> CopyCode(Handle<Code> code, Vector<byte> reloc_info);
Handle<Object> ToObject(Handle<Object> object);
Handle<Object> ToObject(Handle<Object> object,
Handle<Context> native_context);
// Interface for creating error objects.
Handle<Object> NewError(const char* maker, const char* message,
Handle<JSArray> args);
Handle<String> EmergencyNewError(const char* message, Handle<JSArray> args);
Handle<Object> NewError(const char* maker, const char* message,
Vector< Handle<Object> > args);
Handle<Object> NewError(const char* message,
Vector< Handle<Object> > args);
Handle<Object> NewError(Handle<String> message);
Handle<Object> NewError(const char* constructor,
Handle<String> message);
Handle<Object> NewTypeError(const char* message,
Vector< Handle<Object> > args);
Handle<Object> NewTypeError(Handle<String> message);
Handle<Object> NewRangeError(const char* message,
Vector< Handle<Object> > args);
Handle<Object> NewRangeError(Handle<String> message);
Handle<Object> NewSyntaxError(const char* message, Handle<JSArray> args);
Handle<Object> NewSyntaxError(Handle<String> message);
Handle<Object> NewReferenceError(const char* message,
Vector< Handle<Object> > args);
Handle<Object> NewReferenceError(Handle<String> message);
Handle<Object> NewEvalError(const char* message,
Vector< Handle<Object> > args);
Handle<JSFunction> NewFunction(Handle<String> name,
InstanceType type,
int instance_size,
Handle<Code> code,
bool force_initial_map);
Handle<JSFunction> NewFunction(Handle<Map> function_map,
Handle<SharedFunctionInfo> shared, Handle<Object> prototype);
Handle<JSFunction> NewFunctionWithPrototype(Handle<String> name,
InstanceType type,
int instance_size,
Handle<JSObject> prototype,
Handle<Code> code,
bool force_initial_map);
Handle<JSFunction> NewFunctionWithoutPrototype(Handle<String> name,
Handle<Code> code);
Handle<String> NumberToString(Handle<Object> number);
Handle<String> Uint32ToString(uint32_t value);
enum ApiInstanceType {
JavaScriptObject,
InnerGlobalObject,
OuterGlobalObject
};
Handle<JSFunction> CreateApiFunction(
Handle<FunctionTemplateInfo> data,
ApiInstanceType type = JavaScriptObject);
Handle<JSFunction> InstallMembers(Handle<JSFunction> function);
// Installs interceptors on the instance. 'desc' is a function template,
// and instance is an object instance created by the function of this
// function template.
void ConfigureInstance(Handle<FunctionTemplateInfo> desc,
Handle<JSObject> instance,
bool* pending_exception);
#define ROOT_ACCESSOR(type, name, camel_name) \
inline Handle<type> name() { \
return Handle<type>(BitCast<type**>( \
&isolate()->heap()->roots_[Heap::k##camel_name##RootIndex])); \
}
ROOT_LIST(ROOT_ACCESSOR)
#undef ROOT_ACCESSOR_ACCESSOR
#define STRING_ACCESSOR(name, str) \
inline Handle<String> name() { \
return Handle<String>(BitCast<String**>( \
&isolate()->heap()->roots_[Heap::k##name##RootIndex])); \
}
INTERNALIZED_STRING_LIST(STRING_ACCESSOR)
#undef STRING_ACCESSOR
Handle<String> hidden_string() {
return Handle<String>(&isolate()->heap()->hidden_string_);
}
Handle<SharedFunctionInfo> NewSharedFunctionInfo(
Handle<String> name,
int number_of_literals,
bool is_generator,
Handle<Code> code,
Handle<ScopeInfo> scope_info);
Handle<SharedFunctionInfo> NewSharedFunctionInfo(Handle<String> name);
Handle<JSMessageObject> NewJSMessageObject(
Handle<String> type,
Handle<JSArray> arguments,
int start_position,
int end_position,
Handle<Object> script,
Handle<Object> stack_trace,
Handle<Object> stack_frames);
Handle<SeededNumberDictionary> DictionaryAtNumberPut(
Handle<SeededNumberDictionary>,
uint32_t key,
Handle<Object> value);
Handle<UnseededNumberDictionary> DictionaryAtNumberPut(
Handle<UnseededNumberDictionary>,
uint32_t key,
Handle<Object> value);
#ifdef ENABLE_DEBUGGER_SUPPORT
Handle<DebugInfo> NewDebugInfo(Handle<SharedFunctionInfo> shared);
#endif
// Return a map using the map cache in the native context.
// The key the an ordered set of property names.
Handle<Map> ObjectLiteralMapFromCache(Handle<Context> context,
Handle<FixedArray> keys);
// Creates a new FixedArray that holds the data associated with the
// atom regexp and stores it in the regexp.
void SetRegExpAtomData(Handle<JSRegExp> regexp,
JSRegExp::Type type,
Handle<String> source,
JSRegExp::Flags flags,
Handle<Object> match_pattern);
// Creates a new FixedArray that holds the data associated with the
// irregexp regexp and stores it in the regexp.
void SetRegExpIrregexpData(Handle<JSRegExp> regexp,
JSRegExp::Type type,
Handle<String> source,
JSRegExp::Flags flags,
int capture_count);
// Returns the value for a known global constant (a property of the global
// object which is neither configurable nor writable) like 'undefined'.
// Returns a null handle when the given name is unknown.
Handle<Object> GlobalConstantFor(Handle<String> name);
// Converts the given boolean condition to JavaScript boolean value.
Handle<Object> ToBoolean(bool value);
private:
Isolate* isolate() { return reinterpret_cast<Isolate*>(this); }
Handle<JSFunction> NewFunctionHelper(Handle<String> name,
Handle<Object> prototype);
Handle<JSFunction> NewFunctionWithoutPrototypeHelper(
Handle<String> name,
LanguageMode language_mode);
// Create a new map cache.
Handle<MapCache> NewMapCache(int at_least_space_for);
// Update the map cache in the native context with (keys, map)
Handle<MapCache> AddToMapCache(Handle<Context> context,
Handle<FixedArray> keys,
Handle<Map> map);
};
Handle<Object> Factory::NewNumberFromSize(size_t value,
PretenureFlag pretenure) {
if (Smi::IsValid(static_cast<intptr_t>(value))) {
return Handle<Object>(Smi::FromIntptr(static_cast<intptr_t>(value)),
isolate());
} else {
return NewNumber(static_cast<double>(value), pretenure);
}
}
} } // namespace v8::internal
#endif // V8_FACTORY_H_
| [
"gaye@mozilla.com"
] | gaye@mozilla.com |
4613bfa134638d7351009095aed61ba0a0a90c0c | c075cfe521103977789d600b61ad05b605f4fb10 | /тренировка2/ZAD_K.cpp | d90d489723bf96847ab4533f94908cf96541e64b | [] | no_license | igoroogle/codeforces | dd3c99b6a5ceb19d7d9495b370d4b2ef8949f534 | 579cd1d2aa30a0b0b4cc61d104a02499c69ac152 | refs/heads/master | 2020-07-20T12:37:07.225539 | 2019-09-05T19:21:27 | 2019-09-05T19:35:26 | 206,639,451 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,717 | cpp | #include "bits/stdc++.h"
using namespace std;
#define x first
#define y second
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(), (a).end()
#define sz(a) int((a).size())
#define sqr(a) ((a) * (a))
#define forn(i, n) for (int i = 0; i < int(n); i++)
typedef unsigned int unt;
typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef double geom;
const ll MOD = 457839487523;
const ll P = 768477;
const int INF = 2e9;
const long long INF64 = 9e18;
const long double EPS = 1e-9;
const long double PI = 3.14159265358979310000;
const int N = 300001;
const int M = 12001;
ll hashes[300010], uhashes[300010], pw[300010];
string s, us;
int main()
{
freopen("ragnarok.in", "r", stdin);
freopen("ragnarok.out", "w", stdout);
ll n, i, val1, val2;
getline(cin, s);
n = s.length();
us = s;
reverse(us.begin(), us.end());
pw[0] = 1;
for (i = 1; i <= n; i++)
pw[i] = (pw[i - 1] * P) % MOD;
hashes[0] = ll(s[0] - 'a' + 1);
uhashes[0] = ll(us[0] - 'a' + 1);
for (i = 1; i < n; i++)
hashes[i] = (hashes[i - 1] + pw[i] * ll(s[i] - 'a' + 1)) % MOD;
for (i = 1; i < n; i++)
uhashes[i] = (uhashes[i - 1] + pw[i] * ll(us[i] - 'a' + 1)) % MOD;
for (i = 0; i < n; i++)
{
if (i == 0)
val1 = hashes[n - 1];
else
val1 = (hashes[n - 1] + MOD - hashes[i - 1]) % MOD;
val2 = (uhashes[n - i - 1] * pw[i]) % MOD;
if (val1 == val2)
{
if (i == 0)
cout << s << endl;
else
cout << s << us.substr(n - i, i) << endl;
return 0;
}
}
return 0;
}
| [
"160698qnigor98"
] | 160698qnigor98 |
d87a4888edd6fbefefed202f64ddf71d4e9fa76b | c303c76aa21b1d65d00f5a965a2bed6b02f070be | /src/wasm/baseline/x64/liftoff-assembler-x64.h | 4628b0f7edc8e4461cf45b8ef318752856d82902 | [
"bzip2-1.0.6",
"SunPro",
"BSD-3-Clause"
] | permissive | andrew-cc-chen/v8 | 6339353959bcb582924b6437813167a59503a6ca | fddcf5a67538c73996518de6b7160b0a412947a1 | refs/heads/master | 2020-03-24T05:25:48.439227 | 2018-07-26T16:44:20 | 2018-07-26T17:28:50 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 48,587 | h | // Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_WASM_BASELINE_X64_LIFTOFF_ASSEMBLER_X64_H_
#define V8_WASM_BASELINE_X64_LIFTOFF_ASSEMBLER_X64_H_
#include "src/wasm/baseline/liftoff-assembler.h"
#include "src/assembler.h"
#include "src/wasm/value-type.h"
namespace v8 {
namespace internal {
namespace wasm {
#define REQUIRE_CPU_FEATURE(name, ...) \
if (!CpuFeatures::IsSupported(name)) { \
bailout("no " #name); \
return __VA_ARGS__; \
} \
CpuFeatureScope feature(this, name);
namespace liftoff {
static_assert((kLiftoffAssemblerGpCacheRegs &
Register::ListOf<kScratchRegister>()) == 0,
"scratch register must not be used as cache registers");
constexpr DoubleRegister kScratchDoubleReg2 = xmm14;
static_assert(kScratchDoubleReg != kScratchDoubleReg2, "collision");
static_assert(
(kLiftoffAssemblerFpCacheRegs &
DoubleRegister::ListOf<kScratchDoubleReg, kScratchDoubleReg2>()) == 0,
"scratch registers must not be used as cache registers");
// rbp-8 holds the stack marker, rbp-16 is the instance parameter, first stack
// slot is located at rbp-24.
constexpr int32_t kConstantStackSpace = 16;
constexpr int32_t kFirstStackSlotOffset =
kConstantStackSpace + LiftoffAssembler::kStackSlotSize;
inline Operand GetStackSlot(uint32_t index) {
int32_t offset = index * LiftoffAssembler::kStackSlotSize;
return Operand(rbp, -kFirstStackSlotOffset - offset);
}
// TODO(clemensh): Make this a constexpr variable once Operand is constexpr.
inline Operand GetInstanceOperand() { return Operand(rbp, -16); }
inline Operand GetMemOp(LiftoffAssembler* assm, Register addr, Register offset,
uint32_t offset_imm, LiftoffRegList pinned) {
// Wasm memory is limited to a size <2GB, so all offsets can be encoded as
// immediate value (in 31 bits, interpreted as signed value).
// If the offset is bigger, we always trap and this code is not reached.
DCHECK(is_uint31(offset_imm));
if (offset == no_reg) return Operand(addr, offset_imm);
return Operand(addr, offset, times_1, offset_imm);
}
inline void Load(LiftoffAssembler* assm, LiftoffRegister dst, Operand src,
ValueType type) {
switch (type) {
case kWasmI32:
assm->movl(dst.gp(), src);
break;
case kWasmI64:
assm->movq(dst.gp(), src);
break;
case kWasmF32:
assm->Movss(dst.fp(), src);
break;
case kWasmF64:
assm->Movsd(dst.fp(), src);
break;
default:
UNREACHABLE();
}
}
inline void Store(LiftoffAssembler* assm, Operand dst, LiftoffRegister src,
ValueType type) {
switch (type) {
case kWasmI32:
assm->movl(dst, src.gp());
break;
case kWasmI64:
assm->movq(dst, src.gp());
break;
case kWasmF32:
assm->Movss(dst, src.fp());
break;
case kWasmF64:
assm->Movsd(dst, src.fp());
break;
default:
UNREACHABLE();
}
}
inline void push(LiftoffAssembler* assm, LiftoffRegister reg, ValueType type) {
switch (type) {
case kWasmI32:
case kWasmI64:
assm->pushq(reg.gp());
break;
case kWasmF32:
assm->subp(rsp, Immediate(kPointerSize));
assm->Movss(Operand(rsp, 0), reg.fp());
break;
case kWasmF64:
assm->subp(rsp, Immediate(kPointerSize));
assm->Movsd(Operand(rsp, 0), reg.fp());
break;
default:
UNREACHABLE();
}
}
template <typename... Regs>
inline void SpillRegisters(LiftoffAssembler* assm, Regs... regs) {
for (LiftoffRegister r : {LiftoffRegister(regs)...}) {
if (assm->cache_state()->is_used(r)) assm->SpillRegister(r);
}
}
} // namespace liftoff
int LiftoffAssembler::PrepareStackFrame() {
int offset = pc_offset();
sub_sp_32(0);
return offset;
}
void LiftoffAssembler::PatchPrepareStackFrame(int offset,
uint32_t stack_slots) {
uint32_t bytes = liftoff::kConstantStackSpace + kStackSlotSize * stack_slots;
DCHECK_LE(bytes, kMaxInt);
// We can't run out of space, just pass anything big enough to not cause the
// assembler to try to grow the buffer.
constexpr int kAvailableSpace = 64;
Assembler patching_assembler(AssemblerOptions{}, buffer_ + offset,
kAvailableSpace);
patching_assembler.sub_sp_32(bytes);
}
void LiftoffAssembler::FinishCode() {}
void LiftoffAssembler::AbortCompilation() {}
void LiftoffAssembler::LoadConstant(LiftoffRegister reg, WasmValue value,
RelocInfo::Mode rmode) {
switch (value.type()) {
case kWasmI32:
if (value.to_i32() == 0 && RelocInfo::IsNone(rmode)) {
xorl(reg.gp(), reg.gp());
} else {
movl(reg.gp(), Immediate(value.to_i32(), rmode));
}
break;
case kWasmI64:
if (RelocInfo::IsNone(rmode)) {
TurboAssembler::Set(reg.gp(), value.to_i64());
} else {
movq(reg.gp(), value.to_i64(), rmode);
}
break;
case kWasmF32:
TurboAssembler::Move(reg.fp(), value.to_f32_boxed().get_bits());
break;
case kWasmF64:
TurboAssembler::Move(reg.fp(), value.to_f64_boxed().get_bits());
break;
default:
UNREACHABLE();
}
}
void LiftoffAssembler::LoadFromInstance(Register dst, uint32_t offset,
int size) {
DCHECK_LE(offset, kMaxInt);
movp(dst, liftoff::GetInstanceOperand());
DCHECK(size == 4 || size == 8);
if (size == 4) {
movl(dst, Operand(dst, offset));
} else {
movq(dst, Operand(dst, offset));
}
}
void LiftoffAssembler::SpillInstance(Register instance) {
movp(liftoff::GetInstanceOperand(), instance);
}
void LiftoffAssembler::FillInstanceInto(Register dst) {
movp(dst, liftoff::GetInstanceOperand());
}
void LiftoffAssembler::Load(LiftoffRegister dst, Register src_addr,
Register offset_reg, uint32_t offset_imm,
LoadType type, LiftoffRegList pinned,
uint32_t* protected_load_pc, bool is_load_mem) {
if (emit_debug_code() && offset_reg != no_reg) {
AssertZeroExtended(offset_reg);
}
Operand src_op =
liftoff::GetMemOp(this, src_addr, offset_reg, offset_imm, pinned);
if (protected_load_pc) *protected_load_pc = pc_offset();
switch (type.value()) {
case LoadType::kI32Load8U:
case LoadType::kI64Load8U:
movzxbl(dst.gp(), src_op);
break;
case LoadType::kI32Load8S:
movsxbl(dst.gp(), src_op);
break;
case LoadType::kI64Load8S:
movsxbq(dst.gp(), src_op);
break;
case LoadType::kI32Load16U:
case LoadType::kI64Load16U:
movzxwl(dst.gp(), src_op);
break;
case LoadType::kI32Load16S:
movsxwl(dst.gp(), src_op);
break;
case LoadType::kI64Load16S:
movsxwq(dst.gp(), src_op);
break;
case LoadType::kI32Load:
case LoadType::kI64Load32U:
movl(dst.gp(), src_op);
break;
case LoadType::kI64Load32S:
movsxlq(dst.gp(), src_op);
break;
case LoadType::kI64Load:
movq(dst.gp(), src_op);
break;
case LoadType::kF32Load:
Movss(dst.fp(), src_op);
break;
case LoadType::kF64Load:
Movsd(dst.fp(), src_op);
break;
default:
UNREACHABLE();
}
}
void LiftoffAssembler::Store(Register dst_addr, Register offset_reg,
uint32_t offset_imm, LiftoffRegister src,
StoreType type, LiftoffRegList pinned,
uint32_t* protected_store_pc, bool is_store_mem) {
if (emit_debug_code() && offset_reg != no_reg) {
AssertZeroExtended(offset_reg);
}
Operand dst_op =
liftoff::GetMemOp(this, dst_addr, offset_reg, offset_imm, pinned);
if (protected_store_pc) *protected_store_pc = pc_offset();
switch (type.value()) {
case StoreType::kI32Store8:
case StoreType::kI64Store8:
movb(dst_op, src.gp());
break;
case StoreType::kI32Store16:
case StoreType::kI64Store16:
movw(dst_op, src.gp());
break;
case StoreType::kI32Store:
case StoreType::kI64Store32:
movl(dst_op, src.gp());
break;
case StoreType::kI64Store:
movq(dst_op, src.gp());
break;
case StoreType::kF32Store:
Movss(dst_op, src.fp());
break;
case StoreType::kF64Store:
Movsd(dst_op, src.fp());
break;
default:
UNREACHABLE();
}
}
void LiftoffAssembler::ChangeEndiannessLoad(LiftoffRegister dst, LoadType type,
LiftoffRegList pinned) {
// Nop.
}
void LiftoffAssembler::ChangeEndiannessStore(LiftoffRegister src,
StoreType type,
LiftoffRegList pinned) {
// Nop.
}
void LiftoffAssembler::LoadCallerFrameSlot(LiftoffRegister dst,
uint32_t caller_slot_idx,
ValueType type) {
Operand src(rbp, kPointerSize * (caller_slot_idx + 1));
liftoff::Load(this, dst, src, type);
}
void LiftoffAssembler::MoveStackValue(uint32_t dst_index, uint32_t src_index,
ValueType type) {
DCHECK_NE(dst_index, src_index);
if (cache_state_.has_unused_register(kGpReg)) {
Fill(LiftoffRegister{kScratchRegister}, src_index, type);
Spill(dst_index, LiftoffRegister{kScratchRegister}, type);
} else {
pushq(liftoff::GetStackSlot(src_index));
popq(liftoff::GetStackSlot(dst_index));
}
}
void LiftoffAssembler::Move(Register dst, Register src, ValueType type) {
DCHECK_NE(dst, src);
if (type == kWasmI32) {
movl(dst, src);
} else {
DCHECK_EQ(kWasmI64, type);
movq(dst, src);
}
}
void LiftoffAssembler::Move(DoubleRegister dst, DoubleRegister src,
ValueType type) {
DCHECK_NE(dst, src);
if (type == kWasmF32) {
Movss(dst, src);
} else {
DCHECK_EQ(kWasmF64, type);
Movsd(dst, src);
}
}
void LiftoffAssembler::Spill(uint32_t index, LiftoffRegister reg,
ValueType type) {
RecordUsedSpillSlot(index);
Operand dst = liftoff::GetStackSlot(index);
switch (type) {
case kWasmI32:
movl(dst, reg.gp());
break;
case kWasmI64:
movq(dst, reg.gp());
break;
case kWasmF32:
Movss(dst, reg.fp());
break;
case kWasmF64:
Movsd(dst, reg.fp());
break;
default:
UNREACHABLE();
}
}
void LiftoffAssembler::Spill(uint32_t index, WasmValue value) {
RecordUsedSpillSlot(index);
Operand dst = liftoff::GetStackSlot(index);
switch (value.type()) {
case kWasmI32:
movl(dst, Immediate(value.to_i32()));
break;
case kWasmI64: {
if (is_int32(value.to_i64())) {
// Sign extend low word.
movq(dst, Immediate(static_cast<int32_t>(value.to_i64())));
} else if (is_uint32(value.to_i64())) {
// Zero extend low word.
movl(kScratchRegister, Immediate(static_cast<int32_t>(value.to_i64())));
movq(dst, kScratchRegister);
} else {
movq(kScratchRegister, value.to_i64());
movq(dst, kScratchRegister);
}
break;
}
default:
// We do not track f32 and f64 constants, hence they are unreachable.
UNREACHABLE();
}
}
void LiftoffAssembler::Fill(LiftoffRegister reg, uint32_t index,
ValueType type) {
Operand src = liftoff::GetStackSlot(index);
switch (type) {
case kWasmI32:
movl(reg.gp(), src);
break;
case kWasmI64:
movq(reg.gp(), src);
break;
case kWasmF32:
Movss(reg.fp(), src);
break;
case kWasmF64:
Movsd(reg.fp(), src);
break;
default:
UNREACHABLE();
}
}
void LiftoffAssembler::FillI64Half(Register, uint32_t half_index) {
UNREACHABLE();
}
void LiftoffAssembler::emit_i32_add(Register dst, Register lhs, Register rhs) {
if (lhs != dst) {
leal(dst, Operand(lhs, rhs, times_1, 0));
} else {
addl(dst, rhs);
}
}
void LiftoffAssembler::emit_i32_sub(Register dst, Register lhs, Register rhs) {
if (dst == rhs) {
negl(dst);
addl(dst, lhs);
} else {
if (dst != lhs) movl(dst, lhs);
subl(dst, rhs);
}
}
namespace liftoff {
template <void (Assembler::*op)(Register, Register),
void (Assembler::*mov)(Register, Register)>
void EmitCommutativeBinOp(LiftoffAssembler* assm, Register dst, Register lhs,
Register rhs) {
if (dst == rhs) {
(assm->*op)(dst, lhs);
} else {
if (dst != lhs) (assm->*mov)(dst, lhs);
(assm->*op)(dst, rhs);
}
}
} // namespace liftoff
void LiftoffAssembler::emit_i32_mul(Register dst, Register lhs, Register rhs) {
liftoff::EmitCommutativeBinOp<&Assembler::imull, &Assembler::movl>(this, dst,
lhs, rhs);
}
namespace liftoff {
enum class DivOrRem : uint8_t { kDiv, kRem };
template <typename type, DivOrRem div_or_rem>
void EmitIntDivOrRem(LiftoffAssembler* assm, Register dst, Register lhs,
Register rhs, Label* trap_div_by_zero,
Label* trap_div_unrepresentable) {
constexpr bool needs_unrepresentable_check =
std::is_signed<type>::value && div_or_rem == DivOrRem::kDiv;
constexpr bool special_case_minus_1 =
std::is_signed<type>::value && div_or_rem == DivOrRem::kRem;
DCHECK_EQ(needs_unrepresentable_check, trap_div_unrepresentable != nullptr);
#define iop(name, ...) \
do { \
if (sizeof(type) == 4) { \
assm->name##l(__VA_ARGS__); \
} else { \
assm->name##q(__VA_ARGS__); \
} \
} while (false)
// For division, the lhs is always taken from {edx:eax}. Thus, make sure that
// these registers are unused. If {rhs} is stored in one of them, move it to
// another temporary register.
// Do all this before any branch, such that the code is executed
// unconditionally, as the cache state will also be modified unconditionally.
liftoff::SpillRegisters(assm, rdx, rax);
if (rhs == rax || rhs == rdx) {
iop(mov, kScratchRegister, rhs);
rhs = kScratchRegister;
}
// Check for division by zero.
iop(test, rhs, rhs);
assm->j(zero, trap_div_by_zero);
Label done;
if (needs_unrepresentable_check) {
// Check for {kMinInt / -1}. This is unrepresentable.
Label do_div;
iop(cmp, rhs, Immediate(-1));
assm->j(not_equal, &do_div);
// {lhs} is min int if {lhs - 1} overflows.
iop(cmp, lhs, Immediate(1));
assm->j(overflow, trap_div_unrepresentable);
assm->bind(&do_div);
} else if (special_case_minus_1) {
// {lhs % -1} is always 0 (needs to be special cased because {kMinInt / -1}
// cannot be computed).
Label do_rem;
iop(cmp, rhs, Immediate(-1));
assm->j(not_equal, &do_rem);
// clang-format off
// (conflicts with presubmit checks because it is confused about "xor")
iop(xor, dst, dst);
// clang-format on
assm->jmp(&done);
assm->bind(&do_rem);
}
// Now move {lhs} into {eax}, then zero-extend or sign-extend into {edx}, then
// do the division.
if (lhs != rax) iop(mov, rax, lhs);
if (std::is_same<int32_t, type>::value) { // i32
assm->cdq();
assm->idivl(rhs);
} else if (std::is_same<uint32_t, type>::value) { // u32
assm->xorl(rdx, rdx);
assm->divl(rhs);
} else if (std::is_same<int64_t, type>::value) { // i64
assm->cqo();
assm->idivq(rhs);
} else { // u64
assm->xorq(rdx, rdx);
assm->divq(rhs);
}
// Move back the result (in {eax} or {edx}) into the {dst} register.
constexpr Register kResultReg = div_or_rem == DivOrRem::kDiv ? rax : rdx;
if (dst != kResultReg) {
iop(mov, dst, kResultReg);
}
if (special_case_minus_1) assm->bind(&done);
}
} // namespace liftoff
void LiftoffAssembler::emit_i32_divs(Register dst, Register lhs, Register rhs,
Label* trap_div_by_zero,
Label* trap_div_unrepresentable) {
liftoff::EmitIntDivOrRem<int32_t, liftoff::DivOrRem::kDiv>(
this, dst, lhs, rhs, trap_div_by_zero, trap_div_unrepresentable);
}
void LiftoffAssembler::emit_i32_divu(Register dst, Register lhs, Register rhs,
Label* trap_div_by_zero) {
liftoff::EmitIntDivOrRem<uint32_t, liftoff::DivOrRem::kDiv>(
this, dst, lhs, rhs, trap_div_by_zero, nullptr);
}
void LiftoffAssembler::emit_i32_rems(Register dst, Register lhs, Register rhs,
Label* trap_div_by_zero) {
liftoff::EmitIntDivOrRem<int32_t, liftoff::DivOrRem::kRem>(
this, dst, lhs, rhs, trap_div_by_zero, nullptr);
}
void LiftoffAssembler::emit_i32_remu(Register dst, Register lhs, Register rhs,
Label* trap_div_by_zero) {
liftoff::EmitIntDivOrRem<uint32_t, liftoff::DivOrRem::kRem>(
this, dst, lhs, rhs, trap_div_by_zero, nullptr);
}
void LiftoffAssembler::emit_i32_and(Register dst, Register lhs, Register rhs) {
liftoff::EmitCommutativeBinOp<&Assembler::andl, &Assembler::movl>(this, dst,
lhs, rhs);
}
void LiftoffAssembler::emit_i32_or(Register dst, Register lhs, Register rhs) {
liftoff::EmitCommutativeBinOp<&Assembler::orl, &Assembler::movl>(this, dst,
lhs, rhs);
}
void LiftoffAssembler::emit_i32_xor(Register dst, Register lhs, Register rhs) {
liftoff::EmitCommutativeBinOp<&Assembler::xorl, &Assembler::movl>(this, dst,
lhs, rhs);
}
namespace liftoff {
template <ValueType type>
inline void EmitShiftOperation(LiftoffAssembler* assm, Register dst,
Register src, Register amount,
void (Assembler::*emit_shift)(Register),
LiftoffRegList pinned) {
// If dst is rcx, compute into the scratch register first, then move to rcx.
if (dst == rcx) {
assm->Move(kScratchRegister, src, type);
if (amount != rcx) assm->Move(rcx, amount, type);
(assm->*emit_shift)(kScratchRegister);
assm->Move(rcx, kScratchRegister, type);
return;
}
// Move amount into rcx. If rcx is in use, move its content into the scratch
// register. If src is rcx, src is now the scratch register.
bool use_scratch = false;
if (amount != rcx) {
use_scratch = src == rcx ||
assm->cache_state()->is_used(LiftoffRegister(rcx)) ||
pinned.has(LiftoffRegister(rcx));
if (use_scratch) assm->movq(kScratchRegister, rcx);
if (src == rcx) src = kScratchRegister;
assm->Move(rcx, amount, type);
}
// Do the actual shift.
if (dst != src) assm->Move(dst, src, type);
(assm->*emit_shift)(dst);
// Restore rcx if needed.
if (use_scratch) assm->movq(rcx, kScratchRegister);
}
} // namespace liftoff
void LiftoffAssembler::emit_i32_shl(Register dst, Register src, Register amount,
LiftoffRegList pinned) {
liftoff::EmitShiftOperation<kWasmI32>(this, dst, src, amount,
&Assembler::shll_cl, pinned);
}
void LiftoffAssembler::emit_i32_sar(Register dst, Register src, Register amount,
LiftoffRegList pinned) {
liftoff::EmitShiftOperation<kWasmI32>(this, dst, src, amount,
&Assembler::sarl_cl, pinned);
}
void LiftoffAssembler::emit_i32_shr(Register dst, Register src, Register amount,
LiftoffRegList pinned) {
liftoff::EmitShiftOperation<kWasmI32>(this, dst, src, amount,
&Assembler::shrl_cl, pinned);
}
bool LiftoffAssembler::emit_i32_clz(Register dst, Register src) {
Label nonzero_input;
Label continuation;
testl(src, src);
j(not_zero, &nonzero_input, Label::kNear);
movl(dst, Immediate(32));
jmp(&continuation, Label::kNear);
bind(&nonzero_input);
// Get most significant bit set (MSBS).
bsrl(dst, src);
// CLZ = 31 - MSBS = MSBS ^ 31.
xorl(dst, Immediate(31));
bind(&continuation);
return true;
}
bool LiftoffAssembler::emit_i32_ctz(Register dst, Register src) {
Label nonzero_input;
Label continuation;
testl(src, src);
j(not_zero, &nonzero_input, Label::kNear);
movl(dst, Immediate(32));
jmp(&continuation, Label::kNear);
bind(&nonzero_input);
// Get least significant bit set, which equals number of trailing zeros.
bsfl(dst, src);
bind(&continuation);
return true;
}
bool LiftoffAssembler::emit_i32_popcnt(Register dst, Register src) {
if (!CpuFeatures::IsSupported(POPCNT)) return false;
CpuFeatureScope scope(this, POPCNT);
popcntl(dst, src);
return true;
}
void LiftoffAssembler::emit_i64_add(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs) {
if (lhs.gp() != dst.gp()) {
leap(dst.gp(), Operand(lhs.gp(), rhs.gp(), times_1, 0));
} else {
addp(dst.gp(), rhs.gp());
}
}
void LiftoffAssembler::emit_i64_sub(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs) {
if (dst.gp() == rhs.gp()) {
negq(dst.gp());
addq(dst.gp(), lhs.gp());
} else {
if (dst.gp() != lhs.gp()) movq(dst.gp(), lhs.gp());
subq(dst.gp(), rhs.gp());
}
}
void LiftoffAssembler::emit_i64_mul(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs) {
liftoff::EmitCommutativeBinOp<&Assembler::imulq, &Assembler::movq>(
this, dst.gp(), lhs.gp(), rhs.gp());
}
bool LiftoffAssembler::emit_i64_divs(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs,
Label* trap_div_by_zero,
Label* trap_div_unrepresentable) {
liftoff::EmitIntDivOrRem<int64_t, liftoff::DivOrRem::kDiv>(
this, dst.gp(), lhs.gp(), rhs.gp(), trap_div_by_zero,
trap_div_unrepresentable);
return true;
}
bool LiftoffAssembler::emit_i64_divu(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs,
Label* trap_div_by_zero) {
liftoff::EmitIntDivOrRem<uint64_t, liftoff::DivOrRem::kDiv>(
this, dst.gp(), lhs.gp(), rhs.gp(), trap_div_by_zero, nullptr);
return true;
}
bool LiftoffAssembler::emit_i64_rems(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs,
Label* trap_div_by_zero) {
liftoff::EmitIntDivOrRem<int64_t, liftoff::DivOrRem::kRem>(
this, dst.gp(), lhs.gp(), rhs.gp(), trap_div_by_zero, nullptr);
return true;
}
bool LiftoffAssembler::emit_i64_remu(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs,
Label* trap_div_by_zero) {
liftoff::EmitIntDivOrRem<uint64_t, liftoff::DivOrRem::kRem>(
this, dst.gp(), lhs.gp(), rhs.gp(), trap_div_by_zero, nullptr);
return true;
}
void LiftoffAssembler::emit_i64_and(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs) {
liftoff::EmitCommutativeBinOp<&Assembler::andq, &Assembler::movq>(
this, dst.gp(), lhs.gp(), rhs.gp());
}
void LiftoffAssembler::emit_i64_or(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs) {
liftoff::EmitCommutativeBinOp<&Assembler::orq, &Assembler::movq>(
this, dst.gp(), lhs.gp(), rhs.gp());
}
void LiftoffAssembler::emit_i64_xor(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs) {
liftoff::EmitCommutativeBinOp<&Assembler::xorq, &Assembler::movq>(
this, dst.gp(), lhs.gp(), rhs.gp());
}
void LiftoffAssembler::emit_i64_shl(LiftoffRegister dst, LiftoffRegister src,
Register amount, LiftoffRegList pinned) {
liftoff::EmitShiftOperation<kWasmI64>(this, dst.gp(), src.gp(), amount,
&Assembler::shlq_cl, pinned);
}
void LiftoffAssembler::emit_i64_sar(LiftoffRegister dst, LiftoffRegister src,
Register amount, LiftoffRegList pinned) {
liftoff::EmitShiftOperation<kWasmI64>(this, dst.gp(), src.gp(), amount,
&Assembler::sarq_cl, pinned);
}
void LiftoffAssembler::emit_i64_shr(LiftoffRegister dst, LiftoffRegister src,
Register amount, LiftoffRegList pinned) {
liftoff::EmitShiftOperation<kWasmI64>(this, dst.gp(), src.gp(), amount,
&Assembler::shrq_cl, pinned);
}
void LiftoffAssembler::emit_i32_to_intptr(Register dst, Register src) {
movsxlq(dst, src);
}
void LiftoffAssembler::emit_f32_add(DoubleRegister dst, DoubleRegister lhs,
DoubleRegister rhs) {
if (CpuFeatures::IsSupported(AVX)) {
CpuFeatureScope scope(this, AVX);
vaddss(dst, lhs, rhs);
} else if (dst == rhs) {
addss(dst, lhs);
} else {
if (dst != lhs) movss(dst, lhs);
addss(dst, rhs);
}
}
void LiftoffAssembler::emit_f32_sub(DoubleRegister dst, DoubleRegister lhs,
DoubleRegister rhs) {
if (CpuFeatures::IsSupported(AVX)) {
CpuFeatureScope scope(this, AVX);
vsubss(dst, lhs, rhs);
} else if (dst == rhs) {
movss(kScratchDoubleReg, rhs);
movss(dst, lhs);
subss(dst, kScratchDoubleReg);
} else {
if (dst != lhs) movss(dst, lhs);
subss(dst, rhs);
}
}
void LiftoffAssembler::emit_f32_mul(DoubleRegister dst, DoubleRegister lhs,
DoubleRegister rhs) {
if (CpuFeatures::IsSupported(AVX)) {
CpuFeatureScope scope(this, AVX);
vmulss(dst, lhs, rhs);
} else if (dst == rhs) {
mulss(dst, lhs);
} else {
if (dst != lhs) movss(dst, lhs);
mulss(dst, rhs);
}
}
void LiftoffAssembler::emit_f32_div(DoubleRegister dst, DoubleRegister lhs,
DoubleRegister rhs) {
if (CpuFeatures::IsSupported(AVX)) {
CpuFeatureScope scope(this, AVX);
vdivss(dst, lhs, rhs);
} else if (dst == rhs) {
movss(kScratchDoubleReg, rhs);
movss(dst, lhs);
divss(dst, kScratchDoubleReg);
} else {
if (dst != lhs) movss(dst, lhs);
divss(dst, rhs);
}
}
namespace liftoff {
enum class MinOrMax : uint8_t { kMin, kMax };
template <typename type>
inline void EmitFloatMinOrMax(LiftoffAssembler* assm, DoubleRegister dst,
DoubleRegister lhs, DoubleRegister rhs,
MinOrMax min_or_max) {
Label is_nan;
Label lhs_below_rhs;
Label lhs_above_rhs;
Label done;
#define dop(name, ...) \
do { \
if (sizeof(type) == 4) { \
assm->name##s(__VA_ARGS__); \
} else { \
assm->name##d(__VA_ARGS__); \
} \
} while (false)
// Check the easy cases first: nan (e.g. unordered), smaller and greater.
// NaN has to be checked first, because PF=1 implies CF=1.
dop(Ucomis, lhs, rhs);
assm->j(parity_even, &is_nan, Label::kNear); // PF=1
assm->j(below, &lhs_below_rhs, Label::kNear); // CF=1
assm->j(above, &lhs_above_rhs, Label::kNear); // CF=0 && ZF=0
// If we get here, then either
// a) {lhs == rhs},
// b) {lhs == -0.0} and {rhs == 0.0}, or
// c) {lhs == 0.0} and {rhs == -0.0}.
// For a), it does not matter whether we return {lhs} or {rhs}. Check the sign
// bit of {rhs} to differentiate b) and c).
dop(Movmskp, kScratchRegister, rhs);
assm->testl(kScratchRegister, Immediate(1));
assm->j(zero, &lhs_below_rhs, Label::kNear);
assm->jmp(&lhs_above_rhs, Label::kNear);
assm->bind(&is_nan);
// Create a NaN output.
dop(Xorp, dst, dst);
dop(Divs, dst, dst);
assm->jmp(&done, Label::kNear);
assm->bind(&lhs_below_rhs);
DoubleRegister lhs_below_rhs_src = min_or_max == MinOrMax::kMin ? lhs : rhs;
if (dst != lhs_below_rhs_src) dop(Movs, dst, lhs_below_rhs_src);
assm->jmp(&done, Label::kNear);
assm->bind(&lhs_above_rhs);
DoubleRegister lhs_above_rhs_src = min_or_max == MinOrMax::kMin ? rhs : lhs;
if (dst != lhs_above_rhs_src) dop(Movs, dst, lhs_above_rhs_src);
assm->bind(&done);
}
} // namespace liftoff
void LiftoffAssembler::emit_f32_min(DoubleRegister dst, DoubleRegister lhs,
DoubleRegister rhs) {
liftoff::EmitFloatMinOrMax<float>(this, dst, lhs, rhs,
liftoff::MinOrMax::kMin);
}
void LiftoffAssembler::emit_f32_max(DoubleRegister dst, DoubleRegister lhs,
DoubleRegister rhs) {
liftoff::EmitFloatMinOrMax<float>(this, dst, lhs, rhs,
liftoff::MinOrMax::kMax);
}
void LiftoffAssembler::emit_f32_abs(DoubleRegister dst, DoubleRegister src) {
static constexpr uint32_t kSignBit = uint32_t{1} << 31;
if (dst == src) {
TurboAssembler::Move(kScratchDoubleReg, kSignBit - 1);
Andps(dst, kScratchDoubleReg);
} else {
TurboAssembler::Move(dst, kSignBit - 1);
Andps(dst, src);
}
}
void LiftoffAssembler::emit_f32_neg(DoubleRegister dst, DoubleRegister src) {
static constexpr uint32_t kSignBit = uint32_t{1} << 31;
if (dst == src) {
TurboAssembler::Move(kScratchDoubleReg, kSignBit);
Xorps(dst, kScratchDoubleReg);
} else {
TurboAssembler::Move(dst, kSignBit);
Xorps(dst, src);
}
}
void LiftoffAssembler::emit_f32_ceil(DoubleRegister dst, DoubleRegister src) {
REQUIRE_CPU_FEATURE(SSE4_1);
Roundss(dst, src, kRoundUp);
}
void LiftoffAssembler::emit_f32_floor(DoubleRegister dst, DoubleRegister src) {
REQUIRE_CPU_FEATURE(SSE4_1);
Roundss(dst, src, kRoundDown);
}
void LiftoffAssembler::emit_f32_trunc(DoubleRegister dst, DoubleRegister src) {
REQUIRE_CPU_FEATURE(SSE4_1);
Roundss(dst, src, kRoundToZero);
}
void LiftoffAssembler::emit_f32_nearest_int(DoubleRegister dst,
DoubleRegister src) {
REQUIRE_CPU_FEATURE(SSE4_1);
Roundss(dst, src, kRoundToNearest);
}
void LiftoffAssembler::emit_f32_sqrt(DoubleRegister dst, DoubleRegister src) {
Sqrtss(dst, src);
}
void LiftoffAssembler::emit_f64_add(DoubleRegister dst, DoubleRegister lhs,
DoubleRegister rhs) {
if (CpuFeatures::IsSupported(AVX)) {
CpuFeatureScope scope(this, AVX);
vaddsd(dst, lhs, rhs);
} else if (dst == rhs) {
addsd(dst, lhs);
} else {
if (dst != lhs) movsd(dst, lhs);
addsd(dst, rhs);
}
}
void LiftoffAssembler::emit_f64_sub(DoubleRegister dst, DoubleRegister lhs,
DoubleRegister rhs) {
if (CpuFeatures::IsSupported(AVX)) {
CpuFeatureScope scope(this, AVX);
vsubsd(dst, lhs, rhs);
} else if (dst == rhs) {
movsd(kScratchDoubleReg, rhs);
movsd(dst, lhs);
subsd(dst, kScratchDoubleReg);
} else {
if (dst != lhs) movsd(dst, lhs);
subsd(dst, rhs);
}
}
void LiftoffAssembler::emit_f64_mul(DoubleRegister dst, DoubleRegister lhs,
DoubleRegister rhs) {
if (CpuFeatures::IsSupported(AVX)) {
CpuFeatureScope scope(this, AVX);
vmulsd(dst, lhs, rhs);
} else if (dst == rhs) {
mulsd(dst, lhs);
} else {
if (dst != lhs) movsd(dst, lhs);
mulsd(dst, rhs);
}
}
void LiftoffAssembler::emit_f64_div(DoubleRegister dst, DoubleRegister lhs,
DoubleRegister rhs) {
if (CpuFeatures::IsSupported(AVX)) {
CpuFeatureScope scope(this, AVX);
vdivsd(dst, lhs, rhs);
} else if (dst == rhs) {
movsd(kScratchDoubleReg, rhs);
movsd(dst, lhs);
divsd(dst, kScratchDoubleReg);
} else {
if (dst != lhs) movsd(dst, lhs);
divsd(dst, rhs);
}
}
void LiftoffAssembler::emit_f64_min(DoubleRegister dst, DoubleRegister lhs,
DoubleRegister rhs) {
liftoff::EmitFloatMinOrMax<double>(this, dst, lhs, rhs,
liftoff::MinOrMax::kMin);
}
void LiftoffAssembler::emit_f64_max(DoubleRegister dst, DoubleRegister lhs,
DoubleRegister rhs) {
liftoff::EmitFloatMinOrMax<double>(this, dst, lhs, rhs,
liftoff::MinOrMax::kMax);
}
void LiftoffAssembler::emit_f64_abs(DoubleRegister dst, DoubleRegister src) {
static constexpr uint64_t kSignBit = uint64_t{1} << 63;
if (dst == src) {
TurboAssembler::Move(kScratchDoubleReg, kSignBit - 1);
Andpd(dst, kScratchDoubleReg);
} else {
TurboAssembler::Move(dst, kSignBit - 1);
Andpd(dst, src);
}
}
void LiftoffAssembler::emit_f64_neg(DoubleRegister dst, DoubleRegister src) {
static constexpr uint64_t kSignBit = uint64_t{1} << 63;
if (dst == src) {
TurboAssembler::Move(kScratchDoubleReg, kSignBit);
Xorpd(dst, kScratchDoubleReg);
} else {
TurboAssembler::Move(dst, kSignBit);
Xorpd(dst, src);
}
}
bool LiftoffAssembler::emit_f64_ceil(DoubleRegister dst, DoubleRegister src) {
REQUIRE_CPU_FEATURE(SSE4_1, true);
Roundsd(dst, src, kRoundUp);
return true;
}
bool LiftoffAssembler::emit_f64_floor(DoubleRegister dst, DoubleRegister src) {
REQUIRE_CPU_FEATURE(SSE4_1, true);
Roundsd(dst, src, kRoundDown);
return true;
}
bool LiftoffAssembler::emit_f64_trunc(DoubleRegister dst, DoubleRegister src) {
REQUIRE_CPU_FEATURE(SSE4_1, true);
Roundsd(dst, src, kRoundToZero);
return true;
}
bool LiftoffAssembler::emit_f64_nearest_int(DoubleRegister dst,
DoubleRegister src) {
REQUIRE_CPU_FEATURE(SSE4_1, true);
Roundsd(dst, src, kRoundToNearest);
return true;
}
void LiftoffAssembler::emit_f64_sqrt(DoubleRegister dst, DoubleRegister src) {
Sqrtsd(dst, src);
}
namespace liftoff {
// Used for float to int conversions. If the value in {converted_back} equals
// {src} afterwards, the conversion succeeded.
template <typename dst_type, typename src_type>
inline void ConvertFloatToIntAndBack(LiftoffAssembler* assm, Register dst,
DoubleRegister src,
DoubleRegister converted_back) {
if (std::is_same<double, src_type>::value) { // f64
if (std::is_same<int32_t, dst_type>::value) { // f64 -> i32
assm->Cvttsd2si(dst, src);
assm->Cvtlsi2sd(converted_back, dst);
} else if (std::is_same<uint32_t, dst_type>::value) { // f64 -> u32
assm->Cvttsd2siq(dst, src);
assm->movl(dst, dst);
assm->Cvtqsi2sd(converted_back, dst);
} else if (std::is_same<int64_t, dst_type>::value) { // f64 -> i64
assm->Cvttsd2siq(dst, src);
assm->Cvtqsi2sd(converted_back, dst);
} else {
UNREACHABLE();
}
} else { // f32
if (std::is_same<int32_t, dst_type>::value) { // f32 -> i32
assm->Cvttss2si(dst, src);
assm->Cvtlsi2ss(converted_back, dst);
} else if (std::is_same<uint32_t, dst_type>::value) { // f32 -> u32
assm->Cvttss2siq(dst, src);
assm->movl(dst, dst);
assm->Cvtqsi2ss(converted_back, dst);
} else if (std::is_same<int64_t, dst_type>::value) { // f32 -> i64
assm->Cvttss2siq(dst, src);
assm->Cvtqsi2ss(converted_back, dst);
} else {
UNREACHABLE();
}
}
}
template <typename dst_type, typename src_type>
inline bool EmitTruncateFloatToInt(LiftoffAssembler* assm, Register dst,
DoubleRegister src, Label* trap) {
if (!CpuFeatures::IsSupported(SSE4_1)) {
assm->bailout("no SSE4.1");
return true;
}
CpuFeatureScope feature(assm, SSE4_1);
DoubleRegister rounded = kScratchDoubleReg;
DoubleRegister converted_back = kScratchDoubleReg2;
if (std::is_same<double, src_type>::value) { // f64
assm->Roundsd(rounded, src, kRoundToZero);
} else { // f32
assm->Roundss(rounded, src, kRoundToZero);
}
ConvertFloatToIntAndBack<dst_type, src_type>(assm, dst, rounded,
converted_back);
if (std::is_same<double, src_type>::value) { // f64
assm->Ucomisd(converted_back, rounded);
} else { // f32
assm->Ucomiss(converted_back, rounded);
}
// Jump to trap if PF is 0 (one of the operands was NaN) or they are not
// equal.
assm->j(parity_even, trap);
assm->j(not_equal, trap);
return true;
}
} // namespace liftoff
bool LiftoffAssembler::emit_type_conversion(WasmOpcode opcode,
LiftoffRegister dst,
LiftoffRegister src, Label* trap) {
switch (opcode) {
case kExprI32ConvertI64:
movl(dst.gp(), src.gp());
return true;
case kExprI32SConvertF32:
return liftoff::EmitTruncateFloatToInt<int32_t, float>(this, dst.gp(),
src.fp(), trap);
case kExprI32UConvertF32:
return liftoff::EmitTruncateFloatToInt<uint32_t, float>(this, dst.gp(),
src.fp(), trap);
case kExprI32SConvertF64:
return liftoff::EmitTruncateFloatToInt<int32_t, double>(this, dst.gp(),
src.fp(), trap);
case kExprI32UConvertF64:
return liftoff::EmitTruncateFloatToInt<uint32_t, double>(this, dst.gp(),
src.fp(), trap);
case kExprI32ReinterpretF32:
Movd(dst.gp(), src.fp());
return true;
case kExprI64SConvertI32:
movsxlq(dst.gp(), src.gp());
return true;
case kExprI64SConvertF32:
return liftoff::EmitTruncateFloatToInt<int64_t, float>(this, dst.gp(),
src.fp(), trap);
case kExprI64UConvertF32: {
REQUIRE_CPU_FEATURE(SSE4_1, true);
Cvttss2uiq(dst.gp(), src.fp(), trap);
return true;
}
case kExprI64SConvertF64:
return liftoff::EmitTruncateFloatToInt<int64_t, double>(this, dst.gp(),
src.fp(), trap);
case kExprI64UConvertF64: {
REQUIRE_CPU_FEATURE(SSE4_1, true);
Cvttsd2uiq(dst.gp(), src.fp(), trap);
return true;
}
case kExprI64UConvertI32:
AssertZeroExtended(src.gp());
if (dst.gp() != src.gp()) movl(dst.gp(), src.gp());
return true;
case kExprI64ReinterpretF64:
Movq(dst.gp(), src.fp());
return true;
case kExprF32SConvertI32:
Cvtlsi2ss(dst.fp(), src.gp());
return true;
case kExprF32UConvertI32:
movl(kScratchRegister, src.gp());
Cvtqsi2ss(dst.fp(), kScratchRegister);
return true;
case kExprF32SConvertI64:
Cvtqsi2ss(dst.fp(), src.gp());
return true;
case kExprF32UConvertI64:
Cvtqui2ss(dst.fp(), src.gp());
return true;
case kExprF32ConvertF64:
Cvtsd2ss(dst.fp(), src.fp());
return true;
case kExprF32ReinterpretI32:
Movd(dst.fp(), src.gp());
return true;
case kExprF64SConvertI32:
Cvtlsi2sd(dst.fp(), src.gp());
return true;
case kExprF64UConvertI32:
movl(kScratchRegister, src.gp());
Cvtqsi2sd(dst.fp(), kScratchRegister);
return true;
case kExprF64SConvertI64:
Cvtqsi2sd(dst.fp(), src.gp());
return true;
case kExprF64UConvertI64:
Cvtqui2sd(dst.fp(), src.gp());
return true;
case kExprF64ConvertF32:
Cvtss2sd(dst.fp(), src.fp());
return true;
case kExprF64ReinterpretI64:
Movq(dst.fp(), src.gp());
return true;
default:
UNREACHABLE();
}
}
void LiftoffAssembler::emit_jump(Label* label) { jmp(label); }
void LiftoffAssembler::emit_jump(Register target) { jmp(target); }
void LiftoffAssembler::emit_cond_jump(Condition cond, Label* label,
ValueType type, Register lhs,
Register rhs) {
if (rhs != no_reg) {
switch (type) {
case kWasmI32:
cmpl(lhs, rhs);
break;
case kWasmI64:
cmpq(lhs, rhs);
break;
default:
UNREACHABLE();
}
} else {
DCHECK_EQ(type, kWasmI32);
testl(lhs, lhs);
}
j(cond, label);
}
void LiftoffAssembler::emit_i32_eqz(Register dst, Register src) {
testl(src, src);
setcc(equal, dst);
movzxbl(dst, dst);
}
void LiftoffAssembler::emit_i32_set_cond(Condition cond, Register dst,
Register lhs, Register rhs) {
cmpl(lhs, rhs);
setcc(cond, dst);
movzxbl(dst, dst);
}
void LiftoffAssembler::emit_i64_eqz(Register dst, LiftoffRegister src) {
testq(src.gp(), src.gp());
setcc(equal, dst);
movzxbl(dst, dst);
}
void LiftoffAssembler::emit_i64_set_cond(Condition cond, Register dst,
LiftoffRegister lhs,
LiftoffRegister rhs) {
cmpq(lhs.gp(), rhs.gp());
setcc(cond, dst);
movzxbl(dst, dst);
}
namespace liftoff {
template <void (TurboAssembler::*cmp_op)(DoubleRegister, DoubleRegister)>
void EmitFloatSetCond(LiftoffAssembler* assm, Condition cond, Register dst,
DoubleRegister lhs, DoubleRegister rhs) {
Label cont;
Label not_nan;
(assm->*cmp_op)(lhs, rhs);
// If PF is one, one of the operands was NaN. This needs special handling.
assm->j(parity_odd, ¬_nan, Label::kNear);
// Return 1 for f32.ne, 0 for all other cases.
if (cond == not_equal) {
assm->movl(dst, Immediate(1));
} else {
assm->xorl(dst, dst);
}
assm->jmp(&cont, Label::kNear);
assm->bind(¬_nan);
assm->setcc(cond, dst);
assm->movzxbl(dst, dst);
assm->bind(&cont);
}
} // namespace liftoff
void LiftoffAssembler::emit_f32_set_cond(Condition cond, Register dst,
DoubleRegister lhs,
DoubleRegister rhs) {
liftoff::EmitFloatSetCond<&TurboAssembler::Ucomiss>(this, cond, dst, lhs,
rhs);
}
void LiftoffAssembler::emit_f64_set_cond(Condition cond, Register dst,
DoubleRegister lhs,
DoubleRegister rhs) {
liftoff::EmitFloatSetCond<&TurboAssembler::Ucomisd>(this, cond, dst, lhs,
rhs);
}
void LiftoffAssembler::StackCheck(Label* ool_code, Register limit_address) {
cmpp(rsp, Operand(limit_address, 0));
j(below_equal, ool_code);
}
void LiftoffAssembler::CallTrapCallbackForTesting() {
PrepareCallCFunction(0);
CallCFunction(ExternalReference::wasm_call_trap_callback_for_testing(), 0);
}
void LiftoffAssembler::AssertUnreachable(AbortReason reason) {
TurboAssembler::AssertUnreachable(reason);
}
void LiftoffAssembler::PushRegisters(LiftoffRegList regs) {
LiftoffRegList gp_regs = regs & kGpCacheRegList;
while (!gp_regs.is_empty()) {
LiftoffRegister reg = gp_regs.GetFirstRegSet();
pushq(reg.gp());
gp_regs.clear(reg);
}
LiftoffRegList fp_regs = regs & kFpCacheRegList;
unsigned num_fp_regs = fp_regs.GetNumRegsSet();
if (num_fp_regs) {
subp(rsp, Immediate(num_fp_regs * kStackSlotSize));
unsigned offset = 0;
while (!fp_regs.is_empty()) {
LiftoffRegister reg = fp_regs.GetFirstRegSet();
Movsd(Operand(rsp, offset), reg.fp());
fp_regs.clear(reg);
offset += sizeof(double);
}
DCHECK_EQ(offset, num_fp_regs * sizeof(double));
}
}
void LiftoffAssembler::PopRegisters(LiftoffRegList regs) {
LiftoffRegList fp_regs = regs & kFpCacheRegList;
unsigned fp_offset = 0;
while (!fp_regs.is_empty()) {
LiftoffRegister reg = fp_regs.GetFirstRegSet();
Movsd(reg.fp(), Operand(rsp, fp_offset));
fp_regs.clear(reg);
fp_offset += sizeof(double);
}
if (fp_offset) addp(rsp, Immediate(fp_offset));
LiftoffRegList gp_regs = regs & kGpCacheRegList;
while (!gp_regs.is_empty()) {
LiftoffRegister reg = gp_regs.GetLastRegSet();
popq(reg.gp());
gp_regs.clear(reg);
}
}
void LiftoffAssembler::DropStackSlotsAndRet(uint32_t num_stack_slots) {
DCHECK_LT(num_stack_slots, (1 << 16) / kPointerSize); // 16 bit immediate
ret(static_cast<int>(num_stack_slots * kPointerSize));
}
void LiftoffAssembler::CallC(wasm::FunctionSig* sig,
const LiftoffRegister* args,
const LiftoffRegister* rets,
ValueType out_argument_type, int stack_bytes,
ExternalReference ext_ref) {
subp(rsp, Immediate(stack_bytes));
int arg_bytes = 0;
for (ValueType param_type : sig->parameters()) {
liftoff::Store(this, Operand(rsp, arg_bytes), *args++, param_type);
arg_bytes += ValueTypes::MemSize(param_type);
}
DCHECK_LE(arg_bytes, stack_bytes);
// Pass a pointer to the buffer with the arguments to the C function.
movp(arg_reg_1, rsp);
constexpr int kNumCCallArgs = 1;
// Now call the C function.
PrepareCallCFunction(kNumCCallArgs);
CallCFunction(ext_ref, kNumCCallArgs);
// Move return value to the right register.
const LiftoffRegister* next_result_reg = rets;
if (sig->return_count() > 0) {
DCHECK_EQ(1, sig->return_count());
constexpr Register kReturnReg = rax;
if (kReturnReg != next_result_reg->gp()) {
Move(*next_result_reg, LiftoffRegister(kReturnReg), sig->GetReturn(0));
}
++next_result_reg;
}
// Load potential output value from the buffer on the stack.
if (out_argument_type != kWasmStmt) {
liftoff::Load(this, *next_result_reg, Operand(rsp, 0), out_argument_type);
}
addp(rsp, Immediate(stack_bytes));
}
void LiftoffAssembler::CallNativeWasmCode(Address addr) {
near_call(addr, RelocInfo::WASM_CALL);
}
void LiftoffAssembler::CallIndirect(wasm::FunctionSig* sig,
compiler::CallDescriptor* call_descriptor,
Register target) {
if (target == no_reg) {
popq(kScratchRegister);
target = kScratchRegister;
}
if (FLAG_untrusted_code_mitigations) {
RetpolineCall(target);
} else {
call(target);
}
}
void LiftoffAssembler::CallRuntimeStub(WasmCode::RuntimeStubId sid) {
// A direct call to a wasm runtime stub defined in this module.
// Just encode the stub index. This will be patched at relocation.
near_call(static_cast<Address>(sid), RelocInfo::WASM_STUB_CALL);
}
void LiftoffAssembler::AllocateStackSlot(Register addr, uint32_t size) {
subp(rsp, Immediate(size));
movp(addr, rsp);
}
void LiftoffAssembler::DeallocateStackSlot(uint32_t size) {
addp(rsp, Immediate(size));
}
void LiftoffStackSlots::Construct() {
for (auto& slot : slots_) {
const LiftoffAssembler::VarState& src = slot.src_;
switch (src.loc()) {
case LiftoffAssembler::VarState::kStack:
if (src.type() == kWasmI32) {
// Load i32 values to a register first to ensure they are zero
// extended.
asm_->movl(kScratchRegister, liftoff::GetStackSlot(slot.src_index_));
asm_->pushq(kScratchRegister);
} else {
// For all other types, just push the whole (8-byte) stack slot.
// This is also ok for f32 values (even though we copy 4 uninitialized
// bytes), because f32 and f64 values are clearly distinguished in
// Turbofan, so the uninitialized bytes are never accessed.
asm_->pushq(liftoff::GetStackSlot(slot.src_index_));
}
break;
case LiftoffAssembler::VarState::kRegister:
liftoff::push(asm_, src.reg(), src.type());
break;
case LiftoffAssembler::VarState::KIntConst:
asm_->pushq(Immediate(src.i32_const()));
break;
}
}
}
#undef REQUIRE_CPU_FEATURE
} // namespace wasm
} // namespace internal
} // namespace v8
#endif // V8_WASM_BASELINE_X64_LIFTOFF_ASSEMBLER_X64_H_
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
4dad02b0e551b2428019731ba0866ff77b4e39f8 | 6f69622c84e625633fe107ecf0453a54c54aa531 | /dsa/cses/graph/gameroutes.cpp | 88c80243d40a28a5bc06d91a1ea402e02354218b | [] | no_license | skrstv123/CP-ALGO | f1f7ca5d19c3d9f538ff33ac2510e01739b9bbe6 | 835f676166ab1088951b8f6ef6c083dacf62e055 | refs/heads/master | 2021-07-26T21:32:54.572089 | 2021-07-06T10:11:00 | 2021-07-06T10:11:00 | 215,589,822 | 0 | 2 | null | 2020-10-05T16:16:30 | 2019-10-16T16:05:09 | Python | UTF-8 | C++ | false | false | 1,733 | cpp | // Created by skrstv123
#include <bits/stdc++.h>
using namespace std;
#define ar array
#define ll long long
#define range(i, start, end ,step) for(ll i=start ;i<end; i += step)
#define rep(i,s,e) for(ll i=s;i<=e;++i)
#define reparr(arr) for(auto x: arr) cout<<x<<" ";
#define repr(i,e,s) for(ll i=e; i>=s; i--)
#define vit vector<ll>
#define mid(l,r) (l+(r-l)/2)
#define endl '\n'
#define vr vector
#define pr pair
#define pll pair<ll, ll>
#define pb push_back
#define fp first
#define sp second
const int MAX_N = 1e5 + 1;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
void solve() {
ll n,m,a,b;
cin>>n>>m;
ll indegree[n+1] = {0};
vit graph[n+1];
rep(i,1,m){
cin>>a>>b;
graph[a].pb(b);
indegree[b]++;
}
queue<ll> Q;
////////////////////////////////////////////
// so that no nodes have extra indegree
// if they have, they will not be able to contribute to the chains (ans)
// all nodes contributing extra indegrees are detected and their contri
// is nullified.
rep(i, 2, n){
if(indegree[i]==0) Q.push(i);
}
while(!Q.empty()){
ll u = Q.front();
Q.pop();
for(ll v: graph[u]){
indegree[v]--;
if(indegree[v]==0) Q.push(v);
}
}
////////////////////////////////////////////
Q.push(1);
ll chainspropagated[n+1] = {0};
chainspropagated[1] = 1;
// topsort using bfs
while(!Q.empty()){
ll u = Q.front();
Q.pop();
for(ll v:graph[u]){
indegree[v]--;
(chainspropagated[v]+=chainspropagated[u])%=MOD;
if(indegree[v]==0) Q.push(v);
}
}
cout<<chainspropagated[n];
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int tc = 1;
// cin >> tc;
for (int t = 1; t <= tc; t++) {
// cout << "Case #" << t << ": ";
solve();
}
} | [
"skrstv123@gmail.com"
] | skrstv123@gmail.com |
846252cc2dfcd46b2814956f5f897bbaa986e3d8 | c15eb5614c7111859f5441f1ef7555aeddf33197 | /Project_171005/Project_171005/TicketMachine.h | 968cb744be70f07305a5d805c42204963fa04127 | [] | no_license | itachixc/learning-c- | b058f11a50f5b1c16957b024fa891255e75dabbb | 2b121f0a6add50fa85bf7de1b21c2307ed7b474a | refs/heads/master | 2021-08-07T11:49:09.834403 | 2017-11-08T03:55:46 | 2017-11-08T03:55:46 | 105,867,717 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 248 | h | #pragma once
class TicketMachine
{
public:
TicketMachine();
~TicketMachine();
void showPrompt();
void insertMoney(int money);
void showBalance();
void printTicket();
void showTotal();
private:
const int PRICE;
int balance;
int total;
};
| [
"itachi@mail.ustc.edu.cn"
] | itachi@mail.ustc.edu.cn |
d15231d90c8b0f5c2262dd5aaf086a941c11f352 | 2c78de0b151238b1c0c26e6a4d1a36c7fa09268c | /MDProcess/MDAModel/impl/RoseModelImpl/ImplementedItemImpl_factory.h | 85713928dad7b65914df52b39ff8f68162572c6e | [] | no_license | bravesoftdz/realwork | 05a3b308cef59bed8a9efda4212849c391b4b267 | 19b446ce8ad2adf82ab8ce7988bc003221accad2 | refs/heads/master | 2021-06-07T23:57:22.429896 | 2016-11-01T18:30:21 | 2016-11-01T18:30:21 | null | 0 | 0 | null | null | null | null | WINDOWS-1251 | C++ | false | false | 1,894 | h | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Модуль: "w:/MDProcess/MDAModel/impl/RoseModelImpl/ImplementedItemImpl_factory.h"
// генератор заголовочных файлов для фабрик интерфейсов (.h)
// Generated from UML model, root element: <<Servant::Class>> MDProcess::MDAModel::RoseModelImpl::ImplementedItemImpl
// Заголовк реализации фабрик интерфеса ImplementedItem для серванта ImplementedItemImpl
//
//
// Все права принадлежат ООО НПП "Гарант-Сервис".
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef __MDPROCESS_MDAMODEL_ROSEMODELIMPL_IMPLEMENTEDITEMIMPL_FCTR_H__
#define __MDPROCESS_MDAMODEL_ROSEMODELIMPL_IMPLEMENTEDITEMIMPL_FCTR_H__
#include "shared/CoreSrv/sys/std_inc.h"
#include "MDProcess/MDAModel/RoseModel/RoseModelFactories.h"
#include "MDProcess/MDAModel/impl/RoseModelImpl/RoseModelImpl.h"
namespace RoseModelImpl {
/// Interface-factory implementation for ImplementedItemImpl
class ImplementedItemImpl_factory:
virtual public ::Core::RefCountObjectBase
, virtual public ImplementedItemAbstractFactory
{
public:
ImplementedItemImpl_factory ();
void registrate_me (Core::Root::FactoryPriority priority) /*throw (Core::Root::DuplicatedFactoryKey)*/;
protected:
const char* key () const;
ImplementedItem* make (const std::string& uid, bool need_collect_child);
};
typedef ::Core::Var<ImplementedItemImpl_factory> ImplementedItemImpl_factory_var;
} // namespace RoseModelImpl
#endif //__MDPROCESS_MDAMODEL_ROSEMODELIMPL_IMPLEMENTEDITEMIMPL_FCTR_H__
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
| [
"instigator21@gmail.com"
] | instigator21@gmail.com |
f203e5645fb7bac39b0dc72d59a56df639e6ea87 | b443e5377d348394015f611bb15c4186415215be | /game66/server/servers/war_server/src/game_imple_table.cpp | 35dcaa96158a57da6fe7be4aef8151561d3955a2 | [] | no_license | lemontreehuang/game66 | 67c029fc6ad0ca62de82eeee9533e3ab34287bc8 | afc7532c8e84e8743e403d4b39a1cccd187c8e29 | refs/heads/master | 2023-03-16T00:23:58.639075 | 2020-10-14T13:40:19 | 2020-10-14T13:40:19 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 104,338 | cpp |
#include <data_cfg_mgr.h>
#include <center_log.h>
#include "game_imple_table.h"
#include "stdafx.h"
#include "game_room.h"
#include "json/json.h"
#include "robot_mgr.h"
using namespace std;
using namespace svrlib;
using namespace net;
using namespace game_war;
namespace
{
const static uint32 s_FreeTime = 3*1000; // 空闲时间
const static uint32 s_PlaceJettonTime = 13*1000; // 下注时间
const static uint32 s_DispatchTime = 10*1000; // 发牌时间
};
CGameTable* CGameRoom::CreateTable(uint32 tableID)
{
CGameTable* pTable = NULL;
switch(m_roomCfg.roomType)
{
case emROOM_TYPE_COMMON: //
{
pTable = new CGameWarTable(this,tableID,emTABLE_TYPE_SYSTEM);
}break;
case emROOM_TYPE_MATCH: //
{
pTable = new CGameWarTable(this,tableID,emTABLE_TYPE_SYSTEM);
}break;
case emROOM_TYPE_PRIVATE: //
{
pTable = new CGameWarTable(this,tableID,emTABLE_TYPE_PLAYER);
}break;
default:
{
assert(false);
return NULL;
}break;
}
return pTable;
}
// 梭哈游戏桌子
CGameWarTable::CGameWarTable(CGameRoom* pRoom,uint32 tableID,uint8 tableType)
:CGameTable(pRoom,tableID,tableType)
{
m_vecPlayers.clear();
//总下注数
memset(m_allJettonScore,0,sizeof(m_allJettonScore));
memset(m_playerJettonScore,0,sizeof(m_playerJettonScore));
//个人下注
for(uint8 i=0;i<JETTON_INDEX_COUNT;++i){
m_userJettonScore[i].clear();
}
//玩家成绩
m_mpUserWinScore.clear();
//扑克信息
memset(m_cbTableCardArray,0,sizeof(m_cbTableCardArray));
m_robotBankerWinPro = 0;
m_robotBankerMaxCardPro = 0;
m_pCurBanker = NULL;
m_tagControlPalyer.Init();
m_bInitTableSuccess = false;
m_bIsChairRobotAlreadyJetton = false;
m_chairRobotPlaceJetton.clear();
m_bIsRobotAlreadyJetton = false;
m_RobotPlaceJetton.clear();
return;
}
CGameWarTable::~CGameWarTable()
{
}
bool CGameWarTable::CanEnterTable(CGamePlayer* pPlayer)
{
if (pPlayer->GetTable() != NULL)
{
return false;
}
// 限额进入
if(IsFullTable() || GetPlayerCurScore(pPlayer) < GetEnterMin())
{
return false;
}
return true;
}
bool CGameWarTable::CanLeaveTable(CGamePlayer* pPlayer)
{
if (pPlayer == NULL)
{
LOG_DEBUG("roomid:%d,tableid:%d", GetRoomID(), GetTableID());
return false;
}
if (m_pCurBanker == pPlayer || IsSetJetton(pPlayer->GetUID()))
{
return false;
}
if (pPlayer->IsRobot() == false)
{
LOG_DEBUG("roomid:%d,tableid:%d,uid:%d", GetRoomID(), GetTableID(), pPlayer->GetUID());
}
return true;
}
bool CGameWarTable::CanSitDown(CGamePlayer* pPlayer,uint16 chairID)
{
return CGameTable::CanSitDown(pPlayer,chairID);
}
bool CGameWarTable::CanStandUp(CGamePlayer* pPlayer)
{
return true;
}
bool CGameWarTable::IsFullTable()
{
if(m_mpLookers.size() >= 200)
return true;
return false;
}
void CGameWarTable::GetTableFaceInfo(net::table_face_info* pInfo)
{
net::war_table_info* pwar = pInfo->mutable_war();
pwar->set_tableid(GetTableID());
pwar->set_tablename(m_conf.tableName);
if(m_conf.passwd.length() > 1){
pwar->set_is_passwd(1);
}else{
pwar->set_is_passwd(0);
}
pwar->set_hostname(m_conf.hostName);
pwar->set_basescore(m_conf.baseScore);
pwar->set_consume(m_conf.consume);
pwar->set_entermin(m_conf.enterMin);
pwar->set_duetime(m_conf.dueTime);
pwar->set_feetype(m_conf.feeType);
pwar->set_feevalue(m_conf.feeValue);
pwar->set_card_time(s_PlaceJettonTime);
pwar->set_table_state(GetGameState());
pwar->set_sitdown(m_pHostRoom->GetSitDown());
}
//配置桌子
bool CGameWarTable::Init()
{
if (m_pHostRoom == NULL) {
return false;
}
SetGameState(net::TABLE_STATE_WAR_FREE);
m_vecPlayers.resize(GAME_PLAYER);
for(uint8 i=0;i<GAME_PLAYER;++i)
{
m_vecPlayers[i].Reset();
}
m_robotApplySize = g_RandGen.RandRange(4, 8);//机器人申请人数
m_robotChairSize = g_RandGen.RandRange(2, 4);//机器人座位数
m_iArrDispatchCardPro[Pro_Index_BaoZi] = 23;
m_iArrDispatchCardPro[Pro_Index_ShunJin] = 22;
m_iArrDispatchCardPro[Pro_Index_JinHua] = 800;
m_iArrDispatchCardPro[Pro_Index_ShunZi] = 655;
m_iArrDispatchCardPro[Pro_Index_Double] = 4000;
m_iArrDispatchCardPro[Pro_Index_Single] = 4500;
m_sysBankerWinPro = 80;
ReAnalysisParam();
m_bInitTableSuccess = true;
CRobotOperMgr::Instance().PushTable(this);
SetMaxChairNum(GAME_PLAYER); // add by har
return true;
}
bool CGameWarTable::ReAnalysisParam() {
string param = m_pHostRoom->GetCfgParam();
Json::Reader reader;
Json::Value jvalue;
if (!reader.parse(param, jvalue))
{
LOG_ERROR("reader json parse error - roomid:%d,param:%s", m_pHostRoom->GetRoomID(),param.c_str());
return true;
}
for (int i = 0; i < Pro_Index_MAX; i++)
{
string strPro = CStringUtility::FormatToString("pr%d", i);
if (jvalue.isMember(strPro.c_str()) && jvalue[strPro.c_str()].isIntegral())
{
m_iArrDispatchCardPro[i] = jvalue[strPro.c_str()].asInt();
}
}
if (jvalue.isMember("sbw") && jvalue["sbw"].isIntegral())
{
m_sysBankerWinPro = jvalue["sbw"].asInt();
}
LOG_ERROR("reader_json - roomid:%d,tableid:%d,m_sysBankerWinPro:%d,m_iArrDispatchCardPro:%d %d %d %d %d %d",
GetRoomID(), GetTableID(), m_sysBankerWinPro, m_iArrDispatchCardPro[0], m_iArrDispatchCardPro[1], m_iArrDispatchCardPro[2], m_iArrDispatchCardPro[3], m_iArrDispatchCardPro[4], m_iArrDispatchCardPro[5]);
return true;
}
void CGameWarTable::ShutDown()
{
}
//复位桌子
void CGameWarTable::ResetTable()
{
ResetGameData();
}
// 是否能够开始游戏
bool CGameWarTable::IsCanStartGame()
{
bool bFlag = true;
if (m_bInitTableSuccess == false)
{
bFlag = false;
}
return bFlag;
}
void CGameWarTable::OnTimeTick()
{
OnTableTick();
uint8 tableState = GetGameState();
if(m_coolLogic.isTimeOut())
{
switch(tableState)
{
case TABLE_STATE_WAR_FREE: // 空闲
{
// if(IsCanStartGame())
//{
// SetGameState(TABLE_STATE_WAR_PLACE_JETTON);
// m_coolLogic.beginCooling(s_PlaceJettonTime);
// OnGameStart();
// InitBlingLog();
// InitChessID();
// CalculateDeity();
// }
//else
//{
// m_coolLogic.beginCooling(s_FreeTime);
// }
}break;
case TABLE_STATE_WAR_PLACE_JETTON: // 下注时间
{
SetGameState(TABLE_STATE_WAR_GAME_END);
m_coolLogic.beginCooling(s_DispatchTime);
DispatchTableCard();
m_bIsChairRobotAlreadyJetton = false;
m_chairRobotPlaceJetton.clear();
m_bIsRobotAlreadyJetton = false;
m_RobotPlaceJetton.clear();
OnGameEnd(INVALID_CHAIR,GER_NORMAL);
m_brc_table_status = emTABLE_STATUS_END;
m_brc_table_status_time = 0;
//同步刷新百人场控制界面的桌子状态信息
OnBrcControlFlushTableStatus();
}break;
case TABLE_STATE_WAR_GAME_END: // 结束游戏
{
ClearTurnGameData();
SetGameState(TABLE_STATE_WAR_FREE);
m_coolLogic.beginCooling(s_FreeTime);
m_brc_table_status = emTABLE_STATUS_FREE;
m_brc_table_status_time = 0;
//同步刷新百人场控制界面的桌子状态信息
OnBrcControlFlushTableStatus();
}break;
default:
break;
}
}
if(tableState == TABLE_STATE_WAR_PLACE_JETTON && m_coolLogic.getPassTick() > 3000)
{
//OnRobotOper();
OnChairRobotJetton();
OnRobotJetton();
}
}
void CGameWarTable::OnRobotTick()
{
uint8 tableState = GetGameState();
int64 passtick = m_coolLogic.getPassTick();
//LOG_DEBUG("on_time_tick_loop - roomid:%d,tableid:%d,m_lGameCount:%lld,tableState:%d,passtick:%lld", GetRoomID(), GetTableID(), m_lGameCount, tableState, passtick);
if (tableState == net::TABLE_STATE_WAR_PLACE_JETTON && m_coolLogic.getPassTick() > 500)
{
OnChairRobotPlaceJetton();
OnRobotPlaceJetton();
}
if (m_coolLogic.isTimeOut())
{
switch (tableState)
{
case TABLE_STATE_WAR_FREE: // 空闲
{
if (IsCanStartGame())
{
if (OnGameStart())
{
InitBlingLog();
InitChessID();
CalculateDeity();
}
m_brc_table_status = emTABLE_STATUS_START;
m_brc_table_status_time = s_PlaceJettonTime;
//同步刷新百人场控制界面的桌子状态信息
OnBrcControlFlushTableStatus();
}
else
{
m_coolLogic.beginCooling(s_FreeTime);
}
}break;
default:
break;
}
}
}
// 游戏消息
int CGameWarTable::OnGameMessage(CGamePlayer* pPlayer,uint16 cmdID, const uint8* pkt_buf, uint16 buf_len)
{
if (pPlayer == NULL)
{
LOG_DEBUG("table recv - roomid:%d,tableid:%d,pPlayer:%p,cmdID:%d", GetRoomID(), GetTableID(), pPlayer, cmdID);
return 0;
}
if (pPlayer->IsRobot() == false)
{
LOG_DEBUG("table recv - roomid:%d,tableid:%d,uid:%d,cmdID:%d", GetRoomID(), GetTableID(), pPlayer->GetUID(), cmdID);
}
switch(cmdID)
{
case net::C2S_MSG_WAR_PLACE_JETTON: // 用户加注
{
if(GetGameState() != TABLE_STATE_WAR_PLACE_JETTON)
{
LOG_DEBUG("not jetton state can't jetton");
return 0;
}
net::msg_war_place_jetton_req msg;
PARSE_MSG_FROM_ARRAY(msg);
return OnUserPlaceJetton(pPlayer,msg.jetton_area(),msg.jetton_score());
}break;
case net::C2S_MSG_WAR_CONTINUOUS_PRESSURE_REQ://
{
net::msg_player_continuous_pressure_jetton_req msg;
PARSE_MSG_FROM_ARRAY(msg);
return OnUserContinuousPressure(pPlayer, msg);
}break;
case net::C2S_MSG_BRC_CONTROL_ENTER_TABLE_REQ://
{
net::msg_brc_control_user_enter_table_req msg;
PARSE_MSG_FROM_ARRAY(msg);
return OnBrcControlEnterControlInterface(pPlayer);
}break;
case net::C2S_MSG_BRC_CONTROL_LEAVE_TABLE_REQ://
{
net::msg_brc_control_user_leave_table_req msg;
PARSE_MSG_FROM_ARRAY(msg);
return OnBrcControlPlayerLeaveInterface(pPlayer);
}break;
case net::C2S_MSG_BRC_CONTROL_AREA_INFO_REQ://
{
net::msg_brc_control_area_info_req msg;
PARSE_MSG_FROM_ARRAY(msg);
return OnBrcControlPlayerBetArea(pPlayer, msg);
}break;
default:
{
return 0;
}
}
return 0;
}
//用户断线或重连
bool CGameWarTable::OnActionUserNetState(CGamePlayer* pPlayer,bool bConnected,bool isJoin)
{
LOG_DEBUG("roomid:%d,tableid:%d,uid:%d,bConnected:%d,isJoin:%d",GetRoomID(),GetTableID(), pPlayer->GetUID(), bConnected, isJoin);
if(bConnected)//断线重连
{
if(isJoin)
{
pPlayer->SetPlayDisconnect(false);
PlayerSetAuto(pPlayer,0);
SendTableInfoToClient(pPlayer);
SendSeatInfoToClient(pPlayer);
if(m_mpLookers.find(pPlayer->GetUID()) != m_mpLookers.end()){
NotifyPlayerJoin(pPlayer,true);
}
SendLookerListToClient(pPlayer);
SendGameScene(pPlayer);
SendPlayLog(pPlayer);
}
}else{
pPlayer->SetPlayDisconnect(true);
}
return true;
}
//用户坐下
bool CGameWarTable::OnActionUserSitDown(WORD wChairID,CGamePlayer* pPlayer)
{
SendSeatInfoToClient();
return true;
}
//用户起立
bool CGameWarTable::OnActionUserStandUp(WORD wChairID,CGamePlayer* pPlayer)
{
SendSeatInfoToClient();
return true;
}
// 游戏开始
bool CGameWarTable::OnGameStart()
{
if (m_pHostRoom == NULL)
{
return false;
}
if (m_pHostRoom->GetCanGameStart() == false)
{
//LOG_DEBUG("start_error - GameType:%d,roomid:%d,tableid:%d", GetGameType(), GetRoomID(), GetTableID());
return false;
}
LOG_DEBUG("game_start - GameType:%d,roomid:%d,tableid:%d", GetGameType(), GetRoomID(), GetTableID());
//LOG_DEBUG("game start - roomid:%d,tableid:%d,m_robotBankerWinPro:%d",m_pHostRoom->GetRoomID(),GetTableID(), m_robotBankerWinPro);
m_curr_bet_user.clear();
SetGameState(TABLE_STATE_WAR_PLACE_JETTON);
m_coolLogic.beginCooling(s_PlaceJettonTime);
net::msg_war_start_rep gameStart;
gameStart.set_time_leave(m_coolLogic.getCoolTick());
SendMsgToAll(&gameStart,net::S2C_MSG_WAR_START);
OnTableGameStart();
//OnRobotStandUp();
return true;
}
uint32 CGameWarTable::GetBankerUID()
{
return 0;
}
//游戏结束
bool CGameWarTable::OnGameEnd(uint16 chairID,uint8 reason)
{
LOG_DEBUG("game end - roomid%d,tableid:%d",GetRoomID(),GetTableID());
switch(reason)
{
case GER_NORMAL: //常规结束
{
AddPlayerToBlingLog();
for (uint8 i = 0; i<JETTON_INDEX_COUNT; ++i)
{
auto iter = m_userJettonScore[i].begin();
for (; iter != m_userJettonScore[i].end(); iter++)
{
if (iter->second != 0)
{
OnAddPlayerJetton(iter->first, iter->second);
}
}
}
//计算分数
int64 lBankerWinScore = CalculateScore();
int64 playerAllWinScore = 0; // 玩家总赢分,红黑大战玩家不能上庄 add by har
WriteGameInfoLog();
//结束消息
net::msg_war_game_end msg;
msg.set_time_leave(m_coolLogic.getCoolTick());
for(uint8 i=0;i<SHOW_CARD_COUNT;++i)
{
net::msg_cards* pCards = msg.add_table_cards();
for(uint8 j=0;j<MAX_CARD_COUNT;++j)
{
pCards->add_cards(m_cbTableCardArray[i][j]);
}
}
for(uint8 i=0;i<SHOW_CARD_COUNT;++i)
{
msg.add_card_types(m_cbTableCardType[i]);
}
for(uint8 i=0;i<JETTON_INDEX_COUNT;++i)
{
msg.add_win_multiple(m_winMultiple[i]);
}
for (uint8 i = 0; i<JETTON_INDEX_COUNT; ++i)
{
msg.add_win_index(m_winIndex[i]);
}
LOG_DEBUG("roomid:%d,tableid:%d,lBankerWinScore:%lld,CardType:%d %d,cbWinArea:%d %d %d,lWinMultiple:%d %d %d",
GetRoomID(), GetTableID(),lBankerWinScore, m_cbTableCardType[0], m_cbTableCardType[1], m_winIndex[0], m_winIndex[1], m_winIndex[2], m_winMultiple[0], m_winMultiple[1], m_winMultiple[2]);
//发送积分
for (WORD wUserIndex = 0; wUserIndex < GAME_PLAYER; ++wUserIndex)
{
//设置成绩
CGamePlayer *pPlayer = GetPlayer(wUserIndex);
if (pPlayer == NULL)
{
msg.add_player_score(0);
}
else
{
int64 lUserScoreFree = CalcPlayerInfo(pPlayer->GetUID(), m_mpUserWinScore[pPlayer->GetUID()], m_mpWinScoreForFee[pPlayer->GetUID()]);
lUserScoreFree = lUserScoreFree + m_mpUserWinScore[pPlayer->GetUID()];
m_mpUserWinScore[pPlayer->GetUID()] = lUserScoreFree;
//uint32 uid = GetPlayerID(wUserIndex);
msg.add_player_score(m_mpUserWinScore[pPlayer->GetUID()]);
// add by har
if (!pPlayer->IsRobot())
playerAllWinScore += lUserScoreFree; // add by har end
}
}
for (WORD wUserIndex = 0; wUserIndex < GAME_PLAYER; ++wUserIndex)
{
CGamePlayer *pPlayer = GetPlayer(wUserIndex);
if (pPlayer == NULL)
continue;
msg.set_user_score(m_mpUserWinScore[pPlayer->GetUID()]);
pPlayer->SendMsgToClient(&msg, net::S2C_MSG_WAR_GAME_END);
//精准控制统计
OnBrcControlSetResultInfo(pPlayer->GetUID(), m_mpUserWinScore[pPlayer->GetUID()]);
}
//发送旁观者积分
map<uint32,CGamePlayer*>::iterator it = m_mpLookers.begin();
for(;it != m_mpLookers.end();++it)
{
CGamePlayer* pPlayer = it->second;
if (pPlayer == NULL)
{
LOG_DEBUG("send_player_game_end - roomid:%d,tableid:%d", GetRoomID(), GetTableID());
continue;
}
int64 lUserScoreFree = CalcPlayerInfo(pPlayer->GetUID(), m_mpUserWinScore[pPlayer->GetUID()], m_mpWinScoreForFee[pPlayer->GetUID()]);
lUserScoreFree = lUserScoreFree + m_mpUserWinScore[pPlayer->GetUID()];
m_mpUserWinScore[pPlayer->GetUID()] = lUserScoreFree;
msg.set_user_score(lUserScoreFree);
LOG_DEBUG("send_player_game_end - roomid:%d,tableid:%d,uid:%d,score:%lld", GetRoomID(), GetTableID(), pPlayer->GetUID(), lUserScoreFree);
pPlayer->SendMsgToClient(&msg, net::S2C_MSG_WAR_GAME_END);
//精准控制统计
OnBrcControlSetResultInfo(pPlayer->GetUID(), m_mpUserWinScore[pPlayer->GetUID()]);\
// add by har
if (!pPlayer->IsRobot())
playerAllWinScore += lUserScoreFree; // add by har end
}
//更新活跃福利数据
int64 curr_win = m_mpUserWinScore[m_aw_ctrl_uid];
UpdateActiveWelfareInfo(m_aw_ctrl_uid, curr_win);
LOG_DEBUG("OnGameEnd2 - roomid:%d,tableid:%d,playerAllWinScore:%d", GetRoomID(), GetTableID(), playerAllWinScore);
m_pHostRoom->UpdateStock(this, playerAllWinScore); // 必须写在m_userJettonScore清零的前面 add by har
//同步所有玩家数据到控端
OnBrcFlushSendAllPlayerInfo();
//个人下注
for (uint8 i = 0; i<JETTON_INDEX_COUNT; ++i) {
m_userJettonScore[i].clear();
}
SaveBlingLog();
OnTableGameEnd();
return true;
}break;
case GER_DISMISS: //游戏解散
{
LOG_ERROR("强制游戏解散");
for(uint8 i=0;i<GAME_PLAYER;++i)
{
if(m_vecPlayers[i].pPlayer != NULL) {
LeaveTable(m_vecPlayers[i].pPlayer);
}
}
ResetTable();
return true;
}break;
case GER_NETWORK_ERROR: //用户强退
case GER_USER_LEAVE:
default:
break;
}
//错误断言
assert(false);
return false;
}
//玩家进入或离开
void CGameWarTable::OnPlayerJoin(bool isJoin,uint16 chairID,CGamePlayer* pPlayer)
{
uint32 uid = 0;
if (pPlayer!=NULL) {
uid = pPlayer->GetUID();
}
//int64 lCurScore = GetPlayerCurScore(pPlayer);
// LOG_DEBUG("PlayerJoin - roomid:%d,tableid:%d,uid:%d,isJoin:%d,chairID:%d,lCurScore:%lld", GetRoomID(),GetTableID(),uid, isJoin,chairID, lCurScore);
LOG_DEBUG("player join - uid:%d,chairID:%d,isJoin:%d,looksize:%d,lCurScore:%lld", uid, chairID, isJoin, m_mpLookers.size(), GetPlayerCurScore(pPlayer));
UpdateEnterScore(isJoin, pPlayer);
CGameTable::OnPlayerJoin(isJoin,chairID,pPlayer);
if(isJoin)
{
SendGameScene(pPlayer);
SendPlayLog(pPlayer);
}
else
{
for(uint8 i=0;i<JETTON_INDEX_COUNT;++i)
{
m_userJettonScore[i].erase(pPlayer->GetUID());
}
}
//刷新控制界面的玩家数据
if (!pPlayer->IsRobot())
{
OnBrcFlushSendAllPlayerInfo();
}
}
// 发送场景信息(断线重连)
void CGameWarTable::SendGameScene(CGamePlayer* pPlayer)
{
int64 lCurScore = GetPlayerCurScore(pPlayer);
LOG_DEBUG("send game scene - uid:%d,m_gameState:%d,lCurScore:%lld", pPlayer->GetUID(), m_gameState,lCurScore);
switch(m_gameState)
{
case net::TABLE_STATE_WAR_FREE: // 空闲状态
{
net::msg_war_game_info_free_rep msg;
msg.set_time_leave(m_coolLogic.getCoolTick());
pPlayer->SendMsgToClient(&msg,net::S2C_MSG_WAR_GAME_FREE_INFO);
}break;
case net::TABLE_STATE_WAR_PLACE_JETTON: // 游戏状态
case net::TABLE_STATE_WAR_GAME_END: // 结束状态
{
net::msg_war_game_info_play_rep msg;
for(uint8 i=0;i<JETTON_INDEX_COUNT;++i){
msg.add_all_jetton_score(m_allJettonScore[i]);
}
msg.set_time_leave(m_coolLogic.getCoolTick());
msg.set_game_status(m_gameState);
for(uint8 i=0;i<JETTON_INDEX_COUNT;++i){
msg.add_self_jetton_score(m_userJettonScore[i][pPlayer->GetUID()]);
}
if (m_gameState == net::TABLE_STATE_WAR_GAME_END)
{
for (uint8 i = 0; i<SHOW_CARD_COUNT; ++i)
{
net::msg_cards* pCards = msg.add_table_cards();
for (uint8 j = 0; j<MAX_CARD_COUNT; ++j)
{
pCards->add_cards(m_cbTableCardArray[i][j]);
}
}
for (uint8 i = 0; i<SHOW_CARD_COUNT; ++i)
{
msg.add_card_types(m_cbTableCardType[i]);
}
}
pPlayer->SendMsgToClient(&msg,net::S2C_MSG_WAR_GAME_PLAY_INFO);
//刷新所有控制界面信息协议---用于断线重连的处理
if (pPlayer->GetCtrlFlag())
{
//刷新百人场桌子状态
m_brc_table_status_time = m_coolLogic.getCoolTick();
LOG_DEBUG("BBB - uid:%d,m_brc_table_status_time:%d", pPlayer->GetUID(), m_brc_table_status_time);
OnBrcControlFlushTableStatus(pPlayer);
//发送控制区域信息
OnBrcControlFlushAreaInfo(pPlayer);
//发送所有真实玩家列表
OnBrcControlSendAllPlayerInfo(pPlayer);
//发送机器人总下注信息
OnBrcControlSendAllRobotTotalBetInfo();
//发送真实玩家总下注信息
OnBrcControlSendAllPlayerTotalBetInfo();
//发送申请上庄玩家列表
OnBrcControlFlushAppleList();
}
}break;
default:
break;
}
SendLookerListToClient(pPlayer);
SendFrontJettonInfo(pPlayer);
}
int64 CGameWarTable::CalcPlayerInfo(uint32 uid,int64 winScore, int64 OnlywinScore,bool isBanker)
{
//LOG_DEBUG("report to lobby:%d %lld",uid,winScore);
int64 userJettonScore = 0;
for (int nAreaIndex = 0; nAreaIndex < JETTON_INDEX_COUNT; nAreaIndex++)
{
auto it_player_jetton = m_userJettonScore[nAreaIndex].find(uid);
if (it_player_jetton == m_userJettonScore[nAreaIndex].end())
{
continue;
}
userJettonScore += it_player_jetton->second;
}
//if (winScore == 0 && userJettonScore == 0)
//{
// return 0;
//}
int64 fee = GetBrcFee(uid, OnlywinScore, true);
winScore += fee;
CalcPlayerGameInfoForBrc(uid, winScore, 0, true, false, userJettonScore);
if(isBanker)
{
}
LOG_DEBUG("report to lobby:%d winScore:%lld OnlywinScore:%lld fee:%lld", uid, winScore, OnlywinScore, fee);
return fee;
}
// 重置游戏数据
void CGameWarTable::ResetGameData()
{
//总下注数
memset(m_allJettonScore,0,sizeof(m_allJettonScore));
memset(m_playerJettonScore,0,sizeof(m_playerJettonScore));
memset(m_winMultiple,0,sizeof(m_winMultiple));
//个人下注
for(uint8 i=0;i<JETTON_INDEX_COUNT;++i){
m_userJettonScore[i].clear();
}
//玩家成绩
m_mpUserWinScore.clear();
//扑克信息
memset(m_cbTableCardArray,0,sizeof(m_cbTableCardArray));
}
void CGameWarTable::ClearTurnGameData()
{
//总下注数
memset(m_allJettonScore,0,sizeof(m_allJettonScore));
memset(m_playerJettonScore, 0, sizeof(m_playerJettonScore));
//个人下注
for(uint8 i=0;i<JETTON_INDEX_COUNT;++i){
m_userJettonScore[i].clear();
}
//玩家成绩
m_mpUserWinScore.clear();
m_curr_bet_user.clear();
//扑克信息
memset(m_cbTableCardArray,0,sizeof(m_cbTableCardArray));
}
// 获取单个下注的是机器人还是玩家 add by har
void CGameWarTable::IsRobotOrPlayerJetton(CGamePlayer *pPlayer, bool &isAllPlayer, bool &isAllRobot) {
for (uint16 wAreaIndex = 0; wAreaIndex < JETTON_INDEX_COUNT; ++wAreaIndex) {
map<uint32, int64>::iterator it_player_jetton = m_userJettonScore[wAreaIndex].find(pPlayer->GetUID());
if (it_player_jetton == m_userJettonScore[wAreaIndex].end())
continue;
if (it_player_jetton->second == 0)
continue;
if (!pPlayer->IsRobot())
isAllRobot = false;
isAllPlayer = false;
return;
}
}
// 写入出牌log
void CGameWarTable::WriteOutCardLog(uint16 chairID,uint8 cardData[],uint8 cardCount,int32 mulip)
{
uint8 cardType = m_GameLogic.GetCardType(cardData,cardCount);
Json::Value logValue;
logValue["p"] = chairID;
logValue["m"] = mulip;
logValue["cardtype"] = cardType;
for(uint32 i=0;i<cardCount;++i){
logValue["c"].append(cardData[i]);
}
m_operLog["card"].append(logValue);
}
// 写入加注log
void CGameWarTable::WriteAddScoreLog(uint32 uid,uint8 area,int64 score)
{
if(score == 0)
return;
Json::Value logValue;
logValue["uid"] = uid;
logValue["p"] = area;
logValue["s"] = score;
m_operLog["op"].append(logValue);
}
// 写入最大牌型
void CGameWarTable::WriteMaxCardType(uint32 uid,uint8 cardType)
{
Json::Value logValue;
logValue["uid"] = uid;
logValue["mt"] = cardType;
m_operLog["maxcard"].append(logValue);
}
void CGameWarTable::WriteGameInfoLog()
{
// 椅子用户
for (int nChairID = 0; nChairID<GAME_PLAYER; nChairID++)
{
CGamePlayer * pPlayer = GetPlayer(nChairID);
if (pPlayer == NULL)
{
continue;
}
uint32 dwUserID = pPlayer->GetUID();
int64 lUserJettonScore = 0;
Json::Value logValue;
logValue["uid"] = dwUserID;
for (int nAreaIndex = 0; nAreaIndex<JETTON_INDEX_COUNT; nAreaIndex++)
{
auto it_player_jetton = m_userJettonScore[nAreaIndex].find(dwUserID);
if (it_player_jetton == m_userJettonScore[nAreaIndex].end())
{
continue;
}
int64 lIndexJettonScore = it_player_jetton->second;
lUserJettonScore += lIndexJettonScore;
string strindex = CStringUtility::FormatToString("score_%d", nAreaIndex);
logValue[strindex.c_str()] = lIndexJettonScore;
}
if (lUserJettonScore>0)
{
logValue["score_a"] = lUserJettonScore;
m_operLog["userBetInfo"].append(logValue);
}
}
// 旁观用户
auto it_looker = m_mpLookers.begin();
for (; it_looker != m_mpLookers.end(); it_looker++)
{
CGamePlayer * pPlayer = it_looker->second;
if (pPlayer == NULL)
{
continue;
}
uint32 dwUserID = pPlayer->GetUID();
int64 lUserJettonScore = 0;
Json::Value logValue;
logValue["uid"] = dwUserID;
for (int nAreaIndex = 0; nAreaIndex<JETTON_INDEX_COUNT; nAreaIndex++)
{
auto it_player_jetton = m_userJettonScore[nAreaIndex].find(dwUserID);
if (it_player_jetton == m_userJettonScore[nAreaIndex].end())
{
continue;
}
int64 lIndexJettonScore = it_player_jetton->second;
lUserJettonScore += lIndexJettonScore;
string strindex = CStringUtility::FormatToString("score_%d", nAreaIndex);
logValue[strindex.c_str()] = lIndexJettonScore;
}
if (lUserJettonScore>0)
{
logValue["score_a"] = lUserJettonScore;
m_operLog["userBetInfo"].append(logValue);
}
}
//写扑克牌
for (int i = 0; i < SHOW_CARD_COUNT; i++)
{
Json::Value logValue;
logValue["p"] = i;
logValue["t"] = m_cbTableCardType[i];
for (int j = 0; j < MAX_CARD_COUNT; j++)
{
logValue["c"].append(m_cbTableCardArray[i][j]);
}
m_operLog["card"].append(logValue);
}
Json::Value logValueMultiple;
for (int i = 0; i < JETTON_INDEX_COUNT; i++)
{
logValueMultiple["m"].append(m_winMultiple[i]);
logValueMultiple["w"].append(m_winIndex[i]);
}
m_operLog["ji"] = logValueMultiple;
}
//加注事件
bool CGameWarTable:: OnUserPlaceJetton(CGamePlayer* pPlayer, BYTE cbJettonArea, int64 lJettonScore)
{
//LOG_DEBUG("player place jetton:%d--%d--%lld",pPlayer->GetUID(),cbJettonArea,lJettonScore);
//效验参数
if (pPlayer->IsRobot() == false)
{
LOG_DEBUG("table recv - roomid:%d,tableid:%d,uid:%d,GetGameState:%d,cbJettonArea:%d,lJettonScore:%lld",
GetRoomID(), GetTableID(), pPlayer->GetUID(), GetGameState(), cbJettonArea, lJettonScore);
}
if(cbJettonArea > JETTON_INDEX_OTHER || lJettonScore <= 0)
{
if (pPlayer->IsRobot() == false)
{
LOG_DEBUG("jetton error - roomid:%d,tableid:%d,uid:%d,cbJettonArea:%d,lJettonScore:%lld", GetRoomID(), GetTableID(), pPlayer->GetUID(), cbJettonArea, lJettonScore);
}
return false;
}
if(GetGameState() != net::TABLE_STATE_WAR_PLACE_JETTON)
{
net::msg_war_place_jetton_rep msg;
msg.set_jetton_area(cbJettonArea);
msg.set_jetton_score(lJettonScore);
msg.set_result(net::RESULT_CODE_FAIL);
//发送消息
pPlayer->SendMsgToClient(&msg,net::S2C_MSG_WAR_PLACE_JETTON_REP);
return true;
}
//变量定义
int64 lJettonCount = 0L;
for (int nAreaIndex = 0; nAreaIndex < JETTON_INDEX_COUNT; ++nAreaIndex)
{
lJettonCount += m_userJettonScore[nAreaIndex][pPlayer->GetUID()];
}
if (TableJettonLimmit(pPlayer, lJettonScore, lJettonCount) == false)
{
if (pPlayer->IsRobot() == false)
{
LOG_DEBUG("table_jetton_limit - roomid:%d,tableid:%d,uid:%d,curScore:%lld,jettonmin:%lld",
GetRoomID(), GetTableID(), pPlayer->GetUID(), GetPlayerCurScore(pPlayer), GetJettonMin());
}
net::msg_war_place_jetton_rep msg;
msg.set_jetton_area(cbJettonArea);
msg.set_jetton_score(lJettonScore);
msg.set_result(net::RESULT_CODE_FAIL);
//发送消息
pPlayer->SendMsgToClient(&msg, net::S2C_MSG_WAR_PLACE_JETTON_REP);
return true;
}
//玩家积分
int64 lUserScore = GetPlayerCurScore(pPlayer);
//合法校验
if(lUserScore < lJettonCount + lJettonScore)
{
if (pPlayer->IsRobot() == false)
{
LOG_DEBUG("jetton more - roomid:%d,tableid:%d,uid:%d,cbJettonArea:%d,lJettonScore:%lld,lJettonCount:%lld,lUserScore:%lld",
GetRoomID(), GetTableID(), pPlayer->GetUID(), cbJettonArea, lJettonScore, lJettonCount, lUserScore);
}
net::msg_war_place_jetton_rep msg;
msg.set_jetton_area(cbJettonArea);
msg.set_jetton_score(lJettonScore);
msg.set_result(net::RESULT_CODE_FAIL);
//发送消息
pPlayer->SendMsgToClient(&msg, net::S2C_MSG_WAR_PLACE_JETTON_REP);
return true;
}
//保存下注
m_allJettonScore[cbJettonArea] += lJettonScore;
if (!pPlayer->IsRobot())
{
m_playerJettonScore[cbJettonArea] += lJettonScore;
m_curr_bet_user.insert(pPlayer->GetUID());
}
m_userJettonScore[cbJettonArea][pPlayer->GetUID()] += lJettonScore;
//OnAddPlayerJetton(pPlayer->GetUID(), lJettonScore);
RecordPlayerBaiRenJettonInfo(pPlayer, cbJettonArea, lJettonScore);
AddUserBlingLog(pPlayer);
net::msg_war_place_jetton_rep msg;
msg.set_jetton_area(cbJettonArea);
msg.set_jetton_score(lJettonScore);
msg.set_result(net::RESULT_CODE_SUCCESS);
//发送消息
pPlayer->SendMsgToClient(&msg, net::S2C_MSG_WAR_PLACE_JETTON_REP);
net::msg_war_place_jetton_broadcast broad;
broad.set_uid(pPlayer->GetUID());
broad.set_jetton_area(cbJettonArea);
broad.set_jetton_score(lJettonScore);
broad.set_total_jetton_score(m_allJettonScore[cbJettonArea]);
SendMsgToAll(&broad, net::S2C_MSG_WAR_PLACE_JETTON_BROADCAST);
//刷新百人场控制界面的下注信息
OnBrcControlBetDeal(pPlayer);
return true;
}
bool CGameWarTable::OnUserContinuousPressure(CGamePlayer* pPlayer, net::msg_player_continuous_pressure_jetton_req & msg)
{
//LOG_DEBUG("player place jetton:%d--%d--%lld",pPlayer->GetUID(),cbJettonArea,lJettonScore);
LOG_DEBUG("roomid:%d,tableid:%d,uid:%d,branker:%d,GetGameState:%d,info_size:%d",
GetRoomID(), GetTableID(), pPlayer->GetUID(), GetBankerUID(), GetGameState(), msg.info_size());
net::msg_player_continuous_pressure_jetton_rep rep;
rep.set_result(net::RESULT_CODE_FAIL);
if (msg.info_size() == 0 || GetGameState() != net::TABLE_STATE_WAR_PLACE_JETTON || pPlayer->GetUID() == GetBankerUID())
{
pPlayer->SendMsgToClient(&rep, net::S2C_MSG_WAR_CONTINUOUS_PRESSURE_REP);
return false;
}
//效验参数
int64 lTotailScore = 0;
for (int i = 0; i < msg.info_size(); i++)
{
net::bairen_jetton_info info = msg.info(i);
if (info.score() <= 0 || info.area()>=JETTON_INDEX_COUNT)
{
LOG_DEBUG("error_pressu - uid:%d,i:%d,area:%d,score:%lld", pPlayer->GetUID(), i, info.area(), info.score());
pPlayer->SendMsgToClient(&rep, net::S2C_MSG_WAR_CONTINUOUS_PRESSURE_REP);
return false;
}
lTotailScore += info.score();
}
//变量定义
int64 lJettonCount = 0L;
for (int nAreaIndex = 0; nAreaIndex < JETTON_INDEX_COUNT; ++nAreaIndex)
{
lJettonCount += m_userJettonScore[nAreaIndex][pPlayer->GetUID()];
}
//玩家积分
int64 lUserScore = GetPlayerCurScore(pPlayer);
int64 lUserMaxJettonScore = lJettonCount + lTotailScore + GetJettonMin();
//合法校验
//if (lUserScore < lUserMaxJettonScore)
if (GetJettonMin() > GetEnterScore(pPlayer) || (lUserScore < lJettonCount + lTotailScore))
{
pPlayer->SendMsgToClient(&rep, net::S2C_MSG_WAR_CONTINUOUS_PRESSURE_REP);
LOG_DEBUG("error_pressu - uid:%d,lUserScore:%lld,lUserMaxJettonScore:%lld, lJettonCount:%lld,, lTotailScore:%lld,, GetJettonMin:%lld",
pPlayer->GetUID(), lUserScore, lUserMaxJettonScore, lJettonCount, lTotailScore, GetJettonMin());
return false;
}
//成功标识
//bool bPlaceJettonSuccess = true;
//for (int i = 0; i < msg.info_size(); i++)
//{
// net::bairen_jetton_info info = msg.info(i);
// if (info.score() <= 0 || info.area()>=JETTON_INDEX_COUNT)
// {
// LOG_DEBUG("error_pressu - uid:%d,i:%d,area:%d,score:%lld", pPlayer->GetUID(), i, info.area(), info.score());
// pPlayer->SendMsgToClient(&rep, net::S2C_MSG_WAR_CONTINUOUS_PRESSURE_REP);
// return false;
// }
// int64 lUserMaxJetton = GetUserMaxJetton(pPlayer, info.area());
// if (lUserMaxJetton < info.score())
// {
// LOG_DEBUG("error_pressu - uid:%d,i:%d,lUserMaxJetton:%lld,area:%d,score:%lld", pPlayer->GetUID(), i, lUserMaxJetton, info.area(), info.score());
// pPlayer->SendMsgToClient(&rep, net::S2C_MSG_WAR_CONTINUOUS_PRESSURE_REP);
// return false;
// }
//}
for (int i = 0; i < msg.info_size(); i++)
{
net::bairen_jetton_info info = msg.info(i);
m_allJettonScore[info.area()] += info.score();
if (!pPlayer->IsRobot())
{
m_playerJettonScore[info.area()] += info.score();
m_curr_bet_user.insert(pPlayer->GetUID());
}
m_userJettonScore[info.area()][pPlayer->GetUID()] += info.score();
RecordPlayerBaiRenJettonInfo(pPlayer, info.area(), info.score());
BYTE cbJettonArea = info.area();
int64 lJettonScore = info.score();
net::msg_war_place_jetton_rep msg;
msg.set_jetton_area(cbJettonArea);
msg.set_jetton_score(lJettonScore);
msg.set_result(net::RESULT_CODE_SUCCESS);
//发送消息
pPlayer->SendMsgToClient(&msg, net::S2C_MSG_WAR_PLACE_JETTON_REP);
net::msg_war_place_jetton_broadcast broad;
broad.set_uid(pPlayer->GetUID());
broad.set_jetton_area(cbJettonArea);
broad.set_jetton_score(lJettonScore);
broad.set_total_jetton_score(m_allJettonScore[cbJettonArea]);
SendMsgToAll(&broad, net::S2C_MSG_WAR_PLACE_JETTON_BROADCAST);
}
rep.set_result(net::RESULT_CODE_SUCCESS);
pPlayer->SendMsgToClient(&rep, net::S2C_MSG_WAR_CONTINUOUS_PRESSURE_REP);
//刷新百人场控制界面的下注信息
OnBrcControlBetDeal(pPlayer);
return true;
}
int CGameWarTable::GetProCardType()
{
int iArrDispatchCardPro[Pro_Index_MAX] = { 0 };
for (int i = 0; i < Pro_Index_MAX; i++)
{
iArrDispatchCardPro[i] = m_iArrDispatchCardPro[i];
}
int iRandNum = g_RandGen.RandRange(0, PRO_DENO_10000);
int iProIndex = 0;
for (; iProIndex < Pro_Index_MAX; iProIndex++)
{
if (iArrDispatchCardPro[iProIndex] == 0)
{
continue;
}
if (iRandNum <= iArrDispatchCardPro[iProIndex])
{
break;
}
else
{
iRandNum -= iArrDispatchCardPro[iProIndex];
}
}
if (iProIndex >= Pro_Index_MAX)
{
iProIndex = 0;
}
return iProIndex;
}
bool CGameWarTable::ProbabilityDispatchPokerCard()
{
bool bIsFlag = true;
int iArProCardType[SHOW_CARD_COUNT] = { 0 };
// 先确定每一个人获取的类型
for (uint16 i = 0; i < SHOW_CARD_COUNT; ++i)
{
iArProCardType[i] = Pro_Index_MAX;
int iProIndex = GetProCardType();
if (iProIndex < Pro_Index_MAX)
{
iArProCardType[i] = iProIndex;
}
}
// 根据类型获取全部的手牌
for (int index = 0; index < 1024; index++)
{
bIsFlag = m_GameLogic.GetCardTypeData(iArProCardType, m_cbTableCardArray);
BYTE cbArTempCardData[SHOW_CARD_COUNT][MAX_COUNT] = { 0 };
memcpy(cbArTempCardData, m_cbTableCardArray, sizeof(cbArTempCardData));
if (m_GameLogic.IsSameCard(cbArTempCardData[0], cbArTempCardData[1], MAX_COUNT) == false)
{
break;
}
}
for (uint16 i = 0; i < SHOW_CARD_COUNT; ++i)
{
LOG_DEBUG("roomid:%d,tableid:%d,iArProCardType:%d,m_cbHandCardData:0x%02X 0x%02X 0x%02X",
GetRoomID(), GetTableID(), iArProCardType[i], m_cbTableCardArray[i][0], m_cbTableCardArray[i][1], m_cbTableCardArray[i][2]);
}
return bIsFlag;
}
void CGameWarTable::GetAreaInfo(WORD iLostIndex, WORD iWinIndex,BYTE cbType[], BYTE cbWinArea[], int64 lWinMultiple[])
{
for (int iJettonIndex = 0; iJettonIndex < JETTON_INDEX_COUNT; iJettonIndex++)
{
if (iJettonIndex == JETTON_INDEX_TIGER || iJettonIndex == JETTON_INDEX_LEOPARD)
{
if (iJettonIndex == iWinIndex)
{
cbWinArea[iJettonIndex] = TRUE;
lWinMultiple[iJettonIndex] = 1;
}
}
else if (iJettonIndex == JETTON_INDEX_OTHER)
{
int switch_on = cbType[iWinIndex];
switch (switch_on)
{
case CT_DOUBLE:
{
cbWinArea[iJettonIndex] = TRUE;
lWinMultiple[iJettonIndex] = 1;
}break;
case CT_SHUN_ZI:
{
cbWinArea[iJettonIndex] = TRUE;
lWinMultiple[iJettonIndex] = 2;
}break;
case CT_JIN_HUA:
{
cbWinArea[iJettonIndex] = TRUE;
lWinMultiple[iJettonIndex] = 3;
}break;
case CT_SHUN_JIN:
{
cbWinArea[iJettonIndex] = TRUE;
lWinMultiple[iJettonIndex] = 5;
}break;
case CT_BAO_ZI:
{
cbWinArea[iJettonIndex] = TRUE;
lWinMultiple[iJettonIndex] = 10;
}break;
}
}
}
}
bool CGameWarTable::SetControlPalyerWin(uint32 control_uid)
{
int iLoopCount = 99999;
int iLoopIndex = 0;
for (; iLoopIndex < iLoopCount; iLoopIndex++)
{
int64 lUserLostScore = 0;
int64 lUserWinScore = 0;
BYTE cbWinArea[JETTON_INDEX_COUNT] = { 0 };
int64 lWinMultiple[JETTON_INDEX_COUNT] = { 0 };
BYTE cbTableCardType[SHOW_CARD_COUNT] = { 0 };
BYTE cbTableCardArray[SHOW_CARD_COUNT][MAX_CARD_COUNT] = { 0 };
memcpy(cbTableCardArray, m_cbTableCardArray, sizeof(cbTableCardArray));
cbTableCardType[JETTON_INDEX_TIGER] = m_GameLogic.GetCardType(cbTableCardArray[JETTON_INDEX_TIGER], MAX_CARD_COUNT);
cbTableCardType[JETTON_INDEX_LEOPARD] = m_GameLogic.GetCardType(cbTableCardArray[JETTON_INDEX_LEOPARD], MAX_CARD_COUNT);
BYTE result = m_GameLogic.CompareCard(cbTableCardArray[JETTON_INDEX_TIGER], cbTableCardArray[JETTON_INDEX_LEOPARD], MAX_CARD_COUNT);
WORD iLostIndex = 0, iWinIndex = 0;
if (result == TRUE)
{
iWinIndex = JETTON_INDEX_TIGER;
iLostIndex = JETTON_INDEX_LEOPARD;
}
else
{
iWinIndex = JETTON_INDEX_LEOPARD;
iLostIndex = JETTON_INDEX_TIGER;
}
GetAreaInfo(iLostIndex, iWinIndex, cbTableCardType, cbWinArea, lWinMultiple);
// 椅子用户
//for (int nChairID = 0; nChairID<GAME_PLAYER; nChairID++)
//{
// CGamePlayer * pPlayer = GetPlayer(nChairID);
// if (pPlayer == NULL)
// {
// continue;
// }
// uint32 dwUserID = pPlayer->GetUID();
// if (dwUserID != control_uid)
// {
// continue;
// }
// for (int nAreaIndex = 0; nAreaIndex<JETTON_INDEX_COUNT; nAreaIndex++)
// {
// auto it_player_jetton = m_userJettonScore[nAreaIndex].find(dwUserID);
// if (it_player_jetton == m_userJettonScore[nAreaIndex].end())
// {
// continue;
// }
// int64 lUserJettonScore = it_player_jetton->second;
// if (lUserJettonScore == 0)
// {
// continue;
// }
// int64 lTempWinScore = 0;
// if (cbWinArea[nAreaIndex] == TRUE)
// {
// lTempWinScore = (lUserJettonScore * lWinMultiple[nAreaIndex]);
// lUserWinScore += lTempWinScore;
// }
// else
// {
// lTempWinScore = -lUserJettonScore;
// lUserLostScore -= lUserJettonScore;
// }
// }
// lUserWinScore += lUserLostScore;
//}
//if (lUserWinScore > 0)
//{
// return true;
//}
// 旁观用户
//auto it_looker = m_mpLookers.find(control_uid);
//if (it_looker == m_mpLookers.end())
//{
// LOG_DEBUG("contt_player 1 - roomid:%d,tableid:%d,uid:%d,iLoopIndex:%d,", GetRoomID(), GetTableID(), control_uid, iLoopIndex);
// return false;
//}
//CGamePlayer * pPlayer = it_looker->second;
//if (pPlayer == NULL)
//{
// LOG_DEBUG("contt_player 2 - roomid:%d,tableid:%d,uid:%d,iLoopIndex:%d,", GetRoomID(), GetTableID(), control_uid, iLoopIndex);
// return false;
//}
uint32 dwUserID = control_uid;// pPlayer->GetUID();
for (int nAreaIndex = 0; nAreaIndex < JETTON_INDEX_COUNT; nAreaIndex++)
{
auto it_player_jetton = m_userJettonScore[nAreaIndex].find(dwUserID);
if (it_player_jetton == m_userJettonScore[nAreaIndex].end())
{
continue;
}
int64 lUserJettonScore = it_player_jetton->second;
if (lUserJettonScore == 0)
{
continue;
}
int64 lTempWinScore = 0;
if (cbWinArea[nAreaIndex] == TRUE)
{
lTempWinScore = (lUserJettonScore * lWinMultiple[nAreaIndex]);
lUserWinScore += lTempWinScore;
}
else
{
lTempWinScore = -lUserJettonScore;
lUserLostScore -= lUserJettonScore;
}
}
lUserWinScore += lUserLostScore;
if (lUserWinScore > 0)
{
return true;
}
else
{
for (int index = 0; index < 1024; index++)
{
m_GameLogic.RandCardList(m_cbTableCardArray[0], sizeof(m_cbTableCardArray) / sizeof(m_cbTableCardArray[0][0]));
BYTE cbArTempCardData[SHOW_CARD_COUNT][MAX_COUNT] = { 0 };
memcpy(cbArTempCardData, m_cbTableCardArray, sizeof(cbArTempCardData));
if (m_GameLogic.IsSameCard(cbArTempCardData[0], cbArTempCardData[1], MAX_COUNT) == false)
{
break;
}
}
}
}
LOG_DEBUG("contt_player 3 - roomid:%d,tableid:%d,uid:%d,iLoopIndex:%d,", GetRoomID(), GetTableID(), control_uid, iLoopIndex);
return false;
}
bool CGameWarTable::SetControlPalyerLost(uint32 control_uid)
{
int iLoopCount = 1024;
for (int iLoopIndex = 0; iLoopIndex < iLoopCount; iLoopIndex++)
{
int64 lUserLostScore = 0;
int64 lUserWinScore = 0;
BYTE cbWinArea[JETTON_INDEX_COUNT] = { 0 };
int64 lWinMultiple[JETTON_INDEX_COUNT] = { 0 };
BYTE cbTableCardType[SHOW_CARD_COUNT] = { 0 };
BYTE cbTableCardArray[SHOW_CARD_COUNT][MAX_CARD_COUNT] = { 0 };
memcpy(cbTableCardArray, m_cbTableCardArray, sizeof(cbTableCardArray));
cbTableCardType[JETTON_INDEX_TIGER] = m_GameLogic.GetCardType(cbTableCardArray[JETTON_INDEX_TIGER], MAX_CARD_COUNT);
cbTableCardType[JETTON_INDEX_LEOPARD] = m_GameLogic.GetCardType(cbTableCardArray[JETTON_INDEX_LEOPARD], MAX_CARD_COUNT);
BYTE result = m_GameLogic.CompareCard(cbTableCardArray[JETTON_INDEX_TIGER], cbTableCardArray[JETTON_INDEX_LEOPARD], MAX_CARD_COUNT);
WORD iLostIndex = 0, iWinIndex = 0;
if (result == TRUE)
{
iWinIndex = JETTON_INDEX_TIGER;
iLostIndex = JETTON_INDEX_LEOPARD;
}
else
{
iWinIndex = JETTON_INDEX_LEOPARD;
iLostIndex = JETTON_INDEX_TIGER;
}
GetAreaInfo(iLostIndex, iWinIndex, cbTableCardType, cbWinArea, lWinMultiple);
// 椅子用户
//for (int nChairID = 0; nChairID<GAME_PLAYER; nChairID++)
//{
// CGamePlayer * pPlayer = GetPlayer(nChairID);
// if (pPlayer == NULL)
// {
// continue;
// }
// uint32 dwUserID = pPlayer->GetUID();
// if (dwUserID != control_uid)
// {
// continue;
// }
// for (int nAreaIndex = 0; nAreaIndex<JETTON_INDEX_COUNT; nAreaIndex++)
// {
// auto it_player_jetton = m_userJettonScore[nAreaIndex].find(dwUserID);
// if (it_player_jetton == m_userJettonScore[nAreaIndex].end())
// {
// continue;
// }
// int64 lUserJettonScore = it_player_jetton->second;
// if (lUserJettonScore == 0)
// {
// continue;
// }
// int64 lTempWinScore = 0;
// if (cbWinArea[nAreaIndex] == TRUE)
// {
// lTempWinScore = (lUserJettonScore * lWinMultiple[nAreaIndex]);
// lUserWinScore += lTempWinScore;
// }
// else
// {
// lTempWinScore = -lUserJettonScore;
// lUserLostScore -= lUserJettonScore;
// }
// }
// lUserWinScore += lUserLostScore;
//}
//if (lUserWinScore < 0)
//{
// return true;
//}
// 旁观用户
//auto it_looker = m_mpLookers.find(control_uid);
//CGamePlayer * pPlayer = it_looker->second;
//if (pPlayer == NULL)
//{
// return false;
//}
uint32 dwUserID = control_uid;// pPlayer->GetUID();
for (int nAreaIndex = 0; nAreaIndex < JETTON_INDEX_COUNT; nAreaIndex++)
{
auto it_player_jetton = m_userJettonScore[nAreaIndex].find(dwUserID);
if (it_player_jetton == m_userJettonScore[nAreaIndex].end())
{
continue;
}
int64 lUserJettonScore = it_player_jetton->second;
if (lUserJettonScore == 0)
{
continue;
}
int64 lTempWinScore = 0;
if (cbWinArea[nAreaIndex] == TRUE)
{
lTempWinScore = (lUserJettonScore * lWinMultiple[nAreaIndex]);
lUserWinScore += lTempWinScore;
}
else
{
lTempWinScore = -lUserJettonScore;
lUserLostScore -= lUserJettonScore;
}
}
lUserWinScore += lUserLostScore;
if (lUserWinScore < 0)
{
return true;
}
else
{
for (int index = 0; index < 1024; index++)
{
m_GameLogic.RandCardList(m_cbTableCardArray[0], sizeof(m_cbTableCardArray) / sizeof(m_cbTableCardArray[0][0]));
BYTE cbArTempCardData[SHOW_CARD_COUNT][MAX_COUNT] = { 0 };
memcpy(cbArTempCardData, m_cbTableCardArray, sizeof(cbArTempCardData));
if (m_GameLogic.IsSameCard(cbArTempCardData[0], cbArTempCardData[1], MAX_COUNT) == false)
{
break;
}
}
}
}
return false;
}
bool CGameWarTable::SetSystemBrankerWinPlayerScore()
{
int iLoopCount = 1024;
for (int iLoopIndex = 0; iLoopIndex < iLoopCount; iLoopIndex++)
{
map<uint32, int64> mpUserLostScore;
map<uint32, int64> mpUserWinScore;
mpUserLostScore.clear();
mpUserWinScore.clear();
int64 lBankerWinScore = 0;
BYTE cbWinArea[JETTON_INDEX_COUNT] = { 0 };
int64 lWinMultiple[JETTON_INDEX_COUNT] = { 0 };
BYTE cbTableCardType[SHOW_CARD_COUNT] = { 0 };
BYTE cbTableCardArray[SHOW_CARD_COUNT][MAX_CARD_COUNT] = { 0 };
memcpy(cbTableCardArray, m_cbTableCardArray, sizeof(cbTableCardArray));
cbTableCardType[JETTON_INDEX_TIGER] = m_GameLogic.GetCardType(cbTableCardArray[JETTON_INDEX_TIGER], MAX_CARD_COUNT);
cbTableCardType[JETTON_INDEX_LEOPARD] = m_GameLogic.GetCardType(cbTableCardArray[JETTON_INDEX_LEOPARD], MAX_CARD_COUNT);
BYTE result = m_GameLogic.CompareCard(cbTableCardArray[JETTON_INDEX_TIGER], cbTableCardArray[JETTON_INDEX_LEOPARD], MAX_CARD_COUNT);
WORD iLostIndex = 0, iWinIndex = 0;
if (result == TRUE)
{
iWinIndex = JETTON_INDEX_TIGER;
iLostIndex = JETTON_INDEX_LEOPARD;
}
else
{
iWinIndex = JETTON_INDEX_LEOPARD;
iLostIndex = JETTON_INDEX_TIGER;
}
GetAreaInfo(iLostIndex, iWinIndex, cbTableCardType, cbWinArea, lWinMultiple);
// 椅子用户
for (int nChairID = 0; nChairID<GAME_PLAYER; nChairID++)
{
CGamePlayer * pPlayer = GetPlayer(nChairID);
if (pPlayer == NULL)
{
continue;
}
if (pPlayer->IsRobot())
{
continue;
}
uint32 dwUserID = pPlayer->GetUID();
for (int nAreaIndex = 0; nAreaIndex<JETTON_INDEX_COUNT; nAreaIndex++)
{
auto it_player_jetton = m_userJettonScore[nAreaIndex].find(dwUserID);
if (it_player_jetton == m_userJettonScore[nAreaIndex].end())
{
continue;
}
int64 lUserJettonScore = it_player_jetton->second;
if (lUserJettonScore == 0)
{
continue;
}
int64 lTempWinScore = 0;
if (cbWinArea[nAreaIndex] == TRUE)
{
lTempWinScore = (lUserJettonScore * lWinMultiple[nAreaIndex]);
mpUserWinScore[dwUserID] += lTempWinScore;
lBankerWinScore -= lTempWinScore;
}
else
{
lTempWinScore = -lUserJettonScore;
mpUserLostScore[dwUserID] -= lUserJettonScore;
lBankerWinScore += lUserJettonScore;
}
}
mpUserWinScore[dwUserID] += mpUserLostScore[dwUserID];
}
// 旁观用户
auto it_looker = m_mpLookers.begin();
for (; it_looker != m_mpLookers.end(); it_looker++)
{
CGamePlayer * pPlayer = it_looker->second;
if (pPlayer == NULL)
{
continue;
}
if (pPlayer->IsRobot())
{
continue;
}
uint32 dwUserID = pPlayer->GetUID();
for (int nAreaIndex = 0; nAreaIndex < JETTON_INDEX_COUNT; nAreaIndex++)
{
auto it_player_jetton = m_userJettonScore[nAreaIndex].find(dwUserID);
if (it_player_jetton == m_userJettonScore[nAreaIndex].end())
{
continue;
}
int64 lUserJettonScore = it_player_jetton->second;
if (lUserJettonScore == 0)
{
continue;
}
int64 lTempWinScore = 0;
if (cbWinArea[nAreaIndex] == TRUE)
{
lTempWinScore = (lUserJettonScore * lWinMultiple[nAreaIndex]);
mpUserWinScore[dwUserID] += lTempWinScore;
lBankerWinScore -= lTempWinScore;
}
else
{
lTempWinScore = -lUserJettonScore;
mpUserLostScore[dwUserID] -= lUserJettonScore;
lBankerWinScore += lUserJettonScore;
}
}
mpUserWinScore[dwUserID] += mpUserLostScore[dwUserID];
}
if (lBankerWinScore > 0)
{
return true;
}
else
{
for (int index = 0; index < 1024; index++)
{
m_GameLogic.RandCardList(m_cbTableCardArray[0], sizeof(m_cbTableCardArray) / sizeof(m_cbTableCardArray[0][0]));
BYTE cbArTempCardData[SHOW_CARD_COUNT][MAX_COUNT] = { 0 };
memcpy(cbArTempCardData, m_cbTableCardArray, sizeof(cbArTempCardData));
if (m_GameLogic.IsSameCard(cbArTempCardData[0], cbArTempCardData[1], MAX_COUNT) == false)
{
break;
}
}
}
}
return false;
}
bool CGameWarTable::ProgressControlPalyer()
{
bool bIsFalgControl = false;
bool bControlPlayerIsJetton = false;
uint32 control_uid = m_tagControlPalyer.uid;
uint32 game_count = m_tagControlPalyer.count;
uint32 control_type = m_tagControlPalyer.type;
if (control_uid != 0 && game_count>0 && control_type != GAME_CONTROL_CANCEL)
{
for (int i = 0; i < JETTON_INDEX_COUNT; i++)
{
auto it_player_jetton = m_userJettonScore[i].find(control_uid);
if (it_player_jetton == m_userJettonScore[i].end())
{
continue;
}
int64 lUserJettonScore = it_player_jetton->second;
if (lUserJettonScore >0)
{
bControlPlayerIsJetton = true;
}
}
if (bControlPlayerIsJetton && game_count>0 && control_type != GAME_CONTROL_CANCEL)
{
if (control_type == GAME_CONTROL_WIN)
{
bIsFalgControl = SetControlPalyerWin(control_uid);
}
if (control_type == GAME_CONTROL_LOST)
{
bIsFalgControl = SetControlPalyerLost(control_uid);
}
if (bIsFalgControl && m_tagControlPalyer.count>0)
{
//m_tagControlPalyer.count--;
//if (m_tagControlPalyer.count == 0)
//{
// m_tagControlPalyer.Init();
//}
if (m_pHostRoom != NULL)
{
m_pHostRoom->SynControlPlayer(GetTableID(), m_tagControlPalyer.uid, -1, m_tagControlPalyer.type);
}
}
}
}
LOG_DEBUG("roomid:%d,tableid:%d,control_uid:%d,game_count:%d,control_type:%d,bControlPlayerIsJetton:%d,bIsFalgControl:%d",
GetRoomID(), GetTableID(), control_uid, game_count, control_type, bControlPlayerIsJetton, bIsFalgControl);
return bIsFalgControl;
}
// 福利控制
bool CGameWarTable::DosWelfareCtrl()
{
bool bIsFalgControl = ProgressControlPalyer();
uint32 sysBankerWinPro = m_pHostRoom->GetSysBankerWinPro();
bool needChangeCard = g_RandGen.RandRatio(sysBankerWinPro, PRO_DENO_10000);
bool bIsSysWinScore = false;
if (bIsFalgControl == false && needChangeCard)
{
bIsSysWinScore = SetSystemBrankerWinPlayerScore();
}
LOG_DEBUG("roomid:%d,tableid:%d,sysBankerWinPro:%d,bIsFalgControl:%d,needChangeCard:%d,bIsSysWinScore:%d", GetRoomID(), GetTableID(), sysBankerWinPro, bIsFalgControl, needChangeCard, bIsSysWinScore);
return true;
}
// 非福利控制
bool CGameWarTable::NotWelfareCtrl()
{
bool bIsFalgControl = ProgressControlPalyer();
bool needChangeCard = g_RandGen.RandRatio(m_sysBankerWinPro, PRO_DENO_10000);
bool bIsSysWinScore = false;
if (bIsFalgControl == false && needChangeCard)
{
bIsSysWinScore = SetSystemBrankerWinPlayerScore();
}
// add by har
bool bIsStockControl = false;
if (!bIsFalgControl && !bIsSysWinScore)
bIsStockControl = SetStockWinLose(); // add by har end
//判断是否满足活跃福利
bool isAwCtrl = false;
if (!bIsFalgControl && !bIsSysWinScore && !bIsStockControl)
isAwCtrl = ActiveWelfareCtrl();
LOG_DEBUG("roomid:%d,tableid:%d,m_sysBankerWinPro:%d,bIsFalgControl:%d,needChangeCard:%d,bIsSysWinScore:%d,isAwCtrl:%d,bIsStockControl:%d",
GetRoomID(), GetTableID(), m_sysBankerWinPro, bIsFalgControl, needChangeCard, bIsSysWinScore, isAwCtrl, bIsStockControl);
return true;
}
//bool CGameWarTable::KilledPlayerCtrl()
//{
// bool bIsFalgControl = ProgressControlPalyer();
//
// bool needChangeCard = g_RandGen.RandRatio(m_pHostRoom->GetAoSysBankerWinPro(), PRO_DENO_10000);
// bool bIsSysWinScore = false;
// if (bIsFalgControl == false && needChangeCard)
// {
// bIsSysWinScore = SetSystemBrankerWinPlayerScore();
// }
//
// LOG_DEBUG("roomid:%d,tableid:%d,bIsFalgControl:%d,needChangeCard:%d,bIsSysWinScore:%d", GetRoomID(), GetTableID(), bIsFalgControl, needChangeCard, bIsSysWinScore);
//
// return true;
//}
//发送扑克
bool CGameWarTable::DispatchTableCard()
{
//重新洗牌
//m_GameLogic.RandCardList(m_cbTableCardArray[0],sizeof(m_cbTableCardArray)/sizeof(m_cbTableCardArray[0][0]));
ProbabilityDispatchPokerCard();
bool bAreaIsControl = false;
int newroom = 0;
bool bHaveNotNovicePlayer = true;
//增加精准控制区域
bAreaIsControl = OnBrcAreaControl();
if (!bAreaIsControl && m_pHostRoom != NULL)
{
newroom = m_pHostRoom->GetNoviceWelfare();
}
if (!bAreaIsControl && newroom == 1)
{
bHaveNotNovicePlayer = HaveNotNovicePlayer();
if (bHaveNotNovicePlayer == false)
{
DosWelfareCtrl();
SetChessWelfare(1);
}
else
{
NotWelfareCtrl();
}
}
if (!bAreaIsControl && newroom != 1)
{
NotWelfareCtrl();
}
SetIsAllRobotOrPlayerJetton(IsAllRobotOrPlayerJetton()); // add by har
LOG_DEBUG("dos_wel_ctrl - roomid:%d,tableid:%d,bAreaIsControl:%d, newroom:%d, bHaveNotNovicePlayer:%d,ChessWelfare:%d,GetIsAllRobotOrPlayerJetton:%d",
GetRoomID(), GetTableID(), bAreaIsControl, newroom, bHaveNotNovicePlayer, GetChessWelfare(), GetIsAllRobotOrPlayerJetton());
for (uint16 i = 0; i < SHOW_CARD_COUNT; ++i)
{
LOG_DEBUG("roomid:%d,tableid:%d,m_cbHandCardData:0x%02X 0x%02X 0x%02X", GetRoomID(), GetTableID(), m_cbTableCardArray[i][0], m_cbTableCardArray[i][1], m_cbTableCardArray[i][2]);
}
return true;
}
//发送游戏记录
void CGameWarTable::SendPlayLog(CGamePlayer* pPlayer)
{
net::msg_war_play_log_rep msg;
for(uint16 i=0;i<m_vecRecord.size();++i)
{
net::war_play_log* plog = msg.add_logs();
warGameRecord& record = m_vecRecord[i];
for(uint16 j=0;j<JETTON_INDEX_COUNT;j++){
plog->add_seats_win(record.wins[j]);
}
plog->set_card(record.card);
plog->set_index(record.index);
}
LOG_DEBUG("发送牌局记录:%d",msg.logs_size());
if(pPlayer != NULL) {
pPlayer->SendMsgToClient(&msg, net::S2C_MSG_WAR_PLAY_LOG);
}else{
SendMsgToAll(&msg,net::S2C_MSG_WAR_PLAY_LOG);
}
}
//最大下注
int64 CGameWarTable::GetUserMaxJetton(CGamePlayer* pPlayer, BYTE cbJettonArea)
{
int iTimer = 3;
//已下注额
int64 lNowJetton = 0;
for(int nAreaIndex = 0; nAreaIndex < JETTON_INDEX_COUNT; ++nAreaIndex)
{
lNowJetton += m_userJettonScore[nAreaIndex][pPlayer->GetUID()];
}
//庄家金币
int64 lBankerScore = 9223372036854775807;
if (m_pCurBanker != NULL)
{
lBankerScore = lBankerScore;
}
for (int nAreaIndex = 0; nAreaIndex < JETTON_INDEX_COUNT; ++nAreaIndex)
{
lBankerScore -= m_allJettonScore[nAreaIndex] * iTimer;
}
//个人限制
int64 lMeMaxScore = (GetPlayerCurScore(pPlayer) - lNowJetton*iTimer)/iTimer;
//庄家限制
lMeMaxScore = min(lMeMaxScore,lBankerScore/iTimer);
//非零限制
lMeMaxScore = MAX(lMeMaxScore, 0);
return (lMeMaxScore);
}
bool CGameWarTable::IsSetJetton(uint32 uid)
{
//for (uint8 i = 0; i < JETTON_INDEX_COUNT; ++i)
//{
// if (m_userJettonScore[i][uid] > 0)
// return true;
//}
for (int i = 0; i < JETTON_INDEX_COUNT; i++)
{
auto it_player_jetton = m_userJettonScore[i].find(uid);
if (it_player_jetton == m_userJettonScore[i].end())
{
continue;
}
int64 lUserJettonScore = it_player_jetton->second;
if (lUserJettonScore >0)
{
//bControlPlayerIsJetton = true;
return true;
}
}
for (uint32 i = 0; i < m_chairRobotPlaceJetton.size(); i++)
{
uint32 temp_uid = 0;
if (m_chairRobotPlaceJetton[i].pPlayer)
{
temp_uid = m_chairRobotPlaceJetton[i].pPlayer->GetUID();
}
if (uid == temp_uid) {
return true;
}
}
for (uint32 i = 0; i < m_RobotPlaceJetton.size(); i++)
{
uint32 temp_uid = 0;
if (m_RobotPlaceJetton[i].pPlayer)
{
temp_uid = m_RobotPlaceJetton[i].pPlayer->GetUID();
}
if (uid == temp_uid) {
return true;
}
}
return false;
}
int64 CGameWarTable::GetAreaMultiple(int nAreaIndex, int iLostIndex, int iWinIndex)
{
int64 lMultiple = 0;
if (nAreaIndex == JETTON_INDEX_TIGER || nAreaIndex == JETTON_INDEX_LEOPARD)
{
if (nAreaIndex == iWinIndex)
{
lMultiple = 1;
}
}
else if (nAreaIndex == JETTON_INDEX_OTHER)
{
int switch_on = m_cbTableCardType[iWinIndex];
switch (switch_on)
{
case CT_DOUBLE:
{
lMultiple = 1;
}break;
case CT_SHUN_ZI:
{
lMultiple = 2;
}break;
case CT_JIN_HUA:
{
lMultiple = 3;
}break;
case CT_SHUN_JIN:
{
lMultiple = 5;
}break;
case CT_BAO_ZI:
{
lMultiple = 15;
}break;
}
}
return lMultiple;
}
//计算得分
int64 CGameWarTable::CalculateScore()
{
map<uint32, int64> mpUserLostScore;
mpUserLostScore.clear();
m_mpUserWinScore.clear();
m_mpWinScoreForFee.clear();
memset(m_winMultiple, 0, sizeof(m_winMultiple));
int64 lBankerWinScore = 0;
BYTE cbWinArea[JETTON_INDEX_COUNT] = { 0 };
memset(cbWinArea, 0, sizeof(cbWinArea));
int64 lWinMultiple[JETTON_INDEX_COUNT] = { 0 };
memset(lWinMultiple, 0, sizeof(lWinMultiple));
BYTE cbTableCardArray[SHOW_CARD_COUNT][MAX_CARD_COUNT] = {0};
memcpy(cbTableCardArray, m_cbTableCardArray, sizeof(cbTableCardArray));
m_cbTableCardType[JETTON_INDEX_TIGER] = m_GameLogic.GetCardType(cbTableCardArray[JETTON_INDEX_TIGER], MAX_CARD_COUNT);
m_cbTableCardType[JETTON_INDEX_LEOPARD] = m_GameLogic.GetCardType(cbTableCardArray[JETTON_INDEX_LEOPARD], MAX_CARD_COUNT);
BYTE result = m_GameLogic.CompareCard(cbTableCardArray[JETTON_INDEX_TIGER], cbTableCardArray[JETTON_INDEX_LEOPARD], MAX_CARD_COUNT);
WORD iLostIndex = 0, iWinIndex = 0;
if (result == TRUE)
{
iWinIndex = JETTON_INDEX_TIGER;
iLostIndex = JETTON_INDEX_LEOPARD;
}
else
{
iWinIndex = JETTON_INDEX_LEOPARD;
iLostIndex = JETTON_INDEX_TIGER;
}
GetAreaInfo(iLostIndex, iWinIndex, m_cbTableCardType, cbWinArea, lWinMultiple);
LOG_DEBUG("roomid:%d,tableid:%d,iLostIndex:%d, iWinIndex:%d,result:%d,CardType:%d %d,cbWinArea:%d %d %d,lWinMultiple:%lld %lld %lld",
GetRoomID(),GetTableID(),iLostIndex, iWinIndex, result, m_cbTableCardType[0], m_cbTableCardType[1], cbWinArea[0], cbWinArea[1], cbWinArea[2], lWinMultiple[0], lWinMultiple[1], lWinMultiple[2]);
for (int i = 0; i < JETTON_INDEX_COUNT; i++)
{
m_winMultiple[i] = lWinMultiple[i];
m_winIndex[i] = cbWinArea[i];
}
memcpy(m_record.wins, cbWinArea, sizeof(m_record.wins));
m_record.card = m_cbTableCardType[iWinIndex];
m_record.index = m_iGameCount;
if (m_record.index == 0)
{
m_vecRecord.clear();
}
//memcpy(m_record.card, cbTableCardArray, sizeof(m_record.card));
m_vecRecord.push_back(m_record);
if (m_vecRecord.size() >= 72)
{
m_vecRecord.erase(m_vecRecord.begin());
}
//m_vecGamePlayRecord.push_back(m_record);
//if (m_vecGamePlayRecord.size() >= 72) {
// m_vecGamePlayRecord.erase(m_vecGamePlayRecord.begin());
//}
SendGameEndLogInfo();
// 椅子用户
for (int nChairID = 0; nChairID<GAME_PLAYER; nChairID++)
{
CGamePlayer * pPlayer = GetPlayer(nChairID);
if (pPlayer == NULL)
{
continue;
}
uint32 dwUserID = pPlayer->GetUID();
for (int nAreaIndex = 0; nAreaIndex<JETTON_INDEX_COUNT; nAreaIndex++)
{
auto it_player_jetton = m_userJettonScore[nAreaIndex].find(dwUserID);
if (it_player_jetton == m_userJettonScore[nAreaIndex].end())
{
continue;
}
int64 lUserJettonScore = it_player_jetton->second;
if (lUserJettonScore == 0)
{
continue;
}
int64 lTempWinScore = 0;
if (cbWinArea[nAreaIndex] == TRUE)
{
lTempWinScore = (lUserJettonScore * lWinMultiple[nAreaIndex]);
m_mpUserWinScore[dwUserID] += lTempWinScore;
lBankerWinScore -= lTempWinScore;
}
else
{
lTempWinScore = -lUserJettonScore;
mpUserLostScore[dwUserID] -= lUserJettonScore;
lBankerWinScore += lUserJettonScore;
}
}
m_mpWinScoreForFee[dwUserID] = m_mpUserWinScore[dwUserID];
m_mpUserWinScore[dwUserID] += mpUserLostScore[dwUserID];
}
// 旁观用户
auto it_looker = m_mpLookers.begin();
for (; it_looker != m_mpLookers.end(); it_looker++)
{
CGamePlayer * pPlayer = it_looker->second;
if (pPlayer == NULL)
{
continue;
}
uint32 dwUserID = pPlayer->GetUID();
for (int nAreaIndex = 0; nAreaIndex < JETTON_INDEX_COUNT; nAreaIndex++)
{
auto it_player_jetton = m_userJettonScore[nAreaIndex].find(dwUserID);
if (it_player_jetton == m_userJettonScore[nAreaIndex].end())
{
continue;
}
int64 lUserJettonScore = it_player_jetton->second;
if (lUserJettonScore == 0)
{
continue;
}
int64 lTempWinScore = 0;
if (cbWinArea[nAreaIndex] == TRUE)
{
lTempWinScore = (lUserJettonScore * lWinMultiple[nAreaIndex]);
m_mpUserWinScore[dwUserID] += lTempWinScore;
lBankerWinScore -= lTempWinScore;
}
else
{
lTempWinScore = -lUserJettonScore;
mpUserLostScore[dwUserID] -= lUserJettonScore;
lBankerWinScore += lUserJettonScore;
}
}
m_mpWinScoreForFee[dwUserID] = m_mpUserWinScore[dwUserID];
m_mpUserWinScore[dwUserID] += mpUserLostScore[dwUserID];
if (pPlayer->IsRobot() == false)
{
LOG_DEBUG("score result looker - uid:%d,mroomid,tableid:%d,_mpUserWinScore:%lld", dwUserID, GetRoomID(), GetTableID(), m_mpUserWinScore[dwUserID]);
}
}
return lBankerWinScore;
}
//申请条件
int64 CGameWarTable::GetApplyBankerCondition()
{
return GetBaseScore();
}
int64 CGameWarTable::GetApplyBankerConditionLimit()
{
return GetBaseScore()*20;
}
void CGameWarTable::OnRobotOper()
{
//LOG_DEBUG("robot place jetton");
map<uint32,CGamePlayer*>::iterator it = m_mpLookers.begin();
for(;it != m_mpLookers.end();++it)
{
CGamePlayer* pPlayer = it->second;
if(pPlayer == NULL || !pPlayer->IsRobot() || pPlayer == m_pCurBanker)
continue;
uint8 area = GetRobotJettonArea();
if(g_RandGen.RandRatio(50,PRO_DENO_100))
continue;
int64 minJetton = GetRobotJettonScore(pPlayer, area);
if (minJetton == 0)
{
continue;
}
if (!OnUserPlaceJetton(pPlayer, area, minJetton))
{
break;
}
}
for(uint32 i=0;i<GAME_PLAYER;++i)
{
CGamePlayer* pPlayer = GetPlayer(i);
if(pPlayer == NULL || !pPlayer->IsRobot() || pPlayer == m_pCurBanker)
continue;
uint8 area = GetRobotJettonArea();
if(g_RandGen.RandRatio(85,PRO_DENO_100))
continue;
int64 minJetton = GetRobotJettonScore(pPlayer, area);
if (minJetton == 0)
{
continue;
}
if(!OnUserPlaceJetton(pPlayer,area,minJetton))
break;
}
}
int64 CGameWarTable::GetRobotJettonScore(CGamePlayer* pPlayer, uint8 area)
{
int64 lUserRealJetton = 100;
int64 lUserMinJetton = 100;
int64 lUserMaxJetton = GetUserMaxJetton(pPlayer, area);
int64 lUserCurJetton = GetPlayerCurScore(pPlayer);
//LOG_DEBUG("uid:%d,lUserMinJetton:%lld,lUserMaxJetton:%lld,lUserRealJetton:%lld", pPlayer->GetUID(), lUserMinJetton, lUserMaxJetton, lUserRealJetton);
if (lUserCurJetton < 2000)
{
lUserRealJetton = 0;
}
else if (lUserCurJetton >= 2000 && lUserCurJetton < 50000)
{
if (g_RandGen.RandRatio(35, PRO_DENO_100))
{
lUserRealJetton = 100;
}
else if (g_RandGen.RandRatio(57, PRO_DENO_100))
{
lUserRealJetton = 1000;
}
else
{
lUserRealJetton = 5000;
}
}
else if (lUserCurJetton >= 50000 && lUserCurJetton < 200000)
{
if (g_RandGen.RandRatio(15, PRO_DENO_100))
{
lUserRealJetton = 1000;
}
else if (g_RandGen.RandRatio(47, PRO_DENO_100))
{
lUserRealJetton = 5000;
}
else if (g_RandGen.RandRatio(35, PRO_DENO_100))
{
lUserRealJetton = 1000;
}
else
{
lUserRealJetton = 50000;
}
}
else if (lUserCurJetton >= 200000 && lUserCurJetton < 2000000)
{
if (g_RandGen.RandRatio(3000, PRO_DENO_10000))
{
lUserRealJetton = 5000;
}
else if (g_RandGen.RandRatio(5500, PRO_DENO_10000))
{
lUserRealJetton = 10000;
}
else
{
lUserRealJetton = 50000;
}
}
else if (lUserCurJetton >= 2000000)
{
if (g_RandGen.RandRatio(500, PRO_DENO_10000))
{
lUserRealJetton = 5000;
}
else if (g_RandGen.RandRatio(3000, PRO_DENO_10000))
{
lUserRealJetton = 10000;
}
else
{
lUserRealJetton = 50000;
}
}
else
{
lUserRealJetton = 100;
}
if (lUserRealJetton > lUserMaxJetton && lUserRealJetton == 50000)
{
lUserRealJetton = 10000;
}
if (lUserRealJetton > lUserMaxJetton && lUserRealJetton == 10000)
{
lUserRealJetton = 5000;
}
if (lUserRealJetton > lUserMaxJetton && lUserRealJetton == 5000)
{
lUserRealJetton = 1000;
}
if (lUserRealJetton > lUserMaxJetton && lUserRealJetton == 1000)
{
lUserRealJetton = 100;
}
if (lUserRealJetton > lUserMaxJetton && lUserRealJetton == 100)
{
lUserRealJetton = 0;
}
if (lUserRealJetton < lUserMinJetton)
{
lUserRealJetton = 0;
}
return lUserRealJetton;
}
int64 CGameWarTable::GetRobotJettonScoreRand(CGamePlayer* pPlayer, uint8 area)
{
int64 lUserRealJetton = 100;
int switch_on = g_RandGen.RandRange(0, 3);
switch (switch_on)
{
case 0:
{
lUserRealJetton = 100;
}break;
case 1:
{
lUserRealJetton = 1000;
}break;
case 2:
{
lUserRealJetton = 5000;
}break;
case 3:
{
lUserRealJetton = 10000;
}break;
default:
break;
}
return lUserRealJetton;
}
void CGameWarTable::OnRobotStandUp()
{
// 保持一两个座位给玩家
vector<uint16> emptyChairs;
vector<uint16> robotChairs;
for(uint8 i=0;i<GAME_PLAYER;++i)
{
CGamePlayer* pPlayer = GetPlayer(i);
if(pPlayer == NULL){
emptyChairs.push_back(i);
continue;
}
if(pPlayer->IsRobot()){
robotChairs.push_back(i);
}
}
if(GetChairPlayerNum() > m_robotChairSize && robotChairs.size() > 0)// 机器人站起
{
uint16 chairID = robotChairs[g_RandGen.RandUInt()%robotChairs.size()];
CGamePlayer* pPlayer = GetPlayer(chairID);
if(pPlayer != NULL && pPlayer->IsRobot() && CanStandUp(pPlayer))
{
PlayerSitDownStandUp(pPlayer,false,chairID);
return;
}
}
if(GetChairPlayerNum() < m_robotChairSize && emptyChairs.size() > 0)//机器人坐下
{
map<uint32,CGamePlayer*>::iterator it = m_mpLookers.begin();
for(;it != m_mpLookers.end();++it)
{
CGamePlayer* pPlayer = it->second;
if(pPlayer == NULL || !pPlayer->IsRobot() || pPlayer == m_pCurBanker)
continue;
uint16 chairID = emptyChairs[g_RandGen.RandUInt()%emptyChairs.size()];
if(CanSitDown(pPlayer,chairID)){
PlayerSitDownStandUp(pPlayer,true,chairID);
return;
}
}
}
}
/*void CGameWarTable::GetAllRobotPlayer(vector<CGamePlayer*> & robots)
{
robots.clear();
map<uint32, CGamePlayer*>::iterator it = m_mpLookers.begin();
for (; it != m_mpLookers.end(); ++it)
{
CGamePlayer* pPlayer = it->second;
if (pPlayer == NULL || !pPlayer->IsRobot())
{
continue;
}
robots.push_back(pPlayer);
}
for (WORD wUserIndex = 0; wUserIndex < GAME_PLAYER; ++wUserIndex)
{
CGamePlayer *pPlayer = GetPlayer(wUserIndex);
if (pPlayer == NULL || !pPlayer->IsRobot())
{
continue;
}
robots.push_back(pPlayer);
}
//LOG_DEBUG("robots.size:%d", robots.size());
}*/
void CGameWarTable::AddPlayerToBlingLog()
{
map<uint32,CGamePlayer*>::iterator it = m_mpLookers.begin();
for(;it != m_mpLookers.end();++it)
{
CGamePlayer* pPlayer = it->second;
if(pPlayer == NULL)
continue;
for(uint8 i=0;i<JETTON_INDEX_COUNT;++i){
if(m_userJettonScore[i][pPlayer->GetUID()] > 0){
AddUserBlingLog(pPlayer);
break;
}
}
}
AddUserBlingLog(m_pCurBanker);
}
bool CGameWarTable::IsInTableRobot(uint32 uid, CGamePlayer * pPlayer)
{
for (uint32 i = 0; i<GAME_PLAYER; ++i)
{
if (pPlayer != NULL && pPlayer == GetPlayer(i) && pPlayer->GetUID() == uid)
{
return true;
}
}
auto iter_player = m_mpLookers.find(uid);
if (iter_player != m_mpLookers.end())
{
if (pPlayer != NULL && pPlayer == iter_player->second && pPlayer->GetUID() == iter_player->first)
{
return true;
}
}
return false;
}
bool CGameWarTable::OnChairRobotJetton()
{
if (m_bIsChairRobotAlreadyJetton)
{
return false;
}
m_bIsChairRobotAlreadyJetton = true;
m_chairRobotPlaceJetton.clear();
for (uint32 i = 0; i < GAME_PLAYER; ++i)
{
CGamePlayer* pPlayer = GetPlayer(i);
if (pPlayer == NULL || !pPlayer->IsRobot() || pPlayer == m_pCurBanker)
{
continue;
}
int iJettonCount = g_RandGen.RandRange(5, 9);
uint8 cbJettonArea = GetRobotJettonArea();
uint8 cbOldJettonArea = cbJettonArea;
int64 lUserRealJetton = GetRobotJettonScore(pPlayer, cbJettonArea);
if (lUserRealJetton == 0)
{
continue;
}
int iJettonTypeCount = g_RandGen.RandRange(1, 2);
int iJettonStartCount = g_RandGen.RandRange(2, 3);
int64 lOldRealJetton = -1;
int64 iJettonOldTime = -1;
bool bIsContinuouslyJetton = false;
int iPreRatio = g_RandGen.RandRange(5, 10);
if (g_RandGen.RandRatio(iPreRatio, PRO_DENO_100))
{
bIsContinuouslyJetton = true;
if (lUserRealJetton == 100 || lUserRealJetton == 1000)
{
iJettonCount = g_RandGen.RandRange(5, 18);
}
}
for (int iIndex = 0; iIndex < iJettonCount; iIndex++)
{
//if (g_RandGen.RandRatio(95, PRO_DENO_100))
//{
// continue;
//}
if (bIsContinuouslyJetton == false)
{
//cbJettonArea = GetRobotJettonArea();
if (g_RandGen.RandRatio(10, PRO_DENO_100))
{
cbJettonArea = JETTON_INDEX_OTHER;
}
else
{
cbJettonArea = cbOldJettonArea;
}
lUserRealJetton = GetRobotJettonScore(pPlayer, cbJettonArea);
if (lOldRealJetton == -1)
{
lOldRealJetton = lUserRealJetton;
}
if (lOldRealJetton != lUserRealJetton && iJettonTypeCount == 1)
{
lUserRealJetton = lOldRealJetton;
}
if (lOldRealJetton != lUserRealJetton && iJettonTypeCount == 2 && iJettonStartCount == iIndex)
{
lUserRealJetton = lUserRealJetton;
lOldRealJetton = lUserRealJetton;
}
else
{
lUserRealJetton = lOldRealJetton;
}
}
if (lUserRealJetton == 0)
{
continue;
}
if (cbJettonArea == JETTON_INDEX_OTHER)
{
if (lUserRealJetton == 50000 || lUserRealJetton == 200000)
{
lUserRealJetton = GetRobotJettonScoreRand(pPlayer, cbJettonArea);
}
}
tagRobotPlaceJetton robotPlaceJetton;
robotPlaceJetton.uid = pPlayer->GetUID();
robotPlaceJetton.pPlayer = pPlayer;
int64 uRemainTime = m_coolLogic.getCoolTick();
int64 passtick = m_coolLogic.getPassTick();
int64 uMaxDelayTime = s_PlaceJettonTime;
if (iJettonOldTime >= uMaxDelayTime - 500)
{
iJettonOldTime = g_RandGen.RandRange(100, 5000);
}
if (iJettonOldTime == -1)
{
robotPlaceJetton.time = g_RandGen.RandRange(100, uMaxDelayTime - 500);
iJettonOldTime = robotPlaceJetton.time;
if (bIsContinuouslyJetton == true)
{
robotPlaceJetton.time = g_RandGen.RandRange(100, 4000);
iJettonOldTime = robotPlaceJetton.time;
}
}
else
{
robotPlaceJetton.time = g_RandGen.RandRange(100, uMaxDelayTime - 500);
iJettonOldTime = robotPlaceJetton.time;
}
if (bIsContinuouslyJetton == true)
{
robotPlaceJetton.time = iJettonOldTime + 100;
iJettonOldTime = robotPlaceJetton.time;
}
if (robotPlaceJetton.time <= 0 || robotPlaceJetton.time > uMaxDelayTime - 500)
{
continue;
}
robotPlaceJetton.area = cbJettonArea;
robotPlaceJetton.jetton = lUserRealJetton;
robotPlaceJetton.bflag = false;
m_chairRobotPlaceJetton.push_back(robotPlaceJetton);
}
}
LOG_DEBUG("chair_robot_jetton - roomid:%d,tableid:%d,m_chairRobotPlaceJetton.size:%d", GetRoomID(), GetTableID(), m_chairRobotPlaceJetton.size());
return true;
}
void CGameWarTable::OnChairRobotPlaceJetton()
{
if (m_chairRobotPlaceJetton.size() == 0)
{
return;
}
vector<tagRobotPlaceJetton> vecRobotPlaceJetton;
for (uint32 i = 0; i < m_chairRobotPlaceJetton.size(); i++)
{
if (m_chairRobotPlaceJetton.size() == 0)
{
return;
}
tagRobotPlaceJetton robotPlaceJetton = m_chairRobotPlaceJetton[i];
CGamePlayer * pPlayer = robotPlaceJetton.pPlayer;
if (pPlayer == NULL)
{
continue;
}
if (m_chairRobotPlaceJetton.size() == 0)
{
return;
}
int64 passtick = m_coolLogic.getPassTick();
int64 uMaxDelayTime = s_PlaceJettonTime;
//passtick = passtick / 1000;
bool bflag = false;
bool bIsInTable = false;
bool bIsJetton = false;
for (uint32 i = 0; i < vecRobotPlaceJetton.size(); i++)
{
if (vecRobotPlaceJetton[i].pPlayer != NULL && vecRobotPlaceJetton[i].pPlayer->GetUID() == robotPlaceJetton.pPlayer->GetUID())
{
bIsJetton = true;
}
}
if (passtick > robotPlaceJetton.time && uMaxDelayTime - passtick > 800 && m_chairRobotPlaceJetton[i].bflag == false && bIsJetton == false)
{
bIsInTable = IsInTableRobot(robotPlaceJetton.uid, robotPlaceJetton.pPlayer);
if (bIsInTable)
{
bflag = OnUserPlaceJetton(robotPlaceJetton.pPlayer, robotPlaceJetton.area, robotPlaceJetton.jetton);
}
m_chairRobotPlaceJetton[i].bflag = bflag;
vecRobotPlaceJetton.push_back(robotPlaceJetton);
//LOG_DEBUG("chair_robot_jetton - roomid:%d,tableid:%d,uid:%d,time:%d,passtick:%d,bIsInTable:%d,bIsJetton:%d,bflag:%d", GetRoomID(), GetTableID(), pPlayer->GetUID(), robotPlaceJetton.time, passtick, bIsInTable, bIsJetton, bflag);
}
if (m_chairRobotPlaceJetton[i].bflag == true)
{
vecRobotPlaceJetton.push_back(robotPlaceJetton);
}
}
for (uint32 i = 0; i < vecRobotPlaceJetton.size(); i++)
{
auto iter_begin = m_chairRobotPlaceJetton.begin();
for (; iter_begin != m_chairRobotPlaceJetton.end(); iter_begin++)
{
if (iter_begin->bflag == true)
{
m_chairRobotPlaceJetton.erase(iter_begin);
break;
}
}
}
}
bool CGameWarTable::OnRobotJetton()
{
//return false;
if (m_bIsRobotAlreadyJetton)
{
return false;
}
m_bIsRobotAlreadyJetton = true;
m_RobotPlaceJetton.clear();
int64 iJettonOldTime = -1;
map<uint32, CGamePlayer*>::iterator it = m_mpLookers.begin();
for (; it != m_mpLookers.end(); ++it)
{
CGamePlayer* pPlayer = it->second;
if (pPlayer == NULL || !pPlayer->IsRobot() || pPlayer == m_pCurBanker)
continue;
if (g_RandGen.RandRatio(50, PRO_DENO_100))
{
continue;
}
int iJettonCount = g_RandGen.RandRange(1, 6);
uint8 cbJettonArea = GetRobotJettonArea();
uint8 cbOldJettonArea = cbJettonArea;
int64 lUserRealJetton = GetRobotJettonScore(pPlayer, cbJettonArea);
if (lUserRealJetton == 0)
{
continue;
}
int iJettonTypeCount = g_RandGen.RandRange(1, 2);
int iJettonStartCount = g_RandGen.RandRange(2, 3);
int64 lOldRealJetton = -1;
bool bIsContinuouslyJetton = false;
int iPreRatio = g_RandGen.RandRange(5, 10);
if (g_RandGen.RandRatio(iPreRatio, PRO_DENO_100))
{
bIsContinuouslyJetton = true;
if (lUserRealJetton == 100 || lUserRealJetton == 1000)
{
iJettonCount = g_RandGen.RandRange(5, 18);
}
}
for (int iIndex = 0; iIndex < iJettonCount; iIndex++)
{
if (bIsContinuouslyJetton == false)
{
//cbJettonArea = GetRobotJettonArea();
if (g_RandGen.RandRatio(10, PRO_DENO_100))
{
cbJettonArea = JETTON_INDEX_OTHER;
}
else
{
cbJettonArea = cbOldJettonArea;
}
lUserRealJetton = GetRobotJettonScore(pPlayer, cbJettonArea);
if (lOldRealJetton == -1)
{
lOldRealJetton = lUserRealJetton;
}
if (lOldRealJetton != lUserRealJetton && iJettonTypeCount == 1)
{
lUserRealJetton = lOldRealJetton;
}
if (lOldRealJetton != lUserRealJetton && iJettonTypeCount == 2 && iJettonStartCount == iIndex)
{
lUserRealJetton = lUserRealJetton;
lOldRealJetton = lUserRealJetton;
}
else
{
lUserRealJetton = lOldRealJetton;
}
}
if (lUserRealJetton == 0)
{
continue;
}
if (cbJettonArea == JETTON_INDEX_OTHER)
{
if (lUserRealJetton == 50000 || lUserRealJetton == 200000)
{
lUserRealJetton = GetRobotJettonScoreRand(pPlayer, cbJettonArea);
}
}
tagRobotPlaceJetton robotPlaceJetton;
robotPlaceJetton.uid = pPlayer->GetUID();
robotPlaceJetton.pPlayer = pPlayer;
int64 uRemainTime = m_coolLogic.getCoolTick();
int64 passtick = m_coolLogic.getPassTick();
int64 uMaxDelayTime = s_PlaceJettonTime;
if (iJettonOldTime >= uMaxDelayTime - 500)
{
iJettonOldTime = g_RandGen.RandRange(100, 5000);
}
if (iJettonOldTime == -1)
{
robotPlaceJetton.time = g_RandGen.RandRange(100, 5000);
iJettonOldTime = robotPlaceJetton.time;
}
else
{
robotPlaceJetton.time = iJettonOldTime + g_RandGen.RandRange(100, 2000);
iJettonOldTime = robotPlaceJetton.time;
}
if (bIsContinuouslyJetton == true)
{
robotPlaceJetton.time = iJettonOldTime + 100;
iJettonOldTime = robotPlaceJetton.time;
}
if (robotPlaceJetton.time <= 0 || robotPlaceJetton.time > uMaxDelayTime - 500)
{
continue;
}
robotPlaceJetton.area = cbJettonArea;
robotPlaceJetton.jetton = lUserRealJetton;
robotPlaceJetton.bflag = false;
m_RobotPlaceJetton.push_back(robotPlaceJetton);
}
}
return true;
}
void CGameWarTable::OnRobotPlaceJetton()
{
if (m_RobotPlaceJetton.size() == 0)
{
return;
}
vector<tagRobotPlaceJetton> vecRobotPlaceJetton;
for (uint32 i = 0; i < m_RobotPlaceJetton.size(); i++)
{
if (m_RobotPlaceJetton.size() == 0)
{
return;
}
tagRobotPlaceJetton robotPlaceJetton = m_RobotPlaceJetton[i];
CGamePlayer * pPlayer = robotPlaceJetton.pPlayer;
if (pPlayer == NULL) {
continue;
}
if (m_RobotPlaceJetton.size() == 0)
{
return;
}
int64 passtick = m_coolLogic.getPassTick();
int64 uMaxDelayTime = s_PlaceJettonTime;
//passtick = passtick / 1000;
bool bflag = false;
bool bIsInTable = false;
bool bIsJetton = false;
for (uint32 i = 0; i < vecRobotPlaceJetton.size(); i++)
{
if (vecRobotPlaceJetton[i].pPlayer != NULL && vecRobotPlaceJetton[i].pPlayer->GetUID() == robotPlaceJetton.pPlayer->GetUID())
{
bIsJetton = true;
}
}
if (robotPlaceJetton.time <= passtick && uMaxDelayTime - passtick > 500 && m_RobotPlaceJetton[i].bflag == false && bIsJetton == false)
{
bIsInTable = IsInTableRobot(robotPlaceJetton.uid, robotPlaceJetton.pPlayer);
if (bIsInTable)
{
bflag = OnUserPlaceJetton(robotPlaceJetton.pPlayer, robotPlaceJetton.area, robotPlaceJetton.jetton);
}
m_RobotPlaceJetton[i].bflag = bflag;
vecRobotPlaceJetton.push_back(robotPlaceJetton);
//LOG_DEBUG("look_robot_jetton - roomid:%d,tableid:%d,uid:%d,time:%d,passtick:%d,bIsInTable:%d,bIsJetton:%d,bflag:%d", GetRoomID(), GetTableID(), pPlayer->GetUID(), robotPlaceJetton.time, passtick, bIsInTable, bIsJetton, bflag);
}
}
for (uint32 i = 0; i < vecRobotPlaceJetton.size(); i++)
{
auto iter_begin = m_RobotPlaceJetton.begin();
for (; iter_begin != m_RobotPlaceJetton.end(); iter_begin++)
{
if (iter_begin->bflag == true)
{
m_RobotPlaceJetton.erase(iter_begin);
break;
}
}
}
}
uint8 CGameWarTable::GetRobotJettonArea()
{
uint8 cbJettonArea = g_RandGen.RandRange(JETTON_INDEX_TIGER, JETTON_INDEX_OTHER);
//if (m_cbFrontRobotJettonArea == JETTON_INDEX_LEOPARD)
//{
// if (g_RandGen.RandRatio(8000, PRO_DENO_10000))
// {
// cbJettonArea = JETTON_INDEX_TIGER;
// }
// else if (g_RandGen.RandRatio(8000, PRO_DENO_10000))
// {
// cbJettonArea = JETTON_INDEX_LEOPARD;
// }
// else
// {
// cbJettonArea = JETTON_INDEX_OTHER;
// }
//}
//else if (m_cbFrontRobotJettonArea == JETTON_INDEX_TIGER)
//{
// if (g_RandGen.RandRatio(8000, PRO_DENO_10000))
// {
// cbJettonArea = JETTON_INDEX_LEOPARD;
// }
// else if (g_RandGen.RandRatio(8000, PRO_DENO_10000))
// {
// cbJettonArea = JETTON_INDEX_TIGER;
// }
// else
// {
// cbJettonArea = JETTON_INDEX_OTHER;
// }
//}
//else
//{
// if (g_RandGen.RandRatio(5000, PRO_DENO_10000))
// {
// if (g_RandGen.RandRatio(8000, PRO_DENO_10000))
// {
// cbJettonArea = JETTON_INDEX_TIGER;
// }
// else if (g_RandGen.RandRatio(8000, PRO_DENO_10000))
// {
// cbJettonArea = JETTON_INDEX_LEOPARD;
// }
// else
// {
// cbJettonArea = JETTON_INDEX_OTHER;
// }
// }
// else
// {
// if (g_RandGen.RandRatio(8000, PRO_DENO_10000))
// {
// cbJettonArea = JETTON_INDEX_LEOPARD;
// }
// else if (g_RandGen.RandRatio(8000, PRO_DENO_10000))
// {
// cbJettonArea = JETTON_INDEX_TIGER;
// }
// else
// {
// cbJettonArea = JETTON_INDEX_OTHER;
// }
// }
//}
if (g_RandGen.RandRatio(50, PRO_DENO_100))
{
cbJettonArea = JETTON_INDEX_TIGER;
}
else
{
cbJettonArea = JETTON_INDEX_LEOPARD;
}
if (g_RandGen.RandRatio(5, PRO_DENO_100))
{
cbJettonArea = JETTON_INDEX_OTHER;
}
if (cbJettonArea > JETTON_INDEX_OTHER)
{
cbJettonArea = g_RandGen.RandRange(JETTON_INDEX_TIGER, JETTON_INDEX_OTHER);
}
m_cbFrontRobotJettonArea = cbJettonArea;
return cbJettonArea;
}
bool CGameWarTable::ActiveWelfareCtrl()
{
LOG_DEBUG("enter ActiveWelfareCtrl ctrl player count:%d.", m_aw_ctrl_player_list.size());
//获取当前局活跃福利的控制玩家列表
GetActiveWelfareCtrlPlayerList();
vector<tagAWPlayerInfo>::iterator iter = m_aw_ctrl_player_list.begin();
for (; iter != m_aw_ctrl_player_list.end(); iter++)
{
uint32 control_uid = iter->uid;
//判断当前控制玩家是否在配置概率范围内
uint32 tmp = rand() % 100;
uint32 probability = iter->probability;
if (tmp > probability)
{
LOG_DEBUG("The current player is not in config rate - control_uid:%d tmp:%d probability:%d", control_uid, tmp, probability)
break;
}
LOG_DEBUG("The current player in config rate - control_uid:%d tmp:%d probability:%d", control_uid, tmp, probability)
if (SetControlPalyerWinForAW(control_uid, iter->max_win))
{
LOG_DEBUG("search success current player - uid:%d max_win:%d", control_uid, iter->max_win);
m_aw_ctrl_uid = control_uid; //设置当前活跃福利所控的玩家ID
return true;
}
else
{
break;
}
}
LOG_DEBUG("the all ActiveWelfareCtrl player is search fail. return false.");
return false;
}
bool CGameWarTable::SetControlPalyerWinForAW(uint32 control_uid, int64 max_win)
{
LOG_DEBUG("enter SetControlPalyerWinForAW function. control_uid:%d max_win:%lld", control_uid, max_win);
int iLoopCount = 99999;
int iLoopIndex = 0;
for (; iLoopIndex < iLoopCount; iLoopIndex++)
{
int64 lUserLostScore = 0;
int64 lUserWinScore = 0;
BYTE cbWinArea[JETTON_INDEX_COUNT] = { 0 };
int64 lWinMultiple[JETTON_INDEX_COUNT] = { 0 };
BYTE cbTableCardType[SHOW_CARD_COUNT] = { 0 };
BYTE cbTableCardArray[SHOW_CARD_COUNT][MAX_CARD_COUNT] = { 0 };
memcpy(cbTableCardArray, m_cbTableCardArray, sizeof(cbTableCardArray));
cbTableCardType[JETTON_INDEX_TIGER] = m_GameLogic.GetCardType(cbTableCardArray[JETTON_INDEX_TIGER], MAX_CARD_COUNT);
cbTableCardType[JETTON_INDEX_LEOPARD] = m_GameLogic.GetCardType(cbTableCardArray[JETTON_INDEX_LEOPARD], MAX_CARD_COUNT);
BYTE result = m_GameLogic.CompareCard(cbTableCardArray[JETTON_INDEX_TIGER], cbTableCardArray[JETTON_INDEX_LEOPARD], MAX_CARD_COUNT);
WORD iLostIndex = 0, iWinIndex = 0;
if (result == TRUE)
{
iWinIndex = JETTON_INDEX_TIGER;
iLostIndex = JETTON_INDEX_LEOPARD;
}
else
{
iWinIndex = JETTON_INDEX_LEOPARD;
iLostIndex = JETTON_INDEX_TIGER;
}
GetAreaInfo(iLostIndex, iWinIndex, cbTableCardType, cbWinArea, lWinMultiple);
uint32 dwUserID = control_uid;// pPlayer->GetUID();
for (int nAreaIndex = 0; nAreaIndex < JETTON_INDEX_COUNT; nAreaIndex++)
{
auto it_player_jetton = m_userJettonScore[nAreaIndex].find(dwUserID);
if (it_player_jetton == m_userJettonScore[nAreaIndex].end())
{
continue;
}
int64 lUserJettonScore = it_player_jetton->second;
if (lUserJettonScore == 0)
{
continue;
}
int64 lTempWinScore = 0;
if (cbWinArea[nAreaIndex] == TRUE)
{
lTempWinScore = (lUserJettonScore * lWinMultiple[nAreaIndex]);
lUserWinScore += lTempWinScore;
}
else
{
lTempWinScore = -lUserJettonScore;
lUserLostScore -= lUserJettonScore;
}
}
lUserWinScore += lUserLostScore;
if (lUserWinScore > 0 && lUserWinScore <= max_win)
{
LOG_DEBUG("search find success. control_uid:%d lUserWinScore:%lld max_win:%lld", control_uid, lUserWinScore, max_win);
return true;
}
else
{
for (int index = 0; index < 1024; index++)
{
m_GameLogic.RandCardList(m_cbTableCardArray[0], sizeof(m_cbTableCardArray) / sizeof(m_cbTableCardArray[0][0]));
BYTE cbArTempCardData[SHOW_CARD_COUNT][MAX_COUNT] = { 0 };
memcpy(cbArTempCardData, m_cbTableCardArray, sizeof(cbArTempCardData));
if (m_GameLogic.IsSameCard(cbArTempCardData[0], cbArTempCardData[1], MAX_COUNT) == false)
{
break;
}
}
}
}
return false;
}
void CGameWarTable::GetGamePlayLogInfo(net::msg_game_play_log* pInfo)
{
net::msg_war_play_log_rep* pplay = pInfo->mutable_war();
for (uint16 i = 0; i<m_vecRecord.size(); ++i)
{
net::war_play_log* plog = pplay->add_logs();
warGameRecord& record = m_vecRecord[i];
for (uint16 j = 0; j<JETTON_INDEX_COUNT; j++) {
plog->add_seats_win(record.wins[j]);
}
plog->set_card(record.card);
plog->set_index(record.index);
}
}
void CGameWarTable::GetGameEndLogInfo(net::msg_game_play_log* pInfo)
{
net::msg_war_play_log_rep* pplay = pInfo->mutable_war();
net::war_play_log* plog = pplay->add_logs();
warGameRecord& record = m_record;
for (uint16 j = 0; j<JETTON_INDEX_COUNT; j++) {
plog->add_seats_win(record.wins[j]);
}
plog->set_card(record.card);
plog->set_index(record.index);
}
void CGameWarTable::OnBrcControlSendAllPlayerInfo(CGamePlayer* pPlayer)
{
if (!pPlayer)
{
return;
}
LOG_DEBUG(" ++++ send brc control all true player info list uid:%d.", pPlayer->GetUID());
net::msg_brc_control_all_player_bet_info rep;
//计算座位玩家
for (WORD wChairID = 0; wChairID < GAME_PLAYER; wChairID++)
{
//获取用户
CGamePlayer * tmp_pPlayer = GetPlayer(wChairID);
if (tmp_pPlayer == NULL) continue;
if (tmp_pPlayer->IsRobot()) continue;
uint32 uid = tmp_pPlayer->GetUID();
net::brc_control_player_bet_info *info = rep.add_player_bet_list();
info->set_uid(uid);
info->set_coin(tmp_pPlayer->GetAccountValue(emACC_VALUE_COIN));
info->set_name(tmp_pPlayer->GetPlayerName());
LOG_DEBUG(" ++++ uid:%d name:%s", tmp_pPlayer->GetUID(), tmp_pPlayer->GetPlayerName());
//统计信息
auto iter = m_mpPlayerResultInfo.find(uid);
if (iter != m_mpPlayerResultInfo.end())
{
info->set_curr_day_win(iter->second.day_win_coin);
info->set_win_number(iter->second.win);
info->set_lose_number(iter->second.lose);
info->set_total_win(iter->second.total_win_coin);
}
//下注信息
uint64 total_bet = 0;
for (WORD wAreaIndex = 0; wAreaIndex < JETTON_INDEX_COUNT; ++wAreaIndex)
{
info->add_area_info(m_userJettonScore[wAreaIndex][uid]);
total_bet += m_userJettonScore[wAreaIndex][uid];
}
info->set_total_bet(total_bet);
info->set_ismaster(IsBrcControlPlayer(uid));
}
//计算旁观玩家
map<uint32, CGamePlayer*>::iterator it = m_mpLookers.begin();
for (; it != m_mpLookers.end(); ++it)
{
CGamePlayer* tmp_pPlayer = it->second;
if (tmp_pPlayer == NULL) continue;
if (tmp_pPlayer->IsRobot()) continue;
uint32 uid = tmp_pPlayer->GetUID();
net::brc_control_player_bet_info *info = rep.add_player_bet_list();
info->set_uid(uid);
info->set_coin(tmp_pPlayer->GetAccountValue(emACC_VALUE_COIN));
info->set_name(tmp_pPlayer->GetPlayerName());
LOG_DEBUG(" ++++ uid:%d name:%s", tmp_pPlayer->GetUID(), tmp_pPlayer->GetPlayerName());
//统计信息
auto iter = m_mpPlayerResultInfo.find(uid);
if (iter != m_mpPlayerResultInfo.end())
{
info->set_curr_day_win(iter->second.day_win_coin);
info->set_win_number(iter->second.win);
info->set_lose_number(iter->second.lose);
info->set_total_win(iter->second.total_win_coin);
}
//下注信息
uint64 total_bet = 0;
for (WORD wAreaIndex = 0; wAreaIndex < JETTON_INDEX_COUNT; ++wAreaIndex)
{
info->add_area_info(m_userJettonScore[wAreaIndex][uid]);
total_bet += m_userJettonScore[wAreaIndex][uid];
}
info->set_total_bet(total_bet);
info->set_ismaster(IsBrcControlPlayer(uid));
}
pPlayer->SendMsgToClient(&rep, net::S2C_MSG_BRC_CONTROL_ALL_PLAYER_BET_INFO);
}
void CGameWarTable::OnBrcControlNoticeSinglePlayerInfo(CGamePlayer* pPlayer)
{
if (!pPlayer)
{
return;
}
if (pPlayer->IsRobot()) return;
uint32 uid = pPlayer->GetUID();
LOG_DEBUG("notice brc control single true player bet info uid:%d.", uid);
net::msg_brc_control_single_player_bet_info rep;
//计算座位玩家
for (WORD wChairID = 0; wChairID < GAME_PLAYER; wChairID++)
{
//获取用户
CGamePlayer * tmp_pPlayer = GetPlayer(wChairID);
if (tmp_pPlayer == NULL) continue;
if (uid == tmp_pPlayer->GetUID())
{
net::brc_control_player_bet_info *info = rep.mutable_player_bet_info();
info->set_uid(uid);
info->set_coin(pPlayer->GetAccountValue(emACC_VALUE_COIN));
info->set_name(pPlayer->GetPlayerName());
//统计信息
auto iter = m_mpPlayerResultInfo.find(uid);
if (iter != m_mpPlayerResultInfo.end())
{
info->set_curr_day_win(iter->second.day_win_coin);
info->set_win_number(iter->second.win);
info->set_lose_number(iter->second.lose);
info->set_total_win(iter->second.total_win_coin);
}
//下注信息
uint64 total_bet = 0;
for (WORD wAreaIndex = 0; wAreaIndex < JETTON_INDEX_COUNT; ++wAreaIndex)
{
info->add_area_info(m_userJettonScore[wAreaIndex][uid]);
total_bet += m_userJettonScore[wAreaIndex][uid];
}
info->set_total_bet(total_bet);
info->set_ismaster(IsBrcControlPlayer(uid));
break;
}
}
//计算旁观玩家
map<uint32, CGamePlayer*>::iterator it = m_mpLookers.begin();
for (; it != m_mpLookers.end(); ++it)
{
CGamePlayer* tmp_pPlayer = it->second;
if (tmp_pPlayer == NULL)continue;
if (uid == tmp_pPlayer->GetUID())
{
net::brc_control_player_bet_info *info = rep.mutable_player_bet_info();
info->set_uid(uid);
info->set_coin(pPlayer->GetAccountValue(emACC_VALUE_COIN));
info->set_name(pPlayer->GetPlayerName());
//统计信息
auto iter = m_mpPlayerResultInfo.find(uid);
if (iter != m_mpPlayerResultInfo.end())
{
info->set_curr_day_win(iter->second.day_win_coin);
info->set_win_number(iter->second.win);
info->set_lose_number(iter->second.lose);
info->set_total_win(iter->second.total_win_coin);
}
//下注信息
uint64 total_bet = 0;
for (WORD wAreaIndex = 0; wAreaIndex < JETTON_INDEX_COUNT; ++wAreaIndex)
{
info->add_area_info(m_userJettonScore[wAreaIndex][uid]);
total_bet += m_userJettonScore[wAreaIndex][uid];
}
info->set_total_bet(total_bet);
info->set_ismaster(IsBrcControlPlayer(uid));
break;
}
}
for (auto &it : m_setControlPlayers)
{
it->SendMsgToClient(&rep, net::S2C_MSG_BRC_CONTROL_SINGLE_PLAYER_BET_INFO);
}
}
void CGameWarTable::OnBrcControlSendAllRobotTotalBetInfo()
{
LOG_DEBUG("notice brc control all robot totol bet info.");
net::msg_brc_control_total_robot_bet_info rep;
for (WORD wAreaIndex = 0; wAreaIndex < JETTON_INDEX_COUNT; ++wAreaIndex)
{
rep.add_area_info(m_allJettonScore[wAreaIndex] - m_playerJettonScore[wAreaIndex]);
LOG_DEBUG("wAreaIndex:%d m_allJettonScore[%d]:%lld m_playerJettonScore[%d]:%lld", wAreaIndex, wAreaIndex, m_allJettonScore[wAreaIndex], wAreaIndex, m_playerJettonScore[wAreaIndex]);
}
for (auto &it : m_setControlPlayers)
{
it->SendMsgToClient(&rep, net::S2C_MSG_BRC_CONTROL_TOTAL_ROBOT_BET_INFO);
}
}
void CGameWarTable::OnBrcControlSendAllPlayerTotalBetInfo()
{
LOG_DEBUG("notice brc control all player totol bet info.");
net::msg_brc_control_total_player_bet_info rep;
for (WORD wAreaIndex = 0; wAreaIndex < JETTON_INDEX_COUNT; ++wAreaIndex)
{
rep.add_area_info(m_playerJettonScore[wAreaIndex]);
LOG_DEBUG("m_playerJettonScore[%d]:%lld", wAreaIndex, m_playerJettonScore[wAreaIndex]);
}
for (auto &it : m_setControlPlayers)
{
it->SendMsgToClient(&rep, net::S2C_MSG_BRC_CONTROL_TOTAL_PLAYER_BET_INFO);
}
}
bool CGameWarTable::OnBrcControlEnterControlInterface(CGamePlayer* pPlayer)
{
if (!pPlayer)
return false;
LOG_DEBUG("brc control enter control interface. uid:%d", pPlayer->GetUID());
bool ret = OnBrcControlPlayerEnterInterface(pPlayer);
if (ret)
{
//刷新百人场桌子状态
m_brc_table_status_time = m_coolLogic.getCoolTick();
OnBrcControlFlushTableStatus(pPlayer);
//发送所有真实玩家列表
OnBrcControlSendAllPlayerInfo(pPlayer);
//发送机器人总下注信息
OnBrcControlSendAllRobotTotalBetInfo();
//发送真实玩家总下注信息
OnBrcControlSendAllPlayerTotalBetInfo();
//发送申请上庄玩家列表
//OnBrcControlFlushAppleList();
return true;
}
return false;
}
void CGameWarTable::OnBrcControlBetDeal(CGamePlayer* pPlayer)
{
if (!pPlayer)
return;
LOG_DEBUG("brc control bet deal. uid:%d", pPlayer->GetUID());
if (pPlayer->IsRobot())
{
//发送机器人总下注信息
OnBrcControlSendAllRobotTotalBetInfo();
}
else
{
//通知单个玩家下注信息
OnBrcControlNoticeSinglePlayerInfo(pPlayer);
//发送真实玩家总下注信息
OnBrcControlSendAllPlayerTotalBetInfo();
}
}
bool CGameWarTable::OnBrcAreaControl()
{
LOG_DEBUG("brc area control.");
if (m_real_control_uid == 0)
{
LOG_DEBUG("brc area control the control uid is zero.");
return false;
}
//获取当前控制区域
uint8 ctrl_area_type = AREA_MAX; //控制区域
uint8 ctrl_card_type = AREA_MAX; //控制牌型
for (uint8 i = 0; i < AREA_MAX - 2; ++i)
{
if (m_req_control_area[i] == 1)
{
ctrl_card_type = i;
break;
}
}
for (uint8 i = AREA_MAX - 2; i < AREA_MAX; ++i)
{
if (m_req_control_area[i] == 1)
{
ctrl_area_type = i;
break;
}
}
if (ctrl_area_type == AREA_MAX && ctrl_card_type == AREA_MAX)
{
LOG_DEBUG("brc area control the ctrl_area is error. ctrl_area_type:%d ctrl_card_type:%d", ctrl_area_type, ctrl_card_type);
return false;
}
int iLoopCount = 5000;
for (int iLoopIndex = 0; iLoopIndex < iLoopCount; iLoopIndex++)
{
int64 lUserLostScore = 0;
int64 lUserWinScore = 0;
BYTE cbWinArea[JETTON_INDEX_COUNT] = { 0 };
int64 lWinMultiple[JETTON_INDEX_COUNT] = { 0 };
BYTE cbTableCardType[SHOW_CARD_COUNT] = { 0 };
BYTE cbTableCardArray[SHOW_CARD_COUNT][MAX_CARD_COUNT] = { 0 };
memcpy(cbTableCardArray, m_cbTableCardArray, sizeof(cbTableCardArray));
cbTableCardType[JETTON_INDEX_TIGER] = m_GameLogic.GetCardType(cbTableCardArray[JETTON_INDEX_TIGER], MAX_CARD_COUNT);
cbTableCardType[JETTON_INDEX_LEOPARD] = m_GameLogic.GetCardType(cbTableCardArray[JETTON_INDEX_LEOPARD], MAX_CARD_COUNT);
BYTE result = m_GameLogic.CompareCard(cbTableCardArray[JETTON_INDEX_TIGER], cbTableCardArray[JETTON_INDEX_LEOPARD], MAX_CARD_COUNT);
WORD iLostIndex = 0, iWinIndex = 0;
if (result == TRUE)
{
iWinIndex = JETTON_INDEX_TIGER;
iLostIndex = JETTON_INDEX_LEOPARD;
}
else
{
iWinIndex = JETTON_INDEX_LEOPARD;
iLostIndex = JETTON_INDEX_TIGER;
}
//先判断区域,再判断牌型
bool find_flag = false;
//设置黑方赢
if (ctrl_area_type == AREA_BLACK && iWinIndex == JETTON_INDEX_TIGER)
{
if (ctrl_card_type == AREA_MAX)
{
find_flag = true;
}
else
{
if (cbTableCardType[JETTON_INDEX_TIGER] == ctrl_card_type)
{
find_flag = true;
}
}
}
//设置红方赢
if (ctrl_area_type == AREA_RED && iWinIndex == JETTON_INDEX_LEOPARD)
{
if (ctrl_card_type == AREA_MAX)
{
find_flag = true;
}
else
{
if (cbTableCardType[JETTON_INDEX_LEOPARD] == ctrl_card_type)
{
find_flag = true;
}
}
}
//只设置赢取方的牌型
if (ctrl_area_type == AREA_MAX && ctrl_card_type != AREA_MAX)
{
if (iWinIndex == JETTON_INDEX_TIGER && cbTableCardType[JETTON_INDEX_TIGER] == ctrl_card_type)
{
find_flag = true;
}
if (iWinIndex == JETTON_INDEX_LEOPARD && cbTableCardType[JETTON_INDEX_LEOPARD] == ctrl_card_type)
{
find_flag = true;
}
}
if (!find_flag)
{
for (int index = 0; index < 1024; index++)
{
m_GameLogic.RandCardList(m_cbTableCardArray[0], sizeof(m_cbTableCardArray) / sizeof(m_cbTableCardArray[0][0]));
BYTE cbArTempCardData[SHOW_CARD_COUNT][MAX_COUNT] = { 0 };
memcpy(cbArTempCardData, m_cbTableCardArray, sizeof(cbArTempCardData));
if (m_GameLogic.IsSameCard(cbArTempCardData[0], cbArTempCardData[1], MAX_COUNT) == false)
{
break;
}
}
}
else
{
return true;
}
}
return false;
}
void CGameWarTable::OnBrcFlushSendAllPlayerInfo()
{
LOG_DEBUG("send brc flush all true player info list.");
net::msg_brc_control_all_player_bet_info rep;
//计算座位玩家
for (WORD wChairID = 0; wChairID < GAME_PLAYER; wChairID++)
{
//获取用户
CGamePlayer * tmp_pPlayer = GetPlayer(wChairID);
if (tmp_pPlayer == NULL) continue;
if (tmp_pPlayer->IsRobot()) continue;
uint32 uid = tmp_pPlayer->GetUID();
net::brc_control_player_bet_info *info = rep.add_player_bet_list();
info->set_uid(uid);
info->set_coin(tmp_pPlayer->GetAccountValue(emACC_VALUE_COIN));
info->set_name(tmp_pPlayer->GetPlayerName());
//统计信息
auto iter = m_mpPlayerResultInfo.find(uid);
if (iter != m_mpPlayerResultInfo.end())
{
info->set_curr_day_win(iter->second.day_win_coin);
info->set_win_number(iter->second.win);
info->set_lose_number(iter->second.lose);
info->set_total_win(iter->second.total_win_coin);
}
//下注信息
uint64 total_bet = 0;
for (WORD wAreaIndex = 0; wAreaIndex < JETTON_INDEX_COUNT; ++wAreaIndex)
{
info->add_area_info(m_userJettonScore[wAreaIndex][uid]);
total_bet += m_userJettonScore[wAreaIndex][uid];
}
info->set_total_bet(total_bet);
info->set_ismaster(IsBrcControlPlayer(uid));
}
//计算旁观玩家
map<uint32, CGamePlayer*>::iterator it = m_mpLookers.begin();
for (; it != m_mpLookers.end(); ++it)
{
CGamePlayer* tmp_pPlayer = it->second;
if (tmp_pPlayer == NULL) continue;
if (tmp_pPlayer->IsRobot()) continue;
uint32 uid = tmp_pPlayer->GetUID();
net::brc_control_player_bet_info *info = rep.add_player_bet_list();
info->set_uid(uid);
info->set_coin(tmp_pPlayer->GetAccountValue(emACC_VALUE_COIN));
info->set_name(tmp_pPlayer->GetPlayerName());
//统计信息
auto iter = m_mpPlayerResultInfo.find(uid);
if (iter != m_mpPlayerResultInfo.end())
{
info->set_curr_day_win(iter->second.day_win_coin);
info->set_win_number(iter->second.win);
info->set_lose_number(iter->second.lose);
info->set_total_win(iter->second.total_win_coin);
}
//下注信息
uint64 total_bet = 0;
for (WORD wAreaIndex = 0; wAreaIndex < JETTON_INDEX_COUNT; ++wAreaIndex)
{
info->add_area_info(m_userJettonScore[wAreaIndex][uid]);
total_bet += m_userJettonScore[wAreaIndex][uid];
}
info->set_total_bet(total_bet);
info->set_ismaster(IsBrcControlPlayer(uid));
}
for (auto &it : m_setControlPlayers)
{
it->SendMsgToClient(&rep, net::S2C_MSG_BRC_CONTROL_ALL_PLAYER_BET_INFO);
}
}
bool CGameWarTable::ChangeBanker(bool bCancelCurrentBanker)
{
return true;
}
void CGameWarTable::SendApplyUser(CGamePlayer* pPlayer)
{
return;
}
// 设置库存输赢 add by har
bool CGameWarTable::SetStockWinLose() {
int64 stockChange = m_pHostRoom->IsStockChangeCard(this);
if (stockChange == 0)
return false;
int64 playerAllWinScore = GetBankerAndPlayerWinScore();
// 循环,直到找到满足条件的牌组合
for (int i = 0; i < 1000; ++i) {
if (CheckStockChange(stockChange, playerAllWinScore, i))
return true;
//重新洗牌
for (int index = 0; index < 1024; ++index) {
m_GameLogic.RandCardList(m_cbTableCardArray[0], sizeof(m_cbTableCardArray) / sizeof(m_cbTableCardArray[0][0]));
BYTE cbArTempCardData[SHOW_CARD_COUNT][MAX_COUNT] = { 0 };
memcpy(cbArTempCardData, m_cbTableCardArray, sizeof(cbArTempCardData));
if (!m_GameLogic.IsSameCard(cbArTempCardData[0], cbArTempCardData[1], MAX_COUNT))
break;
}
playerAllWinScore = GetBankerAndPlayerWinScore();
}
LOG_ERROR("SetStockWinLose fail roomid:%d,tableid:%d,playerAllWinScore:%d,stockChange:%d", GetRoomID(), GetTableID(), playerAllWinScore, stockChange);
return false;
}
// 获取某个玩家的赢分 add by har
int64 CGameWarTable::GetSinglePlayerWinScore(CGamePlayer *pPlayer, uint8 cbWinArea[JETTON_INDEX_COUNT], int64 lWinMultiple[JETTON_INDEX_COUNT], int64 &lBankerWinScore) {
if (pPlayer == NULL)
return 0;
int64 playerWinScore = 0; // 该玩家赢分
uint32 dwUserID = pPlayer->GetUID();
for (int nAreaIndex = 0; nAreaIndex < JETTON_INDEX_COUNT; ++nAreaIndex) {
map<uint32, int64>::iterator it_player_jetton = m_userJettonScore[nAreaIndex].find(dwUserID);
if (it_player_jetton == m_userJettonScore[nAreaIndex].end())
continue;
int64 lUserJettonScore = it_player_jetton->second;
if (lUserJettonScore == 0)
continue;
int64 lTempWinScore = 0;
if (cbWinArea[nAreaIndex] == TRUE)
playerWinScore += (lUserJettonScore * lWinMultiple[nAreaIndex]);
else
playerWinScore -= lUserJettonScore;
}
lBankerWinScore -= playerWinScore;
if (pPlayer->IsRobot())
return 0;
return playerWinScore;
}
// 获取非机器人玩家赢分 add by har
int64 CGameWarTable::GetBankerAndPlayerWinScore() {
int64 playerAllWinScore = 0; // 非机器人玩家总赢数
int64 lBankerWinScore = 0;
uint8 cbWinArea[JETTON_INDEX_COUNT] = { 0 };
int64 lWinMultiple[JETTON_INDEX_COUNT] = { 0 };
uint8 cbTableCardType[SHOW_CARD_COUNT] = { 0 };
uint8 cbTableCardArray[SHOW_CARD_COUNT][MAX_CARD_COUNT] = { 0 };
memcpy(cbTableCardArray, m_cbTableCardArray, sizeof(cbTableCardArray));
cbTableCardType[JETTON_INDEX_TIGER] = m_GameLogic.GetCardType(cbTableCardArray[JETTON_INDEX_TIGER], MAX_CARD_COUNT);
cbTableCardType[JETTON_INDEX_LEOPARD] = m_GameLogic.GetCardType(cbTableCardArray[JETTON_INDEX_LEOPARD], MAX_CARD_COUNT);
uint8 result = m_GameLogic.CompareCard(cbTableCardArray[JETTON_INDEX_TIGER], cbTableCardArray[JETTON_INDEX_LEOPARD], MAX_CARD_COUNT);
uint16 iLostIndex = 0, iWinIndex = 0;
if (result == TRUE) {
iWinIndex = JETTON_INDEX_TIGER;
iLostIndex = JETTON_INDEX_LEOPARD;
}
else {
iWinIndex = JETTON_INDEX_LEOPARD;
iLostIndex = JETTON_INDEX_TIGER;
}
GetAreaInfo(iLostIndex, iWinIndex, cbTableCardType, cbWinArea, lWinMultiple);
// 椅子用户
for (int nChairID = 0; nChairID < GAME_PLAYER; ++nChairID)
playerAllWinScore += GetSinglePlayerWinScore(GetPlayer(nChairID), cbWinArea, lWinMultiple, lBankerWinScore);
// 旁观用户
for (map<uint32, CGamePlayer*>::iterator it_looker = m_mpLookers.begin(); it_looker != m_mpLookers.end(); ++it_looker)
playerAllWinScore += GetSinglePlayerWinScore(it_looker->second, cbWinArea, lWinMultiple, lBankerWinScore);
if (IsBankerRealPlayer())
playerAllWinScore += lBankerWinScore;
return playerAllWinScore;
} | [
"53386482+luoweiqiao@users.noreply.github.com"
] | 53386482+luoweiqiao@users.noreply.github.com |
4575b45e232329636230f1eff414e45e80dd0730 | 3db3033c14e26ad7db8714f85e52d62495078cad | /tests/compile_time/source/include.version.cpp | 38abe959da4348528b68a2a2d7457d190ea945d4 | [
"BSL-1.0"
] | permissive | ThePhD/itsy_bitsy | bf8e901ad8961eeef5e293ff75da92fd72556c6a | d5b6bf9509bb2dff6235452d427f0b1c349d5f8b | refs/heads/main | 2022-08-13T22:05:44.236268 | 2022-08-01T17:42:49 | 2022-08-01T17:42:49 | 193,730,863 | 115 | 17 | NOASSERTION | 2022-07-17T15:18:54 | 2019-06-25T15:05:21 | C++ | UTF-8 | C++ | false | false | 335 | cpp | // itsy.bitsy
//
// Copyright ⓒ 2019-present ThePhD.
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See https://github.com/ThePhD/itsy_bitsy#using-the-library for documentation.
#include <itsy/version.hpp>
| [
"phdofthehouse@gmail.com"
] | phdofthehouse@gmail.com |
017402df3fa9b224396a8dab42ab70524bee7ab3 | 91a882547e393d4c4946a6c2c99186b5f72122dd | /Source/XPSP1/NT/net/rras/cm/ccfgnt/debug.cpp | 5eaa4d4860f74d71345b131e245bc8cfd0ff7f99 | [] | no_license | IAmAnubhavSaini/cryptoAlgorithm-nt5src | 94f9b46f101b983954ac6e453d0cf8d02aa76fc7 | d9e1cdeec650b9d6d3ce63f9f0abe50dabfaf9e2 | refs/heads/master | 2023-09-02T10:14:14.795579 | 2021-11-20T13:47:06 | 2021-11-20T13:47:06 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,434 | cpp | /*-----------------------------------------------------------------------------
debug.cpp
This file implements the debuggin features
Copyright (c) 1996-1998 Microsoft Corporation
All rights reserved
Authors:
ChrisK Chris Kauffman
Histroy:
7/22/96 ChrisK Cleaned and formatted
7/31/96 ValdonB Changes for Win16
-----------------------------------------------------------------------------*/
#include <windows.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#if defined(WIN16)
extern HINSTANCE g_hInst;
extern LPSTR g_lpszCommandLine;
extern LPSTR GetCommandLine(void);
#endif
BOOL fInAssert=FALSE;
// ############################################################################
// DebugSz
//
// This function outputs debug string
//
// Created 1/28/96, Chris Kauffman
// ############################################################################
void DebugSz(LPCSTR psz)
{
#if defined(_DEBUG)
OutputDebugString(psz);
#endif
} // DebugSz
// ############################################################################
// Debug Printf to debug output screen
void Dprintf(LPCSTR pcsz, ...)
{
#ifdef _DEBUG
va_list argp;
char szBuf[1024];
va_start(argp, pcsz);
#if 0
vsprintf(szBuf, pcsz, argp);
#else
wvsprintf(szBuf, pcsz, argp);
#endif
DebugSz(szBuf);
va_end(argp);
#endif
} // Dprintf()
// ############################################################################
// Handle asserts
BOOL FAssertProc(LPCSTR szFile, DWORD dwLine, LPCSTR szMsg, DWORD dwFlags)
{
BOOL fAssertIntoDebugger = FALSE;
char szMsgEx[1024], szTitle[255], szFileName[MAX_PATH];
int id;
UINT fuStyle;
LPTSTR pszCommandLine = GetCommandLine();
//BYTE szTime[80];
#if !defined(WIN16)
CHAR szTime[80];
HANDLE hAssertTxt;
SYSTEMTIME st;
DWORD cbWritten;
#endif
// no recursive asserts
if (fInAssert)
{
DebugSz("***Recursive Assert***\r\n");
return(FALSE);
}
fInAssert = TRUE;
#if defined(WIN16)
GetModuleFileName(g_hInst, szFileName, MAX_PATH);
wsprintf(szMsgEx,"%s:#%ld\r\n%s,\r\n%s", szFile, dwLine, szFileName, szMsg);
#else
GetModuleFileName(NULL, szFileName, MAX_PATH);
wsprintf(szMsgEx,"%s:#%d\r\nProcess ID: %d %s, Thread ID: %d\r\n%s",
szFile,dwLine,GetCurrentProcessId(),szFileName,GetCurrentThreadId(),szMsg);
#endif
wsprintf(szTitle,"Assertion Failed");
fuStyle = MB_APPLMODAL | MB_ABORTRETRYIGNORE;
fuStyle |= MB_ICONSTOP;
DebugSz(szTitle);
DebugSz(szMsgEx);
// dump the assert into ASSERT.TXT
#if !defined(WIN16)
hAssertTxt = CreateFile("assert.txt", GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_WRITE_THROUGH, NULL);
if (INVALID_HANDLE_VALUE != hAssertTxt)
{
SetFilePointer(hAssertTxt, 0, NULL, FILE_END);
GetLocalTime(&st);
wsprintf(szTime, "\r\n\r\n%02d/%02d/%02d %d:%02d:%02d\r\n", st.wMonth, st.wDay, st.wYear, st.wHour, st.wMinute, st.wSecond);
WriteFile(hAssertTxt, szTime, lstrlen(szTime), &cbWritten, NULL);
WriteFile(hAssertTxt, szMsgEx, lstrlen(szMsgEx), &cbWritten, NULL);
CloseHandle(hAssertTxt);
}
#endif
id = MessageBox(NULL, szMsgEx, szTitle, fuStyle);
switch (id)
{
case IDABORT:
#if defined(WIN16)
exit(0);
#else
ExitProcess(0);
#endif
break;
case IDCANCEL:
case IDIGNORE:
break;
case IDRETRY:
fAssertIntoDebugger = TRUE;
break;
}
fInAssert = FALSE;
return(fAssertIntoDebugger);
} // AssertProc()
| [
"support@cryptoalgo.cf"
] | support@cryptoalgo.cf |
193595138bd62c733db37ec35731bc0786a5852f | d09092dbe69c66e916d8dd76d677bc20776806fe | /.libs/puno_automatic_generated/inc/types/com/sun/star/ui/ItemType.hpp | d052488a5f842fd5674497e2fb678edc801b02a0 | [] | no_license | GXhua/puno | 026859fcbc7a509aa34ee857a3e64e99a4568020 | e2f8e7d645efbde5132b588678a04f70f1ae2e00 | refs/heads/master | 2020-03-22T07:35:46.570037 | 2018-07-11T02:19:26 | 2018-07-11T02:19:26 | 139,710,567 | 0 | 0 | null | 2018-07-04T11:03:58 | 2018-07-04T11:03:58 | null | UTF-8 | C++ | false | false | 182 | hpp | #ifndef INCLUDED_COM_SUN_STAR_UI_ITEMTYPE_HPP
#define INCLUDED_COM_SUN_STAR_UI_ITEMTYPE_HPP
#include "com/sun/star/ui/ItemType.hdl"
#endif // INCLUDED_COM_SUN_STAR_UI_ITEMTYPE_HPP
| [
"guoxinhua@10.10.12.142"
] | guoxinhua@10.10.12.142 |
e6277e7d60d6ec9a08477b3cb3b796dbf831a407 | ff93b3d44693687f0e8dd9dec525ce4ac08c317c | /agents/Player/ruleset.h | 0afbe43baf17ce4f56107440afe7cde9651f814b | [] | no_license | agiordana/HAT | 6ea2b5a6b3a635e6702ccf8573133a65c8c14c9a | f61f0783c8d9f9d4e3b1374eb6475f4d88f95ff9 | refs/heads/master | 2020-12-24T07:54:07.078444 | 2018-10-01T12:39:05 | 2018-10-01T12:39:05 | 59,103,594 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,701 | h | /*
* ruleset.h
* mngagent
*
* Created by Attilio Giordana on 1/13/12.
* Copyright 2012 Università del Piemonte Orientale. All rights reserved.
*
*/
#ifndef _mngagent_ruleset_
#define _mngagent_ruleset_
#include "agentlib.h"
#include "rule.h"
#include "eventcounterset.h"
#include "BooleanConditionSet.h"
class RuleSet: public setof<Rule> {
public:
/**
Costruttore della classe. Inizializza n istanze della classe Rule, tante quanti sono i file XML
presenti nella working directory dell'agente. Ogni file XML contiene tutti i parametri che
vengono utilizzati dalle istanze di Rule.
@param dir directory che contiene i file XML con i parametri per le istanze di Rule
*/
RuleSet(std::string);
/**
@param ec istanza di EventCounterSet, contiene istanze di EventCounter
@param action insieme di istanze di Message che contengono le informazioni da inviare come
risposta al client
@return numero di matching trovati
*/
int match(EventCounterSet* ec, BooleanConditionSet* cnd, setof<MMessage>& action);
/**
* Imposta il tempo di attesa da utilizzare per la modalità program_wait
* @param wt tempo di attesa in secondi
* @return ritorna il tempo di attesa impostato
*/
bool setValidityTime(std::string, std::string, std::string);
bool setStatus(std::string, std::string);
bool subjects(MParams& subj);
bool timeUpdate();
protected:
/**
* Controlla se la regola è attiva
* @param r istanza di Rule, contiene le informazioni sulla regola
* @param active
* @return true se la regola deve essere eseguita, false altrimenti
*/
bool isON(Rule&);
};
#endif
| [
"noreply@github.com"
] | agiordana.noreply@github.com |
b1a44e3d22922983fdeab36495892fa564da924f | a5d5f8f8bb2568254aaa4bf572d67c7dfc097ca4 | /sample_project/Classes/RankScene.hpp | 79c0833cf6abed50a2719003a4eca959709c68a4 | [
"MIT"
] | permissive | gary9987/oop-bang-game-project | a4a89cc2a256502a9693cca52ebbb6d8452eee6f | 99ce8ef0089d1286321e82ffc74b380bf0d51316 | refs/heads/master | 2022-01-18T16:00:50.386773 | 2019-06-14T14:33:27 | 2019-06-14T14:33:27 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 476 | hpp | //
// RankScene.hpp
// HelloCpp-mobile
//
// Created by Guan Ying Chen on 2019/5/18.
//
#ifndef RankScene_hpp
#define RankScene_hpp
#include "cocos2d.h"
#include "ui/CocosGUI.h"
class RankScene : public cocos2d::Scene{
public:
static cocos2d::Scene *createScene();
bool init() override;
CREATE_FUNC(RankScene);
private:
void BackToLoooby(cocos2d::Ref*, cocos2d::ui::Widget::TouchEventType);
};
#endif /* RankScene_hpp */
| [
"s310068@shsh.tw"
] | s310068@shsh.tw |
e5ea8fa915728375bb3055ab7539f41f8ae762db | 6ee40cae3a87cbe0fc2140d87839bf947264493b | /guiPageInterface.h | 3885b07b70f78fbe8cf6979af91264fd322f7e58 | [] | no_license | wangxingchao/qt_printer_v0 | 570c13ed5dfa001f00524ef7bbe1b8c3da64a856 | 00c1196f45ea6b269b34de81273822af9e8da0e3 | refs/heads/master | 2020-04-06T03:42:12.056968 | 2013-03-24T10:23:46 | 2013-03-24T10:23:46 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 2,893 | h | #ifndef GLOBALVARIABLE_H
#define GLOBALVARIABLE_H
#include "PMJOpMessage.hh"
/***页面请求处理过程:页面请求按钮触发后,界面侧将数据打包,调用函数HandPageRequestAction
***此函数有三个参数:
*** PageNo int 表示页面的ID号码,见<<guiPageDef.h>>中的定义
*** IENo int 表示子页面的ID号码,见<<guiPageDef.h>>中的定义
*** Data void* 页面请求包含数据项,格式为:类型 = 置,数据中间以分号间隔
*** 例如, int = 5;string = 3322233;只支持这两种数据类型。
***/
class guiPageInterface
{
public:
static PMJInitialConfMsg g_pmjInitialConfMsg;
static PMJDeviceOnOffMsg g_pmjDeviceOnOffMsg;
static PMJPrintMsg g_pmjPrintMsg;
static PMJInfoEditSaveMsg g_InfoEditSaveMsg;
static PMJInfoContentGetMsg g_pmjInfocontentGetmsg;
static PMJInfoContentGetRspMsg g_pmjInfoContentGetRspMsg;
static PMJInfoNameListGetMsg g_pmjInfoNameListGetmsg;
static PMJInfoNameListGetRspMsg g_pmjInfoNameListGetRspMsg;
static PMJInkChannelLogReqMsg g_pmjInkChannelLogMsg;
static PMJUserLogReqMsg g_pmjUserLogMsg;
static PMJObStacleLogReqMsg g_pmjObStacleLogMsg;
static PMJMainTainMsg g_pmjMainTainMsg;
static PMJInkChannelParaMsg g_pmjInkChannelParaMsg;
static PMJInkPrintParaMsg g_pmjInkPrintParaMsg;
static PMJWordStyleParaMsg g_wordStyleParaMsg;
public:
void static SetMainWnd(void* wnd);
void static SendMessage(const char* data, qint32 len);
void static HandPageRequestAction(int pageNo, int ieNo,void *data);
void static HandlePageUserManualReq(int ieNo,void *data);
void static HandlePageSysInfoReq(int ieNo,void *data);
void static HandlePageRunLog(int ieNo, void* data);
void static HandlePagePrint(int ieNo,void *data);
void static HandlePagePenyinPara(int ieNo, void *data);
void static HandlePageOtherStatus(int ieNo, void *data);
void static HandlePageOnOffPmj(int ieNo,void *data);
void static HandlePageNewInfo(int ieNo, void *data);
void static HandlePageMain(int ieNo,void *data);
void static HandlePageMainWindow(int ieNo,void *data);
void static HandlePageMainTain(int ieNo, void *data);
void static HandlePageLightStatus(int ieNo, void *data);
void static HandlePageInitCfg(int ieNo, void *data);
void static HandlePageEditInfo(int ieNo, void *data);
void static HandlePageDailyMainTain(int ieNo, void *data);
void static HandlePageInkParam(int ieNo, void *data);
void static HandlePageFontParam(int ieNo, void *data);
private:
static void* m_mainwnd;
};
#endif // GLOBALVARIABLE_H
| [
"root@ubuntu.(none)"
] | root@ubuntu.(none) |
621c216ac3dc4cc8d2216bcc50a6eac9943ebc22 | c665670b6dde521d7faadfe1958b38b19d16bc80 | /firmware/Font16.cpp | 906d6dc173f4be15afa36e012eecb6952cfa3721 | [
"BSD-3-Clause",
"BSD-2-Clause"
] | permissive | menan/Adafruit_ST7735_AS | 380587bec563d99bd00e3446fde126943350d3c3 | 6aacda9328eadc9125113532ec22e56921c4f716 | refs/heads/master | 2016-09-06T09:00:19.220898 | 2015-03-05T18:26:36 | 2015-03-05T18:26:36 | 31,642,207 | 0 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 28,767 | cpp | // Font size 2
#include "Font16.h"
#ifdef __AVR__
#include <avr/pgmspace.h>
#else
#define PROGMEM
#endif
PROGMEM const unsigned char widtbl_f16[96] = // character width table
{
5, 2, 3, 8, 7, 8, 8, 2, // char 32 - 39
6, 6, 7, 5, 2, 5, 4, 6, // char 40 - 47
7, 7, 7, 7, 7, 7, 7, 7, // char 48 - 55
7, 7, 2, 2, 5, 5, 5, 7, // char 56 - 63
8, 7, 7, 7, 7, 7, 7, 7, // char 64 - 71
6, 3, 7, 7, 6, 9, 7, 7, // char 72 - 79
7, 7, 7, 7, 7, 7, 7, 9, // char 80 - 87
7, 7, 7, 3, 6, 3, 7, 8, // char 88 - 95
3, 6, 6, 6, 6, 6, 5, 6, // char 96 - 103
6, 4, 4, 5, 4, 7, 6, 7, // char 104 - 111
6, 7, 5, 5, 4, 6, 7, 7, // char 112 - 119
5, 6, 6, 4, 2, 4, 7, 5 // char 120 - 127
};
// Row format, MSB left
PROGMEM const unsigned char chr_f16_20[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // row 1 - 11
0x00, 0x00, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_21[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, // row 1 - 11
0x00, 0x40, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_22[16] = // 1 unsigned char per row
{
0x00, 0x00, 0xA0, 0xA0, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // row 1 - 11
0x00, 0x00, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_23[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x24, 0x24, 0x24, 0xFF, 0x24, 0x24, 0xFF, 0x24, // row 1 - 11
0x24, 0x24, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_24[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x3C, 0x42, 0x40, 0x40, 0x70, 0x40, 0x70, 0x40, // row 1 - 11
0x40, 0xFE, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_25[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x61, 0x91, 0x92, 0x64, 0x08, 0x10, 0x26, 0x49, // row 1 - 11
0x89, 0x86, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_26[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x20, 0x50, 0x88, 0x88, 0x50, 0x20, 0x52, 0x8C, // row 1 - 11
0x8C, 0x73, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_27[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x40, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, // row 1 - 11
0x00, 0x00, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_28[16] = // 1 unsigned char per row
{
0x00, 0x0C, 0x10, 0x20, 0x40, 0x40, 0x80, 0x80, 0x80, 0x80, 0x80, // row 1 - 11
0x40, 0x40, 0x20, 0x10, 0x0C // row 12 - 16
};
PROGMEM const unsigned char chr_f16_29[16] = // 1 unsigned char per row
{
0x00, 0xC0, 0x20, 0x10, 0x08, 0x08, 0x04, 0x04, 0x04, 0x04, 0x04, // row 1 - 11
0x08, 0x08, 0x10, 0x20, 0xC0 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_2A[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x00, 0x10, 0x92, 0x54, 0x38, 0x54, 0x92, 0x10, // row 1 - 11
0x00, 0x00, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_2B[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0xF8, 0x20, 0x20, // row 1 - 11
0x00, 0x00, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_2C[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // row 1 - 11
0xC0, 0xC0, 0x40, 0x80, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_2D[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, // row 1 - 11
0x00, 0x00, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_2E[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // row 1 - 11
0xC0, 0xC0, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_2F[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x04, 0x04, 0x08, 0x08, 0x10, 0x10, 0x20, 0x20, 0x40, // row 1 - 11
0x40, 0x80, 0x80, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_30[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x38, 0x44, 0x44, 0x82, 0x82, 0x82, 0x82, 0x44, // row 1 - 11
0x44, 0x38, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_31[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x10, 0x30, 0x50, 0x10, 0x10, 0x10, 0x10, 0x10, // row 1 - 11
0x10, 0x7C, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_32[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x38, 0x44, 0x82, 0x02, 0x04, 0x18, 0x20, 0x40, // row 1 - 11
0x80, 0xFE, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_33[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x78, 0x84, 0x02, 0x04, 0x38, 0x04, 0x02, 0x02, // row 1 - 11
0x84, 0x78, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_34[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x04, 0x0C, 0x14, 0x24, 0x44, 0x84, 0xFE, 0x04, // row 1 - 11
0x04, 0x04, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_35[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0xFC, 0x80, 0x80, 0x80, 0xF8, 0x04, 0x02, 0x02, // row 1 - 11
0x84, 0x78, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_36[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x3C, 0x40, 0x80, 0x80, 0xB8, 0xC4, 0x82, 0x82, // row 1 - 11
0x44, 0x38, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_37[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x7E, 0x02, 0x02, 0x04, 0x04, 0x08, 0x08, 0x10, // row 1 - 11
0x10, 0x10, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_38[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x38, 0x44, 0x82, 0x44, 0x38, 0x44, 0x82, 0x82, // row 1 - 11
0x44, 0x38, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_39[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x38, 0x44, 0x82, 0x82, 0x46, 0x3A, 0x02, 0x02, // row 1 - 11
0x04, 0x78, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_3A[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0xC0, 0xC0, // row 1 - 11
0x00, 0x00, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_3B[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0xC0, 0xC0, // row 1 - 11
0x40, 0x80, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_3C[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x20, 0x40, 0x80, 0x40, 0x20, // row 1 - 11
0x10, 0x08, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_3D[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0xF8, 0x00, // row 1 - 11
0x00, 0x00, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_3E[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x10, 0x08, 0x10, 0x20, // row 1 - 11
0x40, 0x80, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_3F[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x38, 0x44, 0x82, 0x02, 0x04, 0x08, 0x10, 0x10, // row 1 - 11
0x00, 0x10, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_40[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x3C, 0x42, 0x99, 0xA5, 0xA5, 0xA5, 0xA5, 0x9E, // row 1 - 11
0x40, 0x3E, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_41[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x10, 0x10, 0x28, 0x28, 0x44, 0x44, 0x7C, 0x82, // row 1 - 11
0x82, 0x82, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_42[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0xF8, 0x84, 0x82, 0x84, 0xF8, 0x84, 0x82, 0x82, // row 1 - 11
0x84, 0xF8, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_43[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x3C, 0x42, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, // row 1 - 11
0x42, 0x3C, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_44[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0xF8, 0x84, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, // row 1 - 11
0x84, 0xF8, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_45[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0xFE, 0x80, 0x80, 0x80, 0xFC, 0x80, 0x80, 0x80, // row 1 - 11
0x80, 0xFE, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_46[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0xFE, 0x80, 0x80, 0x80, 0xF8, 0x80, 0x80, 0x80, // row 1 - 11
0x80, 0x80, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_47[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x3C, 0x42, 0x80, 0x80, 0x80, 0x9C, 0x82, 0x82, // row 1 - 11
0x42, 0x3C, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_48[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x84, 0x84, 0x84, 0x84, 0xFC, 0x84, 0x84, 0x84, // row 1 - 11
0x84, 0x84, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_49[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0xE0, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, // row 1 - 11
0x40, 0xE0, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_4A[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x82, // row 1 - 11
0x44, 0x38, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_4B[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x84, 0x88, 0x90, 0xA0, 0xC0, 0xA0, 0x90, 0x88, // row 1 - 11
0x84, 0x82, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_4C[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, // row 1 - 11
0x80, 0xFC, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_4D[32] = // 2 unsigned chars per row
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC1, 0x80, 0xC1, 0x80, 0xA2, 0x80, // row 1 - 6
0xA2, 0x80, 0x94, 0x80, 0x94, 0x80, 0x88, 0x80, 0x88, 0x80, 0x80, 0x80, // row 7 - 12
0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // row 13 - 16
};
PROGMEM const unsigned char chr_f16_4E[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0xC2, 0xC2, 0xA2, 0xA2, 0x92, 0x92, 0x8A, 0x8A, // row 1 - 11
0x86, 0x86, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_4F[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x38, 0x44, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, // row 1 - 11
0x44, 0x38, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_50[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0xF8, 0x84, 0x82, 0x82, 0x82, 0x84, 0xF8, 0x80, // row 1 - 11
0x80, 0x80, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_51[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x38, 0x44, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, // row 1 - 11
0x44, 0x38, 0x08, 0x06, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_52[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0xF8, 0x84, 0x82, 0x82, 0x84, 0xF8, 0x90, 0x88, // row 1 - 11
0x84, 0x82, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_53[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x38, 0x44, 0x82, 0x80, 0x60, 0x1C, 0x02, 0x82, // row 1 - 11
0x44, 0x38, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_54[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0xFE, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, // row 1 - 11
0x10, 0x10, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_55[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, // row 1 - 11
0x44, 0x38, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_56[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x82, 0x82, 0x82, 0x82, 0x44, 0x44, 0x28, 0x28, // row 1 - 11
0x10, 0x10, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_57[32] = // 2 unsigned chars per row
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, // row 1 - 6
0x88, 0x80, 0x88, 0x80, 0x49, 0x00, 0x55, 0x00, 0x55, 0x00, 0x22, 0x00, // row 7 - 12
0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // row 13 - 16
};
PROGMEM const unsigned char chr_f16_58[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x82, 0x82, 0x44, 0x28, 0x10, 0x10, 0x28, 0x44, // row 1 - 11
0x82, 0x82, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_59[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x82, 0x82, 0x82, 0x44, 0x28, 0x10, 0x10, 0x10, // row 1 - 11
0x10, 0x10, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_5A[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0xFE, 0x02, 0x04, 0x08, 0x10, 0x10, 0x20, 0x40, // row 1 - 11
0x80, 0xFE, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_5B[16] = // 1 unsigned char per row
{
0x00, 0x00, 0xE0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, // row 1 - 11
0x80, 0x80, 0xE0, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_5C[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x04, 0x04, 0x08, 0x08, 0x10, 0x10, 0x20, 0x20, 0x40, // row 1 - 11
0x40, 0x80, 0x80, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_5D[16] = // 1 unsigned char per row
{
0x00, 0x00, 0xE0, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // row 1 - 11
0x20, 0x20, 0xE0, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_5E[32] = // 1 unsigned chars per row
{
0x00, 0x10, 0x28, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // row 1 - 11
0x00, 0x00, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_5F[32] = // 1 unsigned chars per row
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // row 1 - 11
0x00, 0x00, 0x00, 0xFF, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_60[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x40, 0x40, 0x40, 0x20, 0x00, 0x00, 0x00, 0x00, // row 1 - 11
0x00, 0x00, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_61[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x08, 0x04, 0x74, 0x8C, // row 1 - 11
0x8C, 0x74, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_62[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0xB0, 0xC8, 0x84, 0x84, 0x84, // row 1 - 11
0xC8, 0xB0, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_63[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x80, 0x80, 0x80, // row 1 - 11
0x44, 0x38, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_64[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x34, 0x4C, 0x84, 0x84, 0x84, // row 1 - 11
0x4C, 0x34, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_65[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x84, 0xF8, 0x80, // row 1 - 11
0x44, 0x38, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_66[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x30, 0x48, 0x40, 0x40, 0x40, 0xE0, 0x40, 0x40, // row 1 - 11
0x40, 0x40, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_67[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x4C, 0x84, 0x84, 0x84, // row 1 - 11
0x4C, 0x34, 0x04, 0x08, 0x70 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_68[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0xB0, 0xC8, 0x84, 0x84, 0x84, // row 1 - 11
0x84, 0x84, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_69[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, // row 1 - 11
0x40, 0x40, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_6A[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x30, 0x10, 0x10, 0x10, 0x10, // row 1 - 11
0x10, 0x10, 0x10, 0x90, 0x60 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_6B[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x88, 0x90, 0xA0, 0xC0, 0xA0, // row 1 - 11
0x90, 0x88, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_6C[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0xC0, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, // row 1 - 11
0x40, 0x40, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_6D[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAC, 0xD2, 0x92, 0x92, 0x92, // row 1 - 11
0x92, 0x92, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_6E[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB0, 0xC8, 0x84, 0x84, 0x84, // row 1 - 11
0x84, 0x84, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_6F[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x82, 0x82, 0x82, // row 1 - 11
0x44, 0x38, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_70[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB0, 0xC8, 0x84, 0x84, 0x84, // row 1 - 11
0xC8, 0xB0, 0x80, 0x80, 0x80 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_71[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x4C, 0x84, 0x84, 0x84, // row 1 - 11
0x4C, 0x34, 0x04, 0x04, 0x06 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_72[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB0, 0xC8, 0x80, 0x80, 0x80, // row 1 - 11
0x80, 0x80, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_73[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x88, 0x80, 0x70, 0x08, // row 1 - 11
0x88, 0x70, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_74[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0xE0, 0x40, 0x40, 0x40, 0x40, // row 1 - 11
0x40, 0x30, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_75[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x84, 0x84, 0x84, 0x84, // row 1 - 11
0x4C, 0x34, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_76[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x82, 0x82, 0x82, 0x44, // row 1 - 11
0x28, 0x10, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_77[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x82, 0x82, 0x92, 0x92, // row 1 - 11
0xAA, 0x44, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_78[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x50, 0x20, 0x50, // row 1 - 11
0x88, 0x88, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_79[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x84, 0x84, 0x84, 0x84, // row 1 - 11
0x4C, 0x34, 0x04, 0x08, 0x70 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_7A[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x04, 0x08, 0x30, 0x40, // row 1 - 11
0x80, 0xFC, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_7B[16] = // 1 unsigned char per row
{
0x00, 0x10, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x40, 0x20, 0x20, // row 1 - 11
0x20, 0x20, 0x20, 0x20, 0x10 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_7C[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, // row 1 - 11
0x40, 0x40, 0x40, 0x40, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_7D[16] = // 1 unsigned char per row
{
0x00, 0x40, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x10, 0x20, 0x20, // row 1 - 11
0x20, 0x20, 0x20, 0x20, 0x40 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_7E[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x00, 0x32, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // row 1 - 11
0x00, 0x00, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char chr_f16_7F[16] = // 1 unsigned char per row
{
0x00, 0x00, 0x30, 0x48, 0x48, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, // row 1 - 11
0x00, 0x00, 0x00, 0x00, 0x00 // row 12 - 16
};
PROGMEM const unsigned char* const chrtbl_f16[96] = // character pointer table
{
chr_f16_20, chr_f16_21, chr_f16_22, chr_f16_23, chr_f16_24, chr_f16_25, chr_f16_26, chr_f16_27,
chr_f16_28, chr_f16_29, chr_f16_2A, chr_f16_2B, chr_f16_2C, chr_f16_2D, chr_f16_2E, chr_f16_2F,
chr_f16_30, chr_f16_31, chr_f16_32, chr_f16_33, chr_f16_34, chr_f16_35, chr_f16_36, chr_f16_37,
chr_f16_38, chr_f16_39, chr_f16_3A, chr_f16_3B, chr_f16_3C, chr_f16_3D, chr_f16_3E, chr_f16_3F,
chr_f16_40, chr_f16_41, chr_f16_42, chr_f16_43, chr_f16_44, chr_f16_45, chr_f16_46, chr_f16_47,
chr_f16_48, chr_f16_49, chr_f16_4A, chr_f16_4B, chr_f16_4C, chr_f16_4D, chr_f16_4E, chr_f16_4F,
chr_f16_50, chr_f16_51, chr_f16_52, chr_f16_53, chr_f16_54, chr_f16_55, chr_f16_56, chr_f16_57,
chr_f16_58, chr_f16_59, chr_f16_5A, chr_f16_5B, chr_f16_5C, chr_f16_5D, chr_f16_5E, chr_f16_5F,
chr_f16_60, chr_f16_61, chr_f16_62, chr_f16_63, chr_f16_64, chr_f16_65, chr_f16_66, chr_f16_67,
chr_f16_68, chr_f16_69, chr_f16_6A, chr_f16_6B, chr_f16_6C, chr_f16_6D, chr_f16_6E, chr_f16_6F,
chr_f16_70, chr_f16_71, chr_f16_72, chr_f16_73, chr_f16_74, chr_f16_75, chr_f16_76, chr_f16_77,
chr_f16_78, chr_f16_79, chr_f16_7A, chr_f16_7B, chr_f16_7C, chr_f16_7D, chr_f16_7E, chr_f16_7F
};
| [
"menan89@gmail.com"
] | menan89@gmail.com |
9c58037b2a0f7536eb29e661540c5f47d40cd2e5 | 857b6981c88910a1b4d05a47cfe5f46987894d51 | /lfwu/chapter14/str_blob/StrBlob.h | 2ed246632fc9316d660f68853b17ffd7679107b4 | [] | no_license | xiaoy/CPrimer | 6bc23216e6e2b865ec2c0a490ff675f4e0e16f4e | 457e70edfe59649bed5082878603ec06e2629284 | refs/heads/master | 2021-01-23T20:17:14.834368 | 2014-02-25T00:18:45 | 2014-02-25T00:18:45 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,019 | h | // -------------------------------------------------------------------
// Author: lfwu
// Date: January-08-2014
// Note:
// Email:zgwulongfei@gmail.com
// Blog:http://blog.csdn.net/hackmind
// -------------------------------------------------------------------
#ifndef STR_BLOB_
#define STR_BLOB_
#include <string>
#include <vector>
#include <initializer_list>
#include <memory>
class StrBlob{
public:
typedef std::vector<std::string>::size_type size_type;
friend class StrBlobPtr;
StrBlob();
StrBlob(std::initializer_list<std::string> il);
~StrBlob();
size_type Size() const { return data_->size();}
size_type RefCount() const { return data_.use_count();}
const std::string& Front();
const std::string& Back();
const std::string& Front() const;
const std::string& Back() const;
void PushBack(const std::string& str);
void Pop();
private:
std::shared_ptr<std::vector<std::string>> data_;
void Check(size_type i, const std::string& str) const;
};
#endif
| [
"zgwulongfei@gmail.com"
] | zgwulongfei@gmail.com |
e74583c09bc405ef53f412cb092b4946216df60c | fe0348f5acb816e01a1ce8e30f8a60cb1e94376f | /Source/ActionRPGGame/UI/Abilities/ARUIAbilityManagerComponent.cpp | 8c7c9de7a0113da43e1bf77d266d3d8ad0a7ebf7 | [] | no_license | gragonvlad/ActionRPGGame | f8bd366f61260aa951a84811160aea700ce71c78 | 9cf8aac653c7a3dacf5d14be06960d8758fd1aab | refs/heads/master | 2021-01-01T20:33:43.067586 | 2017-07-27T21:45:46 | 2017-07-27T21:45:46 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,842 | cpp | // Fill out your copyright notice in the Description page of Project Settings.
#include "ARUIAbilityManagerComponent.h"
#include "ARAbilityInfoWidget.h"
#include "ARWeaponInfoWidget.h"
#include "ARPlayerController.h"
#include "AFAbilityComponent.h"
#include "AssetRegistryModule.h"
#include "Engine/AssetManager.h"
#include "ARAbilityBase.h"
#include "ARAbilityUIData.h"
// Sets default values for this component's properties
UARUIAbilityManagerComponent::UARUIAbilityManagerComponent()
{
// Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features
// off to improve performance if you don't need them.
PrimaryComponentTick.bCanEverTick = true;
// ...
}
// Called when the game starts
void UARUIAbilityManagerComponent::BeginPlay()
{
//initiazile Model (hhueheu).
AbilitySet.SetNum(2);
AbilitySet[0].SetNum(6);
AbilitySet[1].SetNum(6);
AbilityTagsSet.SetNum(2);
AbilityTagsSet[0].SetNum(6);
AbilityTagsSet[1].SetNum(6);
//InputBindingsSet.SetNum(2);
//InputBindingsSet[0].SetNum(6);
//InputBindingsSet[1].SetNum(6);
ActiveSet = 0;
if (AbilitySetConfigClass)
{
AbilitySetConfigWidget = CreateWidget<UUserWidget>(Cast<APlayerController>(GetOwner()), AbilitySetConfigClass);
//AbilitySetConfigWidget->InitializeWidget(this);
AbilitySetConfigWidget->AddToViewport();
}
if (AbilityWidgetClass)
{
AbilityWidget = CreateWidget<UARAbilityInfoWidget>(Cast<APlayerController>(GetOwner()), AbilityWidgetClass);
AbilityWidget->InitializeWidget(this);
}
if (WeaponWidgetClass)
{
WeaponWidget = CreateWidget<UARWeaponInfoWidget>(Cast<APlayerController>(GetOwner()), WeaponWidgetClass);
WeaponWidget->InitializeWidget(this);
}
if (WeaponCrosshairWidgetClass)
{
WeaponCrosshairWidget = CreateWidget<UUserWidget>(Cast<APlayerController>(GetOwner()), WeaponCrosshairWidgetClass);
WeaponCrosshairWidget->AddToViewport();
}
APlayerController* MyPC = Cast<APlayerController>(GetOwner());
if (!MyPC)
return;
IAFAbilityInterface* ABInt = Cast<IAFAbilityInterface>(MyPC->GetPawn());
if (!ABInt)
return;
UAFAbilityComponent* AbilityComp = ABInt->GetAbilityComp();
if (!AbilityComp)
return;
for (const FGameplayTag& Tag : AbilityInputs)
{
AbilityComp->BP_BindAbilityToAction(Tag);
}
Super::BeginPlay();
}
// Called every frame
void UARUIAbilityManagerComponent::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
// ...
}
UARAbilityBase* UARUIAbilityManagerComponent::GetAbility(int32 SetIndex, int32 AbilityIndex)
{
if(AbilitySet[SetIndex][AbilityIndex].IsValid())
return AbilitySet[SetIndex][AbilityIndex].Get();
return nullptr;
}
void UARUIAbilityManagerComponent::SetAbility(int32 SetIndex, int32 AbilityIndex, UARAbilityBase* InAbility)
{
AbilitySet[SetIndex][AbilityIndex] = InAbility;
}
FGameplayTag UARUIAbilityManagerComponent::GetAbilityTag(int32 SetIndex, int32 AbilityIndex)
{
return AbilityTagsSet[SetIndex][AbilityIndex];
}
void UARUIAbilityManagerComponent::SetAbilityTag(int32 SetIndex, int32 AbilityIndex, FGameplayTag InAbilityTag)
{
AbilityTagsSet[SetIndex][AbilityIndex] = InAbilityTag;
}
FGameplayTag UARUIAbilityManagerComponent::GetInputTag(int32 SetIndex, int32 AbilityIndex)
{
return InputBindingsSet[SetIndex][AbilityIndex];
}
void UARUIAbilityManagerComponent::SetInputTag(int32 SetIndex, int32 AbilityIndex, FGameplayTag InAbilityTag)
{
InputBindingsSet[SetIndex][AbilityIndex] = InAbilityTag;
}
void UARUIAbilityManagerComponent::NativeEquipAbility(const FGameplayTag& InAbilityTag, int32 AbilitySet
, int32 AbilityIndex)
{
//fake implementation untill I add AssetManager support.
APlayerController* MyPC = Cast<APlayerController>(GetOwner());
if (!MyPC)
return;
IAFAbilityInterface* ABInt = Cast<IAFAbilityInterface>(MyPC->GetPawn());
if (!ABInt)
return;
UAFAbilityComponent* AbilityComp = ABInt->GetAbilityComp();
if (!AbilityComp)
return;
if (!AbilityComp->OnAbilityAdded.IsAlreadyBound(this, &UARUIAbilityManagerComponent::OnAbilityReady))
{
FGameplayTag d = GetInputTag(AbilitySet, AbilityIndex);
AbilityComp->OnAbilityAdded.AddDynamic(this, &UARUIAbilityManagerComponent::OnAbilityReady);
}
TSubclassOf<UGAAbilityBase> AbilityClass = AbilityData->Items.FindRef(InAbilityTag).AbilityClass;
FARAbilityEquipInfo ABInfo(AbilitySet, AbilityIndex, GetInputTag(AbilitySet, AbilityIndex));
AwatingAbilityConfimation.Add(InAbilityTag, ABInfo);
AbilityComp->NativeAddAbilityFromTag(InAbilityTag, nullptr, GetInputTag(AbilitySet, AbilityIndex));
}
void UARUIAbilityManagerComponent::OnAbilityReady(const FGameplayTag& InAbilityTag)
{
NativeOnAbilityReady(InAbilityTag);
}
void UARUIAbilityManagerComponent::NativeOnAbilityReady(const FGameplayTag& InAbilityTag)
{
APlayerController* MyPC = Cast<APlayerController>(GetOwner());
if (!MyPC)
return;
IAFAbilityInterface* ABInt = Cast<IAFAbilityInterface>(MyPC->GetPawn());
if (!ABInt)
return;
UAFAbilityComponent* AbilityComp = ABInt->GetAbilityComp();
if (!AbilityComp)
return;
if (AwatingAbilityConfimation.Contains(InAbilityTag))
{
FARAbilityEquipInfo Value;
AwatingAbilityConfimation.RemoveAndCopyValue(InAbilityTag, Value);
UARAbilityBase* Ability = Cast<UARAbilityBase>(AbilityComp->BP_GetAbilityByTag(InAbilityTag));
SetAbility(Value.AbilitySetIndex, Value.AbilityIndex, Ability);
SetAbilityTag(Value.AbilitySetIndex, Value.AbilityIndex, InAbilityTag);
SetInputTag(Value.AbilitySetIndex, Value.AbilityIndex, Value.InputBinding);
AbilityComp->SetAbilityToAction(InAbilityTag, Value.InputBinding);
}
}
void UARUIAbilityManagerComponent::SwitchSet()
{
//in reality it should be vlidated on server as well
//although this system is independent from ability component.
APlayerController* MyPC = Cast<APlayerController>(GetOwner());
if (!MyPC)
return;
IAFAbilityInterface* ABInt = Cast<IAFAbilityInterface>(MyPC->GetPawn());
if (!ABInt)
return;
UAFAbilityComponent* AbilityComp = ABInt->GetAbilityComp();
if (!AbilityComp)
return;
if (ActiveSet == 0)
{
const TArray<FGameplayTag>& AbilityTags = AbilityTagsSet[0];
const FARAbilityInputBinding& InputTags = InputBindingsSet[0];
const FARAbilityInputBinding InputTags2 = InputBindingsSet[1];
for (int32 Idx = 0; Idx < 6; Idx++)
{
AbilityComp->SetBlockedInput(InputTags[Idx], true);
AbilityComp->SetBlockedInput(InputTags2[Idx], false);
//AbilityComp->BP_BindAbilityToAction(InputBinding, AbilityTag);
}
ActiveSet = 1;
OnAbilitySetChanged.Broadcast(1);
}
else if (ActiveSet == 1)
{
const TArray<FGameplayTag>& AbilityTags = AbilityTagsSet[1];
const FARAbilityInputBinding& InputTags = InputBindingsSet[1];
const FARAbilityInputBinding& InputTags2 = InputBindingsSet[0];
for (int32 Idx = 0; Idx < 6; Idx++)
{
AbilityComp->SetBlockedInput(InputTags[Idx], true);
AbilityComp->SetBlockedInput(InputTags2[Idx], false);
//AbilityComp->BP_BindAbilityToAction(InputBinding, AbilityTag);
}
ActiveSet = 0;
OnAbilitySetChanged.Broadcast(0);
}
}
void UARUIAbilityManagerComponent::FinishedLoadinFiles()
{
FAssetRegistryModule& AssetRegistryModule = FModuleManager::LoadModuleChecked<FAssetRegistryModule>("AssetRegistry");
TArray<FAssetData> AssetData;
FARFilter Filter;
Filter.ClassNames.Add(TEXT("UGAAbilityBase"));// .Classes.Add(UStaticMesh::StaticClass());
Filter.TagsAndValues.Add("Ability.Corruption");
Filter.bRecursiveClasses = true;
AssetRegistryModule.Get().GetAssets(Filter, AssetData);
FARFilter Filter2;
Filter2.bRecursiveClasses = true;
Filter2.ClassNames.Add(TEXT("UGAAbilityBase"));// .Classes.Add(UStaticMesh::StaticClass());
TArray<FAssetData> AssetData2;
AssetRegistryModule.Get().GetAssets(Filter2, AssetData2);
} | [
"xeavien@gmail.com"
] | xeavien@gmail.com |
8c9c3cd33cb62c20e7048c7a62d0bea91ba90c03 | ecc942e8cd0caef5e29ca015c7cc4dadd8a41d46 | /迷宫1605.cpp | ac7e7f4704443267049fb73d29d7e7df69ed4203 | [] | no_license | 666Tim517/yaochenyang | 566057944785ddf1077db6126f1f5308fb7367ea | 82424d24156b45821f0af627f5deb2bcea473297 | refs/heads/main | 2023-01-24T03:14:20.616389 | 2020-11-15T03:22:07 | 2020-11-15T03:22:07 | 311,522,879 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 683 | cpp | #include<iostream>
using namespace std;
#define N 1000
int map[N][N]={0},v[N][N]={0};
int n,m,t,sx,sy,fx,fy,ans=0;
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};
void dfs(int x,int y)
{
int tx,ty;
if(x==fx&&y==fy)
{
ans++;
return;
}
else
{
for(int i=0;i<4;i++)
{
tx=x+dx[i];
ty=y+dy[i];
if(tx<1||ty<1||tx>n||ty>m)
continue;
else if(map[tx][ty]==0&&v[tx][ty]==0)
{
v[tx][ty]=1;
dfs(tx,ty);
v[tx][ty]=0;
}
}
}
return;
}
int main()
{
int a,b;
cin>>n>>m>>t;
cin>>sx>>sy>>fx>>fy;
while(t--)
{
cin>>a>>b;
map[a][b]=2;
}
map[fx][fy]=1;
dfs(fx,fy);
cout<<ans<<endl;
return 0;
}
| [
"noreply@github.com"
] | 666Tim517.noreply@github.com |
4e6c7924378a1d366362badf9e46f2795993581d | 8929c305fc101641cbb615f5f4108a36d9aae9bb | /inorder.cpp | 70d9c2e8386d66d19fbb8be60ae26836c8e03633 | [] | no_license | rresol/Practice | 629403d32bc0e2d80ad3769527ca6ab8338593c0 | 13b9bb892af6a051b23db5023a906078849365be | refs/heads/master | 2021-01-12T18:06:27.145251 | 2017-10-04T10:06:11 | 2017-10-04T10:06:11 | 71,325,176 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 578 | cpp | void MorrisTraversal(root)
{
if(root==NULL)
return;
current = root;
while(current!=NULL)
{
if(current->left==NULL)
{
current = current->right;
}
else
{
pre = current->left;
while(pre->right!=NULL || pre->right!=current)
{
pre = pre->right;
}
if(pre->right==NULL)
{
pre->right = current;
current = current->left;
}
if(pre->right==current)
{
pre->right = NULL;
cout<<current->data;
current = current->right;
}
}
}
}
| [
"shashank.kumar.apc13@itbhu.ac.in"
] | shashank.kumar.apc13@itbhu.ac.in |
ded0ac9a869fbfe0eb778a5effe35abbf8e9a987 | e3b893f45bfc94cd747632ce6d44243b26b01f48 | /src/gallium/drivers/radeon/AMDGPUInstrInfo.cpp | 2af036740ae6efec79b9af1606e2cced65140a0e | [
"NCSA"
] | permissive | altf4/mesa | 7a2cb55dacd96c6cf77b1ac82d220a56b730b426 | 6cb9e99a757bd5a9d908ed6c5515a9ae5fb041ba | refs/heads/master | 2020-07-02T00:50:59.749554 | 2012-08-09T20:55:07 | 2012-08-09T22:21:02 | 5,363,303 | 6 | 4 | null | null | null | null | UTF-8 | C++ | false | false | 12,481 | cpp | //===-- AMDGPUInstrInfo.cpp - Base class for AMD GPU InstrInfo ------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file contains the implementation of the TargetInstrInfo class that is
// common to all AMD GPUs.
//
//===----------------------------------------------------------------------===//
#include "AMDGPUInstrInfo.h"
#include "AMDGPURegisterInfo.h"
#include "AMDGPUTargetMachine.h"
#include "AMDIL.h"
#include "AMDILUtilityFunctions.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#define GET_INSTRINFO_CTOR
#include "AMDGPUGenInstrInfo.inc"
using namespace llvm;
AMDGPUInstrInfo::AMDGPUInstrInfo(TargetMachine &tm)
: AMDGPUGenInstrInfo(), RI(tm, *this), TM(tm) { }
const AMDGPURegisterInfo &AMDGPUInstrInfo::getRegisterInfo() const {
return RI;
}
bool AMDGPUInstrInfo::isCoalescableExtInstr(const MachineInstr &MI,
unsigned &SrcReg, unsigned &DstReg,
unsigned &SubIdx) const {
// TODO: Implement this function
return false;
}
unsigned AMDGPUInstrInfo::isLoadFromStackSlot(const MachineInstr *MI,
int &FrameIndex) const {
// TODO: Implement this function
return 0;
}
unsigned AMDGPUInstrInfo::isLoadFromStackSlotPostFE(const MachineInstr *MI,
int &FrameIndex) const {
// TODO: Implement this function
return 0;
}
bool AMDGPUInstrInfo::hasLoadFromStackSlot(const MachineInstr *MI,
const MachineMemOperand *&MMO,
int &FrameIndex) const {
// TODO: Implement this function
return false;
}
unsigned AMDGPUInstrInfo::isStoreFromStackSlot(const MachineInstr *MI,
int &FrameIndex) const {
// TODO: Implement this function
return 0;
}
unsigned AMDGPUInstrInfo::isStoreFromStackSlotPostFE(const MachineInstr *MI,
int &FrameIndex) const {
// TODO: Implement this function
return 0;
}
bool AMDGPUInstrInfo::hasStoreFromStackSlot(const MachineInstr *MI,
const MachineMemOperand *&MMO,
int &FrameIndex) const {
// TODO: Implement this function
return false;
}
MachineInstr *
AMDGPUInstrInfo::convertToThreeAddress(MachineFunction::iterator &MFI,
MachineBasicBlock::iterator &MBBI,
LiveVariables *LV) const {
// TODO: Implement this function
return NULL;
}
bool AMDGPUInstrInfo::getNextBranchInstr(MachineBasicBlock::iterator &iter,
MachineBasicBlock &MBB) const {
while (iter != MBB.end()) {
switch (iter->getOpcode()) {
default:
break;
ExpandCaseToAllScalarTypes(AMDGPU::BRANCH_COND);
case AMDGPU::BRANCH:
return true;
};
++iter;
}
return false;
}
bool AMDGPUInstrInfo::AnalyzeBranch(MachineBasicBlock &MBB,
MachineBasicBlock *&TBB,
MachineBasicBlock *&FBB,
SmallVectorImpl<MachineOperand> &Cond,
bool AllowModify) const {
bool retVal = true;
return retVal;
MachineBasicBlock::iterator iter = MBB.begin();
if (!getNextBranchInstr(iter, MBB)) {
retVal = false;
} else {
MachineInstr *firstBranch = iter;
if (!getNextBranchInstr(++iter, MBB)) {
if (firstBranch->getOpcode() == AMDGPU::BRANCH) {
TBB = firstBranch->getOperand(0).getMBB();
firstBranch->eraseFromParent();
retVal = false;
} else {
TBB = firstBranch->getOperand(0).getMBB();
FBB = *(++MBB.succ_begin());
if (FBB == TBB) {
FBB = *(MBB.succ_begin());
}
Cond.push_back(firstBranch->getOperand(1));
retVal = false;
}
} else {
MachineInstr *secondBranch = iter;
if (!getNextBranchInstr(++iter, MBB)) {
if (secondBranch->getOpcode() == AMDGPU::BRANCH) {
TBB = firstBranch->getOperand(0).getMBB();
Cond.push_back(firstBranch->getOperand(1));
FBB = secondBranch->getOperand(0).getMBB();
secondBranch->eraseFromParent();
retVal = false;
} else {
assert(0 && "Should not have two consecutive conditional branches");
}
} else {
MBB.getParent()->viewCFG();
assert(0 && "Should not have three branch instructions in"
" a single basic block");
retVal = false;
}
}
}
return retVal;
}
unsigned int AMDGPUInstrInfo::getBranchInstr(const MachineOperand &op) const {
const MachineInstr *MI = op.getParent();
switch (MI->getDesc().OpInfo->RegClass) {
default: // FIXME: fallthrough??
case AMDGPU::GPRI32RegClassID: return AMDGPU::BRANCH_COND_i32;
case AMDGPU::GPRF32RegClassID: return AMDGPU::BRANCH_COND_f32;
};
}
unsigned int
AMDGPUInstrInfo::InsertBranch(MachineBasicBlock &MBB,
MachineBasicBlock *TBB,
MachineBasicBlock *FBB,
const SmallVectorImpl<MachineOperand> &Cond,
DebugLoc DL) const
{
assert(TBB && "InsertBranch must not be told to insert a fallthrough");
for (unsigned int x = 0; x < Cond.size(); ++x) {
Cond[x].getParent()->dump();
}
if (FBB == 0) {
if (Cond.empty()) {
BuildMI(&MBB, DL, get(AMDGPU::BRANCH)).addMBB(TBB);
} else {
BuildMI(&MBB, DL, get(getBranchInstr(Cond[0])))
.addMBB(TBB).addReg(Cond[0].getReg());
}
return 1;
} else {
BuildMI(&MBB, DL, get(getBranchInstr(Cond[0])))
.addMBB(TBB).addReg(Cond[0].getReg());
BuildMI(&MBB, DL, get(AMDGPU::BRANCH)).addMBB(FBB);
}
assert(0 && "Inserting two branches not supported");
return 0;
}
unsigned int AMDGPUInstrInfo::RemoveBranch(MachineBasicBlock &MBB) const {
MachineBasicBlock::iterator I = MBB.end();
if (I == MBB.begin()) {
return 0;
}
--I;
switch (I->getOpcode()) {
default:
return 0;
ExpandCaseToAllScalarTypes(AMDGPU::BRANCH_COND);
case AMDGPU::BRANCH:
I->eraseFromParent();
break;
}
I = MBB.end();
if (I == MBB.begin()) {
return 1;
}
--I;
switch (I->getOpcode()) {
// FIXME: only one case??
default:
return 1;
ExpandCaseToAllScalarTypes(AMDGPU::BRANCH_COND);
I->eraseFromParent();
break;
}
return 2;
}
MachineBasicBlock::iterator skipFlowControl(MachineBasicBlock *MBB) {
MachineBasicBlock::iterator tmp = MBB->end();
if (!MBB->size()) {
return MBB->end();
}
while (--tmp) {
if (tmp->getOpcode() == AMDGPU::ENDLOOP
|| tmp->getOpcode() == AMDGPU::ENDIF
|| tmp->getOpcode() == AMDGPU::ELSE) {
if (tmp == MBB->begin()) {
return tmp;
} else {
continue;
}
} else {
return ++tmp;
}
}
return MBB->end();
}
void
AMDGPUInstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
MachineBasicBlock::iterator MI,
unsigned SrcReg, bool isKill,
int FrameIndex,
const TargetRegisterClass *RC,
const TargetRegisterInfo *TRI) const {
assert(!"Not Implemented");
}
void
AMDGPUInstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
MachineBasicBlock::iterator MI,
unsigned DestReg, int FrameIndex,
const TargetRegisterClass *RC,
const TargetRegisterInfo *TRI) const {
assert(!"Not Implemented");
}
MachineInstr *
AMDGPUInstrInfo::foldMemoryOperandImpl(MachineFunction &MF,
MachineInstr *MI,
const SmallVectorImpl<unsigned> &Ops,
int FrameIndex) const {
// TODO: Implement this function
return 0;
}
MachineInstr*
AMDGPUInstrInfo::foldMemoryOperandImpl(MachineFunction &MF,
MachineInstr *MI,
const SmallVectorImpl<unsigned> &Ops,
MachineInstr *LoadMI) const {
// TODO: Implement this function
return 0;
}
bool
AMDGPUInstrInfo::canFoldMemoryOperand(const MachineInstr *MI,
const SmallVectorImpl<unsigned> &Ops) const
{
// TODO: Implement this function
return false;
}
bool
AMDGPUInstrInfo::unfoldMemoryOperand(MachineFunction &MF, MachineInstr *MI,
unsigned Reg, bool UnfoldLoad,
bool UnfoldStore,
SmallVectorImpl<MachineInstr*> &NewMIs) const {
// TODO: Implement this function
return false;
}
bool
AMDGPUInstrInfo::unfoldMemoryOperand(SelectionDAG &DAG, SDNode *N,
SmallVectorImpl<SDNode*> &NewNodes) const {
// TODO: Implement this function
return false;
}
unsigned
AMDGPUInstrInfo::getOpcodeAfterMemoryUnfold(unsigned Opc,
bool UnfoldLoad, bool UnfoldStore,
unsigned *LoadRegIndex) const {
// TODO: Implement this function
return 0;
}
bool AMDGPUInstrInfo::shouldScheduleLoadsNear(SDNode *Load1, SDNode *Load2,
int64_t Offset1, int64_t Offset2,
unsigned NumLoads) const {
assert(Offset2 > Offset1
&& "Second offset should be larger than first offset!");
// If we have less than 16 loads in a row, and the offsets are within 16,
// then schedule together.
// TODO: Make the loads schedule near if it fits in a cacheline
return (NumLoads < 16 && (Offset2 - Offset1) < 16);
}
bool
AMDGPUInstrInfo::ReverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond)
const {
// TODO: Implement this function
return true;
}
void AMDGPUInstrInfo::insertNoop(MachineBasicBlock &MBB,
MachineBasicBlock::iterator MI) const {
// TODO: Implement this function
}
bool AMDGPUInstrInfo::isPredicated(const MachineInstr *MI) const {
// TODO: Implement this function
return false;
}
bool
AMDGPUInstrInfo::SubsumesPredicate(const SmallVectorImpl<MachineOperand> &Pred1,
const SmallVectorImpl<MachineOperand> &Pred2)
const {
// TODO: Implement this function
return false;
}
bool AMDGPUInstrInfo::DefinesPredicate(MachineInstr *MI,
std::vector<MachineOperand> &Pred) const {
// TODO: Implement this function
return false;
}
bool AMDGPUInstrInfo::isPredicable(MachineInstr *MI) const {
// TODO: Implement this function
return MI->getDesc().isPredicable();
}
bool
AMDGPUInstrInfo::isSafeToMoveRegClassDefs(const TargetRegisterClass *RC) const {
// TODO: Implement this function
return true;
}
MachineInstr * AMDGPUInstrInfo::convertToISA(MachineInstr & MI, MachineFunction &MF,
DebugLoc DL) const
{
MachineInstrBuilder newInstr;
MachineRegisterInfo &MRI = MF.getRegInfo();
const AMDGPURegisterInfo & RI = getRegisterInfo();
// Create the new instruction
newInstr = BuildMI(MF, DL, TM.getInstrInfo()->get(MI.getOpcode()));
for (unsigned i = 0; i < MI.getNumOperands(); i++) {
MachineOperand &MO = MI.getOperand(i);
// Convert dst regclass to one that is supported by the ISA
if (MO.isReg() && MO.isDef()) {
if (TargetRegisterInfo::isVirtualRegister(MO.getReg())) {
const TargetRegisterClass * oldRegClass = MRI.getRegClass(MO.getReg());
const TargetRegisterClass * newRegClass = RI.getISARegClass(oldRegClass);
assert(newRegClass);
MRI.setRegClass(MO.getReg(), newRegClass);
}
}
// Add the operand to the new instruction
newInstr.addOperand(MO);
}
return newInstr;
}
| [
"thomas.stellard@amd.com"
] | thomas.stellard@amd.com |
77bdbee46b0b906e5ecbe438fee99efb62ea5627 | 379245deec58e0accd2cd943386955601d55fad3 | /src/base/sorted_block.cpp | 3a1f97a41db424bef0e6a15cda939dbd55e6d3b5 | [] | no_license | karpachev/DummyDB | 0a393e38a1ab030803996558e098b4b075813b48 | c0d6480e55c88009a594db0fc664d49288f7730a | refs/heads/master | 2021-06-21T20:44:47.731941 | 2017-01-18T13:47:30 | 2017-01-18T13:47:30 | 33,487,812 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,210 | cpp | #include "sorted_block.h"
#include <stdio.h>
namespace DummyDB
{
SortedBlock::SortedBlock()
{
block_size = 0;
}
SortedBlock::~SortedBlock()
{
//dtor
}
Result<Value>
SortedBlock::set(const Key& key, const Value& value)
{
std::vector< std::pair<Key,Value> >::iterator it;
for(it=block.begin(); it!=block.end(); it++) {
if ( key == it->first ) {
// the key already exists - overwrite it!
Result<Value> result(it->second);
block_size-= it->second.bufferSize(); // substract old value length
it->second = value;
block_size+= it->second.bufferSize(); // add new value length
result.status = true;
return result;
}
if ( key < it->first ) {
break;
}
}
block_size+= key.bufferSize(); // add new key length
block_size+= value.bufferSize(); // add new value length
block.insert(it, std::pair<Key,Value>(key,value));
Result<Value> result(value);
result.status= true;
return result;
}
static bool equal_keys(const Key& a, const Key& b) {
return a == b;
}
static bool prefix_equal_keys(const Key& a, const Key& b) {
return a |= b;
}
Result<Value>
SortedBlock::remove(const Key& key)
{
Result< std::vector<int> > index = indexOf(key,equal_keys);
if (index.status==false) {
// not found - emptyr result
return Result<Value>();
}
const int& index_found= index.value[0];
block_size-= block[index_found].first.bufferSize(); // substract removed key length
block_size-= block[index_found].second.bufferSize(); // substrackt removed value length
Result<Value> result(block[index_found].second);
block.erase( block.begin()+index_found );
return result;
}
Result<Value>
SortedBlock::get(const Key& key) const
{
Result< std::vector<int> > index = indexOf(key,equal_keys);
if (index.status==false) {
// not found - emptyr result
return Result<Value>();
}
// index.value[0] is the index of the found entry
const int& index_found= index.value[0];
return Result<Value>(block[index_found].second);
}
/**
* Perform a binary sarch to find a matching entry
* in the sorted map_table.
* @return Result.status==false - not found
* Result.value[0] - the index of the found entry
* Result.value[1] - the max index of the last step
* Result.value[2] - the min index of the last step
*/
Result< std::vector<int> >
SortedBlock::indexOf(const Key& key, bool (*compare)(const Key& a, const Key& b) ) const
{
Result< std::vector<int> > result;
int min_index =0,
max_index = block.size()-1;
if (max_index==0) {
return result; // Not found: table still empty
}
while(min_index<=max_index) {
int middle_index = (min_index+max_index)/2;
if ( compare(key, block[middle_index].first) ) {
// Found
result.status = true;
result.value.push_back(middle_index);
result.value.push_back(max_index);
result.value.push_back(min_index);
return result;
}
if ( key < block[middle_index].first ) {
max_index= middle_index-1;
} else {
min_index= middle_index+1;
}
}
// Binary search not successful
return result;
}
Result<SortedBlock>
SortedBlock::prefixSearch(const Key& key) const
{
Result<SortedBlock> result;
Result< std::vector<int> > index = indexOf(key, prefix_equal_keys);
if (index.status==false) {
// not found - empty result
return result;
}
// index.value[0] is the index of a matching key
// index.value[1] is the index of a bigger key
// index.value[2] is the index of a lesser key
const int& index_found = index.value[0];
const int& index_max = index.value[1];
const int& index_min = index.value[2];
const int& low_bound = indexOfSplit(key, index_min, index_found, true);
const int& high_bound = indexOfSplit(key, index_found, index_max, false);
result.status=true;
result.value.block = std::vector< std::pair<Key,Value> >(
block.begin()+low_bound,
block.begin()+high_bound+1
);
return result;
}
int
SortedBlock::indexOfSplit(const Key& key, int index_min, int index_max, bool lower_range) const
{
do
{
bool min_found = key |= block[index_min].first;
bool max_found = key |= block[index_max].first;
if (min_found&&max_found) {
// the whole range is of identical keys.
if (lower_range) {
// In the low range the split must be the first key
return index_min;
} else {
// In the higher range the split must be the first key
return index_max;
}
}
if (index_min+1>=index_max) {
return min_found?index_min:index_max;
}
int index_middle = (index_min+index_max)/2;
bool middle_found = key |= block[index_middle].first;
if (min_found) {
if(middle_found) {
// split must in in the [index_middle,index_max]
index_min = index_middle;
} else {
// split must in in the [index_min,index_middle)
index_max = index_middle;
}
}
if (max_found) {
if(middle_found) {
// split must in in the [index_min,index_middle)
index_max = index_middle;
} else {
// split must in in the [index_middle,index_max]
index_min = index_middle;
}
}
} while (index_min<=index_max);
return 1;
}
void
SortedBlock::toStdout() {
std::vector< std::pair<Key,Value> >::iterator it;
int i=0;
for (it=block.begin();it<block.end();it++) {
printf( "%4d: [%3d=>%3d]'%s'=>'%s'\r\n",
i++,
it->first.toString().size(), it->second.toString().size(),
it->first.toString().c_str(),it->second.toString().c_str()
);
}
}
} // namespace DummyDB
| [
"v.karpachev@gmail.com"
] | v.karpachev@gmail.com |
97ab433111963c83e90c98e6542e07f110e00779 | 2147d0d957b3189d0a87fd31d84812556bb379f5 | /include/qlib/QPride.hpp | 9fb1f9fbcac965c1830d8c390fcc4176cf3b3369 | [] | no_license | kkaragiannis/DVG-profiler | 74d894f44c4f6e752e943ff2b0f4e2aaa473300c | a35e65ef255ab3dc90da1e1087d5c4a7a9b41e0a | refs/heads/master | 2020-04-11T08:53:07.643424 | 2018-12-14T01:26:04 | 2018-12-14T01:26:04 | 161,658,993 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,897 | hpp | /*
* ::718604!
*
* Copyright(C) November 20, 2014 U.S. Food and Drug Administration
* Authors: Dr. Vahan Simonyan (1), Dr. Raja Mazumder (2), et al
* Affiliation: Food and Drug Administration (1), George Washington University (2)
*
* All rights Reserved.
*
* The MIT License (MIT)
*
* 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.
*/
#ifndef _QPride_qLib_hpp
#define _QPride_qLib_hpp
#include <qlib/QPrideBase.hpp>
namespace slib
{
class sQPrideConnection;
class sSql;
class sQPride:public sQPrideBase
{
sQPrideConnection * conn;
public:
sQPride(const char * defline=0, const char * service="qm");
virtual ~sQPride();
bool usesQPSvcTable() const; //!< Are services defined in QPSvc table (and not as objects)?
sSql * sql(void);
};
}
#endif // _QPride_qLib_hpp
| [
"anton.golikow@gmail.com"
] | anton.golikow@gmail.com |
148feca3a2f91d61642bef445767e6544836862b | 948f4e13af6b3014582909cc6d762606f2a43365 | /testcases/juliet_test_suite/testcases/CWE23_Relative_Path_Traversal/s01/CWE23_Relative_Path_Traversal__char_environment_ifstream_67a.cpp | 3a5f6763ee62a9f1812a9773268cce29af299e38 | [] | no_license | junxzm1990/ASAN-- | 0056a341b8537142e10373c8417f27d7825ad89b | ca96e46422407a55bed4aa551a6ad28ec1eeef4e | refs/heads/master | 2022-08-02T15:38:56.286555 | 2022-06-16T22:19:54 | 2022-06-16T22:19:54 | 408,238,453 | 74 | 13 | null | 2022-06-16T22:19:55 | 2021-09-19T21:14:59 | null | UTF-8 | C++ | false | false | 3,074 | cpp | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE23_Relative_Path_Traversal__char_environment_ifstream_67a.cpp
Label Definition File: CWE23_Relative_Path_Traversal.label.xml
Template File: sources-sink-67a.tmpl.cpp
*/
/*
* @description
* CWE: 23 Relative Path Traversal
* BadSource: environment Read input from an environment variable
* GoodSource: Use a fixed file name
* Sinks: ifstream
* BadSink : Open the file named in data using ifstream::open()
* Flow Variant: 67 Data flow: data passed in a struct from one function to another in different source files
*
* */
#include "std_testcase.h"
#ifdef _WIN32
#define BASEPATH "c:\\temp\\"
#else
#include <wchar.h>
#define BASEPATH "/tmp/"
#endif
#define ENV_VARIABLE "ADD"
#ifdef _WIN32
#define GETENV getenv
#else
#define GETENV getenv
#endif
#include <fstream>
using namespace std;
namespace CWE23_Relative_Path_Traversal__char_environment_ifstream_67
{
typedef struct _structType
{
char * structFirst;
} structType;
#ifndef OMITBAD
/* bad function declaration */
void badSink(structType myStruct);
void bad()
{
char * data;
structType myStruct;
char dataBuffer[FILENAME_MAX] = BASEPATH;
data = dataBuffer;
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, FILENAME_MAX-dataLen-1);
}
}
myStruct.structFirst = data;
badSink(myStruct);
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodG2B uses the GoodSource with the BadSink */
void goodG2BSink(structType myStruct);
static void goodG2B()
{
char * data;
structType myStruct;
char dataBuffer[FILENAME_MAX] = BASEPATH;
data = dataBuffer;
/* FIX: Use a fixed file name */
strcat(data, "file.txt");
myStruct.structFirst = data;
goodG2BSink(myStruct);
}
void good()
{
goodG2B();
}
#endif /* OMITGOOD */
} /* close namespace */
/* Below is the main(). It is only used when building this testcase on
its own for testing or for building a binary to use in testing binary
analysis tools. It is not used when compiling all the testcases as one
application, which is how source code analysis tools are tested. */
#ifdef INCLUDEMAIN
using namespace CWE23_Relative_Path_Traversal__char_environment_ifstream_67; /* so that we can use good and bad easily */
int main(int argc, char * argv[])
{
/* seed randomness */
srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
printLine("Calling good()...");
good();
printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
printLine("Calling bad()...");
bad();
printLine("Finished bad()");
#endif /* OMITBAD */
return 0;
}
#endif
| [
"yzhang0701@gmail.com"
] | yzhang0701@gmail.com |
550a76c036dcd11c7f14119eb7203bb28cab5b83 | 490e31feed48a2e2a2ce41fbb235c68265f22d90 | /c++/32/32-3.cpp | 1844a6ad7a88ba6392b1bbbb4a3ea2533b83f5e4 | [] | no_license | jianweiyao/Code | eef804f0f6fb30676f63b2af7067619c79e2c3e9 | ed578982eab492179d561acc7a8e747a580e581f | refs/heads/master | 2020-03-18T21:11:46.710924 | 2018-06-14T04:05:11 | 2018-06-14T04:05:11 | 135,265,609 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 414 | cpp | // C++中的输入输出
#include <iostream>
#include <cmath>
using namespace std;
int main(int argc, const char *argv[]) {
cout << "Hello world!" << endl;
double a = 0;
double b = 0;
cout << "Input a: ";
cin >> a;
cout << "Input b: ";
cin >> b;
double c = sqrt(a * a + b * b);
cout << "c = " << c << endl;
return 0;
}
| [
"319807036@qq.com"
] | 319807036@qq.com |
1283cb683c996e2948156687d8ad21be63b894e7 | 9e5371d85db2a3406a414f472b20a9e3ec837909 | /SideScroller/Source/SideScroller/MyCharacter.h | 77697d952c904db2193ac0ae772033a6bfba5a0a | [] | no_license | adaless5/2DSouls | 31b1e81994cd18e9b2f580a470d71f4fc167aac1 | 24cafe20687d14a1274763cf86f2a0cdab9fae4d | refs/heads/master | 2022-12-14T08:56:43.796634 | 2020-09-02T15:33:28 | 2020-09-02T15:33:28 | 258,704,544 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 867 | h | // Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Character.h"
#include "MyCharacter.generated.h"
UCLASS()
class SIDESCROLLER_API AMyCharacter : public ACharacter
{
GENERATED_BODY()
public:
// Sets default values for this character's properties
AMyCharacter();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
// Called to bind functionality to input
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
protected:
/*UPROPERTY(EditAnywhere, Category = "Player")
class USpringArmComponent* SpringArm;
UPROPERTY(EditAnywhere, Category = "Player")
class UCameraComponent* PlayerCamera; */
};
| [
"dale0135@algonquinlive.com"
] | dale0135@algonquinlive.com |
318716264cbc2491993d1f2f18e301dbbf068368 | 57f24846a3fa3670c8519af87e658eca120f6d23 | /B2_CoarseMesh/2/p | 1147a5ac28e2210f31d9b71f6654bb85278b8c4a | [] | no_license | bshambaugh/openfoam-experiments | 82adb4b7d7eb0ec454d6f98eba274b279a6597d8 | a1dd4012cb9791836da2f9298247ceba8701211c | refs/heads/master | 2021-07-14T05:53:07.275777 | 2019-02-15T19:37:28 | 2019-02-15T19:37:28 | 153,547,385 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 262,103 | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 4.1 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "2";
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField nonuniform List<scalar>
26785
(
0.182313
0.174631
0.167046
0.159905
0.153299
0.147265
0.141686
0.136494
0.131561
0.126842
0.122275
0.117851
0.113559
0.109401
0.10538
0.101481
0.0977232
0.0941001
0.0906289
0.0873145
0.0841669
0.0812035
0.0784336
0.07587
0.0735136
0.0713612
0.0693999
0.067616
0.0659973
0.064528
0.0631988
0.0619978
0.0609035
0.0598947
0.0589471
0.0580364
0.057153
0.0562919
0.0554498
0.0546226
0.0537982
0.0529602
0.052091
0.0511852
0.0502408
0.0492644
0.0482615
0.0472343
0.0461823
0.045104
0.0440038
0.0428907
0.041778
0.0406756
0.039589
0.038522
0.037477
0.0364515
0.0354408
0.0344445
0.0334647
0.0325101
0.0315925
0.0307174
0.0298881
0.0291049
0.0283643
0.0276645
0.0270057
0.0263868
0.0258049
0.0252542
0.0247228
0.0241935
0.0236551
0.0231016
0.0225216
0.0219073
0.021254
0.0205594
0.0198229
0.0190455
0.0182292
0.0173758
0.0164869
0.0155641
0.0146092
0.013624
0.0126107
0.0115717
0.0105099
0.00942921
0.0083354
0.00723709
0.00614209
0.00505603
0.00396453
0.00286056
0.00173721
0.000588527
0.182316
0.174631
0.167044
0.159903
0.153298
0.147266
0.141689
0.136498
0.131567
0.126849
0.122283
0.11786
0.113569
0.10941
0.10539
0.101491
0.0977327
0.0941096
0.090638
0.0873233
0.0841751
0.0812113
0.0784412
0.0758776
0.0735214
0.0713691
0.0694082
0.0676246
0.0660062
0.0645376
0.0632091
0.0620089
0.0609155
0.0599075
0.0589606
0.0580505
0.0571675
0.0563065
0.0554644
0.0546372
0.0538124
0.0529745
0.052106
0.0512013
0.0502583
0.0492827
0.0482798
0.047252
0.0461993
0.0451206
0.0440209
0.0429085
0.0417961
0.0406933
0.039606
0.0385381
0.0374918
0.0364654
0.0354537
0.0344566
0.0334765
0.0325212
0.0316028
0.0307268
0.0298961
0.0291117
0.0283703
0.0276698
0.0270105
0.026391
0.0258085
0.0252569
0.0247247
0.0241947
0.0236552
0.0231009
0.0225204
0.0219058
0.0212523
0.0205576
0.0198211
0.019044
0.018228
0.0173748
0.0164861
0.0155635
0.0146086
0.0136236
0.0126103
0.0115712
0.0105094
0.00942857
0.00833469
0.00723654
0.0061419
0.00505599
0.00396452
0.00286067
0.00173714
0.000588344
0.18232
0.17463
0.167039
0.159898
0.153295
0.147266
0.141693
0.136507
0.131579
0.126863
0.1223
0.117878
0.113587
0.10943
0.105409
0.10151
0.0977519
0.0941284
0.0906563
0.0873408
0.0841918
0.0812274
0.0784567
0.075893
0.073537
0.071385
0.0694246
0.0676418
0.0660242
0.0645569
0.0632299
0.062031
0.0609394
0.0599329
0.0589873
0.0580785
0.0571965
0.0563359
0.0554938
0.0546661
0.0538406
0.0530029
0.0521359
0.0512338
0.0502934
0.0493194
0.0483164
0.0472873
0.0462334
0.0451545
0.0440555
0.0429443
0.0418323
0.0407287
0.0396401
0.0385703
0.0375217
0.036493
0.0354793
0.0344808
0.0335
0.0325438
0.0316235
0.0307452
0.0299121
0.0291253
0.0283822
0.0276806
0.0270203
0.0263999
0.0258161
0.0252628
0.0247286
0.0241971
0.0236553
0.0230994
0.0225179
0.0219027
0.021249
0.0205543
0.0198182
0.0190416
0.018226
0.0173733
0.016485
0.0155626
0.0146077
0.0136224
0.012609
0.0115697
0.0105076
0.00942697
0.00833339
0.00723549
0.00614144
0.00505605
0.00396458
0.00286054
0.00173685
0.000588015
0.182326
0.174629
0.167033
0.15989
0.15329
0.147267
0.1417
0.136519
0.131596
0.126885
0.122324
0.117905
0.113616
0.109459
0.105438
0.10154
0.0977806
0.0941566
0.0906836
0.0873671
0.0842168
0.0812516
0.0784802
0.0759162
0.0735606
0.0714088
0.0694492
0.0676677
0.0660513
0.064586
0.0632612
0.0620643
0.0609749
0.0599709
0.0590272
0.0581206
0.0572403
0.0563802
0.0555379
0.0547096
0.0538828
0.0530452
0.0521809
0.0512826
0.0503461
0.0493742
0.0483709
0.0473399
0.0462844
0.0452054
0.0441077
0.0429981
0.0418865
0.0407819
0.0396913
0.0386188
0.0375664
0.0365341
0.0355178
0.0345174
0.0335354
0.0325777
0.0316545
0.0307727
0.0299359
0.0291458
0.0284002
0.0276971
0.0270355
0.0264136
0.0258278
0.0252718
0.0247346
0.0242007
0.0236556
0.0230973
0.0225142
0.021898
0.021244
0.0205494
0.0198138
0.0190378
0.0182231
0.0173711
0.0164832
0.015561
0.0146061
0.0136206
0.0126067
0.0115671
0.0105049
0.00942436
0.00833151
0.00723431
0.00614107
0.00505597
0.00396476
0.00286053
0.00173649
0.000587626
0.182334
0.174627
0.167024
0.15988
0.153284
0.147267
0.141708
0.136536
0.13162
0.126914
0.122357
0.117941
0.113653
0.109498
0.105477
0.101579
0.0978189
0.0941942
0.0907199
0.087402
0.0842501
0.0812839
0.0785116
0.0759472
0.0735921
0.0714405
0.0694819
0.0677021
0.0660874
0.0646246
0.063303
0.0621086
0.0610222
0.0600214
0.0590804
0.0581766
0.0572989
0.0564397
0.055597
0.0547676
0.0539392
0.0531017
0.0522409
0.0513477
0.0504162
0.0494469
0.048443
0.0474097
0.0463523
0.0452734
0.0441775
0.0430698
0.0419589
0.0408528
0.0397595
0.0386833
0.037626
0.0365887
0.0355689
0.0345663
0.0335826
0.0326226
0.0316958
0.0308093
0.0299676
0.0291733
0.0284246
0.0277194
0.0270562
0.0264323
0.0258438
0.0252843
0.0247432
0.0242057
0.0236564
0.0230947
0.0225093
0.0218918
0.0212371
0.0205426
0.0198076
0.0190326
0.0182188
0.0173677
0.0164805
0.0155586
0.0146037
0.0136178
0.0126034
0.0115633
0.0105011
0.00942108
0.00832907
0.00723278
0.00614085
0.00505627
0.00396488
0.00286048
0.00173621
0.000587289
0.182344
0.174625
0.167013
0.159868
0.153276
0.147268
0.14172
0.136557
0.131649
0.12695
0.122399
0.117986
0.113701
0.109547
0.105526
0.101628
0.0978669
0.0942411
0.0907652
0.0874456
0.0842918
0.0813245
0.0785511
0.0759861
0.0736316
0.0714803
0.0695227
0.0677451
0.0661327
0.0646729
0.0633551
0.0621639
0.061081
0.0600844
0.059147
0.0582468
0.0573723
0.0565143
0.0556711
0.0548402
0.05401
0.0531726
0.0523159
0.051429
0.0505033
0.049537
0.0485325
0.0474965
0.0464371
0.0453585
0.0442649
0.0431596
0.0420495
0.0409416
0.0398447
0.0387638
0.0377004
0.0366569
0.0356326
0.0346272
0.0336413
0.0326786
0.0317473
0.0308549
0.0300073
0.029208
0.0284556
0.0277479
0.0270826
0.0264562
0.0258645
0.0253007
0.0247546
0.0242125
0.023658
0.0230919
0.0225034
0.0218838
0.0212282
0.0205338
0.0197995
0.0190255
0.0182128
0.0173629
0.0164765
0.015555
0.0146001
0.0136138
0.0125989
0.0115584
0.0104962
0.00941696
0.00832635
0.00723138
0.00614061
0.00505659
0.00396525
0.00286058
0.00173602
0.000587038
0.182357
0.174622
0.167
0.159853
0.153267
0.14727
0.141733
0.136582
0.131685
0.126994
0.122448
0.11804
0.113757
0.109605
0.105585
0.101687
0.0979245
0.0942973
0.0908194
0.0874977
0.0843418
0.0813732
0.0785988
0.0760331
0.073679
0.071528
0.0695716
0.0677966
0.066187
0.0647307
0.0634174
0.0622301
0.0611514
0.0601598
0.0592269
0.0583311
0.0574607
0.0566043
0.0557604
0.0549276
0.0540953
0.0532579
0.0524058
0.0515263
0.0506071
0.0496442
0.0486391
0.0476002
0.0465387
0.0454607
0.0443698
0.0432674
0.0421581
0.0410482
0.0399469
0.0388602
0.0377895
0.0367384
0.0357087
0.0347
0.0337114
0.0327453
0.0318088
0.0309096
0.0300552
0.0292501
0.0284935
0.0277828
0.027115
0.0264857
0.0258902
0.0253214
0.0247694
0.0242213
0.0236606
0.023089
0.0224963
0.021874
0.0212172
0.0205226
0.019789
0.0190162
0.018205
0.0173563
0.0164709
0.0155499
0.014595
0.0136084
0.0125929
0.0115522
0.0104904
0.00941234
0.00832344
0.0072299
0.0061407
0.00505722
0.00396595
0.00286093
0.001736
0.000586921
0.182373
0.174618
0.166984
0.159835
0.153256
0.147271
0.141749
0.136612
0.131726
0.127045
0.122506
0.118103
0.113823
0.109674
0.105653
0.101756
0.0979917
0.0943628
0.0908824
0.0875585
0.0844002
0.0814302
0.0786547
0.0760881
0.0737343
0.0715838
0.0696287
0.0678565
0.0662504
0.0647981
0.06349
0.0623073
0.0612335
0.0602475
0.0593201
0.0584298
0.057564
0.0567097
0.055865
0.05503
0.0541954
0.053358
0.0525108
0.0516393
0.0507273
0.0497682
0.0487626
0.0477209
0.0466571
0.04558
0.0444924
0.0433934
0.0422849
0.0411723
0.040066
0.0389725
0.0378931
0.0368332
0.035797
0.0347844
0.0337928
0.0328227
0.0318802
0.0309735
0.0301115
0.0292999
0.0285385
0.0278245
0.0271538
0.0265212
0.0259213
0.0253468
0.024788
0.0242326
0.0236646
0.0230862
0.0224881
0.0218624
0.0212038
0.020509
0.0197761
0.0190045
0.0181949
0.0173476
0.0164633
0.015543
0.0145882
0.0136014
0.0125856
0.011545
0.010484
0.00940746
0.0083205
0.0072288
0.00614106
0.00505817
0.00396686
0.00286145
0.00173616
0.000586936
0.18239
0.174614
0.166966
0.159814
0.153243
0.147273
0.141767
0.136646
0.131774
0.127103
0.122573
0.118175
0.113899
0.109752
0.105732
0.101834
0.0980686
0.0944376
0.0909542
0.0876278
0.0844669
0.0814954
0.0787188
0.0761513
0.0737977
0.0716477
0.0696939
0.0679249
0.0663227
0.0648751
0.0635727
0.0623955
0.0613271
0.0603475
0.0594267
0.0585427
0.0576822
0.0568305
0.055985
0.0551473
0.0543105
0.0534729
0.0526307
0.0517678
0.0508637
0.0499088
0.048903
0.0478584
0.0467925
0.0457164
0.0446327
0.0435374
0.0424296
0.0413138
0.0402019
0.0391002
0.0380108
0.036941
0.0358974
0.0348802
0.033885
0.0329105
0.0319615
0.0310466
0.0301763
0.0293578
0.0285912
0.0278733
0.0271993
0.026563
0.0259582
0.0253774
0.0248109
0.0242467
0.02367
0.0230834
0.0224789
0.0218487
0.0211878
0.0204926
0.0197605
0.0189903
0.0181823
0.0173366
0.0164536
0.0155341
0.0145797
0.0135929
0.0125772
0.011537
0.0104772
0.00940246
0.00831754
0.00722778
0.00614165
0.00505937
0.00396798
0.00286212
0.00173644
0.000587026
0.18241
0.174609
0.166945
0.159791
0.153229
0.147275
0.141787
0.136684
0.131827
0.127169
0.122648
0.118257
0.113985
0.10984
0.105821
0.101923
0.0981552
0.0945217
0.0910349
0.0877056
0.084542
0.081569
0.0787912
0.0762227
0.073869
0.0717195
0.0697673
0.0680017
0.0664041
0.0649617
0.0636657
0.0624946
0.0614324
0.0604599
0.0595466
0.0586699
0.0578153
0.0569666
0.0561203
0.0552798
0.0544405
0.0536029
0.0527656
0.0519117
0.0510161
0.0500659
0.0490602
0.0480129
0.0469449
0.04587
0.0447904
0.0436992
0.042592
0.0414724
0.040354
0.0392432
0.0381425
0.0370616
0.0360096
0.0349871
0.0339879
0.0330084
0.0320524
0.031129
0.03025
0.0294241
0.0286519
0.0279298
0.027252
0.0266115
0.0260012
0.0254134
0.0248382
0.024264
0.0236771
0.0230808
0.0224684
0.0218329
0.0211693
0.0204735
0.0197422
0.0189735
0.0181671
0.0173231
0.0164416
0.0155233
0.0145695
0.013583
0.0125678
0.0115285
0.01047
0.00939699
0.00831445
0.00722717
0.00614268
0.00506088
0.00396921
0.0028628
0.00173668
0.000587077
0.182433
0.174604
0.166921
0.159764
0.153213
0.147277
0.14181
0.136727
0.131887
0.127242
0.122731
0.118347
0.114079
0.109938
0.105919
0.102021
0.0982514
0.0946151
0.0911245
0.0877921
0.0846257
0.0816508
0.0788719
0.0763022
0.0739481
0.0717992
0.0698488
0.0680869
0.0664945
0.0650581
0.063769
0.0626047
0.0615494
0.0605846
0.0596798
0.0588113
0.0579631
0.0571179
0.056271
0.0554274
0.0545857
0.0537481
0.0529157
0.052071
0.0511844
0.0502395
0.0492344
0.0481846
0.0471145
0.0460408
0.0449656
0.0438787
0.0427716
0.0416474
0.0405221
0.039401
0.0382877
0.0371946
0.0361333
0.0351048
0.0341011
0.0331163
0.032153
0.0312208
0.030333
0.0294993
0.0287211
0.0279943
0.0273122
0.026667
0.0260507
0.0254552
0.0248703
0.0242844
0.0236857
0.0230781
0.0224565
0.0218149
0.0211482
0.0204517
0.0197212
0.018954
0.0181493
0.0173072
0.0164275
0.0155106
0.0145578
0.0135721
0.0125576
0.0115193
0.0104624
0.00939174
0.00831199
0.00722731
0.00614412
0.00506241
0.00397021
0.00286314
0.00173662
0.000586946
0.18246
0.174597
0.166895
0.159735
0.153195
0.147279
0.141836
0.136775
0.131953
0.127324
0.122823
0.118447
0.114184
0.110045
0.106027
0.10213
0.0983572
0.0947179
0.091223
0.0878872
0.0847179
0.081741
0.0789608
0.0763898
0.0740351
0.0718866
0.0699383
0.0681805
0.0665939
0.0651643
0.0638827
0.0627259
0.0616783
0.0607216
0.0598261
0.0589669
0.0581255
0.057284
0.056437
0.0555902
0.0547462
0.0539088
0.0530812
0.0522457
0.0513687
0.0504297
0.0494258
0.0483737
0.0473016
0.0462291
0.0451581
0.0440753
0.042968
0.0418385
0.0407055
0.039573
0.038446
0.0373398
0.0362683
0.035233
0.0342242
0.0332339
0.0322633
0.0313223
0.0304255
0.0295839
0.0287992
0.028067
0.0273801
0.0267295
0.0261067
0.0255027
0.0249069
0.024308
0.0236957
0.0230753
0.0224432
0.0217947
0.0211245
0.0204272
0.0196977
0.0189319
0.018129
0.017289
0.0164113
0.0154962
0.0145448
0.0135602
0.0125469
0.0115102
0.0104554
0.00938756
0.00831058
0.00722812
0.00614556
0.00506338
0.00397041
0.00286273
0.001736
0.000586521
0.182489
0.174589
0.166865
0.159702
0.153175
0.147282
0.141864
0.136827
0.132026
0.127413
0.122924
0.118557
0.114298
0.110163
0.106146
0.102248
0.0984727
0.09483
0.0913305
0.087991
0.0848187
0.0818396
0.0790578
0.0764855
0.0741298
0.0719818
0.0700359
0.0682824
0.0667024
0.0652806
0.0640071
0.0628583
0.0618192
0.0608712
0.0599855
0.0591363
0.0583023
0.0574648
0.0566181
0.0557684
0.0549221
0.0540852
0.0532622
0.052436
0.0515693
0.050637
0.0496347
0.0485807
0.0475064
0.0464346
0.0453676
0.0442885
0.0431803
0.0420448
0.0409034
0.0397585
0.0386169
0.0374967
0.0364143
0.0353715
0.0343572
0.0333611
0.0323834
0.0314336
0.0305279
0.0296782
0.0288865
0.0281484
0.0274558
0.0267993
0.0261691
0.0255557
0.0249479
0.0243343
0.023707
0.0230722
0.0224286
0.0217723
0.0210984
0.0204004
0.019672
0.0189075
0.0181064
0.0172685
0.0163932
0.0154803
0.0145308
0.013548
0.0125365
0.0115021
0.01045
0.00938492
0.00831022
0.00722914
0.00614631
0.00506309
0.00396926
0.00286125
0.00173468
0.000585767
0.182521
0.17458
0.166833
0.159666
0.153154
0.147285
0.141894
0.136884
0.132105
0.127509
0.123033
0.118676
0.114423
0.11029
0.106274
0.102376
0.0985977
0.0949516
0.0914471
0.0881036
0.0849281
0.0819465
0.0791629
0.0765891
0.0742321
0.0720845
0.0701414
0.0683927
0.06682
0.0654069
0.0641422
0.0630022
0.0619721
0.0610333
0.0601578
0.0593194
0.0584932
0.05766
0.0568141
0.0559619
0.0551136
0.0542775
0.0534591
0.0526422
0.0517863
0.0508615
0.0498615
0.0488058
0.0477292
0.0466576
0.0455936
0.0445174
0.0434077
0.0422656
0.041115
0.0399569
0.0388
0.0376652
0.0365711
0.0355202
0.0344997
0.0334978
0.0325131
0.0315551
0.0306405
0.0297825
0.0289833
0.0282384
0.0275394
0.026876
0.0262375
0.0256135
0.0249924
0.0243627
0.023719
0.0230687
0.0224126
0.0217482
0.0210704
0.0203718
0.0196445
0.0188812
0.0180818
0.0172463
0.0163736
0.0154633
0.0145163
0.013536
0.0125272
0.0114955
0.0104464
0.00938375
0.00831046
0.00722961
0.00614564
0.00506103
0.00396649
0.00285867
0.00173275
0.00058474
0.182557
0.17457
0.166797
0.159627
0.153131
0.147288
0.141928
0.136946
0.13219
0.127614
0.123151
0.118804
0.114557
0.110427
0.106412
0.102514
0.0987324
0.0950827
0.091573
0.0882252
0.0850463
0.0820618
0.079276
0.0767004
0.074342
0.0721947
0.0702548
0.0685113
0.0669468
0.0655434
0.0642883
0.0631576
0.0621373
0.0612079
0.0603431
0.0595159
0.0586979
0.0578695
0.057025
0.056171
0.0553209
0.054486
0.0536724
0.0528647
0.0520202
0.0511037
0.0501065
0.0490493
0.04797
0.0468977
0.0458357
0.0447613
0.0436494
0.0425002
0.0413397
0.0401675
0.0389948
0.037845
0.0367386
0.0356788
0.0346518
0.033644
0.0326526
0.0316867
0.0307636
0.0298969
0.0290897
0.028337
0.0276306
0.0269592
0.0263113
0.0256754
0.0250396
0.0243925
0.0237315
0.0230647
0.0223957
0.0217229
0.0210412
0.0203421
0.0196159
0.0188538
0.0180561
0.017223
0.0163531
0.0154458
0.0145019
0.0135247
0.0125191
0.0114907
0.0104444
0.00938355
0.00831059
0.00722878
0.00614317
0.00505718
0.00396228
0.00285526
0.00173046
0.000583568
0.182598
0.174558
0.166757
0.159584
0.153105
0.147292
0.141964
0.137013
0.132283
0.127727
0.123279
0.118942
0.1147
0.110575
0.10656
0.102661
0.0988766
0.0952232
0.0917082
0.0883558
0.0851733
0.0821855
0.079397
0.0768195
0.0744592
0.0723121
0.0703759
0.0686383
0.0670826
0.0656901
0.0644455
0.0633246
0.0623146
0.0613952
0.0605411
0.0597256
0.0589162
0.058093
0.0572509
0.0563957
0.0555445
0.0547111
0.0539024
0.053104
0.0522714
0.0513639
0.0503699
0.0493114
0.0482289
0.0471546
0.0460932
0.0450193
0.0439043
0.0427477
0.0415767
0.0403898
0.0392012
0.0380363
0.036917
0.0358475
0.0348134
0.0337994
0.0328018
0.0318287
0.0308971
0.0300216
0.0292055
0.0284442
0.0277289
0.0270483
0.0263896
0.0257402
0.0250881
0.0244228
0.023744
0.0230604
0.0223785
0.0216975
0.021012
0.0203124
0.019587
0.0188259
0.0180299
0.0171993
0.0163324
0.0154283
0.0144878
0.0135142
0.0125123
0.0114872
0.0104433
0.00938356
0.00830997
0.00722633
0.00613912
0.00505212
0.00395721
0.00285151
0.0017281
0.000582406
0.182643
0.174545
0.166713
0.159538
0.153078
0.147296
0.142003
0.137085
0.132382
0.127849
0.123415
0.11909
0.114854
0.110732
0.106718
0.102818
0.0990304
0.0953733
0.0918529
0.0884957
0.0853092
0.0823176
0.0795258
0.076946
0.0745837
0.0724368
0.0705046
0.0687735
0.0672276
0.0658471
0.0646136
0.0635032
0.0625041
0.061595
0.0607519
0.0599482
0.059148
0.0583305
0.0574917
0.0566365
0.0557847
0.0549533
0.0541498
0.0533605
0.0525401
0.0516424
0.0506519
0.049592
0.0485057
0.0474281
0.0463653
0.0452905
0.0441717
0.0430076
0.0418255
0.0406236
0.039419
0.0382391
0.0371064
0.0360263
0.0349844
0.0339642
0.0329606
0.0319806
0.0310409
0.0301562
0.0293305
0.0285593
0.0278339
0.0271424
0.0264711
0.0258066
0.0251367
0.0244526
0.0237563
0.0230561
0.0223617
0.021673
0.0209839
0.0202834
0.0195586
0.0187983
0.018004
0.0171757
0.0163117
0.0154107
0.0144738
0.013504
0.012506
0.0114843
0.0104425
0.00938321
0.00830846
0.00722265
0.00613436
0.00504691
0.00395204
0.00284771
0.0017259
0.000581416
0.182691
0.17453
0.166665
0.159487
0.153048
0.1473
0.142045
0.137162
0.132488
0.127979
0.123561
0.119247
0.115018
0.110899
0.106886
0.102985
0.0991938
0.0955329
0.0920072
0.0886449
0.085454
0.0824581
0.0796624
0.07708
0.0747154
0.0725685
0.0706408
0.0689169
0.0673817
0.0660141
0.0647928
0.0636934
0.0627057
0.0618075
0.0609754
0.0601838
0.0593934
0.0585823
0.0577477
0.0568937
0.056042
0.0552131
0.0544152
0.0536347
0.0528265
0.0519391
0.0509524
0.0498908
0.0488
0.0477175
0.0466514
0.0455742
0.0444511
0.0432793
0.0420857
0.0408689
0.0396486
0.0384537
0.0373069
0.0362151
0.0351647
0.0341381
0.0331287
0.0321424
0.0311948
0.0303005
0.0294642
0.0286819
0.0279447
0.0272404
0.0265547
0.0258733
0.0251842
0.0244814
0.0237684
0.0230524
0.0223463
0.0216506
0.0209579
0.0202562
0.0195312
0.0187715
0.0179787
0.0171524
0.0162908
0.0153928
0.0144594
0.0134937
0.0124996
0.0114813
0.0104415
0.00938245
0.0083066
0.00721893
0.00613051
0.00504209
0.00394676
0.00284419
0.00172428
0.000580797
0.182745
0.174513
0.166613
0.159432
0.153017
0.147305
0.14209
0.137245
0.132602
0.128117
0.123716
0.119415
0.115192
0.111076
0.107063
0.103162
0.0993667
0.0957021
0.092171
0.0888034
0.0856077
0.0826069
0.0798068
0.0772212
0.0748542
0.0727073
0.0707844
0.0690685
0.0675447
0.0661911
0.0649827
0.0638951
0.0629194
0.0620324
0.0612117
0.0604323
0.0596523
0.0588487
0.0580195
0.0571679
0.0563173
0.0554913
0.0546992
0.0539273
0.0531308
0.0522537
0.0512708
0.0502072
0.0491112
0.0480222
0.0469507
0.0458697
0.0447419
0.0435627
0.0423574
0.0411259
0.0398904
0.0386804
0.0375189
0.0364142
0.0353543
0.034321
0.0333058
0.0323134
0.031358
0.0304538
0.029606
0.0288112
0.0280605
0.0273413
0.0266391
0.0259389
0.0252299
0.0245089
0.0237806
0.02305
0.0223333
0.0216313
0.020935
0.0202314
0.0195053
0.0187457
0.0179538
0.0171289
0.0162692
0.0153739
0.0144441
0.0134825
0.0124927
0.0114779
0.0104403
0.00938198
0.00830597
0.00721657
0.00612719
0.00503745
0.00394184
0.00284145
0.00172365
0.000580767
0.182803
0.174494
0.166556
0.159373
0.152983
0.147311
0.142138
0.137333
0.132722
0.128264
0.123881
0.119592
0.115376
0.111264
0.107251
0.103348
0.0995492
0.0958809
0.0923445
0.0889715
0.0857704
0.0827642
0.0799588
0.0773698
0.0750001
0.0728532
0.0709355
0.0692281
0.0677164
0.0663776
0.0651831
0.064108
0.0631449
0.0622697
0.0614608
0.0606939
0.0599251
0.0591299
0.0583074
0.0574598
0.0566113
0.0557888
0.0550026
0.0542384
0.0534528
0.0525858
0.0516065
0.0505405
0.0494384
0.0483414
0.0472628
0.0461767
0.0450442
0.0438578
0.0426408
0.0413954
0.0401449
0.0389196
0.0377425
0.0366234
0.0355528
0.0345124
0.0334915
0.0324931
0.03153
0.0306155
0.0297551
0.0289463
0.0281802
0.027444
0.0267229
0.0260027
0.0252734
0.0245351
0.0237934
0.0230498
0.0223238
0.0216158
0.0209157
0.020209
0.0194807
0.0187205
0.0179287
0.0171045
0.0162462
0.0153534
0.0144273
0.0134703
0.0124853
0.0114746
0.0104402
0.0093833
0.00830663
0.00721511
0.00612463
0.0050337
0.00393795
0.0028399
0.00172423
0.000581541
0.182868
0.174471
0.166494
0.159309
0.152946
0.147317
0.142189
0.137427
0.132851
0.128419
0.124056
0.11978
0.115571
0.111462
0.107448
0.103544
0.0997411
0.0960692
0.0925277
0.089149
0.0859421
0.0829298
0.0801186
0.0775255
0.0751531
0.0730061
0.0710938
0.0693956
0.0678968
0.0665735
0.0653935
0.0643318
0.0633819
0.0625194
0.0617229
0.0609688
0.060212
0.0594268
0.0586122
0.0577701
0.0569251
0.0561066
0.0553259
0.0545686
0.0537922
0.0529343
0.0519584
0.0508895
0.0497806
0.0486746
0.0475871
0.046495
0.0453579
0.0441648
0.0429364
0.0416779
0.0404128
0.0391717
0.0379776
0.0368425
0.0357602
0.0347121
0.0336854
0.0326809
0.03171
0.0307847
0.0299107
0.0290863
0.0283029
0.0275474
0.0268055
0.026064
0.0253147
0.0245604
0.0238076
0.0230527
0.0223183
0.0216044
0.0208996
0.0201887
0.0194571
0.0186953
0.0179026
0.0170783
0.0162212
0.0153311
0.0144093
0.0134575
0.012478
0.0114721
0.0104408
0.0093852
0.00830784
0.00721435
0.00612353
0.0050315
0.00393535
0.00283945
0.00172658
0.000583265
0.182939
0.174447
0.166427
0.159241
0.152908
0.147323
0.142244
0.137526
0.132986
0.128584
0.12424
0.119978
0.115775
0.11167
0.107655
0.103749
0.0999426
0.0962672
0.0927205
0.0893359
0.0861228
0.0831037
0.0802861
0.0776886
0.0753132
0.0731662
0.0712594
0.0695708
0.0680854
0.0667781
0.0656136
0.0645661
0.0636303
0.0627813
0.061998
0.0612572
0.0605137
0.0597398
0.0589347
0.0580998
0.0572598
0.0564456
0.0556699
0.0549177
0.0541483
0.0532981
0.0523251
0.0512531
0.050137
0.0490211
0.0479234
0.0468245
0.0456832
0.0444843
0.0432452
0.0419743
0.0406948
0.0394369
0.0382241
0.0370713
0.035976
0.03492
0.0338871
0.0328763
0.0318972
0.0309608
0.0300722
0.0292304
0.0284276
0.0276507
0.0268864
0.0261229
0.0253542
0.0245855
0.0238236
0.0230589
0.0223169
0.0215968
0.0208863
0.0201698
0.0194334
0.0186689
0.0178746
0.0170499
0.0161943
0.0153074
0.0143901
0.0134439
0.0124702
0.0114696
0.0104419
0.00938799
0.00831073
0.00721523
0.00612513
0.00503087
0.00393353
0.0028409
0.00173111
0.000585862
0.183014
0.174419
0.166354
0.159167
0.152866
0.14733
0.142302
0.137632
0.13313
0.128758
0.124434
0.120186
0.115991
0.111888
0.107872
0.103964
0.100154
0.0964746
0.0929228
0.0895321
0.0863123
0.083286
0.0804614
0.0778589
0.0754805
0.0733336
0.0714323
0.0697536
0.0682821
0.0669912
0.0658427
0.0648105
0.0638898
0.0630554
0.0622862
0.0615597
0.0608305
0.0600697
0.0592759
0.0584499
0.0576163
0.0568068
0.056035
0.0552859
0.0545206
0.0536759
0.0527054
0.0516302
0.0505066
0.0493803
0.0482717
0.0471654
0.0460206
0.0448169
0.043568
0.0422854
0.0409913
0.039715
0.0384813
0.0373092
0.0362
0.0351356
0.0340968
0.033079
0.0320913
0.031143
0.0302387
0.0293778
0.0285536
0.0277536
0.0269654
0.0261798
0.0253928
0.0246112
0.0238416
0.0230685
0.0223192
0.0215921
0.0208745
0.0201509
0.0194087
0.0186404
0.0178441
0.0170192
0.0161651
0.0152816
0.0143692
0.0134292
0.0124622
0.0114673
0.0104439
0.00939247
0.00831645
0.00722243
0.00612939
0.0050306
0.00393378
0.00284495
0.00173764
0.000588921
0.183098
0.174388
0.166274
0.159088
0.152823
0.147338
0.142365
0.137744
0.133282
0.128941
0.124639
0.120405
0.116217
0.112117
0.1081
0.104188
0.100374
0.0966915
0.0931347
0.0897377
0.0865106
0.0834764
0.0806445
0.0780365
0.075655
0.0735084
0.0716126
0.0699439
0.0684865
0.0672123
0.0660805
0.0650648
0.0641603
0.0633415
0.0625877
0.0618764
0.061163
0.0604171
0.0596365
0.0588214
0.0579957
0.057191
0.0564216
0.055673
0.0549082
0.0540665
0.0530978
0.0520196
0.0508887
0.0497521
0.0486322
0.0475181
0.0463704
0.0451632
0.0439059
0.0426119
0.0413025
0.0400058
0.0387496
0.0375566
0.0364315
0.0353578
0.0343133
0.0332891
0.0322919
0.0313309
0.0304097
0.029528
0.0286804
0.0278557
0.0270429
0.0262354
0.0254315
0.024638
0.023861
0.0230807
0.022324
0.0215889
0.0208627
0.0201308
0.0193819
0.0186091
0.0178104
0.0169852
0.016133
0.0152534
0.0143469
0.013414
0.0124544
0.0114661
0.0104478
0.00939963
0.00832556
0.00723186
0.00613453
0.00503246
0.0039373
0.00285163
0.00174519
0.000591754
0.183187
0.174353
0.166188
0.159004
0.152777
0.147347
0.142431
0.137862
0.133442
0.129134
0.124854
0.120635
0.116454
0.112357
0.108337
0.104423
0.100604
0.0969179
0.0933559
0.0899523
0.0867176
0.083675
0.0808353
0.0782214
0.0758368
0.0736906
0.0718001
0.0701415
0.0686983
0.0674408
0.0663266
0.0653285
0.0644415
0.0636398
0.0629027
0.0622078
0.0615118
0.0607829
0.0600176
0.059215
0.0583987
0.0575989
0.0568299
0.0560786
0.0553106
0.0544686
0.0535011
0.0524208
0.0512831
0.0501365
0.049005
0.047883
0.0467329
0.0455234
0.0442592
0.0429542
0.0416286
0.0403102
0.0390297
0.0378135
0.0366701
0.0355856
0.0345353
0.0335053
0.0324991
0.0315245
0.0305849
0.0296807
0.028808
0.0279573
0.0271197
0.0262908
0.025471
0.0246663
0.0238807
0.0230943
0.0223299
0.0215854
0.0208492
0.020108
0.0193516
0.018574
0.0177729
0.0169478
0.0160981
0.0152235
0.014324
0.0133992
0.0124478
0.0114667
0.0104539
0.00940914
0.00833631
0.00724396
0.0061431
0.00503834
0.00394452
0.00286011
0.00175221
0.000593589
0.183287
0.174312
0.166095
0.158914
0.152728
0.147357
0.142501
0.137986
0.13361
0.129336
0.125079
0.120876
0.116702
0.112607
0.108585
0.104667
0.100844
0.0971536
0.0935864
0.0901761
0.0869331
0.0838816
0.0810337
0.0784137
0.0760259
0.0738802
0.071995
0.0703462
0.0689173
0.0676766
0.0665805
0.0656017
0.0647336
0.0639503
0.0632313
0.0625542
0.0618772
0.0611675
0.0604197
0.0596315
0.0588257
0.0580305
0.0572598
0.0565024
0.0557272
0.0548816
0.0539146
0.0528331
0.0516897
0.0505335
0.0493908
0.0482607
0.0471087
0.0458982
0.0446282
0.0433126
0.0419703
0.0406288
0.0393218
0.0380797
0.0369154
0.035818
0.0347617
0.0337267
0.0327119
0.0317236
0.0307646
0.0298362
0.0289366
0.028059
0.0271964
0.0263468
0.0255119
0.0246962
0.0239006
0.0231077
0.0223347
0.0215797
0.0208323
0.020081
0.0193168
0.0185343
0.0177313
0.016907
0.0160611
0.0151928
0.014301
0.0133844
0.0124415
0.0114686
0.0104623
0.00942174
0.00835092
0.00726054
0.00615655
0.0050493
0.0039547
0.00286871
0.00175695
0.000593814
0.183394
0.174268
0.165994
0.158818
0.152676
0.147367
0.142576
0.138118
0.133787
0.129548
0.125315
0.121127
0.11696
0.112869
0.108844
0.104921
0.101093
0.0973986
0.093826
0.0904087
0.087157
0.084096
0.0812397
0.0786132
0.0762221
0.0740773
0.0721972
0.070558
0.0691432
0.0679194
0.0668423
0.0658841
0.0650364
0.064273
0.0635737
0.062916
0.0622597
0.0615715
0.0608433
0.0600711
0.0592768
0.0584858
0.0577111
0.0569441
0.0561577
0.0553051
0.0543378
0.0532567
0.0521089
0.0509439
0.0497903
0.0486519
0.0474982
0.0462878
0.0450132
0.0436874
0.0423279
0.0409619
0.039626
0.0383552
0.037167
0.0360546
0.0349916
0.0339523
0.0329296
0.0319276
0.0309488
0.029995
0.029067
0.0281615
0.0272741
0.0264041
0.0255544
0.0247272
0.02392
0.0231191
0.0223367
0.02157
0.0208103
0.0200486
0.0192768
0.01849
0.0176859
0.0168637
0.0160224
0.0151607
0.0142773
0.0133705
0.0124378
0.0114741
0.0104749
0.00943881
0.00837008
0.0072806
0.00617427
0.00506445
0.00396608
0.0028754
0.00175797
0.000592156
0.183508
0.17422
0.165885
0.158715
0.152622
0.147379
0.142655
0.138256
0.133973
0.129769
0.125561
0.121389
0.11723
0.113141
0.109113
0.105185
0.101352
0.0976528
0.0940746
0.0906501
0.0873892
0.0843182
0.0814531
0.0788198
0.0764254
0.0742818
0.0724065
0.0707767
0.069376
0.068169
0.0671117
0.0661758
0.0653501
0.0646083
0.0639302
0.0632935
0.0626598
0.0619953
0.0612889
0.060534
0.0597514
0.058964
0.0581832
0.0574033
0.0566021
0.0557393
0.0547712
0.0536922
0.0525416
0.0513686
0.0502045
0.0490576
0.0479021
0.0466925
0.0454143
0.0440784
0.0427012
0.0413093
0.0399421
0.0386396
0.0374246
0.0362949
0.0352244
0.0341814
0.0331517
0.0321361
0.0311369
0.030157
0.0292
0.0282661
0.0273535
0.0264631
0.0255981
0.0247584
0.0239381
0.0231271
0.0223341
0.0215546
0.0207822
0.0200101
0.0192313
0.0184409
0.0176367
0.0168175
0.0159822
0.0151292
0.0142563
0.013361
0.0124392
0.0114848
0.0104923
0.00946014
0.00839294
0.0073029
0.00619463
0.00508254
0.00397655
0.00287818
0.00175452
0.000588709
0.183634
0.174165
0.165768
0.158606
0.152565
0.147392
0.142738
0.138402
0.134168
0.130001
0.125818
0.121663
0.117511
0.113425
0.109392
0.10546
0.101621
0.0979164
0.0943321
0.0909001
0.0876295
0.0845478
0.0816737
0.0790333
0.0766356
0.0744932
0.0726229
0.0710022
0.0696156
0.0684255
0.067389
0.066477
0.065675
0.0649563
0.0643011
0.0636871
0.063078
0.0624391
0.0617563
0.0610196
0.0602488
0.0594643
0.0586754
0.0578798
0.0570607
0.0561851
0.0552155
0.0541405
0.0529892
0.051809
0.0506347
0.0494791
0.0483211
0.0471127
0.0458314
0.0444853
0.0430896
0.0416705
0.0402698
0.0389327
0.0376882
0.0365389
0.03546
0.0344139
0.033378
0.032349
0.0313289
0.0303221
0.0293352
0.0283724
0.0274347
0.0265238
0.0256427
0.0247892
0.0239539
0.0231307
0.0223254
0.021532
0.0207467
0.0199648
0.01918
0.0183874
0.0175846
0.0167704
0.0159436
0.0151017
0.0142415
0.0133587
0.0124475
0.011501
0.0105136
0.00948398
0.00841716
0.00732504
0.00621462
0.0050992
0.00398239
0.00287545
0.00174661
0.000583829
0.183769
0.174104
0.16564
0.15849
0.152506
0.147407
0.142827
0.138556
0.134372
0.130243
0.126086
0.121948
0.117804
0.113719
0.109683
0.105745
0.1019
0.0981892
0.0945983
0.0911585
0.0878778
0.0847849
0.0819012
0.0792535
0.0768522
0.0747114
0.0728459
0.0712344
0.069862
0.0686891
0.0676744
0.0667879
0.0660114
0.0653176
0.064687
0.0640972
0.0635144
0.0629031
0.0622452
0.0615273
0.060768
0.0599855
0.0591871
0.0583736
0.0575341
0.0566436
0.0556722
0.054603
0.0534533
0.0522669
0.0510825
0.0499176
0.0487559
0.0475481
0.0462638
0.044907
0.0434921
0.0420445
0.0406084
0.0392343
0.0379579
0.0367871
0.0356986
0.0346497
0.0336085
0.0325663
0.0315249
0.0304907
0.0294732
0.028481
0.027518
0.0265862
0.0256878
0.0248185
0.0239658
0.023128
0.0223085
0.0215006
0.020703
0.0199127
0.0191236
0.0183307
0.0175317
0.0167255
0.01591
0.0150818
0.0142355
0.0133649
0.0124627
0.0115215
0.0105366
0.00950748
0.00843977
0.00734457
0.00623141
0.00511109
0.0039842
0.00286738
0.00173506
0.000577985
0.183919
0.174032
0.165503
0.158366
0.152443
0.147424
0.142921
0.138717
0.134586
0.130496
0.126365
0.122244
0.118107
0.114025
0.109985
0.10604
0.102188
0.0984714
0.0948733
0.0914251
0.0881339
0.0850291
0.0821356
0.0794802
0.0770751
0.074936
0.0730754
0.071473
0.0701151
0.06896
0.0679681
0.0671089
0.0663598
0.0656926
0.0650883
0.0645245
0.0639695
0.0633871
0.0627552
0.0620561
0.0613075
0.0605262
0.0597175
0.0588847
0.058023
0.0571163
0.0561429
0.0550818
0.0539359
0.0527445
0.0515499
0.0503747
0.0492074
0.0479985
0.0467104
0.0453422
0.043907
0.0424301
0.0409573
0.0395444
0.0382339
0.03704
0.0359411
0.0348895
0.0338437
0.0327886
0.0317256
0.0306632
0.0296146
0.0285925
0.0276036
0.0266499
0.0257322
0.0248443
0.0239714
0.0231169
0.0222814
0.0214591
0.0206508
0.0198543
0.0190635
0.0182734
0.0174815
0.0166863
0.0158848
0.0150715
0.0142392
0.0133793
0.0124832
0.011544
0.0105583
0.00952748
0.00845785
0.00735918
0.0062425
0.00511651
0.00398278
0.00285373
0.00172061
0.000571556
0.184079
0.173955
0.165355
0.158235
0.152378
0.147442
0.143021
0.138886
0.13481
0.130759
0.126655
0.122551
0.118423
0.114342
0.110298
0.106346
0.102487
0.098763
0.0951569
0.0916999
0.0883977
0.0852804
0.0823765
0.0797129
0.0773038
0.0751664
0.0733109
0.0717178
0.070375
0.0692384
0.0682707
0.0674406
0.0667207
0.0660821
0.0655058
0.0649695
0.0644434
0.0638907
0.0632851
0.0626048
0.0618662
0.0610852
0.0602659
0.0594132
0.0585283
0.0576048
0.0566298
0.0555787
0.0544394
0.053244
0.0520389
0.050852
0.0496761
0.0484635
0.0471701
0.0457892
0.0443328
0.042826
0.041316
0.039863
0.0385171
0.0372988
0.0361884
0.035134
0.0340842
0.0330164
0.0319315
0.0308407
0.0297604
0.0287076
0.0276917
0.0267144
0.0257744
0.0248644
0.0239687
0.0230954
0.0222426
0.0214068
0.0205902
0.0197908
0.0190022
0.0182187
0.0174372
0.0166555
0.0158692
0.0150711
0.0142514
0.0133995
0.0125061
0.0115652
0.0105757
0.00954127
0.00846915
0.00736727
0.00624688
0.00511439
0.0039726
0.0028355
0.00170453
0.000564879
0.184249
0.17387
0.165195
0.158096
0.15231
0.147463
0.143127
0.139064
0.135043
0.131034
0.126957
0.12287
0.11875
0.11467
0.110622
0.106663
0.102796
0.0990639
0.0954493
0.0919828
0.0886689
0.0855385
0.0826236
0.0799516
0.077538
0.0754023
0.073552
0.0719686
0.0706415
0.0695245
0.0685825
0.0677834
0.0670948
0.0664867
0.0659403
0.0654326
0.0649363
0.0644136
0.0638342
0.0631721
0.0624428
0.0616617
0.0608319
0.0599595
0.059051
0.0581106
0.0571348
0.0560959
0.054966
0.0537678
0.0525514
0.0513507
0.0501628
0.0489423
0.0476411
0.0462461
0.0447677
0.0432311
0.0416841
0.0401906
0.0388082
0.0375646
0.0364421
0.0353844
0.0343308
0.0332505
0.0321434
0.0310236
0.0299112
0.0288266
0.027782
0.0267785
0.0258128
0.0248768
0.023956
0.0230621
0.0221913
0.0213439
0.0205226
0.0197246
0.0189425
0.0181694
0.0174011
0.0166341
0.0158628
0.0150784
0.014269
0.0134219
0.0125275
0.0115815
0.010586
0.00954703
0.00847239
0.00736796
0.00624424
0.00510539
0.00395611
0.00281331
0.00168739
0.000558111
0.184435
0.173775
0.165023
0.157949
0.15224
0.147486
0.143239
0.139251
0.135287
0.131319
0.12727
0.1232
0.119088
0.11501
0.110957
0.106991
0.103115
0.0993743
0.0957503
0.0922736
0.0889475
0.0858032
0.0828768
0.0801957
0.0777775
0.0756435
0.0737984
0.0722252
0.0709147
0.0698186
0.0689039
0.0681378
0.0674827
0.0669073
0.0663925
0.0659145
0.0654481
0.0649551
0.0644012
0.0637569
0.0630365
0.0622551
0.0614154
0.0605241
0.0595919
0.0586351
0.0576598
0.0566356
0.0555178
0.0543179
0.0530892
0.0518718
0.0506675
0.0494344
0.048122
0.0467113
0.0452104
0.0436445
0.0420615
0.0405279
0.0391087
0.0378392
0.0367037
0.0356417
0.0345839
0.0334912
0.0323616
0.0312125
0.0300672
0.0289496
0.027874
0.0268411
0.0258458
0.0248801
0.0239328
0.0230164
0.0221279
0.0212716
0.0204498
0.019658
0.0188869
0.0181273
0.0173734
0.0166207
0.0158629
0.0150898
0.0142876
0.013442
0.0125435
0.0115903
0.0105876
0.00954406
0.00846739
0.00736132
0.00623591
0.00509223
0.00393758
0.002789
0.00166998
0.000551394
0.184636
0.173668
0.164837
0.157794
0.152167
0.147511
0.143357
0.139447
0.135542
0.131616
0.127595
0.123542
0.119438
0.115362
0.111304
0.10733
0.103445
0.0996941
0.09606
0.0925724
0.0892334
0.0860743
0.0831356
0.080445
0.0780217
0.0758895
0.0740499
0.0724874
0.0711946
0.0701208
0.0692352
0.0685044
0.067885
0.0673446
0.066863
0.0664154
0.0659787
0.0655146
0.0649853
0.0643584
0.0636467
0.0628652
0.0620166
0.0611075
0.060152
0.0591798
0.0582068
0.0571995
0.0560965
0.054896
0.0536532
0.0524159
0.0511904
0.049939
0.0486114
0.0471833
0.0456599
0.0440658
0.0424485
0.0408761
0.0394202
0.0381243
0.0369747
0.035907
0.034844
0.0337386
0.0325861
0.0314069
0.0302281
0.0290759
0.0279666
0.0269008
0.0258721
0.0248738
0.0238993
0.0229594
0.0220545
0.0211924
0.0203746
0.0195936
0.0188369
0.0180924
0.0173526
0.0166124
0.0158654
0.0151005
0.0143022
0.0134552
0.0125507
0.0115895
0.0105801
0.00953273
0.00845497
0.00734864
0.00622385
0.00507725
0.0039184
0.00276294
0.00165258
0.000544782
0.184857
0.173544
0.164637
0.15763
0.152092
0.14754
0.143483
0.139653
0.135808
0.131925
0.127931
0.123896
0.119799
0.115724
0.111662
0.10768
0.103784
0.100023
0.0963783
0.092879
0.0895264
0.0863517
0.0833998
0.0806991
0.0782704
0.0761399
0.0743062
0.072755
0.0714811
0.0704313
0.0695769
0.0688834
0.0683022
0.0677988
0.0673521
0.0669354
0.0665278
0.0660914
0.0655856
0.064976
0.0642735
0.0634923
0.0626358
0.0617106
0.0607324
0.0597459
0.0587772
0.0577892
0.0567034
0.0555028
0.0542441
0.0529829
0.0517309
0.0504555
0.0491083
0.0476611
0.0461155
0.0444951
0.042846
0.0412366
0.0397449
0.038422
0.0372567
0.0361811
0.0351111
0.0339919
0.032816
0.031606
0.0303927
0.0292043
0.0280585
0.0269565
0.0258912
0.024858
0.0238568
0.0228935
0.0219739
0.0211094
0.0202996
0.019533
0.0187925
0.0180631
0.0173356
0.0166051
0.0158655
0.0151053
0.0143082
0.013458
0.0125469
0.0115785
0.0105638
0.00951412
0.00843664
0.00733257
0.00621005
0.00506258
0.00390018
0.00273563
0.00163553
0.00053832
0.185093
0.173412
0.164422
0.157456
0.152014
0.147572
0.143616
0.139869
0.136086
0.132246
0.12828
0.124261
0.120172
0.116098
0.112031
0.10804
0.104135
0.100362
0.0967053
0.0931935
0.0898264
0.0866353
0.0836692
0.0809576
0.0785232
0.0763944
0.0745669
0.0730281
0.0717743
0.0707504
0.0699292
0.0692752
0.0687346
0.0682704
0.0678599
0.0674743
0.067095
0.0666851
0.0662018
0.0656097
0.0649172
0.0641372
0.0632737
0.0623343
0.0613342
0.0603349
0.0593727
0.058406
0.0573389
0.0561385
0.0548614
0.053572
0.0522883
0.0509831
0.049612
0.0481444
0.0465776
0.0449332
0.0432551
0.0416116
0.0400849
0.0387343
0.0375512
0.0364645
0.0353847
0.0342502
0.0330499
0.0318083
0.0305593
0.029333
0.0281483
0.0270071
0.0259027
0.0248338
0.0238069
0.0228218
0.0218899
0.021026
0.0202272
0.0194766
0.0187525
0.0180364
0.0173183
0.016594
0.0158582
0.0150998
0.0143018
0.0134479
0.0125314
0.0115579
0.0105399
0.00948956
0.00841387
0.00731424
0.00619636
0.0050496
0.00388379
0.00270801
0.00161931
0.00053206
0.185343
0.173265
0.16419
0.157274
0.151935
0.147608
0.143757
0.140095
0.136375
0.132579
0.128641
0.124639
0.120557
0.116483
0.112412
0.108412
0.104495
0.10071
0.0970409
0.0935157
0.0901332
0.0869248
0.0839435
0.0812204
0.0787798
0.0766526
0.0748318
0.0733065
0.0720742
0.0710783
0.0702925
0.06968
0.0691823
0.0687592
0.0683861
0.0680317
0.0676798
0.0672953
0.066834
0.06626
0.0655789
0.0648004
0.0639314
0.0629798
0.0619591
0.0609485
0.0599947
0.0590506
0.0580029
0.0568022
0.055504
0.054182
0.0528616
0.0515214
0.0501223
0.0486332
0.0470467
0.0453812
0.0436778
0.0420031
0.040443
0.0390635
0.0378594
0.0367575
0.0356641
0.0345119
0.0332859
0.0320116
0.0307259
0.0294602
0.0282344
0.0270518
0.0259073
0.0248028
0.0237517
0.022748
0.0218063
0.0209451
0.0201585
0.0194239
0.0187143
0.0180086
0.0172964
0.0165748
0.0158398
0.0150808
0.014281
0.0134242
0.0125046
0.0115285
0.0105095
0.00946022
0.00838778
0.00729385
0.0061821
0.00503878
0.00386863
0.00268378
0.00160471
0.000526034
0.185617
0.173101
0.163941
0.157082
0.151853
0.147647
0.143907
0.140333
0.136677
0.132925
0.129015
0.125029
0.120954
0.116879
0.112803
0.108794
0.104865
0.101068
0.097385
0.0938454
0.0904468
0.0872201
0.0842226
0.0814871
0.0790402
0.0769144
0.0751008
0.0735901
0.0723811
0.0714152
0.0706669
0.0700977
0.0696452
0.0692647
0.0689299
0.0686069
0.0682816
0.0679218
0.0674825
0.0669279
0.0662589
0.0654826
0.0646102
0.0636489
0.0626091
0.0615885
0.0606445
0.0597232
0.0586946
0.0574922
0.0561701
0.0548111
0.0534494
0.0520696
0.0506393
0.0491282
0.0475241
0.0458408
0.0441159
0.0424135
0.0408214
0.0394114
0.0381824
0.0370601
0.0359481
0.034775
0.0335218
0.0322138
0.0308903
0.0295841
0.0283158
0.0270906
0.0259058
0.024767
0.0236933
0.0226755
0.0217264
0.0208689
0.0200939
0.019373
0.0186745
0.0179755
0.0172659
0.0165439
0.0158073
0.0150466
0.0142453
0.0133876
0.0124676
0.0114918
0.0104739
0.00942719
0.00835939
0.00727229
0.00616883
0.00503026
0.00385563
0.00267119
0.0015921
0.000520092
0.185912
0.172917
0.163674
0.15688
0.151769
0.147692
0.144065
0.140582
0.136991
0.133284
0.129402
0.125431
0.121362
0.117287
0.113205
0.109186
0.105246
0.101434
0.0977373
0.0941825
0.0907667
0.087521
0.0845062
0.0817577
0.0793041
0.0771797
0.0753739
0.0738793
0.072695
0.0717614
0.0710523
0.0705283
0.070123
0.0697865
0.0694905
0.0691989
0.0688999
0.0685648
0.0681483
0.0676142
0.0669576
0.066185
0.0653118
0.0643436
0.0632864
0.0622572
0.0613233
0.0604238
0.0594123
0.0582062
0.0568574
0.0554575
0.0540502
0.0526274
0.0511632
0.0496301
0.0480112
0.046314
0.0445716
0.0428451
0.0412223
0.0397797
0.0385208
0.037372
0.0362356
0.0350378
0.0337554
0.0324127
0.0310508
0.0297033
0.0283917
0.0271237
0.0258996
0.0247287
0.0236341
0.0226073
0.0216522
0.0207978
0.0200321
0.0193211
0.0186295
0.0179333
0.0172233
0.0164991
0.0157599
0.0149973
0.0141958
0.0133395
0.0124219
0.011449
0.0104343
0.00939175
0.00832994
0.00725044
0.00615601
0.00502263
0.00384514
0.00265191
0.00157921
0.000513693
0.186236
0.172706
0.163387
0.156668
0.151684
0.147741
0.144233
0.140843
0.137319
0.133656
0.129802
0.125846
0.121783
0.117706
0.113619
0.109589
0.105636
0.10181
0.0980976
0.0945266
0.0910927
0.0878271
0.0847943
0.0820322
0.0795719
0.0774487
0.0756513
0.0741742
0.0730164
0.072117
0.0714486
0.0709717
0.0706152
0.0703236
0.0700669
0.069807
0.0695342
0.0692247
0.068832
0.0683184
0.0676757
0.0669094
0.0660384
0.0650658
0.0639938
0.0629568
0.0620321
0.0611516
0.0601541
0.0589417
0.0575632
0.0561191
0.0546628
0.0531943
0.0516947
0.0501403
0.0485096
0.0468026
0.0450468
0.0432997
0.0416474
0.0401694
0.0388748
0.0376924
0.0365253
0.0352983
0.0339847
0.0326067
0.031206
0.0298172
0.0284624
0.0271521
0.0258904
0.02469
0.0235764
0.0225448
0.0215844
0.0207313
0.0199709
0.0192649
0.0185754
0.0178787
0.0171664
0.0164393
0.0156978
0.0149345
0.0141347
0.0132822
0.0123695
0.0114017
0.0103923
0.00935582
0.00830149
0.00722956
0.0061373
0.00501433
0.003837
0.00264589
0.00156651
0.000506254
0.186582
0.172478
0.16308
0.156446
0.151598
0.147795
0.144411
0.141117
0.137661
0.134042
0.130216
0.126275
0.122216
0.118137
0.114043
0.110002
0.106035
0.102193
0.0984655
0.0948772
0.0914242
0.0881382
0.0850867
0.0823106
0.0798435
0.0777216
0.0759333
0.0744751
0.0733454
0.072482
0.0718557
0.0714277
0.0711214
0.0708751
0.0706583
0.0704306
0.0701846
0.0699013
0.0695328
0.0690408
0.0684146
0.0676577
0.0667921
0.0658177
0.0647336
0.0636895
0.0627714
0.0619058
0.0609178
0.0596957
0.0582852
0.0567941
0.0552863
0.0537702
0.0522346
0.0506598
0.0490207
0.0473083
0.0455434
0.0437785
0.0420973
0.0405808
0.0392441
0.0380207
0.036816
0.0355552
0.0342085
0.0327948
0.0313555
0.0299259
0.0285287
0.0271775
0.0258805
0.0246531
0.0235221
0.0224881
0.0215225
0.0206675
0.0199073
0.0192006
0.0185088
0.017809
0.017094
0.0163649
0.0156226
0.0148607
0.0140645
0.0132178
0.0123122
0.0113518
0.01035
0.00932152
0.00827564
0.00721097
0.00612332
0.00500379
0.00382968
0.00264972
0.00155112
0.000496737
0.186952
0.172225
0.16275
0.156215
0.15151
0.147855
0.1446
0.141404
0.138016
0.134443
0.130644
0.126716
0.122662
0.11858
0.114478
0.110426
0.106444
0.102585
0.0988405
0.0952338
0.0917606
0.0884538
0.085383
0.0825928
0.0801194
0.0779988
0.0762204
0.0747827
0.0736825
0.0728566
0.0722738
0.0718959
0.0716407
0.0714403
0.0712639
0.0710692
0.0708501
0.0705936
0.0702503
0.069782
0.0691757
0.0684321
0.0675749
0.0666012
0.0655082
0.0644571
0.0635418
0.0626852
0.0617011
0.0604657
0.059021
0.0574812
0.0559201
0.0543556
0.0527839
0.0511902
0.049546
0.0478326
0.0460622
0.0442821
0.042572
0.0410134
0.0396277
0.0383556
0.0371065
0.0358074
0.0344259
0.0329768
0.0314999
0.0300306
0.0285925
0.0272022
0.0258722
0.0246203
0.0234729
0.0224355
0.0214648
0.0206037
0.019838
0.019125
0.0184269
0.0177228
0.0170058
0.0162769
0.0155366
0.0147783
0.0139878
0.0131485
0.0122517
0.011301
0.0103093
0.0092905
0.00825309
0.00719373
0.00610786
0.00498801
0.00381855
0.00265539
0.00152598
0.000483731
0.187354
0.171943
0.162397
0.155973
0.151422
0.147922
0.144799
0.141704
0.138386
0.134858
0.131086
0.127171
0.123121
0.119035
0.114924
0.110859
0.106862
0.102985
0.0992221
0.0955957
0.0921012
0.0887732
0.0856831
0.082879
0.0803999
0.0782808
0.0765132
0.0750973
0.0740281
0.0732408
0.0727031
0.072376
0.0721723
0.0720182
0.0718831
0.0717216
0.0715297
0.0713009
0.0709847
0.0705429
0.0699607
0.0692347
0.0683888
0.0674176
0.0663191
0.0652607
0.0643433
0.0634887
0.062502
0.0612493
0.059769
0.0581798
0.0565645
0.0549512
0.0533439
0.0517328
0.0500867
0.0483763
0.0466037
0.04481
0.0430703
0.0414655
0.0400242
0.0386957
0.0373957
0.0360542
0.0346369
0.0331534
0.0316405
0.0301333
0.0286562
0.0272288
0.025868
0.0245933
0.0234297
0.0223843
0.0214094
0.0205374
0.01976
0.0190354
0.0183283
0.0176197
0.0169029
0.0161773
0.015442
0.01469
0.0139066
0.0130759
0.0121893
0.0112505
0.010271
0.00926283
0.00823243
0.00717499
0.00608378
0.00496388
0.00379752
0.00263398
0.00148739
0.000467498
0.187788
0.171627
0.16202
0.155721
0.151334
0.147995
0.14501
0.142018
0.138771
0.135288
0.131542
0.12764
0.123592
0.119502
0.115382
0.111302
0.107288
0.103391
0.0996096
0.0959622
0.0924452
0.0890958
0.0859866
0.083169
0.0806852
0.0785681
0.0768122
0.0754197
0.0743825
0.0736351
0.0731438
0.0728677
0.0727154
0.0726079
0.0725149
0.0723868
0.0722225
0.0720228
0.0717364
0.0713249
0.0707712
0.0700673
0.0692352
0.0682679
0.067167
0.0661008
0.0651754
0.0643149
0.0633187
0.062045
0.0605282
0.05889
0.0572205
0.0555584
0.0539163
0.0522892
0.0506439
0.0489399
0.0471676
0.045361
0.0435901
0.041935
0.0404314
0.0390395
0.0376828
0.0362955
0.0348419
0.0333257
0.0317792
0.0302364
0.0287225
0.0272601
0.0258702
0.0245736
0.0233932
0.0223351
0.0213542
0.0204661
0.0196712
0.0189304
0.0182125
0.0175005
0.0167868
0.0160681
0.0153412
0.0145974
0.0138221
0.0130007
0.0121258
0.0112005
0.0102346
0.00923646
0.00820997
0.00715081
0.00605367
0.00492839
0.00376319
0.0025966
0.00143728
0.000449422
0.188265
0.171264
0.161617
0.15546
0.151246
0.148076
0.145233
0.142347
0.139172
0.135733
0.132014
0.128123
0.124078
0.119982
0.115851
0.111755
0.107724
0.103805
0.100003
0.0963324
0.0927916
0.0894208
0.0862929
0.0834628
0.0809755
0.0788613
0.0771183
0.0757503
0.0747461
0.0740401
0.073596
0.0733704
0.0732692
0.0732089
0.0731586
0.0730638
0.0729281
0.0727595
0.0725063
0.0721292
0.0716087
0.0709309
0.0701149
0.0691524
0.0680517
0.0669768
0.0660371
0.0651625
0.0641497
0.0628515
0.0612984
0.0596128
0.0578899
0.0561796
0.0545033
0.0528613
0.0512186
0.0495235
0.0477529
0.0459328
0.0441284
0.0424189
0.0408469
0.0393851
0.0379667
0.0365312
0.0350417
0.0334953
0.0319182
0.0303424
0.028794
0.0272985
0.0258805
0.0245622
0.0233634
0.0222884
0.0212975
0.0203882
0.0195705
0.0188103
0.0180811
0.0173675
0.0166601
0.0159519
0.0152359
0.0145017
0.0137351
0.0129233
0.0120607
0.01115
0.0101973
0.00920726
0.00818082
0.00711579
0.00600984
0.00487959
0.00371739
0.00255524
0.00139463
0.00043206
0.188776
0.17087
0.161188
0.155189
0.151158
0.148164
0.145469
0.142691
0.139588
0.136194
0.1325
0.128621
0.124576
0.120475
0.116331
0.112218
0.108167
0.104226
0.100401
0.0967057
0.0931397
0.0897474
0.0866014
0.08376
0.0812709
0.0791608
0.077432
0.0760899
0.0751193
0.0744558
0.0740597
0.0738837
0.073833
0.0738207
0.0738133
0.0737521
0.0736466
0.0735117
0.0732956
0.0729573
0.0724742
0.0718263
0.0710279
0.0700708
0.0689724
0.0678873
0.0669269
0.0660297
0.064994
0.0636684
0.06208
0.0603496
0.0585752
0.0568174
0.0551078
0.0534513
0.0518119
0.0501267
0.0483581
0.0465229
0.0446819
0.0429137
0.0412681
0.0397308
0.0382468
0.0367616
0.0352374
0.0336637
0.0320592
0.0304531
0.0288725
0.0273453
0.0259
0.0245592
0.02334
0.0222441
0.0212377
0.0203029
0.0194584
0.0186767
0.0179367
0.0172238
0.0165258
0.0158309
0.0151278
0.0144038
0.0136457
0.0128434
0.0119931
0.0110962
0.010155
0.00916974
0.00813938
0.00706513
0.00595145
0.00481729
0.00366301
0.00251318
0.00136109
0.00041623
0.189323
0.170432
0.160731
0.154909
0.151072
0.148261
0.145718
0.14305
0.14002
0.13667
0.133002
0.129133
0.125089
0.120981
0.116824
0.112692
0.10862
0.104654
0.100803
0.0970816
0.0934887
0.0900748
0.0869115
0.0840603
0.0815712
0.0794669
0.0777538
0.0764387
0.0755023
0.0748825
0.0745347
0.0744072
0.0744065
0.0744432
0.0744787
0.0744517
0.0743787
0.0742808
0.0741059
0.0738107
0.0733685
0.0727533
0.0719736
0.0710224
0.0699276
0.0688304
0.0678429
0.0669151
0.0658505
0.0644958
0.0628738
0.0611021
0.0592789
0.0574749
0.0557325
0.0540615
0.0524248
0.050749
0.0489812
0.0471282
0.045247
0.0434162
0.0416924
0.0400752
0.0385227
0.0369872
0.0354297
0.0338318
0.0322032
0.0305695
0.0289584
0.0274009
0.0259282
0.0245638
0.0233217
0.0222011
0.0211735
0.0202102
0.0193365
0.0185327
0.0177832
0.0170735
0.0163874
0.0157077
0.0150182
0.0143044
0.0135543
0.0127606
0.0119211
0.0110356
0.0101024
0.00911825
0.00808091
0.00699562
0.00587622
0.00474387
0.00360531
0.00247448
0.00133407
0.000403169
0.189919
0.169943
0.160246
0.154621
0.150988
0.148368
0.145982
0.143425
0.140468
0.137162
0.133519
0.129659
0.125616
0.1215
0.117328
0.113175
0.109081
0.105088
0.10121
0.0974594
0.0938381
0.0904024
0.0872226
0.0843632
0.0818763
0.0797795
0.078084
0.0767973
0.0758955
0.0753198
0.0750205
0.0749406
0.0749894
0.0750764
0.0751546
0.0751632
0.0751258
0.0750685
0.0749391
0.0746907
0.0742922
0.0737116
0.0729508
0.0720068
0.0709153
0.0698034
0.0687827
0.0678167
0.0667184
0.0653337
0.0636809
0.0618721
0.0600038
0.0581553
0.0563808
0.0546944
0.0530583
0.0513897
0.0496201
0.0477457
0.0458203
0.0439235
0.0421182
0.0404178
0.0387946
0.0372086
0.0356196
0.0340003
0.0323504
0.0306912
0.0290511
0.0274638
0.0259634
0.0245737
0.0233062
0.0221575
0.0211038
0.0201105
0.0192069
0.0183819
0.017625
0.0169207
0.0162484
0.0155847
0.0149086
0.0142042
0.0134609
0.012674
0.0118425
0.0109645
0.0100348
0.00904818
0.0080022
0.00690664
0.00578731
0.00466382
0.00354889
0.00244487
0.00134362
0.000394683
0.190564
0.169393
0.159731
0.154325
0.150907
0.148485
0.14626
0.143817
0.140933
0.13767
0.134051
0.130201
0.126156
0.122031
0.117844
0.11367
0.109551
0.105528
0.101621
0.097839
0.0941876
0.0907298
0.0875342
0.0846682
0.0821855
0.0800985
0.0784226
0.0771656
0.0762987
0.075767
0.0755165
0.0754835
0.0755822
0.0757202
0.075841
0.0758876
0.0758897
0.0758772
0.0757972
0.0755985
0.0752455
0.0747003
0.0739584
0.0730233
0.0719337
0.0708037
0.0697438
0.0687327
0.0675968
0.0661827
0.0645024
0.0626611
0.0607519
0.0588614
0.0570552
0.055352
0.0537132
0.0520479
0.0502725
0.0483723
0.0463989
0.0444334
0.0425446
0.0407588
0.0390635
0.0374269
0.0358077
0.0341692
0.0325002
0.0308168
0.0291485
0.0275315
0.0260025
0.0245857
0.0232903
0.0221108
0.0210271
0.0200043
0.019072
0.0182281
0.0174663
0.0167695
0.0161118
0.0154641
0.0148008
0.0141044
0.0133659
0.0125829
0.0117551
0.0108794
0.00994871
0.00895685
0.00790231
0.00680018
0.00569057
0.00458054
0.00349395
0.00242158
0.00135912
0.00038757
0.191273
0.168767
0.159187
0.154023
0.150829
0.148613
0.146553
0.144225
0.141414
0.138194
0.134599
0.130757
0.126711
0.122577
0.118372
0.114174
0.110029
0.105975
0.102036
0.0982201
0.094537
0.0910567
0.0878461
0.084975
0.0824986
0.0804237
0.0787695
0.0775434
0.0767119
0.0762238
0.0760218
0.0760356
0.0761851
0.0763741
0.0765386
0.0766264
0.0766726
0.0767092
0.076682
0.0765351
0.0762285
0.0757186
0.074997
0.0740712
0.0729808
0.0718289
0.0707242
0.0696616
0.0684851
0.067043
0.0653391
0.0634701
0.0615245
0.0595951
0.057758
0.0560359
0.0543898
0.0527224
0.0509362
0.0490056
0.0469806
0.0449448
0.0429718
0.0410995
0.039331
0.0376436
0.0359948
0.0343382
0.032651
0.030944
0.0292473
0.0276001
0.0260414
0.0245956
0.02327
0.0220578
0.0209422
0.0198916
0.0189335
0.0180742
0.0173104
0.0166229
0.0159803
0.0153479
0.0146959
0.0140054
0.013269
0.0124859
0.0116569
0.0107784
0.00984273
0.00884407
0.00778288
0.00668012
0.00558617
0.0044955
0.00344168
0.00240685
0.00137984
0.000381719
0.192034
0.16808
0.158613
0.153714
0.150755
0.148752
0.146865
0.144652
0.141912
0.138733
0.135162
0.131328
0.127281
0.123136
0.118912
0.114689
0.110516
0.106428
0.102454
0.0986027
0.0948865
0.0913834
0.0881582
0.0852833
0.082815
0.0807546
0.0791242
0.0779302
0.0771347
0.0766895
0.0765356
0.0765967
0.0767974
0.0770379
0.0772481
0.0773816
0.0774771
0.0775667
0.0775949
0.0775006
0.077241
0.0767678
0.076067
0.0751493
0.0740549
0.072877
0.0717222
0.0706022
0.0693826
0.0679149
0.0661919
0.0642995
0.0623225
0.0603576
0.0584903
0.0567468
0.0550877
0.0534117
0.0516089
0.0496431
0.0475636
0.0454574
0.0434011
0.0414424
0.0395998
0.0378607
0.0361816
0.0345065
0.032801
0.0310697
0.0293439
0.0276656
0.0260757
0.024599
0.0232413
0.0219955
0.0208481
0.0197722
0.0187921
0.0179216
0.0171592
0.0164827
0.0158553
0.0152369
0.0145943
0.0139072
0.0131693
0.0123819
0.0115466
0.0106609
0.00971765
0.00871218
0.00764807
0.00655242
0.00548038
0.00441223
0.00339621
0.00240263
0.00141185
0.000383132
0.192851
0.167314
0.158009
0.153402
0.150687
0.148906
0.147194
0.145096
0.142428
0.139289
0.13574
0.131914
0.127864
0.123708
0.119464
0.115214
0.111011
0.106887
0.102876
0.0989867
0.0952363
0.0917099
0.0884706
0.0855933
0.0831345
0.0810908
0.0794861
0.0783253
0.0775662
0.0771638
0.0770575
0.077166
0.0774182
0.0777112
0.0779706
0.0781552
0.0783055
0.0784518
0.0785365
0.0784956
0.0782849
0.0778485
0.0771679
0.0762564
0.0751546
0.0739467
0.0727369
0.071554
0.070289
0.0687984
0.0670609
0.0651497
0.0631458
0.0611492
0.0592522
0.057484
0.0558058
0.0541138
0.0522883
0.0502829
0.0481471
0.0459716
0.0438346
0.0417906
0.0398734
0.0380809
0.0363694
0.0346737
0.0329481
0.031191
0.0294347
0.0277241
0.0261015
0.024592
0.0232006
0.0219209
0.0207435
0.0196452
0.0186477
0.0177705
0.0170129
0.0163491
0.0157367
0.0151309
0.0144953
0.0138084
0.0130652
0.0122692
0.011424
0.0105282
0.00957632
0.00856575
0.00750357
0.00642135
0.00536434
0.00433739
0.00336319
0.00240551
0.00142849
0.000377687
0.193743
0.166458
0.157375
0.153085
0.150624
0.149074
0.14754
0.14556
0.142962
0.139862
0.136333
0.132514
0.128461
0.124292
0.120029
0.11575
0.111515
0.107352
0.103301
0.0993722
0.0955868
0.092037
0.0887839
0.0859051
0.0834571
0.081432
0.0798547
0.0787279
0.0780056
0.0776456
0.0775865
0.0777424
0.0780465
0.0783944
0.0787075
0.0789495
0.07916
0.0793658
0.0795074
0.079522
0.0793613
0.078961
0.0782992
0.0773914
0.0762787
0.0750374
0.0737682
0.072517
0.071204
0.0696933
0.0679464
0.066021
0.0639945
0.0619694
0.0600427
0.0582461
0.0565418
0.0548262
0.0529718
0.0509234
0.0487306
0.0464883
0.0442746
0.0421478
0.0401552
0.0383069
0.0365593
0.0348392
0.0330901
0.031305
0.0295165
0.0277723
0.0261159
0.024572
0.0231459
0.0218325
0.0206277
0.0195103
0.0184996
0.0176201
0.0168705
0.0162207
0.0156229
0.0150277
0.014396
0.0137062
0.0129545
0.012147
0.0112896
0.0103828
0.00942323
0.0084107
0.00735553
0.00628876
0.00524855
0.00427543
0.00334378
0.00241103
0.00143859
0.000364328
0.19471
0.165499
0.156713
0.152768
0.150569
0.149256
0.147905
0.146043
0.143514
0.140451
0.136942
0.133127
0.129072
0.12489
0.120604
0.116296
0.112026
0.107822
0.103729
0.099759
0.0959382
0.0923649
0.0890986
0.0862191
0.0837828
0.081778
0.0802294
0.0791371
0.078452
0.0781341
0.0781216
0.0783248
0.0786818
0.0790878
0.0794603
0.0797667
0.0800427
0.0803099
0.0805087
0.0805812
0.0804709
0.0801052
0.0794598
0.0785531
0.0774266
0.0761491
0.0748172
0.0734924
0.0721284
0.0705995
0.0688483
0.0669136
0.0648686
0.0628176
0.0608601
0.0590305
0.0572929
0.0555458
0.053657
0.051563
0.0493138
0.0470085
0.0447232
0.0425167
0.0404487
0.0385412
0.0367523
0.0350023
0.0332255
0.0314092
0.0295869
0.0278083
0.0261172
0.0245382
0.0230765
0.0217301
0.0205004
0.0193678
0.0183475
0.0174694
0.0167303
0.0160953
0.0155109
0.0149237
0.014293
0.0135973
0.0128351
0.0120152
0.0111456
0.0102286
0.00926343
0.00825238
0.00720836
0.00616111
0.00515707
0.00423763
0.00333505
0.00241691
0.00144794
0.00037779
0.195769
0.16441
0.156024
0.15245
0.150522
0.149453
0.148291
0.146548
0.144086
0.141058
0.137566
0.133755
0.129696
0.1255
0.121191
0.116851
0.112545
0.108297
0.10416
0.100147
0.0962909
0.0926945
0.0894153
0.0865358
0.0841118
0.0821287
0.0806099
0.0795523
0.0789045
0.0786283
0.0786617
0.0789124
0.079324
0.0797922
0.0802308
0.0806086
0.0809549
0.0812845
0.0815411
0.081674
0.0816138
0.0812804
0.080649
0.0797408
0.078598
0.0772824
0.0758854
0.0744823
0.0730634
0.0715174
0.0697666
0.0678278
0.0657681
0.0636925
0.0617023
0.059834
0.0580554
0.0562692
0.0543413
0.0522007
0.049897
0.0475329
0.0451814
0.0428993
0.0407559
0.0387854
0.0369489
0.0351622
0.0333523
0.0315018
0.0296444
0.0278313
0.0261058
0.0244915
0.0229944
0.0216155
0.0203628
0.0192193
0.0181921
0.017318
0.0165909
0.0159701
0.015397
0.0148148
0.0141822
0.0134793
0.0127065
0.0118751
0.0109948
0.0100695
0.00910108
0.0080946
0.00706652
0.00604704
0.00510342
0.00421866
0.00333015
0.00241931
0.00145356
0.000393061
0.196906
0.163209
0.155311
0.152134
0.150484
0.149669
0.148698
0.147075
0.144677
0.141682
0.138206
0.134398
0.130332
0.126121
0.121788
0.117415
0.113071
0.108776
0.104592
0.100536
0.0966452
0.093026
0.0897347
0.0868558
0.0844445
0.0824841
0.0809957
0.0799729
0.0793624
0.0791274
0.0792063
0.0795048
0.0799733
0.0805087
0.0810205
0.0814766
0.0818972
0.0822893
0.0826055
0.0828005
0.0827894
0.0824859
0.0818656
0.0809537
0.0797931
0.0784383
0.0769751
0.0754896
0.0740114
0.0724483
0.0707019
0.0687639
0.0666929
0.0645931
0.0625667
0.0606533
0.0588255
0.0569929
0.0550222
0.0528358
0.0504807
0.0480616
0.0456489
0.0432956
0.0410774
0.0390398
0.0371485
0.0353175
0.0334687
0.0315809
0.0296878
0.0278414
0.026083
0.0244347
0.0229029
0.0214923
0.0202176
0.019068
0.0180359
0.0171666
0.0164514
0.0158427
0.0152776
0.0146973
0.0140609
0.013351
0.0125696
0.0117292
0.0108405
0.00990887
0.00893936
0.00794037
0.00693334
0.00594751
0.00505422
0.00419785
0.00332108
0.00241746
0.00146002
0.00040486
0.198126
0.161871
0.154577
0.151822
0.150455
0.149903
0.149129
0.147623
0.145288
0.142324
0.138863
0.135055
0.130982
0.126753
0.122395
0.117987
0.113602
0.109258
0.105026
0.100926
0.0970011
0.0933597
0.090057
0.0871795
0.0847811
0.0828445
0.0813869
0.0803987
0.0798253
0.079631
0.0797548
0.0801021
0.0806306
0.0812387
0.0818311
0.0823719
0.0828696
0.0833238
0.0837025
0.0839604
0.0839968
0.0837204
0.0831089
0.0821917
0.081012
0.0796174
0.0780882
0.0765174
0.0749758
0.0733944
0.0716552
0.0697223
0.0676426
0.0655178
0.0634507
0.061485
0.0595999
0.0577138
0.0556976
0.0534678
0.0510655
0.0485948
0.0461246
0.0437042
0.0414121
0.0393032
0.0373494
0.035466
0.0335723
0.0316447
0.0297165
0.0278391
0.0260508
0.024371
0.0228065
0.0213655
0.0200689
0.0189175
0.0178824
0.0170173
0.0163118
0.0157113
0.0151499
0.0145687
0.0139282
0.0132134
0.012427
0.011581
0.0106864
0.00975056
0.00878214
0.0077926
0.00680923
0.00585994
0.00500458
0.00416903
0.00330412
0.00241306
0.00147075
0.000419871
0.199456
0.160376
0.153827
0.151516
0.150436
0.150156
0.149583
0.148193
0.14592
0.142984
0.139536
0.135728
0.131646
0.127397
0.123011
0.118567
0.114138
0.109742
0.10546
0.101316
0.0973581
0.0936957
0.0903826
0.0875072
0.0851219
0.0832098
0.0817835
0.0808295
0.0802929
0.0801389
0.0803074
0.0807051
0.0812976
0.0819844
0.0826644
0.0832952
0.0838713
0.084388
0.0848321
0.0851525
0.0852345
0.0849828
0.0843782
0.0834547
0.0822553
0.08082
0.079226
0.0775687
0.07596
0.0743585
0.0726281
0.0707033
0.0686165
0.0664649
0.064352
0.0623264
0.0603757
0.0584295
0.0563658
0.0540962
0.051652
0.0491328
0.0466073
0.0441227
0.0417576
0.0395731
0.0375489
0.0356046
0.0336606
0.0316914
0.0297295
0.0278247
0.0260108
0.0243036
0.0227098
0.0212403
0.019922
0.0187709
0.0177361
0.0168729
0.0161728
0.0155753
0.015013
0.014429
0.0137858
0.0130699
0.0122834
0.0114358
0.010538
0.00959986
0.00863352
0.00765216
0.00669023
0.00577638
0.00494647
0.00412385
0.00327755
0.00240627
0.00148426
0.000436994
0.200889
0.158704
0.153065
0.151218
0.150431
0.150431
0.150062
0.148788
0.146572
0.143664
0.140225
0.136415
0.132323
0.128052
0.123635
0.119152
0.114677
0.110228
0.105893
0.101704
0.0977157
0.0940334
0.0907112
0.0878388
0.0854668
0.0835801
0.0821853
0.0812653
0.0807653
0.0806511
0.0808646
0.0813152
0.0819762
0.082748
0.0835221
0.0842468
0.0849009
0.0854833
0.0859945
0.0863758
0.0865008
0.0862716
0.0856729
0.0847433
0.0835232
0.0820458
0.0803893
0.0786457
0.0769677
0.0753437
0.0736223
0.0717072
0.0696135
0.0674327
0.0652682
0.063175
0.061151
0.0591385
0.0570257
0.0547202
0.05224
0.0496758
0.0470961
0.0445489
0.0421108
0.0398462
0.0377435
0.0357302
0.0337307
0.0317191
0.0297259
0.0277979
0.0259635
0.024234
0.022616
0.0211215
0.0197826
0.0186271
0.0176014
0.0167365
0.0160358
0.0154351
0.0148679
0.0142807
0.0136382
0.0129264
0.012145
0.0113001
0.0104016
0.00946161
0.00849556
0.00751715
0.00657055
0.00568709
0.00487315
0.00406038
0.00324347
0.00239666
0.00149104
0.000438032
0.202456
0.156819
0.152299
0.150929
0.150437
0.150729
0.150568
0.149407
0.147246
0.144363
0.140933
0.137117
0.133013
0.128719
0.124269
0.119744
0.11522
0.110714
0.106325
0.102091
0.0980728
0.0943719
0.091042
0.0881736
0.0858153
0.0839548
0.0825921
0.0817059
0.0812425
0.0811683
0.0814277
0.0819343
0.082669
0.0835317
0.0844056
0.0852264
0.0859592
0.0866115
0.0871894
0.0876286
0.0877938
0.0875856
0.0869927
0.0860567
0.0848159
0.0832967
0.0815778
0.0797498
0.0780016
0.0763526
0.074639
0.0727335
0.0706321
0.0684189
0.0661972
0.0640295
0.061925
0.0598407
0.057677
0.0553393
0.0528292
0.0502236
0.0475906
0.0449811
0.0424689
0.0401193
0.03793
0.0358397
0.03378
0.0317261
0.0297048
0.0277583
0.0259081
0.0241619
0.0225259
0.0210118
0.0196548
0.0184902
0.017481
0.0166105
0.0159025
0.0152927
0.0147177
0.0141287
0.0134916
0.0127897
0.0120186
0.0111798
0.0102815
0.00933805
0.00836748
0.00738466
0.00644707
0.00558657
0.00478733
0.00399488
0.00320554
0.00237911
0.00147991
0.000430691
0.204135
0.154737
0.15154
0.150653
0.150453
0.151051
0.151103
0.150052
0.147942
0.145082
0.141658
0.137834
0.133716
0.129398
0.124911
0.120342
0.115766
0.111201
0.106755
0.102476
0.0984285
0.0947099
0.0913737
0.0885104
0.0861662
0.0843331
0.0830032
0.0821511
0.0817247
0.081691
0.0819981
0.0825648
0.0833787
0.084338
0.0853161
0.0862343
0.0870491
0.0877737
0.0884166
0.0889097
0.0891118
0.0889233
0.0883369
0.0873944
0.0861334
0.0845744
0.0827923
0.0808822
0.079064
0.077387
0.0756785
0.0737809
0.0716698
0.0694208
0.067137
0.0648888
0.0626978
0.0605369
0.0583207
0.0559535
0.0534189
0.0507761
0.0480907
0.0454178
0.0428293
0.0403895
0.0381056
0.0359305
0.0338068
0.0317113
0.0296655
0.0277056
0.0258441
0.0240856
0.0224388
0.0209117
0.0195414
0.0183676
0.0173748
0.0164965
0.0157747
0.0151509
0.0145672
0.0139792
0.0133527
0.0126662
0.0119091
0.0110781
0.0101791
0.00922823
0.00824659
0.00725291
0.00632254
0.00547742
0.0046956
0.00392863
0.00316407
0.00234716
0.00144178
0.000411741
0.205925
0.152421
0.150797
0.150391
0.150484
0.151398
0.151667
0.150723
0.148661
0.145821
0.142401
0.138568
0.134432
0.130087
0.125561
0.120945
0.116314
0.111688
0.107183
0.102857
0.0987816
0.0950461
0.0917048
0.0888475
0.086518
0.0847134
0.0834174
0.0825999
0.0822117
0.0822203
0.082578
0.0832096
0.0841083
0.0851691
0.0862549
0.0872725
0.088173
0.088971
0.0896759
0.0902181
0.0904535
0.0902835
0.0897046
0.0887565
0.0874762
0.0858797
0.0840338
0.0820443
0.0801567
0.0784479
0.07674
0.0748471
0.0727234
0.0704352
0.0680852
0.0657518
0.0634701
0.061229
0.0589585
0.0565636
0.0540089
0.0513329
0.0485958
0.045858
0.0431902
0.0406547
0.0382687
0.0360015
0.0338095
0.0316732
0.0296071
0.0276376
0.0257704
0.0240057
0.0223533
0.0208205
0.0194429
0.0182622
0.0172781
0.0163952
0.0156543
0.0150134
0.0144221
0.0138388
0.0132275
0.0125597
0.011818
0.0109942
0.0100919
0.00912827
0.00812918
0.00712203
0.00620306
0.00536505
0.00460443
0.00386134
0.0031132
0.00229185
0.00137349
0.000380489
0.207864
0.149844
0.150087
0.150144
0.150528
0.151772
0.152261
0.151422
0.149402
0.146579
0.143164
0.139319
0.135163
0.130787
0.12622
0.121554
0.116866
0.112175
0.107609
0.103235
0.0991313
0.095379
0.0920334
0.0891828
0.0868685
0.0850933
0.0838324
0.0830508
0.082703
0.0827569
0.0831693
0.083872
0.0848611
0.0860275
0.0872232
0.0883432
0.0893323
0.0902042
0.0909678
0.0915537
0.0918185
0.091666
0.0910955
0.090144
0.0888453
0.0872135
0.0853038
0.0832381
0.0812814
0.0795356
0.0778217
0.0759285
0.0737888
0.0714584
0.0690391
0.0666176
0.0642424
0.0619187
0.0595925
0.0571708
0.0545995
0.0518937
0.0491053
0.0463001
0.0435496
0.0409135
0.0384188
0.0360525
0.0337878
0.0316108
0.0295282
0.0275533
0.025686
0.023922
0.0222699
0.0207375
0.019359
0.0181744
0.0171882
0.0163077
0.0155441
0.0148852
0.0142886
0.0137135
0.0131196
0.0124709
0.0117429
0.0109231
0.0100131
0.00903167
0.00801092
0.00699222
0.00608152
0.00525467
0.00451641
0.00379288
0.00304574
0.00220561
0.00128391
0.000347607
0.209928
0.146975
0.149425
0.149915
0.150584
0.152175
0.152888
0.152148
0.150167
0.147358
0.143945
0.140086
0.135907
0.131497
0.126888
0.122169
0.11742
0.112663
0.108034
0.103611
0.0994771
0.0957076
0.0923577
0.089514
0.087215
0.0854703
0.0842458
0.0835019
0.0831976
0.083301
0.0837741
0.0845549
0.0856403
0.0869155
0.0882224
0.0894476
0.0905278
0.0914737
0.0922925
0.0929172
0.0932077
0.0930713
0.09251
0.0915575
0.0902424
0.0885763
0.0866056
0.0844671
0.0824402
0.0806498
0.0789209
0.0770209
0.0748611
0.072486
0.0699958
0.0674849
0.0650153
0.0626079
0.0602247
0.0577762
0.0551905
0.0524578
0.0496181
0.0467422
0.0439054
0.0411648
0.0385564
0.036085
0.0337426
0.0315239
0.0294277
0.0274526
0.0255905
0.023834
0.0221886
0.020663
0.0192896
0.0181041
0.0171112
0.0162359
0.0154478
0.0147718
0.0141729
0.0136079
0.0130302
0.0123968
0.0116771
0.0108558
0.00993314
0.00893038
0.00788778
0.00686224
0.00595075
0.00514749
0.00442572
0.00370586
0.00294032
0.00209877
0.00120028
0.000318538
0.212168
0.143767
0.148833
0.149702
0.150654
0.152609
0.153548
0.152903
0.150956
0.148158
0.144746
0.140871
0.136666
0.132219
0.127563
0.122791
0.117978
0.113152
0.108458
0.103984
0.0998192
0.0960311
0.0926764
0.0898391
0.0875552
0.0858413
0.0846546
0.0839506
0.0836938
0.0838528
0.0843939
0.0852611
0.0864487
0.0878355
0.089254
0.0905856
0.091759
0.092779
0.0936506
0.0943098
0.0946229
0.0945016
0.0939497
0.092998
0.0916694
0.0899707
0.0879437
0.0857353
0.0836353
0.0817905
0.0800349
0.0781194
0.0759349
0.0735134
0.0709522
0.0683523
0.0657887
0.0632976
0.0608565
0.0583803
0.0557813
0.0530239
0.0501327
0.0471824
0.0442553
0.0414072
0.0386821
0.0361011
0.033676
0.0314134
0.0293054
0.0273353
0.0254843
0.0237418
0.0221098
0.0205981
0.0192355
0.018052
0.017051
0.0161821
0.0153705
0.0146795
0.0140803
0.0135242
0.0129575
0.0123313
0.0116117
0.0107816
0.00984176
0.00881724
0.00775717
0.00673049
0.00582275
0.00503685
0.00431676
0.00358422
0.00283737
0.00200114
0.00111456
0.000286078
0.214545
0.140232
0.148337
0.149505
0.150737
0.153075
0.154242
0.153686
0.151768
0.148978
0.145564
0.141674
0.13744
0.132951
0.128247
0.123419
0.11854
0.113643
0.108883
0.104355
0.100158
0.0963496
0.0929886
0.0901563
0.087887
0.086204
0.085056
0.0843946
0.0841902
0.0844117
0.0850295
0.0859923
0.0872884
0.0887889
0.0903191
0.0917564
0.0930245
0.0941189
0.0950418
0.0957328
0.0960666
0.0959599
0.0954176
0.0944678
0.0931283
0.0914006
0.0893226
0.0870469
0.0848693
0.0829579
0.0811615
0.0792199
0.0770052
0.0745363
0.0719053
0.0692185
0.0665628
0.0639888
0.0614884
0.0589825
0.0563699
0.0535898
0.0506475
0.0476193
0.0445974
0.0416381
0.0387958
0.0361025
0.0335904
0.0312811
0.0291619
0.027201
0.0253676
0.0236457
0.0220348
0.0205442
0.0191979
0.0180193
0.0170112
0.0161481
0.0153179
0.0146141
0.0140144
0.0134625
0.0128973
0.0122672
0.0115372
0.0106909
0.00973141
0.00868851
0.0076174
0.00659238
0.00568635
0.00490798
0.00418131
0.00347033
0.00271654
0.00188807
0.00104192
0.000263808
0.21707
0.136316
0.147969
0.149328
0.150833
0.153576
0.154972
0.154499
0.152605
0.149819
0.146402
0.142493
0.138229
0.133695
0.128938
0.124053
0.119105
0.114137
0.109308
0.104726
0.100494
0.0966632
0.093294
0.0904649
0.0882089
0.0865562
0.0854478
0.0848318
0.0846852
0.0849771
0.0856813
0.0867494
0.0881603
0.0897765
0.091418
0.0929596
0.0943224
0.0954915
0.0964655
0.0971875
0.0975413
0.0974494
0.0969169
0.0959697
0.0946219
0.0928697
0.0907466
0.0884056
0.086145
0.0841531
0.0822995
0.0803194
0.0780681
0.075551
0.0728528
0.0700826
0.0673378
0.0646819
0.0621205
0.0595813
0.0569531
0.0541514
0.0511597
0.0480505
0.0449307
0.0418571
0.0388954
0.0360901
0.0334874
0.0311289
0.0289986
0.0270502
0.0252403
0.0235463
0.0219644
0.0205022
0.0191779
0.018008
0.0169951
0.0161321
0.0152949
0.0145797
0.0139766
0.0134203
0.0128441
0.0121971
0.0114463
0.010578
0.00959965
0.00854401
0.00746659
0.00644075
0.00553056
0.00475652
0.00404665
0.00332332
0.00257406
0.00178447
0.000991972
0.000253399
0.219813
0.131972
0.147767
0.14916
0.150942
0.154115
0.155739
0.15534
0.153464
0.150681
0.147258
0.14333
0.139032
0.13445
0.129638
0.124692
0.119675
0.114634
0.109736
0.105098
0.100828
0.0969724
0.0935925
0.0907642
0.0885202
0.0868969
0.0858288
0.085261
0.085178
0.0855489
0.0863495
0.0875327
0.0890643
0.0907975
0.0925498
0.0941949
0.0956508
0.0968948
0.0979204
0.0986742
0.0990491
0.0989728
0.0984504
0.0975066
0.096153
0.0943813
0.0922191
0.0898148
0.0874648
0.0853777
0.0834492
0.0814164
0.0791212
0.0765552
0.0737936
0.0709447
0.0681145
0.065378
0.062753
0.0601751
0.0575266
0.054703
0.0516647
0.0484733
0.0452523
0.0420642
0.038982
0.0360631
0.0333681
0.0309583
0.0288164
0.026883
0.0251022
0.0234433
0.0218985
0.0204721
0.0191758
0.0180196
0.0170055
0.0161347
0.0153047
0.0145777
0.0139649
0.0133924
0.0127916
0.012115
0.011335
0.0104427
0.00944895
0.00838548
0.00730198
0.00626824
0.00535334
0.00459961
0.00388525
0.00315896
0.00244533
0.00170168
0.000957418
0.000244923
0.222728
0.127159
0.147773
0.148998
0.151064
0.154694
0.156545
0.156211
0.154348
0.151564
0.148132
0.144183
0.13985
0.135216
0.130345
0.125335
0.120247
0.115133
0.110166
0.10547
0.101161
0.0972778
0.0938843
0.0910543
0.0888205
0.0872257
0.0861984
0.0856822
0.0856688
0.0861274
0.0870346
0.0883421
0.0899996
0.0918506
0.0937127
0.095461
0.0970094
0.0983275
0.0994056
0.100193
0.100591
0.100532
0.10002
0.09908
0.0977235
0.0959374
0.0937419
0.0912763
0.088831
0.0866339
0.0846119
0.0825114
0.0801643
0.0775485
0.0747276
0.071806
0.0688948
0.0660787
0.0633863
0.0607622
0.0580863
0.0552379
0.0521557
0.0488848
0.0455592
0.0422584
0.0390567
0.0360214
0.0332332
0.0307708
0.0286165
0.0266994
0.0249522
0.0233357
0.0218362
0.020453
0.0191912
0.0180543
0.0170437
0.0161642
0.0153457
0.0146049
0.0139739
0.0133721
0.0127333
0.0120173
0.0112038
0.0102891
0.00928449
0.00821449
0.00711985
0.00607158
0.00516761
0.00442816
0.00370768
0.00299809
0.00232955
0.0016338
0.000922842
0.000229327
0.225816
0.121823
0.148039
0.148837
0.151199
0.155317
0.157391
0.157111
0.155254
0.152467
0.149025
0.145053
0.140682
0.135993
0.131059
0.125983
0.120822
0.115637
0.110599
0.105845
0.101494
0.0975795
0.0941695
0.0913351
0.0891098
0.0875425
0.086557
0.0860959
0.0861586
0.0867137
0.0877373
0.0891772
0.090965
0.0929339
0.094905
0.0967564
0.0983971
0.0997895
0.100921
0.101745
0.102169
0.102127
0.101626
0.100691
0.0993347
0.0975391
0.0953154
0.0927902
0.0902444
0.0879233
0.0857894
0.0836057
0.0811983
0.0785319
0.0756565
0.0726684
0.0696809
0.0667861
0.0640217
0.0613422
0.0586289
0.0557499
0.052625
0.0492811
0.0458498
0.0424384
0.0391193
0.0359657
0.0330852
0.0305694
0.0284005
0.0264992
0.0247888
0.0232214
0.0217754
0.0204436
0.0192228
0.0181112
0.0171089
0.0162226
0.0154112
0.014654
0.013995
0.0133508
0.0126634
0.0119028
0.0110564
0.0101235
0.00911079
0.00803045
0.00691739
0.00585984
0.00498222
0.00424661
0.00353645
0.00286066
0.00222638
0.0015674
0.000883408
0.000209732
0.229046
0.115965
0.148622
0.148661
0.151347
0.155989
0.158279
0.15804
0.156182
0.15339
0.149937
0.14594
0.141528
0.136781
0.131779
0.126632
0.1214
0.116143
0.111036
0.106222
0.101825
0.0978778
0.0944481
0.0916063
0.0893881
0.0878477
0.0869054
0.0865036
0.0866491
0.0873094
0.0884585
0.0900378
0.0919591
0.0940454
0.0961245
0.0980803
0.0998135
0.10128
0.102467
0.103329
0.103781
0.10376
0.10327
0.102342
0.100987
0.0991867
0.0969387
0.094355
0.0917042
0.0892468
0.0869834
0.0847013
0.0822251
0.0795074
0.0765823
0.0735345
0.0704756
0.0675023
0.0646606
0.0619153
0.0591528
0.056235
0.0530662
0.049655
0.046125
0.0426039
0.0391684
0.0358996
0.0329293
0.0303592
0.0281722
0.0262836
0.0246106
0.0230973
0.0217132
0.0204408
0.0192681
0.0181871
0.0171971
0.0163055
0.0154908
0.0147141
0.0140169
0.0133198
0.0125782
0.0117734
0.0108985
0.00995128
0.00892896
0.00783074
0.00669616
0.00564452
0.00479174
0.00406896
0.00338373
0.00273567
0.00213495
0.00150218
0.00084218
0.000185866
0.232428
0.109528
0.149588
0.148455
0.151509
0.156712
0.159211
0.159
0.157134
0.154332
0.150867
0.146843
0.142389
0.137579
0.132504
0.127283
0.121978
0.116652
0.111476
0.106601
0.102157
0.0981724
0.0947196
0.0918675
0.0896548
0.0881412
0.0872443
0.0869068
0.0871424
0.0879166
0.0891995
0.0909237
0.0929802
0.0951829
0.0973719
0.0994322
0.101258
0.1028
0.104043
0.104947
0.10543
0.10543
0.104954
0.104032
0.102683
0.100881
0.0986109
0.0959681
0.0932082
0.0906037
0.0881949
0.0857997
0.0832467
0.080477
0.077507
0.0744063
0.0712808
0.0682291
0.0653043
0.062482
0.0596574
0.0566907
0.0534748
0.0500014
0.0463823
0.0427554
0.0392069
0.0358297
0.0327735
0.0301477
0.0279373
0.0260562
0.0244184
0.0229618
0.0216457
0.0204404
0.019322
0.018276
0.0173008
0.0164038
0.0155731
0.0147733
0.0140288
0.0132728
0.0124771
0.0116331
0.010735
0.00977397
0.00873644
0.00761316
0.00646162
0.00541121
0.00460625
0.00390808
0.00324428
0.00261498
0.00202736
0.00143997
0.000795679
0.000154904
0.235974
0.102468
0.151008
0.148198
0.151687
0.157493
0.160188
0.159989
0.158108
0.155295
0.151815
0.147763
0.143265
0.138387
0.133234
0.127935
0.122556
0.117162
0.11192
0.106983
0.102488
0.0984631
0.0949833
0.0921176
0.0899092
0.0884226
0.0875743
0.0873073
0.0876409
0.0885376
0.0899616
0.0918348
0.0940274
0.0963479
0.0986478
0.100812
0.10273
0.104348
0.10565
0.106599
0.107116
0.107139
0.106676
0.105763
0.104422
0.102622
0.100331
0.0976269
0.0947535
0.0919926
0.0894242
0.0869024
0.0842646
0.0814419
0.0784317
0.0752846
0.0720969
0.0689668
0.0659529
0.0630425
0.0601424
0.057116
0.0538489
0.0503175
0.0466188
0.0428942
0.0392407
0.0357638
0.0326263
0.0299433
0.0277033
0.0258225
0.0242156
0.0228157
0.021571
0.0204375
0.0193777
0.0183697
0.0174102
0.0165059
0.0156488
0.0148212
0.014023
0.0132073
0.0123627
0.0114862
0.0105679
0.00958927
0.00852887
0.00737853
0.00622708
0.00520131
0.00443604
0.0037568
0.00311273
0.00249521
0.00193376
0.00136331
0.000746311
0.000129485
0.239664
0.0947415
0.152962
0.147861
0.151882
0.158336
0.161212
0.161008
0.159103
0.156276
0.152782
0.148701
0.144154
0.139204
0.133968
0.128586
0.123133
0.117673
0.112366
0.107368
0.102818
0.0987489
0.0952378
0.0923552
0.0901498
0.0886911
0.0878955
0.0877064
0.0881468
0.0891744
0.0907463
0.0927715
0.0951006
0.0975424
0.0999531
0.102219
0.104229
0.105925
0.107289
0.108286
0.108841
0.10889
0.108441
0.107538
0.106208
0.104411
0.102098
0.0993289
0.0963368
0.0934114
0.0906711
0.0880102
0.08528
0.0824029
0.0793562
0.0761683
0.0729225
0.0697138
0.0666053
0.063596
0.0606073
0.0575102
0.0541875
0.050602
0.0468341
0.0430224
0.0392747
0.0357087
0.0324955
0.029754
0.0274778
0.0255896
0.0240076
0.0226617
0.0214884
0.0204279
0.0194281
0.0184588
0.0175146
0.0166005
0.0157114
0.0148512
0.0139965
0.013126
0.0122402
0.0113363
0.0103962
0.0093927
0.00830275
0.00712951
0.00600232
0.00501394
0.0042743
0.00361595
0.00297973
0.00236599
0.00182274
0.00127495
0.000710561
0.000121096
0.243505
0.0863001
0.155533
0.147411
0.152098
0.159247
0.162284
0.162057
0.160121
0.157278
0.153769
0.149656
0.145058
0.14003
0.134706
0.129237
0.123709
0.118184
0.112813
0.107753
0.103146
0.0990285
0.0954816
0.0925783
0.0903748
0.0889452
0.0882076
0.0881051
0.0886616
0.089829
0.091555
0.0937349
0.096201
0.098767
0.101289
0.103654
0.105756
0.107532
0.108961
0.110012
0.110609
0.110686
0.110254
0.109362
0.108042
0.106248
0.10391
0.101072
0.0979555
0.0948584
0.0919355
0.0891244
0.0862942
0.0833601
0.080279
0.0770549
0.0737543
0.0704667
0.0672582
0.0641403
0.0610506
0.0578724
0.0544898
0.0508545
0.0470281
0.0431415
0.0393124
0.0356694
0.0323868
0.0295859
0.0272676
0.0253638
0.0237997
0.0225029
0.0213979
0.0204077
0.019466
0.0185344
0.0176043
0.0166784
0.015757
0.014861
0.0139524
0.0130352
0.0121157
0.011185
0.0102171
0.00918086
0.00805931
0.00687484
0.00579514
0.00483668
0.00412285
0.00346959
0.00282366
0.0022217
0.00169625
0.00120601
0.000684907
0.000111208
0.247436
0.0771516
0.158808
0.146803
0.152342
0.160233
0.163406
0.163136
0.161162
0.158299
0.154775
0.15063
0.145976
0.140864
0.135449
0.129888
0.124284
0.118694
0.113261
0.108138
0.10347
0.0993007
0.0957128
0.0927846
0.0905818
0.089183
0.0885097
0.0885038
0.0891867
0.0905026
0.0923888
0.0947263
0.0973305
0.10002
0.102654
0.10512
0.107314
0.109172
0.11067
0.111779
0.112424
0.112533
0.11212
0.11124
0.109928
0.108132
0.105765
0.102853
0.0996079
0.0963328
0.0932186
0.0902472
0.0873092
0.0843141
0.0811984
0.0779405
0.0745873
0.0712202
0.0679073
0.064672
0.0614701
0.0582012
0.0547546
0.0510736
0.0472001
0.0432524
0.0393557
0.0356481
0.0323032
0.0294429
0.0270771
0.0251501
0.0235961
0.0223415
0.0212982
0.0203724
0.0194842
0.0185879
0.0176708
0.0167328
0.0157839
0.0148527
0.0138974
0.0129429
0.0119935
0.0110317
0.0100275
0.00895432
0.00780633
0.00662739
0.00558587
0.00466633
0.00396575
0.00330337
0.0026487
0.00206688
0.00157116
0.00111558
0.000667306
0.000100544
0.251411
0.0672691
0.162883
0.145987
0.152621
0.161299
0.164578
0.164243
0.162223
0.15934
0.155801
0.151623
0.146907
0.141707
0.136195
0.130539
0.124857
0.119204
0.113708
0.108522
0.10379
0.0995641
0.0959297
0.092972
0.0907685
0.0894026
0.0888006
0.0889022
0.0897224
0.0911957
0.0932481
0.0957463
0.0984906
0.101303
0.104048
0.106615
0.108903
0.110845
0.112416
0.113591
0.114292
0.114437
0.114046
0.113177
0.111868
0.110064
0.107663
0.104672
0.101293
0.0978354
0.0945228
0.0913824
0.0883282
0.085266
0.0821129
0.0788211
0.075416
0.0719685
0.0685475
0.0651874
0.0618639
0.0584953
0.0549807
0.0512574
0.0473479
0.0433541
0.0394043
0.0356445
0.0322446
0.0293257
0.0269084
0.0249514
0.0233991
0.0221775
0.0211861
0.0203156
0.0194746
0.0186107
0.0177066
0.0167591
0.0157918
0.014831
0.0138395
0.0128549
0.0118746
0.0108734
0.00982593
0.00871817
0.00755582
0.00639768
0.0053745
0.00449453
0.00378896
0.00310768
0.00245704
0.00190557
0.00145354
0.00103626
0.000646718
8.1302e-05
0.25545
0.0566463
0.167838
0.144902
0.152947
0.162454
0.1658
0.165379
0.163307
0.160402
0.156846
0.152634
0.147853
0.142558
0.136944
0.131192
0.12543
0.119712
0.114155
0.108904
0.104105
0.0998176
0.0961311
0.093139
0.0909332
0.0896024
0.0890794
0.0893
0.0902684
0.0919078
0.0941318
0.0967942
0.0996814
0.102617
0.105473
0.108141
0.110524
0.112554
0.114202
0.115447
0.116213
0.116402
0.116037
0.115179
0.113867
0.112047
0.109603
0.106527
0.103011
0.0993681
0.095852
0.0925349
0.0893559
0.0862183
0.083022
0.0796935
0.0762354
0.0727063
0.069174
0.0656836
0.0622306
0.0587551
0.0551682
0.0514046
0.0474689
0.0434442
0.0394566
0.0356565
0.0322085
0.0292325
0.0267608
0.0247681
0.0232088
0.0220086
0.0210564
0.0202298
0.0194284
0.0185946
0.0177051
0.0167546
0.0157817
0.014801
0.0137842
0.0127724
0.0117552
0.0107061
0.0096136
0.00848056
0.007319
0.0061891
0.00517467
0.00431504
0.00359783
0.00290699
0.00227042
0.00176363
0.00136044
0.000982632
0.000600748
4.41931e-05
0.259451
0.0452952
0.173758
0.143476
0.153336
0.163703
0.167071
0.166543
0.164412
0.161485
0.157913
0.153664
0.148813
0.143418
0.137696
0.131845
0.126002
0.120221
0.114601
0.109284
0.104414
0.100061
0.0963163
0.0932848
0.0910748
0.0897816
0.0893456
0.089697
0.0908243
0.0926377
0.0950382
0.097868
0.100902
0.103962
0.106928
0.109696
0.112177
0.114298
0.11603
0.117352
0.11819
0.118431
0.118095
0.117248
0.115928
0.114082
0.111586
0.10842
0.104764
0.100934
0.0972113
0.0937108
0.0903973
0.0871741
0.0839257
0.0805553
0.0770415
0.0734291
0.0697834
0.0661588
0.0625709
0.0589824
0.0553193
0.0515157
0.0475613
0.0435198
0.0395094
0.0356802
0.0321906
0.0291596
0.0266324
0.0245992
0.0230236
0.0218311
0.0209029
0.0201071
0.0193378
0.0185328
0.017662
0.0167189
0.0157555
0.014766
0.0137319
0.0126908
0.0116277
0.0105258
0.00939405
0.00824974
0.00710061
0.00599384
0.00497236
0.00412369
0.00340303
0.00272332
0.00211319
0.00164458
0.00127347
0.000913978
0.000519055
1.02619e-05
0.263389
0.0332415
0.180721
0.141627
0.153808
0.165054
0.168391
0.167731
0.165539
0.16259
0.159
0.154713
0.149788
0.144287
0.138451
0.132499
0.126574
0.120729
0.115046
0.109661
0.104717
0.100293
0.0964849
0.0934089
0.0911932
0.0899405
0.0895996
0.0900934
0.0913899
0.0933843
0.0959652
0.0989653
0.102149
0.105337
0.108412
0.111282
0.113862
0.116079
0.117903
0.119311
0.120223
0.120522
0.120222
0.119387
0.118052
0.116168
0.113611
0.110349
0.106552
0.102536
0.0986057
0.0949159
0.0914578
0.0881363
0.0848246
0.0814044
0.077831
0.0741335
0.0703733
0.0666128
0.0628869
0.0591812
0.0554381
0.0515938
0.0476254
0.0435784
0.0395588
0.035711
0.0321861
0.029103
0.0265204
0.0244428
0.022841
0.0216407
0.0207196
0.0199412
0.0191973
0.0184213
0.0175756
0.016654
0.0157149
0.0147265
0.0136779
0.0126002
0.0114827
0.0103301
0.00917195
0.00803021
0.00689613
0.00579705
0.0047589
0.00393333
0.00322125
0.0025396
0.00198825
0.00153296
0.00115905
0.000788735
0.000435696
-2.39104e-05
0.267237
0.0205764
0.18878
0.139264
0.154393
0.166515
0.169757
0.168942
0.166685
0.163717
0.160111
0.155781
0.150777
0.145165
0.13921
0.133153
0.127147
0.121237
0.115491
0.110036
0.105013
0.100515
0.0966367
0.0935115
0.0912887
0.0900801
0.0898426
0.0904901
0.0919652
0.0941466
0.096911
0.100084
0.103422
0.10674
0.109926
0.112898
0.115578
0.117898
0.119822
0.121325
0.122317
0.122675
0.122418
0.121595
0.120239
0.118307
0.115678
0.112314
0.108376
0.104177
0.10004
0.0961554
0.0925413
0.0891073
0.0857185
0.0822391
0.0786009
0.0748167
0.0709421
0.0670462
0.0631816
0.0593566
0.0555305
0.0516434
0.0476634
0.043619
0.039601
0.0357438
0.0321899
0.0290589
0.026422
0.0242967
0.0226583
0.0214338
0.0205022
0.0197288
0.0190055
0.0182607
0.0174486
0.0165642
0.0156618
0.0146796
0.0136132
0.0124891
0.0113132
0.0101196
0.00895073
0.00781925
0.00669239
0.00559235
0.00455599
0.00375051
0.00306063
0.00240117
0.00187949
0.00140401
0.00100042
0.000636016
0.000358093
-4.66241e-05
0.270973
0.00737748
0.197978
0.136288
0.155126
0.168093
0.171166
0.170174
0.16785
0.164866
0.161244
0.15687
0.151781
0.14605
0.139972
0.133807
0.127718
0.121745
0.115935
0.110407
0.105303
0.100724
0.0967712
0.0935923
0.0913618
0.0902014
0.0900762
0.0908883
0.0925507
0.0949241
0.0978746
0.101223
0.10472
0.10817
0.111469
0.114544
0.117329
0.119757
0.121789
0.123396
0.12447
0.124894
0.124684
0.123872
0.122489
0.120497
0.117786
0.114314
0.110235
0.105857
0.101515
0.0974324
0.0936503
0.0900876
0.0866065
0.0830566
0.0793479
0.0754753
0.071488
0.0674596
0.0634583
0.0595137
0.055602
0.0516693
0.0476777
0.0436409
0.0396326
0.0357738
0.0321976
0.0290236
0.0263347
0.0241583
0.0224728
0.0212074
0.0202484
0.0194694
0.0187646
0.0180553
0.0172865
0.0164551
0.0155967
0.0146201
0.0135266
0.0123476
0.0111163
0.00989611
0.00872928
0.00761045
0.00648726
0.00539445
0.00435727
0.00358671
0.0029262
0.00231275
0.00176756
0.00124766
0.000807813
0.00046545
0.000314615
-6.67679e-05
0.27455
-0.00624461
0.208333
0.132589
0.156055
0.169794
0.172615
0.171423
0.169033
0.166035
0.162401
0.157981
0.152799
0.146944
0.140735
0.134459
0.128289
0.122253
0.116377
0.110774
0.105586
0.100922
0.0968876
0.0936508
0.0914126
0.0903057
0.0903018
0.0912895
0.0931471
0.0957166
0.0988551
0.102382
0.106041
0.109629
0.113043
0.116223
0.119116
0.121657
0.123805
0.125522
0.126683
0.127182
0.127023
0.126221
0.124801
0.122738
0.119933
0.116348
0.112129
0.107577
0.103034
0.0987478
0.0947852
0.0910767
0.0874865
0.0838539
0.0800679
0.0761059
0.0720086
0.0678526
0.063719
0.0596566
0.0556573
0.0516754
0.0476702
0.0436431
0.0396498
0.0357962
0.0322043
0.0289934
0.0262551
0.0240244
0.0222814
0.0209593
0.0199579
0.0191656
0.01848
0.0178122
0.0170965
0.0163329
0.0155179
0.01454
0.0134072
0.01217
0.0108962
0.00966903
0.00851291
0.00740334
0.00626628
0.00518347
0.00417197
0.00345275
0.00281783
0.00223317
0.00164528
0.00108126
0.000608729
0.000290663
0.000252762
-8.70083e-05
0.277789
-0.0201512
0.219852
0.128046
0.15724
0.171623
0.1741
0.172688
0.170231
0.167224
0.163581
0.159112
0.153833
0.147846
0.1415
0.13511
0.128857
0.122759
0.116817
0.111137
0.10586
0.101106
0.0969848
0.093686
0.0914408
0.0903937
0.0905209
0.0916947
0.093755
0.0965239
0.0998523
0.10356
0.107386
0.111117
0.114649
0.117938
0.120942
0.123601
0.125871
0.127705
0.128963
0.129543
0.129438
0.128642
0.127177
0.125029
0.122119
0.118416
0.114058
0.109336
0.104595
0.100101
0.0959443
0.0920725
0.0883558
0.0846274
0.080757
0.0767043
0.072501
0.0682242
0.063965
0.0597879
0.0556999
0.0516642
0.0476417
0.0436238
0.0396485
0.0358053
0.0322046
0.0289635
0.0261789
0.0238906
0.0220803
0.0206882
0.0196323
0.0188218
0.0181585
0.0175391
0.0168856
0.0161994
0.0154208
0.0144297
0.0132471
0.0119632
0.0106709
0.00943473
0.00828467
0.00716788
0.00601647
0.00495361
0.00401611
0.00335585
0.00277187
0.00216124
0.00151224
0.000914765
0.000438388
0.000157602
0.000179018
-0.000122941
0.280719
-0.0341898
0.232507
0.122543
0.158753
0.173583
0.175617
0.173965
0.171444
0.168434
0.164784
0.160265
0.154882
0.148755
0.142266
0.135758
0.129423
0.123262
0.117252
0.111493
0.106125
0.101275
0.0970609
0.0936967
0.0914461
0.0904658
0.0907341
0.0921048
0.0943745
0.0973458
0.100865
0.104757
0.108755
0.112634
0.116291
0.119692
0.122812
0.125593
0.12799
0.129946
0.131313
0.131982
0.131931
0.131139
0.129619
0.127374
0.124347
0.120518
0.116023
0.111136
0.106198
0.101489
0.0971252
0.0930726
0.0892122
0.0853744
0.0814121
0.0772673
0.0729623
0.0685728
0.0641961
0.059909
0.0557315
0.0516374
0.0475921
0.0435808
0.0396241
0.0357952
0.0321921
0.0289275
0.0260999
0.0237513
0.0218659
0.0203937
0.0192753
0.0184445
0.0178078
0.0172441
0.016661
0.0160491
0.0152981
0.0142797
0.0130472
0.0117453
0.0104225
0.00917706
0.00802299
0.00688939
0.00574741
0.00472099
0.00389143
0.00327313
0.00272534
0.00206471
0.00139258
0.00080999
0.0003364
7.64567e-05
9.75756e-05
-0.000148057
0.283188
-0.0481499
0.246272
0.11598
0.160688
0.175674
0.177161
0.175252
0.172671
0.169664
0.166011
0.16144
0.155946
0.149671
0.143032
0.136403
0.129986
0.123762
0.117683
0.11184
0.106378
0.101427
0.0971139
0.0936811
0.0914274
0.090522
0.0909417
0.0925198
0.0950052
0.0981809
0.101892
0.105969
0.110145
0.114182
0.117971
0.121489
0.12473
0.127638
0.130166
0.132249
0.133735
0.1345
0.134506
0.133714
0.132131
0.129776
0.126619
0.122659
0.118025
0.112975
0.10784
0.10291
0.0983252
0.0940749
0.0900541
0.0860933
0.082031
0.0777925
0.0733905
0.0688972
0.0644122
0.0600206
0.0557533
0.0515959
0.0475214
0.0435122
0.0395725
0.0357601
0.03216
0.0288784
0.0260113
0.0236006
0.0216349
0.0200774
0.0188934
0.0180422
0.0174357
0.0169338
0.016425
0.0158763
0.0151416
0.0140841
0.0128226
0.0114945
0.0101387
0.00887907
0.00771067
0.00656939
0.00547931
0.00452653
0.00379219
0.00318639
0.00262515
0.00196959
0.00131281
0.000766859
0.000293946
-2.97527e-06
1.76423e-05
-0.000158326
0.285055
-0.0618528
0.260574
0.108256
0.163157
0.177888
0.178724
0.176548
0.173912
0.170915
0.167261
0.162636
0.157025
0.150594
0.143797
0.137045
0.130547
0.124259
0.118107
0.112178
0.106618
0.101559
0.0971416
0.0936374
0.0913836
0.0905623
0.091144
0.0929395
0.0956458
0.0990268
0.102929
0.107193
0.111553
0.115758
0.11969
0.123334
0.126702
0.12974
0.132403
0.134617
0.136229
0.137096
0.137161
0.136367
0.134716
0.13224
0.128941
0.124843
0.120069
0.114857
0.109522
0.104361
0.099542
0.0950779
0.0908808
0.0867837
0.0826131
0.0782792
0.0737847
0.0691966
0.0646126
0.0601227
0.055766
0.0515404
0.0474299
0.0434167
0.0394907
0.0356951
0.0321019
0.0288089
0.025906
0.0234331
0.0213856
0.0197431
0.0184955
0.0176253
0.0170496
0.016613
0.0161733
0.0156755
0.0149435
0.013841
0.0125695
0.011196
0.00980498
0.00852337
0.00734165
0.0062199
0.00522871
0.00437334
0.00369936
0.00310313
0.00256378
0.00189914
0.00126998
0.000751145
0.000299345
-8.53448e-05
-3.74124e-05
-0.000159913
0.28634
-0.0750849
0.275554
0.0992896
0.166294
0.180214
0.1803
0.17785
0.175167
0.172187
0.168537
0.163855
0.158119
0.151523
0.144562
0.137682
0.131104
0.124753
0.118524
0.112504
0.106842
0.101671
0.0971425
0.0935643
0.0913141
0.0905868
0.0913412
0.0933637
0.0962949
0.0998809
0.103973
0.108425
0.112976
0.117361
0.12145
0.12523
0.128732
0.131904
0.134706
0.137055
0.138793
0.139768
0.139896
0.1391
0.137377
0.134771
0.131319
0.127075
0.122157
0.11678
0.111241
0.105841
0.100773
0.0960805
0.0916925
0.0874461
0.0831588
0.0787272
0.0741445
0.0694703
0.0647969
0.060215
0.0557699
0.051472
0.0473181
0.0432939
0.0393766
0.0355967
0.0320124
0.0287125
0.0257777
0.0232448
0.0211183
0.0193966
0.0180923
0.017205
0.0166571
0.016284
0.0159046
0.0154433
0.0146985
0.0135557
0.0122699
0.0108337
0.00940544
0.0081013
0.00692348
0.00585577
0.00499875
0.00423894
0.00360109
0.0030331
0.002521
0.00186585
0.00125452
0.000747003
0.000343102
-9.05097e-05
-6.28861e-05
-0.000115813
0.28678
-0.0876365
0.290953
0.0890253
0.170248
0.182629
0.181881
0.179157
0.176436
0.173481
0.169838
0.165098
0.159227
0.15246
0.145325
0.138314
0.131657
0.125244
0.118934
0.112818
0.10705
0.10176
0.0971154
0.0934609
0.0912187
0.0905962
0.0915342
0.0937931
0.0969519
0.100741
0.105021
0.109662
0.114411
0.118989
0.12325
0.127179
0.130824
0.134133
0.137076
0.139564
0.141428
0.142513
0.142706
0.14191
0.140114
0.137372
0.133758
0.129359
0.124294
0.118746
0.112995
0.107345
0.102016
0.097081
0.0924895
0.0880819
0.0836689
0.0791366
0.0744693
0.0697171
0.0649632
0.0602963
0.0557646
0.0513909
0.0471869
0.0431441
0.039229
0.0354615
0.0318866
0.0285834
0.025621
0.0230327
0.0208343
0.0190445
0.0176944
0.0167929
0.0162657
0.0159482
0.0156202
0.0151783
0.0144039
0.0132302
0.0119032
0.0103925
0.00893338
0.0076189
0.00647074
0.00548821
0.00477976
0.00409584
0.00348865
0.00297628
0.00248709
0.001866
0.00126272
0.000746881
0.000426164
-1.46059e-05
-6.07663e-05
-0.000129058
0.286432
-0.0992842
0.307607
0.0773875
0.175194
0.185102
0.183462
0.180467
0.177721
0.174799
0.171168
0.166366
0.160351
0.153404
0.146089
0.138943
0.132205
0.125731
0.119338
0.113119
0.107242
0.101826
0.0970599
0.0933272
0.0910978
0.0905918
0.0917245
0.0942291
0.097617
0.101606
0.106071
0.110902
0.115855
0.120642
0.125091
0.129184
0.13298
0.136428
0.139515
0.142142
0.144131
0.145331
0.145592
0.144797
0.142927
0.140047
0.136263
0.131701
0.126479
0.120753
0.114778
0.108867
0.103264
0.0980774
0.0932722
0.0886926
0.084145
0.079508
0.0747581
0.0699346
0.0651085
0.0603637
0.0557485
0.0512972
0.047037
0.0429676
0.0390467
0.0352866
0.0317194
0.0284151
0.0254302
0.0227942
0.0205361
0.0186935
0.0173115
0.0163993
0.0158839
0.0156078
0.0153236
0.0148807
0.0140577
0.0128608
0.0114499
0.00986794
0.00839474
0.00708845
0.00599182
0.00511666
0.00455207
0.00392279
0.00337459
0.0029529
0.0024862
0.00189518
0.0012854
0.000755948
0.000494909
3.88606e-05
9.60959e-07
-0.000140467
0.285231
-0.109855
0.320902
0.0643631
0.181251
0.187551
0.185007
0.181758
0.179005
0.176129
0.172516
0.167653
0.161487
0.154351
0.146851
0.139566
0.132749
0.126211
0.119732
0.113408
0.107416
0.101868
0.0969751
0.0931625
0.0909514
0.0905745
0.0919131
0.0946735
0.0982915
0.102476
0.107123
0.112143
0.117309
0.12232
0.126978
0.131248
0.135204
0.13879
0.142017
0.144783
0.146906
0.148224
0.148554
0.147761
0.14582
0.1428
0.138839
0.134104
0.128716
0.122796
0.116584
0.110397
0.104513
0.0990663
0.0940408
0.0892804
0.084589
0.0798418
0.0750094
0.0701192
0.065228
0.0604132
0.0557189
0.0511899
0.0468688
0.0427647
0.0388288
0.035069
0.0315053
0.028201
0.0251994
0.0225268
0.0202258
0.0183498
0.0169512
0.0160332
0.0155212
0.0152683
0.0150198
0.0145516
0.0136643
0.0124294
0.0109003
0.00926989
0.00779916
0.00651244
0.00548975
0.00473493
0.00429421
0.00371348
0.00326074
0.00296685
0.00251311
0.00195161
0.00131779
0.000785353
0.000571041
0.000116144
3.78921e-05
-0.000167932
0.282993
-0.118925
0.344366
0.0511553
0.189471
0.190299
0.18676
0.183228
0.180459
0.177605
0.173987
0.16904
0.162694
0.155339
0.147635
0.140202
0.1333
0.126695
0.120124
0.113687
0.107576
0.10189
0.0968652
0.0929717
0.0907849
0.0905506
0.0921062
0.0951325
0.09898
0.103354
0.108177
0.113388
0.118775
0.124028
0.128916
0.133379
0.1375
0.141219
0.144583
0.147493
0.149755
0.151195
0.151594
0.150806
0.148798
0.145639
0.141495
0.136578
0.131006
0.124874
0.118405
0.11193
0.105755
0.100046
0.094797
0.0898488
0.0850041
0.0801391
0.0752213
0.0702665
0.0653158
0.0604391
0.0556721
0.0510674
0.0466822
0.0425358
0.0385743
0.0348054
0.0312388
0.0279343
0.0249225
0.022228
0.0199061
0.018019
0.0166201
0.0157022
0.0151875
0.0149391
0.0147114
0.0141914
0.0132432
0.0118972
0.0102684
0.00861158
0.00714759
0.005898
0.00497253
0.00434444
0.00399531
0.00350385
0.00315513
0.00298382
0.00250579
0.00199539
0.00137217
0.000826694
0.000624401
0.000167504
8.06218e-05
-0.000185807
0.279397
-0.127051
0.345812
0.0258638
0.189716
0.188803
0.186559
0.183578
0.18087
0.178143
0.174689
0.169807
0.163418
0.155964
0.148148
0.140636
0.133699
0.127055
0.120408
0.113866
0.107642
0.101821
0.096667
0.0926962
0.0905418
0.0904686
0.092256
0.0955622
0.0996419
0.104202
0.1092
0.114604
0.120224
0.125741
0.130881
0.135553
0.139847
0.143689
0.147185
0.150248
0.152656
0.154217
0.154686
0.153907
0.151837
0.148543
0.144211
0.139099
0.133324
0.126955
0.12021
0.113434
0.106968
0.101002
0.0955339
0.0903962
0.0853903
0.0803983
0.0753895
0.0703693
0.065363
0.0604333
0.0556016
0.0509254
0.0464749
0.0422792
0.0382806
0.0344906
0.0309117
0.0276053
0.0245905
0.0218922
0.0195759
0.0177032
0.0163209
0.0154116
0.0148929
0.0146329
0.0143906
0.0138082
0.0127799
0.0112718
0.00957725
0.00789518
0.00644695
0.00526886
0.00444396
0.00393147
0.00365345
0.00329835
0.00306057
0.00299225
0.00246859
0.00203975
0.00143848
0.000966549
0.00075074
0.000362326
0.000285619
-8.06558e-05
0.277524
-0.123376
0.383349
0.0336425
0.230739
0.215226
0.208631
0.201868
0.195981
0.19046
0.184681
0.17795
0.16997
0.161099
0.15213
0.143715
0.136116
0.128983
0.121935
0.115054
0.10854
0.102446
0.0970652
0.0929474
0.090785
0.09084
0.0928287
0.096389
0.100659
0.10536
0.110494
0.116069
0.121923
0.127726
0.13315
0.138053
0.142529
0.146485
0.150096
0.153303
0.155849
0.157527
0.158067
0.157302
0.15518
0.151757
0.147229
0.1419
0.135891
0.129244
0.122179
0.11507
0.10829
0.102049
0.0963446
0.0909943
0.0858012
0.0806589
0.0755427
0.070449
0.0653869
0.0604122
0.055525
0.0507838
0.0462682
0.0420166
0.0379683
0.0341435
0.0305419
0.0272326
0.0242248
0.0215449
0.019264
0.0174294
0.0160753
0.0151771
0.0146506
0.0143597
0.0140456
0.0134406
0.0122383
0.0105855
0.00883561
0.00713103
0.00572648
0.00462871
0.00389938
0.00348863
0.00327726
0.00308218
0.00296557
0.0029528
0.00241427
0.00206671
0.00142566
0.000978366
0.00073655
0.000349809
0.000213076
-0.000364417
0.254449
-0.158103
0.367978
-0.0255593
0.190224
0.16993
0.166292
0.162637
0.160023
0.157778
0.155153
0.151233
0.145735
0.139238
0.132591
0.126535
0.121235
0.116212
0.110971
0.105595
0.100345
0.0952805
0.090795
0.0875021
0.0861801
0.0871528
0.0900424
0.0944116
0.0992902
0.104449
0.109965
0.115898
0.122106
0.128257
0.133969
0.139067
0.143681
0.147714
0.151446
0.154836
0.157574
0.159413
0.160056
0.15933
0.15719
0.153691
0.14902
0.143516
0.137298
0.130398
0.123063
0.115693
0.108701
0.10231
0.096498
0.091047
0.0857507
0.0805134
0.075325
0.0701829
0.0650877
0.0600952
0.0551778
0.0503931
0.0458285
0.0415297
0.0374296
0.0335562
0.029916
0.0265984
0.0236041
0.0209634
0.0187487
0.0169904
0.0157101
0.014874
0.0143837
0.0140942
0.0137276
0.0130472
0.0116447
0.00982975
0.00801488
0.00629452
0.00493748
0.00391667
0.00326946
0.00295013
0.00283802
0.00286152
0.00286394
0.00281385
0.00234744
0.00207035
0.0016079
0.00116456
0.00105497
0.000666027
0.000638434
-0.000192973
0.288723
-0.110001
0.415597
0.00707601
0.269034
0.230982
0.225328
0.219464
0.215026
0.211131
0.206795
0.201086
0.193815
0.185522
0.177033
0.169091
0.161924
0.155028
0.147949
0.140773
0.133801
0.127074
0.120997
0.11625
0.113699
0.113618
0.115522
0.119003
0.122936
0.127134
0.131734
0.136828
0.142339
0.147892
0.153044
0.157617
0.161749
0.165213
0.168324
0.171088
0.17318
0.174351
0.174352
0.172992
0.170196
0.16601
0.16059
0.154319
0.147327
0.13963
0.131435
0.123249
0.115536
0.10848
0.102026
0.0959366
0.0900236
0.0842312
0.0785772
0.0730571
0.0676522
0.0624126
0.0572709
0.0522655
0.047477
0.0429501
0.0386229
0.0345862
0.0308126
0.0273989
0.0243504
0.0217068
0.0195323
0.0177825
0.0164689
0.0155536
0.0149449
0.0144423
0.0137462
0.0127495
0.0112202
0.00931647
0.00748394
0.00576279
0.00446924
0.00352533
0.0029482
0.0027288
0.0026716
0.00277084
0.00280181
0.00263751
0.00225207
0.00197826
0.00172316
0.00148388
0.00128785
0.000909102
0.00119301
-0.000664064
0.218361
-0.172512
0.393769
-0.0686682
0.222053
0.169355
0.165052
0.15889
0.154342
0.150229
0.145744
0.140009
0.132748
0.124516
0.116436
0.109262
0.103085
0.0972693
0.0913316
0.0853642
0.0796707
0.0742911
0.0696098
0.0662921
0.0652059
0.0667845
0.0702905
0.0753352
0.0807077
0.0862937
0.0922737
0.0987652
0.105698
0.112715
0.119311
0.125162
0.130373
0.134776
0.138958
0.142909
0.146235
0.148657
0.14982
0.149521
0.14773
0.144506
0.13993
0.134346
0.127875
0.12059
0.112826
0.105144
0.0980028
0.0915928
0.0857952
0.0803033
0.0749242
0.0696451
0.0645384
0.0596324
0.054926
0.0504633
0.046079
0.0417978
0.0376786
0.0337729
0.0300128
0.026365
0.023001
0.0201213
0.0176683
0.015662
0.0140203
0.0127084
0.0117743
0.0111886
0.010855
0.0105674
0.0100194
0.0089989
0.00735734
0.00546601
0.00373698
0.00217529
0.00119152
0.000572357
0.000293342
0.000301572
0.000653773
0.00121014
0.0017579
0.0011118
0.000779181
0.000633516
0.000722245
0.000711539
0.000582195
-0.000196705
-0.000631305
-0.00173588
0.260833
-0.116254
0.43073
-0.0389986
0.283259
0.216703
0.213299
0.2078
0.204539
0.202003
0.198925
0.194116
0.187461
0.179742
0.171922
0.164749
0.158358
0.15208
0.145438
0.138527
0.131706
0.125029
0.118925
0.114166
0.111784
0.112181
0.114882
0.119361
0.124079
0.128882
0.134049
0.139764
0.14599
0.152362
0.158301
0.163502
0.167992
0.171518
0.174806
0.177996
0.180606
0.182228
0.182535
0.181325
0.178583
0.174459
0.169001
0.162554
0.155235
0.147086
0.138497
0.129924
0.121954
0.114807
0.108352
0.102268
0.096335
0.0905051
0.0848014
0.0792081
0.0736758
0.0682844
0.0629692
0.0577689
0.0527666
0.0480017
0.0433326
0.0389048
0.0347245
0.0310112
0.0277682
0.0249981
0.02268
0.0208166
0.0194599
0.0186569
0.0182902
0.0180527
0.0175259
0.0164874
0.0146934
0.0124451
0.010316
0.00833969
0.0069052
0.00576929
0.00487041
0.00453899
0.00449885
0.00464202
0.00473438
0.00435192
0.00384317
0.00331735
0.00296233
0.002646
0.00217846
0.00181595
0.0027939
0.00033588
0.223018
-0.135734
0.426784
-0.0939965
0.29599
0.193854
0.195788
0.188647
0.184099
0.18003
0.175432
0.169287
0.161351
0.152157
0.143159
0.135199
0.128257
0.121513
0.114551
0.107526
0.100707
0.0941736
0.0884079
0.0842055
0.0826652
0.0845135
0.0881257
0.0931732
0.0982044
0.103446
0.109213
0.115638
0.12275
0.130066
0.136845
0.142565
0.147559
0.151567
0.155563
0.15947
0.162638
0.164712
0.165356
0.164395
0.161833
0.15776
0.152237
0.145481
0.137646
0.128976
0.119804
0.111053
0.103262
0.0964412
0.0902511
0.0842725
0.0783543
0.0725574
0.0669809
0.0616224
0.0564858
0.05172
0.0469624
0.0423046
0.0378124
0.0335061
0.0293402
0.0253611
0.0218156
0.0188671
0.0164458
0.0145306
0.0130573
0.0120151
0.0114601
0.0112825
0.0112507
0.0110784
0.0103842
0.0090216
0.00684739
0.00454598
0.00258894
0.00109343
0.000472778
5.82943e-06
-0.000111302
0.000425736
0.000937521
0.0012739
0.00118522
0.00096997
0.000841756
0.000866565
0.000923977
0.000737829
0.000407691
0.000276199
-0.000899537
-0.00346323
0.16694
-0.169792
0.430125
-0.110447
0.273649
0.175624
0.169168
0.162203
0.15859
0.155611
0.151907
0.146253
0.138693
0.130161
0.122029
0.115076
0.109167
0.10333
0.0971139
0.0906561
0.0843593
0.0784026
0.0731693
0.0694001
0.0681767
0.0696195
0.0737261
0.0799295
0.0859983
0.0918298
0.0979001
0.104578
0.111956
0.119756
0.1273
0.13426
0.139967
0.144015
0.147958
0.152091
0.155716
0.158301
0.159327
0.15864
0.156381
0.152689
0.147486
0.140746
0.132636
0.12354
0.114094
0.105056
0.0972273
0.0906611
0.0848857
0.0793139
0.0737044
0.0681448
0.0628224
0.0578151
0.0530553
0.0485041
0.0440555
0.0396591
0.0353469
0.0311729
0.0270947
0.0230893
0.0195033
0.0165567
0.014158
0.0121997
0.0106211
0.00948635
0.00889066
0.00884178
0.00916185
0.00952656
0.00959271
0.00909603
0.00749729
0.00529236
0.00351551
0.00187418
0.000980127
0.000563905
0.000497613
0.000721315
0.00145571
0.00190978
0.00180038
0.00165366
0.00161747
0.00147186
0.00122043
0.00126098
0.001334
0.00122937
0.00155341
0.00125032
0.393153
-0.0582024
0.492744
-0.031402
0.336872
0.301883
0.291308
0.277619
0.269537
0.264882
0.261194
0.256175
0.248497
0.2384
0.227372
0.216798
0.207326
0.198318
0.189167
0.179615
0.169835
0.159969
0.150211
0.141113
0.13402
0.131138
0.131019
0.134209
0.138416
0.142502
0.146522
0.151009
0.156498
0.163143
0.170218
0.176426
0.182386
0.185873
0.187957
0.190392
0.193173
0.195693
0.19735
0.197454
0.195687
0.192276
0.187558
0.181668
0.174482
0.165836
0.155673
0.144748
0.134354
0.125528
0.118229
0.111777
0.10551
0.099148
0.0926848
0.0862175
0.0798362
0.0736186
0.0675368
0.061591
0.0558069
0.0502554
0.044863
0.0394447
0.0339777
0.0286798
0.0238274
0.0195639
0.0158925
0.0127899
0.0104801
0.00923543
0.00923895
0.0103681
0.0118253
0.0134313
0.0140282
0.013428
0.0122532
0.0105385
0.00841806
0.00645751
0.00507124
0.00418518
0.00423508
0.00457653
0.00461838
0.0044225
0.0039358
0.00357326
0.00334433
0.00267736
0.00175483
0.000486187
-0.000168057
-0.000281065
0.0783514
-0.217568
0.379479
-0.11754
0.114903
0.124557
0.133785
0.127848
0.121758
0.118673
0.117514
0.116227
0.112808
0.106417
0.0987718
0.0924375
0.0878666
0.0838639
0.0797166
0.0751727
0.0702778
0.0652463
0.0601161
0.0549043
0.0500896
0.0483567
0.0502919
0.0548776
0.0613989
0.068398
0.075033
0.0813805
0.0881498
0.0961213
0.105672
0.115253
0.123885
0.131417
0.137723
0.143469
0.149309
0.155092
0.16024
0.164075
0.166085
0.166012
0.163887
0.159874
0.154159
0.146891
0.138054
0.127799
0.116875
0.10719
0.0993334
0.0928487
0.0869283
0.0810871
0.0752866
0.0696942
0.0644155
0.0594263
0.0546039
0.049835
0.045079
0.0404178
0.0358985
0.0314718
0.0270881
0.0227795
0.0186272
0.0147549
0.0111788
0.00785143
0.00480139
0.00244715
0.000840571
0.00159043
0.0034033
0.00575854
0.00750147
0.00817769
0.00817334
0.00772332
0.00693266
0.00549555
0.0040991
0.00368141
0.00369858
0.0041963
0.00447912
0.00450275
0.00440602
0.0041881
0.00335953
0.00273003
0.00199242
0.000939585
0.000241936
-0.000512263
0.484076
-0.127507
0.503844
0.00448723
0.342173
0.294094
0.303016
0.294556
0.283045
0.27304
0.265483
0.259205
0.252359
0.242807
0.230347
0.217095
0.20532
0.194681
0.184472
0.174303
0.164008
0.153809
0.143955
0.134617
0.125677
0.118473
0.113842
0.113049
0.115176
0.118914
0.123009
0.126825
0.130464
0.134847
0.140686
0.148567
0.157854
0.165651
0.170934
0.174217
0.176862
0.17954
0.182262
0.184629
0.185956
0.185702
0.183615
0.17968
0.174039
0.166847
0.158181
0.147961
0.136383
0.124398
0.114023
0.105733
0.0989305
0.0927925
0.0868176
0.0807822
0.0746519
0.0685671
0.0626811
0.0570335
0.0515816
0.0463466
0.0413654
0.0366245
0.0320709
0.0276891
0.0235193
0.0196545
0.0161786
0.0127559
0.0096659
0.00731493
0.00573183
0.00544087
0.00672672
0.008326
0.010038
0.0112616
0.0118664
0.0119427
0.0113563
0.0100597
0.00890113
0.0078767
0.00731344
0.00688986
0.00710587
0.00714708
0.00691791
0.00569697
0.00453425
0.00306692
0.00256008
0.00166416
0.000604426
-0.000309046
0.168225
-0.143298
0.346573
-0.0783836
0.0762679
0.114067
0.143006
0.153872
0.155665
0.155495
0.156488
0.158495
0.159803
0.15832
0.151253
0.143102
0.136365
0.130902
0.125861
0.120619
0.114844
0.108683
0.102426
0.0964074
0.0909022
0.0871616
0.0853788
0.0856624
0.0884543
0.0932887
0.0993245
0.105607
0.111685
0.117344
0.12391
0.130845
0.136625
0.143497
0.150481
0.156435
0.161373
0.165777
0.16993
0.173784
0.176986
0.179013
0.179394
0.177799
0.174124
0.16845
0.161004
0.151895
0.141111
0.129069
0.117283
0.107396
0.0995811
0.0930606
0.0870195
0.0809777
0.0747733
0.0684984
0.0623308
0.0563764
0.0506346
0.0451009
0.0397945
0.0347247
0.0298949
0.0252891
0.0209802
0.017079
0.0136451
0.0112166
0.00907187
0.00722109
0.00620355
0.00630559
0.00683761
0.007888
0.0092869
0.0105646
0.0115554
0.0120755
0.0118927
0.0112522
0.0103825
0.00957724
0.00872189
0.00849447
0.00811705
0.00763238
0.00685651
0.00562471
0.00412657
0.00302799
0.00236755
0.000964316
0.00073864
-0.000217012
0.330011
-0.142986
0.46521
-0.00604987
0.288919
0.224364
0.239993
0.241673
0.235628
0.225755
0.216324
0.209082
0.203357
0.197476
0.189708
0.180529
0.170523
0.161359
0.153109
0.145302
0.137567
0.129809
0.122135
0.114713
0.107631
0.101836
0.0979364
0.0961079
0.0964392
0.0989021
0.102984
0.108031
0.113217
0.118497
0.123153
0.127728
0.133102
0.13902
0.145635
0.152078
0.157855
0.163036
0.167867
0.172438
0.176581
0.179916
0.181977
0.182292
0.1805
0.176404
0.17008
0.16177
0.15165
0.139896
0.127244
0.115442
0.10561
0.0976698
0.0908946
0.0846304
0.0784699
0.0722681
0.0660817
0.0600183
0.0541285
0.0484254
0.0429158
0.037616
0.0324945
0.0275866
0.0228507
0.0183116
0.0147617
0.0119086
0.00999154
0.00910053
0.00893671
0.00901611
0.00925914
0.00988335
0.0108022
0.0118736
0.0129472
0.0137492
0.0140189
0.0136646
0.0131245
0.0121368
0.0113479
0.010629
0.00964373
0.00839082
0.00705326
0.00555452
0.00443673
0.00320361
0.00215971
0.00156233
0.000635578
-0.000438861
0.312748
-0.144495
0.385514
-0.0314838
0.121409
0.150004
0.178843
0.197946
0.206197
0.206935
0.204312
0.201154
0.19837
0.195149
0.192033
0.185207
0.176348
0.167324
0.158898
0.150908
0.143099
0.135312
0.127605
0.120125
0.112932
0.106577
0.101639
0.098402
0.0970875
0.0978118
0.100496
0.104595
0.109721
0.114702
0.119135
0.12251
0.126744
0.131905
0.137765
0.144001
0.150123
0.155922
0.161446
0.166788
0.171898
0.176525
0.180275
0.18266
0.183168
0.181327
0.176884
0.169928
0.160792
0.149865
0.137581
0.124851
0.113182
0.103227
0.0949064
0.0876891
0.0810379
0.0746027
0.0682651
0.0620469
0.0559909
0.0501108
0.0444238
0.038925
0.0336836
0.0286285
0.0238509
0.019904
0.0163638
0.0134133
0.0118849
0.0113336
0.0114101
0.0113921
0.0115365
0.0119028
0.0124781
0.0132016
0.0140727
0.0148858
0.0153326
0.0154157
0.0150327
0.0145047
0.013917
0.0123453
0.0105003
0.0084256
0.00665284
0.00557104
0.00424448
0.00328313
0.00212833
0.000993329
0.000330288
-0.000148148
0.301397
-0.12669
0.397142
-0.0117116
0.19671
0.150853
0.171692
0.188304
0.1997
0.204006
0.203657
0.201558
0.199337
0.196688
0.194585
0.190704
0.183829
0.175662
0.167409
0.159386
0.151553
0.143798
0.136113
0.128596
0.12125
0.114376
0.108391
0.10367
0.100566
0.0993956
0.10027
0.102967
0.106721
0.110562
0.113791
0.117224
0.121183
0.125812
0.131162
0.137042
0.143163
0.14927
0.155286
0.161227
0.167075
0.172686
0.17778
0.181948
0.184661
0.185277
0.18319
0.178091
0.170179
0.160074
0.148427
0.135814
0.123046
0.111244
0.100954
0.0922412
0.0846588
0.0777158
0.0710972
0.06469
0.0584829
0.052481
0.0466385
0.0410312
0.035541
0.0303776
0.0260478
0.0221827
0.0186778
0.0163008
0.0148909
0.0147004
0.0144422
0.0143678
0.0143262
0.0144624
0.0147957
0.01529
0.0158417
0.0165759
0.0171262
0.0171443
0.0170549
0.0167921
0.0152581
0.0130996
0.0106649
0.00835565
0.00664752
0.00490224
0.00377875
0.00276058
0.00186834
0.000796409
0.000107839
-0.000379616
0.305503
-0.121781
0.395809
-0.0123721
0.177366
0.149804
0.162565
0.177521
0.190438
0.197827
0.200337
0.200115
0.19908
0.197569
0.196357
0.194288
0.189524
0.182793
0.175273
0.167607
0.159958
0.152306
0.144671
0.137102
0.129603
0.122252
0.115322
0.109256
0.104482
0.101525
0.100505
0.101612
0.103346
0.105441
0.108163
0.111447
0.115208
0.119558
0.124507
0.130018
0.135943
0.142106
0.148386
0.154754
0.161192
0.167608
0.173802
0.179458
0.184133
0.187193
0.187827
0.185252
0.179154
0.170074
0.159056
0.146921
0.13417
0.121329
0.109238
0.0985762
0.0894443
0.0814847
0.0742477
0.0674503
0.0609813
0.0547939
0.0489162
0.0431311
0.0377735
0.0331535
0.0289604
0.0250896
0.0221481
0.0199232
0.0191097
0.0184429
0.0181328
0.0179007
0.0176919
0.0175399
0.0175293
0.0176142
0.0180733
0.0184783
0.0188086
0.0195356
0.0196342
0.0180994
0.0157674
0.0131448
0.0108559
0.00856802
0.00637907
0.00464131
0.00327546
0.00203136
0.00136124
0.000510733
0.000189375
-0.000253946
0.296593
-0.115035
0.396566
-0.00999397
0.175568
0.146666
0.156242
0.168202
0.181111
0.190521
0.195622
0.197514
0.19787
0.197991
0.197721
0.196923
0.193987
0.188972
0.182696
0.175871
0.168781
0.161457
0.153968
0.146387
0.138681
0.130823
0.123043
0.115695
0.109435
0.104561
0.101892
0.100129
0.0997456
0.100396
0.102491
0.10541
0.109019
0.1132
0.117937
0.123197
0.128919
0.134989
0.141323
0.147907
0.154744
0.161777
0.168841
0.175652
0.181847
0.186954
0.19024
0.190629
0.187061
0.179502
0.169226
0.157594
0.145308
0.132551
0.119634
0.107292
0.0962693
0.0867189
0.0783752
0.0708455
0.0638938
0.0574559
0.0512746
0.0458653
0.0410053
0.0366694
0.0325683
0.0292892
0.0264818
0.0249714
0.0236915
0.0228396
0.0222522
0.0218869
0.0216046
0.0213377
0.0211301
0.020996
0.0205253
0.0210883
0.0221115
0.0211713
0.0197651
0.0172228
0.0152743
0.013317
0.0111417
0.00888636
0.00657825
0.004366
0.00258525
0.00117455
0.000158832
-2.45127e-05
0.000456147
-3.78454e-05
0.290161
-0.11409
0.400178
-0.00823052
0.172766
0.144301
0.151263
0.160298
0.17211
0.182466
0.189627
0.193691
0.195608
0.197367
0.198565
0.198796
0.197337
0.19402
0.189308
0.183756
0.177602
0.170877
0.16368
0.156126
0.148193
0.139876
0.131257
0.122895
0.115109
0.1089
0.103334
0.0992983
0.0964467
0.0959069
0.0969242
0.0992944
0.102604
0.106642
0.11128
0.116446
0.122055
0.128024
0.134316
0.140957
0.148003
0.155466
0.163203
0.170916
0.178237
0.184775
0.190118
0.193394
0.192928
0.18767
0.178646
0.167665
0.155895
0.143648
0.13096
0.118061
0.105497
0.0941563
0.0841886
0.0754857
0.0676655
0.0605749
0.0547749
0.0494964
0.0450403
0.0408309
0.0374696
0.0343544
0.0323537
0.0305035
0.0290007
0.0277861
0.0268503
0.0261689
0.0256883
0.0252954
0.0248204
0.0245507
0.0249448
0.0236365
0.022281
0.0195981
0.0180043
0.0166108
0.0147248
0.0127676
0.0107588
0.00877014
0.00667167
0.0044977
0.00234739
0.000177253
-0.00065236
-0.000613672
0.000416816
-4.34816e-05
0.292369
-0.117697
0.404767
-0.00525335
0.169963
0.142078
0.14726
0.153761
0.163917
0.174294
0.182789
0.188806
0.192498
0.195801
0.198627
0.199993
0.199805
0.198051
0.195008
0.190988
0.186076
0.180215
0.173504
0.166074
0.15798
0.149172
0.139979
0.130597
0.121954
0.113312
0.105672
0.098718
0.0943341
0.0920141
0.0918047
0.0932856
0.0960921
0.0998932
0.104473
0.109646
0.115264
0.121224
0.127495
0.134136
0.141263
0.148946
0.157172
0.165627
0.173751
0.181325
0.187859
0.193182
0.195846
0.193682
0.186782
0.176969
0.165858
0.15415
0.142019
0.129483
0.116721
0.104057
0.0925254
0.0821879
0.0734805
0.0661874
0.0597451
0.054579
0.0499209
0.0463957
0.0431929
0.0410149
0.0388486
0.0368678
0.0350517
0.0334698
0.0321757
0.0310507
0.0300839
0.0295675
0.0294002
0.0282815
0.0270649
0.024078
0.0212844
0.0193477
0.017207
0.0153015
0.013595
0.0119167
0.0101875
0.00838216
0.00641112
0.00450541
0.00236714
-0.000330297
-0.00106086
-0.000732081
0.000275111
-0.000148488
0.270068
-0.119606
0.404768
-0.00183148
0.166977
0.139718
0.143814
0.148369
0.156728
0.166488
0.175601
0.183119
0.188682
0.193614
0.197867
0.200493
0.201568
0.201265
0.199798
0.197312
0.193784
0.189042
0.183033
0.175886
0.167675
0.158642
0.148874
0.139158
0.128702
0.118448
0.108025
0.0996111
0.0931791
0.0891363
0.0873629
0.0876701
0.0896926
0.0930861
0.0975238
0.102714
0.108422
0.114488
0.120844
0.127541
0.134693
0.142497
0.150816
0.15949
0.168436
0.177032
0.18455
0.190647
0.195492
0.196681
0.192803
0.184989
0.175019
0.164025
0.152482
0.140559
0.128234
0.11572
0.103267
0.0921806
0.0823787
0.0741719
0.067252
0.0612074
0.0566329
0.0527729
0.0503417
0.0481267
0.0459945
0.0438842
0.0418728
0.0399478
0.038187
0.0370244
0.0357916
0.0338814
0.0327133
0.0300731
0.0271781
0.0243504
0.0218415
0.0191444
0.0168182
0.0146263
0.0126012
0.0107376
0.00902106
0.00746219
0.0058425
0.0044063
0.00237247
0.000197673
-0.000994532
-0.000950511
7.12381e-05
-0.000153372
0.273559
-0.12932
0.404638
0.000385571
0.164879
0.137426
0.140651
0.143828
0.150565
0.159378
0.168541
0.177008
0.184388
0.190837
0.196371
0.200292
0.202729
0.203824
0.203681
0.202504
0.200372
0.196939
0.19183
0.185122
0.177071
0.167848
0.158227
0.147242
0.13574
0.123205
0.111721
0.101554
0.0933636
0.0874334
0.083926
0.0827668
0.0837216
0.0864487
0.0905567
0.0956706
0.10147
0.10772
0.114285
0.12112
0.1284
0.136095
0.144259
0.153138
0.162468
0.171782
0.18026
0.18702
0.192418
0.196185
0.195782
0.190881
0.182837
0.173047
0.162315
0.151076
0.139503
0.127442
0.115729
0.104351
0.0944277
0.0853063
0.0772429
0.0707284
0.0652407
0.0613469
0.0584694
0.0560296
0.0537264
0.0513796
0.049062
0.0471014
0.044979
0.0422766
0.0405966
0.0376243
0.0347059
0.0311239
0.0278189
0.0248826
0.0219789
0.0192947
0.0166709
0.014241
0.0119598
0.00982117
0.00785471
0.00613633
0.00458327
0.00346526
0.00231633
0.00103886
-2.41768e-05
-0.000595281
-0.000441308
-0.000259176
0.262806
-0.135606
0.401843
0.00118383
0.161804
0.135208
0.137568
0.139866
0.145315
0.153141
0.162033
0.170951
0.179776
0.187618
0.194231
0.199434
0.203351
0.205709
0.206659
0.206499
0.205631
0.203576
0.199541
0.19345
0.185619
0.176989
0.166515
0.155036
0.141861
0.128854
0.116273
0.104778
0.0949092
0.0871391
0.0817707
0.0789336
0.0785348
0.0802833
0.0837882
0.088631
0.0944267
0.10085
0.107659
0.114812
0.122091
0.129731
0.137978
0.146818
0.156165
0.165726
0.174885
0.182622
0.188311
0.19268
0.195002
0.193548
0.188359
0.180592
0.171234
0.160983
0.150218
0.139473
0.12839
0.117727
0.107662
0.0986372
0.0906803
0.0831568
0.0770424
0.0722073
0.0684498
0.0653549
0.0625008
0.0599066
0.0570029
0.0536269
0.0508947
0.0476313
0.0439579
0.0403237
0.0360423
0.0322866
0.0288243
0.025489
0.0224633
0.019563
0.0167555
0.0140514
0.0115478
0.00917274
0.00694019
0.0049536
0.00323626
0.00219442
0.00169579
0.00115496
0.000472848
-0.000397177
-0.000705849
-0.000525748
0.255748
-0.146665
0.398155
0.000700783
0.157213
0.13245
0.134321
0.13618
0.140779
0.147806
0.156386
0.165522
0.174958
0.183922
0.191571
0.197883
0.20299
0.206798
0.208915
0.209608
0.209636
0.208814
0.205781
0.200327
0.193494
0.184358
0.173873
0.16128
0.148291
0.134933
0.121726
0.109188
0.0978989
0.088405
0.0811776
0.0765301
0.0745101
0.074941
0.0775096
0.0818102
0.0874005
0.0938668
0.100896
0.108083
0.115645
0.12361
0.131975
0.140745
0.149886
0.159265
0.168556
0.177056
0.183827
0.188527
0.191315
0.192312
0.190234
0.185281
0.178169
0.169667
0.160315
0.151101
0.141948
0.13209
0.122171
0.112849
0.104581
0.0972066
0.0906009
0.0849724
0.0802621
0.0762287
0.0726357
0.0686638
0.0649703
0.0607877
0.0560979
0.0515189
0.0467424
0.041761
0.03752
0.0334572
0.0297113
0.0262443
0.0230023
0.020001
0.0171294
0.0143473
0.0116545
0.00908495
0.0066398
0.00435752
0.00236598
0.00109536
0.000285133
-2.22697e-05
-4.73455e-05
-0.000449076
-0.00102275
-0.000710192
0.259087
-0.160256
0.393338
-0.000231158
0.151764
0.129149
0.130715
0.1325
0.1367
0.143289
0.15174
0.161089
0.170706
0.179985
0.188272
0.195596
0.201977
0.207029
0.210324
0.211838
0.212523
0.212565
0.210271
0.205995
0.198916
0.190162
0.179058
0.167268
0.154576
0.141344
0.127901
0.11471
0.102327
0.0913508
0.0823778
0.0758606
0.0719943
0.0707784
0.0720481
0.075471
0.0805561
0.0867759
0.0936369
0.101175
0.10919
0.117543
0.126139
0.134933
0.143884
0.152915
0.161884
0.170452
0.177975
0.183854
0.187743
0.189733
0.189677
0.187347
0.182927
0.176778
0.169915
0.161978
0.154133
0.145766
0.136946
0.128048
0.119561
0.111728
0.104645
0.0983372
0.0928382
0.0879301
0.0829839
0.0781052
0.0727998
0.0669515
0.0611831
0.0548186
0.0490767
0.0439085
0.0390132
0.0346275
0.0306405
0.0269884
0.0236147
0.0204884
0.017559
0.0147544
0.0120655
0.00948458
0.0070265
0.00478593
0.00293019
0.00168168
0.000738376
7.32219e-06
-0.000316611
-0.000386199
-0.000440906
-0.000648525
0.234788
-0.168569
0.382439
-0.00311712
0.145148
0.124966
0.126593
0.128632
0.132844
0.139467
0.148237
0.157456
0.166791
0.176067
0.184821
0.192971
0.200303
0.206386
0.2108
0.21321
0.214433
0.214883
0.213353
0.208757
0.20225
0.193276
0.183464
0.172463
0.160545
0.147833
0.134585
0.121174
0.108105
0.0959823
0.0854686
0.0771094
0.0712611
0.0681257
0.0677333
0.0698853
0.0741248
0.0796149
0.086418
0.0942194
0.102632
0.111369
0.120263
0.129212
0.13813
0.146936
0.155557
0.163849
0.171467
0.177962
0.182946
0.186306
0.187959
0.187859
0.185942
0.182755
0.177969
0.172434
0.165883
0.158604
0.150713
0.14245
0.134172
0.126196
0.118723
0.11187
0.105527
0.099732
0.0934789
0.0869039
0.0797567
0.0722332
0.0648432
0.0581636
0.0518997
0.046125
0.0408499
0.0360056
0.0316217
0.0276624
0.0240874
0.0208534
0.017888
0.0151458
0.0125793
0.0101641
0.00795972
0.0060124
0.00473409
0.0037356
0.0030277
0.00228554
0.00133188
0.000614193
5.53568e-05
-0.000514878
0.240548
-0.184405
0.373407
-0.0094584
0.139952
0.120546
0.122024
0.124493
0.129237
0.136508
0.144908
0.154361
0.163466
0.172581
0.181553
0.190175
0.198066
0.204882
0.210221
0.213495
0.215541
0.215819
0.213406
0.209171
0.202621
0.195186
0.186461
0.176694
0.165876
0.154088
0.141471
0.128299
0.114998
0.102136
0.090375
0.0803262
0.0724988
0.0672852
0.0649485
0.0654556
0.0683395
0.0730073
0.0795584
0.0874014
0.0960087
0.105017
0.11419
0.123359
0.132387
0.141171
0.149658
0.157803
0.165458
0.172353
0.178165
0.182684
0.185829
0.18752
0.188014
0.18687
0.184571
0.18092
0.176002
0.170015
0.163198
0.155773
0.14801
0.140197
0.132557
0.125171
0.118251
0.110581
0.102796
0.0944362
0.0854631
0.0769779
0.0690473
0.0616017
0.0547711
0.0485037
0.0427659
0.0375304
0.0327694
0.0284734
0.0246194
0.021162
0.0180751
0.0153083
0.0128141
0.010633
0.0087635
0.00765003
0.00697328
0.00675045
0.0065322
0.00579135
0.00445947
0.00285317
0.00138465
7.77941e-05
0.231622
-0.193473
0.361121
-0.0187508
0.131488
0.115622
0.117094
0.120383
0.125993
0.133217
0.142019
0.151445
0.16057
0.169585
0.178571
0.187285
0.195378
0.202501
0.208618
0.212858
0.214606
0.213907
0.211198
0.20679
0.201637
0.195307
0.188002
0.179653
0.170245
0.159742
0.148175
0.135703
0.122652
0.109519
0.0969062
0.0854641
0.0758145
0.0685497
0.0640817
0.0627405
0.0637364
0.0674865
0.0734508
0.0809695
0.0894817
0.0985635
0.107909
0.117281
0.126488
0.135398
0.14395
0.152126
0.15988
0.167091
0.173557
0.179092
0.183543
0.187014
0.189026
0.189965
0.189612
0.18778
0.184509
0.17993
0.174268
0.167774
0.160664
0.153163
0.145578
0.137952
0.129489
0.120376
0.110644
0.100602
0.0910507
0.0818654
0.0732282
0.065205
0.0577903
0.0509993
0.0448002
0.0391487
0.0340173
0.0293845
0.0252202
0.0215245
0.0182747
0.0154411
0.0130345
0.0110251
0.00988083
0.00906198
0.00877456
0.00867789
0.00844535
0.00774748
0.00643977
0.00464214
0.00267599
0.000590451
0.22611
-0.205103
0.350364
-0.0299683
0.121275
0.10954
0.111872
0.116172
0.122159
0.130084
0.139001
0.148517
0.157876
0.166933
0.175794
0.18431
0.192204
0.199515
0.205714
0.209654
0.21113
0.209656
0.206832
0.20329
0.198926
0.193841
0.187926
0.181131
0.17334
0.164421
0.154285
0.142965
0.130668
0.117785
0.104822
0.0924143
0.0812932
0.0721103
0.0657244
0.0619079
0.0612228
0.063611
0.0684826
0.0752328
0.0832925
0.0921826
0.101521
0.111002
0.120387
0.129517
0.138302
0.146704
0.154696
0.162235
0.169246
0.175646
0.181393
0.185983
0.189572
0.19209
0.193288
0.193056
0.191349
0.188215
0.183752
0.178225
0.171915
0.164723
0.156641
0.147868
0.138355
0.127864
0.11704
0.106562
0.0963887
0.0867081
0.0775518
0.0689724
0.0610063
0.0536742
0.0469704
0.0408758
0.0353611
0.0303785
0.0259144
0.0219636
0.01854
0.0156668
0.0133576
0.0120087
0.0109603
0.0106603
0.0104695
0.0101337
0.00964291
0.00885396
0.00760935
0.0058646
0.00371667
0.000840188
0.235715
-0.220033
0.339854
-0.0409823
0.109674
0.102707
0.106246
0.111226
0.118098
0.126346
0.135515
0.145286
0.155122
0.16437
0.173018
0.181123
0.188578
0.19572
0.200931
0.204134
0.204974
0.203987
0.201603
0.198477
0.194905
0.190845
0.186249
0.181005
0.174931
0.1678
0.159414
0.14967
0.138637
0.126561
0.113835
0.101037
0.08887
0.078365
0.0697082
0.0638578
0.0613124
0.0618289
0.0650776
0.0705723
0.0777671
0.0861297
0.0952008
0.104612
0.114089
0.123444
0.132558
0.141347
0.149746
0.157712
0.165229
0.172321
0.178999
0.184699
0.189526
0.193238
0.195712
0.196776
0.196395
0.194577
0.191229
0.186194
0.179942
0.172955
0.164331
0.154974
0.144344
0.133466
0.122624
0.1119
0.101495
0.0914735
0.0819208
0.0728891
0.0644305
0.0565805
0.0493658
0.0428034
0.0368733
0.0315479
0.0268005
0.0226465
0.0191106
0.016305
0.0144367
0.0128915
0.0121477
0.0116667
0.0112831
0.0107697
0.010024
0.00903015
0.00775691
0.00613978
0.00415584
0.00114219
0.215049
-0.22435
0.32279
-0.0528547
0.0965235
0.0953196
0.0997807
0.10598
0.113283
0.121813
0.131246
0.141423
0.15195
0.16157
0.170028
0.177517
0.18498
0.190672
0.1947
0.197153
0.198228
0.197498
0.195511
0.192814
0.189788
0.186555
0.183093
0.179291
0.174914
0.169661
0.163252
0.155462
0.146172
0.135473
0.123598
0.11103
0.0986734
0.0866668
0.0765156
0.0689538
0.0642491
0.062538
0.0637083
0.0674661
0.0733377
0.0807667
0.089231
0.0983107
0.107699
0.117187
0.126619
0.135866
0.144802
0.153323
0.161368
0.168939
0.176085
0.18274
0.188473
0.193134
0.196611
0.198639
0.198897
0.19768
0.195033
0.191099
0.185148
0.177173
0.168564
0.158559
0.148254
0.1377
0.12707
0.116516
0.10613
0.0960175
0.0862586
0.0769281
0.0680849
0.0597842
0.052089
0.0450513
0.0386958
0.0330239
0.0280537
0.0237643
0.0203644
0.0178882
0.015876
0.0146601
0.0136984
0.0129291
0.0121909
0.011342
0.0102847
0.00899163
0.00748672
0.00578016
0.00386682
0.00108458
0.227686
-0.233548
0.312915
-0.0670635
0.0842469
0.0866081
0.0929908
0.10003
0.107646
0.116345
0.126072
0.136634
0.147832
0.157987
0.166499
0.173692
0.179922
0.184709
0.187914
0.189944
0.190858
0.190481
0.188863
0.186504
0.183871
0.181237
0.178684
0.176134
0.173329
0.169936
0.165622
0.160077
0.152896
0.144045
0.133797
0.122079
0.109491
0.0972949
0.0862229
0.0770117
0.0702053
0.0661207
0.064905
0.0664868
0.070545
0.0765683
0.0840107
0.0924174
0.101451
0.110871
0.120489
0.130129
0.139611
0.148751
0.157377
0.165348
0.172639
0.179635
0.185893
0.191041
0.195021
0.197817
0.199172
0.198546
0.196238
0.191648
0.186017
0.17847
0.169544
0.160185
0.150368
0.140346
0.130223
0.120077
0.109994
0.100053
0.0903404
0.0809316
0.0718931
0.0632927
0.0552159
0.0477522
0.0409969
0.035036
0.029844
0.025737
0.0224795
0.0199319
0.0182409
0.0168841
0.0157545
0.0146835
0.0135671
0.0123075
0.0108437
0.00918523
0.00739588
0.00552041
0.0035623
0.000948311
0.224825
-0.234064
0.302578
-0.0819902
0.0721334
0.0764724
0.085246
0.0931748
0.101098
0.109931
0.119946
0.130803
0.142181
0.152685
0.161394
0.168642
0.174348
0.178188
0.180896
0.182471
0.183224
0.183121
0.181877
0.179828
0.177471
0.175245
0.173348
0.171804
0.170416
0.16872
0.16642
0.163383
0.158769
0.151885
0.143196
0.133007
0.121658
0.109797
0.0982726
0.0878616
0.0792432
0.0729338
0.0692478
0.0683239
0.0700793
0.0741666
0.0800886
0.0873856
0.0956933
0.10473
0.114262
0.124064
0.133911
0.143564
0.152775
0.161287
0.168893
0.175807
0.18217
0.187734
0.192117
0.195032
0.196551
0.196361
0.193756
0.190085
0.18409
0.17689
0.168789
0.15998
0.150802
0.141395
0.131873
0.122299
0.11272
0.103197
0.0937967
0.0845868
0.0756313
0.0669953
0.0587587
0.0510618
0.0440636
0.0379138
0.0329755
0.0286442
0.0253649
0.0229349
0.0209863
0.0193926
0.0179594
0.0165583
0.0150798
0.0134518
0.0116525
0.00971168
0.00768117
0.00559357
0.00346215
0.000877231
0.224495
-0.236382
0.299257
-0.0957326
0.0603411
0.0654806
0.0760537
0.0850196
0.0935153
0.102532
0.112758
0.123854
0.13504
0.145554
0.154918
0.162341
0.167621
0.171283
0.173621
0.17497
0.175597
0.175629
0.17473
0.172982
0.170867
0.168913
0.167512
0.166702
0.16645
0.166731
0.166168
0.164737
0.162336
0.158178
0.151981
0.143895
0.134209
0.123389
0.112088
0.101094
0.0912183
0.0831301
0.0772076
0.0736795
0.0727401
0.0743524
0.0781811
0.0838212
0.090903
0.099106
0.108139
0.117721
0.12757
0.13741
0.14696
0.15593
0.164023
0.171146
0.177364
0.182671
0.186899
0.190118
0.191536
0.191336
0.189551
0.185546
0.180335
0.173879
0.166467
0.15837
0.149816
0.141014
0.132092
0.123124
0.11415
0.105202
0.0963261
0.0875846
0.0790293
0.0707136
0.0627134
0.0551152
0.0482738
0.0423983
0.0370378
0.032805
0.0293363
0.0264732
0.0240893
0.0220308
0.0201776
0.0184091
0.0166233
0.0147474
0.0127437
0.0106004
0.00833647
0.00596807
0.00349942
0.000897424
0.242846
-0.244531
0.298708
-0.104466
0.0487468
0.0544637
0.0657625
0.0755769
0.0847849
0.094061
0.104321
0.115402
0.126648
0.137673
0.147203
0.154713
0.160093
0.16377
0.166121
0.167442
0.16806
0.168128
0.167569
0.166176
0.164357
0.162716
0.161624
0.161681
0.16242
0.163144
0.164317
0.164973
0.164621
0.162809
0.159182
0.153623
0.14619
0.137113
0.126833
0.116038
0.105615
0.096391
0.0887311
0.0828256
0.0790734
0.0778186
0.0790044
0.0823777
0.0876241
0.0944155
0.102419
0.111296
0.120703
0.130308
0.139796
0.148851
0.157148
0.164482
0.170726
0.175946
0.180134
0.182514
0.18436
0.184253
0.18249
0.179468
0.175077
0.169536
0.162983
0.155636
0.14774
0.139524
0.131167
0.122778
0.114409
0.106091
0.0978654
0.0897817
0.081913
0.0742681
0.0669141
0.0601229
0.0535056
0.0475292
0.0424035
0.0379036
0.0340055
0.0306084
0.0276325
0.0250056
0.0226431
0.0204535
0.0183396
0.0162025
0.0139702
0.0116011
0.00900206
0.00626671
0.00362754
0.000926674
0.227207
-0.240335
0.291533
-0.10918
0.0370355
0.0438853
0.0549733
0.0651962
0.0749193
0.0844582
0.0945731
0.105407
0.117046
0.128246
0.138122
0.14596
0.15167
0.155655
0.158293
0.159851
0.160633
0.160847
0.160571
0.159606
0.158244
0.15699
0.156762
0.156735
0.157837
0.15981
0.16195
0.163892
0.165195
0.165437
0.164246
0.161347
0.15658
0.149907
0.141489
0.131778
0.121582
0.111852
0.102913
0.0951462
0.0889168
0.0847783
0.0829936
0.0835741
0.0863637
0.0911002
0.0974592
0.10508
0.113578
0.122563
0.131659
0.140522
0.148791
0.156125
0.16254
0.167401
0.170817
0.17366
0.174758
0.174882
0.173903
0.171741
0.16843
0.163961
0.158428
0.151983
0.144846
0.137269
0.129474
0.121623
0.113818
0.106117
0.0985835
0.0912797
0.0842173
0.0776142
0.0712592
0.0648743
0.0590197
0.053553
0.048477
0.0438039
0.0394954
0.0355382
0.031923
0.0286363
0.0256351
0.0228508
0.0202249
0.0176786
0.0149998
0.0121552
0.00941969
0.00652674
0.00361121
0.000892741
0.247854
-0.240714
0.291172
-0.112372
0.0272894
0.0339668
0.0440627
0.0542479
0.0641324
0.0738079
0.083733
0.0945067
0.106123
0.117593
0.127883
0.136179
0.142353
0.146871
0.150049
0.152095
0.153254
0.153779
0.153831
0.153498
0.152796
0.152481
0.151985
0.152548
0.154138
0.156421
0.159105
0.161827
0.164272
0.16611
0.166995
0.166595
0.164602
0.16076
0.15493
0.147216
0.1381
0.128428
0.118819
0.109741
0.101639
0.0949611
0.0902089
0.087707
0.0875505
0.0896337
0.0937114
0.0994655
0.106523
0.114453
0.122822
0.131178
0.13914
0.146282
0.151758
0.156857
0.160229
0.162291
0.163651
0.164154
0.163837
0.162622
0.160411
0.157147
0.152812
0.147477
0.141306
0.134524
0.127381
0.1201
0.112845
0.105754
0.0988951
0.0924472
0.0865525
0.0805236
0.075002
0.0698287
0.0648056
0.0599119
0.0550906
0.0503401
0.045688
0.0411859
0.0368788
0.0328108
0.0290348
0.0254687
0.0219487
0.0186163
0.0156466
0.0126186
0.00951688
0.00643045
0.00346077
0.000828173
0.251706
-0.231924
0.291348
-0.113827
0.018237
0.024821
0.0335387
0.0432109
0.0527687
0.0623816
0.0721727
0.0827949
0.0942715
0.105859
0.116455
0.125227
0.132051
0.137311
0.14125
0.144021
0.145816
0.146927
0.147592
0.147988
0.14835
0.148073
0.148272
0.149218
0.150944
0.153302
0.156103
0.15916
0.162263
0.165179
0.167633
0.16931
0.169855
0.16889
0.166056
0.161099
0.154023
0.145253
0.135725
0.126002
0.116591
0.107851
0.100409
0.0948351
0.0914901
0.090492
0.0917333
0.0949863
0.0999853
0.106301
0.113391
0.120906
0.127967
0.134066
0.139912
0.144118
0.14734
0.149685
0.151261
0.152213
0.152528
0.152162
0.151022
0.149
0.146004
0.142011
0.137083
0.131386
0.125156
0.118649
0.11211
0.105719
0.0998001
0.0941427
0.0886787
0.0838368
0.0792946
0.0749566
0.0706575
0.0662499
0.061663
0.0568663
0.05191
0.0468908
0.041914
0.0369431
0.0320201
0.0276401
0.0236169
0.0197334
0.0160723
0.0126445
0.00937371
0.00623866
0.00332226
0.000776433
0.256878
-0.224479
0.29834
-0.113472
0.0102178
0.0162232
0.0238273
0.0326063
0.0415707
0.0506139
0.0601834
0.0705564
0.0817697
0.0932155
0.103885
0.11309
0.120689
0.126866
0.131768
0.135496
0.138204
0.140157
0.141686
0.143148
0.14382
0.14451
0.145392
0.146658
0.148401
0.15062
0.153282
0.156325
0.159662
0.163161
0.166629
0.169809
0.172378
0.173938
0.174034
0.17218
0.167949
0.161228
0.152699
0.143123
0.13296
0.122731
0.113108
0.104767
0.0982737
0.0940064
0.0920468
0.0922191
0.0944264
0.098549
0.103704
0.108941
0.11525
0.121002
0.125805
0.129955
0.133278
0.135878
0.137843
0.139244
0.140134
0.140513
0.140329
0.139485
0.137862
0.135363
0.131952
0.127704
0.122799
0.117501
0.112089
0.106894
0.101611
0.0966238
0.0921643
0.0880297
0.0841224
0.0802632
0.0763065
0.0721122
0.0675508
0.0625941
0.0573085
0.0517281
0.0459543
0.0405158
0.0351506
0.0299249
0.0250616
0.0205861
0.0164704
0.0126937
0.00923152
0.00606467
0.00323127
0.000745766
0.284684
-0.225498
0.308971
-0.108788
0.00289852
0.0088409
0.0151191
0.022474
0.0306383
0.0388198
0.0479842
0.0579861
0.068778
0.0798028
0.0903247
0.0998859
0.108284
0.115486
0.121513
0.126408
0.130267
0.133568
0.136133
0.137951
0.139819
0.141548
0.143164
0.144763
0.146506
0.148523
0.1509
0.153697
0.15694
0.160596
0.164557
0.168642
0.172588
0.176049
0.178572
0.179591
0.178436
0.174557
0.16806
0.159502
0.149461
0.138565
0.127521
0.117015
0.107676
0.100159
0.0949438
0.0917361
0.0901597
0.090558
0.0935918
0.0974818
0.101724
0.106266
0.110682
0.114684
0.118196
0.121154
0.12357
0.125484
0.126948
0.128
0.128646
0.12884
0.12849
0.12748
0.125715
0.123186
0.12001
0.116382
0.112608
0.108614
0.104464
0.100547
0.0968026
0.0931395
0.0894727
0.085712
0.0817239
0.0773491
0.0724998
0.0671862
0.0614473
0.055565
0.0496712
0.0436341
0.0377015
0.0319909
0.0265947
0.0215886
0.017009
0.0128676
0.00916797
0.00591396
0.00312784
0.000712983
0.273288
-0.213635
0.312371
-0.0952264
-0.00295108
0.00170806
0.00716853
0.0130014
0.0201867
0.027621
0.0359239
0.0452384
0.0553358
0.0657365
0.0760056
0.0858654
0.0950481
0.103289
0.110561
0.117087
0.122306
0.126333
0.129917
0.133124
0.136081
0.138892
0.141296
0.143322
0.14515
0.14701
0.149083
0.151524
0.15446
0.157952
0.161978
0.166431
0.171119
0.175764
0.179976
0.183207
0.184724
0.183751
0.179901
0.173318
0.164458
0.153906
0.142347
0.130585
0.119048
0.10807
0.0990884
0.0928008
0.0883571
0.0855365
0.0846983
0.0857286
0.0880756
0.0912517
0.0948809
0.0986256
0.102234
0.105554
0.108494
0.111023
0.113152
0.11492
0.116364
0.117489
0.118258
0.118609
0.118461
0.117701
0.11643
0.114928
0.112837
0.110421
0.107916
0.105151
0.102138
0.0988474
0.0953119
0.0914619
0.0871693
0.0823462
0.0769944
0.0711457
0.0650642
0.05894
0.0525935
0.0462037
0.0398971
0.0337982
0.0280006
0.0225783
0.0175935
0.013097
0.0091343
0.0057457
0.00296745
0.000654689
0.299046
-0.202599
0.322599
-0.0809127
-0.00523349
-0.00437123
0.000437158
0.00484955
0.0106012
0.0172043
0.0242578
0.0325483
0.0416615
0.0513416
0.0613202
0.0714014
0.0813976
0.0908934
0.0991087
0.106527
0.113204
0.118927
0.12386
0.128279
0.132365
0.136142
0.139399
0.142003
0.144096
0.145949
0.147818
0.149925
0.152473
0.155609
0.159392
0.163786
0.168666
0.173828
0.178959
0.183587
0.187034
0.188486
0.187292
0.183195
0.176302
0.167018
0.155739
0.143065
0.130759
0.11841
0.106541
0.0962492
0.0880333
0.0818733
0.0778158
0.0758012
0.0756046
0.076869
0.0792005
0.0822247
0.0856175
0.0891208
0.0925415
0.0957484
0.0986721
0.101296
0.103646
0.105768
0.107637
0.109199
0.110611
0.111932
0.112448
0.112529
0.112516
0.111938
0.110829
0.10932
0.10729
0.104643
0.10141
0.097482
0.0928149
0.0874801
0.0814457
0.0750032
0.0685352
0.0617648
0.0549106
0.0481057
0.0414625
0.0350639
0.0289803
0.0232759
0.0180147
0.0132644
0.00909878
0.00559091
0.00280018
0.000581996
0.304373
-0.184299
0.333447
-0.0664688
-0.00467813
-0.00851382
-0.00591876
-0.00236833
0.00183035
0.00750521
0.0133355
0.0202932
0.0282387
0.0371093
0.0468462
0.057095
0.0672124
0.0773164
0.0869285
0.0957895
0.103839
0.111006
0.117362
0.123062
0.128252
0.132975
0.137148
0.140477
0.143039
0.145093
0.146946
0.148862
0.151086
0.153821
0.157194
0.161236
0.165887
0.171012
0.176377
0.18161
0.186146
0.189256
0.19021
0.188464
0.183775
0.17611
0.166303
0.154912
0.141871
0.128239
0.11467
0.101907
0.090616
0.0811858
0.0738231
0.0686075
0.065477
0.0642456
0.0646345
0.0663124
0.068946
0.0722283
0.0758871
0.0796946
0.0834767
0.0871288
0.0905924
0.0938904
0.0972386
0.100425
0.102865
0.105349
0.107937
0.110096
0.1116
0.112709
0.113191
0.112961
0.111835
0.109999
0.107115
0.103152
0.0982118
0.092163
0.0856893
0.0788124
0.071437
0.0639519
0.0565264
0.0492902
0.0423221
0.0356773
0.0294018
0.0235421
0.0181516
0.0132971
0.00906008
0.00552133
0.00273346
0.000539559
0.306087
-0.173288
0.351075
-0.0513388
-0.000768053
-0.00995437
-0.0104654
-0.00821783
-0.00517862
-0.00118611
0.00359911
0.00896994
0.0156519
0.0236541
0.0325289
0.0424438
0.0530373
0.0638196
0.0743863
0.0844244
0.0937634
0.102317
0.110097
0.117149
0.123515
0.12923
0.134266
0.138453
0.141701
0.144208
0.146287
0.14823
0.150294
0.152706
0.155636
0.159169
0.163308
0.167978
0.173021
0.178166
0.182986
0.186886
0.189171
0.18917
0.186364
0.180931
0.173456
0.163258
0.151034
0.137426
0.123169
0.108988
0.0955773
0.0834975
0.0731512
0.0647967
0.0585592
0.0544403
0.0523294
0.0520211
0.053257
0.0557569
0.059233
0.0634025
0.0680039
0.0728103
0.0777208
0.0824811
0.0866651
0.0910276
0.0953995
0.0997177
0.103583
0.107108
0.110242
0.112745
0.114519
0.115261
0.115215
0.113955
0.111375
0.10744
0.102052
0.0961654
0.0892102
0.0815367
0.0735751
0.0655466
0.0576445
0.049997
0.0426944
0.0357984
0.0293548
0.0234045
0.0179931
0.0131784
0.00902676
0.00558532
0.00283781
0.000561134
0.343723
-0.182417
0.371057
-0.033869
0.00633465
-0.00769034
-0.0123419
-0.0126402
-0.011253
-0.00869316
-0.00526766
-0.00132874
0.00421053
0.0108597
0.0189474
0.0284993
0.0390766
0.0502017
0.0614254
0.0723803
0.0828552
0.0927251
0.101912
0.110339
0.117936
0.1247
0.13066
0.135791
0.139894
0.143094
0.145653
0.147871
0.149993
0.152238
0.154794
0.157783
0.161255
0.165191
0.169499
0.173997
0.178394
0.18223
0.184937
0.185851
0.184584
0.181696
0.176073
0.167829
0.157202
0.144692
0.130886
0.116433
0.101999
0.0882031
0.0755703
0.0645164
0.0553431
0.0482457
0.0433124
0.040522
0.0397658
0.0408714
0.0436165
0.0477337
0.0529194
0.0588145
0.0647922
0.0705883
0.0765665
0.0825576
0.0885627
0.0939967
0.0991572
0.103909
0.10809
0.111594
0.114113
0.115841
0.116367
0.11549
0.113089
0.109255
0.10456
0.0983527
0.0911663
0.0833289
0.0751202
0.0667909
0.0585392
0.0505274
0.0428821
0.0357019
0.0290636
0.0230298
0.0176556
0.0129904
0.00905817
0.00581102
0.00309216
0.000634351
0.332328
-0.166808
0.375019
-0.0142998
0.0137719
-0.00280687
-0.0112116
-0.0146732
-0.0153459
-0.0149582
-0.0128475
-0.0100384
-0.00601488
-0.000672792
0.00650671
0.0153777
0.025537
0.0365837
0.0480926
0.0596897
0.0711299
0.0822124
0.0927417
0.10252
0.111388
0.119284
0.126249
0.132326
0.137458
0.141581
0.144874
0.147604
0.150001
0.152261
0.154567
0.157058
0.159819
0.162869
0.166164
0.169593
0.172958
0.176019
0.17825
0.179407
0.179798
0.178192
0.174398
0.168206
0.15966
0.148989
0.136585
0.122944
0.108632
0.0942301
0.0802969
0.0673376
0.0557856
0.0460008
0.0382644
0.032765
0.0295928
0.0287516
0.0301591
0.0336415
0.0388754
0.045345
0.0520549
0.0593129
0.0668925
0.0745669
0.0816723
0.0884442
0.0946793
0.100265
0.105128
0.109067
0.112156
0.114189
0.114858
0.114099
0.112104
0.109106
0.10449
0.0986388
0.0917757
0.0841756
0.0760867
0.0677391
0.059345
0.051096
0.0431643
0.0357034
0.0288474
0.0227103
0.0173819
0.0129062
0.00922997
0.00615137
0.00337871
0.000718014
0.355665
-0.154333
0.384728
0.00404728
0.0242932
0.00451242
-0.00730842
-0.014239
-0.0178121
-0.0193457
-0.0190064
-0.017099
-0.0147612
-0.0106617
-0.0045735
0.00328039
0.0126343
0.0232008
0.0346319
0.0465885
0.058783
0.0709049
0.0826308
0.0936619
0.103773
0.112854
0.120927
0.128067
0.134299
0.139485
0.143711
0.147157
0.150028
0.152484
0.154685
0.156771
0.15884
0.160937
0.163036
0.165088
0.167001
0.168558
0.170321
0.171742
0.172142
0.17134
0.168909
0.164564
0.158144
0.14966
0.139281
0.127307
0.114145
0.100262
0.086162
0.0723496
0.0593162
0.0475266
0.0374116
0.029353
0.0236596
0.0205481
0.0201344
0.0223716
0.0270623
0.033086
0.0404938
0.0490211
0.0579501
0.0666138
0.0750507
0.0829103
0.0899936
0.09619
0.101343
0.105474
0.108654
0.110475
0.11099
0.110423
0.109055
0.106252
0.102191
0.0969808
0.090797
0.0838144
0.0762222
0.0682166
0.0599979
0.0517697
0.0437377
0.0361068
0.0290745
0.0228173
0.0174666
0.0130571
0.00946605
0.00641349
0.00358596
0.000798381
0.358508
-0.138841
0.391089
0.0175142
0.0349354
0.013171
-0.00149704
-0.0115615
-0.0179949
-0.0218602
-0.0232853
-0.0229473
-0.021903
-0.0190013
-0.0141578
-0.00756726
0.000627821
0.010358
0.0213982
0.0334339
0.0461058
0.0589893
0.0716647
0.0837686
0.0950327
0.105304
0.114551
0.122834
0.1302
0.136563
0.141852
0.146168
0.149668
0.152476
0.154711
0.156492
0.157913
0.159016
0.159848
0.160344
0.160767
0.161675
0.162325
0.162741
0.162791
0.162152
0.160503
0.15751
0.152914
0.146566
0.138445
0.128656
0.117413
0.105021
0.0918562
0.0783468
0.0649565
0.0521758
0.0405197
0.0305093
0.022641
0.0173657
0.0149939
0.0156776
0.0186983
0.0241694
0.0316564
0.0403052
0.0496618
0.0592768
0.0685975
0.0772478
0.0849621
0.0914426
0.0967495
0.100953
0.103676
0.105015
0.105448
0.105163
0.103682
0.101174
0.0976739
0.0932448
0.0879503
0.0818789
0.0751432
0.0678799
0.0602489
0.0524341
0.0446434
0.0371039
0.0300464
0.0236807
0.0181586
0.0135293
0.00971056
0.00650238
0.00364319
0.000841898
0.354726
-0.12507
0.406323
0.029741
0.0454929
0.022326
0.00545364
-0.00703993
-0.0158843
-0.0219774
-0.0254565
-0.0270261
-0.0271309
-0.0254993
-0.0221377
-0.0170724
-0.0102796
-0.00162389
0.00877913
0.0206137
0.0334257
0.0467069
0.0599919
0.0728955
0.0851293
0.0965092
0.106946
0.116448
0.125019
0.132612
0.139054
0.144354
0.148592
0.151855
0.154218
0.155765
0.156565
0.156731
0.156323
0.156013
0.155623
0.154959
0.154272
0.15356
0.152766
0.151733
0.150218
0.14794
0.144624
0.140043
0.134048
0.126579
0.117672
0.107456
0.0961447
0.0840287
0.0714752
0.0589247
0.0468906
0.035958
0.02676
0.0199237
0.0160511
0.0148059
0.015679
0.0193194
0.0255669
0.0337227
0.0429939
0.0527223
0.06232
0.0713029
0.0791382
0.0859022
0.091279
0.0949312
0.0970196
0.0984339
0.0987666
0.0980211
0.0964648
0.0941682
0.0911797
0.0875087
0.0831625
0.0781597
0.0725407
0.0663708
0.0597449
0.0527925
0.0456798
0.0386028
0.0317699
0.0253787
0.0195925
0.0145178
0.0101886
0.00655951
0.00351234
0.000781168
0.39226
-0.141581
0.427094
0.0441487
0.0560227
0.0322159
0.0135771
-0.000791698
-0.0115162
-0.0195165
-0.0253969
-0.0286574
-0.0302832
-0.0301691
-0.0284647
-0.0250913
-0.0198415
-0.0124084
-0.00283646
0.00850631
0.0210822
0.0343481
0.0478424
0.0611969
0.074131
0.0864436
0.0979952
0.108709
0.11855
0.127427
0.13509
0.141445
0.1465
0.1503
0.152868
0.154243
0.154559
0.153959
0.153241
0.152131
0.150537
0.148688
0.146724
0.144773
0.142881
0.141016
0.139067
0.13686
0.134176
0.130789
0.126495
0.121135
0.114613
0.106901
0.0980495
0.0881906
0.0775494
0.0664527
0.0553437
0.0447806
0.035467
0.028075
0.0225314
0.0187807
0.0177758
0.0196051
0.0240135
0.0305403
0.0385694
0.0474155
0.0564344
0.0648997
0.072764
0.0792428
0.0839763
0.0872783
0.0896745
0.090626
0.0904821
0.089516
0.0879053
0.0857781
0.0831918
0.0801631
0.076686
0.0727486
0.0683419
0.063467
0.0581428
0.0524163
0.046369
0.0401144
0.0337917
0.0275591
0.0215879
0.0160513
0.0111067
0.00687653
0.00343433
0.000681593
0.37566
-0.126405
0.425521
0.0628324
0.0647345
0.0417886
0.0224803
0.00689439
-0.00523005
-0.0151696
-0.0232051
-0.028376
-0.0313128
-0.0331888
-0.0332394
-0.0315623
-0.0278146
-0.0216187
-0.0130286
-0.00247492
0.00946992
0.0222849
0.0355522
0.0489513
0.0622362
0.0752093
0.0876958
0.0995296
0.110582
0.120701
0.12968
0.137218
0.143204
0.147625
0.150454
0.151784
0.151729
0.151197
0.149997
0.14805
0.145582
0.142754
0.139725
0.136631
0.133588
0.130673
0.127909
0.12525
0.122583
0.119751
0.116568
0.112849
0.10843
0.103183
0.0970272
0.0899445
0.0819997
0.0733791
0.0644103
0.0555603
0.0472803
0.0396972
0.0332852
0.0284664
0.025723
0.02531
0.0272411
0.0313062
0.0370918
0.0440251
0.0513039
0.0588068
0.0655177
0.0709692
0.0754968
0.0789218
0.0808412
0.0815371
0.0812349
0.0801861
0.078597
0.0766146
0.074334
0.0718054
0.0690456
0.0660462
0.0627778
0.0591952
0.0552477
0.0508935
0.0461136
0.0409211
0.0353699
0.0295659
0.0236731
0.0179061
0.0125099
0.00773068
0.00378608
0.000720889
0.396223
-0.117619
0.430002
0.0800638
0.0764524
0.052283
0.0321661
0.0155586
0.00211557
-0.00920963
-0.0191589
-0.0266712
-0.0315131
-0.0349153
-0.0364723
-0.0363485
-0.0339532
-0.0289123
-0.0213975
-0.0119002
-0.00096005
0.0109783
0.0235772
0.0365898
0.0498249
0.063107
0.0762437
0.0890084
0.101173
0.112508
0.122735
0.131457
0.138448
0.143546
0.146753
0.148067
0.148508
0.147847
0.146076
0.14354
0.140438
0.13692
0.133099
0.129097
0.125053
0.12111
0.117392
0.113974
0.110871
0.10803
0.105345
0.102676
0.0998627
0.0967436
0.0931691
0.0890164
0.0841904
0.0786962
0.0727482
0.0666268
0.0598468
0.0531087
0.0469706
0.0417429
0.0377715
0.0353828
0.0347876
0.0360249
0.0389183
0.0430293
0.0479918
0.0532134
0.0580093
0.0625839
0.0665257
0.0693417
0.0710138
0.0716207
0.0713456
0.070387
0.0689351
0.0671526
0.0651662
0.0630654
0.0609015
0.0586843
0.0563793
0.0539117
0.0511812
0.0480829
0.0445259
0.0404507
0.0358435
0.0307544
0.0253119
0.019721
0.0142418
0.0091547
0.00471053
0.000995999
0.396798
-0.104089
0.426512
0.0902539
0.0873778
0.0632332
0.0423461
0.0246663
0.0100611
-0.00229026
-0.0135435
-0.02343
-0.0304627
-0.0353624
-0.0382964
-0.0394884
-0.0381484
-0.0341005
-0.0276997
-0.0194486
-0.00980544
0.000894827
0.0124208
0.0246218
0.0373817
0.0505641
0.0639718
0.0773339
0.0903345
0.102667
0.113984
0.123848
0.131809
0.137651
0.141206
0.143542
0.144217
0.143282
0.141225
0.13836
0.134904
0.130981
0.126674
0.122075
0.117312
0.11255
0.10797
0.103737
0.0999779
0.0967599
0.0940911
0.0919262
0.090172
0.0886982
0.0873265
0.0858918
0.0842791
0.0821453
0.0791652
0.0753242
0.0711
0.0664554
0.0615399
0.0566521
0.0521381
0.0483549
0.0456097
0.0440959
0.0438436
0.0446012
0.0465783
0.0488827
0.0518276
0.0548022
0.0574007
0.0594049
0.0606774
0.0612001
0.0610342
0.0602968
0.0591316
0.0576874
0.0561009
0.0544838
0.0529087
0.0513934
0.0498888
0.0482894
0.0464738
0.0443254
0.0417344
0.0386226
0.0349524
0.0307351
0.0260447
0.0210211
0.0158514
0.0107372
0.0058658
0.0013913
0.384251
-0.0854692
0.437135
0.0992769
0.0987698
0.0742936
0.0525899
0.0338947
0.0180509
0.00460188
-0.00748883
-0.0186443
-0.0280214
-0.0343695
-0.0389839
-0.0411819
-0.0405124
-0.0372934
-0.0319876
-0.0250544
-0.016861
-0.00763118
0.00251577
0.0135357
0.0254025
0.0380372
0.0512601
0.0647848
0.0782443
0.0912475
0.103361
0.114072
0.122865
0.129298
0.134326
0.137286
0.138113
0.137324
0.135327
0.132463
0.128947
0.124905
0.120411
0.115537
0.110391
0.105127
0.0999439
0.0950573
0.0906733
0.0869657
0.0840611
0.0820262
0.0808643
0.0804927
0.0807857
0.0813091
0.0817079
0.0822692
0.0824073
0.081781
0.0804211
0.0781654
0.0750272
0.0711672
0.0668487
0.0623936
0.0581459
0.0543431
0.051062
0.0488337
0.0477078
0.0473747
0.047603
0.0482629
0.0491231
0.0499488
0.0505546
0.0508203
0.0507013
0.0502206
0.0494528
0.0485031
0.0474844
0.0464925
0.0455809
0.0447395
0.0438999
0.0429337
0.0416751
0.0401038
0.0381782
0.0358133
0.0329432
0.029544
0.025636
0.0212841
0.0165933
0.0116932
0.0067129
0.00172127
0.422572
-0.111981
0.459862
0.109385
0.110122
0.0857746
0.0631521
0.0433945
0.026248
0.0115783
-0.00153842
-0.0137896
-0.0244984
-0.032412
-0.0382558
-0.041063
-0.0410625
-0.0387521
-0.0345835
-0.0289798
-0.0222601
-0.0145713
-0.00594499
0.0036655
0.0143189
0.0260021
0.0385729
0.0517537
0.0651575
0.0783359
0.0907865
0.101966
0.1112
0.119179
0.125097
0.12862
0.130094
0.129886
0.128381
0.125888
0.122634
0.118765
0.114373
0.109533
0.104339
0.09893
0.0934941
0.0882602
0.0834756
0.0793806
0.0761841
0.0740437
0.0730226
0.073054
0.0737105
0.0752102
0.0775549
0.0803633
0.0828829
0.0850785
0.0864409
0.0866625
0.0855927
0.0832427
0.079756
0.0753468
0.0702841
0.0651603
0.0601428
0.0555895
0.0514375
0.0480468
0.0455038
0.0437477
0.0426427
0.0420041
0.04164
0.0413856
0.0411267
0.0408084
0.0404304
0.0400298
0.039655
0.0393333
0.0390381
0.0386746
0.0381
0.0373483
0.0364567
0.0353582
0.0339761
0.0322361
0.0300731
0.027441
0.0243143
0.0206892
0.0165852
0.0120466
0.0071455
0.00192282
0.400119
-0.0946946
0.454963
0.129521
0.119984
0.0964231
0.0735006
0.0527189
0.0342615
0.0183538
0.00430424
-0.00833333
-0.0197623
-0.029298
-0.0357146
-0.0391791
-0.040104
-0.0388922
-0.0359475
-0.0316808
-0.026398
-0.0202039
-0.0130787
-0.0049299
0.00434564
0.0147834
0.0262905
0.0386244
0.0514035
0.0641478
0.076347
0.087435
0.097829
0.106585
0.113162
0.11763
0.120144
0.120973
0.120397
0.118679
0.116042
0.11266
0.108659
0.104141
0.0992086
0.0939919
0.0886605
0.0834269
0.0785313
0.0742248
0.0707471
0.0682865
0.0669187
0.0664446
0.0670895
0.0691088
0.0724009
0.0762711
0.0806231
0.0848751
0.0884661
0.0909081
0.0918694
0.0912128
0.0890137
0.0855826
0.0811761
0.0755381
0.069544
0.0630632
0.056719
0.0509394
0.0459899
0.0419773
0.0388883
0.0366267
0.0350492
0.0339995
0.0333358
0.0329469
0.0327541
0.0327024
0.0327464
0.0328349
0.0329006
0.0328547
0.0325993
0.032137
0.0314779
0.0306146
0.0295246
0.0281774
0.0265294
0.0245221
0.0220871
0.019156
0.015675
0.0116222
0.00702831
0.00193469
0.410366
-0.090633
0.453871
0.14949
0.134327
0.108201
0.0839462
0.0619402
0.0423035
0.025375
0.0110083
-0.00204127
-0.0142167
-0.0241909
-0.0313041
-0.0357059
-0.0377959
-0.038022
-0.0365563
-0.03374
-0.0298678
-0.025045
-0.0192573
-0.0124376
-0.00450797
0.0045701
0.0147424
0.0258196
0.0374685
0.0492316
0.060711
0.0721288
0.0825924
0.0915921
0.0989179
0.104491
0.108349
0.11059
0.111357
0.110828
0.10919
0.106626
0.103304
0.0993705
0.0949582
0.0902037
0.0852607
0.080306
0.0755422
0.0711896
0.0674651
0.0645425
0.0624731
0.0613197
0.061571
0.0634431
0.0665188
0.070853
0.0760282
0.0814748
0.0865659
0.0907026
0.0933906
0.094345
0.0936217
0.0916932
0.0883983
0.0837427
0.0775482
0.0704193
0.0629563
0.0556898
0.0490148
0.0431883
0.0383387
0.0344884
0.0315814
0.029511
0.028143
0.0273324
0.0269334
0.0268095
0.0268443
0.0269487
0.0270582
0.0271207
0.0270823
0.0269007
0.0265474
0.0259901
0.025187
0.0241438
0.0228713
0.0213356
0.0194573
0.0171298
0.0142462
0.0107304
0.00657279
0.00179673
0.401111
-0.0876996
0.439831
0.159561
0.147247
0.120538
0.0948011
0.0714596
0.0509547
0.0333834
0.018149
0.00497899
-0.0066731
-0.0170929
-0.0254469
-0.0312375
-0.0348527
-0.0367432
-0.0369673
-0.035732
-0.0332397
-0.0296054
-0.0248912
-0.0191422
-0.0123801
-0.00461505
0.00411784
0.0137075
0.0239253
0.0345802
0.0455374
0.0561446
0.0661102
0.0751433
0.0830433
0.0896841
0.0949634
0.0988155
0.101222
0.102225
0.101931
0.100501
0.0981272
0.0950025
0.0913054
0.0871975
0.0828275
0.0783456
0.0739124
0.0697005
0.0658798
0.0625807
0.0598191
0.058018
0.0576537
0.0585537
0.0610628
0.0650436
0.0701288
0.0758172
0.0815157
0.0865934
0.0904727
0.0927126
0.0932821
0.0929792
0.0914528
0.0879955
0.082764
0.0761772
0.0687788
0.0611056
0.053625
0.0467022
0.0405883
0.035425
0.0312607
0.0280665
0.025753
0.0241854
0.0232011
0.0226312
0.0223229
0.0221557
0.0220491
0.0219578
0.0218552
0.021717
0.0215152
0.0212298
0.0208123
0.0201706
0.0193331
0.0182879
0.0169541
0.0152032
0.01289
0.00989061
0.0061492
0.0016293
0.367549
-0.0682855
0.442524
0.164201
0.15912
0.133019
0.10621
0.0818518
0.060387
0.0416353
0.0261743
0.0134283
0.00195622
-0.00876681
-0.0185015
-0.0261482
-0.0316095
-0.0352665
-0.0374089
-0.0378083
-0.036579
-0.0339177
-0.0300334
-0.0251138
-0.0193111
-0.0127307
-0.00541585
0.00265088
0.0115324
0.0210621
0.0307073
0.0402532
0.0495275
0.0583379
0.0665362
0.073968
0.0804598
0.0858244
0.0898948
0.0925635
0.093819
0.0937578
0.0925601
0.090447
0.0876392
0.0843323
0.0806909
0.0768586
0.0729696
0.0691548
0.0655304
0.062155
0.0590776
0.0568667
0.0555223
0.0555594
0.0571303
0.0601294
0.0643174
0.0693192
0.0746403
0.0797159
0.0839557
0.0871435
0.0891115
0.0898605
0.0895229
0.087581
0.0839195
0.0787396
0.0724155
0.0653944
0.0581225
0.0509979
0.0443423
0.0383889
0.0332825
0.0290834
0.0257739
0.0232707
0.0214469
0.0201579
0.0192617
0.0186318
0.0181671
0.0178085
0.0175517
0.0174046
0.0173104
0.0171227
0.0168611
0.0165685
0.0162145
0.0157189
0.014956
0.0137666
0.0119772
0.00942372
0.00599841
0.00154683
0.413878
-0.12879
0.453272
0.161123
0.164379
0.144714
0.118497
0.0929186
0.0703132
0.0513199
0.0353514
0.0224162
0.0109702
-9.06315e-05
-0.011037
-0.020808
-0.0287119
-0.0343106
-0.0378098
-0.039487
-0.0394155
-0.037737
-0.0346392
-0.0303964
-0.0253327
-0.0197249
-0.0136961
-0.00713308
0.000338043
0.00851312
0.0168816
0.0253014
0.0337641
0.0422052
0.0504391
0.0582663
0.0654838
0.0718859
0.0772626
0.0814131
0.0842021
0.0856169
0.0857743
0.0848788
0.0831668
0.0808612
0.0781508
0.0751901
0.0721081
0.0690123
0.065973
0.0629801
0.0601062
0.0576105
0.0558109
0.0551143
0.0555874
0.057229
0.0599344
0.0634815
0.067524
0.0716193
0.0755615
0.0789111
0.0812258
0.0826621
0.0832549
0.082625
0.0805872
0.0771559
0.0725086
0.0669295
0.0607534
0.0543211
0.0479493
0.0419095
0.0364137
0.031602
0.0275347
0.0241954
0.0215148
0.0194106
0.0178214
0.0166869
0.0159109
0.0153463
0.0148327
0.0144238
0.0141837
0.014113
0.0141626
0.0142654
0.0143323
0.0142446
0.0138593
0.0130141
0.0115348
0.00924561
0.00600473
0.00153994
0.390421
-0.114098
0.424291
0.163681
0.16307
0.150786
0.129414
0.10485
0.0816115
0.0618386
0.045099
0.0312965
0.0192646
0.00763257
-0.00440738
-0.015752
-0.0252484
-0.0325867
-0.0375789
-0.0405398
-0.0417375
-0.0410963
-0.0387413
-0.035068
-0.0305855
-0.025745
-0.0207875
-0.015605
-0.00968163
-0.00285123
0.00434964
0.0117967
0.0195024
0.0274111
0.0353513
0.0431042
0.0504863
0.0573546
0.0635293
0.0687658
0.0728357
0.0756271
0.0771764
0.0776361
0.0772194
0.0761487
0.0746241
0.0728112
0.0708419
0.068809
0.0667579
0.0645943
0.0624294
0.0601516
0.0583701
0.057163
0.056626
0.0568239
0.0577689
0.0593896
0.0615181
0.0639501
0.0666693
0.0691313
0.071182
0.0728358
0.0738883
0.0741275
0.0733848
0.071581
0.0687389
0.0649725
0.0604619
0.0554259
0.0500994
0.0447166
0.0395006
0.0346519
0.0303177
0.0265647
0.0233795
0.0206678
0.018342
0.0164597
0.0150486
0.01409
0.013511
0.0132283
0.0131829
0.0133185
0.013563
0.0138237
0.0139917
0.0139466
0.0135598
0.0126957
0.0112126
0.00896225
0.00581586
0.00149645
0.392044
-0.121455
0.409329
0.167093
0.162916
0.152366
0.137069
0.11629
0.0935333
0.0726678
0.0546352
0.0392856
0.0260593
0.0138867
0.00220225
-0.0100071
-0.0206938
-0.0299457
-0.0365007
-0.0410191
-0.0433917
-0.0436521
-0.04206
-0.0390839
-0.0352988
-0.0312322
-0.0271951
-0.0231181
-0.0185071
-0.0129793
-0.00690572
-0.000400351
0.00653074
0.0138032
0.0212162
0.0286025
0.0358368
0.0427945
0.0492918
0.0550919
0.0599792
0.0638267
0.0666201
0.0684435
0.069449
0.069823
0.0697484
0.06937
0.068815
0.0681811
0.0673871
0.066457
0.0651474
0.0637837
0.0623904
0.0610115
0.059731
0.0586582
0.0578946
0.0575032
0.0574972
0.0580621
0.0589525
0.0600381
0.0612275
0.0623661
0.0633004
0.063865
0.0639066
0.063308
0.062002
0.0599778
0.0572786
0.0539931
0.0502414
0.0461547
0.0418505
0.0374591
0.0331873
0.0292088
0.0256489
0.0225781
0.0200149
0.0179616
0.0164144
0.0153462
0.0146995
0.0143932
0.0143342
0.0144232
0.0145557
0.0146243
0.0145231
0.0141506
0.0134134
0.012227
0.0105124
0.00818754
0.00518039
0.00132712
0.37722
-0.122954
0.370531
0.16229
0.159302
0.149763
0.139538
0.123903
0.104036
0.0829351
0.0635573
0.0464814
0.0319398
0.0191596
0.00737011
-0.00455194
-0.0160509
-0.0260222
-0.0343783
-0.0401879
-0.043604
-0.0448835
-0.0443588
-0.0424699
-0.0397501
-0.036701
-0.0336123
-0.0304095
-0.0266707
-0.0221451
-0.0170576
-0.0114538
-0.00535266
0.00117512
0.00798546
0.0148978
0.0217708
0.0284693
0.0348438
0.0407393
0.0460182
0.0505872
0.0544128
0.057518
0.0599622
0.0618671
0.0634258
0.0647591
0.0657741
0.0665331
0.0672692
0.0678781
0.0679883
0.0677592
0.0670441
0.0658103
0.0641188
0.0621013
0.0599306
0.0577951
0.0559065
0.0545724
0.0536353
0.0531134
0.0529673
0.0531268
0.0534858
0.053902
0.0542093
0.0542639
0.0539453
0.0531641
0.0518691
0.0500514
0.0477445
0.0450185
0.041965
0.0386858
0.0353015
0.0319498
0.0287669
0.0258736
0.0233598
0.0212775
0.019639
0.0184207
0.017568
0.0170011
0.0166207
0.0163151
0.0159737
0.0155019
0.0148272
0.0138926
0.0126473
0.0110572
0.00912001
0.00683762
0.00418184
0.00104027
0.329949
-0.0950495
0.360433
0.154239
0.154622
0.144762
0.136102
0.125961
0.110374
0.0910422
0.0713158
0.0530997
0.0373268
0.0238274
0.0117806
0.000305452
-0.0114448
-0.0219079
-0.0308572
-0.0375721
-0.0421069
-0.0446851
-0.0456431
-0.0453213
-0.0441336
-0.0424364
-0.0404099
-0.0379233
-0.0346795
-0.0308664
-0.0265006
-0.0215951
-0.0161942
-0.0103797
-0.00426468
0.0019976
0.0082749
0.0144597
0.0204647
0.0262184
0.0316514
0.0366911
0.0413085
0.0455558
0.0494374
0.0527944
0.0556279
0.0582759
0.060927
0.0636214
0.066312
0.0684926
0.0702354
0.0712794
0.0714372
0.0706227
0.0688647
0.0663002
0.0631595
0.0597356
0.0565383
0.0535909
0.0510118
0.048899
0.0472848
0.0461548
0.0454706
0.0451697
0.0451573
0.045309
0.0454842
0.0455417
0.0453565
0.0448333
0.0439157
0.0425892
0.040878
0.0388373
0.0365486
0.0341136
0.0316456
0.0292567
0.0270422
0.0250674
0.0233594
0.0219099
0.0206838
0.0196267
0.0186666
0.0177125
0.0166621
0.0154448
0.0140597
0.0125587
0.0110122
0.00936769
0.00754236
0.00550998
0.00326548
0.000721428
0.378472
-0.162674
0.37454
0.139112
0.145894
0.138067
0.129918
0.121824
0.111558
0.0958166
0.0773306
0.0592719
0.0427539
0.0285174
0.0163099
0.0050946
-0.00610526
-0.0168631
-0.0261737
-0.0337935
-0.0396374
-0.0437446
-0.0464876
-0.0480738
-0.0487144
-0.0485585
-0.0474953
-0.0455074
-0.0428905
-0.0396395
-0.0357796
-0.0313619
-0.0264684
-0.0212088
-0.0157081
-0.0100924
-0.00444019
0.0012025
0.00680245
0.0123392
0.0178392
0.0232816
0.0284033
0.0331199
0.0376642
0.0421276
0.0465067
0.0508458
0.0552325
0.0596895
0.0640543
0.0678514
0.0710428
0.0732998
0.0743876
0.074174
0.0726616
0.0699859
0.0664107
0.0624891
0.0584578
0.0544473
0.0506751
0.0472974
0.0444064
0.0420542
0.0402688
0.0390499
0.0383575
0.0381083
0.0381828
0.0384407
0.0387384
0.0389435
0.0389476
0.0386733
0.0380793
0.0371591
0.035939
0.0344713
0.0328262
0.0310799
0.0293027
0.0275492
0.0258486
0.0241976
0.0225729
0.0209602
0.0193689
0.0178403
0.0164005
0.0149271
0.0133377
0.0116145
0.00979359
0.00792731
0.00605001
0.00417862
0.00231924
0.000372944
0.349298
-0.171134
0.344539
0.137151
0.134077
0.127918
0.121094
0.114129
0.106545
0.0964722
0.0810971
0.0642035
0.0480542
0.0334783
0.0211231
0.0103818
9.21403e-05
-0.0105365
-0.0205003
-0.0295111
-0.0368223
-0.042674
-0.0473608
-0.0510013
-0.0534186
-0.0543386
-0.054249
-0.0532244
-0.0512892
-0.0485475
-0.0451186
-0.0411149
-0.0366364
-0.0317897
-0.0266991
-0.0215067
-0.0162704
-0.0109684
-0.00556961
-0.00016087
0.00503739
0.0102188
0.0155222
0.0209283
0.0264062
0.0319548
0.0375704
0.0432515
0.0489864
0.054695
0.0601501
0.065188
0.0694765
0.0727026
0.0746191
0.0750623
0.0740142
0.0717541
0.0686291
0.0647958
0.0605029
0.056048
0.0516718
0.0475564
0.0438295
0.0405787
0.0378658
0.0357298
0.0341777
0.0331762
0.0326542
0.0325121
0.032633
0.0328945
0.0331786
0.033382
0.0334232
0.0332477
0.032828
0.0321615
0.0312636
0.0301594
0.0288788
0.0274622
0.0259672
0.0244639
0.022937
0.0213455
0.0196656
0.0179003
0.0160813
0.0142379
0.0123817
0.0105205
0.00866903
0.00684908
0.00508317
0.00338698
0.00176464
0.000137699
0.349331
-0.179037
0.320459
0.140026
0.128195
0.118691
0.111169
0.104478
0.0980748
0.0912152
0.0817127
0.0677874
0.0528233
0.0386939
0.0262459
0.0156231
0.00556967
-0.00477356
-0.015523
-0.0253729
-0.0345289
-0.042412
-0.0489582
-0.0537828
-0.057372
-0.0597752
-0.0608881
-0.0607634
-0.059508
-0.0572595
-0.0542402
-0.0506513
-0.0465985
-0.0421572
-0.0374028
-0.0324272
-0.02738
-0.0223348
-0.0172692
-0.0120995
-0.00678573
-0.00130021
0.00440147
0.0103329
0.0164747
0.0227961
0.0292619
0.03582
0.0423715
0.0487367
0.054693
0.0602624
0.0650915
0.0688599
0.0714029
0.0726608
0.072627
0.0712816
0.0687808
0.0654063
0.0614434
0.0571532
0.0527507
0.0484095
0.0442942
0.0405284
0.0371881
0.034318
0.031955
0.03011
0.0287656
0.0278773
0.0273782
0.0271848
0.0272043
0.0273428
0.0275131
0.02764
0.027664
0.0275432
0.0272554
0.0267997
0.0261673
0.0253403
0.0243148
0.023109
0.0217503
0.0202616
0.0186623
0.0169741
0.0152259
0.013453
0.0116915
0.0099671
0.0082874
0.00664283
0.00501243
0.00337558
0.00173161
7.15554e-05
0.334168
-0.182173
0.268636
0.131821
0.119686
0.108778
0.100398
0.0935925
0.0878045
0.0825888
0.0768459
0.0681813
0.0560301
0.0429621
0.030564
0.0197311
0.009849
-0.00015461
-0.011369
-0.0227643
-0.0334312
-0.0425845
-0.0500935
-0.0564062
-0.0613884
-0.0649421
-0.0670098
-0.0676443
-0.0672261
-0.065804
-0.0634067
-0.0602348
-0.0564985
-0.052348
-0.0478792
-0.0431537
-0.0382298
-0.0331427
-0.0278986
-0.0224761
-0.016852
-0.0110065
-0.00492862
0.00138414
0.00792224
0.0146616
0.0215557
0.0285182
0.0354
0.0419924
0.0480957
0.053666
0.058621
0.0627437
0.0657901
0.0676063
0.0681734
0.0675684
0.065938
0.0634747
0.0603905
0.0568269
0.0529169
0.0488286
0.0447263
0.0407535
0.0370234
0.0336201
0.0306056
0.0280247
0.0259026
0.0242416
0.0230199
0.0221939
0.021703
0.0214775
0.0214445
0.0215342
0.0216803
0.021819
0.0218926
0.0218549
0.0216715
0.0213175
0.0207777
0.0200515
0.0191532
0.018107
0.0169408
0.0156795
0.0143396
0.0129239
0.0114449
0.00993587
0.00841894
0.00689659
0.00534951
0.00374122
0.0020318
0.000129971
0.273583
-0.143305
0.249611
0.118964
0.109281
0.0975527
0.0886114
0.0818426
0.0765363
0.0721316
0.0681221
0.0633721
0.0557095
0.0448593
0.0331594
0.0220673
0.0117946
0.00166057
-0.00903123
-0.0212103
-0.032351
-0.0427567
-0.0515272
-0.0588707
-0.064734
-0.0690772
-0.0722666
-0.0741593
-0.0746557
-0.0739233
-0.0721628
-0.0695653
-0.0663014
-0.062497
-0.0582253
-0.0535432
-0.0485419
-0.043257
-0.0377014
-0.0318898
-0.0258487
-0.0196026
-0.0131721
-0.00657353
0.000178501
0.00705777
0.0140115
0.0209453
0.027717
0.0341567
0.0401083
0.0454702
0.0501585
0.0540696
0.0571015
0.0591917
0.0603351
0.0605782
0.0600064
0.058732
0.0568152
0.054315
0.051329
0.0479715
0.0443655
0.0406327
0.0368893
0.0332431
0.029794
0.0266319
0.023832
0.0214479
0.0195057
0.0180026
0.0169092
0.0161778
0.015752
0.0155694
0.0155812
0.0157337
0.0159603
0.0161919
0.0163663
0.0164343
0.0163625
0.0161323
0.0157405
0.0151968
0.014521
0.0137382
0.012873
0.0119426
0.0109522
0.00989588
0.00875491
0.00749615
0.00607447
0.00443851
0.00254642
0.000293721
0.327527
-0.225292
0.263006
0.0959084
0.0938724
0.084226
0.0758156
0.0694017
0.0644978
0.0605297
0.0571305
0.0538345
0.0496096
0.0427554
0.0325692
0.0215173
0.010837
0.000369454
-0.0101585
-0.0211323
-0.0327867
-0.0432274
-0.0528174
-0.06089
-0.0677536
-0.073183
-0.077108
-0.0796346
-0.0808807
-0.0809725
-0.0800526
-0.0782551
-0.0756908
-0.0724406
-0.068551
-0.0640466
-0.0589708
-0.0534453
-0.0475456
-0.0413288
-0.0348634
-0.0282133
-0.0214368
-0.0145864
-0.00770392
-0.000836752
0.00594839
0.0125584
0.0188795
0.0247968
0.0302144
0.0350664
0.0393153
0.0429411
0.0459311
0.0482776
0.0499798
0.0510472
0.0515039
0.0513691
0.0506422
0.0493432
0.0475078
0.0451869
0.0424459
0.0393638
0.0360331
0.0325596
0.029059
0.0256512
0.0224514
0.0195582
0.0170445
0.014949
0.0132737
0.0119854
0.0110268
0.0103821
0.0100413
0.00997006
0.0101132
0.0104033
0.0107706
0.011152
0.0114963
0.0117654
0.0119338
0.0119879
0.0119232
0.0117411
0.0114439
0.0110296
0.010487
0.00979324
0.00891513
0.00781339
0.00644724
0.00477882
0.00278814
0.000405107
0.300531
-0.236924
0.233123
0.0863019
0.0766332
0.0681237
0.0609582
0.0553205
0.0509331
0.0474325
0.0444411
0.0415728
0.0383532
0.0340115
0.0272917
0.0174427
0.00701131
-0.00322352
-0.013224
-0.0231693
-0.0341361
-0.0448779
-0.0548106
-0.0633085
-0.0703886
-0.0761085
-0.0805349
-0.0837473
-0.0858413
-0.0869048
-0.0870086
-0.0862056
-0.0845325
-0.0820147
-0.0786739
-0.0745332
-0.0696448
-0.0641261
-0.0580784
-0.0516079
-0.0448266
-0.0378432
-0.0307586
-0.0236701
-0.0166672
-0.00983296
-0.00325486
0.00297731
0.00878266
0.014104
0.0189163
0.0232254
0.0270584
0.030449
0.0334236
0.0359925
0.0381498
0.0398795
0.0411639
0.0419883
0.0423322
0.0421764
0.0415099
0.0403298
0.0386461
0.0364887
0.0339125
0.0309985
0.0278517
0.0245946
0.0213572
0.0182656
0.0154297
0.0129321
0.0108184
0.00908981
0.00770142
0.00663208
0.00588783
0.00546404
0.00533786
0.00546884
0.0058059
0.00629336
0.00687509
0.00749747
0.00810992
0.00866697
0.0091295
0.00946469
0.00964437
0.00964217
0.00943068
0.00898116
0.008267
0.00726893
0.00597801
0.00439473
0.00253285
0.000369155
0.298862
-0.246053
0.204664
0.0845302
0.0660443
0.0539571
0.0456338
0.0396873
0.0353588
0.0321224
0.0294285
0.0268056
0.0239043
0.0204017
0.0158535
0.00933015
0.000411331
-0.00891341
-0.0182692
-0.0276308
-0.0371697
-0.0474455
-0.0567993
-0.0652069
-0.0723743
-0.0783571
-0.083273
-0.0871944
-0.0901731
-0.0922389
-0.0933985
-0.0936428
-0.0929544
-0.0913147
-0.0887143
-0.0851527
-0.0806755
-0.0754129
-0.0694926
-0.0630313
-0.0561547
-0.0490011
-0.0417088
-0.0344198
-0.0272776
-0.0204118
-0.013936
-0.00794209
-0.00248853
0.00241013
0.00678338
0.010693
0.0142144
0.0174179
0.0203555
0.0230536
0.0255142
0.0277191
0.0296363
0.0312263
0.0324467
0.033256
0.0336216
0.0335187
0.0329161
0.0317992
0.0301809
0.0281051
0.0256452
0.0228998
0.0199854
0.0170277
0.0141525
0.011475
0.00908902
0.00705604
0.00539582
0.00409088
0.00309925
0.00240328
0.0020029
0.00188623
0.00203418
0.00241905
0.00299971
0.00372319
0.00452747
0.00534425
0.00610527
0.00674771
0.00721748
0.00747051
0.00747308
0.00720238
0.00664853
0.00581989
0.00474221
0.0034461
0.00194532
0.000204927
0.288265
-0.246362
0.145905
0.0714772
0.0527339
0.0391871
0.0294153
0.022504
0.0177019
0.0143076
0.0116498
0.00922212
0.0066865
0.00380689
0.000393548
-0.00387175
-0.00971403
-0.0172827
-0.0252193
-0.0332101
-0.0414039
-0.0501937
-0.0590025
-0.0671902
-0.0743453
-0.0805838
-0.0860145
-0.0906599
-0.0944995
-0.0974998
-0.0996186
-0.100812
-0.101041
-0.100272
-0.0984868
-0.0956797
-0.0918681
-0.0871153
-0.081575
-0.0753779
-0.0686529
-0.0615477
-0.0542208
-0.0468422
-0.0395914
-0.0326449
-0.0261501
-0.0202124
-0.0148863
-0.0101692
-0.00600661
-0.00230807
0.00103035
0.00410563
0.00699373
0.00974297
0.012373
0.0148769
0.0172257
0.0193741
0.0212669
0.0228475
0.0240666
0.0248915
0.0252766
0.0251782
0.0245768
0.0234809
0.0219268
0.019976
0.0177114
0.0152331
0.0126532
0.010089
0.00765425
0.00544894
0.00354958
0.00200271
0.000822283
-3.47874e-06
-0.000502121
-0.000713958
-0.000684922
-0.000427264
4.03236e-05
0.000682221
0.00144738
0.00227194
0.00308421
0.00381387
0.00439895
0.00479056
0.00495822
0.00489407
0.00459932
0.00406016
0.00328703
0.00231678
0.00120732
-4.17087e-05
0.214831
-0.188257
0.124633
0.0563669
0.0381656
0.0231654
0.011839
0.00369562
-0.00198658
-0.00596802
-0.0088751
-0.0111745
-0.0132299
-0.0153272
-0.0176727
-0.0204191
-0.0238151
-0.0284076
-0.0342173
-0.0404062
-0.046848
-0.0538678
-0.0620215
-0.0699137
-0.0772936
-0.0839641
-0.0899203
-0.0951711
-0.0996583
-0.103325
-0.106122
-0.108004
-0.108933
-0.108877
-0.107813
-0.105731
-0.102641
-0.0985856
-0.093673
-0.0880037
-0.0816961
-0.0748954
-0.0677695
-0.0605033
-0.0532936
-0.0463372
-0.0398105
-0.0338419
-0.0284972
-0.0237787
-0.0196326
-0.0159649
-0.0126637
-0.00962019
-0.00674281
-0.00396552
-0.00125028
0.00141321
0.00400979
0.00650322
0.00884257
0.0109751
0.0128608
0.0144433
0.0156612
0.0164652
0.0168223
0.016719
0.0161616
0.0151762
0.0138078
0.0121202
0.0101942
0.00812438
0.00601327
0.00396407
0.00207245
0.000419254
-0.000935344
-0.00195491
-0.00262757
-0.00296554
-0.00300269
-0.00278465
-0.00236067
-0.00178111
-0.00109274
-0.000339934
0.000425277
0.00114953
0.00178478
0.00228748
0.00261477
0.00273616
0.00263967
0.00233173
0.00183706
0.00120007
0.000485549
-0.000294776
0.26815
-0.27965
0.138135
0.0339465
0.0199232
0.00522242
-0.00713963
-0.0165639
-0.0234322
-0.0283029
-0.0316527
-0.0339084
-0.0354618
-0.0366501
-0.0377361
-0.0389121
-0.0403433
-0.0423232
-0.0453495
-0.0494192
-0.0541616
-0.0598541
-0.0667802
-0.0745224
-0.0820955
-0.0890942
-0.0954417
-0.101086
-0.105952
-0.109988
-0.113161
-0.115447
-0.116826
-0.117275
-0.116777
-0.115321
-0.112901
-0.109532
-0.105296
-0.100288
-0.0945978
-0.0883451
-0.0816854
-0.0747989
-0.067881
-0.0611276
-0.054716
-0.0487839
-0.0434137
-0.0386266
-0.0343881
-0.030622
-0.0272286
-0.0241049
-0.0211597
-0.0183221
-0.0155422
-0.0127925
-0.0100676
-0.00738016
-0.00475642
-0.00224684
9.40076e-05
0.00221354
0.00406213
0.00559612
0.00678086
0.00759191
0.00801593
0.00805176
0.00771221
0.00702578
0.00603745
0.0048078
0.00341038
0.00192755
0.000445457
-0.000951698
-0.00218768
-0.00320014
-0.00394579
-0.00440413
-0.00457829
-0.00449148
-0.00418152
-0.00369613
-0.00308743
-0.00240555
-0.00169628
-0.00100449
-0.000370364
0.000170985
0.000588103
0.000856464
0.000962082
0.000904279
0.000697818
0.000374037
-1.78173e-05
-0.000470191
0.240316
-0.297594
0.114119
0.0180062
-0.000332895
-0.0152009
-0.028037
-0.0384708
-0.0465005
-0.0522906
-0.056123
-0.0583653
-0.0594047
-0.0596161
-0.059352
-0.058935
-0.0586504
-0.058766
-0.0596642
-0.0617923
-0.0649269
-0.0690007
-0.0743372
-0.0815463
-0.0890278
-0.0962982
-0.102837
-0.108573
-0.113512
-0.117639
-0.120936
-0.123387
-0.124978
-0.125701
-0.125551
-0.124529
-0.122635
-0.119874
-0.116269
-0.111923
-0.106921
-0.101366
-0.0953903
-0.089147
-0.0828048
-0.0765342
-0.07049
-0.0647938
-0.0595225
-0.0547094
-0.0503544
-0.0464254
-0.0428558
-0.0395608
-0.0364555
-0.0334772
-0.0305809
-0.0277302
-0.0249049
-0.022103
-0.0193376
-0.0166342
-0.0140267
-0.0115515
-0.00924459
-0.00713943
-0.00526674
-0.00365391
-0.00232416
-0.00129494
-0.000576071
-0.000167596
-5.78229e-05
-0.000222385
-0.000624236
-0.00121434
-0.00193289
-0.00271205
-0.00348118
-0.00417361
-0.00473339
-0.00512144
-0.00531922
-0.00532875
-0.00516029
-0.00482471
-0.00434932
-0.00377228
-0.00313679
-0.00248683
-0.00186371
-0.00130275
-0.000830954
-0.000466193
-0.000218111
-8.96184e-05
-7.65264e-05
-0.000165148
-0.000328754
-0.000573624
0.235804
-0.311211
0.0830797
0.00652302
-0.0175461
-0.0352886
-0.0497806
-0.061589
-0.0708023
-0.0774373
-0.0816918
-0.0839003
-0.0844547
-0.0837842
-0.0823447
-0.080584
-0.0789006
-0.0776256
-0.0770531
-0.0775486
-0.0795203
-0.0825326
-0.0865974
-0.0919126
-0.0989813
-0.105822
-0.112183
-0.117769
-0.122561
-0.126566
-0.129779
-0.132191
-0.133795
-0.134592
-0.134584
-0.13378
-0.13219
-0.129828
-0.126729
-0.122998
-0.118702
-0.113922
-0.108759
-0.103332
-0.0977579
-0.0921608
-0.0866665
-0.0813801
-0.0763578
-0.071612
-0.0671288
-0.0629568
-0.0591182
-0.0555827
-0.0522916
-0.0491783
-0.0461831
-0.0432595
-0.0403751
-0.0375122
-0.0346659
-0.0318419
-0.0290527
-0.0263154
-0.0236501
-0.0210792
-0.0186277
-0.0163219
-0.0141877
-0.0122474
-0.0105214
-0.00902891
-0.00778501
-0.00679821
-0.00606834
-0.00558502
-0.0053271
-0.00525779
-0.00532461
-0.00546956
-0.00563435
-0.00576628
-0.00582353
-0.00577864
-0.00561857
-0.00534163
-0.00495586
-0.00447828
-0.0039331
-0.00334948
-0.00275888
-0.00219194
-0.0016755
-0.00123068
-0.000872728
-0.000611733
-0.000453093
-0.000397083
-0.000435562
-0.000606978
0.224818
-0.310117
0.0166131
-0.0199084
-0.041046
-0.0584823
-0.0735573
-0.0861773
-0.0961449
-0.103353
-0.107912
-0.110094
-0.110294
-0.109008
-0.10679
-0.104178
-0.101636
-0.0995343
-0.0981423
-0.097656
-0.0982684
-0.100251
-0.103149
-0.106997
-0.112135
-0.118037
-0.123672
-0.128806
-0.133261
-0.136991
-0.13998
-0.142219
-0.143703
-0.144437
-0.144433
-0.143713
-0.142302
-0.140231
-0.137531
-0.134259
-0.130531
-0.126425
-0.122028
-0.117423
-0.112658
-0.107749
-0.102716
-0.0977009
-0.0928236
-0.0881566
-0.0837299
-0.0795537
-0.0756304
-0.07195
-0.0684874
-0.0652062
-0.0620648
-0.0590226
-0.0560432
-0.0530969
-0.0501613
-0.047222
-0.0442716
-0.0413101
-0.0383438
-0.0353841
-0.0324457
-0.0295508
-0.0267371
-0.0240358
-0.0214591
-0.0190283
-0.0167699
-0.0147126
-0.0128827
-0.0112999
-0.00997299
-0.00889707
-0.00805261
-0.00740762
-0.00692213
-0.00655268
-0.00625634
-0.00599382
-0.00573185
-0.00544477
-0.00511559
-0.00473626
-0.0043071
-0.00383548
-0.00333406
-0.00281897
-0.00230849
-0.00182235
-0.0013813
-0.00100625
-0.000717438
-0.000534597
-0.000473579
-0.000604903
0.129625
-0.235205
-0.0147444
-0.0462504
-0.0667531
-0.0842994
-0.0995397
-0.112318
-0.122464
-0.12991
-0.134673
-0.136907
-0.136989
-0.135469
-0.132954
-0.130009
-0.127094
-0.124552
-0.122616
-0.121427
-0.121054
-0.121561
-0.123078
-0.125269
-0.128222
-0.1328
-0.137476
-0.141962
-0.145878
-0.149177
-0.151827
-0.153799
-0.155079
-0.155663
-0.155565
-0.154813
-0.153449
-0.151522
-0.149085
-0.146199
-0.142951
-0.139346
-0.135376
-0.13117
-0.126833
-0.122424
-0.117968
-0.113488
-0.109021
-0.104611
-0.100295
-0.0961049
-0.0920662
-0.0881951
-0.0844976
-0.0809685
-0.0775914
-0.0743408
-0.0711844
-0.0680868
-0.0650131
-0.0619331
-0.0588245
-0.0556752
-0.0524824
-0.0492596
-0.0460297
-0.0427687
-0.039469
-0.036144
-0.0328201
-0.0295339
-0.0263306
-0.0232614
-0.0203781
-0.0177276
-0.0153468
-0.0132593
-0.011474
-0.00998581
-0.0087776
-0.00782181
-0.00708226
-0.00651621
-0.00607746
-0.00572033
-0.00540381
-0.0050946
-0.00476858
-0.00441063
-0.00401364
-0.00357731
-0.00310754
-0.00261655
-0.00212289
-0.00165073
-0.00122846
-0.00088828
-0.000662628
-0.000643834
0.17146
-0.341695
-0.0149659
-0.0717277
-0.0937233
-0.11169
-0.127045
-0.139723
-0.149802
-0.15732
-0.162247
-0.164681
-0.164965
-0.163637
-0.161285
-0.158428
-0.155469
-0.152689
-0.150274
-0.148343
-0.146971
-0.146211
-0.14615
-0.146845
-0.148169
-0.150332
-0.153963
-0.157506
-0.160746
-0.163473
-0.165655
-0.167256
-0.168245
-0.168611
-0.168361
-0.167522
-0.166135
-0.164248
-0.16188
-0.159006
-0.155782
-0.152343
-0.148753
-0.145045
-0.141236
-0.137333
-0.133331
-0.129229
-0.125034
-0.120768
-0.116465
-0.112164
-0.107911
-0.103749
-0.0997141
-0.0958311
-0.0921092
-0.0885414
-0.0851054
-0.0817678
-0.0784894
-0.0752327
-0.0719673
-0.0686784
-0.0653741
-0.0620131
-0.0585558
-0.0549807
-0.0512801
-0.0474632
-0.043557
-0.0396052
-0.0356645
-0.0318008
-0.0280823
-0.0245744
-0.0213338
-0.0184055
-0.0158208
-0.0135965
-0.0117349
-0.0102226
-0.0090315
-0.0081198
-0.00743589
-0.00692342
-0.00652653
-0.00619422
-0.00588317
-0.00555941
-0.0051987
-0.00478642
-0.0043171
-0.00379405
-0.00322906
-0.00264215
-0.00206082
-0.00151846
-0.00104979
-0.00075078
0.136742
-0.380313
-0.0454985
-0.100741
-0.124032
-0.141849
-0.156747
-0.169025
-0.178882
-0.186341
-0.19139
-0.194147
-0.194903
-0.194088
-0.192178
-0.189594
-0.186672
-0.183661
-0.180744
-0.178056
-0.175702
-0.173758
-0.172298
-0.171448
-0.171217
-0.171733
-0.17338
-0.175718
-0.178086
-0.180168
-0.181797
-0.182926
-0.183524
-0.183576
-0.183086
-0.18207
-0.18053
-0.178453
-0.175938
-0.173072
-0.169933
-0.166648
-0.163274
-0.159825
-0.156285
-0.152626
-0.148815
-0.144831
-0.140667
-0.136338
-0.131874
-0.127324
-0.122745
-0.1182
-0.113748
-0.109435
-0.105291
-0.101327
-0.0975321
-0.0938786
-0.0903321
-0.0868604
-0.0834437
-0.080035
-0.0765798
-0.0730352
-0.0693648
-0.0655431
-0.0615597
-0.0574215
-0.0531538
-0.0487999
-0.0444173
-0.0400739
-0.0358423
-0.0317938
-0.0279941
-0.0245
-0.0213557
-0.0185914
-0.0162205
-0.0142384
-0.0126225
-0.0113346
-0.0103253
-0.00953934
-0.00892037
-0.00841338
-0.00796623
-0.00753336
-0.00707825
-0.0065749
-0.00600784
-0.00537154
-0.00466935
-0.00391302
-0.00312267
-0.0023263
-0.00155552
-0.000902199
0.123825
-0.409018
-0.0884477
-0.132843
-0.15702
-0.175003
-0.189545
-0.201381
-0.210855
-0.218079
-0.223156
-0.226242
-0.227541
-0.227311
-0.225861
-0.223511
-0.220548
-0.217221
-0.213735
-0.210253
-0.206909
-0.203818
-0.20108
-0.198805
-0.19715
-0.195994
-0.195574
-0.196698
-0.198119
-0.19948
-0.200477
-0.201035
-0.201135
-0.200759
-0.199872
-0.198473
-0.196613
-0.194343
-0.191726
-0.188834
-0.185732
-0.182488
-0.17913
-0.175657
-0.172052
-0.168282
-0.164319
-0.160138
-0.155738
-0.151133
-0.146358
-0.141459
-0.136496
-0.131538
-0.126655
-0.121905
-0.11733
-0.112951
-0.108774
-0.10478
-0.100936
-0.0971974
-0.0935214
-0.0898632
-0.0861765
-0.0824181
-0.0785519
-0.0745526
-0.0704082
-0.066122
-0.0617138
-0.0572191
-0.0526865
-0.0481743
-0.0437464
-0.0394679
-0.0354017
-0.0316048
-0.028125
-0.0249968
-0.0222389
-0.0198523
-0.0178213
-0.0161175
-0.014701
-0.0135223
-0.0125317
-0.0116926
-0.0109607
-0.0102879
-0.00962796
-0.00894074
-0.00819565
-0.00737307
-0.00646443
-0.00547161
-0.00440642
-0.00329056
-0.0021526
-0.00108621
0.100964
-0.414085
-0.168008
-0.183046
-0.200335
-0.215148
-0.227878
-0.2385
-0.247069
-0.253712
-0.258586
-0.261812
-0.263462
-0.263624
-0.262451
-0.260169
-0.257038
-0.253308
-0.249206
-0.244922
-0.240617
-0.236432
-0.232496
-0.22893
-0.225861
-0.223496
-0.221624
-0.220466
-0.220807
-0.221333
-0.221655
-0.221579
-0.221056
-0.2201
-0.21874
-0.21699
-0.214868
-0.212404
-0.20963
-0.20658
-0.203289
-0.19982
-0.19619
-0.19239
-0.188406
-0.184227
-0.179836
-0.17522
-0.170388
-0.165371
-0.16022
-0.154985
-0.149685
-0.144368
-0.139098
-0.133937
-0.128935
-0.124124
-0.119512
-0.115093
-0.110845
-0.106732
-0.102715
-0.0987525
-0.0948024
-0.090826
-0.08679
-0.08267
-0.0784527
-0.0741371
-0.069735
-0.0652706
-0.0607785
-0.0563013
-0.0518869
-0.047586
-0.0434495
-0.0395255
-0.0358562
-0.0324738
-0.029398
-0.0266349
-0.0241748
-0.0219967
-0.0200964
-0.0184578
-0.0170496
-0.0158303
-0.0147521
-0.0137641
-0.0128162
-0.0118622
-0.0108627
-0.00978674
-0.00861315
-0.00733125
-0.00594055
-0.00445069
-0.00287926
-0.00131649
-0.0302775
-0.330995
-0.222787
-0.23384
-0.248359
-0.26114
-0.272084
-0.281129
-0.288401
-0.294119
-0.298447
-0.301433
-0.303047
-0.303248
-0.302072
-0.299656
-0.296218
-0.292002
-0.287246
-0.282166
-0.276957
-0.27179
-0.266815
-0.262158
-0.25792
-0.25419
-0.251167
-0.24866
-0.246843
-0.246082
-0.245443
-0.244544
-0.243317
-0.241774
-0.239919
-0.237758
-0.235294
-0.232527
-0.229459
-0.226095
-0.222437
-0.218494
-0.214324
-0.20994
-0.205354
-0.200599
-0.195725
-0.190717
-0.185522
-0.180123
-0.174543
-0.168833
-0.163057
-0.157282
-0.15157
-0.145977
-0.140546
-0.135303
-0.130258
-0.125408
-0.120739
-0.116226
-0.11184
-0.107547
-0.103314
-0.0991083
-0.0949027
-0.0906746
-0.0864092
-0.0821008
-0.0777522
-0.0733752
-0.068989
-0.0646192
-0.0602964
-0.0560547
-0.0519303
-0.0479585
-0.0441719
-0.0405963
-0.0372461
-0.0341297
-0.0312675
-0.0286689
-0.0263329
-0.0242495
-0.0223981
-0.0207469
-0.0192552
-0.0178763
-0.0165615
-0.0152631
-0.0139364
-0.0125418
-0.0110466
-0.00942692
-0.00766849
-0.00576482
-0.0037136
-0.00158921
-0.00940904
-0.451169
-0.248936
-0.278343
-0.297684
-0.311138
-0.321381
-0.329203
-0.3352
-0.339798
-0.343213
-0.345497
-0.346602
-0.346435
-0.344942
-0.342175
-0.33829
-0.333506
-0.328062
-0.32219
-0.316101
-0.309981
-0.303987
-0.298249
-0.292872
-0.287932
-0.283491
-0.279691
-0.276416
-0.273911
-0.271933
-0.270149
-0.268165
-0.265938
-0.263479
-0.260771
-0.257789
-0.254509
-0.250912
-0.246994
-0.242758
-0.238232
-0.233516
-0.228658
-0.223611
-0.218353
-0.212889
-0.207235
-0.20141
-0.195435
-0.189343
-0.183177
-0.176987
-0.170823
-0.164733
-0.158759
-0.15293
-0.147271
-0.141794
-0.136503
-0.131393
-0.126452
-0.121663
-0.117004
-0.11245
-0.107978
-0.103564
-0.0991889
-0.0948383
-0.090502
-0.0861751
-0.081858
-0.0775556
-0.0732776
-0.0690387
-0.0648581
-0.060757
-0.0567555
-0.0528702
-0.0491275
-0.0455549
-0.0421733
-0.0389989
-0.036043
-0.0333112
-0.030801
-0.0285006
-0.0263883
-0.0244339
-0.0226001
-0.0208451
-0.0191247
-0.0173941
-0.0156088
-0.0137277
-0.0117139
-0.00953736
-0.00717434
-0.00460433
-0.00188423
-0.073043
-0.529639
-0.299323
-0.330666
-0.352114
-0.366276
-0.37614
-0.383012
-0.387812
-0.391127
-0.393276
-0.394407
-0.394533
-0.393571
-0.391421
-0.388058
-0.383566
-0.37812
-0.371942
-0.365262
-0.358293
-0.351221
-0.3442
-0.33736
-0.330807
-0.324626
-0.318872
-0.313602
-0.308846
-0.304592
-0.30137
-0.298485
-0.295648
-0.292623
-0.289386
-0.285935
-0.282246
-0.278287
-0.27404
-0.269524
-0.264781
-0.25976
-0.254465
-0.248923
-0.243151
-0.23717
-0.231007
-0.224696
-0.218272
-0.21177
-0.205225
-0.19867
-0.192136
-0.185649
-0.179235
-0.172916
-0.166712
-0.160644
-0.154726
-0.148971
-0.143389
-0.137982
-0.132745
-0.12767
-0.122741
-0.117944
-0.11326
-0.108674
-0.104169
-0.0997325
-0.0953533
-0.091023
-0.0867356
-0.0824861
-0.0782718
-0.0740974
-0.0699773
-0.0659281
-0.0619671
-0.0581118
-0.0543799
-0.0507885
-0.0473525
-0.0440843
-0.0409914
-0.0380753
-0.03533
-0.0327413
-0.0302881
-0.0279427
-0.0256724
-0.0234404
-0.0212063
-0.0189281
-0.0165632
-0.0140694
-0.0114068
-0.00854024
-0.00544017
-0.00215431
-0.119565
-0.599159
-0.370406
-0.395356
-0.415455
-0.428837
-0.43776
-0.443459
-0.446862
-0.448609
-0.449132
-0.448697
-0.447404
-0.445214
-0.442024
-0.437764
-0.43245
-0.4262
-0.419196
-0.411643
-0.403742
-0.395667
-0.387563
-0.379551
-0.371749
-0.364263
-0.357179
-0.350565
-0.344503
-0.33886
-0.333692
-0.329406
-0.325559
-0.321624
-0.317524
-0.313225
-0.30872
-0.30403
-0.299158
-0.294038
-0.288624
-0.282891
-0.276831
-0.270515
-0.263986
-0.257284
-0.250457
-0.243548
-0.236597
-0.229639
-0.222702
-0.215803
-0.208952
-0.202158
-0.195426
-0.188765
-0.182186
-0.175705
-0.169341
-0.163115
-0.157047
-0.15115
-0.145435
-0.139904
-0.134554
-0.129376
-0.124359
-0.119488
-0.11475
-0.110126
-0.105598
-0.101147
-0.0967672
-0.0924503
-0.0881903
-0.0839835
-0.0798301
-0.0757335
-0.0717001
-0.0677378
-0.0638559
-0.0600649
-0.0563758
-0.0527989
-0.0493422
-0.0460094
-0.0427983
-0.0397008
-0.036703
-0.0337857
-0.0309247
-0.0280912
-0.0252525
-0.0223733
-0.0194175
-0.0163491
-0.0131328
-0.00973628
-0.00613033
-0.00236045
-0.190348
-0.640288
-0.480051
-0.482342
-0.493443
-0.502332
-0.508451
-0.511954
-0.513294
-0.512976
-0.51145
-0.509036
-0.505889
-0.502019
-0.497356
-0.491822
-0.485391
-0.478114
-0.470114
-0.461556
-0.452609
-0.44343
-0.434167
-0.424947
-0.415879
-0.407061
-0.398581
-0.390518
-0.382953
-0.376055
-0.369591
-0.363626
-0.358266
-0.353135
-0.347966
-0.34273
-0.337381
-0.331869
-0.32615
-0.320184
-0.313937
-0.307395
-0.300565
-0.293533
-0.286337
-0.279019
-0.271622
-0.264194
-0.256773
-0.249391
-0.242065
-0.234804
-0.227607
-0.220468
-0.213384
-0.206355
-0.199387
-0.192494
-0.185695
-0.179014
-0.172476
-0.166104
-0.159914
-0.15392
-0.148124
-0.142527
-0.13712
-0.131887
-0.126814
-0.121895
-0.117119
-0.112471
-0.107932
-0.103486
-0.0991167
-0.0948117
-0.090561
-0.0863579
-0.082198
-0.0780794
-0.0740028
-0.0699712
-0.0659898
-0.0620651
-0.0582033
-0.0544084
-0.0506813
-0.0470193
-0.0434155
-0.0398595
-0.0363365
-0.0328278
-0.029311
-0.0257613
-0.0221531
-0.0184623
-0.0146664
-0.0107448
-0.00667534
-0.00250499
-0.391631
-0.595553
-0.57891
-0.57676
-0.581737
-0.586098
-0.588713
-0.589256
-0.58788
-0.584968
-0.580937
-0.576103
-0.570645
-0.564623
-0.558017
-0.550774
-0.542847
-0.534231
-0.524984
-0.515218
-0.505069
-0.494679
-0.484176
-0.473676
-0.463281
-0.453083
-0.443164
-0.4336
-0.424455
-0.415796
-0.407833
-0.400338
-0.393416
-0.387115
-0.380849
-0.374509
-0.368072
-0.361528
-0.35484
-0.347971
-0.340895
-0.333595
-0.326069
-0.318345
-0.310514
-0.302618
-0.294695
-0.28678
-0.278903
-0.271086
-0.26334
-0.255669
-0.248069
-0.240532
-0.233051
-0.225624
-0.218255
-0.210954
-0.203739
-0.196632
-0.189658
-0.182841
-0.176199
-0.169748
-0.163493
-0.157431
-0.151572
-0.14592
-0.14047
-0.135214
-0.130136
-0.125217
-0.120435
-0.115766
-0.111188
-0.106679
-0.102221
-0.0978003
-0.0934032
-0.0890212
-0.0846489
-0.0802838
-0.0759267
-0.0715803
-0.0672482
-0.0629339
-0.0586401
-0.054368
-0.0501173
-0.0458855
-0.0416677
-0.037456
-0.0332401
-0.0290079
-0.0247461
-0.020441
-0.0160804
-0.0116537
-0.00714908
-0.00262051
-0.428958
-0.753692
-0.668063
-0.672857
-0.678111
-0.679539
-0.678646
-0.675788
-0.671193
-0.665207
-0.658197
-0.650466
-0.642214
-0.633552
-0.624515
-0.615083
-0.605221
-0.594893
-0.584096
-0.572879
-0.561333
-0.549566
-0.537684
-0.525786
-0.51396
-0.502289
-0.490856
-0.479744
-0.469036
-0.4588
-0.449075
-0.440018
-0.431424
-0.423403
-0.415867
-0.408357
-0.400797
-0.393146
-0.385404
-0.37756
-0.369599
-0.361514
-0.353299
-0.344958
-0.336553
-0.328116
-0.319677
-0.311265
-0.302905
-0.294612
-0.286397
-0.278263
-0.270206
-0.262222
-0.254305
-0.246453
-0.238669
-0.230959
-0.223339
-0.215824
-0.208435
-0.20119
-0.1941
-0.187185
-0.180465
-0.173954
-0.167661
-0.161588
-0.155732
-0.150084
-0.144627
-0.139342
-0.134205
-0.12919
-0.12427
-0.119421
-0.114619
-0.109844
-0.105077
-0.100305
-0.0955184
-0.0907119
-0.0858836
-0.0810346
-0.0761676
-0.0712865
-0.0663956
-0.0614995
-0.0566026
-0.0517086
-0.0468198
-0.0419365
-0.0370577
-0.0321809
-0.0273021
-0.0224159
-0.0175156
-0.0125954
-0.00765131
-0.002747
-0.558428
-0.909478
-0.779757
-0.781904
-0.785398
-0.783732
-0.779026
-0.772247
-0.763864
-0.754247
-0.74372
-0.732566
-0.721013
-0.709213
-0.697243
-0.685131
-0.672858
-0.660378
-0.647647
-0.634662
-0.621459
-0.608103
-0.594669
-0.581231
-0.567861
-0.554631
-0.54162
-0.528908
-0.516559
-0.504635
-0.493192
-0.482283
-0.472038
-0.462354
-0.453179
-0.444266
-0.435423
-0.426621
-0.417831
-0.409031
-0.400202
-0.391326
-0.382391
-0.37339
-0.364381
-0.355382
-0.346405
-0.337467
-0.328584
-0.319772
-0.31104
-0.302395
-0.293838
-0.285366
-0.276978
-0.268673
-0.260452
-0.252319
-0.24428
-0.236345
-0.22853
-0.220853
-0.213334
-0.20599
-0.198837
-0.191889
-0.185153
-0.178632
-0.172321
-0.166212
-0.160289
-0.154534
-0.148924
-0.143435
-0.138042
-0.132718
-0.127441
-0.122186
-0.116934
-0.111669
-0.106378
-0.101054
-0.0956933
-0.090296
-0.0848644
-0.079403
-0.0739174
-0.0684147
-0.0629024
-0.0573878
-0.0518775
-0.0463764
-0.040888
-0.0354144
-0.0299567
-0.0245146
-0.0190859
-0.0136679
-0.00825743
-0.00291723
-0.68452
-1.06284
-0.915917
-0.910124
-0.907843
-0.901
-0.891276
-0.879631
-0.86663
-0.852633
-0.837919
-0.822749
-0.807347
-0.791886
-0.776472
-0.761164
-0.745965
-0.730836
-0.715723
-0.70058
-0.685393
-0.670176
-0.654963
-0.639803
-0.624751
-0.609865
-0.595191
-0.580783
-0.566701
-0.553005
-0.539757
-0.52701
-0.514814
-0.503264
-0.492382
-0.482116
-0.47204
-0.46208
-0.452212
-0.442434
-0.432722
-0.423048
-0.413385
-0.403707
-0.393996
-0.384321
-0.3747
-0.365147
-0.355675
-0.346291
-0.337001
-0.32781
-0.318719
-0.309729
-0.300839
-0.292046
-0.283353
-0.274763
-0.266282
-0.257917
-0.24968
-0.241582
-0.233639
-0.225864
-0.218268
-0.210861
-0.203649
-0.196633
-0.189811
-0.183173
-0.176708
-0.170399
-0.164227
-0.15817
-0.152207
-0.146312
-0.140464
-0.134642
-0.128824
-0.122996
-0.117144
-0.111261
-0.10534
-0.0993808
-0.0933843
-0.0873544
-0.081297
-0.0752194
-0.0691302
-0.063038
-0.0569508
-0.0508755
-0.0448175
-0.0387805
-0.0327671
-0.0267789
-0.020817
-0.0148812
-0.0089674
-0.00312977
-0.854289
-1.19112
-1.08665
-1.06364
-1.04936
-1.03387
-1.01699
-0.999003
-0.980225
-0.960873
-0.941153
-0.921266
-0.901396
-0.881704
-0.862301
-0.843257
-0.824595
-0.806294
-0.788301
-0.770552
-0.752988
-0.735577
-0.718314
-0.701217
-0.684302
-0.667591
-0.65111
-0.634895
-0.618995
-0.603472
-0.588401
-0.573856
-0.559904
-0.546593
-0.533964
-0.522019
-0.510643
-0.499496
-0.48853
-0.477695
-0.466981
-0.456367
-0.445827
-0.43534
-0.424888
-0.414512
-0.40422
-0.394018
-0.383915
-0.373916
-0.364028
-0.354252
-0.344593
-0.335052
-0.32563
-0.316326
-0.307141
-0.298076
-0.289134
-0.280319
-0.271637
-0.263096
-0.254703
-0.246468
-0.238396
-0.230493
-0.222764
-0.215209
-0.207825
-0.200607
-0.193546
-0.186629
-0.179841
-0.173165
-0.166579
-0.160065
-0.153601
-0.147168
-0.140748
-0.134325
-0.127888
-0.121427
-0.114937
-0.108414
-0.101859
-0.0952737
-0.0886627
-0.0820321
-0.0753893
-0.0687421
-0.0620983
-0.0554653
-0.0488497
-0.0422568
-0.0356909
-0.0291542
-0.0226484
-0.0161738
-0.00972713
-0.00335973
-1.17894
-1.24856
-1.24781
-1.22713
-1.20494
-1.18116
-1.15628
-1.13077
-1.10505
-1.07929
-1.05364
-1.02823
-1.00319
-0.97863
-0.95465
-0.931313
-0.908646
-0.886639
-0.865247
-0.844395
-0.824003
-0.804005
-0.78435
-0.765011
-0.745974
-0.727237
-0.708804
-0.690694
-0.672941
-0.655597
-0.638731
-0.622419
-0.606733
-0.591734
-0.577472
-0.563917
-0.551047
-0.538559
-0.52636
-0.514405
-0.502646
-0.491051
-0.47959
-0.468236
-0.456968
-0.445792
-0.434745
-0.423828
-0.413043
-0.40239
-0.391871
-0.381485
-0.371234
-0.36112
-0.351142
-0.341302
-0.331598
-0.32203
-0.312597
-0.303299
-0.294139
-0.285118
-0.27624
-0.267507
-0.258923
-0.250491
-0.242212
-0.234086
-0.226113
-0.218288
-0.210605
-0.203055
-0.195626
-0.188304
-0.181073
-0.173916
-0.166816
-0.159755
-0.152718
-0.145689
-0.138658
-0.131615
-0.124552
-0.117465
-0.110353
-0.103216
-0.0960559
-0.0888776
-0.0816863
-0.0744884
-0.0672907
-0.0601005
-0.052925
-0.0457715
-0.0386462
-0.0315537
-0.0244962
-0.0174742
-0.010487
-0.0035884
-1.33887
-1.49229
-1.44657
-1.40982
-1.37751
-1.34384
-1.30957
-1.27526
-1.24133
-1.20801
-1.17541
-1.14358
-1.11258
-1.08247
-1.05329
-1.02508
-0.997871
-0.971633
-0.946321
-0.921857
-0.89815
-0.875107
-0.852649
-0.830717
-0.80927
-0.788283
-0.767742
-0.747646
-0.728008
-0.708858
-0.69024
-0.672207
-0.654817
-0.63812
-0.622162
-0.607012
-0.59263
-0.57883
-0.565382
-0.552234
-0.539343
-0.526687
-0.514237
-0.501963
-0.489838
-0.477838
-0.465999
-0.454325
-0.442816
-0.431469
-0.420284
-0.409258
-0.39839
-0.387679
-0.377125
-0.366725
-0.356477
-0.346378
-0.336425
-0.326614
-0.316942
-0.307409
-0.298012
-0.288751
-0.279627
-0.270641
-0.261793
-0.253083
-0.24451
-0.236071
-0.227761
-0.219574
-0.2115
-0.203527
-0.195644
-0.187836
-0.18009
-0.172392
-0.164727
-0.157083
-0.149448
-0.141811
-0.134165
-0.126503
-0.118822
-0.111121
-0.103401
-0.0956639
-0.0879149
-0.0801593
-0.0724034
-0.0646545
-0.05692
-0.0492073
-0.0415241
-0.0338772
-0.0262725
-0.018714
-0.0112051
-0.00380186
-1.58284
-1.76313
-1.67382
-1.61679
-1.56969
-1.52318
-1.47739
-1.4326
-1.38905
-1.34692
-1.30626
-1.26704
-1.22923
-1.19282
-1.1578
-1.12416
-1.09187
-1.0609
-1.03118
-1.00262
-0.975126
-0.948596
-0.922937
-0.898072
-0.873939
-0.850493
-0.827695
-0.805521
-0.783954
-0.762993
-0.742651
-0.722952
-0.703926
-0.685605
-0.668009
-0.651152
-0.635057
-0.619846
-0.605119
-0.590755
-0.576717
-0.56296
-0.549464
-0.536202
-0.52315
-0.510285
-0.497629
-0.485179
-0.472928
-0.460869
-0.448998
-0.437311
-0.425805
-0.414477
-0.403325
-0.392344
-0.381529
-0.370874
-0.360374
-0.350021
-0.33981
-0.329737
-0.319797
-0.309987
-0.300306
-0.290752
-0.281325
-0.272024
-0.262847
-0.253793
-0.244858
-0.236036
-0.227319
-0.2187
-0.210167
-0.20171
-0.193318
-0.184979
-0.176682
-0.168413
-0.160163
-0.151921
-0.143678
-0.135429
-0.127169
-0.118895
-0.110608
-0.102309
-0.0940005
-0.0856882
-0.0773779
-0.0690768
-0.0607924
-0.052532
-0.0443032
-0.0361147
-0.0279762
-0.0198981
-0.0118889
-0.00400516
-1.84415
-2.04304
-1.92015
-1.84346
-1.77981
-1.7184
-1.65918
-1.60227
-1.54768
-1.49546
-1.4456
-1.39798
-1.3525
-1.30905
-1.26755
-1.2279
-1.19004
-1.15388
-1.11933
-1.08628
-1.05462
-1.02425
-0.995064
-0.966979
-0.939918
-0.913812
-0.888594
-0.864207
-0.840604
-0.817749
-0.795621
-0.774211
-0.753522
-0.733569
-0.714371
-0.695943
-0.678293
-0.661393
-0.645261
-0.629589
-0.614329
-0.599439
-0.584889
-0.570645
-0.556673
-0.542941
-0.529419
-0.51614
-0.503098
-0.490287
-0.4777
-0.465328
-0.453165
-0.441204
-0.429437
-0.417857
-0.406455
-0.395224
-0.384154
-0.373238
-0.362467
-0.351835
-0.341335
-0.330964
-0.320716
-0.310589
-0.300581
-0.29069
-0.280913
-0.271249
-0.261694
-0.252244
-0.242892
-0.233631
-0.224455
-0.215355
-0.206321
-0.197345
-0.188415
-0.179521
-0.170653
-0.161803
-0.152962
-0.144125
-0.135288
-0.126448
-0.117604
-0.108758
-0.0999097
-0.0910621
-0.0822195
-0.0733875
-0.0645735
-0.0557856
-0.0470327
-0.0383247
-0.0296728
-0.0210891
-0.0125853
-0.00421711
-2.15981
-2.309
-2.1869
-2.08938
-2.00622
-1.92777
-1.8534
-1.78285
-1.71592
-1.65247
-1.59234
-1.53538
-1.4814
-1.4302
-1.38159
-1.33542
-1.29154
-1.24981
-1.21009
-1.17226
-1.13618
-1.10173
-1.0688
-1.03727
-1.00706
-0.978086
-0.950251
-0.923475
-0.897681
-0.8728
-0.848779
-0.825574
-0.803163
-0.781535
-0.76069
-0.740637
-0.721386
-0.702965
-0.685361
-0.668361
-0.651854
-0.635792
-0.620127
-0.60483
-0.589868
-0.575211
-0.56083
-0.546733
-0.532907
-0.519344
-0.506032
-0.492964
-0.480128
-0.467515
-0.455115
-0.442918
-0.430911
-0.419086
-0.40743
-0.395935
-0.38459
-0.373388
-0.362321
-0.351381
-0.340564
-0.329865
-0.31928
-0.308807
-0.298442
-0.288182
-0.278024
-0.267963
-0.257995
-0.248115
-0.238316
-0.228592
-0.218937
-0.209341
-0.199797
-0.190295
-0.180829
-0.171389
-0.161971
-0.152568
-0.143178
-0.133795
-0.124418
-0.115046
-0.105679
-0.0963186
-0.0869682
-0.0776323
-0.0683172
-0.0590306
-0.0497812
-0.0405783
-0.031431
-0.0223483
-0.0133398
-0.00445659
-2.61526
-2.53312
-2.43785
-2.33928
-2.24117
-2.14671
-2.05682
-1.97178
-1.89155
-1.81594
-1.74472
-1.67764
-1.61444
-1.55485
-1.4986
-1.44545
-1.39518
-1.34758
-1.30247
-1.25967
-1.21901
-1.18033
-1.14349
-1.10835
-1.07481
-1.04276
-1.01212
-0.982781
-0.954635
-0.927587
-0.901551
-0.876459
-0.85226
-0.828926
-0.806444
-0.784808
-0.764016
-0.744055
-0.724887
-0.706527
-0.688744
-0.671486
-0.654703
-0.638355
-0.622405
-0.606815
-0.591552
-0.576611
-0.561982
-0.547652
-0.533606
-0.519831
-0.506312
-0.493037
-0.479993
-0.467166
-0.454545
-0.442115
-0.429867
-0.417787
-0.405866
-0.394094
-0.382461
-0.370959
-0.35958
-0.34832
-0.337173
-0.326134
-0.315201
-0.304368
-0.293633
-0.28299
-0.272437
-0.261969
-0.251581
-0.241267
-0.231023
-0.220842
-0.210718
-0.200644
-0.190614
-0.18062
-0.170659
-0.160725
-0.150813
-0.140921
-0.131044
-0.121181
-0.111331
-0.101495
-0.0916746
-0.081872
-0.0720911
-0.0623367
-0.0526145
-0.0429307
-0.0332911
-0.023701
-0.0141662
-0.0047282
-2.95577
-2.86958
-2.73925
-2.61081
-2.48969
-2.37529
-2.26762
-2.16658
-2.07189
-1.98323
-1.90021
-1.82243
-1.74951
-1.68108
-1.6168
-1.55633
-1.49939
-1.44569
-1.39499
-1.34705
-1.30166
-1.25863
-1.21777
-1.17894
-1.14199
-1.1068
-1.07325
-1.04124
-1.01063
-0.981324
-0.953196
-0.926156
-0.90013
-0.875062
-0.850917
-0.827669
-0.805307
-0.783825
-0.763234
-0.743523
-0.72448
-0.706039
-0.688148
-0.670757
-0.653826
-0.637314
-0.621182
-0.605394
-0.589953
-0.574844
-0.560051
-0.545557
-0.531345
-0.517401
-0.503707
-0.490248
-0.477011
-0.463981
-0.451144
-0.438488
-0.426001
-0.413672
-0.401489
-0.389444
-0.377528
-0.365732
-0.354051
-0.34248
-0.331012
-0.319644
-0.308371
-0.297189
-0.286095
-0.275083
-0.26415
-0.253293
-0.242506
-0.231786
-0.221127
-0.210524
-0.199972
-0.189466
-0.179002
-0.168576
-0.158183
-0.147819
-0.13748
-0.127163
-0.116867
-0.106589
-0.096331
-0.0860916
-0.0758719
-0.0656727
-0.0554949
-0.04534
-0.0352101
-0.0251074
-0.015034
-0.00501963
-3.33483
-3.24388
-3.06495
-2.89738
-2.74837
-2.61052
-2.48264
-2.36393
-2.25364
-2.1511
-2.05565
-1.96672
-1.88375
-1.80623
-1.73371
-1.66577
-1.60202
-1.54212
-1.48574
-1.4326
-1.38244
-1.33502
-1.29015
-1.24762
-1.20726
-1.16892
-1.13245
-1.09774
-1.06465
-1.03305
-1.0028
-0.973793
-0.945938
-0.919159
-0.893401
-0.868626
-0.844805
-0.821911
-0.799922
-0.778805
-0.758512
-0.738903
-0.719915
-0.701489
-0.683581
-0.666146
-0.649145
-0.63254
-0.616318
-0.600457
-0.584939
-0.569744
-0.554854
-0.540253
-0.525922
-0.511846
-0.498009
-0.484395
-0.47099
-0.45778
-0.444751
-0.431892
-0.419189
-0.406631
-0.39421
-0.381915
-0.369739
-0.357676
-0.345718
-0.33386
-0.322097
-0.310425
-0.298838
-0.287335
-0.275911
-0.264563
-0.253287
-0.242082
-0.230941
-0.219862
-0.208841
-0.197873
-0.186954
-0.17608
-0.165246
-0.154448
-0.143682
-0.132944
-0.122231
-0.11154
-0.100867
-0.0902115
-0.0795694
-0.0689388
-0.0583175
-0.0477035
-0.0370948
-0.0264898
-0.0158872
-0.00530768
-3.71652
-3.618
-3.39476
-3.18734
-3.00868
-2.84577
-2.69634
-2.55896
-2.43236
-2.31544
-2.20726
-2.10697
-2.01384
-1.9272
-1.84645
-1.77107
-1.70056
-1.63452
-1.57255
-1.5143
-1.45946
-1.40777
-1.35897
-1.31283
-1.26916
-1.22775
-1.18844
-1.15109
-1.11555
-1.0817
-1.04937
-1.01845
-0.98882
-0.960386
-0.933072
-0.906818
-0.881578
-0.857315
-0.833999
-0.811602
-0.790143
-0.769429
-0.749401
-0.73
-0.711173
-0.69287
-0.675045
-0.657657
-0.640683
-0.624101
-0.607887
-0.592022
-0.576485
-0.561258
-0.546322
-0.53166
-0.517255
-0.503091
-0.489153
-0.475426
-0.461893
-0.448543
-0.43536
-0.422334
-0.409452
-0.396704
-0.384081
-0.371574
-0.359177
-0.346882
-0.334683
-0.322575
-0.310554
-0.298617
-0.286759
-0.274979
-0.263273
-0.251639
-0.240072
-0.228571
-0.21713
-0.205747
-0.194417
-0.183135
-0.171899
-0.160702
-0.14954
-0.138408
-0.127303
-0.116219
-0.105152
-0.0940961
-0.0830469
-0.0720003
-0.0609523
-0.0498994
-0.0388373
-0.0277612
-0.0166671
-0.00556941
-4.12443
-3.96589
-3.7095
-3.46856
-3.26052
-3.07249
-2.90147
-2.7454
-2.60251
-2.47132
-2.35056
-2.23913
-2.13608
-2.04057
-1.95186
-1.86931
-1.79233
-1.72041
-1.6531
-1.59
-1.53073
-1.47499
-1.42248
-1.37293
-1.32612
-1.28182
-1.23984
-1.20001
-1.16217
-1.12618
-1.09189
-1.05915
-1.02784
-0.997856
-0.969094
-0.94148
-0.914954
-0.889465
-0.864974
-0.841453
-0.818868
-0.797111
-0.776109
-0.755795
-0.736108
-0.716995
-0.698406
-0.680294
-0.662626
-0.645376
-0.62852
-0.612035
-0.595901
-0.580096
-0.564603
-0.549403
-0.534478
-0.519811
-0.505387
-0.491188
-0.477199
-0.463404
-0.449789
-0.436342
-0.423048
-0.409897
-0.396878
-0.383981
-0.371198
-0.358521
-0.345944
-0.333459
-0.321064
-0.308754
-0.296525
-0.284375
-0.2723
-0.260297
-0.248364
-0.236495
-0.224688
-0.21294
-0.201245
-0.189601
-0.178002
-0.166443
-0.154919
-0.143425
-0.131955
-0.120504
-0.109065
-0.0976319
-0.0862002
-0.074764
-0.0633186
-0.0518591
-0.0403806
-0.0288777
-0.0173462
-0.00579539
-4.58373
-4.26049
-3.97615
-3.7223
-3.49073
-3.28053
-3.0897
-2.91615
-2.75793
-2.61328
-2.48068
-2.3588
-2.24648
-2.14271
-2.04663
-1.95745
-1.87451
-1.79721
-1.72502
-1.65748
-1.59418
-1.53476
-1.47887
-1.42624
-1.37659
-1.32967
-1.28528
-1.24322
-1.20331
-1.16539
-1.12932
-1.09494
-1.06212
-1.03073
-1.00067
-0.971846
-0.944178
-0.917603
-0.89207
-0.867536
-0.843955
-0.821282
-0.79942
-0.778299
-0.757851
-0.738021
-0.718755
-0.700003
-0.681718
-0.663875
-0.64645
-0.629417
-0.612753
-0.596439
-0.580454
-0.564779
-0.549396
-0.534286
-0.519433
-0.504819
-0.490428
-0.476243
-0.46225
-0.448434
-0.434782
-0.421282
-0.407921
-0.394689
-0.381577
-0.368576
-0.355679
-0.342878
-0.330171
-0.31755
-0.305013
-0.292556
-0.280175
-0.267866
-0.255626
-0.24345
-0.231334
-0.219276
-0.207271
-0.195313
-0.1834
-0.171523
-0.159679
-0.147861
-0.136063
-0.12428
-0.112504
-0.100731
-0.0889546
-0.0771693
-0.0653694
-0.0535494
-0.0417045
-0.0298299
-0.0179223
-0.00598656
-4.9165
-4.56378
-4.24343
-3.95515
-3.69655
-3.46403
-3.25435
-3.06468
-2.89254
-2.73581
-2.59266
-2.46151
-2.34101
-2.22999
-2.12744
-2.03248
-1.94435
-1.86237
-1.78596
-1.71459
-1.64782
-1.58522
-1.52644
-1.47115
-1.41907
-1.36992
-1.32346
-1.2795
-1.23782
-1.19826
-1.16067
-1.12489
-1.09077
-1.05818
-1.02701
-0.997149
-0.968505
-0.941005
-0.914588
-0.889203
-0.864806
-0.841362
-0.818775
-0.796973
-0.775887
-0.755453
-0.735617
-0.716326
-0.69753
-0.679198
-0.661301
-0.643812
-0.626708
-0.609968
-0.593571
-0.577498
-0.561728
-0.546245
-0.531029
-0.516064
-0.501332
-0.486817
-0.472504
-0.458378
-0.444425
-0.430632
-0.416987
-0.403479
-0.390097
-0.376832
-0.363677
-0.350624
-0.337668
-0.324803
-0.312024
-0.299325
-0.286703
-0.274153
-0.261671
-0.249251
-0.236891
-0.224585
-0.212329
-0.200117
-0.187945
-0.175806
-0.163694
-0.151603
-0.139528
-0.127463
-0.115402
-0.10334
-0.0912699
-0.0791872
-0.0670863
-0.0549619
-0.0428094
-0.0306239
-0.0184024
-0.00614618
-5.21903
-4.82691
-4.46788
-4.14856
-3.86565
-3.61345
-3.38749
-3.18413
-3.00034
-2.8336
-2.68177
-2.54304
-2.41589
-2.29899
-2.19123
-2.09162
-1.99932
-1.91359
-1.8338
-1.75938
-1.68983
-1.62471
-1.56364
-1.50624
-1.45223
-1.40131
-1.35323
-1.30776
-1.2647
-1.22385
-1.18506
-1.14817
-1.11302
-1.07949
-1.04744
-1.01676
-0.987353
-0.959136
-0.932039
-0.906001
-0.880973
-0.856922
-0.833765
-0.811427
-0.789837
-0.76893
-0.748647
-0.728932
-0.709736
-0.69102
-0.672754
-0.654911
-0.637464
-0.620393
-0.603674
-0.587289
-0.571216
-0.555439
-0.539938
-0.524695
-0.509694
-0.494919
-0.480354
-0.465984
-0.451794
-0.437772
-0.423906
-0.410184
-0.396594
-0.383129
-0.36978
-0.356539
-0.343398
-0.330353
-0.317395
-0.304521
-0.291723
-0.278998
-0.266339
-0.253741
-0.241201
-0.228711
-0.216268
-0.203865
-0.191497
-0.179156
-0.166839
-0.154538
-0.142249
-0.129966
-0.117683
-0.105395
-0.0930951
-0.0807791
-0.0684416
-0.0560781
-0.0436837
-0.0312534
-0.0187839
-0.00627363
-5.45403
-5.01767
-4.62862
-4.28651
-3.98558
-3.71888
-3.48103
-3.26776
-3.0756
-2.90169
-2.74369
-2.5996
-2.46774
-2.34671
-2.23528
-2.13241
-2.0372
-1.94886
-1.86672
-1.79018
-1.7187
-1.65183
-1.58916
-1.53031
-1.47496
-1.42282
-1.37362
-1.32711
-1.28309
-1.24136
-1.20174
-1.16408
-1.12823
-1.09404
-1.06138
-1.03014
-1.00021
-0.971497
-0.94393
-0.917441
-0.89198
-0.86752
-0.843977
-0.821274
-0.799341
-0.77811
-0.757521
-0.737518
-0.718048
-0.699069
-0.680551
-0.662463
-0.644781
-0.62748
-0.61054
-0.593938
-0.577656
-0.561674
-0.545974
-0.530538
-0.51535
-0.500393
-0.485652
-0.471111
-0.456758
-0.442578
-0.42856
-0.414692
-0.400963
-0.387364
-0.373886
-0.360521
-0.34726
-0.334096
-0.321024
-0.308035
-0.295124
-0.282286
-0.269513
-0.256801
-0.244143
-0.231533
-0.218966
-0.206436
-0.193936
-0.181462
-0.169006
-0.156564
-0.14413
-0.131698
-0.119264
-0.10682
-0.0943636
-0.0818879
-0.0693886
-0.0568607
-0.0442993
-0.0316991
-0.019056
-0.00636502
-5.61644
-5.1245
-4.70915
-4.35691
-4.0474
-3.77335
-3.52947
-3.31107
-3.11453
-2.93688
-2.77563
-2.62873
-2.49442
-2.37123
-2.2579
-2.15333
-2.05661
-1.96692
-1.88357
-1.80592
-1.73346
-1.66569
-1.60219
-1.54259
-1.48656
-1.43379
-1.38401
-1.33697
-1.29246
-1.25028
-1.21024
-1.17219
-1.13597
-1.10145
-1.06848
-1.03695
-1.00676
-0.977799
-0.950001
-0.923296
-0.897631
-0.872953
-0.849208
-0.826307
-0.804187
-0.782783
-0.762033
-0.741879
-0.722268
-0.703155
-0.684507
-0.666294
-0.648492
-0.631075
-0.614021
-0.597309
-0.58092
-0.564834
-0.549032
-0.533498
-0.518214
-0.503164
-0.488333
-0.473706
-0.459269
-0.445009
-0.430915
-0.416974
-0.403176
-0.389511
-0.37597
-0.362543
-0.349224
-0.336004
-0.322876
-0.309833
-0.296868
-0.283975
-0.271149
-0.258381
-0.245666
-0.232998
-0.220371
-0.207778
-0.195214
-0.182673
-0.170148
-0.157636
-0.145129
-0.132622
-0.120109
-0.107586
-0.095048
-0.0824886
-0.0699032
-0.0572868
-0.0446345
-0.0319415
-0.0192032
-0.0064148
20.6479
20.6446
20.6525
20.6499
20.6587
20.6417
20.6715
20.6681
20.6796
20.6884
20.7014
20.7105
20.7373
20.761
20.758
20.7743
20.792
20.7908
20.8213
20.8731
20.8717
20.8647
20.8832
20.8684
20.8649
20.8472
20.8664
20.8525
20.8249
20.8669
20.8801
20.7623
20.7185
20.7167
20.6458
20.5798
20.5916
20.4845
20.2357
20.1413
20.0297
19.7749
19.452
19.3243
19.2334
19.075
18.6848
18.4673
17.9735
17.3822
17.2037
16.9388
16.5354
15.8178
15.5904
15.2045
14.6147
13.5729
13.0949
12.484
11.3146
10.7988
10.1764
9.8507
7.96106
7.25041
6.78268
4.97554
4.08252
3.14318
3.06764
0.567448
-0.781199
-1.92786
-1.31172
-8.59829
-9.28491
-1.37406
-7.30744
-10.0481
-12.0982
-13.7836
-14.6344
-4.42827
-11.4063
-11.5872
-11.9006
-12.3138
-12.5495
-13.1216
-14.9509
-16.0397
-6.34792
-14.1968
-14.5933
-14.9688
-15.315
-15.4122
-15.9114
-17.6545
-18.89
-11.1054
-19.6193
-20.4023
-21.0166
-21.553
-22.1069
-22.6369
-23.4401
-25.0884
-25.7126
-13.8981
-23.7246
-24.6818
-25.6248
-26.6377
-27.5821
-28.6191
-30.4412
-31.9977
-27.1
-34.7775
-36.3171
-37.8441
-39.4608
-41.1287
-42.8678
-44.9817
-46.3187
-34.2958
-41.8688
-44.3799
-46.5806
-49.1454
-51.5521
-53.7802
-55.8163
-58.673
-63.6176
-74.173
-77.9594
-80.133
-83.1578
-86.3959
-89.3683
-92.7141
-95.9382
-99.343
-117.441
-114.337
-119.025
-124.431
-128.357
-132.192
-135.656
-137.859
-140.425
-160.586
-152.561
-157.44
-173.604
-124.835
-125.697
-120.184
-105.819
-102.621
-92.9458
-83.8239
-80.7464
-73.1143
-66.677
-64.8688
-58.9502
-57.6943
-53.165
-49.0265
-47.8243
-43.8674
-42.8073
-39.5423
-36.5963
-35.703
-33.1195
-30.7415
-29.9434
-27.9031
-27.1658
-25.4421
-23.7525
-23.1641
-21.849
-21.2511
-20.0949
-18.8807
-18.4442
-17.5655
-16.5613
-16.225
-15.5916
-15.1832
-14.5493
-13.8248
-13.5788
-13.1436
-12.8328
-12.3745
-11.8206
-11.629
-11.2756
-10.7907
-10.6469
-10.4
-10.1903
-9.89711
-9.51734
-9.40366
-9.21087
-9.04863
-8.81403
-8.5007
-8.40943
-8.21375
-7.93251
-7.86471
-7.74103
-7.62937
-7.45967
-7.23195
-7.17767
-7.07436
-6.99225
-6.85
-6.6599
-6.62352
-6.49611
-6.3323
-6.31282
-6.24627
-6.20486
-6.11088
0.137334
0.216888
0.228577
0.173397
0.241961
0.226128
0.230757
0.226918
0.215431
0.213977
0.209888
0.204028
0.187558
0.184208
0.180191
0.176116
0.161142
0.164395
0.167703
0.171565
0.162018
0.174197
0.186166
0.199136
0.195776
0.216125
0.235274
0.253626
0.249836
0.272384
0.292328
0.309837
0.300858
0.319374
0.337194
0.352375
0.335443
0.349424
0.360361
0.366768
0.335706
0.347547
0.353204
0.35471
0.312044
0.321806
0.324828
0.326346
0.273045
0.286401
0.291242
0.295958
0.231622
0.244779
0.248207
0.251098
0.16621
0.168052
0.160192
0.148571
0.0254798
-0.00547134
-0.0548928
-0.119701
-0.327462
-0.440837
-0.588777
-0.775853
-1.13852
-1.41375
-1.73129
-2.11844
-2.66987
-3.17984
-3.69145
-4.23071
-4.8177
-5.3122
-5.72644
0.141716
0.235245
0.222266
0.184405
0.24376
0.229415
0.229167
0.220984
0.222078
0.214237
0.208559
0.196637
0.19551
0.186155
0.180476
0.169752
0.172008
0.167755
0.168396
0.164428
0.17427
0.178005
0.186653
0.190414
0.208093
0.219162
0.233173
0.240589
0.260073
0.273791
0.287213
0.292862
0.308505
0.319633
0.32963
0.332084
0.341835
0.348548
0.350958
0.344135
0.343269
0.346767
0.343364
0.330692
0.321933
0.322395
0.315554
0.301524
0.287526
0.289048
0.282751
0.270367
0.250392
0.250083
0.24117
0.22566
0.189768
0.177559
0.156038
0.124868
0.054285
0.00900257
-0.0546975
-0.139733
-0.292297
-0.420724
-0.583574
-0.789839
-1.10502
-1.39722
-1.73558
-2.14499
-2.67335
-3.20587
-3.74584
-4.31858
-4.91672
-5.44197
-5.88344
0.15574
0.263906
0.244957
0.223084
0.263499
0.257811
0.258199
0.254104
0.249833
0.244711
0.239776
0.232788
0.22565
0.218938
0.214132
0.208637
0.204223
0.202349
0.203763
0.205215
0.207763
0.21357
0.222794
0.232096
0.241821
0.254085
0.268811
0.282348
0.29341
0.307229
0.322237
0.334572
0.341611
0.352183
0.364445
0.373814
0.374623
0.380296
0.385865
0.386864
0.376694
0.378673
0.379211
0.374684
0.355537
0.354862
0.352605
0.346404
0.321123
0.32163
0.319974
0.314407
0.28299
0.281644
0.277089
0.266831
0.221668
0.208295
0.190064
0.161738
0.0863243
0.0386721
-0.0235638
-0.108304
-0.258692
-0.391922
-0.557214
-0.768184
-1.07346
-1.37561
-1.72637
-2.15056
-2.68021
-3.22998
-3.79767
-4.40123
-5.0228
-5.57579
-6.03766
0.130154
0.230855
0.20926
0.194391
0.226281
0.223538
0.224519
0.218925
0.216972
0.212452
0.208365
0.199139
0.194354
0.188483
0.18444
0.176515
0.174613
0.173951
0.176007
0.174518
0.179252
0.186248
0.195979
0.201941
0.213816
0.227915
0.243267
0.253323
0.267351
0.283388
0.298888
0.307795
0.318879
0.332166
0.344865
0.350739
0.356458
0.365007
0.371119
0.36926
0.366135
0.370082
0.371052
0.364209
0.353874
0.354196
0.35226
0.344026
0.328532
0.328681
0.327036
0.319543
0.29804
0.295445
0.290657
0.278625
0.243337
0.228421
0.209627
0.179309
0.113797
0.0639767
0.000731222
-0.0860613
-0.226526
-0.363292
-0.531744
-0.746939
-1.04271
-1.35332
-1.71543
-2.15295
-2.68576
-3.25505
-3.85157
-4.48559
-5.13096
-5.71591
-6.20213
0.133967
0.246287
0.218826
0.210363
0.235811
0.234787
0.233766
0.229107
0.22778
0.222731
0.217137
0.209155
0.205466
0.199137
0.193722
0.187008
0.186152
0.184323
0.1847
0.18415
0.189922
0.195452
0.203377
0.209922
0.222455
0.234578
0.248056
0.258447
0.272953
0.28722
0.301372
0.310681
0.322386
0.334496
0.346213
0.35244
0.359129
0.366822
0.372535
0.371536
0.370146
0.373316
0.374251
0.368422
0.360698
0.36042
0.358682
0.351315
0.339501
0.338888
0.337366
0.330318
0.313694
0.310316
0.305534
0.293619
0.264474
0.248864
0.229829
0.19916
0.140694
0.0899922
0.0262262
-0.0613176
-0.194164
-0.332839
-0.503447
-0.721376
-1.01136
-1.32875
-1.70098
-2.1504
-2.69046
-3.27901
-3.9041
-4.56916
-5.2428
-5.86041
-6.36917
0.134576
0.241998
0.217169
0.212444
0.232112
0.232759
0.232028
0.228079
0.22663
0.222093
0.216809
0.209551
0.205824
0.200073
0.194942
0.188966
0.188028
0.186585
0.186959
0.186946
0.192481
0.198116
0.205747
0.212617
0.224742
0.236675
0.249626
0.26028
0.274558
0.288477
0.302108
0.311834
0.323696
0.335538
0.346779
0.353476
0.360706
0.368154
0.373723
0.373677
0.373588
0.376443
0.37743
0.372767
0.367066
0.366588
0.365084
0.358846
0.349875
0.348973
0.34762
0.341436
0.328589
0.324987
0.32035
0.309095
0.284867
0.269242
0.25023
0.219932
0.167119
0.116363
0.0524819
-0.0349327
-0.161747
-0.301293
-0.473429
-0.69311
-0.979168
-1.30222
-1.68375
-2.14434
-2.6937
-3.30186
-3.95566
-4.65275
-5.35782
-6.00967
-6.54595
0.136848
0.237648
0.216369
0.214042
0.229431
0.231073
0.230574
0.22732
0.225758
0.221621
0.216626
0.210105
0.20634
0.201061
0.196222
0.19099
0.189949
0.188802
0.18922
0.189761
0.195015
0.200699
0.208111
0.215333
0.226987
0.238714
0.251245
0.262188
0.276117
0.289731
0.302953
0.313117
0.324961
0.336594
0.347499
0.354701
0.362249
0.369573
0.375098
0.376009
0.376897
0.379652
0.380786
0.377312
0.373204
0.372791
0.37162
0.366613
0.359894
0.359054
0.358009
0.352913
0.343071
0.339665
0.335372
0.325141
0.304859
0.289703
0.271025
0.241616
0.193381
0.143186
0.0796246
-0.00701723
-0.128941
-0.268566
-0.441598
-0.66227
-0.945716
-1.27356
-1.66359
-2.1348
-2.69504
-3.32319
-4.00601
-4.73636
-5.47596
-6.16336
-6.72952
0.140342
0.232783
0.215782
0.215
0.22721
0.229453
0.229207
0.226563
0.224934
0.221161
0.216479
0.210623
0.206858
0.202008
0.197487
0.192926
0.191813
0.190933
0.191443
0.192472
0.197473
0.203189
0.210446
0.21796
0.229172
0.240698
0.252891
0.264065
0.277634
0.290981
0.30388
0.314417
0.326187
0.337659
0.348324
0.35599
0.363757
0.371043
0.376615
0.378415
0.380092
0.382905
0.384282
0.381943
0.379158
0.379003
0.378266
0.374493
0.369639
0.369114
0.368517
0.364608
0.357252
0.354344
0.350586
0.341592
0.324592
0.310255
0.292199
0.264026
0.219644
0.170466
0.10763
0.0222296
-0.0955484
-0.234635
-0.407982
-0.629043
-0.910701
-1.24262
-1.64043
-2.12186
-2.6941
-3.34268
-4.05498
-4.82003
-5.59714
-6.32363
-6.92216
0.144715
0.227792
0.215204
0.215484
0.225338
0.227923
0.227927
0.225808
0.224167
0.220726
0.216368
0.211103
0.207391
0.202931
0.198744
0.194771
0.193638
0.192996
0.193632
0.195072
0.199873
0.205604
0.212755
0.22049
0.231313
0.242641
0.254559
0.265895
0.279129
0.292235
0.304883
0.315714
0.327397
0.338742
0.349247
0.357315
0.365258
0.372568
0.378258
0.380861
0.383213
0.386199
0.387899
0.386621
0.384981
0.385221
0.385006
0.382433
0.379182
0.379153
0.379128
0.376447
0.371219
0.369027
0.365978
0.358347
0.34417
0.33091
0.313737
0.287039
0.246027
0.198221
0.136477
0.0526804
-0.061422
-0.199465
-0.372588
-0.593526
-0.873881
-1.20927
-1.61418
-2.10546
-2.69051
-3.36
-4.10237
-4.90372
-5.72133
-6.49023
-7.12815
0.14967
0.222929
0.214537
0.21561
0.223728
0.226489
0.22673
0.225058
0.223456
0.220321
0.21629
0.211545
0.207936
0.203836
0.199986
0.196527
0.195425
0.195
0.195783
0.197565
0.202218
0.207954
0.215031
0.222922
0.233414
0.244551
0.256243
0.267675
0.28061
0.293497
0.305947
0.317
0.328602
0.339848
0.350253
0.358664
0.366765
0.374146
0.380011
0.383333
0.38629
0.38953
0.39162
0.391323
0.39071
0.391443
0.391823
0.390402
0.388572
0.389171
0.389825
0.38838
0.38503
0.383716
0.381527
0.375335
0.363665
0.351679
0.335615
0.310573
0.272613
0.22646
0.16614
0.0842455
-0.0264542
-0.16302
-0.335419
-0.55578
-0.835063
-1.17337
-1.58473
-2.08554
-2.68395
-3.37481
-4.14795
-4.98732
-5.84844
-6.66244
-7.34097
0.154902
0.218404
0.213741
0.215467
0.222315
0.225153
0.225608
0.224317
0.222797
0.219946
0.216238
0.211954
0.208491
0.204726
0.20121
0.1982
0.197174
0.19695
0.197891
0.199957
0.204508
0.210244
0.217271
0.225264
0.235477
0.246431
0.257932
0.269407
0.282081
0.29477
0.307062
0.318274
0.329809
0.340979
0.351332
0.360032
0.368287
0.375776
0.381857
0.385825
0.389339
0.392896
0.395424
0.39604
0.396368
0.397666
0.398697
0.39838
0.397842
0.399167
0.400588
0.400375
0.398728
0.398412
0.39721
0.392508
0.383128
0.37257
0.357811
0.334567
0.299458
0.255194
0.196596
0.116862
0.0094315
-0.125274
-0.296477
-0.515834
-0.794088
-1.13478
-1.55197
-2.06197
-2.67408
-3.38675
-4.19144
-5.07069
-5.97844
-6.84262
-7.56375
0.16014
0.214353
0.21283
0.215127
0.221052
0.223909
0.224555
0.223592
0.222184
0.219601
0.216209
0.212337
0.209051
0.205601
0.202413
0.199801
0.198883
0.198849
0.199953
0.202255
0.206744
0.212477
0.219469
0.227522
0.237502
0.248284
0.259619
0.271095
0.283543
0.296053
0.308216
0.31954
0.331021
0.342136
0.35247
0.361417
0.369828
0.377454
0.38378
0.388333
0.392374
0.396293
0.399296
0.400763
0.401973
0.403888
0.405613
0.406356
0.407017
0.40914
0.411398
0.412409
0.412342
0.413117
0.413008
0.409834
0.402594
0.393587
0.380303
0.358976
0.326601
0.284428
0.227821
0.150484
0.0462902
-0.0861999
-0.255758
-0.473699
-0.750822
-1.09337
-1.51576
-2.03458
-2.6606
-3.39546
-4.23253
-5.15361
-6.11128
-7.0311
-7.8032
0.165162
0.210855
0.21184
0.214644
0.219906
0.222751
0.223568
0.222887
0.221615
0.219286
0.216198
0.212698
0.209613
0.206464
0.203591
0.201335
0.200551
0.2007
0.201966
0.204469
0.208925
0.214656
0.221623
0.229705
0.239489
0.250111
0.261298
0.272745
0.284997
0.297345
0.309401
0.320799
0.33224
0.343318
0.35366
0.36282
0.37139
0.379176
0.385769
0.390857
0.395401
0.399716
0.40322
0.405491
0.407536
0.410105
0.412557
0.414321
0.416115
0.419089
0.422241
0.424466
0.425893
0.427829
0.428903
0.427285
0.422089
0.414733
0.403072
0.383767
0.354067
0.314164
0.259796
0.185077
0.0841608
-0.0457777
-0.21326
-0.429372
-0.70515
-1.04902
-1.47597
-2.00321
-2.64317
-3.40055
-4.27088
-5.2358
-6.24681
-7.22646
-8.05126
0.169862
0.207884
0.210815
0.214065
0.218853
0.221674
0.22264
0.222207
0.221085
0.219
0.216204
0.213044
0.210175
0.207314
0.204745
0.202811
0.202179
0.202504
0.20393
0.206605
0.211052
0.216783
0.223731
0.231819
0.241436
0.25191
0.262965
0.274362
0.286441
0.298644
0.310609
0.322056
0.333467
0.344523
0.354892
0.364241
0.372975
0.38094
0.387813
0.393396
0.398427
0.403163
0.407186
0.41022
0.413066
0.416315
0.419516
0.42227
0.425147
0.429012
0.433103
0.436536
0.439394
0.442547
0.444878
0.444844
0.441627
0.43601
0.4261
0.408912
0.381872
0.344403
0.292501
0.220613
0.12307
-0.00399114
-0.168976
-0.382842
-0.656971
-1.00159
-1.43247
-1.96763
-2.62146
-3.40162
-4.30607
-5.31695
-6.3849
-7.42866
-8.31757
0.174124
0.205437
0.209795
0.213424
0.217876
0.220669
0.221769
0.221555
0.220592
0.21874
0.216223
0.213379
0.210735
0.20815
0.205872
0.204234
0.203766
0.204261
0.205844
0.20867
0.213125
0.218858
0.225791
0.233871
0.243345
0.253683
0.264616
0.275949
0.287877
0.299949
0.311836
0.323311
0.334703
0.34575
0.35616
0.365682
0.374583
0.382741
0.389902
0.39595
0.401455
0.406629
0.411183
0.414948
0.418567
0.422514
0.42648
0.430198
0.434123
0.438908
0.443973
0.448607
0.452855
0.457269
0.46092
0.462494
0.461219
0.457415
0.44937
0.43439
0.410024
0.375141
0.325919
0.25707
0.163035
0.0391716
-0.122901
-0.334092
-0.606197
-0.950979
-1.38509
-1.92765
-2.59513
-3.39823
-4.33768
-5.39666
-6.52532
-7.63727
-8.59593
0.177877
0.203483
0.208815
0.21275
0.216964
0.219732
0.22095
0.220932
0.220133
0.218504
0.216255
0.213704
0.211291
0.208971
0.206972
0.205608
0.205311
0.205974
0.207708
0.210669
0.215145
0.220883
0.227804
0.235865
0.245216
0.255429
0.26625
0.27751
0.289303
0.301258
0.313077
0.324567
0.335947
0.346997
0.357459
0.367141
0.376212
0.384574
0.39203
0.398519
0.404486
0.41011
0.415203
0.419674
0.424044
0.4287
0.433442
0.438103
0.443046
0.448774
0.45484
0.460673
0.466281
0.471992
0.477017
0.480222
0.48087
0.478946
0.472868
0.46018
0.438527
0.406374
0.360033
0.294427
0.204065
0.0837182
-0.0750298
-0.283105
-0.552747
-0.897064
-1.33369
-1.88302
-2.56381
-3.38992
-4.3652
-5.4745
-6.6678
-7.85467
-8.89005
0.181092
0.201978
0.207896
0.212064
0.216109
0.218857
0.220181
0.22034
0.219705
0.218293
0.216298
0.214023
0.211842
0.209779
0.208046
0.206938
0.206816
0.207642
0.209522
0.212607
0.217112
0.222858
0.229768
0.237805
0.247048
0.257147
0.267863
0.279047
0.290719
0.302569
0.314327
0.325825
0.3372
0.348262
0.358785
0.368617
0.377862
0.386437
0.394191
0.401101
0.40752
0.413604
0.41924
0.424394
0.429497
0.43487
0.440394
0.445981
0.451921
0.458607
0.465697
0.472725
0.479676
0.486713
0.493156
0.498017
0.500583
0.500599
0.496579
0.486265
0.467378
0.438093
0.394824
0.332665
0.246165
0.129652
-0.0253589
-0.22986
-0.496551
-0.839738
-1.27812
-1.83351
-2.52714
-3.37621
-4.38809
-5.54996
-6.81205
-8.07974
-9.20568
0.183817
0.200817
0.207049
0.211382
0.215304
0.218038
0.219458
0.219779
0.219308
0.218102
0.216351
0.214338
0.212386
0.210572
0.209093
0.208227
0.208281
0.209267
0.211287
0.214486
0.219028
0.224784
0.231686
0.239694
0.248842
0.258836
0.269455
0.280561
0.292125
0.30388
0.315585
0.327086
0.33846
0.349543
0.360134
0.370112
0.379532
0.388326
0.396379
0.403696
0.410559
0.417108
0.423288
0.429107
0.434927
0.441021
0.447331
0.453828
0.46075
0.468406
0.476535
0.484759
0.493039
0.501428
0.509328
0.515868
0.520355
0.522366
0.520489
0.51263
0.496572
0.47029
0.430277
0.371767
0.289332
0.176973
0.0261135
-0.17434
-0.437546
-0.778896
-1.2182
-1.77886
-2.48471
-3.35658
-4.40574
-5.62245
-6.95763
-8.31154
-9.53258
0.186066
0.199946
0.20628
0.210715
0.214547
0.217271
0.218779
0.21925
0.218938
0.217933
0.216414
0.214649
0.212924
0.211349
0.210114
0.209477
0.209707
0.210848
0.213005
0.21631
0.220893
0.226662
0.233556
0.241535
0.250599
0.260497
0.271026
0.282054
0.293519
0.30519
0.316848
0.328348
0.339727
0.350838
0.361502
0.371622
0.381219
0.390238
0.39859
0.4063
0.413601
0.420617
0.427342
0.433811
0.440335
0.44715
0.454247
0.461642
0.469532
0.478167
0.487348
0.496768
0.506371
0.516132
0.525524
0.533765
0.540185
0.544242
0.544585
0.539257
0.526102
0.502953
0.466372
0.411712
0.333561
0.225677
0.0793863
-0.11653
-0.375675
-0.714438
-1.15379
-1.71881
-2.43614
-3.33045
-4.41749
-5.69132
-7.1041
-8.55264
-9.87359
0.187886
0.199311
0.205587
0.210072
0.213833
0.216552
0.218142
0.218751
0.218595
0.217782
0.216486
0.214957
0.213455
0.212111
0.21111
0.210691
0.211094
0.212388
0.214676
0.218082
0.222709
0.228493
0.235381
0.243331
0.25232
0.26213
0.272574
0.283526
0.294903
0.306497
0.318113
0.329612
0.341
0.352145
0.362888
0.373147
0.382922
0.392169
0.400821
0.408914
0.416645
0.42413
0.431397
0.438503
0.445718
0.453255
0.461138
0.469421
0.478269
0.487887
0.498131
0.508747
0.519669
0.530822
0.541734
0.5517
0.560067
0.566218
0.568852
0.566133
0.555958
0.536069
0.503091
0.452481
0.378842
0.275755
0.134455
-0.0564172
-0.310889
-0.646273
-1.08472
-1.6531
-2.381
-3.29726
-4.42262
-5.75581
-7.25098
-8.80239
-10.2362
0.189334
0.198857
0.204965
0.209457
0.21316
0.215879
0.217544
0.218281
0.218277
0.217649
0.216566
0.215263
0.213979
0.212858
0.212081
0.21187
0.212444
0.213887
0.216301
0.219803
0.224477
0.230277
0.237161
0.245083
0.254004
0.263734
0.274099
0.284979
0.296274
0.307801
0.31938
0.330877
0.342278
0.353462
0.364288
0.374685
0.38464
0.394116
0.403066
0.411534
0.419691
0.427644
0.435449
0.44318
0.451077
0.459333
0.468
0.477161
0.486957
0.497564
0.508877
0.520689
0.532931
0.545491
0.55795
0.569662
0.579995
0.588285
0.593279
0.593241
0.586128
0.569623
0.540414
0.494053
0.42516
0.327196
0.191312
0.00600681
-0.243148
-0.574314
-1.01084
-1.58146
-2.31886
-3.25636
-4.42032
-5.81505
-7.3976
-9.05888
-10.6092
0.190479
0.198523
0.204408
0.208873
0.212526
0.215247
0.216982
0.217841
0.217983
0.217532
0.216653
0.215567
0.214495
0.21359
0.213027
0.213016
0.213757
0.215345
0.217882
0.221476
0.226197
0.232017
0.238897
0.246792
0.255652
0.26531
0.2756
0.286411
0.297634
0.309099
0.320646
0.332142
0.343561
0.354789
0.3657
0.376234
0.386369
0.396078
0.405324
0.414159
0.422736
0.431156
0.439496
0.44784
0.456408
0.465381
0.474829
0.484859
0.495596
0.507194
0.519581
0.532591
0.546153
0.560135
0.574163
0.587642
0.599962
0.610434
0.61785
0.620567
0.616598
0.603599
0.57832
0.536405
0.4725
0.379983
0.249945
0.0707447
-0.172416
-0.498483
-0.931997
-1.50363
-2.24927
-3.20709
-4.40971
-5.8681
-7.54329
-9.3221
-11.0031
0.191372
0.198271
0.203907
0.20832
0.21193
0.214655
0.216456
0.217428
0.217712
0.217432
0.216748
0.21587
0.215003
0.214306
0.213949
0.21413
0.215034
0.216764
0.219419
0.223101
0.227872
0.233712
0.24059
0.24846
0.257266
0.266856
0.277079
0.287825
0.29898
0.310391
0.32191
0.333408
0.344847
0.356123
0.367122
0.377794
0.38811
0.39805
0.407591
0.416787
0.425778
0.434663
0.443533
0.452481
0.461712
0.471397
0.481622
0.492512
0.504184
0.516774
0.530238
0.544447
0.559331
0.574747
0.590364
0.605631
0.61996
0.632655
0.642552
0.648095
0.647353
0.637978
0.616786
0.579514
0.520839
0.434097
0.310336
0.137794
-0.0986681
-0.418712
-0.848052
-1.41933
-2.17179
-3.14874
-4.38983
-5.91386
-7.68714
-9.59046
-11.4106
0.192062
0.19807
0.203453
0.207799
0.211367
0.214098
0.215962
0.217041
0.217462
0.217346
0.21685
0.21617
0.215503
0.215007
0.214848
0.215213
0.216277
0.218144
0.220914
0.224682
0.229502
0.235363
0.242242
0.250089
0.258845
0.268375
0.278534
0.289219
0.300314
0.311676
0.32317
0.334672
0.346134
0.357462
0.368552
0.379361
0.389859
0.400031
0.409865
0.419416
0.428816
0.438162
0.447557
0.4571
0.466984
0.477377
0.488374
0.500118
0.512717
0.526299
0.540844
0.556252
0.572459
0.589322
0.606545
0.623619
0.639978
0.654936
0.667372
0.675807
0.678376
0.672741
0.655788
0.623353
0.570153
0.489513
0.372466
0.207145
-0.0218866
-0.334941
-0.758871
-1.3283
-2.08594
-3.08058
-4.35965
-5.95115
-7.82821
-9.86688
-11.8309
0.192584
0.197898
0.203039
0.207309
0.210838
0.213576
0.2155
0.21668
0.217232
0.217274
0.216958
0.21647
0.215994
0.215692
0.215725
0.216267
0.217485
0.219487
0.222368
0.226219
0.231088
0.236972
0.243852
0.251678
0.26039
0.269864
0.279965
0.290593
0.301633
0.312952
0.324426
0.335933
0.347423
0.358805
0.369989
0.380936
0.391614
0.402019
0.412142
0.422043
0.431848
0.441651
0.451565
0.461694
0.472224
0.483319
0.495084
0.507673
0.521194
0.535767
0.551393
0.568
0.585534
0.603853
0.622698
0.641597
0.660009
0.677265
0.692294
0.703687
0.709648
0.707867
0.695302
0.667893
0.620414
0.546205
0.436306
0.278781
0.0579363
-0.247123
-0.664332
-1.2303
-1.99125
-3.00183
-4.31803
-5.9786
-7.96543
-10.1493
-12.2603
0.192972
0.197735
0.202658
0.206847
0.21034
0.213087
0.215067
0.216344
0.217021
0.217215
0.217071
0.216767
0.216478
0.216363
0.216578
0.217291
0.218661
0.220792
0.223781
0.227713
0.232632
0.23854
0.245422
0.25323
0.261902
0.271326
0.281372
0.291948
0.302939
0.314219
0.325677
0.337192
0.348711
0.360152
0.37143
0.382515
0.393374
0.40401
0.414421
0.424667
0.434871
0.445127
0.455555
0.466261
0.477429
0.48922
0.501747
0.515175
0.529611
0.545173
0.561881
0.579687
0.59855
0.618334
0.638813
0.659553
0.68004
0.699631
0.717303
0.731718
0.741149
0.743332
0.735301
0.713106
0.671592
0.604139
0.501826
0.352681
0.140798
-0.155222
-0.564328
-1.12508
-1.88727
-2.91168
-4.26374
-5.99467
-8.09749
-10.4369
-12.6907
0.193249
0.197575
0.202305
0.206413
0.209871
0.212627
0.214661
0.21603
0.216828
0.217168
0.21719
0.217062
0.216953
0.217018
0.217411
0.218288
0.219804
0.222062
0.225155
0.229165
0.234135
0.240067
0.246953
0.254745
0.263382
0.272759
0.282756
0.293283
0.30423
0.315476
0.326921
0.338446
0.349998
0.361499
0.372874
0.384097
0.395137
0.406003
0.416699
0.427286
0.437884
0.448588
0.459523
0.470799
0.482596
0.495079
0.508361
0.52262
0.537965
0.554513
0.572302
0.591307
0.6115
0.632756
0.654882
0.677479
0.700061
0.72202
0.742383
0.759881
0.77286
0.779112
0.775756
0.758957
0.723652
0.66328
0.568989
0.428811
0.226685
-0.059217
-0.458769
-1.0124
-1.77352
-2.80929
-4.19545
-5.99765
-8.22301
-10.7336
-13.1175
0.193429
0.197415
0.201974
0.206003
0.20943
0.212195
0.214282
0.215739
0.216653
0.217132
0.217314
0.217356
0.21742
0.217659
0.218221
0.219258
0.220915
0.223297
0.226491
0.230577
0.235596
0.241554
0.248446
0.256224
0.264828
0.274164
0.284116
0.294599
0.305505
0.316723
0.328157
0.339695
0.351282
0.362846
0.374319
0.385681
0.396901
0.407995
0.418974
0.429897
0.440885
0.452031
0.463467
0.475305
0.487724
0.500891
0.514923
0.530005
0.546253
0.563784
0.582652
0.602855
0.624379
0.647114
0.670896
0.695363
0.720061
0.744419
0.767519
0.788157
0.804757
0.815181
0.816638
0.805414
0.776555
0.723586
0.637752
0.507132
0.315571
0.040897
-0.347582
-0.892073
-1.64955
-2.69379
-4.11174
-5.98559
-8.34043
-11.0396
-13.525
0.193524
0.197258
0.201663
0.205617
0.209015
0.211791
0.213928
0.215468
0.216493
0.217108
0.217441
0.217647
0.217878
0.218285
0.219011
0.220201
0.221996
0.224497
0.22779
0.23195
0.237018
0.243003
0.249901
0.257668
0.266244
0.275542
0.285452
0.295895
0.306765
0.317957
0.329384
0.340937
0.352563
0.364192
0.375763
0.387264
0.398665
0.409985
0.421243
0.432498
0.44387
0.455454
0.467385
0.479777
0.49281
0.506654
0.521428
0.537328
0.554471
0.572981
0.592927
0.614325
0.637181
0.661399
0.686847
0.713196
0.740028
0.766815
0.792693
0.816526
0.836818
0.851512
0.857913
0.852439
0.83026
0.785014
0.708068
0.587597
0.407419
0.14511
-0.230716
-0.763905
-1.51491
-2.5643
-4.01106
-5.95627
-8.44779
-11.3543
-13.9111
0.193559
0.197089
0.201368
0.205253
0.208624
0.211411
0.213596
0.215217
0.216349
0.217093
0.217573
0.217936
0.218329
0.218896
0.219781
0.221119
0.223047
0.225663
0.229052
0.233284
0.238402
0.244413
0.251319
0.259076
0.267627
0.276891
0.286764
0.297171
0.308009
0.319179
0.330602
0.342172
0.353838
0.365534
0.377206
0.388846
0.400426
0.41197
0.423505
0.435088
0.446839
0.458854
0.471273
0.484212
0.497851
0.512365
0.527875
0.544583
0.562616
0.5821
0.60312
0.625711
0.649899
0.675604
0.702723
0.730966
0.759951
0.789193
0.817888
0.844967
0.869019
0.888076
0.89955
0.899994
0.884722
0.847511
0.779881
0.670148
0.502176
0.253392
-0.108144
-0.627747
-1.3692
-2.41993
-3.89177
-5.90719
-8.54286
-11.6822
-14.2565
0.193541
0.196914
0.201086
0.204909
0.208256
0.211055
0.213287
0.214984
0.216219
0.217087
0.217708
0.218222
0.21877
0.219494
0.22053
0.222011
0.224068
0.226797
0.230278
0.234581
0.239747
0.245787
0.252701
0.260451
0.26898
0.278213
0.288053
0.298426
0.309235
0.320388
0.331809
0.343399
0.355107
0.366872
0.378646
0.390424
0.402182
0.413949
0.425757
0.437664
0.449788
0.462228
0.475129
0.488608
0.502846
0.518022
0.53426
0.551769
0.570684
0.591137
0.613228
0.637009
0.662527
0.689721
0.718517
0.748664
0.779816
0.811538
0.843086
0.873459
0.901334
0.924843
0.941513
0.948037
0.939894
0.911024
0.853131
0.754721
0.599779
0.365695
0.0201342
-0.483477
-1.21203
-2.25979
-3.75212
-5.83553
-8.6226
-12.0233
-14.5575
0.193476
0.196737
0.200817
0.204583
0.20791
0.210721
0.212998
0.214769
0.216102
0.217089
0.217846
0.218506
0.219204
0.220077
0.221261
0.222879
0.22506
0.227898
0.231469
0.235841
0.241056
0.247123
0.254048
0.261792
0.270302
0.279508
0.289317
0.299661
0.310445
0.321583
0.333005
0.344617
0.356369
0.368205
0.38008
0.391997
0.403932
0.41592
0.427998
0.440224
0.452716
0.465575
0.478951
0.492963
0.507791
0.523621
0.54058
0.558882
0.578672
0.600088
0.623244
0.648212
0.675058
0.703742
0.734219
0.766277
0.799611
0.833834
0.868267
0.901979
0.933737
0.961782
0.983764
0.996525
0.995724
0.975494
0.92775
0.84124
0.700148
0.481951
0.15409
-0.331018
-1.04308
-2.08302
-3.59029
-5.73811
-8.68342
-12.385
-14.8069
0.193366
0.196561
0.200558
0.204274
0.207583
0.210407
0.212728
0.21457
0.215998
0.2171
0.217987
0.218786
0.219629
0.220647
0.221972
0.223723
0.226025
0.228968
0.232626
0.237066
0.242328
0.248424
0.25536
0.2631
0.271593
0.280775
0.290558
0.300874
0.311637
0.322763
0.334189
0.345824
0.357622
0.369531
0.381508
0.393563
0.405675
0.41788
0.430225
0.442765
0.45562
0.468893
0.482736
0.497273
0.512684
0.529161
0.546832
0.565918
0.586575
0.608947
0.633164
0.659314
0.687485
0.717659
0.749819
0.783795
0.819323
0.856067
0.893413
0.930504
0.966201
0.998861
1.02626
1.04541
1.05216
1.04085
1.00366
0.92962
0.803193
0.60207
0.293662
-0.170336
-0.862067
-1.88878
-3.40434
-5.61131
-8.72067
-12.771
-14.979
0.193231
0.196376
0.200308
0.203981
0.207275
0.210113
0.212476
0.214387
0.215906
0.217117
0.21813
0.219064
0.220046
0.221203
0.222664
0.224544
0.226962
0.230008
0.23375
0.238255
0.243565
0.24969
0.256638
0.264376
0.272855
0.282016
0.291774
0.302067
0.312811
0.323928
0.335359
0.34702
0.358866
0.370848
0.382929
0.395121
0.407408
0.419829
0.432436
0.445286
0.458498
0.472178
0.486483
0.501537
0.517522
0.534637
0.553013
0.572875
0.59439
0.617711
0.642983
0.67031
0.699802
0.731464
0.765308
0.801207
0.838939
0.878219
0.918504
0.959012
0.998698
1.03605
1.06897
1.09465
1.10914
1.10704
1.08079
1.01977
0.908808
0.72594
0.438755
-0.00145062
-0.668782
-1.6763
-3.19233
-5.45106
-8.72821
-13.1798
-15.0727
0.193075
0.196187
0.200068
0.203703
0.206984
0.209837
0.212241
0.214218
0.215824
0.217142
0.218275
0.219339
0.220455
0.221746
0.223338
0.225341
0.227872
0.231016
0.234841
0.239411
0.244767
0.250922
0.257882
0.26562
0.274086
0.283229
0.292966
0.303239
0.313966
0.325077
0.336516
0.348204
0.3601
0.372156
0.38434
0.396669
0.40913
0.421764
0.434629
0.447785
0.461349
0.475429
0.490188
0.505753
0.522304
0.540048
0.559119
0.579748
0.602114
0.626376
0.652694
0.681193
0.712001
0.745149
0.780676
0.8185
0.858445
0.900275
0.943519
0.987476
1.0312
1.0733
1.11185
1.14419
1.16661
1.17397
1.15904
1.11158
1.01687
0.853429
0.589236
0.175561
-0.463103
-1.44492
-2.95229
-5.25287
-8.69878
-13.6164
-15.0832
0.192898
0.195999
0.199835
0.203438
0.20671
0.209578
0.212023
0.214063
0.215753
0.217173
0.218421
0.21961
0.220855
0.222275
0.223993
0.226117
0.228756
0.231996
0.235901
0.240533
0.245935
0.25212
0.259094
0.266832
0.275289
0.284415
0.294134
0.304388
0.315103
0.326209
0.337658
0.349375
0.361321
0.373454
0.385741
0.398206
0.410839
0.423683
0.436803
0.45026
0.46417
0.478644
0.493849
0.509917
0.527026
0.545389
0.565147
0.586535
0.609742
0.634936
0.662295
0.691958
0.724076
0.758704
0.795913
0.835664
0.877827
0.922217
0.968438
1.01587
1.06368
1.11059
1.15485
1.19397
1.2245
1.24157
1.23832
1.20494
1.12725
0.984381
0.744938
0.360559
-0.245005
-1.19408
-2.68228
-5.01175
-8.62197
-14.0807
-14.9782
0.1927
0.195816
0.199609
0.203186
0.206451
0.209336
0.211819
0.21392
0.215691
0.217209
0.218569
0.219878
0.221247
0.222791
0.224632
0.22687
0.229614
0.232946
0.236929
0.241622
0.24707
0.253284
0.260273
0.268013
0.276462
0.285574
0.295277
0.305516
0.31622
0.327324
0.338785
0.350532
0.36253
0.374739
0.38713
0.39973
0.412533
0.425586
0.438956
0.452709
0.466959
0.48182
0.497465
0.514028
0.531686
0.55066
0.571095
0.593232
0.61727
0.643388
0.671778
0.702597
0.736018
0.772123
0.81101
0.852686
0.89707
0.944027
0.993239
1.04418
1.0961
1.14789
1.19793
1.24395
1.28274
1.30976
1.31852
1.29972
1.23979
1.11862
0.905657
0.553338
-0.0145749
-0.923376
-2.3805
-4.7223
-8.48354
-14.5655
-14.7901
0.192498
0.195627
0.199392
0.202946
0.206206
0.209108
0.21163
0.213789
0.215639
0.217251
0.218718
0.220142
0.221631
0.223295
0.225252
0.227602
0.230447
0.233868
0.237926
0.242679
0.248172
0.254416
0.26142
0.269162
0.277606
0.286706
0.296395
0.306622
0.317317
0.328421
0.339896
0.351674
0.363726
0.376012
0.388506
0.40124
0.414212
0.427469
0.441086
0.45513
0.469714
0.484957
0.501034
0.518083
0.536281
0.555856
0.57696
0.599835
0.624695
0.651726
0.681138
0.713106
0.747822
0.785395
0.825955
0.869554
0.916161
0.96569
1.0179
1.07236
1.12844
1.18514
1.24104
1.29406
1.34127
1.37845
1.39954
1.39579
1.35433
1.25593
1.07115
0.753629
0.227975
-0.632629
-2.04535
-4.37897
-8.26705
-15.062
-14.4387
0.19229
0.195438
0.199181
0.202717
0.205975
0.208894
0.211453
0.21367
0.215595
0.217297
0.218867
0.220403
0.222006
0.223785
0.225856
0.228313
0.231255
0.234763
0.238893
0.243705
0.249242
0.255516
0.262536
0.270282
0.278721
0.287812
0.297489
0.307705
0.318393
0.329501
0.340991
0.352802
0.364907
0.377271
0.389868
0.402734
0.415873
0.429332
0.443191
0.45752
0.472433
0.48805
0.504552
0.52208
0.54081
0.560976
0.582737
0.606342
0.632012
0.659947
0.690372
0.723477
0.759479
0.798514
0.84074
0.886257
0.935083
0.987186
1.04241
1.10041
1.16065
1.22231
1.28413
1.34425
1.40001
1.44755
1.48127
1.49301
1.47068
1.39609
1.24113
0.961096
0.482298
-0.321894
-1.67557
-3.97627
-7.95158
-15.5603
-13.989
0.192076
0.195252
0.198977
0.202499
0.205757
0.208693
0.211289
0.213561
0.215558
0.217348
0.219017
0.220659
0.222373
0.224263
0.226442
0.229003
0.232038
0.23563
0.239831
0.2447
0.250281
0.256585
0.26362
0.271371
0.279807
0.28889
0.298559
0.308766
0.31945
0.330561
0.342068
0.353913
0.366072
0.378514
0.391214
0.404211
0.417514
0.431173
0.44527
0.45988
0.475115
0.4911
0.508018
0.526016
0.545268
0.566016
0.588425
0.612748
0.639219
0.668046
0.699472
0.733706
0.770982
0.81147
0.855355
0.902782
0.953823
1.0085
1.06673
1.12828
1.19272
1.25937
1.32716
1.39445
1.45889
1.51697
1.56358
1.59122
1.58865
1.53884
1.41527
1.17533
0.747912
0.00848254
-1.27036
-3.50923
-7.51733
-16.034
-13.5239
0.191856
0.195075
0.198779
0.202291
0.205551
0.208505
0.211137
0.213462
0.215529
0.217402
0.219166
0.220911
0.222731
0.224729
0.227012
0.229672
0.232798
0.23647
0.240741
0.245665
0.251288
0.257622
0.264674
0.272431
0.280865
0.289942
0.299603
0.309803
0.320485
0.331602
0.343128
0.355007
0.367221
0.379741
0.392544
0.40567
0.419135
0.432991
0.44732
0.462205
0.477758
0.494103
0.51143
0.529889
0.549655
0.570973
0.59402
0.619051
0.64631
0.676019
0.708435
0.743785
0.782324
0.824254
0.869788
0.919117
0.972365
1.02961
1.09085
1.15595
1.2246
1.29627
1.37007
1.44461
1.51782
1.58661
1.64636
1.69026
1.70802
1.68389
1.59319
1.39585
1.02421
0.357836
-0.829572
-2.9737
-6.94393
-16.4383
-12.9571
0.19164
0.194896
0.198589
0.202093
0.205356
0.208329
0.210996
0.213372
0.215506
0.21746
0.219315
0.221159
0.223082
0.225181
0.227565
0.230322
0.233535
0.237284
0.241622
0.246601
0.252265
0.258629
0.265698
0.273461
0.281895
0.290968
0.300623
0.310818
0.321499
0.332624
0.34417
0.356084
0.368353
0.380951
0.393855
0.407109
0.420734
0.434783
0.449342
0.464496
0.480359
0.497059
0.514786
0.533698
0.553967
0.575846
0.59952
0.625247
0.653283
0.683861
0.717255
0.753709
0.793498
0.836858
0.88403
0.935249
0.990694
1.0505
1.11474
1.1834
1.25627
1.33297
1.41282
1.49466
1.57674
1.65636
1.72947
1.78996
1.82857
1.83096
1.77449
1.62209
1.31043
0.725175
-0.353812
-2.36681
-6.21385
-16.7404
-12.4358
0.191428
0.194718
0.198405
0.201904
0.205172
0.208164
0.210865
0.21329
0.215489
0.217521
0.219464
0.221402
0.223423
0.225622
0.228102
0.230951
0.234249
0.238073
0.242475
0.247507
0.253213
0.259605
0.266691
0.274462
0.282897
0.291967
0.301617
0.31181
0.322492
0.333625
0.345192
0.357143
0.369467
0.382142
0.395147
0.408527
0.42231
0.436549
0.451331
0.466749
0.482917
0.499964
0.518084
0.537439
0.558202
0.58063
0.60492
0.631333
0.660134
0.691568
0.725927
0.763471
0.804497
0.849274
0.898071
0.951165
1.00879
1.07114
1.13839
1.21059
1.28768
1.36943
1.45535
1.54453
1.63555
1.72613
1.81277
1.89015
1.95006
1.9797
1.9587
1.85339
1.60567
1.10921
0.155388
-1.68755
-5.31575
-16.8713
-11.9238
0.191219
0.194547
0.198228
0.201724
0.204998
0.208009
0.210743
0.213216
0.215477
0.217584
0.219611
0.221641
0.223756
0.22605
0.228624
0.231561
0.23494
0.238836
0.243301
0.248385
0.25413
0.260552
0.267655
0.275434
0.283871
0.292939
0.302587
0.312777
0.323462
0.334607
0.346195
0.358183
0.370562
0.383314
0.396419
0.409923
0.42386
0.438286
0.453289
0.468964
0.485431
0.502818
0.521322
0.54111
0.562357
0.585325
0.61022
0.637305
0.666858
0.699136
0.734445
0.773065
0.815314
0.861491
0.911899
0.966853
1.02665
1.09154
1.16176
1.2375
1.31881
1.40561
1.49761
1.59416
1.69417
1.7958
1.89613
1.99064
2.07224
2.12977
2.14532
2.08902
1.90885
1.50835
0.695529
-0.937031
-4.24422
-16.7092
-10.7362
0.191009
0.194384
0.198058
0.201552
0.204834
0.207863
0.21063
0.213149
0.21547
0.217649
0.219757
0.221874
0.224081
0.226466
0.229129
0.232152
0.235609
0.239574
0.2441
0.249234
0.255019
0.261469
0.26859
0.276377
0.284818
0.293885
0.303531
0.313722
0.324411
0.335567
0.347178
0.359204
0.371637
0.384465
0.397669
0.411295
0.425385
0.439994
0.455211
0.471139
0.487898
0.505617
0.524497
0.544709
0.56643
0.589927
0.615414
0.643161
0.673452
0.70656
0.742806
0.782486
0.82594
0.873503
0.925504
0.9823
1.04425
1.11165
1.18485
1.26411
1.34962
1.44146
1.53955
1.64349
1.75253
1.86527
1.97941
2.09125
2.19486
2.28082
2.33384
2.32821
2.21872
1.92066
1.26321
-0.118977
-3.00618
-16.1709
-9.01493
0.190809
0.194223
0.197894
0.201389
0.204678
0.207727
0.210525
0.213089
0.215468
0.217715
0.219902
0.222103
0.224397
0.22687
0.229618
0.232724
0.236256
0.240288
0.244873
0.250056
0.255879
0.262357
0.269496
0.277292
0.285736
0.294804
0.304451
0.314642
0.325337
0.336506
0.348141
0.360204
0.372692
0.385595
0.398896
0.412643
0.426881
0.44167
0.457099
0.473273
0.490316
0.508361
0.527608
0.548234
0.570419
0.594433
0.620502
0.648896
0.679913
0.713835
0.751002
0.791727
0.83637
0.885299
0.938876
0.997494
1.06157
1.13147
1.20761
1.29038
1.38008
1.47694
1.58111
1.69244
1.81052
1.93443
2.06246
2.19177
2.31765
2.43247
2.5237
2.57007
2.5339
2.34381
1.85424
0.759923
-1.6158
-15.1362
-6.96792
0.190617
0.194065
0.197737
0.201233
0.204532
0.207599
0.210428
0.213035
0.215469
0.217784
0.220045
0.222326
0.224704
0.227262
0.230093
0.233277
0.236881
0.240978
0.24562
0.250851
0.256711
0.263217
0.270373
0.278179
0.286628
0.295697
0.305345
0.315539
0.326241
0.337423
0.349082
0.361184
0.373725
0.386702
0.400099
0.413964
0.428349
0.443314
0.458949
0.475363
0.492685
0.511048
0.530652
0.551682
0.574322
0.598841
0.625479
0.654509
0.686236
0.720959
0.75903
0.800783
0.846596
0.896872
0.952004
1.01242
1.0786
1.15098
1.23004
1.31629
1.41014
1.51201
1.62223
1.74094
1.86808
2.00316
2.14514
2.29201
2.44034
2.58432
2.7143
2.81371
2.85288
2.77513
2.46374
1.69032
-0.0950854
-13.5505
-4.93603
0.190431
0.193913
0.197586
0.201085
0.204393
0.207479
0.210338
0.212987
0.215475
0.217853
0.220186
0.222544
0.225003
0.227642
0.230552
0.233812
0.237486
0.241645
0.246341
0.251619
0.257515
0.264048
0.271222
0.279038
0.287492
0.296564
0.306213
0.316411
0.327121
0.338318
0.350002
0.362142
0.374736
0.387786
0.401278
0.415259
0.429786
0.444924
0.46076
0.477409
0.495002
0.513676
0.533629
0.555053
0.578136
0.603149
0.630343
0.659995
0.692419
0.727926
0.766885
0.809647
0.856611
0.908213
0.964877
1.02707
1.09533
1.17015
1.25211
1.3418
1.43979
1.54663
1.66287
1.78894
1.9251
2.07136
2.22729
2.39178
2.56264
2.73597
2.90505
3.05816
3.17403
3.21164
3.08593
2.661
1.53105
-11.2849
0.692046
0.190248
0.193771
0.197442
0.200945
0.204262
0.207367
0.210255
0.212944
0.215483
0.217922
0.220324
0.222757
0.225293
0.22801
0.230995
0.234329
0.238069
0.242288
0.247038
0.25236
0.258291
0.26485
0.272043
0.27987
0.28833
0.297405
0.307057
0.317259
0.327978
0.339191
0.3509
0.363078
0.375725
0.388846
0.402431
0.416525
0.431192
0.446499
0.462531
0.479408
0.497266
0.516242
0.536535
0.558343
0.581859
0.607355
0.635091
0.665352
0.698457
0.734733
0.774561
0.818314
0.866409
0.919313
0.977485
1.04143
1.11174
1.18898
1.2738
1.3669
1.46897
1.58074
1.70297
1.83635
1.9815
2.1389
2.30876
2.49086
2.68429
2.88703
3.09535
3.30244
3.49565
3.65011
3.71414
3.65745
3.14688
-8.42027
15.3328
0.190077
0.193631
0.197304
0.200811
0.204138
0.207261
0.210178
0.212906
0.215494
0.217992
0.220461
0.222964
0.225574
0.228366
0.231424
0.234827
0.238632
0.242908
0.247709
0.253074
0.259041
0.265625
0.272836
0.280674
0.28914
0.298219
0.307875
0.318083
0.328812
0.340041
0.351776
0.363991
0.37669
0.38988
0.403556
0.417763
0.432566
0.448038
0.464261
0.48136
0.499476
0.518746
0.53937
0.561551
0.585489
0.611456
0.639722
0.670576
0.704347
0.741375
0.782054
0.826778
0.875982
0.930164
0.989818
1.05549
1.12781
1.20743
1.29507
1.39154
1.49766
1.61432
1.74248
1.88311
2.0372
2.20568
2.38942
2.58906
2.80499
3.03709
3.28459
3.54558
3.81602
4.08718
4.34082
4.64215
4.54464
-5.6875
24.0951
0.189914
0.193496
0.197172
0.200684
0.204021
0.207163
0.210106
0.212873
0.215508
0.218063
0.220594
0.223165
0.225847
0.22871
0.231838
0.235308
0.239175
0.243506
0.248356
0.253763
0.259763
0.266373
0.273601
0.28145
0.289924
0.299008
0.308668
0.318882
0.329622
0.340868
0.352628
0.364881
0.37763
0.390889
0.404654
0.41897
0.433906
0.449538
0.465949
0.483263
0.501629
0.521186
0.542131
0.564674
0.589023
0.61545
0.644231
0.675665
0.710086
0.747848
0.78936
0.835033
0.885323
0.940759
1.00187
1.06922
1.14354
1.2255
1.31592
1.41571
1.52582
1.64731
1.78134
1.92915
2.0921
2.27158
2.46909
2.68617
2.92447
3.18575
3.47214
3.78658
4.13342
4.51954
4.95837
5.5828
5.9025
-2.1277
26.6796
0.189758
0.193368
0.197046
0.200564
0.203911
0.207071
0.21004
0.212843
0.215524
0.218133
0.220725
0.223361
0.22611
0.229043
0.232237
0.235771
0.239697
0.244081
0.248978
0.254426
0.260458
0.267093
0.274339
0.2822
0.290681
0.29977
0.309435
0.319656
0.330408
0.341671
0.353457
0.365747
0.378546
0.391871
0.405723
0.420146
0.435212
0.451
0.467592
0.485116
0.503724
0.523559
0.544816
0.567713
0.592461
0.619334
0.648617
0.680615
0.71567
0.754149
0.796472
0.843074
0.894426
0.951087
1.01362
1.08264
1.1589
1.24316
1.33632
1.43938
1.55342
1.67967
1.8195
1.97441
2.14612
2.33648
2.54765
2.782
3.04245
3.3326
3.65742
4.02449
4.4462
4.94415
5.56053
6.47206
7.20231
1.19126
28.9026
0.189609
0.193248
0.196927
0.20045
0.203807
0.206984
0.20998
0.212817
0.215542
0.218202
0.220852
0.223551
0.226365
0.229363
0.232622
0.236217
0.2402
0.244635
0.249577
0.255064
0.261127
0.267786
0.27505
0.282923
0.291412
0.300506
0.310177
0.320405
0.33117
0.342451
0.354261
0.366589
0.379437
0.392826
0.406763
0.42129
0.436482
0.452422
0.46919
0.486917
0.505761
0.525865
0.547425
0.570663
0.5958
0.623106
0.652877
0.685423
0.721096
0.760273
0.803387
0.850894
0.903285
0.961143
1.02506
1.09571
1.17388
1.2604
1.35625
1.46252
1.58043
1.71137
1.8569
2.01881
2.19917
2.40029
2.62493
2.87635
3.15866
3.47726
3.83985
4.2584
4.7528
5.35819
6.14176
7.29254
8.48535
4.42228
28.1511
0.189469
0.193132
0.196813
0.200343
0.20371
0.206903
0.209923
0.212794
0.215561
0.218271
0.220977
0.223734
0.226611
0.229672
0.232993
0.236646
0.240683
0.245166
0.250152
0.255676
0.26177
0.268452
0.275734
0.283619
0.292116
0.301217
0.310893
0.32113
0.331907
0.343206
0.355042
0.367406
0.380301
0.393752
0.407772
0.422402
0.437716
0.453802
0.470742
0.488666
0.507736
0.528102
0.549956
0.573525
0.599038
0.626765
0.657008
0.690087
0.72636
0.766216
0.810101
0.858489
0.911891
0.970917
1.0362
1.10843
1.18846
1.27719
1.37567
1.4851
1.6068
1.74235
1.8935
2.0623
2.25117
2.46287
2.7008
2.96902
3.27284
3.61937
4.01888
4.48745
5.05182
5.75916
6.69822
8.07448
9.74537
7.56625
28.7834
0.189338
0.19302
0.196706
0.200241
0.203618
0.206827
0.209871
0.212775
0.215581
0.218339
0.221097
0.223912
0.226848
0.22997
0.233349
0.237058
0.241147
0.245677
0.250703
0.256264
0.262387
0.269092
0.276391
0.284288
0.292794
0.301901
0.311584
0.321829
0.332619
0.343936
0.355797
0.368196
0.381139
0.39465
0.40875
0.423479
0.438912
0.45514
0.472245
0.49036
0.50965
0.530268
0.552406
0.576295
0.602173
0.630308
0.661009
0.694604
0.731459
0.771975
0.816608
0.865852
0.920239
0.980402
1.047
1.12078
1.20264
1.29353
1.39459
1.50709
1.63251
1.77258
1.92923
2.1048
2.30203
2.52414
2.77511
3.05983
3.38473
3.75855
4.19399
4.71083
5.34196
6.14485
7.22604
8.80785
10.9052
10.5416
31.7467
0.189214
0.192916
0.196604
0.200145
0.203531
0.206757
0.209824
0.212758
0.215603
0.218406
0.221215
0.224084
0.227076
0.230256
0.233691
0.237453
0.241592
0.246165
0.251231
0.256827
0.262978
0.269705
0.277021
0.284931
0.293445
0.302559
0.312249
0.322503
0.333306
0.344642
0.356527
0.368961
0.381949
0.395519
0.409697
0.424522
0.440069
0.456434
0.4737
0.491999
0.511501
0.532361
0.554774
0.578974
0.605203
0.633733
0.664876
0.69897
0.736389
0.777545
0.822904
0.87298
0.928323
0.98959
1.05748
1.13276
1.2164
1.30939
1.41296
1.52848
1.65753
1.80201
1.96406
2.14625
2.35167
2.58397
2.84772
3.14859
3.49409
3.89447
4.36468
4.92785
5.62211
6.51347
7.72217
9.48412
11.9308
12.9975
32.4036
0.189097
0.192818
0.196508
0.200055
0.20345
0.206691
0.209779
0.212744
0.215625
0.218472
0.221329
0.224249
0.227296
0.23053
0.234019
0.237832
0.242018
0.246633
0.251737
0.257365
0.263543
0.270292
0.277625
0.285548
0.294071
0.303192
0.312889
0.323151
0.333968
0.345322
0.357231
0.369699
0.382731
0.396358
0.410611
0.42553
0.441188
0.457684
0.475105
0.493581
0.513286
0.534382
0.55706
0.581558
0.608127
0.637038
0.668608
0.703184
0.741148
0.782924
0.828985
0.879866
0.936136
0.998474
1.06761
1.14436
1.22972
1.32476
1.43077
1.54923
1.68183
1.83061
1.99793
2.18659
2.40001
2.64227
2.9185
3.23511
3.60066
4.02681
4.53052
5.13786
5.89135
6.86361
8.18452
10.0981
12.8199
15.0265
33.5476
0.188988
0.192725
0.196417
0.199969
0.203374
0.206629
0.209739
0.212732
0.215648
0.218536
0.221439
0.224408
0.227507
0.230793
0.234333
0.238193
0.242424
0.24708
0.25222
0.257879
0.264084
0.270853
0.278203
0.286138
0.29467
0.303798
0.313503
0.323774
0.334604
0.345976
0.357908
0.370409
0.383485
0.397166
0.411492
0.426501
0.442266
0.458889
0.476458
0.495105
0.515007
0.536328
0.559261
0.584048
0.610943
0.64022
0.672202
0.707243
0.745733
0.788106
0.834847
0.886506
0.943672
1.00705
1.07739
1.15556
1.24259
1.33962
1.44801
1.56932
1.70536
1.85834
2.03078
2.22575
2.44697
2.69893
2.98731
3.31924
3.70424
4.15527
4.69111
5.34031
6.14892
7.1943
8.61195
10.6474
13.5682
16.5699
34.7324
0.188887
0.192637
0.196332
0.199889
0.203303
0.206571
0.209702
0.212722
0.215672
0.218598
0.221545
0.224561
0.227709
0.231045
0.234633
0.238539
0.242812
0.247506
0.25268
0.25837
0.264599
0.271388
0.278754
0.286703
0.295243
0.304379
0.314091
0.324371
0.335213
0.346604
0.358559
0.371092
0.38421
0.397944
0.412339
0.427435
0.443302
0.460047
0.47776
0.496571
0.51666
0.538197
0.561377
0.58644
0.61365
0.643278
0.675655
0.711144
0.75014
0.79309
0.840486
0.892894
0.950925
1.0153
1.08681
1.16635
1.255
1.35396
1.46465
1.58872
1.72811
1.88515
2.06258
2.26367
2.49247
2.75386
3.05403
3.40081
3.8046
4.27958
4.84607
5.53475
6.39427
7.50497
9.00426
11.1322
14.182
17.9348
35.8882
0.188793
0.192554
0.196252
0.199814
0.203236
0.206517
0.209668
0.212714
0.215696
0.218659
0.221647
0.224707
0.227902
0.231286
0.234919
0.238868
0.243182
0.247912
0.253118
0.258836
0.265089
0.271898
0.27928
0.287241
0.295791
0.304934
0.314653
0.324942
0.335797
0.347205
0.359183
0.371747
0.384906
0.398691
0.413152
0.428332
0.444297
0.461158
0.479008
0.497977
0.518246
0.53999
0.563406
0.588735
0.616245
0.646211
0.678967
0.714885
0.754367
0.797871
0.845897
0.899026
0.95789
1.02323
1.09587
1.17673
1.26694
1.36775
1.48066
1.60742
1.75005
1.91102
2.09327
2.3003
2.53644
2.80696
3.11854
3.47966
3.90156
4.39947
4.9951
5.72078
6.627
7.79542
9.36198
11.5537
14.6421
18.6216
35.5048
0.188705
0.192478
0.196177
0.199744
0.203173
0.206467
0.209636
0.212707
0.215719
0.218718
0.221745
0.224847
0.228086
0.231515
0.235192
0.239182
0.243533
0.248297
0.253534
0.259279
0.265555
0.272382
0.279779
0.287753
0.296312
0.305462
0.315189
0.325487
0.336354
0.34778
0.359779
0.372373
0.385572
0.399406
0.413931
0.42919
0.44525
0.462221
0.480202
0.499321
0.519762
0.541705
0.565346
0.59093
0.618727
0.649016
0.682135
0.718464
0.758412
0.802446
0.851076
0.904898
0.96456
1.03083
1.10455
1.18668
1.2784
1.381
1.49605
1.62538
1.77113
1.93591
2.12281
2.33558
2.5788
2.85814
3.18072
3.55565
3.99491
4.51471
5.13792
5.89812
6.84687
8.06576
9.68657
11.9186
14.9979
18.977
32.3262
0.188623
0.192405
0.196107
0.199678
0.203115
0.206421
0.209608
0.212702
0.215743
0.218775
0.221839
0.224981
0.228261
0.231732
0.235451
0.239479
0.243866
0.248663
0.253928
0.259699
0.265996
0.272841
0.280253
0.288239
0.296807
0.305965
0.315699
0.326005
0.336884
0.348327
0.360347
0.37297
0.386207
0.400089
0.414674
0.430009
0.446159
0.463236
0.481341
0.500604
0.521209
0.54334
0.567198
0.593024
0.621095
0.651691
0.685156
0.721878
0.762271
0.806813
0.85602
0.910504
0.970931
1.03808
1.11284
1.19619
1.28935
1.39367
1.51078
1.64259
1.79135
1.95979
2.15116
2.36944
2.61949
2.9073
3.24047
3.62864
4.0845
4.62511
5.27429
6.06652
7.05378
8.31639
9.97994
12.2335
15.2794
19.1905
29.7291
0.188549
0.192338
0.196042
0.199616
0.203061
0.206378
0.209582
0.212699
0.215766
0.21883
0.221928
0.225108
0.228427
0.231939
0.235696
0.23976
0.24418
0.249008
0.2543
0.260095
0.266413
0.273275
0.280701
0.288699
0.297276
0.306441
0.316182
0.326497
0.337387
0.348846
0.360888
0.373537
0.386812
0.400739
0.415381
0.430789
0.447023
0.4642
0.482424
0.501824
0.522585
0.544896
0.568959
0.595016
0.623347
0.654235
0.68803
0.725126
0.765943
0.810967
0.860725
0.915841
0.976998
1.045
1.12074
1.20526
1.2998
1.40576
1.52484
1.65902
1.81066
1.98261
2.17828
2.40185
2.65844
2.95438
3.29766
3.69849
4.17015
4.73046
5.40401
6.22583
7.24774
8.54784
10.2442
12.5052
15.5015
19.3108
27.5649
0.188481
0.192276
0.195981
0.199559
0.203011
0.206338
0.209558
0.212696
0.215789
0.218882
0.222013
0.225228
0.228584
0.232134
0.235927
0.240025
0.244477
0.249333
0.254651
0.260469
0.266806
0.273684
0.281124
0.289133
0.297719
0.306891
0.31664
0.326962
0.337863
0.349338
0.361399
0.374076
0.387386
0.401356
0.416052
0.431528
0.447843
0.465115
0.483451
0.502981
0.52389
0.546371
0.570628
0.596904
0.625481
0.656646
0.690754
0.728205
0.769424
0.814906
0.865187
0.920904
0.982755
1.05156
1.12825
1.21387
1.30973
1.41726
1.53821
1.67466
1.82905
2.00435
2.20412
2.43274
2.69558
2.99928
3.35222
3.76508
4.25174
4.83062
5.52691
6.37593
7.42886
8.76081
10.4816
12.7392
15.6706
19.3536
25.8053
0.188418
0.192218
0.195925
0.199506
0.202964
0.206302
0.209536
0.212695
0.215811
0.218932
0.222094
0.225341
0.228733
0.232317
0.236145
0.240274
0.244756
0.249639
0.254981
0.26082
0.267175
0.274068
0.281521
0.289541
0.298136
0.307315
0.317071
0.327401
0.338312
0.349801
0.361882
0.374584
0.387929
0.40194
0.416686
0.432226
0.448617
0.465979
0.484421
0.504074
0.525122
0.547764
0.572205
0.598688
0.627497
0.658923
0.693327
0.731113
0.772713
0.818628
0.869403
0.92569
0.988199
1.05777
1.13535
1.22202
1.31913
1.42814
1.55088
1.68949
1.84649
2.02497
2.22865
2.46208
2.73086
3.04193
3.40403
3.8283
4.32911
4.92542
5.64287
6.51679
7.59729
8.95605
10.6941
12.9393
15.796
19.334
24.3381
0.188361
0.192165
0.195874
0.199457
0.202921
0.206268
0.209517
0.212694
0.215833
0.218979
0.22217
0.225448
0.228872
0.232489
0.236349
0.240507
0.245017
0.249926
0.25529
0.261149
0.267521
0.274428
0.281892
0.289924
0.298527
0.307713
0.317475
0.327812
0.338733
0.350237
0.362336
0.375063
0.388439
0.40249
0.417283
0.432882
0.449346
0.466791
0.485333
0.505101
0.526281
0.549074
0.573688
0.600365
0.629393
0.661065
0.695748
0.733849
0.775808
0.82213
0.873371
0.930193
0.993323
1.06361
1.14203
1.22971
1.32799
1.43841
1.56284
1.70348
1.86296
2.04445
2.25183
2.48981
2.76421
3.08225
3.45302
3.88804
4.40215
5.01475
5.75177
6.64836
7.75328
9.13433
10.8837
13.1095
15.8859
19.2646
23.2145
0.188309
0.192116
0.195826
0.199412
0.202881
0.206237
0.209499
0.212694
0.215854
0.219024
0.222241
0.225547
0.229001
0.23265
0.23654
0.240725
0.24526
0.250193
0.255577
0.261455
0.267842
0.274762
0.282239
0.290281
0.298892
0.308085
0.317853
0.328196
0.339126
0.350643
0.362761
0.375511
0.388918
0.403005
0.417842
0.433497
0.450027
0.467552
0.486187
0.506063
0.527366
0.550301
0.575077
0.601936
0.631167
0.66307
0.698014
0.736411
0.778705
0.825409
0.877086
0.934412
0.998124
1.06909
1.1483
1.23691
1.3363
1.44805
1.57407
1.71662
1.87843
2.06276
2.27362
2.51589
2.79558
3.12019
3.4991
3.94421
4.47074
5.09849
5.85353
6.77068
7.89708
9.29642
11.052
13.2537
15.9478
19.1578
22.3068
0.188262
0.192072
0.195783
0.19937
0.202845
0.206209
0.209483
0.212694
0.215874
0.219065
0.222307
0.22564
0.229122
0.2328
0.236716
0.240927
0.245486
0.250441
0.255844
0.261738
0.268141
0.275073
0.28256
0.290612
0.299231
0.30843
0.318204
0.328553
0.339491
0.351021
0.363157
0.375928
0.389364
0.403485
0.418363
0.43407
0.450662
0.46826
0.486982
0.506959
0.528377
0.551444
0.57637
0.603398
0.63282
0.664937
0.700125
0.738797
0.781404
0.828463
0.880547
0.938343
1.0026
1.07419
1.15415
1.24363
1.34406
1.45705
1.58455
1.7289
1.89289
2.07988
2.29399
2.54028
2.82493
3.15568
3.5422
3.99671
4.5348
5.17654
5.94809
6.88378
8.02896
9.44305
11.2003
13.3724
15.9883
19.0303
21.6134
0.18822
0.192032
0.195743
0.199332
0.202812
0.206183
0.209469
0.212695
0.215892
0.219104
0.222368
0.225726
0.229233
0.232938
0.23688
0.241114
0.245695
0.250669
0.256091
0.262
0.268415
0.275359
0.282856
0.290918
0.299544
0.308748
0.318528
0.328883
0.339828
0.35137
0.363522
0.376315
0.389777
0.40393
0.418845
0.434599
0.45125
0.468915
0.487717
0.507789
0.529313
0.552502
0.577567
0.604751
0.634349
0.666666
0.702079
0.741006
0.783902
0.83129
0.883752
0.941982
1.00674
1.07892
1.15957
1.24986
1.35126
1.46539
1.59428
1.74029
1.90631
2.09577
2.31292
2.56294
2.8522
3.18867
3.58225
4.04547
4.59423
5.24883
6.03541
6.98773
8.14921
9.57488
11.3305
13.4725
16.0122
18.8942
21.0518
0.188182
0.191995
0.195707
0.199298
0.202782
0.20616
0.209457
0.212696
0.21591
0.21914
0.222424
0.225804
0.229336
0.233064
0.23703
0.241284
0.245886
0.250879
0.256317
0.26224
0.268667
0.275621
0.283128
0.291198
0.299831
0.30904
0.318825
0.329186
0.340137
0.35169
0.363858
0.37667
0.390157
0.404339
0.419288
0.435086
0.45179
0.469517
0.488393
0.508551
0.530174
0.553474
0.578666
0.605995
0.635754
0.668254
0.703875
0.743037
0.786197
0.833888
0.886696
0.945328
1.01055
1.08327
1.16455
1.2556
1.35788
1.47308
1.60323
1.75079
1.91868
2.11042
2.33037
2.58383
2.87736
3.21908
3.61917
4.09042
4.64895
5.31528
6.11547
7.0826
8.25812
9.69259
11.4441
13.5564
16.0238
18.7571
20.6224
0.188149
0.191963
0.195675
0.199267
0.202755
0.206139
0.209446
0.212698
0.215926
0.219172
0.222475
0.225876
0.229429
0.233179
0.237166
0.24144
0.246059
0.25107
0.256522
0.262457
0.268895
0.275858
0.283374
0.291452
0.300092
0.309306
0.319095
0.32946
0.340418
0.351981
0.364164
0.376995
0.390504
0.404712
0.419692
0.435529
0.452281
0.470065
0.489008
0.509246
0.530958
0.554359
0.579668
0.607127
0.637034
0.669701
0.705512
0.744887
0.788289
0.836255
0.88938
0.948377
1.01402
1.08724
1.1691
1.26083
1.36392
1.48009
1.61141
1.76037
1.92997
2.12381
2.34631
2.60293
2.90035
3.24689
3.65292
4.13147
4.6989
5.37584
6.18823
7.16846
8.35595
9.79688
11.5428
13.6263
16.0267
18.6262
20.3043
0.188119
0.191934
0.195646
0.19924
0.202731
0.206121
0.209436
0.212699
0.21594
0.219201
0.222521
0.22594
0.229512
0.233283
0.237288
0.241579
0.246215
0.251242
0.256707
0.262653
0.269101
0.276072
0.283595
0.291681
0.300327
0.309545
0.319338
0.329708
0.340671
0.352243
0.36444
0.377287
0.390817
0.405049
0.420056
0.435928
0.452725
0.47056
0.489563
0.509872
0.531666
0.555158
0.580571
0.608148
0.638188
0.671006
0.706988
0.746555
0.790176
0.83839
0.8918
0.951127
1.01715
1.09082
1.17321
1.26555
1.36938
1.48642
1.61881
1.76904
1.94018
2.13591
2.36073
2.6202
2.92114
3.27204
3.68344
4.16859
4.74401
5.43045
6.2537
7.24542
8.44299
9.88847
11.628
13.6842
16.0236
18.5051
20.0466
0.188094
0.191908
0.19562
0.199216
0.202709
0.206105
0.209427
0.212701
0.215953
0.219227
0.222562
0.225998
0.229587
0.233375
0.237398
0.241704
0.246354
0.251394
0.256871
0.262826
0.269283
0.276262
0.283792
0.291884
0.300536
0.309758
0.319554
0.329927
0.340895
0.352476
0.364686
0.377548
0.391095
0.405349
0.42038
0.436284
0.453119
0.471
0.490057
0.51043
0.532296
0.55587
0.581374
0.609057
0.639216
0.672168
0.708303
0.748042
0.791856
0.840291
0.893955
0.953576
1.01994
1.09401
1.17687
1.26977
1.37425
1.49207
1.6254
1.77677
1.94929
2.14671
2.37361
2.63562
2.93971
3.2945
3.71069
4.2017
4.78423
5.47908
6.31187
7.31355
8.51954
9.968
11.7007
13.7319
16.0167
18.3955
19.8642
0.188071
0.191886
0.195598
0.199194
0.202691
0.206091
0.20942
0.212702
0.215965
0.21925
0.222598
0.226048
0.229652
0.233455
0.237493
0.241812
0.246475
0.251528
0.257015
0.262978
0.269442
0.276428
0.283964
0.292062
0.300719
0.309944
0.319743
0.330119
0.341092
0.352681
0.364902
0.377777
0.39134
0.405612
0.420664
0.436595
0.453465
0.471386
0.49049
0.510919
0.532849
0.556493
0.582078
0.609854
0.640117
0.673187
0.709455
0.749344
0.793329
0.841958
0.895844
0.955722
1.02239
1.0968
1.18008
1.27346
1.37852
1.49703
1.63119
1.78355
1.9573
2.15619
2.38491
2.64917
2.95602
3.31422
3.73462
4.23078
4.81952
5.5217
6.36275
7.37294
8.5859
10.0361
11.7622
13.7709
16.0077
18.2991
19.7265
0.188053
0.191868
0.195579
0.199176
0.202675
0.206079
0.209414
0.212703
0.215975
0.21927
0.222628
0.226091
0.229708
0.233524
0.237575
0.241905
0.246579
0.251643
0.257138
0.263108
0.269578
0.27657
0.284112
0.292214
0.300875
0.310103
0.319905
0.330284
0.34126
0.352856
0.365087
0.377973
0.391549
0.405837
0.420908
0.436862
0.453762
0.471718
0.490862
0.511339
0.533323
0.557028
0.582682
0.610537
0.640891
0.674062
0.710445
0.750462
0.794593
0.843388
0.897465
0.957564
1.02449
1.09921
1.18283
1.27664
1.38219
1.5013
1.63616
1.78938
1.96417
2.16434
2.39463
2.66082
2.97005
3.33118
3.7552
4.25577
4.84984
5.55827
6.40633
7.42367
8.64236
10.0931
11.8131
13.8023
15.9981
18.2169
19.6377
0.188037
0.191852
0.195564
0.199161
0.202662
0.206069
0.209409
0.212704
0.215983
0.219286
0.222654
0.226127
0.229755
0.233582
0.237643
0.241983
0.246666
0.251739
0.257241
0.263216
0.269692
0.276689
0.284235
0.292341
0.301006
0.310236
0.32004
0.33042
0.3414
0.353002
0.365242
0.378138
0.391724
0.406025
0.421111
0.437085
0.45401
0.471994
0.491172
0.511689
0.533719
0.557475
0.583186
0.611107
0.641536
0.674792
0.71127
0.751395
0.795647
0.844582
0.898817
0.9591
1.02624
1.10121
1.18513
1.27929
1.38525
1.50486
1.64031
1.79426
1.96992
2.17116
2.40275
2.67056
2.98177
3.34536
3.77239
4.27665
4.87515
5.58877
6.44263
7.46583
8.6892
10.1396
11.8545
13.8274
15.9888
18.1494
19.5757
0.188025
0.19184
0.195551
0.199149
0.202652
0.206061
0.209405
0.212705
0.21599
0.219299
0.222674
0.226156
0.229792
0.233628
0.237697
0.242045
0.246735
0.251815
0.257324
0.263303
0.269782
0.276784
0.284333
0.292442
0.30111
0.310343
0.320147
0.33053
0.341512
0.353119
0.365366
0.378269
0.391864
0.406176
0.421274
0.437263
0.454208
0.472216
0.49142
0.51197
0.534036
0.557832
0.583589
0.611564
0.642053
0.675376
0.711931
0.752142
0.796491
0.845537
0.899899
0.96033
1.02765
1.10282
1.18698
1.28141
1.38771
1.50771
1.64364
1.79816
1.97452
2.17662
2.40926
2.67836
2.99117
3.35673
3.78618
4.29339
4.89542
5.61319
6.47166
7.49948
8.72668
10.1763
11.8863
13.8468
15.9805
18.0959
19.5314
0.188016
0.191831
0.195541
0.19914
0.202644
0.206055
0.209402
0.212706
0.215995
0.219309
0.222689
0.226178
0.229821
0.233662
0.237738
0.242092
0.246787
0.251873
0.257386
0.263368
0.26985
0.276855
0.284407
0.292519
0.301188
0.310422
0.320228
0.330612
0.341596
0.353207
0.365459
0.378368
0.391968
0.406288
0.421396
0.437397
0.454357
0.472382
0.491607
0.512181
0.534274
0.5581
0.583892
0.611907
0.642441
0.675814
0.712427
0.752703
0.797125
0.846253
0.900711
0.961255
1.0287
1.10402
1.18836
1.28301
1.38955
1.50985
1.64615
1.80109
1.97798
2.18072
2.41416
2.68422
2.99824
3.36527
3.79653
4.30597
4.91065
5.63152
6.49343
7.52469
8.75491
10.2042
11.9084
13.8611
15.9739
18.0563
19.505
0.18801
0.191824
0.195535
0.199134
0.202638
0.206052
0.2094
0.212706
0.215999
0.219315
0.222699
0.226193
0.22984
0.233685
0.237765
0.242123
0.246821
0.251911
0.257427
0.263411
0.269895
0.276903
0.284457
0.292569
0.30124
0.310475
0.320282
0.330666
0.341652
0.353265
0.365522
0.378434
0.392037
0.406363
0.421478
0.437486
0.454457
0.472493
0.491731
0.512321
0.534433
0.558278
0.584094
0.612137
0.6427
0.676106
0.712757
0.753078
0.797548
0.846729
0.901252
0.961873
1.02941
1.10483
1.18928
1.28407
1.39079
1.51128
1.64781
1.80305
1.98029
2.18346
2.41742
2.68813
3.00295
3.37097
3.80344
4.31436
4.92081
5.64374
6.50794
7.54147
8.77377
10.2234
11.922
13.8705
15.9694
18.03
19.492
0.188007
0.191821
0.195531
0.199131
0.202636
0.20605
0.209399
0.212707
0.216
0.219318
0.222705
0.2262
0.229849
0.233696
0.237778
0.242138
0.246838
0.25193
0.257448
0.263432
0.269918
0.276927
0.284482
0.292595
0.301266
0.310501
0.320308
0.330693
0.341679
0.353295
0.365554
0.378467
0.392071
0.4064
0.421519
0.437531
0.454506
0.472549
0.491794
0.512392
0.534511
0.558367
0.584196
0.612251
0.642829
0.676252
0.712923
0.753265
0.797758
0.846968
0.901525
0.962181
1.02976
1.10523
1.18975
1.28461
1.3914
1.51199
1.64865
1.80403
1.98144
2.18483
2.41906
2.69009
3.00531
3.37383
3.8069
4.31855
4.9259
5.64985
6.5152
7.54986
8.78317
10.2332
11.9285
13.8751
15.967
18.017
19.4909
316.884
258.522
237.701
199.378
169.655
138.955
109.337
80.614
52.5894
25.211
-1.87929
-26.6033
-57.7983
-72.9323
-117.253
-70.3164
-93.4321
-90.9238
-110.153
-110.015
-122.647
-126.397
-133.06
-138.339
-141.635
-146.546
-147.136
-150.543
-149.542
-149.397
-74.9011
-76.7815
-73.4692
-76.2975
-73.6032
-74.9798
-73.5376
-73.0816
-72.3758
-70.5091
-70.1259
-67.4423
-66.7733
-63.8659
-61.0577
-52.6482
-52.9362
-50.8414
-52.5251
-50.2543
-51.5227
-50.45
-50.3702
-50.8143
-49.3097
-50.7262
-48.223
-49.5418
-47.8734
-48.0589
-50.5457
-52.2429
-49.4132
-53.2387
-49.6783
-52.4772
-50.8653
-51.3891
-52.519
-50.5281
-54.0677
-50.4477
-54.3122
-51.6498
-53.511
-52.8741
-54.6418
-51.8588
-55.5992
-51.9758
-55.3565
-53.3103
-54.2092
-55.1467
-53.0597
-56.4367
-52.7549
-56.5126
-53.7059
-55.4088
-54.3221
-55.996
-53.1806
-56.8805
-53.1866
-56.4811
-54.3611
-55.1882
-55.9962
-53.8735
-57.14
-53.4288
-57.0915
-54.2576
-55.8734
-55.0268
-56.638
-53.8176
-57.4701
-53.7491
-57.0144
-54.8675
-55.6678
-56.4497
-54.3202
-57.5471
-53.8589
-57.4734
-54.6611
-56.258
-55.5107
-57.1181
-54.3112
-57.9335
-54.2435
-57.4823
-55.3409
-56.1367
-56.9248
-54.7876
-58.0356
-54.3358
-57.9637
-55.1575
-56.7627
-56.0239
-57.6308
-54.8206
-58.4431
-54.7664
-57.9962
-55.8649
-56.6606
-57.4546
-55.3163
-58.569
-54.8663
-58.495
-55.6877
-57.2829
-56.5602
-58.1703
-55.3484
-58.9907
-55.2858
-58.542
-56.3795
-57.1951
-57.9571
-55.8285
-59.0488
-55.3474
-58.9406
-56.127
-57.695
-57.1021
-58.7009
-55.8914
-59.5204
-55.7749
-59.057
-56.7845
-57.6582
-58.2131
-56.1811
-59.2188
-55.5233
-59.0193
-56.1474
-57.6408
-57.6123
-58.9949
-56.7698
-59.5486
-56.5927
-58.9692
-57.0384
-57.644
-57.6518
-56.158
-57.889
-55.1636
-57.3056
-55.091
-55.8672
-61.1222
-61.1268
-59.1463
-59.9547
-58.0278
-58.3144
-56.7987
-56.1127
-55.1128
-53.5176
-53.8074
-51.3792
-52.2932
-50.2135
-50.2572
-60.6103
-45.9578
-54.0599
-53.1198
-52.344
-51.493
-50.3463
-49.4621
-48.1645
-46.585
-44.9569
-42.4499
-42.4895
-39.2744
-38.9508
)
;
boundaryField
{
courseFace
{
type zeroGradient;
}
courseCyclicBoundary
{
type cyclicAMI;
value nonuniform List<scalar>
200
(
0.186029
0.186032
0.186035
0.186041
0.186048
0.18606
0.186072
0.186086
0.186101
0.186119
0.186144
0.186168
0.186193
0.186222
0.186253
0.186295
0.186333
0.186374
0.186419
0.186468
0.186531
0.186589
0.186651
0.186717
0.186788
0.18688
0.186964
0.187051
0.187146
0.187246
0.187375
0.187491
0.187613
0.187743
0.187881
0.188056
0.188214
0.188379
0.188556
0.188742
0.188974
0.189185
0.189407
0.189642
0.18989
0.190193
0.190473
0.190766
0.191077
0.191407
0.191797
0.192166
0.192553
0.192963
0.193398
0.193895
0.194377
0.194881
0.195415
0.195979
0.196595
0.19721
0.197849
0.198522
0.199222
0.199939
0.200676
0.201433
0.202232
0.203054
0.203787
0.204571
0.205342
0.206095
0.206817
0.207206
0.20768
0.20803
0.208255
0.208311
0.207581
0.20708
0.206374
0.205459
0.204284
0.202025
0.200318
0.198404
0.196335
0.194063
0.191087
0.18896
0.186871
0.184781
0.183833
0.173329
0.197758
0.172915
0.182377
0.167097
-6.01005
-5.73805
-5.44803
-5.12399
-4.76216
-4.20548
-3.80021
-3.41171
-3.02942
-2.65691
-2.12826
-1.83189
-1.57497
-1.3435
-1.14812
-0.794474
-0.647173
-0.525163
-0.416402
-0.342696
-0.136472
-0.0826016
-0.0403572
-0.000505317
0.012243
0.137269
0.149343
0.157622
0.16851
0.157525
0.244859
0.245813
0.245026
0.247819
0.227636
0.294132
0.29395
0.291601
0.293618
0.273173
0.328203
0.330935
0.329485
0.333397
0.316295
0.360054
0.362712
0.359882
0.361036
0.343265
0.374921
0.373454
0.365629
0.364124
0.34703
0.362921
0.354101
0.339531
0.333147
0.313646
0.321391
0.310702
0.294219
0.285021
0.26319
0.265673
0.253912
0.236997
0.228521
0.210281
0.211616
0.203284
0.191345
0.188172
0.17685
0.184209
0.18268
0.177682
0.180706
0.176565
0.189293
0.193743
0.194684
0.202623
0.203746
0.217982
0.223886
0.225734
0.232864
0.233172
0.243459
0.24777
0.245762
0.24971
0.262864
0.172169
0.278712
0.188456
0.243566
0.144363
)
;
}
courseWalls
{
type zeroGradient;
}
freeBoundaryCourse
{
type fixedValue;
value uniform 0;
}
courseSymmetryWalls
{
type symmetryPlane;
}
fineSymmetryWall
{
type symmetryPlane;
}
fineWalls
{
type zeroGradient;
}
fineCyclicBoundary
{
type cyclicAMI;
value nonuniform List<scalar>
160
(
0.169724
0.177191
0.192156
0.17571
0.183963
0.18538
0.188079
0.191004
0.194032
0.196965
0.199722
0.202196
0.204059
0.205729
0.206986
0.207848
0.208033
0.208138
0.207936
0.207479
0.20656
0.205789
0.204929
0.204011
0.202852
0.201914
0.200997
0.200104
0.199079
0.198259
0.19747
0.196712
0.195879
0.195209
0.194575
0.193974
0.193331
0.192806
0.192315
0.19185
0.191362
0.190959
0.190583
0.190228
0.18986
0.189553
0.189267
0.188998
0.188722
0.18849
0.188274
0.188072
0.187867
0.187694
0.187535
0.187386
0.187237
0.187111
0.186995
0.186888
0.186782
0.186692
0.186611
0.186536
0.186463
0.186402
0.186347
0.186298
0.18625
0.186211
0.186176
0.186146
0.186118
0.186095
0.186076
0.186061
0.186048
0.186039
0.186033
0.18603
-6.00343
-5.63945
-5.24699
-4.77796
-4.18611
-3.66116
-3.16264
-2.67307
-2.11327
-1.73327
-1.41914
-1.15571
-0.786413
-0.599533
-0.450311
-0.344468
-0.133112
-0.0658282
-0.0124488
0.0132338
0.138354
0.152785
0.165564
0.159511
0.24538
0.245691
0.247684
0.230168
0.294635
0.29321
0.293601
0.275734
0.328923
0.330642
0.332488
0.318599
0.360758
0.362271
0.361066
0.345465
0.375361
0.371259
0.364657
0.34885
0.362893
0.349254
0.335101
0.315428
0.321256
0.305148
0.288238
0.264977
0.26542
0.247968
0.231319
0.211602
0.211433
0.19885
0.189009
0.177721
0.184345
0.180743
0.179364
0.177022
0.189717
0.193972
0.199677
0.203904
0.218492
0.224672
0.23047
0.233277
0.243882
0.248112
0.245614
0.262044
0.187166
0.250705
0.22884
0.155103
)
;
}
fineplug
{
type cyclicAMI;
value nonuniform List<scalar>
80
(
-23.6065
-24.5696
-25.0557
-24.7249
-23.2111
-23.4071
-23.6325
-23.8687
-24.0033
-24.3303
-25.8347
-27.3751
-27.5961
-26.322
-26.5486
-26.7632
-26.9443
-26.9999
-27.2851
-28.2811
-28.9871
-30.516
-30.4786
-30.926
-31.277
-31.5835
-32.1325
-32.9002
-33.3592
-34.3011
-34.6578
-33.1152
-34.1989
-34.7459
-35.2848
-35.8635
-36.4032
-37.3667
-38.5932
-39.4826
-40.2475
-41.0711
-42.0771
-43.2021
-44.1259
-45.079
-46.0728
-47.2808
-48.5363
-44.4062
-45.9935
-47.4284
-48.6859
-50.3947
-51.8915
-53.1647
-54.3282
-55.9605
-57.1417
-65.1503
-67.3141
-68.5561
-70.2846
-72.1349
-74.236
-76.1479
-77.9902
-79.9358
-80.1777
-86.1886
-87.7098
-90.7987
-93.0422
-95.2336
-99.3068
-104.753
-106.219
-101.81
-113.154
-115.942
)
;
}
faceFine
{
type zeroGradient;
}
inletFace
{
type zeroGradient;
}
inlet
{
type zeroGradient;
}
inletWalls
{
type zeroGradient;
}
outletInlet
{
type cyclicAMI;
value nonuniform List<scalar>
15
(
-24.2134
-24.0727
-26.9566
-27.8545
-31.156
-33.5674
-35.4052
-39.8529
-44.9758
-47.0163
-53.9618
-67.7364
-78.495
-91.5524
-107.647
)
;
}
}
// ************************************************************************* //
| [
"brent.shambaugh@gmail.com"
] | brent.shambaugh@gmail.com | |
f8148803d5e2a0a5adade22a2691c046afa64a33 | d87a64d5a7fbb80658f97d75e7ac148fe5e99ac7 | /coding-blocks-course/challenges-fundamentals/print-reverse.cpp | d9e40338daf9ae9ebb0366b2b73339469d46fe1c | [] | no_license | Ctrl-Code/Files | 435a9a517611bc9cad6564e0349e3dbed6bc07cf | c3fae0168a8c2fb2f0b028348d5d0cc536d70b28 | refs/heads/master | 2021-07-06T05:18:49.339047 | 2020-07-29T20:18:38 | 2020-07-29T20:18:38 | 135,023,420 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 280 | cpp | // ctrl-code: 2007261300
#include <iostream>
int main()
{
int number, answer = 0, temp;
std::cin >> number;
while (number)
{
temp = number % 10;
answer = (answer * 10) + temp;
number /= 10;
}
std::cout << answer;
return 0;
} | [
"chebomsta@gmail.com"
] | chebomsta@gmail.com |
2fa119ed0d5f81a99b52b7f388ed956b2e29e117 | aa87d3ce0e0f4b1db28e40385bd155e2ba31ef56 | /ParseParameter/ParseParameter.cpp | 22de67265bb9b16031f1e3399548a48d8fc70242 | [] | no_license | foocoder/HUAWEIOJ | b7a6bc38632db2703d95550d5ca568b4377ea927 | fe0b14dbc59623c7c1e3a3a70f10972c21d8eda6 | refs/heads/master | 2021-01-20T06:14:30.699878 | 2017-05-15T06:18:30 | 2017-05-15T06:18:30 | 83,869,448 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,691 | cpp | /*
*@@@@@@@@@@ File Information Start @@@@@@@@@@
* @file: ParseParameter.cpp
* @author: Fuchen Duan
* @email: slow295185031@gmail.com
* @github: https://foocoder.github.com
* @homepage: http://foocder.github.io
* @create at: 2017-04-23 14:12:28
* @last update: 2017-04-23 14:51:22
*@@@@@@@@@@ File Information Finish @@@@@@@@@@
*/
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
int main(int argc, char *argv[])
{
string strLine;
getline( cin, strLine );
int nLen = strLine.size();
int nIdx = 0;
char charIdx;
bool bIsFinish = true;
bool bIsQuote = false;
vector<string> vecParameters;
string strPara;
while( ( charIdx = strLine[nIdx++] ) != '\0' ){
if( charIdx == ' ' ){
if( bIsQuote ){
strPara += ' ';
continue;
}
else{
if( !strPara.empty() ) {
vecParameters.push_back( strPara );
strPara.clear();
}
/* bIsFinish = true; */
}
}
else if( charIdx == '\"' ){
if( bIsQuote ){
bIsQuote = false;
}
else{
bIsQuote = true;
}
}
else{
strPara += charIdx;
}
}
if( !strPara.empty() ){
vecParameters.push_back( strPara );
}
cout<<vecParameters.size()<<endl;
for( auto i : vecParameters ){
cout<<i<<endl;
}
/* for( int i=0; i<nLen; ++i ){ */
/* if( strLine[i] ){ */
/* } */
/* } */
return 0;
}
| [
"slow295185031@gmail.com"
] | slow295185031@gmail.com |
67ed472b31931830ce104751d4efaf3db2259406 | bfb9da168e51ad6d514b97059ad0ee0f45f3664f | /Action.cpp | 958830c7412e80b6e2656fa5b4440db42e25c942 | [] | no_license | orsaar0/SPLFLIX | da911c45135399e087e2b616ea57b356714a39a0 | f6eb5292f0833be789d7ee94080b00fbaaf00c20 | refs/heads/main | 2023-05-27T23:37:20.656904 | 2021-06-17T08:40:32 | 2021-06-17T08:40:32 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,302 | cpp | //#include "../include/Action.h"
#include "../include/User.h"
#include "../include/Session.h"
#include "../include/Action.h"
#include <string>
using namespace std;
// BaseAction Class
BaseAction ::BaseAction(): errorMsg(""), status(PENDING){}
BaseAction :: ~BaseAction () = default;
ActionStatus BaseAction:: getStatus() const { return status;}
void BaseAction:: act(Session& sess){}
string BaseAction:: toString() const {
if (status == PENDING) return "PENDING";
else if (status == COMPLETED) return "COMPLETED";
else return "ERROR: " + errorMsg;
}
void BaseAction:: complete() {status = COMPLETED;}
void BaseAction:: error(const string& message){
BaseAction::errorMsg = message;
status = ERROR;
}
string BaseAction::getErrorMsg() const {return errorMsg;}
// CreatUser Class
CreateUser:: CreateUser (string name, string algorithm): BaseAction(), name(name), algorithm(algorithm) {}
CreateUser ::~CreateUser() = default;
void CreateUser:: act (Session& sess){
if (name == "name error") error("the new user name is already taken");
else if (algorithm == "alg error") error("desired algorithm type is not exist");
else {
sess.createUser(name, algorithm);
complete();
}
}
string CreateUser:: toString() const {
if (getStatus() == ERROR) return "CreateUser ERROR: " + getErrorMsg();
else return "CreateUser COMPLETED";
}
CreateUser* CreateUser :: Clone() const{
return (new CreateUser (*this));
}
// ChangeActiveUser
ChangeActiveUser::ChangeActiveUser(string& name): BaseAction(), name(name) {}
ChangeActiveUser::~ChangeActiveUser() = default;
void ChangeActiveUser:: act (Session& sess){
// wanted user is not found
if (!sess.findUser(name)) error("user to active is not exist");
// user is found, put it as an activeUser in sess
else {
sess.change_active_user(sess.findUserInMap(name));
complete();
}
}
string ChangeActiveUser:: toString() const {
if (getStatus() == ERROR) return "ChangeActiveUser ERROR: " + getErrorMsg();
else return "ChangeActiveUser COMPLETED";
}
ChangeActiveUser* ChangeActiveUser :: Clone() const{
return (new ChangeActiveUser (*this));
}
// DeleteUser Class
DeleteUser:: DeleteUser (string to_delete): BaseAction(), to_delete(to_delete){}
DeleteUser ::~DeleteUser() = default;
void DeleteUser :: act (Session& sess){
// wanted user is not found
if (!sess.findUser(to_delete)) error("user for deletion is not found");
// user is found, delete it from user Map
else {
sess.delete_user(to_delete);
complete();
}
}
string DeleteUser ::toString() const {
if (getStatus() == ERROR) return "DeleteUser ERROR: " + getErrorMsg();
else return "DeleteUser COMPLETED";
}
DeleteUser* DeleteUser :: Clone() const{
return (new DeleteUser (*this));
}
//DuplicateUser Class
DuplicateUser :: DuplicateUser (string original_user, string new_user): BaseAction(), o(original_user), n(new_user){}
DuplicateUser ::~DuplicateUser() = default;
void DuplicateUser :: act (Session& sess) {
if (!sess.findUser(o)) error("original user is missing");
else {
// creat a new user on the heap with the same algorithm
sess.createUser(n, sess.findUserInMap(o)->getData());
// set the history of the new user to be tha same as original
sess.findUserInMap(n)->setHistory(sess.findUserInMap(o)->get_history());
complete();
}
}
string DuplicateUser :: toString() const {
if (getStatus() == ERROR) return "DuplicateUser ERROR: " + getErrorMsg();
else return "DuplicateUser COMPLETED";
}
DuplicateUser* DuplicateUser :: Clone() const{
return (new DuplicateUser (*this));
}
// PrintContentList Class
PrintContentList :: PrintContentList (): BaseAction(){}
PrintContentList ::~PrintContentList() = default;
void PrintContentList :: act (Session& sess){
for(auto& x : sess.getContent()) {
string to_print = (*x).toString();
cout << to_print << endl;
}
complete();
}
string PrintContentList ::toString() const {
return "PrintContentList COMPLETED";
}
PrintContentList* PrintContentList :: Clone() const{
return (new PrintContentList (*this));
}
// PrintWatchHistory Class
PrintWatchHistory :: PrintWatchHistory (): BaseAction() {}
PrintWatchHistory ::~PrintWatchHistory() = default;
void PrintWatchHistory :: act (Session& sess){
if (sess.getActiveUser() -> get_history().size() == 0) error("history is empty");
else {
int index = 1;
for (auto& x: sess.getActiveUser()->get_history()) {
cout << to_string(index)+ ". " + x->contentToString() << endl;
index++;
}
complete();
}
}
string PrintWatchHistory ::toString() const {
if (getStatus() == ERROR) return "PrintWatchHistory ERROR: " + getErrorMsg();
else return "PrintWatchHistory COMPLETED";
}
PrintWatchHistory* PrintWatchHistory :: Clone() const{
return (new PrintWatchHistory (*this));
}
// Watch Class
Watch :: Watch (string user_input): BaseAction(), id(move(user_input)){}
Watch ::~Watch() = default;
void Watch :: act (Session& sess) {
// add the action to the action log
Watchable* recommend = nullptr;
// search the content that the user wants to watch
int input_id = stoi(id);
for (auto& x : sess.getContent()){
if(input_id == x->getId()){
cout << "Watching " + x->toString() << endl;
sess.getActiveUser()->get_history().push_back(x);
complete();
sess.getLog().push_back(this);
recommend = x->getNextWatchable(sess);
break;
}
}
if (recommend == nullptr) cout << "no recommendation for you now" << endl;
else {
cout << "We recommend watching " + recommend->toString() + ", continue watching? [y/n]" << endl;
string ans;
getline(cin, ans);
if (ans == "y") {
auto *a = new Watch(to_string(recommend->getId()));
(*a).act(sess);
} else {
if (ans != "n")
cout << "ok... we guess you didn't like our recommendation, don't give up on us! let's start over again" << endl;
}
}
}
string Watch ::toString() const {
if (getStatus() == ERROR) return "PrintWatchHistory ERROR: " + getErrorMsg();
else return "Watch COMPLETED";
}
Watch* Watch :: Clone() const{
return (new Watch (*this));
}
// PrintActionsLog Class
PrintActionsLog :: PrintActionsLog (): BaseAction(){}
PrintActionsLog ::~PrintActionsLog() = default;
void PrintActionsLog :: act (Session& sess){
string final_string;
if (sess.getLog().size() == 0) error("log is empty");
else {
for (BaseAction* x: sess.getLog()) final_string = x->toString() + "\n" + final_string;
cout << final_string << endl;
complete();
}
}
string PrintActionsLog :: toString() const {
if (getStatus() == ERROR) return "PrintActionsLog ERROR: " + getErrorMsg();
else return "PrintActionsLog COMPLETED";
}
PrintActionsLog* PrintActionsLog :: Clone() const{
return (new PrintActionsLog (*this));
}
// Exit Class
Exit :: Exit (): BaseAction(){}
Exit ::~Exit() = default;
void Exit :: act (Session& sess){
cout << "Tnx for using SPLFLIX! hope to see you again soon. Goodbye" << endl;
complete();
}
string Exit :: toString() const {
return "EXIT COMPLETED";
}
Exit* Exit :: Clone() const{
return (new Exit (*this));
}
//todo: delete Session? what should we do here?...
| [
"noreply@github.com"
] | orsaar0.noreply@github.com |
1d56469fd33ff73d5eda8d8bedd5880820659a0f | b336c3db94667329eb1d0eea5b65d8df20fa5e3d | /libraries/Dragino/examples/IoTServer/Cayenne and TTN/cayenne and ttn example/GPS_shield examples/GPS_shield_cayenne_and_ttn-otaaClient/GPS_shield_cayenne_and_ttn-otaaClient.ino | f4496fa5d0822eee427d7b173e2947dbc95c22a7 | [] | no_license | AtemJosh/Arduino-Profile-Examples | c005c1b4f290d5143299e011402135ef8d661c11 | 656be9cbce75213c3fd01e3c7108faf715b59c4d | refs/heads/master | 2020-08-03T09:21:52.112851 | 2019-06-19T13:53:12 | 2019-06-19T13:53:12 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 9,834 | ino | /*******************************************************************************
* Copyright (c) 2019 Thomas Telkamp and Matthijs Kooijman
*
* Permission is hereby granted, free of charge, to anyone
* obtaining a copy of this document and accompanying files,
* to do whatever they want with them without any restriction,
* including, but not limited to, copying, modification and redistribution.
* NO WARRANTY OF ANY KIND IS PROVIDED.
*
* This example sends a valid LoRaWAN packet with payload "Hello,
* world!", using frequency and encryption settings matching those of
* the The Things Network.
*
* This uses OTAA (Over-the-air activation), where where a DevEUI and
* application key is configured, which are used in an over-the-air
* activation procedure where a DevAddr and session keys are
* assigned/generated for use with all further communication.
*
* Note: LoRaWAN per sub-band duty-cycle limitation is enforced (1% in
* g1, 0.1% in g2), but not the TTN fair usage policy (which is probably
* violated by this sketch when left running for longer)!
* To use this sketch, first register your application and device with
* the things network, to set or generate an AppEUI, DevEUI and AppKey.
* Multiple devices can use the same AppEUI, but each device has its own
* DevEUI and AppKey.
*
* Do not forget to define the radio type correctly in config.h.
*
*******************************************************************************/
#include <TinyGPS.h>
#include <lmic.h>
#include <hal/hal.h>
#include <SPI.h>
#include <SoftwareSerial.h>
TinyGPS gps;
SoftwareSerial ss(4, 3); // Arduino RX, TX to conenct
static void smartdelay(unsigned long ms);
unsigned int count = 0; //For times count
float longitude,latitude;
float flat,flon,falt;
float mgLon,mgLat; // World Geodetic System ==> Mars Geodetic System
static uint8_t mydata[11] ={0x03,0x88,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
// This EUI must be in little-endian format, so least-significant-byte
// first. When copying an EUI from ttnctl output, this means to reverse
// the bytes. For TTN issued EUIs the last bytes should be 0xD5, 0xB3,
// 0x70.
static const u1_t PROGMEM APPEUI[8]={ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 };
void os_getArtEui (u1_t* buf) { memcpy_P(buf, APPEUI, 8);}
// This should also be in little endian format, see above.
static const u1_t PROGMEM DEVEUI[8]={ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 };
void os_getDevEui (u1_t* buf) { memcpy_P(buf, DEVEUI, 8);}
// This key should be in big endian format (or, since it is not really a
// number but a block of memory, endianness does not really apply). In
// practice, a key taken from ttnctl can be copied as-is.
// The key shown here is the semtech default key.
static const u1_t PROGMEM APPKEY[16] ={ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 };
void os_getDevKey (u1_t* buf) { memcpy_P(buf, APPKEY, 16);}
static osjob_t sendjob;
// Schedule TX every this many seconds (might become longer due to duty
// cycle limitations).
const unsigned TX_INTERVAL = 60;
// Pin mapping
const lmic_pinmap lmic_pins = {
.nss = 10,
.rxtx = LMIC_UNUSED_PIN,
.rst = 9,
.dio = {2, 6, 7},
};
void onEvent (ev_t ev) {
Serial.print(os_getTime());
Serial.print(": ");
switch(ev) {
case EV_SCAN_TIMEOUT:
Serial.println(F("EV_SCAN_TIMEOUT"));
break;
case EV_BEACON_FOUND:
Serial.println(F("EV_BEACON_FOUND"));
break;
case EV_BEACON_MISSED:
Serial.println(F("EV_BEACON_MISSED"));
break;
case EV_BEACON_TRACKED:
Serial.println(F("EV_BEACON_TRACKED"));
break;
case EV_JOINING:
Serial.println(F("EV_JOINING"));
break;
case EV_JOINED:
Serial.println(F("EV_JOINED"));
// Disable link check validation (automatically enabled
// during join, but not supported by TTN at this time).
LMIC_setLinkCheckMode(0);
break;
case EV_RFU1:
Serial.println(F("EV_RFU1"));
break;
case EV_JOIN_FAILED:
Serial.println(F("EV_JOIN_FAILED"));
break;
case EV_REJOIN_FAILED:
Serial.println(F("EV_REJOIN_FAILED"));
break;
break;
case EV_TXCOMPLETE:
Serial.println(F("EV_TXCOMPLETE (includes waiting for RX windows)"));
if (LMIC.txrxFlags & TXRX_ACK)
Serial.println(F("Received ack"));
if (LMIC.dataLen) {
Serial.println(F("Received "));
Serial.println(LMIC.dataLen);
Serial.println(F(" bytes of payload"));
}
// Schedule next transmission
os_setTimedCallback(&sendjob, os_getTime()+sec2osticks(TX_INTERVAL), do_send);
break;
case EV_LOST_TSYNC:
Serial.println(F("EV_LOST_TSYNC"));
break;
case EV_RESET:
Serial.println(F("EV_RESET"));
break;
case EV_RXCOMPLETE:
// data received in ping slot
Serial.println(F("EV_RXCOMPLETE"));
break;
case EV_LINK_DEAD:
Serial.println(F("EV_LINK_DEAD"));
break;
case EV_LINK_ALIVE:
Serial.println(F("EV_LINK_ALIVE"));
break;
default:
Serial.println(F("Unknown event"));
break;
}
}
// World Geodetic System ==> Mars Geodetic System
double transformLat(double x, double y)
{
double ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * sqrt(abs(x));
ret += (20.0 * sin(6.0 * x * M_PI) + 20.0 * sin(2.0 * x * M_PI)) * 2.0 / 3.0;
ret += (20.0 * sin(y * M_PI) + 40.0 * sin(y / 3.0 * M_PI)) * 2.0 / 3.0;
ret += (160.0 * sin(y / 12.0 * M_PI) + 320 * sin(y * M_PI / 30.0)) * 2.0 / 3.0;
return ret;
}
double transformLon(double x, double y)
{
double ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * sqrt(abs(x));
ret += (20.0 * sin(6.0 * x * M_PI) + 20.0 * sin(2.0 * x * M_PI)) * 2.0 / 3.0;
ret += (20.0 * sin(x * M_PI) + 40.0 * sin(x / 3.0 * M_PI)) * 2.0 / 3.0;
ret += (150.0 * sin(x / 12.0 * M_PI) + 300.0 * sin(x / 30.0 * M_PI)) * 2.0 / 3.0;
return ret;
}
void WGS2GCJTransform(float wgLon, float wgLat, float &mgLon, float &mgLat)
{
const double a = 6378245.0;
const double ee = 0.00669342162296594323;
double dLat = transformLat(wgLon - 105.0, wgLat - 35.0);
double dLon = transformLon(wgLon - 105.0, wgLat - 35.0);
double radLat = wgLat / 180.0 * M_PI;
double magic = sin(radLat);
magic = 1 - ee * magic * magic;
double sqrtMagic = sqrt(magic);
dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * M_PI);
dLon = (dLon * 180.0) / (a / sqrtMagic * cos(radLat) * M_PI);
mgLat = wgLat + dLat;
mgLon = wgLon + dLon;
}
void GPSRead()
{
unsigned long age;
gps.f_get_position(&flat, &flon, &age);
falt=gps.f_altitude(); //get altitude
flon == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flon, 6;//save six decimal places
flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flat, 6;
falt == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : falt, 2;//save two decimal places
if((flon < 72.004 || flon > 137.8347)&&(flat < 0.8293 || flat >55.8271)) //out of China
{
longitude=flon;
latitude=flat;
// Serial.println("Out of China");
}
else
{
WGS2GCJTransform(flon,flat,mgLon,mgLat);
longitude=mgLon;
latitude=mgLat;
//Serial.println("In China");
}
int32_t lat = latitude * 10000;
int32_t lon = longitude * 10000;
int32_t alt = falt * 100;
mydata[2] = lat >> 16;
mydata[3] = lat >> 8;
mydata[4] = lat;
mydata[5] = lon >> 16;
mydata[6] = lon >> 8;
mydata[7] = lon;
mydata[8] = alt >> 16;
mydata[9] = alt >> 8;
mydata[10] = alt;
}
void printdata(){
Serial.print(F("########### "));
Serial.print(F("NO."));
Serial.print(count);
Serial.println(F(" ###########"));
if(flon!=1000.000000) //Successfully positioning
{
Serial.println(F("The longtitude and latitude and altitude are:"));
Serial.print(F("["));
Serial.print(mgLon,4);
Serial.print(F(","));
Serial.print(mgLat,4);
Serial.print(F(","));
Serial.print(falt);
Serial.print(F("]"));
Serial.println(F(""));
count++;
}
else
{
Serial.println(F("Unsuccessfully positioning"));
}
}
static void smartdelay(unsigned long ms)
{
unsigned long start = millis();
do
{
while (ss.available())
{
gps.encode(ss.read());
}
} while (millis() - start < ms);
}
void do_send(osjob_t* j){
// Check if there is not a current TX/RX job running
if (LMIC.opmode & OP_TXRXPEND) {
Serial.println(F("OP_TXRXPEND, not sending"));
} else {
smartdelay(1000);
GPSRead();
printdata();
// Prepare upstream data transmission at the next possible time.
LMIC_setTxData2(1, mydata, sizeof(mydata), 0);
Serial.println(F("Packet queued"));
}
// Next TX is scheduled after TX_COMPLETE event.
}
void setup() {
Serial.begin(9600);
Serial.println(F("Starting"));
ss.begin(9600);
#ifdef VCC_ENABLE
// For Pinoccio Scout boards
pinMode(VCC_ENABLE, OUTPUT);
digitalWrite(VCC_ENABLE, HIGH);
delay(1000);
#endif
// LMIC init
os_init();
// Reset the MAC state. Session and pending data transfers will be discarded.
LMIC_reset();
// Start job (sending automatically starts OTAA too)
do_send(&sendjob);
}
void loop() {
os_runloop_once();
}
| [
"44599451+engineer-lin@users.noreply.github.com"
] | 44599451+engineer-lin@users.noreply.github.com |
8848d9e4d13ab431efe1f08ecb2a8991a133578f | b16e2f8cc94df8320f9caf8c8592fa21b1f7c413 | /HDUOJ/1532/dinic.cpp | 4c08a3895186f1f6485ffa487eea490a83722de9 | [
"MIT"
] | permissive | codgician/Competitive-Programming | 000dfafea0575b773b0a10502f5128d2088f3398 | 391f3ce9b89b0a4bbbe3ff60eb2369fef57460d4 | refs/heads/master | 2022-06-13T04:59:52.322037 | 2020-04-29T06:38:59 | 2020-04-29T06:38:59 | 104,017,512 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,990 | cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <iomanip>
#include <climits>
#include <vector>
#include <queue>
#include <set>
#include <map>
#define VERTEX_SIZE 201
#define EDGE_SIZE 401
using namespace std;
typedef struct _Edge
{
int to;
int capacity;
int next;
} Edge;
Edge arr[EDGE_SIZE];
int head[VERTEX_SIZE], arrPt, vertexNum;
int depth[VERTEX_SIZE], lastVisitedEdge[VERTEX_SIZE];
void addEdge(int from, int to, int capacity)
{
arr[arrPt] = {to, capacity, head[from]};
head[from] = arrPt++;
arr[arrPt] = {from, 0, head[to]};
head[to] = arrPt++;
}
bool updateDepth(int startPt, int endPt)
{
memset(depth, -1, sizeof(depth));
queue<int> q;
depth[startPt] = 0;
q.push(startPt);
while (!q.empty())
{
int cntPt = q.front();
q.pop();
int edgePt = head[cntPt];
while (edgePt != -1)
{
if (depth[arr[edgePt].to] == -1 && arr[edgePt].capacity > 0)
{
depth[arr[edgePt].to] = depth[cntPt] + 1;
if (arr[edgePt].to == endPt)
return true;
q.push(arr[edgePt].to);
}
edgePt = arr[edgePt].next;
}
}
return false;
}
int findAugPath(int cntPt, int endPt, int minCapacity)
{
if (cntPt == endPt)
return minCapacity;
int cntFlow = 0;
int &edgePt = lastVisitedEdge[cntPt];
while (edgePt != -1)
{
if (depth[arr[edgePt].to] == depth[cntPt] + 1 && arr[edgePt].capacity > 0)
{
int flowInc = findAugPath(arr[edgePt].to, endPt, min(minCapacity - cntFlow, arr[edgePt].capacity));
if (flowInc == 0)
{
depth[arr[edgePt].to] = -1;
}
else
{
arr[edgePt].capacity -= flowInc;
arr[edgePt ^ 1].capacity += flowInc;
cntFlow += flowInc;
if (cntFlow == minCapacity)
break;
}
}
edgePt = arr[edgePt].next;
}
return cntFlow;
}
int dinic(int startPt, int endPt)
{
int ans = 0;
while (updateDepth(startPt, endPt))
{
for (int i = 0; i < vertexNum; i++)
{
lastVisitedEdge[i] = head[i];
}
int flowInc = findAugPath(startPt, endPt, INT_MAX);
if (flowInc == 0)
break;
ans += flowInc;
}
return ans;
}
int main()
{
ios::sync_with_stdio(false);
int edgeNum;
while (cin >> edgeNum >> vertexNum)
{
arrPt = 0;
memset(head, -1, sizeof(head));
for (int i = 0; i < edgeNum; i++)
{
int from, to, capacity;
cin >> from >> to >> capacity;
from--;
to--;
addEdge(from, to, capacity);
}
int ans = dinic(0, vertexNum - 1);
cout << ans << endl;
}
return 0;
}
| [
"codgician@users.noreply.github.com"
] | codgician@users.noreply.github.com |
c6fc397bd0545d5b7e115e5d90d7886444a838af | b2b631c3aaf7ff9384023610f2038911be22f123 | /TestWeightedGraph.cpp | 2b97b34de5c15e376d3872dddc10bf407ec0f376 | [] | no_license | aberry5621/cplusplus_book_source_code | a7e68da30599b7526387870c207ae40f4091b7da | 094941d135bc2654fe2d0ec041f3ad1de243adb9 | refs/heads/master | 2021-01-12T16:27:15.237724 | 2016-09-26T17:43:58 | 2016-09-26T17:43:58 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,672 | cpp | #include <iostream>
#include <string>
#include <vector>
#include "WeightedGraph.h"
#include "WeightedEdge.h"
using namespace std;
int main()
{
// Vertices for graph in Figure 24.1
string vertices[] = {"Seattle", "San Francisco", "Los Angeles",
"Denver", "Kansas City", "Chicago", "Boston", "New York",
"Atlanta", "Miami", "Dallas", "Houston"};
// Edge array for graph in Figure 24.1
int edges[][3] = {
{0, 1, 807}, {0, 3, 1331}, {0, 5, 2097},
{1, 0, 807}, {1, 2, 381}, {1, 3, 1267},
{2, 1, 381}, {2, 3, 1015}, {2, 4, 1663}, {2, 10, 1435},
{3, 0, 1331}, {3, 1, 1267}, {3, 2, 1015}, {3, 4, 599},
{3, 5, 1003},
{4, 2, 1663}, {4, 3, 599}, {4, 5, 533}, {4, 7, 1260},
{4, 8, 864}, {4, 10, 496},
{5, 0, 2097}, {5, 3, 1003}, {5, 4, 533},
{5, 6, 983}, {5, 7, 787},
{6, 5, 983}, {6, 7, 214},
{7, 4, 1260}, {7, 5, 787}, {7, 6, 214}, {7, 8, 888},
{8, 4, 864}, {8, 7, 888}, {8, 9, 661},
{8, 10, 781}, {8, 11, 810},
{9, 8, 661}, {9, 11, 1187},
{10, 2, 1435}, {10, 4, 496}, {10, 8, 781}, {10, 11, 239},
{11, 8, 810}, {11, 9, 1187}, {11, 10, 239}
};
const int NUMBER_OF_EDGES = 46; // 46 edges in Figure 24.1
// Create a vector for vertices
vector<string> vectorOfVertices(12);
copy(vertices, vertices + 12, vectorOfVertices.begin());
// Create a vector for edges
vector<WeightedEdge> edgeVector;
for (int i = 0; i < NUMBER_OF_EDGES; i++)
edgeVector.push_back(WeightedEdge(edges[i][0],
edges[i][1], edges[i][2]));
WeightedGraph<string> graph1(vectorOfVertices, edgeVector);
cout << "The number of vertices in graph1: " << graph1.getSize();
cout << "\nThe vertex with index 1 is " << graph1.getVertex(1);
cout << "\nThe index for Miami is " << graph1.getIndex("Miami");
cout << "\nThe edges for graph1: " << endl;
graph1.printWeightedEdges();
// Create a graph for Figure 24.3(a)
int edges2[][3] =
{
{0, 1, 2}, {0, 3, 8},
{1, 0, 2}, {1, 2, 7}, {1, 3, 3},
{2, 1, 7}, {2, 3, 4}, {2, 4, 5},
{3, 0, 8}, {3, 1, 3}, {3, 2, 4}, {3, 4, 6},
{4, 2, 5}, {4, 3, 6}
}; // 14 edges in Figure 24.3(a)
const int NUMBER_OF_EDGES2 = 14; // 14 edges in Figure 24.3(a)
vector<WeightedEdge> edgeVector2;
for (int i = 0; i < NUMBER_OF_EDGES2; i++)
edgeVector2.push_back(WeightedEdge(edges2[i][0],
edges2[i][1], edges2[i][2]));
WeightedGraph<int> graph2(5, edgeVector2); // 5 vertices in graph2
cout << "The number of vertices in graph2: " << graph2.getSize();
cout << "\nThe edges for graph2: " << endl;
graph2.printWeightedEdges();
return 0;
}
| [
"alexberry721@gmail.com"
] | alexberry721@gmail.com |
cc2d2db86a10684d41f52906296731b168df61ac | c31b5a50b294bac12c12d4a9ed5a27e62e180285 | /libsrc/domain/MDBOrderPlacerJapanese.cpp | 3c0f392efbb66ad85776947a997d41c4da178f71 | [] | no_license | IHE-WUSTL/mesa | 6192bf0ab76c770945e432f1078404e883a09c7f | 6cfa6dcba8b39214975ebaed3be89b53a683e20b | refs/heads/master | 2020-03-08T06:27:53.528645 | 2018-04-03T19:54:46 | 2018-04-03T19:54:46 | 127,972,608 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 20,252 | cpp | //
// Copyright (C) 1999, 2000, HIMSS, RSNA and Washington University
//
// The MESA test tools software and supporting documentation were
// developed for the Integrating the Healthcare Enterprise (IHE)
// initiative Year 1 (1999-2000), under the sponsorship of the
// Healthcare Information and Management Systems Society (HIMSS)
// and the Radiological Society of North America (RSNA) by:
// Electronic Radiology Laboratory
// Mallinckrodt Institute of Radiology
// Washington University School of Medicine
// 510 S. Kingshighway Blvd.
// St. Louis, MO 63110
//
// THIS SOFTWARE IS MADE AVAILABLE, AS IS, AND NEITHER HIMSS, RSNA NOR
// WASHINGTON UNIVERSITY MAKE ANY WARRANTY ABOUT THE SOFTWARE, ITS
// PERFORMANCE, ITS MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR
// USE, FREEDOM FROM ANY DEFECTS OR COMPUTER DISEASES OR ITS CONFORMITY
// TO ANY SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND PERFORMANCE OF
// THE SOFTWARE IS WITH THE USER.
//
// Copyright of the software and supporting documentation is
// jointly owned by HIMSS, RSNA and Washington University, and free
// access is hereby granted as a license to use this software, copy
// this software and prepare derivative works based upon this software.
// However, any distribution of this software source code or supporting
// documentation or derivative works (source code and supporting
// documentation) must include the three paragraphs of this copyright
// notice.
#include "MESA.hpp"
#include "MLogClient.hpp"
#include "MDBOrderPlacerJapanese.hpp"
#include "MPatient.hpp"
#include "MVisit.hpp"
#include "MPlacerOrder.hpp"
#include "MFillerOrder.hpp"
#include "MCharsetEncoder.hpp"
MDBOrderPlacerJapanese::MDBOrderPlacerJapanese() : mDBInterface(NULL)
{
}
MDBOrderPlacerJapanese::MDBOrderPlacerJapanese(const MDBOrderPlacerJapanese& cpy) : mDBInterface(cpy.mDBInterface)
{
}
MDBOrderPlacerJapanese::~MDBOrderPlacerJapanese()
{
if (mDBInterface)
delete mDBInterface;
}
void
MDBOrderPlacerJapanese::printOn(ostream& s) const
{
s << "MDBOrderPlacerJapanese";
}
void
MDBOrderPlacerJapanese::streamIn(istream& s)
{
//s >> this->member;
}
MDBOrderPlacerJapanese::MDBOrderPlacerJapanese(const MString& databaseName) :
mDBInterface(0)
{
if (databaseName != "")
mDBInterface = new MDBInterface(databaseName);
}
int
MDBOrderPlacerJapanese::openDatabase(const MString& databaseName)
{
if (mDBInterface)
delete mDBInterface;
if (databaseName != "")
mDBInterface = new MDBInterface(databaseName);
else
mDBInterface = 0;
return 0;
}
int
MDBOrderPlacerJapanese::admitRegisterPatient(const MPatient& patient,
const MVisit& visit)
{
MLogClient logClient;
logClient.logTimeStamp(MLogClient::MLOG_VERBOSE,
"MDBOrderPlacerJapanese::admitRegisterPatient enter method");
// first do sanity check
if (!mDBInterface) {
logClient.logTimeStamp(MLogClient::MLOG_ERROR,
"MDBOrderPlacerJapanese::admitRegisterPatient exit method, no DB Interface");
return 1;
}
if (patient.mapEmpty()) {
logClient.logTimeStamp(MLogClient::MLOG_VERBOSE,
"MDBOrderPlacerJapanese::admitRegisterPatient exit method, patient object is empty");
return 0;
}
char pNameISO2022JP[1024];
char pNameEUCJP[1024];
int outputLength = 0;
patient.patientName().safeExport(pNameISO2022JP, sizeof(pNameISO2022JP));
MCharsetEncoder e;
int status = 0;
logClient.logTimeStamp(MLogClient::MLOG_VERBOSE,
MString("Patient Name in ISO2022JP format: ") + pNameISO2022JP);
status = e.xlate(pNameEUCJP, outputLength, (int)sizeof(pNameEUCJP),
pNameISO2022JP, ::strlen(pNameISO2022JP),
"ISO2022JP", "EUC_JP");
if (status != 0) {
logClient.logTimeStamp(MLogClient::MLOG_VERBOSE,
"MDBOrderPlacerJapanese::admitRegisterPatient exit method, unable to translate from ISO2022JP to EUCJP");
return 1;
}
pNameEUCJP[outputLength] = '\0';
logClient.logTimeStamp(MLogClient::MLOG_VERBOSE,
MString("Patient Name in EUC_JP format: ") + pNameEUCJP);
MPatient p (patient);
p.patientName(pNameEUCJP);
if (recordExists(p))
updateRecord(p);
else
addRecord(p);
if (visit.mapEmpty())
return 0;
if (recordExists(visit))
updateRecord(visit);
else
addRecord(visit);
logClient.logTimeStamp(MLogClient::MLOG_VERBOSE,
"MDBOrderPlacerJapanese::admitRegisterPatient exit method");
return 0;
}
int
MDBOrderPlacerJapanese::preRegisterPatient(const MPatient& patient,
const MVisit& visit)
{
return this->admitRegisterPatient(patient, visit);
}
int
MDBOrderPlacerJapanese::updateADTInfo(const MPatient& patient)
{
// first do sanity check
if (!mDBInterface)
return 1;
if (patient.mapEmpty())
return 0;
updateRecord(patient);
return 1;
}
int
MDBOrderPlacerJapanese::updateADTInfo(const MPatient& patient, const MVisit& visit)
{
// first do sanity check
if (!mDBInterface)
return 1;
if (patient.mapEmpty())
return 0;
updateRecord(patient);
if (visit.mapEmpty())
return 0;
updateRecord(visit);
return 1;
}
int
MDBOrderPlacerJapanese::transferPatient(const MVisit& visit)
{
// first do sanity check
if (!mDBInterface)
return 1;
if (visit.mapEmpty())
return 0;
MPatient patient;
patient.patientID(visit.patientID());
patient.issuerOfPatientID(visit.issuerOfPatientID());
if (!recordExists(patient))
return 0;
updateRecord(visit);
return 1;
}
int
MDBOrderPlacerJapanese::mergePatient(const MPatient& patient, const MString& issuer)
{
if (!mDBInterface)
return 1;
MCriteriaVector criteria;
MString priorID = patient.priorID(issuer);
MCriteria c;
c.attribute = "patid";
c.oper = TBL_EQUAL;
c.value = priorID;
MCriteriaVector cv;
cv.push_back(c);
MUpdateVector updateVector;
MUpdate u;
u.attribute = "patid";
u.func = TBL_SET;
u.value = patient.patientID();
updateVector.push_back(u);
MPlacerOrder placerOrder;
placerOrder.patientID(patient.patientID());
mDBInterface->update(placerOrder, cv, updateVector);
MFillerOrder fillerOrder;
fillerOrder.patientID(patient.patientID());
mDBInterface->update(fillerOrder, cv, updateVector);
// Then delete from patient table.
mDBInterface->remove(patient, cv);
// Add the patient if it does not already exist
if (!recordExists(patient)) {
addRecord(patient);
}
return 1;
}
int
MDBOrderPlacerJapanese::enterOrder(const MPlacerOrder& order)
{
// first do sanity check
if (!mDBInterface)
return 1;
if (order.mapEmpty())
return 0;
MPatient p;
p.patientID(order.patientID());
p.issuerOfPatientID(order.issuerOfPatientID());
if (recordExists(p))
{
if (recordExists(order))
updateRecord(order);
else
addOrder(order);
}
else
return 0;
return 1;
}
int
MDBOrderPlacerJapanese::enterOrder(const MFillerOrder& order)
{
// first do sanity check
if (!mDBInterface)
return 1;
if (order.mapEmpty())
return 0;
MPatient p;
p.patientID(order.patientID());
p.issuerOfPatientID(order.issuerOfPatientID());
if (recordExists(p))
{
if (recordExists(order))
updateRecord(order);
else
addOrder(order);
}
else
return 0;
return 1;
}
int
MDBOrderPlacerJapanese::updateOrder(const MPlacerOrder& order)
{
// first do sanity check
if (!mDBInterface)
return 1;
if (order.mapEmpty())
return 0;
MPatient p;
p.patientID(order.patientID());
p.issuerOfPatientID(order.issuerOfPatientID());
if (recordExists(p)) {
updateRecord(order);
return 1;
} else {
return 0;
}
}
int
MDBOrderPlacerJapanese::cancelOrder(const MPlacerOrder& order)
{
//first do sanity check
if (!mDBInterface)
return 1;
if (order.mapEmpty())
return 0;
deleteRecord(order);
return 1;
}
int
MDBOrderPlacerJapanese::getOrder(MPatient& patient, MPlacerOrder& order)
{
//first do sanity check
if (!mDBInterface)
return 1;
if (order.mapEmpty())
return 0;
if (patient.mapEmpty())
{
// set patient ID and issuer in patient object from order object
patient.patientID(order.patientID());
patient.issuerOfPatientID(order.issuerOfPatientID());
}
else
{
if (patient.patientID() != order.patientID())
return 0;
}
if (recordExists(patient))
{
MCriteriaVector cv;
setCriteria(patient, cv);
mDBInterface->select(patient, cv, NULL);
}
else
return 0;
if (recordExists(order))
{
MCriteriaVector cv;
setCriteria(order, cv);
mDBInterface->select(order, cv, NULL);
}
else
return 0;
// now get all the orders belonging to the order placer
MOrder o;
MCriteriaVector cv;
// set criteria
o.placerOrderNumber(order.placerOrderNumber());
setCriteria(o, cv);
int numOrders = mDBInterface->select(o, cv, placerOrderCallback, &order);
// processPlacerOrder() function will be repeatedly called with order
// domain object. This function will insert each order found in the
// placerOrder object
if (numOrders != order.numOrders())
{
cout << "MDBOrderPlacerJapanese: Processing Error: " << endl;
cout << "Number of Orders in the database: " << numOrders << endl;
cout << "Number of Orders captured in the domain object: " \
<< order.numOrders() << endl;
}
return 1;
}
MString
MDBOrderPlacerJapanese::newPlacerOrderNumber() const
{
MString s;
s = mIdentifier.mesaID(MIdentifier::MID_PLACERORDERNUMBER, *mDBInterface);
return s;
}
#if 0
int
MDBOrderPlacerJapanese::newPlacerOrderNumber(MString& placerOrderNumber)
{
//first do sanity check
if (!mDBInterface)
return 1;
// get all the placer orders
MPlacerOrder order;
// extract entity ID (first component) from the placer order number
char* poNum = placerOrderNumber.strData();
char* applID = strchr(poNum, '^');
char* entityID;
if (applID)
{
entityID = new char[applID-poNum+1];
memset(entityID, 0, applID-poNum+1);
strncpy(entityID, poNum, applID-poNum);
// if entity id is not a number, then cannot do it
for (int i = 0; i < strlen(entityID); i++)
{
if (!isdigit(entityID[i]))
return 0;
}
}
else
{
entityID = new char[strlen(poNum)+1];
strcpy(entityID, poNum);
}
long entityIDNum = atoi(entityID);
mDBInterface->selectAll(order, newOrderCallback, &entityIDNum);
// newOrderCallback() function will be repeatedly called with order
// domain object. This function will determine the new integer value of
// the entity ID
// entityIDNum is now the largest numeric entityID not found in the table
char* tmpID = new char[strlen(entityID)+5];
memset(tmpID, 0, sizeof(tmpID));
sprintf(tmpID, "%d", entityIDNum);
char* newID;
if (applID)
{
newID = new char[strlen(entityID)+strlen(applID)+1];
memset(newID, 0, sizeof(entityID));
}
else
{
newID = new char[strlen(entityID)+1];
memset(newID, 0, sizeof(newID));
}
// fill in leading zeros
for (int i = strlen(tmpID)-strlen(entityID); i > 0; i--)
newID[i-1] = '0';
strcat(newID, tmpID);
placerOrderNumber = MString(newID);
if (applID)
placerOrderNumber += MString(applID);
// cleanup
delete [] poNum;
delete [] entityID;
delete [] tmpID;
delete [] newID;
return 1;
}
#endif
// **********************************************************************************************
// FOLLOWING ARE PRIVATE FUNCTIONS ONLY MEANT TO BE USED BY THE CLASS MEMBER FUNCTIONS THEMSELVES
// **********************************************************************************************
int
MDBOrderPlacerJapanese::recordExists(const MPatient& patient)
{
if (patient.mapEmpty())
return 0;
MPatient p;
MCriteriaVector cv;
setCriteria(patient, cv);
return mDBInterface->select(p, cv, NULL);
}
int
MDBOrderPlacerJapanese::recordExists(const MVisit& visit)
{
if (visit.mapEmpty())
return 0;
MVisit v;
MCriteriaVector cv;
setCriteria(visit, cv);
return mDBInterface->select(v, cv, NULL);
}
int
MDBOrderPlacerJapanese::recordExists(const MPlacerOrder& order)
{
if (order.mapEmpty())
return 0;
MPlacerOrder po;
MCriteriaVector cv;
setCriteria(order, cv);
return mDBInterface->select(po, cv, NULL);
}
int
MDBOrderPlacerJapanese::recordExists(const MFillerOrder& order)
{
if (order.mapEmpty())
return 0;
MFillerOrder fo;
MCriteriaVector cv;
setCriteria(order, cv);
return mDBInterface->select(fo, cv, NULL);
}
int
MDBOrderPlacerJapanese::recordExists(const MOrder& order)
{
if (order.mapEmpty())
return 0;
MOrder o;
MCriteriaVector cv;
setCriteria(order, cv);
return mDBInterface->select(o, cv, NULL);
}
void
MDBOrderPlacerJapanese::addRecord(const MDomainObject& domainObject)
{
mDBInterface->insert(domainObject);
}
void
MDBOrderPlacerJapanese::addOrder(const MPlacerOrder& order)
{
MPlacerOrder localOrder(order);
mDBInterface->insert(localOrder);
for (int inx = 0; inx < localOrder.numOrders(); inx++)
addRecord(localOrder.order(inx));
}
void
MDBOrderPlacerJapanese::addOrder(const MFillerOrder& order)
{
mDBInterface->insert(order);
for (int inx = 0; inx < order.numOrders(); inx++)
addRecord(order.order(inx));
}
void
MDBOrderPlacerJapanese::deleteRecord(const MPatient& patient)
{
MCriteriaVector cv;
setCriteria(patient, cv);
mDBInterface->remove(patient, cv);
}
void
MDBOrderPlacerJapanese::deleteRecord(const MVisit& visit)
{
MCriteriaVector cv;
setCriteria(visit, cv);
mDBInterface->remove(visit, cv);
}
void
MDBOrderPlacerJapanese::deleteRecord(const MPlacerOrder& order)
{
MCriteriaVector cv;
MPlacerOrder localOrder(order);
setCriteria(localOrder, cv);
mDBInterface->remove(localOrder, cv);
for (int inx = 0; inx < localOrder.numOrders(); inx++)
deleteRecord(localOrder.order(inx));
}
void
MDBOrderPlacerJapanese::deleteRecord(const MFillerOrder& order)
{
MCriteriaVector cv;
setCriteria(order, cv);
mDBInterface->remove(order, cv);
for (int inx = 0; inx < order.numOrders(); inx++)
deleteRecord(order.order(inx));
}
void
MDBOrderPlacerJapanese::deleteRecord(const MOrder& order)
{
MCriteriaVector cv;
setCriteria(order, cv);
mDBInterface->remove(order, cv);
}
void
MDBOrderPlacerJapanese::updateRecord(const MPatient& patient)
{
MCriteriaVector cv;
MUpdateVector uv;
setCriteria(patient, cv);
setCriteria(patient, uv);
mDBInterface->update(patient, cv, uv);
}
void
MDBOrderPlacerJapanese::updateRecord(const MVisit& visit)
{
MCriteriaVector cv;
MUpdateVector uv;
setCriteria(visit, cv);
setCriteria(visit, uv);
mDBInterface->update(visit, cv, uv);
}
void
MDBOrderPlacerJapanese::updateRecord(const MPlacerOrder& order)
{
MCriteriaVector cv;
MUpdateVector uv;
MPlacerOrder localOrder(order);
setCriteria(localOrder, cv);
setCriteria(localOrder, uv);
mDBInterface->update(localOrder, cv, uv);
for (int inx = 0; inx < localOrder.numOrders(); inx++)
updateRecord(localOrder.order(inx));
}
void
MDBOrderPlacerJapanese::updateRecord(const MFillerOrder& order)
{
MCriteriaVector cv;
MUpdateVector uv;
setCriteria(order, cv);
setCriteria(order, uv);
mDBInterface->update(order, cv, uv);
for (int inx = 0; inx < order.numOrders(); inx++)
updateRecord(order.order(inx));
}
void
MDBOrderPlacerJapanese::updateRecord(const MOrder& order)
{
MCriteriaVector cv;
MUpdateVector uv;
setCriteria(order, cv);
setCriteria(order, uv);
mDBInterface->update(order, cv, uv);
}
void
MDBOrderPlacerJapanese::setCriteria(const MPatient& patient, MCriteriaVector& cv)
{
MCriteria c;
c.attribute = "patid";
c.oper = TBL_EQUAL;
c.value = patient.patientID();
cv.push_back(c);
MString issuer(patient.issuerOfPatientID());
if (issuer.size())
{
c.attribute = "issuer";
c.oper = TBL_EQUAL;
c.value = patient.issuerOfPatientID();
cv.push_back(c);
}
}
void
MDBOrderPlacerJapanese::setCriteria(const MVisit& visit, MCriteriaVector& cv)
{
MCriteria c;
c.attribute = "patid";
c.oper = TBL_EQUAL;
c.value = visit.patientID();
cv.push_back(c);
MString issuer(visit.issuerOfPatientID());
if (issuer.size())
{
c.attribute = "issuer";
c.oper = TBL_EQUAL;
c.value = visit.issuerOfPatientID();
cv.push_back(c);
}
c.attribute = "visnum";
c.oper = TBL_EQUAL;
c.value = visit.visitNumber();
cv.push_back(c);
}
void
MDBOrderPlacerJapanese::setCriteria(const MPlacerOrder& order, MCriteriaVector& cv)
{
MCriteria c;
MString patientID(order.patientID());
if (patientID.size())
{
c.attribute = "patid";
c.oper = TBL_EQUAL;
c.value = order.patientID();
cv.push_back(c);
}
MString issuer(order.issuerOfPatientID());
if (issuer.size())
{
c.attribute = "issuer";
c.oper = TBL_EQUAL;
c.value = order.issuerOfPatientID();
cv.push_back(c);
}
c.attribute = "plaordnum";
c.oper = TBL_EQUAL;
c.value = order.placerOrderNumber();
cv.push_back(c);
}
void
MDBOrderPlacerJapanese::setCriteria(const MFillerOrder& order, MCriteriaVector& cv)
{
MCriteria c;
MString patientID(order.patientID());
if (patientID.size())
{
c.attribute = "patid";
c.oper = TBL_EQUAL;
c.value = order.patientID();
cv.push_back(c);
}
MString issuer(order.issuerOfPatientID());
if (issuer.size())
{
c.attribute = "issuer";
c.oper = TBL_EQUAL;
c.value = order.issuerOfPatientID();
cv.push_back(c);
}
MString poNum(order.placerOrderNumber());
if (poNum.size())
{
c.attribute = "plaordnum";
c.oper = TBL_EQUAL;
c.value = order.placerOrderNumber();
cv.push_back(c);
}
c.attribute = "filordnum";
c.oper = TBL_EQUAL;
c.value = order.fillerOrderNumber();
cv.push_back(c);
// may include accession number also
/*
MString accNum(order.accessionNumber());
if (accNum.size())
{
c.attribute = "accnum";
c.oper = TBL_EQUAL;
c.value = order.accessionNumber();
cv.push_back(c);
} */
}
void
MDBOrderPlacerJapanese::setCriteria(const MOrder& order, MCriteriaVector& cv)
{
MCriteria c;
c.attribute = "plaordnum";
c.oper = TBL_EQUAL;
c.value = order.placerOrderNumber();
cv.push_back(c);
MString foNum(order.fillerOrderNumber());
if (foNum.size())
{
c.attribute = "filordnum";
c.oper = TBL_EQUAL;
c.value = order.fillerOrderNumber();
cv.push_back(c);
}
/* may be Universal Service ID also
c.attribute = "uniserid";
c.oper = TBL_EQUAL;
c.value = order.universalServiceID();
cv.push_back(c);
*/
}
void
MDBOrderPlacerJapanese::setCriteria(const MDomainObject& domainObject, MUpdateVector& uv)
{
MUpdate u;
MDomainMap m = domainObject.map();
for (MDomainMap::iterator i = m.begin(); i != m.end(); i++)
{
u.attribute = (*i).first;
u.func = TBL_SET;
u.value = (*i).second;
uv.push_back(u);
}
}
static void
placerOrderCallback(MDomainObject& o, void* ctx)
{
MOrder ord;
ord.import(o);
MPlacerOrder* po = (MPlacerOrder*)ctx;
if (po)
po->add(ord);
}
static void
newOrderCallback(MDomainObject& o, void* ctx)
{
MPlacerOrder order;
order.import(o);
long* newEntityID = (long*)ctx;
MString placerOrderNumber = order.placerOrderNumber();
char* poNum = placerOrderNumber.strData();
char* applID = strchr(poNum, '^');
char* entityID = new char[applID-poNum+1];
memset(entityID, 0, applID-poNum+1);
strncpy(entityID, poNum, applID-poNum);
// if entity id is not a number, then cannot do comparison
for (int i = 0; i < strlen(entityID); i++)
{
if (!isdigit(entityID[i]))
return;
}
long entityIDNum = atoi(entityID);
if (entityIDNum >= *newEntityID)
*newEntityID = entityIDNum + 1;
}
MString
MDBOrderPlacerJapanese::newPatientID() const
{
MString s;
s = mIdentifier.mesaID(MIdentifier::MID_PATIENT, *mDBInterface);
return s;
}
| [
""
] | |
9b4ff45992553401cc42cb3f1cf01dd1ecef2a85 | 38b057c7dea2e7b9015e3fce67726cb1678a90b1 | /libs/z3/src/tactic/generic_model_converter.h | 750a22cd41c65b8bd774de667ab9132f6beac0ba | [
"MIT"
] | permissive | anhvvcs/corana | 3ef150667e8124c19238a3f75a875096bbf698c5 | dc40868ee4ba1c6148547fb125fddccfb0d446c3 | refs/heads/master | 2023-08-10T07:04:37.740227 | 2023-07-24T20:41:30 | 2023-07-24T20:41:30 | 181,912,504 | 34 | 4 | MIT | 2023-06-29T03:32:18 | 2019-04-17T14:49:09 | C | UTF-8 | C++ | false | false | 1,900 | h | /*++
Copyright (c) 2017 Microsoft Corporation
Module Name:
generic_model_converter.h
Abstract:
Generic model converter that hides and adds entries.
It subsumes filter_model_converter and extension_model_converter.
Author:
Nikolaj Bjorner (nbjorner) 2017-10-29
Notes:
--*/
#ifndef GENERIC_MODEL_CONVERTER_H_
#define GENERIC_MODEL_CONVERTER_H_
#include "tactic/model_converter.h"
class generic_model_converter : public model_converter {
enum instruction { HIDE, ADD };
struct entry {
func_decl_ref m_f;
expr_ref m_def;
instruction m_instruction;
entry(func_decl* f, expr* d, ast_manager& m, instruction i):
m_f(f, m), m_def(d, m), m_instruction(i) {}
};
ast_manager& m;
std::string m_orig;
vector<entry> m_entries;
obj_map<func_decl, unsigned> m_first_idx;
expr_ref simplify_def(entry const& e);
public:
generic_model_converter(ast_manager & m, char const* orig) : m(m), m_orig(orig) {}
~generic_model_converter() override;
void hide(expr* e) { SASSERT(is_app(e) && to_app(e)->get_num_args() == 0); hide(to_app(e)->get_decl()); }
void hide(func_decl * f) { m_entries.push_back(entry(f, nullptr, m, HIDE)); }
void add(func_decl * d, expr* e);
void add(expr * d, expr* e) { SASSERT(is_app(d) && to_app(d)->get_num_args() == 0); add(to_app(d)->get_decl(), e); }
void operator()(labels_vec & labels) override {}
void operator()(model_ref & md) override;
void cancel() override {}
void display(std::ostream & out) override;
model_converter * translate(ast_translation & translator) override;
void set_env(ast_pp_util* visitor) override;
void operator()(expr_ref& fml) override;
void get_units(obj_map<expr, bool>& units) override;
};
typedef ref<generic_model_converter> generic_model_converter_ref;
#endif
| [
"anhvvcs@gmail.com"
] | anhvvcs@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.